var $allow_overlap = 0; // Whether to allow overlapping time entries.
var $future_entries = 0; // Whether to allow creating future entries.
var $uncompleted_indicators = 0; // Uncompleted time entry indicators (show nowhere or on users page).
+ var $confirm_save = 1; // Work in progress. TODO: change default to 0 and get from group config upon init.
var $bcc_email = null; // Bcc email.
var $allow_ip = null; // Specification from where user is allowed access.
var $password_complexity = null; // Password complexity example.
// Warning messages.
'warn.sure' => 'Вы уверены?',
-'warn.confirm_save' => 'Дата изменена. Подвердите сохранение, а не копирование этой записи.',
+'warn.confirm_save' => 'Дата изменена. Подтвердите сохранение, а не копирование записи.',
// Success messages.
'msg.success' => 'Операция завершена успешно.',
idx++;
{/foreach}
+// TODO: improve on conditional confirmSave.
+// Existing entry date for confirm save warnings.
+var original_date = "{$entry_date}";
+
+function confirmSave() {
+ var date_on_save = document.getElementById("date").value;
+ if (original_date != date_on_save) {
+ return confirm("{$i18n.warn.confirm_save}");
+ }
+}
+// TODO: improve on conditional confirmSave above.
+
// The fillProjectDropdown function populates the project combo box with
// projects associated with a selected client (client id is passed here as id).
function fillProjectDropdown(id) {
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.18.28.4541 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.18.28.4542 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
<a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
<a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
<a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
{include file="time_script.tpl"}
+<script>
+// TODO: improve on conditional confirmSave.
+// Existing entry date for confirm save warnings.
+var original_date = "{$entry_date}";
+
+function confirmSave() {
+ var date_on_save = document.getElementById("date").value;
+ if (original_date != date_on_save) {
+ return confirm("{$i18n.warn.confirm_save}");
+ }
+}
+// TODO: improve on conditional confirmSave above.
+</script>
+
{$forms.timeRecordForm.open}
<table cellspacing="4" cellpadding="7" border="0">
<tr>
// Hidden control for record id.
$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_id));
$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')));
}
} // isPost
+// TODO: improve on conditional confirmSave.
+$smarty->assign('entry_date', $cl_date);
+
$smarty->assign('predefined_expenses', $predefined_expenses);
$smarty->assign('client_list', $client_list);
$smarty->assign('project_list', $project_list);
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')));
}
} // 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);