Commit 1173b5cd authored by Frank Bergmann's avatar Frank Bergmann

Added number formatting and right alingment

parent d45ddde8
......@@ -19,6 +19,7 @@ ad_page_contract {
{ level_of_detail 2 }
{ truncate_note_length 4000}
{ output_format "html" }
{ number_locale "" }
{ project_id:integer 0}
{ task_id:integer 0}
{ company_id:integer 0}
......@@ -71,15 +72,17 @@ set edit_timesheet_p [im_permission $current_user_id "add_hours_all"]
if {[im_permission $current_user_id "edit_hours_all"]} {set edit_timesheet_p 1 }
set view_hours_all_p [im_permission $current_user_id "view_hours_all"]
if {!$view_hours_all_p} { set user_id $current_user_id }
set locale [lang::user::locale]
if {"" == $number_locale} { set number_locale $locale }
# If project_id and task_id are set and equal, exclude task_id from sql
if {0 != $task_id && "" != $task_id && 0 != $project_id && "" != $project_id && $project_id == $task_id} {
set task_id 0
}
# ------------------------------------------------------------
# Constants
......@@ -330,7 +333,7 @@ set report_def [list \
$sub_project_nr
$user_initials
"<nobr>$date_pretty</nobr>"
$hours_link
"#align=right $hours_link"
"<nobr>$note</nobr>"
} \
content {} \
......@@ -341,7 +344,7 @@ set report_def [list \
$sub_project_nr
$user_initials
""
"<i>$hours_user_subtotal</i>"
"#align=right <i>$hours_user_subtotal</i>"
""
} \
] \
......@@ -351,7 +354,7 @@ set report_def [list \
$sub_project_nr
""
""
"<i>$hours_project_sub_subtotal</i>"
"#align=right <i>$hours_project_sub_subtotal</i>"
""
} \
] \
......@@ -546,6 +549,11 @@ switch $output_format {
[im_report_output_format_select output_format "" $output_format]
</td>
</tr>
<tr>
<td class=form-label>[lang::message::lookup "" intranet-reporting.Number_Format "Number Format"]</td>
<td>[im_report_number_locale_select number_locale $number_locale]</td>
</td>
</tr>
<tr>
<td class=form-label></td>
<td class=form-widget><input type=submit value='[lang::message::lookup "" acs-kernel.common_Submit "Submit"]'></td>
......@@ -610,9 +618,13 @@ db_foreach sql $sql {
if {[string length $note] > $truncate_note_length} {
set note "[string range $note 0 $truncate_note_length] ..."
}
set hours_link $hours
set hours_formatted [im_report_format_number $hours $output_format $number_locale]
set hours_formatted $hours
# !!!
set hours_link $hours_formatted
if {$edit_timesheet_p} {
set hours_link " <a href=\"[export_vars -base $hours_url {julian_date user_id {project_id $sub_project_id} {return_url $this_url}}]\">$hours</a>\n"
set hours_link " <a href=\"[export_vars -base $hours_url {julian_date user_id {project_id $sub_project_id} {return_url $this_url}}]\">$hours_formatted</a>\n"
}
im_report_display_footer \
......@@ -625,9 +637,9 @@ db_foreach sql $sql {
-cell_class $class
im_report_update_counters -counters $counters
set hours_user_subtotal [expr {round(100.0 * $hours_user_subtotal) / 100.0}]
set hours_project_sub_subtotal [expr {round(100.0 * $hours_project_sub_subtotal) / 100.0}]
set hours_project_subtotal [expr {round(100.0 * $hours_project_subtotal) / 100.0}]
set hours_user_subtotal [im_report_format_number [expr {round(100.0 * $hours_user_subtotal) / 100.0}] $output_format $number_locale]
set hours_project_sub_subtotal [im_report_format_number [expr {round(100.0 * $hours_project_sub_subtotal) / 100.0}] $output_format $number_locale]
set hours_project_subtotal [im_report_format_number [expr {round(100.0 * $hours_project_subtotal) / 100.0}] $output_format $number_locale]
set last_value_list [im_report_render_header \
-output_format $output_format \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment