{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;
<td align="right">{$i18n.label.duration}:</td>
<td>{$forms.timeRecordForm.duration.control} {if $user->getDecimalMark() == ','}{str_replace('.', ',', $i18n.form.time.duration_format)}{else}{$i18n.form.time.duration_format}{/if}</td>
</tr>
+{/if}
+{if $template_dropdown}
+ <tr>
+ <td align="right">{$i18n.label.template}:</td>
+ <td>{$forms.timeRecordForm.template.control}</td>
+ </tr>
{/if}
</table>
</td>
<td align="right" valign="top">{if ($record.duration == '0:00' && $record.start <> '')}<font color="#ff0000">{$i18n.form.time.uncompleted}</font>{else}{$record.duration}{/if}</td>
<td valign="top">{if $record.comment}{$record.comment|escape}{else} {/if}</td>
<td valign="top" align="center">
- {if $record.invoice_id}
+ {if $record.approved || $record.timesheet_id || $record.invoice_id}
{else}
<a href="time_edit.php?id={$record.id}">{$i18n.label.edit}</a>