From ef20b2b6b1feb47ad02b5ff7525f1a0fd11d0fa4 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 2 Aug 2007 19:56:20 +0000 Subject: import rt 3.6.4 --- rt/html/SelfService/Attachment/dhandler | 6 +- rt/html/SelfService/Closed.html | 15 +++-- rt/html/SelfService/Create.html | 92 ++++++++++++++-------------- rt/html/SelfService/CreateTicketInQueue.html | 6 +- rt/html/SelfService/Display.html | 63 +++++++++++-------- rt/html/SelfService/Elements/GotoTicket | 8 ++- rt/html/SelfService/Elements/Header | 6 +- rt/html/SelfService/Elements/MyRequests | 67 ++++++++++---------- rt/html/SelfService/Elements/Tabs | 34 ++++++++-- rt/html/SelfService/Error.html | 16 ++--- rt/html/SelfService/Prefs.html | 18 +++--- rt/html/SelfService/Update.html | 36 ++++++----- rt/html/SelfService/index.html | 14 +++-- 13 files changed, 223 insertions(+), 158 deletions(-) (limited to 'rt/html/SelfService') diff --git a/rt/html/SelfService/Attachment/dhandler b/rt/html/SelfService/Attachment/dhandler index f953c2486..e7d59e63c 100644 --- a/rt/html/SelfService/Attachment/dhandler +++ b/rt/html/SelfService/Attachment/dhandler @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: diff --git a/rt/html/SelfService/Closed.html b/rt/html/SelfService/Closed.html index 2d49a6897..766b0bc4f 100644 --- a/rt/html/SelfService/Closed.html +++ b/rt/html/SelfService/Closed.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -45,5 +47,10 @@ %# END BPS TAGGED BLOCK }}} <& /SelfService/Elements/Header, Title => loc('Closed tickets') &> -<& /SelfService/Elements/MyRequests, status => ['rejected', 'resolved'], friendly_status => -loc('closed') &> +<& /SelfService/Elements/MyRequests, status => ['rejected', 'resolved'], + friendly_status => loc('closed'), + BaseURL => $RT::WebPath . "/SelfService/Closed.html?", + Page => $Page &> +<%ARGS> +$Page => 1 + diff --git a/rt/html/SelfService/Create.html b/rt/html/SelfService/Create.html index d60ae267a..f66961db8 100644 --- a/rt/html/SelfService/Create.html +++ b/rt/html/SelfService/Create.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -45,67 +47,67 @@ %# END BPS TAGGED BLOCK }}} <& Elements/Header, Title => loc("Create a ticket") &> -
- + + - - - + +
+ + + - - - + + + - - - - + + + + - - - - + + + + - - + + + - - - - - + + + + - -
<&|/l&>Queue: - - <%$queue_obj->Name%> (<%$queue_obj->Description%>) -
+ + <%$queue_obj->Name%> (<%$queue_obj->Description%>) +
<&|/l&>Requestors: - - -
+ + +
<&|/l&>Cc: - - -
+ + +
<&|/l&>Subject: - - -
+ +
<& /Ticket/Elements/EditCustomFields, QueueObj => $queue_obj &>
+ <&|/l&>Attach file: - - -
-<&|/l&>Describe the issue below:
+
+ +
+<&|/l&>Describe the issue below:
<& /Elements/MessageBox &> -
+
<& /Elements/Submit, Label => loc("Create ticket")&> -
+ <%args> $Queue => undef diff --git a/rt/html/SelfService/CreateTicketInQueue.html b/rt/html/SelfService/CreateTicketInQueue.html index 5e8973610..fd7e42664 100755 --- a/rt/html/SelfService/CreateTicketInQueue.html +++ b/rt/html/SelfService/CreateTicketInQueue.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: diff --git a/rt/html/SelfService/Display.html b/rt/html/SelfService/Display.html index f7140df02..0410e1b48 100644 --- a/rt/html/SelfService/Display.html +++ b/rt/html/SelfService/Display.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -47,25 +49,25 @@ <& /Elements/ListActions, actions => \@results &> - - - + +
- <& /Elements/TitleBoxStart, title => loc('The Basics'), + + + - + - -
+ <&| /Widgets/TitleBox, title => loc('The Basics'), title_class=> 'inverse', color => "#993333" &> <& /Ticket/Elements/ShowBasics, Ticket => $Ticket &> <& /Ticket/Elements/ShowCustomFields, Ticket => $Ticket &> - <& /Elements/TitleBoxEnd &> - - <& /Elements/TitleBoxStart, title => loc("Dates"), + + + <&| /Widgets/TitleBox, title => loc("Dates"), title_class=> 'inverse', color => "#663366" &> <& /Ticket/Elements/ShowDates, Ticket => $Ticket, UpdatedLink => 0 &> - <& /Elements/TitleBoxEnd &> -
+ +
@@ -158,15 +160,6 @@ if ( $id[0] eq 'new' ) { 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 ); @@ -183,7 +176,8 @@ if ( $id[0] eq 'new' ) { if ( $session{'Attachments'} - || ( $ARGS{'UpdateContent'} ne '' + || ( defined $ARGS{'UpdateContent'} + && $ARGS{'UpdateContent'} ne '' && $ARGS{'UpdateContent'} ne "-- \n" . $session{'CurrentUser'}->UserObj->Signature ) ) @@ -206,6 +200,27 @@ if ( $id[0] eq 'new' ) { # }}} + } + + # This code does automatic redirection if any updates happen. + + unless ( $Ticket->CurrentUserHasRight('ShowTicket') ) { + $m->comp( 'Error.html', + Why => loc("No permission to display that ticket") ); + $m->abort(); + } + + if (@results) { + # We've done something, so we need to clear the decks to avoid + # resubmission on refresh. + # But we need to store Actions somewhere too, so we don't lose them. + $session{"Actions"} = \@results; + RT::Interface::Web::Redirect($RT::WebURL."SelfService/Display.html?id=" + . $Ticket->id); + } else { + @results = @{ delete $session{"Actions"} || [] }; + } + my $Transactions = $Ticket->Transactions; my $attachments = diff --git a/rt/html/SelfService/Elements/GotoTicket b/rt/html/SelfService/Elements/GotoTicket index 50efaa24e..5eac306e9 100644 --- a/rt/html/SelfService/Elements/GotoTicket +++ b/rt/html/SelfService/Elements/GotoTicket @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -43,4 +45,4 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -
 
+
 
diff --git a/rt/html/SelfService/Elements/Header b/rt/html/SelfService/Elements/Header index c7e6a9167..f248292e2 100644 --- a/rt/html/SelfService/Elements/Header +++ b/rt/html/SelfService/Elements/Header @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: diff --git a/rt/html/SelfService/Elements/MyRequests b/rt/html/SelfService/Elements/MyRequests index 2df8ce842..41f6b09b1 100644 --- a/rt/html/SelfService/Elements/MyRequests +++ b/rt/html/SelfService/Elements/MyRequests @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -43,43 +45,40 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<& /Elements/TitleBoxStart, title => $title &> - - - - - - - -% while (my $Ticket = $MyTickets->Next) { - - - -% } -
<&|/l&>Subject<&|/l&>Status<&|/l&>Owner
-<%$Ticket->Id%>: <%$Ticket->Subject%> - -<%loc($Ticket->Status)%> - -<%$Ticket->OwnerObj->Name%> -
-<& /Elements/TitleBoxEnd &> - +<&| /Widgets/TitleBox, title => $title &> +<& /Elements/TicketList, Title => $title, + Format => @Format, + Query => $Query, + Order => $Order, + OrderBy => $OrderBy, + BaseURL => $BaseURL, + Page => $Page &> + <%INIT> -$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) { - - $MyTickets->LimitStatus(VALUE => $status); +my $id = $session{'CurrentUser'}->id; +my $Query = "( " + . join( ' OR ', map "$_.id = $id", @roles ) + . ")"; +if ( @status ) { + $Query .= " AND ( " + . join( ' OR ', map "Status = '$_'", @status ) + . " )"; } +my $Order = "ASC"; +my $OrderBy = "Created"; +my @Format = qq{ + '__id__/TITLE:#', + '__Subject__/TITLE:Subject', + Status, + Requestors, + OwnerName}; <%ARGS> -$title => undef $friendly_status => loc('open') +$title => loc("My [_1] tickets", $friendly_status) +@roles => ('Watcher') @status => ('open', 'new', 'stalled') +$BaseURL => undef +$Page => 1 diff --git a/rt/html/SelfService/Elements/Tabs b/rt/html/SelfService/Elements/Tabs index 802fd6525..80f4ce4cd 100644 --- a/rt/html/SelfService/Elements/Tabs +++ b/rt/html/SelfService/Elements/Tabs @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -52,6 +54,18 @@ &> <%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; @@ -65,11 +79,19 @@ my $tabs = { A => { title => loc('Open tickets'), }, B => { title => loc('Closed tickets'), path => 'SelfService/Closed.html', - }, - C => { title => loc('New ticket'), - path => 'SelfService/CreateTicketInQueue.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'), diff --git a/rt/html/SelfService/Error.html b/rt/html/SelfService/Error.html index 8ac9f81ea..81a483d39 100644 --- a/rt/html/SelfService/Error.html +++ b/rt/html/SelfService/Error.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -45,15 +47,15 @@ %# END BPS TAGGED BLOCK }}} <& /SelfService/Elements/Header, Title => loc('Error') &>

<%loc('Error')%>

-<& /Elements/TitleBoxStart, title => $Title &> +<&| /Widgets/TitleBox, title => $Title &> <%$Why%> -
- +
+ <%$Details%> -<& /Elements/TitleBoxEnd &> + - + <%args> diff --git a/rt/html/SelfService/Prefs.html b/rt/html/SelfService/Prefs.html index 3913203fb..0cd3756c3 100644 --- a/rt/html/SelfService/Prefs.html +++ b/rt/html/SelfService/Prefs.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -46,14 +48,14 @@ <& /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 &> -
+<&| /Widgets/TitleBox, title => loc('Change password') &> +<&|/l&>New password: +<&|/l&>Confirm: + +
% } <& /Elements/Submit, Label => loc('Save Changes') &>
diff --git a/rt/html/SelfService/Update.html b/rt/html/SelfService/Update.html index 816a610aa..b10716f9a 100644 --- a/rt/html/SelfService/Update.html +++ b/rt/html/SelfService/Update.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -48,9 +50,9 @@ &> -
- - + + + % if (exists $session{'Attachments'}) { - - + - + + % } # end of if
@@ -65,30 +67,30 @@ <&|/l&>Subject - +
+ <&|/l&>Attached file - - <&|/l&>Check box to delete
+
+ <&|/l&>Check box to delete
% foreach my $attach_name (keys %{$session{'Attachments'}}) { - <%$attach_name%>
+ <%$attach_name%>
% } # end of foreach -
<&|/l&>Attach - - + +
@@ -97,11 +99,11 @@ Name => "UpdateContent", QuoteTransaction => $ARGS{QuoteTransaction} &> -
+
<& /Elements/Submit &> -
+ diff --git a/rt/html/SelfService/index.html b/rt/html/SelfService/index.html index f3ccb8555..c4a9577ab 100644 --- a/rt/html/SelfService/index.html +++ b/rt/html/SelfService/index.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -43,6 +45,10 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<& /SelfService/Elements/Header, Title => undef &> +<& /SelfService/Elements/Header, Title => loc('Open Tickets') &> -<& /SelfService/Elements/MyRequests &> +<& /SelfService/Elements/MyRequests, BaseURL => $RT::WebPath . "/SelfService/?", + Page => $Page &> +<%ARGS> +$Page => 1 + -- cgit v1.2.1