3 %# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
5 %# (Except where explictly superceded by other copyright notices)
7 %# This work is made available to you under the terms of Version 2 of
8 %# the GNU General Public License. A copy of that license should have
9 %# been provided with this software, but in any event can be snarfed
12 %# This work is distributed in the hope that it will be useful, but
13 %# WITHOUT ANY WARRANTY; without even the implied warranty of
14 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 %# General Public License for more details.
17 %# Unless otherwise specified, all modifications, corrections or
18 %# extensions to this work which alter its source code become the
19 %# property of Best Practical Solutions, LLC when submitted for
20 %# inclusion in the work.
24 <& /Admin/Elements/Header, Title => loc('Admin/Queue/Basics') &>
25 <& /Admin/Elements/QueueTabs, id => $QueueObj->id,
26 QueueObj => $QueueObj,
27 current_tab => $current_tab,
28 Title => loc('Admin/Queue/Basics') &>
29 <& /Elements/ListActions, actions => \@results &>
33 <FORM ACTION="<%$RT::WebPath%>/Admin/Queues/Modify.html" METHOD=POST>
35 <INPUT TYPE=HIDDEN NAME=id VALUE="new">
37 <INPUT TYPE=HIDDEN NAME=id VALUE="<%$QueueObj->Id%>">
42 <&|/l&>Queue Name</&>:
44 <TD><INPUT name="Name" value="<% ($Create) ? "" : $QueueObj->Name %>"></TD>
47 <&|/l&>Description</&>:</TD><TD COLSPAN=3><INPUT name="Description" value="<% ($Create) ? "" : $QueueObj->Description %>" size=60></TD></TR>
50 <&|/l&>Correspondence Address</&>:
52 <INPUT name="CorrespondAddress" value="<% ($Create) ? "" : $QueueObj->CorrespondAddress %>">
53 <BR><font size="-1"><i><&|/l , $RT::CorrespondAddress&>(If left blank, will default to [_1]</&></i></font>
57 <&|/l&>Comment Address</&>: </TD><TD>
58 <INPUT NAME="CommentAddress" value="<% ($Create) ? "" : $QueueObj->CommentAddress %>">
59 <BR><font size="-1"><i><&|/l , $RT::CommentAddress&>(If left blank, will default to [_1]</&></i></font>
64 <&|/l&>Priority starts at</&>:
65 </TD><TD><INPUT NAME="InitialPriority" value="<% ($Create) ? "" : $QueueObj->InitialPriority %>">
68 <&|/l&>Over time, priority moves toward</&>:
69 </TD><TD><INPUT NAME="FinalPriority" value="<% ($Create) ? "" : $QueueObj->FinalPriority %>">
74 <&|/l&>Requests should be due in</&>:
76 <INPUT NAME="DefaultDueIn" VALUE="<% ($Create) ? "" : $QueueObj->DefaultDueIn%>"> <&|/l&>days</&>.
82 <TD COLSPAN=4><INPUT TYPE=HIDDEN NAME="SetEnabled" VALUE="1">
83 <INPUT TYPE=CHECKBOX NAME="Enabled" VALUE="1" <%$EnabledChecked%>> <&|/l&>Enabled (Unchecking this box disables this queue)</&><BR>
84 <& /Elements/Callback, QueueObj => $QueueObj, results => \@results, %ARGS &>
89 <& /Elements/Submit &>
96 my $QueueObj = new RT::Queue($session{'CurrentUser'});
98 my ($title, @results, $Disabled, $EnabledChecked);
99 $EnabledChecked = "CHECKED";
102 $current_tab = 'Admin/Queues/Modify.html?Create=1';
103 $title = loc("Create a queue");
106 my ($val, $msg) = $QueueObj->Create(Name => $Name);
107 delete $session{'create_in_queues'};
116 $QueueObj->Load($id) || $QueueObj->Load($Name) || Abort("Couldn't load queue '$Name'");
118 $title = loc('Editing Configuration for queue [_1]', $QueueObj->Name);
120 $current_tab = 'Admin/Queues/Modify.html?id='.$QueueObj->id;
122 if ($QueueObj->Id()) {
123 delete $session{'create_in_queues'};
124 my @attribs= qw(Description CorrespondAddress CommentAddress Name
125 InitialPriority FinalPriority DefaultDueIn);
127 @results = UpdateRecordObject( AttributesRef => \@attribs,
131 #we're asking about enabled on the web page but really care about disabled.
138 if ( ($SetEnabled) and ( $Disabled != $QueueObj->Disabled) ) {
139 my ($code, $msg) = $QueueObj->SetDisabled($Disabled);
140 push @results, loc('Enabled status [_1]', loc_fuzzy($msg));
143 if ($QueueObj->Disabled()) {
155 $Description => undef
156 $CorrespondAddress => undef
157 $CommentAddress => undef
158 $InitialPriority => undef
159 $FinalPriority => undef
160 $DefaultDueIn => undef