Commit 48cec7c4 authored by Frank Bergmann's avatar Frank Bergmann

- Gustaf changes

parent 98723ef6
...@@ -308,7 +308,7 @@ ad_proc im_timesheet_conf_new_page_wf_perm_delete_button { ...@@ -308,7 +308,7 @@ ad_proc im_timesheet_conf_new_page_wf_perm_delete_button {
] ]
ns_log Notice "im_timesheet_conf_new_page_wf_perm_delete_button conf_id=$conf_id => $perm_set" ns_log Notice "im_timesheet_conf_new_page_wf_perm_delete_button conf_id=$conf_id => $perm_set"
return [expr [lsearch $perm_set "d"] > -1] return [expr {[lsearch $perm_set "d"] > -1}]
} }
ad_proc im_timesheet_conf_new_page_wf_perm_edit_button { ad_proc im_timesheet_conf_new_page_wf_perm_edit_button {
...@@ -323,7 +323,7 @@ ad_proc im_timesheet_conf_new_page_wf_perm_edit_button { ...@@ -323,7 +323,7 @@ ad_proc im_timesheet_conf_new_page_wf_perm_edit_button {
] ]
ns_log Notice "im_timesheet_conf_new_page_wf_perm_edit_button conf_id=$conf_id => $perm_set" ns_log Notice "im_timesheet_conf_new_page_wf_perm_edit_button conf_id=$conf_id => $perm_set"
return [expr [lsearch $perm_set "w"] > -1] return [expr {[lsearch $perm_set "w"] > -1}]
} }
...@@ -347,7 +347,7 @@ ad_proc eval_wf_start_date { ...@@ -347,7 +347,7 @@ ad_proc eval_wf_start_date {
if { $one_week_back_month == $date_part_month } { if { $one_week_back_month == $date_part_month } {
# Find # Find
return [expr $date_julian - [expr $day_of_week - 1]] return [expr {$date_julian - [expr {$day_of_week - 1}]}]
} else { } else {
# return first day of month # return first day of month
return [dt_ansi_to_julian_single_arg "$date_part_year-$date_part_month-01"] return [dt_ansi_to_julian_single_arg "$date_part_year-$date_part_month-01"]
...@@ -401,14 +401,14 @@ ad_proc im_timesheet2_workflow_unsubmitted_hours_user_notification_sweeper { ...@@ -401,14 +401,14 @@ ad_proc im_timesheet2_workflow_unsubmitted_hours_user_notification_sweeper {
set key "$user_id-$hour_month" set key "$user_id-$hour_month"
set h 0 set h 0
if {[info exists user_hour_month_hash($key)]} { set h $user_hour_month_hash($key) } if {[info exists user_hour_month_hash($key)]} { set h $user_hour_month_hash($key) }
set h [expr $h + $hours] set h [expr {$h + $hours}]
set user_hour_month_hash($key) $h set user_hour_month_hash($key) $h
# Sum up unconfirmed hours total # Sum up unconfirmed hours total
set key "$user_id" set key "$user_id"
set h 0 set h 0
if {[info exists user_hour_hash($key)]} { set h $user_hour_hash($key) } if {[info exists user_hour_hash($key)]} { set h $user_hour_hash($key) }
set h [expr $h + $hours] set h [expr {$h + $hours}]
set user_hour_hash($key) $h set user_hour_hash($key) $h
# Store auxillary variables in their hashes # Store auxillary variables in their hashes
...@@ -446,9 +446,9 @@ ad_proc im_timesheet2_workflow_unsubmitted_hours_user_notification_sweeper { ...@@ -446,9 +446,9 @@ ad_proc im_timesheet2_workflow_unsubmitted_hours_user_notification_sweeper {
ad_return_complaint 1 "<pre>email=$email<br>system_owner=$system_owner<br>subject=$subject<br>message=$message<br>" ad_return_complaint 1 "<pre>email=$email<br>system_owner=$system_owner<br>subject=$subject<br>message=$message<br>"
} else { } else {
if [catch { if {[catch {
ns_sendmail $email $system_owner $subject $message ns_sendmail $email $system_owner $subject $message
} errmsg] { } errmsg]} {
ns_log Error "im_timesheet2_workflow_unsubmitted_hours_user_notification_sweeper: Error sending to \"$email\": $errmsg" ns_log Error "im_timesheet2_workflow_unsubmitted_hours_user_notification_sweeper: Error sending to \"$email\": $errmsg"
} else { } else {
ns_log Notice "im_timesheet2_workflow_unsubmitted_hours_user_notification_sweeper: Sent mail to $email\n" ns_log Notice "im_timesheet2_workflow_unsubmitted_hours_user_notification_sweeper: Sent mail to $email\n"
...@@ -520,9 +520,9 @@ User %user_name% has modified hours in the following projects:\n ...@@ -520,9 +520,9 @@ User %user_name% has modified hours in the following projects:\n
%ansi_list_txt% %ansi_list_txt%
"] "]
if [catch { if {[catch {
ns_sendmail $supervisor_email $sender_email $subject $message ns_sendmail $supervisor_email $sender_email $subject $message
} errmsg] { } errmsg]} {
ns_log Error "im_timesheet_conf_object_delete: Error sending to \"$supervisor_email\": $errmsg" ns_log Error "im_timesheet_conf_object_delete: Error sending to \"$supervisor_email\": $errmsg"
} else { } else {
ns_log Notice "im_timesheet_conf_object_delete: Sent mail to $email\n" ns_log Notice "im_timesheet_conf_object_delete: Sent mail to $email\n"
......
...@@ -86,7 +86,7 @@ if {[info exists task]} { ...@@ -86,7 +86,7 @@ if {[info exists task]} {
# --------------------------------------------------------------- # ---------------------------------------------------------------
set transition_key [db_string transition_key "select transition_key from wf_tasks where task_id = :task_id" -default ""] set transition_key [db_string transition_key "select transition_key from wf_tasks where task_id = :task_id" -default ""]
set current_user_id [ad_maybe_redirect_for_registration] set current_user_id [auth::require_login]
set object_name [db_string name "select acs_object__name(:absence_id)"] set object_name [db_string name "select acs_object__name(:absence_id)"]
# --------------------------------------------------------------- # ---------------------------------------------------------------
......
...@@ -86,7 +86,7 @@ if {[info exists task]} { ...@@ -86,7 +86,7 @@ if {[info exists task]} {
# --------------------------------------------------------------- # ---------------------------------------------------------------
set transition_key [db_string transition_key "select transition_key from wf_tasks where task_id = :task_id" -default ""] set transition_key [db_string transition_key "select transition_key from wf_tasks where task_id = :task_id" -default ""]
set current_user_id [ad_maybe_redirect_for_registration] set current_user_id [auth::require_login]
set object_name [db_string name "select acs_object__name(:conf_id)" -default ""] set object_name [db_string name "select acs_object__name(:conf_id)" -default ""]
# --------------------------------------------------------------- # ---------------------------------------------------------------
......
...@@ -19,7 +19,7 @@ ad_page_contract { ...@@ -19,7 +19,7 @@ ad_page_contract {
# Defaults & Security # Defaults & Security
# --------------------------------------------------------------- # ---------------------------------------------------------------
set user_id [ad_maybe_redirect_for_registration] set user_id [auth::require_login]
if {![info exists conf_id] || 0 == [llength $conf_id]} { if {![info exists conf_id] || 0 == [llength $conf_id]} {
aad_returnredirect $return_url aad_returnredirect $return_url
......
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<master> <master>
<property name="title">@page_title@</property> <property name="doc(title)">@page_title;literal@</property>
<property name="context">@context_bar@</property> <property name="context">@context_bar;literal@</property>
<property name="main_navbar_label">notes</property> <property name="main_navbar_label">notes</property>
<!-- <!--
<table border=0 cellpadding=0 cellspacing=0> <table border="0" cellpadding="0" cellspacing="0">
<tr> <tr>
<td> <td>
...@@ -20,10 +20,10 @@ ...@@ -20,10 +20,10 @@
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td valign=top width="30%"> <td valign="top" width="30%">
<table border=0 cellpadding=0 cellspacing=0> <table border="0" cellpadding="0" cellspacing="0">
<tr> <tr>
<td class=rowtitle align=center> <td class=rowtitle align="center">
#intranet-core.Admin_Links# #intranet-core.Admin_Links#
</td> </td>
</tr> </tr>
......
...@@ -21,7 +21,7 @@ ad_page_contract { ...@@ -21,7 +21,7 @@ ad_page_contract {
# --------------------------------------------------------------- # ---------------------------------------------------------------
# User id already verified by filters # User id already verified by filters
set user_id [ad_maybe_redirect_for_registration] set user_id [auth::require_login]
set current_user_id $user_id set current_user_id $user_id
set page_focus "im_header_form.keywords" set page_focus "im_header_form.keywords"
set user_admin_p [im_is_user_site_wide_or_intranet_admin $current_user_id] set user_admin_p [im_is_user_site_wide_or_intranet_admin $current_user_id]
...@@ -40,7 +40,7 @@ set edit_project_all_p [im_permission $current_user_id "edit_projects_all"] ...@@ -40,7 +40,7 @@ set edit_project_all_p [im_permission $current_user_id "edit_projects_all"]
# --------------------------------------------------------------- # ---------------------------------------------------------------
set admin_links "" set admin_links ""
append admin_links " <li><a href=\"new?[export_vars -url {object_id return_url}]\">[_ intranet-timesheet2-workflow.Add_a_new_Conf]</a>\n" append admin_links " <li><a href=\"[export_vars -base new {object_id return_url}]\">[_ intranet-timesheet2-workflow.Add_a_new_Conf]</a>\n"
if {"" != $admin_links} { set admin_links "<ul>\n$admin_links</ul>\n" } if {"" != $admin_links} { set admin_links "<ul>\n$admin_links</ul>\n" }
set bulk_actions_list "[list]" set bulk_actions_list "[list]"
......
<master> <master>
<property name="title">@page_title@</property> <property name="doc(title)">@page_title;literal@</property>
<property name="main_navbar_label">timesheet</property> <property name="main_navbar_label">timesheet</property>
<h2>@page_title@</h2> <h2>@page_title@</h2>
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<br>&nbsp;<br> <br>&nbsp;<br>
<p> <p>
<a href="@return_url;noquote@" <a href="@return_url@"
><%= [lang::message::lookup "" intranet-timesheet2-workflow.Return_to_previous_page "Return to previous page"] %></a> ><%= [lang::message::lookup "" intranet-timesheet2-workflow.Return_to_previous_page "Return to previous page"] %></a>
</p> </p>
<br> <br>
...@@ -32,7 +32,7 @@ set wf_user_id $user_id ...@@ -32,7 +32,7 @@ set wf_user_id $user_id
# Check for valid user/auth_token combination # Check for valid user/auth_token combination
set valid_p [im_valid_auto_login_p -check_user_requires_manual_login_p 0 -user_id $user_id -auto_login $auth_token] set valid_p [im_valid_auto_login_p -check_user_requires_manual_login_p 0 -user_id $user_id -auto_login $auth_token]
if {!$valid_p} { if {!$valid_p} {
set user_id [ad_maybe_redirect_for_registration] set user_id [auth::require_login]
} }
set page_title "[lang::message::lookup "" intranet-timesheet2-workflow.Create_New_Timesheet_Workflow "New Timesheet Workflow(s)"]" set page_title "[lang::message::lookup "" intranet-timesheet2-workflow.Create_New_Timesheet_Workflow "New Timesheet Workflow(s)"]"
......
<if @enable_master_p@> <if @enable_master_p@>
<master> <master>
<property name="title">@page_title@</property> <property name="doc(title)">@page_title;literal@</property>
<property name="main_navbar_label">timesheet</property> <property name="main_navbar_label">timesheet</property>
</if> </if>
......
...@@ -26,7 +26,7 @@ if {![info exists panel_p]} { ...@@ -26,7 +26,7 @@ if {![info exists panel_p]} {
} }
} }
set user_id [ad_maybe_redirect_for_registration] set user_id [auth::require_login]
set page_title [lang::message::lookup "" intranet-timesheet2-workflow.Timesheet_Conf_Object "Timesheet Confirmation"] set page_title [lang::message::lookup "" intranet-timesheet2-workflow.Timesheet_Conf_Object "Timesheet Confirmation"]
set context_bar [im_context_bar $page_title] set context_bar [im_context_bar $page_title]
......
...@@ -32,7 +32,7 @@ ad_page_contract { ...@@ -32,7 +32,7 @@ ad_page_contract {
# because it identifies unquely the report's Menu and # because it identifies unquely the report's Menu and
# its permissions. # its permissions.
set menu_label "reporting-timesheet-unsubmitted-hours" set menu_label "reporting-timesheet-unsubmitted-hours"
set current_user_id [ad_maybe_redirect_for_registration] set current_user_id [auth::require_login]
set read_p [db_string report_perms " set read_p [db_string report_perms "
select im_object_permission_p(m.menu_id, :current_user_id, 'read') select im_object_permission_p(m.menu_id, :current_user_id, 'read')
from im_menus m from im_menus m
...@@ -96,7 +96,7 @@ if {$level_of_detail > 3} { set level_of_detail 3 } ...@@ -96,7 +96,7 @@ if {$level_of_detail > 3} { set level_of_detail 3 }
# ------------------------------------------------------------ # ------------------------------------------------------------
# Permissions - Unprivileged users can only see their own hours # Permissions - Unprivileged users can only see their own hours
# #
set view_hours_all_p [expr [im_permission $current_user_id view_hours_all] || [im_permission $current_user_id add_hours_all]] set view_hours_all_p [expr {[im_permission $current_user_id view_hours_all] || [im_permission $current_user_id add_hours_all]}]
set view_hours_direct_reports_p [im_permission $current_user_id add_hours_direct_reports] set view_hours_direct_reports_p [im_permission $current_user_id add_hours_direct_reports]
if {!$view_hours_all_p && !$view_hours_direct_reports_p} { set member_id $current_user_id } if {!$view_hours_all_p && !$view_hours_direct_reports_p} { set member_id $current_user_id }
if {!$view_hours_all_p && $view_hours_direct_reports_p} { if {!$view_hours_all_p && $view_hours_direct_reports_p} {
...@@ -181,7 +181,7 @@ switch $type_of_hours { ...@@ -181,7 +181,7 @@ switch $type_of_hours {
} }
set where_clause [join $criteria " and\n\t\t"] set where_clause [join $criteria " and\n\t\t"]
if { ![empty_string_p $where_clause] } { if { $where_clause ne "" } {
set where_clause " and $where_clause" set where_clause " and $where_clause"
} }
...@@ -459,8 +459,8 @@ db_foreach sql $sql { ...@@ -459,8 +459,8 @@ db_foreach sql $sql {
im_report_update_counters -counters $counters im_report_update_counters -counters $counters
set hours_monthly_sum [expr round(100.0 * $hours_monthly_sum) / 100.0] set hours_monthly_sum [expr {round(100.0 * $hours_monthly_sum) / 100.0}]
set hours_subtotal [expr round(100.0 * $hours_subtotal) / 100.0] set hours_subtotal [expr {round(100.0 * $hours_subtotal) / 100.0}]
set hours_subtotal_pretty [im_report_format_number $hours_subtotal $output_format $number_locale] set hours_subtotal_pretty [im_report_format_number $hours_subtotal $output_format $number_locale]
set hours_monthly_sum_pretty [im_report_format_number $hours_monthly_sum $output_format $number_locale] set hours_monthly_sum_pretty [im_report_format_number $hours_monthly_sum $output_format $number_locale]
......
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