Commit b748d456 authored by Frank Bergmann's avatar Frank Bergmann

- Gustaf changes

parent 55ec1545
...@@ -137,11 +137,11 @@ db_foreach tickets $sql { ...@@ -137,11 +137,11 @@ db_foreach tickets $sql {
} }
set row_html "<tr$bgcolor([expr $ctr % 2])>\n" set row_html "<tr$bgcolor([expr {$ctr % 2}])>\n"
append row_html "<td>$score_html</td>\n" append row_html "<td>$score_html</td>\n"
append row_html "<td><a href=$ticket_url>$project_name</a></td>\n" append row_html "<td><a href=$ticket_url>$project_name</a></td>\n"
append row_html "</tr>\n" append row_html "</tr>\n"
append row_html "<tr$bgcolor([expr $ctr % 2])>\n" append row_html "<tr$bgcolor([expr {$ctr % 2}])>\n"
append row_html "<td colspan=2>[string range $message 0 $max_message]</td>\n" append row_html "<td colspan=2>[string range $message 0 $max_message]</td>\n"
append row_html "</tr>\n" append row_html "</tr>\n"
......
...@@ -64,6 +64,6 @@ set ticket_types_json "\[[join $ticket_types_list ","]\]" ...@@ -64,6 +64,6 @@ set ticket_types_json "\[[join $ticket_types_list ","]\]"
# ---------------------------------------------------- # ----------------------------------------------------
# Create a random ID for the diagram # 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 "ticket_aging_$diagram_rand" set diagram_id "ticket_aging_$diagram_rand"
...@@ -75,6 +75,6 @@ set of_l10n [lang::message::lookup "" intranet-core.Ticket_Aging_of "of"] ...@@ -75,6 +75,6 @@ set of_l10n [lang::message::lookup "" intranet-core.Ticket_Aging_of "of"]
# ---------------------------------------------------- # ----------------------------------------------------
# Create a random ID for the diagram # 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 "ticket_aging_$diagram_rand" set diagram_id "ticket_aging_$diagram_rand"
...@@ -201,12 +201,12 @@ ad_proc -public im_ticket_permissions { ...@@ -201,12 +201,12 @@ ad_proc -public im_ticket_permissions {
return 0 return 0
} }
set owner_p [expr $user_id == $creation_user_id] set owner_p [expr {$user_id == $creation_user_id}]
set assignee_p [expr $user_id == $ticket_assignee_id] set assignee_p [expr {$user_id == $ticket_assignee_id}]
set customer_p [expr $customer_member_p || $user_id == $ticket_customer_contact_id] set customer_p [expr {$customer_member_p || $user_id == $ticket_customer_contact_id}]
set read [expr $admin_p || $owner_p || $assignee_p || $customer_p || $sla_member_p || $ticket_member_p || $holding_user_p || $case_assignee_p || $queue_member_p || $view_tickets_all_p || $edit_tickets_all_p] set read [expr {$admin_p || $owner_p || $assignee_p || $customer_p || $sla_member_p || $ticket_member_p || $holding_user_p || $case_assignee_p || $queue_member_p || $view_tickets_all_p || $edit_tickets_all_p}]
set write [expr $admin_p || $edit_tickets_all_p || $ticket_admin_p] set write [expr {$admin_p || $edit_tickets_all_p || $ticket_admin_p}]
set view $read set view $read
set admin $write set admin $write
...@@ -393,7 +393,7 @@ namespace eval im_ticket { ...@@ -393,7 +393,7 @@ namespace eval im_ticket {
while {[db_string lv "select im_ticket_seq.last_value"] < $last_ticket_nr} { while {[db_string lv "select im_ticket_seq.last_value"] < $last_ticket_nr} {
set ttt [db_string update "select nextval('im_ticket_seq')"] set ttt [db_string update "select nextval('im_ticket_seq')"]
} }
return [expr $last_ticket_nr + 1] return [expr {$last_ticket_nr + 1}]
} }
} }
...@@ -461,7 +461,7 @@ namespace eval im_ticket { ...@@ -461,7 +461,7 @@ namespace eval im_ticket {
# Update the item with additional variables from the vars array # Update the item with additional variables from the vars array
set sql_list [list] set sql_list [list]
foreach var [array names vars] { foreach var [array names vars] {
if {$var == "ticket_id"} { continue } if {$var eq "ticket_id"} { continue }
lappend sql_list "$var = :$var" lappend sql_list "$var = :$var"
} }
set sql " set sql "
...@@ -1209,9 +1209,9 @@ ad_proc -public im_helpdesk_ticket_component { ...@@ -1209,9 +1209,9 @@ ad_proc -public im_helpdesk_ticket_component {
set extra_select [join $extra_selects ",\n\t"] set extra_select [join $extra_selects ",\n\t"]
set extra_from [join $extra_froms ",\n\t"] set extra_from [join $extra_froms ",\n\t"]
set extra_where [join $extra_wheres "and\n\t"] set extra_where [join $extra_wheres "and\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" }
if { ![empty_string_p $extra_from] } { set extra_from ",\n\t$extra_from" } if { $extra_from ne "" } { set extra_from ",\n\t$extra_from" }
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" }
if {0 == $ticket_status_id} { set ticket_status_id [im_ticket_status_open] } if {0 == $ticket_status_id} { set ticket_status_id [im_ticket_status_open] }
...@@ -1321,7 +1321,7 @@ ad_proc -public im_helpdesk_ticket_component { ...@@ -1321,7 +1321,7 @@ ad_proc -public im_helpdesk_ticket_component {
# Format the List Table Header # Format the List Table Header
# Set up colspan to be the number of headers + 1 for the # column # 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}]
set table_header_html "<tr>\n" set table_header_html "<tr>\n"
foreach col $column_headers { foreach col $column_headers {
...@@ -1342,14 +1342,14 @@ ad_proc -public im_helpdesk_ticket_component { ...@@ -1342,14 +1342,14 @@ ad_proc -public im_helpdesk_ticket_component {
db_foreach personal_ticket_query $personal_ticket_query { db_foreach personal_ticket_query $personal_ticket_query {
set url [im_maybe_prepend_http $url] set url [im_maybe_prepend_http $url]
if { [empty_string_p $url] } { if { $url eq "" } {
set url_string "&nbsp;" set url_string "&nbsp;"
} else { } else {
set url_string "<a href=\"$url\">$url</a>" set url_string "<a href=\"$url\">$url</a>"
} }
# Append together a line of data based on the "column_vars" parameter list # Append together a line of data based on the "column_vars" parameter list
set row_html "<tr$bgcolor([expr $ctr % 2])>\n" set row_html "<tr$bgcolor([expr {$ctr % 2}])>\n"
foreach column_var $column_vars { foreach column_var $column_vars {
append row_html "\t<td class=\"list\">" append row_html "\t<td class=\"list\">"
set cmd "append row_html $column_var" set cmd "append row_html $column_var"
...@@ -1363,7 +1363,7 @@ ad_proc -public im_helpdesk_ticket_component { ...@@ -1363,7 +1363,7 @@ ad_proc -public im_helpdesk_ticket_component {
} }
# Show a reasonable message when there are no result rows: # Show a reasonable message when there are no result rows:
if { [empty_string_p $table_body_html] } { if { $table_body_html eq "" } {
# Let the component disappear if there are no tickets... # Let the component disappear if there are no tickets...
if {!$show_empty_ticket_list_p} { return "" } if {!$show_empty_ticket_list_p} { return "" }
...@@ -1856,9 +1856,9 @@ No customer emails are lost, however the ...@@ -1856,9 +1856,9 @@ No customer emails are lost, however the
offending ticket may get duplicated. offending ticket may get duplicated.
$err_msg $err_msg
" "
if [catch { if {[catch {
ns_sendmail $email $sender_email $subject $message ns_sendmail $email $sender_email $subject $message
} errmsg] { } errmsg]} {
ns_log Error "im_helpdesk_inbox_pop3_import_sweeper: Error sending to \"$email\": $errmsg" ns_log Error "im_helpdesk_inbox_pop3_import_sweeper: Error sending to \"$email\": $errmsg"
} }
......
...@@ -58,7 +58,7 @@ ad_proc -public im_helpdesk_sourceforge_tracker_import_sweeper { } { ...@@ -58,7 +58,7 @@ ad_proc -public im_helpdesk_sourceforge_tracker_import_sweeper { } {
set tree [xml_parse -persist $xml] set tree [xml_parse -persist $xml]
set rss_node [xml_doc_get_first_node $tree] set rss_node [xml_doc_get_first_node $tree]
set root_name [xml_node_get_name $rss_node] set root_name [xml_node_get_name $rss_node]
if { ![string equal $root_name "rss"] } { if { $root_name ne "rss" } {
ns_log Error "im_helpdesk_sourceforge_tracker_import_sweeper: Expected 'rss' as root node of xml file, found: '$root_name'" ns_log Error "im_helpdesk_sourceforge_tracker_import_sweeper: Expected 'rss' as root node of xml file, found: '$root_name'"
return return
} }
......
...@@ -7,12 +7,12 @@ Printer Friendly Template for Tickets ...@@ -7,12 +7,12 @@ Printer Friendly Template for Tickets
<html> <html>
<head> <head>
<title><%=[lang::message::lookup "" intranet-helpdesk.Ticket "Ticket"]%></title> <title><%=[lang::message::lookup "" intranet-helpdesk.Ticket "Ticket"]%></title>
<link rel='stylesheet' href='/intranet/style/invoice.css' type='text/css'> <link rel="stylesheet" href="/intranet/style/invoice.css" type="text/css">
<link rel=StyleSheet type=text/css href="/intranet/style/style.saltnpepper.css"> <link rel=StyleSheet type="text/css" href="/intranet/style/style.saltnpepper.css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head> </head>
<body text="#000000"> <body text="#000000">
<p style='text-align:left'><%=[im_logo]%></p> <p style="text-align:left"><%=[im_logo]%></p>
<br> <br>
<table width="650px" cellpadding="5" cellspacing="5"> <table width="650px" cellpadding="5" cellspacing="5">
<tr> <tr>
......
<master> <master>
<property name="title">@page_title@</property> <property name="doc(title)">@page_title;literal@</property>
<property name="context">#intranet-core.context#</property> <property name="context">#intranet-core.context#</property>
<property name="main_navbar_label">helpdesk</property> <property name="main_navbar_label">helpdesk</property>
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<tr> <tr>
<td></td> <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> <td></td>
</tr> </tr>
</table> </table>
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<tr> <tr>
<td></td> <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> <td></td>
</tr> </tr>
</table> </table>
......
...@@ -25,7 +25,7 @@ ad_page_contract { ...@@ -25,7 +25,7 @@ ad_page_contract {
# Defaults & Security # 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-helpdesk.Associate_Ticket_With_$target_object_type "Associate Ticket With $target_object_type"] set page_title [lang::message::lookup "" intranet-helpdesk.Associate_Ticket_With_$target_object_type "Associate Ticket With $target_object_type"]
set context_bar [im_context_bar $page_title] set context_bar [im_context_bar $page_title]
set page_focus "im_header_form.keywords" set page_focus "im_header_form.keywords"
...@@ -101,7 +101,7 @@ switch $target_object_type { ...@@ -101,7 +101,7 @@ switch $target_object_type {
:current_user_id, :current_user_id,
'[ad_conn peeraddr]', '[ad_conn peeraddr]',
:release_status_id, :release_status_id,
[expr $max_sort_order + 10] [expr {$max_sort_order + 10}]
) )
"] "]
...@@ -163,7 +163,7 @@ switch $target_object_type { ...@@ -163,7 +163,7 @@ switch $target_object_type {
null, null,
:current_user_id, :current_user_id,
'[ad_conn peeraddr]', '[ad_conn peeraddr]',
[expr $max_sort_order + 10] [expr {$max_sort_order + 10}]
) )
" "
# Write the audit log # Write the audit log
......
<master> <master>
<property name="title">@page_title@</property> <property name="doc(title)">@page_title;literal@</property>
<property name="context">#intranet-core.context#</property> <property name="context">#intranet-core.context#</property>
<property name="main_navbar_label">helpdesk</property> <property name="main_navbar_label">helpdesk</property>
<br> <br>
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<thead> <thead>
<tr class="list-header"> <tr class="list-header">
<th colspan=2><%= [lang::message::lookup "" intranet-helpdesk.Associate_With "Associate With"] %></th> <th colspan="2"><%= [lang::message::lookup "" intranet-helpdesk.Associate_With "Associate With"] %></th>
<th> <%= [lang::message::lookup "" intranet-helpdesk.Object Object] %></th> <th> <%= [lang::message::lookup "" intranet-helpdesk.Object Object] %></th>
<th> <%= [lang::message::lookup "" intranet-helpdesk.Comment Comment] %></th> <th> <%= [lang::message::lookup "" intranet-helpdesk.Comment Comment] %></th>
</tr> </tr>
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<tbody> <tbody>
<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-helpdesk.Object_Type_User "User"] %></td> <td> <%= [lang::message::lookup "" intranet-helpdesk.Object_Type_User "User"] %></td>
<td> <%= [im_user_select user_id ""] %> <%= [lang::message::lookup "" intranet-helpdesk.Associate_As "as"] %>&nbsp; <td> <%= [im_user_select user_id ""] %> <%= [lang::message::lookup "" intranet-helpdesk.Associate_As "as"] %>&nbsp;
<%= [im_biz_object_roles_select role_id $first_ticket_id [im_biz_object_role_full_member]] %> <%= [im_biz_object_roles_select role_id $first_ticket_id [im_biz_object_role_full_member]] %>
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
</tr> </tr>
<tr> <tr>
<td> <input type=radio name=target_object_type value=release_project></td> <td> <input type="radio" name="target_object_type" value="release_project"></td>
<td> <%= [lang::message::lookup "" intranet-helpdesk.Object_Type_Release_Project "Release Project"] %></td> <td> <%= [lang::message::lookup "" intranet-helpdesk.Object_Type_Release_Project "Release Project"] %></td>
<td> <%= [im_project_select -project_type_id [im_project_type_software_release] release_project_id] %></td> <td> <%= [im_project_select -project_type_id [im_project_type_software_release] release_project_id] %></td>
<td> <%= [lang::message::lookup "" intranet-helpdesk.Associate_Msg_Release_Project " <td> <%= [lang::message::lookup "" intranet-helpdesk.Associate_Msg_Release_Project "
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
</tr> </tr>
<tr> <tr>
<td> <input type=radio name=target_object_type value=conf_item></td> <td> <input type="radio" name="target_object_type" value="conf_item"></td>
<td> <%= [lang::message::lookup "" intranet-helpdesk.Object_Type_Configuration_Item "Configuration Item"] %></td> <td> <%= [lang::message::lookup "" intranet-helpdesk.Object_Type_Configuration_Item "Configuration Item"] %></td>
<td> <%= [im_select -ad_form_option_list_style_p 1 -translate_p 0 conf_item_id [im_conf_item_options]] %></td> <td> <%= [im_select -ad_form_option_list_style_p 1 -translate_p 0 conf_item_id [im_conf_item_options]] %></td>
<td> <%= [lang::message::lookup "" intranet-helpdesk.Associate_Msg_Conf_Item " <td> <%= [lang::message::lookup "" intranet-helpdesk.Associate_Msg_Conf_Item "
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
</tr> </tr>
<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-helpdesk.Object_Type_Ticket Ticket] %></td> <td> <%= [lang::message::lookup "" intranet-helpdesk.Object_Type_Ticket Ticket] %></td>
<td> <%= [im_select -ad_form_option_list_style_p 1 -translate_p 0 ticket_id [im_ticket_options -maxlen_name 30]] %></td> <td> <%= [im_select -ad_form_option_list_style_p 1 -translate_p 0 ticket_id [im_ticket_options -maxlen_name 30]] %></td>
<td> <%= [lang::message::lookup "" intranet-helpdesk.Associate_Msg_Ticket " <td> <%= [lang::message::lookup "" intranet-helpdesk.Associate_Msg_Ticket "
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<tr> <tr>
<td>&nbsp;</td> <td>&nbsp;</td>
<td><input type=submit name=submit value="<%= [lang::message::lookup "" intranet-helpdesk.Associate_Assoc_Action Associate] %>"></td> <td><input type="submit" name="submit" value="<%= [lang::message::lookup "" intranet-helpdesk.Associate_Assoc_Action Associate] %>"></td>
<td>&nbsp;</td> <td>&nbsp;</td>
</tr> </tr>
<tbody> <tbody>
......
...@@ -19,7 +19,7 @@ ad_page_contract { ...@@ -19,7 +19,7 @@ ad_page_contract {
# Defaults & Security # 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-helpdesk.Associate_Ticket_With_Other_Object "Associate Tickets With Another Object"] set page_title [lang::message::lookup "" intranet-helpdesk.Associate_Ticket_With_Other_Object "Associate Tickets With Another Object"]
set context_bar [im_context_bar $page_title] set context_bar [im_context_bar $page_title]
set page_focus "im_header_form.keywords" set page_focus "im_header_form.keywords"
......
<master> <master>
<property name="title">@page_title@</property> <property name="doc(title)">@page_title;literal@</property>
<property name="context">#intranet-core.context#</property> <property name="context">#intranet-core.context#</property>
<property name="main_navbar_label">helpdesk</property> <property name="main_navbar_label">helpdesk</property>
......
...@@ -20,7 +20,7 @@ ad_page_contract { ...@@ -20,7 +20,7 @@ ad_page_contract {
# Defaults & Security # 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-helpdesk.Title_Change_Prio "Change Ticket Prio"] set page_title [lang::message::lookup "" intranet-helpdesk.Title_Change_Prio "Change Ticket Prio"]
if { ""==$ticket_prio } { if { ""==$ticket_prio } {
......
<master> <master>
<property name="title">@page_title@</property> <property name="doc(title)">@page_title;literal@</property>
<property name="context">#intranet-core.context#</property> <property name="context">#intranet-core.context#</property>
<property name="main_navbar_label">helpdesk</property> <property name="main_navbar_label">helpdesk</property>
......
...@@ -20,7 +20,7 @@ ad_page_contract { ...@@ -20,7 +20,7 @@ ad_page_contract {
# Defaults & Security # Defaults & Security
# --------------------------------------------------------------- # ---------------------------------------------------------------
set current_user_id [ad_maybe_redirect_for_registration] set current_user_id [auth::require_login]
set ticket_ids [list] set ticket_ids [list]
set page_title [lang::message::lookup "" intranet-helpdesk.Title_Change_Prio "Change Ticket Prio"] set page_title [lang::message::lookup "" intranet-helpdesk.Title_Change_Prio "Change Ticket Prio"]
...@@ -51,5 +51,5 @@ append ticket_list_html "</ul>" ...@@ -51,5 +51,5 @@ append ticket_list_html "</ul>"
set select_box [im_category_select_plain "Intranet Ticket Priority" "ticket_prio"] set select_box [im_category_select_plain "Intranet Ticket Priority" "ticket_prio"]
# set form_action "action-change-priority-2?[export_vars -url {tid return_url]}" # set form_action "[export_vars -base action-change-priority-2 {tid return_url]}"
set form_action "action-change-priority-2" set form_action "action-change-priority-2"
...@@ -29,7 +29,7 @@ ad_page_contract { ...@@ -29,7 +29,7 @@ ad_page_contract {
# Defaults & Security # Defaults & Security
# --------------------------------------------------------------- # ---------------------------------------------------------------
set current_user_id [ad_maybe_redirect_for_registration] set current_user_id [auth::require_login]
if { {} == $ticket_ids} { if { {} == $ticket_ids} {
set ticket_ids $tid set ticket_ids $tid
} }
......
<master> <master>
<property name="title">@page_title@</property> <property name="doc(title)">@page_title;literal@</property>
<property name="context">#intranet-core.context#</property> <property name="context">#intranet-core.context#</property>
<property name="main_navbar_label">helpdesk</property> <property name="main_navbar_label">helpdesk</property>
......
...@@ -20,7 +20,7 @@ ad_page_contract { ...@@ -20,7 +20,7 @@ ad_page_contract {
# Defaults & Security # 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-helpdesk.Title_Reassign_Ticket "Reassign Ticket"] set page_title [lang::message::lookup "" intranet-helpdesk.Title_Reassign_Ticket "Reassign Ticket"]
if {"" == $ticket_assignee_id} { if {"" == $ticket_assignee_id} {
......
<master> <master>
<property name="title">@page_title@</property> <property name="doc(title)">@page_title;literal@</property>
<property name="context">#intranet-core.context#</property> <property name="context">#intranet-core.context#</property>
<property name="main_navbar_label">helpdesk</property> <property name="main_navbar_label">helpdesk</property>
......
...@@ -20,7 +20,7 @@ ad_page_contract { ...@@ -20,7 +20,7 @@ ad_page_contract {
# Defaults & Security # Defaults & Security
# --------------------------------------------------------------- # ---------------------------------------------------------------
set current_user_id [ad_maybe_redirect_for_registration] set current_user_id [auth::require_login]
set ticket_ids [list] set ticket_ids [list]
set page_title [lang::message::lookup "" intranet-helpdesk.Title_Reassign "Reassign Tickets"] set page_title [lang::message::lookup "" intranet-helpdesk.Title_Reassign "Reassign Tickets"]
if {1 == [llength $tid]} { set tid [lindex $tid 0] } if {1 == [llength $tid]} { set tid [lindex $tid 0] }
...@@ -78,5 +78,5 @@ foreach assig $ticket_assignee_options { ...@@ -78,5 +78,5 @@ foreach assig $ticket_assignee_options {
} }
append select_box "</select>\n" append select_box "</select>\n"
# set form_action "action-reassign-2?[export_vars -url {tid return_url}]" # set form_action [export_vars -base action-reassign-2 {tid return_url}]
set form_action "action-reassign-2" set form_action "action-reassign-2"
...@@ -22,7 +22,7 @@ ad_page_contract { ...@@ -22,7 +22,7 @@ ad_page_contract {
return_url return_url
} }
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] set user_is_admin_p [im_is_user_site_wide_or_intranet_admin $user_id]
set user_name [im_name_from_user_id [ad_conn user_id]] set user_name [im_name_from_user_id [ad_conn user_id]]
...@@ -146,7 +146,7 @@ switch $action_id { ...@@ -146,7 +146,7 @@ switch $action_id {
where t.ticket_id = p.project_id and where t.ticket_id = p.project_id and
t.ticket_id = :ticket_id t.ticket_id = :ticket_id
" "
set customer_p [expr $ticket_customer_contact_id == $user_id || $customer_company_member_p > 0] set customer_p [expr {$ticket_customer_contact_id == $user_id || $customer_company_member_p > 0}]
if {!$customer_p && !$visible_explicite_permission_p} { if {!$customer_p && !$visible_explicite_permission_p} {
im_ticket::check_permissions -ticket_id $ticket_id -operation "write" im_ticket::check_permissions -ticket_id $ticket_id -operation "write"
......
<master> <master>
<property name="title">@page_title@</property> <property name="doc(title)">@page_title;literal@</property>
<property name="context">#intranet-core.context#</property> <property name="context">#intranet-core.context#</property>
<property name="main_navbar_label">helpdesk</property> <property name="main_navbar_label">helpdesk</property>
......
...@@ -17,7 +17,7 @@ ad_page_contract { ...@@ -17,7 +17,7 @@ ad_page_contract {
# Defaults & Security # 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-helpdesk.Admin_Helpdesk "Helpdesk Administration"] set page_title [lang::message::lookup "" intranet-helpdesk.Admin_Helpdesk "Helpdesk Administration"]
set context_bar [im_context_bar $page_title] set context_bar [im_context_bar $page_title]
set page_focus "im_header_form.keywords" set page_focus "im_header_form.keywords"
......
<master> <master>
<property name="title">@page_title@</property> <property name="doc(title)">@page_title;literal@</property>
<property name="context">#intranet-core.context#</property> <property name="context">#intranet-core.context#</property>
<property name="main_navbar_label">helpdesk</property> <property name="main_navbar_label">helpdesk</property>
<property name="sub_navbar">@ticket_navbar_html;noquote@</property> <property name="sub_navbar">@ticket_navbar_html;literal@</property>
<property name="left_navbar">@left_navbar_html;noquote@</property> <property name="left_navbar">@left_navbar_html;literal@</property>
<SCRIPT Language=JavaScript src=/resources/diagram/diagram/diagram.js></SCRIPT> <SCRIPT Language=JavaScript src=/resources/diagram/diagram/diagram.js></SCRIPT>
<table cellspacing=0 cellpadding=0 border=0 width="100%"> <table cellspacing="0" cellpadding="0" border="0" width="100%">
<form action=/intranet-helpdesk/action method=POST> <form action=/intranet-helpdesk/action method=POST>
<%= [export_vars -form {return_url}] %> <%= [export_vars -form {return_url}] %>
<tr valign=top> <tr valign="top">
<td> <td>
<table class="table_list_page"> <table class="table_list_page">
......
...@@ -37,7 +37,7 @@ ad_page_contract { ...@@ -37,7 +37,7 @@ ad_page_contract {
# Defaults & Security # 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-helpdesk.Tickets "Tickets"] set page_title [lang::message::lookup "" intranet-helpdesk.Tickets "Tickets"]
set context_bar [im_context_bar $page_title] set context_bar [im_context_bar $page_title]
set page_focus "im_header_form.keywords" set page_focus "im_header_form.keywords"
...@@ -56,10 +56,10 @@ if {"all" == $mine_p && !$view_tickets_all_p} { ...@@ -56,10 +56,10 @@ if {"all" == $mine_p && !$view_tickets_all_p} {
set mine_p "queue" set mine_p "queue"
} }
if { [empty_string_p $how_many] || $how_many < 1 } { if { $how_many eq "" || $how_many < 1 } {
set how_many [im_parameter -package_id [im_package_core_id] NumberResultsPerPage "" 50] set how_many [im_parameter -package_id [im_package_core_id] NumberResultsPerPage "" 50]
} }
set end_idx [expr $start_idx + $how_many] set end_idx [expr {$start_idx + $how_many}]
if {"" == $start_date} { set start_date [parameter::get_from_package_key -package_key "intranet-cost" -parameter DefaultStartDate -default "2000-01-01"] } if {"" == $start_date} { set start_date [parameter::get_from_package_key -package_key "intranet-cost" -parameter DefaultStartDate -default "2000-01-01"] }
if {"" == $end_date} { set end_date [parameter::get_from_package_key -package_key "intranet-cost" -parameter DefaultEndDate -default "2100-01-01"] } if {"" == $end_date} { set end_date [parameter::get_from_package_key -package_key "intranet-cost" -parameter DefaultEndDate -default "2100-01-01"] }
...@@ -152,7 +152,7 @@ db_foreach column_list_sql $column_sql { ...@@ -152,7 +152,7 @@ db_foreach column_list_sql $column_sql {
if {!$user_is_admin_p} { set admin_link "" } if {!$user_is_admin_p} { set admin_link "" }
set checkbox_p [regexp {<input} $column_name match] set checkbox_p [regexp {<input} $column_name match]
if { [string compare $order_by $column_name] == 0 || $checkbox_p } { if { $order_by eq $column_name || $checkbox_p } {
append table_header_html "<td class=rowtitle>$col_txt$admin_link</td>\n" append table_header_html "<td class=rowtitle>$col_txt$admin_link</td>\n"
} else { } else {
append table_header_html "<td class=rowtitle><a href=\"$col_url\">$col_txt</a>$admin_link</td>\n" append table_header_html "<td class=rowtitle><a href=\"$col_url\">$col_txt</a>$admin_link</td>\n"
...@@ -169,7 +169,7 @@ set table_header_html " ...@@ -169,7 +169,7 @@ set table_header_html "
# Set up colspan to be the number of headers + 1 for the # column # 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}]
# --------------------------------------------------------------- # ---------------------------------------------------------------
...@@ -223,7 +223,7 @@ if {[llength $ticket_sla_options] < 2 && !$view_tickets_all_p} { set sla_exists_ ...@@ -223,7 +223,7 @@ if {[llength $ticket_sla_options] < 2 && !$view_tickets_all_p} { set sla_exists_
# If there's only one SLA (usually when user is customer) set default SLA # If there's only one SLA (usually when user is customer) set default SLA
if {[llength $ticket_sla_options] == 2 && !$view_tickets_all_p} { if {[llength $ticket_sla_options] == 2 && !$view_tickets_all_p} {
set ticket_sla_options [im_helpdesk_ticket_sla_options -include_create_sla_p 1 -include_empty_p 0] set ticket_sla_options [im_helpdesk_ticket_sla_options -include_create_sla_p 1 -include_empty_p 0]
set ticket_sla_id [lindex [lindex $ticket_sla_options 0] 1] set ticket_sla_id [lindex $ticket_sla_options 0 1]
} }
set ticket_creator_options [list] set ticket_creator_options [list]
...@@ -321,13 +321,13 @@ array set extra_sql_array [im_dynfield::search_sql_criteria_from_form \ ...@@ -321,13 +321,13 @@ array set extra_sql_array [im_dynfield::search_sql_criteria_from_form \
# --------------------------------------------------------------- # ---------------------------------------------------------------
set criteria [list] set criteria [list]
if {![empty_string_p $ticket_status_id] && $ticket_status_id > 0 } { if {$ticket_status_id ne "" && $ticket_status_id > 0 } {
lappend criteria "t.ticket_status_id in (select * from im_sub_categories($ticket_status_id))" lappend criteria "t.ticket_status_id in (select * from im_sub_categories($ticket_status_id))"
} }
if {![empty_string_p $ticket_type_id] && $ticket_type_id != 0 } { if {$ticket_type_id ne "" && $ticket_type_id != 0 } {
lappend criteria "t.ticket_type_id in ([join [im_sub_categories $ticket_type_id] ","])" lappend criteria "t.ticket_type_id in ([join [im_sub_categories $ticket_type_id] ","])"
} }
if {![empty_string_p $ticket_queue_id] && $ticket_queue_id != 0 } { if {$ticket_queue_id ne "" && $ticket_queue_id != 0 } {
if {"null" == $ticket_queue_id} { if {"null" == $ticket_queue_id} {
lappend criteria "t.ticket_queue_id is null" lappend criteria "t.ticket_queue_id is null"
} else { } else {
...@@ -335,11 +335,11 @@ if {![empty_string_p $ticket_queue_id] && $ticket_queue_id != 0 } { ...@@ -335,11 +335,11 @@ if {![empty_string_p $ticket_queue_id] && $ticket_queue_id != 0 } {
} }
} }
if {[empty_string_p $ticket_sla_id] == 0 && $ticket_sla_id != 0 } { if {$ticket_sla_id eq "" == 0 && $ticket_sla_id != 0 } {
lappend criteria "p.parent_id = :ticket_sla_id" lappend criteria "p.parent_id = :ticket_sla_id"
} }
if {[empty_string_p $ticket_creator_id] == 0 && $ticket_creator_id != 0 } { if {$ticket_creator_id eq "" == 0 && $ticket_creator_id != 0 } {
lappend criteria "t.ticket_id in (select object_id from acs_objects where creation_user = :ticket_creator_id)" lappend criteria "t.ticket_id in (select object_id from acs_objects where creation_user = :ticket_creator_id)"
} }
...@@ -389,20 +389,20 @@ if {"" != $customer_contact_dept_code} { ...@@ -389,20 +389,20 @@ if {"" != $customer_contact_dept_code} {
if {![empty_string_p $customer_id] && $customer_id != 0 } { if {$customer_id ne "" && $customer_id != 0 } {
lappend criteria "p.company_id = :customer_id" lappend criteria "p.company_id = :customer_id"
} }
if {![empty_string_p $customer_contact_id] && $customer_contact_id != 0 } { if {$customer_contact_id ne "" && $customer_contact_id != 0 } {
lappend criteria "t.ticket_customer_contact_id = :customer_contact_id" lappend criteria "t.ticket_customer_contact_id = :customer_contact_id"
} }
if {![empty_string_p $start_date] && $start_date != "" } { if {$start_date ne "" && $start_date ne "" } {
lappend criteria "o.creation_date >= :start_date::timestamptz" lappend criteria "o.creation_date >= :start_date::timestamptz"
} }
if {![empty_string_p $end_date] && $end_date != "" } { if {$end_date ne "" && $end_date ne "" } {
lappend criteria "o.creation_date < :end_date::timestamptz" lappend criteria "o.creation_date < :end_date::timestamptz"
} }
if {![empty_string_p $ticket_name] && $ticket_name != "" } { if {$ticket_name ne "" && $ticket_name ne "" } {
if {0 && ![string isalphanum $ticket_name]} { if {0 && ![string isalphanum $ticket_name]} {
ad_return_complaint 1 [lang::message::lookup "" intranet-helpdesk.Only_alphanum_allowed " ad_return_complaint 1 [lang::message::lookup "" intranet-helpdesk.Only_alphanum_allowed "
Only alphanumerical characters are allowed for searching for security reasons. Only alphanumerical characters are allowed for searching for security reasons.
...@@ -415,7 +415,7 @@ if {![empty_string_p $ticket_name] && $ticket_name != "" } { ...@@ -415,7 +415,7 @@ if {![empty_string_p $ticket_name] && $ticket_name != "" } {
set letter [string toupper $letter] set letter [string toupper $letter]
if {![empty_string_p $letter] && [string compare $letter "ALL"] != 0 && [string compare $letter "SCROLL"] != 0 } { if {$letter ne "" && $letter ne "ALL" && $letter ne "SCROLL" } {
lappend criteria "im_first_letter_default_to_a(p.project_name) = upper(:letter)" lappend criteria "im_first_letter_default_to_a(p.project_name) = upper(:letter)"
} }
...@@ -548,10 +548,10 @@ set extra_select [join $extra_selects ",\n\t"] ...@@ -548,10 +548,10 @@ set extra_select [join $extra_selects ",\n\t"]
set extra_from [join $extra_froms ",\n\t"] set extra_from [join $extra_froms ",\n\t"]
set extra_where [join $extra_wheres "and\n\t"] set extra_where [join $extra_wheres "and\n\t"]
if { ![empty_string_p $where_clause] } { set where_clause " and $where_clause" } if { $where_clause ne "" } { set where_clause " and $where_clause" }
if { ![empty_string_p $extra_select] } { set extra_select ",\n\t$extra_select" } if { $extra_select ne "" } { set extra_select ",\n\t$extra_select" }
if { ![empty_string_p $extra_from] } { set extra_from ",\n\t$extra_from" } if { $extra_from ne "" } { set extra_from ",\n\t$extra_from" }
if { ![empty_string_p $extra_where] } { set extra_where ",\n\t$extra_where" } if { $extra_where ne "" } { set extra_where ",\n\t$extra_where" }
# --------------------------------------------------------------- # ---------------------------------------------------------------
...@@ -649,7 +649,7 @@ eval "set sql \"$sql\"" ...@@ -649,7 +649,7 @@ eval "set sql \"$sql\""
# ad_return_complaint 1 "<pre>$sql</pre>" # ad_return_complaint 1 "<pre>$sql</pre>"
if {[string equal $letter "ALL"]} { if {$letter eq "ALL"} {
# Set these limits to negative values to deactivate them # Set these limits to negative values to deactivate them
set total_in_limited -1 set total_in_limited -1
set how_many -1 set how_many -1
...@@ -771,7 +771,7 @@ db_foreach tickets_info_query $selection -bind $form_vars { ...@@ -771,7 +771,7 @@ db_foreach tickets_info_query $selection -bind $form_vars {
set ticket_status_l10n [lang::message::lookup "" intranet-core.$ticket_status_key $ticket_status] set ticket_status_l10n [lang::message::lookup "" intranet-core.$ticket_status_key $ticket_status]
# Append together a line of data based on the "column_vars" parameter list # Append together a line of data based on the "column_vars" parameter list
set row_html "<tr$bgcolor([expr $ctr % 2])>\n" set row_html "<tr$bgcolor([expr {$ctr % 2}])>\n"
foreach column_var $column_vars { foreach column_var $column_vars {
append row_html "\t<td valign=top>" append row_html "\t<td valign=top>"
set cmd "append row_html $column_var" set cmd "append row_html $column_var"
...@@ -789,7 +789,7 @@ db_foreach tickets_info_query $selection -bind $form_vars { ...@@ -789,7 +789,7 @@ db_foreach tickets_info_query $selection -bind $form_vars {
} }
# Show a reasonable message when there are no result rows: # 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 " set table_body_html "
<tr><td colspan=$colspan><ul><li><b> <tr><td colspan=$colspan><ul><li><b>
[lang::message::lookup "" intranet-core.lt_There_are_currently_n "There are currently no entries matching the selected criteria"] [lang::message::lookup "" intranet-core.lt_There_are_currently_n "There are currently no entries matching the selected criteria"]
...@@ -800,7 +800,7 @@ if { [empty_string_p $table_body_html] } { ...@@ -800,7 +800,7 @@ if { [empty_string_p $table_body_html] } {
if { $end_idx < $total_in_limited } { if { $end_idx < $total_in_limited } {
# This means that there are rows that we decided not to return # This means that there are rows that we decided not to return
# Include a link to go to the next page # Include a link to go to the next page
set next_start_idx [expr $end_idx + 0] set next_start_idx [expr {$end_idx + 0}]
set next_page_url "index?start_idx=$next_start_idx&amp;[export_ns_set_vars url [list start_idx]]" set next_page_url "index?start_idx=$next_start_idx&amp;[export_ns_set_vars url [list start_idx]]"
} else { } else {
set next_page_url "" set next_page_url ""
...@@ -809,7 +809,7 @@ if { $end_idx < $total_in_limited } { ...@@ -809,7 +809,7 @@ if { $end_idx < $total_in_limited } {
if { $start_idx > 0 } { if { $start_idx > 0 } {
# This means we didn't start with the first row - there is # This means we didn't start with the first row - there is
# at least 1 previous row. add a previous page link # at least 1 previous row. add a previous page link
set previous_start_idx [expr $start_idx - $how_many] set previous_start_idx [expr {$start_idx - $how_many}]
if { $previous_start_idx < 0 } { set previous_start_idx 0 } if { $previous_start_idx < 0 } { set previous_start_idx 0 }
set previous_page_url "index?start_idx=$previous_start_idx&amp;[export_ns_set_vars url [list start_idx]]" set previous_page_url "index?start_idx=$previous_start_idx&amp;[export_ns_set_vars url [list start_idx]]"
} else { } else {
...@@ -825,7 +825,7 @@ if { $start_idx > 0 } { ...@@ -825,7 +825,7 @@ if { $start_idx > 0 } {
# => include a link to go to the next page # => include a link to go to the next page
# #
if {$total_in_limited > 0 && $end_idx < $total_in_limited} { if {$total_in_limited > 0 && $end_idx < $total_in_limited} {
set next_start_idx [expr $end_idx + 0] set next_start_idx [expr {$end_idx + 0}]
set next_page "<a href=index?start_idx=$next_start_idx&amp;[export_ns_set_vars url [list start_idx]]>Next Page</a>" set next_page "<a href=index?start_idx=$next_start_idx&amp;[export_ns_set_vars url [list start_idx]]>Next Page</a>"
} else { } else {
set next_page "" set next_page ""
...@@ -836,7 +836,7 @@ if {$total_in_limited > 0 && $end_idx < $total_in_limited} { ...@@ -836,7 +836,7 @@ if {$total_in_limited > 0 && $end_idx < $total_in_limited} {
# => add a previous page link # => add a previous page link
# #
if { $start_idx > 0 } { if { $start_idx > 0 } {
set previous_start_idx [expr $start_idx - $how_many] set previous_start_idx [expr {$start_idx - $how_many}]
if { $previous_start_idx < 0 } { set previous_start_idx 0 } if { $previous_start_idx < 0 } { set previous_start_idx 0 }
set previous_page "<a href=index?start_idx=$previous_start_idx&amp;[export_ns_set_vars url [list start_idx]]>Previous Page</a>" set previous_page "<a href=index?start_idx=$previous_start_idx&amp;[export_ns_set_vars url [list start_idx]]>Previous Page</a>"
} else { } else {
...@@ -845,8 +845,8 @@ if { $start_idx > 0 } { ...@@ -845,8 +845,8 @@ if { $start_idx > 0 } {
# Showing "next page" and the number of tickets shown # Showing "next page" and the number of tickets shown
set start_idxpp [expr $start_idx+1] set start_idxpp [expr {$start_idx+1}]
set end_idx [expr $start_idx + $how_many] set end_idx [expr {$start_idx + $how_many}]
if {$end_idx > $total_in_limited} { set end_idx $total_in_limited } if {$end_idx > $total_in_limited} { set end_idx $total_in_limited }
set viewing_msg [lang::message::lookup "" intranet-helpdesk.Viewing_start_end_from_total_in_limited " set viewing_msg [lang::message::lookup "" intranet-helpdesk.Viewing_start_end_from_total_in_limited "
Viewing tickets %start_idxpp% to %end_idx% from %total_in_limited%"] Viewing tickets %start_idxpp% to %end_idx% from %total_in_limited%"]
...@@ -869,7 +869,7 @@ if {!$user_is_admin_p} { set ticket_action_customize_html "" } ...@@ -869,7 +869,7 @@ if {!$user_is_admin_p} { set ticket_action_customize_html "" }
set table_submit_html " set table_submit_html "
<tfoot> <tfoot>
<tr valign=top> <tr valign=top>
<td align=left colspan=[expr $colspan-1] valign=top> <td align=left colspan=[expr {$colspan-1}] valign=top>
<!-- [im_gif cleardot] --> <!-- [im_gif cleardot] -->
<table cellspacing=1 cellpadding=1 border=0> <table cellspacing=1 cellpadding=1 border=0>
<tr valign=top> <tr valign=top>
......
<master> <master>
<property name="title">@page_title@</property> <property name="doc(title)">@page_title;literal@</property>
<property name="main_navbar_label"></property> <property name="main_navbar_label"></property>
<%= [im_box_header $page_title] %> <%= [im_box_header $page_title] %>
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<form action='@return_url;noquote@' method=POST> <form action='@return_url;noquote@' method=POST>
<%= [export_vars -form {return_url ticket_id ticket_nr ticket_name}] %> <%= [export_vars -form {return_url ticket_id ticket_nr ticket_name}] %>
<table cellspacing=2 cellpadding=2> <table cellspacing="2" cellpadding="2">
<!-- ticket sla --> <!-- ticket sla -->
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<tr class=roweven> <tr class=roweven>
<td></td> <td></td>
<td><input type=submit value='<%= [lang::message::lookup "" intranet-core.Continue "Continue"] %>'></td> <td><input type="submit" value='<%= [lang::message::lookup "" intranet-core.Continue "Continue"] %>'></td>
</tr> </tr>
</table> </table>
......
...@@ -21,13 +21,13 @@ ad_page_contract { ...@@ -21,13 +21,13 @@ ad_page_contract {
# No permissions necessary, that's handled by the object's new page # No permissions necessary, that's handled by the object's new page
# Here we just select an object_type_id for the given object. # Here we just select an object_type_id for the given object.
set current_user_id [ad_maybe_redirect_for_registration] set current_user_id [auth::require_login]
set page_title [lang::message::lookup "" intranet-helpdesk.Please_Select_Ticket_Properties "Please select ticket properties"] set page_title [lang::message::lookup "" intranet-helpdesk.Please_Select_Ticket_Properties "Please select ticket properties"]
set context_bar [im_context_bar $page_title] set context_bar [im_context_bar $page_title]
set add_tickets_p [im_permission $current_user_id "add_tickets"] set add_tickets_p [im_permission $current_user_id "add_tickets"]
set ticket_sla_options [im_select_flatten_list [im_helpdesk_ticket_sla_options -customer_id $ticket_customer_id -include_create_sla_p 1 -include_empty_p 0]] set ticket_sla_options [im_select_flatten_list [im_helpdesk_ticket_sla_options -customer_id $ticket_customer_id -include_create_sla_p 1 -include_empty_p 0]]
set len_ticket_sla_options [expr [llength $ticket_sla_options] / 2] set len_ticket_sla_options [expr {[llength $ticket_sla_options] / 2}]
if {!$add_tickets_p} { if {!$add_tickets_p} {
......
<if @enable_master_p@><master></if> <if @enable_master_p@><master></if>
<property name="title">@page_title@</property> <property name="doc(title)">@page_title;literal@</property>
<property name="context">@context;noquote@</property> <property name="context">@context;literal@</property>
<property name="main_navbar_label">helpdesk</property> <property name="main_navbar_label">helpdesk</property>
<property name="focus">@focus;noquote@</property> <property name="focus">@focus;literal@</property>
<property name="sub_navbar">@sub_navbar;noquote@</property> <property name="sub_navbar">@sub_navbar;literal@</property>
<property name="left_navbar">@left_navbar_html;noquote@</property> <property name="left_navbar">@left_navbar_html;literal@</property>
<SCRIPT Language=JavaScript src=/resources/diagram/diagram/diagram.js></SCRIPT> <SCRIPT Language=JavaScript src=/resources/diagram/diagram/diagram.js></SCRIPT>
@message_html;noquote@ @message_html;noquote@
......
...@@ -74,7 +74,7 @@ if {![info exists task]} { ...@@ -74,7 +74,7 @@ if {![info exists task]} {
# Security # Security
# ------------------------------------------------------------------ # ------------------------------------------------------------------
set current_user_id [ad_maybe_redirect_for_registration] set current_user_id [auth::require_login]
set user_id $current_user_id set user_id $current_user_id
set current_url [im_url_with_query] set current_url [im_url_with_query]
set action_url "/intranet-helpdesk/new" set action_url "/intranet-helpdesk/new"
...@@ -180,7 +180,7 @@ if {0 != $escalate_from_ticket_id} { ...@@ -180,7 +180,7 @@ if {0 != $escalate_from_ticket_id} {
set page_title [lang::message::lookup "" intranet-helpdesk.New_Ticket "New Ticket"] set page_title [lang::message::lookup "" intranet-helpdesk.New_Ticket "New Ticket"]
if {[exists_and_not_null ticket_id]} { if {([info exists ticket_id] && $ticket_id ne "")} {
set page_title [db_string title "select project_name from im_projects where project_id = :ticket_id" -default ""] set page_title [db_string title "select project_name from im_projects where project_id = :ticket_id" -default ""]
} }
if {0 != $escalate_from_ticket_id} { if {0 != $escalate_from_ticket_id} {
...@@ -200,7 +200,7 @@ set context [list $page_title] ...@@ -200,7 +200,7 @@ set context [list $page_title]
# We need the ticket_type_id for page title, dynfields etc. # We need the ticket_type_id for page title, dynfields etc.
# Check if we can deduce the ticket_type_id from ticket_id # Check if we can deduce the ticket_type_id from ticket_id
if {0 == $ticket_type_id || "" == $ticket_type_id} { if {0 == $ticket_type_id || "" == $ticket_type_id} {
if {[exists_and_not_null ticket_id]} { if {([info exists ticket_id] && $ticket_id ne "")} {
set ticket_type_id [db_string ttype_id "select ticket_type_id from im_tickets where ticket_id = :ticket_id" -default 0] set ticket_type_id [db_string ttype_id "select ticket_type_id from im_tickets where ticket_id = :ticket_id" -default 0]
} }
} }
...@@ -234,7 +234,7 @@ if {"edit" == $form_mode && ![info exists ticket_id]} { ...@@ -234,7 +234,7 @@ if {"edit" == $form_mode && ![info exists ticket_id]} {
if {"edit" == $form_mode} { set show_components_p 0 } if {"edit" == $form_mode} { set show_components_p 0 }
set ticket_exists_p 0 set ticket_exists_p 0
if {[exists_and_not_null ticket_id]} { if {([info exists ticket_id] && $ticket_id ne "")} {
# Check if the ticket exists # Check if the ticket exists
set ticket_exists_p [db_string ticket_exists_p "select count(*) from im_tickets where ticket_id = :ticket_id"] set ticket_exists_p [db_string ticket_exists_p "select count(*) from im_tickets where ticket_id = :ticket_id"]
...@@ -349,7 +349,7 @@ $ticket_action_customize_html ...@@ -349,7 +349,7 @@ $ticket_action_customize_html
if {"edit" == $form_mode} { if {"edit" == $form_mode} {
set redirect_p 0 set redirect_p 0
# redirect if ticket_type_id is not defined # redirect if ticket_type_id is not defined
if {("" == $ticket_type_id || 0 == $ticket_type_id) && ![exists_and_not_null ticket_id]} { if {("" == $ticket_type_id || 0 == $ticket_type_id) && (![info exists ticket_id] || $ticket_id eq "")} {
set all_same_p [im_dynfield::subtype_have_same_attributes_p -object_type "im_ticket"] set all_same_p [im_dynfield::subtype_have_same_attributes_p -object_type "im_ticket"]
set all_same_p 0 set all_same_p 0
if {!$all_same_p} { if {!$all_same_p} {
...@@ -358,7 +358,7 @@ if {"edit" == $form_mode} { ...@@ -358,7 +358,7 @@ if {"edit" == $form_mode} {
} }
# Redirect if the SLA hasn't been defined yet # Redirect if the SLA hasn't been defined yet
if {("" == $ticket_sla_id || 0 == $ticket_sla_id) && ![exists_and_not_null ticket_id]} { if {("" == $ticket_sla_id || 0 == $ticket_sla_id) && (![info exists ticket_id] || $ticket_id eq "")} {
set redirect_p 1 set redirect_p 1
} }
...@@ -394,7 +394,7 @@ if {$ticket_exists_p} { ...@@ -394,7 +394,7 @@ if {$ticket_exists_p} {
# Check if we can get the ticket_customer_id. # Check if we can get the ticket_customer_id.
# We need this field in order to limit the customer contacts to show. # We need this field in order to limit the customer contacts to show.
if {![exists_and_not_null ticket_customer_id] && [exists_and_not_null ticket_sla_id] && "new" != $ticket_sla_id} { if {(![info exists ticket_customer_id] || $ticket_customer_id eq "") && ([info exists ticket_sla_id] && $ticket_sla_id ne "") && "new" != $ticket_sla_id} {
set ticket_customer_id [db_string cid "select company_id from im_projects where project_id = :ticket_sla_id" -default ""] set ticket_customer_id [db_string cid "select company_id from im_projects where project_id = :ticket_sla_id" -default ""]
} }
...@@ -496,7 +496,7 @@ if {"new" == $ticket_customer_contact_id && $user_can_create_new_customer_contac ...@@ -496,7 +496,7 @@ if {"new" == $ticket_customer_contact_id && $user_can_create_new_customer_contac
# Form options # Form options
# ------------------------------------------------------------------ # ------------------------------------------------------------------
if {[exists_and_not_null ticket_customer_id]} { if {([info exists ticket_customer_id] && $ticket_customer_id ne "")} {
set customer_sla_options [im_helpdesk_ticket_sla_options -customer_id $ticket_customer_id -include_create_sla_p $add_projects_p] set customer_sla_options [im_helpdesk_ticket_sla_options -customer_id $ticket_customer_id -include_create_sla_p $add_projects_p]
set customer_contact_options [db_list_of_lists customer_contact_options " set customer_contact_options [db_list_of_lists customer_contact_options "
select im_name_from_user_id(u.user_id) as name, select im_name_from_user_id(u.user_id) as name,
...@@ -691,7 +691,7 @@ ad_form -extend -name helpdesk_ticket -on_request { ...@@ -691,7 +691,7 @@ ad_form -extend -name helpdesk_ticket -on_request {
set message "" set message ""
if {[info exists ticket_note]} { append message $ticket_note } else { set ticket_note "" } if {[info exists ticket_note]} { append message $ticket_note } else { set ticket_note "" }
if {[info exists ticket_description]} { append message $ticket_description } else { set ticket_description "" } if {[info exists ticket_description]} { append message $ticket_description } else { set ticket_description "" }
if {![exists_and_not_null project_name]} { set project_name $ticket_name} if {(![info exists project_name] || $project_name eq "")} { set project_name $ticket_name}
set ticket_id [im_ticket::new \ set ticket_id [im_ticket::new \
-ticket_sla_id $ticket_sla_id \ -ticket_sla_id $ticket_sla_id \
...@@ -844,7 +844,7 @@ ad_form -extend -name helpdesk_ticket -on_request { ...@@ -844,7 +844,7 @@ ad_form -extend -name helpdesk_ticket -on_request {
set ticket_nr [string trim [string tolower $ticket_nr]] set ticket_nr [string trim [string tolower $ticket_nr]]
if {"" == $ticket_nr} { set ticket_nr [im_ticket::next_ticket_nr] } if {"" == $ticket_nr} { set ticket_nr [im_ticket::next_ticket_nr] }
if {![exists_and_not_null project_name]} { set project_name $ticket_name } if {(![info exists project_name] || $project_name eq "")} { set project_name $ticket_name }
set start_date_sql [template::util::date get_property sql_date $start_date] set start_date_sql [template::util::date get_property sql_date $start_date]
set end_date_sql [template::util::date get_property sql_timestamp $end_date] set end_date_sql [template::util::date get_property sql_timestamp $end_date]
...@@ -939,7 +939,7 @@ if {$show_components_p} { ...@@ -939,7 +939,7 @@ if {$show_components_p} {
-object_id $notification_object_id \ -object_id $notification_object_id \
-user_id $user_id] -user_id $user_id]
set notification_subscribed_p [expr ![empty_string_p $notification_request_id]] set notification_subscribed_p [expr {$notification_request_id ne ""}]
if { $notification_subscribed_p } { if { $notification_subscribed_p } {
set notification_url [notification::display::unsubscribe_url -request_id $notification_request_id -url $notification_current_url] set notification_url [notification::display::unsubscribe_url -request_id $notification_request_id -url $notification_current_url]
......
<master> <master>
<property name="title">@page_title@</property> <property name="doc(title)">@page_title;literal@</property>
<property name="context">#intranet-core.context#</property> <property name="context">#intranet-core.context#</property>
<property name="main_navbar_label">helpdesk</property> <property name="main_navbar_label">helpdesk</property>
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<td> <td>
<table> <table>
<tr class=rowtitle> <tr class=rowtitle>
<th align=center> <th align="center">
<input type="checkbox" name="_dummy" onclick="acs_ListCheckAll('alerts', this.checked)" title="<%= [lang::message::lookup "" intranet-helpdesk.Check_Uncheck_all_rows "Check/Uncheck all rows"] %>" checked> <input type="checkbox" name="_dummy" onclick="acs_ListCheckAll('alerts', this.checked)" title="<%= [lang::message::lookup "" intranet-helpdesk.Check_Uncheck_all_rows "Check/Uncheck all rows"] %>" checked>
</th> </th>
<th><%= [lang::message::lookup "" intranet-helpdesk.Name Name] %></th> <th><%= [lang::message::lookup "" intranet-helpdesk.Name Name] %></th>
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</else> </else>
<td class="list-narrow"> <td class="list-narrow">
<input type=checkbox name=user_id_from_search value="@stakeholders.user_id@" id="alerts,@user_id@" @stakeholders.checked@> <input type="checkbox" name="user_id_from_search" value="@stakeholders.user_id@" id="alerts,@user_id@" @stakeholders.checked@>
</td> </td>
<td class="list-narrow"> <td class="list-narrow">
<a href="@stakeholders.stakeholder_url@">@stakeholders.user_name@</a> <a href="@stakeholders.stakeholder_url@">@stakeholders.user_name@</a>
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<td> <td>
<%= [lang::message::lookup "" intranet-helpdesk.Subject Subject] %> <%= [lang::message::lookup "" intranet-helpdesk.Subject Subject] %>
<td> <td>
<input type=text size=70 name=subject value='@subject@'> <input type="text" size="70" name="subject" value='@subject@'>
</td> </td>
</tr> </tr>
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
<tr> <tr>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
<input type=submit name=submit value="@send_msg@"> <input type="submit" name="submit" value="@send_msg@">
</td> </td>
</tr> </tr>
</table> </table>
......
...@@ -24,16 +24,16 @@ ad_page_contract { ...@@ -24,16 +24,16 @@ ad_page_contract {
# Defaults & Permission # Defaults & Permission
# -------------------------------------------------------- # --------------------------------------------------------
set current_user_id [ad_maybe_redirect_for_registration] set current_user_id [auth::require_login]
set page_title [lang::message::lookup "" intranet-helpdesk.Notify_Stakeholders "Notify Stakeholders"] set page_title [lang::message::lookup "" intranet-helpdesk.Notify_Stakeholders "Notify Stakeholders"]
set context_bar [im_context_bar $page_title] set context_bar [im_context_bar $page_title]
# Get the SystemUrl without trailing "/" # Get the SystemUrl without trailing "/"
set system_url [im_parameter -package_id [ad_acs_kernel_id] SystemURL ""] set system_url [im_parameter -package_id [ad_acs_kernel_id] SystemURL ""]
set sysurl_len [string length $system_url] set sysurl_len [string length $system_url]
set last_char [string range $system_url [expr $sysurl_len-1] $sysurl_len] set last_char [string range $system_url $sysurl_len-1 $sysurl_len]
if {[string equal "/" $last_char]} { if {"/" eq $last_char} {
set system_url "[string range $system_url 0 [expr $sysurl_len-2]]" set system_url "[string range $system_url 0 $sysurl_len-2]"
} }
set action_name [im_category_from_id $action_id] set action_name [im_category_from_id $action_id]
......
<!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">projects</property> <property name="main_navbar_label">projects</property>
......
...@@ -17,7 +17,7 @@ ad_page_contract { ...@@ -17,7 +17,7 @@ ad_page_contract {
set page_title [_ intranet-core.Done] set page_title [_ intranet-core.Done]
set context_bar [im_context_bar [list /intranet/projects/ "[lang::message::lookup "" intranet-helpdesk.Helpdesk "Helpdesk"]"] $page_title] set context_bar [im_context_bar [list /intranet/projects/ "[lang::message::lookup "" intranet-helpdesk.Helpdesk "Helpdesk"]"] $page_title]
set current_user_id [ad_maybe_redirect_for_registration] set current_user_id [auth::require_login]
im_ticket_permissions $current_user_id $ticket_id view read write admin im_ticket_permissions $current_user_id $ticket_id view read write admin
if {!$admin} { if {!$admin} {
......
<!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">tickets</property> <property name="main_navbar_label">tickets</property>
...@@ -27,7 +27,7 @@ who've flooded a site with fake crud. ...@@ -27,7 +27,7 @@ who've flooded a site with fake crud.
<center> <center>
<form method=get action=nuke-2> <form method=get action=nuke-2>
<input type=hidden name=ticket_id value="@ticket_id@"> <input type="hidden" name="ticket_id" value="@ticket_id@">
<input type=submit value="Yes I am sure that I want to delete this @object_type@"> <input type="submit" value="Yes I am sure that I want to delete this @object_type@">
</form> </form>
</center> </center>
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
<master src="../../intranet-core/www/master"> <master src="../../intranet-core/www/master">
</if> </if>
<property name="title">@page_title@</property> <property name="doc(title)">@page_title;literal@</property>
<property name="context">@context;noquote@</property> <property name="context">@context;literal@</property>
<property name="main_navbar_label">helpdesk</property> <property name="main_navbar_label">helpdesk</property>
<property name="focus">@focus;noquote@</property> <property name="focus">@focus;literal@</property>
<property name="sub_navbar">@sub_navbar;noquote@</property> <property name="sub_navbar">@sub_navbar;literal@</property>
<if @message@ not nil> <if @message@ not nil>
<div class="general-message">@message@</div> <div class="general-message">@message@</div>
......
...@@ -71,7 +71,7 @@ if {![info exists task]} { ...@@ -71,7 +71,7 @@ if {![info exists task]} {
# Default & Security # Default & Security
# ------------------------------------------------------------------ # ------------------------------------------------------------------
set current_user_id [ad_maybe_redirect_for_registration] set current_user_id [auth::require_login]
set current_url [im_url_with_query] set current_url [im_url_with_query]
set action_url "/intranet-helpdesk/new" set action_url "/intranet-helpdesk/new"
set focus "ticket.var_name" set focus "ticket.var_name"
......
...@@ -28,7 +28,7 @@ ad_page_contract { ...@@ -28,7 +28,7 @@ ad_page_contract {
# ------------------------------------------------------------ # ------------------------------------------------------------
set menu_label "reporting_helpdesk_ticket_by_customer_dept" set menu_label "reporting_helpdesk_ticket_by_customer_dept"
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
...@@ -36,7 +36,7 @@ set read_p [db_string report_perms " ...@@ -36,7 +36,7 @@ set read_p [db_string report_perms "
" -default 'f'] " -default 'f']
set read_p "t" set read_p "t"
if {![string equal "t" $read_p]} { if {"t" ne $read_p } {
ad_return_complaint 1 "<li> ad_return_complaint 1 "<li>
[lang::message::lookup "" intranet-reporting.You_dont_have_permissions "You don't have the necessary permissions to view this page"]" [lang::message::lookup "" intranet-reporting.You_dont_have_permissions "You don't have the necessary permissions to view this page"]"
return return
...@@ -121,7 +121,7 @@ if {"" != $report_assignee_dept_id} { ...@@ -121,7 +121,7 @@ if {"" != $report_assignee_dept_id} {
)" } )" }
set where_clause [join $criteria " and\n "] set where_clause [join $criteria " and\n "]
if { ![empty_string_p $where_clause] } { if { $where_clause ne "" } {
set where_clause " and $where_clause" set where_clause " and $where_clause"
} }
......
<master> <master>
<property name="title">@page_title@</property> <property name="doc(title)">@page_title;literal@</property>
<property name="context">#intranet-core.context#</property> <property name="context">#intranet-core.context#</property>
<property name="main_navbar_label">helpdesk</property> <property name="main_navbar_label">helpdesk</property>
<property name="sub_navbar">@ticket_navbar_html;noquote@</property> <property name="sub_navbar">@ticket_navbar_html;literal@</property>
<h1>@page_title@</h1> <h1>@page_title@</h1>
......
...@@ -20,7 +20,7 @@ ad_page_contract { ...@@ -20,7 +20,7 @@ ad_page_contract {
# Defaults & Security # 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-helpdesk.Successfully_Requested_SLA "Successfully Requested a new SLA"] set page_title [lang::message::lookup "" intranet-helpdesk.Successfully_Requested_SLA "Successfully Requested a new SLA"]
set context_bar [im_context_bar $page_title] set context_bar [im_context_bar $page_title]
set page_focus "im_header_form.keywords" set page_focus "im_header_form.keywords"
......
<master> <master>
<property name="title">@page_title@</property> <property name="doc(title)">@page_title;literal@</property>
<property name="context">#intranet-core.context#</property> <property name="context">#intranet-core.context#</property>
<property name="main_navbar_label">helpdesk</property> <property name="main_navbar_label">helpdesk</property>
<property name="sub_navbar">@ticket_navbar_html;noquote@</property> <property name="sub_navbar">@ticket_navbar_html;literal@</property>
<h1>@page_title@</h1> <h1>@page_title@</h1>
...@@ -22,14 +22,14 @@ ...@@ -22,14 +22,14 @@
<tr> <tr>
<td class="form-label"><%= [lang::message::lookup "" intranet-helpdesk.Your_Company "Your Company"] %></td> <td class="form-label"><%= [lang::message::lookup "" intranet-helpdesk.Your_Company "Your Company"] %></td>
<td class="form-widget"> <td class="form-widget">
<input type=text size=40 name=company_name> <input type="text" size="40" name="company_name">
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="form-label"><%= [lang::message::lookup "" intranet-helpdesk.Contact_Email_Tel "Contact (Email or Tel)"] %></td> <td class="form-label"><%= [lang::message::lookup "" intranet-helpdesk.Contact_Email_Tel "Contact (Email or Tel)"] %></td>
<td class="form-widget"> <td class="form-widget">
<input type=text size=40 name=contact> <input type="text" size="40" name="contact">
</td> </td>
</tr> </tr>
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<tr> <tr>
<td class="form-label"> </td> <td class="form-label"> </td>
<td class="form-widget"> <td class="form-widget">
<input type=submit value='<%= [lang::message::lookup "" intranet-helpdesk.Submit "Submit"] %>'> <input type="submit" value='<%= [lang::message::lookup "" intranet-helpdesk.Submit "Submit"] %>'>
</td> </td>
</tr> </tr>
......
...@@ -17,7 +17,7 @@ ad_page_contract { ...@@ -17,7 +17,7 @@ ad_page_contract {
# Defaults & Security # 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-helpdesk.Request_SLA "Request a Service Contract"] set page_title [lang::message::lookup "" intranet-helpdesk.Request_SLA "Request a Service Contract"]
set context_bar [im_context_bar $page_title] set context_bar [im_context_bar $page_title]
set page_focus "im_header_form.keywords" set page_focus "im_header_form.keywords"
......
<master> <master>
<property name="title">@page_title@</property> <property name="doc(title)">@page_title;literal@</property>
<property name="context">#intranet-core.context#</property> <property name="context">#intranet-core.context#</property>
<property name="main_navbar_label">helpdesk</property> <property name="main_navbar_label">helpdesk</property>
<property name="sub_navbar">@ticket_navbar_html;noquote@</property> <property name="sub_navbar">@ticket_navbar_html;literal@</property>
<property name="left_navbar">@left_navbar_html;noquote@</property> <property name="left_navbar">@left_navbar_html;literal@</property>
<SCRIPT Language=JavaScript src=/resources/diagram/diagram/diagram.js></SCRIPT> <SCRIPT Language=JavaScript src=/resources/diagram/diagram/diagram.js></SCRIPT>
<table cellspacing=0 cellpadding=0 border=0 width="100%"> <table cellspacing="0" cellpadding="0" border="0" width="100%">
<form action="@return_url;noquote@" method=GET> <form action="@return_url;noquote@" method=GET>
<%= [export_vars -form {action_id return_url}] %> <%= [export_vars -form {action_id return_url}] %>
<tr valign=top> <tr valign="top">
<td> <td>
<%= [im_box_header $page_title] %> <%= [im_box_header $page_title] %>
<table class=\"list\"> <table class=\"list\">
......
...@@ -33,7 +33,7 @@ ad_page_contract { ...@@ -33,7 +33,7 @@ ad_page_contract {
# Defaults & Security # 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-helpdesk.Select_a_base_for_the_Duplicated_Ticket "Please Select a Base for the Duplicated Ticket"] set page_title [lang::message::lookup "" intranet-helpdesk.Select_a_base_for_the_Duplicated_Ticket "Please Select a Base for the Duplicated Ticket"]
set context_bar [im_context_bar $page_title] set context_bar [im_context_bar $page_title]
set page_focus "im_header_form.keywords" set page_focus "im_header_form.keywords"
...@@ -52,10 +52,10 @@ if {"all" == $mine_p && !$view_tickets_all_p} { ...@@ -52,10 +52,10 @@ if {"all" == $mine_p && !$view_tickets_all_p} {
set mine_p "queue" set mine_p "queue"
} }
if { [empty_string_p $how_many] || $how_many < 1 } { if { $how_many eq "" || $how_many < 1 } {
set how_many [im_parameter -package_id [im_package_core_id] NumberResultsPerPage "" 50] set how_many [im_parameter -package_id [im_package_core_id] NumberResultsPerPage "" 50]
} }
set end_idx [expr $start_idx + $how_many] set end_idx [expr {$start_idx + $how_many}]
# --------------------------------------------------------------- # ---------------------------------------------------------------
# Defined Table Fields # Defined Table Fields
...@@ -112,7 +112,7 @@ db_foreach column_list_sql $column_sql { ...@@ -112,7 +112,7 @@ db_foreach column_list_sql $column_sql {
if {!$user_is_admin_p} { set admin_link "" } if {!$user_is_admin_p} { set admin_link "" }
if { [string compare $order_by $column_name] == 0} { if { $order_by eq $column_name } {
append table_header_html "<td class=rowtitle>$col_txt$admin_link</td>\n" append table_header_html "<td class=rowtitle>$col_txt$admin_link</td>\n"
} else { } else {
append table_header_html "<td class=rowtitle><a href=\"$col_url\">$col_txt</a>$admin_link</td>\n" append table_header_html "<td class=rowtitle><a href=\"$col_url\">$col_txt</a>$admin_link</td>\n"
...@@ -123,7 +123,7 @@ append table_header_html "</tr>\n" ...@@ -123,7 +123,7 @@ append table_header_html "</tr>\n"
# Set up colspan to be the number of headers + 1 for the # column # 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}]
# --------------------------------------------------------------- # ---------------------------------------------------------------
# Filter with Dynamic Fields # Filter with Dynamic Fields
...@@ -202,25 +202,25 @@ array set extra_sql_array [im_dynfield::search_sql_criteria_from_form \ ...@@ -202,25 +202,25 @@ array set extra_sql_array [im_dynfield::search_sql_criteria_from_form \
# --------------------------------------------------------------- # ---------------------------------------------------------------
set criteria [list] set criteria [list]
if { ![empty_string_p $ticket_status_id] && $ticket_status_id > 0 } { if { $ticket_status_id ne "" && $ticket_status_id > 0 } {
lappend criteria "t.ticket_status_id in ([join [im_sub_categories $ticket_status_id] ","])" lappend criteria "t.ticket_status_id in ([join [im_sub_categories $ticket_status_id] ","])"
} }
if { ![empty_string_p $ticket_type_id] && $ticket_type_id != 0 } { if { $ticket_type_id ne "" && $ticket_type_id != 0 } {
lappend criteria "t.ticket_type_id in ([join [im_sub_categories $ticket_type_id] ","])" lappend criteria "t.ticket_type_id in ([join [im_sub_categories $ticket_type_id] ","])"
} }
if { ![empty_string_p $ticket_queue_id] && $ticket_queue_id != 0 } { if { $ticket_queue_id ne "" && $ticket_queue_id != 0 } {
lappend criteria "t.ticket_queue_id = :ticket_queue_id" lappend criteria "t.ticket_queue_id = :ticket_queue_id"
} }
if {0 != $assignee_id && "" != $assignee_id} { if {0 != $assignee_id && "" != $assignee_id} {
lappend criteria "t.ticket_assignee_id = :assignee_id" lappend criteria "t.ticket_assignee_id = :assignee_id"
} }
if { ![empty_string_p $customer_id] && $customer_id != 0 } { if { $customer_id ne "" && $customer_id != 0 } {
lappend criteria "p.company_id = :customer_id" lappend criteria "p.company_id = :customer_id"
} }
if { ![empty_string_p $customer_contact_id] && $customer_contact_id != 0 } { if { $customer_contact_id ne "" && $customer_contact_id != 0 } {
lappend criteria "t.ticket_customer_contact_id = :customer_contact_id" lappend criteria "t.ticket_customer_contact_id = :customer_contact_id"
} }
if { ![empty_string_p $letter] && [string compare $letter "ALL"] != 0 && [string compare $letter "SCROLL"] != 0 } { if { $letter ne "" && $letter ne "ALL" && $letter ne "SCROLL" } {
lappend criteria "im_first_letter_default_to_a(t.ticket_name)=:letter" lappend criteria "im_first_letter_default_to_a(t.ticket_name)=:letter"
} }
...@@ -298,10 +298,10 @@ set extra_select [join $extra_selects ",\n\t"] ...@@ -298,10 +298,10 @@ set extra_select [join $extra_selects ",\n\t"]
set extra_from [join $extra_froms ",\n\t"] set extra_from [join $extra_froms ",\n\t"]
set extra_where [join $extra_wheres "and\n\t"] set extra_where [join $extra_wheres "and\n\t"]
if { ![empty_string_p $where_clause] } { set where_clause " and $where_clause" } if { $where_clause ne "" } { set where_clause " and $where_clause" }
if { ![empty_string_p $extra_select] } { set extra_select ",\n\t$extra_select" } if { $extra_select ne "" } { set extra_select ",\n\t$extra_select" }
if { ![empty_string_p $extra_from] } { set extra_from ",\n\t$extra_from" } if { $extra_from ne "" } { set extra_from ",\n\t$extra_from" }
if { ![empty_string_p $extra_where] } { set extra_where ",\n\t$extra_where" } if { $extra_where ne "" } { set extra_where ",\n\t$extra_where" }
# --------------------------------------------------------------- # ---------------------------------------------------------------
...@@ -386,7 +386,7 @@ set sql " ...@@ -386,7 +386,7 @@ set sql "
# 5a. Limit the SQL query to MAX rows and provide << and >> # 5a. Limit the SQL query to MAX rows and provide << and >>
# --------------------------------------------------------------- # ---------------------------------------------------------------
if {[string equal $letter "ALL"]} { if {$letter eq "ALL"} {
# Set these limits to negative values to deactivate them # Set these limits to negative values to deactivate them
set total_in_limited -1 set total_in_limited -1
set how_many -1 set how_many -1
...@@ -414,7 +414,7 @@ set idx $start_idx ...@@ -414,7 +414,7 @@ set idx $start_idx
db_foreach tickets_info_query $selection -bind $form_vars { db_foreach tickets_info_query $selection -bind $form_vars {
# Append together a line of data based on the "column_vars" parameter list # Append together a line of data based on the "column_vars" parameter list
set row_html "<tr$bgcolor([expr $ctr % 2])>\n" set row_html "<tr$bgcolor([expr {$ctr % 2}])>\n"
foreach column_var $column_vars { foreach column_var $column_vars {
append row_html "\t<td valign=top>" append row_html "\t<td valign=top>"
set cmd "append row_html $column_var" set cmd "append row_html $column_var"
...@@ -430,7 +430,7 @@ db_foreach tickets_info_query $selection -bind $form_vars { ...@@ -430,7 +430,7 @@ db_foreach tickets_info_query $selection -bind $form_vars {
} }
# Show a reasonable message when there are no result rows: # 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 " set table_body_html "
<tr><td colspan=$colspan><ul><li><b> <tr><td colspan=$colspan><ul><li><b>
[lang::message::lookup "" intranet-core.lt_There_are_currently_n "There are currently no entries matching the selected criteria"] [lang::message::lookup "" intranet-core.lt_There_are_currently_n "There are currently no entries matching the selected criteria"]
...@@ -441,7 +441,7 @@ if { [empty_string_p $table_body_html] } { ...@@ -441,7 +441,7 @@ if { [empty_string_p $table_body_html] } {
if { $end_idx < $total_in_limited } { if { $end_idx < $total_in_limited } {
# This means that there are rows that we decided not to return # This means that there are rows that we decided not to return
# Include a link to go to the next page # Include a link to go to the next page
set next_start_idx [expr $end_idx + 0] set next_start_idx [expr {$end_idx + 0}]
set next_page_url "index?start_idx=$next_start_idx&amp;[export_ns_set_vars url [list start_idx]]" set next_page_url "index?start_idx=$next_start_idx&amp;[export_ns_set_vars url [list start_idx]]"
} else { } else {
set next_page_url "" set next_page_url ""
...@@ -450,7 +450,7 @@ if { $end_idx < $total_in_limited } { ...@@ -450,7 +450,7 @@ if { $end_idx < $total_in_limited } {
if { $start_idx > 0 } { if { $start_idx > 0 } {
# This means we didn't start with the first row - there is # This means we didn't start with the first row - there is
# at least 1 previous row. add a previous page link # at least 1 previous row. add a previous page link
set previous_start_idx [expr $start_idx - $how_many] set previous_start_idx [expr {$start_idx - $how_many}]
if { $previous_start_idx < 0 } { set previous_start_idx 0 } if { $previous_start_idx < 0 } { set previous_start_idx 0 }
set previous_page_url "index?start_idx=$previous_start_idx&amp;[export_ns_set_vars url [list start_idx]]" set previous_page_url "index?start_idx=$previous_start_idx&amp;[export_ns_set_vars url [list start_idx]]"
} else { } else {
...@@ -466,7 +466,7 @@ if { $start_idx > 0 } { ...@@ -466,7 +466,7 @@ if { $start_idx > 0 } {
# => include a link to go to the next page # => include a link to go to the next page
# #
if {$total_in_limited > 0 && $end_idx < $total_in_limited} { if {$total_in_limited > 0 && $end_idx < $total_in_limited} {
set next_start_idx [expr $end_idx + 0] set next_start_idx [expr {$end_idx + 0}]
set next_page "<a href=index?start_idx=$next_start_idx&amp;[export_ns_set_vars url [list start_idx]]>Next Page</a>" set next_page "<a href=index?start_idx=$next_start_idx&amp;[export_ns_set_vars url [list start_idx]]>Next Page</a>"
} else { } else {
set next_page "" set next_page ""
...@@ -477,7 +477,7 @@ if {$total_in_limited > 0 && $end_idx < $total_in_limited} { ...@@ -477,7 +477,7 @@ if {$total_in_limited > 0 && $end_idx < $total_in_limited} {
# => add a previous page link # => add a previous page link
# #
if { $start_idx > 0 } { if { $start_idx > 0 } {
set previous_start_idx [expr $start_idx - $how_many] set previous_start_idx [expr {$start_idx - $how_many}]
if { $previous_start_idx < 0 } { set previous_start_idx 0 } if { $previous_start_idx < 0 } { set previous_start_idx 0 }
set previous_page "<a href=index?start_idx=$previous_start_idx&amp;[export_ns_set_vars url [list start_idx]]>Previous Page</a>" set previous_page "<a href=index?start_idx=$previous_start_idx&amp;[export_ns_set_vars url [list start_idx]]>Previous Page</a>"
} else { } else {
...@@ -590,4 +590,4 @@ set left_navbar_html " ...@@ -590,4 +590,4 @@ set left_navbar_html "
</div> </div>
<hr/> <hr/>
" "
\ No newline at end of file
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