diff options
Diffstat (limited to 'rt/share/html/Ticket/Elements')
37 files changed, 4210 insertions, 0 deletions
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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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 }}} +<br /> +<br /> + +<&|/l&>Add new watchers</&>:<br /> + +<table> +% if ($Users and $Users->Count) { +<tr><td> +<&|/l&>Type</&> +</td><td> +<&|/l&>Username</&> +</td></tr> +% while (my $u = $Users->Next ) { +<tr><td><&/Elements/SelectWatcherType, Name => "Ticket-AddWatcher-Principal-". $u->PrincipalId &></td><td><& '/Elements/ShowUser', User => $u, style=>'verbose' &></td></tr> +% } +% } + +% if ($Groups and $Groups->Count) { +<tr><td> +<&|/l&>Type</&> +</td><td> +<&|/l&>Group</&> +</td></tr> +% while (my $g = $Groups->Next ) { +<tr><td><&/Elements/SelectWatcherType, Name => "Ticket-AddWatcher-Principal-".$g->PrincipalId, Scope => 'queue' &></td><td><%$g->Name%> (<%$g->Description%>)</td></tr> +% } +% } + +<tr><td> +<&|/l&>Type</&> +</td><td> +<&|/l&>Email</&> +</td></tr> +% my $counter = 4; +% for my $email (@extras) { +% $counter++; +<tr><td> +<&/Elements/SelectWatcherType, Name => "WatcherTypeEmail".$counter &> +</td><td> +<input type="hidden" name="WatcherAddressEmail<%$counter%>" value="<%$email->address%>"> +<%$email->format%> +</td></tr> +% } +<tr><td> +<&/Elements/SelectWatcherType, Name => "WatcherTypeEmail1" &> +</td><td> +<& /Elements/EmailInput, Name => 'WatcherAddressEmail1', Size => '20' &> +</td></tr> +<tr><td> +<&/Elements/SelectWatcherType, Name => "WatcherTypeEmail2" &> +</td><td> +<& /Elements/EmailInput, Name => 'WatcherAddressEmail2', Size => '20' &> +</td></tr> +<tr><td> +<&/Elements/SelectWatcherType, Name => "WatcherTypeEmail3" &> +</td><td> +<& /Elements/EmailInput, Name => 'WatcherAddressEmail3', Size => '20' &> +</td></tr> +</table> + +<%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)); +} + + +</%INIT> + +<%ARGS> +$UserField => 'Name' +$UserOp => '=' +$UserString => undef +$GroupField => 'Name' +$GroupOp => '=' +$GroupString => undef +$PrivilegedOnly => undef +$Ticket => undef +</%ARGS> 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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; +} +</%INIT> +<%ARGS> +$id +$Toggle => 0 +</%ARGS> +<span id="toggle-<% $id %>"> +% my $url = RT->Config->Get('WebPath') ."/Helpers/Toggle/TicketBookmark?id=". $id; +<a align="right" href="<% $url %>" onclick="ahah('<% $url |n %>', 'toggle-<% $id |n %>'); return false;" > +% if ( $bookmarked ) { +<img src="<% RT->Config->Get('WebPath') %>/NoAuth/images/star.gif" alt="<% loc('Remove Bookmark') %>" style="border-style: none" /> +% } else { +<img src="<% RT->Config->Get('WebPath') %>/NoAuth/images/empty_star.gif" alt="<% loc('Add Bookmark') %>" style="border-style: none" /> +% } +</a> +</span> 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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 }}} +<table width="100%"> + <tr> + <td valign="top" width="50%"> + <h3><&|/l&>Current Links</&></h3> +<table> + <tr> + <td class="labeltop"><&|/l&>Depends on</&>:</td> + <td class="value"> +% if ( $hash{DependsOn} ) { +% for my $link ( values %{$hash{DependsOn}} ) { + <input type="checkbox" class="checkbox" name="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1" /> + <& /Elements/ShowLink, URI => $link->TargetURI &><br /> +% } } + </td> + </tr> + <tr> + <td class="labeltop"><&|/l&>Depended on by</&>:</td> + <td class="value"> +% if ( $hash{DependedOnBy} ) { +% for my $link ( values %{$hash{DependedOnBy}} ) { + <input type="checkbox" class="checkbox" name="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1" /> + <& /Elements/ShowLink, URI => $link->BaseURI &><br /> +% } } + </td> + </tr> + <tr> + <td class="labeltop"><&|/l&>Parents</&>:</td> + <td class="value"> +% if ( $hash{MemberOf} ) { +% for my $link ( values %{$hash{MemberOf}} ) { + <input type="checkbox" class="checkbox" name="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1" /> + <& /Elements/ShowLink, URI => $link->TargetURI &><br /> +% } } + </td> + </tr> + <tr> + <td class="labeltop"><&|/l&>Children</&>:</td> + <td class="value"> +% if ( $hash{Members} ) { +% for my $link ( values %{$hash{Members}} ) { + <input type="checkbox" class="checkbox" name="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1" /> + <& /Elements/ShowLink, URI => $link->BaseURI &><br /> +% } } + </td> + </tr> + <tr> + <td class="labeltop"><&|/l&>Refers to</&>:</td> + <td class="value"> +% if ( $hash{RefersTo} ) { +% for my $link ( values %{$hash{RefersTo}} ) { + <input type="checkbox" class="checkbox" name="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1" /> + <& /Elements/ShowLink, URI => $link->TargetURI &><br /> +% } } + </td> + </tr> + <tr> + <td class="labeltop"><&|/l&>Referred to by</&>:</td> + <td class="value"> +% if ( $hash{ReferredToBy} ) { +% for my $link ( values %{$hash{ReferredToBy}} ) { +% # Skip reminders +% next if (UNIVERSAL::isa($link->BaseObj, 'RT::Ticket') && $link->BaseObj->Type eq 'reminder'); + <input type="checkbox" class="checkbox" name="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1" /> + <& /Elements/ShowLink, URI => $link->BaseURI &><br /> +% } } + </td> + </tr> + <tr> + <td></td> + <td><i><&|/l&>(Check box to delete)</&></i></td> + </tr> +</table> +</td> +<td valign="top"> +<h3><&|/l&>New Links</&></h3> +<i><&|/l&>Enter tickets or URIs to link tickets to. Separate multiple entries with spaces.</&> +</i><br /> +<table> + <tr> + <td class="label"><&|/l&>Merge into</&>:</td> + <td class="entry"><input name="Ticket-MergeInto" /> <i><&|/l&>(only one ticket)</&></i></td> + </tr> + <tr> + <td class="label"><&|/l&>Depends on</&>:</td> + <td class="entry"><input name="Ticket-DependsOn" /></td> + </tr> + <tr> + <td class="label"><&|/l&>Depended on by</&>:</td> + <td class="entry"><input name="DependsOn-Ticket" /></td> + </tr> + <tr> + <td class="label"><&|/l&>Parents</&>:</td> + <td class="entry"><input name="Ticket-MemberOf" /></td> + </tr> + <tr> + <td class="label"><&|/l&>Children</&>:</td> + <td class="entry"> <input name="MemberOf-Ticket" /></td> + </tr> + <tr> + <td class="label"><&|/l&>Refers to</&>:</td> + <td class="entry"><input name="Ticket-RefersTo" /></td> + </tr> + <tr> + <td class="label"><&|/l&>Referred to by</&>:</td> + <td class="entry"> <input name="RefersTo-Ticket" /></td> + </tr> +</table> +</td> +</tr> +</table> + +<%ARGS> +$Tickets => undef +</%ARGS> + +<%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{$_}; + } + } + } +} +</%INIT> 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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 }}} +<table> + <tr> + <td class="label"><&|/l&>Subject</&>:</td> + <td class="value"><input name="Subject" value="<%$TicketObj->Subject|h%>" size="50" /></td> + </tr> + + <tr> + <td class="label"><&|/l&>Status</&>:</td> + <td class="value"><%$SelectStatus|n%></td> + </tr> + <tr> + <td class="label"><&|/l&>Queue</&>:</td> + <td class="value"><%$SelectQueue|n%></td> + </tr> + <tr> + <td class="label"><&|/l&>Owner</&>:</td> + <td class="value"><& /Elements/SelectOwner, + Name => 'Owner', + QueueObj => $TicketObj->QueueObj, + TicketObj => $TicketObj, + Default => $TicketObj->OwnerObj->Id, + DefaultValue => 0, + &></td> + </tr> + + <tr> + <td class="label"><&|/l&>Time Estimated</&>:</td> + <td class="value"> + <& /Elements/EditTimeValue, + Name => 'TimeEstimated', + Default => $TicketObj->TimeEstimated, + &> + </td> + </tr> + <tr> + <td class="label"><&|/l&>Time Worked</&>:</td> + <td class="value"> + <& /Elements/EditTimeValue, + Name => 'TimeWorked', + Default => $TicketObj->TimeWorked, + &> + </td> + </tr> + <tr> + <td class="label"><&|/l&>Time Left</&>:</td> + <td class="value"> + <& /Elements/EditTimeValue, + Name => 'TimeLeft', + Default => $TicketObj->TimeLeft, + &> + </td> + </tr> + + <tr> + <td class="label"><&|/l&>Priority</&>:</td> + <td class="value"><& /Elements/SelectPriority, + Default => $TicketObj->Priority, + &></td> + </tr> + + <tr> + <td class="label"><&|/l&>Final Priority</&>:</td> + <td class="value"><& /Elements/SelectPriority, + Name => "FinalPriority", + Default => $TicketObj->FinalPriority, + &></td> + </tr> + + + +% $m->callback( CallbackName => 'EndOfList', TicketObj => $TicketObj, %ARGS ); +</table> + +<%INIT> +#It's hard to do this inline, so we'll preload the html of the selectstatus in here. +my $SelectStatus = $m->scomp("/Elements/SelectStatus", Name => 'Status', DefaultLabel => loc("[_1] (Unchanged)",loc($TicketObj->Status))); +my $SelectQueue = $m->scomp("/Elements/SelectQueue", Name => 'Queue', Default =>$TicketObj->QueueObj->Id, ShowNullOption => 0); + +</%INIT> +<%ARGS> + +$TicketObj => undef +</%ARGS> 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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 }}} +<table> +% my $i = 0; +% while ( my $CustomField = $CustomFields->Next ) { +% next unless $CustomField->CurrentUserHasRight('ModifyCustomField'); +% $i++; +% if ( $i % 2 ) { +<tr> +% } + <td class="cflabel"> + <b><% loc($CustomField->Name) %></b><br /> + <i><% $CustomField->FriendlyType %></i> + </td> + <td class="entry"> +% 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)) { + <br /> + <span class="cfinvalidfield"><% $msg %></span> +% } + </td> + +% unless ( $i % 2 ) { +</tr> +% } + +% } + +%# close row if required +% if ( $i % 2 ) { +</tr> +% } + +</table> +<%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 ); + +</%INIT> +<%ARGS> +$NamePrefix => '' +$TicketObj => undef +$QueueObj => undef +$OnCreate => undef +$DefaultsFromTopArguments => 1 +</%ARGS> 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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 }}} +<table> + <tr> + <td class="label"><&|/l&>Starts</&>:</td> + <td class="entry"><& /Elements/SelectDate, menu_prefix => 'Starts', current => 0 &> + (<% $TicketObj->StartsObj->AsString %>)</td> + </tr> + <tr> + <td class="label"><&|/l&>Started</&>:</td> + <td class="entry"><& /Elements/SelectDate, menu_prefix => 'Started', current => 0 &> (<%$TicketObj->StartedObj->AsString %>)</td> + </tr> + + <tr> + <td class="label"> + <&|/l&>Last Contact</&>: + </td> + <td class="entry"> + <& /Elements/SelectDate, menu_prefix => 'Told', current => 0 &> (<% $TicketObj->ToldObj->AsString %>) + </td> + </tr> + <tr> + <td class="label"><&|/l&>Due</&>:</td> + <td class="entry"> + <& /Elements/SelectDate, menu_prefix => 'Due', current => 0 &> (<% $TicketObj->DueObj->AsString %>) + </td> + </tr> +</table> +<%ARGS> +$TicketObj => undef +</%ARGS> + diff --git a/rt/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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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 }}} +<table width="100%"> +<tr> +<td valign="top"> + +<h3><&|/l&>New watchers</&></h3> +<&|/l&>Find people whose</&><br /> +<& /Elements/SelectUsers &> +<input type="submit" class="button" name="OnlySearchForPeople" value="<&|/l&>Go!</&>" /> +<br /> +<&|/l&>Find groups whose</&><br /> +<& /Elements/SelectGroups &> +<input type="submit" class="button" name="OnlySearchForGroup" value="<&|/l&>Go!</&>" /> + +<& AddWatchers, Ticket => $Ticket, UserString => $UserString, + UserOp => $UserOp, UserField => $UserField, + GroupString => $GroupString, GroupOp => $GroupOp, + GroupField => $GroupField, PrivilegedOnly => $PrivilegedOnly &> +</td><td valign="top"> +<h3><&|/l&>Owner</&></h3> +<&|/l&>Owner</&>: <& /Elements/SelectOwner, Name => 'Owner', QueueObj => $Ticket->QueueObj, TicketObj => $Ticket, Default => $Ticket->OwnerObj->Id, DefaultValue => 0&> +<h3><&|/l&>Current watchers</&></h3> + +<&|/l&>Requestors</&>: +<& EditWatchers, TicketObj => $Ticket, Watchers => $Ticket->Requestors &> + +<&|/l&>Cc</&>: +<& EditWatchers, TicketObj => $Ticket, Watchers => $Ticket->Cc &> + +<&|/l&>Administrative Cc</&>: +<& EditWatchers, TicketObj => $Ticket, Watchers => $Ticket->AdminCc &> + +<i><&|/l&>(Check box to delete)</&></i><br /> +</td> +</tr> +</table> + +<%ARGS> +$UserField => undef +$UserOp => undef +$UserString => undef +$GroupField => undef +$GroupOp => undef +$GroupString => undef +$PrivilegedOnly => undef +$Ticket => undef +</%ARGS> diff --git a/rt/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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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'); +<tr> +<td class="label"><% loc($CF->Name) %>:</td> +<td> +<& /Elements/EditCustomField, + CustomField => $CF, + NamePrefix => $NamePrefix +&> +<em><% $CF->FriendlyType %></em> +</td> +</td></tr> +% } +% } + +<%INIT> +my $CustomFields; + +if ($TicketObj) { + $CustomFields = $TicketObj->TransactionCustomFields(); +} else { + $CustomFields = $QueueObj->TicketTransactionCustomFields(); +} + +$m->callback( CallbackName => 'MassageTransactionCustomFields', CustomFields => $CustomFields ); + +</%INIT> +<%ARGS> +$NamePrefix => "Object-RT::Transaction--CustomField-" +$TicketObj => undef +$QueueObj => undef +</%ARGS> + 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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 }}} +<ul> +%# Print out a placeholder if there are none. +% unless ( $Members->Count ) { +<li><i><&|/l&>none</&></i></li> +% } + + +% while ( my $watcher = $Members->Next ) { +% my $member = $watcher->MemberObj->Object; +<li> +<input type="checkbox" class="checkbox" name="Ticket-DeleteWatcher-Type-<% $Watchers->Type %>-Principal-<% $watcher->MemberId %>" value="1" unchecked /> +% if ( $member->isa( 'RT::User' ) ) { +<a href="<% RT->Config->Get('WebPath') %>/Admin/Users/Modify.html?id=<% $watcher->MemberId %>"> +<& /Elements/ShowUser, User => $member &></a> +% if ($TicketObj and grep { $_->Content eq $member->EmailAddress } $TicketObj->SquelchMailTo) { +<b><&|/l&>(Will not be sent email)</&></b> +% } + +% } else { +<a href="<% RT->Config->Get('WebPath') %>/Admin/Groups/Modify.html?id=<% $watcher->MemberId %>"> +<% $member->Name %></a> +% } +</li> +% } +</ul> +<%INIT> +my $Members = $Watchers->MembersObj; +</%INIT> +<%ARGS> +$TicketObj => undef +$Watchers => undef +</%ARGS> 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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); +</%INIT> +<%ARGS> +$Ticket => undef +$Tickets => undef +</%ARGS> + 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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); +</%INIT> +<%ARGS> +$Ticket => undef +</%ARGS> + 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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 + +</%args> +<%init> +my %squelch = $m->comp('SELF:SquelchRecipients', %ARGS); +my $Object = $squelch{'Object'}; +my @non_recipients = @{ $squelch{'EmailAddresses'} }; + +</%init> +<h2><&|/l&>This message will be sent to...</&></h2> + +% if ( $Object and $Object->Scrips ) { +<i><&|/l&>(Check boxes to disable notifications to the listed recipients)</&></i><br /> + +% foreach my $scrip (@{$Object->Scrips->Prepared}) { +% next unless $scrip->ActionObj->Action->isa('RT::Action::SendEmail'); +<b><% $scrip->Description || loc('Scrip #[_1]',$scrip->id) %></b><br /> +<&|/l, loc($scrip->ConditionObj->Name), loc($scrip->ActionObj->Name), loc($scrip->TemplateObj->Name)&>[_1] [_2] with template [_3]</&> +<br /> +%foreach my $type qw(To Cc Bcc) { +%my @addresses = $scrip->ActionObj->Action->$type(); +<ul> +%foreach my $addr (@addresses) { +<li> <b><%loc($type)%></b>: <input type="checkbox" class="checkbox" name="Ticket-<%$TicketObj->id%>-SquelchMailTo" value="<%$addr->address%>" /> <%$addr->address%> +% } +</ul> +% } +% if (RT->Config->Get('PreviewScripMessages')) { +<textarea cols="80" rows="5"> +<%$scrip->ActionObj->TemplateObj->MIMEObj->as_string%> +</textarea> +% } +% } +% } +<br /> + +<h2><&|/l&>Messages about this ticket will not be sent to...</&></h2> +<i><&|/l&>(Check boxes to enable notifications to the listed recipients)</&></i> +<br /> +<ul> +% foreach my $recipient (@non_recipients) { +<li><input type="checkbox" class="checkbox" name="Ticket-<%$TicketObj->id%>-UnsquelchMailTo" value="<%$recipient->Content%>" /> +<% $recipient->Content %> +% } +</ul> +<& /Elements/Submit, Name => 'UpdatePreview', Value => 'UpdatePreview', Label => loc('Save Changes')&> + +<%METHOD SquelchRecipients> +<%ARGS> +$TicketObj => undef +</%ARGS> +<%INIT> +my $arg = 'Ticket-'.$TicketObj->Id.'-SquelchMailTo'; +my @squelchto = ref($ARGS{$arg}) eq 'ARRAY' ? @{$ARGS{$arg}} : ($ARGS{$arg}); + +foreach my $address (@squelchto) { + $TicketObj->SquelchMailTo($address) if ($address); +} + + +$arg = 'Ticket-'.$TicketObj->Id.'-UnsquelchMailTo'; +my @unsquelchto = ref($ARGS{$arg}) eq 'ARRAY' ? @{$ARGS{$arg}} : ($ARGS{$arg}); + +foreach my $address (@unsquelchto) { + $TicketObj->UnsquelchMailTo($address) if ($address); +} + + +my $action; + +if (($ARGS{'UpdateType'} && $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]); +</%INIT> +</%METHOD> + +<%METHOD GetRecipients> +<%ARGS> +$TicketObj +</%ARGS> +<%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; +</%INIT> +</%METHOD> + +<%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; +</%INIT> +</%METHOD> 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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 +</%args> +<%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; +</%init> +<input type="hidden" class="hidden" name="id" value="<% $Ticket->id %>" /> +<input type="hidden" class="hidden" name="update-reminders" value="1" /> +<div> +% while (my $reminder = $reminder_collection->Next) { +% if ($reminder->Status eq 'resolved' && !$ShowCompleted) { +<input type="hidden" class="hidden" name="Complete-Reminder-<% $reminder->id %>" value="1" /> +% } elsif ($Edit) { +<& SELF:EditEntry, Reminder => $reminder, Ticket => $Ticket &> +% } else { +<& SELF:ShowEntry, Reminder => $reminder, Ticket => $Ticket &> +% } +% } +% if ($reminder_collection->Count) { +<i><&|/l&>(Check box to delete)</&></i><br /><br /> +% } +</div> +<div> +<&|/l&>New reminder:</&> +<& SELF:NewReminder, Ticket => $Ticket &> +<%method NewReminder> +<%args> +$Ticket +</%args> +<table> +<tr class="input-row"> +<td class="label"><label class="horizontal" for="NewReminder-Subject" ><&|/l&>Subject</&>:</label></td> +<td class="value"> +<input type="text" size="15" name="NewReminder-Subject" id="NewReminder-Subject" /> +</td> +</tr> +<tr class="input-row"> +<td class="label"> +<label class="horizontal" for="NewReminder-Owner" ><&|/l&>Owner</&>:</label></td><td class="value"> +<& /Elements/SelectOwner, Name => 'NewReminder-Owner', QueueObj => $Ticket->QueueObj, Default=>$session{'CurrentUser'}->id, DefaultValue => 0 &> +</td> +</tr> +<tr class="input-row"> +<td class="label"><label class="horizontal" for="NewReminder-Due" ><&|/l&>Due</&>:</label></td> +<td class="value"> +<& /Elements/SelectDate, Name => "NewReminder-Due", Default => "" &> +</td> +</tr> +</table> +</%method> +<%method EditEntry> +<%args> +$Reminder +$Ticket +</%args> +<input + type="checkbox" + name="Complete-Reminder-<%$Reminder->id%>" + <% $Reminder->Status eq 'resolved' ? 'checked="checked"' : '' %> +/> + <input type="text" size="15" name="Reminder-Subject-<% $Reminder->id %>" value="<%$Reminder->Subject%>" /> • + <& /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 : '' %>)<br /> +</%method> +<%method ShowEntry> +<%args> +$Reminder +$Ticket +</%args> +<input + type="checkbox" + name="Complete-Reminder-<%$Reminder->id%>" + <% $Reminder->Status eq 'resolved' ? 'checked="checked"' : '' %> +/> + <%$Reminder->Subject%> • + <%$Reminder->OwnerObj->Name%> + <%$Reminder->DueObj->Unix>0 ? "• ". $Reminder->DueObj->AgeAsString : '' |n%><br /> +</%method> 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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%><br /> +<ul> +% foreach my $rev (@{$documents{$key}}) { + +<%PERL> +my $size = $rev->ContentLength; + +if ($size) { + if ($size > 1024) { + $size = int($size/102.4)/10 . "k"; + } + else { + $size = $size ."b"; + } + +</%PERL> + +<li><font size="-2"> +<a href="<%RT->Config->Get('WebPath')%>/Ticket/Attachment/<%$rev->TransactionId%>/<%$rev->Id%>/<%$rev->Filename | u%>"> +<&|/l, $rev->CreatedAsString, $size, $rev->CreatorObj->Name &>[_1] ([_2]) by [_3]</&> +</a> +</font></li> +% } +% } +</ul> + +% } +</&> + +% } + +<%INIT> + +# If we haven't been passed in an Attachments object (through the precaching mechanism) +# then we need to find one +$Attachments ||= $m->comp('FindAttachments', Ticket => $Ticket); + +my %documents; +while ( my $attach = $Attachments->Next() ) { + next unless ($attach->Filename()); + unshift( @{ $documents{ $attach->Filename } }, $attach ); +} + +</%INIT> +<%ARGS> +$Ticket => undef +$Attachments => undef +</%ARGS> + diff --git a/rt/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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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 }}} +<table> + <tr> + <td class="label id"><&|/l&>Id</&>:</td> + <td class="value id"><%$Ticket->Id %></td> + </tr> + <tr> + <td class="label status"><&|/l&>Status</&>:</td> + <td class="value status"><% loc($Ticket->Status) %></td> + </tr> +% if ($Ticket->TimeEstimated) { + <tr> + <td class="label time estimated"><&|/l&>Estimated</&>:</td> + <td class="value time estimated"><& ShowTime, minutes => $Ticket->TimeEstimated &></td> + </tr> +% } +% if ($Ticket->TimeWorked) { + <tr> + <td class="label time worked"><&|/l&>Worked</&>:</td> + <td class="value time worked"><& ShowTime, minutes => $Ticket->TimeWorked &></td> + </tr> +% } +% if ($Ticket->TimeLeft) { + <tr> + <td class="label time left"><&|/l&>Left</&>:</td> + <td class="value time left"><& ShowTime, minutes => $Ticket->TimeLeft &></td> + </tr> +% } + <tr> + <td class="label priority"><&|/l&>Priority</&>:</td> + <td class="value priority"><& ShowPriority, Ticket => $Ticket &></td> + </tr> + <tr> + <td class="label queue"><&|/l&>Queue</&>:</td> + <td class="value queue"><& ShowQueue, QueueObj => $Ticket->QueueObj &></td> + </tr> +% $m->callback( %ARGS, CallbackName => 'EndOfList', TicketObj => $Ticket ); +</table> +<%ARGS> +$Ticket => undef +</%ARGS> 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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 +</%ARGS> 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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 }}} +<table> + <tr> + <td class="label date created"><&|/l&>Created</&>:</td> + <td class="value date created"><% $Ticket->CreatedObj->AsString %></td> + </tr> + <tr> + <td class="label date starts"><&|/l&>Starts</&>:</td> + <td class="value date starts"><% $Ticket->StartsObj->AsString %></td> + </tr> + <tr> + <td class="label date started"><&|/l&>Started</&>:</td> + <td class="value date started"><% $Ticket->StartedObj->AsString %></td> + </tr> + <tr> + <td class="label date told"><a href="<% RT->Config->Get('WebPath') %>/Ticket/Display.html?id=<% $Ticket->id %>&Action=SetTold"><&|/l&>Last Contact</&></a>:</td> + <td class="value date told"><% $Ticket->ToldObj->AsString %></td> + </tr> + <tr> + <td class="label date due"><&|/l&>Due</&>:</td> +% my $due = $Ticket->DueObj; +% if ( $due && $due->Unix > 0 && $due->Diff < 0 ) { + <td class="value date due"><span class="overdue"><% $due->AsString %></span></td> +% } else { + <td class="value date due"><% $due->AsString %></td> +% } + </tr> + <tr> + <td class="label date resolved"><&|/l&>Closed</&>:</td> + <td class="value date resolved"><% $Ticket->ResolvedObj->AsString %></td> + </tr> + <tr> + <td class="label date updated"><&|/l&>Updated</&>:</td> +% my $UpdatedString = $Ticket->LastUpdated ? loc("[_1] by [_2]", $Ticket->LastUpdatedAsString, $Ticket->LastUpdatedByObj->Name) : loc("Never"); +% if ($UpdatedLink) { + <td class="value date updated"><a href="#lasttrans"><% $UpdatedString | h %></a></td> +% } else { + <td class="value date updated"><% $UpdatedString | h %></td> +% } + </tr> +</table> +<%ARGS> +$Ticket => undef +$UpdatedLink => 1 +</%ARGS> 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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</&>:<br /> +% while (my $Link = $Ticket->DependsOn->Next) { +% my $member = $Link->TargetObj; +<a href="<%RT->Config->Get('WebPath')%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> +[<%$member->Status%>] + <br /> +% } +<&|/l&>Depended on by</&>:<br /> +% while (my $Link = $Ticket->DependedOnBy->Next) { +% my $member = $Link->TargetObj; +<a href="<%RT->Config->Get('WebPath')%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> +[<%$member->Status%>] + <br /> +% } + +<%ARGS> +$Ticket => undef +</%ARGS> diff --git a/rt/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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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 }}} +<table class="crypt-runs"> +<tr><td align="right" class="labeltop" rowspan="<% scalar @messages %>">GnuPG:</td> +<td><% shift @messages %></td></tr> + +% foreach my $msg( @messages ) { +<tr><td><% $msg %></td></tr> +% } +</table> +<%ARGS> +$Attachment +$WarnUnsigned => undef +$Reverify => 1 +</%ARGS> +<%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; + +</%INIT> 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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 &><br /> +% } +% my $Groups = $Group->GroupMembersObj( Recursively => $Recursively ); +% $Groups->LimitToUserDefinedGroups; +% while (my $group = $Groups->Next) { +<&|/l&>Group</&>: <% $group->Name %><br /> +% } + +<%ARGS> +$Group => undef +$Recursively => 0, +$Ticket => undef +</%ARGS> 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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. +</%doc> +<%perl> +if ($ShowDisplayModes or $ShowTitle) { + my $title = $ShowTitle + ? loc('History') + : ' '; + + my $titleright; + + if ($ShowDisplayModes) { + $titleright = ''; + + if ($ShowHeaders) { + $titleright .= qq{<a href="$URIFile?id=} . + $Ticket->id.qq{">} . + loc("Brief headers") . + qq{</a> — }; + $titleright .= q[<span class="selected">] . loc("Full headers") . "</span>"; + } + else { + $titleright .= q[<span class="selected">] . loc("Brief headers") . "</span> — "; + $titleright .= qq{<a href="$URIFile?ShowHeaders=1;id=} . + $Ticket->id.qq{">} . + loc("Full headers") . + qq{</a>}; + } + } +</%perl> +<div class="history"> +<& /Widgets/TitleBoxStart, title => $title, titleright_raw => $titleright &> +% } + +<div id="ticket-history"> +<%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(); +} + +</%perl> +</div> +% if ($ShowDisplayModes or $ShowTitle) { +<& /Widgets/TitleBoxEnd &> +</div> +% } +<%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); + +</%INIT> +<%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 +</%ARGS> 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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 }}} +<ul> +% while (my $link = $members->Next) { +<li><& /Elements/ShowLink, URI => $link->BaseURI &><br /> +% if ($depth < 8) { +<& /Ticket/Elements/ShowMembers, Ticket => $link->BaseObj, depth => ($depth+1) &> +% } +</li> +% } +</ul> + +<%INIT> + +return unless $Ticket; +my $members = $Ticket->Members; +return unless $members->Count; + +</%INIT> + +<%ARGS> +$Ticket => undef +$depth => 1 +</%ARGS> 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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 ) { +<table> +% foreach my $header (@headers) { + <tr> + <td align="right" class="message-header-key"><% $header->{'Tag'} %>:</td> + <td class="message-header-value"><% $header->{'Value'} | n %></td> + </tr> +% } +</table> +% } +<%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; +} +</%INIT> +<%ARGS> +$Message => undef +$Localize => 1 +@DisplayHeaders => ('_all') +</%ARGS> 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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('<pre>') if $plain_text_pre && !$Depth && !$plain_text_mono; + $m->out( qq{<div class="message-stanza-depth-$Depth">} ); + + 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{<div class="message-stanza-depth-$Depth">} ); + } + if ( length $para ) { + $print_content->( \$para ); $para = ''; + } + + if ( @stack ) { + ($Message, $i) = @{ pop @stack }; + $Depth--; + $m->out('</div>'); + goto AGAIN; + } + + $m->out('</div>'); + $m->out('</pre>') if $plain_text_pre && !$Depth && !$plain_text_mono; +} else { + $print_content->( \$Message ); +} +</%perl> +<%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)}{<br />}g if defined $$ref; + } + $m->out( $$ref ); +}; +</%INIT> +<%ARGS> +$Message => undef +$Depth => 0 +$Transaction => undef +</%ARGS> 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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 }}} +<ul> +% while (my $link = $member_of->Next) { +<li><& /Elements/ShowLink, URI => $link->TargetURI &><br /> +% } +</ul> +<%INIT> + +return unless $Ticket; +my $member_of = $Ticket->MemberOf; +return unless $member_of->Count; + +</%INIT> + +<%ARGS> +$Ticket => undef +</%ARGS> 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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 }}} +<table> + <tr> + <td class="label"><&|/l&>Owner</&>:</td> +% my $owner = $Ticket->OwnerObj; + <td class="value"><& /Elements/ShowUser, User => $owner, Ticket => $Ticket &> + <& /Elements/ShowUserEmailFrequency, User => $owner, Ticket => $Ticket &></td> + </tr> + <tr> + <td class="labeltop"><&|/l&>Requestors</&>:</td> + <td class="value"><& ShowGroupMembers, Group => $Ticket->Requestors, Ticket => $Ticket &></td> + </tr> + <tr> + <td class="labeltop"><&|/l&>Cc</&>:</td> + <td class="value"><& ShowGroupMembers, Group => $Ticket->Cc, Ticket => $Ticket &></td> + </tr> + <tr> + <td class="labeltop"><&|/l&>AdminCc</&>:</td> + <td class="value"><& ShowGroupMembers, Group => $Ticket->AdminCc, Ticket => $Ticket &></td> + </tr> +</table> +<%INIT> +</%INIT> +<%ARGS> +$Ticket => undef +</%ARGS> 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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 +</%ARGS> 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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 +</%ARGS> +<%INIT> +my $value = $QueueObj->Name; +$value = '#'. $QueueObj->id + unless defined $value && length $value; +</%INIT> 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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' ); +</%PERL> + +<&| /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' ); + +<span class="label"><&|/l&>Comments about this user</&>:</span><br /> +<b class="value"><% ($requestor->Comments || loc("No comment entered about this user")) %></b><br /> + +<span class="label"><&|/l, $rows &>This user's [_1] highest priority tickets</&>:</span> +<ul> +%while (my $w=$tickets->Next) { +%my $uri = RT::URI->new( $session{'CurrentUser'} ); +%$uri->FromObject($w); +<li class="value"><& /Elements/ShowLink, URI => $uri &></li> +%} +</ul> + +<&|/l&>Groups this user belongs to</&>:<br /> + +<& /Elements/ShowMemberships, UserObj => $requestor &> + +</&> + +% } +<%ARGS> +$Ticket=>undef +$DisplayPath => "/Ticket/Display.html" +$conditions => [] +</%ARGS> 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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 }}} + <table width="100%" class="ticket-summary"> + <tr> + <td valign="top" class="boxcontainer"> + <&| /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' ); + </td> + <td valign="top" class="boxcontainer"> +% 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' &> + <table> + <tr> + <td> + <form action="<%RT->Config->Get('WebPath')%>/Ticket/Display.html" method="post"> + <& /Ticket/Elements/Reminders, Ticket => $Ticket, ShowCompleted => 0 &> + <div align="right"><input type="submit" class="button" value="<&|/l&>Save</&>" /></div> + </form> + </td> + </tr> + </table> + </&> +% } + <&| /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 => '<a href="'. RT->Config->Get('WebPath'). '/Ticket/Graphs/index.html?id='.$Ticket->id.'">'.loc('Graph').'</a>' 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' ); + + </td> + </tr> + </table> +<%ARGS> +$Ticket => undef +$Attachments => undef +</%ARGS> + + + + 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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; +</%init> +<%ARGS> +$minutes +</%ARGS> + 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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 }}} +<div class="ticket-transaction <% $type_class %> <% $RowNum % 2 ? 'odd' : 'even' %>"> +% $m->callback( titlebar_cmd => \$titlebar_commands, Transaction => $Transaction, %ARGS, CallbackName => 'ModifyDisplay' ); + +<div class="ticket-transaction"> +% $m->callback( titlebar_cmd => \$titlebar_commands, Transaction => $Transaction, %ARGS, CallbackName => 'ModifyCommand' ); + <div class="metadata"> + <span class="type"> + <a name="txn-<% $Transaction->Id %>" href="<% $DisplayPath %>#txn-<% $Transaction->Id %>">#</a> + <% $LastTransaction ? '<a id="lasttrans" name="lasttrans"></a>' : ''|n %> + </span> + <span class="date"><% $transdate|n %></span> +% my $desc = $Transaction->BriefDescription; +% $m->callback( text => \$desc, Transaction => $Transaction, %ARGS, CallbackName => 'ModifyDisplay' ); + <span class="description"> + <& /Elements/ShowUser, User => $Transaction->CreatorObj &> - <% $TicketString %> <% $desc %> + </span> +% $m->callback( TimeTaken => \$TimeTaken, Transaction => $Transaction, %ARGS, CallbackName => 'ModifyTimeTaken' ); + <span class="time-taken"><% $TimeTaken %></span> + <span class="actions<% $titlebar_commands ? '': ' hidden'%>"><% $titlebar_commands |n %></span> + </div> + + <div class="content"> +% if ( $Transaction->CustomFieldValues->Count ) { + <& /Elements/ShowCustomFields, Object => $Transaction &> +% } +% $m->comp('ShowTransactionAttachments', %ARGS, Parent => 0) unless ($Collapsed ||!$ShowBody); + </div> + +</div> +</div> + +<%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 +</%ARGS> +<%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', +); + +</%ONCE> +<%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 .= + "[<a target=\"_blank\" href=\"$EmailRecordPath?id=" + . $Transaction->Ticket + . "&Transaction=" + . $Transaction->Id + . "&Attachment=" + . ( $Attachments->[0] && $Attachments->[0]->id ) + . '">' . loc('Show') . "</a>] "; + $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 .= + "[<a href=\"".$UpdatePath + . "?id=" . $Transaction->Ticket + . "&QuoteTransaction=" . $Transaction->Id + . "&Action=Respond\">" + . loc('Reply') + . "</a>] "; + } + if ( $can_modify || $ticket->CurrentUserHasRight('CommentOnTicket') ) { + $titlebar_commands .= + "[<a href=\"".$UpdatePath."?id=" + . $Transaction->Ticket + . "&QuoteTransaction=" + . $Transaction->Id + . "&Action=Comment\">" + . loc('Comment') . "</a>]"; + } + if ( $ticket->CurrentUserHasRight('ForwardMessage') ) { + $titlebar_commands .= + "[<a href=\"". $ForwardPath + . "?id=". $Transaction->Ticket + . "&QuoteTransaction=". $Transaction->Id + . "\">". loc('Forward') . "</a>]"; + } + if ( $can_modify + && RT->Config->Get('GnuPG')->{'Enable'} + && RT->Config->Get('GnuPG')->{'AllowEncryptDataInDB'} + && $ticket->CurrentUserHasRight('ForwardMessage') + ) { + $titlebar_commands .= + "[<a href=\"". $EncryptionPath + . "?id=". $Transaction->Id + . "\">". loc('Encrypt/Decrypt') . "</a>]"; + } + } +} +</%INIT> 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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 ) { +</%PERL> +<div class="downloadattachment"> +<a href="<% $AttachPath %>/<% $Transaction->Id %>/<% $message->Id %>/<% ($message->Filename ||'')| u%>"><&|/l&>Download</&> <% $message->Filename || loc('(untitled)') %></a> +% if ( $DownloadableHeaders && !$message->Filename && $message->ContentType =~ /text/ ) { + / <a href="<% $AttachPath %>/WithHeaders/<% $message->Id %>"><% loc('with headers') %></a> +% } +<br /> +<span class="downloadcontenttype"><% $message->ContentType %> <% $size_to_str->( $size ) %></span> +</div> +% } + +%# If there is sub-messages, open a dedicated div +% if ( scalar ( grep $_->__Value('Parent') == $message->id, @$Attachments ) ) { +<div class="messageattachments"> +% } else { +<div class="messagebody <% RT->Config->Get('PlainTextMono', $session{'CurrentUser'}) ? ' plain-text-white-space' : ''%>"> +% } +<%PERL> + +$render_attachment->( $message ); + +$m->comp( + $m->current_comp, + %ARGS, + Parent => $message->id, + ParentObj => $message +); + +</%PERL> +</div> +% } +<%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 +</%ARGS> +<%INIT> +my @DisplayHeaders=qw(_all); +if ( $Transaction->Type =~ /EmailRecord$/ ) { + @DisplayHeaders = qw(To Cc Bcc); +} + +# If the transaction has anything attached to it at all +elsif (!$ShowHeaders) { + @DisplayHeaders = qw(To From RT-Send-Cc Cc Bcc Date Subject); + 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('<p>'. loc( 'Text file is not shown because it is disabled in preferences.' ) .'</p>'); + return; + } + elsif ( $max_size && $message->ContentLength > $max_size ) { + $m->out('<p>'. loc( 'Message body not shown because it is too large.' ) .'</p>'); + return; + } + elsif ( $disposition ne 'inline' ) { + $m->out('<p>'. loc( 'Message body is not shown because sender requested not to inline it.' ) .'</p>'); + 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('<p>'. loc( 'Message body is not shown because sender requested not to inline it.' ) .'</p>'); + return; + } + + my $filename = $message->Filename || loc('(untitled)'); + $m->out('<img' + . ' alt="' + . $filename + . '"' + . ' title="' + . $filename + . '"' + . ' src="' + . $AttachPath . '/' + . $Transaction->Id . '/' + . $message->Id + . '/" />' ); + } + elsif ( $message->ContentLength > 0 ) { + $m->out( '<p>' . + loc( 'Message body not shown because it is not plain text.' ) . + '</p>' + ); + } +}; + +</%INIT> 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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 }}} +<div class="unread-messages"> +<&| /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 <a href="[_1]">jump to the first unread message</a> or <a href="[_2]">jump to the first unread message and mark all messages as seen</a>.</&> +</&> +</div> +<%ARGS> +$Ticket +</%ARGS> +<%INIT> +return unless (RT->Config->Get( 'ShowUnreadMessageNotifications', $session{'CurrentUser'})); +my $txn = $Ticket->SeenUpTo or return; +</%INIT> 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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) { +<b><&|/l&>(Will not be sent email)</&></b> +% } + +<%ARGS> +$User => undef +$Ticket => undef +</%ARGS> 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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}; +} + +</%INIT> + + +<%ARGS> +$Ticket => undef +$subtabs => undef +$current_tab => '' +$current_subtab => '' +$Title => undef +$RowsPerPage => undef +</%ARGS> 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 +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 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 }}} +<tr><td class="label"><&|/l&>One-time Cc</&>:</td><td><& /Elements/EmailInput, Name => 'UpdateCc', Size => '60', Default => $ARGS{UpdateCc} &> +<input type="hidden" id="UpdateIgnoreAddressCheckboxes" name="UpdateIgnoreAddressCheckboxes" value="0"> + <br /> + +%foreach my $addr ( keys %txn_addresses) { +% next if ( grep {$addr eq $_} @req_addresses ); +<input +id="UpdateCc-<%$addr%>" +name="UpdateCc-<%$addr%>" + type="checkbox" + onClick="checkboxToInput('UpdateCc', 'UpdateCc-<%$addr%>','<%$txn_addresses{$addr}->format%>' ); $(UpdateIgnoreAddressCheckboxes).value=1" + <% $ARGS{'UpdateCc-'.$addr} ? 'checked="checked"' : ''%> > <& /Elements/ShowUser, Address => $txn_addresses{$addr}&> +%} +</td></tr> +<tr><td class="label"><&|/l&>One-time Bcc</&>:</td><td><& /Elements/EmailInput, Name => 'UpdateBcc', Size => '60', Default => $ARGS{UpdateBcc} &><br /> +%foreach my $addr ( keys %txn_addresses) { +% next if ( grep {$addr eq $_} @req_addresses ); +<input + id="UpdateBcc-<%$addr%>" + name="UpdateBcc-<%$addr%>" + type="checkbox" + onClick="checkboxToInput('UpdateBcc', 'UpdateBcc-<%$addr%>','<%$txn_addresses{$addr}->format%>' ); $(UpdateIgnoreAddressCheckboxes).value=1" + <% $ARGS{'UpdateBcc-'.$addr} ? 'checked="checked"' : ''%>> +<& /Elements/ShowUser, Address => $txn_addresses{$addr}&> +%} +</td></tr> +<%args> +$TicketObj +</%args> +<%init> +my %txn_addresses = %{$TicketObj->TransactionAddresses}; +my @req_addresses = split /,/, $TicketObj->RequestorAddresses; +</%init> |