Commit 2fa83784 authored by Frank Bergmann's avatar Frank Bergmann

- Gustaf changes

parent 057c3c80
......@@ -6,11 +6,11 @@ template::head::add_javascript -src "/intranet-sencha/js/ext-all.js" -order 100
# Cut 'select' part
set no_records_found_msg ""
set position_from [expr [string first "FROM " $sql] -1]
set position_from [expr {[string first "FROM " $sql] -1}]
set sql_no_select [string range $sql $position_from end]
# Cut 'order by' part
set position_order [expr [string first "ORDER BY " $sql_no_select] -1]
set position_order [expr {[string first "ORDER BY " $sql_no_select] -1}]
set sql_no_select_no_order [string range $sql_no_select 0 $position_order ]
switch $chart_type {
......
......@@ -5,21 +5,21 @@
<form action='project-deviation-time-budget' id='intranet-reporting-project-deviation-time-budget'>
<%=[export_vars -form {opened_projects}]%>
<table border=0 cellspacing="1" cellpadding="1" width="100%">
<tr valign=top>
<table border="0" cellspacing="1" cellpadding="1" width="100%">
<tr valign="top">
<td>
<table border=0 cellspacing=1 cellpadding=1 width="420px">
<table border="0" cellspacing="1" cellpadding="1" width="420px">
<tr>
<td class=form-label><%=[lang::message::lookup "" intranet-core.Start_Date "Start Date"]%></td>
<td class=form-widget>
<input type=textfield name="start_date" id="start_date" value=@start_date@>
<input type="text"field name="start_date" id="start_date" value="@start_date@">
<input type="button" style="height:20px; width:20px; background: url('/resources/acs-templating/calendar.gif');" onclick ="return showCalendar('start_date', 'y-m-d');" >
</td>
</tr>
<tr>
<td class=form-label><%=[lang::message::lookup "" intranet-core.End_Date "End Date"]%></td>
<td class=form-widget>
<input type=textfield name="end_date" id="end_date" value=@end_date@>
<input type="text"field name="end_date" id="end_date" value="@end_date@">
<input type="button" style="height:20px; width:20px; background: url('/resources/acs-templating/calendar.gif');" onclick ="return showCalendar('end_date', 'y-m-d');" >
</td>
</tr>
......
This diff is collapsed.
......@@ -124,7 +124,7 @@ ad_proc im_report_format_number {
output medium.
} {
if {"" == $locale} { set locale [lang::user::locale] }
set amount_zeros [im_numeric_add_trailing_zeros [expr $amount+0] $rounding_precision]
set amount_zeros [im_numeric_add_trailing_zeros [expr {$amount+0}] $rounding_precision]
set amount_pretty [lc_numeric $amount_zeros "" $locale]
return $amount_pretty
}
......@@ -197,7 +197,7 @@ ad_proc im_report_render_cell {
set key [string tolower $key]
set cell $rest
if {[string equal $key "class"]} {
if {$key eq "class"} {
set cell_class $value
} else {
append td_fields "$key=$value "
......@@ -283,7 +283,7 @@ ad_proc im_report_render_header {
# Determine last and new value for the current group group_level
set last_value ""
set new_value ""
if {$group_var != ""} {
if {$group_var ne ""} {
if {[info exists last_value_array($group_level)]} {
set last_value $last_value_array($group_level)
}
......@@ -300,7 +300,7 @@ ad_proc im_report_render_header {
# -------------------------------------------------------
# Write out the header if last_value != new_value
if { ($content == "" || $new_value != $last_value) && ($group_level <= $level_of_detail) && [llength $header] > 0} {
if { ($content eq "" || $new_value != $last_value) && ($group_level <= $level_of_detail) && [llength $header] > 0} {
switch $output_format {
html - printer { ns_write "<tr>\n" }
csv { }
......@@ -380,7 +380,7 @@ ad_proc im_report_render_footer {
}
incr group_level
}
set group_level [expr $group_level - 1]
set group_level [expr {$group_level - 1}]
while {$group_level > 0} {
if {$debug} { ns_log Notice "render_footer: level=$group_level" }
......@@ -395,7 +395,7 @@ ad_proc im_report_render_footer {
# -------------------------------------------------------
# Determine the new value for the current group_level
set new_value ""
if {$group_var != ""} {
if {$group_var ne ""} {
upvar $group_var $group_var
if {![info exists $group_var]} {
ad_return_complaint 1 "Header: Level $group_level: Group var '$group_var' doesn't exist"
......@@ -423,7 +423,7 @@ ad_proc im_report_render_footer {
# Store the result for display later
set footer_array($group_level) $footer_record
set group_level [expr $group_level - 1]
set group_level [expr {$group_level - 1}]
}
if {$debug} { ns_log Notice "render_footer: after group_by footers" }
......@@ -487,7 +487,7 @@ ad_proc im_report_display_footer {
# -------------------------------------------------------
# Determine new value for the current group return_group_level
set new_value ""
if {$group_var != ""} {
if {$group_var ne ""} {
upvar $group_var $group_var
set cmd "set new_value \"\$$group_var\""
eval $cmd
......@@ -498,7 +498,7 @@ ad_proc im_report_display_footer {
# In this case we have found the first level in which the
# results differ. This is the level where we have to return.
if {$debug} { ns_log Notice "display_footer: level=$return_group_level, group_var=$group_var, new_record_value=$new_record_value, new_value=$new_value" }
if {![string equal $new_value $new_record_value]} {
if {$new_value ne $new_record_value } {
# leave the while loop
break
}
......@@ -531,7 +531,7 @@ ad_proc im_report_display_footer {
}
incr max_group_level
}
set max_group_level [expr $max_group_level - 2]
set max_group_level [expr {$max_group_level - 2}]
if {$display_all_footers_p} { set return_group_level 1 }
......@@ -542,7 +542,7 @@ ad_proc im_report_display_footer {
# return_group_level.
#
if {$debug} { ns_log Notice "display_footer: max_group_level=$max_group_level, return_group_level=$return_group_level" }
for {set group_level $max_group_level} { $group_level >= $return_group_level} { set group_level [expr $group_level-1]} {
for {set group_level $max_group_level} { $group_level >= $return_group_level} { set group_level [expr {$group_level-1}]} {
# -------------------------------------------------------
# Extract the footer_line
......@@ -600,10 +600,10 @@ ad_proc im_report_update_counters {
set last_reset $counter_reset($var)
}
set cmd "set reset_val \[expr $reset\]"
set cmd "set reset_val \[expr {$reset}\]"
set reset_val [uplevel 1 $cmd]
set cmd "set expr_val \[expr $expr\]"
set cmd "set expr_val \[expr {$expr}\]"
set expr_val [uplevel 1 $cmd]
if {$last_reset != $reset_val} {
......@@ -620,7 +620,7 @@ ad_proc im_report_update_counters {
}
set last_count $counter_count($var)
set last_sum [expr $last_sum + $expr_val]
set last_sum [expr {$last_sum + $expr_val}]
incr last_count
......@@ -634,7 +634,7 @@ ad_proc im_report_update_counters {
# Store the rounded result
upvar "${var}_rounded" "${var}_rounded"
set "${var}_rounded" [expr round(100.0 * $last_sum) / 100.0]
set "${var}_rounded" [expr {round(100.0 * $last_sum) / 100.0}]
}
}
......@@ -747,12 +747,12 @@ ad_proc im_report_write_http_headers {
append content_type "; charset=$http_encoding"
# Set content disposition for CSV exports
if { $output_format == "csv" && $report_name != ""} {
if { $output_format eq "csv" && $report_name ne ""} {
set report_key [string tolower $report_name]
regsub -all {[^a-zA-z0-9_]} $report_key "_" report_key
regsub -all {_+} $report_key "_" report_key
set all_the_headers "HTTP/1.0 200 OK\nMIME-Version: 1.0\nContent-Type: $content_type\nContent-Disposition: attachment; filename=${report_key}.csv\r\n"
} elseif { $output_format == "txt" && $report_name != "" } {
} elseif { $output_format eq "txt" && $report_name ne "" } {
set report_key [string tolower $report_name]
regsub -all {[^a-zA-z0-9_]} $report_key "_" report_key
regsub -all {_+} $report_key "_" report_key
......@@ -845,10 +845,10 @@ ad_proc -public im_report_take_n_from_list { list n } {
set result [list]
for {set i 0} {$i < [llength $list]} {incr i} {
set elem [lindex $list $i]
set left_rest [lrange $list 0 [expr $i-1]]
set right_rest [lrange $list [expr $i+1] end]
set left_rest [lrange $list 0 $i-1]
set right_rest [lrange $list $i+1 end]
set rest [concat $left_rest $right_rest]
set rest_perms [im_report_take_n_from_list $rest [expr $n-1]]
set rest_perms [im_report_take_n_from_list $rest [expr {$n-1}]]
foreach rest_perm $rest_perms {
lappend result $rest_perm
......@@ -927,8 +927,8 @@ ad_proc -public im_reporting_tree_sortkey_pretty {
set factor 128
set dec 0
for {set i 0} {$i < [llength $bits_list]} {incr i} {
set dec [expr $dec + $factor * [lindex $bits_list $i]]
set factor [expr $factor / 2]
set dec [expr {$dec + $factor * [lindex $bits_list $i]}]
set factor [expr {$factor / 2}]
}
append result " ."
set tree_sortkey $rest
......
......@@ -32,7 +32,7 @@ ad_page_contract {
set menu_label "reporting-budget-main-projects"
# Get the current user
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
# Determine whether the current_user has read permissions.
set read_p [db_string report_perms "
......@@ -42,7 +42,7 @@ set read_p [db_string report_perms "
" -default 'f']
# Write out an error message if the current user doesn't have read permissions
if {![string equal "t" $read_p]} {
if {"t" ne $read_p } {
set message "You don't have the necessary permissions to view this page"
ad_return_complaint 1 "<li>$message"
ad_script_abort
......@@ -433,7 +433,7 @@ set class ""
db_foreach sql $report_sql {
# Select either "roweven" or "rowodd"
set class $rowclass([expr $counter % 2])
set class $rowclass([expr {$counter % 2}])
# Restrict the length of the project_name to max. 40 characters.
set project_name [string_truncate -len 40 $project_name]
......@@ -489,17 +489,17 @@ db_foreach sql $report_sql {
set eop_hours_pretty ""
if {"" != $eop_hours} {
set eop_hours_pretty [im_report_format_number [expr round(10.0 * $eop_hours) / 10.0] $output_format $number_locale]
set eop_hours_pretty [im_report_format_number [expr {round(10.0 * $eop_hours) / 10.0}] $output_format $number_locale]
}
set eop_costs_pretty ""
if {"" != $eop_costs} {
set eop_costs_pretty [im_report_format_number [expr round(10.0 * $eop_costs) / 10.0] $output_format $number_locale]
set eop_costs_pretty [im_report_format_number [expr {round(10.0 * $eop_costs) / 10.0}] $output_format $number_locale]
}
set percent_completed_pretty ""
if {"" != $percent_completed} {
set percent_completed_pretty [im_report_format_number [expr round(10.0 * $percent_completed) / 10.0] $output_format $number_locale]
set percent_completed_pretty [im_report_format_number [expr {round(10.0 * $percent_completed) / 10.0}] $output_format $number_locale]
}
set budget_hours_pretty [im_report_format_number $budget_hours $output_format $number_locale]
......
......@@ -29,7 +29,7 @@ ad_page_contract {
set menu_label "reporting-capacity-planning"
# Get the current user
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
# Determine whether the current_user has read permissions.
set read_p [db_string report_perms "
......@@ -39,7 +39,7 @@ set read_p [db_string report_perms "
" -default 'f']
# Write out an error message if the current user doesn't have read permissions
if {![string equal "t" $read_p]} {
if {"t" ne $read_p } {
set message "You don't have the necessary permissions to view this page"
ad_return_complaint 1 "<li>$message"
ad_script_abort
......@@ -299,7 +299,7 @@ set class ""
db_foreach sql $report_sql {
# Select either "roweven" or "rowodd"
set class $rowclass([expr $counter % 2])
set class $rowclass([expr {$counter % 2}])
# Restrict the length of the project_name to max. 40 characters.
set project_name [string_truncate -len 40 $project_name]
......@@ -316,9 +316,9 @@ db_foreach sql $report_sql {
# Calculated Variables
set estim_hours ""
catch { set estim_hours [expr round(10 * $logged_hours * 100 / $percent_completed) / 10] }
catch { set estim_hours [expr {round(10 * $logged_hours * 100 / $percent_completed) / 10}] }
set estim_costs ""
catch { set estim_costs [expr round(10 * $logged_costs * 100 / $percent_completed) / 10] }
catch { set estim_costs [expr {round(10 * $logged_costs * 100 / $percent_completed) / 10}] }
# Color=red if logged hours > budget hours
set logged_hours_color "black"
......
......@@ -32,7 +32,7 @@ ad_page_contract {
# Security
set menu_label "reporting-check-project-finance-customer"
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set read_p [db_string report_perms "
select im_object_permission_p(m.menu_id, :current_user_id, 'read')
from im_menus m
......@@ -42,7 +42,7 @@ set read_p [db_string report_perms "
# ToDo: Remove
set read_p "t"
if {![string equal "t" $read_p]} {
if {"t" ne $read_p } {
set message "You don't have the necessary permissions to view this page"
ad_return_complaint 1 "<li>$message"
ad_script_abort
......@@ -256,7 +256,7 @@ set class ""
db_foreach sql $report_sql {
# Select either "roweven" or "rowodd"
set class $rowclass([expr $counter % 2])
set class $rowclass([expr {$counter % 2}])
im_report_display_footer \
-group_def $report_def \
......
......@@ -31,7 +31,7 @@ ad_page_contract {
# Security
set menu_label "reporting-check-subprojects-customer"
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set read_p [db_string report_perms "
select im_object_permission_p(m.menu_id, :current_user_id, 'read')
from im_menus m
......@@ -41,7 +41,7 @@ set read_p [db_string report_perms "
# ToDo: Remove
set read_p "t"
if {![string equal "t" $read_p]} {
if {"t" ne $read_p } {
set message "You don't have the necessary permissions to view this page"
ad_return_complaint 1 "<li>$message"
ad_script_abort
......@@ -256,7 +256,7 @@ set class ""
db_foreach sql $report_sql {
# Select either "roweven" or "rowodd"
set class $rowclass([expr $counter % 2])
set class $rowclass([expr {$counter % 2}])
im_report_display_footer \
-group_def $report_def \
......
......@@ -24,7 +24,7 @@ ad_page_contract {
# ------------------------------------------------------------
# SECURITY
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
if { ![im_is_user_site_wide_or_intranet_admin $current_user_id] } {
set message "You don't have the necessary permissions to view this page"
ad_return_complaint 1 "<li>$message"
......@@ -352,7 +352,7 @@ db_dml create_im_report_get_ts_costs_no_cache_im_costs_sql $im_report_get_ts_cos
# Report SQL
set criteria [list]
if { ![empty_string_p $project_status_id] && $project_status_id > 0 } {
if { $project_status_id ne "" && $project_status_id > 0 } {
lappend criteria "p.project_status_id in ([join [im_sub_categories $project_status_id] ","])"
}
if {"" != $start_date} {
......@@ -360,7 +360,7 @@ if {"" != $start_date} {
}
set where_clause [join $criteria " and\n "]
if { ![empty_string_p $where_clause] } {
if { $where_clause ne "" } {
set where_clause " and $where_clause"
}
......@@ -456,7 +456,7 @@ db_foreach r $sql {
if { "" == $diff } { set diff 0 }
if { [info exists show_diff_only_p] && 0 == $diff } { continue }
set diff_total [expr $diff_total + $diff]
set diff_total [expr {$diff_total + $diff}]
ns_write "<tr>\n
<td>$project_name</td>\n
<td>[expr {double(round(100*$costs_no_cache_im_costs))/100}]</td>\n
......
<master>
<property name="title">@page_title@</property>
<property name="context_bar">@context_bar;noquote@</property>
<property name="doc(title)">@page_title;literal@</property>
<property name="context_bar">@context_bar;literal@</property>
<property name="main_navbar_label">reporting</property>
<table width="100%"><tr>
......
......@@ -30,13 +30,13 @@ set cnt 0
# because it identifies unquely the report's Menu and
# its permissions.
set menu_label "reporting-community-stats"
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set read_p [db_string report_perms "
select im_object_permission_p(m.menu_id, :current_user_id, 'read')
from im_menus m
where m.label = :menu_label
" -default 'f']
if {![string equal "t" $read_p]} {
if {"t" ne $read_p } {
ad_return_complaint 1 [lang::message::lookup "" intranet-reporting.You_dont_have_permissions "You don't have the necessary permissions to view this page"]
ad_script_abort
}
......@@ -56,7 +56,7 @@ set total_users [db_string total_users "
select count(*)
from persons
"]
append content "<tr><td $bgcolor([expr $cnt%2])>Total users in the system</td><td $bgcolor([expr $cnt%2])>$total_users</td></tr>\n"
append content "<tr><td $bgcolor([expr {$cnt%2}])>Total users in the system</td><td $bgcolor([expr {$cnt%2}])>$total_users</td></tr>\n"
incr cnt
append content "<tr><td class=rowplain colspan=2>&nbsp;</td></tr>\n"
......@@ -73,7 +73,7 @@ set users_status_sql "
"
db_foreach users_status $users_status_sql {
set status [lang::message::lookup "" intranet-reporting.User_status_$member_state $member_state]
append content "<tr><td $bgcolor([expr $cnt%2])>Users with status $status</td><td $bgcolor([expr $cnt%2])>$users</td></tr>\n"
append content "<tr><td $bgcolor([expr {$cnt%2}])>Users with status $status</td><td $bgcolor([expr {$cnt%2}])>$users</td></tr>\n"
incr cnt
}
......@@ -93,11 +93,11 @@ db_1row user_groups_sql "
"
append content "<tr><td class=rowplain colspan=2>&nbsp;</td></tr>\n"
append content "<tr><td $bgcolor([expr $cnt%2])>Members of group 'Employees'</td><td $bgcolor([expr $cnt%2])>$emps</td></tr>\n"
append content "<tr><td $bgcolor([expr {$cnt%2}])>Members of group 'Employees'</td><td $bgcolor([expr {$cnt%2}])>$emps</td></tr>\n"
incr cnt
append content "<tr><td $bgcolor([expr $cnt%2])>Members of group 'Customers'</td><td $bgcolor([expr $cnt%2])>$custs</td></tr>\n"
append content "<tr><td $bgcolor([expr {$cnt%2}])>Members of group 'Customers'</td><td $bgcolor([expr {$cnt%2}])>$custs</td></tr>\n"
incr cnt
append content "<tr><td $bgcolor([expr $cnt%2])>Members of group 'Freelancers'</td><td $bgcolor([expr $cnt%2])>$provs</td></tr>\n"
append content "<tr><td $bgcolor([expr {$cnt%2}])>Members of group 'Freelancers'</td><td $bgcolor([expr {$cnt%2}])>$provs</td></tr>\n"
incr cnt
......
<master src="../../intranet-core/www/master">
<property name="context">@context;noquote@</property>
<property name="title">@page_title@</property>
<property name="context">@context;literal@</property>
<property name="doc(title)">@page_title;literal@</property>
<property name="main_navbar_label">reporting</property>
<property name="left_navbar">@left_navbar_html;noquote@</property>
<property name="left_navbar">@left_navbar_html;literal@</property>
<table width="100%">
......
......@@ -29,7 +29,7 @@ ad_page_contract {
# Defaults & Security
# ------------------------------------------------------
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set user_admin_p [im_is_user_site_wide_or_intranet_admin $current_user_id]
set reports_exist_p [im_table_exists "im_reports"]
......@@ -45,7 +45,7 @@ set read_p [util_memoize [list db_string report_perms "
where m.label = '$menu_label'
" -default 'f']]
if {![string equal "t" $read_p]} {
if {"t" ne $read_p } {
ad_return_complaint 1 "<li>[lang::message::lookup "" intranet-reporting.You_dont_have_permissions "You don't have the necessary permissions to view this page"]"
return
}
......
<master>
<property name="title">@page_title@</property>
<property name="context_bar">@context_bar;noquote@</property>
<property name="doc(title)">@page_title;literal@</property>
<property name="context_bar">@context_bar;literal@</property>
<property name="main_navbar_label">reporting</property>
<table width="100%"><tr>
......
......@@ -35,13 +35,13 @@ set help "
# because it identifies unquely the report's Menu and
# its permissions.
set menu_label "reporting-late-projects"
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set read_p [db_string report_perms "
select im_object_permission_p(m.menu_id, :current_user_id, 'read')
from im_menus m
where m.label = :menu_label
" -default 'f']
if {![string equal "t" $read_p]} {
if {"t" ne $read_p } {
ad_return_complaint 1 [lang::message::lookup "" intranet-reporting.You_dont_have_permissions "You don't have the necessary permissions to view this page"]
ad_script_abort
}
......
......@@ -4,28 +4,28 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<master src="../../intranet-core/www/master">
<property name="title">@page_title@</property>
<property name="doc(title)">@page_title;literal@</property>
<property name="main_navbar_label">reporting</property>
<form>
<%= [export_vars -form {opened_projects project_id}] %>
<table border=0 cellspacing=1 cellpadding=1>
<tr valign=top>
<table border="0" cellspacing="1" cellpadding="1">
<tr valign="top">
<td>
<table border=0 cellspacing=1 cellpadding=1>
<table border="0" cellspacing="1" cellpadding="1">
<!--
<tr>
<td class=form-label>Start Date</td>
<td class=form-widget>
<input type=textfield name=start_date value=@start_date@>
<input type="text"field name="start_date" value="@start_date@">
</td>
</tr>
<tr>
<td class=form-label>End Date</td>
<td class=form-widget>
<input type=textfield name=end_date value=@end_date@>
<input type="text"field name="end_date" value="@end_date@">
</td>
</tr>
-->
......@@ -49,7 +49,7 @@
</tr>
<tr>
<td class=form-label></td>
<td class=form-widget><input type=submit value=Submit></td>
<td class=form-widget><input type="submit" value="Submit"></td>
</tr>
</table>
</td>
......
......@@ -33,7 +33,7 @@ if { -1 == $project_status_id } {
}
set menu_label "logged_units_vs_planned_units"
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set hours_per_day [parameter::get -package_id [apm_package_id_from_key intranet-timesheet2] -parameter "TimesheetHoursPerDay" -default 8]
set read_p [db_string report_perms "
select im_object_permission_p(m.menu_id, :current_user_id, 'read')
......@@ -42,7 +42,7 @@ set read_p [db_string report_perms "
" -default 'f']
set read_p t
if {![string equal "t" $read_p]} {
if {"t" ne $read_p } {
ad_return_complaint 1 [lang::message::lookup "" intranet-reporting.You_dont_have_permissions "You don't have the necessary permissions to view this page"]
ad_script_abort
}
......@@ -311,13 +311,13 @@ array set project_hours {}
# if { ![info exists projects($hours_project_id,$user_id)] } {
# set projects($hours_project_id,$user_id) 0
# }
# set projects($hours_project_id,$user_id) [expr $projects($hours_project_id,$user_id) + $logged_hours]
# set projects($hours_project_id,$user_id) [expr {$projects($hours_project_id,$user_id) + $logged_hours}]
# foreach parent_id $project_parents($hours_project_id) {
# if { ![info exists projects($parent_id,$user_id)] } {
# set projects($parent_id,$user_id) 0
# }
# set projects($parent_id,$user_id) [expr $projects($parent_id,$user_id) + $logged_hours]
# set projects($parent_id,$user_id) [expr {$projects($parent_id,$user_id) + $logged_hours}]
# }
#
# }
......@@ -329,7 +329,7 @@ array set project_hours {}
set elements [list]
if {[lsearch $display_fields "customer_name"] >= 0} {
if {"customer_name" in $display_fields} {
lappend elements customer_name
lappend elements {
label "Customer"
......@@ -340,7 +340,7 @@ if {[lsearch $display_fields "customer_name"] >= 0} {
}
}
}
if {[lsearch $display_fields "project_nr"] >= 0} {
if {"project_nr" in $display_fields} {
lappend elements project_nr
lappend elements {
label "Project Nr"
......@@ -364,7 +364,7 @@ lappend elements {
}
}
if {[lsearch $display_fields "start_date"] >= 0} {
if {"start_date" in $display_fields} {
lappend elements child_start_date
lappend elements {
label "Start"
......@@ -372,7 +372,7 @@ if {[lsearch $display_fields "start_date"] >= 0} {
}
}
if {[lsearch $display_fields "end_date"] >= 0} {
if {"end_date" in $display_fields} {
lappend elements child_end_date
lappend elements {
label "End"
......@@ -380,7 +380,7 @@ if {[lsearch $display_fields "end_date"] >= 0} {
}
}
if {[lsearch $display_fields "reported_hours_cache"] >= 0} {
if {"reported_hours_cache" in $display_fields} {
lappend elements reported_hours_cache
lappend elements {
label "Total Units<br>logged"
......@@ -389,7 +389,7 @@ if {[lsearch $display_fields "reported_hours_cache"] >= 0} {
}
}
if {[lsearch $display_fields "sum_reported_units"] >= 0} {
if {"sum_reported_units" in $display_fields} {
lappend elements sum_reported_units
lappend elements {
label "Reported<br>Units"
......@@ -398,7 +398,7 @@ if {[lsearch $display_fields "sum_reported_units"] >= 0} {
}
}
if {[lsearch $display_fields "sum_planned_units"] >= 0} {
if {"sum_planned_units" in $display_fields} {
lappend elements sum_planned_units
lappend elements {
label "Planned<br>Units"
......@@ -407,7 +407,7 @@ if {[lsearch $display_fields "sum_planned_units"] >= 0} {
}
}
if {[lsearch $display_fields "sum_billable_units"] >= 0} {
if {"sum_billable_units" in $display_fields} {
lappend elements sum_billable_units
lappend elements {
label "Billable<br>Units"
......@@ -591,7 +591,7 @@ db_multirow -extend {level_spacer open_gif} project_list project_list "
for {set i 0} {$i < $tree_level} {incr i} { append level_spacer "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" }
# Open/Close Logic
set open_p [expr [lsearch $opened_projects $child_id] >= 0]
set open_p [expr {[lsearch $opened_projects $child_id] >= 0}]
if {$open_p} {
set opened $opened_projects
......@@ -634,7 +634,7 @@ template::multirow foreach project_list {
# foreach user_id [array names users] {
# if { [info exists projects($child_id,$user_id)] } {
# set hours [expr $projects($child_id,$user_id)]
# set hours [expr {$projects($child_id,$user_id)}]
# } else {
# set hours ""
# }
......@@ -643,18 +643,18 @@ template::multirow foreach project_list {
# Days to hours
if { "" != $sum_planned_days } {
set sum_planned_hours [expr $sum_planned_hours + [expr $sum_planned_days * $hours_per_day]]
set sum_planned_hours [expr {$sum_planned_hours + [expr {$sum_planned_days * $hours_per_day}]}]
}
if { "" != $sum_planned_weeks } {
set sum_planned_hours [expr $sum_planned_hours + [expr $sum_planned_weeks * 5 * $hours_per_day]]
set sum_planned_hours [expr {$sum_planned_hours + [expr {$sum_planned_weeks * 5 * $hours_per_day}]}]
}
# Weeks to hours
if { "" != $sum_billable_days } {
set sum_billable_hours [expr $sum_billable_hours + [expr $sum_billable_days * $hours_per_day]]
set sum_billable_hours [expr {$sum_billable_hours + [expr {$sum_billable_days * $hours_per_day}]}]
}
if { "" != $sum_billable_weeks } {
set sum_billable_hours [expr $sum_billable_hours + [expr $sum_billable_weeks * 5 * $hours_per_day]]
set sum_billable_hours [expr {$sum_billable_hours + [expr {$sum_billable_weeks * 5 * $hours_per_day}]}]
}
# Check for empty
......@@ -667,13 +667,13 @@ template::multirow foreach project_list {
set sum_billable_units $sum_billable_hours
set sum_reported_units $reported_hours_cache
} elseif {$uom_id == $uom_day_id} {
set sum_planned_units [expr $sum_planned_hours / $hours_per_day]
set sum_billable_units [expr $sum_billable_hours / $hours_per_day]
set sum_reported_units [expr $reported_hours_cache / $hours_per_day]
set sum_planned_units [expr {$sum_planned_hours / $hours_per_day}]
set sum_billable_units [expr {$sum_billable_hours / $hours_per_day}]
set sum_reported_units [expr {$reported_hours_cache / $hours_per_day}]
} elseif { $uom_id == $uom_week_id} {
set sum_planned_units [expr [expr $sum_planned_hours / $hours_per_day] / 5]
set sum_billable_units [expr [expr $sum_billable_hours / $hours_per_day] /5]
set sum_reported_units [expr [expr $reported_hours_cache / $hours_per_day] /5]
set sum_planned_units [expr {[expr {$sum_planned_hours / $hours_per_day}] / 5}]
set sum_billable_units [expr {[expr {$sum_billable_hours / $hours_per_day}] /5}]
set sum_reported_units [expr {[expr {$reported_hours_cache / $hours_per_day}] /5}]
} else {
ad_return_complaint 1 "Unit of Measure '$uom_id' not supported by this report. Supported are: $uom_hour_id, $uom_day_id, $uom_week_id"
}
......@@ -681,17 +681,17 @@ template::multirow foreach project_list {
if { "" == $sum_planned_units } { set sum_planned_units 0 }
if { "" == $sum_reported_units } { set sum_reported_units 0 }
set balance_rep_plan [expr $sum_planned_units - $sum_reported_units]
set balance_rep_bill [expr $sum_billable_units - $sum_reported_units]
set balance_rep_plan [expr {$sum_planned_units - $sum_reported_units}]
set balance_rep_bill [expr {$sum_billable_units - $sum_reported_units}]
# Formatting
set sum_planned_units [lc_numeric [im_numeric_add_trailing_zeros [expr $sum_planned_units+0] $rounding_precision] $format_string $locale]
set sum_billable_units [lc_numeric [im_numeric_add_trailing_zeros [expr $sum_billable_units+0] $rounding_precision] $format_string $locale]
set sum_reported_units [lc_numeric [im_numeric_add_trailing_zeros [expr $sum_reported_units+0] $rounding_precision] $format_string $locale]
set balance_rep_plan [lc_numeric [im_numeric_add_trailing_zeros [expr $balance_rep_plan+0] $rounding_precision] $format_string $locale]
set balance_rep_bill [lc_numeric [im_numeric_add_trailing_zeros [expr $balance_rep_bill+0] $rounding_precision] $format_string $locale]
set sum_planned_units [lc_numeric [im_numeric_add_trailing_zeros [expr {$sum_planned_units+0}] $rounding_precision] $format_string $locale]
set sum_billable_units [lc_numeric [im_numeric_add_trailing_zeros [expr {$sum_billable_units+0}] $rounding_precision] $format_string $locale]
set sum_reported_units [lc_numeric [im_numeric_add_trailing_zeros [expr {$sum_reported_units+0}] $rounding_precision] $format_string $locale]
set balance_rep_plan [lc_numeric [im_numeric_add_trailing_zeros [expr {$balance_rep_plan+0}] $rounding_precision] $format_string $locale]
set balance_rep_bill [lc_numeric [im_numeric_add_trailing_zeros [expr {$balance_rep_bill+0}] $rounding_precision] $format_string $locale]
set reported_hours_cache [lc_numeric [im_numeric_add_trailing_zeros [expr $reported_hours_cache+0] $rounding_precision] $format_string $locale]
set reported_hours_cache [lc_numeric [im_numeric_add_trailing_zeros [expr {$reported_hours_cache+0}] $rounding_precision] $format_string $locale]
incr i
}
......
......@@ -4,7 +4,7 @@ ad_page_contract {
}
set user_id [ad_maybe_redirect_for_registration]
set user_id [auth::require_login]
set page_title "Invoices Report"
set context_bar [im_context_bar $page_title]
set context ""
......
......@@ -4,7 +4,7 @@ ad_page_contract {
}
set user_id [ad_maybe_redirect_for_registration]
set user_id [auth::require_login]
set page_title "Magazine Editors Report"
set context_bar [im_context_bar $page_title]
set context ""
......@@ -21,13 +21,13 @@ set row_class "rowtitle"
# because it identifies unquely the report's Menu and
# its permissions.
set menu_label "reporting-other-magazine-editors"
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set read_p [db_string report_perms "
select im_object_permission_p(m.menu_id, :current_user_id, 'read')
from im_menus m
where m.label = :menu_label
" -default 'f']
if {![string equal "t" $read_p]} {
if {"t" ne $read_p } {
ad_return_complaint 1 [lang::message::lookup "" intranet-reporting.You_dont_have_permissions "You don't have the necessary permissions to view this page"]
ad_script_abort
}
......
<master src="../../intranet-core/www/master">
<property name="context">@context;noquote@</property>
<property name="title">@page_title@</property>
<property name="context">@context;literal@</property>
<property name="doc(title)">@page_title;literal@</property>
<property name="main_navbar_label">reporting</property>
<h2>@page_title@</h2>
......
......@@ -19,7 +19,7 @@ ad_page_contract {
{form_mode "display"}
}
set user_id [ad_maybe_redirect_for_registration]
set user_id [auth::require_login]
set page_title [lang::message::lookup "" intranet-reporting.Edit_Report "Edit Report"]
set context [im_context_bar $page_title]
if {![im_permission $user_id "add_reports"]} {
......
......@@ -25,14 +25,14 @@ ad_page_contract {
# because it identifies unquely the report's Menu and
# its permissions.
set menu_label "reporting-program-eva"
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set read_p [db_string report_perms "
select im_object_permission_p(m.menu_id, :current_user_id, 'read')
from im_menus m
where m.label = :menu_label
" -default 'f']
if {![string equal "t" $read_p]} {
if {"t" ne $read_p } {
ad_return_complaint 1 "<li>
[lang::message::lookup "" intranet-reporting.You_dont_have_permissions "You don't have the necessary permissions to view this page"]"
return
......@@ -139,7 +139,7 @@ if {0 != $program_id && "" != $program_id} {
}
set where_clause [join $criteria " and\n "]
if { ![empty_string_p $where_clause] } {
if { $where_clause ne "" } {
set where_clause " and $where_clause"
}
......@@ -238,12 +238,12 @@ set report_def [list \
footer {
"<br>&nbsp;<br>"
""
"\#align=right [format \"%.2f\" [expr {double(round(100*[expr $program_budget_converted-$budget_sum]))/100}]]"
"\#align=right [format \"%.2f\" [expr {double(round(100*[expr {$program_budget_converted-$budget_sum}]))/100}]]"
""
""
""
"&nbsp;"
"\#align=right [format \"%.2f\" [expr {double(round(100*[expr $program_budget_hours-$budget_hours_sum]))/100}]]"
"\#align=right [format \"%.2f\" [expr {double(round(100*[expr {$program_budget_hours-$budget_hours_sum}]))/100}]]"
""
""
""
......@@ -438,10 +438,10 @@ db_foreach sql $sql {
}
# Calculated variables
set project_cost [expr $cost_timesheet_logged_cache + $cost_bills_cache]
set project_cost [expr {$cost_timesheet_logged_cache + $cost_bills_cache}]
set budget_overrun_percentage "<i>[lang::message::lookup "" intranet-reporting.Undefined "Undefined"]</i>"
if {0.0 != $percent_completed && 0.0 != $project_budget_converted} {
set percent_consumed [expr 100.0 * ($project_cost / $project_budget_converted)]
set percent_consumed [expr {100.0 * ($project_cost / $project_budget_converted)}]
set budget_overrun_percentage [expr (100.0 * $percent_consumed / $percent_completed) - 100.0]
regexp {^([0-9\-\+]+)} $budget_overrun_percentage match budget_overrun_percentage
if {$budget_overrun_percentage > 5.0} { set budget_overrun_percentage "<font color=red>$budget_overrun_percentage</font>" }
......@@ -449,7 +449,7 @@ db_foreach sql $sql {
set budget_hours_overrun_percentage "<i>[lang::message::lookup "" intranet-reporting.Undefined "Undefined"]</i>"
if {0.0 != $percent_completed && 0.0 != $project_budget_hours} {
set percent_consumed [expr 100.0 * ($reported_hours_cache / $project_budget_hours)]
set percent_consumed [expr {100.0 * ($reported_hours_cache / $project_budget_hours)}]
set budget_hours_overrun_percentage [expr (100.0 * $percent_consumed / $percent_completed) - 100.0]
regexp {^([0-9\-\+]+)} $budget_hours_overrun_percentage match budget_hours_overrun_percentage
if {$budget_hours_overrun_percentage > 5.0} { set budget_hours_overrun_percentage "<font color=red>$budget_hours_overrun_percentage</font>" }
......
......@@ -4,9 +4,9 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<master src="../../intranet-core/www/master">
<property name="title">@page_title@</property>
<property name="doc(title)">@page_title;literal@</property>
<property name="main_navbar_label">reporting</property>
<property name="left_navbar">@left_navbar_html;noquote@</property>
<property name="left_navbar">@left_navbar_html;literal@</property>
<br>
<h1><%=[lang::message::lookup "" intranet-reporting.ListOfCurrentProjectTasks "List of Current Project Tasks"]%></h1>
<p>
......
......@@ -74,14 +74,14 @@ set restrict_to_project_id ""
# Permissions & Validation
# ------------------------------------------------------------
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set read_p [db_string report_perms "
select im_object_permission_p(m.menu_id, :current_user_id, 'read')
from im_menus m
where m.label = :menu_label
" -default 'f']
if {![string equal "t" $read_p]} {
if {"t" ne $read_p } {
ad_return_complaint 1 "<li>
[lang::message::lookup "" intranet-reporting.You_dont_have_permissions "You don't have the necessary permissions to view this page"]"
return
......@@ -141,7 +141,7 @@ if {"" == $form_vars} { set form_vars [ns_set create] }
# Get the start_idx in case of pagination
set start_idx [ns_set get $form_vars "task_start_idx"]
if {"" == $start_idx} { set start_idx 0 }
set end_idx [expr $start_idx + $max_entries_per_page - 1]
set end_idx [expr {$start_idx + $max_entries_per_page - 1}]
set bgcolor(0) " class=roweven"
set bgcolor(1) " class=rowodd"
......@@ -151,7 +151,7 @@ set timesheet_report_url "/intranet-timesheet2-tasks/report-timesheet"
set current_url [im_url_with_query]
if {![info exists current_page_url]} { set current_page_url [ad_conn url] }
if {![exists_and_not_null return_url]} { set return_url $current_url }
if {(![info exists return_url] || $return_url eq "")} { set return_url $current_url }
# Get the "view" (=list of columns to show)
set view_id [im_view_id_from_name $view_name]
......@@ -213,7 +213,7 @@ foreach var $export_var_list {
ns_log Notice "im_timesheet_task_component: $var <- $value"
} else {
set value [ns_set get $form_vars $var]
if {![string equal "" $value]} {
if {$value ne ""} {
ns_set put $bind_vars $var $value
ns_log Notice "im_timesheet_task_component: $var <- $value"
}
......@@ -226,7 +226,7 @@ set len [ns_set size $bind_vars]
for {set i 0} {$i < $len} {incr i} {
set key [ns_set key $bind_vars $i]
set value [ns_set value $bind_vars $i]
if {![string equal $value ""]} {
if {$value ne "" } {
lappend params "$key=[ns_urlencode $value]"
}
}
......@@ -234,7 +234,7 @@ set pass_through_vars_html [join $params "&"]
# ---------------------- Format Header ----------------------------------
# Set up colspan to be the number of headers + 1 for the # column
set colspan [expr [llength $column_headers] + 1]
set colspan [expr {[llength $column_headers] + 1}]
# Format the header names with links that modify the
# sort order of the SQL query.
......@@ -323,10 +323,10 @@ db_foreach main_project_sql $main_project_sql {
}
set extra_select [join $extra_selects ",\n\t"]
if { ![empty_string_p $extra_select] } { set extra_select ",\n\t$extra_select" }
if { $extra_select ne "" } { set extra_select ",\n\t$extra_select" }
set extra_from [join $extra_froms ",\n\t"]
if { ![empty_string_p $extra_from] } { set extra_from ",\n\t$extra_from" }
if { $extra_from ne "" } { set extra_from ",\n\t$extra_from" }
if { "" != $employee_cost_center_id && 0 != $employee_cost_center_id } {
lappend extra_wheres "t.task_id in (select object_id_one from acs_rels where object_id_two in (select employee_id from im_employees where department_id = :employee_cost_center_id))"
......@@ -342,7 +342,7 @@ db_foreach main_project_sql $main_project_sql {
}
set extra_where [join $extra_wheres "and\n\t"]
if { ![empty_string_p $extra_where] } { set extra_where "and \n\t$extra_where" }
if { $extra_where ne "" } { set extra_where "and \n\t$extra_where" }
# ------------------------------------------------------------------------------
......@@ -686,7 +686,7 @@ db_foreach main_project_sql $main_project_sql {
# We've got a task.
# Write out a line with task information
append table_body_html "<tr$bgcolor([expr $ctr % 2])>\n"
append table_body_html "<tr$bgcolor([expr {$ctr % 2}])>\n"
foreach column_var $column_vars {
append table_body_html "\t<td valign=top>"
set cmd "append table_body_html $column_var"
......@@ -704,7 +704,7 @@ db_foreach main_project_sql $main_project_sql {
# ----------------------------------------------------
# Show a reasonable message when there are no result rows:
# if { [empty_string_p $table_body_html] } {
# if { $table_body_html eq "" } {
# set table_body_html "
# <tr class=table_list_page_plain>
# <td colspan=$colspan align=left>
......@@ -725,21 +725,21 @@ set next_page_html ""
if { [info exists ctr] } {
# Deal with pagination
if {$ctr == $max_entries_per_page && $end_idx < [expr $total_in_limited - 1]} {
if {$ctr == $max_entries_per_page && $end_idx < [expr {$total_in_limited - 1}]} {
# This means that there are rows that we decided not to return
# Include a link to go to the next page
set next_start_idx [expr $end_idx + 1]
set next_start_idx [expr {$end_idx + 1}]
set task_max_entries_per_page $max_entries_per_page
set next_page_url "$current_page_url?[export_vars -url {project_id task_object_id task_max_entries_per_page order_by}]&task_start_idx=$next_start_idx&$pass_through_vars_html"
set next_page_url "[export_vars -base $current_page_url {project_id task_object_id task_max_entries_per_page order_by}]&task_start_idx=$next_start_idx&$pass_through_vars_html"
set next_page_html "($remaining_items more) <A href=\"$next_page_url\">&gt;&gt;</a>"
}
if { $start_idx > 0 } {
# This means we didn't start with the first row - there is
# at least 1 previous row. add a previous page link
set previous_start_idx [expr $start_idx - $max_entries_per_page]
set previous_start_idx [expr {$start_idx - $max_entries_per_page}]
if { $previous_start_idx < 0 } { set previous_start_idx 0 }
set previous_page_html "<A href=$current_page_url?[export_vars -url {project_id}]&$pass_through_vars_html&order_by=$order_by&task_start_idx=$previous_start_idx>&lt;&lt;</a>"
set previous_page_html "<A href=[export_vars -base $current_page_url {project_id}]&$pass_through_vars_html&order_by=$order_by&task_start_idx=$previous_start_idx>&lt;&lt;</a>"
}
}
......
......@@ -32,7 +32,7 @@ ad_page_contract {
# because it identifies unquely the report's Menu and
# its permissions.
set menu_label "reporting-projects-main"
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
# Default User = Current User, to reduce performance overhead
if {"" == $start_date && "" == $end_date && 0 == $project_id && 0 == $company_id && 0 == $member_id && 0 == $project_lead_id} {
set user_id $current_user_id
......@@ -56,7 +56,7 @@ set number_format "999,999.99"
# ------------------------------------------------------------
if {![string equal "t" $read_p]} {
if {"t" ne $read_p } {
ad_return_complaint 1 "
[lang::message::lookup "" intranet-reporting.You_dont_have_permissions "You don't have the necessary permissions to view this page"]"
return
......@@ -148,7 +148,7 @@ if {0 != $project_lead_id && "" != $project_lead_id} { lappend criteria "p.proje
if {0 != $project_id && "" != $project_id} { lappend criteria "p.project_id = :project_id" }
set where_clause [join $criteria " and\n "]
if { ![empty_string_p $where_clause] } {
if { $where_clause ne "" } {
set where_clause " and $where_clause"
}
......
......@@ -27,7 +27,7 @@ ad_page_contract {
# because it identifies unquely the report's Menu and
# its permissions.
set menu_label "reporting-skill-profile-unassigned-tasks"
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set use_project_name_p [parameter::get_from_package_key -package_key intranet-reporting -parameter "UseProjectNameInsteadOfProjectNr" -default 0]
# Default User = Current User, to reduce performance overhead
......@@ -53,7 +53,7 @@ set number_format "999,990.99"
# ------------------------------------------------------------
if {![string equal "t" $read_p]} {
if {"t" ne $read_p } {
ad_return_complaint 1 "
[lang::message::lookup "" intranet-reporting.You_dont_have_permissions "You don't have the necessary permissions to view this page"]"
return
......@@ -187,7 +187,7 @@ if {0 != $project_id && "" != $project_id} {
}
set where_clause [join $criteria " and\n "]
if { ![empty_string_p $where_clause] } {
if { $where_clause ne "" } {
set where_clause " and $where_clause"
}
......
......@@ -28,7 +28,7 @@ ad_page_contract {
# because it identifies unquely the report's Menu and
# its permissions.
set menu_label "reporting-survsimp-main"
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set read_p [db_string report_perms "
select im_object_permission_p(m.menu_id, :current_user_id, 'read')
from im_menus m
......@@ -49,7 +49,7 @@ set number_format "999,999.99"
# ------------------------------------------------------------
if {![string equal "t" $read_p]} {
if {"t" ne $read_p } {
ad_return_complaint 1 "
[lang::message::lookup "" intranet-reporting.You_dont_have_permissions "You don't have the necessary permissions to view this page"]"
return
......@@ -127,7 +127,7 @@ set criteria [list]
if {0 != $survey_id && "" != $survey_id} { lappend criteria "ss.survey_id = :survey_id" }
set where_clause [join $criteria " and\n "]
if { ![empty_string_p $where_clause] } {
if { $where_clause ne "" } {
set where_clause " and $where_clause"
}
......
......@@ -33,7 +33,7 @@ ad_page_contract {
# its permissions.
set menu_label "reporting-timesheet-customer-project"
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
# Default User = Current User, to reduce performance overhead
if {"" == $start_date && "" == $end_date && 0 == $project_id && 0 == $company_id && 0 == $user_id} {
......@@ -57,7 +57,7 @@ set number_format "999,999.99"
# ------------------------------------------------------------
if {![string equal "t" $read_p]} {
if {"t" ne $read_p } {
ad_return_complaint 1 "
[lang::message::lookup "" intranet-reporting.You_dont_have_permissions "You don't have the necessary permissions to view this page"]"
return
......@@ -162,7 +162,7 @@ if {0 != $project_id && "" != $project_id} {
}
set where_clause [join $criteria " and\n "]
if { ![empty_string_p $where_clause] } {
if { $where_clause ne "" } {
set where_clause " and $where_clause"
}
......
......@@ -57,7 +57,7 @@ proc im_reporting_render_odt_template {
# </report>
# Create a temporary directory
set odt_tmp_path [ns_tmpnam]
set odt_tmp_path [ad_tmpnam]
ns_log Notice "im_reporting_render_odt_template: tmp_path=$odt_tmp_path"
ns_mkdir $odt_tmp_path
......@@ -234,9 +234,8 @@ proc im_reporting_render_odt_template {
# Update target cell coordinate
if {[catch {
# Calculate new target cell coordinate
set coordinate_int_new [expr $coordinate_int_orig + $ctr_new_nodes_created -1]
ns_log Notice "timesheet-customer-project-xml-xslt:: New value of coordinate_int: $coordinate_int_new"
set coordinate_int_new [expr {$coordinate_int_orig + $ctr_new_nodes_created -1}]
ns_log NOTICE "timesheet-customer-project-xml-xslt:: New value of coordinate_int: $coordinate_int_new"
set cmd "set target_coordinate \[string map \{$coordinate_int_orig $coordinate_int_new\} \"[lindex [split $coordinate_pair ":"] 1]\"\]"
eval $cmd
......@@ -321,7 +320,7 @@ proc im_reporting_render_odt_template {
# because it identifies unquely the report's Menu and
# its permissions.
set menu_label "reporting-timesheet-customer-project-xml-xslt"
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set use_project_name_p [parameter::get_from_package_key -package_key intranet-reporting -parameter "UseProjectNameInsteadOfProjectNr" -default 0]
set xml_output ""
......@@ -374,7 +373,7 @@ if { "template" == $output_format && "" == $odt_template_id } {
ad_return_complaint 1 [lang::message::lookup "" intranet-reporting.ChooseTemplate "Please choose a template"]
}
if {![string equal "t" $read_p]} {
if {"t" ne $read_p } {
ad_return_complaint 1 "
[lang::message::lookup "" intranet-reporting.You_dont_have_permissions "You don't have the necessary permissions to view this page"]"
return
......@@ -532,12 +531,12 @@ if { "" != $print_hour_p } {
}
set where_clause [join $criteria " and\n "]
if { ![empty_string_p $where_clause] } {
if { $where_clause ne "" } {
set where_clause " and $where_clause"
}
set where_clause_absences [join $criteria_absences " and\n "]
if { ![empty_string_p $where_clause_absences ] } {
if { $where_clause_absences ne "" } {
set where_clause_absences " and $where_clause_absences"
}
......@@ -575,7 +574,7 @@ if { "" != $export_absences } {
if { [info exists absence_hash($hash_key)] } {
# Add only when absence duration is less than one day
if { [lindex $absence_hash($hash_key) 0] < 1 } {
set absence_hash($hash_key) [list [expr [lindex $absence_hash($hash_key) 0] + $duration_days] "-1" $absence_date $active_employee_id $user_initials]
set absence_hash($hash_key) [list [expr {[lindex $absence_hash($hash_key) 0] + $duration_days}] "-1" $absence_date $active_employee_id $user_initials]
if { [lindex $absence_hash($hash_key) 0] >= 1 } {
set absence_hash($hash_key) [list 1 "-1"]
}
......@@ -1366,13 +1365,13 @@ switch $output_format {
ns_log Notice "timesheet-customer-project-v2 :: uri_xslt: $uri_xslt"
# Create tmp file for Reports Default XML
set uri_report_default_xml [ns_tmpnam]
set uri_report_default_xml [ad_tmpnam]
set fo [open $uri_report_default_xml {RDWR CREAT}]
puts $fo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>[$root asXML]"
close $fo
# Create tmp file for Report Custom XML
set uri_report_custom_xml [ns_tmpnam]
set uri_report_custom_xml [ad_tmpnam]
set fo [open $uri_report_custom_xml {RDWR CREAT}]
puts $fo " "
close $fo
......@@ -1388,7 +1387,7 @@ switch $output_format {
}
template {
# Create tmp file for Reports Default XML
set uri_report_default_xml [ns_tmpnam]
set uri_report_default_xml [ad_tmpnam]
set fo [open $uri_report_default_xml {RDWR CREAT}]
puts $fo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>[$root asXML]"
close $fo
......@@ -1399,7 +1398,7 @@ switch $output_format {
ns_log Notice "timesheet-customer-project-v2 :: uri_xslt: $uri_xslt"
# Create tmp file for Report Custom XML
set uri_report_custom_xml [ns_tmpnam]
set uri_report_custom_xml [ad_tmpnam]
set fo [open $uri_report_custom_xml {RDWR CREAT}]
puts $fo " "
close $fo
......
......@@ -35,7 +35,7 @@ ad_page_contract {
# because it identifies unquely the report's Menu and
# its permissions.
set menu_label "reporting-timesheet-customer-project"
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set use_project_name_p [parameter::get_from_package_key -package_key intranet-reporting -parameter "UseProjectNameInsteadOfProjectNr" -default 0]
......@@ -74,7 +74,7 @@ set number_format "999,990.99"
# ------------------------------------------------------------
if {![string equal "t" $read_p]} {
if {"t" ne $read_p } {
ad_return_complaint 1 "
[lang::message::lookup "" intranet-reporting.You_dont_have_permissions "You don't have the necessary permissions to view this page"]"
return
......@@ -208,7 +208,7 @@ if {0 != $project_id && "" != $project_id} {
}
set where_clause [join $criteria " and\n "]
if { ![empty_string_p $where_clause] } {
if { $where_clause ne "" } {
set where_clause " and $where_clause"
}
......@@ -608,9 +608,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 [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 last_value_list [im_report_render_header \
-output_format $output_format \
......
......@@ -28,14 +28,14 @@ ad_page_contract {
# because it identifies unquely the report's Menu and
# its permissions.
set menu_label "reporting-timesheet-days-per-project-and-month"
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set read_p [db_string report_perms "
select im_object_permission_p(m.menu_id, :current_user_id, 'read')
from im_menus m
where m.label = :menu_label
" -default 'f']
set read_p "t"
if {![string equal "t" $read_p]} {
if {"t" ne $read_p } {
ad_return_complaint 1 "<li>
[lang::message::lookup "" intranet-reporting.You_dont_have_permissions "You don't have the necessary permissions to view this page"]"
ad_script_abort
......@@ -122,7 +122,7 @@ if { [info exists cost_center_id] && 0 != $cost_center_id && "" != $cost_center_
}
set where_clause [join $criteria " and\n "]
if { ![empty_string_p $where_clause] } {
if { $where_clause ne "" } {
set where_clause " and $where_clause"
}
......@@ -158,7 +158,7 @@ set first_month ""
# ad_return_complaint 1 "$year_end - $month_end<br>$year_start - $month"
for {set i 0} {[expr $year * 12 + $month] <= [expr $year_end * 12 + $month_end]} {incr i} {
for {set i 0} {[expr {$year * 12 + $month}] <= [expr {$year_end * 12 + $month_end}]} {incr i} {
if {$month > 12} {
set month 1
incr year
......@@ -357,7 +357,7 @@ db_foreach sql $sql {
# Rounding for counter sums
set year $year_start
set month $month_start
for {set i 0} {[expr $year * 12 + $month] <= [expr $year_end * 12 + $month_end]} {incr i} {
for {set i 0} {[expr {$year * 12 + $month}] <= [expr {$year_end * 12 + $month_end}]} {incr i} {
if {$month > 12} {
set month 1
incr year
......
......@@ -3,27 +3,27 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<master src="../../intranet-core/www/master">
<property name="title">@page_title@</property>
<property name="doc(title)">@page_title;literal@</property>
<property name="main_navbar_label">reporting</property>
<form>
<%= [export_vars -form {opened_projects project_id}] %>
<table border=0 cellspacing=1 cellpadding=1>
<tr valign=top><td>
<table border="0" cellspacing="1" cellpadding="1">
<tr valign="top"><td>
<table border=0 cellspacing=1 cellpadding=1>
<table border="0" cellspacing="1" cellpadding="1">
<tr>
<td class=form-label>Start Date</td>
<td class=form-widget>
<input type=textfield name=start_date value=@start_date@>
<input type="text"field name="start_date" value="@start_date@">
</td>
</tr>
<tr>
<td class=form-label>End Date</td>
<td class=form-widget>
<input type=textfield name=end_date value=@end_date@>
<input type="text"field name="end_date" value="@end_date@">
</td>
</tr>
<tr>
......@@ -40,13 +40,13 @@
</tr>
<tr>
<td class=form-label></td>
<td class=form-widget><input type=submit value=Submit></td>
<td class=form-widget><input type="submit" value="Submit"></td>
</tr>
</table>
</td><td>
<table border=0 cellspacing=1 cellpadding=1>
<table border="0" cellspacing="1" cellpadding="1">
<tr>
<td class=form-label>Show<br>Fields</td>
<td class=form-widget>
......
......@@ -26,13 +26,13 @@ ad_page_contract {
# because it identifies unquely the report's Menu and
# its permissions.
set menu_label "reporting-timesheet-finance"
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set read_p [db_string report_perms "
select im_object_permission_p(m.menu_id, :current_user_id, 'read')
from im_menus m
where m.label = :menu_label
" -default 'f']
if {![string equal "t" $read_p]} {
if {"t" ne $read_p } {
ad_return_complaint 1 [lang::message::lookup "" intranet-reporting.You_dont_have_permissions "You don't have the necessary permissions to view this page"]
ad_script_abort
}
......@@ -299,13 +299,13 @@ db_foreach hours $hours_sql {
if { ![info exists projects($hours_project_id,$user_id)] } {
set projects($hours_project_id,$user_id) 0
}
set projects($hours_project_id,$user_id) [expr $projects($hours_project_id,$user_id) + $logged_hours]
set projects($hours_project_id,$user_id) [expr {$projects($hours_project_id,$user_id) + $logged_hours}]
foreach parent_id $project_parents($hours_project_id) {
if { ![info exists projects($parent_id,$user_id)] } {
set projects($parent_id,$user_id) 0
}
set projects($parent_id,$user_id) [expr $projects($parent_id,$user_id) + $logged_hours]
set projects($parent_id,$user_id) [expr {$projects($parent_id,$user_id) + $logged_hours}]
}
}
......@@ -317,7 +317,7 @@ db_foreach hours $hours_sql {
set elements [list]
if {[lsearch $display_fields "customer_name"] >= 0} {
if {"customer_name" in $display_fields} {
lappend elements customer_name
lappend elements {
label "Customer"
......@@ -328,7 +328,7 @@ if {[lsearch $display_fields "customer_name"] >= 0} {
}
}
}
if {[lsearch $display_fields "project_nr"] >= 0} {
if {"project_nr" in $display_fields} {
lappend elements project_nr
lappend elements {
label "Project Nr"
......@@ -352,7 +352,7 @@ lappend elements {
}
}
if {[lsearch $display_fields "start_date"] >= 0} {
if {"start_date" in $display_fields} {
lappend elements child_start_date
lappend elements {
label "Start"
......@@ -360,7 +360,7 @@ if {[lsearch $display_fields "start_date"] >= 0} {
}
}
if {[lsearch $display_fields "end_date"] >= 0} {
if {"end_date" in $display_fields} {
lappend elements child_end_date
lappend elements {
label "End"
......@@ -368,7 +368,7 @@ if {[lsearch $display_fields "end_date"] >= 0} {
}
}
if {[lsearch $display_fields "cost_invoices_cache"] >= 0} {
if {"cost_invoices_cache" in $display_fields} {
lappend elements cost_invoices_cache
lappend elements {
label "Invoice"
......@@ -376,56 +376,56 @@ if {[lsearch $display_fields "cost_invoices_cache"] >= 0} {
}
}
if {[lsearch $display_fields "cost_delivery_notes_cache"] >= 0} {
if {"cost_delivery_notes_cache" in $display_fields} {
lappend elements cost_delivery_notes_cache
lappend elements {
label "DelNote"
html "align right"
}
}
if {[lsearch $display_fields "cost_quotes_cache"] >= 0} {
if {"cost_quotes_cache" in $display_fields} {
lappend elements cost_quotes_cache
lappend elements {
label "Quote"
html "align right"
}
}
if {[lsearch $display_fields "cost_bills_cache"] >= 0} {
if {"cost_bills_cache" in $display_fields} {
lappend elements cost_bills_cache
lappend elements {
label "Bill"
html "align right"
}
}
if {[lsearch $display_fields "cost_expense_logged_cache"] >= 0} {
if {"cost_expense_logged_cache" in $display_fields} {
lappend elements cost_expense_logged_cache
lappend elements {
label "Expense"
html "align right"
}
}
if {[lsearch $display_fields "cost_timesheet_logged_cache"] >= 0} {
if {"cost_timesheet_logged_cache" in $display_fields} {
lappend elements cost_timesheet_logged_cache
lappend elements {
label "TimeS"
html "align right"
}
}
if {[lsearch $display_fields "cost_purchase_orders_cache"] >= 0} {
if {"cost_purchase_orders_cache" in $display_fields} {
lappend elements cost_purchase_orders_cache
lappend elements {
label "POs"
html "align right"
}
}
if {[lsearch $display_fields "direct_hours"] >= 0} {
if {"direct_hours" in $display_fields} {
lappend elements direct_hours
lappend elements {
label "Direct<br>Hours"
display_template { <b><div align=right>@project_list.direct_hours@</div></b> }
}
}
if {[lsearch $display_fields "reported_hours_cache"] >= 0} {
if {"reported_hours_cache" in $display_fields} {
lappend elements reported_hours_cache
lappend elements {
label "Total <br>Hours"
......@@ -501,7 +501,7 @@ db_multirow -extend {level_spacer open_gif} project_list project_list "
for {set i 0} {$i < $tree_level} {incr i} { append level_spacer "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" }
# Open/Close Logic
set open_p [expr [lsearch $opened_projects $child_id] >= 0]
set open_p [expr {[lsearch $opened_projects $child_id] >= 0}]
if {$open_p} {
set opened $opened_projects
......
......@@ -22,7 +22,7 @@ ad_page_contract {
# Security & Permissions
# ------------------------------------------------------------
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
# Check privileges
set view_hours_all_p [im_permission $current_user_id view_hours_all]
......@@ -40,7 +40,7 @@ set read_p [db_string report_perms "
where m.label = 'timesheet-incomplete-days'
" -default 'f']
if {![string equal "t" $read_p] && ![im_is_user_site_wide_or_intranet_admin $current_user_id]} {
if {"t" ne $read_p && ![im_is_user_site_wide_or_intranet_admin $current_user_id]} {
ad_return_complaint 1 "<li>
[lang::message::lookup "" intranet-reporting.You_dont_have_permissions "You don't have the necessary permissions to view this page"]"
return
......@@ -71,7 +71,7 @@ if { [dt_ansi_to_julian_single_arg $start_date] > [dt_ansi_to_julian_single_arg
ad_return_complaint 1 "<strong>End Date</strong> must be later than <strong>Start Date</strong>"
}
set duration_in_days [expr [db_string get_data "select date_part('day', :end_date::timestamp - :start_date::timestamp)" -default 0] +1]
set duration_in_days [expr {[db_string get_data "select date_part('day', :end_date::timestamp - :start_date::timestamp)" -default 0] +1}]
if { $duration_in_days > 365 } {
ad_return_complaint 1 "Periods > 1 year are not allowed"
......@@ -106,7 +106,7 @@ set inner_where ""
set criteria_inner [list]
# Check for filter "Employee"
if { [info exists user_id] && $user_id != "" } { lappend criteria_inner "user_id = :user_id" } else { set user_id ""}
if { [info exists user_id] && $user_id ne "" } { lappend criteria_inner "user_id = :user_id" } else { set user_id ""}
# Check for filter "Cost Center"
if { "0" != $cost_center_id && "" != $cost_center_id } {
......@@ -139,7 +139,7 @@ if { 0 != $skill_profile_id } {
}
# Create "inner where"
if { ![empty_string_p $criteria_inner] } {
if { $criteria_inner ne "" } {
set inner_where [join $criteria_inner " and\n "]
}
if {"" != $inner_where} { set inner_where "and $inner_where" }
......
......@@ -34,7 +34,7 @@ ad_page_contract {
# Uses the same label as the timesheet report.
set menu_label "reporting-timesheet-customer-project"
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set read_p [db_string report_perms "
select im_object_permission_p(m.menu_id, :current_user_id, 'read')
......@@ -65,7 +65,7 @@ set date_signature_l10n [lang::message::lookup "" intranet-reporting.Date_Signat
# ------------------------------------------------------------
if {![string equal "t" $read_p]} {
if {"t" ne $read_p } {
ad_return_complaint 1 "
[lang::message::lookup "" intranet-reporting.You_dont_have_permissions "You don't have the necessary permissions to view this page"]"
return
......@@ -141,7 +141,7 @@ if {0 != $project_id && "" != $project_id} {
}
set where_clause [join $criteria " and\n "]
if { ![empty_string_p $where_clause] } {
if { $where_clause ne "" } {
set where_clause " and $where_clause"
}
......@@ -533,8 +533,8 @@ switch $output_template {
<td id=time>$description</td>
</tr>
"
set sub_total [expr $sub_total + $hours]
set grand_total [expr $grand_total + $hours]
set sub_total [expr {$sub_total + $hours}]
set grand_total [expr {$grand_total + $hours}]
}
......
This diff is collapsed.
......@@ -28,7 +28,7 @@ ad_page_contract {
# Label: Provides the security context for this report
set menu_label "timesheet-productivity-calendar-view-workdays-simple"
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set read_p [db_string report_perms "
select im_object_permission_p(m.menu_id, :current_user_id, 'read')
......@@ -36,7 +36,7 @@ set read_p [db_string report_perms "
where m.label = :menu_label
" -default 'f']
if {![string equal "t" $read_p]} {
if {"t" ne $read_p } {
ad_return_complaint 1 "<li>
[lang::message::lookup "" intranet-reporting.You_dont_have_permissions "You don't have the necessary permissions to view this page"]"
return
......@@ -62,7 +62,7 @@ set date_format "YYYY-MM-DD"
set todays_date [db_string todays_date "select to_char(now(), :date_format) from dual" -default ""]
if { [empty_string_p $report_year_month] } {
if { $report_year_month eq "" } {
set report_year_month "[string range $todays_date 0 3]-[string range $todays_date 5 6]"
}
......@@ -93,7 +93,7 @@ set im_user_absence_type_training 5004
# Conditional SQL Where-Clause
#
if {[empty_string_p $different_from_project_p]} {
if {$different_from_project_p eq ""} {
set mm_checked ""
set mm_value ""
} else {
......@@ -103,7 +103,7 @@ if {[empty_string_p $different_from_project_p]} {
set criteria [list]
if {"" != $project_id && 0 != $project_id && $different_from_project_p == ""} {
if {"" != $project_id && 0 != $project_id && $different_from_project_p eq ""} {
lappend criteria "
p.project_id in (
select
......@@ -118,7 +118,7 @@ if {"" != $project_id && 0 != $project_id && $different_from_project_p == ""} {
"
}
if {"" != $project_id && 0 != $project_id && $different_from_project_p != ""} {
if {"" != $project_id && 0 != $project_id && $different_from_project_p ne ""} {
lappend criteria "
p.project_id in (
select
......@@ -137,7 +137,7 @@ if {"" != $customer_id && 0 != $customer_id} {
lappend criteria "p.company_id = :customer_id"
}
if { ![empty_string_p $project_status_id] && $project_status_id > 0 } {
if { $project_status_id ne "" && $project_status_id > 0 } {
lappend criteria "p.project_status_id in ([join [im_sub_categories $project_status_id] ","])"
}
......@@ -166,7 +166,7 @@ if { $show_user_only_p } {
# ad_return_complaint 1 $show_user_only_p
set where_clause [join $criteria " and\n "]
if { ![empty_string_p $where_clause] } {
if { $where_clause ne "" } {
set where_clause " and $where_clause"
}
......@@ -311,7 +311,7 @@ order by
set line_str " \"\" \"<b><a href=\$project_url\$top_parent_project_id>\${top_project_nr} - \${top_project_name}</a></b>\" \"<b><a href=\$project_url\$sub_project_id>\${sub_project_nr} - \${sub_project_name}</a></b>\" "
append line_str $day_placeholders "\$number_hours_project_ctr"
set no_empty_columns [expr $duration+1]
set no_empty_columns [expr {$duration+1}]
set report_def [list group_by user_id header {"\#colspan=99 <a href=$user_url$user_id>$user_name</a>"} content]
lappend report_def [list group_by project_id header $line_str content {}]
......@@ -631,12 +631,12 @@ db_foreach sql $sql {
if { "" != [expr $$day_double_digit] } {
set thours_arr($day_double_digit) [expr $thours_arr($day_double_digit) + $$day_double_digit]
set number_hours_project_ctr [expr $number_hours_project_ctr + [expr $$day_double_digit]]
set number_hours_ctr_pretty [expr $number_hours_ctr_pretty + [expr $$day_double_digit]]
set number_hours_project_ctr [expr {$number_hours_project_ctr + [expr $$day_double_digit]}]
set number_hours_ctr_pretty [expr {$number_hours_ctr_pretty + [expr $$day_double_digit]}]
if { 0 == $month_arr($day_double_digit) } {
set month_arr($day_double_digit) 1
set number_hours_ctr [expr $number_hours_ctr + $thours_arr($day_double_digit)]
set number_hours_ctr [expr {$number_hours_ctr + $thours_arr($day_double_digit)}]
}
}
......
......@@ -28,7 +28,7 @@ ad_page_contract {
# its permissions.
set menu_label "reporting-timesheet-productivity"
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set read_p [db_string report_perms "
select im_object_permission_p(m.menu_id, :current_user_id, 'read')
......@@ -36,7 +36,7 @@ set read_p [db_string report_perms "
where m.label = :menu_label
" -default 'f']
if {![string equal "t" $read_p]} {
if {"t" ne $read_p } {
ad_return_complaint 1 "<li>
[lang::message::lookup "" intranet-reporting.You_dont_have_permissions "You don't have the necessary permissions to view this page"]"
return
......@@ -105,7 +105,7 @@ if { [info exists cost_center_id] && 0 != $cost_center_id && "" != $cost_center_
}
set where_clause [join $criteria " and\n "]
if { ![empty_string_p $where_clause] } {
if { $where_clause ne "" } {
set where_clause " and $where_clause"
}
......
This diff is collapsed.
......@@ -25,7 +25,7 @@ ad_page_contract {
# because it identifies unquely the report's Menu and
# its permissions.
set menu_label "reporting-timesheet-productivity"
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set use_project_name_p [parameter::get_from_package_key -package_key intranet-reporting -parameter "UseProjectNameInsteadOfProjectNr" -default 0]
set read_p [db_string report_perms "
......@@ -34,7 +34,7 @@ set read_p [db_string report_perms "
where m.label = :menu_label
" -default 'f']
if {![string equal "t" $read_p]} {
if {"t" ne $read_p } {
ad_return_complaint 1 "<li>
[lang::message::lookup "" intranet-reporting.You_dont_have_permissions "You don't have the necessary permissions to view this page"]"
return
......@@ -106,7 +106,7 @@ if {[info exists user_id] && 0 != $user_id && "" != $user_id} {
}
set where_clause [join $criteria " and\n "]
if { ![empty_string_p $where_clause] } {
if { $where_clause ne "" } {
set where_clause " and $where_clause"
}
......
......@@ -19,7 +19,7 @@ ad_page_contract {
{ limit 1000 }
}
# set current_user_id [ad_maybe_redirect_for_registration]
# set current_user_id [auth::require_login]
set current_user_id [ad_conn user_id]
set menu_label "reporting-user-contacts"
set read_p [db_string report_perms "
......@@ -28,7 +28,7 @@ set read_p [db_string report_perms "
where m.label = :menu_label
" -default 'f']
if {![string equal "t" $read_p]} {
if {"t" ne $read_p } {
set message "You don't have the necessary permissions to view this page"
ad_return_complaint 1 "<li>$message"
ad_script_abort
......@@ -43,7 +43,7 @@ set role_id 1300
set object_id 0
set notify_asignee 1
set offset [expr $page * $limit]
set offset [expr {$page * $limit}]
# ------------------------------------------------------------
# Page Title, Bread Crums and Help
......@@ -378,7 +378,7 @@ db_foreach sql $report_sql {
# a "hash", depending on the value of "counter".
# You need explicite evaluation ("expre") in TCL
# to calculate arithmetic expressions.
set class $rowclass([expr $counter % 2])
set class $rowclass([expr {$counter % 2}])
im_report_display_footer \
-output_format $output_format \
......
......@@ -28,14 +28,14 @@ ad_page_contract {
# because it identifies unquely the report's Menu and
# its permissions.
set menu_label "reporting-vaw-project-documents"
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set read_p [db_string report_perms "
select im_object_permission_p(m.menu_id, :current_user_id, 'read')
from im_menus m
where m.label = :menu_label
" -default 'f']
if {![string equal "t" $read_p]} {
if {"t" ne $read_p } {
ad_return_complaint 1 "<li>
[lang::message::lookup "" intranet-reporting.You_dont_have_permissions "You don't have the necessary permissions to view this page"]"
return
......@@ -182,7 +182,7 @@ if {0 != $project_id} {
}
set where_clause [join $criteria " and\n "]
if { ![empty_string_p $where_clause] } {
if { $where_clause ne "" } {
set where_clause " and $where_clause"
}
......
<master src="../../intranet-core/www/master">
<property name="context">@context;noquote@</property>
<property name="title">@page_title@</property>
<property name="context">@context;literal@</property>
<property name="doc(title)">@page_title;literal@</property>
<property name="main_navbar_label">reporting</property>
<property name="left_navbar">@left_navbar_html;noquote@</property>
<property name="left_navbar">@left_navbar_html;literal@</property>
<!-- <h2>@page_title@</h2> -->
......
......@@ -145,7 +145,7 @@ set read_p [db_string report_perms "
from im_menus m
where m.menu_id = :menu_id
" -default 'f']
if {![string equal "t" $read_p]} {
if {"t" ne $read_p } {
set msg_l10n [lang::message::lookup "" intranet-reporting.You_dont_have_permissions "You don't have the necessary permissions to view this page"]
im_reporting_rest_error -format $format -error_message $msg_l10n
}
......
......@@ -35,7 +35,7 @@ ad_page_contract {
# -------------------------------------
# ToDo: Check usefullness of [im_rest_authenticate]
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
# -------------------------------------
# Body
......
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