diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0260effebc6..bca87c7a65f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5041,7 +5041,7 @@ class Form } elseif ($typehour=='text' || $typehour=='textselect') { - $retstring.=''; + $retstring.=''; } else return 'BadValueForParameterTypeHour'; @@ -5065,7 +5065,7 @@ class Form } elseif ($typehour=='text' ) { - $retstring.=''; + $retstring.=''; } if ($typehour!='text') $retstring.=' '.$langs->trans('MinuteShort'); diff --git a/htdocs/core/js/timesheet.js b/htdocs/core/js/timesheet.js index 5541f348c9f..a55424f8e8c 100644 --- a/htdocs/core/js/timesheet.js +++ b/htdocs/core/js/timesheet.js @@ -163,6 +163,56 @@ function updateTotal(days,mode) } } } + + // Add data on the perday view + jQuery('.inputhour').each(function( index ) { + if (this.value) + { + var taskTime= new Date(0); + /*console.log(total.getHours()) + console.log(this.value) + alert(element.value);*/ + if (this.value) + { + console.log(this.value+':00') + result=parseTime(this.value+':00',taskTime); + } + else + { + result=parseTime(this.innerHTML+':00',taskTime); + } + if (result >= 0) + { + total.setHours(total.getHours()+taskTime.getHours()); + } + console.log(total.getHours()) + } + }); + // Add data on the perday view + jQuery('.inputminute').each(function( index ) { + if (this.value) + { + var taskTime= new Date(0); + /* console.log(total.getHours()) + console.log(this.value) + alert(element.value);*/ + if (this.value) + { + console.log('00:'+this.value) + result=parseTime('00:'+"00".substring(0, 2 - this.value.length) + this.value,taskTime); + } + else + { + result=parseTime('00:'+"00".substring(0, 2 - this.innerHTML) + this.innerHTML,taskTime); + } + if (result >= 0) + { + total.setMinutes(total.getMinutes()+taskTime.getMinutes()); + } + console.log(total.getMinutes()) + } + }); + if (document.getElementById('totalDay['+days+']')) // May be null if no task records to output (nbline is also 0 in this case) { document.getElementById('totalDay['+days+']').innerHTML = pad(total.getHours())+':'+pad(total.getMinutes()); diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index f220c2f6542..8233251d815 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -739,6 +739,8 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr $alreadyspent=''; if ($dayWorkLoad > 0) $alreadyspent=convertSecondToTime($dayWorkLoad,'allhourmin'); + $idw = 0; + $tableCell=''; $tableCell.=''; $tableCell.=' + '; @@ -746,6 +748,15 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr $tableCell.=$form->select_duration($lines[$i]->id.'duration','',$disabledtask,'text',0,1); //$tableCell.=' '; print $tableCell; + + $modeinput='hours'; + + print ''; + print ''; print '