[Rt-commit] rtir branch, 4.2/configurable-linked-queue-portlets, repushed

Blaine Motsinger blaine at bestpractical.com
Thu Apr 30 14:53:55 EDT 2020


The branch 4.2/configurable-linked-queue-portlets was deleted and repushed:
       was c015157a5aba3bfcec05e5fe7fa90cf761d95a7b
       now 91249f0d6ccffa54ae71ff7f978c211bbf399328

1: 90996de4 ! 1: ae31bb23 Update RTIR Incidents to use a callback for displaying queue portlets
    @@ -26,15 +26,18 @@
          },
      );
      
    -+=item C<%LinkedQueuePortlets%>
    -+
    -+This config adds portlets, containing a list of linked
    -+tickets by queue (Incident Reports, Investigations,
    -+Countermeasures) to each Incident display page. By
    -+default, all link types are shown. Additional accepted
    -+link types include, 'DependsOn', 'DependedOnBy',
    -+'HasMember' (children), 'MemberOf' (parents), 'RefersTo',
    -+and 'ReferredToBy'.
    ++=item C<%LinkedQueuePortlets>
    ++
    ++C<%LinkedQueuePortlets> allows you to display links to tickets in
    ++another queue in a stand-alone portlet on the ticket display page.
    ++This makes it easier to highlight specific ticket links separate from
    ++the standard Links portlet.
    ++
    ++You can include multiple linked queues in each ticket and they are
    ++displayed in the order you define them in the configuration. The values
    ++are RT link types: 'DependsOn', 'DependedOnBy', 'HasMember'
    ++(children), 'MemberOf' (parents), 'RefersTo', and 'ReferredToBy'.
    ++'All' lists all linked tickets. You can include multiple link types.
     +
     +=cut
     +
    @@ -55,6 +58,8 @@
     +++ b/html/Callbacks/RTIR/Ticket/Elements/ShowLinkedQueues/MassageQueries
     @@
     +<%INIT>
    ++# this callback provides a means to manipulate the queries and empty message strings for each linked queue
    ++# for ShowLinkedQueues before the queries are run or message strings displayed on the page.
     +my $queue = RT::Queue->new($session{CurrentUser});
     +$queue->Load($Queue);
     +my $lifecycle = $queue->Lifecycle;
    @@ -82,6 +87,8 @@
     +++ b/html/Callbacks/RTIR/Ticket/Elements/ShowLinkedQueues/MassageTitleBox
     @@
     +<%INIT>
    ++# this callback provides a means to manipulate the values being sent to the TitleBox element
    ++# for ShowLinkedQueues before they are run and displayed on the page.
     +my @queues = ( 'Incident Reports','Investigations', 'Countermeasures' );
     +
     +my %lifecycles = (
    @@ -93,31 +100,33 @@
     +my $id = $ARGSRef->{ TicketObj }->id;
     +
     +foreach my $queue ( @queues ) {
    -+    if( $queue eq $$title ) {
    ++    if ( $queue eq $$title ) {
     +        my $lifecycle = $lifecycles{ $queue };
     +        $$class = 'tickets-list-'. lc(RT::IR::TicketType( Lifecycle => $lifecycle ));
     +        $$title_href = RT::IR->HREFTo("Incident/Children/?Lifecycle=$lifecycle&id=$id");
     +
    -+    my @titleright_raw;
    -+    if( $ARGSRef->{ TicketObj }->CurrentUserHasRight('ModifyTicket') ) {
    -+        if (1) { # XXX TODO RESTORE THIS ACL CHECK
    -+        # $QueueObj->Id and $QueueObj->CurrentUserHasRight('CreateTicket') ) {
    ++        my @titleright_raw;
    ++        if ( $ARGSRef->{ TicketObj }->CurrentUserHasRight('ModifyTicket') ) {
    ++            my $QueueObj = RT::Queue->new($session{CurrentUser});
    ++            $QueueObj->Load($queue);
    ++
    ++            if ( $QueueObj->Id and $QueueObj->CurrentUserHasRight('CreateTicket') ) {
    ++                push @titleright_raw, {
    ++                    title => $lifecycle ne RT::IR->lifecycle_investigation? loc('Create') : loc('Launch'),
    ++                    class => 'create_child' . ($lifecycle ? '_'.$lifecycle : ''),
    ++                    path => RT::IR->HREFTo("CreateInQueue.html?Incident=$id&Lifecycle=".$lifecycle),
    ++                };
    ++            }
     +            push @titleright_raw, {
    -+                title => $lifecycle ne RT::IR->lifecycle_investigation? loc('Create') : loc('Launch'),
    -+                class => 'create_child' . ($lifecycle ? '_'.$lifecycle : ''),
    -+                path => RT::IR->HREFTo("CreateInQueue.html?Incident=$id&Lifecycle=".$lifecycle),
    ++                title => loc('Link'),
    ++                path  => RT::IR->HREFTo("Link/FromIncident/?id=$id&Lifecycle=".$lifecycle),
     +            };
     +        }
    -+        push @titleright_raw, {
    -+            title => loc('Link'),
    -+            path  => RT::IR->HREFTo("Link/FromIncident/?id=$id&Lifecycle=".$lifecycle),
    -+        };
    -+    }
    -+
    -+    $$titleright_raw = join ' 'x3,
    -+        map q{<a href="} . $_->{'path'} . ( $_->{'class'} ? q{" class="} . $_->{'class'} : '' ) . q{">}
    -+            . $m->interp->apply_escapes( $_->{title}, 'h' ) . q{</a>},
    -+        @titleright_raw;
    ++
    ++        $$titleright_raw = join ' 'x3,
    ++            map q{<a href="} . $_->{'path'} . ( $_->{'class'} ? q{" class="} . $_->{'class'} : '' ) . q{">}
    ++                . $m->interp->apply_escapes( $_->{title}, 'h' ) . q{</a>},
    ++            @titleright_raw;
     +    }
     +}
     +</%INIT>
2: c015157a ! 2: 70bb09dc Add test for Linked Queue Portlets
    @@ -49,3 +49,4 @@
     +    'Countermeasure portlet contains link to Countermeasure' );
     +
     +done_testing();
    +
-:  ------- > 3: d8fb0707 Disable InlineEdit for Incident/Children list
-:  ------- > 4: 91249f0d Add LinkedQueuePortletFormats documentation



More information about the rt-commit mailing list