if ($value == '24:00' || $value == '2400') return true;
if (preg_match('/^([0-1]{0,1}[0-9]|2[0-3]):?[0-5][0-9]$/', $value )) { // 0:00 - 23:59, 000 - 2359
- if ('00:00' == ttTimeHelper::normalizeDuration($value))
- return false;
return true;
}
if (preg_match('/^([0-1]{0,1}[0-9]|2[0-4])h?$/', $value )) { // 0, 1 ... 24
- if ('00:00' == ttTimeHelper::normalizeDuration($value))
- return false;
return true;
}
if (preg_match('/^([0-1]{0,1}[0-9]|2[0-3])?[.][0-9]{1,4}h?$/', $value )) { // decimal values like 0.5, 1.25h, ... .. 23.9999h
- if ('00:00' == ttTimeHelper::normalizeDuration($value))
- return false;
return true;
}
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.9.28.3522 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.9.29.3523 | 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>
{if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
<td valign='top'>{$record.project|escape:'html'}</td>
{/if}
- <td align='right' valign='top'>{if $record.duration == '0:00'}<font color="#ff0000">{/if}{$record.duration}{if $record.duration == '0:00'}</font>{/if}
+ <td align='right' valign='top'>{if ($record.duration == '0:00' && $record.start <> '')}<font color="#ff0000">{/if}{$record.duration}{if ($record.duration == '0:00' && $record.start <> '')}</font>{/if}</td>
<td align='center'>{if $record.invoice_id} {else}<a href='time_edit.php?id={$record.id}'>{$i18n.label.edit}</a>{/if}</td>
</tr>
{/foreach}
{if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
<td>{$time_rec.project_name|escape:'html'}</td>
{/if}
- <td align="right">{if $time_rec.duration<>'0:00'}{$time_rec.duration}{else}<font color="#ff0000">{$i18n.form.time.uncompleted}</font>{/if}</td>
+ <td align="right">{if ($time_rec.duration == '0:00' && $time_rec.start <> '')}<font color="#ff0000">{$i18n.form.time.uncompleted}</font>{else}{$time_rec.duration}{/if}</td>
<td>{if $time_rec.comment}{$time_rec.comment|escape:'html'}{else} {/if}</td>
</tr>
</table>
<td nowrap align='right' valign='top'>{if $record.start}{$record.start}{else} {/if}</td>
<td nowrap align='right' valign='top'>{if $record.finish}{$record.finish}{else} {/if}</td>
{/if}
- <td align='right' valign='top'>{if $record.duration <> '0:00'}{$record.duration}{else}<font color="#ff0000">{$i18n.form.time.uncompleted}</font>{/if}</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:'html'}{else} {/if}</td>
<td valign='top' align='center'>
{if $record.invoice_id}
{else}
<a href='time_edit.php?id={$record.id}'>{$i18n.label.edit}</a>
- {if $record.duration == '0:00'}
+ {if ($record.duration == '0:00' && $record.start <> '')}
<input type='hidden' name='record_id' value='{$record.id}'>
<input type='hidden' name='browser_date' value=''>
<input type='hidden' name='browser_time' value=''>
<td align="right">{if $time_rec.finish<>$time_rec.start}{$time_rec.finish}{else} {/if}</td>
{/if}
{if (($smarty.const.TYPE_DURATION == $user->record_type) || ($smarty.const.TYPE_ALL == $user->record_type))}
- <td align="right">{if $time_rec.duration<>'0:00'}{$time_rec.duration}{else}<font color="#ff0000">{$i18n.form.time.uncompleted}</font>{/if}</td>
+ <td align="right">{if ($time_rec.duration == '0:00' && $time_rec.start <> '')}<font color="#ff0000">{$i18n.form.time.uncompleted}</font>{else}{$time_rec.duration}{/if}</td>
{/if}
<td>{if $time_rec.comment}{$time_rec.comment|escape:'html'}{else} {/if}</td>
</tr>
if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode) {
if (!$cl_task) $err->add($i18n->getKey('error.task'));
}
- if (!$cl_duration) {
- if ('0' == $cl_duration)
- $err->add($i18n->getKey('error.field'), $i18n->getKey('label.duration'));
- elseif ($cl_start || $cl_finish) {
+ if (strlen($cl_duration) == 0) {
+ if ($cl_start || $cl_finish) {
if (!ttTimeHelper::isValidTime($cl_start))
$err->add($i18n->getKey('error.field'), $i18n->getKey('label.start'));
if ($cl_finish) {
$cl_billable = $time_rec['billable'];
// Add an info message to the form if we are editing an uncompleted record.
- if (($cl_start == $cl_finish) && ($cl_duration == '0:00')) {
+ if (strlen($cl_start) > 0 && $cl_start == $cl_finish && $cl_duration == '0:00') {
$cl_finish = '';
$cl_duration = '';
$msg->add($i18n->getKey('form.time_edit.uncompleted'));
if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode) {
if (!$cl_task) $err->add($i18n->getKey('error.task'));
}
- if (!$cl_duration) {
- if ('0' == $cl_duration)
- $err->add($i18n->getKey('error.field'), $i18n->getKey('label.duration'));
- elseif ($cl_start || $cl_finish) {
+ if (strlen($cl_duration) == 0) {
+ if ($cl_start || $cl_finish) {
if (!ttTimeHelper::isValidTime($cl_start))
$err->add($i18n->getKey('error.field'), $i18n->getKey('label.start'));
if ($cl_finish) {
$cl_billable = $time_rec['billable'];
// Add an info message to the form if we are editing an uncompleted record.
- if (($cl_start == $cl_finish) && ($cl_duration == '0:00')) {
+ if (strlen($cl_start) > 0 && $cl_start == $cl_finish && $cl_duration == '0:00') {
$cl_finish = '';
$cl_duration = '';
$msg->add($i18n->getKey('form.time_edit.uncompleted'));