Commit a9abf440 authored by Frank Bergmann's avatar Frank Bergmann

- added "associate" action scripts

parent 36185205
<master>
<property name="title">@page_title@</property>
<property name="context">#intranet-core.context#</property>
<property name="main_navbar_label">helpdesk</property>
<h1>@page_title@</h1>
<if "user" eq @target_object_type@>
<form action=associated-3 method=GET>
<%= [export_form_vars tid return_url] %>
<p>Please select a user to add to the selected tickets.
</p>
<table>
<tr>
<th>Field</th>
<th>Value</th>
<th>Comment</th>
</tr>
<tr>
<td>Target Object</td>
<td><%= [im_user_select user_id ""] %></td>
<td>Please choose a user to associated with the tickets.</td>
</tr>
<tr>
<td>Role</td>
<td><%= [im_biz_object_roles_select role_id $first_ticket_id [im_biz_object_role_full_member]] %></td>
<td>Please choose a user to associated with the tickets.</td>
</tr>
<tr>
<td></td>
<td><input type=submit name=submit value="Add User to Tickets"></td>
<td></td>
</tr>
</table>
</form>
</if>
<if "release_project" eq @target_object_type@>
<form action=associated-3 method=GET>
<%= [export_form_vars tid return_url] %>
<p>Please select a user to add to the selected tickets.
</p>
<table>
<tr>
<th>Field</th>
<th>Value</th>
<th>Comment</th>
</tr>
<tr>
<td>Target Object</td>
<td><%= [im_project_select -project_type_id [im_project_type_software_release] release_project_id] %></td>
<td>Please choose a user to associated with the tickets.</td>
</tr>
<tr>
<td></td>
<td><input type=submit name=submit value="Add User to Tickets"></td>
<td></td>
</tr>
</table>
</form>
</if>
# /packages/intranet-helpdesk/www/associate-2.tcl
#
# Copyright (C) 2010 ]project-open[
#
# All rights reserved. Please check
# http://www.project-open.com/license/ for details.
ad_page_contract {
Allow the user to associate the current ticket with a new object
using an OpenACS relationship.
@author frank.bergmann@project-open.com
} {
{ tid ""}
{ target_object_type "" }
{ return_url "/intranet-helpdesk/index" }
}
# ---------------------------------------------------------------
# Defaults & Security
# ---------------------------------------------------------------
set current_user_id [ad_maybe_redirect_for_registration]
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 page_focus "im_header_form.keywords"
set action_forbidden_msg [lang::message::lookup "" intranet-helpdesk.Action_Forbidden "<b>Unable to execute action</b>:<br>You don't have the permissions to execute the action '%action_name%' on this ticket."]
# Check that the user has write permissions on all select tickets
foreach ticket_id $tid {
# Check that ticket_id is an integer
im_security_alert_check_integer -location "Helpdesk: Associate" -value $ticket_id
im_ticket_permissions $current_user_id $ticket_id view read write admin
if {!$write} { ad_return_complaint 1 $action_forbidden_msg }
}
set first_ticket_id [lindex $tid 0]
<master>
<property name="title">@page_title@</property>
<property name="context">#intranet-core.context#</property>
<property name="main_navbar_label">helpdesk</property>
<h1>@page_title@</h1>
<p>
This page allows you to associated your tickets with other objects:
</p>
<form action=associate-2 method=GET>
<%= [export_form_vars tid return_url] %>
<table>
<tr>
<th>&nbsp;</th>
<th>Associate with</th>
<th>Comment</th>
</tr>
<tr>
<td><input type=radio name=target_object_type value=user></td>
<td>User</td>
<td>
Add a new user to the tickets.<br>
Users can be added either as "members" or "administrators".
</td>
</tr>
<tr>
<td><input type=radio name=target_object_type value=release_project></td>
<td>Release Project</td>
<td>Make your tickets "release items" of a software Release Project. <br>
Release items are those changes to software that are included in a specific release.
</td>
</tr>
<tr>
<td><input type=radio name=target_object_type value=conf_item></td>
<td>Configuration Item</td>
<td>Associate your tickets with a configuration item.<br>
A configuration item is a hardware or software item that is affected by your tickets.
</td>
</tr>
<tr>
<td><input type=radio name=target_object_type value=ticket></td>
<td>Ticket</td>
<td>Associate your tickets with another ticket.<br>
This is used for escalating and for referencing another ticket.
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type=submit name=submit value="Associate"></td>
<td>&nbsp;</td>
</tr>
</table>
</form>
\ No newline at end of file
# /packages/intranet-helpdesk/www/relationship-new.tcl
#
# Copyright (C) 2010 ]project-open[
#
# All rights reserved. Please check
# http://www.project-open.com/license/ for details.
ad_page_contract {
Allow the user to associate the current ticket with a new object
using an OpenACS relationship.
@author frank.bergmann@project-open.com
} {
{ tid ""}
{ action_name "associate" }
{ return_url "/intranet-helpdesk/index" }
}
# ---------------------------------------------------------------
# Defaults & Security
# ---------------------------------------------------------------
set current_user_id [ad_maybe_redirect_for_registration]
set page_title [lang::message::lookup "" intranet-helpdesk.Associate_Ticket_With_Other_Object "Associate Ticket With Other Object"]
set context_bar [im_context_bar $page_title]
set page_focus "im_header_form.keywords"
set action_forbidden_msg [lang::message::lookup "" intranet-helpdesk.Action_Forbidden "<b>Unable to execute action</b>:<br>You don't have the permissions to execute the action '%action_name%' on this ticket."]
# Check that the user has write permissions on all select tickets
foreach ticket_id $tid {
# Check that ticket_id is an integer
im_security_alert_check_integer -location "Helpdesk: Associate" -value $ticket_id
im_ticket_permissions $current_user_id $ticket_id view read write admin
if {!$write} { ad_return_complaint 1 $action_forbidden_msg }
}
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