Work in progress on multiple group by options in reports.
authorNik Okuntseff <support@anuko.com>
Sun, 28 Oct 2018 15:24:34 +0000 (15:24 +0000)
committerNik Okuntseff <support@anuko.com>
Sun, 28 Oct 2018 15:25:08 +0000 (15:25 +0000)
WEB-INF/templates/reports.tpl
reports.php

index af67478..290e224 100644 (file)
@@ -296,10 +296,15 @@ function handleCheckboxes() {
           </td>
         </tr>
         <tr>
-          <td><b>{$i18n.form.reports.group_by}</b></td>
+            <td><b>{$i18n.form.reports.group_by}</b></td>
         </tr>
         <tr valign="top">
-          <td>{$forms.reportForm.group_by.control} <label>{$forms.reportForm.chtotalsonly.control} {$i18n.label.totals_only}</label></td>
+          <td>{$forms.reportForm.group_by.control}</td>
+          <td>{$forms.reportForm.group_by2.control}</td>
+          <td>{$forms.reportForm.group_by3.control}</td>
+        </tr>
+        <tr>
+          <td><label>{$forms.reportForm.chtotalsonly.control} {$i18n.label.totals_only}</label></td>
         </tr>
       </table>
 
index a282532..ae5c937 100644 (file)
@@ -232,7 +232,12 @@ if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode)
 if ($custom_fields && $custom_fields->fields[0] && $custom_fields->fields[0]['type'] == CustomFields::TYPE_DROPDOWN) {
   $group_by_options['cf_1'] = $custom_fields->fields[0]['label'];
 }
+$group_by_options_size = sizeof($group_by_options);
 $form->addInput(array('type'=>'combobox','onchange'=>'handleCheckboxes();','name'=>'group_by','data'=>$group_by_options));
+if (defined('MULTIPLE_GROUP_BY_DEBUG') && isTrue(MULTIPLE_GROUP_BY_DEBUG)) {
+  if ($group_by_options_size > 2) $form->addInput(array('type'=>'combobox','onchange'=>'handleCheckboxes();','name'=>'group_by2','data'=>$group_by_options));
+  if ($group_by_options_size > 3) $form->addInput(array('type'=>'combobox','onchange'=>'handleCheckboxes();','name'=>'group_by3','data'=>$group_by_options));
+}
 $form->addInput(array('type'=>'checkbox','name'=>'chtotalsonly'));
 
 // Add text field for a new favorite report name.