Commit cacdee7c authored by Frank Bergmann's avatar Frank Bergmann

- added admin links to task hierarchy component component

parent 72896950
...@@ -120,6 +120,7 @@ ad_proc -public im_timesheet_task_list_component { ...@@ -120,6 +120,7 @@ ad_proc -public im_timesheet_task_list_component {
} { } {
# ---------------------- Security - Show the comp? ------------------------------- # ---------------------- Security - Show the comp? -------------------------------
set user_id [ad_get_user_id] set user_id [ad_get_user_id]
set user_is_admin_p [im_is_user_site_wide_or_intranet_admin $user_id]
set include_subprojects 0 set include_subprojects 0
...@@ -181,6 +182,7 @@ ad_proc -public im_timesheet_task_list_component { ...@@ -181,6 +182,7 @@ ad_proc -public im_timesheet_task_list_component {
# #
set column_headers [list] set column_headers [list]
set column_vars [list] set column_vars [list]
set admin_links [list]
set extra_selects [list] set extra_selects [list]
set extra_froms [list] set extra_froms [list]
set extra_wheres [list] set extra_wheres [list]
...@@ -198,6 +200,8 @@ ad_proc -public im_timesheet_task_list_component { ...@@ -198,6 +200,8 @@ ad_proc -public im_timesheet_task_list_component {
if {"" == $visible_for || [eval $visible_for]} { if {"" == $visible_for || [eval $visible_for]} {
lappend column_headers "$column_name" lappend column_headers "$column_name"
lappend column_vars "$column_render_tcl" lappend column_vars "$column_render_tcl"
lappend admin_links "<a href=[export_vars -base "/intranet/admin/views/new-column" {return_url column_id {form_mode edit}}] target=\"_blank\">[im_gif wrench]</a>"
if {"" != $extra_select} { lappend extra_selects $extra_select } if {"" != $extra_select} { lappend extra_selects $extra_select }
if {"" != $extra_from} { lappend extra_froms $extra_from } if {"" != $extra_from} { lappend extra_froms $extra_from }
if {"" != $extra_where} { lappend extra_wheres $extra_where } if {"" != $extra_where} { lappend extra_wheres $extra_where }
...@@ -253,6 +257,8 @@ ad_proc -public im_timesheet_task_list_component { ...@@ -253,6 +257,8 @@ ad_proc -public im_timesheet_task_list_component {
# Format the header names with links that modify the # Format the header names with links that modify the
# sort order of the SQL query. # sort order of the SQL query.
# #
set col_ctr 0
set admin_link ""
set table_header_html "" set table_header_html ""
foreach col $column_headers { foreach col $column_headers {
set cmd_eval "" set cmd_eval ""
...@@ -261,8 +267,9 @@ ad_proc -public im_timesheet_task_list_component { ...@@ -261,8 +267,9 @@ ad_proc -public im_timesheet_task_list_component {
eval $cmd eval $cmd
regsub -all " " $cmd_eval "_" cmd_eval_subs regsub -all " " $cmd_eval "_" cmd_eval_subs
set cmd_eval [lang::message::lookup "" intranet-timesheet2-tasks.$cmd_eval_subs $cmd_eval] set cmd_eval [lang::message::lookup "" intranet-timesheet2-tasks.$cmd_eval_subs $cmd_eval]
lappend column_headers $column_name if {$user_is_admin_p} { set admin_link [lindex $admin_links $col_ctr] }
append table_header_html " <th class=rowtitle>$cmd_eval</th>\n" append table_header_html " <th class=rowtitle>$cmd_eval$admin_link</th>\n"
incr col_ctr
} }
set table_header_html " set table_header_html "
......
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