Refactored ttRoleHelper::getRoleByRank().
[timetracker.git] / time_edit.php
index 5670f19..17ba34b 100644 (file)
@@ -210,7 +210,8 @@ if ($user->isPluginEnabled('iv'))
 if ($user->can('manage_invoices') && $user->isPluginEnabled('ps'))
   $form->addInput(array('type'=>'checkbox','name'=>'paid','value'=>$cl_paid));
 $form->addInput(array('type'=>'hidden','name'=>'browser_today','value'=>'')); // User current date, which gets filled in on btn_save or btn_copy click.
-$form->addInput(array('type'=>'submit','name'=>'btn_save','onclick'=>'browser_today.value=get_date()','value'=>$i18n->get('button.save')));
+// TODO: improve on conditional confirmSave.
+$form->addInput(array('type'=>'submit','name'=>'btn_save','onclick'=>'browser_today.value=get_date();return(confirmSave())','value'=>$i18n->get('button.save')));
 $form->addInput(array('type'=>'submit','name'=>'btn_copy','onclick'=>'browser_today.value=get_date()','value'=>$i18n->get('button.copy')));
 $form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->get('label.delete')));
 
@@ -400,6 +401,9 @@ if ($request->isPost()) {
   }
 } // isPost
 
+// TODO: improve on conditional confirmSave.
+$smarty->assign('entry_date', $cl_date);
+
 $smarty->assign('client_list', $client_list);
 $smarty->assign('project_list', $project_list);
 $smarty->assign('task_list', $task_list);