diff --git a/Controller/ConfigController.php b/Controller/ConfigController.php index f984767..a07811d 100644 --- a/Controller/ConfigController.php +++ b/Controller/ConfigController.php @@ -18,6 +18,7 @@ class ConfigController extends BaseController 'organon_tweaks_keep_scroll' => (int) $this->configModel->get('organon_tweaks_keep_scroll', 1), 'organon_tweaks_quick_click_only' => (int) $this->configModel->get('organon_tweaks_quick_click_only', 1), 'organon_tweaks_enhance_recurrence' => (int) $this->configModel->get('organon_tweaks_enhance_recurrence', 1), + 'organon_tweaks_emphasize_duedate_default' => (int) $this->configModel->get('organon_tweaks_emphasize_duedate_default', 0), ), 'errors' => array(), ))); @@ -30,11 +31,13 @@ class ConfigController extends BaseController $alwaysCommentIcon = isset($values['organon_tweaks_always_comment_icon']) ? 1 : 0; $keepScroll = isset($values['organon_tweaks_keep_scroll']) ? 1 : 0; $quickClickOnly = isset($values['organon_tweaks_quick_click_only']) ? 1 : 0; + $emphasizeDueDateDefault = isset($values['organon_tweaks_emphasize_duedate_default']) ? 1 : 0; if ($this->configModel->save(array( 'organon_tweaks_always_comment_icon' => $alwaysCommentIcon, 'organon_tweaks_keep_scroll' => $keepScroll, 'organon_tweaks_quick_click_only' => $quickClickOnly, + 'organon_tweaks_emphasize_duedate_default' => $emphasizeDueDateDefault, ))) { $this->flash->success(t('Settings saved successfully.')); } else { diff --git a/Helper/OrganonProjectHelper.php b/Helper/OrganonProjectHelper.php new file mode 100644 index 0000000..26a73d0 --- /dev/null +++ b/Helper/OrganonProjectHelper.php @@ -0,0 +1,45 @@ + on, '0' -> off, 'default'/absent -> follow the LIVE global default. + */ +class OrganonProjectHelper extends Base +{ + const EMPHASIZE_KEY = 'organon_tweaks_emphasize_duedate'; + const EMPHASIZE_DEFAULT_KEY = 'organon_tweaks_emphasize_duedate_default'; + + /** + * Should the current board emphasize the due date? Board pages only (project_id in the route). + * + * @return bool + */ + public function isEmphasizeDueDate() + { + $project_id = $this->request->getIntegerParam('project_id'); + + if ($project_id <= 0) { + return false; + } + + $value = $this->projectMetadataModel->get($project_id, self::EMPHASIZE_KEY, 'default'); + + if ($value === '1') { + return true; + } + + if ($value === '0') { + return false; + } + + // 'default' (or absent) -> follow the live global default. + return (int) $this->configModel->get(self::EMPHASIZE_DEFAULT_KEY, 0) === 1; + } +} diff --git a/Plugin.php b/Plugin.php index 4819282..2bfbe29 100644 --- a/Plugin.php +++ b/Plugin.php @@ -20,6 +20,13 @@ class Plugin extends Base // Settings page for the plugin's tweaks. $this->template->hook->attach('template:config:sidebar', 'organonTweaks:config/sidebar'); + // Per-board tweak: emphasize the due date on the board. Configured with 3-state radios on the + // board's Settings -> Integrations (Use default / Always on / Always off); the global default + // (for "Use default" boards) lives in the plugin settings above. The emphasis + diff --git a/Template/project/integration.php b/Template/project/integration.php new file mode 100644 index 0000000..e4e0273 --- /dev/null +++ b/Template/project/integration.php @@ -0,0 +1,24 @@ + + +

+
+

+ + + + + +

+ +

+
+ +
+ +
diff --git a/VERSION b/VERSION index 7d165b4..36d103a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -OrganonTweaks v1.3.3 +OrganonTweaks v1.4