[Rt-commit] [rtir] 06/06: Switch to using 'ConstituencyFor' helper rather than direct cf access
Jesse Vincent
jesse at bestpractical.com
Wed Mar 25 03:34:16 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 de12dfae4d57672750280395e7a951b704ebbc07
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Wed Mar 25 00:33:49 2015 -0700
Switch to using 'ConstituencyFor' helper rather than direct cf access
---
html/RTIR/Display.html | 2 +-
html/RTIR/Edit.html | 2 +-
html/RTIR/Elements/QueueSummary | 2 +-
html/RTIR/Elements/SelectConstituency | 2 +-
html/RTIR/Elements/SelectRTIRQueue | 2 +-
html/RTIR/Elements/WorkWithConstituency | 2 +-
html/RTIR/Incident/Display.html | 2 +-
7 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/html/RTIR/Display.html b/html/RTIR/Display.html
index ab30fb5..a8e84d3 100644
--- a/html/RTIR/Display.html
+++ b/html/RTIR/Display.html
@@ -66,7 +66,7 @@
class => 'ticket-info-basics',
&>
<table class="basics">
-% if (my $constituency = $Ticket->QueueObj->FirstCustomFieldValue('RTIR Constituency') ) {
+% if (my $constituency = RT::IR->ConstituencyFor($Ticket)) {
<tr>
<td class="label"><% loc("Constituency") %>:</td>
<td class="value">
diff --git a/html/RTIR/Edit.html b/html/RTIR/Edit.html
index e09cc29..0ff3990 100644
--- a/html/RTIR/Edit.html
+++ b/html/RTIR/Edit.html
@@ -99,7 +99,7 @@
Name => 'Queue', Default => $ARGS{'Queue'} || $Ticket->Queue,
TicketObj => $Ticket, Lifecycle => $Ticket->QueueObj->Lifecycle,
LimitToConstituency => ($m->{'RTIR_ConstituencyFilter'} || RT::IR->StrictConstituencyLinking) ? 1 : 0,
- Constituency => $Ticket->QueueObj->FirstCustomFieldValue('RTIR Constituency')
+ Constituency => RT::IR->ConstituencyFor($Ticket)
&></td>
</tr>
diff --git a/html/RTIR/Elements/QueueSummary b/html/RTIR/Elements/QueueSummary
index 1ea8b55..38eba44 100644
--- a/html/RTIR/Elements/QueueSummary
+++ b/html/RTIR/Elements/QueueSummary
@@ -92,7 +92,7 @@ my $queue_filter =sub {
return undef if !$q->CurrentUserHasRight('ShowTicket');
return undef if exists $unwanted->{$q->Name};
return undef if (defined $m->{'RTIR_ConstituencyFilter'}
- && ($q->FirstCustomFieldValue('RTIR Constituency') || '')
+ && (RT::IR->ConstituencyFor($q) || '')
ne ($m->{'RTIR_ConstituencyFilter'}||''));
return 1;
};
diff --git a/html/RTIR/Elements/SelectConstituency b/html/RTIR/Elements/SelectConstituency
index 2d467b0..bb9674e 100644
--- a/html/RTIR/Elements/SelectConstituency
+++ b/html/RTIR/Elements/SelectConstituency
@@ -13,7 +13,7 @@ for my $lifecycle (RT::IR->Lifecycles) {
# This list is already filtered by queues the user can see
for my $queue (@{$queues->ItemsArrayRef}) {
- my $c = $queue->FirstCustomFieldValue('RTIR Constituency');
+ my $c = RT::IR->ConstituencyFor($queue);
next unless $c;
$known_constituencies{$c }++;
}
diff --git a/html/RTIR/Elements/SelectRTIRQueue b/html/RTIR/Elements/SelectRTIRQueue
index 220d7d6..76c7aa0 100644
--- a/html/RTIR/Elements/SelectRTIRQueue
+++ b/html/RTIR/Elements/SelectRTIRQueue
@@ -114,7 +114,7 @@ if ( not defined $session{$cache_key} ) {
}
while (my $object = $collection->Next) {
- my $object_constituency =$object->FirstCustomFieldValue('RTIR Constituency') ||'';
+ my $object_constituency = RT::IR->ConstituencyFor($object) || '';
next if ($LimitToConstituency &&
($object_constituency ne ($Constituency||'')));
if ($ShowAll
diff --git a/html/RTIR/Elements/WorkWithConstituency b/html/RTIR/Elements/WorkWithConstituency
index 68123dc..722afc8 100644
--- a/html/RTIR/Elements/WorkWithConstituency
+++ b/html/RTIR/Elements/WorkWithConstituency
@@ -15,7 +15,7 @@ for my $lifecycle (RT::IR->Lifecycles) {
# This list is already filtered by queues the user can see
for my $queue (@{$queues->ItemsArrayRef}) {
- my $c = $queue->FirstCustomFieldValue('RTIR Constituency');
+ my $c = RT::IR->ConstituencyFor($queue);
next unless $c;
$known_constituencies{$c }++;
}
diff --git a/html/RTIR/Incident/Display.html b/html/RTIR/Incident/Display.html
index f15a824..2a6665b 100644
--- a/html/RTIR/Incident/Display.html
+++ b/html/RTIR/Incident/Display.html
@@ -64,7 +64,7 @@
<table>
-% if (my $constituency = $TicketObj->QueueObj->FirstCustomFieldValue('RTIR Constituency') ) {
+% if (my $constituency = RT::IR->ConstituencyFor($TicketObj)) {
<tr>
<td class="label"><% loc("Constituency") %>:</td>
<td class="value">
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the rt-commit
mailing list