[Rt-commit] [rtir] 01/09: RTIR Ticket Edit now limits by constituency and lifecycle by default
Jesse Vincent
jesse at bestpractical.com
Tue Mar 10 21:11:07 EDT 2015
This is an automated email from the git hooks/post-receive script.
jesse pushed a commit to branch 3.4/remove_old_constituencies
in repository rtir.
commit ea0b8fb0b00de948586f7aea2413d6742fe3b6bc
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Tue Mar 10 13:57:23 2015 -0700
RTIR Ticket Edit now limits by constituency and lifecycle by default
---
html/RTIR/Edit.html | 13 +++++++++++++
html/RTIR/Elements/SelectRTIRQueue | 8 +++++---
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/html/RTIR/Edit.html b/html/RTIR/Edit.html
index 340d23e..bf0241f 100644
--- a/html/RTIR/Edit.html
+++ b/html/RTIR/Edit.html
@@ -93,6 +93,19 @@
TicketObj => $Ticket, QueueObj => $Ticket->QueueObj,
&></td>
</tr>
+ <tr>
+ <td class="label"><&|/l&>Queue</&>:</td>
+ <td class="value"><& /RTIR/Elements/SelectRTIRQueue,
+ Name => 'Queue', Default => $ARGS{'Queue'} || $Ticket->Queue,
+ TicketObj => $Ticket, Lifecycle => $Ticket->QueueObj->Lifecycle,
+ LimitToConstituency => 1,
+ Constituency => $Ticket->QueueObj->FirstCustomFieldValue('RTIR Constituency')
+ &></td>
+ </tr>
+
+
+
+
% if ($Ticket->QueueObj->Lifecycle ne RT::IR->lifecycle_incident ) {
<tr>
<td class="label"><%loc("Incident")%>:</td>
diff --git a/html/RTIR/Elements/SelectRTIRQueue b/html/RTIR/Elements/SelectRTIRQueue
index 1b0bb60..35c23e3 100644
--- a/html/RTIR/Elements/SelectRTIRQueue
+++ b/html/RTIR/Elements/SelectRTIRQueue
@@ -45,8 +45,6 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-%# XXX TODO replace with something that limits by constituency and
-%# XXX TODO Lifecycle
<select name="<%$Name%>" <% ($OnChange) ? 'onchange="'.$OnChange.'"' : '' |n %> class="<%$Class%>">
% if ($ShowNullOption) {
<option value=""><% $DefaultLabel %></option>
@@ -70,12 +68,14 @@ $Default => 0
$OnChange => undef
$CacheNeedsUpdate => RT->System->QueueCacheNeedsUpdate
$Lifecycle => undef
+$LimitToConstituency => 0
+$Constituency => undef
</%args>
<%init>
my $Class = "select-rtir-queue-".$Lifecycle;
# XXX TODO This cache will need to take constituency into account
-my $cache_key = join "---", "SelectObject", 'rtir-queue-'.$Lifecycle,
+my $cache_key = join "---", "SelectObject", 'rtir-queue-'.$Lifecycle,$LimitToConstituency, ($Constituency ||""),
$session{'CurrentUser'}->Id, $CheckRight || "", $ShowAll;
if ( defined $session{$cache_key} && ref $session{$cache_key} eq 'ARRAY') {
@@ -110,6 +110,8 @@ if ( not defined $session{$cache_key} ) {
}
while (my $object = $collection->Next) {
+
+ next if ($LimitToConstituency && $object->FirstCustomFieldValue('RTIR Constituency') ne $Constituency);
if ($ShowAll
or not $CheckRight
or $session{CurrentUser}->HasRight( Object => $object, Right => $CheckRight ))
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the rt-commit
mailing list