<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.18.56.4849 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <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> |
<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"}
-{if $template_dropdown}
-<script>
-var templates = new Array();
-{foreach $templates as $template}
- templates[{$template.id}] = "{$template.content|escape:'javascript'}";
-{/foreach}
-
-// The fillNote function populates the Note field with a selected template body.
-function fillNote(id) {
- if (!id) return; // Do nothing.
- var template_body = templates[id];
- var note = document.getElementById("note");
- note.value = template_body;
-}
-</script>
-{/if}
-
<style>
.not_billable td {
color: #ff6666;
task_names[{$task.id}] = "{$task.name|escape:'javascript'}";
{/foreach}
+{if $template_dropdown}
+var templates = new Array();
+{foreach $templates as $template}
+ templates[{$template.id}] = "{$template.content|escape:'javascript'}";
+{/foreach}
+
+// The fillNote function populates the Note field with a selected template body.
+function fillNote(id) {
+ if (!id) return; // Do nothing.
+ var template_body = templates[id];
+ var note = document.getElementById("note");
+ note.value = template_body;
+}
+{/if}
+
// Mandatory top options for project and task dropdowns.
var empty_label_project = "{$i18n.dropdown.select|escape:'javascript'}";
var empty_label_task = "{$i18n.dropdown.select|escape:'javascript'}";
$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','style'=>'width: 250px; height: 200px;','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.