%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
-%#!!pape: selfservice_find_attachments.patch {{
<& /Ticket/Elements/ShowHistory,
Ticket => $Ticket,
URIFile => "Display.html",
Attachments => $attachments,
UpdatePath => "Update.html"
&>
-%#!!pape: selfservice_find_attachments.patch }}
$m->callback( ARGSRef => \%ARGS, CallbackName => 'Initial' );
-# {{{ Load the ticket
+# Load the ticket
#If we get handed two ids, mason will make them an array. bleck.
# We want teh first one. Just because there's no other sensible way
# to deal
my @id = ( ref $id eq 'ARRAY' ) ? @{$id} : ($id);
-my $Ticket = new RT::Ticket( $session{'CurrentUser'} );
+my $Ticket = RT::Ticket->new( $session{'CurrentUser'} );
# store the uploaded attachment in session
-if ( $ARGS{'Attach'} ) { # attachment?
+if ( defined $ARGS{'Attach'} && length $ARGS{'Attach'} ) { # attachment?
$session{'Attachments'} = {} unless defined $session{'Attachments'};
my $attachment = MakeMIMEEntity(
# {{{ Create a new ticket
- my $Queue = new RT::Queue( $session{'CurrentUser'} );
+ my $Queue = RT::Queue->new( $session{'CurrentUser'} );
unless ( $Queue->Load( $ARGS{'Queue'} ) ) {
$m->comp( 'Error.html', Why => loc('Queue not found') );
$m->abort;
( $Ticket, @results ) =
- CreateTicket( Attachments => $session{'Attachments'}, %ARGS, Status => 'new' );
+ CreateTicket( Attachments => $session{'Attachments'}, %ARGS );
unless ( $Ticket->id ) {
$m->comp( 'Error.html', Why => join( "\n", @results ));
$m->abort();
}
- # }}}
# delete temporary storage entry to make WebUI clean
unless ( keys %{ $session{'Attachments'} } and $ARGS{'UpdateAttach'} ) {
delete $session{'Attachments'};
}
- # }}}
}
else {
unless ( $Ticket->Load( $id[0] ) ) {
my @cfupdates = ProcessObjectCustomFieldUpdates(Object => $Ticket, ARGSRef => \%ARGS);
push (@results, @cfupdates);
- # }}}
#Update the status
if ( ( defined $ARGS{'Status'} )
( $code, $msg ) = $Ticket->SetStatus( $ARGS{'Status'} );
push @results, "$msg";
}
- # }}}
}