[TikiWiki-commits] [Git][tikiwiki/tiki][27.x] [BP][FIX] Trackers: restore multi-status toggle (Open/Pending/Closed) without...
"luci \(@luciash\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <69b153521997d_3bf48d50799e4@gitlab-sidekiq-low-urgency-cpu-bound-v2-69874456c-grgbd.mail> |
luci pushed to branch 27.x at Tiki Wiki CMS Groupware / Tiki Commits: 4b942c87 by Doddy MATABARO at 2026-03-11T11:27:07+00:00 [BP][FIX] Trackers: restore multi-status toggle (Open/Pending/Closed) without... --- * [BP][FIX] Trackers: restore multi-status toggle (Open/Pending/Closed) without... --- * [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 See merge request tikiwiki/tiki!9323 * Revert "[BP][FIX] Trackers: restore multi-status toggle (Open/Pending/Closed) without..." This reverts commit e90ecda10e5aefaafed4d910a35396f7ea5b5360. * [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 See merge request tikiwiki/tiki!9313 - - - - - 1 changed file: - tiki-view_tracker.php Changes: ===================================== tiki-view_tracker.php ===================================== @@ -151,20 +151,48 @@ 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'; $sta['statuslink'] = $let; } 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/4b942c879a43777379bd13c2f8a5576ec7dc0962 -- View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/4b942c879a43777379bd13c2f8a5576ec7dc0962 You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help _______________________________________________ TikiWiki-cvs mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs