[Rt-commit] rt branch, master, updated. rt-4.1.8-410-gb99c4db

Ruslan Zakirov ruz at bestpractical.com
Thu May 23 06:52:43 EDT 2013


The branch, master has been updated
       via  b99c4db02d3bdbfef0b46fb3c694417143f35495 (commit)
       via  9c2c6b23c8bb8654932fcee5044455075f9b6e7c (commit)
       via  80b1b0c6ef3a4d3215d33868dc4da7f73f0f5c8e (commit)
       via  b586cec7271e97d423c3b56ef42e6dba4734042e (commit)
       via  1520657d13755c2e56197bd8303610edae679469 (commit)
      from  c3060accf84f91a0de6977acb52f2dd814b0409a (commit)

Summary of changes:
 share/html/Elements/Error           | 11 +++---
 share/html/Elements/Header          |  2 --
 share/html/SelfService/Display.html | 19 ++++------
 share/html/SelfService/Error.html   | 71 -------------------------------------
 4 files changed, 10 insertions(+), 93 deletions(-)
 delete mode 100644 share/html/SelfService/Error.html

- Log -----------------------------------------------------------------
commit b99c4db02d3bdbfef0b46fb3c694417143f35495
Merge: c3060ac 9c2c6b2
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu May 23 14:51:34 2013 +0400

    Merge branch '4.2/error-cleanup'
    
    Conflicts:
    	share/html/SelfService/Display.html

diff --cc share/html/SelfService/Display.html
index 5e90375,faf3150..1298254
--- a/share/html/SelfService/Display.html
+++ b/share/html/SelfService/Display.html
@@@ -96,29 -96,58 +96,22 @@@ my @id = ( ref $id eq 'ARRAY' ) ? @{$id
  
  my $Ticket = RT::Ticket->new( $session{'CurrentUser'} );
  
 -# store the uploaded attachment in session
 -if ( defined $ARGS{'Attach'} && length $ARGS{'Attach'} ) { # attachment?
 -    $session{'Attachments'} = {} unless defined $session{'Attachments'};
 -
 -    my $attachment = MakeMIMEEntity(
 -        AttachmentFieldName => 'Attach'
 -    );
 -
 -    my $file_path = Encode::decode_utf8("$ARGS{'Attach'}");
 -    $session{'Attachments'} = {
 -        %{ $session{'Attachments'} || {} },
 -        $file_path => $attachment,
 -    };
 -}
 -
 -if ( defined ($id[0]) && $id[0] eq 'new' ) {
 -
 -    # {{{ Create a new ticket
 +if ( ($id[0]||'') eq 'new' ) {
  
      my $Queue = RT::Queue->new( $session{'CurrentUser'} );
-     unless ( $Queue->Load( $ARGS{'Queue'} ) ) {
-         Abort( loc('Queue not found') );
-     }
- 
-     unless ( $Queue->CurrentUserHasRight('CreateTicket') ) {
-         Abort( loc('You have no permission to create tickets in that queue.') );
-     }
+     Abort( loc('Queue not found') ) unless $Queue->Load( $ARGS{'Queue'} );
  
+     Abort( loc('You have no permission to create tickets in that queue.') )
+         unless $Queue->CurrentUserHasRight('CreateTicket');
  
 -    ( $Ticket, @results ) =
 -    CreateTicket( Attachments => $session{'Attachments'}, %ARGS );
 +    ( $Ticket, @results ) = CreateTicket( %ARGS );
  
-     unless ( $Ticket->id ) {
-         Abort( join "\n", @results );
-     }
+     Abort( join("\n", @results ) ) unless $Ticket->id;
+ 
 -        # delete temporary storage entry to make WebUI clean
 -        unless ( keys %{ $session{'Attachments'} } and $ARGS{'UpdateAttach'} ) {
 -            delete $session{'Attachments'};
 -        }
 -
 -    }
 -    else {
 -        $Ticket = LoadTicket($ARGS{'id'});
 -
 -    my ( $code, $msg );
 -
 +}
 +else {
-     unless ( $Ticket->Load( $id[0] ) ) {
-         Abort( loc( "Couldn't load ticket '[_1]'", $id ) );
-     }
++    $Ticket = LoadTicket($ARGS{'id'});
  
 -    if (
 -        $session{'Attachments'}
 -        || ( defined $ARGS{'UpdateContent'}
 -            && $ARGS{'UpdateContent'} ne ''
 -            && $ARGS{'UpdateContent'} ne "-- \n"
 -            . $session{'CurrentUser'}->UserObj->Signature )
 -      )
 -    {
 -        $ARGS{UpdateAttachments} = $session{'Attachments'};
 -    }
      push @results, ProcessUpdateMessage(
          ARGSRef   => \%ARGS,
          TicketObj => $Ticket

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


More information about the Rt-commit mailing list