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

- Gustaf changes

parent 7d2b30d4
......@@ -145,7 +145,7 @@ namespace eval im_conf_item {
# Update the item with additional variables from the vars array
set sql_list [list]
foreach var [array names vars] {
if {$var == "conf_item_id"} { continue }
if {$var eq "conf_item_id"} { continue }
lappend sql_list "$var = :$var"
}
set sql "
......@@ -413,7 +413,7 @@ ad_proc -public im_conf_item_permissions {user_id conf_item_id view_var read_var
set user_is_group_admin_p [im_biz_object_admin_p $user_id $conf_item_id]
# Admin permissions to global + intranet admins + group administrators
set user_admin_p [expr $user_is_admin_p || $user_is_group_admin_p || $user_is_wheel_p]
set user_admin_p [expr {$user_is_admin_p || $user_is_group_admin_p || $user_is_wheel_p}]
if {$user_admin_p} {
set read 1
......@@ -479,7 +479,7 @@ ad_proc -public im_conf_item_list_component {
# Get the start_idx in case of pagination
set start_idx [ns_set get $form_vars "conf_item_start_idx"]
if {"" == $start_idx} { set start_idx 0 }
set end_idx [expr $start_idx + $max_entries_per_page - 1]
set end_idx [expr {$start_idx + $max_entries_per_page - 1}]
set bgcolor(0) " class=roweven"
set bgcolor(1) " class=rowodd"
......@@ -488,7 +488,7 @@ ad_proc -public im_conf_item_list_component {
set current_url [im_url_with_query]
if {![info exists current_page_url]} { set current_page_url [ad_conn url] }
if {![exists_and_not_null return_url]} { set return_url $current_url }
if {(![info exists return_url] || $return_url eq "")} { set return_url $current_url }
# Get the "view" (=list of columns to show)
set view_id [db_string get_view_id "select view_id from im_views where view_name = :view_name" -default 0]
......@@ -550,7 +550,7 @@ ad_proc -public im_conf_item_list_component {
if {$debug} { ns_log Notice "im_conf_item_list_component: $var <- $value" }
} else {
set value [ns_set get $form_vars $var]
if {![string equal "" $value]} {
if {$value ne ""} {
ns_set put $bind_vars $var $value
if {$debug} { ns_log Notice "im_conf_item_list_component: $var <- $value" }
}
......@@ -564,7 +564,7 @@ ad_proc -public im_conf_item_list_component {
for {set i 0} {$i < $len} {incr i} {
set key [ns_set key $bind_vars $i]
set value [ns_set value $bind_vars $i]
if {![string equal $value ""]} {
if {$value ne "" } {
lappend params "$key=[ns_urlencode $value]"
}
}
......@@ -573,7 +573,7 @@ ad_proc -public im_conf_item_list_component {
# ---------------------- Format Header ----------------------------------
# Set up colspan to be the number of headers + 1 for the # column
set colspan [expr [llength $column_headers] + 1]
set colspan [expr {[llength $column_headers] + 1}]
# Format the header names with links that modify the
# sort order of the SQL query.
......@@ -713,13 +713,13 @@ ad_proc -public im_conf_item_list_component {
}
set extra_select [join $extra_selects ",\n\t"]
if { ![empty_string_p $extra_select] } { set extra_select ",\n\t$extra_select" }
if { $extra_select ne "" } { set extra_select ",\n\t$extra_select" }
set extra_from [join $extra_froms ",\n\t"]
if { ![empty_string_p $extra_from] } { set extra_from ",\n\t$extra_from" }
if { $extra_from ne "" } { set extra_from ",\n\t$extra_from" }
set extra_where [join $extra_wheres "and\n\t"]
if { ![empty_string_p $extra_where] } { set extra_where "and \n\t$extra_where" }
if { $extra_where ne "" } { set extra_where "and \n\t$extra_where" }
# ---------------------- Get the SQL Query -------------------------
......@@ -836,7 +836,7 @@ ad_proc -public im_conf_item_list_component {
# We've got a conf_item.
# Write out a line with conf_item information
append table_body_html "<tr$bgcolor([expr $ctr % 2])>\n"
append table_body_html "<tr$bgcolor([expr {$ctr % 2}])>\n"
foreach column_var $column_vars {
append table_body_html "\t<td valign=top>"
......@@ -863,7 +863,7 @@ ad_proc -public im_conf_item_list_component {
# ----------------------------------------------------
# Show a reasonable message when there are no result rows:
if { [empty_string_p $table_body_html] } {
if { $table_body_html eq "" } {
set table_body_html "
<tr class=table_list_page_plain>
......@@ -894,12 +894,12 @@ ad_proc -public im_conf_item_list_component {
set total_in_limited 0
# Deal with pagination
if {$ctr == $max_entries_per_page && $end_idx < [expr $total_in_limited - 1]} {
if {$ctr == $max_entries_per_page && $end_idx < [expr {$total_in_limited - 1}]} {
# This means that there are rows that we decided not to return
# Include a link to go to the next page
set next_start_idx [expr $end_idx + 1]
set next_start_idx [expr {$end_idx + 1}]
set conf_item_max_entries_per_page $max_entries_per_page
set next_page_url "$current_page_url?[export_vars -url {conf_item_id conf_item_object_id conf_item_max_entries_per_page order_by}]&conf_item_start_idx=$next_start_idx&$pass_through_vars_html"
set next_page_url "[export_vars -base $current_page_url {conf_item_id conf_item_object_id conf_item_max_entries_per_page order_by}]&conf_item_start_idx=$next_start_idx&$pass_through_vars_html"
set next_page_html "($remaining_items more) <A href=\"$next_page_url\">&gt;&gt;</a>"
} else {
set next_page_html ""
......@@ -908,9 +908,9 @@ ad_proc -public im_conf_item_list_component {
if { $start_idx > 0 } {
# This means we didn't start with the first row - there is
# at least 1 previous row. add a previous page link
set previous_start_idx [expr $start_idx - $max_entries_per_page]
set previous_start_idx [expr {$start_idx - $max_entries_per_page}]
if { $previous_start_idx < 0 } { set previous_start_idx 0 }
set previous_page_html "<A href=$current_page_url?[export_vars -url {conf_item_id}]&$pass_through_vars_html&order_by=$order_by&conf_item_start_idx=$previous_start_idx>&lt;&lt;</a>"
set previous_page_html "<A href=[export_vars -base $current_page_url {conf_item_id}]&$pass_through_vars_html&order_by=$order_by&conf_item_start_idx=$previous_start_idx>&lt;&lt;</a>"
} else {
set previous_page_html ""
}
......@@ -923,7 +923,7 @@ ad_proc -public im_conf_item_list_component {
<table width='100%'>
<tr>
<td align=left>
<a href=\"/intranet-confdb/new?[export_vars -url {return_url}]\"
<a href=\"/intranet-confdb/[export_vars -base new {return_url}]\"
>[lang::message::lookup "" intranet-confdb.New_Conf_Item "New Conf Item"]</a>
</td>
<td align=right>
......
<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>
......
......@@ -24,7 +24,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-confdb.Associate_Conf_Item_With_$target_object_type "Associate Configuration Item With $target_object_type"]
set context_bar [im_context_bar $page_title]
set page_focus "im_header_form.keywords"
......
......@@ -23,7 +23,7 @@ ad_page_contract {
# ---------------------------------------------------------------
# User id already verified by filters
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
# Check permission on "conf_item_id".
# The SQL below only selects relationships associated with conf_item_id.
......
<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">confdb</property>
......@@ -14,13 +14,13 @@
<%= [export_vars -form {cid return_url}] %>
<table>
<tr>
<th colspan=2><%= [lang::message::lookup "" intranet-confdb.Associate_With "Associate With"] %></th>
<th colspan="2"><%= [lang::message::lookup "" intranet-confdb.Associate_With "Associate With"] %></th>
<th> <%= [lang::message::lookup "" intranet-confdb.Object Object] %></th>
<th> <%= [lang::message::lookup "" intranet-confdb.Comment Comment] %></th>
</tr>
<tr>
<td> <input type=radio name=target_object_type value=user></td>
<td> <input type="radio" name="target_object_type" value="user"></td>
<td> <%= [lang::message::lookup "" intranet-confdb.Object_Type_User "User"] %></td>
<td> <%= [im_user_select -group_id [im_customer_group_id] user_id ""] %><br>
<%= [lang::message::lookup "" intranet-confdb.Associate_As "as"] %>&nbsp;
......@@ -33,7 +33,7 @@
</tr>
<tr>
<td> <input type=radio name=target_object_type value=project></td>
<td> <input type="radio" name="target_object_type" value="project"></td>
<td> <%= [lang::message::lookup "" intranet-confdb.Object_Type_Project "Project"] %></td>
<td> <%= [im_project_select -exclude_subprojects_p 0 project_id] %></td>
<td> <%= [lang::message::lookup "" intranet-confdb.Associate_Msg_Project "
......@@ -42,7 +42,7 @@
</tr>
<tr>
<td> <input type=radio name=target_object_type value=ticket></td>
<td> <input type="radio" name="target_object_type" value="ticket"></td>
<td> <%= [lang::message::lookup "" intranet-confdb.Object_Type_Ticket Ticket] %></td>
<td> <%= [im_select -translate_p 0 -ad_form_option_list_style_p 1 ticket_id [im_ticket_options]] %></td>
<td> <%= [lang::message::lookup "" intranet-confdb.Associate_Msg_Ticket "
......@@ -52,7 +52,7 @@
<tr>
<td>&nbsp;</td>
<td><input type=submit name=submit value="<%= [lang::message::lookup "" intranet-confdb.Associate_Assoc_Action Associate] %>"></td>
<td><input type="submit" name="submit" value="<%= [lang::message::lookup "" intranet-confdb.Associate_Assoc_Action Associate] %>"></td>
<td>&nbsp;</td>
</tr>
......
......@@ -18,7 +18,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-confdb.Associate_Conf_Item_With_Other_Object "Associate Conf Item With Another Object"]
set context_bar [im_context_bar $page_title]
set page_focus "im_header_form.keywords"
......
......@@ -22,7 +22,7 @@ ad_page_contract {
# ---------------------------------------------------------------
# User id already verified by filters
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set del_p [im_permission $current_user_id "add_conf_items"]
if {!$del_p} {
ad_return_complaint 1 "Not sufficient permissions"
......
......@@ -22,7 +22,7 @@ if {![info exists object_id]} {
}
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 user_admin_p 1
set project_id $object_id
......
<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">conf_items</property>
<property name="left_navbar">@left_navbar_html;noquote@</property>
<property name="left_navbar">@left_navbar_html;literal@</property>
<listtemplate name="@list_id@"></listtemplate>
......@@ -25,7 +25,7 @@ ad_page_contract {
# ---------------------------------------------------------------
# User id already verified by filters
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set page_focus "im_header_form.keywords"
set page_title [lang::message::lookup "" intranet-confdb.Configuration_Items "Configuration Items"]
set context_bar [im_context_bar $page_title]
......
......@@ -6,11 +6,11 @@
<master src="../../intranet-core/www/master">
</if>
<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">conf_items</property>
<property name="focus">@focus;noquote@</property>
<property name="sub_navbar">@sub_navbar;noquote@</property>
<property name="focus">@focus;literal@</property>
<property name="sub_navbar">@sub_navbar;literal@</property>
<if @message@ not nil>
<div class="general-message">@message@</div>
......
......@@ -23,7 +23,7 @@ ad_page_contract {
{ enable_master_p 1}
}
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
if {![im_permission $current_user_id "add_conf_items"]} {
ad_return_complaint 1 "You don't have sufficient permissions to create or modify tickets"
ad_script_abort
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<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">conf_items</property>
......
......@@ -27,7 +27,7 @@ ad_page_contract {
set page_title [_ intranet-core.Done]
set context_bar [im_context_bar $page_title]
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set user_is_admin_p [im_is_user_site_wide_or_intranet_admin $current_user_id]
if {!$user_is_admin_p} {
ad_return_complaint 1 "You need to have administration rights for this operation."
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<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">conf_items</property>
<br>
......@@ -27,7 +27,7 @@ who've flooded a site with fake crud.
<center>
<form method=get action=nuke-2>
<input type=hidden name=conf_item_id value="@conf_item_id@">
<input type=submit value="Yes I am sure that I want to delete this @object_type@">
<input type="hidden" name="conf_item_id" value="@conf_item_id@">
<input type="submit" value="Yes I am sure that I want to delete this @object_type@">
</form>
</center>
......@@ -14,7 +14,7 @@
# { conf_item_id:integer "" }
# return_url
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
# ---------------------------------------------------------------
......
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