[Rt-commit] rt branch, 4.6/configurable-linked-queue-portlets, repushed

Maureen Mirville maureen at bestpractical.com
Wed Dec 12 18:15:46 EST 2018


The branch 4.6/configurable-linked-queue-portlets was deleted and repushed:
       was b2ee2d7a5b929cafec4e33d1fc9f7bef8ee81f83
       now 9c6a4cac981f915a06d44884e5591757f96c0fc3

1: 0f387a635 ! 1: 5f0c212bd Add a configurable queue portlet to ticket display page
    @@ -89,17 +89,21 @@
     +
     +my $query = "Queue = '" . $QueueName . "' AND ". $ExtraQuery;
     +
    -+if ( grep /All/, @LinkTypes ) {
    ++if ( grep { lc $_ eq 'all' } @LinkTypes ) {
     +    $linked_tickets->FromSQL( "$query AND ( LinkedTo = $ticket_id OR LinkedFrom = $ticket_id )" );
     +} else {
     +    my @link_relations = map { $_ . " = $ticket_id" } @LinkTypes;
     +    my $link_query = join ( ' OR ', @link_relations );
    -+    $query = $query . ' AND ( ' . $link_query . ' )' if $link_query;
    ++    if ( $link_query ) {
    ++        $query = $query . ' AND ( ' . $link_query . ' )';
    ++    } else {
    ++        $query = 'id=0';
    ++    }
     +    $linked_tickets->FromSQL( $query );
     +}
     +
     +$Format = RT->Config->Get( 'LinkedQueuesPortletFormat' );
    -+$FullList = "/Ticket/ModifyLinks.html?id=" . $TicketObj->id . "&Queue=" . $QueueId;
    ++$FullList = RT->Config->Get( 'WebPath' ) . "/Ticket/ModifyLinks.html?id=" . $TicketObj->id . "&Queue=" . $QueueName;
     +
     +$m->callback( CallbackName => 'MassagePortlets', ARGSRef => \%ARGS, Format => \$Format, FullList => \$FullList );
     +</%INIT>
    @@ -174,19 +178,19 @@
     +%#
     +%# END BPS TAGGED BLOCK }}}
     +<%PERL>
    -+my ( $title_href, $titleright_raw, $title_class, $class );
    -+
    -+foreach my $on_queue ( @show_portlet_on_queues ) {
    -+    if ( $on_queue eq $TicketObj->QueueObj->Name ) {
    -+        foreach my $queues ( @{ $portlet_config{ $on_queue } } ) {
    -+            foreach my $queue_name ( keys %{ $queues } ) {
    -+                my $queue_obj = RT::Queue->new( $session{ CurrentUser } );
    -+                my ( $ret, $msg ) = $queue_obj->Load( $queue_name );
    -+                RT::Logger->error( $msg ) unless $ret;
    -+                next unless $ret;
    -+                foreach my $link_types ( $queues->{ $queue_name } ) {
    -+                    $title_class = 'inverse';
    -+                    $class = "ticket-info-links";
    ++my ( $title_href, $titleright_raw, $title_class, $class ) = ('')x4;
    ++
    ++foreach my $queues ( @{ $portlet_config{ $queue } } ) {
    ++    foreach my $queue_name ( keys %{ $queues } ) {
    ++        my $queue_obj = RT::Queue->new( $session{ CurrentUser } );
    ++        my ( $ret, $msg ) = $queue_obj->Load( $queue_name );
    ++        unless ( $ret ) {
    ++            RT::Logger->error( $msg );
    ++            next;
    ++        }
    ++        my $link_types = $queues->{ $queue_name };
    ++            $title_class = 'inverse';
    ++            $class = "ticket-info-links";
     +
     +$m->callback( CallbackName => 'MassageTitleBox',
     +    ARGSRef         => \%ARGS,
    @@ -196,6 +200,12 @@
     +    title_class     => \$title_class,
     +    class           => \$class,
     +);
    ++
    ++$m->callback( CallbackName => '',
    ++    ARGSRef     => \%ARGS,
    ++    OrderBy     => \$OrderBy,
    ++    Rows        => \$Rows,
    ++);
     +</%PERL>
     +
     +<&| /Widgets/TitleBox,
    @@ -225,15 +235,13 @@
     +    QueueId          => $queue_obj->id,
     +&>
     +</&>
    -+%               }
    -+%           }
    -+%       }
     +%   }
     +%}
     +<%INIT>
     +my %portlet_config = RT->Config->Get( 'LinkedQueuePortlets' );
     +return unless %portlet_config;
    -+my @show_portlet_on_queues = sort keys %portlet_config;
    ++my $queue = $TicketObj->QueueObj->Name;
    ++return unless $portlet_config{ $queue };
     +</%INIT>
     +
     +
2: b2ee2d7a5 = 2: 9c6a4cac9 Add docs for the new Linked Queue Portlets configs



More information about the rt-commit mailing list