Commit 12cf84f0 authored by Frank Bergmann's avatar Frank Bergmann

- Gustaf changes

parent f458ee2b
......@@ -20,7 +20,7 @@ if {![info exists diagram_project_id]} {
}
# Create a random ID for the diagram
set diagram_rand [expr round(rand() * 100000000.0)]
set diagram_rand [expr {round(rand() * 100000000.0)}]
set diagram_id "project_eva_$diagram_rand"
set default_currency [im_parameter -package_id [im_package_cost_id] "DefaultCurrency" "" "EUR"]
......
......@@ -24,7 +24,7 @@ set max_length_customer_name 15
# ----------------------------------------------------
# Create a random ID for the diagram
set diagram_rand [expr round(rand() * 100000000.0)]
set diagram_rand [expr {round(rand() * 100000000.0)}]
set diagram_id "top_customers_$diagram_rand"
set default_currency [im_parameter -package_id [im_package_cost_id] "DefaultCurrency" "" "EUR"]
......
This diff is collapsed.
<table cellspacing=0 cellpadding=0 width="100%">
<tr valign=center>
<table cellspacing="0" cellpadding="0" width="100%">
<tr valign="center">
<td>
</td>
<td align=right>
<td align="right">
@cube_link;noquote@
</td>
</tr>
......
<table cellspacing=0 cellpadding=0 width="100%">
<tr valign=center>
<table cellspacing="0" cellpadding="0" width="100%">
<tr valign="center">
<td>
<h2>@component_name@</h2>
</td>
<td align=right>
<td align="right">
@cube_link;noquote@
</td>
</tr>
......
<master>
<property name="title">@page_title@</property>
<property name="doc(title)">@page_title;literal@</property>
<property name="main_navbar_label">projects</property>
<property name="left_navbar">@left_navbar_html;noquote@</property>
<property name="left_navbar">@left_navbar_html;literal@</property>
<h1><%=[lang::message::lookup "" intranet-reporting-dashboard.Dashboard "Dashboard"]%></h1>
<%= [im_component_bay top] %>
<table cellpadding=0 cellspacing=0 border=0 width="100%">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td valign=top width='50%'>
<td valign="top" width='50%'>
<%= [im_component_bay left] %>
</td>
<td width='5px'>&nbsp;</td>
<td valign=top>
<td valign="top">
<%= [im_component_bay right] %>
</td>
</tr>
</table><br>
<table cellpadding=0 cellspacing=0 border=0 width="100%">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr><td>
<!-- Bottom Component Bay -->
<%= [im_component_bay bottom] %>
......
......@@ -34,7 +34,7 @@ ad_page_contract {
# Defaults & Security
# ---------------------------------------------------------------------
set show_context_help_p 0
set user_id [ad_maybe_redirect_for_registration]
set user_id [auth::require_login]
set return_url [im_url_with_query]
set current_url [ns_conn url]
set site_wide_admin_p [im_is_user_site_wide_or_intranet_admin $user_id]
......
<master src="../../intranet-core/www/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="dashboard">home</property>
<property name="focus">@page_focus;noquote@</property>
<property name="focus">@page_focus;literal@</property>
<h2>@page_title@</h2>
......
......@@ -21,7 +21,7 @@ ad_page_contract {
# Defaults & Security
# ---------------------------------------------------------------
set user_id [ad_maybe_redirect_for_registration]
set user_id [auth::require_login]
set page_title "[_ intranet-dashboard.Dashboard]"
set context_bar [im_context_bar $page_title]
set page_focus "im_header_form.keywords"
......
......@@ -91,7 +91,7 @@ template::multirow foreach mr {
set message "Data loaded. Warning: Using default hourly_cost=$default_hourly_cost"
set hourly_cost $default_hourly_cost
}
set total_planned_ts_value [expr $total_planned_ts_value + $planned_units * $hourly_cost]
set total_planned_ts_value [expr {$total_planned_ts_value + $planned_units * $hourly_cost}]
}
set timeline_list [lsort -integer [array name timeline_hash]]
......@@ -116,7 +116,7 @@ template::multirow foreach mr {
for {set i $start_idx} {$i < $end_idx} {incr i} {
set incl 0.0
if {[info exists inclination_hash($i)]} { set incl $inclination_hash($i) }
set incl [expr $incl + $inclination * $hourly_cost]
set incl [expr {$incl + $inclination * $hourly_cost}]
set inclination_hash($i) $incl
}
}
......@@ -128,22 +128,22 @@ template::multirow foreach mr {
# ----------------------------------------------------
set timeline_list_len [expr [llength $timeline_list] - 1]
set timeline_list_len [expr {[llength $timeline_list] - 1}]
set value 0.0
array set planned_ts_value_hash {}
set planned_ts_value_hash(0) $value
for {set i 0} {$i < $timeline_list_len} {incr i} {
set start_epoch [lindex $timeline_list $i]
set end_epoch [lindex $timeline_list [expr $i+1]]
set end_epoch [lindex $timeline_list $i+1]
set inclination 0.0
if {[info exists inclination_hash($i)]} { set inclination $inclination_hash($i) }
set duration_hours [expr ($end_epoch - $start_epoch) / 3600.0]
set delta [expr $duration_hours * $inclination]
set value [expr $value + $delta]
set delta [expr {$duration_hours * $inclination}]
set value [expr {$value + $delta}]
ns_log Notice "project-eva: i=$i: start:[im_date_epoch_to_ansi $start_epoch] [im_date_epoch_to_time $start_epoch], end:[im_date_epoch_to_ansi $end_epoch] [im_date_epoch_to_time $end_epoch], duration_hours=$duration_hours, inclination=$inclination, delta=$delta, value=$value"
set planned_ts_value_hash([expr $i+1]) $value
set planned_ts_value_hash([expr {$i+1}]) $value
}
......@@ -202,7 +202,7 @@ db_foreach ts $timesheet_sql {
# Update the hash
set key "$cost_type_id-$ctr"
set value [expr $value + $amount]
set value [expr {$value + $amount}]
set cost_hash($key) $value
}
......@@ -223,7 +223,7 @@ while {0 != $old_cost_type_id && $ctr < $timeline_list_len} {
set ctr 0
set json_lines {}
foreach epoch $timeline_list {
set planned_ts_value [expr round(100.0 * $planned_ts_value_hash($ctr)) / 100.0]
set planned_ts_value [expr {round(100.0 * $planned_ts_value_hash($ctr)) / 100.0}]
set json_values [list]
lappend json_values "'date': '[im_date_epoch_to_ansi $epoch] [im_date_epoch_to_time $epoch]'"
......
......@@ -67,7 +67,7 @@ db_foreach top_customers $top_customers_sql {
if {$count < $diagram_max_customers} {
multirow append top_customers $customer_name_limited $customer_revenues
} else {
set other_revenues [expr $other_revenues + $customer_revenues]
set other_revenues [expr {$other_revenues + $customer_revenues}]
}
incr count
......
......@@ -65,7 +65,7 @@ template::diagram::create \
}
}
if {[exists_and_not_null csv]} {
if {([info exists csv] && $csv ne "")} {
template::diagram::write_output -name dia1
}
......
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