Commit 0c970c46 authored by Frank Bergmann's avatar Frank Bergmann

- Improving Tickets for ]po[ internal use

parent 67c09fd8
This diff is collapsed.
...@@ -400,15 +400,12 @@ ad_form \ ...@@ -400,15 +400,12 @@ ad_form \
-action $action_url \ -action $action_url \
-mode $form_mode \ -mode $form_mode \
-method GET \ -method GET \
-export {start_idx order_by how_many view_name letter } \ -export { } \
-form $ticket_elements -form $ticket_elements
template::element::set_value $form_id ticket_nr [im_ticket::next_ticket_nr] template::element::set_value $form_id ticket_nr [im_ticket::next_ticket_nr]
template::element::set_value $form_id ticket_status_id [im_ticket_status_open]
# --------------------------------------------------------------- # ---------------------------------------------------------------
......
...@@ -14,39 +14,47 @@ ...@@ -14,39 +14,47 @@
<if @view_name@ eq "component">
<%= [im_component_page -plugin_id $plugin_id -return_url "/intranet-helpdesk/new?ticket_id=$ticket_id"] %>
<if @show_components_p@>
<%= [im_component_bay top] %>
<table width="100%">
<tr valign="top">
<td width="50%">
<%= [im_box_header $page_title] %>
<formtemplate id="ticket"></formtemplate>
<%= [im_box_footer] %>
<%= [im_component_bay left] %>
</td>
<td width="50%">
<%= [im_component_bay right] %>
<if @show_user_info_p@>
<%= [im_box_header "Basic Information About You"] %>
<formtemplate id="userinfo"></formtemplate>
<%= [im_box_footer] %>
<%= [im_box_header "Your Complete Contact Information"] %>
<%= $contact_html %>
<%= [im_box_footer] %>
</if>
</td>
</tr>
</table>
<%= [im_component_bay bottom] %>
</if> </if>
<else> <else>
<%= [im_box_header $page_title] %>
<formtemplate id="ticket"></formtemplate> <if @show_components_p@>
<%= [im_box_footer] %>
<%= [im_component_bay top] %>
<table width="100%">
<tr valign="top">
<td width="50%">
<%= [im_box_header $page_title] %>
<formtemplate id="ticket"></formtemplate>
<%= [im_box_footer] %>
<%= [im_component_bay left] %>
</td>
<td width="50%">
<%= [im_component_bay right] %>
<if @show_user_info_p@>
<%= [im_box_header "Basic Information About You"] %>
<formtemplate id="userinfo"></formtemplate>
<%= [im_box_footer] %>
<%= [im_box_header "Your Complete Contact Information"] %>
<%= $contact_html %>
<%= [im_box_footer] %>
</if>
</td>
</tr>
</table>
<%= [im_component_bay bottom] %>
</if>
<else>
<%= [im_box_header $page_title] %>
<formtemplate id="ticket"></formtemplate>
<%= [im_box_footer] %>
</else>
</else> </else>
...@@ -21,6 +21,8 @@ if {![info exists task]} { ...@@ -21,6 +21,8 @@ if {![info exists task]} {
@author frank.bergmann@project-open.com @author frank.bergmann@project-open.com
} { } {
ticket_id:integer,optional ticket_id:integer,optional
{ ticket_name "" }
{ ticket_nr "" }
{ task_id "" } { task_id "" }
{ return_url "" } { return_url "" }
edit_p:optional edit_p:optional
...@@ -29,6 +31,8 @@ if {![info exists task]} { ...@@ -29,6 +31,8 @@ if {![info exists task]} {
{ ticket_type_id 0 } { ticket_type_id 0 }
{ return_url "/intranet-helpdesk/" } { return_url "/intranet-helpdesk/" }
{ vars_from_url ""} { vars_from_url ""}
{ plugin_id:integer 0 }
{ view_name "standard"}
form_mode:optional form_mode:optional
} }
...@@ -51,6 +55,10 @@ if {![info exists task]} { ...@@ -51,6 +55,10 @@ if {![info exists task]} {
set show_components_p 0 set show_components_p 0
set enable_master_p 0 set enable_master_p 0
set show_user_info_p 0 set show_user_info_p 0
set plugin_id 0
set view_name "standard"
} }
# ------------------------------------------------------------------ # ------------------------------------------------------------------
...@@ -64,8 +72,12 @@ set focus "ticket.var_name" ...@@ -64,8 +72,12 @@ set focus "ticket.var_name"
set td_class(0) "class=roweven" set td_class(0) "class=roweven"
set td_class(1) "class=rowodd" set td_class(1) "class=rowodd"
if {[info exists ticket_id]} { if {[info exists ticket_id] && "" == $ticket_id} { unset ticket_id }
set ticket_type_id [db_string ttype_id "select ticket_type_id from im_tickets where ticket_id = :ticket_id" -default 0]
if {0 == $ticket_type_id || "" == $ticket_type_id} {
if {[exists_and_not_null ticket_id]} {
set ticket_type_id [db_string ttype_id "select ticket_type_id from im_tickets where ticket_id = :ticket_id" -default 0]
}
} }
if {0 != $ticket_type_id} { if {0 != $ticket_type_id} {
set ticket_type [im_category_from_id $ticket_type_id] set ticket_type [im_category_from_id $ticket_type_id]
...@@ -75,7 +87,6 @@ if {0 != $ticket_type_id} { ...@@ -75,7 +87,6 @@ if {0 != $ticket_type_id} {
} }
set context [list $page_title] set context [list $page_title]
# ------------------------------------------------------------------ # ------------------------------------------------------------------
# #
# ------------------------------------------------------------------ # ------------------------------------------------------------------
...@@ -100,11 +111,11 @@ set user_can_create_new_customer_contact_p 1 ...@@ -100,11 +111,11 @@ set user_can_create_new_customer_contact_p 1
# Redirect if the type of the object hasn't been defined and # Redirect if the type of the object hasn't been defined and
# if there are DynFields specific for subtypes. # if there are DynFields specific for subtypes.
if {0 == $ticket_type_id && ![info exists ticket_id]} { if {("" == $ticket_type_id || 0 == $ticket_type_id) && ![exists_and_not_null ticket_id]} {
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} {
ad_returnredirect [export_vars -base "/intranet/biz-object-type-select" {{object_type "im_ticket"} {return_url $current_url} {type_id_var ticket_type_id}}] ad_returnredirect [export_vars -base "/intranet/biz-object-type-select" {{object_type "im_ticket"} {return_url $current_url} {type_id_var ticket_type_id} ticket_name ticket_nr {pass_through_variables {ticket_nr ticket_name}}}]
} }
} }
...@@ -329,7 +340,6 @@ if {"new" == $ticket_customer_contact_id_value && $user_can_create_new_customer_ ...@@ -329,7 +340,6 @@ if {"new" == $ticket_customer_contact_id_value && $user_can_create_new_customer_
# #
# ------------------------------------------------------------------ # ------------------------------------------------------------------
# Fix for problem changing to "edit" form_mode # Fix for problem changing to "edit" form_mode
set form_action [template::form::get_action "ticket"] set form_action [template::form::get_action "ticket"]
if {"" != $form_action} { set form_mode "edit" } if {"" != $form_action} { set form_mode "edit" }
...@@ -383,6 +393,7 @@ ad_form -extend -name ticket -on_request { ...@@ -383,6 +393,7 @@ ad_form -extend -name ticket -on_request {
if {[info exists ticket_note]} { append message $ticket_note } if {[info exists ticket_note]} { append message $ticket_note }
if {[info exists ticket_description]} { append message $ticket_description } if {[info exists ticket_description]} { append message $ticket_description }
if {"" == $message} { set message [lang::message::lookup "" intranet-helpdesk.Empty_Forum_Message "No message specified"]}
db_dml topic_insert { db_dml topic_insert {
insert into im_forum_topics ( insert into im_forum_topics (
...@@ -524,15 +535,15 @@ append contact_html "</table>\n</form>\n" ...@@ -524,15 +535,15 @@ append contact_html "</table>\n</form>\n"
# Setup the subnavbar # Setup the subnavbar
set bind_vars [ns_set create] set bind_vars [ns_set create]
if {[info exists ticket_id]} { ns_set put $bind_vars ticket_id $ticket_id }
if {[info exists ticket_id]} {
ns_set put $bind_vars ticket_id $ticket_id
}
set ticket_menu_id [db_string parent_menu "select menu_id from im_menus where label='ticket'" -default 0] set ticket_menu_id [db_string parent_menu "select menu_id from im_menus where label='helpdesk'" -default 0]
set sub_navbar [im_sub_navbar \ set sub_navbar [im_sub_navbar \
-components \ -components \
-base_url "/intranet-helpdesk/" \ -current_plugin_id $plugin_id \
-base_url "/intranet-helpdesk/new?ticket_id=$ticket_id" \
-plugin_url "/intranet-helpdesk/new" \
$ticket_menu_id \ $ticket_menu_id \
$bind_vars "" "pagedesriptionbar" "ticket_timesheet_ticket"] $bind_vars "" "pagedesriptionbar" "helpdesk_summary"]
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