fix Always-off (on/off/default safe values) + bump emphasis to 1.375em (v1.4.2)

This commit is contained in:
2026-07-08 13:03:35 -03:00
parent d1178bc463
commit 8a97c5cb94
5 changed files with 13 additions and 9 deletions

View File

@@ -9,7 +9,11 @@ use Kanboard\Core\Base;
*
* Resolves the 3-state "emphasize due date" setting for the CURRENT board (read from the route
* project_id, which the router populates for pretty URLs before the layout renders):
* per-board '1' -> on, '0' -> off, 'default'/absent -> follow the LIVE global default.
* per-board 'on' -> on, 'off' -> off, 'default'/absent -> follow the LIVE global default.
*
* The stored values are the non-falsy strings 'on'/'off' (not '1'/'0'): Kanboard's
* MetadataModel::get() uses `?:`, and PHP treats the string "0" as falsy, so a stored "0" would
* come back as the 'default' fallback and "Always off" would never be honored.
*/
class OrganonProjectHelper extends Base
{
@@ -31,11 +35,11 @@ class OrganonProjectHelper extends Base
$value = $this->projectMetadataModel->get($project_id, self::EMPHASIZE_KEY, 'default');
if ($value === '1') {
if ($value === 'on') {
return true;
}
if ($value === '0') {
if ($value === 'off') {
return false;
}

View File

@@ -83,7 +83,7 @@ class Plugin extends Base
public function getPluginVersion()
{
return '1.4.1';
return '1.4.2';
}
public function getPluginHomepage()

View File

@@ -1,3 +1,3 @@
<?php if ($this->OrganonProjectHelper->isEmphasizeDueDate()): ?>
<style>.task-date { font-size: 1.25em; font-weight: bold; }</style>
<style>.task-date { font-size: 1.375em; font-weight: bold; }</style>
<?php endif ?>

View File

@@ -1,4 +1,4 @@
<?php $choice = isset($values['organon_tweaks_emphasize_duedate']) && in_array($values['organon_tweaks_emphasize_duedate'], array('1', '0'), true) ? $values['organon_tweaks_emphasize_duedate'] : 'default' ?>
<?php $choice = isset($values['organon_tweaks_emphasize_duedate']) && in_array($values['organon_tweaks_emphasize_duedate'], array('on', 'off'), true) ? $values['organon_tweaks_emphasize_duedate'] : 'default' ?>
<h3><i class="fa fa-umbrella fa-fw" aria-hidden="true"></i> <?= t('OrganonTweaks') ?></h3>
<div class="listing">
@@ -8,10 +8,10 @@
<input type="radio" name="organon_tweaks_emphasize_duedate" value="default" <?= $choice === 'default' ? 'checked="checked"' : '' ?>> <?= t('Use default') ?>
</label>
<label style="display:inline-block; margin-right:16px;">
<input type="radio" name="organon_tweaks_emphasize_duedate" value="1" <?= $choice === '1' ? 'checked="checked"' : '' ?>> <?= t('Always on') ?>
<input type="radio" name="organon_tweaks_emphasize_duedate" value="on" <?= $choice === 'on' ? 'checked="checked"' : '' ?>> <?= t('Always on') ?>
</label>
<label style="display:inline-block; margin-right:16px;">
<input type="radio" name="organon_tweaks_emphasize_duedate" value="0" <?= $choice === '0' ? 'checked="checked"' : '' ?>> <?= t('Always off') ?>
<input type="radio" name="organon_tweaks_emphasize_duedate" value="off" <?= $choice === 'off' ? 'checked="checked"' : '' ?>> <?= t('Always off') ?>
</label>
<p class="form-help">

View File

@@ -1 +1 @@
OrganonTweaks v1.4.1
OrganonTweaks v1.4.2