Commit 3f1c28ab authored by Frank Bergmann's avatar Frank Bergmann

- Gustaf changes

parent 60d2f9ac
......@@ -80,7 +80,7 @@ if {![info exists ignore_hash($warning_key)]} {
set task_list_len [llength $task_list]
if {$task_list_len > 3} {
set task_list [lrange $task_list 0 2]
lappend task_list "... ([expr $task_list_len - 3] [lang::message::lookup "" intranet-ganttproject.more_tasks "more tasks"])"
lappend task_list "... ([expr {$task_list_len - 3}] [lang::message::lookup "" intranet-ganttproject.more_tasks "more tasks"])"
}
set project_id $main_project_id
......@@ -164,7 +164,7 @@ if {![info exists ignore_hash($warning_key)]} {
append task_html "</tr>\n"
}
if {[string length $task_html] > 0} {
if {$task_html ne ""} {
set task_header "<tr class=rowtitle>\n"
append task_header "<td class=rowtitle><input type=checkbox name=_dummy onclick=acs_ListCheckAll('task_with_empty_start_end_date',this.checked) checked></td>\n"
append task_header "<td class=rowtitle>[lang::message::lookup "" intranet-ganttproject.Task "Task"]</td>\n"
......@@ -372,11 +372,11 @@ if {![info exists ignore_hash($warning_key)]} {
set task_list_len [llength $task_list]
if {$task_list_len > 3} {
set task_list [lrange $task_list 0 2]
lappend task_list "... ([expr $task_list_len - 3] more tasks)"
lappend task_list "... ([expr {$task_list_len - 3}] more tasks)"
}
if {[string length $task_html] > 0} {
if {$task_html ne ""} {
set task_header "<tr class=rowtitle>\n"
append task_header "<td class=rowtitle><input type=checkbox name=_dummy onclick=acs_ListCheckAll('task_without_start_constraint',this.checked) checked></td>\n"
append task_header "<td class=rowtitle>[lang::message::lookup "" intranet-ganttproject.Task "Task"]</td>\n"
......@@ -490,10 +490,10 @@ if {0 && ![info exists ignore_hash($warning_key)]} {
if {"" == $project_calendar} { set project_calendar [im_ms_calendar::default] }
set seconds_in_interval [im_ms_calendar::seconds_in_interval -start_date $start_date -end_date $end_date -calendar $project_calendar]
set seconds_work [expr $seconds_in_interval * $percentage / 100.0]
set seconds_work [expr {$seconds_in_interval * $percentage / 100.0}]
switch $uom_id {
320 { set seconds_uom [expr $planned_units * 3600] }
321 { set seconds_uom [expr $planned_units * 3600 * 8.0] }
320 { set seconds_uom [expr {$planned_units * 3600}] }
321 { set seconds_uom [expr {$planned_units * 3600 * 8.0}] }
default { set seconds_uom 0.0 }
}
......@@ -503,12 +503,12 @@ if {0 && ![info exists ignore_hash($warning_key)]} {
if {"" != $seconds_in_timephased} { set seconds_work $seconds_in_timephased }
set overallocation_factor "undefined"
catch { set overallocation_factor [expr $seconds_work / $seconds_uom] }
catch { set overallocation_factor [expr {$seconds_work / $seconds_uom}] }
if {"undefined" != $overallocation_factor} {
# Accept max. 10% overassignment, because of small rounding
# errors between %assigned and actual time spent by the resource
if {[expr abs($overallocation_factor - 1.0)] > 0.10} {
if {[expr {abs($overallocation_factor - 1.0)}] > 0.10} {
ns_log Notice "ms-project-warning-component: fix-tasks-with-overallocation: seconds_work=$seconds_work, seconds_uom=$seconds_uom, seconds_in_timephased=$seconds_in_timephased, task_name=$task_name"
......@@ -519,10 +519,10 @@ if {0 && ![info exists ignore_hash($warning_key)]} {
append task_html "<td align=left><a href=[export_vars -base "/intranet/projects/view" {{project_id $task_id}}]>$task_name</a></td>\n"
append task_html "<td>$start_date_pretty</td>\n"
append task_html "<td>$end_date_pretty</td>\n"
append task_html "<td align=right>[expr round(10.0 * $seconds_uom / 3600.0) / 10.0]</td>\n"
append task_html "<td align=right>[expr round(10.0 * $seconds_work / 3600.0) / 10.0]</td>\n"
append task_html "<td align=right>[expr round(10.0 * $percentage) / 10.0]</a></td>\n"
append task_html "<td align=right>[expr round(1000.0 * $overallocation_factor) / 1000.0]</td>\n"
append task_html "<td align=right>[expr {round(10.0 * $seconds_uom / 3600.0) / 10.0}]</td>\n"
append task_html "<td align=right>[expr {round(10.0 * $seconds_work / 3600.0) / 10.0}]</td>\n"
append task_html "<td align=right>[expr {round(10.0 * $percentage) / 10.0}]</a></td>\n"
append task_html "<td align=right>[expr {round(1000.0 * $overallocation_factor) / 1000.0}]</td>\n"
append task_html "</tr>\n"
incr task_ctr
}
......@@ -539,11 +539,11 @@ if {0 && ![info exists ignore_hash($warning_key)]} {
set task_list_len [llength $task_list]
if {$task_list_len > 3} {
set task_list [lrange $task_list 0 2]
lappend task_list "... ([expr $task_list_len - 3] more tasks)"
lappend task_list "... ([expr {$task_list_len - 3}] more tasks)"
}
if {[string length $task_html] > 0} {
if {$task_html ne ""} {
set task_header "<tr class=rowtitle>\n"
append task_header "<td class=rowtitle align=center><input type=checkbox name=_dummy onclick=acs_ListCheckAll('task_with_overallocation',this.checked) checked></td>\n"
append task_header "<td class=rowtitle align=center>[lang::message::lookup "" intranet-ganttproject.Task "Task"]</td>\n"
......@@ -692,7 +692,7 @@ if {![info exists ignore_hash($warning_key)]} {
foreach tuple $assigned_skill_profiles {
set skill_profile_id [lindex $tuple 0]
set percent [lindex $tuple 2]
if {"" != $percent} { set percent [expr $percent+0.0] }
if {"" != $percent} { set percent [expr {$percent+0.0}] }
set string [im_name_from_user_id $skill_profile_id]
if {"" != $percent} { append string ":$percent%" }
lappend skill_profiles_list $string
......@@ -703,7 +703,7 @@ if {![info exists ignore_hash($warning_key)]} {
foreach tuple $assigned_persons {
set skill_profile_id [lindex $tuple 0]
set percent [lindex $tuple 2]
set percent [expr $percent+0.0]
set percent [expr {$percent+0.0}]
set string [im_name_from_user_id $skill_profile_id]
if {"" != $percent} { append string ":$percent%" }
lappend persons_list $string
......@@ -715,7 +715,7 @@ if {![info exists ignore_hash($warning_key)]} {
set rel_id [lindex $tuple 3]
# Required percent assignment in order to eqal out person vs. skill profiles
set percent [expr $percentage_skill_profiles - $percentage_non_skill_profiles]
set percent [expr {$percentage_skill_profiles - $percentage_non_skill_profiles}]
append task_html "<tr>\n"
append task_html "<td><input type=checkbox name=checked.$rel_id id=task_with_overallocation.$rel_id checked></td>\n"
......@@ -743,11 +743,11 @@ if {![info exists ignore_hash($warning_key)]} {
set task_list_len [llength $task_list]
if {$task_list_len > 3} {
set task_list [lrange $task_list 0 2]
lappend task_list "... ([expr $task_list_len - 3] more tasks)"
lappend task_list "... ([expr {$task_list_len - 3}] more tasks)"
}
if {[string length $task_html] > 0} {
if {$task_html ne ""} {
set task_header "<tr class=rowtitle>\n"
append task_header "<td class=rowtitle align=center><input type=checkbox name=_dummy onclick=acs_ListCheckAll('task_with_overallocation',this.checked) checked></td>\n"
append task_header "<td class=rowtitle align=center>[lang::message::lookup "" intranet-ganttproject.Task "Task Name"]</td>\n"
......
This diff is collapsed.
......@@ -226,7 +226,7 @@ ad_proc -public seconds_in_interval {
# ----------------------------------------------------------------------------------------
# Get the service hours per Day Of Week (1=Su, 2=Mo, 7=Sa)
# service_hours are like {09:00 18:00}
set dow [expr 1 + (($j + 1) % 7)]
set dow [expr {1 + (($j + 1) % 7)}]
set cal_day_string $cal_hash($dow)
array unset cal_day_hash
array set cal_day_hash $cal_day_string
......@@ -248,7 +248,7 @@ ad_proc -public seconds_in_interval {
# Add the duration of the interval to the working seconds
if {$hour_end_epoch > $hour_start_epoch} {
set working_seconds [expr $working_seconds + ($hour_end_epoch - $hour_start_epoch)]
set working_seconds [expr {$working_seconds + ($hour_end_epoch - $hour_start_epoch)}]
}
ns_log Notice "im_ms_calendar::seconds_in_interval: j=$j, dow=$dow, hour_start_ansi=$hour_start_ansi, hour_end_ansi=$hour_end_ansi, hour_start_epoch=$hour_start_epoch, hour_end_epoch=$hour_end_epoch"
......
......@@ -192,7 +192,7 @@ ad_proc -public im_ms_project_write_task {
if {"" == $duration_hours} {
set duration_hours $default_duration
}
if {"" == $duration_hours || [string equal $start_date $end_date] || $duration_hours < 0} {
if {"" == $duration_hours || $start_date eq $end_date || $duration_hours < 0} {
set duration_hours 0
}
......@@ -282,21 +282,21 @@ ad_proc -public im_ms_project_write_task {
Duration - ManualDuration {
# Check if we've got a duration defined in the xml_elements.
# Otherwise (export without import...) generate a duration.
set seconds [expr $duration_hours * 3600.0]
set seconds [expr {$duration_hours * 3600.0}]
set value [im_gp_seconds_to_ms_project_time $seconds]
}
ManualDuration {
# Check if we've got a duration defined in the xml_elements.
# Otherwise (export without import...) generate a duration.
set seconds [expr $duration_hours * 3600.0]
set seconds [expr {$duration_hours * 3600.0}]
set value [im_gp_seconds_to_ms_project_time $seconds]
}
DurationFormat { set value 7 }
EffortDriven { if {"t" == $effort_driven_p} { set value 1 } else { set value 0 } }
RemainingDuration {
set remaining_duration_hours [expr round($duration_hours * (100.0 - $percent_completed) / 100.0)]
set seconds [expr $remaining_duration_hours * 3600.0]
set remaining_duration_hours [expr {round($duration_hours * (100.0 - $percent_completed) / 100.0)}]
set seconds [expr {$remaining_duration_hours * 3600.0}]
set value [im_gp_seconds_to_ms_project_time $seconds]
}
Milestone { if {"t" == $milestone_p} { set value 1 } else { set value 0 } }
......@@ -358,7 +358,7 @@ ad_proc -public im_ms_project_write_task {
set planned_units 0
set value ""
} else {
set seconds [expr $planned_units * 3600.0]
set seconds [expr {$planned_units * 3600.0}]
set value [im_gp_seconds_to_ms_project_time $seconds]
}
}
......@@ -493,7 +493,7 @@ ad_proc -public im_ms_project_seconds_in_timephased {
set value_seconds [im_gp_ms_project_time_to_seconds $timephase_value]
if {[string is integer $value_seconds]} {
if {"" == $seconds} { set seconds 0.0 }
set seconds [expr $seconds + $value_seconds]
set seconds [expr {$seconds + $value_seconds}]
}
}
}
......
......@@ -196,7 +196,7 @@ ad_proc -public im_taskjuggler_write_task {
set allocation_ctr 0
db_foreach project_allocations $project_allocations_sql {
incr allocation_ctr
set allocation_hours [expr $percentage * 8.0 / 100.0]
set allocation_hours [expr {$percentage * 8.0 / 100.0}]
if {$allocation_hours < 0.1 } {
# Ignore allocations below 1%.
append tj "${indent}\t\# WARNING: Ignoring assignment percentage of $percentage because it is below the TJ resolution\n"
......
......@@ -84,15 +84,15 @@ switch $action {
# Calculate the overallocation factor in order to reduce the resource assignments
set seconds_in_interval [im_ms_calendar::seconds_in_interval -start_date $start_date -end_date $end_date -calendar [im_ms_calendar::default]]
set seconds_work [expr $seconds_in_interval * $percentage / 100.0]
set seconds_work [expr {$seconds_in_interval * $percentage / 100.0}]
switch $uom_id {
320 { set seconds_uom [expr $planned_units * 3600] }
321 { set seconds_uom [expr $planned_units * 3600 * 8.0] }
320 { set seconds_uom [expr {$planned_units * 3600}] }
321 { set seconds_uom [expr {$planned_units * 3600 * 8.0}] }
default { set seconds_uom 0.0 }
}
set overallocation_factor "undefined"
catch { set overallocation_factor [expr round(10.0 * $seconds_work / $seconds_uom) / 10.0] }
catch { set overallocation_factor [expr {round(10.0 * $seconds_work / $seconds_uom) / 10.0}] }
if {"undefined" != $overallocation_factor} {
db_dml reduce_overallocation "
......
......@@ -26,7 +26,7 @@ ad_page_contract {
set today [db_string today "select to_char(now(), 'YYYY-MM-DD')"]
if {0 == $user_id} {
set user_id [ad_maybe_redirect_for_registration]
set user_id [auth::require_login]
}
# get the current users permissions for this project
......
<master src="../../intranet-core/www/master">
<property name="title">@page_title@</property>
<property name="main_navbar_label">@main_navbar_label@</property>
<property name="sub_navbar">@sub_navbar;noquote@</property>
<property name="left_navbar">@left_navbar_html;noquote@</property>
<property name="show_context_help">@show_context_help_p;noquote@</property>
<property name="doc(title)">@page_title;literal@</property>
<property name="main_navbar_label">@main_navbar_label;literal@</property>
<property name="sub_navbar">@sub_navbar;literal@</property>
<property name="left_navbar">@left_navbar_html;literal@</property>
<property name="show_context_help">@show_context_help_p;literal@</property>
@html;noquote@
......@@ -37,7 +37,7 @@ ad_page_contract {
set show_context_help_p 0
set user_id [ad_maybe_redirect_for_registration]
set user_id [auth::require_login]
if {![im_permission $user_id "view_projects_all"]} {
ad_return_complaint 1 "You don't have permissions to see this page"
ad_script_abort
......
<master>
<property name="title">@page_title@</property>
<property name="context">@context_bar@</property>
<property name="doc(title)">@page_title;literal@</property>
<property name="context">@context_bar;literal@</property>
<property name="main_navbar_label">projects</property>
<property name="sub_navbar">@sub_navbar;noquote@</property>
<property name="sub_navbar">@sub_navbar;literal@</property>
<h1>@page_title@</h1>
......
......@@ -27,7 +27,7 @@ ad_page_contract {
# Defaults & Security
# ---------------------------------------------------------------
set user_id [ad_maybe_redirect_for_registration]
set user_id [auth::require_login]
im_project_permissions $user_id $project_id view read write admin
if {!$write} {
ad_return_complaint 1 "You don't have permissions to see this page"
......@@ -93,7 +93,7 @@ if {$max_n_bytes && ($file_size > $max_n_bytes) } {
# -------------------------------------------------------------------
set file_type [fileutil::fileType $tmp_filename]
if {[lsearch $file_type "ms-office"] >= 0} {
if {"ms-office" in $file_type} {
# We've found a binary MS-Office file, probably MPP
ad_return_complaint 1 "
......@@ -160,7 +160,7 @@ array set task_hash $task_hash_array
set task_hash_tasks [list 0]
foreach task_hash_key [array names task_hash] {
set task_hash_value $task_hash($task_hash_key)
if [info exists db_task_ids($task_hash_value)] {
if {[info exists db_task_ids($task_hash_value)]} {
unset db_task_ids($task_hash_value)
}
lappend task_hash_tasks $task_hash_value
......
......@@ -2,10 +2,10 @@
<!-- @author Juanjo Ruiz (juanjoruizx@yahoo.es) -->
<master src="../../intranet-core/www/master">
<property name="title">@page_title@</property>
<property name="context">@context_bar@</property>
<property name="doc(title)">@page_title;literal@</property>
<property name="context">@context_bar;literal@</property>
<property name="main_navbar_label">projects</property>
<property name="sub_navbar">@sub_navbar;noquote@</property>
<property name="sub_navbar">@sub_navbar;literal@</property>
<!-- ------------------------------------------------------------------------------ -->
......@@ -18,7 +18,7 @@
</p>
<form enctype="multipart/form-data" method="POST" action="gantt-upload-2">
<%= [export_vars -form {project_id return_url}] %>
<table border=0>
<table border="0">
<tr>
<td><%= [lang::message::lookup "" intranet-core.File "File"] %></td>
<td>
......
......@@ -34,7 +34,7 @@ set page_title [lang::message::lookup "" intranet-ganttproject.Import_from_progr
set context_bar [im_context_bar $page_title]
# get the current users permissions for this project
set user_id [ad_maybe_redirect_for_registration]
set user_id [auth::require_login]
im_project_permissions $user_id $project_id view read write admin
if {!$write} {
ad_return_complaint 1 "You don't have permissions to see this page"
......
<master src="../../intranet-core/www/master">
<property name="title">@page_title@</property>
<property name="main_navbar_label">@main_navbar_label@</property>
<property name="sub_navbar">@sub_navbar;noquote@</property>
<property name="show_context_help">@show_context_help_p;noquote@</property>
<property name="doc(title)">@page_title;literal@</property>
<property name="main_navbar_label">@main_navbar_label;literal@</property>
<property name="sub_navbar">@sub_navbar;literal@</property>
<property name="show_context_help">@show_context_help_p;literal@</property>
@html;noquote@
......@@ -33,7 +33,7 @@ ad_page_contract {
# Default & Security
# ---------------------------------------------------------------
set user_id [ad_maybe_redirect_for_registration]
set user_id [auth::require_login]
foreach pid $project_id {
im_project_permissions $user_id $pid view read write admin
......
......@@ -3,8 +3,8 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<master src="../../intranet-core/www/master">
<property name="title">@page_title@</property>
<property name="context">@context_bar@</property>
<property name="doc(title)">@page_title;literal@</property>
<property name="context">@context_bar;literal@</property>
<property name="main_navbar_label">forum</property>
......@@ -18,20 +18,20 @@
<form enctype=multipart/form-data method=POST action=gantt-upload-2.tcl>
<%= [export_vars -form {return_url}] %>
<table border=0>
<table border="0">
<tr>
<td class=rowtitle align=center colspan=2>Upload a GanttProject file</td>
<td class=rowtitle align="center" colspan="2">Upload a GanttProject file</td>
</tr>
<tr $bgcolor(1)>
<td align=right>File</td>
<td align="right">File</td>
<td>
<input type=file name=upload_file size=30>
<input type="file" name="upload_file" size="30">
</td>
</tr>
<tr $bgcolor(0)>
<td></td>
<td>
<input type=submit value='Submit'><br>
<input type="submit" value='Submit'><br>
</td>
</tr>
</table>
......
......@@ -22,7 +22,7 @@ ad_page_contract {
# ---------------------------------------------------------------
set today [db_string today "select to_char(now(), 'YYYY-MM-DD')"]
set user_id [ad_maybe_redirect_for_registration]
set user_id [auth::require_login]
set main_project_id $project_id
......@@ -405,16 +405,16 @@ db_foreach project_allocations $project_allocations_sql {
# The sum of assigned work overrides the task work in MS-Project,
# so we divide the task work evenly across the assigned resources.
if { ![info exists planned_units] || "" == $planned_units || "" == [string trim $planned_units] } { set planned_units 0 }
set planned_seconds [expr $planned_units * 3600.0]
set actual_work_seconds [expr $planned_seconds * $percent_completed / 100.0]
set remaining_work_seconds [expr $planned_seconds - $actual_work_seconds]
set planned_seconds [expr {$planned_units * 3600.0}]
set actual_work_seconds [expr {$planned_seconds * $percent_completed / 100.0}]
set remaining_work_seconds [expr {$planned_seconds - $actual_work_seconds}]
if {$total_percentage_assigned == 0} {
set work_seconds $planned_seconds
} else {
set work_seconds [expr $planned_seconds * $percentage_assigned / $total_percentage_assigned]
set actual_work_seconds [expr $actual_work_seconds * $percentage_assigned / $total_percentage_assigned]
set remaining_work_seconds [expr $remaining_work_seconds * $percentage_assigned / $total_percentage_assigned]
set work_seconds [expr {$planned_seconds * $percentage_assigned / $total_percentage_assigned}]
set actual_work_seconds [expr {$actual_work_seconds * $percentage_assigned / $total_percentage_assigned}]
set remaining_work_seconds [expr {$remaining_work_seconds * $percentage_assigned / $total_percentage_assigned}]
}
set work_ms [im_gp_seconds_to_ms_project_time $work_seconds]
set actual_work_ms [im_gp_seconds_to_ms_project_time $actual_work_seconds]
......@@ -427,7 +427,7 @@ db_foreach project_allocations $project_allocations_sql {
<UID>$assignment_ctr</UID>
<TaskUID>$task_id</TaskUID>
<ResourceUID>$user_id</ResourceUID>
<Units>[expr $percentage_assigned / 100.0]</Units>
<Units>[expr {$percentage_assigned / 100.0}]</Units>
<PercentWorkComplete>$percent_completed</PercentWorkComplete>
<Start>${start_date_date}T00:00:00</Start>
<Finish>${end_date_date}T23:00:00</Finish>
......@@ -449,7 +449,7 @@ set xml ""
foreach line [split $xml_org "\n"] {
if {[regexp {^([\ \t]*)\<([a-zA-Z0-9]+)\>\<\/([a-zA-Z0-9]+)\>} $line match blank tag1 tag2]} {
if {[string equal $tag1 $tag2]} {
if {$tag1 eq $tag2} {
append xml "$blank<$tag1/>\n"
} else {
append xml "$line\n"
......
......@@ -22,7 +22,7 @@ ad_page_contract {
# ---------------------------------------------------------------
set today [db_string today "select to_char(now(), 'YYYY-MM-DD')"]
set user_id [ad_maybe_redirect_for_registration]
set user_id [auth::require_login]
set main_project_id $project_id
......@@ -405,16 +405,16 @@ db_foreach project_allocations $project_allocations_sql {
# The sum of assigned work overrides the task work in MS-Project,
# so we divide the task work evenly across the assigned resources.
if { ![info exists planned_units] || "" == $planned_units || "" == [string trim $planned_units] } { set planned_units 0 }
set planned_seconds [expr $planned_units * 3600.0]
set actual_work_seconds [expr $planned_seconds * $percent_completed / 100.0]
set remaining_work_seconds [expr $planned_seconds - $actual_work_seconds]
set planned_seconds [expr {$planned_units * 3600.0}]
set actual_work_seconds [expr {$planned_seconds * $percent_completed / 100.0}]
set remaining_work_seconds [expr {$planned_seconds - $actual_work_seconds}]
if {$total_percentage_assigned == 0} {
set work_seconds $planned_seconds
} else {
set work_seconds [expr $planned_seconds * $percentage_assigned / $total_percentage_assigned]
set actual_work_seconds [expr $actual_work_seconds * $percentage_assigned / $total_percentage_assigned]
set remaining_work_seconds [expr $remaining_work_seconds * $percentage_assigned / $total_percentage_assigned]
set work_seconds [expr {$planned_seconds * $percentage_assigned / $total_percentage_assigned}]
set actual_work_seconds [expr {$actual_work_seconds * $percentage_assigned / $total_percentage_assigned}]
set remaining_work_seconds [expr {$remaining_work_seconds * $percentage_assigned / $total_percentage_assigned}]
}
set work_ms [im_gp_seconds_to_ms_project_time $work_seconds]
set actual_work_ms [im_gp_seconds_to_ms_project_time $actual_work_seconds]
......@@ -427,7 +427,7 @@ db_foreach project_allocations $project_allocations_sql {
<UID>$assignment_ctr</UID>
<TaskUID>$task_id</TaskUID>
<ResourceUID>$user_id</ResourceUID>
<Units>[expr $percentage_assigned / 100.0]</Units>
<Units>[expr {$percentage_assigned / 100.0}]</Units>
<PercentWorkComplete>$percent_completed</PercentWorkComplete>
<Start>${start_date_date}T00:00:00</Start>
<Finish>${end_date_date}T23:00:00</Finish>
......@@ -449,7 +449,7 @@ set xml ""
foreach line [split $xml_org "\n"] {
if {[regexp {^([\ \t]*)\<([a-zA-Z0-9]+)\>\<\/([a-zA-Z0-9]+)\>} $line match blank tag1 tag2]} {
if {[string equal $tag1 $tag2]} {
if {$tag1 eq $tag2} {
append xml "$blank<$tag1/>\n"
} else {
append xml "$line\n"
......
......@@ -22,7 +22,7 @@ ad_page_contract {
# ---------------------------------------------------------------
set today [db_string today "select to_char(now(), 'YYYY-MM-DD')"]
set user_id [ad_maybe_redirect_for_registration]
set user_id [auth::require_login]
set main_project_id $project_id
......@@ -409,16 +409,16 @@ db_foreach project_allocations $project_allocations_sql {
# The sum of assigned work overrides the task work in MS-Project,
# so we divide the task work evenly across the assigned resources.
if { ![info exists planned_units] || "" == $planned_units || "" == [string trim $planned_units] } { set planned_units 0 }
set planned_seconds [expr $planned_units * 3600.0]
set actual_work_seconds [expr $planned_seconds * $percent_completed / 100.0]
set remaining_work_seconds [expr $planned_seconds - $actual_work_seconds]
set planned_seconds [expr {$planned_units * 3600.0}]
set actual_work_seconds [expr {$planned_seconds * $percent_completed / 100.0}]
set remaining_work_seconds [expr {$planned_seconds - $actual_work_seconds}]
if {$total_percentage_assigned == 0} {
set work_seconds $planned_seconds
} else {
set work_seconds [expr $planned_seconds * $percentage_assigned / $total_percentage_assigned]
set actual_work_seconds [expr $actual_work_seconds * $percentage_assigned / $total_percentage_assigned]
set remaining_work_seconds [expr $remaining_work_seconds * $percentage_assigned / $total_percentage_assigned]
set work_seconds [expr {$planned_seconds * $percentage_assigned / $total_percentage_assigned}]
set actual_work_seconds [expr {$actual_work_seconds * $percentage_assigned / $total_percentage_assigned}]
set remaining_work_seconds [expr {$remaining_work_seconds * $percentage_assigned / $total_percentage_assigned}]
}
set work_ms [im_gp_seconds_to_ms_project_time $work_seconds]
set actual_work_ms [im_gp_seconds_to_ms_project_time $actual_work_seconds]
......@@ -431,7 +431,7 @@ db_foreach project_allocations $project_allocations_sql {
# in order to return exactly the same schedule for a task that was specified in MS-Project
# (exact "round-trip")
set units [expr $percentage_assigned / 100.0]
set units [expr {$percentage_assigned / 100.0}]
set xml_exists_p [db_0or1row assignment_info "
select ga.*
......@@ -442,7 +442,7 @@ db_foreach project_allocations $project_allocations_sql {
if {$xml_exists_p} {
set units_diff 100
if {$units > 0} { set units_diff [expr 100.0 * abs(($units - $xml_units) / $units)] }
if {$units > 0} { set units_diff [expr {100.0 * abs(($units - $xml_units) / $units)}] }
ns_log Notice "microsoft-project: TimephasedData: rel_id=$rel_id, $task_id != $xml_taskuid, $user_id != $xml_resourceuid, $units != $xml_units, units_diff=$units_diff"
if {$task_id != $xml_taskuid} { set xml_exists_p 0 }
if {$user_id != $xml_resourceuid} { set xml_exists_p 0 }
......@@ -478,7 +478,7 @@ db_foreach project_allocations $project_allocations_sql {
ns_log Notice "microsoft-project: TimephasedData: store: xml_element=$xml_element, len(xml_xml) = [string length $xml_xml]"
set var_name "xml_[string tolower $xml_element]"
set var_value [expr "$$var_name"]
set var_value [expr $$var_name]
append xml_xml "<$xml_element>$var_value</$xml_element>\n\t\t\t"
}
set timephased_xml ""
......@@ -529,7 +529,7 @@ set xml ""
foreach line [split $xml_org "\n"] {
if {[regexp {^([\ \t]*)\<([a-zA-Z0-9]+)\>\<\/([a-zA-Z0-9]+)\>} $line match blank tag1 tag2]} {
if {[string equal $tag1 $tag2]} {
if {$tag1 eq $tag2} {
append xml "$blank<$tag1/>\n"
} else {
append xml "$line\n"
......
......@@ -26,7 +26,7 @@ ad_page_contract {
set today [db_string today "select to_char(now(), 'YYYY-MM-DD')"]
if {0 == $user_id} {
set user_id [ad_maybe_redirect_for_registration]
set user_id [auth::require_login]
}
# ---------------------------------------------------------------
......@@ -383,7 +383,7 @@ ad_proc -public im_openproj_write_task {
if {"" == $duration} {
set duration $default_duration
}
if {"" == $duration || [string equal $start_date $end_date] } {
if {"" == $duration || $start_date eq $end_date } {
set duration 0
}
......
<master>
<property name="title">@page_title@</property>
<property name="context">@context_bar@</property>
<property name="doc(title)">@page_title;literal@</property>
<property name="context">@context_bar;literal@</property>
<property name="main_navbar_label">projects</property>
<property name="sub_navbar">@sub_navbar;noquote@</property>
<property name="sub_navbar">@sub_navbar;literal@</property>
<h1><%= [lang::message::lookup "" intranet-ganttproject.TaskJuggler_Schedule_Successfully_Imported "
......
......@@ -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 [lang::message::lookup "" intranet-ganttproject.TaskJuggler_Import "TaskJuggler Import"]
set context_bar [im_context_bar $page_title]
if {"" == $return_url} { set return_url [im_url_with_query] }
......
<master>
<property name="title">@page_title@</property>
<property name="context">@context_bar@</property>
<property name="doc(title)">@page_title;literal@</property>
<property name="context">@context_bar;literal@</property>
<property name="main_navbar_label">projects</property>
<property name="sub_navbar">@sub_navbar;noquote@</property>
<property name="sub_navbar">@sub_navbar;literal@</property>
<!-- ------------------------------------------------------------------------------ -->
......@@ -32,7 +32,7 @@ and import the values into the current project.
<form action=taskjuggler-import method=POST>
<%= [export_vars -form {project_id}] %>
<input type=submit name=import value="Import Schedule">
<input type="submit" name="import" value="Import Schedule">
from TaskJuggler into ]project-open[
</form>
......@@ -22,7 +22,7 @@ ad_page_contract {
# ---------------------------------------------------------------
set today [db_string today "select to_char(now(), 'YYYY-MM-DD')"]
set user_id [ad_maybe_redirect_for_registration]
set user_id [auth::require_login]
set hours_per_day 8.0
set default_currency [im_parameter -package_id [im_package_cost_id] "DefaultCurrency" "" "EUR"]
......@@ -151,7 +151,7 @@ db_foreach project_resources $project_resources_sql {
set user_tj "\tresource r$person_id \"$user_name\" {\n"
if {"" != $hourly_cost} {
append user_tj "\t\trate [expr $hourly_cost * $hours_per_day]\n"
append user_tj "\t\trate [expr {$hourly_cost * $hours_per_day}]\n"
}
# ---------------------------------------------------------------
......
......@@ -26,7 +26,7 @@ ad_page_contract {
# Defaults & Security
# ---------------------------------------------------------------
set user_id [ad_maybe_redirect_for_registration]
set user_id [auth::require_login]
set user_is_admin_p [im_is_user_site_wide_or_intranet_admin $user_id]
if {!$user_is_admin_p} {
ad_return_complaint 1 "This page is only accessible for administrators"
......@@ -120,7 +120,7 @@ if {[set resource_node [$root_node selectNodes /project/resources]] == ""} {
set resource_node [$root_node selectNodes -namespace { "project" "http://schemas.microsoft.com/project" } "project:Resources" ]
}
if {$resource_node != ""} {
if {$resource_node ne ""} {
set resource_hash_array [im_gp_save_resources -debug_p $debug_p $resource_node]
array set resource_hash $resource_hash_array
}
......@@ -143,7 +143,7 @@ if {[set allocations_node [$root_node selectNodes /project/allocations]] == ""}
set allocations_node [$root_node selectNodes -namespace { "project" "http://schemas.microsoft.com/project" } "project:Assignments" ]
}
if {$allocations_node != ""} {
if {$allocations_node ne ""} {
im_gp_save_allocations \
-debug_p $debug_p \
$allocations_node \
......
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