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