[Rt-commit] [rtir] 10/10: XXX TODO - move a hardcoded queue name out of a reusable component

Jesse Vincent jesse at bestpractical.com
Sat Feb 21 16:15:19 EST 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 0a06e563c1af9143b60606c98fb084b20de5464b
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Sat Feb 21 13:06:51 2015 -0800

    XXX TODO - move a hardcoded queue name out of a reusable component
    
    This change pulls up a hardcoded queue name from Elements/ReplyForm
    to the BulkAbandon page, which is the only place that called it
    without a ticket object (and hence a queue).
    
    Eventually, even that should go away, but this helps to localize the hard-coded
    queue name
---
 html/RTIR/Incident/BulkAbandon.html   |  7 ++++++-
 html/RTIR/Incident/Elements/ReplyForm | 10 +++-------
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/html/RTIR/Incident/BulkAbandon.html b/html/RTIR/Incident/BulkAbandon.html
index 561e972..e72f222 100644
--- a/html/RTIR/Incident/BulkAbandon.html
+++ b/html/RTIR/Incident/BulkAbandon.html
@@ -84,7 +84,7 @@ Lifecycle     => RT::IR->lifecycle_incident,
 </&>
 <br />
 
-<& Elements/ReplyForm &>
+<& Elements/ReplyForm, QueueObj => $queue &>
 
 <& /Elements/Submit,
     Name => "BulkAbandon",
@@ -180,6 +180,11 @@ if ( $ARGS{'BulkAbandon'} ) {
     );
 }
 
+# XXX TODO Don't make this assumption 
+my $queue = RT::Queue->new( $session{'CurrentUser'} );
+$queue->Load('Incidents');
+
+
 </%INIT>
 <%ARGS>
 $Query           => ''
diff --git a/html/RTIR/Incident/Elements/ReplyForm b/html/RTIR/Incident/Elements/ReplyForm
index 52c0286..4c4f624 100644
--- a/html/RTIR/Incident/Elements/ReplyForm
+++ b/html/RTIR/Incident/Elements/ReplyForm
@@ -91,7 +91,7 @@
 &>
 </td></tr>
 
-<& /RTIR/Elements/UpdateData, %ARGS, Ticket => $TicketObj, QueueObj => $queue &>
+<& /RTIR/Elements/UpdateData, %ARGS, Ticket => $TicketObj, QueueObj => $QueueObj &>
 
 </table>
 
@@ -107,12 +107,7 @@ if ( $Action eq 'Comment' || $UpdateType eq 'private' ) {
     $ResponseDefault = "selected";
 }
 
-my $queue;
-$queue = $TicketObj->QueueObj if $TicketObj;
-unless ( $queue ) {
-    $queue = RT::Queue->new( $session{'CurrentUser'} );
-    $queue->Load('Incidents');
-}
+$QueueObj = $TicketObj->QueueObj if $TicketObj;
 
 </%INIT>
 <%ARGS>
@@ -127,5 +122,6 @@ $AllowResponse => 1,
 $Owner         => undef,
 
 $TicketObj     => undef,
+$QueueObj      => undef
 $Status        => '',
 </%ARGS>

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


More information about the rt-commit mailing list