<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.18.56.4850 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.18.56.4851 | 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>
<tr><td>{$i18n.label.duration}:</td></tr>
<tr><td>{$forms.timeRecordForm.duration.control}</td></tr>
{/if}
+{if $template_dropdown}
+ <tr><td>{$i18n.label.template}:</td></tr>
+ <tr><td>{$forms.timeRecordForm.template.control}</td></tr>
+{/if}
<tr><td>{$i18n.label.note}:</td></tr>
<tr><td>{$forms.timeRecordForm.note.control}</td></tr>
{/if}
<tr><td>{$i18n.label.date}:</td></tr>
<tr><td>{$forms.timeRecordForm.date.control}</td></tr>
+{if $template_dropdown}
+ <tr><td>{$i18n.label.template}:</td></tr>
+ <tr><td>{$forms.timeRecordForm.template.control}</td></tr>
+{/if}
<tr><td>{$i18n.label.note}:</td></tr>
<tr><td>{$forms.timeRecordForm.note.control}</td></tr>
<tr><td align="center">{$forms.timeRecordForm.btn_save.control} {$forms.timeRecordForm.btn_copy.control} {$forms.timeRecordForm.btn_delete.control}</td></tr>
}
}
+// If we have templates, add a dropdown to select one.
+if ($user->isPluginEnabled('tp')){
+ $templates = ttGroupHelper::getActiveTemplates();
+ if (count($templates) >= 1) {
+ $form->addInput(array('type'=>'combobox',
+ 'onchange'=>'fillNote(this.value);',
+ 'name'=>'template',
+ 'style'=>'width: 250px;',
+ 'data'=>$templates,
+ 'datakeys'=>array('id','name'),
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
+ $smarty->assign('template_dropdown', 1);
+ $smarty->assign('templates', $templates);
+ }
+}
+
// Submit.
if ($request->isPost()) {
if ($request->getParameter('btn_submit')) {
$err->add($i18n->get('error.field'), $i18n->get('label.duration'));
}
if (!ttValidString($cl_note, true)) $err->add($i18n->get('error.field'), $i18n->get('label.note'));
+ if ($user->isPluginEnabled('tp') && strpos($cl_note, '%req%') !== false) {
+ // A %req% element is found in note. They have to be replaced by user.
+ $err->add($i18n->get('error.field'), $i18n->get('label.note'));
+ }
if (!ttTimeHelper::canAdd()) $err->add($i18n->get('error.expired'));
// Finished validating user input.
$form->addInput(array('type'=>'text','name'=>'duration','value'=>$cl_duration,'onchange'=>"formDisable('duration');"));
$form->addInput(array('type'=>'datefield','name'=>'date','maxlength'=>'20','value'=>$cl_date));
$form->addInput(array('type'=>'textarea','name'=>'note','class'=>'mobile-textarea','value'=>$cl_note));
+
// If we have custom fields - add controls for them.
if ($custom_fields && $custom_fields->fields[0]) {
// Only one custom field is supported at this time.
'empty' => array('' => $i18n->get('dropdown.select'))));
}
}
+
+// If we have templates, add a dropdown to select one.
+if ($user->isPluginEnabled('tp')){
+ $templates = ttGroupHelper::getActiveTemplates();
+ if (count($templates) >= 1) {
+ $form->addInput(array('type'=>'combobox',
+ 'onchange'=>'fillNote(this.value);',
+ 'name'=>'template',
+ 'style'=>'width: 250px;',
+ 'data'=>$templates,
+ 'datakeys'=>array('id','name'),
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
+ $smarty->assign('template_dropdown', 1);
+ $smarty->assign('templates', $templates);
+ }
+}
+
// Hidden control for record id.
$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_id));
if ($user->isPluginEnabled('iv'))
}
if (!ttValidDate($cl_date)) $err->add($i18n->get('error.field'), $i18n->get('label.date'));
if (!ttValidString($cl_note, true)) $err->add($i18n->get('error.field'), $i18n->get('label.note'));
+ if ($user->isPluginEnabled('tp') && strpos($cl_note, '%req%') !== false) {
+ // A %req% element is found in note. They have to be replaced by user.
+ $err->add($i18n->get('error.field'), $i18n->get('label.note'));
+ }
if (!ttTimeHelper::canAdd()) $err->add($i18n->get('error.expired'));
// Finished validating user input.