[Bps-public-commit] RT-Extension-FeaturedTickets branch, master, updated. dc9b1e903074353889c47399deb9d3080ac90ca6

Craig Kaiser craig at bestpractical.com
Tue Apr 17 14:28:44 EDT 2018


The branch, master has been updated
       via  dc9b1e903074353889c47399deb9d3080ac90ca6 (commit)
      from  9db1d3d142a4af6334a830c2488c706972fa4859 (commit)

Summary of changes:
 etc/initialdata                 | 11 +++++++++++
 html/NoAuth/Featured/index.html | 11 ++++++++++-
 2 files changed, 21 insertions(+), 1 deletion(-)

- Log -----------------------------------------------------------------
commit dc9b1e903074353889c47399deb9d3080ac90ca6
Author: craig Kaiser <craig at bestpractical.com>
Date:   Tue Apr 17 14:25:20 2018 -0400

    Add 'Feature Type' custom field and limit
    
    Limit tickets displayed by 'feature type' so that we can have seperate
    pages for RT and RTIR. The custom field should default to 'RT' and be
    able to be changed by sending a url variable of 'feature_type'.

diff --git a/etc/initialdata b/etc/initialdata
index dad014e..91405e2 100644
--- a/etc/initialdata
+++ b/etc/initialdata
@@ -47,4 +47,15 @@ our @Queues = ({
          Description =>'Details On Feature, shown only in modal',
          ApplyTo     => $QueueName,
     },
+    {
+        Name        =>'Feature Type',
+        Type        =>'SelectSingle',
+        LookupType  =>'RT::Queue-RT::Ticket',
+        Description =>'Where the feature applies to.',
+        ApplyTo     => $QueueName,
+        Values      => [
+            { Name => 'RT' },
+            { Name => 'RTIR' },
+        ],
+    },
 );
\ No newline at end of file
diff --git a/html/NoAuth/Featured/index.html b/html/NoAuth/Featured/index.html
index b5401d5..104ede2 100644
--- a/html/NoAuth/Featured/index.html
+++ b/html/NoAuth/Featured/index.html
@@ -170,8 +170,17 @@ my @statuses = RT->Config->Get('FeaturedTicketStatuses');
 for my $status (@statuses) {
     $tickets->LimitStatus( VALUE => $status->[0]);
 }
+
+($ret, $msg) = $tickets->LimitCustomField(
+    CUSTOMFIELD => 'Feature Type',
+    OPERATOR    => 'LIKE',
+    VALUE       => $feature_type,
+    QUEUE       => $queue,
+);
+return ($ret, $msg) unless $ret;
 </%init>
 
 <%args>
-$ticket_id => undef
+$ticket_id     => undef
+$feature_type  => 'RT'
 </%args>

-----------------------------------------------------------------------


More information about the Bps-public-commit mailing list