As suggested in PR#33, allowed entry of decimal values with a comma for teams with...
[timetracker.git] / profile_edit.php
index 9fac75f..11ca295 100644 (file)
@@ -59,6 +59,8 @@ if ($request->isPost()) {
     $cl_custom_format_time = $request->getParameter('format_time');
     $cl_start_week = $request->getParameter('start_week');
     $cl_tracking_mode = $request->getParameter('tracking_mode');
+    $cl_project_required = $request->getParameter('project_required');
+    $cl_task_required = $request->getParameter('task_required');
     $cl_record_type = $request->getParameter('record_type');
     $cl_uncompleted_indicators = $request->getParameter('uncompleted_indicators');
     $cl_charts = $request->getParameter('charts');
@@ -86,6 +88,8 @@ if ($request->isPost()) {
     $cl_custom_format_time = $user->time_format;
     $cl_start_week = $user->week_start;
     $cl_tracking_mode = $user->tracking_mode;
+    $cl_project_required = $user->project_required;
+    $cl_task_required = $user->task_required;
     $cl_record_type = $user->record_type;
     $cl_uncompleted_indicators = $user->uncompleted_indicators;
 
@@ -161,7 +165,9 @@ if ($user->canManageTeam()) {
   $tracking_mode_options[MODE_TIME] = $i18n->getKey('form.profile.mode_time');
   $tracking_mode_options[MODE_PROJECTS] = $i18n->getKey('form.profile.mode_projects');
   $tracking_mode_options[MODE_PROJECTS_AND_TASKS] = $i18n->getKey('form.profile.mode_projects_and_tasks');
-  $form->addInput(array('type'=>'combobox','name'=>'tracking_mode','style'=>'width: 150px;','data'=>$tracking_mode_options,'value'=>$cl_tracking_mode));
+  $form->addInput(array('type'=>'combobox','name'=>'tracking_mode','style'=>'width: 150px;','data'=>$tracking_mode_options,'value'=>$cl_tracking_mode,'onchange'=>'handleTaskRequiredCheckbox()'));
+  $form->addInput(array('type'=>'checkbox','name'=>'project_required','value'=>$cl_project_required));
+  $form->addInput(array('type'=>'checkbox','name'=>'task_required','value'=>$cl_task_required));
 
   // Prepare record type choices.
   $record_type_options = array();
@@ -251,6 +257,8 @@ if ($request->isPost()) {
         'time_format' => $cl_custom_format_time,
         'week_start' => $cl_start_week,
         'tracking_mode' => $cl_tracking_mode,
+        'project_required' => $cl_project_required,
+        'task_required' => $cl_task_required,
         'record_type' => $cl_record_type,
         'uncompleted_indicators' => $cl_uncompleted_indicators,
         'plugins' => $plugins));
@@ -273,7 +281,7 @@ if ($request->isPost()) {
 
 $smarty->assign('auth_external', $auth->isPasswordExternal());
 $smarty->assign('forms', array($form->getName()=>$form->toArray()));
-$smarty->assign('onload', 'onLoad="handlePluginCheckboxes()"');
+$smarty->assign('onload', 'onLoad="handleTaskRequiredCheckbox(); handlePluginCheckboxes();"');
 $smarty->assign('title', $i18n->getKey('title.profile'));
 $smarty->assign('content_page_name', 'profile_edit.tpl');
 $smarty->display('index.tpl');