summaryrefslogtreecommitdiff
path: root/rt/share/html/SelfService
diff options
context:
space:
mode:
Diffstat (limited to 'rt/share/html/SelfService')
-rwxr-xr-xrt/share/html/SelfService/Closed.html6
-rwxr-xr-xrt/share/html/SelfService/Create.html43
-rwxr-xr-xrt/share/html/SelfService/Display.html135
-rwxr-xr-xrt/share/html/SelfService/Elements/MyRequests21
-rw-r--r--[-rwxr-xr-x]rt/share/html/SelfService/Helpers/Autocomplete/CustomFieldValues (renamed from rt/share/html/SelfService/Error.html)25
-rw-r--r--rt/share/html/SelfService/Helpers/Autocomplete/Users48
-rwxr-xr-xrt/share/html/SelfService/Prefs.html6
-rwxr-xr-xrt/share/html/SelfService/Update.html10
-rwxr-xr-xrt/share/html/SelfService/index.html2
9 files changed, 148 insertions, 148 deletions
diff --git a/rt/share/html/SelfService/Closed.html b/rt/share/html/SelfService/Closed.html
index bfdc1db..803772a 100755
--- a/rt/share/html/SelfService/Closed.html
+++ b/rt/share/html/SelfService/Closed.html
@@ -50,9 +50,9 @@
<& /SelfService/Elements/MyRequests,
%ARGS,
status => [ RT::Queue->InactiveStatusArray ],
- friendly_status => loc('closed'),
- BaseURL => RT->Config->Get('WebPath') ."/SelfService/Closed.html?",
- Page => $Page,
+ title => loc('My closed tickets'),
+ BaseURL => RT->Config->Get('WebPath') ."/SelfService/Closed.html?",
+ Page => $Page,
&>
<%ARGS>
diff --git a/rt/share/html/SelfService/Create.html b/rt/share/html/SelfService/Create.html
index 9784917..18b970b 100755
--- a/rt/share/html/SelfService/Create.html
+++ b/rt/share/html/SelfService/Create.html
@@ -48,8 +48,12 @@
<& Elements/Header, Title => loc("Create a ticket") &>
<& /Elements/ListActions, actions => \@results &>
-<form action="Create.html" method="post" enctype="multipart/form-data">
+<form action="Create.html" method="post" enctype="multipart/form-data" name="TicketCreate">
<input type="hidden" class="hidden" name="id" value="new" />
+<input type="hidden" class="hidden" name="Token" value="<% $ARGS{'Token'} %>" />
+% for my $key (grep {defined $ARGS{$_}} map {+("new-$_", "$_-new")} keys %RT::Link::DIRMAP) {
+<input type="hidden" class="hidden" name="<% $key %>" value="<% $ARGS{$key} %>" />
+% }
<table width="100%">
<tr>
@@ -67,7 +71,7 @@
<&|/l&>Requestors</&>:
</td>
<td class="value">
-<& /Elements/EmailInput, Name => 'Requestors', Size => '20', Default => $ARGS{Requestors} || $session{CurrentUser}->EmailAddress &>
+<& /Elements/EmailInput, Name => 'Requestors', Size => '20', Default => $ARGS{Requestors} || $session{CurrentUser}->EmailAddress, AutocompleteMultiple => 1 &>
</td>
</tr>
<tr>
@@ -88,7 +92,12 @@
</tr>
<tr>
<td colspan="2">
- <& /Ticket/Elements/EditCustomFields, %ARGS, QueueObj => $queue_obj &>
+ <& /Elements/EditCustomFields,
+ %ARGS,
+ Object => RT::Ticket->new($session{CurrentUser}),
+ CustomFields => $queue_obj->TicketCustomFields,
+ AsTable => 0,
+ &>
</td>
</tr>
<& /Ticket/Elements/AddAttachments, %ARGS, QueueObj => $queue_obj &>
@@ -112,31 +121,31 @@ $Queue => undef
my @results;
my $queue_obj = RT::Queue->new($session{'CurrentUser'});
$queue_obj->Load($Queue);
-my $CFs = $queue_obj->TicketCustomFields();
-my $ValidCFs = $m->comp(
- '/Elements/ValidateCustomFields',
- CustomFields => $CFs,
- ARGSRef => \%ARGS
-);
ProcessAttachments(ARGSRef => \%ARGS);
my $skip_create = 0;
+
+{
+ my ($status, @msg) = $m->comp(
+ '/Elements/ValidateCustomFields',
+ CustomFields => $queue_obj->TicketCustomFields,
+ ARGSRef => \%ARGS
+ );
+ unless ($status) {
+ push @results, @msg;
+ $skip_create = 1;
+ }
+}
+
$m->callback( CallbackName => 'BeforeCreate', ARGSRef => \%ARGS, skip_create => \$skip_create, results => \@results );
if ( !exists $ARGS{'AddMoreAttach'} and defined($ARGS{'id'}) and $ARGS{'id'} eq 'new' ) { # new ticket?
- if ( $ValidCFs && !$skip_create ) {
+ if ( !$skip_create ) {
$m->comp('Display.html', %ARGS);
$RT::Logger->crit("After display call; error is $@");
$m->abort();
}
- elsif ( !$ValidCFs ) {
- # Invalid CFs
- while (my $CF = $CFs->Next) {
- my $msg = $m->notes('InvalidField-' . $CF->Id) or next;
- push @results, $CF->Name . ': ' . $msg;
- }
- }
}
</%init>
diff --git a/rt/share/html/SelfService/Display.html b/rt/share/html/SelfService/Display.html
index 3d4c4e4..9a115eb 100755
--- a/rt/share/html/SelfService/Display.html
+++ b/rt/share/html/SelfService/Display.html
@@ -52,20 +52,27 @@
<& /Elements/ListActions, actions => \@results &>
<& /Ticket/Elements/ShowUpdateStatus, Ticket => $Ticket &>
- <table width="100%" class="ticketsummary" >
+ <table width="100%" class="ticket-summary" >
<tr>
<td valign="top" width="50%" class="boxcontainer">
<&| /Widgets/TitleBox, title => loc('The Basics'),
+ class => 'ticket-info-basics',
($LinkBasicsTitle ? (title_href => $title_box_link) : ()),
title_class=> 'inverse',
color => "#993333" &>
- <& /Ticket/Elements/ShowBasics, Ticket => $Ticket &>
- <& /Ticket/Elements/ShowCustomFields, Ticket => $Ticket &>
+ <& /Ticket/Elements/ShowBasics, Ticket => $Ticket, UngroupedCFs => 1 &>
</&>
+
+ <& /Elements/ShowCustomFieldCustomGroupings,
+ Object => $Ticket,
+ title_href => ($LinkBasicsTitle ? RT->Config->Get('WebPath')."/SelfService/Update.html" : "" ),
+ Groupings => [ grep {$_ !~ /^(Basics|Dates)$/} RT::CustomField->Groupings( "RT::Ticket" ) ],
+ &>
</td>
<td valign="top" width="50%" class="boxcontainer">
<&| /Widgets/TitleBox, title => loc("Dates"),
- title_class=> 'inverse',
+ class => 'ticket-info-dates',
+ title_class=> 'inverse',
color => "#663366" &>
<& /Ticket/Elements/ShowDates, Ticket => $Ticket, UpdatedLink => 0 &>
</&>
@@ -73,16 +80,12 @@
</tr>
</table>
+% $m->callback(CallbackName => 'BeforeShowHistory', ARGSRef=> \%ARGS, Ticket => $Ticket );
-
-<& /Ticket/Elements/ShowHistory,
- Ticket => $Ticket,
- URIFile => "Display.html",
+<& /Elements/ShowHistory,
+ Object => $Ticket,
ShowHeaders => $ARGS{'ShowHeaders'},
DownloadableHeaders => 0,
- AttachPath => "Attachment",
- Attachments => $attachments,
- UpdatePath => "Update.html"
&>
@@ -101,108 +104,66 @@ my @id = ( ref $id eq 'ARRAY' ) ? @{$id} : ($id);
my $Ticket = RT::Ticket->new( $session{'CurrentUser'} );
-if ( defined ($id[0]) && $id[0] eq 'new' ) {
-
- # {{{ Create a new ticket
+if ( ($id[0]||'') eq 'new' ) {
my $Queue = RT::Queue->new( $session{'CurrentUser'} );
- unless ( $Queue->Load( $ARGS{'Queue'} ) ) {
- $m->comp( 'Error.html', Why => loc('Queue not found') );
- $m->abort;
- }
+ Abort( loc('Queue not found') ) unless $Queue->Load( $ARGS{'Queue'} );
- unless ( $Queue->CurrentUserHasRight('CreateTicket') ) {
- $m->comp( 'Error.html',
- Why =>
- loc('You have no permission to create tickets in that queue.') );
- $m->abort;
- }
+ Abort( loc('You have no permission to create tickets in that queue.') )
+ unless $Queue->CurrentUserHasRight('CreateTicket');
+ ( $Ticket, @results ) = CreateTicket( %ARGS );
- ( $Ticket, @results ) =
- CreateTicket( Attachments => delete $session{'Attachments'}, %ARGS );
+ Abort( join("\n", @results ) ) unless $Ticket->id;
+
+}
+else {
+ $Ticket = LoadTicket($ARGS{'id'});
- unless ( $Ticket->id ) {
- $m->comp( 'Error.html', Why => join( "\n", @results ));
- $m->abort();
- }
- }
- else {
- unless ( $Ticket->Load( $id[0] ) ) {
- $m->comp( 'Error.html',
- Why => loc( "Couldn't load ticket '[_1]'", $id ) );
- $m->abort();
- }
-
- my ( $code, $msg );
-
-
- if (
- $session{'Attachments'}
- || ( defined $ARGS{'UpdateContent'}
- && $ARGS{'UpdateContent'} ne ''
- && $ARGS{'UpdateContent'} ne "-- \n"
- . $session{'CurrentUser'}->UserObj->Signature )
- )
- {
- $ARGS{UpdateAttachments} = $session{'Attachments'};
- }
push @results, ProcessUpdateMessage(
ARGSRef => \%ARGS,
TicketObj => $Ticket
);
- delete $session{'Attachments'};
my @cfupdates = ProcessObjectCustomFieldUpdates(Object => $Ticket, ARGSRef => \%ARGS);
push (@results, @cfupdates);
-
#Update the status
if ( ( defined $ARGS{'Status'} )
and $ARGS{'Status'}
and ( $ARGS{'Status'} ne $Ticket->Status ) )
{
- ( $code, $msg ) = $Ticket->SetStatus( $ARGS{'Status'} );
+ my ($code, $msg) = $Ticket->SetStatus( $ARGS{'Status'} );
push @results, "$msg";
}
+}
- }
+# This code does automatic redirection if any updates happen.
- # This code does automatic redirection if any updates happen.
+unless ( $Ticket->CurrentUserHasRight('ShowTicket') ) {
+ Abort( loc("No permission to display that ticket") );
+}
- unless ( $Ticket->CurrentUserHasRight('ShowTicket') ) {
- $m->comp( 'Error.html',
- Why => loc("No permission to display that ticket") );
- # XXX: Why abort? then we loose footer //ruz
- $m->abort();
- }
-
- if ( $ARGS{'MarkAsSeen'} ) {
- $Ticket->SetAttribute(
- Name => 'User-'. $Ticket->CurrentUser->id .'-SeenUpTo',
- Content => $Ticket->LastUpdated,
- );
- push @results, loc('Marked all messages as seen');
- }
-
- # This code does automatic redirection if any updates happen.
- MaybeRedirectForResults(
- Actions => \@results,
- Path => '/SelfService/Display.html',
- Anchor => $ARGS{'Anchor'},
- Arguments => { id => $Ticket->id },
+if ( $ARGS{'MarkAsSeen'} ) {
+ $Ticket->SetAttribute(
+ Name => 'User-'. $Ticket->CurrentUser->id .'-SeenUpTo',
+ Content => $Ticket->LastUpdated,
);
-
- my $Transactions = $Ticket->Transactions;
-
- my $attachments =
- $m->comp( '/Ticket/Elements/FindAttachments', Ticket => $Ticket );
-
- my $LinkBasicsTitle = $Ticket->CurrentUserHasRight('ModifyTicket')
- || $Ticket->CurrentUserHasRight('ReplyToTicket');
- my $title_box_link = RT->Config->Get('WebPath')."/SelfService/Update.html?id=".$Ticket->Id;
- $m->callback(CallbackName => 'BeforeDisplay', Ticket => \$Ticket, ARGSRef => \%ARGS, title_box_link => \$title_box_link);
+ push @results, loc('Marked all messages as seen');
+}
+
+MaybeRedirectForResults(
+ Actions => \@results,
+ Path => '/SelfService/Display.html',
+ Anchor => $ARGS{'Anchor'},
+ Arguments => { 'id' => $Ticket->id },
+);
+
+my $LinkBasicsTitle = $Ticket->CurrentUserHasRight('ModifyTicket')
+ || $Ticket->CurrentUserHasRight('ReplyToTicket');
+my $title_box_link = RT->Config->Get('WebPath')."/SelfService/Update.html?id=".$Ticket->Id;
+$m->callback(CallbackName => 'BeforeDisplay', Ticket => \$Ticket, ARGSRef => \%ARGS, title_box_link => \$title_box_link);
</%INIT>
diff --git a/rt/share/html/SelfService/Elements/MyRequests b/rt/share/html/SelfService/Elements/MyRequests
index b9fdcf1..107240dce 100755
--- a/rt/share/html/SelfService/Elements/MyRequests
+++ b/rt/share/html/SelfService/Elements/MyRequests
@@ -47,19 +47,19 @@
%# END BPS TAGGED BLOCK }}}
<&| /Widgets/TitleBox, title => $title &>
<& /Elements/CollectionList, Title => $title,
- Format => $Format,
- Query => $Query,
- Order => @Order,
- OrderBy => @OrderBy,
- BaseURL => $BaseURL,
- AllowSorting => 1,
- Class => 'RT::Tickets',
- Rows => $Rows,
- Page => $Page &>
+ Format => $Format,
+ Query => $Query,
+ Order => @Order,
+ OrderBy => @OrderBy,
+ BaseURL => $BaseURL,
+ AllowSorting => 1,
+ Class => 'RT::Tickets',
+ Rows => $Rows,
+ Page => $Page &>
</&>
<%INIT>
-my $title = loc("My [_1] tickets", $friendly_status);
+$title ||= loc("My [_1] tickets", $friendly_status);
my $id = $session{'CurrentUser'}->id;
my $Query = "( Watcher.id = $id )";
if ( @status ) {
@@ -69,6 +69,7 @@ if ( @status ) {
my $Format = RT->Config->Get('DefaultSelfServiceSearchResultFormat');
</%INIT>
<%ARGS>
+$title => undef
$friendly_status => loc('open')
@status => ()
$BaseURL => undef
diff --git a/rt/share/html/SelfService/Error.html b/rt/share/html/SelfService/Helpers/Autocomplete/CustomFieldValues
index 14c5ad5..be0c96b 100755..100644
--- a/rt/share/html/SelfService/Error.html
+++ b/rt/share/html/SelfService/Helpers/Autocomplete/CustomFieldValues
@@ -45,27 +45,4 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<& /SelfService/Elements/Header, Title => loc('Error') &>
-<h2 class="title"><%loc('Error')%></h2>
-<&| /Widgets/TitleBox, title => $Title &>
-<%$Why%>
-<br />
-<font size="-1">
-<%$Details%>
-</font>
-</&>
-</body>
-</html>
-
-
-<%args>
-$Code => undef
-$Details => undef
-$Title => loc("RT Error")
-$Why => loc("the calling component did not specify why")
-</%args>
-
-<%INIT>
-$Details ||= loc("No details");
-$RT::Logger->error("WebRT: $Why ($Details)");
-</%INIT>
+% $m->comp('/Helpers/Autocomplete/CustomFieldValues', %ARGS);
diff --git a/rt/share/html/SelfService/Helpers/Autocomplete/Users b/rt/share/html/SelfService/Helpers/Autocomplete/Users
new file mode 100644
index 0000000..bfe4ef0
--- /dev/null
+++ b/rt/share/html/SelfService/Helpers/Autocomplete/Users
@@ -0,0 +1,48 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
+%# <sales@bestpractical.com>
+%#
+%# (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->comp('/Helpers/Autocomplete/Users', %ARGS);
diff --git a/rt/share/html/SelfService/Prefs.html b/rt/share/html/SelfService/Prefs.html
index 6284a88..6207a3b 100755
--- a/rt/share/html/SelfService/Prefs.html
+++ b/rt/share/html/SelfService/Prefs.html
@@ -77,7 +77,7 @@
</td></tr></table>
<br />
<& /Elements/Submit, Label => loc('Save Changes') &>
- </form>
+</form>
<%INIT>
@@ -120,8 +120,8 @@ if ( $Lang ) {
if ($Signature) {
$Signature =~ s/(\r\n|\r)/\n/g;
if ($Signature ne $user->Signature) {
- my ($val, $msg) = $user->SetSignature($Signature);
- push (@results, "Signature: ".$msg);
+ my ($val, $msg) = $user->SetSignature($Signature);
+ push (@results, "Signature: ".$msg);
}
}
diff --git a/rt/share/html/SelfService/Update.html b/rt/share/html/SelfService/Update.html
index 3bbf109..9cc80b7 100755
--- a/rt/share/html/SelfService/Update.html
+++ b/rt/share/html/SelfService/Update.html
@@ -51,17 +51,21 @@
% $m->callback(CallbackName => 'BeforeForm', %ARGS, ARGSRef => \%ARGS, Ticket => $Ticket );
-<form action="Update.html" method="post" enctype="multipart/form-data">
+<form action="Update.html" method="post" enctype="multipart/form-data" name="TicketUpdate">
<input type="hidden" class="hidden" name="QuoteTransaction" value="<% $ARGS{QuoteTransaction}||'' %>" />
<input type="hidden" class="hidden" name="UpdateType" value="response" />
<input type="hidden" class="hidden" name="id" value="<%$Ticket->Id%>" />
+<input type="hidden" class="hidden" name="Token" value="<% $ARGS{'Token'} %>" />
<table width="100%">
<tr>
<td class="label">
<&|/l&>Status</&>
</td>
<td class="value">
- <& /Elements/SelectStatus, Name => "Status", TicketObj => $Ticket, DefaultLabel => loc("[_1] (Unchanged)", loc($Ticket->Status)), Default => $ARGS{'Status'} || ($Ticket->Status eq $DefaultStatus ? undef : $DefaultStatus)&>
+ <& /Ticket/Elements/SelectStatus,
+ Name => "Status",
+ TicketObj => $Ticket,
+ Default => $DefaultStatus &>
</td>
</tr>
<tr>
@@ -74,7 +78,7 @@
</tr>
<& /Ticket/Elements/AddAttachments, %ARGS, TicketObj => $Ticket &>
- <tr><td colspan="2"><& /Ticket/Elements/EditCustomFields, TicketObj => $Ticket &></td></tr>
+ <tr><td colspan="2"><& /Elements/EditCustomFields, Object => $Ticket, AsTable => 0 &></td></tr>
</table>
% if (exists $ARGS{UpdateContent}) {
% # preserve QuoteTransaction so we can use it to set up sane references/in/reply to
diff --git a/rt/share/html/SelfService/index.html b/rt/share/html/SelfService/index.html
index f002a68..4f0f6d8 100755
--- a/rt/share/html/SelfService/index.html
+++ b/rt/share/html/SelfService/index.html
@@ -49,7 +49,7 @@
<& /SelfService/Elements/MyRequests,
%ARGS,
status => [ RT::Queue->ActiveStatusArray() ],
- friendly_status => loc('open'),
+ title => loc('My open tickets'),
BaseURL => RT->Config->Get('WebPath') ."/SelfService/?",
Page => $Page,
&>