From 679854b8bbc65d112071111bbd7f34a6a481fb30 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Tue, 4 Jun 2013 00:21:24 -0700 Subject: RT 4.0.13 --- rt/share/html/SelfService/Article/Display.html | 2 +- rt/share/html/SelfService/Article/Search.html | 2 +- rt/share/html/SelfService/Article/autohandler | 2 +- rt/share/html/SelfService/Attachment/dhandler | 2 +- rt/share/html/SelfService/Closed.html | 2 +- rt/share/html/SelfService/Create.html | 17 +++------ rt/share/html/SelfService/CreateTicketInQueue.html | 2 +- rt/share/html/SelfService/Display.html | 33 ++-------------- rt/share/html/SelfService/Elements/GotoTicket | 2 +- rt/share/html/SelfService/Elements/Header | 2 +- rt/share/html/SelfService/Elements/MyRequests | 2 +- rt/share/html/SelfService/Elements/SearchArticle | 2 +- rt/share/html/SelfService/Error.html | 2 +- rt/share/html/SelfService/Prefs.html | 44 +++++++++++++++++++++- rt/share/html/SelfService/Update.html | 30 ++++++++++----- rt/share/html/SelfService/index.html | 2 +- 16 files changed, 84 insertions(+), 64 deletions(-) (limited to 'rt/share/html/SelfService') diff --git a/rt/share/html/SelfService/Article/Display.html b/rt/share/html/SelfService/Article/Display.html index 77b3c0ff2..93e8bcbc3 100644 --- a/rt/share/html/SelfService/Article/Display.html +++ b/rt/share/html/SelfService/Article/Display.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/SelfService/Article/Search.html b/rt/share/html/SelfService/Article/Search.html index c9acc555a..7e178d37f 100644 --- a/rt/share/html/SelfService/Article/Search.html +++ b/rt/share/html/SelfService/Article/Search.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/SelfService/Article/autohandler b/rt/share/html/SelfService/Article/autohandler index 802184c27..3bb2c2b38 100644 --- a/rt/share/html/SelfService/Article/autohandler +++ b/rt/share/html/SelfService/Article/autohandler @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/SelfService/Attachment/dhandler b/rt/share/html/SelfService/Attachment/dhandler index e3381a981..01b7bba76 100755 --- a/rt/share/html/SelfService/Attachment/dhandler +++ b/rt/share/html/SelfService/Attachment/dhandler @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/SelfService/Closed.html b/rt/share/html/SelfService/Closed.html index 6fd6e8328..13ca3a876 100755 --- a/rt/share/html/SelfService/Closed.html +++ b/rt/share/html/SelfService/Closed.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/SelfService/Create.html b/rt/share/html/SelfService/Create.html index e28ab0f57..76126ae18 100755 --- a/rt/share/html/SelfService/Create.html +++ b/rt/share/html/SelfService/Create.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -91,16 +91,7 @@ <& /Ticket/Elements/EditCustomFields, %ARGS, QueueObj => $queue_obj &> - - -%# FIXME: if failed customfields validation, attachement needs to be choosen -%# again by user. -<&|/l&>Attach file: - - - - - +<& /Ticket/Elements/AddAttachments, %ARGS, QueueObj => $queue_obj &> @@ -128,10 +119,12 @@ my $ValidCFs = $m->comp( ARGSRef => \%ARGS ); +ProcessAttachments(ARGSRef => \%ARGS); + my $skip_create = 0; $m->callback( CallbackName => 'BeforeCreate', ARGSRef => \%ARGS, skip_create => \$skip_create, results => \@results ); -if ( defined($ARGS{'id'}) and $ARGS{'id'} eq 'new' ) { # new ticket? +if ( !exists $ARGS{'AddMoreAttach'} and defined($ARGS{'id'}) and $ARGS{'id'} eq 'new' ) { # new ticket? if ( $ValidCFs && !$skip_create ) { $m->comp('Display.html', %ARGS); $RT::Logger->crit("After display call; error is $@"); diff --git a/rt/share/html/SelfService/CreateTicketInQueue.html b/rt/share/html/SelfService/CreateTicketInQueue.html index 887c32e35..39020973e 100755 --- a/rt/share/html/SelfService/CreateTicketInQueue.html +++ b/rt/share/html/SelfService/CreateTicketInQueue.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/SelfService/Display.html b/rt/share/html/SelfService/Display.html index 23c74672a..857ebfa98 100755 --- a/rt/share/html/SelfService/Display.html +++ b/rt/share/html/SelfService/Display.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -100,21 +100,6 @@ my @id = ( ref $id eq 'ARRAY' ) ? @{$id} : ($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 @@ -134,19 +119,12 @@ if ( defined ($id[0]) && $id[0] eq 'new' ) { ( $Ticket, @results ) = - CreateTicket( Attachments => $session{'Attachments'}, %ARGS ); + CreateTicket( Attachments => delete $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] ) ) { @@ -172,12 +150,7 @@ if ( defined ($id[0]) && $id[0] eq 'new' ) { ARGSRef => \%ARGS, TicketObj => $Ticket ); - delete $session{'Attachments'}; - - # delete temporary storage entry to make WebUI clean - unless ( keys %{ $session{'Attachments'} } and $ARGS{'UpdateAttach'} ) { - delete $session{'Attachments'}; - } + delete $session{'Attachments'}; my @cfupdates = ProcessObjectCustomFieldUpdates(Object => $Ticket, ARGSRef => \%ARGS); push (@results, @cfupdates); diff --git a/rt/share/html/SelfService/Elements/GotoTicket b/rt/share/html/SelfService/Elements/GotoTicket index 28bc81b82..8d8dae07b 100755 --- a/rt/share/html/SelfService/Elements/GotoTicket +++ b/rt/share/html/SelfService/Elements/GotoTicket @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/SelfService/Elements/Header b/rt/share/html/SelfService/Elements/Header index 7cbc0ad96..1aad1a791 100755 --- a/rt/share/html/SelfService/Elements/Header +++ b/rt/share/html/SelfService/Elements/Header @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/SelfService/Elements/MyRequests b/rt/share/html/SelfService/Elements/MyRequests index 76accfc9b..b6f8f8979 100755 --- a/rt/share/html/SelfService/Elements/MyRequests +++ b/rt/share/html/SelfService/Elements/MyRequests @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/SelfService/Elements/SearchArticle b/rt/share/html/SelfService/Elements/SearchArticle index d547127b5..1d0087695 100644 --- a/rt/share/html/SelfService/Elements/SearchArticle +++ b/rt/share/html/SelfService/Elements/SearchArticle @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/SelfService/Error.html b/rt/share/html/SelfService/Error.html index 9f0c7f82e..0ee0b5d64 100755 --- a/rt/share/html/SelfService/Error.html +++ b/rt/share/html/SelfService/Error.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/SelfService/Prefs.html b/rt/share/html/SelfService/Prefs.html index ac5d725ad..6478ef206 100755 --- a/rt/share/html/SelfService/Prefs.html +++ b/rt/share/html/SelfService/Prefs.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -50,6 +50,23 @@ <& /Elements/ListActions, actions => \@results &>
+
+ + +
+<&| /Widgets/TitleBox, title => loc('Locale'), id => "user-prefs-identity" &> + + + + + + + + + +
<&|/l&>Language:<& /Elements/SelectLang, Name => 'Lang', Default => $user->Lang &>
<&|/l&>Timezone:<& /Elements/SelectTimezone, Name => 'Timezone', Default => $user->Timezone &>
+ +
<&| /Widgets/TitleBox, title => loc('Change password') &> <& /Elements/EditPassword, User => $user, @@ -57,6 +74,7 @@ &> +

<& /Elements/Submit, Label => loc('Save Changes') &> @@ -76,6 +94,29 @@ if (defined $NewPass1 && length $NewPass1 ) { push @results, loc("Password: [_1]", $msg); } +my @fields = qw( + Lang Timezone + ); + +$m->callback( + CallbackName => 'UpdateLogic', + fields => \@fields, + results => \@results, + UserObj => $user, + ARGSRef => \%ARGS, +); + +push @results, UpdateRecordObject ( + AttributesRef => \@fields, + Object => $user, + ARGSRef => \%ARGS, +); + +if ( $Lang ) { + $session{'CurrentUser'}->LanguageHandle($Lang); + $session{'CurrentUser'} = $session{'CurrentUser'}; # force writeback +} + if ($Signature) { $Signature =~ s/(\r\n|\r)/\n/g; if ($Signature ne $user->Signature) { @@ -93,4 +134,5 @@ $Signature => undef $CurrentPass => undef $NewPass1 => undef $NewPass2 => undef +$Lang => undef diff --git a/rt/share/html/SelfService/Update.html b/rt/share/html/SelfService/Update.html index 6525d3de9..cc5e496db 100755 --- a/rt/share/html/SelfService/Update.html +++ b/rt/share/html/SelfService/Update.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -51,7 +51,8 @@ % $m->callback(CallbackName => 'BeforeForm', %ARGS, ARGSRef => \%ARGS, Ticket => $Ticket ); -
+ + @@ -68,21 +69,27 @@ <&|/l&>Subject <& /Ticket/Elements/AddAttachments, %ARGS, TicketObj => $Ticket &>
- +
<& /Ticket/Elements/EditCustomFields, TicketObj => $Ticket &>
-<& /Elements/MessageBox, - Name => "UpdateContent", - QuoteTransaction => $ARGS{QuoteTransaction} - &> +% if (exists $ARGS{UpdateContent}) { +% # preserve QuoteTransaction so we can use it to set up sane references/in/reply to +% my $temp = $ARGS{'QuoteTransaction'}; +% delete $ARGS{'QuoteTransaction'}; +<& /Elements/MessageBox, Name=>"UpdateContent", Default=>$ARGS{UpdateContent}, IncludeSignature => 0, %ARGS&> +% $ARGS{'QuoteTransaction'} = $temp; +% } else { +% my $IncludeSignature = 1; +<& /Elements/MessageBox, Name=>"UpdateContent", IncludeSignature => $IncludeSignature, %ARGS &> +% }
-<& /Elements/Submit &> +<& /Elements/Submit, Label => loc('Update Ticket'), Name => 'SubmitTicket', id => 'SubmitTicket' &>
@@ -102,7 +109,12 @@ Abort( loc("No permission to view update ticket") ) unless ( $Ticket->CurrentUserHasRight('ReplyToTicket') or $Ticket->CurrentUserHasRight('ModifyTicket') ); -$m->callback(CallbackName => 'BeforeDisplay', Ticket => \$Ticket, ARGSRef => \%ARGS); +ProcessAttachments(ARGSRef => \%ARGS); + +if ( exists $ARGS{SubmitTicket} ) { + $m->callback(CallbackName => 'BeforeDisplay', Ticket => \$Ticket, ARGSRef => \%ARGS); + return $m->comp('Display.html', TicketObj => $Ticket, %ARGS); +} <%ARGS> diff --git a/rt/share/html/SelfService/index.html b/rt/share/html/SelfService/index.html index 29accf551..ab43ab950 100755 --- a/rt/share/html/SelfService/index.html +++ b/rt/share/html/SelfService/index.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) -- cgit v1.2.1