From 945721f48f74d5cfffef7c7cf3a3d6bc2521f5dd Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 15 Jul 2003 13:16:32 +0000 Subject: import of rt 3.0.4 --- rt/html/SelfService/Attachment/dhandler | 27 ++++++ rt/html/SelfService/Closed.html | 27 ++++++ rt/html/SelfService/Create.html | 80 ++++++++++++++++++ rt/html/SelfService/Display.html | 141 ++++++++++++++++++++++++++++++++ rt/html/SelfService/Elements/GotoTicket | 24 ++++++ rt/html/SelfService/Elements/Header | 25 ++++++ rt/html/SelfService/Elements/MyRequests | 62 ++++++++++++++ rt/html/SelfService/Elements/Tabs | 64 +++++++++++++++ rt/html/SelfService/Error.html | 46 +++++++++++ rt/html/SelfService/Prefs.html | 68 +++++++++++++++ rt/html/SelfService/Update.html | 61 ++++++++++++++ rt/html/SelfService/index.html | 26 ++++++ 12 files changed, 651 insertions(+) create mode 100644 rt/html/SelfService/Attachment/dhandler create mode 100644 rt/html/SelfService/Closed.html create mode 100644 rt/html/SelfService/Create.html create mode 100644 rt/html/SelfService/Display.html create mode 100644 rt/html/SelfService/Elements/GotoTicket create mode 100644 rt/html/SelfService/Elements/Header create mode 100644 rt/html/SelfService/Elements/MyRequests create mode 100644 rt/html/SelfService/Elements/Tabs create mode 100644 rt/html/SelfService/Error.html create mode 100644 rt/html/SelfService/Prefs.html create mode 100644 rt/html/SelfService/Update.html create mode 100644 rt/html/SelfService/index.html (limited to 'rt/html/SelfService') diff --git a/rt/html/SelfService/Attachment/dhandler b/rt/html/SelfService/Attachment/dhandler new file mode 100644 index 000000000..4bebbe565 --- /dev/null +++ b/rt/html/SelfService/Attachment/dhandler @@ -0,0 +1,27 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<%init> +$m->comp('/Ticket/Attachment/dhandler', %ARGS); +$m->abort; + diff --git a/rt/html/SelfService/Closed.html b/rt/html/SelfService/Closed.html new file mode 100644 index 000000000..b9b2ac672 --- /dev/null +++ b/rt/html/SelfService/Closed.html @@ -0,0 +1,27 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<& /SelfService/Elements/Header, Title => loc('Closed Tickets') &> + +<& /SelfService/Elements/MyRequests, status => ['rejected', 'resolved'], friendly_status => +loc('closed') &> diff --git a/rt/html/SelfService/Create.html b/rt/html/SelfService/Create.html new file mode 100644 index 000000000..7bbc88a65 --- /dev/null +++ b/rt/html/SelfService/Create.html @@ -0,0 +1,80 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<& Elements/Header, Title => loc("Create a ticket") &> + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+<&|/l&>Queue: + +<& /Elements/SelectNewTicketQueue, Verbose => 'True' &> +
+<&|/l&>Requestors: + + +
+<&|/l&>Cc: + + +
+<&|/l&>Subject: + + +
+<&|/l&>Attach file: + + +
+<&|/l&>Describe the issue below:
+<& /Elements/MessageBox &> +
+<& /Elements/Submit, Label => loc("Create ticket")&> + + +
diff --git a/rt/html/SelfService/Display.html b/rt/html/SelfService/Display.html new file mode 100644 index 000000000..fc3fcb289 --- /dev/null +++ b/rt/html/SelfService/Display.html @@ -0,0 +1,141 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<& /SelfService/Elements/Header, Title => loc('#[_1]: [_2]', $Ticket->id, $Ticket->Subject) &> + +<& /Elements/ListActions, actions => \@results &> + + + + + + +
+ <& /Elements/TitleBoxStart, title => loc('The Basics'), + title_class=> 'inverse', + color => "#993333" &> + <& /Ticket/Elements/ShowBasics, Ticket => $Ticket &> + <& /Elements/TitleBoxEnd &> + + <& /Elements/TitleBoxStart, title => loc("Dates"), + title_class=> 'inverse', + color => "#663366" &> + <& /Ticket/Elements/ShowDates, Ticket => $Ticket &> + <& /Elements/TitleBoxEnd &> +
+ + + +<& /Ticket/Elements/ShowHistory, Ticket => $Ticket&> + + + +<%INIT> + +my ( $field, @results ); + +# {{{ 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'} ); +if ( $id[0] eq 'new' ) { + + # {{{ Create a new ticket + + my $Queue = new RT::Queue( $session{'CurrentUser'} ); + unless ( $Queue->Load( $ARGS{'Queue'} ) ) { + $m->comp( 'Error.html', Why => loc('Queue not found') ); + $m->abort; + } + + unless ( $Queue->CurrentUserHasRight('CreateTicket') ) { + $m->comp( 'Error.html', + Why => + loc('You have no permission to create tickets in that queue.') ); + $m->abort; + } + + my @Requestors = split ( /\s*,\s*/, $ARGS{'Requestors'} ); + my @Cc = split ( /\s*,\s*/, $ARGS{'Cc'} ); + + my $MIMEObj = MakeMIMEEntity( Subject => $ARGS{'Subject'}, + From => $ARGS{'From'}, + Cc => $ARGS{'Cc'}, + Body => $ARGS{'Content'}, + AttachmentFieldName => 'Attach' ); + + #TODO in Create_Details.html: priorities and due-date + my ( $id, $Trans, $ErrMsg ) = $Ticket->Create( Queue => $ARGS{Queue}, + Requestor => \@Requestors, + Cc => \@Cc, + Subject => $ARGS{Subject}, + MIMEObj => $MIMEObj ); + unless ( $id && $Trans ) { + $m->comp( 'Error.html', Why => $ErrMsg ); + $m->abort(); + } + + push ( @results, $ErrMsg ); + + # }}} +} +else { + unless ( $Ticket->Load( $id[0] ) ) { + $m->comp( 'Error.html', + Why => loc( "Couldn't load ticket '[_1]'", $id ) ); + $m->abort(); + } +} + +# }}} + +unless ( $Ticket->CurrentUserHasRight('ShowTicket') ) { + $m->comp( 'Error.html', + Why => loc("No permission to display that ticket") ); + $m->abort(); +} + +my ( $code, $msg ); + +#Update the status +if ( ( defined $ARGS{'Status'} ) + and ( $ARGS{'Status'} ne $Ticket->Status ) ) { + ( $code, $msg ) = $Ticket->SetStatus( $ARGS{'Status'} ); + push @results, "$msg"; +} + +ProcessUpdateMessage( ARGSRef => \%ARGS, + Actions => \@results, + TicketObj => $Ticket ); + +my $Transactions = $Ticket->Transactions; + + + + +<%ARGS> +$id => undef + diff --git a/rt/html/SelfService/Elements/GotoTicket b/rt/html/SelfService/Elements/GotoTicket new file mode 100644 index 000000000..71da8c115 --- /dev/null +++ b/rt/html/SelfService/Elements/GotoTicket @@ -0,0 +1,24 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +
 
diff --git a/rt/html/SelfService/Elements/Header b/rt/html/SelfService/Elements/Header new file mode 100644 index 000000000..6ad137999 --- /dev/null +++ b/rt/html/SelfService/Elements/Header @@ -0,0 +1,25 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Header, %ARGS, Prefs => '/SelfService/Prefs.html' &> +<& /SelfService/Elements/Tabs, %ARGS &> diff --git a/rt/html/SelfService/Elements/MyRequests b/rt/html/SelfService/Elements/MyRequests new file mode 100644 index 000000000..95ede0811 --- /dev/null +++ b/rt/html/SelfService/Elements/MyRequests @@ -0,0 +1,62 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<& /Elements/TitleBoxStart, title => $title &> + + + + + + + +% while (my $Ticket = $MyTickets->Next) { + + + +% } +
<&|/l&>Subject<&|/l&>Status<&|/l&>Owner
+<%$Ticket->Id%>: <%$Ticket->Subject%> + +<%$Ticket->Status%> + +<%$Ticket->OwnerObj->Name%> +
+<& /Elements/TitleBoxEnd &> + + +<%INIT> +$title ||= loc("My [_1] tickets", $friendly_status); +my $MyTickets; +$MyTickets = new RT::Tickets ($session{'CurrentUser'}); +$MyTickets->LimitWatcher(TYPE => 'Requestor', VALUE => $session{'CurrentUser'}->EmailAddress); + +foreach my $status (@status) { + + $MyTickets->LimitStatus(VALUE => $status); +} + +<%ARGS> +$title => undef +$friendly_status => loc('open') +@status => ('open', 'new', 'stalled') + diff --git a/rt/html/SelfService/Elements/Tabs b/rt/html/SelfService/Elements/Tabs new file mode 100644 index 000000000..efab86676 --- /dev/null +++ b/rt/html/SelfService/Elements/Tabs @@ -0,0 +1,64 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<& /Elements/PageLayout, + current_toptab => $current_toptab, + current_tab => $current_tab, + toptabs => $tabs, + topactions => $actions, + title => $Title +&> + +<%INIT> + +if ($Title) { +$Title = loc ("RT Self Service") . " / " . $Title; +} else { +$Title = loc ("RT Self Service"); + +} +my ($tab); +my $tabs = { A => { title => loc('Open tickets'), + path => 'SelfService/', + }, + B => { title => loc('Closed tickets'), + path => 'SelfService/Closed.html', + }, + C => { title => loc('New ticket'), + path => 'SelfService/Create.html' + }, + Z => { title => loc('Preferences'), + path => 'SelfService/Prefs.html' + } + }; +my $actions = { + B => { html => $m->scomp('GotoTicket') + } + }; + +<%ARGS> +$Title => undef +$current_toptab => undef +$current_tab => undef + + diff --git a/rt/html/SelfService/Error.html b/rt/html/SelfService/Error.html new file mode 100644 index 000000000..ac93aceff --- /dev/null +++ b/rt/html/SelfService/Error.html @@ -0,0 +1,46 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<& /SelfService/Elements/Header, Title => loc('Error') &> +

<%loc('Error')%>

+<& /Elements/TitleBoxStart, title => $Title &> +<%$Why%> +
+ +<%$Details%> + +<& /Elements/TitleBoxEnd &> + + + + +<%args> +$Code => undef +$Details => undef +$Title => loc("RT Error") +$Why => loc("the calling component did not specify why") + + +<%INIT> +$RT::Logger->error("WebRT: $Why ($Details)"); + diff --git a/rt/html/SelfService/Prefs.html b/rt/html/SelfService/Prefs.html new file mode 100644 index 000000000..3bbb9b913 --- /dev/null +++ b/rt/html/SelfService/Prefs.html @@ -0,0 +1,68 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<& /SelfService/Elements/Header, Title => loc('Preferences') &> + +<& /Elements/ListActions, actions => \@results &> +
+ +% unless ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth) { +<& /Elements/TitleBoxStart, title => loc('Change password') &> +<&|/l&>New password: +<&|/l&>Confirm: +<& /Elements/TitleBoxEnd &> +
+% } +<& /Elements/Submit &> +
+ + +<%INIT> +my @results; + +if ($NewPass1) { + if ($NewPass1 ne $NewPass2) { + push (@results, "Passwords did not match."); + } + else { + my ($val, $msg)=$session{'CurrentUser'}->UserObj->SetPassword($NewPass1); + push (@results, "Password: ".$msg); + } +} +if ($Signature) { + $Signature =~ s/(\r\n|\r)/\n/g; + if ($Signature ne $session{'CurrentUser'}->UserObj->Signature) { + my ($val, $msg)=$session{'CurrentUser'}->UserObj->SetSignature($Signature); + push (@results, "Signature: ".$msg); + } +} +#A hack to make sure that session gets rewritten. + +$session{'i'}++; + + +<%ARGS> +$Signature => undef +$NewPass1 => undef +$NewPass2 => undef + diff --git a/rt/html/SelfService/Update.html b/rt/html/SelfService/Update.html new file mode 100644 index 000000000..9ff31775f --- /dev/null +++ b/rt/html/SelfService/Update.html @@ -0,0 +1,61 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<& /SelfService/Elements/Header, Title =>loc('Update ticket #[_1]', $Ticket->id) &> + + +
+ + +<&|/l&>Status: <& /Elements/SelectStatus, Name=>"Status", Default => $DefaultStatus &>
+<&|/l&>Subject:
+<&|/l&>Attach:
+<& /Elements/MessageBox, Name=>"UpdateContent", QuoteTransaction=>$ARGS{QuoteTransaction} &> +
+ + +<& /Elements/Submit &> +
+ + + +<%INIT> + +my $Ticket = LoadTicket($id); + +my $title = loc("Update ticket #[_1]", $Ticket->id); + +$DefaultStatus = $Ticket->Status() unless ($DefaultStatus); + + +Abort(loc("No permission to view update ticket")) + unless ( $Ticket->CurrentUserHasRight('ReplyToTicket') or + $Ticket->CurrentUserHasRight('ModifyTicket') ); + + + +<%ARGS> +$id => undef +$Action => undef +$DefaultStatus => undef + diff --git a/rt/html/SelfService/index.html b/rt/html/SelfService/index.html new file mode 100644 index 000000000..71dc1156e --- /dev/null +++ b/rt/html/SelfService/index.html @@ -0,0 +1,26 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<& /SelfService/Elements/Header, Title => undef &> + +<& /SelfService/Elements/MyRequests &> -- cgit v1.2.1 From 289340780927b5bac2c7604d7317c3063c6dd8cc Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 11 Mar 2004 02:05:38 +0000 Subject: import of rt 3.0.9 --- rt/html/SelfService/Display.html | 43 +++++++++++++++++++++++++++++++-- rt/html/SelfService/Elements/MyRequests | 1 + rt/html/SelfService/Update.html | 19 ++++++++++++++- 3 files changed, 60 insertions(+), 3 deletions(-) (limited to 'rt/html/SelfService') diff --git a/rt/html/SelfService/Display.html b/rt/html/SelfService/Display.html index fc3fcb289..124ecf407 100644 --- a/rt/html/SelfService/Display.html +++ b/rt/html/SelfService/Display.html @@ -38,7 +38,7 @@ <& /Elements/TitleBoxStart, title => loc("Dates"), title_class=> 'inverse', color => "#663366" &> - <& /Ticket/Elements/ShowDates, Ticket => $Ticket &> + <& /Ticket/Elements/ShowDates, Ticket => $Ticket, UpdatedLink => 0 &> <& /Elements/TitleBoxEnd &> @@ -46,7 +46,7 @@ -<& /Ticket/Elements/ShowHistory, Ticket => $Ticket&> +<& /Ticket/Elements/ShowHistory, Ticket => $Ticket, AttachPath => "Attachment" &> @@ -101,6 +101,12 @@ if ( $id[0] eq 'new' ) { push ( @results, $ErrMsg ); # }}} + +# delete temporary storage entry to make WebUI clean +unless (keys %{$session{'Attachments'}} and $ARGS{'UpdateAttach'}) { + delete $session{'Attachments'}; +} +# }}} } else { unless ( $Ticket->Load( $id[0] ) ) { @@ -127,10 +133,43 @@ if ( ( defined $ARGS{'Status'} ) push @results, "$msg"; } +# {{{ store the uploaded attachment in session +if ($ARGS{'Attach'}) { # attachment? + $session{'Attachments'} = {} unless defined $session{'Attachments'}; + + my $subject = "$ARGS{'Attach'}"; + # since CGI.pm deutf8izes the magic field, we need to add it back. + Encode::_utf8_on($subject); + # strip leading directories + $subject =~ s#^.*[\\/]##; + + my $attachment = MakeMIMEEntity( + Subject => $subject, + Body => "", + AttachmentFieldName => 'Attach' + ); + + $session{'Attachments'} = { %{$session{'Attachments'} || {}}, + $ARGS{'Attach'} => $attachment }; +} +# }}} + +if ( $session{'Attachments'} || + ( $ARGS{'UpdateContent'} ne '' + && $ARGS{'UpdateContent'} ne "-- \n" + . $session{'CurrentUser'}->UserObj->Signature )) { + $ARGS{UpdateAttachments} = $session{'Attachments'}; +} ProcessUpdateMessage( ARGSRef => \%ARGS, Actions => \@results, TicketObj => $Ticket ); +# delete temporary storage entry to make WebUI clean +unless (keys %{$session{'Attachments'}} and $ARGS{'UpdateAttach'}) { + delete $session{'Attachments'}; +} +# }}} + my $Transactions = $Ticket->Transactions; diff --git a/rt/html/SelfService/Elements/MyRequests b/rt/html/SelfService/Elements/MyRequests index 95ede0811..839359aed 100644 --- a/rt/html/SelfService/Elements/MyRequests +++ b/rt/html/SelfService/Elements/MyRequests @@ -49,6 +49,7 @@ $title ||= loc("My [_1] tickets", $friendly_status); my $MyTickets; $MyTickets = new RT::Tickets ($session{'CurrentUser'}); $MyTickets->LimitWatcher(TYPE => 'Requestor', VALUE => $session{'CurrentUser'}->EmailAddress); +$MyTickets->OrderBy(FIELD => 'id', ORDER => 'ASC'); foreach my $status (@status) { diff --git a/rt/html/SelfService/Update.html b/rt/html/SelfService/Update.html index 9ff31775f..9444aa706 100644 --- a/rt/html/SelfService/Update.html +++ b/rt/html/SelfService/Update.html @@ -29,7 +29,24 @@ <&|/l&>Status: <& /Elements/SelectStatus, Name=>"Status", Default => $DefaultStatus &>
<&|/l&>Subject:
-<&|/l&>Attach:
+ + +% if (exists $session{'Attachments'}) { + + + + +% } # end of if + +
+<&|/l&>Attached file: + +<&|/l&>Check box to delete
+% foreach my $attach_name (keys %{$session{'Attachments'}}) { +<%$attach_name%>
+% } # end of foreach +
<&|/l&>Attach: +
<& /Elements/MessageBox, Name=>"UpdateContent", QuoteTransaction=>$ARGS{QuoteTransaction} &>
-- cgit v1.2.1 From c582e92888b4a5553e1b4e5214cf35217e4a0cf0 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 11 Nov 2004 12:13:50 +0000 Subject: import rt 3.0.12 --- rt/html/SelfService/Display.html | 8 +++++++- rt/html/SelfService/Prefs.html | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'rt/html/SelfService') diff --git a/rt/html/SelfService/Display.html b/rt/html/SelfService/Display.html index 124ecf407..d4e46a23b 100644 --- a/rt/html/SelfService/Display.html +++ b/rt/html/SelfService/Display.html @@ -46,7 +46,9 @@ -<& /Ticket/Elements/ShowHistory, Ticket => $Ticket, AttachPath => "Attachment" &> +%#!!pape: selfservice_find_attachments.patch {{ +<& /Ticket/Elements/ShowHistory, Ticket => $Ticket, AttachPath => "Attachment", Attachments => $attachments, UpdatePath => "Update.html" &> +%#!!pape: selfservice_find_attachments.patch }} @@ -172,6 +174,10 @@ unless (keys %{$session{'Attachments'}} and $ARGS{'UpdateAttach'}) { my $Transactions = $Ticket->Transactions; +#!!pape: selfservice_find_attachments.patch {{ +my $attachments = $m->comp('/Ticket/Elements/FindAttachments', Ticket => $Ticket); +#!!pape: selfservice_find_attachments.patch }} + diff --git a/rt/html/SelfService/Prefs.html b/rt/html/SelfService/Prefs.html index 3bbb9b913..70dc73fed 100644 --- a/rt/html/SelfService/Prefs.html +++ b/rt/html/SelfService/Prefs.html @@ -33,7 +33,7 @@ <& /Elements/TitleBoxEnd &>
% } -<& /Elements/Submit &> +<& /Elements/Submit, Label => loc('Save Changes') &> -- cgit v1.2.1 From d39d52aac8f38ea9115628039f0df5aa3ac826de Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 3 Dec 2004 20:40:48 +0000 Subject: import rt 3.2.2 --- rt/html/SelfService/Attachment/dhandler | 38 ++++++++++++++++++++++------ rt/html/SelfService/Closed.html | 38 ++++++++++++++++++++++------ rt/html/SelfService/Create.html | 38 ++++++++++++++++++++++------ rt/html/SelfService/Display.html | 44 ++++++++++++++++++++++++--------- rt/html/SelfService/Elements/GotoTicket | 38 ++++++++++++++++++++++------ rt/html/SelfService/Elements/Header | 38 ++++++++++++++++++++++------ rt/html/SelfService/Elements/MyRequests | 38 ++++++++++++++++++++++------ rt/html/SelfService/Elements/Tabs | 38 ++++++++++++++++++++++------ rt/html/SelfService/Error.html | 38 ++++++++++++++++++++++------ rt/html/SelfService/Prefs.html | 38 ++++++++++++++++++++++------ rt/html/SelfService/Update.html | 40 +++++++++++++++++++++++------- rt/html/SelfService/index.html | 38 ++++++++++++++++++++++------ 12 files changed, 364 insertions(+), 100 deletions(-) (limited to 'rt/html/SelfService') diff --git a/rt/html/SelfService/Attachment/dhandler b/rt/html/SelfService/Attachment/dhandler index 4bebbe565..698e345d3 100644 --- a/rt/html/SelfService/Attachment/dhandler +++ b/rt/html/SelfService/Attachment/dhandler @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK +%# {{{ BEGIN BPS TAGGED BLOCK %# -%# Copyright (c) 1996-2003 Jesse Vincent +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# %# -%# (Except where explictly superceded by other copyright notices) +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have @@ -14,13 +20,29 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) %# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. %# -%# END LICENSE BLOCK +%# }}} END BPS TAGGED BLOCK <%init> $m->comp('/Ticket/Attachment/dhandler', %ARGS); $m->abort; diff --git a/rt/html/SelfService/Closed.html b/rt/html/SelfService/Closed.html index b9b2ac672..515879eeb 100644 --- a/rt/html/SelfService/Closed.html +++ b/rt/html/SelfService/Closed.html @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK +%# {{{ BEGIN BPS TAGGED BLOCK %# -%# Copyright (c) 1996-2003 Jesse Vincent +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# %# -%# (Except where explictly superceded by other copyright notices) +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have @@ -14,13 +20,29 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) %# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. %# -%# END LICENSE BLOCK +%# }}} END BPS TAGGED BLOCK <& /SelfService/Elements/Header, Title => loc('Closed Tickets') &> <& /SelfService/Elements/MyRequests, status => ['rejected', 'resolved'], friendly_status => diff --git a/rt/html/SelfService/Create.html b/rt/html/SelfService/Create.html index 7bbc88a65..a2cfd9fee 100644 --- a/rt/html/SelfService/Create.html +++ b/rt/html/SelfService/Create.html @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK +%# {{{ BEGIN BPS TAGGED BLOCK %# -%# Copyright (c) 1996-2003 Jesse Vincent +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# %# -%# (Except where explictly superceded by other copyright notices) +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have @@ -14,13 +20,29 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) %# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. %# -%# END LICENSE BLOCK +%# }}} END BPS TAGGED BLOCK <& Elements/Header, Title => loc("Create a ticket") &>
diff --git a/rt/html/SelfService/Display.html b/rt/html/SelfService/Display.html index d4e46a23b..a94593e32 100644 --- a/rt/html/SelfService/Display.html +++ b/rt/html/SelfService/Display.html @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK +%# {{{ BEGIN BPS TAGGED BLOCK %# -%# Copyright (c) 1996-2003 Jesse Vincent +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# %# -%# (Except where explictly superceded by other copyright notices) +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have @@ -14,27 +20,43 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) %# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. %# -%# END LICENSE BLOCK +%# }}} END BPS TAGGED BLOCK <& /SelfService/Elements/Header, Title => loc('#[_1]: [_2]', $Ticket->id, $Ticket->Subject) &> <& /Elements/ListActions, actions => \@results &> - -
+ <& /Elements/TitleBoxStart, title => loc('The Basics'), title_class=> 'inverse', color => "#993333" &> <& /Ticket/Elements/ShowBasics, Ticket => $Ticket &> <& /Elements/TitleBoxEnd &> + <& /Elements/TitleBoxStart, title => loc("Dates"), title_class=> 'inverse', color => "#663366" &> @@ -129,7 +151,7 @@ unless ( $Ticket->CurrentUserHasRight('ShowTicket') ) { my ( $code, $msg ); #Update the status -if ( ( defined $ARGS{'Status'} ) +if ( ( defined $ARGS{'Status'} ) and $ARGS{'Status'} and ( $ARGS{'Status'} ne $Ticket->Status ) ) { ( $code, $msg ) = $Ticket->SetStatus( $ARGS{'Status'} ); push @results, "$msg"; diff --git a/rt/html/SelfService/Elements/GotoTicket b/rt/html/SelfService/Elements/GotoTicket index 71da8c115..265d69874 100644 --- a/rt/html/SelfService/Elements/GotoTicket +++ b/rt/html/SelfService/Elements/GotoTicket @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK +%# {{{ BEGIN BPS TAGGED BLOCK %# -%# Copyright (c) 1996-2003 Jesse Vincent +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# %# -%# (Except where explictly superceded by other copyright notices) +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have @@ -14,11 +20,27 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) %# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. %# -%# END LICENSE BLOCK +%# }}} END BPS TAGGED BLOCK   diff --git a/rt/html/SelfService/Elements/Header b/rt/html/SelfService/Elements/Header index 6ad137999..6fe2133ea 100644 --- a/rt/html/SelfService/Elements/Header +++ b/rt/html/SelfService/Elements/Header @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK +%# {{{ BEGIN BPS TAGGED BLOCK %# -%# Copyright (c) 1996-2003 Jesse Vincent +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# %# -%# (Except where explictly superceded by other copyright notices) +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have @@ -14,12 +20,28 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) %# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. %# -%# END LICENSE BLOCK +%# }}} END BPS TAGGED BLOCK <& /Elements/Header, %ARGS, Prefs => '/SelfService/Prefs.html' &> <& /SelfService/Elements/Tabs, %ARGS &> diff --git a/rt/html/SelfService/Elements/MyRequests b/rt/html/SelfService/Elements/MyRequests index 839359aed..026722a7f 100644 --- a/rt/html/SelfService/Elements/MyRequests +++ b/rt/html/SelfService/Elements/MyRequests @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK +%# {{{ BEGIN BPS TAGGED BLOCK %# -%# Copyright (c) 1996-2003 Jesse Vincent +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# %# -%# (Except where explictly superceded by other copyright notices) +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have @@ -14,13 +20,29 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) %# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. %# -%# END LICENSE BLOCK +%# }}} END BPS TAGGED BLOCK <& /Elements/TitleBoxStart, title => $title &> diff --git a/rt/html/SelfService/Elements/Tabs b/rt/html/SelfService/Elements/Tabs index efab86676..dbe2109ce 100644 --- a/rt/html/SelfService/Elements/Tabs +++ b/rt/html/SelfService/Elements/Tabs @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK +%# {{{ BEGIN BPS TAGGED BLOCK %# -%# Copyright (c) 1996-2003 Jesse Vincent +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# %# -%# (Except where explictly superceded by other copyright notices) +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have @@ -14,13 +20,29 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) %# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. %# -%# END LICENSE BLOCK +%# }}} END BPS TAGGED BLOCK <& /Elements/PageLayout, current_toptab => $current_toptab, current_tab => $current_tab, diff --git a/rt/html/SelfService/Error.html b/rt/html/SelfService/Error.html index ac93aceff..b4cddee4f 100644 --- a/rt/html/SelfService/Error.html +++ b/rt/html/SelfService/Error.html @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK +%# {{{ BEGIN BPS TAGGED BLOCK %# -%# Copyright (c) 1996-2003 Jesse Vincent +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# %# -%# (Except where explictly superceded by other copyright notices) +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have @@ -14,13 +20,29 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) %# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. %# -%# END LICENSE BLOCK +%# }}} END BPS TAGGED BLOCK <& /SelfService/Elements/Header, Title => loc('Error') &>

<%loc('Error')%>

<& /Elements/TitleBoxStart, title => $Title &> diff --git a/rt/html/SelfService/Prefs.html b/rt/html/SelfService/Prefs.html index 70dc73fed..ce2165e22 100644 --- a/rt/html/SelfService/Prefs.html +++ b/rt/html/SelfService/Prefs.html @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK +%# {{{ BEGIN BPS TAGGED BLOCK %# -%# Copyright (c) 1996-2003 Jesse Vincent +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# %# -%# (Except where explictly superceded by other copyright notices) +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have @@ -14,13 +20,29 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) %# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. %# -%# END LICENSE BLOCK +%# }}} END BPS TAGGED BLOCK <& /SelfService/Elements/Header, Title => loc('Preferences') &> <& /Elements/ListActions, actions => \@results &> diff --git a/rt/html/SelfService/Update.html b/rt/html/SelfService/Update.html index 9444aa706..ef37684c9 100644 --- a/rt/html/SelfService/Update.html +++ b/rt/html/SelfService/Update.html @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK +%# {{{ BEGIN BPS TAGGED BLOCK %# -%# Copyright (c) 1996-2003 Jesse Vincent +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# %# -%# (Except where explictly superceded by other copyright notices) +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have @@ -14,20 +20,36 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) %# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. %# -%# END LICENSE BLOCK +%# }}} END BPS TAGGED BLOCK <& /SelfService/Elements/Header, Title =>loc('Update ticket #[_1]', $Ticket->id) &>
-<&|/l&>Status: <& /Elements/SelectStatus, Name=>"Status", Default => $DefaultStatus &>
+<&|/l&>Status: <& /Elements/SelectStatus, Name=>"Status", DefaultLabel => loc("[_1] (Unchanged)",$DefaultStatus) &>
<&|/l&>Subject:
diff --git a/rt/html/SelfService/index.html b/rt/html/SelfService/index.html index 71dc1156e..234568c81 100644 --- a/rt/html/SelfService/index.html +++ b/rt/html/SelfService/index.html @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK +%# {{{ BEGIN BPS TAGGED BLOCK %# -%# Copyright (c) 1996-2003 Jesse Vincent +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# %# -%# (Except where explictly superceded by other copyright notices) +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have @@ -14,13 +20,29 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) %# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. %# -%# END LICENSE BLOCK +%# }}} END BPS TAGGED BLOCK <& /SelfService/Elements/Header, Title => undef &> <& /SelfService/Elements/MyRequests &> -- cgit v1.2.1 From d4d0590bef31071e8809ec046717444b95b3f30a Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 15 Oct 2005 09:11:20 +0000 Subject: import rt 3.4.4 --- rt/html/SelfService/Attachment/dhandler | 6 +- rt/html/SelfService/Closed.html | 8 +- rt/html/SelfService/Create.html | 47 ++++--- rt/html/SelfService/CreateTicketInQueue.html | 61 +++++++++ rt/html/SelfService/Display.html | 183 ++++++++++++++------------- rt/html/SelfService/Elements/GotoTicket | 6 +- rt/html/SelfService/Elements/Header | 6 +- rt/html/SelfService/Elements/MyRequests | 8 +- rt/html/SelfService/Elements/Tabs | 18 ++- rt/html/SelfService/Error.html | 6 +- rt/html/SelfService/Prefs.html | 6 +- rt/html/SelfService/Update.html | 75 +++++++---- rt/html/SelfService/index.html | 6 +- 13 files changed, 276 insertions(+), 160 deletions(-) create mode 100755 rt/html/SelfService/CreateTicketInQueue.html (limited to 'rt/html/SelfService') diff --git a/rt/html/SelfService/Attachment/dhandler b/rt/html/SelfService/Attachment/dhandler index 698e345d3..f953c2486 100644 --- a/rt/html/SelfService/Attachment/dhandler +++ b/rt/html/SelfService/Attachment/dhandler @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%init> $m->comp('/Ticket/Attachment/dhandler', %ARGS); $m->abort; diff --git a/rt/html/SelfService/Closed.html b/rt/html/SelfService/Closed.html index 515879eeb..2d49a6897 100644 --- a/rt/html/SelfService/Closed.html +++ b/rt/html/SelfService/Closed.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,8 +42,8 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -<& /SelfService/Elements/Header, Title => loc('Closed Tickets') &> +%# END BPS TAGGED BLOCK }}} +<& /SelfService/Elements/Header, Title => loc('Closed tickets') &> <& /SelfService/Elements/MyRequests, status => ['rejected', 'resolved'], friendly_status => loc('closed') &> diff --git a/rt/html/SelfService/Create.html b/rt/html/SelfService/Create.html index a2cfd9fee..d60ae267a 100644 --- a/rt/html/SelfService/Create.html +++ b/rt/html/SelfService/Create.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& Elements/Header, Title => loc("Create a ticket") &> @@ -50,43 +50,49 @@
- - + - - - - - - - - + + + + - @@ -100,3 +106,10 @@ +<%args> +$Queue => undef + +<%init> +my $queue_obj = RT::Queue->new($session{'CurrentUser'}); +$queue_obj->Load($Queue); + diff --git a/rt/html/SelfService/CreateTicketInQueue.html b/rt/html/SelfService/CreateTicketInQueue.html new file mode 100755 index 000000000..5e8973610 --- /dev/null +++ b/rt/html/SelfService/CreateTicketInQueue.html @@ -0,0 +1,61 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& Elements/Header, Title => loc("Create a ticket") &> + +

<&|/l&>Select a queue for your new ticket

+ +
+% while (my $queue = $queues->Next) { +% next unless $queue->CurrentUserHasRight('CreateTicket'); + +
<%$queue->Name%>
+
<%$queue->Description%>
+% } +
+<%init> +my $queues = RT::Queues->new($session{'CurrentUser'}); +$queues->UnLimit; + diff --git a/rt/html/SelfService/Display.html b/rt/html/SelfService/Display.html index a94593e32..f7140df02 100644 --- a/rt/html/SelfService/Display.html +++ b/rt/html/SelfService/Display.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /SelfService/Elements/Header, Title => loc('#[_1]: [_2]', $Ticket->id, $Ticket->Subject) &> <& /Elements/ListActions, actions => \@results &> @@ -54,6 +54,7 @@ title_class=> 'inverse', color => "#993333" &> <& /Ticket/Elements/ShowBasics, Ticket => $Ticket &> + <& /Ticket/Elements/ShowCustomFields, Ticket => $Ticket &> <& /Elements/TitleBoxEnd &>
+ <&|/l&>Queue: - -<& /Elements/SelectNewTicketQueue, Verbose => 'True' &> + + + <%$queue_obj->Name%> (<%$queue_obj->Description%>)
+ <&|/l&>Requestors: +
+ <&|/l&>Cc: +
+ <&|/l&>Subject: +
+
+ <& /Ticket/Elements/EditCustomFields, QueueObj => $queue_obj &> +
<&|/l&>Attach file: - + +
@@ -69,7 +70,14 @@ %#!!pape: selfservice_find_attachments.patch {{ -<& /Ticket/Elements/ShowHistory, Ticket => $Ticket, AttachPath => "Attachment", Attachments => $attachments, UpdatePath => "Update.html" &> +<& /Ticket/Elements/ShowHistory, + Ticket => $Ticket, + URIFile => "Display.html", + ShowHeaders => $ARGS{'ShowHeaders'}, + AttachPath => "Attachment", + Attachments => $attachments, + UpdatePath => "Update.html" +&> %#!!pape: selfservice_find_attachments.patch }} @@ -85,6 +93,30 @@ my ( $field, @results ); my @id = ( ref $id eq 'ARRAY' ) ? @{$id} : ($id); my $Ticket = new RT::Ticket( $session{'CurrentUser'} ); + +# store the uploaded attachment in session +if ( $ARGS{'Attach'} ) { # attachment? + $session{'Attachments'} = {} unless defined $session{'Attachments'}; + + my $subject = "$ARGS{'Attach'}"; + + # since CGI.pm deutf8izes the magic field, we need to add it back. + Encode::_utf8_on($subject); + + # strip leading directories + $subject =~ s#^.*[\\/]##; + + my $attachment = MakeMIMEEntity( + Subject => $subject, + Body => "", + AttachmentFieldName => 'Attach' + ); + + $session{'Attachments'} = + { %{ $session{'Attachments'} || {} }, + $ARGS{'Attach'} => $attachment }; +} + if ( $id[0] eq 'new' ) { # {{{ Create a new ticket @@ -97,108 +129,87 @@ if ( $id[0] eq 'new' ) { unless ( $Queue->CurrentUserHasRight('CreateTicket') ) { $m->comp( 'Error.html', - Why => - loc('You have no permission to create tickets in that queue.') ); + Why => + loc('You have no permission to create tickets in that queue.') ); $m->abort; } - my @Requestors = split ( /\s*,\s*/, $ARGS{'Requestors'} ); - my @Cc = split ( /\s*,\s*/, $ARGS{'Cc'} ); - - my $MIMEObj = MakeMIMEEntity( Subject => $ARGS{'Subject'}, - From => $ARGS{'From'}, - Cc => $ARGS{'Cc'}, - Body => $ARGS{'Content'}, - AttachmentFieldName => 'Attach' ); - - #TODO in Create_Details.html: priorities and due-date - my ( $id, $Trans, $ErrMsg ) = $Ticket->Create( Queue => $ARGS{Queue}, - Requestor => \@Requestors, - Cc => \@Cc, - Subject => $ARGS{Subject}, - MIMEObj => $MIMEObj ); - unless ( $id && $Trans ) { - $m->comp( 'Error.html', Why => $ErrMsg ); - $m->abort(); - } - push ( @results, $ErrMsg ); + ( $Ticket, @results ) = + CreateTicket( Attachments => $session{'Attachments'}, %ARGS, Status => 'new' ); + + 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] ) ) { + $m->comp( 'Error.html', + Why => loc( "Couldn't load ticket '[_1]'", $id ) ); + $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] ) ) { + unless ( $Ticket->CurrentUserHasRight('ShowTicket') ) { $m->comp( 'Error.html', - Why => loc( "Couldn't load ticket '[_1]'", $id ) ); + Why => loc("No permission to display that ticket") ); $m->abort(); } -} -# }}} + my ( $code, $msg ); -unless ( $Ticket->CurrentUserHasRight('ShowTicket') ) { - $m->comp( 'Error.html', - Why => loc("No permission to display that ticket") ); - $m->abort(); -} - -my ( $code, $msg ); - -#Update the status -if ( ( defined $ARGS{'Status'} ) and $ARGS{'Status'} - and ( $ARGS{'Status'} ne $Ticket->Status ) ) { - ( $code, $msg ) = $Ticket->SetStatus( $ARGS{'Status'} ); - push @results, "$msg"; -} - -# {{{ store the uploaded attachment in session -if ($ARGS{'Attach'}) { # attachment? - $session{'Attachments'} = {} unless defined $session{'Attachments'}; + #Update the status + if ( ( defined $ARGS{'Status'} ) + and $ARGS{'Status'} + and ( $ARGS{'Status'} ne $Ticket->Status ) ) + { + ( $code, $msg ) = $Ticket->SetStatus( $ARGS{'Status'} ); + push @results, "$msg"; + } - my $subject = "$ARGS{'Attach'}"; - # since CGI.pm deutf8izes the magic field, we need to add it back. - Encode::_utf8_on($subject); - # strip leading directories - $subject =~ s#^.*[\\/]##; + # }}} - my $attachment = MakeMIMEEntity( - Subject => $subject, - Body => "", - AttachmentFieldName => 'Attach' + if ( + $session{'Attachments'} + || ( $ARGS{'UpdateContent'} ne '' + && $ARGS{'UpdateContent'} ne "-- \n" + . $session{'CurrentUser'}->UserObj->Signature ) + ) + { + $ARGS{UpdateAttachments} = $session{'Attachments'}; + } + ProcessUpdateMessage( + ARGSRef => \%ARGS, + Actions => \@results, + TicketObj => $Ticket ); - $session{'Attachments'} = { %{$session{'Attachments'} || {}}, - $ARGS{'Attach'} => $attachment }; -} -# }}} + # delete temporary storage entry to make WebUI clean + unless ( keys %{ $session{'Attachments'} } and $ARGS{'UpdateAttach'} ) { + delete $session{'Attachments'}; + } -if ( $session{'Attachments'} || - ( $ARGS{'UpdateContent'} ne '' - && $ARGS{'UpdateContent'} ne "-- \n" - . $session{'CurrentUser'}->UserObj->Signature )) { - $ARGS{UpdateAttachments} = $session{'Attachments'}; -} -ProcessUpdateMessage( ARGSRef => \%ARGS, - Actions => \@results, - TicketObj => $Ticket ); + my @cfupdates = ProcessObjectCustomFieldUpdates(Object => $Ticket, ARGSRef => \%ARGS); + push (@results, @cfupdates); -# delete temporary storage entry to make WebUI clean -unless (keys %{$session{'Attachments'}} and $ARGS{'UpdateAttach'}) { - delete $session{'Attachments'}; -} -# }}} + # }}} -my $Transactions = $Ticket->Transactions; + my $Transactions = $Ticket->Transactions; -#!!pape: selfservice_find_attachments.patch {{ -my $attachments = $m->comp('/Ticket/Elements/FindAttachments', Ticket => $Ticket); -#!!pape: selfservice_find_attachments.patch }} + my $attachments = + $m->comp( '/Ticket/Elements/FindAttachments', Ticket => $Ticket ); diff --git a/rt/html/SelfService/Elements/GotoTicket b/rt/html/SelfService/Elements/GotoTicket index 265d69874..50efaa24e 100644 --- a/rt/html/SelfService/Elements/GotoTicket +++ b/rt/html/SelfService/Elements/GotoTicket @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,5 +42,5 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}}
 
diff --git a/rt/html/SelfService/Elements/Header b/rt/html/SelfService/Elements/Header index 6fe2133ea..c7e6a9167 100644 --- a/rt/html/SelfService/Elements/Header +++ b/rt/html/SelfService/Elements/Header @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,6 +42,6 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, %ARGS, Prefs => '/SelfService/Prefs.html' &> <& /SelfService/Elements/Tabs, %ARGS &> diff --git a/rt/html/SelfService/Elements/MyRequests b/rt/html/SelfService/Elements/MyRequests index 026722a7f..2df8ce842 100644 --- a/rt/html/SelfService/Elements/MyRequests +++ b/rt/html/SelfService/Elements/MyRequests @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/TitleBoxStart, title => $title &> @@ -57,7 +57,7 @@ <%$Ticket->Id%>: <%$Ticket->Subject%> diff --git a/rt/html/SelfService/Elements/Tabs b/rt/html/SelfService/Elements/Tabs index dbe2109ce..802fd6525 100644 --- a/rt/html/SelfService/Elements/Tabs +++ b/rt/html/SelfService/Elements/Tabs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/PageLayout, current_toptab => $current_toptab, current_tab => $current_tab, @@ -67,12 +67,16 @@ my $tabs = { A => { title => loc('Open tickets'), path => 'SelfService/Closed.html', }, C => { title => loc('New ticket'), - path => 'SelfService/Create.html' - }, - Z => { title => loc('Preferences'), - path => 'SelfService/Prefs.html' + path => 'SelfService/CreateTicketInQueue.html' } }; +if ($session{'CurrentUser'}->HasRight( Right => 'ModifySelf', + Object => $RT::System )) { + $tabs->{Z} = { title => loc('Preferences'), + path => 'SelfService/Prefs.html' + }; +} + my $actions = { B => { html => $m->scomp('GotoTicket') } diff --git a/rt/html/SelfService/Error.html b/rt/html/SelfService/Error.html index b4cddee4f..8ac9f81ea 100644 --- a/rt/html/SelfService/Error.html +++ b/rt/html/SelfService/Error.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /SelfService/Elements/Header, Title => loc('Error') &>

<%loc('Error')%>

<& /Elements/TitleBoxStart, title => $Title &> diff --git a/rt/html/SelfService/Prefs.html b/rt/html/SelfService/Prefs.html index ce2165e22..3913203fb 100644 --- a/rt/html/SelfService/Prefs.html +++ b/rt/html/SelfService/Prefs.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /SelfService/Elements/Header, Title => loc('Preferences') &> <& /Elements/ListActions, actions => \@results &> diff --git a/rt/html/SelfService/Update.html b/rt/html/SelfService/Update.html index ef37684c9..816a610aa 100644 --- a/rt/html/SelfService/Update.html +++ b/rt/html/SelfService/Update.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,35 +42,62 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -<& /SelfService/Elements/Header, Title =>loc('Update ticket #[_1]', $Ticket->id) &> +%# END BPS TAGGED BLOCK }}} +<& /SelfService/Elements/Header, + Title =>loc('Update ticket #[_1]', $Ticket->id) +&>
- -<&|/l&>Status: <& /Elements/SelectStatus, Name=>"Status", DefaultLabel => loc("[_1] (Unchanged)",$DefaultStatus) &>
-<&|/l&>Subject:
+
-<%$Ticket->Status%> +<%loc($Ticket->Status)%> <%$Ticket->OwnerObj->Name%>
- + + + + + + + + + % if (exists $session{'Attachments'}) { - - + + + - % } # end of if - + + + +
+ <&|/l&>Status + + <& /Elements/SelectStatus, Name=>"Status", DefaultLabel => loc("[_1] (Unchanged)",loc($DefaultStatus)) &> +
+ <&|/l&>Subject + + +
-<&|/l&>Attached file: - -<&|/l&>Check box to delete
+
+ <&|/l&>Attached file + + <&|/l&>Check box to delete
% foreach my $attach_name (keys %{$session{'Attachments'}}) { -<%$attach_name%>
+ <%$attach_name%>
% } # end of foreach -
<&|/l&>Attach: -
+ <&|/l&>Attach + + + +
-<& /Elements/MessageBox, Name=>"UpdateContent", QuoteTransaction=>$ARGS{QuoteTransaction} &> -
+<& /Ticket/Elements/EditCustomFields, TicketObj => $Ticket &> +<& /Elements/MessageBox, + Name => "UpdateContent", + QuoteTransaction => $ARGS{QuoteTransaction} + &> +
<& /Elements/Submit &> @@ -82,14 +109,14 @@ my $Ticket = LoadTicket($id); -my $title = loc("Update ticket #[_1]", $Ticket->id); +my $title = loc( "Update ticket #[_1]", $Ticket->id ); $DefaultStatus = $Ticket->Status() unless ($DefaultStatus); -Abort(loc("No permission to view update ticket")) - unless ( $Ticket->CurrentUserHasRight('ReplyToTicket') or - $Ticket->CurrentUserHasRight('ModifyTicket') ); +Abort( loc("No permission to view update ticket") ) + unless ( $Ticket->CurrentUserHasRight('ReplyToTicket') + or $Ticket->CurrentUserHasRight('ModifyTicket') ); diff --git a/rt/html/SelfService/index.html b/rt/html/SelfService/index.html index 234568c81..f3ccb8555 100644 --- a/rt/html/SelfService/index.html +++ b/rt/html/SelfService/index.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /SelfService/Elements/Header, Title => undef &> <& /SelfService/Elements/MyRequests &> -- cgit v1.2.1