set sql_from_imhours "select day, user_id, sum(hours) as val, 'h' as type, '' as descr from im_hours where project_id = :project_id group by user_id, day"
}else{
set sql_from_imhours "select day, user_id, sum(hours) as val, 'h' as type, '' as descr from im_hours group by user_id, day"
...
...
@@ -637,12 +637,12 @@ db_foreach get_hours $sql {
}
# Set hours
if {$type=="h"}{
if {$typeeq"h"}{
set user_days($curr_day)$val
}
# Set absences
if {$type=="a"}{
if {$typeeq"a"}{
set user_absences($curr_day)$val
set user_ab_descr($val)$descr
}
...
...
@@ -650,14 +650,14 @@ db_foreach get_hours $sql {
incr ctr
}
set colspan [expr[llength$days]+1]
set colspan [expr{[llength$days]+1}]
if{$ctr > 0 }{
# Writing last record
ns_log notice "weekly_report: left loop, now writing last record"
append table_body_html [im_do_row [array get bgcolor]$ctr$curr_owner_id $owner_name $days[array get user_days][array get user_absences]$holydays$today_date [array get user_ab_descr]$workflow_key ]
}elseif {[empty_string_p $table_body_html]}{
}elseif {$table_body_html eq ""}{
# Show a reasonable message when there are no result rows:
set table_body_html "
<tr><td colspan=$colspan><ul><li><b>
...
...
@@ -677,7 +677,7 @@ set navig_sql "
dual"
db_1row get_navig_dates $navig_sql
set switch_link_html "<a href=\"weekly_report?[export_vars -url {owner_id project_id duration display}]"
set switch_link_html "<a href=\[export_vars -base weekly_report {owner_id project_id duration display}]
set switch_past_html "$switch_link_html&start_at=$past_date&cost_center_id=$cost_center_id&department_id=$department_id&workflow_key=$workflow_key\">«</a>"
set switch_future_html "$switch_link_html&start_at=$future_date&cost_center_id=$cost_center_id&department_id=$department_id&workflow_key=$workflow_key\">»"