1 {include file="time_script.tpl"}
3 <p><span id="hour">00</span><span id="separator">:</span><span id="min">00</span>
10 var separatorVisible = true;
12 function toggleSeparator() {
13 document.getElementById('separator').style.visibility = separatorVisible ? 'hidden' : 'visible';
14 separatorVisible = !separatorVisible;
17 function updateTimer() {
18 if (startDate == null) startDate = new Date();
20 delta = new Date(endDate - startDate);
22 var hours = delta.getUTCHours();
23 if (hours < 10) hours = '0'+hours;
24 document.getElementById('hour').innerHTML = hours;
26 var minutes = delta.getUTCMinutes();
27 if (minutes < 10) minutes = '0'+minutes;
28 document.getElementById('min').innerHTML = minutes;
30 // Toggle visibility of separator for 100 ms.
32 setTimeout('toggleSeparator()', 100);
35 function startTimer() {
39 timerID = setInterval('updateTimer()', 1000);
42 function stopTimer() {
43 clearInterval(timerID);
50 startDate = new Date();
51 startDate.setHours({substr($uncompleted['start'], 0, 2)});
52 startDate.setMinutes({substr($uncompleted['start'], 3, 2)});
53 startDate.setSeconds(0);
59 {$forms.timeRecordForm.open}
60 <table cellspacing="4" cellpadding="7" border="0">
67 {if $user->isPluginEnabled('cl')}
68 <tr><td>{$i18n.label.client}:</td></tr>
69 <tr><td>{$forms.timeRecordForm.client.control}</td></tr>
71 {if $user->isPluginEnabled('iv')}
72 <tr><td><label>{$forms.timeRecordForm.billable.control}{$i18n.form.time.billable}</label></td></tr>
74 {if ($custom_fields && $custom_fields->fields[0])}
75 <tr><td>{$custom_fields->fields[0]['label']|escape}:</td></tr>
76 <tr><td>{$forms.timeRecordForm.cf_1.control}</td></tr>
78 {if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
79 <tr><td>{$i18n.label.project}:</td></tr>
80 <tr><td>{$forms.timeRecordForm.project.control}</td></tr>
82 {if ($smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
83 <tr><td>{$i18n.label.task}:</td></tr>
84 <tr><td>{$forms.timeRecordForm.task.control}</td></tr>
90 <td colspan="2" height="50" align="center">{$forms.timeRecordForm.btn_start.control} {$forms.timeRecordForm.btn_stop.control}</td>
96 {$forms.timeRecordForm.close}
98 <table cellspacing="3" cellpadding="0" border="0" width="100%">
104 <td align="right">{$i18n.label.day_total}:</td>
105 <td>{$day_total}</td>
108 <td align="right">{$i18n.label.week_total}:</td>
109 <td>{$week_total}</td>