diff options
Diffstat (limited to 'rt/html/Ticket')
45 files changed, 4553 insertions, 0 deletions
diff --git a/rt/html/Ticket/Attachment/dhandler b/rt/html/Ticket/Attachment/dhandler new file mode 100644 index 000000000..584fd721d --- /dev/null +++ b/rt/html/Ticket/Attachment/dhandler @@ -0,0 +1,92 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<%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; +</%perl> +<%attr> +AutoFlush => 0 +</%attr> diff --git a/rt/html/Ticket/Create.html b/rt/html/Ticket/Create.html new file mode 100644 index 000000000..b547242f2 --- /dev/null +++ b/rt/html/Ticket/Create.html @@ -0,0 +1,300 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<& /Elements/Header, Title => loc("Create a new ticket") &> +<& /Elements/Tabs, + current_toptab => "Ticket/Create.html", + Title => loc("Create a new ticket") &> +<FORM ACTION="<%$RT::WebPath%>/Ticket/Create.html" METHOD="POST" ENCTYPE="multipart/form-data" NAME="TicketCreate"> +<INPUT TYPE=HIDDEN Name="id" VALUE="new"> +<A NAME="top"> + + +[<a class="currenttab"><&|/l&>Show basics</&></a>] [<A HREF="#detail"><&|/l&>Show details</&></a>] +<BR> +<& /Elements/TitleBoxStart, contentbg => "#cccccc", title => loc("Create a new ticket") &> +<TABLE border=0 cellpadding=0 cellspacing=0> +<TR><TD class=label><&|/l&>Queue</&>:</TD> +<TD class=value><% $QueueObj->Name %> +<INPUT TYPE=HIDDEN NAME=Queue Value="<%$QueueObj->Name%>"> +</TD> +<TD class=label><&|/l&>Status</&>: +</TD> +<TD class=value> +<& /Elements/SelectStatus, Name => "Status", Default => $ARGS{Status}||'new', DefaultValue => 0 &> +</TD> +<TD class=label> +<&|/l&>Owner</&>: +</TD> +<TD class=value> +<& /Elements/SelectOwner, Name => "Owner", QueueObj => $QueueObj, Default => $ARGS{Owner}||$RT::Nobody->Id, DefaultValue => 0 &> +</TD> +</TR> +<TR> +<TD class=label> +<&|/l&>Requestors</&>: +</TD> +<TD class=value COLSPAN=5> +<INPUT Name="Requestors" Value="<% ($ARGS{Requestors}) || $session{CurrentUser}->EmailAddress %>" SIZE=40> +</TD> +</TR> +<TR> +<TD class=labeltop> +<&|/l&>Cc</&>: +</TD> +<TD class=value COLSPAN=5> +<INPUT NAME="Cc" SIZE=40 VALUE="<% $ARGS{Cc} %>"><BR> +<i><font size=-2> +<&|/l&>(Sends a carbon-copy of this update to a comma-delimited list of email addresses. These people <b>will</b> receive future updates.)</&></font></i> +</TD> +</TR> +<TR> +<TD class=labeltop> +<&|/l&>Admin Cc</&>: +</TD> +<TD class=value COLSPAN=5> +<INPUT NAME="AdminCc" SIZE=40 VALUE="<% $ARGS{AdminCc} %>"><BR> +<i><font size=-2> +<&|/l&>(Sends a carbon-copy of this update to a comma-delimited list of administrative email addresses. These people <b>will</b> receive future updates.)</&></font></i> +</TD> +</TR> +<TR> +<TD class=label> +<&|/l&>Subject</&>: +</TD> +<TD class=value COLSPAN=5> +<INPUT Name="Subject" SIZE=60 MAXSIZE=100 value="<%$ARGS{Subject} || ''%>"> +</TD> +</TR> +<TR> +<TD COLSPAN=6> +<& /Ticket/Elements/EditCustomFields, QueueObj => $QueueObj &> +</TD> +</TR> +% if ($TxnCFs->Count) { +% while (my $CF = $TxnCFs->Next()) { +<TR> +<TD ALIGN=RIGHT><% $CF->Name %>:</TD> +<TD><& /Elements/EditCustomField, CustomField => $CF, NamePrefix => + "Object-RT::Transaction--CustomField-" &><em><% $CF->FriendlyType %></em></TD> +</TD></TR> +% } +% } +<TR> +% if (exists $session{'Attachments'}) { +<TD class=label> +<&|/l&>Attached file</&>: +</TD> +<TD COLSPAN=5> +<&|/l&>Check box to delete</&><BR> +% foreach my $attach_name (keys %{$session{'Attachments'}}) { +<input type="checkbox" name="DeleteAttach-<%$attach_name%>" value="1"><%$attach_name%><BR> +% } # end of foreach +</TD> +</TR> +<TR> +% } # end of if +<TD> +<&|/l&>Attach file</&>: +</TD> +<TD class=value COLSPAN=5> +<INPUT TYPE=FILE NAME="Attach"> +<INPUT TYPE=SUBMIT NAME="AddMoreAttach" VALUE="<&|/l&>Add More Files</&>"> +</TD> +</TR> +<TR> +<TD COLSPAN=6> +<&|/l&>Describe the issue below</&>:<br> +% if (exists $ARGS{Content}) { +<& /Elements/MessageBox, Default => $ARGS{Content}, IncludeSignature => 0 &> +% } else { +<& /Elements/MessageBox, QuoteTransaction => $QuoteTransaction &> +%} + +<BR> +</TD> +</TR> +<TR> +<TD ALIGN=RIGHT COLSPAN=2> +</TD> +</TR> +</TABLE> +<& /Elements/TitleBoxEnd &> +<& /Elements/Submit, Label => loc("Create")&> + +<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR> +<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR> +<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR> +<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR> +<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR> + +<A NAME="detail"> + [<A HREF="#top"><&|/l&>Show basics</&></a>] [<a class="currenttab"><&|/l&>Show details</&></a>] +<BR> +<TABLE WIDTH="100%" BORDER=0> +<TR> +<TD WIDTH="50%" VALIGN=TOP> + + <& /Elements/TitleBoxStart, title => loc('The Basics'), + title_class=> 'inverse', + color => "#993333" &> +<TABLE BORDER=0> +<TR><TD ALIGN=RIGHT><&|/l&>Priority</&>:</TD><TD><input size=3 name="InitialPriority" value="<% $ARGS{InitialPriority} ? $ARGS{InitialPriority} : $QueueObj->InitialPriority %>"></TD></TR> +<TR><TD ALIGN=RIGHT><&|/l&>Final Priority</&>:</TD><TD><input size=3 name="FinalPriority" value="<% $ARGS{FinalPriority} ? $ARGS{FinalPriority} : $QueueObj->FinalPriority %>"></TD></TR> +<TR><TD ALIGN=RIGHT><&|/l&>Time Worked</&>:</TD><TD><&|/l,'<input size=3 name="TimeWorked" value="'.$ARGS{TimeWorked}.'">'&>[_1] min</&></TD></TR> +<TR><TD ALIGN=RIGHT><&|/l&>Time Left</&>:</TD><TD><&|/l,'<input size=3 name="TimeLeft" value="'.$ARGS{TimeLeft}.'">'&>[_1] min</&></TD></TR> +</TABLE> +<& /Elements/TitleBoxEnd &> +<br> +<& /Elements/TitleBoxStart, title => loc("Dates"), + title_class=> 'inverse', + color => "#663366" &> + +<TABLE BORDER=0> +<TR><TD ALIGN=RIGHT><&|/l&>Starts</&>:</TD><TD><input size=10 name="Starts" value="<% $ARGS{Starts} %>"></TD></TR> +<TR><TD ALIGN=RIGHT><&|/l&>Due</&>:</TD><TD><input size=10 name="Due" value="<% +$ARGS{Due}%>"></TD></TR> +</TABLE> +<& /Elements/TitleBoxEnd &> +<BR> +</TD> + +<TD VALIGN="TOP"> +<& /Elements/TitleBoxStart, title => loc('Links'), + title_class=> 'inverse', + titleright => '', color=> "#336633" &> + +<i><&|/l&>(Enter ticket ids or URLs, separated with spaces)</&></i> +<TABLE BORDER=0> +<TR><TD ALIGN=RIGHT><&|/l&>Depends on</&></TD><TD><input size=10 name="new-DependsOn" value="<% $ARGS{'new-DependsOn'} %>"></TD></TR> +<TR><TD ALIGN=RIGHT><&|/l&>Depended on by</&></TD><TD><input size=10 name="DependsOn-new" value="<% $ARGS{'DependsOn-new'} %>"></TD></TR> +<TR><TD ALIGN=RIGHT><&|/l&>Parents</&></TD><TD><input size=10 name="new-MemberOf" value="<% $ARGS{'new-MemberOf'} %>"></TD></TR> +<TR><TD ALIGN=RIGHT><&|/l&>Children</&></TD><TD><input size=10 name="MemberOf-new" value="<% $ARGS{'MemberOf-new'} %>"></TD></TR> +<TR><TD ALIGN=RIGHT><&|/l&>Refers to</&></TD><TD><input size=10 name="new-RefersTo" value="<% $ARGS{'new-RefersTo'} %>"></TD></TR> +<TR><TD ALIGN=RIGHT><&|/l&>Referred to by</&></TD><TD><input size=10 name="RefersTo-new" value="<% $ARGS{'RefersTo-new'} %>"></TD></TR> + + +</TABLE> +<& /Elements/TitleBoxEnd &> +<BR> + +</TD> +</TR> +</TABLE> +<& /Elements/Submit, Label => loc("Create") &> +</FORM> +<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR> +<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR> +<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR> +<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR> +<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR> + +<%INIT> + + + +my $QueueObj = new RT::Queue($session{'CurrentUser'}); +$QueueObj->Load($Queue) || Abort(loc("Queue could not be loaded.")); +my $CFs = $QueueObj->TicketCustomFields(); +my $TxnCFs = $QueueObj->TicketTransactionCustomFields(); + +# if no due date has been set explicitly, then use the +# queue's default if it exists +if ($QueueObj->DefaultDueIn && !$ARGS{'Due'}) { + my $default_due = RT::Date->new($session{'CurrentUser'}); + $default_due->SetToNow(); + $default_due->AddDays($QueueObj->DefaultDueIn); + $ARGS{'Due'} = $default_due->ISO(); +} + +# {{{ 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'}"; + + # 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); + return(); +} +</%INIT> + +<%ARGS> +$DependsOn => undef +$DependedOnBy => undef +$MemberOf => undef +$QuoteTransaction => undef +$Queue => undef +</%ARGS> diff --git a/rt/html/Ticket/Display.html b/rt/html/Ticket/Display.html new file mode 100644 index 000000000..dd4c093dc --- /dev/null +++ b/rt/html/Ticket/Display.html @@ -0,0 +1,159 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<& /Elements/Header, + Title => loc("#[_1]: [_2]", $TicketObj->Id, $TicketObj->Subject) &> +<& /Ticket/Elements/Tabs, + Ticket => $TicketObj, + current_tab => 'Ticket/Display.html?id='.$TicketObj->id, + Title => loc("#[_1]: [_2]", $TicketObj->Id, $TicketObj->Subject) &> + +<& /Elements/ListActions, actions => \@Actions &> + +<& /Elements/TitleBoxStart, title => loc('Ticket metadata'), contentbg => +'#ffffff' &> +<& /Ticket/Elements/ShowSummary, Ticket => $TicketObj, Attachments => $attachments &> +<& /Elements/TitleBoxEnd &> + +<BR> + +<& /Elements/Callback, _CallbackName => 'BeforeShowHistory', Ticket => $TicketObj, %ARGS &> + +<& /Ticket/Elements/ShowHistory , + Ticket => $TicketObj, + Tickets => $Tickets, + Collapsed => $ARGS{'Collapsed'}, + ShowHeaders => $ARGS{'ShowHeaders'}, + Attachments => $attachments, + AttachmentContent => $attachment_content + + &> + + +<%ARGS> +$id => undef +$Create => undef +$ShowHeaders => 0 +$Collapsed => undef +$TicketObj => undef +</%ARGS> + +<%INIT> + +$m->comp('/Elements/Callback', _CallbackName => 'Initial', TicketObj => $TicketObj, ARGSRef => \%ARGS); + +my ($linkid, $message, $tid, @Actions, $Tickets); + +unless ($id || $TicketObj) { + 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.'); + } + ($TicketObj, @Actions) = + CreateTicket(Attachments => $session{'Attachments'}, %ARGS); + delete $session{'Attachments'}; + unless ($TicketObj->CurrentUserHasRight('ShowTicket')) { + Abort("No permission to view newly created ticket #".$TicketObj->id."."); + } + # }}} +} else { + if (!$TicketObj) { + + $TicketObj = RT::Ticket->new($session{'CurrentUser'}); + + $TicketObj = LoadTicket($ARGS{'id'}); + unless ($TicketObj->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)=$TicketObj->$action(); + push(@Actions, $msg); + } + } + + $ARGS{'UpdateContent'} =~ s/\r\n/\n/g if defined $ARGS{'UpdateContent'}; + if ( $ARGS{'UpdateTimeWorked'} || + $session{'Attachments'} || + ( defined $ARGS{'UpdateContent'} + && $ARGS{'UpdateContent'} ne '' + && $ARGS{'UpdateContent'} ne "-- \n" + . $session{'CurrentUser'}->UserObj->Signature )) { + $ARGS{UpdateAttachments} = $session{'Attachments'}; + ProcessUpdateMessage( ARGSRef => \%ARGS, + Actions => \@Actions, + TicketObj => $TicketObj ); + delete $session{'Attachments'}; + } + #Process status updates + my @BasicActions = ProcessTicketBasics(ARGSRef => \%ARGS, TicketObj=>$TicketObj); + my @results = ProcessTicketLinks( TicketObj => $TicketObj, ARGSRef => \%ARGS); + + push (@Actions, @BasicActions, @results); +} + + + +$m->comp('/Elements/Callback', _CallbackName => 'BeforeDisplay', + TicketObj => \$TicketObj, Tickets => \$Tickets, ARGSRef => \%ARGS); + + +my $attachments = $m->comp('Elements/FindAttachments', Ticket => $TicketObj, Tickets => $Tickets); +my $attachment_content = $m->comp('Elements/LoadTextAttachments', Ticket => $TicketObj); + +</%INIT> diff --git a/rt/html/Ticket/Elements/AddCustomers b/rt/html/Ticket/Elements/AddCustomers new file mode 100644 index 000000000..01c7367c4 --- /dev/null +++ b/rt/html/Ticket/Elements/AddCustomers @@ -0,0 +1,50 @@ +%# Copyright (c) 2004 Ivan Kohler <ivan-rt@420.am> +%# +%# 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. +<BR> +<%$msg%><br> + +% if (@Customers) { + +<br><i>(Check box to link)<i> +<table> +% foreach my $customer (@Customers) { +<tr> + <td> + <input type="checkbox" name="Ticket-AddCustomer-<% $customer->{'custnum'} %>" VALUE="1" <% scalar(@Customers) == 1 ? 'CHECKED' : '' %>> + <A HREF="<%$freeside_url%>/view/cust_main.cgi?<% $customer->{'custnum'} %>"><% &RT::URI::freeside::small_custview($customer->{'custnum'}, &RT::URI::freeside::FreesideGetConfig('countrydefault'), 1) |n %> + </td> +</tr> +% } + +% } + +<%INIT> +my ($msg); + +my $freeside_url = &RT::URI::freeside::FreesideURL(); + +my @Customers = (); +if ( $CustomerString ) { + @Customers = &RT::URI::freeside::smart_search( 'search' => $CustomerString ); +} + +my @Services = (); +if ($ServiceString) { + @Services = (); #service_search(); +} + +</%INIT> + +<%ARGS> +$CustomerString => undef +$ServiceString => undef +</%ARGS> diff --git a/rt/html/Ticket/Elements/AddWatchers b/rt/html/Ticket/Elements/AddWatchers new file mode 100644 index 000000000..98314b9d2 --- /dev/null +++ b/rt/html/Ticket/Elements/AddWatchers @@ -0,0 +1,121 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<BR> +<%$msg%><br> + +<&|/l&>Add new watchers</&>:<br> + +<table> +% if ($Users and $Users->Count) { +<tr><td> +<&|/l&>Type</&> +</td><td> +<&|/l&>Username</&> +</td></tr> +% while (my $u = $Users->Next ) { +<tr><td><&/Elements/SelectWatcherType, Name => "Ticket-AddWatcher-Principal-".$u->PrincipalId &></td><td><%$u->Name%> (<%$u->RealName%>)</td></tr> +% } +% } + +% if ($Groups and $Groups->Count) { +<tr><td> +<&|/l&>Type</&> +</td><td> +<&|/l&>Group</&> +</td></tr> +% while (my $g = $Groups->Next ) { +<tr><td><&/Elements/SelectWatcherType, Name => "Ticket-AddWatcher-Principal-".$g->PrincipalId, Scope => 'queue' &></td><td><%$g->Name%> (<%$g->Description%>)</td></tr> +% } +% } + +<tr><td> +<&|/l&>Type</&> +</td><td> +<&|/l&>Email</&> +</td></tr> +<tr><td> +<&/Elements/SelectWatcherType, Name => "WatcherTypeEmail1" &> +</td><td> +<input name="WatcherAddressEmail1" size=15> +</td></tr> +<tr><td> +<&/Elements/SelectWatcherType, Name => "WatcherTypeEmail2" &> +</td><td> +<input name="WatcherAddressEmail2" size=15> +</td></tr> +<tr><td> +<&/Elements/SelectWatcherType, Name => "WatcherTypeEmail3" &> +</td><td> +<input name="WatcherAddressEmail3" size=15> +</td></tr> +</table> + +<%INIT> +my ($msg, $Users, $Groups); + +if ($UserString) { + $Users = RT::Users->new($session{'CurrentUser'}); + $Users->Limit(FIELD => $UserField, VALUE => $UserString, OPERATOR => $UserOp); + $Users->LimitToPrivileged if $PrivilegedOnly; + } + +if ($GroupString) { + $Groups = RT::Groups->new($session{'CurrentUser'}); + $Groups->Limit(FIELD => 'Domain', OPERATOR => '=', VALUE => 'UserDefined'); + $Groups->Limit(FIELD => $GroupField, VALUE => $GroupString, OPERATOR => $GroupOp); + } + +</%INIT> + +<%ARGS> +$UserField => 'Name' +$UserOp => '=' +$UserString => undef +$GroupField => 'Name' +$GroupOp => '=' +$GroupString => undef +$PrivilegedOnly => undef +</%ARGS> diff --git a/rt/html/Ticket/Elements/BulkLinks b/rt/html/Ticket/Elements/BulkLinks new file mode 100644 index 000000000..6a3859aa3 --- /dev/null +++ b/rt/html/Ticket/Elements/BulkLinks @@ -0,0 +1,75 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<TABLE> + <TR> + <TD class="label"><&|/l&>Merge into</&>:</TD> + <TD class="entry"><input name="Ticket-MergeInto"> <i><&|/l&>(only one ticket)</&></i></TD> + </TR> + <TR> + <TD class="label"><&|/l&>Depends on</&>:</TD> + <TD class="entry"><input name="Ticket-DependsOn"></TD> + </TR> + <TR> + <TD class="label"><&|/l&>Depended on by</&>:</TD> + <TD class="entry"><input name="DependsOn-Ticket"></TD> + </TR> + <TR> + <TD class="label"><&|/l&>Parents</&>:</TD> + <TD class="entry"><input name="Ticket-MemberOf"></TD> + </TR> + <TR> + <TD class="label"><&|/l&>Children</&>:</TD> + <TD class="entry"> <input name="MemberOf-Ticket"></TD> + </TR> + <TR> + <TD class="label"><&|/l&>Refers to</&>:</TD> + <TD class="entry"><input name="Ticket-RefersTo"></TD> + </TR> + <TR> + <TD class="label"><&|/l&>Referred to by</&>:</TD> + <TD class="entry"> <input name="RefersTo-Ticket"></TD> + </TR> +</TABLE> diff --git a/rt/html/Ticket/Elements/EditBasics b/rt/html/Ticket/Elements/EditBasics new file mode 100644 index 000000000..715685153 --- /dev/null +++ b/rt/html/Ticket/Elements/EditBasics @@ -0,0 +1,94 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<TABLE> + <TR> + <td class="label"><&|/l&>Subject</&>:</td> + <td class="value"><input name=Subject value="<%$TicketObj->Subject|h%>" SIZE=50></td> + </TR> + + <TR> + <td class="label"><&|/l&>Status</&>:</td> + <td class="value"><%$SelectStatus|n%></td> + </TR> + <TR> + <td class="label"><&|/l&>Queue</&>:</td> + <td class="value"><%$SelectQueue|n%></td> + </TR> + <TR> + <td class="label"><&|/l&>Time Estimated</&>:</td> + <td class="value"><input name=TimeEstimated value="<%$TicketObj->TimeEstimated|h%>" SIZE="5"></td> + </TR> + <TR> + <td class="label"><&|/l&>Time Worked</&>:</td> + <td class="value"><input name=TimeWorked value="<%$TicketObj->TimeWorked|h%>" SIZE="5"></td> + </TR> + <TR> + <td class="label"><&|/l&>Time Left</&>:</td> + <td class="value"><input name=TimeLeft value="<%$TicketObj->TimeLeft|h%>" SIZE="5"></td> + </TR> + + <TR> + <td class="label"><&|/l&>Priority</&>:</td> + <td class="value"><input name=Priority value="<%$TicketObj->Priority|h%>" SIZE="5"></td> + </TR> + + <TR> + <td class="label"><&|/l&>Final Priority</&>:</td> + <td class="value"><input name=FinalPriority value="<%$TicketObj->FinalPriority|h%>" SIZE="5"></td> + </TR> +<& /Elements/Callback, _CallbackName => 'EndOfList', TicketObj => $TicketObj, %ARGS &> +</TABLE> + +<%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', DefaultLabel => loc("[_1] (Unchanged)",loc($TicketObj->Status))); +my $SelectQueue = $m->scomp("/Elements/SelectQueue", Name => 'Queue', Default =>$TicketObj->QueueObj->Id); + +</%INIT> +<%ARGS> + +$TicketObj => undef +</%ARGS> diff --git a/rt/html/Ticket/Elements/EditCustomField b/rt/html/Ticket/Elements/EditCustomField new file mode 100644 index 000000000..63687acd7 --- /dev/null +++ b/rt/html/Ticket/Elements/EditCustomField @@ -0,0 +1,55 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<%init> + +# RT 3.2 API compatibility glue + +$RT::Logger->debug("Ticket/Elements/EditCustomField is deprecated in RT 3.4 and will be removed in 3.6."); + +$ARGS{'NamePrefix'} =~ s/^Ticket-/Object-RT::Ticket-/; +$ARGS{'NamePrefix'} =~ s/^CustomField-/Object-RT::Ticket--CustomField-/; +$m->comp('/Elements/EditCustomField', %ARGS, Object=> $ARGS{'TicketObj'}); +</%init> diff --git a/rt/html/Ticket/Elements/EditCustomFields b/rt/html/Ticket/Elements/EditCustomFields new file mode 100644 index 000000000..d566f4e71 --- /dev/null +++ b/rt/html/Ticket/Elements/EditCustomFields @@ -0,0 +1,100 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<table> +<tr> +<td valign="top" width="50%"> +<table> + +% 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) { +</table> +</td> +<td valign="top" width="50%"> +<table> +% } +% $i++; + <tr> + <td class="labeltop"> + <b><%$CustomField->Name%></b><br> + <i><%$CustomField->FriendlyType%></i> + </td> + <td class="entry"><& /Elements/EditCustomField, + Object => $TicketObj, + CustomField => $CustomField, + NamePrefix => $NamePrefix + &></td> + </tr> +% } +</table> +</td> +</tr> +</table> + +<%INIT> +my $CustomFields; +my $NamePrefix; + +if ($TicketObj) { + $CustomFields = $TicketObj->CustomFields(); + $NamePrefix = "Object-RT::Ticket-".$TicketObj->Id."-CustomField-"; + +} else { + $CustomFields = $QueueObj->TicketCustomFields(); + $NamePrefix = "Object-RT::Ticket--CustomField-"; +} + + + +</%INIT> +<%ARGS> +$TicketObj => undef +$QueueObj => undef +</%ARGS> diff --git a/rt/html/Ticket/Elements/EditCustomers b/rt/html/Ticket/Elements/EditCustomers new file mode 100644 index 000000000..47d1aa222 --- /dev/null +++ b/rt/html/Ticket/Elements/EditCustomers @@ -0,0 +1,67 @@ +%# Copyright (c) 2004 Ivan Kohler <ivan-rt@420.am> +%# +%# 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. +<TABLE width=100%> + <TR> + <TD VALIGN=TOP WIDTH=50%> + <h3><&|/l&>Current Customers</&></h3> + +<table> + <tr> + <td><i><&|/l&>(Check box to disassociate)</&></i></td> + </tr> + <tr> + <td class="value"> +% #while (my $link = $Ticket->MemberOf->Next) { +% foreach my $link ( +% grep { $_->TargetURI->Resolver->{'fstable'} eq 'cust_main' } +% grep { $_->TargetURI->Scheme eq 'freeside' } +% @{ $Ticket->_Links('Base')->ItemsArrayRef } +% ) { + + <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>"> +%# <& ShowLink, URI => $link->TargetURI &><br> + <A HREF="<% $link->TargetURI->Resolver->HREF %>"><% $link->TargetURI->Resolver->AsStringLong |n %></A> + <BR> +% } + </td> + </tr> +</table> + +</TD> + +<TD VALIGN=TOP> +<h3><&|/l&>New Customer Links</&></h3> +<&|/l&>Find customer</&><BR> +<input name="CustomerString"> +<input type=submit name="OnlySearchForCustomers" value="<&|/l&>Go!</&>"> +<br><i>cust #, last name, or company</i> +<BR> +%#<BR> +%#<&|/l&>Find service</&><BR> +%#<input name="ServiceString"> +%#<input type=submit name="OnlySearchForServices" value="<&|/l&>Go!</&>"> +%#<br><i>username, username@domain, domain, or IP address</i> +%#<BR> + +<& AddCustomers, Ticket => $Ticket, + CustomerString => $CustomerString, + ServiceString => $ServiceString, &> + +</TD> +</TR> +</TABLE> + +<%ARGS> +$CustomerString => undef +$ServiceString => undef +$Ticket => undef +</%ARGS> diff --git a/rt/html/Ticket/Elements/EditDates b/rt/html/Ticket/Elements/EditDates new file mode 100644 index 000000000..a19774192 --- /dev/null +++ b/rt/html/Ticket/Elements/EditDates @@ -0,0 +1,75 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<TABLE> + <TR> + <TD class="label"><&|/l&>Starts</&>:</TD> + <TD class="entry"><& /Elements/SelectDate, menu_prefix => 'Starts', current => 0 &> + (<% $TicketObj->StartsObj->AsString %>)</TD> + </TR> + <TR> + <TD class="label"><&|/l&>Started</&>:</TD> + <TD class="entry"><& /Elements/SelectDate, menu_prefix => 'Started', current => 0 &> (<%$TicketObj->StartedObj->AsString %>)</TD> + </TR> + + <TR> + <TD class="label"> + <&|/l&>Last Contact</&>: + </TD> + <TD class="entry"> + <& /Elements/SelectDate, menu_prefix => 'Told', current => 0 &> (<% $TicketObj->ToldObj->AsString %>) + </TD> + </TR> + <TR> + <TD class="label"><&|/l&>Due</&>:</TD> + <TD class="entry"> + <& /Elements/SelectDate, menu_prefix => 'Due', current => 0 &> (<% $TicketObj->DueObj->AsString %>) + </TD> + </TR> +</TABLE> +<%ARGS> +$TicketObj => undef +</%ARGS> + diff --git a/rt/html/Ticket/Elements/EditPeople b/rt/html/Ticket/Elements/EditPeople new file mode 100644 index 000000000..055d7ba20 --- /dev/null +++ b/rt/html/Ticket/Elements/EditPeople @@ -0,0 +1,91 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<TABLE> +<TR> +<TD VALIGN=TOP> + +<h3><&|/l&>New watchers</&></h3> +<&|/l&>Find people whose</&><BR> +<& /Elements/SelectUsers &> +<input type=submit name="OnlySearchForPeople" value="<&|/l&>Go!</&>"> +<BR> +<&|/l&>Find groups whose</&><BR> +<& /Elements/SelectGroups &> +<input type=submit name="OnlySearchForGroup" value="<&|/l&>Go!</&>"> + +<& AddWatchers, Ticket => $Ticket, UserString => $UserString, + UserOp => $UserOp, UserField => $UserField, + GroupString => $GroupString, GroupOp => $GroupOp, + GroupField => $GroupField, PrivilegedOnly => $PrivilegedOnly &> +</TD><TD VALIGN=TOP> +<h3><&|/l&>Owner</&></h3> +<&|/l&>Owner</&>: <& /Elements/SelectOwner, Name => 'Owner', QueueObj => $Ticket->QueueObj, TicketObj => $Ticket, Default => $Ticket->OwnerObj->Id, DefaultValue => 0&> +<h3><&|/l&>Current watchers</&></h3> +<&|/l&>(Check box to delete)</&><br> + +<&|/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 &> + +</TD> +</TR> +</TABLE> + +<%ARGS> +$UserField => undef +$UserOp => undef +$UserString => undef +$GroupField => undef +$GroupOp => undef +$GroupString => undef +$PrivilegedOnly => undef +$Ticket => undef +</%ARGS> diff --git a/rt/html/Ticket/Elements/EditWatchers b/rt/html/Ticket/Elements/EditWatchers new file mode 100644 index 000000000..0089932f4 --- /dev/null +++ b/rt/html/Ticket/Elements/EditWatchers @@ -0,0 +1,74 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<ul> +%# Print out a placeholder if there are none. +%if ($Members->Count == 0 ) { +<li><i><&|/l&>none</&></i> +% } + + +%while (my $watcher=$Members->Next) { +<li> +<INPUT TYPE=CHECKBOX NAME="Ticket-DeleteWatcher-Type-<%$Watchers->Type%>-Principal-<%$watcher->MemberId%>" value="1" UNCHECKED> +%if ($watcher->MemberObj->IsUser) { +<a href="<%$RT::WebPath%>/Admin/Users/Modify.html?id=<%$watcher->MemberObj->Object->id%>"> +<%$watcher->MemberObj->Object->Name%></a> +%} else { +<a href="<%$RT::WebPath%>/Admin/Groups/Modify.html?id=<%$watcher->MemberObj->Object->id%>"> +<%$watcher->MemberObj->Object->Name%></a> +%} +% } +</ul> +<%INIT> +my $Members = $Watchers->MembersObj; +</%INIT> +<%ARGS> +$TicketObj => undef +$Watchers => undef +</%ARGS> + + + diff --git a/rt/html/Ticket/Elements/FindAttachments b/rt/html/Ticket/Elements/FindAttachments new file mode 100755 index 000000000..017c77288 --- /dev/null +++ b/rt/html/Ticket/Elements/FindAttachments @@ -0,0 +1,93 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<%INIT> +my %documents; + +#A default implementation here loops through all transactions and pulls out all their attachments. +# We end up doing an end-run around that to get a bit more performance + +# We force the cache of ticket transactions to get populated up front. otherwise, the +# code that looks at attachments will look at each one in turn. +my $attachments = RT::Attachments->new( $session{'CurrentUser'} ); + +$attachments->Columns( qw( Id Filename ContentType Headers Subject Parent ContentEncoding ContentType TransactionId Created)); + +my $transactions = $attachments->NewAlias('Transactions'); +$attachments->Join( ALIAS1 => 'main', + FIELD1 => 'TransactionId', + ALIAS2 => $transactions, + FIELD2 => 'id' ); + +my $tickets = $attachments->NewAlias('Tickets'); + + $attachments->Join( ALIAS1 => $transactions, + FIELD1 => 'ObjectId', + ALIAS2 => $tickets, + FIELD2 => 'id' ); + + $attachments->Limit( ALIAS => $transactions, + FIELD => 'ObjectType', + VALUE => 'RT::Ticket'); +if ($Tickets) { + while ($Ticket = $Tickets->Next) { + $attachments->Limit( ALIAS => $tickets, + FIELD => 'EffectiveId', + VALUE => $Ticket->id() ); + } +} else { + $attachments->Limit( ALIAS => $tickets, + FIELD => 'EffectiveId', + VALUE => $Ticket->id() ); +} + + +return ($attachments); +</%INIT> +<%ARGS> +$Ticket => undef +$Tickets => undef +</%ARGS> + diff --git a/rt/html/Ticket/Elements/LoadTextAttachments b/rt/html/Ticket/Elements/LoadTextAttachments new file mode 100755 index 000000000..943568fb3 --- /dev/null +++ b/rt/html/Ticket/Elements/LoadTextAttachments @@ -0,0 +1,90 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<%INIT> + +my $attachments = RT::Attachments->new( $session{'CurrentUser'} ); + +$attachments->Columns( qw(id Content ContentType TransactionId ContentEncoding)); + +if ( $Ticket->CurrentUserHasRight('ShowTicket') ) { + my $transactions = $attachments->NewAlias('Transactions'); + $attachments->Join( ALIAS1 => 'main', + FIELD1 => 'TransactionId', + ALIAS2 => $transactions, + FIELD2 => 'id' ); + + my $tickets = $attachments->NewAlias('Tickets'); + + + $attachments->Join( ALIAS1 => $transactions, + FIELD1 => 'ObjectId', + ALIAS2 => $tickets, + FIELD2 => 'id' ); + + $attachments->Limit( ALIAS => $transactions, + FIELD => 'ObjectType', + VALUE => 'RT::Ticket'); + + + $attachments->Limit( ALIAS => $tickets, + FIELD => 'EffectiveId', + VALUE => $Ticket->id() ); + # if the user may not see comments do not return them + unless ( $Ticket->CurrentUserHasRight('ShowTicketComments') ) { + $attachments->Limit( ALIAS => $transactions, FIELD => 'Type', OPERATOR => '!=', VALUE => "Comment" ); + } + + $attachments->Limit ( FIELD => 'ContentType', OPERATOR => '=', VALUE => 'text/plain'); + $attachments->Limit ( FIELD => 'ContentType', OPERATOR => 'STARTSWITH', VALUE => 'message/'); + $attachments->Limit ( FIELD => 'ContentType', OPERATOR => '=', VALUE => 'text'); + +} +return ($attachments); +</%INIT> +<%ARGS> +$Ticket => undef +</%ARGS> + diff --git a/rt/html/Ticket/Elements/PreviewScrips b/rt/html/Ticket/Elements/PreviewScrips new file mode 100755 index 000000000..a3492b749 --- /dev/null +++ b/rt/html/Ticket/Elements/PreviewScrips @@ -0,0 +1,124 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<%args> +$TicketObj => undef + +</%args> +<%init> + +my $arg = 'Ticket-'.$TicketObj->Id.'-SquelchMailTo'; +my @squelchto = ref($ARGS{$arg}) eq 'ARRAY' ? @{$ARGS{$arg}} : ($ARGS{$arg}); + +foreach my $address (@squelchto) { + $TicketObj->SquelchMailTo($address) if ($address); +} + + +$arg = 'Ticket-'.$TicketObj->Id.'-UnsquelchMailTo'; +my @unsquelchto = ref($ARGS{$arg}) eq 'ARRAY' ? @{$ARGS{$arg}} : ($ARGS{$arg}); + +foreach my $address (@unsquelchto) { + $TicketObj->UnsquelchMailTo($address) if ($address); +} + + +my $action; + +if (( $ARGS{'UpdateType'} eq 'response' ) || ($ARGS{'Action'} eq 'Respond' )) { + $action = 'Correspond'; +} +else { + $action = 'Comment'; +} + +my $Message = MakeMIMEEntity( + Subject => $ARGS{'UpdateSubject'}, + Body => $ARGS{'UpdateContent'}, +); + +my ( $Transaction, $Description, $Object ) = $TicketObj->$action( + CcMessageTo => $ARGS{'UpdateCc'}, + BccMessageTo => $ARGS{'UpdateBcc'}, + MIMEObj => $Message, + TimeTaken => $ARGS{'UpdateTimeWorked'}, + DryRun => 1 +); + + +my @non_recipients = $TicketObj->SquelchMailTo; +</%init> +<h2><&|/l&>This message will be sent to...</&></h2> +<i><&|/l&>(Check boxes to disable notifications to the listed recipients)</&></i><br> +% foreach my $scrip (@{$Object->Scrips->Prepared}) { +% next unless $scrip->ActionObj->Action->isa('RT::Action::SendEmail'); +<b><%$scrip->Description%></b><br> +<&|/l, loc($scrip->ConditionObj->Name), loc($scrip->ActionObj->Name), loc($scrip->TemplateObj->Name)&>[_1] [_2] with template [_3]</&> +<br> +%foreach my $type qw(To Cc Bcc) { +%my @addresses = $scrip->ActionObj->Action->$type(); +<ul> +%foreach my $addr (@addresses) { +<li> <b><%loc($type)%></b>: <input type="checkbox" name="Ticket-<%$TicketObj->id%>-SquelchMailTo" value="<%$addr->address%>"> <%$addr->address%> +% } +</ul> +% } +% if ($RT::PreviewScripMessages) { +<textarea cols=80 rows="5"> +<%$scrip->ActionObj->TemplateObj->MIMEObj->as_string%> +</textarea> +% } +%} +<br> +<h2><&|/l&>Messages about this ticket will not be sent to...</&></h2> +<i><&|/l&>(Check boxes to enable notifications to the listed recipients)</&></i> +<br> +<ul> +% foreach my $recipient (@non_recipients) { +<li><input type="checkbox" name="Ticket-<%$TicketObj->id%>-UnsquelchMailTo" value="<%$recipient->Content%>"> +<% $recipient->Content %> +% } +</ul> +<& /Elements/Submit, Value => 'UpdatePreview', Label => loc('Save changes')&> diff --git a/rt/html/Ticket/Elements/ShowAttachments b/rt/html/Ticket/Elements/ShowAttachments new file mode 100644 index 000000000..82028dd28 --- /dev/null +++ b/rt/html/Ticket/Elements/ShowAttachments @@ -0,0 +1,101 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +% if (keys %documents) { +<& /Elements/TitleBoxStart, title => loc('Attachments'), + title_class=> 'inverse', + color => "#336699" &> + +% foreach my $key (keys %documents) { + +<%$key%><br> +<ul> +% 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"; + } + +</%PERL> + +<li><font size="-2"> +<A HREF="<%$RT::WebPath%>/Ticket/Attachment/<%$rev->TransactionId%>/<%$rev->Id%>/<%$rev->Filename | u%>"> +<&|/l, $rev->CreatedAsString, $size, $rev->CreatorObj->Name &>[_1] ([_2]) by [_3]</&> +</a> +</font></li> +% } +% } +</ul> + +% } +<& /Elements/TitleBoxEnd &> +<BR> +% } + +<%INIT> + +# If we haven't been passed in an Attachments object (through the precaching mechanism) +# then we need to find one +$Attachments ||= $m->comp('FindAttachments', Ticket => $Ticket); + +my %documents; +while ( my $attach = $Attachments->Next() ) { + next unless ($attach->Filename()); + unshift( @{ $documents{ $attach->Filename } }, $attach ); +} + +</%INIT> +<%ARGS> +$Ticket => undef +$Attachments => undef +</%ARGS> + diff --git a/rt/html/Ticket/Elements/ShowBasics b/rt/html/Ticket/Elements/ShowBasics new file mode 100644 index 000000000..00ed3ccd1 --- /dev/null +++ b/rt/html/Ticket/Elements/ShowBasics @@ -0,0 +1,83 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<table> + <tr> + <td class="label"><&|/l&>Id</&>:</td> + <td class="value"><%$Ticket->Id %></td> + </tr> + <tr> + <td class="label"><&|/l&>Status</&>:</td> + <td class="value"><&|/l&><% $Ticket->Status%></&></td> + </tr> +% if ($Ticket->TimeEstimated) { + <tr> + <td class="label"><&|/l&>Estimated</&>:</td> + <td class="value"><&|/l, $Ticket->TimeEstimated &>[_1] min</&></td> + </tr> +% } +% if ($Ticket->TimeWorked) { + <tr> + <td class="label"><&|/l&>Worked</&>:</td> + <td class="value"><&|/l, $Ticket->TimeWorked &>[_1] min</&></td> + </tr> +% } + <tr> + <td class="label"><&|/l&>Left</&>:</td> + <td class="value"><&|/l, $Ticket->TimeLeft &>[_1] min</&></td> + </tr> + <tr> + <td class="label"><&|/l&>Priority</&>:</td> + <td class="value"><%$Ticket->Priority%>/<%$Ticket->FinalPriority %></td> + </tr> + <tr> + <td class="label"><&|/l&>Queue</&>:</td> + <td class="value"><%$Ticket->QueueObj->Name%></td> + </tr> +<& /Elements/Callback, _CallbackName => 'EndOfList', TicketObj => $Ticket, %ARGS &> +</table> +<%ARGS> +$Ticket => undef +</%ARGS> diff --git a/rt/html/Ticket/Elements/ShowCustomFields b/rt/html/Ticket/Elements/ShowCustomFields new file mode 100644 index 000000000..eb49212c5 --- /dev/null +++ b/rt/html/Ticket/Elements/ShowCustomFields @@ -0,0 +1,49 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<& /Elements/ShowCustomFields, Object => $Ticket &> +<%ARGS> +$Ticket => undef +</%ARGS> diff --git a/rt/html/Ticket/Elements/ShowCustomers b/rt/html/Ticket/Elements/ShowCustomers new file mode 100644 index 000000000..612727ede --- /dev/null +++ b/rt/html/Ticket/Elements/ShowCustomers @@ -0,0 +1,40 @@ +%# Copyright (c) 2004 Ivan Kohler <ivan-rt@420.am> +%# +%# 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. +<table> +% my $cust = 0; +% foreach my $customerURI ( +% grep { $_->Resolver->{'fstable'} eq 'cust_main' } +% grep { $_->Scheme eq 'freeside' } +% map { $_->TargetURI } +% @{ $Ticket->_Links('Base')->ItemsArrayRef } +% ) { +% $cust++; +% my $cust_main = ''; + <tr> + <td class="value"> + <A HREF="<% $customerURI->Resolver->HREF %>"><% $customerURI->Resolver->AsStringLong |n %></A> + </td> + </tr> +% } +% unless ( $cust ) { + <tr> + <td class="labeltop"> + <i>(none)<i> + </td> + </tr> + +% } +</table> +<%ARGS> +$Ticket => undef +</%ARGS> + diff --git a/rt/html/Ticket/Elements/ShowDates b/rt/html/Ticket/Elements/ShowDates new file mode 100644 index 000000000..2ccbb3fea --- /dev/null +++ b/rt/html/Ticket/Elements/ShowDates @@ -0,0 +1,84 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<TABLE> + <TR> + <TD class="label"><&|/l&>Created</&>:</TD> + <TD class="value"><% $Ticket->CreatedObj->AsString %></TD> + </TR> + <TR> + <TD class="label"><&|/l&>Starts</&>:</TD> + <TD class="value"><% $Ticket->StartsObj->AsString %></TD> + </TR> + <TR> + <TD class="label"><&|/l&>Started</&>:</TD> + <TD class="value"><% $Ticket->StartedObj->AsString %></TD> + </TR> + <TR> + <TD class="label"><a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$Ticket->id%>&Action=SetTold"><&|/l&>Last Contact</&></a>:</TD> + <TD class="value"><% $Ticket->ToldObj->AsString %></TD> + </TR> + <TR> + <TD class="label"><&|/l&>Due</&>:</TD> + <TD class="value"><% $Ticket->DueObj->AsString %></TD> + </TR> + <TR> + <TD class="label"><&|/l&>Closed</&>:</TD> + <TD class="value"><% $Ticket->ResolvedObj->AsString %></TD> + </TR> + <TR> + <TD class="label"><&|/l&>Updated</&>:</TD> +% my $UpdatedString = $Ticket->LastUpdated ? (loc("[_1] by [_2]", $Ticket->LastUpdatedAsString, $Ticket->LastUpdatedByObj->Name)) : loc("Never"); +% if ($UpdatedLink) { + <TD class="value"><A HREF="#lasttrans"><% $UpdatedString | h %></a></TD> +% } else { + <TD class="value"><% $UpdatedString | h %></TD> +% } + </TR> +</TABLE> +<%ARGS> +$Ticket => undef +$UpdatedLink => 1 +</%ARGS> diff --git a/rt/html/Ticket/Elements/ShowDependencies b/rt/html/Ticket/Elements/ShowDependencies new file mode 100644 index 000000000..f276bc949 --- /dev/null +++ b/rt/html/Ticket/Elements/ShowDependencies @@ -0,0 +1,63 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<&|/l&>Depends on</&>:<BR> +% while (my $Link = $Ticket->DependsOn->Next) { +% my $member = $Link->TargetObj; +<a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> +[<%$member->Status%>] + <br> +% } +<&|/l&>Depended on by</&>:<BR> +% while (my $Link = $Ticket->DependedOnBy->Next) { +% my $member = $Link->TargetObj; +<a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> +[<%$member->Status%>] + <br> +% } + +<%ARGS> +$Ticket => undef +</%ARGS> diff --git a/rt/html/Ticket/Elements/ShowGroupMembers b/rt/html/Ticket/Elements/ShowGroupMembers new file mode 100644 index 000000000..1fdb79aab --- /dev/null +++ b/rt/html/Ticket/Elements/ShowGroupMembers @@ -0,0 +1,60 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +%# Released under the terms of version 2 of the GNU Public License + +% my $UserMembers = $Group->UserMembersObj; +% while (my $member = $UserMembers->Next()) { +<& ShowUserEntry, User => $member &><br> +% } +% my $GroupMembers = $Group->MembersObj; +% $GroupMembers->LimitToGroups(); +% while (my $member = $GroupMembers->Next()) { +<&|/l&>Group</&>: <%$member->MemberObj->Object->Name%><br> +% } + +<%ARGS> +$Group => undef +</%ARGS>
\ No newline at end of file diff --git a/rt/html/Ticket/Elements/ShowHistory b/rt/html/Ticket/Elements/ShowHistory new file mode 100644 index 000000000..75e34776f --- /dev/null +++ b/rt/html/Ticket/Elements/ShowHistory @@ -0,0 +1,158 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<%perl> + if ($ShowDisplayModes or $ShowTitle) { +my $title; +my $titleright; +if ($ShowTitle) { + $title = loc('History'); +} +else { + $title = ' '; +} +$titleright = loc('Display mode') . ":"; +if ($ShowHeaders) { + $titleright .= "[<A HREF=\"" . $URIFile . "?id=" + . $Ticket->id . "\">" + . loc("Brief headers") + . "</a>] <b>[" + . loc("Full headers") . "]</b>"; +} +else { + $titleright .= "<b>[" + . loc("Brief headers") + . "]</b> [<A HREF=\"" + . $URIFile + . "?ShowHeaders=1" + . "&id=" + . $Ticket->id . "\">" + . loc("Full headers") . "</a>]"; +} +</%perl> +<& /Elements/TitleBoxStart, title => $title, titleright => $titleright, bodyclass=> ''&> +% } + +<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=2 BORDER=0> +<%perl> +my @attachments = @{$Attachments->ItemsArrayRef()}; +my @attachment_content = @{$AttachmentContent->ItemsArrayRef()}; + + + + + +while ( my $Transaction = $Transactions->Next ) { + my $skip = 0; + $m->comp( '/Elements/Callback', + _CallbackName => 'SkipTransaction', + Transaction => $Transaction, + skip => \$skip, + %ARGS ); + next if $skip; + $i++; + + my @trans_attachments = grep { $_->TransactionId == $Transaction->Id } @attachments; + + my $trans_content = {}; + grep { ($_->TransactionId == $Transaction->Id ) && ($trans_content->{$_->Id} = $_) } @attachment_content; + + + #Args is first because we're clobbering the "Attachments" parameter + $m->comp( 'ShowTransaction', + %ARGS, + + AttachPath => $AttachPath, + UpdatePath => $UpdatePath, + Ticket => $Ticket, + Transaction => $Transaction, + ShowHeaders => $ShowHeaders, + Collapsed => $Collapsed, + RowNum => $i, + ShowTitleBarCommands => $ShowTitleBarCommands, + Attachments => \@trans_attachments, + AttachmentContent => $trans_content, + LastTransaction => $Transactions->IsLast + ); + +# manually flush the content buffer after each txn, so the user sees +# some update +$m->flush_buffer(); +} + +</%perl> +</TABLE> +% if ($ShowDisplayModes or $ShowTitle) { +<& /Elements/TitleBoxEnd &> +% } +<%INIT> +my $Transactions = new RT::Transactions($session{'CurrentUser'}); +if ($Tickets) { + while (my $t = $Tickets->Next) { + $Transactions->LimitToTicket($t->id); + } +} else { + $Transactions = $Ticket->Transactions; +} +my $i; + +$Attachments ||= $m->comp('/Ticket/Elements/FindAttachments', Ticket => $Ticket, Tickets => $Tickets || undef); +$AttachmentContent ||= $m->comp('/Ticket/Elements/LoadTextAttachments', Ticket => $Ticket); + +</%INIT> +<%ARGS> +$URIFile => $RT::WebPath."/Ticket/Display.html" +$Ticket => undef +$Tickets => undef +$Attachments => undef +$AttachmentContent => undef +$ShowHeaders => undef +$Collapsed => undef +$ShowTitle => 1 +$ShowDisplayModes => 1 +$ShowTitleBarCommands => 1 +$AttachPath => $RT::WebPath."/Ticket/Attachment" +$UpdatePath => $RT::WebPath."/Ticket/Update.html" +</%ARGS> diff --git a/rt/html/Ticket/Elements/ShowMemberOf b/rt/html/Ticket/Elements/ShowMemberOf new file mode 100644 index 000000000..e443132bc --- /dev/null +++ b/rt/html/Ticket/Elements/ShowMemberOf @@ -0,0 +1,57 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<UL> +% my $memberof = $Ticket->MemberOf; +% while (my $member_of = $memberof->Next) { +<LI><a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member_of->Id%>"><%$member_of->Id%></a>: <%$member_of->Subject%> [<%$member_of->Status%>] +% } +</UL> + +<%INIT> +</%INIT> +<%ARGS> +$Ticket => undef +</%ARGS> diff --git a/rt/html/Ticket/Elements/ShowMembers b/rt/html/Ticket/Elements/ShowMembers new file mode 100644 index 000000000..f4fec1c7c --- /dev/null +++ b/rt/html/Ticket/Elements/ShowMembers @@ -0,0 +1,67 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +% if ($members->Count) { +<UL> +% while (my $link = $members->Next) { +% my $member= $link->BaseObj; +<LI><a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: <%$member->Subject%> [<%loc($member->Status)%>]<br> +% if ($depth < 8) { +<&/Ticket/Elements/ShowMembers, Ticket => $member, depth => ($depth+1) &> +% } +% } +</UL> +% } + +<%INIT> + +my $members = $Ticket->Members; + +</%INIT> + +<%ARGS> +$Ticket => undef +$depth => 1 +</%ARGS> diff --git a/rt/html/Ticket/Elements/ShowMessageHeaders b/rt/html/Ticket/Elements/ShowMessageHeaders new file mode 100644 index 000000000..8dc76bae3 --- /dev/null +++ b/rt/html/Ticket/Elements/ShowMessageHeaders @@ -0,0 +1,88 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +% use Data::Dumper; +<table> +% foreach my $header (@headers) { +% next unless ($display_headers{'_all'} || $display_headers{lc($header->{'Tag'})}); +<tr> +<td align="right" class="message-header-key"><%$header->{'Tag'}%>:</td> +<td class="message-header-value"><%$header->{'Value'} | n%></td> +</tr> +% } +</table> +<%INIT> +my $content = $Headers; +$m->comp('/Elements/Callback', content => \$content, %ARGS); + +# apply html escaping on the original content +# we'll display the value without escaping later (for MakeClicky et al.) +$content = $m->interp->apply_escapes($content, 'h'); + +my @lines = split (/\n/,$content); +my $in_header = 0; +my @headers =(); +foreach (@lines) { + if (/^(\S+):\s+(.*)$/) { + push (@headers, { Tag => $1, Value => $2} ); + } elsif ($headers[-1]) { + $headers[-1]->{'Value'} .= $_; + } else { + + push (@headers, { Tag => $_, Value => ''} ); + } +} + +my %display_headers; + +map { $display_headers{lc($_)} = 1 } @$DisplayHeaders; + +$m->comp('/Elements/Callback', _CallbackName => 'Headers', content => \$content, headers => \@headers, display_headers => \%display_headers, %ARGS); + +</%INIT> +<%ARGS> +$Headers => undef +$DisplayHeaders => undef +</%ARGS> diff --git a/rt/html/Ticket/Elements/ShowMessageStanza b/rt/html/Ticket/Elements/ShowMessageStanza new file mode 100644 index 000000000..eaf551de9 --- /dev/null +++ b/rt/html/Ticket/Elements/ShowMessageStanza @@ -0,0 +1,83 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +% if (ref($Message)) { +<font color="<%$colors[$Depth]%>"> +<%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/<br>/gi if defined $content; + +</%perl> +<%$content |n%><br> +% } +% } # end foreach +</font> +% } else { +% my $content = $Message; +% RT::Interface::Web::EscapeUTF8(\$content); +% $m->comp('/Elements/Callback', content => \$content, %ARGS); +% $content =~ s/\n/<br>/gi; +<%$content |n%><br> +% } +<%INIT> +use URI::URL; +my $server = 'fsck.com'; +my @colors = ('#000000', '#660000', '#006600', '#000066', '#cc0000', '#00cc00', '#0000cc', '#ff0000', '#00ff00', '#0000ff'); +</%INIT> +<%ARGS> +$Message => undef +$Depth => 0 +$Transaction => undef +</%ARGS> diff --git a/rt/html/Ticket/Elements/ShowPeople b/rt/html/Ticket/Elements/ShowPeople new file mode 100644 index 000000000..dbec93928 --- /dev/null +++ b/rt/html/Ticket/Elements/ShowPeople @@ -0,0 +1,66 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<table> + <tr> + <td class="label"><&|/l&>Owner</&>:</td> + <td class="value"><& ShowUserEntry, User => $Ticket->OwnerObj &></td> + </tr> + <tr> + <td class="labeltop"><&|/l&>Requestors</&>:</td> + <td class="value"><& ShowGroupMembers, Group => $Ticket->Requestors &></td> + </tr> + <tr> + <td class="labeltop"><&|/l&>Cc</&>:</td> + <td class="value"><& ShowGroupMembers, Group => $Ticket->Cc &></td> + </tr> + <tr> + <td class="labeltop"><&|/l&>AdminCc</&>:</td> + <td class="value"><& ShowGroupMembers, Group => $Ticket->AdminCc &></td> + </tr> +</table> +<%ARGS> +$Ticket => undef +</%ARGS> diff --git a/rt/html/Ticket/Elements/ShowReferences b/rt/html/Ticket/Elements/ShowReferences new file mode 100644 index 000000000..bb323f66c --- /dev/null +++ b/rt/html/Ticket/Elements/ShowReferences @@ -0,0 +1,72 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<UL> +% while (my $Link = $Ticket->RefersTo->Next) { +<LI> +% if ($Link->TargetURI->IsLocal) { +% my $member = $Link->TargetObj; + +<a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]<br> +% } else { +<A HREF="<%$Link->TargetURI->HREF%>"><%$Link->Target%></A> +% } +%} + + + +% while (my $Link = $Ticket->ReferredToBy->Next) { +<LI> +% if ($Link->BaseURI->IsLocal) { +% my $member = $Link->BaseObj; +<a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]<br> +% } else { +<A HREF="<%$Link->BaseURI->HREF%>"><%$Link->Base%></A> +%} +% } +</UL> +<%ARGS> +$Ticket => undef +</%ARGS> diff --git a/rt/html/Ticket/Elements/ShowRequestor b/rt/html/Ticket/Elements/ShowRequestor new file mode 100644 index 000000000..421d38e0a --- /dev/null +++ b/rt/html/Ticket/Elements/ShowRequestor @@ -0,0 +1,88 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<%PERL> +my $rows = 10; +my $people = $Ticket->Requestors->UserMembersObj; +while (my $requestor=$people->Next) { +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'); +</%PERL> + +% unless ($requestor->Privileged) { +<& /Elements/TitleBoxStart, + title => "<a class='inverse' href=\"$RT::WebPath/Admin/Users/Modify.html?id=".$requestor->id."\">".loc("More about [_1]", $name)."</a>" &> + +%# Additional information about this user. Empty by default. +<& /Elements/Callback, _CallbackName => 'AboutThisUser', requestor => $requestor, %ARGS &> + +<&|/l&>Comments about this user</&>:<BR> +<B><% ($requestor->Comments || loc("No comment entered about this user")) %></B><BR> + +<&|/l, $rows &>This user's [_1] highest priority tickets</&>:<BR> +<UL> +%while (my $w=$tickets->Next) { +<LI><a href="<%$RT::WebPath%><%$DisplayPath%>?id=<%$w->id%>"><%$w->Id%>: <%$w->Subject%></a> (<%$w->Status%>) +%} +</UL> + +<&|/l&>Groups this user belongs to</&>:<BR> + +<& /Elements/ShowMemberships, UserObj => $requestor &> + +<& /Elements/TitleBoxEnd &> + +% } +%} +<%ARGS> +$Ticket=>undef +$DisplayPath => "/Ticket/Display.html" +</%ARGS> diff --git a/rt/html/Ticket/Elements/ShowSummary b/rt/html/Ticket/Elements/ShowSummary new file mode 100644 index 000000000..5a6e7e099 --- /dev/null +++ b/rt/html/Ticket/Elements/ShowSummary @@ -0,0 +1,114 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} + <TABLE WIDTH="100%" class="ticketsummary" > + <TR> + <TD VALIGN=TOP WIDTH="50%" class="boxcontainer"> + <& /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 &> + <br> +% if ($Ticket->QueueObj->TicketCustomFields->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 &> + +<br> +% } + <& /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 &> + <br> + + <& /Elements/TitleBoxStart, title => loc('Customers'), + title_href =>"$RT::WebPath/Ticket/ModifyCustomers.html?id=".$Ticket->Id, + title_class=> 'inverse', + color => "#7f007b" &> + <& /Ticket/Elements/ShowCustomers, Ticket => $Ticket &> + <& /Elements/TitleBoxEnd &> + + <BR> + </TD> + <TD VALIGN=TOP WIDTH="50%" class="boxcontainer"> + + <& /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 &> + <BR> + <& /Elements/TitleBoxStart, title => loc('Links'), + title_href => "$RT::WebPath/Ticket/ModifyLinks.html?id=".$Ticket->Id, + title_class=> 'inverse', + titleright => '', color=> "#336633" &> + <& /Elements/ShowLinks, Ticket => $Ticket &> + <& /Elements/TitleBoxEnd &> + <BR> + <& /Ticket/Elements/ShowAttachments, Ticket => $Ticket, Attachments => $Attachments &> + + <& /Ticket/Elements/ShowRequestor, Ticket => $Ticket &> + + + </TD> + </TR> + </TABLE> +<%ARGS> +$Ticket => undef +$Attachments => undef +</%ARGS> + + + + diff --git a/rt/html/Ticket/Elements/ShowTransaction b/rt/html/Ticket/Elements/ShowTransaction new file mode 100644 index 000000000..8bf589d45 --- /dev/null +++ b/rt/html/Ticket/Elements/ShowTransaction @@ -0,0 +1,186 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<TR class="<% $RowNum%2 ? 'oddline' : 'evenline'%>" > +<TD rowspan="2" valign="top" bgcolor="<%$bgcolor%>"><A NAME="txn-<%$Transaction->Id%>" href="<% $DisplayPath %>#txn-<%$Transaction->Id%>">#</A><% $LastTransaction ? '<a name="lasttrans"> </a>' : ' ' |n %></TD> +<TD>  </TD> +<TD><font size=-2><% $transdate|n %></font> </TD> +% my $desc = $Transaction->BriefDescription; +% $m->comp('/Elements/Callback', _CallbackName => 'ModifyDisplay', text => \$desc, Transaction => $Transaction, %ARGS); +<TD ALIGN="LEFT"><b><%$Transaction->CreatorObj->Name%> - <%$TicketString%> <%$desc%> + +</b></TD> +<TD><%$TimeTaken%> </TD> +<TD ALIGN="RIGHT"><font size=-1><%$titlebar_commands|n%></font></TD> +</TR> +<TR class="<% $RowNum%2 ? 'oddline' : 'evenline'%>"><TD colspan=5> +% if ($Transaction->CustomFieldValues->Count) { +<& /Elements/ShowCustomFields, Object => $Transaction &> +% } +% $m->comp('ShowTransactionAttachments', %ARGS, Parent => 0) unless ($Collapsed ||!$ShowBody); +</TD> +</TR> + +<%ARGS> +$Ticket => undef +$Transaction => undef +$ShowHeaders => 0 +$Collapsed => undef +$ShowTitleBarCommands => 1 +$RowNum => 1 +$DisplayPath => $RT::WebPath."/Ticket/Display.html?id=".$Ticket->id +$AttachPath => $RT::WebPath."/Ticket/Attachment" +$UpdatePath => $RT::WebPath."/Ticket/Update.html" +$EmailRecordPath => $RT::WebPath."/Ticket/ShowEmailRecord.html" +$Attachments => undef +$AttachmentContent => undef +$ShowBody => 1 +$LastTransaction => 0 +</%ARGS> + +<%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 . ": "; +} +$TicketString ||= ''; + +if ( $Transaction->TimeTaken != 0 ) { + $TimeTaken = $Transaction->TimeTaken . " min"; +} else { + $TimeTaken = ''; +} + +unless ($Attachments) { + my $attachments = $Transaction->Attachments; + $attachments->Columns( qw( Id Filename ContentType Headers Subject Parent ContentEncoding ContentType TransactionId) ); + $Attachments = $attachments->ItemsArrayRef(); +} +my $titlebar_commands = ' '; + +my @DisplayHeaders=qw ( _all); + +if ( $Transaction->Type =~ /EmailRecord$/ ) { + @DisplayHeaders = qw(To Cc Bcc); + + $titlebar_commands .= + "[<a target=\"_blank\" href=\"$EmailRecordPath?id=" + . $Transaction->Ticket + . "&Transaction=" + . $Transaction->Id + . "&Attachment=" + . ( $Transaction->Attachments->First + && $Transaction->Attachments->First->Id ) + + . '">' . loc('Show') . "</a>] "; + $ShowBody = 0; +} + + +# If the transaction has anything attached to it at all +else { + + unless ( $ShowHeaders ) { + @DisplayHeaders = qw(To From RT-Send-Cc Cc Bcc Date Subject); + } + + if ( $Attachments->[0] && $ShowTitleBarCommands ) { + if ( $Transaction->TicketObj->CurrentUserHasRight('ReplyToTicket') + or $Transaction->TicketObj->CurrentUserHasRight('ModifyTicket')) { + $titlebar_commands .= + "[<a href=\"".$UpdatePath."?id=" + . $Transaction->Ticket + . "&QuoteTransaction=" + . $Transaction->Id + . "&Action=Respond\">" + . loc('Reply') + . "</a>] "; + } + if ( $Transaction->TicketObj->CurrentUserHasRight('CommentOnTicket') + or $Transaction->TicketObj->CurrentUserHasRight('ModifyTicket')) { + $titlebar_commands .= + "[<a href=\"".$UpdatePath."?id=" + . $Transaction->Ticket + . "&QuoteTransaction=" + . $Transaction->Id + . "&Action=Comment\">" + . loc('Comment') . "</a>]"; + } + } +} +</%INIT> diff --git a/rt/html/Ticket/Elements/ShowTransactionAttachments b/rt/html/Ticket/Elements/ShowTransactionAttachments new file mode 100644 index 000000000..8dabff421 --- /dev/null +++ b/rt/html/Ticket/Elements/ShowTransactionAttachments @@ -0,0 +1,201 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<%perl> +# Find all the attachments which have parent $Parent +# For each of these attachments +foreach my $message ( grep { $_->Parent == $Parent } @$Attachments ) { + + # {{{ show the headers + my $headers = $message->Headers; + chomp $headers; + + # localize the common headers (like 'Subject:'), too. + $headers =~ s/^([^:]+)(?=:)/loc($1)/em; + $m->comp( + 'ShowMessageHeaders', + Headers => $headers, + Transaction => $Transaction, + DisplayHeaders => \@DisplayHeaders + ); + + # }}} + # {{{ if there's any size at all, show the download link + my $size = $message->ContentLength; + if ($size) { + +</%perl> +<div class="downloadattachment"> +<%perl> + + # show a download link + if ( $size > 1024 ) { + $size = loc( "[_1]k", int( $size / 102.4 ) / 10 ); + } + else { + $size = loc( "[_1]b", $size ); + } + +</%PERL> +<A HREF="<%$AttachPath%>/<%$Transaction->Id%>/<%$message->Id%>/<%$message->Filename | u%>"><&|/l&>Download</&> <%$message->Filename || loc('(untitled)') %></a> +<div class="downloadcontenttype"> +<%$message->ContentType%> <% $size %> +</div> +</div> +% } +% # }}} +<div class="messagebody"> +<%perl> +# {{{ if it has a content-disposition: attachment, don't show inline +unless ( $message->GetHeader('Content-Disposition') =~ /attachment/i ) { + + my $content; + + # If it's text + if ( $message->ContentType =~ m{^(text|message)}i + && $size <= $RT::MaxInlineBody ) + { + + if ( + + # it's a toplevel object + !$ParentObj + + # or its parent isn't a multipart alternative + || ( $ParentObj->ContentType !~ m{^multipart/alternative$}i ) + + # or it's of our prefered alterative type + || ( + ( + $RT::PreferRichText + && ( $message->ContentType =~ m{^text/(?:html|enriched)$} ) + ) + || ( !$RT::PreferRichText + && ( $message->ContentType !~ m{^text/(?:html|enriched)$} ) + ) + ) + ) + { + + if ( $AttachmentContent->{ $message->id } ) { + $content = $AttachmentContent->{ $message->id }->Content; + } + else { + $content = $message->Content; + } + + # if it's a text/html clean the body and show it + if ( $message->ContentType =~ m{^text/(?:html|enriched)$}i ) { + $content = + $m->comp( '/Elements/ScrubHTML', Content => $content ); + $m->out($content); + } + + # if it's a text/plain show the body + elsif ( $message->ContentType =~ m{^(text|message|text)}i ) { + + eval { $content = Text::Quoted::extract($content); }; + if ($@) { 1; } + + $m->comp( + 'ShowMessageStanza', + Depth => 0, + Message => $content, + Transaction => $Transaction + ); + } + } + + } + + # if it's an image, show it as an image + elsif ( $message->ContentType =~ /^image\//i ) { + $m->out('<img src="' + . $AttachPath . '/' + . $Transaction->Id . '/' + . $message->Id + . '/">' ); + } +} + +# }}} + +$m->comp( + 'ShowTransactionAttachments', %ARGS, + Parent => $message->id, + ParentObj => $message +); + +} +</%PERL> +</div> +<%ARGS> +$Ticket => undef +$Transaction => undef +$ShowHeaders => 0 +$Collapsed => undef +$ShowTitleBarCommands => 1 +$RowNum => 1 +$AttachPath => $RT::WebPath."/Ticket/Attachment" +$UpdatePath => $RT::WebPath."/Ticket/Update.html" +$EmailRecordPath => $RT::WebPath."/Ticket/ShowEmailRecord.html" +$Attachments => undef +$AttachmentContent => undef +$ShowBody => 1 +$Parent => 0 +$ParentObj => 0 +</%ARGS> +<%INIT> +my @DisplayHeaders=qw( _all); + +if ( $Transaction->Type =~ /EmailRecord$/ ) { + @DisplayHeaders = qw(To Cc Bcc); +} + +# If the transaction has anything attached to it at all +elsif (!$ShowHeaders) { + @DisplayHeaders = qw(To From RT-Send-Cc Cc Bcc Date Subject); +} +</%INIT> diff --git a/rt/html/Ticket/Elements/ShowUserEntry b/rt/html/Ticket/Elements/ShowUserEntry new file mode 100644 index 000000000..163bcbdb1 --- /dev/null +++ b/rt/html/Ticket/Elements/ShowUserEntry @@ -0,0 +1,55 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +%# Released under the terms of version 2 of the GNU Public License + +<%$User->Name%> +% if ($User->EmailAddress && $User->EmailAddress ne $User->Name) { +<<%$User->EmailAddress%>> +% } + +<%ARGS> +$User => undef +</%ARGS>
\ No newline at end of file diff --git a/rt/html/Ticket/Elements/Tabs b/rt/html/Ticket/Elements/Tabs new file mode 100644 index 000000000..46e1d4a27 --- /dev/null +++ b/rt/html/Ticket/Elements/Tabs @@ -0,0 +1,220 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<& /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/Build.html", +my $searchtabs = {}; +my $actions; + +if ( $Ticket) { + +my $id = $Ticket->id(); + +if ( defined $session{'tickets'} ) { + + # we have to update session data if we get new ItemMap + my $updatesession = 1 unless($session{'tickets'}->{'item_map'}); + + my $item_map = $session{'tickets'}->ItemMap; + + if ($updatesession) { + $session{'i'}++; + $session{'tickets'}->PrepForSerialization(); + } + + # Don't 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, }, + _Eb=> { title => loc('Customers'), + path => "Ticket/ModifyCustomers.html?id=" . $id, }, + _F => { title => loc('Jumbo'), + path => "Ticket/ModifyAll.html?id=" . $id, + separator => 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, + }; +} +} + +my $args = "?" . $m->comp( + '/Elements/QueryString', + Query => $ARGS{'Query'} || $session{'CurrentSearchHash'}->{'Query'}, + Format => $ARGS{'Format'} || $session{'CurrentSearchHash'}->{'Format'}, + OrderBy => $ARGS{'OrderBy'} || $session{'CurrentSearchHash'}->{'OrderBy'}, + Order => $ARGS{'Order'} || $session{'CurrentSearchHash'}->{'Order'}, + Rows => $ARGS{'Rows'}, + ) if ($ARGS{'Query'} or $session{'CurrentSearchHash'}->{'Query'}); +$args ||= ''; + +$tabs->{"f"} = { path => "Search/Build.html?NewQuery=1", + title => loc('New Query')}; +$tabs->{"g"} = { path => "Search/Build.html$args", + title => loc('Query Builder')}; +$tabs->{"h"} = { path => "Search/Edit.html$args", + title => loc('Advanced'), + separator => 1 }; +if (defined $session{'tickets'} and $session{'tickets'}->Count) { + $tabs->{"i"} = { path => "Search/Results.html$args", + title => loc('Show Results'), + separator => 1, + subtabs => $searchtabs }; + if ($current_tab =~ "Search/Results.html") { + $current_tab = "Search/Results.html$args"; + } +} + +</%INIT> + + +<%ARGS> +$Ticket => undef +$subtabs => undef +$current_tab => '' +$current_subtab => '' +$Title => undef +</%ARGS> diff --git a/rt/html/Ticket/History.html b/rt/html/Ticket/History.html new file mode 100644 index 000000000..a80cd0002 --- /dev/null +++ b/rt/html/Ticket/History.html @@ -0,0 +1,85 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<& /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) &> + +<BR> + +<& /Ticket/Elements/ShowHistory , + Ticket => $Ticket, + ShowHeaders => $ARGS{'ShowHeaders'}, + URIFile => 'History.html', + Attachments => $attachments, + AttachmentContent => $attachment_content + &> + + +<%ARGS> +$id => undef +</%ARGS> + +<%INIT> + + + +my $Ticket = LoadTicket ($id); + +unless ($Ticket->CurrentUserHasRight('ShowTicket')) { + Abort("No permission to view ticket"); +} + +my $attachments = $m->comp('Elements/FindAttachments', Ticket => $Ticket); +my $attachment_content = $m->comp('Elements/LoadTextAttachments', Ticket => +$Ticket); + + +</%INIT> + + + + diff --git a/rt/html/Ticket/Modify.html b/rt/html/Ticket/Modify.html new file mode 100644 index 000000000..a6c316141 --- /dev/null +++ b/rt/html/Ticket/Modify.html @@ -0,0 +1,85 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<& /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 &> +<FORM METHOD=POST ACTION="Modify.html" ENCTYPE="multipart/form-data"> +<INPUT TYPE=HIDDEN NAME=id VALUE="<%$TicketObj->Id%>"> + +<& /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" &> +</form> +<%INIT> + +my $TicketObj = LoadTicket($id); +my $CustomFields = $TicketObj->QueueObj->TicketCustomFields(); + +# 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 = ProcessObjectCustomFieldUpdates(Object => $TicketObj, 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"); +} + +</%INIT> + + +<%ARGS> +$id => undef +</%ARGS> diff --git a/rt/html/Ticket/ModifyAll.html b/rt/html/Ticket/ModifyAll.html new file mode 100644 index 000000000..23cd93570 --- /dev/null +++ b/rt/html/Ticket/ModifyAll.html @@ -0,0 +1,204 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<& /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 &> + +<FORM METHOD=POST ACTION="ModifyAll.html" ENCTYPE="multipart/form-data"> +<INPUT TYPE=HIDDEN NAME=id VALUE="<%$Ticket->Id%>"> + + +<& /Elements/TitleBoxStart, title => loc('Modify ticket # [_1]', $Ticket->Id), color=> "#993333", width => "100%" &> +<& Elements/EditBasics, TicketObj => $Ticket &> +<& Elements/EditCustomFields, TicketObj => $Ticket &> +<& /Elements/TitleBoxEnd &> + +<BR> + +<& /Elements/TitleBoxStart, title => loc('Dates'), width => "100%", color => "#663366" &> +<& Elements/EditDates, TicketObj => $Ticket &> +<& /Elements/TitleBoxEnd &> + +<BR> + + +<& /Elements/TitleBoxStart, title => loc('People'),width => "100%", color=> "#333399" &> +<& Elements/EditPeople, Ticket => $Ticket, UserField => $UserField, UserString => $UserString, UserOp => $UserOp &> +<& /Elements/TitleBoxEnd &> + +<BR> + +<& /Elements/TitleBoxStart, title => loc('Links'), color => "#336633"&> +<& /Elements/EditLinks, Object => $Ticket, Merge => 1 &> +<& /Elements/TitleBoxEnd &> + +<BR> + +<& /Elements/TitleBoxStart, title => loc('Update ticket') &> +<table> + <tr> + <td class="label"><&|/l&>Update Type</&>:</td> + <td class="entry"> + <select name="UpdateType"> +% if ($CanComment) { + <option value="private" ><&|/l&>Comments (Not sent to requestors)</&></option> +% } +% if ($CanRespond) { + <option value="response"><&|/l&>Reply to requestors</&></option> +% } + </select> + </td> + </tr> + <tr> + <td class="label"><&|/l&>Subject</&>:</td> + <td class="entry"><input name="UpdateSubject" size=60 value="<%$Ticket->Subject%>"></td> + </tr> +% if (my $TxnCFs = $Ticket->TransactionCustomFields) { +% while (my $CF = $TxnCFs->Next()) { +<TR> +<TD class="label"><% $CF->Name %>:</TD> +<TD class="entry"><& /Elements/EditCustomField, + CustomField => $CF, + NamePrefix => "Object-RT::Transaction--CustomField-" + &><em><% $CF->FriendlyType %></em></TD> +</TD></TR> +% } # end if while +% } # end of if + <tr> + <td class="label"><&|/l&>Attach</&>:</td> + <td class="entry"><input name="UpdateAttachment" type=file></td> + </tr> + <tr> + <td class="labeltop"><&|/l&>Content</&>:</td> + <td class="entry"><& /Elements/MessageBox, Name=>"UpdateContent", QuoteTransaction=>$ARGS{QuoteTransaction} &></td> + </tr> +</table> +<& /Elements/TitleBoxEnd &> + + +<& /Elements/Submit, + Label => loc('Save Changes'), + Caption => loc("If you've updated anything above, be sure to"), color => "#333399" &> +</form> + +<%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); + @cf_results = ProcessObjectCustomFieldUpdates( Object => $Ticket, ARGSRef => \%ARGS); + @dresults = ProcessTicketDates( TicketObj => $Ticket, ARGSRef => \%ARGS); + @lresults = ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS); + + if ($ARGS{'UpdateAttachment'}) { + my $subject = "$ARGS{'UpdateAttachment'}"; + # 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 => 'UpdateAttachment' + ); + delete $ARGS{'UpdateAttachment'}; + $ARGS{'UpdateAttachments'}->{ $subject } = $attachment; + } + + $ARGS{'UpdateContent'} =~ s/\r+\n/\n/g; + + if ($ARGS{'UpdateAttachments'} || ( $ARGS{'UpdateContent'} && $ARGS{'UpdateContent'} ne "-- \n" . + $session{'CurrentUser'}->UserObj->Signature)) { + ProcessUpdateMessage(TicketObj => $Ticket, ARGSRef=>\%ARGS, Actions=>\@results); + } + @results = ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS); +} +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"); +} + + +</%INIT> + + + +<%ARGS> +$OnlySearchForPeople => undef +$UserField => undef +$UserOp => undef +$UserString => undef +$id => undef +</%ARGS> + diff --git a/rt/html/Ticket/ModifyCustomers.html b/rt/html/Ticket/ModifyCustomers.html new file mode 100644 index 000000000..72d103b23 --- /dev/null +++ b/rt/html/Ticket/ModifyCustomers.html @@ -0,0 +1,49 @@ +%# Copyright (c) 2004 Ivan Kohler <ivan-rt@420.am> +%# +%# 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. +<& /Elements/Header, Title => loc("Customers for ticket #[_1]", $Ticket->Id) &> +<& /Ticket/Elements/Tabs, + Ticket => $Ticket, + current_tab => "Ticket/ModifyCustomers.html?id=".$Ticket->Id, + Title => loc("Customers for ticket #[_1]", $Ticket->Id) &> + +<& /Elements/ListActions, actions => \@results &> + +<form action="ModifyCustomers.html" method="post"> +<input type="hidden" name="id" value="<%$Ticket->id%>"> + +<& /Elements/TitleBoxStart, title => loc('Edit Customer Links'), color => "#7f007b"&> +<& Elements/EditCustomers, Ticket => $Ticket, CustomerString => $CustomerString, ServiceString => $ServiceString &> +<& /Elements/TitleBoxEnd &> +<& /Elements/Submit, color => "#7f007b", Label => loc('Save Changes') &> +</form> + + +<%INIT> + +my @results = (); +my $Ticket = LoadTicket($id); + +# if we're trying to search for customers/services and nothing else +unless ( $OnlySearchForCustomers || $OnlySearchForServices) { + @results = ProcessTicketCustomers( TicketObj => $Ticket, ARGSRef => \%ARGS); +} + +</%INIT> + + +<%ARGS> +$OnlySearchForCustomers => undef +$OnlySearchForServices => undef +$CustomerString => undef +$ServiceString => undef +$id => undef +</%ARGS> diff --git a/rt/html/Ticket/ModifyDates.html b/rt/html/Ticket/ModifyDates.html new file mode 100644 index 000000000..a4f68f2f5 --- /dev/null +++ b/rt/html/Ticket/ModifyDates.html @@ -0,0 +1,74 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<& /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 &> + +<FORM METHOD=POST ACTION="ModifyDates.html"> +<INPUT TYPE=HIDDEN NAME=id VALUE="<%$TicketObj->Id%>"> +<& /Elements/TitleBoxStart, title => loc('Modify dates for ticket # [_1]', $TicketObj->Id), width => "100%", color => "#663366" &> + +<& Elements/EditDates, TicketObj => $TicketObj &> +<& /Elements/TitleBoxEnd &> +<& /Elements/Submit, Label => loc('Save Changes'), color => "#663366" &> +</form> + + +<%INIT> + +my $TicketObj = LoadTicket($id); +my @results = ProcessTicketDates( TicketObj => $TicketObj, ARGSRef => \%ARGS); + +</%INIT> + + +<%ARGS> +$id => undef +</%ARGS> diff --git a/rt/html/Ticket/ModifyLinks.html b/rt/html/Ticket/ModifyLinks.html new file mode 100644 index 000000000..150597d89 --- /dev/null +++ b/rt/html/Ticket/ModifyLinks.html @@ -0,0 +1,76 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<& /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 &> + +<form action="ModifyLinks.html" method="post"> +<input type="hidden" name="id" value="<%$Ticket->id%>"> + +<& /Elements/TitleBoxStart, title => loc('Edit Links'), color => "#336633"&> +<& /Elements/EditLinks, Object => $Ticket, Merge => 1 &> +<& /Elements/TitleBoxEnd &> +<& /Elements/Submit, color => "#336633", Label => loc('Save Changes') &> +</form> + + + + +<%INIT> + +my $Ticket = LoadTicket($id); +my @results = ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS); + +</%INIT> + + +<%ARGS> +$id => undef +</%ARGS> diff --git a/rt/html/Ticket/ModifyPeople.html b/rt/html/Ticket/ModifyPeople.html new file mode 100644 index 000000000..61cbe6c27 --- /dev/null +++ b/rt/html/Ticket/ModifyPeople.html @@ -0,0 +1,90 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<& /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 &> + +<FORM METHOD=POST ACTION="ModifyPeople.html"> +<INPUT TYPE=HIDDEN NAME=id VALUE="<%$Ticket->Id%>"> +<& /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" &> +</form> + +<%INIT> + +my (@results, @wresults); + +my $Ticket = LoadTicket($id); + +# if we're trying to search for watchers and nothing else +unless ($OnlySearchForPeople or $OnlySearchForGroup) { + @results = ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS); + @wresults = ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS); +} + +push @results, @wresults; +</%INIT> + + + +<%ARGS> +$OnlySearchForPeople => undef +$OnlySearchForGroup => undef +$UserField => undef +$UserOp => undef +$UserString => undef +$GroupField => undef +$GroupOp => undef +$GroupString => undef +$id => undef +</%ARGS> + diff --git a/rt/html/Ticket/ShowEmailRecord.html b/rt/html/Ticket/ShowEmailRecord.html new file mode 100644 index 000000000..38eddd3d2 --- /dev/null +++ b/rt/html/Ticket/ShowEmailRecord.html @@ -0,0 +1,71 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<%args> +$Attachment => undef +$Transaction => undef +</%ARGS> +<%init> + my $AttachmentObj = new RT::Attachment($session{'CurrentUser'}); + $AttachmentObj->Load($Attachment) || Abort(loc("Attachment '[_1]' could not be loaded", $Attachment)); + + + unless ($AttachmentObj->id) { + Abort(loc("Attachment '[_1]' could not be loaded", $Attachment)); + } + unless ($AttachmentObj->TransactionId() == $Transaction ) { + Abort(loc("Attachment '[_1]' could not be loaded", $Attachment)); + } + +</%init> +<& /Elements/Header, ShowBar => 0 &> +<pre> +<%$AttachmentObj->Headers%> + +<%$AttachmentObj->Content%> +</pre> +</body> +</html> +%$m->abort; diff --git a/rt/html/Ticket/Update.html b/rt/html/Ticket/Update.html new file mode 100644 index 000000000..df739c9c7 --- /dev/null +++ b/rt/html/Ticket/Update.html @@ -0,0 +1,224 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<& /Elements/Header, Title => $title &> +<& /Ticket/Elements/Tabs, + Ticket => $TicketObj, + Title=> $title &> + +<FORM ACTION="Update.html" NAME="TicketUpdate" + METHOD=POST enctype="multipart/form-data"> +<input type="hidden" name="QuoteTransaction" value="<% $ARGS{QuoteTransaction} %>"> +<input type="hidden" name="DefaultStatus" value="<% $DefaultStatus %>"> +<input type="hidden" name="Action" value="<% $ARGS{Action} %>"> + +<TABLE BORDER=0> + +<tr><td align=right><&|/l&>Status</&>:</td> +<td> +<& /Elements/SelectStatus, Name=>"Status", DefaultLabel => loc("[_1] (Unchanged)", loc($TicketObj->Status)), Default => $ARGS{'Status'} || ($TicketObj->Status eq $DefaultStatus ? undef : $DefaultStatus)&> +<&|/l&>Owner</&>: +<& /Elements/SelectOwner, Name=>"Owner", DefaultLabel => loc("[_1] (Unchanged)", $TicketObj->OwnerObj->Name()), QueueObj => $TicketObj->QueueObj, TicketObj => $TicketObj, Default => $ARGS{'Owner'} &> +<&|/l&>Worked</&>: <input size=4 name="UpdateTimeWorked" value="<% $ARGS{UpdateTimeWorked}%>"> <&|/l&>minutes</&></td></tr> +% my $skip; +<& /Elements/Callback, _CallbackName => 'BeforeUpdateType', skip => \$skip, %ARGS &> +% if (!$skip) { +<INPUT TYPE=HIDDEN NAME=id VALUE="<%$TicketObj->Id%>"><br> +% } +<tr><td align=right><&|/l&>Update Type</&>:</td> +<td><select name="UpdateType"> +% if ($CanComment) { + <option value="private" <%$ARGS{'UpdateType'} eq "private" ? "SELECTED" : !$ARGS{'UpdateType'}&&$CommentDefault%>><&|/l&>Comments (Not sent to requestors)</&></option> +% } +% if ($CanRespond) { + <option value="response" <%$ARGS{'UpdateType'} eq "response" ? "SELECTED" : !$ARGS{'UpdateType'}&&$ResponseDefault%>><&|/l&>Reply to requestors</&></option> +% } +</select> +</td></tr> +<tr><td align=right><&|/l&>Subject</&>:</td><td> <input name="UpdateSubject" size=60 value="<% $ARGS{UpdateSubject} || $TicketObj->Subject()%>"></td></tr> +<tr><td align=right><&|/l&>Cc</&>:</td><td> <input name="UpdateCc" size=60 +value="<% $ARGS{UpdateCc} %>"><BR> +<i><font size=-2> +<&|/l&>(Sends a carbon-copy of this update to a comma-delimited list of email addresses. Does <b>not</b> change who will receive future updates.)</&></font></i> +</td></tr> +<tr><td align=right><&|/l&>Bcc</&>:</td><td> <input name="UpdateBcc" size=60 VALUE="<%$ARGS{UpdateBcc}%>"><BR> +<i><font size=-2> +<&|/l&>(Sends a blind carbon-copy of this update to a comma-delimited list of email addresses. Does <b>not</b> change who will receive future updates.)</&></font></i> +</td></tr> +% if (exists $session{'Attachments'}) { +<TD> +<&|/l&>Attached file</&>: +</TD> +<TD COLSPAN=5> +<&|/l&>Check box to delete</&><BR> +% foreach my $attach_name (keys %{$session{'Attachments'}}) { +<input type="checkbox" name="DeleteAttach-<%$attach_name%>" value="1"><%$attach_name%><BR> +% } # end of foreach +</TD> +</TR> +<TR> +% } # end of if + +% if (my $TxnCFs = $TicketObj->TransactionCustomFields) { +% while (my $CF = $TxnCFs->Next()) { +<TR> +<TD ALIGN=RIGHT><% $CF->Name %>:</TD> +<TD><& /Elements/EditCustomField, CustomField => $CF, NamePrefix => + "Object-RT::Transaction--CustomField-" &><em><% $CF->FriendlyType %></em></TD> +</TR> +% } # end if while +% } # end of if + +<tr><td align=right><&|/l&>Attach</&>:</td><td><input name="Attach" type="file"><INPUT TYPE=SUBMIT NAME="AddMoreAttach" VALUE="<&|/l&>Add More Files</&>"><input type="hidden" name="UpdateAttach" value="1"> +</td></tr> +<tr><td align="right" valign="top"><&|/l&>Message</&>:</td><td> +<& /Elements/Callback, _CallbackName => 'BeforeMessageBox', %ARGS &> +% if (exists $ARGS{UpdateContent}) { +% # preserve QuoteTransaction so we can use it to set up sane references/in/reply to +% my $temp = $ARGS{'QuoteTransaction'}; +% delete $ARGS{'QuoteTransaction'}; +<& /Elements/MessageBox, Name=>"UpdateContent", Default=>$ARGS{UpdateContent}, IncludeSignature => 0, %ARGS&> +% $ARGS{'QuoteTransaction'} = $temp; +% } else { +<& /Elements/MessageBox, Name=>"UpdateContent", %ARGS &> +% } +</td></tr> +</table> + + + + +<& /Elements/Submit, Label => loc('Update Ticket'), Name => 'SubmitTicket' &> +% if ($TicketObj->CurrentUserHasRight('ShowOutgoingEmail')) { +<& /Ticket/Elements/PreviewScrips, TicketObj => $TicketObj, %ARGS &> +% } +</FORM> +<%INIT> +my $CanRespond = 0; +my $CanComment = 0; +my $title; + +my $TicketObj = LoadTicket($id); + +unless($DefaultStatus){ + $DefaultStatus=($ARGS{'Status'} ||$TicketObj->Status()); +} + +if ($DefaultStatus =~ '^new$'){ + $DefaultStatus='open'; +} + +if ($DefaultStatus eq 'resolved') { + $title = loc("Resolve ticket #[_1] ([_2])", $TicketObj->id, $TicketObj->Subject); +} else { + $title = loc("Update ticket #[_1] ([_2])", $TicketObj->id, $TicketObj->Subject); +} + +# Things needed in the template - we'll do the processing here, just +# for the convenience: + +my ($CommentDefault, $ResponseDefault); +if ($Action ne 'Respond') { + $CommentDefault = "SELECTED"; +} else { + $ResponseDefault = "SELECTED"; +} + + +$CanRespond = 1 if ( $TicketObj->CurrentUserHasRight('ReplyToTicket') or + $TicketObj->CurrentUserHasRight('ModifyTicket') ); + +$CanComment = 1 if ( $TicketObj->CurrentUserHasRight('CommentOnTicket') or + $TicketObj->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( + Filename => $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', TicketObj => $TicketObj, %ARGS); + return; +} + +</%INIT> + +<%ARGS> +$id => undef +$Action => undef +$DefaultStatus => undef +</%ARGS> |