From e70abd21bab68b23488f7ef1ee2e693a3b365691 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 18 May 2010 18:49:59 +0000 Subject: import rt 3.8.8 --- rt/share/html/Ticket/Elements/EditCustomFields | 2 + rt/share/html/Ticket/Elements/EditDates | 1 + .../Ticket/Elements/EditTransactionCustomFields | 2 + rt/share/html/Ticket/Elements/PreviewScrips | 6 +- rt/share/html/Ticket/Elements/ShowAttachments | 17 +++- rt/share/html/Ticket/Elements/ShowDates | 1 + rt/share/html/Ticket/Elements/ShowGroupMembers | 4 +- rt/share/html/Ticket/Elements/ShowMessageStanza | 3 +- rt/share/html/Ticket/Elements/ShowPeople | 4 +- rt/share/html/Ticket/Elements/ShowSummary | 111 +++++++++++---------- rt/share/html/Ticket/Elements/ShowTransaction | 2 + .../Ticket/Elements/ShowTransactionAttachments | 7 +- rt/share/html/Ticket/Elements/Tabs | 24 +++-- rt/share/html/Ticket/Elements/UpdateCc | 26 +++-- 14 files changed, 134 insertions(+), 76 deletions(-) (limited to 'rt/share/html/Ticket/Elements') diff --git a/rt/share/html/Ticket/Elements/EditCustomFields b/rt/share/html/Ticket/Elements/EditCustomFields index c3a44ee22..5478c7871 100755 --- a/rt/share/html/Ticket/Elements/EditCustomFields +++ b/rt/share/html/Ticket/Elements/EditCustomFields @@ -45,6 +45,7 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} +% $m->callback( %ARGS, CallbackName => 'BeforeCustomFields' ); % my $i = 0; % while ( my $CustomField = $CustomFields->Next ) { @@ -85,6 +86,7 @@ % }
+% $m->callback( %ARGS, CallbackName => 'AfterCustomFields', TicketObj => $TicketObj, QueueObj => $QueueObj ); <%INIT> my $CustomFields; diff --git a/rt/share/html/Ticket/Elements/EditDates b/rt/share/html/Ticket/Elements/EditDates index fc17cdbd4..e6f724f7b 100755 --- a/rt/share/html/Ticket/Elements/EditDates +++ b/rt/share/html/Ticket/Elements/EditDates @@ -70,6 +70,7 @@ <& /Elements/SelectDate, menu_prefix => 'Due', current => 0 &> (<% $TicketObj->DueObj->AsString %>) +% $m->callback( %ARGS, CallbackName => 'EndOfList', Ticket => $TicketObj ); <%ARGS> $TicketObj => undef diff --git a/rt/share/html/Ticket/Elements/EditTransactionCustomFields b/rt/share/html/Ticket/Elements/EditTransactionCustomFields index 8bf939db6..a58dded9b 100644 --- a/rt/share/html/Ticket/Elements/EditTransactionCustomFields +++ b/rt/share/html/Ticket/Elements/EditTransactionCustomFields @@ -45,6 +45,7 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} +% $m->callback( CallbackName => 'BeforeTransactionCustomFields', TicketObj => $TicketObj, QueueObj => $QueueObj, NamePrefix => $NamePrefix ); % if ($CustomFields->Count) { % while (my $CF = $CustomFields->Next()) { % next unless $CF->CurrentUserHasRight('ModifyCustomField'); @@ -60,6 +61,7 @@ % } % } +% $m->callback( CallbackName => 'AfterTransactionCustomFields', TicketObj => $TicketObj, QueueObj => $QueueObj, NamePrefix => $NamePrefix ); <%INIT> my $CustomFields; diff --git a/rt/share/html/Ticket/Elements/PreviewScrips b/rt/share/html/Ticket/Elements/PreviewScrips index 7480adecf..d376f5d08 100755 --- a/rt/share/html/Ticket/Elements/PreviewScrips +++ b/rt/share/html/Ticket/Elements/PreviewScrips @@ -69,7 +69,11 @@ my @non_recipients = @{ $squelch{'EmailAddresses'} }; %my @addresses = $scrip->ActionObj->Action->$type(); % } diff --git a/rt/share/html/Ticket/Elements/ShowAttachments b/rt/share/html/Ticket/Elements/ShowAttachments index 72298d79f..ab0d92112 100755 --- a/rt/share/html/Ticket/Elements/ShowAttachments +++ b/rt/share/html/Ticket/Elements/ShowAttachments @@ -61,11 +61,22 @@ my $size = $rev->ContentLength; if ($size) { - if ($size > 1024) { - $size = int($size/102.4)/10 . "k"; + my $kb = int($size/102.4) / 10; + my $units = RT->Config->Get('AttachmentUnits'); + + if (!defined($units)) { + if ($size > 1024) { + $size = $kb . "k"; + } + else { + $size = $size . "b"; + } + } + elsif ($units eq 'k') { + $size = $kb . "k"; } else { - $size = $size ."b"; + $size = $size . "b"; } diff --git a/rt/share/html/Ticket/Elements/ShowDates b/rt/share/html/Ticket/Elements/ShowDates index d309907dc..07140c2e4 100755 --- a/rt/share/html/Ticket/Elements/ShowDates +++ b/rt/share/html/Ticket/Elements/ShowDates @@ -84,6 +84,7 @@ <% $UpdatedString | h %> % } +% $m->callback( %ARGS, CallbackName => 'EndOfList', TicketObj => $Ticket ); <%ARGS> $Ticket => undef diff --git a/rt/share/html/Ticket/Elements/ShowGroupMembers b/rt/share/html/Ticket/Elements/ShowGroupMembers index a15f850b4..6597cc543 100644 --- a/rt/share/html/Ticket/Elements/ShowGroupMembers +++ b/rt/share/html/Ticket/Elements/ShowGroupMembers @@ -50,7 +50,9 @@ % my $Users = $Group->UserMembersObj( Recursively => $Recursively ); % while ( my $user = $Users->Next ) { <& /Elements/ShowUser, User => $user, Ticket => $Ticket &> -<& /Elements/ShowUserEmailFrequency, User => $user, Ticket => $Ticket &>
+<& /Elements/ShowUserEmailFrequency, User => $user, Ticket => $Ticket &> +% $m->callback( User => $user, Ticket => $Ticket, %ARGS, CallbackName => 'AboutThisUser' ); +
% } % my $Groups = $Group->GroupMembersObj( Recursively => $Recursively ); % $Groups->LimitToUserDefinedGroups; diff --git a/rt/share/html/Ticket/Elements/ShowMessageStanza b/rt/share/html/Ticket/Elements/ShowMessageStanza index 0d4fe6154..9d2f21120 100755 --- a/rt/share/html/Ticket/Elements/ShowMessageStanza +++ b/rt/share/html/Ticket/Elements/ShowMessageStanza @@ -48,7 +48,8 @@ <%perl> if ( ref $Message ) { $m->out('
') if $plain_text_pre && !$Depth && !$plain_text_mono;
-    $m->out( qq{
} ); + $m->out( qq{
} ); + my @stack; my $para = ''; diff --git a/rt/share/html/Ticket/Elements/ShowPeople b/rt/share/html/Ticket/Elements/ShowPeople index ddd2e3c6f..1f0e5319e 100755 --- a/rt/share/html/Ticket/Elements/ShowPeople +++ b/rt/share/html/Ticket/Elements/ShowPeople @@ -50,7 +50,9 @@ <&|/l&>Owner: % my $owner = $Ticket->OwnerObj; <& /Elements/ShowUser, User => $owner, Ticket => $Ticket &> - <& /Elements/ShowUserEmailFrequency, User => $owner, Ticket => $Ticket &> + <& /Elements/ShowUserEmailFrequency, User => $owner, Ticket => $Ticket &> +% $m->callback( User => $owner, Ticket => $Ticket, %ARGS, CallbackName => 'AboutThisUser' ); + <&|/l&>Requestors: diff --git a/rt/share/html/Ticket/Elements/ShowSummary b/rt/share/html/Ticket/Elements/ShowSummary index 4c2d54e5e..21c53c594 100755 --- a/rt/share/html/Ticket/Elements/ShowSummary +++ b/rt/share/html/Ticket/Elements/ShowSummary @@ -45,73 +45,82 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} - - - + +
- <&| /Widgets/TitleBox, title => loc('The Basics'), - title_href => RT->Config->Get('WebPath')."/Ticket/Modify.html?id=".$Ticket->Id, - class => 'ticket-info-basics' &> - <& /Ticket/Elements/ShowBasics, Ticket => $Ticket &> - + + + - + - -
+% $m->callback( %ARGS, CallbackName => 'LeftColumnTop' ); + + <&| /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('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 &> + <&| /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 &> + <& /Ticket/Elements/ShowRequestor, Ticket => $Ticket &> % $m->callback( %ARGS, CallbackName => 'LeftColumn' ); - + + + +% $m->callback( %ARGS, CallbackName => 'RightColumnTop' ); + % 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' &> - - -
+ <&|/Widgets/TitleBox, title => loc("Reminders"), + title_href => RT->Config->Get('WebPath')."/Ticket/Reminders.html?id=".$Ticket->Id, + class => 'ticket-info-reminders', + &> + - -
- <& /Ticket/Elements/Reminders, Ticket => $Ticket, ShowCompleted => 0 &> -
+ <& /Ticket/Elements/Reminders, Ticket => $Ticket, ShowCompleted => 0 &> +
-
- +
+ % } - <&| /Widgets/TitleBox, title => loc("Dates"), - title_href => RT->Config->Get('WebPath')."/Ticket/ModifyDates.html?id=".$Ticket->Id, - class => 'ticket-info-dates' &> - <& /Ticket/Elements/ShowDates, Ticket => $Ticket &> - + + <&| /Widgets/TitleBox, title => loc("Dates"), + title_href => RT->Config->Get('WebPath')."/Ticket/ModifyDates.html?id=".$Ticket->Id, + class => 'ticket-info-dates', + &> + <& /Ticket/Elements/ShowDates, Ticket => $Ticket &> + + % my (@extra); % push @extra, titleright_raw => ''.loc('Graph').'' unless RT->Config->Get('DisableGraphViz'); - <&| /Widgets/TitleBox, title => loc('Links'), - title_href => RT->Config->Get('WebPath')."/Ticket/ModifyLinks.html?id=".$Ticket->Id, - class => 'ticket-info-links', @extra &> - <& /Elements/ShowLinks, Ticket => $Ticket &> - + <&| /Widgets/TitleBox, title => loc('Links'), + title_href => RT->Config->Get('WebPath')."/Ticket/ModifyLinks.html?id=".$Ticket->Id, + class => 'ticket-info-links', + @extra, + &> + <& /Elements/ShowLinks, Ticket => $Ticket &> + + % $m->callback( %ARGS, CallbackName => 'RightColumn' ); -
+
<%ARGS> $Ticket => undef $Attachments => undef - - - - diff --git a/rt/share/html/Ticket/Elements/ShowTransaction b/rt/share/html/Ticket/Elements/ShowTransaction index a533323a9..6ccbb0c89 100755 --- a/rt/share/html/Ticket/Elements/ShowTransaction +++ b/rt/share/html/Ticket/Elements/ShowTransaction @@ -55,11 +55,13 @@ # <% $LastTransaction ? '' : ''|n %> +% $m->callback( Transaction => $Transaction, %ARGS, CallbackName => 'AfterAnchor' ); <% $transdate|n %> % my $desc = $Transaction->BriefDescription; % $m->callback( text => \$desc, Transaction => $Transaction, %ARGS, CallbackName => 'ModifyDisplay' ); <& /Elements/ShowUser, User => $Transaction->CreatorObj &> - <% $TicketString %> <% $desc %> +% $m->callback( Transaction => $Transaction, %ARGS, CallbackName => 'AfterDescription' ); % $m->callback( TimeTaken => \$TimeTaken, Transaction => $Transaction, %ARGS, CallbackName => 'ModifyTimeTaken' ); <% $TimeTaken %> diff --git a/rt/share/html/Ticket/Elements/ShowTransactionAttachments b/rt/share/html/Ticket/Elements/ShowTransactionAttachments index 9c40b28da..a8cdfc11c 100644 --- a/rt/share/html/Ticket/Elements/ShowTransactionAttachments +++ b/rt/share/html/Ticket/Elements/ShowTransactionAttachments @@ -67,7 +67,10 @@ foreach my $message ( grep $_->__Value('Parent') == $Parent, @$Attachments ) { % if ( $DownloadableHeaders && !$message->Filename && $message->ContentType =~ /text/ ) { / <% loc('with headers') %> % } -
+ +% $m->callback(CallbackName => 'AfterDownloadLinks', ARGSRef => \%ARGS, Ticket => $Ticket, Transaction => $Transaction, Attachment => $message); + +
<% $message->ContentType %> <% $size_to_str->( $size ) %>
% } @@ -76,7 +79,7 @@ foreach my $message ( grep $_->__Value('Parent') == $Parent, @$Attachments ) { % if ( scalar ( grep $_->__Value('Parent') == $message->id, @$Attachments ) ) {
% } else { -
+
% } <%PERL> diff --git a/rt/share/html/Ticket/Elements/Tabs b/rt/share/html/Ticket/Elements/Tabs index 7deb8c18d..a9e697a9f 100755 --- a/rt/share/html/Ticket/Elements/Tabs +++ b/rt/share/html/Ticket/Elements/Tabs @@ -75,11 +75,13 @@ if ($Ticket) { # 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') - }; + if ( $item_map->{first} ) { + $searchtabs->{'_a'} = { + class => "nav", + path => "Ticket/Display.html?id=" . $item_map->{first}, + title => '<< ' . loc('First') + }; + } $searchtabs->{"_b"} = { class => "nav", path => "Ticket/Display.html?id=" @@ -96,11 +98,13 @@ if ($Ticket) { . $item_map->{ $Ticket->Id }->{next}, title => loc('Next') . ' >' }; - $searchtabs->{'e'} = { - class => "nav", - path => "Ticket/Display.html?id=" . $item_map->{last}, - title => loc('Last') . ' >>' - }; + if ( $item_map->{last} ) { + $searchtabs->{'e'} = { + class => "nav", + path => "Ticket/Display.html?id=" . $item_map->{last}, + title => loc('Last') . ' >>' + }; + } } } diff --git a/rt/share/html/Ticket/Elements/UpdateCc b/rt/share/html/Ticket/Elements/UpdateCc index 2538c82df..2559e5652 100644 --- a/rt/share/html/Ticket/Elements/UpdateCc +++ b/rt/share/html/Ticket/Elements/UpdateCc @@ -49,24 +49,32 @@
-%foreach my $addr ( keys %txn_addresses) { -% next if ( grep {$addr eq $_} @req_addresses ); +%if (scalar @one_time_Ccs) { +(<&|/l&>check to add) +%} +%foreach my $addr ( @one_time_Ccs ) { format; +% $clean_addr =~ s/'/\\'/g; + onClick="checkboxToInput('UpdateCc', 'UpdateCc-<%$addr%>','<%$clean_addr%>' ); $(UpdateIgnoreAddressCheckboxes).value=1" <% $ARGS{'UpdateCc-'.$addr} ? 'checked="checked"' : ''%> > <& /Elements/ShowUser, Address => $txn_addresses{$addr}&> %} <&|/l&>One-time Bcc:<& /Elements/EmailInput, Name => 'UpdateBcc', Size => '60', Default => $ARGS{UpdateBcc} &>
-%foreach my $addr ( keys %txn_addresses) { -% next if ( grep {$addr eq $_} @req_addresses ); +%if (scalar @one_time_Ccs) { +(<&|/l&>check to add) +%} +%foreach my $addr ( @one_time_Ccs ) { format; +% $clean_addr =~ s/'/\\'/g; + onClick="checkboxToInput('UpdateBcc', 'UpdateBcc-<%$addr%>','<%$clean_addr%>' ); $(UpdateIgnoreAddressCheckboxes).value=1" <% $ARGS{'UpdateBcc-'.$addr} ? 'checked="checked"' : ''%>> <& /Elements/ShowUser, Address => $txn_addresses{$addr}&> %} @@ -77,4 +85,10 @@ $TicketObj <%init> my %txn_addresses = %{$TicketObj->TransactionAddresses}; my @req_addresses = split /,/, $TicketObj->RequestorAddresses; +my @one_time_Ccs; + +foreach my $addr ( keys %txn_addresses) { + next if ( grep {$addr eq $_} @req_addresses ); + push @one_time_Ccs,$addr; +} -- cgit v1.2.1