[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] Fix the group and color parameters of the trackertimeline plugin, and...
"franck franck kalunga \(@francksfkal\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <6898f51083b5_2cd60ec94525@gitlab-sidekiq-low-urgency-cpu-bound-v2-fc86f445f-9x4b8.mail> |
franck franck kalunga pushed to branch master at Tiki Wiki CMS Groupware / Tiki
Commits:
f7596fd2 by franck franck kalunga at 2025-08-10T19:30:01+00:00
[FIX] Fix the group and color parameters of the trackertimeline plugin, and make the end parameter be optional
---
* [FIX] Fix the group and color parameters of the trackertimeline plugin, and make the end parameter optional
See merge request tikiwiki/tiki!8257
- - - - -
1 changed file:
- lib/wiki-plugins/wikiplugin_trackertimeline.php
Changes:
=====================================
lib/wiki-plugins/wikiplugin_trackertimeline.php
=====================================
@@ -289,14 +289,6 @@ function wikiplugin_trackertimeline($data, $params)
$fieldIds[ $params['step'] ] = 'step';
}
- if (isset($params['group'])) {
- $fieldIds[ $params['group'] ] = 'group';
- }
-
- if (isset($params['color'])) {
- $fieldIds[ $params['color'] ] = 'color';
- }
-
if (isset($params['type'])) {
$fieldIds[ $params['type'] ] = 'type';
}
@@ -305,9 +297,12 @@ function wikiplugin_trackertimeline($data, $params)
$params['title'] => 'title',
$params['summary'] => 'summary',
$params['start'] => 'start',
- $params['end'] => 'end',
];
+ if (isset($params['end'])) {
+ $fieldIds[ $params['end'] ] = 'end';
+ }
+
if (isset($params['link_page'])) {
$fieldIds[ $params['link_page'] ] = 'link_page';
}
@@ -316,6 +311,14 @@ function wikiplugin_trackertimeline($data, $params)
$fieldIds[ $params['image_field'] ] = 'image';
}
+ if (isset($params['color'])) {
+ $fieldIds[ $params['color'] ] = 'color';
+ }
+
+ if (isset($params['group'])) {
+ $fieldIds[ $params['group'] ] = 'group';
+ }
+
$fields = [];
foreach ($fieldIds as $id => $label) {
$fields[$id] = $trklib->get_tracker_field($id);
@@ -336,7 +339,6 @@ function wikiplugin_trackertimeline($data, $params)
$detailSummary = $detail['summary'] ?? null;
$detailGroup = $detail['group'] ?? null;
$detail['encoded'] = json_encode($detail);
-
// Add to data list
if (! array_key_exists($detailGroup, $data)) {
$data[$detailGroup] = [];
@@ -413,7 +415,7 @@ function wikiplugin_trackertimeline($data, $params)
'events' => $events,
];
}
- $js .= 'var data = ' . json_encode($events) . "; const options = {};";
+ $js .= 'var data = ' . json_encode($events) . "; const options = {}; console.log(data);";
$js .= ! empty($start) ? "let start = new Date(" . $start * 1000 . "); options.start = start;" : "";
$js .= ! empty($end) ? "let end = new Date(" . $end * 1000 . "); options.end = end;" : "";
$js .= ! empty($params['height']) ? "let height = '" . $params['height'] . "';options.height = height;" : "";
@@ -428,7 +430,7 @@ function wikiplugin_trackertimeline($data, $params)
groupsOption.push({id: arrayOfGroupWithoutDuplication[i], content: arrayOfGroupWithoutDuplication[i]})
};\n;
";
- $js .= ! empty($params['group']) ? "var groups = " . json_encode($groups) . ";\n" . $codeHandleGroupParameter : "";
+ $js .= ! empty($params['group']) ? "var groups = " . json_encode($groups) . ";console.log('franck'); console.log('$groups');\n" . $codeHandleGroupParameter : "";
$js .= "const container = document.getElementById('container-timeline');\n";
$js .= "const items = new DataSet(data);";
$js .= ! empty($params['group']) ? "const timeline = new Timeline(container, items, groupsOption, options);" : "const timeline = new Timeline(container, items, options);";
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/f7596fd2781fb13590d17ab52c4db9b5e94201bc
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/f7596fd2781fb13590d17ab52c4db9b5e94201bc
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