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/Ticket/Attachment/dhandler | 68 ++++++++ rt/html/Ticket/Create.html | 257 +++++++++++++++++++++++++++++ rt/html/Ticket/Display.html | 116 +++++++++++++ rt/html/Ticket/Elements/AddWatchers | 97 +++++++++++ rt/html/Ticket/Elements/BulkLinks | 53 ++++++ rt/html/Ticket/Elements/EditBasics | 79 +++++++++ rt/html/Ticket/Elements/EditCustomField | 70 ++++++++ rt/html/Ticket/Elements/EditCustomFields | 74 +++++++++ rt/html/Ticket/Elements/EditDates | 53 ++++++ rt/html/Ticket/Elements/EditLinks | 150 +++++++++++++++++ rt/html/Ticket/Elements/EditPeople | 68 ++++++++ rt/html/Ticket/Elements/EditWatchers | 52 ++++++ rt/html/Ticket/Elements/ShowAttachments | 76 +++++++++ rt/html/Ticket/Elements/ShowBasics | 54 ++++++ rt/html/Ticket/Elements/ShowCustomFields | 46 ++++++ rt/html/Ticket/Elements/ShowDates | 56 +++++++ rt/html/Ticket/Elements/ShowDependencies | 41 +++++ rt/html/Ticket/Elements/ShowHistory | 86 ++++++++++ rt/html/Ticket/Elements/ShowLink | 40 +++++ rt/html/Ticket/Elements/ShowLinks | 87 ++++++++++ rt/html/Ticket/Elements/ShowMemberOf | 35 ++++ rt/html/Ticket/Elements/ShowMembers | 45 +++++ rt/html/Ticket/Elements/ShowMessageHeaders | 32 ++++ rt/html/Ticket/Elements/ShowMessageStanza | 51 ++++++ rt/html/Ticket/Elements/ShowPeople | 45 +++++ rt/html/Ticket/Elements/ShowReferences | 50 ++++++ rt/html/Ticket/Elements/ShowRequestor | 59 +++++++ rt/html/Ticket/Elements/ShowSummary | 82 +++++++++ rt/html/Ticket/Elements/ShowTransaction | 169 +++++++++++++++++++ rt/html/Ticket/Elements/Tabs | 170 +++++++++++++++++++ rt/html/Ticket/History.html | 52 ++++++ rt/html/Ticket/Modify.html | 63 +++++++ rt/html/Ticket/ModifyAll.html | 158 ++++++++++++++++++ rt/html/Ticket/ModifyDates.html | 52 ++++++ rt/html/Ticket/ModifyLinks.html | 54 ++++++ rt/html/Ticket/ModifyPeople.html | 67 ++++++++ rt/html/Ticket/Update.html | 205 +++++++++++++++++++++++ 37 files changed, 3012 insertions(+) create mode 100644 rt/html/Ticket/Attachment/dhandler create mode 100644 rt/html/Ticket/Create.html create mode 100644 rt/html/Ticket/Display.html create mode 100644 rt/html/Ticket/Elements/AddWatchers create mode 100644 rt/html/Ticket/Elements/BulkLinks create mode 100644 rt/html/Ticket/Elements/EditBasics create mode 100644 rt/html/Ticket/Elements/EditCustomField create mode 100644 rt/html/Ticket/Elements/EditCustomFields create mode 100644 rt/html/Ticket/Elements/EditDates create mode 100644 rt/html/Ticket/Elements/EditLinks create mode 100644 rt/html/Ticket/Elements/EditPeople create mode 100644 rt/html/Ticket/Elements/EditWatchers create mode 100644 rt/html/Ticket/Elements/ShowAttachments create mode 100644 rt/html/Ticket/Elements/ShowBasics create mode 100644 rt/html/Ticket/Elements/ShowCustomFields create mode 100644 rt/html/Ticket/Elements/ShowDates create mode 100644 rt/html/Ticket/Elements/ShowDependencies create mode 100644 rt/html/Ticket/Elements/ShowHistory create mode 100644 rt/html/Ticket/Elements/ShowLink create mode 100644 rt/html/Ticket/Elements/ShowLinks create mode 100644 rt/html/Ticket/Elements/ShowMemberOf create mode 100644 rt/html/Ticket/Elements/ShowMembers create mode 100644 rt/html/Ticket/Elements/ShowMessageHeaders create mode 100644 rt/html/Ticket/Elements/ShowMessageStanza create mode 100644 rt/html/Ticket/Elements/ShowPeople create mode 100644 rt/html/Ticket/Elements/ShowReferences create mode 100644 rt/html/Ticket/Elements/ShowRequestor create mode 100644 rt/html/Ticket/Elements/ShowSummary create mode 100644 rt/html/Ticket/Elements/ShowTransaction create mode 100644 rt/html/Ticket/Elements/Tabs create mode 100644 rt/html/Ticket/History.html create mode 100644 rt/html/Ticket/Modify.html create mode 100644 rt/html/Ticket/ModifyAll.html create mode 100644 rt/html/Ticket/ModifyDates.html create mode 100644 rt/html/Ticket/ModifyLinks.html create mode 100644 rt/html/Ticket/ModifyPeople.html create mode 100644 rt/html/Ticket/Update.html (limited to 'rt/html/Ticket') diff --git a/rt/html/Ticket/Attachment/dhandler b/rt/html/Ticket/Attachment/dhandler new file mode 100644 index 000000000..e0f00f57a --- /dev/null +++ b/rt/html/Ticket/Attachment/dhandler @@ -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 +<%perl> + my ($ticket, $trans,$attach, $filename); + my $arg = $m->dhandler_arg; # get rest of path + if ($arg =~ '^(\d+)/(\d+)') { + $trans = $1; + $attach = $2; + } + else { + Abort("Corrupted attachment URL."); + } + my $AttachmentObj = new RT::Attachment($session{'CurrentUser'}); + $AttachmentObj->Load($attach) || Abort("Attachment '$attach' could not be loaded"); + + + unless ($AttachmentObj->id) { + Abort("Bad attachment id. Couldn't find attachment '$attach'\n"); + } + unless ($AttachmentObj->TransactionId() == $trans ) { + Abort("Bad transaction number for attachment. $trans should be".$AttachmentObj->TransactionId() ."\n"); + + } + + my $content_type = $AttachmentObj->ContentType || 'text/plain'; + + unless ($RT::TrustHTMLAttachments) { + $content_type = 'text/plain' if ($content_type =~ /^text\/html/i); + } + + if (my $enc = $AttachmentObj->OriginalEncoding) { + # normalize Encode.pm convention with IANA ones + $enc = 'big5' if $enc eq 'big5-eten'; + $enc = 'utf-8' if $enc eq 'utf8'; + $content_type .= ";charset=$enc"; + } + + # unless ($RT::TrustMIMEAttachments) { + # $content_type = 'application/octet-stream'; + # } + + $r->content_type( $content_type ); + $m->clear_buffer(); + $m->out($AttachmentObj->OriginalContent); + $m->abort; + + diff --git a/rt/html/Ticket/Create.html b/rt/html/Ticket/Create.html new file mode 100644 index 000000000..5b8c908a1 --- /dev/null +++ b/rt/html/Ticket/Create.html @@ -0,0 +1,257 @@ +%# 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 new ticket") &> +<& /Elements/Tabs, + current_toptab => "Ticket/Create.html", + Title => loc("Create a new ticket") &> +
+ + + + +[<&|/l&>Show basics] [<&|/l&>Show details] +
+<& /Elements/TitleBoxStart, contentbg => "#cccccc", title => loc("Create a new ticket") &> + + + + + + + + + + + + + + + + + + + + + + + + + + + + +% if (exists $session{'Attachments'}) { + + + + +% } # end of if + + + + + + + + + +
<&|/l&>Queue<% $QueueObj->Name %> + +<&|/l&>Status: + +<& /Elements/SelectStatus, Name => "Status", Default => $ARGS{Status}||'new' &> + +<&|/l&>Owner: + +<& /Elements/SelectOwner, Name => "Owner", QueueObj => $QueueObj, Default => $ARGS{Owner}||undef &> +
+<&|/l&>Requestors: + + +
+<&|/l&>Cc: + +>
+ +<&|/l&>(Sends a carbon-copy of this update to a comma-delimited list of email addresses. These people will receive future updates.) +
+<&|/l&>Admin Cc: + +>
+ +<&|/l&>(Sends a carbon-copy of this update to a comma-delimited list of administrative email addresses. These people will receive future updates.) +
+<&|/l&>Subject: + + +
+<& /Ticket/Elements/EditCustomFields, QueueObj => $QueueObj &> +
+<&|/l&>Attached file: + +<&|/l&>Check box to delete
+% foreach my $attach_name (keys %{$session{'Attachments'}}) { +<%$attach_name%>
+% } # end of foreach +
+<&|/l&>Attach file: + + + +
+<&|/l&>Describe the issue below:
+% if (exists $ARGS{Content}) { +<& /Elements/MessageBox, Default => $ARGS{Content} &> +% } else { +<& /Elements/MessageBox, QuoteTransaction => $QuoteTransaction &> +%} + +
+
+
+<& /Elements/TitleBoxEnd &> +<& /Elements/Submit, Label => loc("Create")&> + +










+










+










+










+










+ + + [<&|/l&>Show basics] [<&|/l&>Show details] +
+ + + + + + +
+ + <& /Elements/TitleBoxStart, title => loc('The Basics'), + title_class=> 'inverse', + color => "#993333" &> + + + + + +
<&|/l&>Priority:
<&|/l&>Final Priority:
<&|/l&>Time Worked:>
<&|/l&>Time Left:>
+<& /Elements/TitleBoxEnd &> +
+<& /Elements/TitleBoxStart, title => loc("Dates"), + title_class=> 'inverse', + color => "#663366" &> + + + + +
<&|/l&>Starts:>
<&|/l&>Due:>
+<& /Elements/TitleBoxEnd &> +
+
+<& /Elements/TitleBoxStart, title => loc('Relationships'), + title_class=> 'inverse', + titleright => '', color=> "#336633" &> + +<&|/l&>(Enter ticket ids or URLs, seperated with spaces) + + + + + + + + + +
<&|/l&>Depends on>
<&|/l&>Depended on by>
<&|/l&>Parents>
<&|/l&>Children>
<&|/l&>Refers to>
<&|/l&>Referred to by>
+<& /Elements/TitleBoxEnd &> +
+ +
+<& /Elements/Submit, Label => loc("Create") &> +
+









+










+










+










+










+ +<%INIT> +my $QueueObj = new RT::Queue($session{'CurrentUser'}); +$QueueObj->Load($Queue) || Abort(loc("Queue could not be loaded.")); +my $CFs = $QueueObj->CustomFields(); + +# {{{ deal with deleting uploaded attachments +foreach my $key (keys %ARGS) { + if ($key =~ m/^DeleteAttach-(.+)$/) { + delete $session{'Attachments'}{$1}; + } + $session{'Attachments'} = { %{$session{'Attachments'} || {}} }; +} + +# {{{ 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 }; +} +# }}} + +# delete temporary storage entry to make WebUI clean +unless (keys %{$session{'Attachments'}} and $ARGS{'id'} eq 'new') { + delete $session{'Attachments'}; +} + + +# }}} + +if ((!exists $ARGS{'AddMoreAttach'}) && ($ARGS{'id'} eq 'new')) { # new ticket? + $m->comp('Display.html', %ARGS); + $m->abort(); +} + + +<%ARGS> +$DependsOn => undef +$DependedOnBy => undef +$MemberOf => undef +$QuoteTransaction => undef +$Queue => undef + diff --git a/rt/html/Ticket/Display.html b/rt/html/Ticket/Display.html new file mode 100644 index 000000000..cf32dce9d --- /dev/null +++ b/rt/html/Ticket/Display.html @@ -0,0 +1,116 @@ +%# 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("#[_1]: [_2]", $Ticket->Id, $Ticket->Subject) &> +<& /Ticket/Elements/Tabs, + Ticket => $Ticket, + current_tab => 'Ticket/Display.html?id='.$Ticket->id, + Title => loc("#[_1]: [_2]", $Ticket->Id, $Ticket->Subject) &> + +<& /Elements/ListActions, actions => \@Actions &> + +<& /Ticket/Elements/ShowSummary, Ticket => $Ticket &> + + +
+<& /Ticket/Elements/ShowHistory , + Ticket => $Ticket, + Collapsed => $ARGS{'Collapsed'}, + ShowHeaders => $ARGS{'ShowHeaders'} &> + + +<%ARGS> +$id => undef +$Create => undef +$ShowHeaders => undef +$Collapsed => undef + + +<%INIT> + my ($linkid, $message, $tid, $Ticket, @Actions); + +$Ticket = new RT::Ticket($session{'CurrentUser'}); + +unless ($id) { + Abort('No ticket specified'); +} + +if ($ARGS{'id'} eq 'new') { + # {{{ Create a new ticket + + my $Queue = new RT::Queue($session{'CurrentUser'}); + unless ($Queue->Load($ARGS{'Queue'})) { + Abort('Queue not found'); + } + + unless ($Queue->CurrentUserHasRight('CreateTicket')) { + Abort('You have no permission to create tickets in that queue.'); + } + ($Ticket, @Actions) = + CreateTicket(Attachments => $session{'Attachments'}, %ARGS); + delete $session{'Attachments'}; + unless ($Ticket->CurrentUserHasRight('ShowTicket')) { + Abort("No permission to view newly created ticket #".$Ticket->id."."); + } + # }}} +} + +else { + $Ticket = LoadTicket($ARGS{'id'}); + unless ($Ticket->CurrentUserHasRight('ShowTicket')) { + Abort("No permission to view ticket"); + } + + +if (defined $ARGS{'Action'}) { + if ($ARGS{'Action'} =~ /^(Steal|Kill|Take|SetTold)$/) { + my $action = $1; + my ($res, $msg)=$Ticket->$action(); + push(@Actions, $msg); + } +} + + if ( $ARGS{'UpdateContent'} ) { + $ARGS{'UpdateContent'} =~ s/\r\n/\n/g; + if ( $ARGS{'UpdateContent'} ne '' + && $ARGS{'UpdateContent'} ne "-- \n" + . $session{'CurrentUser'}->UserObj->Signature ) { + $ARGS{UpdateAttachments} = $session{'Attachments'}; + ProcessUpdateMessage( ARGSRef => \%ARGS, + Actions => \@Actions, + TicketObj => $Ticket ); + delete $session{'Attachments'}; + } + } +#Process status updates +my @BasicActions = ProcessTicketBasics(ARGSRef => \%ARGS, TicketObj=>$Ticket); +my @results = ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS); + +push (@Actions, @BasicActions, @results); +} + + + + + diff --git a/rt/html/Ticket/Elements/AddWatchers b/rt/html/Ticket/Elements/AddWatchers new file mode 100644 index 000000000..e9f651593 --- /dev/null +++ b/rt/html/Ticket/Elements/AddWatchers @@ -0,0 +1,97 @@ +%# 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 +
+<%$msg%>
+ +<&|/l&>Add new watchers:
+ + +% if ($Users and $Users->Count) { + +% while (my $u = $Users->Next ) { + +% } +% } + +% if ($Groups and $Groups->Count) { + +% while (my $g = $Groups->Next ) { + +% } +% } + + + + + +
+<&|/l&>Type + +<&|/l&>Username +
<&/Elements/SelectWatcherType, Name => "Ticket-AddWatcher-Principal-".$u->PrincipalId &><%$u->Name%> (<%$u->RealName%>)
+<&|/l&>Type + +<&|/l&>Group +
<&/Elements/SelectWatcherType, Name => "Ticket-AddWatcher-Principal-".$g->PrincipalId, Scope => 'queue' &><%$g->Name%> (<%$g->Description%>)
+<&|/l&>Type + +<&|/l&>Email +
+<&/Elements/SelectWatcherType, Name => "WatcherTypeEmail1" &> + + +
+<&/Elements/SelectWatcherType, Name => "WatcherTypeEmail2" &> + + +
+<&/Elements/SelectWatcherType, Name => "WatcherTypeEmail3" &> + + +
+ +<%INIT> +my ($msg, $Users, $Groups); + +if ($UserString) { + $Users = RT::Users->new($session{'CurrentUser'}); + $Users->Limit(FIELD => $UserField, VALUE => $UserString, OPERATOR => $UserOp); + } + +if ($GroupString) { + $Groups = RT::Groups->new($session{'CurrentUser'}); + $Groups->Limit(FIELD => 'Domain', OPERATOR => '=', VALUE => 'UserDefined'); + $Groups->Limit(FIELD => $GroupField, VALUE => $GroupString, OPERATOR => $GroupOp); + } + + + +<%ARGS> +$UserField => 'Name' +$UserOp => '=' +$UserString => undef +$GroupField => 'Name' +$GroupOp => '=' +$GroupString => undef + diff --git a/rt/html/Ticket/Elements/BulkLinks b/rt/html/Ticket/Elements/BulkLinks new file mode 100644 index 000000000..e6b9cd54f --- /dev/null +++ b/rt/html/Ticket/Elements/BulkLinks @@ -0,0 +1,53 @@ +%# 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
<&|/l&>Merge into: <&|/l&>(only one ticket)
<&|/l&>Depends on:
<&|/l&>Depended on by:
<&|/l&>Parents:
<&|/l&>Children:
<&|/l&>Refers to:
<&|/l&>Referred to by:
diff --git a/rt/html/Ticket/Elements/EditBasics b/rt/html/Ticket/Elements/EditBasics new file mode 100644 index 000000000..5d66b1fc1 --- /dev/null +++ b/rt/html/Ticket/Elements/EditBasics @@ -0,0 +1,79 @@ +%# 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 + + + +
+ + + +
<&|/l&>Subject: + +
+
+ + + + + + + +
+ <& /Elements/ShadedBox, + title => loc('Status'), + content => $SelectStatus &> + + <& /Elements/ShadedBox, + title => loc('Time Worked'), + content => "TimeWorked."\" SIZE=5>" &> + + <& /Elements/ShadedBox, + title => loc('Time Left'), + content => "TimeLeft."\" SIZE=5>" +&> + + <& /Elements/ShadedBox, + title => loc('Priority'), + content => "Priority."\" SIZE=3>" &> + + <& /Elements/ShadedBox, + title => loc('Final Priority'), + content => "FinalPriority."\" SIZE=3>" &> + + <& /Elements/ShadedBox, + title => loc('Queue'), + content => "$SelectQueue" &> +
+
+ +<%INIT> +#It's hard to do this inline, so we'll preload the html of the selectstatus in here. +my $SelectStatus = $m->scomp("/Elements/SelectStatus", Name => 'Status', Default=> $TicketObj->Status); +my $SelectQueue = $m->scomp("/Elements/SelectQueue", Name => 'Queue', Default =>$TicketObj->QueueObj->Id); + + +<%ARGS> + +$TicketObj => undef + diff --git a/rt/html/Ticket/Elements/EditCustomField b/rt/html/Ticket/Elements/EditCustomField new file mode 100644 index 000000000..1fc7d4388 --- /dev/null +++ b/rt/html/Ticket/Elements/EditCustomField @@ -0,0 +1,70 @@ +%# 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 +% my $Values; +% if ($TicketObj) { +% $Values = $TicketObj->CustomFieldValues($CustomField->id); +% } +% if ($CustomField->Type eq 'FreeformSingle') { + +% } elsif ($CustomField->Type eq 'FreeformMultiple') { +% my $content; +% if ($TicketObj) { +% while (my $value = $Values->Next ) { +% $content .= $value->Content; +% } +% } + + +% } elsif ($CustomField->Type =~ /^Select/) { + + +% } +<%ARGS> +$TicketObj => undef +$CustomField => undef +$NamePrefix => undef +$Rows => 5 +$Cols=> 15 +$Default => undef + diff --git a/rt/html/Ticket/Elements/EditCustomFields b/rt/html/Ticket/Elements/EditCustomFields new file mode 100644 index 000000000..6b2738965 --- /dev/null +++ b/rt/html/Ticket/Elements/EditCustomFields @@ -0,0 +1,74 @@ +%# 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 + + + + + +
+ + +% my @entry_fields; +% my $i; +% my $cfcount = $CustomFields->Count; +% $cfcount++ if ($cfcount % 2) ; # if we have an odd number of +% #custom fields, fudge it so we know where to put in the table break +% while (my $CustomField = $CustomFields->Next()) { +% if ($cfcount == 2 * $i) { +
+
+ +% } +% $i++; + + + + +% } +
+ <%$CustomField->Name%>
+ <%$CustomField->FriendlyType%> +
<& EditCustomField, TicketObj => $TicketObj, CustomField => $CustomField, NamePrefix => $NamePrefix &>
+
+ +<%INIT> +my $CustomFields; +my $NamePrefix; + +if ($TicketObj) { + $CustomFields = $TicketObj->QueueObj->CustomFields(); + $NamePrefix = "Ticket-".$TicketObj->Id."-CustomField-"; + +} else { + $CustomFields = $QueueObj->CustomFields(); + $NamePrefix = "CustomField-"; +} + + + + +<%ARGS> +$TicketObj => undef +$QueueObj => undef + diff --git a/rt/html/Ticket/Elements/EditDates b/rt/html/Ticket/Elements/EditDates new file mode 100644 index 000000000..1f3bf1b49 --- /dev/null +++ b/rt/html/Ticket/Elements/EditDates @@ -0,0 +1,53 @@ +%# 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 + + + + + + + + + + + + + + + + + + +
<&|/l&>Starts:<& /Elements/SelectDate, menu_prefix => 'Starts', current => 0 &> + (<% $TicketObj->StartsObj->AsString %>)
<&|/l&>Started:<& /Elements/SelectDate, menu_prefix => 'Started', current => 0 &> (<%$TicketObj->StartedObj->AsString %>)
+ <&|/l&>Last Contact: + + <& /Elements/SelectDate, menu_prefix => 'Told', current => 0 &> (<% $TicketObj->ToldObj->AsString %>) +
<&|/l&>Due: + <& /Elements/SelectDate, menu_prefix => 'Due', current => 0 &> (<% $TicketObj->DueObj->AsString %>) +
+<%ARGS> +$TicketObj => undef + + diff --git a/rt/html/Ticket/Elements/EditLinks b/rt/html/Ticket/Elements/EditLinks new file mode 100644 index 000000000..7a522dda6 --- /dev/null +++ b/rt/html/Ticket/Elements/EditLinks @@ -0,0 +1,150 @@ +%# 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 + + + + + +
+

<&|/l&>Current Relationships

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
<&|/l&>(Check box to delete)
<&|/l&>Depends on: +% while (my $link = $Ticket->DependsOn->Next) { +% my $member = $link->TargetObj; + + <%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> + [<%$member->Status%>]
+% } +
<&|/l&>Depended on by: +% while (my $link = $Ticket->DependedOnBy->Next) { +% my $member = $link->BaseObj; + + <%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> + [<%$member->Status%>]
+% } +
<&|/l&>Parents: +% while (my $link = $Ticket->MemberOf->Next) { +% my $member = $link->TargetObj; + + <%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> + [<%$member->Status%>]
+% } +
<&|/l&>Children: +% while (my $link = $Ticket->Members->Next) { + +% my $member = $link->BaseObj; + <%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> + [<%$member->Status%>]
+% } +
<&|/l&>Refers to: +% while (my $link = $Ticket->RefersTo->Next) { + +% if ($link->TargetURI->IsLocal) { +% my $member = $link->TargetObj; + <%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]
+% } else { + <%$link->TargetURI->Resolver->AsString%>
+% } +%} +
<&|/l&>Referred to by: +% while (my $link = $Ticket->ReferredToBy->Next) { + +% if ($link->BaseURI->IsLocal) { +% my $member = $link->BaseObj; + <%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]
+% } else { + <%$link->BaseURI->Resolver->AsString%>
+%} +% } +
+ +
+

<&|/l&>New Relationships

+<&|/l&>Enter tickets or URIs to link tickets to. Seperate multiple entries with spaces.
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
<&|/l&>Merge into: <&|/l&>(only one ticket)
<&|/l&>Depends on:
<&|/l&>Depended on by:
<&|/l&>Parents:
<&|/l&>Children:
<&|/l&>Refers to:
<&|/l&>Referred to by:
+
+ + + +<%ARGS> +$Ticket => undef + diff --git a/rt/html/Ticket/Elements/EditPeople b/rt/html/Ticket/Elements/EditPeople new file mode 100644 index 000000000..1ab8f4ace --- /dev/null +++ b/rt/html/Ticket/Elements/EditPeople @@ -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 + + + + +
+ +

<&|/l&>New watchers

+<&|/l&>Find people whose
+<& /Elements/SelectUsers &> + +
+<&|/l&>Find group whose
+<& /Elements/SelectGroups &> + + +<& AddWatchers, Ticket => $Ticket, UserString => $UserString, + UserOp => $UserOp, UserField => $UserField, + GroupString => $GroupString, GroupOp => $GroupOp, + GroupField => $GroupField &> +
+

<&|/l&>Owner

+<&|/l&>Owner: <& /Elements/SelectOwner, Name => 'Owner', QueueObj => $Ticket->QueueObj, TicketObj => $Ticket, Default => $Ticket->OwnerObj->Id &> +

<&|/l&>Current watchers

+<&|/l&>(Check box to delete)
+ +<&|/l&>Requestors: +<& EditWatchers, TicketObj => $Ticket, Watchers => $Ticket->Requestors &> + +<&|/l&>Cc: +<& EditWatchers, TicketObj => $Ticket, Watchers => $Ticket->Cc &> + +<&|/l&>Administrative Cc: +<& EditWatchers, TicketObj => $Ticket, Watchers => $Ticket->AdminCc &> + +
+ +<%ARGS> +$UserField => undef +$UserOp => undef +$UserString => undef +$GroupField => undef +$GroupOp => undef +$GroupString => undef +$Ticket => undef + diff --git a/rt/html/Ticket/Elements/EditWatchers b/rt/html/Ticket/Elements/EditWatchers new file mode 100644 index 000000000..145071cec --- /dev/null +++ b/rt/html/Ticket/Elements/EditWatchers @@ -0,0 +1,52 @@ +%# 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> +my $Members = $Watchers->MembersObj; + +<%ARGS> +$TicketObj => undef +$Watchers => undef + + + + diff --git a/rt/html/Ticket/Elements/ShowAttachments b/rt/html/Ticket/Elements/ShowAttachments new file mode 100644 index 000000000..22b60d11b --- /dev/null +++ b/rt/html/Ticket/Elements/ShowAttachments @@ -0,0 +1,76 @@ +%# 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 +% if (keys %documents) { +<& /Elements/TitleBoxStart, title => loc('Attachments'), + title_class=> 'inverse', + color => "#336699" &> + +% foreach my $key (keys %documents) { +% my $fontsize='size="-1"'; + +<%$key%>
+
    +% foreach my $rev (@{$documents{$key}}) { + +<%PERL> +my $size = $rev->ContentLength; + +if ($size) { + if ($size > 1024) { + $size = int($size/102.4)/10 . "k"; + } + else { + $size = $size ."b"; + } + + + +
  • > + <%$rev->CreatedAsString%> (<% $size %>)
  • +% } +% $fontsize='size="-2"'; +% } +
+ +% } +<& /Elements/TitleBoxEnd &> +
+% } + +<%INIT> +my %documents; +my $transactions = $Ticket->Transactions(); +while (my $trans = $transactions->Next()) { + my $attachments = $trans->Attachments(); + while (my $attach = $attachments->Next()) { + next unless ($attach->Filename()); + # most recent at the top + unshift (@{$documents{$attach->Filename}}, $attach); + } +} + +<%ARGS> +$Ticket => undef + + diff --git a/rt/html/Ticket/Elements/ShowBasics b/rt/html/Ticket/Elements/ShowBasics new file mode 100644 index 000000000..ad23e8c8c --- /dev/null +++ b/rt/html/Ticket/Elements/ShowBasics @@ -0,0 +1,54 @@ +%# 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 + + + + + + + + + + + + + + + + + + + + + +
<&|/l&>Id:<%$Ticket->Id %>
<&|/l&>Status:<&|/l&><% $Ticket->Status%>
<&|/l&>Worked:<&|/l, $TimeWorked &>[_1] min
<&|/l&>Priority:<%$Ticket->Priority%>/<%$Ticket->FinalPriority %>
<&|/l&>Queue:<%$Ticket->QueueObj->Name%>
+<%INIT> +my $TimeWorked = $Ticket->TimeWorked; +if ($Ticket->TimeLeft > 0 ) { + $TimeWorked = $Ticket->TimeWorked."/".$Ticket->TimeLeft; +} + +<%ARGS> +$Ticket => undef + diff --git a/rt/html/Ticket/Elements/ShowCustomFields b/rt/html/Ticket/Elements/ShowCustomFields new file mode 100644 index 000000000..50d28f0d1 --- /dev/null +++ b/rt/html/Ticket/Elements/ShowCustomFields @@ -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 + +% my @entry_fields; +% while (my $CustomField = $CustomFields->Next()) { +% my $Values = $Ticket->CustomFieldValues($CustomField->Id); + + + + +% } +
<%$CustomField->Name%>: +% while (my $Value = $Values->Next()) { +<%$Value->Content%>
+% } +% unless ($Values->Count()) { +<&|/l&>(no value) +% } +
+<%INIT> +my $CustomFields = $Ticket->QueueObj->CustomFields(); + +<%ARGS> +$Ticket => undef + diff --git a/rt/html/Ticket/Elements/ShowDates b/rt/html/Ticket/Elements/ShowDates new file mode 100644 index 000000000..da7f75bb6 --- /dev/null +++ b/rt/html/Ticket/Elements/ShowDates @@ -0,0 +1,56 @@ +%# 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
<&|/l&>Created:<% $Ticket->CreatedObj->AsString %>
<&|/l&>Starts:<% $Ticket->StartsObj->AsString %>
<&|/l&>Started:<% $Ticket->StartedObj->AsString %>
<&|/l&>Last Contact:<% $Ticket->ToldObj->AsString %>
<&|/l&>Due:<% $Ticket->DueObj->AsString %>
<&|/l&>Closed:<% $Ticket->ResolvedObj->AsString %>
<&|/l&>Updated:<% $Ticket->LastUpdated ? (loc("[_1] by [_2]", $Ticket->LastUpdatedAsString, $Ticket->LastUpdatedByObj->Name)) : loc("Never") | h %>
+<%ARGS> +$Ticket => undef + diff --git a/rt/html/Ticket/Elements/ShowDependencies b/rt/html/Ticket/Elements/ShowDependencies new file mode 100644 index 000000000..b7f396871 --- /dev/null +++ b/rt/html/Ticket/Elements/ShowDependencies @@ -0,0 +1,41 @@ +%# 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 +<&|/l&>Depends on:
+% while (my $Link = $Ticket->DependsOn->Next) { +% my $member = $Link->TargetObj; +<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> +[<%$member->Status%>] +
+% } +<&|/l&>Depended on by:
+% while (my $Link = $Ticket->DependedOnBy->Next) { +% my $member = $Link->TargetObj; +<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> +[<%$member->Status%>] +
+% } + +<%ARGS> +$Ticket => undef + diff --git a/rt/html/Ticket/Elements/ShowHistory b/rt/html/Ticket/Elements/ShowHistory new file mode 100644 index 000000000..2958f8706 --- /dev/null +++ b/rt/html/Ticket/Elements/ShowHistory @@ -0,0 +1,86 @@ +%# 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 +<%perl> + if ($ShowDisplayModes or $ShowTitle) { +my $title; +my $titleright; +if ($ShowTitle) { + $title = loc('History'); +} +else { + $title = ' '; +} +$titleright = loc('Display mode') . ":"; +if ($ShowHeaders && $ShowHeaders == $Ticket->Id ) { + $titleright .= "[" + . loc("Brief headers") + . "] [" + . loc("Full headers") . "]"; +} +else { + $titleright .= "[" + . loc("Brief headers") + . "] [" + . loc("Full headers") . "]"; +} + +<& /Elements/TitleBoxStart, title => $title, titleright => $titleright, bodyclass=> ''&> +% } + + +% while (my $Transaction = $Transactions->Next) { +% my $skip = 0; +% $m->comp('/Elements/Callback', _CallbackName => 'SkipTransaction', Transaction => $Transaction, skip => \$skip, %ARGS); +% next if $skip; +% $i++; +% if ($Transactions->IsLast) { + +% } + <& ShowTransaction, Ticket => $Ticket, Transaction => $Transaction, ShowHeaders => $ShowHeaders, Collapsed => $Collapsed, RowNum => $i, ShowTitleBarCommands => $ShowTitleBarCommands &> +% } +
+% if ($ShowDisplayModes or $ShowTitle) { +<& /Elements/TitleBoxEnd &> +% } +<%INIT> + +my $Transactions = $Ticket->Transactions; +my $i; + + + +<%ARGS> +$URIFile => 'Display.html' +$Ticket => undef +$ShowHeaders => undef +$Collapsed => undef +$ShowTitle => 1 +$ShowDisplayModes => 1 +$ShowTitleBarCommands => 1 + diff --git a/rt/html/Ticket/Elements/ShowLink b/rt/html/Ticket/Elements/ShowLink new file mode 100644 index 000000000..493fd95a5 --- /dev/null +++ b/rt/html/Ticket/Elements/ShowLink @@ -0,0 +1,40 @@ +%# 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 + +% if ($URI->IsLocal) { +% my $member = $URI->Object; +% if (UNIVERSAL::isa($member, "RT::Ticket")) { +<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<% loc($member->Status) %>] +% } elsif ( UNIVERSAL::can($member, 'Name')) { +<%$URI->Resolver->AsString%>: <%$member->Name%> +% } else { +<%$URI->Resolver->AsString%> +% } +% } else { +<%$URI->Resolver->AsString%> +% } + +<%ARGS> +$URI => undef + diff --git a/rt/html/Ticket/Elements/ShowLinks b/rt/html/Ticket/Elements/ShowLinks new file mode 100644 index 000000000..f88a6008d --- /dev/null +++ b/rt/html/Ticket/Elements/ShowLinks @@ -0,0 +1,87 @@ +%# 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 + + + + + + + + + + + + + + + + + + + + + + + + + + +% # Allow people to add more rows to the table +% $m->comp('/Elements/Callback', %ARGS ); + +
<&|/l&>Depends on: +
    +% while (my $Link = $Ticket->DependsOn->Next) { +
  • <& ShowLink, URI => $Link->TargetURI &> +% } +
+
<&|/l&>Depended on by: +
    +% while (my $Link = $Ticket->DependedOnBy->Next) { +
  • <& ShowLink, URI => $Link->BaseURI &> +% } +
+
<&|/l&>Parents: +
    +% while (my $Link = $Ticket->MemberOf->Next) { +
  • <& ShowLink, URI => $Link->TargetURI &> +% } +
+
<&|/l&>Children:<& /Ticket/Elements/ShowMembers, Ticket => $Ticket &>
<&|/l&>Refers to: +
    +% while (my $Link = $Ticket->RefersTo->Next) { +
  • <& ShowLink, URI => $Link->TargetURI &> +% } +
+
<&|/l&>Referred to by: +
    +% while (my $Link = $Ticket->ReferredToBy->Next) { +
  • <& ShowLink, URI => $Link->BaseURI &> +% } +
+
+ +<%ARGS> +$Ticket => undef + diff --git a/rt/html/Ticket/Elements/ShowMemberOf b/rt/html/Ticket/Elements/ShowMemberOf new file mode 100644 index 000000000..79e0a3ba2 --- /dev/null +++ b/rt/html/Ticket/Elements/ShowMemberOf @@ -0,0 +1,35 @@ +%# 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 +
    +% my $memberof = $Ticket->MemberOf; +% while (my $member_of = $memberof->Next) { +
  • <%$member_of->Id%>: <%$member_of->Subject%> [<%$member_of->Status%>] +% } +
+ +<%INIT> + +<%ARGS> +$Ticket => undef + diff --git a/rt/html/Ticket/Elements/ShowMembers b/rt/html/Ticket/Elements/ShowMembers new file mode 100644 index 000000000..e1016626a --- /dev/null +++ b/rt/html/Ticket/Elements/ShowMembers @@ -0,0 +1,45 @@ +%# 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 +% if ($members->Count) { +
    +% while (my $link = $members->Next) { +% my $member= $link->BaseObj; +
  • <%$member->Id%>: <%$member->Subject%> [<%loc($member->Status)%>]
    +% if ($depth < 8) { +<&/Ticket/Elements/ShowMembers, Ticket => $member, depth => ($depth+1) &> +% } +% } +
+% } + +<%INIT> + +my $members = $Ticket->Members; + + + +<%ARGS> +$Ticket => undef +$depth => 1 + diff --git a/rt/html/Ticket/Elements/ShowMessageHeaders b/rt/html/Ticket/Elements/ShowMessageHeaders new file mode 100644 index 000000000..11d873c3e --- /dev/null +++ b/rt/html/Ticket/Elements/ShowMessageHeaders @@ -0,0 +1,32 @@ +%# 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 +<%$content |n%> +<%INIT> +my $content = $Headers; +RT::Interface::Web::EscapeUTF8(\$content); +$m->comp('/Elements/Callback', content => \$content, %ARGS); + +<%ARGS> +$Headers => undef + diff --git a/rt/html/Ticket/Elements/ShowMessageStanza b/rt/html/Ticket/Elements/ShowMessageStanza new file mode 100644 index 000000000..b0998068f --- /dev/null +++ b/rt/html/Ticket/Elements/ShowMessageStanza @@ -0,0 +1,51 @@ +%# 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 +<%perl> +foreach my $stanza (@$Message) { + if ( ref $stanza eq "ARRAY" ) { + $m->comp( 'ShowMessageStanza', + Depth => $Depth + 1, + Transaction => $Transaction, + Message => $stanza ); + } + elsif ( ref $stanza eq "HASH" ) { + my $content = $stanza->{raw}; + RT::Interface::Web::EscapeUTF8(\$content); + $m->comp('/Elements/Callback', content => \$content, %ARGS); + $content =~ s/\n/
/gi; + + +<%$content |n%>
+% } +% } +<%INIT> +use URI::URL; +my $server = 'fsck.com'; +my @colors = ('#000000', '#660000', '#006600', '#000066', '#cc0000', '#00cc00', '#0000cc', '#ff0000', '#00ff00', '#0000ff'); + +<%ARGS> +$Message => undef +$Depth => 0 +$Transaction => undef + diff --git a/rt/html/Ticket/Elements/ShowPeople b/rt/html/Ticket/Elements/ShowPeople new file mode 100644 index 000000000..0b8026949 --- /dev/null +++ b/rt/html/Ticket/Elements/ShowPeople @@ -0,0 +1,45 @@ +%# 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 + + + + + + + + + + + + + + + + + +
<&|/l&>Owner:<%$Ticket->OwnerObj->Name%>
<&|/l&>Requestors:<%$Ticket->RequestorAddresses%>
<&|/l&>Cc:<%$Ticket->CcAddresses%>
<&|/l&>AdminCc:<%$Ticket->AdminCcAddresses%>
+<%ARGS> +$Ticket => undef + + diff --git a/rt/html/Ticket/Elements/ShowReferences b/rt/html/Ticket/Elements/ShowReferences new file mode 100644 index 000000000..831923b2b --- /dev/null +++ b/rt/html/Ticket/Elements/ShowReferences @@ -0,0 +1,50 @@ +%# 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 +
    +% while (my $Link = $Ticket->RefersTo->Next) { +
  • +% if ($Link->TargetURI->IsLocal) { +% my $member = $Link->TargetObj; + +<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]
    +% } else { +<%$Link->Target%> +% } +%} + + + +% while (my $Link = $Ticket->ReferredToBy->Next) { +
  • +% if ($Link->BaseURI->IsLocal) { +% my $member = $Link->BaseObj; +<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]
    +% } else { +<%$Link->Base%> +%} +% } +
+<%ARGS> +$Ticket => undef + diff --git a/rt/html/Ticket/Elements/ShowRequestor b/rt/html/Ticket/Elements/ShowRequestor new file mode 100644 index 000000000..cc91f590f --- /dev/null +++ b/rt/html/Ticket/Elements/ShowRequestor @@ -0,0 +1,59 @@ +%# 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 +<%PERL> +my $rows = 10; +my $people = $Ticket->Requestors->MembersObj; +while (my $member=$people->Next) { +my $requestor = $member->MemberObj->Object; +my $name=$requestor->RealName || $requestor->EmailAddress; +my $tickets = RT::Tickets->new($session{'CurrentUser'}); +$tickets->LimitWatcher(TYPE => 'Requestor', VALUE => $requestor->EmailAddress ); +$tickets->LimitStatus( VALUE => 'open'); +$tickets->LimitStatus( VALUE => 'new'); +$tickets->RowsPerPage($rows); +$tickets->OrderBy(FIELD => 'Priority', + ORDER => 'DESC'); + + +% unless ($requestor->Privileged) { +<& /Elements/TitleBoxStart, + title => "id."\">".loc("More about [_1]", $name)."" &> + +<&|/l&>Comments about this user:
+<% ($requestor->Comments || loc("No comment entered about this user")) %>
+ +<&|/l, $rows &>This user's [_1] highest priority tickets:
+ +<& /Elements/TitleBoxEnd &> + +% } +%} +<%ARGS> +$Ticket=>undef +$DisplayPath => "/Ticket/Display.html" + diff --git a/rt/html/Ticket/Elements/ShowSummary b/rt/html/Ticket/Elements/ShowSummary new file mode 100644 index 000000000..6ae875832 --- /dev/null +++ b/rt/html/Ticket/Elements/ShowSummary @@ -0,0 +1,82 @@ +%# 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 => loc('The Basics'), + title_href =>"$RT::WebPath/Ticket/Modify.html?id=".$Ticket->Id, + title_class=> 'inverse', + color => "#993333" &> + <& /Ticket/Elements/ShowBasics, Ticket => $Ticket &> + <& /Elements/TitleBoxEnd &> +
+% if ($Ticket->QueueObj->CustomFields()->First) { + <& /Elements/TitleBoxStart, title => loc('Custom Fields'), + title_href =>"$RT::WebPath/Ticket/Modify.html?id=".$Ticket->Id, + title_class=> 'inverse', + color => "#993333" &> + <& /Ticket/Elements/ShowCustomFields, Ticket => $Ticket &> + <& /Elements/TitleBoxEnd &> + +
+% } + <& /Elements/TitleBoxStart, title => loc('People'), + title_href =>"$RT::WebPath/Ticket/ModifyPeople.html?id=".$Ticket->Id, + title_class=> 'inverse', + color => "#333399" &> + <& /Ticket/Elements/ShowPeople, Ticket => $Ticket &> + <& /Elements/TitleBoxEnd &> +
+
+ + <& /Elements/TitleBoxStart, title => loc("Dates"), + title_href =>"$RT::WebPath/Ticket/ModifyDates.html?id=".$Ticket->Id, + title_class=> 'inverse', + color => "#663366" &> + <& /Ticket/Elements/ShowDates, Ticket => $Ticket &> + <& /Elements/TitleBoxEnd &> +
+ <& /Elements/TitleBoxStart, title => loc('Relationships'), + title_href => "$RT::WebPath/Ticket/ModifyLinks.html?id=".$Ticket->Id, + title_class=> 'inverse', + titleright => '', color=> "#336633" &> + <& /Ticket/Elements/ShowLinks, Ticket => $Ticket &> + <& /Elements/TitleBoxEnd &> +
+ <& /Ticket/Elements/ShowAttachments, Ticket => $Ticket &> + + <& /Ticket/Elements/ShowRequestor, Ticket => $Ticket &> + + +
+<%ARGS> +$Ticket => undef + + + + + diff --git a/rt/html/Ticket/Elements/ShowTransaction b/rt/html/Ticket/Elements/ShowTransaction new file mode 100644 index 000000000..f2f89d35c --- /dev/null +++ b/rt/html/Ticket/Elements/ShowTransaction @@ -0,0 +1,169 @@ +%# 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 + +#  +   +<% $transdate|n %>  +% my $desc = $Transaction->BriefDescription; +% $m->comp('/Elements/Callback', _CallbackName => 'ModifyDisplay', text => \$desc, Transaction => $Transaction, %ARGS); +<%$Transaction->CreatorObj->Name%> - <%$TicketString%> <%$desc%> + + +<%$TimeTaken%>  +<%$titlebar_commands|n%> + +<%PERL> + +unless ($Collapsed) { + $attachments->GotoFirstItem; + while (my $message=$attachments->Next) { + #we don't want to show any empty transactions, unless they have kids + next unless ($message->ContentLength || $message->Children->Count); + + my ($headers, $quoted); + if ($ShowHeaders && ($ShowHeaders == $Ticket->Id)) { + $headers = $message->Headers; + } else { + $headers = $message->NiceHeaders; + } + chomp $headers; + if ($headers) { + # localize the common headers (like 'Subject:'), too. + eval {$headers =~ s/^([^:]+)(?=:)/loc($1)/em; } # we eval here to catch errors when 5.6 panics + } + # 13456 is a random # of about the biggest size we want to see inline text + my $MAX_INLINE_BODY = 13456; + if ($message->ContentType =~ m{^(text/plain|message|text$)}i && + $message->ContentLength < $MAX_INLINE_BODY ) { + require Text::Quoted; + $quoted = Text::Quoted::extract($message->Content); + } + + + +    +    + + +
+<& ShowMessageHeaders, Headers => $headers, Transaction => $Transaction &>
+
+<& ShowMessageStanza, Depth => 0, Message => $quoted, Transaction => $Transaction &> +
+ + + +% if ($message->Parent == 0 ) { +
+% } +<%PERL> +my $size = $message->ContentLength; + +if ($size) { + if ($size > 1024) { + $size = loc("[_1]k", int($size/102.4)/10); + } + else { + $size = loc("[_1]b", $size); + } + +<&|/l&>Download <% $message->Filename|| loc('(untitled)') %> <% $size %> +% } + + +% } +% } + + + +<%ARGS> +$Ticket => undef +$Transaction => undef +$ShowHeaders => 0 +$Collapsed => undef +$ShowTitleBarCommands => 1 +$RowNum => 1 + + +<%INIT> + + +my ($TimeTaken, $TicketString, $bgcolor); + +my $transdate = $Transaction->CreatedAsString(); +$transdate =~ s/\s/ /g; + +if ($Transaction->Type =~ /^(Create|Correspond|Comment$)/) { + if ($Transaction->IsInbound) { + $bgcolor="#336699"; + } + else { + $bgcolor="#339999"; + } +} elsif (($Transaction->Field =~ /^Owner$/) or + ($Transaction->Type =~ /^(AddWatcher|DelWatcher)$/)) { + $bgcolor="#333399"; + +} elsif ($Transaction->Type =~ /^(AddLink|DeleteLink)$/) { + $bgcolor="#336633"; +} elsif ($Transaction->Type =~ /^(Status|Set|Told)$/) { + if ($Transaction->Field =~ /^(Told|Starts|Started|Due)$/) { + $bgcolor="#663366"; + } + else { + $bgcolor="#993333"; + } +} +else { + $bgcolor="#cccccc"; +} + +if ($Ticket->Id != $Transaction->Ticket) { + $TicketString = "Ticket ".$Transaction->Ticket .": "; +} + +if ($Transaction->TimeTaken > 0) { + $TimeTaken = $Transaction->TimeTaken." min" +} +my $attachments = $Transaction->Attachments; + +my $titlebar_commands=' '; + +# If the transaction has anything attached to it at all +if ($Transaction->Attachments->First && $ShowTitleBarCommands) { + if ($Transaction->TicketObj->CurrentUserHasRight('ReplyToTicket')) { + $titlebar_commands .= + "[Ticket . "&QuoteTransaction=".$Transaction->Id. + "&Action=Respond\">". loc('Reply') ."] "; + } + if ($Transaction->TicketObj->CurrentUserHasRight('CommentOnTicket')) { + $titlebar_commands .= + "[Ticket. + "&QuoteTransaction=".$Transaction->Id. + "&Action=Comment\">". loc('Comment') ."]"; + } +} + + diff --git a/rt/html/Ticket/Elements/Tabs b/rt/html/Ticket/Elements/Tabs new file mode 100644 index 000000000..81c92e8c2 --- /dev/null +++ b/rt/html/Ticket/Elements/Tabs @@ -0,0 +1,170 @@ +%# 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/Callback, Ticket => $Ticket, actions=> $actions, tabs => $tabs, %ARGS &> +<& /Elements/Tabs, + tabs => $tabs, + actions => $actions, + current_tab => $current_tab, + current_toptab => $current_toptab, + Title => $Title &> +<%INIT> + +my $tabs = {}; +my $current_toptab = "Search/Listing.html", + my $searchtabs = { new => { title => loc('New Search'), + path => 'Search/Listing.html?ClearRestrictions=1'} + + +} ; +my $actions; + +if ( $Ticket) { + +my $id = $Ticket->id(); + +if ( defined $session{'tickets'} ) { + + +my $item_map = $session{'tickets'}->ItemMap; + + # Don't $current_toptab = display prev links if we're on the first ticket + + if ($item_map->{$Ticket->Id}->{prev}) { + $searchtabs->{'_a'} = { + class => "nav", + path => "Ticket/Display.html?id=" . $item_map->{first}, + title => '<< ' . loc('First') }; + $searchtabs->{"_b"} = { class => "nav", + path => "Ticket/Display.html?id=" . $item_map->{$Ticket->Id}->{prev}, + title => '< ' . loc('Prev') }; + } + + + # Don't display next links if we're on the last ticket + if ($item_map->{$Ticket->Id}->{next}) { + $searchtabs->{'d'} = { class => "nav", + path => "Ticket/Display.html?id=" . $item_map->{$Ticket->Id}->{next}, + title => loc('Next') . ' >' }; + $searchtabs->{'e'} = { + class => "nav", + path => "Ticket/Display.html?id=" . $item_map->{last}, + title => loc('Last') . ' >>' }; + } +} + + + +$tabs->{"this"} = { class => "currentnav", + path => "Ticket/Display.html?id=" . $Ticket->id, + title => "#" . $id, + current_subtab => $current_subtab }; + +my $ticket_page_tabs = { + _A => { title => loc('Display'), + path => "Ticket/Display.html?id=" . $id, }, + + _Ab => { title => loc('History'), + path => "Ticket/History.html?id=" . $id, }, + _B => { title => loc('Basics'), + path => "Ticket/Modify.html?id=" . $id, }, + + _C => { title => loc('Dates'), + path => "Ticket/ModifyDates.html?id=" . $id, }, + _D => + { title => loc('People'), path => "Ticket/ModifyPeople.html?id=" . $id, }, + _E => { title => loc('Links'), + path => "Ticket/ModifyLinks.html?id=" . $id, }, + _F => { title => loc('Jumbo'), + path => "Ticket/ModifyAll.html?id=" . $id, + seperator => 1 + }, + +}; + +foreach my $tab ( sort keys %{$ticket_page_tabs} ) { + if ( $ticket_page_tabs->{$tab}->{'path'} eq $current_tab ) { + $ticket_page_tabs->{$tab}->{"subtabs"} = $subtabs; + $tabs->{'this'}->{"current_subtab"} = + $ticket_page_tabs->{$tab}->{"path"}; + } +} +$tabs->{'this'}->{"subtabs"} = $ticket_page_tabs; +$current_tab = "Ticket/Display.html?id=" . $id; + + + + + +if ( $Ticket->CurrentUserHasRight('ModifyTicket') + or $Ticket->CurrentUserHasRight('ReplyToTicket') ) { + $actions->{'A'} = { title => loc('Reply'), + path => "Ticket/Update.html?Action=Respond&id=" . $id, + }; +} + +if ( $Ticket->CurrentUserHasRight('ModifyTicket') ) { + if ( $Ticket->Status ne 'resolved' ) { + $actions->{'B'} = { + + path => "Ticket/Update.html?Action=Comment&DefaultStatus=resolved&id=" . $id, + title => loc('Resolve') }; + } + if ( $Ticket->Status ne 'open' ) { + $actions->{'C'} = { path => "Ticket/Display.html?Status=open&id=" . $id, + title => loc('Open it') }; + } +} + +if ( $Ticket->CurrentUserHasRight('OwnTicket') ) { + if ( $Ticket->OwnerObj->id == $RT::Nobody->id ) { + $actions->{'D'} = { path => "Ticket/Display.html?Action=Take&id=" . $id, + title => loc('Take') }; + } + elsif ( $Ticket->OwnerObj->id != $session{CurrentUser}->id ) { + $actions->{'E'} = {path => "Ticket/Display.html?Action=Steal&id=" . $id, + title => loc('Steal') }; + } +} + +if ( $Ticket->CurrentUserHasRight('ModifyTicket') + or $Ticket->CurrentUserHasRight('CommentOnTicket') ) { + $actions->{'F'} = { title => loc('Comment'), + path => "Ticket/Update.html?Action=Comment&id=" . $id, + }; +} +} +$tabs->{"g"} = { path => 'Search/Listing.html', + title => loc('Search'), + separator => 1, + subtabs => $searchtabs }; + + + +<%ARGS> +$Ticket => undef +$subtabs => undef +$current_tab => undef +$current_subtab => undef +$Title => undef + diff --git a/rt/html/Ticket/History.html b/rt/html/Ticket/History.html new file mode 100644 index 000000000..cb02f1c75 --- /dev/null +++ b/rt/html/Ticket/History.html @@ -0,0 +1,52 @@ +%# 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("Ticket History # [_1] [_2]", $Ticket->Id, $Ticket->Subject) &> +<& /Ticket/Elements/Tabs, + Ticket => $Ticket, current_tab => 'Ticket/History.html?id='.$Ticket->id, + Title => loc("Ticket History # [_1] [_2]", $Ticket->Id, $Ticket->Subject) &> + +
+ +<& /Ticket/Elements/ShowHistory , Ticket => $Ticket, ShowHeaders => $ARGS{'ShowHeaders'}, URIFile => 'History.html' &> + + +<%ARGS> +$id => undef + + +<%INIT> + + + +my $Ticket = LoadTicket ($id); + +unless ($Ticket->CurrentUserHasRight('ShowTicket')) { + Abort("No permission to view ticket"); +} + + + + + + diff --git a/rt/html/Ticket/Modify.html b/rt/html/Ticket/Modify.html new file mode 100644 index 000000000..c97fd0994 --- /dev/null +++ b/rt/html/Ticket/Modify.html @@ -0,0 +1,63 @@ +%# 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('Modify ticket #[_1]', $TicketObj->Id) &> +<& /Ticket/Elements/Tabs, + Ticket => $TicketObj, current_subtab => "Ticket/Modify.html?id=".$TicketObj->Id, + Title => loc('Modify ticket #[_1]', $TicketObj->Id) &> + +<& /Elements/ListActions, actions => \@results &> +
+ + +<& /Elements/TitleBoxStart, title => loc('Modify ticket #[_1]',$TicketObj->Id), color=> "#993333", width => "100%" &> +<& Elements/EditBasics, TicketObj => $TicketObj &> +<& Elements/EditCustomFields, TicketObj => $TicketObj &> +<& /Elements/TitleBoxEnd &> + +<& /Elements/Submit, Label => loc('Save Changes'), Caption => loc("If you've updated anything above, be sure to"), color => "#993333" &> +
+<%INIT> + +my $TicketObj = LoadTicket($id); +my $CustomFields = $TicketObj->QueueObj->CustomFields(); + +# Now let callbacks have a chance at editing %ARGS +$m->comp('/Elements/Callback', TicketObj => $TicketObj, CustomFields => $CustomFields, %ARGS); + +my @results = ProcessTicketBasics(TicketObj => $TicketObj, ARGSRef => \%ARGS); +my @cf_results = ProcessTicketCustomFieldUpdates(ARGSRef => \%ARGS); +push (@results, @cf_results); + +# TODO: display the results, even if we can't display the ticket + +unless ($TicketObj->CurrentUserHasRight('ShowTicket')) { + Abort("No permission to view ticket"); +} + + + + +<%ARGS> +$id => undef + diff --git a/rt/html/Ticket/ModifyAll.html b/rt/html/Ticket/ModifyAll.html new file mode 100644 index 000000000..a50689398 --- /dev/null +++ b/rt/html/Ticket/ModifyAll.html @@ -0,0 +1,158 @@ +%# 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("Ticket #[_1] Jumbo update: [_2]", $Ticket->Id, $Ticket->Subject) &> +<& /Ticket/Elements/Tabs, + Ticket => $Ticket, + current_tab => "Ticket/ModifyAll.html?id=".$Ticket->Id, + Title => loc("Ticket #[_1] Jumbo update: [_2]", $Ticket->Id, $Ticket->Subject) &> + +<& /Elements/ListActions, actions => \@results &> + +
+ + + +<& /Elements/TitleBoxStart, title => loc('Modify ticket # [_1]', $Ticket->Id), color=> "#993333", width => "100%" &> +<& Elements/EditBasics, TicketObj => $Ticket &> +<& Elements/EditCustomFields, TicketObj => $Ticket &> +<& /Elements/TitleBoxEnd &> + +
+ +<& /Elements/TitleBoxStart, title => loc('Dates'), width => "100%", color => "#663366" &> +<& Elements/EditDates, TicketObj => $Ticket &> +<& /Elements/TitleBoxEnd &> + +
+ + +<& /Elements/TitleBoxStart, title => loc('People'),width => "100%", color=> "#333399" &> +<& Elements/EditPeople, Ticket => $Ticket, UserField => $UserField, UserString => $UserString, UserOp => $UserOp &> +<& /Elements/TitleBoxEnd &> + +
+ +<& /Elements/TitleBoxStart, title => loc('Relationships'), color => "#336633"&> +<& Elements/EditLinks, Ticket => $Ticket &> +<& /Elements/TitleBoxEnd &> + +
+ +<& /Elements/TitleBoxStart, title => loc('Update ticket') &> + + + + + + + + + + + + + + + + + +
<&|/l&>Update Type: + +
<&|/l&>Subject:
<&|/l&>Attach:
<&|/l&>Content:<& /Elements/MessageBox, Name=>"UpdateContent", QuoteTransaction=>$ARGS{QuoteTransaction} &>
+<& /Elements/TitleBoxEnd &> + + +<& /Elements/Submit, Label => loc('Save Changes'), Caption => loc("If you've updated anything above, be sure to"), color => "#333399" &> +
+ +<%INIT> + + + +my $Ticket = LoadTicket($id); + +my $CanRespond = 0; +my $CanComment = 0; + + +$CanRespond = 1 if ( $Ticket->CurrentUserHasRight('ReplyToTicket') or + $Ticket->CurrentUserHasRight('ModifyTicket') ); + +$CanComment = 1 if ( $Ticket->CurrentUserHasRight('CommentOnTicket') or + $Ticket->CurrentUserHasRight('ModifyTicket') ); + + +my (@wresults, @results, @dresults, @lresults, @cf_results); + +unless ($OnlySearchForPeople) { + @wresults = ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS); + @results = ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS); + @cf_results = ProcessTicketCustomFieldUpdates(ARGSRef => \%ARGS); + @dresults = ProcessTicketDates( TicketObj => $Ticket, ARGSRef => \%ARGS); + @lresults = ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS); + + $ARGS{'UpdateContent'} =~ s/\r\n/\n/g; + + if ($ARGS{'UpdateContent'} && + $ARGS{'UpdateContent'} ne '' && + $ARGS{'UpdateContent'} ne "-- \n" . + $session{'CurrentUser'}->UserObj->Signature + ) { + ProcessUpdateMessage(TicketObj => $Ticket, + ARGSRef=>\%ARGS, + Actions=>\@results); + } +} +push @results, @wresults; +push @results, @dresults; +push @results, @lresults; +push @results, @cf_results; + +# If they've gone and moved the ticket to somewhere they can't see, etc... +# TODO: display the results, even if we can't display the ticket. + +unless ($Ticket->CurrentUserHasRight('ShowTicket')) { + Abort("No permission to view ticket"); +} + + + + + + +<%ARGS> +$OnlySearchForPeople => undef +$UserField => undef +$UserOp => undef +$UserString => undef +$id => undef + + diff --git a/rt/html/Ticket/ModifyDates.html b/rt/html/Ticket/ModifyDates.html new file mode 100644 index 000000000..3ccae4431 --- /dev/null +++ b/rt/html/Ticket/ModifyDates.html @@ -0,0 +1,52 @@ +%# 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('Modify dates for #[_1]', $TicketObj->Id) &> +<& /Ticket/Elements/Tabs, + Ticket => $TicketObj, + current_tab => "Ticket/ModifyDates.html?id=".$TicketObj->Id, + Title => loc('Modify dates for #[_1]', $TicketObj->Id) &> + +<& /Elements/ListActions, actions => \@results &> + +
+ +<& /Elements/TitleBoxStart, title => loc('Modify dates for ticket # [_1]', $TicketObj->Id), width => "100%", color => "#663366" &> + +<& Elements/EditDates, TicketObj => $TicketObj &> +<& /Elements/TitleBoxEnd &> +<& /Elements/Submit, color => "#663366" &> +
+ + +<%INIT> + +my $TicketObj = LoadTicket($id); +my @results = ProcessTicketDates( TicketObj => $TicketObj, ARGSRef => \%ARGS); + + + + +<%ARGS> +$id => undef + diff --git a/rt/html/Ticket/ModifyLinks.html b/rt/html/Ticket/ModifyLinks.html new file mode 100644 index 000000000..1d050088b --- /dev/null +++ b/rt/html/Ticket/ModifyLinks.html @@ -0,0 +1,54 @@ +%# 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("Link ticket #[_1]", $Ticket->Id) &> +<& /Ticket/Elements/Tabs, + Ticket => $Ticket, + current_tab => "Ticket/ModifyLinks.html?id=".$Ticket->Id, + Title => loc("Link ticket #[_1]", $Ticket->Id) &> + +<& /Elements/ListActions, actions => \@results &> + +
+ + +<& /Elements/TitleBoxStart, title => loc('Edit Relationships'), color => "#336633"&> +<& Elements/EditLinks, Ticket => $Ticket &> +<& /Elements/TitleBoxEnd &> +<& /Elements/Submit, color => "#336633", Caption=> loc('Save Changes') &> +
+ + + + +<%INIT> + +my $Ticket = LoadTicket($id); +my @results = ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS); + + + + +<%ARGS> +$id => undef + diff --git a/rt/html/Ticket/ModifyPeople.html b/rt/html/Ticket/ModifyPeople.html new file mode 100644 index 000000000..2e41664d9 --- /dev/null +++ b/rt/html/Ticket/ModifyPeople.html @@ -0,0 +1,67 @@ +%# 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('Modify people related to ticket #[_1]', $Ticket->id) &> +<& /Ticket/Elements/Tabs, + Ticket => $Ticket, + current_tab => "Ticket/ModifyPeople.html?id=".$Ticket->Id, + Title => loc('Modify people related to ticket #[_1]', $Ticket->id) &> + +<& /Elements/ListActions, actions => \@results &> + +
+ +<& /Elements/TitleBoxStart, title => loc('Modify people related to ticket #[_1]', $Ticket->Id), width => "100%", color=> "#333399" &> +<& Elements/EditPeople, Ticket => $Ticket, UserField => $UserField, UserString => $UserString, UserOp => $UserOp, GroupString => $GroupString, GroupOp => $GroupOp, GroupField => $GroupField &> +<& /Elements/TitleBoxEnd &> +<& /Elements/Submit, Label => loc('Save Changes'), Caption => loc("If you've updated anything above, be sure to"), color => "#333399" &> +
+ +<%INIT> + +my (@results, @wresults); + +my $Ticket = LoadTicket($id); + +# if we're trying to search for watchers and nothing else +unless ($OnlySearchForPeople) { + @results = ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS); + @wresults = ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS); +} + +push @results, @wresults; + + + + +<%ARGS> +$OnlySearchForPeople => undef +$UserField => undef +$UserOp => undef +$UserString => undef +$GroupField => undef +$GroupOp => undef +$GroupString => undef +$id => undef + + diff --git a/rt/html/Ticket/Update.html b/rt/html/Ticket/Update.html new file mode 100644 index 000000000..e19aacf6a --- /dev/null +++ b/rt/html/Ticket/Update.html @@ -0,0 +1,205 @@ +%# 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 => $title &> +<& /Ticket/Elements/Tabs, + Ticket => $Ticket , + Title=> $title &> + +
+ + + + + + + + + + +
+<&|/l&>Ticket watchers +<&|/l&>Requestor: + +<% $Ticket->RequestorAddresses %> +
  +<&|/l&>Cc: + +<% $Ticket->CcAddresses %> +
  +<&|/l&>AdminCc: + +<% $Ticket->AdminCcAddresses %> +
+
+ + + + + + + + + + +% if (exists $session{'Attachments'}) { + + + + +% } # end of if + + +
+
<&|/l&>Status: +<& /Elements/SelectStatus, Name=>"Status", Default => $DefaultStatus &> +<&|/l&>Owner: +<& /Elements/SelectOwner, Name=>"Owner", Default => ($ARGS{'Owner'} || $Ticket->OwnerObj->Id()), QueueObj => $Ticket->QueueObj, TicketObj => $Ticket &> +<&|/l&>Worked: <&|/l&>minutes
<&|/l&>Update Type: +
<&|/l&>Subject:
<&|/l&>Cc: >
+ +<&|/l&>(Sends a carbon-copy of this update to a comma-delimited list of email addresses. Does not change who will receive future updates.) +
<&|/l&>Bcc:
+ +<&|/l&>(Sends a blind carbon-copy of this update to a comma-delimited list of email addresses. Does not change who will receive future updates.) +
+<&|/l&>Attached file: + +<&|/l&>Check box to delete
+% foreach my $attach_name (keys %{$session{'Attachments'}}) { +<%$attach_name%>
+% } # end of foreach +
<&|/l&>Attach: +
<&|/l&>Message: +<& /Elements/Callback, _CallbackName => 'BeforeMessageBox', %ARGS &> +% if (exists $ARGS{UpdateContent}) { +% delete $ARGS{'QuoteTransaction'}; +<& /Elements/MessageBox, Name=>"UpdateContent", Default=>$ARGS{UpdateContent}, %ARGS&> +% } else { +<& /Elements/MessageBox, Name=>"UpdateContent", %ARGS &> +% } +
+ + + + +<& /Elements/Submit, Name => 'SubmitTicket' &> + + + + +<%INIT> + +my $CanRespond = 0; +my $CanComment = 0; +my $title; + +my $Ticket = LoadTicket($id); + +unless($DefaultStatus){ + $DefaultStatus=($ARGS{'Status'} ||$Ticket->Status()); +} + +if ($DefaultStatus =~ '^new$'){ + $DefaultStatus='open'; +} + +if ($DefaultStatus eq 'resolved') { + $title = loc("Resolve ticket #[_1] ([_2])", $Ticket->id, $Ticket->Subject); +} else { + $title = loc("Update ticket #[_1] ([_2])", $Ticket->id, $Ticket->Subject); +} + +# Things needed in the template - we'll do the processing here, just +# for the convenience: + +my ($CommentDefault, $ResponseDefault); +if (($Action eq 'Comment') or ($ARGS{'UpdateType'} eq 'private')) { + $CommentDefault = "SELECTED"; +} else { + $ResponseDefault = "SELECTED"; +} + + +$CanRespond = 1 if ( $Ticket->CurrentUserHasRight('ReplyToTicket') or + $Ticket->CurrentUserHasRight('ModifyTicket') ); + +$CanComment = 1 if ( $Ticket->CurrentUserHasRight('CommentOnTicket') or + $Ticket->CurrentUserHasRight('ModifyTicket') ); + + +# {{{ deal with deleting uploaded attachments +foreach my $key (keys %ARGS) { + if ($key =~ m/^DeleteAttach-(.+)$/) { + delete $session{'Attachments'}{$1}; + } + $session{'Attachments'} = { %{$session{'Attachments'} || {}} }; +} + +# {{{ 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 }; +} +# }}} + +# delete temporary storage entry to make WebUI clean +unless (keys %{$session{'Attachments'}} and $ARGS{'UpdateAttach'}) { + delete $session{'Attachments'}; +} +# }}} + +if ( exists $ARGS{SubmitTicket} ) { + $m->comp('Display.html', %ARGS); + return; +} + + +<%ARGS> +$id => undef +$Action => undef +$DefaultStatus => undef + -- cgit v1.2.1