[Rt-commit] rt branch, 4.0-trunk, updated. rt-4.0.18-105-ga2c75fa

Alex Vandiver alexmv at bestpractical.com
Wed Dec 4 16:48:22 EST 2013


The branch, 4.0-trunk has been updated
       via  a2c75faf16a7a4d1d3942a944811d29d7877d25a (commit)
       via  8d02f08217c011619d7bf8dc251e9b3d5a440f17 (commit)
      from  13e5e0905a9b7c427975de624acb6289f5d0a402 (commit)

Summary of changes:
 share/html/Elements/Tabs       | 6 ++++--
 share/html/Ticket/Display.html | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

- Log -----------------------------------------------------------------
commit a2c75faf16a7a4d1d3942a944811d29d7877d25a
Merge: 13e5e09 8d02f08
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Dec 4 16:47:57 2013 -0500

    Merge branch '4.0/silence-last-search-warning' into 4.0-trunk
    
    Conflicts:
    	share/html/Elements/Tabs

diff --cc share/html/Elements/Tabs
index 48fef90,0ea9dd8..152a032
mode 100644,100755..100644
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@@ -525,139 -512,139 +525,141 @@@ my $build_main_nav = sub 
              my $obj = RT::Ticket->new( $session{'CurrentUser'} );
              $obj->Load($id);
  
 -            my $actions = PageMenu()->child( actions => title => loc('Actions'), sort_order  => 95 );
 -            my $tabs = PageMenu();
 -            $tabs->child( bookmark => raw_html => $m->scomp( '/Ticket/Elements/Bookmark', id => $id ), sort_order => 99 );
 -            $tabs->child( display => title => loc('Display'), path => "/Ticket/Display.html?id=" . $id );
 -            $tabs->child( history => title => loc('History'), path => "/Ticket/History.html?id=" . $id );
 -
 -            my %can = %{ $obj->CurrentUser->PrincipalObj->HasRights( Object => $obj ) };
 -            $can{'_ModifyOwner'} = $can{'OwnTicket'} || $can{'TakeTicket'} || $can{'StealTicket'};
 -            my $can = sub {
 -                unless ($_[0] eq 'ExecuteCode') {
 -                    return $can{$_[0]} || $can{'SuperUser'};
 -                } else {
 -                    return !RT->Config->Get('DisallowExecuteCode')
 -                        && ( $can{'ExecuteCode'} || $can{'SuperUser'} );
 -                }
 -            };
 -
 -            # comment out until we can do it for an individual custom field
 -            #if ( $can->('ModifyTicket') || $can->('ModifyCustomField') ) {
 -            $tabs->child( basics => title => loc('Basics'), path => "/Ticket/Modify.html?id=" . $id );
 +            if ( $obj and $obj->id ) {
 +                my $actions = PageMenu()->child( actions => title => loc('Actions'), sort_order  => 95 );
 +                my $tabs = PageMenu();
 +                $tabs->child( bookmark => raw_html => $m->scomp( '/Ticket/Elements/Bookmark', id => $id ), sort_order => 99 );
 +                $tabs->child( display => title => loc('Display'), path => "/Ticket/Display.html?id=" . $id );
 +                $tabs->child( history => title => loc('History'), path => "/Ticket/History.html?id=" . $id );
 +
 +                my %can = %{ $obj->CurrentUser->PrincipalObj->HasRights( Object => $obj ) };
 +                $can{'_ModifyOwner'} = $can{'OwnTicket'} || $can{'TakeTicket'} || $can{'StealTicket'};
 +                my $can = sub {
 +                    unless ($_[0] eq 'ExecuteCode') {
 +                        return $can{$_[0]} || $can{'SuperUser'};
 +                    } else {
 +                        return !RT->Config->Get('DisallowExecuteCode')
 +                            && ( $can{'ExecuteCode'} || $can{'SuperUser'} );
 +                    }
 +                };
  
 -            #}
 +                # comment out until we can do it for an individual custom field
 +                #if ( $can->('ModifyTicket') || $can->('ModifyCustomField') ) {
 +                $tabs->child( basics => title => loc('Basics'), path => "/Ticket/Modify.html?id=" . $id );
  
 -            if ( $can->('ModifyTicket') || $can->('_ModifyOwner') || $can->('Watch') || $can->('WatchAsAdminCc') ) {
 -                $tabs->child( people => title => loc('People'), path => "/Ticket/ModifyPeople.html?id=" . $id );
 -            }
 +                #}
  
 -            if ( $can->('ModifyTicket') ) {
 -                $tabs->child( dates => title => loc('Dates'), path => "/Ticket/ModifyDates.html?id=" . $id );
 -                $tabs->child( links => title => loc('Links'), path => "/Ticket/ModifyLinks.html?id=" . $id );
 -            }
 +                if ( $can->('ModifyTicket') || $can->('_ModifyOwner') || $can->('Watch') || $can->('WatchAsAdminCc') ) {
 +                    $tabs->child( people => title => loc('People'), path => "/Ticket/ModifyPeople.html?id=" . $id );
 +                }
  
 -            #if ( $can->('ModifyTicket') || $can->('ModifyCustomField') || $can->('_ModifyOwner') ) {
 -            $tabs->child( jumbo => title => loc('Jumbo'), path => "/Ticket/ModifyAll.html?id=" . $id );
 -            #}
 +                if ( $can->('ModifyTicket') ) {
 +                    $tabs->child( dates => title => loc('Dates'), path => "/Ticket/ModifyDates.html?id=" . $id );
 +                    $tabs->child( links => title => loc('Links'), path => "/Ticket/ModifyLinks.html?id=" . $id );
 +                }
  
 -            if ( RT->Config->Get('EnableReminders') ) {
 -                $tabs->child( reminders => title => loc('Reminders'), path => "/Ticket/Reminders.html?id=" . $id );
 -            }
 +                #if ( $can->('ModifyTicket') || $can->('ModifyCustomField') || $can->('_ModifyOwner') ) {
 +                $tabs->child( jumbo => title => loc('Jumbo'), path => "/Ticket/ModifyAll.html?id=" . $id );
 +                #}
  
 -            if ( $can->('ModifyTicket') or $can->('ReplyToTicket') ) {
 -                $actions->child( reply => title => loc('Reply'), path => "/Ticket/Update.html?Action=Respond;id=" . $id );
 -            }
 +                if ( RT->Config->Get('EnableReminders') ) {
 +                    $tabs->child( reminders => title => loc('Reminders'), path => "/Ticket/Reminders.html?id=" . $id );
 +                }
  
 -            if ( $can->('ModifyTicket') or $can->('CommentOnTicket') ) {
 -                $actions->child( comment => title => loc('Comment'), path => "/Ticket/Update.html?Action=Comment;id=" . $id );
 -            }
 +                if ( $can->('ModifyTicket') or $can->('ReplyToTicket') ) {
 +                    $actions->child( reply => title => loc('Reply'), path => "/Ticket/Update.html?Action=Respond;id=" . $id );
 +                }
  
 -            if ( $can->('ForwardMessage') ) {
 -                $actions->child( forward => title => loc('Forward'), path => "/Ticket/Forward.html?id=" . $id );
 -            }
 +                if ( $can->('ModifyTicket') or $can->('CommentOnTicket') ) {
 +                    $actions->child( comment => title => loc('Comment'), path => "/Ticket/Update.html?Action=Comment;id=" . $id );
 +                }
  
 -            my $hide_resolve_with_deps = RT->Config->Get('HideResolveActionsWithDependencies')
 -                && $obj->HasUnresolvedDependencies;
 -
 -            my $current   = $obj->Status;
 -            my $lifecycle = $obj->QueueObj->Lifecycle;
 -            my $i         = 1;
 -            foreach my $info ( $lifecycle->Actions($current) ) {
 -                my $next = $info->{'to'};
 -                next unless $lifecycle->IsTransition( $current => $next );
 -
 -                my $check = $lifecycle->CheckRight( $current => $next );
 -                next unless $can->($check);
 -
 -                next if $hide_resolve_with_deps
 -                    && $lifecycle->IsInactive($next)
 -                    && !$lifecycle->IsInactive($current);
 -
 -                my $action = $info->{'update'} || '';
 -                my $url = '/Ticket/';
 -                if ($action) {
 -                    $url .= "Update.html?"
 -                        . $query_string->(
 -                            Action        => $action,
 -                            DefaultStatus => $next,
 -                            id            => $id,
 -                        );
 -                } else {
 -                    $url .= "Display.html?"
 -                        . $query_string->(
 -                            Status => $next,
 -                            id     => $id,
 -                        );
 +                if ( $can->('ForwardMessage') ) {
 +                    $actions->child( forward => title => loc('Forward'), path => "/Ticket/Forward.html?id=" . $id );
                  }
 -                my $key = $info->{'label'} || ucfirst($next);
 -                $actions->child( $key => title => loc( $key ), path => $url);
 -            }
  
 -            if ( $can->('OwnTicket') ) {
 -                if ( $obj->OwnerObj->Id == RT->Nobody->id
 -                     && ( $can->('ModifyTicket') or $can->('TakeTicket') ) ) {
 -                    $actions->child( take => title => loc('Take'), path => "/Ticket/Display.html?Action=Take;id=" . $id );
 +                my $hide_resolve_with_deps = RT->Config->Get('HideResolveActionsWithDependencies')
 +                    && $obj->HasUnresolvedDependencies;
 +
 +                my $current   = $obj->Status;
 +                my $lifecycle = $obj->QueueObj->Lifecycle;
 +                my $i         = 1;
 +                foreach my $info ( $lifecycle->Actions($current) ) {
 +                    my $next = $info->{'to'};
 +                    next unless $lifecycle->IsTransition( $current => $next );
 +
 +                    my $check = $lifecycle->CheckRight( $current => $next );
 +                    next unless $can->($check);
 +
 +                    next if $hide_resolve_with_deps
 +                        && $lifecycle->IsInactive($next)
 +                        && !$lifecycle->IsInactive($current);
 +
 +                    my $action = $info->{'update'} || '';
 +                    my $url = '/Ticket/';
 +                    if ($action) {
 +                        $url .= "Update.html?"
 +                            . $query_string->(
 +                                Action        => $action,
 +                                DefaultStatus => $next,
 +                                id            => $id,
 +                            );
 +                    } else {
 +                        $url .= "Display.html?"
 +                            . $query_string->(
 +                                Status => $next,
 +                                id     => $id,
 +                            );
 +                    }
 +                    my $key = $info->{'label'} || ucfirst($next);
 +                    $actions->child( $key => title => loc( $key ), path => $url);
                  }
  
 -                elsif (    $obj->OwnerObj->id != RT->Nobody->id
 -                        && $obj->OwnerObj->id != $session{CurrentUser}->id
 -                        && ( $can->('ModifyTicket') or $can->('StealTicket') ) ) {
 -                    $actions->child( steal => title => loc('Steal'), path => "/Ticket/Display.html?Action=Steal;id=" . $id );
 +                if ( $can->('OwnTicket') ) {
 +                    if ( $obj->OwnerObj->Id == RT->Nobody->id
 +                         && ( $can->('ModifyTicket') or $can->('TakeTicket') ) ) {
 +                        $actions->child( take => title => loc('Take'), path => "/Ticket/Display.html?Action=Take;id=" . $id );
 +                    }
 +
 +                    elsif (    $obj->OwnerObj->id != RT->Nobody->id
 +                            && $obj->OwnerObj->id != $session{CurrentUser}->id
 +                            && ( $can->('ModifyTicket') or $can->('StealTicket') ) ) {
 +                        $actions->child( steal => title => loc('Steal'), path => "/Ticket/Display.html?Action=Steal;id=" . $id );
 +                    }
                  }
 -            }
  
 -            # TODO needs a "Can extract article into a class applied to this queue" check
 -            $actions->child( 'extract-article' =>
 -                title => loc('Extract Article'),
 -                path  => "/Articles/Article/ExtractIntoClass.html?Ticket=".$obj->id,
 -            );
 +                # TODO needs a "Can extract article into a class applied to this queue" check
 +                $actions->child( 'extract-article' =>
 +                    title => loc('Extract Article'),
 +                    path  => "/Articles/Article/ExtractIntoClass.html?Ticket=".$obj->id,
 +                );
  
 -            if ( defined $session{"tickets"} ) {
 -                # we have to update session data if we get new ItemMap
 -                my $updatesession = 1 unless ( $session{"tickets"}->{'item_map'} );
 +                if ( defined $session{"tickets"} ) {
 +                    # we have to update session data if we get new ItemMap
 +                    my $updatesession = 1 unless ( $session{"tickets"}->{'item_map'} );
  
 -                my $item_map = $session{"tickets"}->ItemMap;
 +                    my $item_map = $session{"tickets"}->ItemMap;
  
 -                if ($updatesession) {
 -                    $session{"tickets"}->PrepForSerialization();
 -                }
 +                    if ($updatesession) {
 +                        $session{"tickets"}->PrepForSerialization();
 +                    }
  
 -                my $search = Menu()->child('search');
 -                # Don't display prev links if we're on the first ticket
 -                if ( $item_map->{$id}->{prev} ) {
 -                    $search->child( first =>
 -                        title => '<< ' . loc('First'), class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{first});
 -                    $search->child( prev =>
 -                        title => '< ' . loc('Prev'),   class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{$id}->{prev});
 -                }
 -                # Don't display next links if we're on the last ticket
 -                if ( $item_map->{$id}->{next} ) {
 -                    $search->child( next =>
 -                        title => loc('Next') . ' >',  class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{$id}->{next});
 -                    if ( $item_map->{last} ) {
 -                        $search->child( last =>
 -                            title => loc('Last') . ' >>', class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{last});
 +                    my $search = Menu()->child('search');
 +                    # Don't display prev links if we're on the first ticket
 +                    if ( $item_map->{$id}->{prev} ) {
 +                        $search->child( first =>
 +                            title => '<< ' . loc('First'), class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{first});
 +                        $search->child( prev =>
 +                            title => '< ' . loc('Prev'),   class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{$id}->{prev});
 +                    }
 +                    # Don't display next links if we're on the last ticket
 +                    if ( $item_map->{$id}->{next} ) {
 +                        $search->child( next =>
 +                            title => loc('Next') . ' >',  class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{$id}->{next});
-                         $search->child( last =>
-                             title => loc('Last') . ' >>', class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{last});
++                        if ( $item_map->{last} ) {
++                            $search->child( last =>
++                                title => loc('Last') . ' >>', class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{last});
++                        }
                      }
                  }
              }
diff --cc share/html/Ticket/Display.html
index 09c1a95,413a5ff..57fe1ee
mode 100644,100755..100644
--- a/share/html/Ticket/Display.html
+++ b/share/html/Ticket/Display.html

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


More information about the rt-commit mailing list