diff options
Diffstat (limited to 'rt/html')
56 files changed, 417 insertions, 183 deletions
diff --git a/rt/html/Admin/Elements/EditCustomField b/rt/html/Admin/Elements/EditCustomField index 7baed168b..de3094bb0 100644 --- a/rt/html/Admin/Elements/EditCustomField +++ b/rt/html/Admin/Elements/EditCustomField @@ -59,7 +59,7 @@ <& /Admin/Elements/AddCustomFieldValue, CustomField => $CustomFieldObj &> </font> % } -<&/Elements/Submit&> +<&/Elements/Submit, Label => loc('Create') &> </FORM> diff --git a/rt/html/Admin/Elements/EditScrip b/rt/html/Admin/Elements/EditScrip index 1f186c233..9b1ad4a47 100644 --- a/rt/html/Admin/Elements/EditScrip +++ b/rt/html/Admin/Elements/EditScrip @@ -92,7 +92,7 @@ </TD> </TR> -<& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> +<& /Elements/Submit, Label => loc('Create'), Reset => 1 &> </FORM> <%init> my (@actions); @@ -114,6 +114,7 @@ if ( $id eq 'new' ) { ); if ( defined $retval ) { push @actions, $msg; + $id = $scrip->id; } else { Abort( $msg); diff --git a/rt/html/Admin/Elements/EditTemplates b/rt/html/Admin/Elements/EditTemplates index 12677ca78..2d13457c2 100644 --- a/rt/html/Admin/Elements/EditTemplates +++ b/rt/html/Admin/Elements/EditTemplates @@ -54,7 +54,7 @@ </TABLE> % } -<& /Elements/Submit &> +<& /Elements/Submit, Label => loc('Delete Template') &> </FORM> <%INIT> diff --git a/rt/html/Admin/Elements/ModifyQueue b/rt/html/Admin/Elements/ModifyQueue index e5761df35..36f9ce17f 100644 --- a/rt/html/Admin/Elements/ModifyQueue +++ b/rt/html/Admin/Elements/ModifyQueue @@ -63,7 +63,7 @@ </TD> </TR> </TABLE> -<& /Elements/Submit &> +<& /Elements/Submit, Label => loc('Save Changes') &> </form> <& /Elements/TitleBoxEnd &> diff --git a/rt/html/Admin/Elements/ModifyUser b/rt/html/Admin/Elements/ModifyUser index 876e8a71b..2faefefaa 100644 --- a/rt/html/Admin/Elements/ModifyUser +++ b/rt/html/Admin/Elements/ModifyUser @@ -84,7 +84,7 @@ <BR> <&|/l&>Country</&>: <input name="Country" value="<%$UserObj->Country%>"> <BR> -<& /Elements/Submit &> +<& /Elements/Submit, Label => loc('Save Changes') &> </form> <& /Elements/TitleBoxEnd &> diff --git a/rt/html/Admin/Elements/SelectNewGroupMembers b/rt/html/Admin/Elements/SelectNewGroupMembers index e5c28e909..256d15b6c 100644 --- a/rt/html/Admin/Elements/SelectNewGroupMembers +++ b/rt/html/Admin/Elements/SelectNewGroupMembers @@ -42,8 +42,14 @@ <%INIT> my $users = new RT::Users($session{'CurrentUser'}); -$users->Limit(FIELD => 'id', VALUE => $RT::SystemUser->id, OPERATOR => '!=' ); -$users->Limit(FIELD => 'id', VALUE => $RT::Nobody->id, OPERATOR => '!=' ); +$users->Limit(FIELD => 'id', + VALUE => $RT::SystemUser->id, + OPERATOR => '!=', + ENTRYAGGREGATOR =>'AND'); +$users->Limit(FIELD => 'id', + VALUE => $RT::Nobody->id, + OPERATOR => '!=', + ENTRYAGGREGATOR =>'AND'); $users->LimitToPrivileged(); my $groups = new RT::Groups($session{'CurrentUser'}); diff --git a/rt/html/Admin/Elements/UserTabs b/rt/html/Admin/Elements/UserTabs index 764fdfcb5..8d8f769a4 100644 --- a/rt/html/Admin/Elements/UserTabs +++ b/rt/html/Admin/Elements/UserTabs @@ -21,54 +21,57 @@ %# %# %# END LICENSE BLOCK -<& /Admin/Elements/Tabs, +<& /Admin/Elements/Tabs, subtabs => $tabs, - current_tab => 'Admin/Users/', - current_subtab => $current_subtab, + current_tab => 'Admin/Users/', + current_subtab => $current_tab, Title => $Title &> <%INIT> my $tabs; -my $subtabs; if ($id) { -$tabs->{'this'} = { title => eval { $UserObj->Name }, - - path => "Admin/Users/Modify.html?id=".$id, -subtabs => { - Queues => { title => loc('Basics'), - path => "Admin/Users/Modify.html?id=".$id - }, -# Scrips => { title => loc('Rights'), -# path => "Admin/Users/Rights.html?id=".$id -# } - - } + $tabs->{'this'} = { + title => eval { $UserObj->Name }, + path => "Admin/Users/Modify.html?id=".$id, + current_subtab => $current_tab, + subtabs => { + A => { title => loc('Basics'), + path => "Admin/Users/Modify.html?id=".$id + }, + } + } } + +if ( $session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'AdminUsers') ) { + $tabs->{"A"} = { + title => loc('Select user'), + path => "Admin/Users/", + }; + $tabs->{"B"} = { + title => loc('New user'), + path => "Admin/Users/Modify.html?Create=1", + separator => 1, + }; } -if ($session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'AdminUsers')) { - $tabs->{"A"} = { title => loc('Select user'), - path => "Admin/Users/", - }; - $tabs->{"B"} = { title => loc('New user'), - path => "Admin/Users/Modify.html?Create=1", - separator => 1, - }; + +# Now let callbacks add their extra tabs +$m->comp('/Elements/Callback', tabs => $tabs, %ARGS); + +foreach my $tab ( sort keys %{$tabs->{'this'}->{'subtabs'}} ) { + if ( $tabs->{'this'}->{'subtabs'}->{$tab}->{'path'} eq $current_tab ) { + $tabs->{'this'}->{"current_subtab"} = $current_tab; + $tabs->{'this'}->{'subtabs'}->{$tab}->{"current_subtab"} = $current_subtab; + $tabs->{'this'}->{'subtabs'}->{$tab}->{"subtabs"} = $subtabs; + } } - # Now let callbacks add their extra tabs - $m->comp('/Elements/Callback', tabs => $tabs, %ARGS); - -foreach my $tab ( sort keys %{$tabs} ) { - if ( $tabs->{$tab}->{'path'} eq $current_subtab ) { - $tabs->{$tab}->{"current_subtab"} = $current_subtab; - } -} +$current_tab = "Admin/Users/Modify.html?id=".$id if $id; + </%INIT> - - <%ARGS> $UserObj => undef $id => undef $current_tab => undef +$subtabs => undef $current_subtab => undef $Title => undef </%ARGS> diff --git a/rt/html/Admin/Global/GroupRights.html b/rt/html/Admin/Global/GroupRights.html index 150e83f43..7bb8c4d57 100644 --- a/rt/html/Admin/Global/GroupRights.html +++ b/rt/html/Admin/Global/GroupRights.html @@ -81,7 +81,7 @@ </TABLE> <& /Elements/TitleBoxEnd &> - <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> + <& /Elements/Submit, Label => loc('Modify Group Rights'), Reset => 1 &> </FORM> diff --git a/rt/html/Admin/Global/Template.html b/rt/html/Admin/Global/Template.html index 71f77e9dd..742c48901 100644 --- a/rt/html/Admin/Global/Template.html +++ b/rt/html/Admin/Global/Template.html @@ -42,7 +42,7 @@ <& /Admin/Elements/ModifyTemplate, Name => $TemplateObj->Name, Description => $TemplateObj->Description, Content => $TemplateObj->Content &> -<& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> +<& /Elements/Submit, Label => loc('Save Changes'), Reset => 1 &> </FORM> diff --git a/rt/html/Admin/Global/UserRights.html b/rt/html/Admin/Global/UserRights.html index aee82d1f4..abd748bff 100644 --- a/rt/html/Admin/Global/UserRights.html +++ b/rt/html/Admin/Global/UserRights.html @@ -50,7 +50,7 @@ </TABLE> <& /Elements/TitleBoxEnd &> - <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> + <& /Elements/Submit, Label => loc('Modify User Rights'), Reset => 1 &> </FORM> diff --git a/rt/html/Admin/Groups/GroupRights.html b/rt/html/Admin/Groups/GroupRights.html index 6220259d3..c1223078e 100644 --- a/rt/html/Admin/Groups/GroupRights.html +++ b/rt/html/Admin/Groups/GroupRights.html @@ -69,7 +69,7 @@ </TABLE> <& /Elements/TitleBoxEnd &> - <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> + <& /Elements/Submit, Label => loc('Modify Group Rights'), Reset => 1 &> </FORM> diff --git a/rt/html/Admin/Groups/Members.html b/rt/html/Admin/Groups/Members.html index 6e669666f..e0c8ddb73 100644 --- a/rt/html/Admin/Groups/Members.html +++ b/rt/html/Admin/Groups/Members.html @@ -77,7 +77,7 @@ </TR> </TABLE> <& /Elements/TitleBoxEnd &> -<& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> +<& /Elements/Submit, Label => loc('Modify Members'), Reset => 1 &> </form> diff --git a/rt/html/Admin/Groups/Modify.html b/rt/html/Admin/Groups/Modify.html index c5e91588e..499781937 100644 --- a/rt/html/Admin/Groups/Modify.html +++ b/rt/html/Admin/Groups/Modify.html @@ -52,7 +52,7 @@ <INPUT TYPE=CHECKBOX NAME="Enabled" VALUE="1" <%$EnabledChecked%>> <&|/l&>Enabled (Unchecking this box disables this group)</&><BR> </TR> </TABLE> -<& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> +<& /Elements/Submit, Label => loc('Create'), Reset => 1 &> </form> <%INIT> diff --git a/rt/html/Admin/Groups/UserRights.html b/rt/html/Admin/Groups/UserRights.html index 0a87ef860..8b4efd21a 100644 --- a/rt/html/Admin/Groups/UserRights.html +++ b/rt/html/Admin/Groups/UserRights.html @@ -51,7 +51,7 @@ </TABLE> <& /Elements/TitleBoxEnd &> - <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> + <& /Elements/Submit, Label => loc('Modify User Rights'), Reset => 1 &> </FORM> diff --git a/rt/html/Admin/Groups/index.html b/rt/html/Admin/Groups/index.html index 57c86c90e..f3ae2305a 100644 --- a/rt/html/Admin/Groups/index.html +++ b/rt/html/Admin/Groups/index.html @@ -32,12 +32,24 @@ <LI><A HREF="Modify.html?id=<%$Group->id%>"><%$Group->Name || loc('(empty)')%></a><BR> %} </UL> +<br><br> +<FORM METHOD=POST ACTION="<% $RT::WebPath %>/Admin/Groups/index.html"> +<input type="checkbox" name="FindDisabledGroups"> <&|/l&>Include disabled groups in listing.</&> +<BR> +<div align=right><input type=submit value="<&|/l&>Go!</&>"></div> +</FORM> <%INIT> my $Groups = RT::Groups->new($session{'CurrentUser'}); + +if ($FindDisabledGroups) { + $Groups->{'find_disabled_rows'} = 1; +} + $Groups->LimitToUserDefinedGroups(); my $title = loc('Select a group'); </%INIT> <%ARGS> +$FindDisabledGroups => 0 </%ARGS> diff --git a/rt/html/Admin/Queues/GroupRights.html b/rt/html/Admin/Queues/GroupRights.html index a1ac709e1..df12f449f 100644 --- a/rt/html/Admin/Queues/GroupRights.html +++ b/rt/html/Admin/Queues/GroupRights.html @@ -82,7 +82,7 @@ % } </TABLE> - <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> + <& /Elements/Submit, Label => loc('Modify Group Rights'), Reset => 1 &> </FORM> diff --git a/rt/html/Admin/Queues/Modify.html b/rt/html/Admin/Queues/Modify.html index 46608eba6..8fa278bf6 100644 --- a/rt/html/Admin/Queues/Modify.html +++ b/rt/html/Admin/Queues/Modify.html @@ -86,7 +86,7 @@ </TR> </TABLE> -<& /Elements/Submit &> +<& /Elements/Submit, Label => loc('Save Changes') &> </form> diff --git a/rt/html/Admin/Queues/Scrip.html b/rt/html/Admin/Queues/Scrip.html index edbfcd66b..dad330f84 100644 --- a/rt/html/Admin/Queues/Scrip.html +++ b/rt/html/Admin/Queues/Scrip.html @@ -51,7 +51,7 @@ unless($QueueObj->id) { if ($id) { $current_subtab = "Admin/Queues/Scrip.html?id=".$id."&Queue=".$QueueObj->id; $title = loc("Modify a scrip for queue [_1]", $QueueObj->Name); - $subtabs->{"C"} = { title => loc("Scrip #[_1]",$QueueObj->id), + $subtabs->{"C"} = { title => loc("Scrip #[_1]",$id), path => "Admin/Queues/Scrip.html?id=$id&Queue=".$QueueObj->id }; } else { $current_subtab = "Admin/Queues/Scrip.html?create=1&Queue=".$QueueObj->id; diff --git a/rt/html/Admin/Queues/Template.html b/rt/html/Admin/Queues/Template.html index 994de6108..0e72e5d05 100644 --- a/rt/html/Admin/Queues/Template.html +++ b/rt/html/Admin/Queues/Template.html @@ -23,7 +23,7 @@ %# END LICENSE BLOCK <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/QueueTabs, id => $Queue, - QueueObj => $TemplateObj->QueueObj, + QueueObj => $QueueObj, current_tab => 'Admin/Queues/Templates.html?id='.$Queue, current_subtab => $current_subtab, subtabs => $subtabs, @@ -41,12 +41,15 @@ <INPUT TYPE=HIDDEN name="Queue" value="<%$Queue%>"> <& /Admin/Elements/ModifyTemplate, Name => $TemplateObj->Name, Description => $TemplateObj->Description, Content => $TemplateObj->Content &> -<& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> +<& /Elements/Submit, Label => loc('Create'), Reset => 1 &> </FORM> <%INIT> +my $QueueObj = new RT::Queue($session{'CurrentUser'}); +$QueueObj->Load($Queue); + my $TemplateObj = new RT::Template($session{'CurrentUser'}); my ($title, @results, $current_subtab); diff --git a/rt/html/Admin/Queues/UserRights.html b/rt/html/Admin/Queues/UserRights.html index aeb55c70b..123a46f8b 100644 --- a/rt/html/Admin/Queues/UserRights.html +++ b/rt/html/Admin/Queues/UserRights.html @@ -50,7 +50,7 @@ % } </TABLE> - <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> + <& /Elements/Submit, Label => loc('Modify User Rights'), Reset => 1 &> </FORM> diff --git a/rt/html/Admin/Users/Modify.html b/rt/html/Admin/Users/Modify.html index b424ae961..5fb941114 100644 --- a/rt/html/Admin/Users/Modify.html +++ b/rt/html/Admin/Users/Modify.html @@ -25,7 +25,7 @@ <& /Admin/Elements/UserTabs, id => $id, UserObj => $UserObj, - current_subtab => $current_tab, + current_tab => $current_tab, Title => $title &> <& /Elements/ListActions, actions => \@results &> @@ -197,7 +197,7 @@ </TR> </TABLE> -<& /Elements/Submit &> +<& /Elements/Submit, Label => loc('Save Changes') &> </form> <%INIT> @@ -243,8 +243,6 @@ else { $Create = 1; } - - } diff --git a/rt/html/Approvals/index.html b/rt/html/Approvals/index.html index b4156f344..1d63a93d6 100644 --- a/rt/html/Approvals/index.html +++ b/rt/html/Approvals/index.html @@ -27,7 +27,7 @@ <& /Elements/ListActions, actions => \@actions &> <form method="post"> <& Elements/PendingMyApproval, %ARGS &> -<& /Elements/Submit &> +<& /Elements/Submit, Label => loc('Show Approvals') &> </form> <%init> diff --git a/rt/html/Elements/Header b/rt/html/Elements/Header index 0fd91a2e2..23ab5f781 100644 --- a/rt/html/Elements/Header +++ b/rt/html/Elements/Header @@ -58,7 +58,6 @@ ONLOAD=" % } else { <&|/l&>Not logged in.</&> % } -</font> </td> </tr> </table> diff --git a/rt/html/Elements/Menu b/rt/html/Elements/Menu index 963be13bf..5cc8ab773 100644 --- a/rt/html/Elements/Menu +++ b/rt/html/Elements/Menu @@ -56,7 +56,7 @@ % } else { % $sep=0; % } -<li style="<%$style%>"><A HREF="<%$RT::WebPath%>/<%$toptabs->{$tab}->{'path'}|n%>" style="font-size: <%$size%>;" class="<%$class%>" +<li style="<%$style%>"><A HREF="<%($toptabs->{$tab}->{'path'} !~ m/^https?:/i) ? $RT::WebPath."/" : ""%><%$toptabs->{$tab}->{'path'}|n%>" style="font-size: <%$size%>;" class="<%$class%>" <%($class eq 'currenttopnav') ? "name='focus'" : ""|n %> <% !$level && "accesskey='".$accesskey++."'" |n%>><% $toptabs->{$tab}->{'title'}%></A> %# Second-level items diff --git a/rt/html/Elements/MessageBox b/rt/html/Elements/MessageBox index 32f422206..2f241a158 100644 --- a/rt/html/Elements/MessageBox +++ b/rt/html/Elements/MessageBox @@ -21,7 +21,7 @@ %# %# %# END LICENSE BLOCK -<TEXTAREA COLS=<%$Width%> ROWS=15 WRAP=<%$Wrap%> NAME="<%$Name%>"><& /Elements/Callback, %ARGS &><% $Default %><%$message%><%$IncludeSignature ? $signature : ''%></TEXTAREA> +<TEXTAREA COLS=<%$Width%> ROWS=<%$Height%> WRAP=<%$Wrap%> NAME="<%$Name%>"><& /Elements/Callback, %ARGS &><% $Default %><%$message%><%$IncludeSignature ? $signature : ''%></TEXTAREA> <%INIT> my ($message); @@ -33,7 +33,7 @@ if ($QuoteTransaction) { } my $signature = ''; -if ($session{'CurrentUser'}->UserObj->Signature) { +if ($IncludeSignature && $session{'CurrentUser'}->UserObj->Signature) { $signature = "-- \n".$session{'CurrentUser'}->UserObj->Signature; } @@ -42,8 +42,9 @@ if ($session{'CurrentUser'}->UserObj->Signature) { $QuoteTransaction => undef $Name => 'Content' $Default => '' -$Width => $RT::MessageBoxWidth -$Wrap => $RT::MessageBoxWrap +$Width => $RT::MessageBoxWidth || 72 +$Height => $RT::MessageBoxHeight || 15 +$Wrap => $RT::MessageBoxWrap || 'HARD' $IncludeSignature => 1 </%ARGS> diff --git a/rt/html/Elements/MyRequests b/rt/html/Elements/MyRequests index 05ae62445..da6fb1f7b 100644 --- a/rt/html/Elements/MyRequests +++ b/rt/html/Elements/MyRequests @@ -66,7 +66,7 @@ <%INIT> -my $rows = 10; +my $rows = $RT::MyRequestsLength; my $MyTickets; $MyTickets = new RT::Tickets ($session{'CurrentUser'}); $MyTickets->LimitWatcher(TYPE => 'Requestor', VALUE => $session{'CurrentUser'}->EmailAddress); diff --git a/rt/html/Elements/QueryString b/rt/html/Elements/QueryString new file mode 100644 index 000000000..36c467938 --- /dev/null +++ b/rt/html/Elements/QueryString @@ -0,0 +1,7 @@ +<%init> +my @params; +while ( (my $key, my $value) = each %ARGS ){ + push @params, $key."=".$m->interp->apply_escapes($value,'u'); +} +return(join('&',@params)); +</%init> diff --git a/rt/html/Elements/SelectMatch b/rt/html/Elements/SelectMatch index d58a9633a..c291537e1 100644 --- a/rt/html/Elements/SelectMatch +++ b/rt/html/Elements/SelectMatch @@ -38,13 +38,13 @@ $Default => undef </%ARGS> <%INIT> my ($TrueDefault, $FalseDefault, $LikeDefault, $NotLikeDefault); -if ($Default && $Default !~ /true/i) { +if ($Default && $Default =~ /false/i) { $FalseDefault = "SELECTED"; } -elsif ($Default && $Default !~ /false/i) { +elsif ($Default && $Default =~ /true/i) { $TrueDefault = "SELECTED"; } -elsif ($Default && $Default !~ /notlike/i) { +elsif ($Default && $Default =~ /notlike/i) { $NotLikeDefault = "SELECTED"; } else { diff --git a/rt/html/REST/1.0/Forms/ticket/default b/rt/html/REST/1.0/Forms/ticket/default index fec499b58..1b3142b86 100644 --- a/rt/html/REST/1.0/Forms/ticket/default +++ b/rt/html/REST/1.0/Forms/ticket/default @@ -177,8 +177,8 @@ else { $key = $simple{$key}; $set = "Set$key"; - next if $val eq $ticket->$key; - ($n, $s) = $ticket->$set($val); + next if (($val eq $ticket->$key)|| ($ticket->$key =~ /^\d+$/ && $val == $ticket->$key)); + ($n, $s) = $ticket->$set("$val"); } elsif (exists $dates{$key}) { $key = $dates{$key}; @@ -226,7 +226,7 @@ else { $s =~ s/^# //; } } - elsif ($key ne 'id' && $key ne 'type') { + elsif ($key ne 'id' && $key ne 'type' && $key ne 'creator') { $n = 0; $s = "Unknown field."; } diff --git a/rt/html/REST/1.0/NoAuth/mail-gateway b/rt/html/REST/1.0/NoAuth/mail-gateway index 359331f58..ca8cf5155 100644 --- a/rt/html/REST/1.0/NoAuth/mail-gateway +++ b/rt/html/REST/1.0/NoAuth/mail-gateway @@ -35,7 +35,7 @@ my ( $status, $error, $Ticket ) = RT::Interface::Email::Gateway(\%ARGS); inherit => undef # inhibit UTF8 conversion done in /autohandler </%flags> % if ($status == -75 ) { -temporary failure +temporary failure - <% $error %> % } % elsif ($status == 1) { ok diff --git a/rt/html/Search/Bulk.html b/rt/html/Search/Bulk.html index de9143c8a..9ecac494f 100644 --- a/rt/html/Search/Bulk.html +++ b/rt/html/Search/Bulk.html @@ -145,7 +145,7 @@ while (my $Ticket = $session{'tickets'}->Next) { <& /Ticket/Elements/BulkLinks &> <& /Elements/TitleBoxEnd &> -<& /Elements/Submit &> +<& /Elements/Submit, Label => loc('Update All') &> </FORM> @@ -180,6 +180,11 @@ while (my $Ticket = $session{'tickets'}->Next) { $RT::Logger->debug( "Checking Ticket ".$Ticket->Id ."\n"); next unless ($ARGS{"UpdateTicket".$Ticket->Id}); $RT::Logger->debug ("Matched\n"); + my @updateresults; + if ($do_comment_reply) { + ProcessUpdateMessage(TicketObj => $Ticket, ARGSRef => \%ARGS, Actions => \@updateresults); + } + #Update the basics. my @basicresults = ProcessTicketBasics(TicketObj => $Ticket, ARGSRef => \%ARGS); my @dateresults = ProcessTicketDates(TicketObj => $Ticket, ARGSRef => \%ARGS); @@ -205,11 +210,7 @@ while (my $Ticket = $session{'tickets'}->Next) { delete $ARGS{$Ticket->Id.'-RefersTo'}; delete $ARGS{'RefersTo-'.$Ticket->Id}; - my @updateresults; - if ($do_comment_reply) { - ProcessUpdateMessage(TicketObj => $Ticket, ARGSRef => \%ARGS, Actions => \@updateresults); - } - my @tempresults = (@watchresults, @basicresults, @dateresults, @updateresults, @linkresults); + my @tempresults = (@watchresults, @basicresults, @dateresults, @updateresults, @linkresults); @tempresults = map { loc("Ticket [_1]: [_2]",$Ticket->Id,$_) } @tempresults; @results = (@results, @tempresults); diff --git a/rt/html/Search/Elements/PickRestriction b/rt/html/Search/Elements/PickRestriction index 0021ab2bc..ff9b86ba5 100644 --- a/rt/html/Search/Elements/PickRestriction +++ b/rt/html/Search/Elements/PickRestriction @@ -21,8 +21,8 @@ %# %# %# END LICENSE BLOCK -<FORM ACTION="Listing.html" METHOD="GET"> -<INPUT TYPE=HIDDEN NAME="Bookmark" VALUE="<% $session{'tickets'}->FreezeLimits()|u %>"> +<FORM ACTION="<%$RT::WebPath%>/Search/Listing.html" METHOD="GET"> +<INPUT TYPE=HIDDEN NAME="Bookmark" VALUE="<% $session{'tickets'}->FreezeLimits()%>"> <& /Elements/TitleBoxStart, title => loc('Refine search')&> <INPUT TYPE=HIDDEN NAME="CompileRestriction" VALUE=1> diff --git a/rt/html/Search/Listing.html b/rt/html/Search/Listing.html index 508534549..68b1fd75c 100644 --- a/rt/html/Search/Listing.html +++ b/rt/html/Search/Listing.html @@ -37,16 +37,16 @@ </TABLE> <div align=center> <font size=2> -<a href="Listing.html?GotoPage=1"><&|/l&>First page</&></a> +<a href="<%$RT::WebPath%>/Search/Listing.html?GotoPage=1"><&|/l&>First page</&></a> % if ( $session{'tickets'}->FirstRow >= $session{'tickets_rows_per_page'}-1 ) { -<a href="Listing.html?GotoPage=Prev"><<&|/l&>Previous page</&></a> +<a href="<%$RT::WebPath%>/Search/Listing.html?GotoPage=Prev"><<&|/l&>Previous page</&></a> % } % if ( $session{'tickets'}->FirstRow + $session{'tickets_rows_per_page'} < $ticketcount ) { -<a href="Listing.html?GotoPage=Next"><&|/l&>Next page</&>></a> +<a href="<%$RT::WebPath%>/Search/Listing.html?GotoPage=Next"><&|/l&>Next page</&>></a> % } -%# <form method=get action="Listing.html"><&|/l&>Goto page</&> <input name=GotoPage size=2></form> +%# <form method=get action="<%$RT::WebPath%>/Search/Listing.html"><&|/l&>Goto page</&> <input name=GotoPage size=2></form> </font> </div> <!--<div align=right>--> @@ -57,7 +57,7 @@ </td> <td align=right> -<a href="Bulk.html"><&|/l&>Update all these tickets at once</&></a> +<a href="<%$RT::WebPath%>/Search/Bulk.html"><&|/l&>Update all these tickets at once</&></a> <!--</div>--> </td> </tr> @@ -75,7 +75,7 @@ %} <BR> <BR> -<A HREF="<% $RT::WebPath%>/Search/Listing.html?Bookmark=<%$session{'tickets'}->FreezeLimits()|u%>&TicketsSortBy=<%$session{'tickets_sort_by'}%>&TicketsSortOrder=<%$session{'tickets_sort_order'}%>&RowsPerPage=<%$session{'tickets_rows_per_page'}%>"><&|/l&>Bookmarkable URL for this search</&></a> +<A HREF="<% $RT::WebPath%>/Search/Listing.html?Bookmark=<%$session{'tickets'}->FreezeLimits()|nu%>&TicketsSortBy=<%$session{'tickets_sort_by'}%>&TicketsSortOrder=<%$session{'tickets_sort_order'}%>&RowsPerPage=<%$session{'tickets_rows_per_page'}%>"><&|/l&>Bookmarkable URL for this search</&></a> <& /Elements/TitleBoxEnd&> </TD> <TD> @@ -96,6 +96,7 @@ if ($session{'tickets'}) { } if ( ($ARGS{'ClearRestrictions'}) || ($ARGS{'NewSearch'}) ) { $session{'tickets'}->ClearRestrictions; + $session{'tickets'}->CleanSlate; } } ProcessSearchQuery(ARGS=>\%ARGS); diff --git a/rt/html/SelfService/Display.html b/rt/html/SelfService/Display.html index 124ecf407..d4e46a23b 100644 --- a/rt/html/SelfService/Display.html +++ b/rt/html/SelfService/Display.html @@ -46,7 +46,9 @@ -<& /Ticket/Elements/ShowHistory, Ticket => $Ticket, AttachPath => "Attachment" &> +%#!!pape: selfservice_find_attachments.patch {{ +<& /Ticket/Elements/ShowHistory, Ticket => $Ticket, AttachPath => "Attachment", Attachments => $attachments, UpdatePath => "Update.html" &> +%#!!pape: selfservice_find_attachments.patch }} @@ -172,6 +174,10 @@ unless (keys %{$session{'Attachments'}} and $ARGS{'UpdateAttach'}) { my $Transactions = $Ticket->Transactions; +#!!pape: selfservice_find_attachments.patch {{ +my $attachments = $m->comp('/Ticket/Elements/FindAttachments', Ticket => $Ticket); +#!!pape: selfservice_find_attachments.patch }} + </%INIT> diff --git a/rt/html/SelfService/Prefs.html b/rt/html/SelfService/Prefs.html index 3bbb9b913..70dc73fed 100644 --- a/rt/html/SelfService/Prefs.html +++ b/rt/html/SelfService/Prefs.html @@ -33,7 +33,7 @@ <& /Elements/TitleBoxEnd &> <BR> % } -<& /Elements/Submit &> +<& /Elements/Submit, Label => loc('Save Changes') &> </form> diff --git a/rt/html/Ticket/Create.html b/rt/html/Ticket/Create.html index 435447a8f..9b5783cee 100644 --- a/rt/html/Ticket/Create.html +++ b/rt/html/Ticket/Create.html @@ -117,7 +117,7 @@ <TD COLSPAN=6> <&|/l&>Describe the issue below</&>:<br> % if (exists $ARGS{Content}) { -<& /Elements/MessageBox, Default => $ARGS{Content} &> +<& /Elements/MessageBox, Default => $ARGS{Content}, IncludeSignature => 0 &> % } else { <& /Elements/MessageBox, QuoteTransaction => $QuoteTransaction &> %} @@ -152,8 +152,8 @@ <TABLE BORDER=0> <TR><TD ALIGN=RIGHT><&|/l&>Priority</&>:</TD><TD><input size=3 name="InitialPriority" value="<% $ARGS{InitialPriority} ? $ARGS{InitialPriority} : $QueueObj->InitialPriority %>"></TD></TR> <TR><TD ALIGN=RIGHT><&|/l&>Final Priority</&>:</TD><TD><input size=3 name="FinalPriority" value="<% $ARGS{FinalPriority} ? $ARGS{FinalPriority} : $QueueObj->FinalPriority %>"></TD></TR> -<TR><TD ALIGN=RIGHT><&|/l&>Time Worked</&>:</TD><TD><input size=3 name="TimeWorked" value="<% $ARGS{TimeWorked} %>"></TD></TR> -<TR><TD ALIGN=RIGHT><&|/l&>Time Left</&>:</TD><TD><input size=3 name="TimeLeft" value="<% $ARGS{TimeLeft} %>"></TD></TR> +<TR><TD ALIGN=RIGHT><&|/l&>Time Worked</&>:</TD><TD><&|/l,'<input size=3 name="TimeWorked" value="'.$ARGS{TimeWorked}.'">'&>[_1] min</&></TD></TR> +<TR><TD ALIGN=RIGHT><&|/l&>Time Left</&>:</TD><TD><&|/l,'<input size=3 name="TimeLeft" value="'.$ARGS{TimeLeft}.'">'&>[_1] min</&></TD></TR> </TABLE> <& /Elements/TitleBoxEnd &> <br> @@ -175,7 +175,7 @@ $ARGS{Due}%>"></TD></TR> title_class=> 'inverse', titleright => '', color=> "#336633" &> -<i><&|/l&>(Enter ticket ids or URLs, seperated with spaces)</&></i> +<i><&|/l&>(Enter ticket ids or URLs, separated with spaces)</&></i> <TABLE BORDER=0> <TR><TD ALIGN=RIGHT><&|/l&>Depends on</&></TD><TD><input size=10 name="new-DependsOn" value="<% $ARGS{'new-DependsOn'} %>"></TD></TR> <TR><TD ALIGN=RIGHT><&|/l&>Depended on by</&></TD><TD><input size=10 name="DependsOn-new" value="<% $ARGS{'DependsOn-new'} %>"></TD></TR> @@ -208,7 +208,9 @@ my $QueueObj = new RT::Queue($session{'CurrentUser'}); $QueueObj->Load($Queue) || Abort(loc("Queue could not be loaded.")); my $CFs = $QueueObj->CustomFields(); -if ($QueueObj->DefaultDueIn) { +# if no due date has been set explicitly, then use the +# queue's default if it exists +if ($QueueObj->DefaultDueIn && !$ARGS{'Due'}) { my $default_due = RT::Date->new($session{'CurrentUser'}); $default_due->SetToNow(); $default_due->AddDays($QueueObj->DefaultDueIn); diff --git a/rt/html/Ticket/Display.html b/rt/html/Ticket/Display.html index 276cee62a..4a8983e6e 100644 --- a/rt/html/Ticket/Display.html +++ b/rt/html/Ticket/Display.html @@ -30,14 +30,18 @@ <& /Elements/ListActions, actions => \@Actions &> -<& /Ticket/Elements/ShowSummary, Ticket => $TicketObj &> +<& /Ticket/Elements/ShowSummary, Ticket => $TicketObj, Attachments => $attachments &> <BR> <& /Ticket/Elements/ShowHistory , Ticket => $TicketObj, Collapsed => $ARGS{'Collapsed'}, - ShowHeaders => $ARGS{'ShowHeaders'} &> + ShowHeaders => $ARGS{'ShowHeaders'}, + Attachments => $attachments, + AttachmentContent => $attachment_content + + &> <%ARGS> @@ -92,18 +96,17 @@ if ($ARGS{'id'} eq 'new') { } } - if ( $ARGS{'UpdateContent'} || $session{'Attachments'}) { - $ARGS{'UpdateContent'} =~ s/\r\n/\n/g; - if ( $session{'Attachments'} || - ( $ARGS{'UpdateContent'} ne '' - && $ARGS{'UpdateContent'} ne "-- \n" - . $session{'CurrentUser'}->UserObj->Signature )) { - $ARGS{UpdateAttachments} = $session{'Attachments'}; - ProcessUpdateMessage( ARGSRef => \%ARGS, - Actions => \@Actions, - TicketObj => $TicketObj ); - delete $session{'Attachments'}; - } + $ARGS{'UpdateContent'} =~ s/\r\n/\n/g; + if ( $ARGS{'UpdateTimeWorked'} || + $session{'Attachments'} || + ( $ARGS{'UpdateContent'} ne '' + && $ARGS{'UpdateContent'} ne "-- \n" + . $session{'CurrentUser'}->UserObj->Signature )) { + $ARGS{UpdateAttachments} = $session{'Attachments'}; + ProcessUpdateMessage( ARGSRef => \%ARGS, + Actions => \@Actions, + TicketObj => $TicketObj ); + delete $session{'Attachments'}; } #Process status updates my @BasicActions = ProcessTicketBasics(ARGSRef => \%ARGS, TicketObj=>$TicketObj); @@ -111,6 +114,11 @@ if ($ARGS{'id'} eq 'new') { push (@Actions, @BasicActions, @results); } + +my $attachments = $m->comp('Elements/FindAttachments', Ticket => $TicketObj); +my $attachment_content = $m->comp('Elements/LoadTextAttachments', Ticket => $TicketObj); + + </%INIT> diff --git a/rt/html/Ticket/Elements/FindAttachments b/rt/html/Ticket/Elements/FindAttachments new file mode 100755 index 000000000..b8a0dd8b6 --- /dev/null +++ b/rt/html/Ticket/Elements/FindAttachments @@ -0,0 +1,46 @@ +<%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 $transactions = $Ticket->Transactions->First; + + +my $attachments = RT::Attachments->new( $session{'CurrentUser'} ); + +$attachments->Columns( qw( Id Filename ContentType Headers Subject Parent ContentEncoding ContentType TransactionId Created)); + +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 => 'Ticket', + ALIAS2 => $tickets, + FIELD2 => 'id' ); + + $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" ); + } +} +return ($attachments); +</%INIT> +<%ARGS> +$Ticket => undef +</%ARGS> + diff --git a/rt/html/Ticket/Elements/LoadTextAttachments b/rt/html/Ticket/Elements/LoadTextAttachments new file mode 100755 index 000000000..084502e4c --- /dev/null +++ b/rt/html/Ticket/Elements/LoadTextAttachments @@ -0,0 +1,39 @@ +<%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 => 'Ticket', + ALIAS2 => $tickets, + FIELD2 => 'id' ); + + $attachments->Limit( ALIAS => $tickets, + FIELD => 'EffectiveId', + VALUE => $Ticket->id() ); + # if the user may not see comments do not return them + unless ( $Ticket->CurrentUserHasRight('ShowTicketComments') ) { + $attachments->Limit( ALIAS => $transactions, FIELD => 'Type', OPERATOR => '!=', VALUE => "Comment" ); + } + + $attachments->Limit ( FIELD => 'ContentType', OPERATOR => '=', VALUE => 'text/plain'); + $attachments->Limit ( FIELD => 'ContentType', OPERATOR => 'STARTSWITH', VALUE => 'message/'); + $attachments->Limit ( FIELD => 'ContentType', OPERATOR => '=', VALUE => 'text'); + +} +return ($attachments); +</%INIT> +<%ARGS> +$Ticket => undef +</%ARGS> + diff --git a/rt/html/Ticket/Elements/ShowAttachments b/rt/html/Ticket/Elements/ShowAttachments index 590a011fb..bdda1692c 100644 --- a/rt/html/Ticket/Elements/ShowAttachments +++ b/rt/html/Ticket/Elements/ShowAttachments @@ -47,7 +47,10 @@ if ($size) { </%PERL> <li><font <%$fontsize%>> - <A HREF="<%$RT::WebPath%>/Ticket/Attachment/<%$rev->TransactionObj->Id%>/<%$rev->Id%>/<%$rev->Filename | u%>"><%$rev->CreatedAsString%> (<% $size %>)</a></font></li> +<A HREF="<%$RT::WebPath%>/Ticket/Attachment/<%$rev->TransactionId%>/<%$rev->Id%>/<%$rev->Filename | u%>"> +<&|/l, $rev->CreatedAsString, $size, $rev->CreatorObj->Name &>[_1] ([_2]) by [_3]</&> +</a> +</font></li> % } % $fontsize='size="-2"'; % } @@ -60,20 +63,15 @@ if ($size) { <%INIT> my %documents; -my $transactions = $Ticket->Transactions(); -while (my $trans = $transactions->Next()) { - my $attachments = $trans->Attachments(); - $attachments->Columns( qw( Id Filename ContentType Headers Subject Parent ContentEncoding ContentType TransactionId) ); - $attachments->Limit(FIELD => 'Filename', OPERATOR => 'IS NOT', VALUE => 'NULL', QUOTEVALUE => 0, ENTRYAGGREGATOR => 'AND'); - $attachments->Limit(FIELD => 'Filename', OPERATOR => '!=', VALUE => '', ENTRYAGGREGATOR => 'AND'); - while (my $attach = $attachments->Next()) { - next unless ($attach->Filename()); - # most recent at the top - unshift (@{$documents{$attach->Filename}}, $attach); - } + +while ( my $attach = $Attachments->Next() ) { + next unless ($attach->Filename()); + unshift( @{ $documents{ $attach->Filename } }, $attach ); } + </%INIT> <%ARGS> $Ticket => undef +$Attachments => undef </%ARGS> diff --git a/rt/html/Ticket/Elements/ShowDates b/rt/html/Ticket/Elements/ShowDates index b09b4bf7b..70c95efc0 100644 --- a/rt/html/Ticket/Elements/ShowDates +++ b/rt/html/Ticket/Elements/ShowDates @@ -36,7 +36,7 @@ <TD class="value"><% $Ticket->StartedObj->AsString %></TD> </TR> <TR> - <TD class="label"><a href="Display.html?id=<%$Ticket->id%>&Action=SetTold"><&|/l&>Last Contact</&></a>:</TD> + <TD class="label"><a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$Ticket->id%>&Action=SetTold"><&|/l&>Last Contact</&></a>:</TD> <TD class="value"><% $Ticket->ToldObj->AsString %></TD> </TR> <TR> diff --git a/rt/html/Ticket/Elements/ShowHistory b/rt/html/Ticket/Elements/ShowHistory index 194be9b37..c4fe41747 100644 --- a/rt/html/Ticket/Elements/ShowHistory +++ b/rt/html/Ticket/Elements/ShowHistory @@ -54,16 +54,50 @@ else { % } <TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=2 BORDER=0> -% while (my $Transaction = $Transactions->Next) { -% my $skip = 0; -% $m->comp('/Elements/Callback', _CallbackName => 'SkipTransaction', Transaction => $Transaction, skip => \$skip, %ARGS); -% next if $skip; -% $i++; -% if ($Transactions->IsLast) { - <a name="lasttrans"></a> -% } - <& ShowTransaction, Ticket => $Ticket, Transaction => $Transaction, ShowHeaders => $ShowHeaders, Collapsed => $Collapsed, RowNum => $i, ShowTitleBarCommands => $ShowTitleBarCommands, %ARGS &> -% } +<%perl> +my @attachments = @{$Attachments->ItemsArrayRef()}; +my @attachment_content = @{$AttachmentContent->ItemsArrayRef()}; + + + + + +while ( my $Transaction = $Transactions->Next ) { + my $skip = 0; + $m->comp( '/Elements/Callback', + _CallbackName => 'SkipTransaction', + Transaction => $Transaction, + skip => \$skip, + %ARGS ); + next if $skip; + $i++; + + $m->out('<a name="lasttrans"></a>') if ( $Transactions->IsLast ); + + my @trans_attachments = grep { $_->TransactionId == $Transaction->Id } @attachments; + + my $trans_content = {}; + grep { ($_->TransactionId == $Transaction->Id ) && ($trans_content->{$_->Id} = $_) } @attachment_content; + + + #Args is first because we're clobbering the "Attachments" parameter + $m->comp( 'ShowTransaction', + %ARGS, + + AttachPath => $AttachPath, + UpdatePath => $UpdatePath, + Ticket => $Ticket, + Transaction => $Transaction, + ShowHeaders => $ShowHeaders, + Collapsed => $Collapsed, + RowNum => $i, + ShowTitleBarCommands => $ShowTitleBarCommands, + Attachments => \@trans_attachments, + AttachmentContent => $trans_content + ); +} + +</%perl> </TABLE> % if ($ShowDisplayModes or $ShowTitle) { <& /Elements/TitleBoxEnd &> @@ -74,13 +108,23 @@ my $Transactions = $Ticket->Transactions; my $i; +$Attachments ||= $m->comp('/Ticket/Elements/FindAttachments', Ticket => $Ticket); +$AttachmentContent ||= $m->comp('/Ticket/Elements/LoadTextAttachments', Ticket => $Ticket); + + + </%INIT> <%ARGS> -$URIFile => 'Display.html' +$URIFile => $RT::WebPath."/Ticket/Display.html" $Ticket => undef +$Attachments => undef +$AttachmentContent => undef $ShowHeaders => undef $Collapsed => undef $ShowTitle => 1 $ShowDisplayModes => 1 $ShowTitleBarCommands => 1 +$AttachPath => $RT::WebPath."/Ticket/Attachment" +$UpdatePath => $RT::WebPath."/Ticket/Update.html" + </%ARGS> diff --git a/rt/html/Ticket/Elements/ShowRequestor b/rt/html/Ticket/Elements/ShowRequestor index cc91f590f..a6398efc7 100644 --- a/rt/html/Ticket/Elements/ShowRequestor +++ b/rt/html/Ticket/Elements/ShowRequestor @@ -23,9 +23,8 @@ %# END LICENSE BLOCK <%PERL> my $rows = 10; -my $people = $Ticket->Requestors->MembersObj; -while (my $member=$people->Next) { -my $requestor = $member->MemberObj->Object; +my $people = $Ticket->Requestors->UserMembersObj; +while (my $requestor=$people->Next) { my $name=$requestor->RealName || $requestor->EmailAddress; my $tickets = RT::Tickets->new($session{'CurrentUser'}); $tickets->LimitWatcher(TYPE => 'Requestor', VALUE => $requestor->EmailAddress ); diff --git a/rt/html/Ticket/Elements/ShowSummary b/rt/html/Ticket/Elements/ShowSummary index 6ae875832..5bcc94b41 100644 --- a/rt/html/Ticket/Elements/ShowSummary +++ b/rt/html/Ticket/Elements/ShowSummary @@ -65,7 +65,7 @@ <& /Ticket/Elements/ShowLinks, Ticket => $Ticket &> <& /Elements/TitleBoxEnd &> <BR> - <& /Ticket/Elements/ShowAttachments, Ticket => $Ticket &> + <& /Ticket/Elements/ShowAttachments, Ticket => $Ticket, Attachments => $Attachments &> <& /Ticket/Elements/ShowRequestor, Ticket => $Ticket &> @@ -75,6 +75,7 @@ </TABLE> <%ARGS> $Ticket => undef +$Attachments => undef </%ARGS> diff --git a/rt/html/Ticket/Elements/ShowTransaction b/rt/html/Ticket/Elements/ShowTransaction index 2d710fcbc..8cde03870 100644 --- a/rt/html/Ticket/Elements/ShowTransaction +++ b/rt/html/Ticket/Elements/ShowTransaction @@ -36,8 +36,7 @@ <%PERL> unless ($Collapsed) { - $attachments->GotoFirstItem; - while (my $message=$attachments->Next) { + foreach my $message (@$Attachments) { my ($headers, $quoted); if ($ShowHeaders && ($ShowHeaders == $Ticket->Id)) { @@ -50,20 +49,31 @@ unless ($Collapsed) { # localize the common headers (like 'Subject:'), too. eval {$headers =~ s/^([^:]+)(?=:)/loc($1)/em; } # we eval here to catch errors when 5.6 panics } - # 13456 is a random # of about the biggest size we want to see inline text - # It's here to catch anyone who hasn't updated RT_Config.pm since this - # constant was moved out there. + + my $MAX_INLINE_BODY = $RT::MaxInlineBody || 13456; - if ($message->ContentType =~ m{^(text/plain|message|text$)}i && - $message->ContentLength < $MAX_INLINE_BODY ) { - eval { - require Text::Quoted; - $quoted = Text::Quoted::extract($message->Content); - }; + if ( $message->ContentType =~ m{^(text/plain|message|text$)}i + && $message->ContentLength < $MAX_INLINE_BODY ) { + + my $content; + # If we've preloaded all the content, let's pull from there + # if we haven't, load it now + if ($AttachmentContent->{$message->id}) { + $content = $AttachmentContent->{$message->id}->Content; + } else { + $content = $message->Content; + } + + + + eval { + require Text::Quoted; + $quoted = Text::Quoted::extract( $content ); + }; if ($@) { - $quoted = $message->Content; + $quoted = $content; } - } + } </%PERL> <TR class="<% $RowNum%2 ? 'oddline' : 'evenline'%>" > @@ -74,7 +84,7 @@ unless ($Collapsed) { <PRE> <& ShowMessageHeaders, Headers => $headers, Transaction => $Transaction &> </PRE> -% if (!length($quoted) && $message->ContentType =~ m#^text/#) { +% if ($message->ContentLength && !length($quoted) && $message->ContentType =~ m#^text/#) { <blockquote><i><&|/l&>Message body not shown because it is too large or is not plain text.</&><br> <&|/l&>You can access it with the Download button on the right.</&></i></blockquote> % } else { @@ -115,6 +125,9 @@ $Collapsed => undef $ShowTitleBarCommands => 1 $RowNum => 1 $AttachPath => $RT::WebPath."/Ticket/Attachment" +$UpdatePath => $RT::WebPath."/Ticket/Update.html" +$Attachments => undef +$AttachmentContent => undef </%ARGS> <%INIT> @@ -126,12 +139,7 @@ my $transdate = $Transaction->CreatedAsString(); $transdate =~ s/\s/ /g; if ($Transaction->Type =~ /^(Create|Correspond|Comment$)/) { - if ($Transaction->IsInbound) { $bgcolor="#336699"; - } - else { - $bgcolor="#339999"; - } } elsif (($Transaction->Field =~ /^Owner$/) or ($Transaction->Type =~ /^(AddWatcher|DelWatcher)$/)) { $bgcolor="#333399"; @@ -154,25 +162,30 @@ if ($Ticket->Id != $Transaction->Ticket) { $TicketString = "Ticket ".$Transaction->Ticket .": "; } -if ($Transaction->TimeTaken > 0) { +if ($Transaction->TimeTaken != 0) { $TimeTaken = $Transaction->TimeTaken." min" } -my $attachments = $Transaction->Attachments; -$attachments->Columns( qw( Id Filename ContentType Headers Subject Parent ContentEncoding ContentType TransactionId) ); + +unless ($Attachments) { + my $attachments = $Transaction->Attachments; + $attachments->Columns( qw( Id Filename ContentType Headers Subject Parent ContentEncoding ContentType TransactionId) ); + $Attachments = $attachments->ItemsArrayRef(); +} + my $titlebar_commands=' '; # If the transaction has anything attached to it at all -if ($Transaction->Attachments->First && $ShowTitleBarCommands) { - if ($Transaction->TicketObj->CurrentUserHasRight('ReplyToTicket')) { +if ($Attachments->[0] && $ShowTitleBarCommands) { + if ($Ticket->CurrentUserHasRight('ReplyToTicket')) { $titlebar_commands .= - "[<a href=\"Update.html?id=". + "[<a href=\"".$UpdatePath."?id=". $Transaction->Ticket . "&QuoteTransaction=".$Transaction->Id. "&Action=Respond\">". loc('Reply') ."</a>] "; } - if ($Transaction->TicketObj->CurrentUserHasRight('CommentOnTicket')) { + if ($Ticket->CurrentUserHasRight('CommentOnTicket')) { $titlebar_commands .= - "[<a href=\"Update.html?id=".$Transaction->Ticket. + "[<a href=\"".$UpdatePath."?id=".$Transaction->Ticket. "&QuoteTransaction=".$Transaction->Id. "&Action=Comment\">". loc('Comment') ."</a>]"; } diff --git a/rt/html/Ticket/History.html b/rt/html/Ticket/History.html index cb02f1c75..95a21deec 100644 --- a/rt/html/Ticket/History.html +++ b/rt/html/Ticket/History.html @@ -28,7 +28,13 @@ <BR> -<& /Ticket/Elements/ShowHistory , Ticket => $Ticket, ShowHeaders => $ARGS{'ShowHeaders'}, URIFile => 'History.html' &> +<& /Ticket/Elements/ShowHistory , + Ticket => $Ticket, + ShowHeaders => $ARGS{'ShowHeaders'}, + URIFile => 'History.html', + Attachments => $attachments, + AttachmentContent => $attachment_content + &> <%ARGS> @@ -45,6 +51,11 @@ unless ($Ticket->CurrentUserHasRight('ShowTicket')) { Abort("No permission to view ticket"); } +my $attachments = $m->comp('Elements/FindAttachments', Ticket => $Ticket); +my $attachment_content = $m->comp('Elements/LoadTextAttachments', Ticket => +$Ticket); + + </%INIT> diff --git a/rt/html/Ticket/ModifyAll.html b/rt/html/Ticket/ModifyAll.html index 1163f3fa5..1d0500d16 100644 --- a/rt/html/Ticket/ModifyAll.html +++ b/rt/html/Ticket/ModifyAll.html @@ -76,7 +76,7 @@ </tr> <tr> <td class="label"><&|/l&>Subject</&>:</td> - <td class="entry"><input name="UpdateSubject" size=60 value=""></td> + <td class="entry"><input name="UpdateSubject" size=60 value="<%$Ticket->Subject%>"></td> </tr> <tr> <td class="label"><&|/l&>Attach</&>:</td> @@ -119,13 +119,29 @@ unless ($OnlySearchForPeople) { @dresults = ProcessTicketDates( TicketObj => $Ticket, ARGSRef => \%ARGS); @lresults = ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS); - $ARGS{'UpdateContent'} =~ s/\r\n/\n/g; - - if ($ARGS{'UpdateContent'} && - $ARGS{'UpdateContent'} ne '' && + if ($ARGS{'UpdateAttachment'}) { + my $subject = "$ARGS{'UpdateAttachment'}"; + # since CGI.pm deutf8izes the magic field, we need to add it back. + Encode::_utf8_on($subject); + # strip leading directories + $subject =~ s#^.*[\\/]##; + + my $attachment = MakeMIMEEntity( + Subject => $subject, + Body => "", + AttachmentFieldName => 'UpdateAttachment' + ); + delete $ARGS{'UpdateAttachment'}; + $ARGS{'UpdateAttachments'}->{ $subject } = $attachment; + } + + $ARGS{'UpdateContent'} =~ s/\r+\n/\n/g; + + if ($ARGS{'UpdateAttachments'} || ( + $ARGS{'UpdateContent'} && $ARGS{'UpdateContent'} ne "-- \n" . $session{'CurrentUser'}->UserObj->Signature - ) { + )) { ProcessUpdateMessage(TicketObj => $Ticket, ARGSRef=>\%ARGS, Actions=>\@results); diff --git a/rt/html/Ticket/ModifyDates.html b/rt/html/Ticket/ModifyDates.html index 3ccae4431..5339e4283 100644 --- a/rt/html/Ticket/ModifyDates.html +++ b/rt/html/Ticket/ModifyDates.html @@ -35,7 +35,7 @@ <& Elements/EditDates, TicketObj => $TicketObj &> <& /Elements/TitleBoxEnd &> -<& /Elements/Submit, color => "#663366" &> +<& /Elements/Submit, Label => loc('Save Changes'), color => "#663366" &> </form> diff --git a/rt/html/Ticket/ModifyLinks.html b/rt/html/Ticket/ModifyLinks.html index 1d050088b..d7e39f3d2 100644 --- a/rt/html/Ticket/ModifyLinks.html +++ b/rt/html/Ticket/ModifyLinks.html @@ -35,7 +35,7 @@ <& /Elements/TitleBoxStart, title => loc('Edit Relationships'), color => "#336633"&> <& Elements/EditLinks, Ticket => $Ticket &> <& /Elements/TitleBoxEnd &> -<& /Elements/Submit, color => "#336633", Caption=> loc('Save Changes') &> +<& /Elements/Submit, color => "#336633", Label => loc('Save Changes') &> </form> diff --git a/rt/html/Ticket/Update.html b/rt/html/Ticket/Update.html index ad3b21787..1df8084e5 100644 --- a/rt/html/Ticket/Update.html +++ b/rt/html/Ticket/Update.html @@ -112,7 +112,7 @@ value=<% $ARGS{UpdateCc} %>><BR> -<& /Elements/Submit, Name => 'SubmitTicket' &> +<& /Elements/Submit, Label => loc('Update Ticket'), Name => 'SubmitTicket' &> </FORM> diff --git a/rt/html/User/Delegation.html b/rt/html/User/Delegation.html index c036f78ec..9c60f6acf 100644 --- a/rt/html/User/Delegation.html +++ b/rt/html/User/Delegation.html @@ -33,7 +33,7 @@ <& Elements/DelegateRights, personalgroups => $personalgroups, objects => $objects, ObjectType => 'RT::Queue' &> <& Elements/DelegateRights, personalgroups => $personalgroups, objects => $objects, ObjectType => 'RT::Group' &> -<& /Elements/Submit &> +<& /Elements/Submit, Label => loc('Modify Rights') &> </form> <%INIT> diff --git a/rt/html/User/Groups/Members.html b/rt/html/User/Groups/Members.html index db83b8c0f..1c031366b 100644 --- a/rt/html/User/Groups/Members.html +++ b/rt/html/User/Groups/Members.html @@ -76,7 +76,7 @@ </TD> </TR> </TABLE> -<& /Elements/Submit &> +<& /Elements/Submit, Label => loc('Modify Members') &> </form> diff --git a/rt/html/User/Groups/Modify.html b/rt/html/User/Groups/Modify.html index f731e1a82..8190afa92 100644 --- a/rt/html/User/Groups/Modify.html +++ b/rt/html/User/Groups/Modify.html @@ -52,7 +52,7 @@ <INPUT TYPE=CHECKBOX NAME="Enabled" VALUE="1" <%$EnabledChecked%>> <&|/l&>Enabled (Unchecking this box disables this group)</&><BR> </TR> </TABLE> -<& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> +<& /Elements/Submit, Label => loc('Create'), Reset => 1 &> </form> <%INIT> diff --git a/rt/html/User/Prefs.html b/rt/html/User/Prefs.html index c2746a38c..68f12b81e 100644 --- a/rt/html/User/Prefs.html +++ b/rt/html/User/Prefs.html @@ -157,7 +157,7 @@ </TABLE> -<& /Elements/Submit &> +<& /Elements/Submit, Label => loc('Save Preferences') &> </form> @@ -190,7 +190,10 @@ if ($UserObj->Id) { my @fieldresults = UpdateRecordObject ( AttributesRef => \@fields, Object => $UserObj, ARGSRef => \%ARGS ); - $session{'CurrentUser'}->LanguageHandle($Lang) if $Lang; + if ($Lang) { + $session{'CurrentUser'}->LanguageHandle($Lang); + $session{'CurrentUser'}= $session{'CurrentUser'}; # Force writeback + } push (@results,@fieldresults); diff --git a/rt/html/autohandler b/rt/html/autohandler index b2a407add..9f93eb054 100644 --- a/rt/html/autohandler +++ b/rt/html/autohandler @@ -117,6 +117,7 @@ elsif ( $RT::WebExternalAuth ) { 'HomePhone', 'WorkPhone', 'MobilePhone', 'PagerPhone', 'Address1', 'Address2', 'City', 'State', 'Zip', 'Country') { + $m->comp('/Elements/Callback', %ARGS, _CallbackName => 'NewUser'); my $method = "Set$attribute"; $UserObj->$method($new_user_info->{$attribute}) @@ -171,11 +172,15 @@ if (!$session{'CurrentUser'} && defined ($user) && defined ($pass) ){ if (!$session{'CurrentUser'}->id() || !$session{'CurrentUser'}->IsPassword($pass)) { + $RT::Logger->error("FAILED LOGIN for $user from $ENV{'REMOTE_ADDR'}"); delete $session{'CurrentUser'}; $m->comp('/Elements/Login', %ARGS, Error => loc('Your username or password is incorrect')); $m->abort(); } + else { + $RT::Logger->info("Successful login for $user from $ENV{'REMOTE_ADDR'}"); + } } # If we've got credentials, let's serve the file up. diff --git a/rt/html/index.html b/rt/html/index.html index 798972d94..928efb8f9 100644 --- a/rt/html/index.html +++ b/rt/html/index.html @@ -47,7 +47,8 @@ if ( $ARGS{'q'} ) { my $query = $ARGS{'q'}; if ( $query =~ m/^\s*(\d+)\s*$/ ) { - $m->redirect("$RT::WebPath/Ticket/Display.html?id=$1"); + $m->comp("/Ticket/Display.html" , id=> $1); + return(); } $session{'tickets'} = RT::Tickets->new( $session{'CurrentUser'} ); @@ -56,26 +57,36 @@ if ( $ARGS{'q'} ) { $session{'tickets'}->LimitWatcher( VALUE => $query, TYPE => 'Requestor', OPERATOR => '=', ); - $m->redirect("$RT::WebPath/Search/Listing.html"); + $m->comp("/Search/Listing.html"); + + return(); } # # Any search on queue name or subject will be for new/open tickets # only. # + $session{'tickets'}->LimitStatus( VALUE => $_, OPERATOR => '=', ) for qw(open new); + + my $queue = RT::Queue->new( $session{'CurrentUser'} ); if ( $queue->Load($query) && $queue->Id ) { $session{'tickets'}->LimitQueue( VALUE => $queue->Id, OPERATOR => '=', ); - $m->redirect("$RT::WebPath/Search/Listing.html"); + + + $m->comp("/Search/Listing.html"); + return(); } - $session{'tickets'}->LimitSubject( VALUE => $query, + $session{'tickets'}->LimitSubject( VALUE => $query, OPERATOR => 'LIKE' ); + $m->comp("/Search/Listing.html"); + + return(); - $m->redirect("$RT::WebPath/Search/Listing.html"); } if ($ARGS{'HomeRefreshInterval'}) { |