[Rt-commit] rt branch, 4.2/add-scrips-menu, repushed

Wallace Reis wreis at bestpractical.com
Tue May 20 17:42:05 EDT 2014


The branch 4.2/add-scrips-menu was deleted and repushed:
       was bf6654b986bab35a6b543fff69ec3c0cb2d84a64
       now aa89bc9d6ab999131999d8c21bddaf31a669f56e

1:  bf6654b ! 1:  aa89bc9 I#28787: Add Scrips menu
    @@ -85,6 +85,38 @@
     -        Arguments => { id => $scrip->id },
     +        Arguments => {
     +            id => $scrip->id,
    ++            From => $From,
    ++        },
    +     );
    + }
    + 
    +
    +diff --git a/share/html/Admin/Scrips/Objects.html b/share/html/Admin/Scrips/Objects.html
    +--- a/share/html/Admin/Scrips/Objects.html
    ++++ b/share/html/Admin/Scrips/Objects.html
    +@@
    + 
    + <form action="Objects.html" method="post" name="AddRemoveScrip">
    + <input type="hidden" class="hidden" name="id" value="<% $id %>" />
    ++<input type="hidden" class="hidden" name="From" value="<% $From || q{} %>" />
    + 
    + % if ( $global ) {
    + <h2><&|/l&>Applies to all objects</&></h2>
    +@@
    + $Stage => undef
    + $Template => ''
    + $Update => 0
    ++$From   => undef
    + </%ARGS>
    + <%INIT>
    + my $scrip = RT::Scrip->new( $session{'CurrentUser'} );
    +@@
    +     }
    +     MaybeRedirectForResults(
    +         Actions   => \@results,
    +-        Arguments => { id => $id },
    ++        Arguments => {
    ++            id => $id,
     +            From => $From,
     +        },
          );
    @@ -133,29 +165,35 @@
                  $obj->Load($id);
      
                  my $tabs = PageMenu();
    +-            $tabs->child( basics => title => loc('Basics') => path => "/Admin/Scrips/Modify.html?id=".$id );
    +-            $tabs->child( 'applies-to' => title => loc('Applies to'), path => "/Admin/Scrips/Objects.html?id=" . $id );
     +
    -+            my ( $admin_cat, $create_path_arg );
    ++            my ( $admin_cat, $create_path_arg, $from_query_param );
     +            my $from_arg = $DECODED_ARGS->{'From'} || q{};
     +            my ($from_queue) = $from_arg =~ /^(\d+)$/;
     +            if ( $from_queue ) {
     +                $admin_cat = "Queues/Scrips.html?id=$from_queue";
     +                $create_path_arg = "?Queue=$from_queue";
    ++                $from_query_param = "&From=$from_queue";
     +            }
     +            elsif ( $from_arg eq 'Global' ) {
     +                $admin_cat = 'Global/Scrips.html';
     +                $create_path_arg = '?Global=1';
    ++                $from_query_param = '&From=Global';
     +            }
     +            else {
     +                $admin_cat = 'Scrips';
    -+                $create_path_arg = q{};
    ++                $from_query_param = $create_path_arg = q{};
     +            }
     +            my $scrips = $tabs->child( scrips => title => loc('Scrips'), path => "/Admin/${admin_cat}" );
     +            $scrips->child( select => title => loc('Select'), path => "/Admin/${admin_cat}" );
     +            $scrips->child( create => title => loc('Create'), path => "/Admin/Scrips/Create.html${create_path_arg}" );
     +
    -             $tabs->child( basics => title => loc('Basics') => path => "/Admin/Scrips/Modify.html?id=".$id );
    -             $tabs->child( 'applies-to' => title => loc('Applies to'), path => "/Admin/Scrips/Objects.html?id=" . $id );
    ++            $tabs->child( basics => title => loc('Basics') => path => "/Admin/Scrips/Modify.html?id=" . $id . $from_query_param );
    ++            $tabs->child( 'applies-to' => title => loc('Applies to'), path => "/Admin/Scrips/Objects.html?id=" . $id . $from_query_param );
              }
    +         elsif ( $request_path =~ m{^/Admin/Scrips/(index\.html)?$} ) {
    +             PageMenu->child( select => title => loc('Select') => path => "/Admin/Scrips/" );
     @@
              }
              elsif ( $request_path =~ m{^/Admin/Scrips/Create\.html$} ) {



More information about the rt-commit mailing list