Commit acb2356e authored by Frank Bergmann's avatar Frank Bergmann

- Gustaf changes

parent 95a1568f
......@@ -355,7 +355,7 @@ ad_proc -public im_sla_ticket_solution_time_sweeper {
the limit is set to 100 by default.
} {
ns_log Notice "im_sla_ticket_solution_time_sweeper: starting"
set traffic_light_limit [expr $limit * 1000]
set traffic_light_limit [expr {$limit * 1000}]
# Make sure that only one thread is calculating at a time
if {[nsv_incr intranet_sla_management sweeper_p] > 1} {
......@@ -564,17 +564,17 @@ ad_proc -public im_sla_ticket_traffic_light_sweeper_helper {
set color ""
if {[catch {
if {"" != $green_expr && [expr $green_expr]} { set color [im_project_on_track_status_green] }
if {"" != $green_expr && [expr {$green_expr}]} { set color [im_project_on_track_status_green] }
} err_msg]} {
ns_log Error "im_sla_ticket_traffic_light_sweeper_helper: #$ticket_id: Error evaluating green_expr=$green_expr: $err_msg"
}
if {[catch {
if {"" != $yellow_expr && [expr $yellow_expr]} { set color [im_project_on_track_status_yellow] }
if {"" != $yellow_expr && [expr {$yellow_expr}]} { set color [im_project_on_track_status_yellow] }
} err_msg]} {
ns_log Error "im_sla_ticket_traffic_light_sweeper_helper: #$ticket_id: Error evaluating yellow_expr=$yellow_expr: $err_msg"
}
if {[catch {
if {"" != $red_expr && [expr $red_expr]} { set color [im_project_on_track_status_red] }
if {"" != $red_expr && [expr {$red_expr}]} { set color [im_project_on_track_status_red] }
} err_msg]} {
ns_log Error "im_sla_ticket_traffic_light_sweeper_helper: #$ticket_id: Error evaluating red_expr=$red_expr: $err_msg"
}
......@@ -764,9 +764,9 @@ ad_proc -public im_sla_ticket_solution_time_sweeper_helper {
set start_julian($ticket_id) $ticket_creation_julian
set start_epoch($ticket_id) $ticket_creation_epoch
set end_julian($ticket_id) $now_julian
set epoch_{$ticket_id}([expr $ticket_creation_epoch - 0.0003]) "creation"
set epoch_{$ticket_id}([expr {$ticket_creation_epoch - 0.0003}]) "creation"
set julian_{$ticket_id}($ticket_creation_julian) "creation"
set epoch_{$ticket_id}([expr $now_epoch + 0.0003]) "now"
set epoch_{$ticket_id}([expr {$now_epoch + 0.0003}]) "now"
set julian_{$ticket_id}($now_julian) "now"
if {$debug_p} { append time_html "<li>sla_id=$sla_id, $ticket_id: ticket_creation_epoch=$ticket_creation_epoch" }
......@@ -799,12 +799,12 @@ ad_proc -public im_sla_ticket_solution_time_sweeper_helper {
set service_start_minute [string trimleft [lindex $service_start_list 1] "0"]
if {"" == $service_start_hour} { set service_start_hour 0 }
if {"" == $service_start_minute} { set service_start_minute 0 }
set service_start_epoch [expr [im_date_julian_to_epoch $j] + 3600.0*$service_start_hour + 60.0*$service_start_minute + 0.01]
set service_start_epoch [expr {[im_date_julian_to_epoch $j] + 3600.0*$service_start_hour + 60.0*$service_start_minute + 0.01}]
set epoch_{$ticket_id}($service_start_epoch) "service_start"
if {$debug_p} {
ns_log Notice "im_sla_ticket_solution_time: ticket_id=$ticket_id, service_start=$service_start, hour=$service_start_hour, min=$service_start_minute"
set service_start_epoch2 [db_string epoch "select extract(epoch from to_timestamp('$j $service_start', 'J HH24:MM')) + 0.01"]
ns_log Notice "im_sla_ticket_solution_time: diff=[expr $service_start_epoch - $service_start_epoch2]"
ns_log Notice "im_sla_ticket_solution_time: diff=[expr {$service_start_epoch - $service_start_epoch2}]"
append debug_html "<li>Start: julian=$j, ansi=[im_date_julian_to_ansi $j], service_start=$service_start, service_start_epoch=$service_start_epoch\n"
}
......@@ -818,12 +818,12 @@ ad_proc -public im_sla_ticket_solution_time_sweeper_helper {
set service_end_minute [string trimleft [lindex $service_end_list 1] "0"]
if {"" == $service_end_hour} { set service_end_hour 0 }
if {"" == $service_end_minute} { set service_end_minute 0 }
set service_end_epoch [expr [im_date_julian_to_epoch $j] + 3600.0*$service_end_hour + 60.0*$service_end_minute + 0.01]
set service_end_epoch [expr {[im_date_julian_to_epoch $j] + 3600.0*$service_end_hour + 60.0*$service_end_minute + 0.01}]
set epoch_{$ticket_id}($service_end_epoch) "service_end"
if {$debug_p} {
ns_log Notice "im_sla_ticket_solution_time: ticket_id=$ticket_id, service_end=$service_end, hour=$service_end_hour, min=$service_end_minute"
set service_end_epoch2 [db_string epoch "select extract(epoch from to_timestamp('$j $service_end', 'J HH24:MM')) + 0.01"]
ns_log Notice "im_sla_ticket_solution_time: diff=[expr $service_end_epoch - $service_end_epoch2]"
ns_log Notice "im_sla_ticket_solution_time: diff=[expr {$service_end_epoch - $service_end_epoch2}]"
append debug_html "<li>End: julian=$j, ansi=[im_date_julian_to_ansi $j], service_end=$service_end, service_end_epoch=$service_end_epoch\n"
}
}
......@@ -849,7 +849,7 @@ ad_proc -public im_sla_ticket_solution_time_sweeper_helper {
set labour_start_minute [string trimleft [lindex $labour_start_list 1] "0"]
if {"" == $labour_start_hour} { set labour_start_hour 0 }
if {"" == $labour_start_minute} { set labour_start_minute 0 }
set labour_start_epoch [expr [im_date_julian_to_epoch $j] + 3600.0*$labour_start_hour + 60.0*$labour_start_minute + 0.04]
set labour_start_epoch [expr {[im_date_julian_to_epoch $j] + 3600.0*$labour_start_hour + 60.0*$labour_start_minute + 0.04}]
set epoch_{$ticket_id}($labour_start_epoch) "labour_start"
# Write the affected groups into a hash
......@@ -866,7 +866,7 @@ ad_proc -public im_sla_ticket_solution_time_sweeper_helper {
if {$debug_p} {
ns_log Notice "im_sla_ticket_solution_time: ticket_id=$ticket_id, labour_start=$labour_start, hour=$labour_start_hour, min=$labour_start_minute"
set labour_start_epoch2 [db_string epoch "select extract(epoch from to_timestamp('$j $labour_start', 'J HH24:MM')) + 0.04"]
ns_log Notice "im_sla_ticket_solution_time: diff=[expr $labour_start_epoch - $labour_start_epoch2]"
ns_log Notice "im_sla_ticket_solution_time: diff=[expr {$labour_start_epoch - $labour_start_epoch2}]"
append debug_html "<li>Labour Start: julian=$j, ansi=[im_date_julian_to_ansi $j], labour_start=$labour_start, labour_start_epoch=$labour_start_epoch\n"
}
......@@ -880,7 +880,7 @@ ad_proc -public im_sla_ticket_solution_time_sweeper_helper {
set labour_end_minute [string trimleft [lindex $labour_end_list 1] "0"]
if {"" == $labour_end_hour} { set labour_end_hour 0 }
if {"" == $labour_end_minute} { set labour_end_minute 0 }
set labour_end_epoch [expr [im_date_julian_to_epoch $j] + 3600.0*$labour_end_hour + 60.0*$labour_end_minute + 0.04]
set labour_end_epoch [expr {[im_date_julian_to_epoch $j] + 3600.0*$labour_end_hour + 60.0*$labour_end_minute + 0.04}]
set epoch_{$ticket_id}($labour_end_epoch) "labour_end"
# Write the affected groups into a hash
set groups [list]
......@@ -890,7 +890,7 @@ ad_proc -public im_sla_ticket_solution_time_sweeper_helper {
if {$debug_p} {
ns_log Notice "im_sla_ticket_solution_time: ticket_id=$ticket_id, labour_end=$labour_end, hour=$labour_end_hour, min=$labour_end_minute"
set labour_end_epoch2 [db_string epoch "select extract(epoch from to_timestamp('$j $labour_end', 'J HH24:MM')) + 0.04"]
ns_log Notice "im_sla_ticket_solution_time: diff=[expr $labour_end_epoch - $labour_end_epoch2]"
ns_log Notice "im_sla_ticket_solution_time: diff=[expr {$labour_end_epoch - $labour_end_epoch2}]"
append debug_html "<li>Labour End: julian=$j, ansi=[im_date_julian_to_ansi $j], labour_end=$labour_end, labour_end_epoch=$labour_end_epoch\n"
}
}
......@@ -1022,7 +1022,7 @@ ad_proc -public im_sla_ticket_solution_time_sweeper_helper {
set event [lindex $event_full 0]
# Calculate duration since last event
set duration_epoch [expr $e - $last_epoch]
set duration_epoch [expr {$e - $last_epoch}]
# Which queue is responsible for the time passed?
if {[info exists queue_hash($e)]} {
......@@ -1046,7 +1046,7 @@ ad_proc -public im_sla_ticket_solution_time_sweeper_helper {
foreach sh $labour_hours {
set labour_start [lindex $sh 0]
set labour_end [lindex $sh 1]
if {[string compare $labour_start $e_time] <= 0 && [string compare $e_time $labour_end] <= 0} {
if {$labour_start ne $e_time <= 0 && $e_time ne $labour_end <= 0} {
# The event's time ($e_time) is between start and end time
set ticket_labour_hour_p 1
}
......@@ -1069,13 +1069,13 @@ ad_proc -public im_sla_ticket_solution_time_sweeper_helper {
}
service_start {
# Check if we were to count the duration until now
set count_duration_p [expr $ticket_open_p && $ticket_lifetime_p && $ticket_service_hour_p && $ticket_labour_hour_p]
set count_duration_p [expr {$ticket_open_p && $ticket_lifetime_p && $ticket_service_hour_p && $ticket_labour_hour_p}]
# Start counting the time from now on.
set ticket_service_hour_p 1
}
service_end {
# Check if we were to count the duration until now
set count_duration_p [expr $ticket_open_p && $ticket_lifetime_p && $ticket_service_hour_p && $ticket_labour_hour_p]
set count_duration_p [expr {$ticket_open_p && $ticket_lifetime_p && $ticket_service_hour_p && $ticket_labour_hour_p}]
# Don't count time from now on until the next service_start
set ticket_service_hour_p 0
}
......@@ -1086,7 +1086,7 @@ ad_proc -public im_sla_ticket_solution_time_sweeper_helper {
if {-1 == [lsearch $affected_groups $queue_id]} { continue }
# Check if we were to count the duration until now
set count_duration_p [expr $ticket_open_p && $ticket_lifetime_p && $ticket_service_hour_p && $ticket_labour_hour_p]
set count_duration_p [expr {$ticket_open_p && $ticket_lifetime_p && $ticket_service_hour_p && $ticket_labour_hour_p}]
# Start counting the time from now on.
set ticket_labour_hour_p 1
}
......@@ -1097,13 +1097,13 @@ ad_proc -public im_sla_ticket_solution_time_sweeper_helper {
if {-1 == [lsearch $affected_groups $queue_id]} { continue }
# Check if we were to count the duration until now
set count_duration_p [expr $ticket_open_p && $ticket_lifetime_p && $ticket_service_hour_p && $ticket_labour_hour_p]
set count_duration_p [expr {$ticket_open_p && $ticket_lifetime_p && $ticket_service_hour_p && $ticket_labour_hour_p}]
# Don't count time from now on until the next labour_start
set ticket_labour_hour_p 0
}
now {
# Check if we were to count the duration until now
set count_duration_p [expr $ticket_open_p && $ticket_lifetime_p && $ticket_service_hour_p && $ticket_labour_hour_p]
set count_duration_p [expr {$ticket_open_p && $ticket_lifetime_p && $ticket_service_hour_p && $ticket_labour_hour_p}]
# Current time. Don't count from here into the future...
set ticket_lifetime_p 0
}
......@@ -1118,7 +1118,7 @@ ad_proc -public im_sla_ticket_solution_time_sweeper_helper {
}
# Check if we were to count the duration until now
set count_duration_p [expr $ticket_open_p && $ticket_lifetime_p && $ticket_service_hour_p && $ticket_labour_hour_p]
set count_duration_p [expr {$ticket_open_p && $ticket_lifetime_p && $ticket_service_hour_p && $ticket_labour_hour_p}]
# Determine ticket status"
if {[lsearch $ticket_open_states $event] > -1} {
......@@ -1133,13 +1133,13 @@ ad_proc -public im_sla_ticket_solution_time_sweeper_helper {
if {$count_duration_p} {
# Total resolution time counter
set resolution_seconds [expr $resolution_seconds + $duration_epoch]
set resolution_seconds [expr {$resolution_seconds + $duration_epoch}]
# Resolution time per queue
if {"" != $last_queue_id} {
set seconds 0.0
if {[info exists queue_resolution_time($last_queue_id)]} { set seconds $queue_resolution_time($last_queue_id) }
set seconds [expr $seconds + $duration_epoch]
set seconds [expr {$seconds + $duration_epoch}]
set queue_resolution_time($last_queue_id) $seconds
}
}
......@@ -1155,20 +1155,20 @@ ad_proc -public im_sla_ticket_solution_time_sweeper_helper {
set restime_html ""
foreach q [lsort -integer [array names queue_resolution_time]] {
set q_name [util_memoize [list db_string queue "select group_name from groups where group_id = $q" -default ""]]
append restime_html "$q_name=[expr round(100 * $queue_resolution_time($q)) / 100.0], "
append restime_html "$q_name=[expr {round(100 * $queue_resolution_time($q)) / 100.0}], "
}
append time_html "
<tr>
<td>[expr round(100.0 * $e) / 100.0]</td>
<td>[expr {round(100.0 * $e) / 100.0}]</td>
<td>[im_date_epoch_to_ansi $e] [im_date_epoch_to_time $e]</td>
<td><font color=$color><nobr>$event $event_pretty</nobr></font></td>
<td align=right>[expr round(100.0 * $duration_epoch) / 100.0]</td>
<td align=right>[expr {round(100.0 * $duration_epoch) / 100.0}]</td>
<td align=right>$count_duration_p</td>
<td>$last_queue_name</td>
<td>$queue_name</td>
<td align=right>[expr round(100.0 * $resolution_seconds) / 100.0]</td>
<td align=right>[expr round(100.0 * $resolution_seconds / 60.0) / 100.0 ]</td>
<td align=right>[expr round(100.0 * $resolution_seconds / 3600.0) / 100.0]</td>
<td align=right>[expr {round(100.0 * $resolution_seconds) / 100.0}]</td>
<td align=right>[expr {round(100.0 * $resolution_seconds / 60.0) / 100.0 }]</td>
<td align=right>[expr {round(100.0 * $resolution_seconds / 3600.0) / 100.0}]</td>
<td>$restime_html</td>
</tr>
"
......@@ -1193,7 +1193,7 @@ ad_proc -public im_sla_ticket_solution_time_sweeper_helper {
# Update the resolution time of the ticket
db_dml update_resolution_time "
update im_tickets set
ticket_resolution_time = [expr $resolution_seconds / 3600.0],
ticket_resolution_time = [expr {$resolution_seconds / 3600.0}],
ticket_resolution_time_dirty = now(),
ticket_resolution_time_per_queue = '{$restime_per_queue}'
where ticket_id = :ticket_id
......
<if @enable_master_p@><master></if>
<property name="title">@page_title@</property>
<property name="context">@context;noquote@</property>
<property name="doc(title)">@page_title;literal@</property>
<property name="context">@context;literal@</property>
<property name="main_navbar_label">helpdesk</property>
<property name="focus">@focus;noquote@</property>
<property name="sub_navbar">@sub_navbar;noquote@</property>
<property name="left_navbar">@left_navbar_html;noquote@</property>
<property name="focus">@focus;literal@</property>
<property name="sub_navbar">@sub_navbar;literal@</property>
<property name="left_navbar">@left_navbar_html;literal@</property>
<SCRIPT Language=JavaScript src=/resources/diagram/diagram/diagram.js></SCRIPT>
......
......@@ -25,7 +25,7 @@ ad_page_contract {
# Defaults & Security
# ---------------------------------------------------------------
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set page_title [lang::message::lookup "" intranet-sla-management.SLA_Parameter "SLA Parameter"]
if {[info exists param_id]} { set page_title [lang::message::lookup "" intranet-sla-management.SLA_parameter SLA_parameter] }
set context_bar [im_context_bar $page_title]
......
<master>
<property name="title">@page_title@</property>
<property name="doc(title)">@page_title;literal@</property>
<property name="context">#intranet-core.context#</property>
<property name="main_navbar_label">helpdesk</property>
......@@ -29,7 +29,7 @@
<tr>
<td></td>
<td><input type=submit name=submit value="Add User to Tickets"></td>
<td><input type="submit" name="submit" value="Add User to Tickets"></td>
<td></td>
</tr>
</table>
......@@ -55,7 +55,7 @@
<tr>
<td></td>
<td><input type=submit name=submit value="Add User to Tickets"></td>
<td><input type="submit" name="submit" value="Add User to Tickets"></td>
<td></td>
</tr>
</table>
......
......@@ -22,7 +22,7 @@ ad_page_contract {
# Defaults & Security
# ---------------------------------------------------------------
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set page_title [lang::message::lookup "" intranet-sla-management.Associate_Ticket_With_$target_object_type "Associate Ticket With $target_object_type"]
set context_bar [im_context_bar $page_title]
set page_focus "im_header_form.keywords"
......
<master>
<property name="title">@page_title@</property>
<property name="doc(title)">@page_title;literal@</property>
<property name="context">#intranet-core.context#</property>
<property name="main_navbar_label">helpdesk</property>
......@@ -14,13 +14,13 @@
<%= [export_vars -form {tid return_url}] %>
<table>
<tr>
<th colspan=2><%= [lang::message::lookup "" intranet-sla-management.Associate_With "Associate With"] %></th>
<th colspan="2"><%= [lang::message::lookup "" intranet-sla-management.Associate_With "Associate With"] %></th>
<th> <%= [lang::message::lookup "" intranet-sla-management.Object Object] %></th>
<th> <%= [lang::message::lookup "" intranet-sla-management.Comment Comment] %></th>
</tr>
<tr>
<td> <input type=radio name=target_object_type value=indicator checked></td>
<td> <input type="radio" name="target_object_type" value="indicator" checked></td>
<td> <%= [lang::message::lookup "" intranet-sla-management.Object_Type_Indicator "Indicator"] %></td>
<td> <%= [im_report_select -report_type_id [im_report_type_indicator] -indicator_object_type "im_sla_parameter" indicator_id] %><br>
</td>
......@@ -31,7 +31,7 @@
<tr>
<td>&nbsp;</td>
<td><input type=submit name=submit value="<%= [lang::message::lookup "" intranet-sla-management.Associate_Assoc_Action Associate] %>"></td>
<td><input type="submit" name="submit" value="<%= [lang::message::lookup "" intranet-sla-management.Associate_Assoc_Action Associate] %>"></td>
<td>&nbsp;</td>
</tr>
......
......@@ -19,7 +19,7 @@ ad_page_contract {
# Defaults & Security
# ---------------------------------------------------------------
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set page_title [lang::message::lookup "" intranet-helpdesk.Associate_Param_With_Other_Object "Associate SLA Parameter With Another Object"]
set context_bar [im_context_bar $page_title]
set page_focus "im_header_form.keywords"
......
......@@ -35,7 +35,7 @@ ad_page_contract {
set menu_label "reporting-sla-resolution-time-per-support-group"
# Get the current user and make sure that he or she is logged in.
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 "
......@@ -45,7 +45,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
......@@ -557,7 +557,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}])
# Restrict the length of the project_name to max.
# 40 characters. (New!)
......@@ -575,11 +575,11 @@ db_foreach sql $report_sql {
# Calculated Variables (New!)
set po_per_quote_perc "undef"
if {[expr $quote_subtotal+0] != 0} {
set po_per_quote_perc [expr int(10000.0 * $po_subtotal / $quote_subtotal) / 100.0]
if {[expr {$quote_subtotal+0}] != 0} {
set po_per_quote_perc [expr {int(10000.0 * $po_subtotal / $quote_subtotal) / 100.0}]
set po_per_quote_perc "$po_per_quote_perc %"
}
set gross_profit [expr $invoice_subtotal - $bill_subtotal]
set gross_profit [expr {$invoice_subtotal - $bill_subtotal}]
set last_value_list [im_report_render_header \
-group_def $report_def \
......
......@@ -23,7 +23,7 @@ ad_page_contract {
# Security
#
set menu_label "reporting-helpdesk-sla-reaction-time"
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
......@@ -33,7 +33,7 @@ set read_p [db_string report_perms "
# For testing - set manually
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
......@@ -315,7 +315,7 @@ if {0 != $ticket_type_id && "" != $ticket_type_id} {
}
set where_clause [join $criteria " and\n\t\t"]
if { ![empty_string_p $where_clause] } { set where_clause " and $where_clause" }
if { $where_clause ne "" } { set where_clause " and $where_clause" }
set report_sql "
......@@ -524,7 +524,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 \
......@@ -584,7 +584,7 @@ im_report_display_footer \
# Calculate fields for totoal (footer0)
# which can be undefined.
set ticket_reaction_time_total_median 0.00
catch { set ticket_reaction_time_total_median [expr $ticket_reaction_time_total_sum / $ticket_reaction_time_total_count] }
catch { set ticket_reaction_time_total_median [expr {$ticket_reaction_time_total_sum / $ticket_reaction_time_total_count}] }
im_report_render_row \
-output_format $output_format \
......
......@@ -23,7 +23,7 @@ ad_page_contract {
# Security
#
set menu_label "reporting-helpdesk-sla-resolution-time"
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
......@@ -33,7 +33,7 @@ set read_p [db_string report_perms "
# For testing - set manually
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
......@@ -163,7 +163,7 @@ set footer0 {
""
""
""
"\#align=right \[lc_numeric \[expr round(100.0 * \$ticket_resolution_time_total_median) / 100.0\] {} \$locale\]"
"\#align=right \[lc_numeric \[expr {round(100.0 * \$ticket_resolution_time_total_median) / 100.0}\] {} \$locale\]"
}
......@@ -183,7 +183,7 @@ set sla_footer {
""
""
""
"\#align=right [lc_numeric [expr round(100.0 * $ticket_resolution_time_sla_sum / $ticket_resolution_time_sla_count) / 100.0] {} $locale]"
"\#align=right [lc_numeric [expr {round(100.0 * $ticket_resolution_time_sla_sum / $ticket_resolution_time_sla_count) / 100.0}] {} $locale]"
}
set ticket_header {
......@@ -368,7 +368,7 @@ if {0 != $ticket_type_id && "" != $ticket_type_id} {
}
set where_clause [join $criteria " and\n\t\t"]
if { ![empty_string_p $where_clause] } { set where_clause " and $where_clause" }
if { $where_clause ne "" } { set where_clause " and $where_clause" }
set report_sql "
......@@ -576,7 +576,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 \
......@@ -636,7 +636,7 @@ im_report_display_footer \
# Calculate fields for totoal (footer0)
# which can be undefined.
set ticket_resolution_time_total_median 0.00
catch { set ticket_resolution_time_total_median [expr $ticket_resolution_time_total_sum / $ticket_resolution_time_total_count] }
catch { set ticket_resolution_time_total_median [expr {$ticket_resolution_time_total_sum / $ticket_resolution_time_total_count}] }
im_report_render_row \
-output_format $output_format \
......
......@@ -2,17 +2,17 @@
<form action="/intranet-sla-management/service-hours-save" method=POST>
<%= [export_vars -form {return_url sla_id}] %>
<table cellspacing=0 cellpadding=0>
<table cellspacing="0" cellpadding="0">
<tr class=rowtitle>
<td class=rowtitle><%= [lang::message::lookup "" intranet-sla-management.Day "Day"] %></td>
<multiple name=hours>
<td class=rowtitle align=center>@hours.hour@</td>
<td class=rowtitle align="center">@hours.hour@</td>
</multiple>
</tr>
@body_html;noquote@
<tr>
<td colspan=25>
<input type=submit value=#intranet-core.Submit#>
<td colspan="25">
<input type="submit" value="#intranet-core.Submit#">
</td>
</tr>
</table>
......
......@@ -18,7 +18,7 @@
# Defaults & Security
# ---------------------------------------------------------------
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
if {"" == $return_url} { set return_url [im_url_with_query] }
set page_title [lang::message::lookup "" intranet-sla-management.Service_Hours "Service Hours"]
set context_bar [im_context_bar $page_title]
......@@ -61,7 +61,7 @@ for {set day 0} {$day < 7} {incr day} {
set line_html "<tr>\n"
append line_html "<td>[lindex $dow_list $day]</td>\n"
for {set h 0} {$h < 24} {incr h} {
set idx [expr $day*100 + $h]
set idx [expr {$day*100 + $h}]
set hh $h
if {[string length $hh] < 2} { set hh "0$hh" }
set hh "$hh:01"
......
......@@ -20,7 +20,7 @@ ad_page_contract {
# Defaults & Security
# ---------------------------------------------------------------
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set page_title [lang::message::lookup "" intranet-sla-management.Save_Service_Hours "Save Service Hours"]
set context_bar [im_context_bar $page_title]
set page_focus "im_header_form.keywords"
......@@ -64,7 +64,7 @@ foreach dow {0 1 2 3 4 5 6} {
set start_pretty $start
if {[string length $start_pretty] < 2} { set start_pretty "0$start" }
# The end time is the start of the next hour, so we have to add +1 to end
set end_pretty [expr $end + 1]
set end_pretty [expr {$end + 1}]
if {[string length $end_pretty] < 2} { set end_pretty "0$end_pretty" }
lappend service_hours [list "$start_pretty:00" "$end_pretty:00"]
......
......@@ -21,7 +21,7 @@ ad_page_contract {
# ---------------------------------------------------------------
set user_id [ad_maybe_redirect_for_registration]
set user_id [auth::require_login]
if {"" == $param} { ad_returnredirect $return_url }
switch $action {
......
......@@ -23,7 +23,7 @@
# Defaults & Security
# ---------------------------------------------------------------
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set add_reports_p [im_permission $current_user_id "add_reports"]
set view_reports_all_p [im_permission $current_user_id "view_reports_all"]
......@@ -149,7 +149,7 @@ set body_html ""
set old_param_id ""
set param_cnt 0
set indicator_cnt 0
set colspan [expr [llength $dynfield_attributes] + 2]
set colspan [expr {[llength $dynfield_attributes] + 2}]
# Read the results into a multirow because
# the "evaluate" needs to alloc an additional DB connection
......@@ -190,7 +190,7 @@ template::multirow foreach param_indicators {
}
# if {[regexp {^([0-9]*)\.([0-9][0-9])} $result match body fraction]} { set result "$body.$fraction" }
if {[string is double $result]} { set result [expr round(100.0 * $result) / 100.0] }
if {[string is double $result]} { set result [expr {round(100.0 * $result) / 100.0}] }
set diagram_html [im_indicator_horizontal_bar \
-name $report_name \
......@@ -220,7 +220,7 @@ template::multirow foreach param_indicators {
if {!$add_reports_p} { set edit_html "" }
set row_html ""
append row_html "<tr $bgcolor([expr $indicator_cnt % 2])>\n"
append row_html "<tr $bgcolor([expr {$indicator_cnt % 2}])>\n"
append row_html "<td>&nbsp;</td>\n"
# append row_html "<td><input type=checkbox name=indicator value=$indicator_id></input></td>\n"
set indicator_url [export_vars -base "/intranet-reporting-indicators/view" {indicator_id}]
......
......@@ -23,7 +23,7 @@ if {![info exists object_id]} {
# This portlet only makes sense in SLAs...
if {![info exists return_url] || "" == $return_url} { set return_url [im_url_with_query] }
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set new_sla_parameter_url [export_vars -base "/intranet-sla-management/new" {object_id return_url}]
# Check the permissions
......
......@@ -23,7 +23,7 @@ ad_page_contract {
# Defaults & Security
# ---------------------------------------------------------------
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set sla_id $project_id
im_project_permissions $current_user_id $project_id sla_view sla_read sla_write sla_admin
......
......@@ -18,7 +18,7 @@
<td><%= [im_category_select "Intranet Ticket Status" ticket_severity_id ""] %></td>
<td><%= [im_category_select "Intranet Ticket Priority" ticket_prio_id ""] %></td>
</tr>
<tr><td colspan=3><input type=submit value='@create_new_entry_msg@'></td></tr>
<tr><td colspan="3"><input type="submit" value='@create_new_entry_msg@'></td></tr>
</table>
</form>
......
......@@ -18,7 +18,7 @@
# Defaults & Security
# ---------------------------------------------------------------
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
if {"" == $return_url} { set return_url [im_url_with_query] }
set page_title [lang::message::lookup "" intranet-sla-management.Ticket_Priority "Ticket Priority"]
set context_bar [im_context_bar $page_title]
......
......@@ -21,7 +21,7 @@ ad_page_contract {
# Defaults & Security
# ---------------------------------------------------------------
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set sla_id $project_id
im_project_permissions $current_user_id $project_id sla_view sla_read sla_write sla_admin
......
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