import('ttProjectHelper');
import('ttFavReportHelper');
import('ttClientHelper');
+import('ttReportHelper');
// Access check.
if (!(ttAccessAllowed('view_own_reports') || ttAccessAllowed('view_reports') || ttAccessAllowed('view_all_reports'))) {
// If we have a custom field - add a checkbox for it.
if ($custom_fields && $custom_fields->fields[0])
$form->addInput(array('type'=>'checkbox','name'=>'chcf_1'));
+if ($user->isPluginEnabled('wu'))
+ $form->addInput(array('type'=>'checkbox','name'=>'chunits'));
+
// Add group by control.
$group_by_options['no_grouping'] = $i18n->get('form.reports.group_by_no');
$group_by_options['date'] = $i18n->get('form.reports.group_by_date');
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'];
}
-$form->addInput(array('type'=>'combobox','onchange'=>'handleCheckboxes();','name'=>'group_by','data'=>$group_by_options));
+$group_by_options_size = sizeof($group_by_options);
+$form->addInput(array('type'=>'combobox','onchange'=>'handleCheckboxes();','name'=>'group_by1','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','name'=>'group_by2','data'=>$group_by_options));
+ if ($group_by_options_size > 3) $form->addInput(array('type'=>'combobox','name'=>'group_by3','data'=>$group_by_options));
+}
$form->addInput(array('type'=>'checkbox','name'=>'chtotalsonly'));
// Add text field for a new favorite report name.
$form->setValueByElement('chfinish', '1');
$form->setValueByElement('chnote', '1');
$form->setValueByElement('chcf_1', '0');
+ $form->setValueByElement('chunits', '0');
$form->setValueByElement('chtotalsonly', '0');
}
if ($start_date->compare($end_date) > 0)
$err->add($i18n->get('error.interval'), $i18n->get('label.end_date'), $i18n->get('label.start_date'));
}
-
- $bean->saveBean();
+ // Check remaining values.
+ if (!ttReportHelper::verifyBean($bean)) $err->add($i18n->get('error.sys'));
if ($err->no()) {
+ $bean->saveBean();
// Now we can go ahead and create a report.
header('Location: report.php');
exit();