From b4b0c7e72d7eaee2fbfc7022022c9698323203dd Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 31 Dec 2009 13:16:41 +0000 Subject: import rt 3.8.7 --- rt/share/html/Ticket/Elements/AddWatchers | 140 +++++++++ rt/share/html/Ticket/Elements/Bookmark | 93 ++++++ rt/share/html/Ticket/Elements/BulkLinks | 195 ++++++++++++ rt/share/html/Ticket/Elements/EditBasics | 130 ++++++++ rt/share/html/Ticket/Elements/EditCustomFields | 108 +++++++ rt/share/html/Ticket/Elements/EditDates | 77 +++++ rt/share/html/Ticket/Elements/EditPeople | 93 ++++++ .../Ticket/Elements/EditTransactionCustomFields | 81 +++++ rt/share/html/Ticket/Elements/EditWatchers | 79 +++++ rt/share/html/Ticket/Elements/FindAttachments | 95 ++++++ rt/share/html/Ticket/Elements/LoadTextAttachments | 93 ++++++ rt/share/html/Ticket/Elements/PreviewScrips | 235 ++++++++++++++ rt/share/html/Ticket/Elements/Reminders | 178 +++++++++++ rt/share/html/Ticket/Elements/ShowAttachments | 104 +++++++ rt/share/html/Ticket/Elements/ShowBasics | 87 ++++++ rt/share/html/Ticket/Elements/ShowCustomFields | 51 +++ rt/share/html/Ticket/Elements/ShowDates | 91 ++++++ rt/share/html/Ticket/Elements/ShowDependencies | 65 ++++ rt/share/html/Ticket/Elements/ShowGnuPGStatus | 177 +++++++++++ rt/share/html/Ticket/Elements/ShowGroupMembers | 65 ++++ rt/share/html/Ticket/Elements/ShowHistory | 171 +++++++++++ rt/share/html/Ticket/Elements/ShowMembers | 69 +++++ rt/share/html/Ticket/Elements/ShowMessageHeaders | 91 ++++++ rt/share/html/Ticket/Elements/ShowMessageStanza | 110 +++++++ rt/share/html/Ticket/Elements/ShowParents | 63 ++++ rt/share/html/Ticket/Elements/ShowPeople | 72 +++++ rt/share/html/Ticket/Elements/ShowPriority | 51 +++ rt/share/html/Ticket/Elements/ShowQueue | 56 ++++ rt/share/html/Ticket/Elements/ShowRequestor | 105 +++++++ rt/share/html/Ticket/Elements/ShowSummary | 117 +++++++ rt/share/html/Ticket/Elements/ShowTime | 59 ++++ rt/share/html/Ticket/Elements/ShowTransaction | 216 +++++++++++++ .../Ticket/Elements/ShowTransactionAttachments | 252 +++++++++++++++ rt/share/html/Ticket/Elements/ShowUpdateStatus | 64 ++++ rt/share/html/Ticket/Elements/ShowUserEntry | 56 ++++ rt/share/html/Ticket/Elements/Tabs | 341 +++++++++++++++++++++ rt/share/html/Ticket/Elements/UpdateCc | 80 +++++ 37 files changed, 4210 insertions(+) create mode 100755 rt/share/html/Ticket/Elements/AddWatchers create mode 100644 rt/share/html/Ticket/Elements/Bookmark create mode 100755 rt/share/html/Ticket/Elements/BulkLinks create mode 100755 rt/share/html/Ticket/Elements/EditBasics create mode 100755 rt/share/html/Ticket/Elements/EditCustomFields create mode 100755 rt/share/html/Ticket/Elements/EditDates create mode 100755 rt/share/html/Ticket/Elements/EditPeople create mode 100644 rt/share/html/Ticket/Elements/EditTransactionCustomFields create mode 100755 rt/share/html/Ticket/Elements/EditWatchers create mode 100644 rt/share/html/Ticket/Elements/FindAttachments create mode 100644 rt/share/html/Ticket/Elements/LoadTextAttachments create mode 100755 rt/share/html/Ticket/Elements/PreviewScrips create mode 100644 rt/share/html/Ticket/Elements/Reminders create mode 100755 rt/share/html/Ticket/Elements/ShowAttachments create mode 100755 rt/share/html/Ticket/Elements/ShowBasics create mode 100755 rt/share/html/Ticket/Elements/ShowCustomFields create mode 100755 rt/share/html/Ticket/Elements/ShowDates create mode 100755 rt/share/html/Ticket/Elements/ShowDependencies create mode 100644 rt/share/html/Ticket/Elements/ShowGnuPGStatus create mode 100644 rt/share/html/Ticket/Elements/ShowGroupMembers create mode 100755 rt/share/html/Ticket/Elements/ShowHistory create mode 100755 rt/share/html/Ticket/Elements/ShowMembers create mode 100755 rt/share/html/Ticket/Elements/ShowMessageHeaders create mode 100755 rt/share/html/Ticket/Elements/ShowMessageStanza create mode 100644 rt/share/html/Ticket/Elements/ShowParents create mode 100755 rt/share/html/Ticket/Elements/ShowPeople create mode 100644 rt/share/html/Ticket/Elements/ShowPriority create mode 100644 rt/share/html/Ticket/Elements/ShowQueue create mode 100755 rt/share/html/Ticket/Elements/ShowRequestor create mode 100755 rt/share/html/Ticket/Elements/ShowSummary create mode 100644 rt/share/html/Ticket/Elements/ShowTime create mode 100755 rt/share/html/Ticket/Elements/ShowTransaction create mode 100644 rt/share/html/Ticket/Elements/ShowTransactionAttachments create mode 100644 rt/share/html/Ticket/Elements/ShowUpdateStatus create mode 100644 rt/share/html/Ticket/Elements/ShowUserEntry create mode 100755 rt/share/html/Ticket/Elements/Tabs create mode 100644 rt/share/html/Ticket/Elements/UpdateCc (limited to 'rt/share/html/Ticket/Elements') diff --git a/rt/share/html/Ticket/Elements/AddWatchers b/rt/share/html/Ticket/Elements/AddWatchers new file mode 100755 index 000000000..d2b222dd5 --- /dev/null +++ b/rt/share/html/Ticket/Elements/AddWatchers @@ -0,0 +1,140 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +
+
+ +<&|/l&>Add new watchers:
+ + +% if ($Users and $Users->Count) { + +% while (my $u = $Users->Next ) { + +% } +% } + +% if ($Groups and $Groups->Count) { + +% while (my $g = $Groups->Next ) { + +% } +% } + + +% my $counter = 4; +% for my $email (@extras) { +% $counter++; + +% } + + + +
+<&|/l&>Type + +<&|/l&>Username +
<&/Elements/SelectWatcherType, Name => "Ticket-AddWatcher-Principal-". $u->PrincipalId &><& '/Elements/ShowUser', User => $u, style=>'verbose' &>
+<&|/l&>Type + +<&|/l&>Group +
<&/Elements/SelectWatcherType, Name => "Ticket-AddWatcher-Principal-".$g->PrincipalId, Scope => 'queue' &><%$g->Name%> (<%$g->Description%>)
+<&|/l&>Type + +<&|/l&>Email +
+<&/Elements/SelectWatcherType, Name => "WatcherTypeEmail".$counter &> + + +<%$email->format%> +
+<&/Elements/SelectWatcherType, Name => "WatcherTypeEmail1" &> + +<& /Elements/EmailInput, Name => 'WatcherAddressEmail1', Size => '20' &> +
+<&/Elements/SelectWatcherType, Name => "WatcherTypeEmail2" &> + +<& /Elements/EmailInput, Name => 'WatcherAddressEmail2', Size => '20' &> +
+<&/Elements/SelectWatcherType, Name => "WatcherTypeEmail3" &> + +<& /Elements/EmailInput, Name => 'WatcherAddressEmail3', Size => '20' &> +
+ +<%INIT> +my ($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); + } + +my @extras; +for my $addr ( values %{$Ticket->TransactionAddresses} ) { + push @extras, $addr unless ($Ticket->IsWatcher( Email => $addr->address)); +} + + + + +<%ARGS> +$UserField => 'Name' +$UserOp => '=' +$UserString => undef +$GroupField => 'Name' +$GroupOp => '=' +$GroupString => undef +$PrivilegedOnly => undef +$Ticket => undef + diff --git a/rt/share/html/Ticket/Elements/Bookmark b/rt/share/html/Ticket/Elements/Bookmark new file mode 100644 index 000000000..d857d380f --- /dev/null +++ b/rt/share/html/Ticket/Elements/Bookmark @@ -0,0 +1,93 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%INIT> +my $bookmarks = $session{'CurrentUser'}->UserObj->FirstAttribute('Bookmarks'); +$bookmarks = $bookmarks->Content if $bookmarks; +$bookmarks ||= {}; + +my $bookmarked = $bookmarks->{ $id }; # we still not sure if it's undef + +my @ids; +if ( $Toggle || !$bookmarked ) { + my $ticket = RT::Ticket->new( $session{'CurrentUser'} ); + $ticket->Load( $id ); + return unless $id = $ticket->id; + + @ids = ($id, $ticket->Merged); +} + +if ( $Toggle ) { + if ( grep $bookmarks->{ $_ }, @ids ) { + delete $bookmarks->{ $_ } foreach @ids; + $bookmarked = 0; + } else { + $bookmarks->{ $id } = 1; + $bookmarked = 1; + } + $session{'CurrentUser'}->UserObj->SetAttribute( + Name => 'Bookmarks', + Content => $bookmarks, + ); +} elsif ( !$bookmarked ) { + $bookmarked = grep $bookmarks->{ $_ }, @ids; +} + +<%ARGS> +$id +$Toggle => 0 + + +% my $url = RT->Config->Get('WebPath') ."/Helpers/Toggle/TicketBookmark?id=". $id; + +% if ( $bookmarked ) { +<% loc('Remove Bookmark') %> +% } else { +<% loc('Add Bookmark') %> +% } + + diff --git a/rt/share/html/Ticket/Elements/BulkLinks b/rt/share/html/Ticket/Elements/BulkLinks new file mode 100755 index 000000000..7f87cefb8 --- /dev/null +++ b/rt/share/html/Ticket/Elements/BulkLinks @@ -0,0 +1,195 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + + + + +
+

<&|/l&>Current Links

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
<&|/l&>Depends on: +% if ( $hash{DependsOn} ) { +% for my $link ( values %{$hash{DependsOn}} ) { + + <& /Elements/ShowLink, URI => $link->TargetURI &>
+% } } +
<&|/l&>Depended on by: +% if ( $hash{DependedOnBy} ) { +% for my $link ( values %{$hash{DependedOnBy}} ) { + + <& /Elements/ShowLink, URI => $link->BaseURI &>
+% } } +
<&|/l&>Parents: +% if ( $hash{MemberOf} ) { +% for my $link ( values %{$hash{MemberOf}} ) { + + <& /Elements/ShowLink, URI => $link->TargetURI &>
+% } } +
<&|/l&>Children: +% if ( $hash{Members} ) { +% for my $link ( values %{$hash{Members}} ) { + + <& /Elements/ShowLink, URI => $link->BaseURI &>
+% } } +
<&|/l&>Refers to: +% if ( $hash{RefersTo} ) { +% for my $link ( values %{$hash{RefersTo}} ) { + + <& /Elements/ShowLink, URI => $link->TargetURI &>
+% } } +
<&|/l&>Referred to by: +% if ( $hash{ReferredToBy} ) { +% for my $link ( values %{$hash{ReferredToBy}} ) { +% # Skip reminders +% next if (UNIVERSAL::isa($link->BaseObj, 'RT::Ticket') && $link->BaseObj->Type eq 'reminder'); + + <& /Elements/ShowLink, URI => $link->BaseURI &>
+% } } +
<&|/l&>(Check box to delete)
+
+

<&|/l&>New Links

+<&|/l&>Enter tickets or URIs to link tickets to. Separate multiple entries with spaces. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
<&|/l&>Merge into: <&|/l&>(only one ticket)
<&|/l&>Depends on:
<&|/l&>Depended on by:
<&|/l&>Parents:
<&|/l&>Children:
<&|/l&>Refers to:
<&|/l&>Referred to by:
+
+ +<%ARGS> +$Tickets => undef + + +<%INIT> +my %hash; +if ( $Tickets && $Tickets->Count ) { + my $first_ticket = $Tickets->Next; + # we only show current links that eixst on all the tickets + for my $type ( qw/DependsOn DependedOnBy Members MemberOf RefersTo + ReferredToBy/ ) { + my $target_or_base = + $type =~ /DependsOn|MemberOf|RefersTo/ ? 'Target' : 'Base'; + while ( my $link = $first_ticket->$type->Next ) { + $hash{$type}{$link->$target_or_base} = $link; + } + } + + while ( my $ticket = $Tickets->Next ) { + for my $type ( qw/DependsOn DependedOnBy Members MemberOf RefersTo + ReferredToBy/ ) { + my $target_or_base = + $type =~ /DependsOn|MemberOf|RefersTo/ ? 'Target' : 'Base'; + # if $hash{$type} is empty, no need to check any more + next unless $hash{$type} && keys %{$hash{$type}}; + my %exists; + while ( my $link = $ticket->$type->Next ) { + $exists{$link->$target_or_base}++; + } + + for ( keys %{$hash{$type}} ) { + delete $hash{$type}{$_} unless $exists{$_}; + } + } + } +} + diff --git a/rt/share/html/Ticket/Elements/EditBasics b/rt/share/html/Ticket/Elements/EditBasics new file mode 100755 index 000000000..0dc4c6e13 --- /dev/null +++ b/rt/share/html/Ticket/Elements/EditBasics @@ -0,0 +1,130 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +% $m->callback( CallbackName => 'EndOfList', TicketObj => $TicketObj, %ARGS ); +
<&|/l&>Subject:
<&|/l&>Status:<%$SelectStatus|n%>
<&|/l&>Queue:<%$SelectQueue|n%>
<&|/l&>Owner:<& /Elements/SelectOwner, + Name => 'Owner', + QueueObj => $TicketObj->QueueObj, + TicketObj => $TicketObj, + Default => $TicketObj->OwnerObj->Id, + DefaultValue => 0, + &>
<&|/l&>Time Estimated: + <& /Elements/EditTimeValue, + Name => 'TimeEstimated', + Default => $TicketObj->TimeEstimated, + &> +
<&|/l&>Time Worked: + <& /Elements/EditTimeValue, + Name => 'TimeWorked', + Default => $TicketObj->TimeWorked, + &> +
<&|/l&>Time Left: + <& /Elements/EditTimeValue, + Name => 'TimeLeft', + Default => $TicketObj->TimeLeft, + &> +
<&|/l&>Priority:<& /Elements/SelectPriority, + Default => $TicketObj->Priority, + &>
<&|/l&>Final Priority:<& /Elements/SelectPriority, + Name => "FinalPriority", + Default => $TicketObj->FinalPriority, + &>
+ +<%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, ShowNullOption => 0); + + +<%ARGS> + +$TicketObj => undef + diff --git a/rt/share/html/Ticket/Elements/EditCustomFields b/rt/share/html/Ticket/Elements/EditCustomFields new file mode 100755 index 000000000..c3a44ee22 --- /dev/null +++ b/rt/share/html/Ticket/Elements/EditCustomFields @@ -0,0 +1,108 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + +% my $i = 0; +% while ( my $CustomField = $CustomFields->Next ) { +% next unless $CustomField->CurrentUserHasRight('ModifyCustomField'); +% $i++; +% if ( $i % 2 ) { + +% } + + + +% unless ( $i % 2 ) { + +% } + +% } + +%# close row if required +% if ( $i % 2 ) { + +% } + +
+ <% loc($CustomField->Name) %>
+ <% $CustomField->FriendlyType %> +
+% my $default = $m->notes('Field-' . $CustomField->Id); +% $default ||= $ARGS{"CustomField-". $CustomField->Id }; + <& /Elements/EditCustomField, + %ARGS, + Object => $TicketObj, + CustomField => $CustomField, + NamePrefix => $NamePrefix, + Default => $default, + &> +% if (my $msg = $m->notes('InvalidField-' . $CustomField->Id)) { +
+ <% $msg %> +% } +
+<%INIT> +my $CustomFields; + +if ($TicketObj && !$OnCreate) { + $CustomFields = $TicketObj->CustomFields(); + $NamePrefix .= "Object-RT::Ticket-".$TicketObj->Id."-CustomField-"; +} else { + $CustomFields = $QueueObj->TicketCustomFields(); + $NamePrefix .= "Object-RT::Ticket--CustomField-"; +} + +$m->callback( %ARGS, CallbackName => 'MassageCustomFields', CustomFields => $CustomFields ); + + +<%ARGS> +$NamePrefix => '' +$TicketObj => undef +$QueueObj => undef +$OnCreate => undef +$DefaultsFromTopArguments => 1 + diff --git a/rt/share/html/Ticket/Elements/EditDates b/rt/share/html/Ticket/Elements/EditDates new file mode 100755 index 000000000..fc17cdbd4 --- /dev/null +++ b/rt/share/html/Ticket/Elements/EditDates @@ -0,0 +1,77 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + + + + + + + + + + + + + + + + + +
<&|/l&>Starts:<& /Elements/SelectDate, menu_prefix => 'Starts', current => 0 &> + (<% $TicketObj->StartsObj->AsString %>)
<&|/l&>Started:<& /Elements/SelectDate, menu_prefix => 'Started', current => 0 &> (<%$TicketObj->StartedObj->AsString %>)
+ <&|/l&>Last Contact: + + <& /Elements/SelectDate, menu_prefix => 'Told', current => 0 &> (<% $TicketObj->ToldObj->AsString %>) +
<&|/l&>Due: + <& /Elements/SelectDate, menu_prefix => 'Due', current => 0 &> (<% $TicketObj->DueObj->AsString %>) +
+<%ARGS> +$TicketObj => undef + + diff --git a/rt/share/html/Ticket/Elements/EditPeople b/rt/share/html/Ticket/Elements/EditPeople new file mode 100755 index 000000000..abf121a1e --- /dev/null +++ b/rt/share/html/Ticket/Elements/EditPeople @@ -0,0 +1,93 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + + + +
+ +

<&|/l&>New watchers

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

<&|/l&>Owner

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

<&|/l&>Current watchers

+ +<&|/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 &> + +<&|/l&>(Check box to delete)
+
+ +<%ARGS> +$UserField => undef +$UserOp => undef +$UserString => undef +$GroupField => undef +$GroupOp => undef +$GroupString => undef +$PrivilegedOnly => undef +$Ticket => undef + diff --git a/rt/share/html/Ticket/Elements/EditTransactionCustomFields b/rt/share/html/Ticket/Elements/EditTransactionCustomFields new file mode 100644 index 000000000..8bf939db6 --- /dev/null +++ b/rt/share/html/Ticket/Elements/EditTransactionCustomFields @@ -0,0 +1,81 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% if ($CustomFields->Count) { +% while (my $CF = $CustomFields->Next()) { +% next unless $CF->CurrentUserHasRight('ModifyCustomField'); + +<% loc($CF->Name) %>: + +<& /Elements/EditCustomField, + CustomField => $CF, + NamePrefix => $NamePrefix +&> +<% $CF->FriendlyType %> + + +% } +% } + +<%INIT> +my $CustomFields; + +if ($TicketObj) { + $CustomFields = $TicketObj->TransactionCustomFields(); +} else { + $CustomFields = $QueueObj->TicketTransactionCustomFields(); +} + +$m->callback( CallbackName => 'MassageTransactionCustomFields', CustomFields => $CustomFields ); + + +<%ARGS> +$NamePrefix => "Object-RT::Transaction--CustomField-" +$TicketObj => undef +$QueueObj => undef + + diff --git a/rt/share/html/Ticket/Elements/EditWatchers b/rt/share/html/Ticket/Elements/EditWatchers new file mode 100755 index 000000000..6f05c69a5 --- /dev/null +++ b/rt/share/html/Ticket/Elements/EditWatchers @@ -0,0 +1,79 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +
    +%# Print out a placeholder if there are none. +% unless ( $Members->Count ) { +
  • <&|/l&>none
  • +% } + + +% while ( my $watcher = $Members->Next ) { +% my $member = $watcher->MemberObj->Object; +
  • + +% if ( $member->isa( 'RT::User' ) ) { + +<& /Elements/ShowUser, User => $member &> +% if ($TicketObj and grep { $_->Content eq $member->EmailAddress } $TicketObj->SquelchMailTo) { +<&|/l&>(Will not be sent email) +% } + +% } else { + +<% $member->Name %> +% } +
  • +% } +
+<%INIT> +my $Members = $Watchers->MembersObj; + +<%ARGS> +$TicketObj => undef +$Watchers => undef + diff --git a/rt/share/html/Ticket/Elements/FindAttachments b/rt/share/html/Ticket/Elements/FindAttachments new file mode 100644 index 000000000..1ce75fda2 --- /dev/null +++ b/rt/share/html/Ticket/Elements/FindAttachments @@ -0,0 +1,95 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%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 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); + +<%ARGS> +$Ticket => undef +$Tickets => undef + + diff --git a/rt/share/html/Ticket/Elements/LoadTextAttachments b/rt/share/html/Ticket/Elements/LoadTextAttachments new file mode 100644 index 000000000..84732b967 --- /dev/null +++ b/rt/share/html/Ticket/Elements/LoadTextAttachments @@ -0,0 +1,93 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%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'); + $attachments->Limit ( FIELD => 'Filename', OPERATOR => 'IS', VALUE => 'NULL') + if RT->Config->Get('SuppressInlineTextFiles', $Ticket->CurrentUser ); +} +return ($attachments); + +<%ARGS> +$Ticket => undef + + diff --git a/rt/share/html/Ticket/Elements/PreviewScrips b/rt/share/html/Ticket/Elements/PreviewScrips new file mode 100755 index 000000000..7480adecf --- /dev/null +++ b/rt/share/html/Ticket/Elements/PreviewScrips @@ -0,0 +1,235 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%args> +$TicketObj => undef + + +<%init> +my %squelch = $m->comp('SELF:SquelchRecipients', %ARGS); +my $Object = $squelch{'Object'}; +my @non_recipients = @{ $squelch{'EmailAddresses'} }; + + +

<&|/l&>This message will be sent to...

+ +% if ( $Object and $Object->Scrips ) { +<&|/l&>(Check boxes to disable notifications to the listed recipients)
+ +% foreach my $scrip (@{$Object->Scrips->Prepared}) { +% next unless $scrip->ActionObj->Action->isa('RT::Action::SendEmail'); +<% $scrip->Description || loc('Scrip #[_1]',$scrip->id) %>
+<&|/l, loc($scrip->ConditionObj->Name), loc($scrip->ActionObj->Name), loc($scrip->TemplateObj->Name)&>[_1] [_2] with template [_3] +
+%foreach my $type qw(To Cc Bcc) { +%my @addresses = $scrip->ActionObj->Action->$type(); +
    +%foreach my $addr (@addresses) { +
  • <%loc($type)%>: <%$addr->address%> +% } +
+% } +% if (RT->Config->Get('PreviewScripMessages')) { + +% } +% } +% } +
+ +

<&|/l&>Messages about this ticket will not be sent to...

+<&|/l&>(Check boxes to enable notifications to the listed recipients) +
+
    +% foreach my $recipient (@non_recipients) { +
  • +<% $recipient->Content %> +% } +
+<& /Elements/Submit, Name => 'UpdatePreview', Value => 'UpdatePreview', Label => loc('Save Changes')&> + +<%METHOD SquelchRecipients> +<%ARGS> +$TicketObj => undef + +<%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'} && $ARGS{'UpdateType'} eq 'response' ) || ($ARGS{'Action'} && $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 +); +unless ( $Transaction ) { + $RT::Logger->error("Coulfn't fire '$action' action: $Description"); +} + + +return (Object => $Object, EmailAddresses => [$TicketObj->SquelchMailTo]); + + + +<%METHOD GetRecipients> +<%ARGS> +$TicketObj + +<%INIT> +my $action; +if ( ( $ARGS{'UpdateType'} && $ARGS{'UpdateType'} eq 'response' ) + || ( $ARGS{'Action'} && $ARGS{'Action'} eq 'Respond' ) ) +{ + $action = 'Correspond'; +} +else { + $action = 'Comment'; +} + +my $Message = MakeMIMEEntity( + Subject => $ARGS{'UpdateSubject'}, + Body => $ARGS{'UpdateContent'}, +); + +my ( $id, $msg, $txn ) = $TicketObj->$action( + CcMessageTo => $ARGS{'UpdateCc'}, + BccMessageTo => $ARGS{'UpdateBcc'}, + MIMEObj => $Message, + TimeTaken => $ARGS{'UpdateTimeWorked'}, + DryRun => 1 +); +unless ( $id && $txn ) { + $RT::Logger->error("Couldn't fire '$action' action: $msg"); + return (); +} + +my @recipients; +foreach my $scrip ( @{ $txn->Scrips->Prepared } ) { + my $action = $scrip->ActionObj->Action; + next unless $action->isa('RT::Action::SendEmail'); + + foreach my $type qw(To Cc Bcc) { + push @recipients, $action->$type(); + } +} +return @recipients; + + + +<%METHOD GetRecipientsOnCreate> +<%INIT> +my $action; +my $Message = MakeMIMEEntity( + Subject => $ARGS{'Subject'}, + Cc => $ARGS{'Cc'}, + Body => $ARGS{'Content'}, +); + +my $TicketObj = RT::Ticket->new( $session{'CurrentUser'} ); +my ( $id, $txn, $msg ) = $TicketObj->Create( + Type => $ARGS{'Type'} || 'ticket', + Queue => $ARGS{'Queue'}, + Owner => $ARGS{'Owner'}, + Requestor => $ARGS{'Requestors'}, + Cc => $ARGS{'Cc'}, + AdminCc => $ARGS{'AdminCc'}, + InitialPriority => $ARGS{'InitialPriority'}, + FinalPriority => $ARGS{'FinalPriority'}, + TimeLeft => $ARGS{'TimeLeft'}, + TimeEstimated => $ARGS{'TimeEstimated'}, + TimeWorked => $ARGS{'TimeWorked'}, + Subject => $ARGS{'Subject'}, + Status => $ARGS{'Status'}, + MIMEObj => $Message, + DryRun => 1 +); +unless ( $id && $txn ) { + $RT::Logger->error("Couldn't fire '$action' action: $msg"); + return (); +} + +my @recipients; +foreach my $scrip ( @{ $txn->Scrips->Prepared } ) { + my $action = $scrip->ActionObj->Action; + next unless $action->isa('RT::Action::SendEmail'); + + foreach my $type qw(To Cc Bcc) { + push @recipients, $action->$type(); + } +} +return @recipients; + + diff --git a/rt/share/html/Ticket/Elements/Reminders b/rt/share/html/Ticket/Elements/Reminders new file mode 100644 index 000000000..14d61efeb --- /dev/null +++ b/rt/share/html/Ticket/Elements/Reminders @@ -0,0 +1,178 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%args> +$Ticket => undef +$id => undef +$ShowCompleted => 0 +$Edit => 0 + +<%init> + +$Ticket = LoadTicket($id) if ($id); + +my $request_args = $m->request_args(); + +my $reminder_collection = $Ticket->Reminders->Collection; + +if ( $request_args->{'update-reminders'} ) { + while ( my $reminder = $reminder_collection->Next ) { + if ( $reminder->Status ne 'resolved' && $request_args->{ 'Complete-Reminder-' . $reminder->id } ) { + $Ticket->Reminders->Resolve($reminder); + } + elsif ( $reminder->Status eq 'resolved' && !$request_args->{ 'Complete-Reminder-' . $reminder->id } ) { + $Ticket->Reminders->Open($reminder); + } + + if ( exists( $request_args->{ 'Reminder-Subject-' . $reminder->id } ) && ( $reminder->Subject ne $request_args->{ 'Reminder-Subject-' . $reminder->id } )) { + $reminder->SetSubject( $request_args->{ 'Reminder-Subject-' . $reminder->id } ) ; + } + + if ( exists( $request_args->{ 'Reminder-Owner-' . $reminder->id } ) && ( $reminder->Owner != $request_args->{ 'Reminder-Owner-' . $reminder->id } )) { + $reminder->SetOwner( $request_args->{ 'Reminder-Owner-' . $reminder->id } , "Force" ) ; + } + + if ( exists( $request_args->{ 'Reminder-Due-' . $reminder->id } ) && ( $reminder->DueObj->Date ne $request_args->{ 'Reminder-Due-' . $reminder->id } )) { + $reminder->SetDue( $request_args->{ 'Reminder-Due-' . $reminder->id } ) ; + } + } +} + +if ( $request_args->{'NewReminder-Subject'} ) { + my $due_obj = RT::Date->new( $session{'CurrentUser'} ); + my $date = Time::ParseDate::parsedate( + $request_args->{'NewReminder-Due'}, + UK => RT->Config->Get('DateDayBeforeMonth'), + PREFER_PAST => 0, + PREFER_FUTURE => 1 + ); + $due_obj->Set( Value => $date, Format => 'unix' ); + my ( $add_id, $msg, $txnid ) = $Ticket->Reminders->Add( + + Subject => $request_args->{'NewReminder-Subject'}, + Owner => $request_args->{'NewReminder-Owner'}, + Due => $due_obj->ISO + ); +} + +# We've made changes, let's reload our search + +$reminder_collection = $Ticket->Reminders->Collection; + + + +
+% while (my $reminder = $reminder_collection->Next) { +% if ($reminder->Status eq 'resolved' && !$ShowCompleted) { + +% } elsif ($Edit) { +<& SELF:EditEntry, Reminder => $reminder, Ticket => $Ticket &> +% } else { +<& SELF:ShowEntry, Reminder => $reminder, Ticket => $Ticket &> +% } +% } +% if ($reminder_collection->Count) { +<&|/l&>(Check box to delete)

+% } +
+
+<&|/l&>New reminder: +<& SELF:NewReminder, Ticket => $Ticket &> +<%method NewReminder> +<%args> +$Ticket + + + + + + + + + + + + + +
+ +
+ +<& /Elements/SelectOwner, Name => 'NewReminder-Owner', QueueObj => $Ticket->QueueObj, Default=>$session{'CurrentUser'}->id, DefaultValue => 0 &> +
+<& /Elements/SelectDate, Name => "NewReminder-Due", Default => "" &> +
+ +<%method EditEntry> +<%args> +$Reminder +$Ticket + +Status eq 'resolved' ? 'checked="checked"' : '' %> +/> + • + <& /Elements/SelectOwner, Name => 'Reminder-Owner-'.$Reminder->id, Queue => $Ticket->QueueObj, Default => $Reminder->Owner, DefaultValue => 0 &> + <& /Elements/SelectDate, Name => 'Reminder-Due-'.$Reminder->id, Default => $Reminder->DueObj->Date &> + (<%$Reminder->DueObj->Unix>0 ? $Reminder->DueObj->AgeAsString : '' %>)
+ +<%method ShowEntry> +<%args> +$Reminder +$Ticket + +Status eq 'resolved' ? 'checked="checked"' : '' %> +/> + <%$Reminder->Subject%> • + <%$Reminder->OwnerObj->Name%> + <%$Reminder->DueObj->Unix>0 ? "• ". $Reminder->DueObj->AgeAsString : '' |n%>
+ diff --git a/rt/share/html/Ticket/Elements/ShowAttachments b/rt/share/html/Ticket/Elements/ShowAttachments new file mode 100755 index 000000000..72298d79f --- /dev/null +++ b/rt/share/html/Ticket/Elements/ShowAttachments @@ -0,0 +1,104 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% if (keys %documents) { +<&| /Widgets/TitleBox, title => loc('Attachments'), + title_class=> 'inverse', + class => 'ticket-info-attachments', + color => "#336699" &> + +% foreach my $key (keys %documents) { + +<%$key%>
+ + +% } + + +% } + +<%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 ); +} + + +<%ARGS> +$Ticket => undef +$Attachments => undef + + diff --git a/rt/share/html/Ticket/Elements/ShowBasics b/rt/share/html/Ticket/Elements/ShowBasics new file mode 100755 index 000000000..5dcbcedb8 --- /dev/null +++ b/rt/share/html/Ticket/Elements/ShowBasics @@ -0,0 +1,87 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + + + + + + + + +% if ($Ticket->TimeEstimated) { + + + + +% } +% if ($Ticket->TimeWorked) { + + + + +% } +% if ($Ticket->TimeLeft) { + + + + +% } + + + + + + + + +% $m->callback( %ARGS, CallbackName => 'EndOfList', TicketObj => $Ticket ); +
<&|/l&>Id:<%$Ticket->Id %>
<&|/l&>Status:<% loc($Ticket->Status) %>
<&|/l&>Estimated:<& ShowTime, minutes => $Ticket->TimeEstimated &>
<&|/l&>Worked:<& ShowTime, minutes => $Ticket->TimeWorked &>
<&|/l&>Left:<& ShowTime, minutes => $Ticket->TimeLeft &>
<&|/l&>Priority:<& ShowPriority, Ticket => $Ticket &>
<&|/l&>Queue:<& ShowQueue, QueueObj => $Ticket->QueueObj &>
+<%ARGS> +$Ticket => undef + diff --git a/rt/share/html/Ticket/Elements/ShowCustomFields b/rt/share/html/Ticket/Elements/ShowCustomFields new file mode 100755 index 000000000..a8366859a --- /dev/null +++ b/rt/share/html/Ticket/Elements/ShowCustomFields @@ -0,0 +1,51 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Elements/ShowCustomFields, Object => $Ticket &> +<%ARGS> +$Ticket => undef + diff --git a/rt/share/html/Ticket/Elements/ShowDates b/rt/share/html/Ticket/Elements/ShowDates new file mode 100755 index 000000000..d309907dc --- /dev/null +++ b/rt/share/html/Ticket/Elements/ShowDates @@ -0,0 +1,91 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + + + + + + + + + + + + + + + + + + +% my $due = $Ticket->DueObj; +% if ( $due && $due->Unix > 0 && $due->Diff < 0 ) { + +% } else { + +% } + + + + + + + +% my $UpdatedString = $Ticket->LastUpdated ? loc("[_1] by [_2]", $Ticket->LastUpdatedAsString, $Ticket->LastUpdatedByObj->Name) : loc("Never"); +% if ($UpdatedLink) { + +% } else { + +% } + +
<&|/l&>Created:<% $Ticket->CreatedObj->AsString %>
<&|/l&>Starts:<% $Ticket->StartsObj->AsString %>
<&|/l&>Started:<% $Ticket->StartedObj->AsString %>
<&|/l&>Last Contact:<% $Ticket->ToldObj->AsString %>
<&|/l&>Due:<% $due->AsString %><% $due->AsString %>
<&|/l&>Closed:<% $Ticket->ResolvedObj->AsString %>
<&|/l&>Updated:<% $UpdatedString | h %><% $UpdatedString | h %>
+<%ARGS> +$Ticket => undef +$UpdatedLink => 1 + diff --git a/rt/share/html/Ticket/Elements/ShowDependencies b/rt/share/html/Ticket/Elements/ShowDependencies new file mode 100755 index 000000000..528be93c5 --- /dev/null +++ b/rt/share/html/Ticket/Elements/ShowDependencies @@ -0,0 +1,65 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<&|/l&>Depends on:
+% while (my $Link = $Ticket->DependsOn->Next) { +% my $member = $Link->TargetObj; +<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> +[<%$member->Status%>] +
+% } +<&|/l&>Depended on by:
+% while (my $Link = $Ticket->DependedOnBy->Next) { +% my $member = $Link->TargetObj; +<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> +[<%$member->Status%>] +
+% } + +<%ARGS> +$Ticket => undef + diff --git a/rt/share/html/Ticket/Elements/ShowGnuPGStatus b/rt/share/html/Ticket/Elements/ShowGnuPGStatus new file mode 100644 index 000000000..08814aafc --- /dev/null +++ b/rt/share/html/Ticket/Elements/ShowGnuPGStatus @@ -0,0 +1,177 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + + + +% foreach my $msg( @messages ) { + +% } +
GnuPG:<% shift @messages %>
<% $msg %>
+<%ARGS> +$Attachment +$WarnUnsigned => undef +$Reverify => 1 + +<%INIT> +my @runs; +my $needs_unsigned_warning = $WarnUnsigned; + +foreach ( $Attachment->SplitHeaders ) { + if ( s/^X-RT-GnuPG-Status:\s*//i ) { + require RT::Crypt::GnuPG; + push @runs, [ RT::Crypt::GnuPG::ParseStatus( $_ ) ]; + } + + $needs_unsigned_warning = 0 if /^X-RT-Incoming-Signature:/; + + # if this is not set, then the email is generated by RT, and so we don't + # need "email is unsigned" warnings + $needs_unsigned_warning = 0 if not /^Received:/; +} + +return unless @runs or $needs_unsigned_warning; + +my $reverify_cb = sub { + my $top = shift; + + my $txn = $top->TransactionObj; + unless ( $txn && $txn->id ) { + return (0, "Couldn't get transaction of attachment #". $top->id); + } + + my $attachments = $txn->Attachments->Clone; + $attachments->Limit( FIELD => 'ContentType', VALUE => 'application/x-rt-original-message' ); + my $original = $attachments->First; + unless ( $original ) { + return (0, "Couldn't find attachment with original email of transaction #". $txn->id); + } + + my $parser = RT::EmailParser->new(); + $parser->SmartParseMIMEEntityFromScalar( + Message => $original->Content, + Decode => 0, + Exact => 1, + ); + my $entity = $parser->Entity; + unless ( $entity ) { + return (0, "Couldn't parse content of attachment #". $original->id); + } + + use RT::Interface::Email::Auth::GnuPG; + my ($status, @res) = RT::Interface::Email::Auth::GnuPG::VerifyDecrypt( Entity => $entity ); + if ( $status && !@res ) { + # imposible in this situation + return (0, "Content of attachment #". $original->id ." is not signed and/or encrypted"); + } + elsif ( @res ) { + require RT::Crypt::GnuPG; + + $top->DelHeader('X-RT-GnuPG-Status'); + $top->AddHeader(map { ('X-RT-GnuPG-Status' => $_->{'status'} ) } @res); + $top->SetHeader('X-RT-Privacy' => 'PGP' ); + $top->DelHeader('X-RT-Incoming-Signature'); + + my @status = RT::Crypt::GnuPG::ParseStatus( $res[0]->{'status'} ); + for ( @status ) { + if ( $_->{'Operation'} eq 'Verify' && $_->{'Status'} eq 'DONE' ) { + $top->AddHeader( 'X-RT-Incoming-Signature' => $_->{'UserString'} ); + $needs_unsigned_warning = 0; + } + } + } + return (1, "Reverified original message"); +}; + +my @messages; +foreach my $run ( @runs ) { + foreach my $line ( @$run ) { + if ( $line->{'Operation'} eq 'KeyCheck' ) { + next unless $Reverify; + # if a public key was missing during verification then we want try again + next unless $line->{'KeyType'} eq 'public' && $line->{'Status'} eq 'MISSING'; + + # but only if we have key + my %key = RT::Crypt::GnuPG::GetPublicKeyInfo( $line->{'Key'} ); + if ( $key{'info'} ) { + my ($status, $msg) = $reverify_cb->($Attachment); + unless ($status) { + $RT::Logger->error($msg); + } else { + return $m->comp('SELF', %ARGS, Reverify => 0); + } + } + else { + push @messages, loc( "Public key '0x[_1]' is required to verify signature", $line->{'Key'} ); + } + } + elsif ( $line->{'Operation'} eq 'PassphraseCheck' ) { + next if $line->{'Status'} eq 'DONE'; + push @messages, loc( $line->{'Message'} ); + } + elsif ( $line->{'Operation'} eq 'Decrypt' ) { + push @messages, loc( $line->{'Message'} ); + } + elsif ( $line->{'Operation'} eq 'Verify' ) { + push @messages, loc( $line->{'Message'} ); + } + else { + next if $line->{'Status'} eq 'DONE'; + push @messages, loc( $line->{'Message'} ); + } + } +} + +push @messages, loc('Warning! This is NOT signed!') + if $needs_unsigned_warning; +return unless @messages; + +my %seen; +@messages = grep !$seen{$_}++, @messages; + + diff --git a/rt/share/html/Ticket/Elements/ShowGroupMembers b/rt/share/html/Ticket/Elements/ShowGroupMembers new file mode 100644 index 000000000..a15f850b4 --- /dev/null +++ b/rt/share/html/Ticket/Elements/ShowGroupMembers @@ -0,0 +1,65 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +%# Released under the terms of version 2 of the GNU Public License + +% my $Users = $Group->UserMembersObj( Recursively => $Recursively ); +% while ( my $user = $Users->Next ) { +<& /Elements/ShowUser, User => $user, Ticket => $Ticket &> +<& /Elements/ShowUserEmailFrequency, User => $user, Ticket => $Ticket &>
+% } +% my $Groups = $Group->GroupMembersObj( Recursively => $Recursively ); +% $Groups->LimitToUserDefinedGroups; +% while (my $group = $Groups->Next) { +<&|/l&>Group: <% $group->Name %>
+% } + +<%ARGS> +$Group => undef +$Recursively => 0, +$Ticket => undef + diff --git a/rt/share/html/Ticket/Elements/ShowHistory b/rt/share/html/Ticket/Elements/ShowHistory new file mode 100755 index 000000000..d85948361 --- /dev/null +++ b/rt/share/html/Ticket/Elements/ShowHistory @@ -0,0 +1,171 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%doc> +# This is (ab)used in Admin/(Users|Groups)/History.html and should probably +# be generalized at some point. + +<%perl> +if ($ShowDisplayModes or $ShowTitle) { + my $title = $ShowTitle + ? loc('History') + : ' '; + + my $titleright; + + if ($ShowDisplayModes) { + $titleright = ''; + + if ($ShowHeaders) { + $titleright .= qq{} . + loc("Brief headers") . + qq{ — }; + $titleright .= q[] . loc("Full headers") . ""; + } + else { + $titleright .= q[] . loc("Brief headers") . " — "; + $titleright .= qq{} . + loc("Full headers") . + qq{}; + } + } + +
+<& /Widgets/TitleBoxStart, title => $title, titleright_raw => $titleright &> +% } + +
+<%perl> +my @attachments = @{$Attachments->ItemsArrayRef()}; +my @attachment_content = @{$AttachmentContent->ItemsArrayRef()}; + +while ( my $Transaction = $Transactions->Next ) { + my $skip = 0; + $m->callback( + %ARGS, + Transaction => $Transaction, + skip => \$skip, + CallbackName => 'SkipTransaction', + ); + next if $skip; + + $i++; + + my @trans_attachments = grep { $_->TransactionId == $Transaction->Id } @attachments; + + my $trans_content = {}; + grep { ($_->TransactionId == $Transaction->Id ) && ($trans_content->{$_->Id} = $_) } @attachment_content; + + + my $IsLastTransaction = 0; + if ( $OldestFirst ) { + $IsLastTransaction = $Transactions->IsLast; + } else { + $IsLastTransaction = 1 if ( $i == 1 ); + } + + #Args is first because we're clobbering the "Attachments" parameter + $m->comp( 'ShowTransaction', + %ARGS, + + Ticket => $Ticket, + Transaction => $Transaction, + ShowHeaders => $ShowHeaders, + RowNum => $i, + Attachments => \@trans_attachments, + AttachmentContent => $trans_content, + LastTransaction => $IsLastTransaction + ); + +# manually flush the content buffer after each txn, so the user sees +# some update +$m->flush_buffer(); +} + + +
+% if ($ShowDisplayModes or $ShowTitle) { +<& /Widgets/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 $OldestFirst = RT->Config->Get( 'OldestTransactionsFirst', $session{'CurrentUser'} ); +my $SortOrder = $OldestFirst? 'ASC': 'DESC'; +$Transactions->OrderByCols( { FIELD => 'Created', + ORDER => $SortOrder }, + { FIELD => 'id', + ORDER => $SortOrder }, + ); + +my $i; +$Attachments ||= $m->comp('/Ticket/Elements/FindAttachments', Ticket => $Ticket, Tickets => $Tickets || undef); +$AttachmentContent ||= $m->comp('/Ticket/Elements/LoadTextAttachments', Ticket => $Ticket); + + +<%ARGS> +$URIFile => RT->Config->Get('WebPath')."/Ticket/Display.html" +$Ticket => undef +$Tickets => undef +$Attachments => undef +$AttachmentContent => undef +$ShowHeaders => undef +$ShowTitle => 1 +$ShowDisplayModes => 1 +$WarnUnsigned => undef + diff --git a/rt/share/html/Ticket/Elements/ShowMembers b/rt/share/html/Ticket/Elements/ShowMembers new file mode 100755 index 000000000..dc570b52d --- /dev/null +++ b/rt/share/html/Ticket/Elements/ShowMembers @@ -0,0 +1,69 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +
    +% while (my $link = $members->Next) { +
  • <& /Elements/ShowLink, URI => $link->BaseURI &>
    +% if ($depth < 8) { +<& /Ticket/Elements/ShowMembers, Ticket => $link->BaseObj, depth => ($depth+1) &> +% } +
  • +% } +
+ +<%INIT> + +return unless $Ticket; +my $members = $Ticket->Members; +return unless $members->Count; + + + +<%ARGS> +$Ticket => undef +$depth => 1 + diff --git a/rt/share/html/Ticket/Elements/ShowMessageHeaders b/rt/share/html/Ticket/Elements/ShowMessageHeaders new file mode 100755 index 000000000..e77e8e20f --- /dev/null +++ b/rt/share/html/Ticket/Elements/ShowMessageHeaders @@ -0,0 +1,91 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% if ( @headers ) { + +% foreach my $header (@headers) { + + + + +% } +
<% $header->{'Tag'} %>:<% $header->{'Value'} | n %>
+% } +<%INIT> +my @headers; +foreach my $field( RT->Config->Get('ShowBccHeader')? $Message->_SplitHeaders : $Message->SplitHeaders ) { + my ($tag, $value) = split /:/, $field, 2; + next unless $tag && $value; + push @headers, { Tag => $tag, Value => $value }; +} + +my %display_headers = map { lc($_) => 1 } @DisplayHeaders; + +$m->callback( + message => $Message, + headers => \@headers, + display_headers => \%display_headers, +); + +unless ( $display_headers{'_all'} ) { + @headers = grep $display_headers{ lc $_->{'Tag'} }, @headers; +} + +my $ticket = $Message->TransactionObj->TicketObj; +foreach my $f (@headers) { + $m->comp('/Elements/MakeClicky', content => \$f->{'Value'}, ticket => $ticket, %ARGS); +} + +if ( $Localize ) { + $_->{'Tag'} = loc($_->{'Tag'}) foreach @headers; +} + +<%ARGS> +$Message => undef +$Localize => 1 +@DisplayHeaders => ('_all') + diff --git a/rt/share/html/Ticket/Elements/ShowMessageStanza b/rt/share/html/Ticket/Elements/ShowMessageStanza new file mode 100755 index 000000000..0d4fe6154 --- /dev/null +++ b/rt/share/html/Ticket/Elements/ShowMessageStanza @@ -0,0 +1,110 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%perl> +if ( ref $Message ) { + $m->out('
') if $plain_text_pre && !$Depth && !$plain_text_mono;
+    $m->out( qq{
} ); + + my @stack; + my $para = ''; + my $i = 0; + + AGAIN: foreach ( ; $i < @$Message; $i++ ) { + my $stanza = $Message->[$i]; + if ( ref $stanza eq "HASH" ) { + $para .= ( defined $stanza->{raw} ? $stanza->{raw} : '') ."\n"; + } + next unless ref $stanza eq "ARRAY"; + + $print_content->( \$para ); $para = ''; + + $Depth++; + push @stack, [$Message, $i+1]; + ($Message, $i) = ($stanza, -1); + $m->out( qq{
} ); + } + if ( length $para ) { + $print_content->( \$para ); $para = ''; + } + + if ( @stack ) { + ($Message, $i) = @{ pop @stack }; + $Depth--; + $m->out('
'); + goto AGAIN; + } + + $m->out('
'); + $m->out('
') if $plain_text_pre && !$Depth && !$plain_text_mono; +} else { + $print_content->( \$Message ); +} + +<%INIT> +my $plain_text_pre = RT->Config->Get('PlainTextPre', $session{'CurrentUser'}); +my $plain_text_mono = RT->Config->Get('PlainTextMono', $session{'CurrentUser'}); + +my $ticket = $Transaction ? $Transaction->TicketObj : undef; + +my $print_content = sub { + my $ref = shift; + return unless defined $$ref && length $$ref; + + $m->callback( content => $ref, %ARGS ); + $m->comp('/Elements/MakeClicky', content => $ref, ticket => $ticket, %ARGS); + unless ( $plain_text_pre || $plain_text_mono ) { + $$ref =~ s{(\r?\n)}{
}g if defined $$ref; + } + $m->out( $$ref ); +}; + +<%ARGS> +$Message => undef +$Depth => 0 +$Transaction => undef + diff --git a/rt/share/html/Ticket/Elements/ShowParents b/rt/share/html/Ticket/Elements/ShowParents new file mode 100644 index 000000000..38c427f49 --- /dev/null +++ b/rt/share/html/Ticket/Elements/ShowParents @@ -0,0 +1,63 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +
    +% while (my $link = $member_of->Next) { +
  • <& /Elements/ShowLink, URI => $link->TargetURI &>
    +% } +
+<%INIT> + +return unless $Ticket; +my $member_of = $Ticket->MemberOf; +return unless $member_of->Count; + + + +<%ARGS> +$Ticket => undef + diff --git a/rt/share/html/Ticket/Elements/ShowPeople b/rt/share/html/Ticket/Elements/ShowPeople new file mode 100755 index 000000000..ddd2e3c6f --- /dev/null +++ b/rt/share/html/Ticket/Elements/ShowPeople @@ -0,0 +1,72 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + + +% my $owner = $Ticket->OwnerObj; + + + + + + + + + + + + + + +
<&|/l&>Owner:<& /Elements/ShowUser, User => $owner, Ticket => $Ticket &> + <& /Elements/ShowUserEmailFrequency, User => $owner, Ticket => $Ticket &>
<&|/l&>Requestors:<& ShowGroupMembers, Group => $Ticket->Requestors, Ticket => $Ticket &>
<&|/l&>Cc:<& ShowGroupMembers, Group => $Ticket->Cc, Ticket => $Ticket &>
<&|/l&>AdminCc:<& ShowGroupMembers, Group => $Ticket->AdminCc, Ticket => $Ticket &>
+<%INIT> + +<%ARGS> +$Ticket => undef + diff --git a/rt/share/html/Ticket/Elements/ShowPriority b/rt/share/html/Ticket/Elements/ShowPriority new file mode 100644 index 000000000..705bbaefe --- /dev/null +++ b/rt/share/html/Ticket/Elements/ShowPriority @@ -0,0 +1,51 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<% $Ticket->Priority %>/<% $Ticket->FinalPriority || ''%> +<%ARGS> +$Ticket => undef + diff --git a/rt/share/html/Ticket/Elements/ShowQueue b/rt/share/html/Ticket/Elements/ShowQueue new file mode 100644 index 000000000..270a82536 --- /dev/null +++ b/rt/share/html/Ticket/Elements/ShowQueue @@ -0,0 +1,56 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<% $QueueObj->Name %> +<%ARGS> +$QueueObj + +<%INIT> +my $value = $QueueObj->Name; +$value = '#'. $QueueObj->id + unless defined $value && length $value; + diff --git a/rt/share/html/Ticket/Elements/ShowRequestor b/rt/share/html/Ticket/Elements/ShowRequestor new file mode 100755 index 000000000..5a7ffc224 --- /dev/null +++ b/rt/share/html/Ticket/Elements/ShowRequestor @@ -0,0 +1,105 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%PERL> +# Unsure sane default +unless ( @$conditions ) { + foreach (RT::Queue->ActiveStatusArray()) { + push @$conditions, { cond => "Status = '$_'", name => loc($_) }; + } +} +my $rows = 10; +my $has_right_adminusers = $session{'CurrentUser'}->HasRight( + Object => $RT::System, Right => 'AdminUsers' +); +$has_right_adminusers &&= $session{'CurrentUser'}->HasRight( + Object => $RT::System, Right => 'ShowConfigTab' +); +my $people = $Ticket->Requestors->UserMembersObj; +while ( my $requestor = $people->Next ) { + next if $requestor->Privileged; + my $name = $m->scomp('/Elements/ShowUser', User => $requestor); + + my $tickets = RT::Tickets->new( $session{'CurrentUser'} ); + $tickets->FromSQL( "Requestor.id = ". $requestor->id ." AND (".join( " OR ", map $_->{cond}, @$conditions).")" ); + $tickets->RowsPerPage( $rows ); + $tickets->OrderBy( FIELD => 'Priority', ORDER => 'DESC' ); + + +<&| /Widgets/TitleBox, + title_href => $has_right_adminusers? RT->Config->Get('WebPath')."/Admin/Users/Modify.html?id=".$requestor->id: undef, + title_raw => loc("More about [_1]", $name), + class => 'ticket-info-requestor' +&> + +%# Additional information about this user. Empty by default. +% $m->callback( requestor => $requestor, %ARGS, CallbackName => 'AboutThisUser' ); + +<&|/l&>Comments about this user:
+<% ($requestor->Comments || loc("No comment entered about this user")) %>
+ +<&|/l, $rows &>This user's [_1] highest priority tickets: +
    +%while (my $w=$tickets->Next) { +%my $uri = RT::URI->new( $session{'CurrentUser'} ); +%$uri->FromObject($w); +
  • <& /Elements/ShowLink, URI => $uri &>
  • +%} +
+ +<&|/l&>Groups this user belongs to:
+ +<& /Elements/ShowMemberships, UserObj => $requestor &> + + + +% } +<%ARGS> +$Ticket=>undef +$DisplayPath => "/Ticket/Display.html" +$conditions => [] + diff --git a/rt/share/html/Ticket/Elements/ShowSummary b/rt/share/html/Ticket/Elements/ShowSummary new file mode 100755 index 000000000..4c2d54e5e --- /dev/null +++ b/rt/share/html/Ticket/Elements/ShowSummary @@ -0,0 +1,117 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + + + + +
+ <&| /Widgets/TitleBox, title => loc('The Basics'), + title_href => RT->Config->Get('WebPath')."/Ticket/Modify.html?id=".$Ticket->Id, + class => 'ticket-info-basics' &> + <& /Ticket/Elements/ShowBasics, Ticket => $Ticket &> + + +% if ($Ticket->CustomFields->First) { + <&| /Widgets/TitleBox, title => loc('Custom Fields'), + title_href => RT->Config->Get('WebPath')."/Ticket/Modify.html?id=".$Ticket->Id, + class => 'ticket-info-cfs' &> + <& /Ticket/Elements/ShowCustomFields, Ticket => $Ticket &> + +% } + <&| /Widgets/TitleBox, title => loc('People'), + title_href => RT->Config->Get('WebPath')."/Ticket/ModifyPeople.html?id=".$Ticket->Id, + class => 'ticket-info-people' &> + <& /Ticket/Elements/ShowPeople, Ticket => $Ticket &> + + + <& /Ticket/Elements/ShowAttachments, Ticket => $Ticket, Attachments => $Attachments &> + + <& /Ticket/Elements/ShowRequestor, Ticket => $Ticket &> + +% $m->callback( %ARGS, CallbackName => 'LeftColumn' ); + +% if ( RT->Config->Get('EnableReminders') ) { + <&|/Widgets/TitleBox, title => loc("Reminders"), + title_href => RT->Config->Get('WebPath')."/Ticket/Reminders.html?id=".$Ticket->Id, + class => 'ticket-info-reminders' &> + + + + +
+
+ <& /Ticket/Elements/Reminders, Ticket => $Ticket, ShowCompleted => 0 &> +
+
+
+ +% } + <&| /Widgets/TitleBox, title => loc("Dates"), + title_href => RT->Config->Get('WebPath')."/Ticket/ModifyDates.html?id=".$Ticket->Id, + class => 'ticket-info-dates' &> + <& /Ticket/Elements/ShowDates, Ticket => $Ticket &> + +% my (@extra); +% push @extra, titleright_raw => ''.loc('Graph').'' unless RT->Config->Get('DisableGraphViz'); + <&| /Widgets/TitleBox, title => loc('Links'), + title_href => RT->Config->Get('WebPath')."/Ticket/ModifyLinks.html?id=".$Ticket->Id, + class => 'ticket-info-links', @extra &> + <& /Elements/ShowLinks, Ticket => $Ticket &> + +% $m->callback( %ARGS, CallbackName => 'RightColumn' ); + +
+<%ARGS> +$Ticket => undef +$Attachments => undef + + + + + diff --git a/rt/share/html/Ticket/Elements/ShowTime b/rt/share/html/Ticket/Elements/ShowTime new file mode 100644 index 000000000..b4050fbae --- /dev/null +++ b/rt/share/html/Ticket/Elements/ShowTime @@ -0,0 +1,59 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% if ($minutes < 60) { +<&|/l, $minutes &>[_1] min +% } else { +<&|/l, sprintf("%.1f",$minutes / 60) &>[quant,_1,hour] (<&|/l, $minutes &>[_1] min) +% } +<%init> +$minutes ||= 0; + +<%ARGS> +$minutes + + diff --git a/rt/share/html/Ticket/Elements/ShowTransaction b/rt/share/html/Ticket/Elements/ShowTransaction new file mode 100755 index 000000000..a533323a9 --- /dev/null +++ b/rt/share/html/Ticket/Elements/ShowTransaction @@ -0,0 +1,216 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +
+% $m->callback( titlebar_cmd => \$titlebar_commands, Transaction => $Transaction, %ARGS, CallbackName => 'ModifyDisplay' ); + +
+% $m->callback( titlebar_cmd => \$titlebar_commands, Transaction => $Transaction, %ARGS, CallbackName => 'ModifyCommand' ); + + +
+% if ( $Transaction->CustomFieldValues->Count ) { + <& /Elements/ShowCustomFields, Object => $Transaction &> +% } +% $m->comp('ShowTransactionAttachments', %ARGS, Parent => 0) unless ($Collapsed ||!$ShowBody); +
+ +
+
+ +<%ARGS> +$Ticket => undef +$Transaction => undef +$ShowHeaders => 0 +$Collapsed => undef +$ShowTitleBarCommands => 1 +$RowNum => 1 +$DisplayPath => RT->Config->Get('WebPath')."/Ticket/Display.html?id=".$Ticket->id +$AttachPath => RT->Config->Get('WebPath')."/Ticket/Attachment" +$UpdatePath => RT->Config->Get('WebPath')."/Ticket/Update.html" +$ForwardPath => RT->Config->Get('WebPath')."/Ticket/Forward.html" +$EncryptionPath => RT->Config->Get('WebPath')."/Ticket/GnuPG.html" +$EmailRecordPath => RT->Config->Get('WebPath')."/Ticket/ShowEmailRecord.html" +$Attachments => undef +$AttachmentContent => undef +$ShowBody => 1 +$LastTransaction => 0 +$WarnUnsigned => undef + +<%ONCE> + +my %class = ( + Create => 'message', + Correspond => 'message', + Comment => 'message', + + AddWatcher => 'people', + DelWatcher => 'people', + Take => 'people', + Untake => 'people', + Force => 'people', + Steal => 'people', + Give => 'people', + + AddLink => 'links', + DeleteLink => 'links', +); + + +<%INIT> + +my $transdate = $Transaction->CreatedAsString(); +$transdate =~ s/\s/ /g; + +my ($type, $field) = ($Transaction->Type, $Transaction->Field || ''); +my $type_class = $class{ $type }; + +unless ( $type_class ) { + if ( $field eq 'Owner' ) { + $type_class = 'people'; + } + elsif ( $type =~ /^(Status|Set|Told)$/ ) { + if ( $field =~ /^(Told|Starts|Started|Due)$/ ) { + $type_class = 'dates'; + } + else { + $type_class = 'basics'; + } + } + else { + $type_class = 'other'; + } +} + +my $TicketString = ''; +if ( $Ticket->Id != $Transaction->Ticket ) { + $TicketString = loc("Ticket #[_1]:", $Transaction->Ticket) .' '; +} + +my $TimeTaken = ''; +$TimeTaken = $Transaction->TimeTaken . " min" + if $Transaction->TimeTaken; + +unless ($Attachments) { + my $attachments = $Transaction->Attachments; + $attachments->Columns( qw( Id Filename ContentType Headers Subject Parent ContentEncoding ContentType TransactionId) ); + $ARGS{'Attachments'} = $Attachments = $attachments->ItemsArrayRef(); +} +my $titlebar_commands = ''; + +if ( $type =~ /EmailRecord$/ ) { + + $titlebar_commands .= + "[Ticket + . "&Transaction=" + . $Transaction->Id + . "&Attachment=" + . ( $Attachments->[0] && $Attachments->[0]->id ) + . '">' . loc('Show') . "] "; + $ShowBody = 0; +} + + +# If the transaction has anything attached to it at all +else { + + if ( $Attachments->[0] && $ShowTitleBarCommands ) { + my $ticket = $Transaction->TicketObj; + my $can_modify = $ticket->CurrentUserHasRight('ModifyTicket'); + if ( $can_modify || $ticket->CurrentUserHasRight('ReplyToTicket') ) { + $titlebar_commands .= + "[" + . loc('Reply') + . "] "; + } + if ( $can_modify || $ticket->CurrentUserHasRight('CommentOnTicket') ) { + $titlebar_commands .= + "[Ticket + . "&QuoteTransaction=" + . $Transaction->Id + . "&Action=Comment\">" + . loc('Comment') . "]"; + } + if ( $ticket->CurrentUserHasRight('ForwardMessage') ) { + $titlebar_commands .= + "[". loc('Forward') . "]"; + } + if ( $can_modify + && RT->Config->Get('GnuPG')->{'Enable'} + && RT->Config->Get('GnuPG')->{'AllowEncryptDataInDB'} + && $ticket->CurrentUserHasRight('ForwardMessage') + ) { + $titlebar_commands .= + "[". loc('Encrypt/Decrypt') . "]"; + } + } +} + diff --git a/rt/share/html/Ticket/Elements/ShowTransactionAttachments b/rt/share/html/Ticket/Elements/ShowTransactionAttachments new file mode 100644 index 000000000..9c40b28da --- /dev/null +++ b/rt/share/html/Ticket/Elements/ShowTransactionAttachments @@ -0,0 +1,252 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%PERL> +# Find all the attachments which have parent $Parent +# For each of these attachments +foreach my $message ( grep $_->__Value('Parent') == $Parent, @$Attachments ) { + + if (RT->Config->Get('GnuPG')->{'Enable'}) { + $m->comp( 'ShowGnuPGStatus', Attachment => $message, WarnUnsigned => $WarnUnsigned ); + } + + $m->comp( 'ShowMessageHeaders', + Message => $message, + DisplayHeaders => \@DisplayHeaders, + ); + + my $size = $message->ContentLength; + if ( $size ) { + +
+<&|/l&>Download <% $message->Filename || loc('(untitled)') %> +% if ( $DownloadableHeaders && !$message->Filename && $message->ContentType =~ /text/ ) { + / <% loc('with headers') %> +% } +
+<% $message->ContentType %> <% $size_to_str->( $size ) %> +
+% } + +%# If there is sub-messages, open a dedicated div +% if ( scalar ( grep $_->__Value('Parent') == $message->id, @$Attachments ) ) { +
+% } else { +
+% } +<%PERL> + +$render_attachment->( $message ); + +$m->comp( + $m->current_comp, + %ARGS, + Parent => $message->id, + ParentObj => $message +); + + +
+% } +<%ARGS> +$Ticket => undef +$Transaction => undef +$ShowHeaders => 0 +$Collapsed => undef +$DownloadableHeaders => 1 +$ShowTitleBarCommands => 1 +$RowNum => 1 +$AttachPath => RT->Config->Get('WebPath')."/Ticket/Attachment" +$UpdatePath => RT->Config->Get('WebPath')."/Ticket/Update.html" +$EmailRecordPath => RT->Config->Get('WebPath')."/Ticket/ShowEmailRecord.html" +$Attachments => undef +$AttachmentContent => {} +$ShowBody => 1 +$Parent => 0 +$ParentObj => undef +$WarnUnsigned => 0 + +<%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); + push @DisplayHeaders, 'RT-Send-Bcc' if RT->Config->Get('ShowBccHeader'); +} + +my $size_to_str = sub { + my $size = shift; + # show a download link + if ( $size > 1024*1024 ) { + $size = loc( "[_1]b", int( $size / 1024 / 102.4 ) / 10 ); + } + elsif ( $size > 1024 ) { + $size = loc( "[_1]k", int( $size / 102.4 ) / 10 ); + } + else { + $size = loc( "[_1]b", $size ); + } + return $size; +}; + +my $render_attachment = sub { + my $message = shift; + + # if it has a content-disposition: attachment, don't show inline + my $disposition = $message->GetHeader('Content-Disposition'); + if ( $disposition && $disposition =~ /attachment/i && $disposition !~ /^\s*inline/ ) { + $disposition = 'attachemnt'; + } else { + $disposition = 'inline'; + } + + # If it's text + if ( $message->ContentType =~ m{^(text|message)}i ) { + my $max_size = RT->Config->Get( 'MaxInlineBody', $session{'CurrentUser'} ); + if ( $message->Filename && RT->Config->Get('SuppressInlineTextFiles', $session{'CurrentUser'} ) ) { + $m->out('

'. loc( 'Text file is not shown because it is disabled in preferences.' ) .'

'); + return; + } + elsif ( $max_size && $message->ContentLength > $max_size ) { + $m->out('

'. loc( 'Message body not shown because it is too large.' ) .'

'); + return; + } + elsif ( $disposition ne 'inline' ) { + $m->out('

'. loc( 'Message body is not shown because sender requested not to inline it.' ) .'

'); + return; + } + + 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->Config->Get('PreferRichText') + && ( $message->ContentType =~ m{^text/(?:html|enriched)$} ) + ) + || ( !RT->Config->Get('PreferRichText') + && ( $message->ContentType !~ m{^text/(?:html|enriched)$} ) + ) + ) + ) + { + + my $content; + 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 ); + if ( $message->ContentType eq 'text/html' ) { + $m->comp('/Elements/MakeClicky', + content => \$content, html => 1, + ticket => $Ticket ); + } + $m->out( $content ); + } + + # if it's a text/plain show the body + elsif ( $message->ContentType =~ m{^(text|message)}i ) { + + eval { require Text::Quoted; $content = Text::Quoted::extract($content); }; + if ($@) { $RT::Logger->warning( "Text::Quoted failed: $@" ) } + + $m->comp( + 'ShowMessageStanza', + Depth => 0, + Message => $content, + Transaction => $Transaction + ); + } + } + } + + # if it's an image, show it as an image + elsif ( RT->Config->Get('ShowTransactionImages') and $message->ContentType =~ /^image\//i ) { + if ( $disposition ne 'inline' ) { + $m->out('

'. loc( 'Message body is not shown because sender requested not to inline it.' ) .'

'); + return; + } + + my $filename = $message->Filename || loc('(untitled)'); + $m->out('' ); + } + elsif ( $message->ContentLength > 0 ) { + $m->out( '

' . + loc( 'Message body not shown because it is not plain text.' ) . + '

' + ); + } +}; + + diff --git a/rt/share/html/Ticket/Elements/ShowUpdateStatus b/rt/share/html/Ticket/Elements/ShowUpdateStatus new file mode 100644 index 000000000..4eb53b405 --- /dev/null +++ b/rt/share/html/Ticket/Elements/ShowUpdateStatus @@ -0,0 +1,64 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +
+<&| /Widgets/TitleBox, title => loc('New messages'), title_href => "#txn-". $txn->id &> +<&|/l, &>There are unread messages on this ticket. +<&|/l, + RT->Config->Get('WebPath') ."/Ticket/Display.html?id=". $Ticket->id. "#txn-".$txn->id, + RT->Config->Get('WebPath') ."/Ticket/Display.html?id=". $Ticket->id ."&MarkAsSeen=1". "#txn-".$txn->id + + &>You can jump to the first unread message or jump to the first unread message and mark all messages as seen. + +
+<%ARGS> +$Ticket + +<%INIT> +return unless (RT->Config->Get( 'ShowUnreadMessageNotifications', $session{'CurrentUser'})); +my $txn = $Ticket->SeenUpTo or return; + diff --git a/rt/share/html/Ticket/Elements/ShowUserEntry b/rt/share/html/Ticket/Elements/ShowUserEntry new file mode 100644 index 000000000..5e4a463da --- /dev/null +++ b/rt/share/html/Ticket/Elements/ShowUserEntry @@ -0,0 +1,56 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Elements/ShowUser, %ARGS &> +% if ($Ticket and grep { $_->Content eq $User->EmailAddress } $Ticket->SquelchMailTo) { +<&|/l&>(Will not be sent email) +% } + +<%ARGS> +$User => undef +$Ticket => undef + diff --git a/rt/share/html/Ticket/Elements/Tabs b/rt/share/html/Ticket/Elements/Tabs new file mode 100755 index 000000000..7deb8c18d --- /dev/null +++ b/rt/share/html/Ticket/Elements/Tabs @@ -0,0 +1,341 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% $m->callback( 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, + }, + _X => { + title => loc('Jumbo'), + path => "Ticket/ModifyAll.html?id=" . $id, + }, + + }; + + if ( RT->Config->Get('EnableReminders') ) { + $ticket_page_tabs->{_F} = { + title => loc('Reminders'), + path => "Ticket/Reminders.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; + + my %can = ( ModifyTicket => $Ticket->CurrentUserHasRight('ModifyTicket'), ); + + if ( $can{'ModifyTicket'} or $Ticket->CurrentUserHasRight('ReplyToTicket') ) + { + $actions->{'F'} = { + title => loc('Reply'), + path => "Ticket/Update.html?Action=Respond&id=" . $id, + }; + } + + if ( $Ticket->CurrentUserHasRight('ForwardMessage') ) + { + $actions->{'FA'} = { + title => loc('Forward'), + path => "Ticket/Forward.html?id=" . $id, + }; + } + + if ( $can{'ModifyTicket'} ) { + if ( $Ticket->Status ne 'resolved' ) { + $actions->{'G'} = { + path => + "Ticket/Update.html?Action=Comment&DefaultStatus=resolved&id=" + . $id, + title => loc('Resolve') + }; + } + if ( $Ticket->Status ne 'open' ) { + $actions->{'A'} = { + path => "Ticket/Display.html?Status=open&id=" . $id, + title => loc('Open it') + }; + } + } + + if ( $Ticket->CurrentUserHasRight('OwnTicket') ) { + if ( $Ticket->OwnerObj->Id == $RT::Nobody->id ) { + $actions->{'B'} = { + path => "Ticket/Display.html?Action=Take&id=" . $id, + title => loc('Take'), + } + if $can{'ModifyTicket'} + or $Ticket->CurrentUserHasRight('TakeTicket'); + } elsif ( $Ticket->OwnerObj->id != $session{CurrentUser}->id ) { + $actions->{'C'} = { + path => "Ticket/Display.html?Action=Steal&id=" . $id, + title => loc('Steal'), + } + if $can{'ModifyTicket'} + or $Ticket->CurrentUserHasRight('StealTicket'); + } + } + + if ( $can{'ModifyTicket'} + or $Ticket->CurrentUserHasRight('CommentOnTicket') ) + { + $actions->{'E'} = { + title => loc('Comment'), + path => "Ticket/Update.html?Action=Comment&id=" . $id, + }; + } + + $actions->{'_ZZ'} + = { html => $m->scomp( '/Ticket/Elements/Bookmark', id => $Ticket->id ), + }; + +} + +if ( ( defined $actions->{A} || defined $actions->{B} || defined $actions->{C} ) + && ( defined $actions->{E} + || defined $actions->{F} + || defined $actions->{G} ) ) +{ + + if ( defined $actions->{C} ) { $actions->{C}->{separator} = 1 } + elsif ( defined $actions->{B} ) { $actions->{B}->{separator} = 1 } + elsif ( defined $actions->{A} ) { $actions->{A}->{separator} = 1 } +} + +my $args = ''; +my $has_query = ''; +my %query_args; +my $search_id = $ARGS{'SavedSearchId'} + || $session{'CurrentSearchHash'}->{'SearchId'} || ''; +my $chart_search_id = $ARGS{'SavedChartSearchId'} || ''; + +$has_query = 1 if ( $ARGS{'Query'} or $session{'CurrentSearchHash'}->{'Query'} ); + +%query_args = ( + SavedSearchId => ($search_id eq 'new') ? undef : $search_id, + SavedChartSearchId => $chart_search_id, + Query => $ARGS{'Query'} || $session{'CurrentSearchHash'}->{'Query'}, + Format => $ARGS{'Format'} || $session{'CurrentSearchHash'}->{'Format'}, + OrderBy => $ARGS{'OrderBy'} + || $session{'CurrentSearchHash'}->{'OrderBy'}, + Order => $ARGS{'Order'} || $session{'CurrentSearchHash'}->{'Order'}, + Page => $ARGS{'Page'} || $session{'CurrentSearchHash'}->{'Page'}, + RowsPerPage => $ARGS{'RowsPerPage'} || $session{'CurrentSearchHash'}->{'RowsPerPage'}, + ); + + $args = "?" . $m->comp( '/Elements/QueryString', %query_args ); + +$tabs->{"f"} = { + path => "Search/Build.html?NewQuery=1", + title => loc('New Search') +}; +$tabs->{"g"} = { + path => "Search/Build.html" . (($has_query) ? $args : ''), + title => loc('Edit Search') +}; +$tabs->{"h"} = { + path => "Search/Edit.html$args", + title => loc('Advanced'), + separator => 1 +}; +if ($has_query) { + + if ( $current_tab =~ m{Search/Results.html} ) { + $current_tab = "Search/Results.html$args"; + + if ( $session{'CurrentUser'} + ->HasRight( Right => 'SuperUser', Object => $RT::System ) ) + { + my $shred_args = $m->comp( + '/Elements/QueryString', + Search => 1, + Plugin => 'Tickets', + 'Tickets:query' => $query_args{'Query'}, + 'Tickets:limit' => $query_args{'Rows'} + ); + + $tabs->{"shredder"} = { + path => 'Admin/Tools/Shredder/?' . $shred_args, + title => loc('Shredder') + }; + + } + } + if ( $current_tab =~ m{Search/(Bulk|Build|Edit)\.html} ) { + $current_tab = "Search/$1.html$args"; + } + + $tabs->{"i"} = { + path => "Search/Results.html$args", + title => loc('Show Results'), + }; + + $tabs->{"j"} = { + path => "Search/Bulk.html$args", + title => loc('Bulk Update'), + }; + + $tabs->{"k"} = { + path => "Search/Chart.html$args", + title => loc('Graph'), + }; + +} + +foreach my $searchtab ( keys %{$searchtabs} ) { + ( $searchtab =~ /^_/ ) + ? $tabs->{ "s" . $searchtab } = $searchtabs->{$searchtab} + : $tabs->{ "z_" . $searchtab } = $searchtabs->{$searchtab}; +} + + + + +<%ARGS> +$Ticket => undef +$subtabs => undef +$current_tab => '' +$current_subtab => '' +$Title => undef +$RowsPerPage => undef + diff --git a/rt/share/html/Ticket/Elements/UpdateCc b/rt/share/html/Ticket/Elements/UpdateCc new file mode 100644 index 000000000..2538c82df --- /dev/null +++ b/rt/share/html/Ticket/Elements/UpdateCc @@ -0,0 +1,80 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<&|/l&>One-time Cc:<& /Elements/EmailInput, Name => 'UpdateCc', Size => '60', Default => $ARGS{UpdateCc} &> + +
+ +%foreach my $addr ( keys %txn_addresses) { +% next if ( grep {$addr eq $_} @req_addresses ); + > <& /Elements/ShowUser, Address => $txn_addresses{$addr}&> +%} + +<&|/l&>One-time Bcc:<& /Elements/EmailInput, Name => 'UpdateBcc', Size => '60', Default => $ARGS{UpdateBcc} &>
+%foreach my $addr ( keys %txn_addresses) { +% next if ( grep {$addr eq $_} @req_addresses ); +> +<& /Elements/ShowUser, Address => $txn_addresses{$addr}&> +%} + +<%args> +$TicketObj + +<%init> +my %txn_addresses = %{$TicketObj->TransactionAddresses}; +my @req_addresses = split /,/, $TicketObj->RequestorAddresses; + -- cgit v1.2.1