[Rt-commit] [rtir] 01/02: First pass of a new "Set constituency" selector

Jesse Vincent jesse at bestpractical.com
Mon Mar 9 06:16:28 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 a6eee591b51735d1e018d5c4408aae96e9f67e1a
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Sat Mar 7 16:29:53 2015 -0800

    First pass of a new "Set constituency" selector
---
 html/RTIR/Elements/SelectConstituency | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/html/RTIR/Elements/SelectConstituency b/html/RTIR/Elements/SelectConstituency
new file mode 100644
index 0000000..2d467b0
--- /dev/null
+++ b/html/RTIR/Elements/SelectConstituency
@@ -0,0 +1,22 @@
+<select class="rtir constituency">
+<option value="-">All Constituencies</option>
+% for my $constituency (keys %known_constituencies) {
+<option value="<%$constituency%>"><%$constituency%></option>
+% }
+</select>
+<%init>
+my %known_constituencies;
+my $queues = RT::Queues->new($session{'CurrentUser'});
+for my $lifecycle (RT::IR->Lifecycles) {
+    $queues->Limit(FIELD => 'Lifecycle', VALUE => $lifecycle, ENTRYAGGREGATOR =>'OR');
+}
+
+# This list is already filtered by queues the user can see
+for my $queue (@{$queues->ItemsArrayRef}) {
+    my $c = $queue->FirstCustomFieldValue('RTIR Constituency');
+    next unless $c;
+   $known_constituencies{$c }++;  
+}
+# XXX TODO Caching
+# XXX TODO pull the current default
+</%init>
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the rt-commit mailing list