From 43a06151e47d2c59b833cbd8c26d97865ee850b6 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 7 Jun 2012 00:56:06 -0700 Subject: starting to work... --- rt/share/html/SelfService/Attachment/dhandler | 2 +- rt/share/html/SelfService/Closed.html | 4 +- rt/share/html/SelfService/Create.html | 6 +- rt/share/html/SelfService/CreateTicketInQueue.html | 2 +- rt/share/html/SelfService/Display.html | 18 ++-- rt/share/html/SelfService/Elements/GotoTicket | 6 +- rt/share/html/SelfService/Elements/Header | 6 +- rt/share/html/SelfService/Elements/MyRequests | 2 +- rt/share/html/SelfService/Elements/Tabs | 113 --------------------- rt/share/html/SelfService/Error.html | 2 +- rt/share/html/SelfService/Prefs.html | 2 +- rt/share/html/SelfService/Update.html | 31 +----- rt/share/html/SelfService/index.html | 2 +- 13 files changed, 28 insertions(+), 168 deletions(-) delete mode 100755 rt/share/html/SelfService/Elements/Tabs (limited to 'rt/share/html/SelfService') diff --git a/rt/share/html/SelfService/Attachment/dhandler b/rt/share/html/SelfService/Attachment/dhandler index ebe44f9ed..e3381a981 100755 --- a/rt/share/html/SelfService/Attachment/dhandler +++ b/rt/share/html/SelfService/Attachment/dhandler @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/SelfService/Closed.html b/rt/share/html/SelfService/Closed.html index 268a2264e..6fd6e8328 100755 --- a/rt/share/html/SelfService/Closed.html +++ b/rt/share/html/SelfService/Closed.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -49,7 +49,7 @@ <& /SelfService/Elements/MyRequests, %ARGS, - status => ['rejected', 'resolved'], + status => [ RT::Queue->InactiveStatusArray ], friendly_status => loc('closed'), BaseURL => RT->Config->Get('WebPath') ."/SelfService/Closed.html?", Page => $Page, diff --git a/rt/share/html/SelfService/Create.html b/rt/share/html/SelfService/Create.html index 56ef79fc3..e28ab0f57 100755 --- a/rt/share/html/SelfService/Create.html +++ b/rt/share/html/SelfService/Create.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -51,14 +51,14 @@
- +
<% $m->callback( CallbackName => 'AfterQueue', %ARGS, QueueObj => $queue_obj ) %> diff --git a/rt/share/html/SelfService/CreateTicketInQueue.html b/rt/share/html/SelfService/CreateTicketInQueue.html index 4707e831c..887c32e35 100755 --- a/rt/share/html/SelfService/CreateTicketInQueue.html +++ b/rt/share/html/SelfService/CreateTicketInQueue.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/SelfService/Display.html b/rt/share/html/SelfService/Display.html index 4f227b18a..23c74672a 100755 --- a/rt/share/html/SelfService/Display.html +++ b/rt/share/html/SelfService/Display.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -74,7 +74,6 @@ -%#!!pape: selfservice_find_attachments.patch {{ <& /Ticket/Elements/ShowHistory, Ticket => $Ticket, URIFile => "Display.html", @@ -84,7 +83,6 @@ Attachments => $attachments, UpdatePath => "Update.html" &> -%#!!pape: selfservice_find_attachments.patch }} @@ -94,16 +92,16 @@ my ( $field, @results ); $m->callback( ARGSRef => \%ARGS, CallbackName => 'Initial' ); -# {{{ Load the ticket +# Load the ticket #If we get handed two ids, mason will make them an array. bleck. # We want teh first one. Just because there's no other sensible way # to deal my @id = ( ref $id eq 'ARRAY' ) ? @{$id} : ($id); -my $Ticket = new RT::Ticket( $session{'CurrentUser'} ); +my $Ticket = RT::Ticket->new( $session{'CurrentUser'} ); # store the uploaded attachment in session -if ( $ARGS{'Attach'} ) { # attachment? +if ( defined $ARGS{'Attach'} && length $ARGS{'Attach'} ) { # attachment? $session{'Attachments'} = {} unless defined $session{'Attachments'}; my $attachment = MakeMIMEEntity( @@ -121,7 +119,7 @@ if ( defined ($id[0]) && $id[0] eq 'new' ) { # {{{ Create a new ticket - my $Queue = new RT::Queue( $session{'CurrentUser'} ); + my $Queue = RT::Queue->new( $session{'CurrentUser'} ); unless ( $Queue->Load( $ARGS{'Queue'} ) ) { $m->comp( 'Error.html', Why => loc('Queue not found') ); $m->abort; @@ -136,21 +134,19 @@ if ( defined ($id[0]) && $id[0] eq 'new' ) { ( $Ticket, @results ) = - CreateTicket( Attachments => $session{'Attachments'}, %ARGS, Status => 'new' ); + CreateTicket( Attachments => $session{'Attachments'}, %ARGS ); unless ( $Ticket->id ) { $m->comp( 'Error.html', Why => join( "\n", @results )); $m->abort(); } - # }}} # delete temporary storage entry to make WebUI clean unless ( keys %{ $session{'Attachments'} } and $ARGS{'UpdateAttach'} ) { delete $session{'Attachments'}; } - # }}} } else { unless ( $Ticket->Load( $id[0] ) ) { @@ -186,7 +182,6 @@ if ( defined ($id[0]) && $id[0] eq 'new' ) { my @cfupdates = ProcessObjectCustomFieldUpdates(Object => $Ticket, ARGSRef => \%ARGS); push (@results, @cfupdates); - # }}} #Update the status if ( ( defined $ARGS{'Status'} ) @@ -196,7 +191,6 @@ if ( defined ($id[0]) && $id[0] eq 'new' ) { ( $code, $msg ) = $Ticket->SetStatus( $ARGS{'Status'} ); push @results, "$msg"; } - # }}} } diff --git a/rt/share/html/SelfService/Elements/GotoTicket b/rt/share/html/SelfService/Elements/GotoTicket index 45fc4d9a9..28bc81b82 100755 --- a/rt/share/html/SelfService/Elements/GotoTicket +++ b/rt/share/html/SelfService/Elements/GotoTicket @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -45,6 +45,6 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} - -  + + diff --git a/rt/share/html/SelfService/Elements/Header b/rt/share/html/SelfService/Elements/Header index dc59ecb5e..7cbc0ad96 100755 --- a/rt/share/html/SelfService/Elements/Header +++ b/rt/share/html/SelfService/Elements/Header @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -45,5 +45,5 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<& /Elements/Header, %ARGS, Prefs => '/SelfService/Prefs.html' &> -<& /SelfService/Elements/Tabs, %ARGS &> +<& /Elements/Header, %ARGS &> +<& /Elements/Tabs &> diff --git a/rt/share/html/SelfService/Elements/MyRequests b/rt/share/html/SelfService/Elements/MyRequests index 8bca07607..549d45839 100755 --- a/rt/share/html/SelfService/Elements/MyRequests +++ b/rt/share/html/SelfService/Elements/MyRequests @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/SelfService/Elements/Tabs b/rt/share/html/SelfService/Elements/Tabs deleted file mode 100755 index eb4cba80c..000000000 --- a/rt/share/html/SelfService/Elements/Tabs +++ /dev/null @@ -1,113 +0,0 @@ -%# BEGIN BPS TAGGED BLOCK {{{ -%# -%# COPYRIGHT: -%# -%# This software is Copyright (c) 1996-2011 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., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. -%# -%# -%# 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 }}} -% $m->callback( %ARGS, tabs => $tabs, actions => $actions ); -<& /Elements/PageLayout, - current_toptab => $current_toptab, - current_tab => $current_tab, - toptabs => $tabs, - topactions => $actions, - title => $Title -&> - -<%INIT> -my $queues = RT::Queues->new($session{'CurrentUser'}); -$queues->UnLimit; - -my $queue_count = 0; -my $queue_id = 1; - -while (my $queue = $queues->Next) { - next unless $queue->CurrentUserHasRight('CreateTicket'); - $queue_id = $queue->id; - $queue_count++; - last if ($queue_count > 1); -} - -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', - }, - }; - -if ($queue_count > 1) { - $tabs->{C} = { title => loc('New ticket'), - path => 'SelfService/CreateTicketInQueue.html' - }; -} else { - $tabs->{C} = { title => loc('New ticket'), - path => 'SelfService/Create.html?Queue=' . $queue_id - }; -} - -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') - } - }; - -<%ARGS> -$Title => undef -$current_toptab => undef -$current_tab => undef - - diff --git a/rt/share/html/SelfService/Error.html b/rt/share/html/SelfService/Error.html index 74b6acf1a..9f0c7f82e 100755 --- a/rt/share/html/SelfService/Error.html +++ b/rt/share/html/SelfService/Error.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/SelfService/Prefs.html b/rt/share/html/SelfService/Prefs.html index 6f3bc9336..ac5d725ad 100755 --- a/rt/share/html/SelfService/Prefs.html +++ b/rt/share/html/SelfService/Prefs.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/SelfService/Update.html b/rt/share/html/SelfService/Update.html index 61ce09059..6525d3de9 100755 --- a/rt/share/html/SelfService/Update.html +++ b/rt/share/html/SelfService/Update.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -54,13 +54,13 @@
-
<&|/l&>Queue: - <%$queue_obj->Name || ''%> (<%$queue_obj->Description || ''%>) + <%$queue_obj->Name || ''%> <% $queue_obj->Description ? '('.$queue_obj->Description.')' : '' %>
+
@@ -72,30 +72,9 @@ -% if (exists $session{'Attachments'}) { - - - - -% } # end of if - - - - + <& /Ticket/Elements/AddAttachments, %ARGS, TicketObj => $Ticket &> +
<&|/l&>Status - <& /Elements/SelectStatus, Name=>"Status", DefaultLabel => loc("[_1] (Unchanged)", loc($Ticket->Status)), Default => $ARGS{'Status'} || ($Ticket->Status eq $DefaultStatus ? undef : $DefaultStatus)&> + <& /Elements/SelectStatus, Name => "Status", TicketObj => $Ticket, DefaultLabel => loc("[_1] (Unchanged)", loc($Ticket->Status)), Default => $ARGS{'Status'} || ($Ticket->Status eq $DefaultStatus ? undef : $DefaultStatus)&>
- <&|/l&>Attached file - - <&|/l&>Check box to delete
-% foreach my $attach_name (keys %{$session{'Attachments'}}) { - <%$attach_name%>
-% } # end of foreach -
- <&|/l&>Attach - - - -
<& /Ticket/Elements/EditCustomFields, TicketObj => $Ticket &>
-<& /Ticket/Elements/EditCustomFields, TicketObj => $Ticket &> <& /Elements/MessageBox, Name => "UpdateContent", QuoteTransaction => $ARGS{QuoteTransaction} diff --git a/rt/share/html/SelfService/index.html b/rt/share/html/SelfService/index.html index f57554aab..a89296b19 100755 --- a/rt/share/html/SelfService/index.html +++ b/rt/share/html/SelfService/index.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) -- cgit v1.2.1