projects
/
timetracker.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
ad70734
)
As suggested in PR#33, allowed entry of decimal values with a comma for teams with...
author
anuko
<support@anuko.com>
Mon, 10 Jul 2017 00:01:34 +0000
(
00:01
+0000)
committer
anuko
<support@anuko.com>
Mon, 10 Jul 2017 00:01:34 +0000
(
00:01
+0000)
WEB-INF/lib/ttClientHelper.class.php
patch
|
blob
|
history
WEB-INF/lib/ttTimeHelper.class.php
patch
|
blob
|
history
WEB-INF/templates/footer.tpl
patch
|
blob
|
history
WEB-INF/templates/time.tpl
patch
|
blob
|
history
WEB-INF/templates/time_edit.tpl
patch
|
blob
|
history
diff --git
a/WEB-INF/lib/ttClientHelper.class.php
b/WEB-INF/lib/ttClientHelper.class.php
index
c77dae0
..
14788ae
100644
(file)
--- a/
WEB-INF/lib/ttClientHelper.class.php
+++ b/
WEB-INF/lib/ttClientHelper.class.php
@@
-286,7
+286,7
@@
class ttClientHelper {
$sql = "select distinct c.id, c.name, c.projects from tt_user_project_binds upb
inner join tt_client_project_binds cpb on (cpb.project_id = upb.project_id)
inner join tt_clients c on (c.id = cpb.client_id and c.status = 1)
$sql = "select distinct c.id, c.name, c.projects from tt_user_project_binds upb
inner join tt_client_project_binds cpb on (cpb.project_id = upb.project_id)
inner join tt_clients c on (c.id = cpb.client_id and c.status = 1)
- where upb.user_id = $user_id and upb.status = 1 order by
c.name
";
+ where upb.user_id = $user_id and upb.status = 1 order by
upper(c.name)
";
$res = $mdb2->query($sql);
if (!is_a($res, 'PEAR_Error')) {
$res = $mdb2->query($sql);
if (!is_a($res, 'PEAR_Error')) {
diff --git
a/WEB-INF/lib/ttTimeHelper.class.php
b/WEB-INF/lib/ttTimeHelper.class.php
index
a2dade9
..
13a2d83
100644
(file)
--- a/
WEB-INF/lib/ttTimeHelper.class.php
+++ b/
WEB-INF/lib/ttTimeHelper.class.php
@@
-92,7
+92,10
@@
class ttTimeHelper {
if (preg_match('/^([0-1]{0,1}[0-9]|2[0-4])h?$/', $value )) { // 0, 1 ... 24
return true;
}
if (preg_match('/^([0-1]{0,1}[0-9]|2[0-4])h?$/', $value )) { // 0, 1 ... 24
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
+
+ global $user;
+ $localizedPattern = '/^([0-1]{0,1}[0-9]|2[0-3])?['.$user->decimal_mark.'][0-9]{1,4}h?$/';
+ if (preg_match($localizedPattern, $value )) { // decimal values like 0.5, 1.25h, ... .. 23.9999h (or with comma)
return true;
}
return true;
}
@@
-104,6
+107,10
@@
class ttTimeHelper {
$time_value = $value;
// If we have a decimal format - convert to time format 00:00.
$time_value = $value;
// If we have a decimal format - convert to time format 00:00.
+ global $user;
+ if ($user->decimal_mark == ',')
+ $time_value = str_replace (',', '.', $time_value);
+
if((strpos($time_value, '.') !== false) || (strpos($time_value, 'h') !== false)) {
$val = floatval($time_value);
$mins = round($val * 60);
if((strpos($time_value, '.') !== false) || (strpos($time_value, 'h') !== false)) {
$val = floatval($time_value);
$mins = round($val * 60);
diff --git
a/WEB-INF/templates/footer.tpl
b/WEB-INF/templates/footer.tpl
index
24c305e
..
3ea7a01
100644
(file)
--- a/
WEB-INF/templates/footer.tpl
+++ b/
WEB-INF/templates/footer.tpl
@@
-12,7
+12,7
@@
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.11.44.36
39
| Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.11.44.36
40
| 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>
<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>
diff --git
a/WEB-INF/templates/time.tpl
b/WEB-INF/templates/time.tpl
index
8328ab4
..
25fc81c
100644
(file)
--- a/
WEB-INF/templates/time.tpl
+++ b/
WEB-INF/templates/time.tpl
@@
-59,7
+59,7
@@
{if (($smarty.const.TYPE_DURATION == $user->record_type) || ($smarty.const.TYPE_ALL == $user->record_type))}
<tr>
<td align="right">{$i18n.label.duration}:</td>
{if (($smarty.const.TYPE_DURATION == $user->record_type) || ($smarty.const.TYPE_ALL == $user->record_type))}
<tr>
<td align="right">{$i18n.label.duration}:</td>
- <td>{$forms.timeRecordForm.duration.control} {
$i18n.form.time.duration_format
}</td>
+ <td>{$forms.timeRecordForm.duration.control} {
if $user->decimal_mark == ','}{str_replace('.', ',', $i18n.form.time.duration_format)}{else}{$i18n.form.time.duration_format}{/if
}</td>
</tr>
{/if}
</table>
</tr>
{/if}
</table>
diff --git
a/WEB-INF/templates/time_edit.tpl
b/WEB-INF/templates/time_edit.tpl
index
f693215
..
9a13d4c
100644
(file)
--- a/
WEB-INF/templates/time_edit.tpl
+++ b/
WEB-INF/templates/time_edit.tpl
@@
-50,7
+50,7
@@
{if (($smarty.const.TYPE_DURATION == $user->record_type) || ($smarty.const.TYPE_ALL == $user->record_type))}
<tr>
<td align="right">{$i18n.label.duration}:</td>
{if (($smarty.const.TYPE_DURATION == $user->record_type) || ($smarty.const.TYPE_ALL == $user->record_type))}
<tr>
<td align="right">{$i18n.label.duration}:</td>
- <td>{$forms.timeRecordForm.duration.control} {
$i18n.form.time.duration_format
}</td>
+ <td>{$forms.timeRecordForm.duration.control} {
if $user->decimal_mark == ','}{str_replace('.', ',', $i18n.form.time.duration_format)}{else}{$i18n.form.time.duration_format}{/if
}</td>
</tr>
{/if}
<tr>
</tr>
{/if}
<tr>