X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/331afa6cc2e76915cbe7fce163803cbe5a93f9da..b6546c4547eb47a06f80b6d0ffa474d3929602f9:/display_options.php?ds=sidebyside diff --git a/display_options.php b/display_options.php new file mode 100644 index 00000000..222cc25d --- /dev/null +++ b/display_options.php @@ -0,0 +1,84 @@ +getConfig()); + +if ($request->isPost()) { + $cl_time_note_on_separate_row = trim($request->getParameter('time_note_on_separate_row')); + $cl_report_note_on_separate_row = trim($request->getParameter('report_note_on_separate_row')); +} else { + $cl_time_note_on_separate_row = $config->getDefinedValue('time_note_on_separate_row'); + $cl_report_note_on_separate_row = $config->getDefinedValue('report_note_on_separate_row'); +} + +$form = new Form('displayOptionsForm'); +// $form->addInput(array('type'=>'checkbox','name'=>'time_client','value'=>$cl_time_client)); +// $form->addInput(array('type'=>'checkbox','name'=>'time_cf_1','value'=>$cl_time_cf_1)); +// $form->addInput(array('type'=>'checkbox','name'=>'time_project','value'=>$cl_time_project)); +// $form->addInput(array('type'=>'checkbox','name'=>'time_task','value'=>$cl_time_task)); +// $form->addInput(array('type'=>'checkbox','name'=>'time_start','value'=>$cl_time_start)); +// $form->addInput(array('type'=>'checkbox','name'=>'time_finish','value'=>$cl_time_finish)); +// $form->addInput(array('type'=>'checkbox','name'=>'time_duration','value'=>$cl_time_duration)); +// $form->addInput(array('type'=>'checkbox','name'=>'time_note','value'=>$cl_time_note)); +$form->addInput(array('type'=>'checkbox','name'=>'time_note_on_separate_row','value'=>$cl_time_note_on_separate_row)); +// TODO: consider adding other fields (timesheet, work_units, invoice, approved, cost, paid)? + +// Reports. +$form->addInput(array('type'=>'checkbox','name'=>'report_note_on_separate_row','value'=>$cl_report_note_on_separate_row)); +// TODO: add PDF break controller here. + +$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save'))); + +if ($request->isPost()){ + if ($err->no()) { + // Update config. + $config->setDefinedValue('time_note_on_separate_row', $cl_time_note_on_separate_row); + $config->setDefinedValue('report_note_on_separate_row', $cl_report_note_on_separate_row); + if ($user->updateGroup(array('config' => $config->getConfig()))) { + header('Location: success.php'); + exit(); + } else + $err->add($i18n->get('error.db')); + } +} + +$smarty->assign('forms', array($form->getName()=>$form->toArray())); +$smarty->assign('title', $i18n->get('title.display_options')); +$smarty->assign('content_page_name', 'display_options.tpl'); +$smarty->display('index.tpl');