[TikiWiki-commits] [Git][tikiwiki/tiki][29.x] [BP][FIX] Trackers: restore multi-status toggle (Open/Pending/Closed) without...
"Doddy MATABARO \(@DoddyMatabaro\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <695b87b484325_2a25106b064372@gitlab-sidekiq-low-urgency-cpu-bound-v2-5bd8dbbcb-2wwxz.mail> |
Doddy MATABARO pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki Commits: 03ec1a10 by Doddy MATABARO at 2026-01-05T09:35:28+00:00 [BP][FIX] Trackers: restore multi-status toggle (Open/Pending/Closed) without... --- * [FIX] Trackers: restore multi-status toggle (Open/Pending/Closed) without... --- * [FIX] Trackers: Fix status button links when single status selected * [FIX] Trackers: restore multi-status toggle (Open/Pending/Closed) without modifiers; respect defaultStatus See merge request tikiwiki/tiki!8400 (cherry picked from commit a7feef665d0bdc720c91be5cf1a9b4df12f00cbc) 790190ff [FIX] Trackers: restore multi-status toggle (Open/Pending/Closed) without... 44ca36e1 [FIX] Trackers: Fix status button links when single status selected Co-authored-by: Doddy MATABARO <[email protected]> See merge request tikiwiki/tiki!9304 - - - - - 1 changed file: - tiki-view_tracker.php Changes: ===================================== tiki-view_tracker.php ===================================== @@ -179,19 +179,46 @@ if (isset($_REQUEST['status'])) { $sts = preg_split('//', $tracker_info["defaultStatus"], -1, PREG_SPLIT_NO_EMPTY); $_REQUEST['status'] = $tracker_info["defaultStatus"]; } else { - $sts = [ - 'o' - ]; + $sts = ['o']; $_REQUEST['status'] = 'o'; } + +/** + * Keep a consistent order for combined statuses, based on tracker’s declared statuses. + * Example typical order: ['o','p','c']. + */ +$statusOrder = array_keys($status_raw); + foreach ($status_raw as $let => $sta) { if (isset($sta['perm']) || ($my || $ours)) { - if (in_array($let, $sts)) { + // Visual state + if (in_array($let, $sts, true)) { $sta['class'] = 'statuson'; } else { $sta['class'] = 'statusoff'; } - $sta['statuslink'] = $let; + + // Build toggled set against current selection + $newSet = $sts; + + if (in_array($let, $newSet, true)) { + // Remove this status from the set + $newSet = array_values(array_diff($newSet, [$let])); + // If that would leave empty, show all OTHER statuses instead + if (empty($newSet)) { + $newSet = array_values(array_diff($statusOrder, [$let])); + } + } else { + // Add clicked status + $newSet[] = $let; + } + + // Normalize order to tracker's order, and ensure uniqueness + $newSet = array_values(array_intersect($statusOrder, $newSet)); + + // Link carries the combined status string (e.g. 'op', 'pc', 'opc', etc.) + $sta['statuslink'] = implode('', $newSet); + $status_types[$let] = $sta; } } View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/03ec1a10e4ea53c344127c9a3e5d1bcc3654bbed -- View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/03ec1a10e4ea53c344127c9a3e5d1bcc3654bbed You're receiving this email because of your account on gitlab.com. _______________________________________________ TikiWiki-cvs mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs