diff options
Diffstat (limited to 'rt/html/Ticket')
-rw-r--r-- | rt/html/Ticket/Attachment/dhandler | 4 | ||||
-rw-r--r-- | rt/html/Ticket/Create.html | 69 | ||||
-rw-r--r-- | rt/html/Ticket/Display.html | 76 | ||||
-rw-r--r-- | rt/html/Ticket/Elements/AddWatchers | 2 | ||||
-rw-r--r-- | rt/html/Ticket/Elements/EditCustomField | 4 | ||||
-rw-r--r-- | rt/html/Ticket/Elements/EditLinks | 29 | ||||
-rw-r--r-- | rt/html/Ticket/Elements/EditPeople | 3 | ||||
-rw-r--r-- | rt/html/Ticket/Elements/ShowAttachments | 5 | ||||
-rw-r--r-- | rt/html/Ticket/Elements/ShowDates | 11 | ||||
-rw-r--r-- | rt/html/Ticket/Elements/ShowHistory | 2 | ||||
-rw-r--r-- | rt/html/Ticket/Elements/ShowMessageStanza | 12 | ||||
-rw-r--r-- | rt/html/Ticket/Elements/ShowPeople | 6 | ||||
-rw-r--r-- | rt/html/Ticket/Elements/ShowTransaction | 24 | ||||
-rw-r--r-- | rt/html/Ticket/Elements/Tabs | 10 | ||||
-rw-r--r-- | rt/html/Ticket/Modify.html | 2 | ||||
-rw-r--r-- | rt/html/Ticket/ModifyAll.html | 2 | ||||
-rw-r--r-- | rt/html/Ticket/ModifyPeople.html | 3 | ||||
-rw-r--r-- | rt/html/Ticket/Update.html | 36 |
18 files changed, 171 insertions, 129 deletions
diff --git a/rt/html/Ticket/Attachment/dhandler b/rt/html/Ticket/Attachment/dhandler index e0f00f57a..ba82b5f2e 100644 --- a/rt/html/Ticket/Attachment/dhandler +++ b/rt/html/Ticket/Attachment/dhandler @@ -65,4 +65,6 @@ $m->out($AttachmentObj->OriginalContent); $m->abort; </%perl> - +<%attr> +AutoFlush => 0 +</%attr> diff --git a/rt/html/Ticket/Create.html b/rt/html/Ticket/Create.html index 5b8c908a1..435447a8f 100644 --- a/rt/html/Ticket/Create.html +++ b/rt/html/Ticket/Create.html @@ -34,55 +34,55 @@ <BR> <& /Elements/TitleBoxStart, contentbg => "#cccccc", title => loc("Create a new ticket") &> <TABLE border=0 cellpadding=0 cellspacing=0> -<TR><TD><&|/l&>Queue</&></TD> -<TD><% $QueueObj->Name %> +<TR><TD class=label><&|/l&>Queue</&>:</TD> +<TD class=value><% $QueueObj->Name %> <INPUT TYPE=HIDDEN NAME=Queue Value="<%$QueueObj->Name%>"> </TD> -<TD><&|/l&>Status</&>: +<TD class=label><&|/l&>Status</&>: </TD> -<TD> +<TD class=value> <& /Elements/SelectStatus, Name => "Status", Default => $ARGS{Status}||'new' &> </TD> -<TD> +<TD class=label> <&|/l&>Owner</&>: </TD> -<TD> +<TD class=value> <& /Elements/SelectOwner, Name => "Owner", QueueObj => $QueueObj, Default => $ARGS{Owner}||undef &> </TD> </TR> <TR> -<TD> +<TD class=label> <&|/l&>Requestors</&>: </TD> -<TD COLSPAN=5> +<TD class=value COLSPAN=5> <INPUT Name="Requestors" Value="<% ($ARGS{Requestors}) || $session{CurrentUser}->EmailAddress %>" SIZE=40> </TD> </TR> <TR> -<TD> +<TD class=labeltop> <&|/l&>Cc</&>: </TD> -<TD COLSPAN=5> -<INPUT NAME="Cc" SIZE=40<% $ARGS{Cc} && " VALUE=\"$ARGS{Cc}\""%>><BR> +<TD class=value COLSPAN=5> +<INPUT NAME="Cc" SIZE=40 VALUE="<% $ARGS{Cc} %>"><BR> <i><font size=-2> <&|/l&>(Sends a carbon-copy of this update to a comma-delimited list of email addresses. These people <b>will</b> receive future updates.)</&></font></i> </TD> </TR> <TR> -<TD> +<TD class=labeltop> <&|/l&>Admin Cc</&>: </TD> -<TD COLSPAN=5> -<INPUT NAME="AdminCc" SIZE=40<% $ARGS{AdminCc} && " VALUE=\"$ARGS{AdminCc}\""%>><BR> +<TD class=value COLSPAN=5> +<INPUT NAME="AdminCc" SIZE=40 VALUE="<% $ARGS{AdminCc} %>"><BR> <i><font size=-2> <&|/l&>(Sends a carbon-copy of this update to a comma-delimited list of administrative email addresses. These people <b>will</b> receive future updates.)</&></font></i> </TD> </TR> <TR> -<TD> +<TD class=label> <&|/l&>Subject</&>: </TD> -<TD COLSPAN=5> +<TD class=value COLSPAN=5> <INPUT Name="Subject" SIZE=60 MAXSIZE=100 value="<%$ARGS{Subject} || ''%>"> </TD> </TR> @@ -93,7 +93,7 @@ </TR> <TR> % if (exists $session{'Attachments'}) { -<TD> +<TD class=label> <&|/l&>Attached file</&>: </TD> <TD COLSPAN=5> @@ -108,7 +108,7 @@ <TD> <&|/l&>Attach file</&>: </TD> -<TD COLSPAN=5> +<TD class=value COLSPAN=5> <INPUT TYPE=FILE NAME="Attach"> <INPUT TYPE=SUBMIT NAME="AddMoreAttach" VALUE="<&|/l&>Add More Files</&>"> </TD> @@ -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"<% $ARGS{TimeWorked} && " VALUE=\"$ARGS{TimeWorked}\"" %>></TD></TR> -<TR><TD ALIGN=RIGHT><&|/l&>Time Left</&>:</TD><TD><input size=3 name="TimeLeft"<% $ARGS{TimeLeft} && " VALUE=\"$ARGS{TimeLeft}\"" %>></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> </TABLE> <& /Elements/TitleBoxEnd &> <br> @@ -162,8 +162,9 @@ color => "#663366" &> <TABLE BORDER=0> -<TR><TD ALIGN=RIGHT><&|/l&>Starts</&>:</TD><TD><input size=10 name="Starts"<% $ARGS{Starts} && " VALUE=\"$ARGS{Starts}\"" %>></TD></TR> -<TR><TD ALIGN=RIGHT><&|/l&>Due</&>:</TD><TD><input size=10 name="Due"<% $ARGS{Due} && " VALUE=\"$ARGS{Due}\"" %>></TD></TR> +<TR><TD ALIGN=RIGHT><&|/l&>Starts</&>:</TD><TD><input size=10 name="Starts" value="<% $ARGS{Starts} %>"></TD></TR> +<TR><TD ALIGN=RIGHT><&|/l&>Due</&>:</TD><TD><input size=10 name="Due" value="<% +$ARGS{Due}%>"></TD></TR> </TABLE> <& /Elements/TitleBoxEnd &> <BR> @@ -176,12 +177,12 @@ <i><&|/l&>(Enter ticket ids or URLs, seperated with spaces)</&></i> <TABLE BORDER=0> -<TR><TD ALIGN=RIGHT><&|/l&>Depends on</&></TD><TD><input size=10 name="new-DependsOn"<% $ARGS{'new-DependsOn'} && " VALUE=\"$ARGS{'new-DependsOn'}\""%>></TD></TR> -<TR><TD ALIGN=RIGHT><&|/l&>Depended on by</&></TD><TD><input size=10 name="DependsOn-new"<% $ARGS{'DependsOn-new'} && " VALUE=\"$ARGS{'DependsOn-new'}\"" %>></TD></TR> -<TR><TD ALIGN=RIGHT><&|/l&>Parents</&></TD><TD><input size=10 name="new-MemberOf"<% $ARGS{'new-MemberOf'} && " VALUE=\"$ARGS{'new-MemberOf'}\"" %>></TD></TR> -<TR><TD ALIGN=RIGHT><&|/l&>Children</&></TD><TD><input size=10 name="MemberOf-new" <% $ARGS{'MemberOf-new'} && " VALUE=\"$ARGS{'MemberOf-new'}\"" %>></TD></TR> -<TR><TD ALIGN=RIGHT><&|/l&>Refers to</&></TD><TD><input size=10 name="new-RefersTo"<% $ARGS{'new-RefersTo'} && " VALUE=\"$ARGS{'new-MemberOf'}\"" %>></TD></TR> -<TR><TD ALIGN=RIGHT><&|/l&>Referred to by</&></TD><TD><input size=10 name="RefersTo-new"<% $ARGS{'RefersTo-new'} && " VALUE=\"$ARGS{'RefersTo-new'}\"" %>></TD></TR> +<TR><TD ALIGN=RIGHT><&|/l&>Depends on</&></TD><TD><input size=10 name="new-DependsOn" value="<% $ARGS{'new-DependsOn'} %>"></TD></TR> +<TR><TD ALIGN=RIGHT><&|/l&>Depended on by</&></TD><TD><input size=10 name="DependsOn-new" value="<% $ARGS{'DependsOn-new'} %>"></TD></TR> +<TR><TD ALIGN=RIGHT><&|/l&>Parents</&></TD><TD><input size=10 name="new-MemberOf" value="<% $ARGS{'new-MemberOf'} %>"></TD></TR> +<TR><TD ALIGN=RIGHT><&|/l&>Children</&></TD><TD><input size=10 name="MemberOf-new" value="<% $ARGS{'MemberOf-new'} %>"></TD></TR> +<TR><TD ALIGN=RIGHT><&|/l&>Refers to</&></TD><TD><input size=10 name="new-RefersTo" value="<% $ARGS{'new-RefersTo'} %>"></TD></TR> +<TR><TD ALIGN=RIGHT><&|/l&>Referred to by</&></TD><TD><input size=10 name="RefersTo-new" value="<% $ARGS{'RefersTo-new'} %>"></TD></TR> </TABLE> @@ -200,10 +201,20 @@ <BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR> <%INIT> + + + my $QueueObj = new RT::Queue($session{'CurrentUser'}); $QueueObj->Load($Queue) || Abort(loc("Queue could not be loaded.")); my $CFs = $QueueObj->CustomFields(); +if ($QueueObj->DefaultDueIn) { + my $default_due = RT::Date->new($session{'CurrentUser'}); + $default_due->SetToNow(); + $default_due->AddDays($QueueObj->DefaultDueIn); + $ARGS{'Due'} = $default_due->ISO(); +} + # {{{ deal with deleting uploaded attachments foreach my $key (keys %ARGS) { if ($key =~ m/^DeleteAttach-(.+)$/) { @@ -218,8 +229,6 @@ if ($ARGS{'Attach'}) { # attachment? my $subject = "$ARGS{'Attach'}"; - # since CGI.pm deutf8izes the magic field, we need to add it back. - Encode::_utf8_on($subject); # strip leading directories $subject =~ s#^.*[\\/]##; diff --git a/rt/html/Ticket/Display.html b/rt/html/Ticket/Display.html index cf32dce9d..276cee62a 100644 --- a/rt/html/Ticket/Display.html +++ b/rt/html/Ticket/Display.html @@ -22,20 +22,20 @@ %# %# END LICENSE BLOCK <& /Elements/Header, - Title => loc("#[_1]: [_2]", $Ticket->Id, $Ticket->Subject) &> + Title => loc("#[_1]: [_2]", $TicketObj->Id, $TicketObj->Subject) &> <& /Ticket/Elements/Tabs, - Ticket => $Ticket, - current_tab => 'Ticket/Display.html?id='.$Ticket->id, - Title => loc("#[_1]: [_2]", $Ticket->Id, $Ticket->Subject) &> + Ticket => $TicketObj, + current_tab => 'Ticket/Display.html?id='.$TicketObj->id, + Title => loc("#[_1]: [_2]", $TicketObj->Id, $TicketObj->Subject) &> <& /Elements/ListActions, actions => \@Actions &> -<& /Ticket/Elements/ShowSummary, Ticket => $Ticket &> +<& /Ticket/Elements/ShowSummary, Ticket => $TicketObj &> <BR> <& /Ticket/Elements/ShowHistory , - Ticket => $Ticket, + Ticket => $TicketObj, Collapsed => $ARGS{'Collapsed'}, ShowHeaders => $ARGS{'ShowHeaders'} &> @@ -45,14 +45,13 @@ $id => undef $Create => undef $ShowHeaders => undef $Collapsed => undef +$TicketObj => undef </%ARGS> <%INIT> - my ($linkid, $message, $tid, $Ticket, @Actions); + my ($linkid, $message, $tid, @Actions); -$Ticket = new RT::Ticket($session{'CurrentUser'}); - -unless ($id) { +unless ($id || $TicketObj) { Abort('No ticket specified'); } @@ -67,47 +66,50 @@ if ($ARGS{'id'} eq 'new') { unless ($Queue->CurrentUserHasRight('CreateTicket')) { Abort('You have no permission to create tickets in that queue.'); } - ($Ticket, @Actions) = - CreateTicket(Attachments => $session{'Attachments'}, %ARGS); + ($TicketObj, @Actions) = + CreateTicket(Attachments => $session{'Attachments'}, %ARGS); delete $session{'Attachments'}; - unless ($Ticket->CurrentUserHasRight('ShowTicket')) { - Abort("No permission to view newly created ticket #".$Ticket->id."."); - } + unless ($TicketObj->CurrentUserHasRight('ShowTicket')) { + Abort("No permission to view newly created ticket #".$TicketObj->id."."); + } # }}} -} +} else { + if (!$TicketObj) { -else { - $Ticket = LoadTicket($ARGS{'id'}); - unless ($Ticket->CurrentUserHasRight('ShowTicket')) { - Abort("No permission to view ticket"); - } + $TicketObj = RT::Ticket->new($session{'CurrentUser'}); + $TicketObj = LoadTicket($ARGS{'id'}); + unless ($TicketObj->CurrentUserHasRight('ShowTicket')) { + Abort("No permission to view ticket"); + } + } -if (defined $ARGS{'Action'}) { - if ($ARGS{'Action'} =~ /^(Steal|Kill|Take|SetTold)$/) { - my $action = $1; - my ($res, $msg)=$Ticket->$action(); - push(@Actions, $msg); - } -} + if (defined $ARGS{'Action'}) { + if ($ARGS{'Action'} =~ /^(Steal|Kill|Take|SetTold)$/) { + my $action = $1; + my ($res, $msg)=$TicketObj->$action(); + push(@Actions, $msg); + } + } - if ( $ARGS{'UpdateContent'} ) { + if ( $ARGS{'UpdateContent'} || $session{'Attachments'}) { $ARGS{'UpdateContent'} =~ s/\r\n/\n/g; - if ( $ARGS{'UpdateContent'} ne '' - && $ARGS{'UpdateContent'} ne "-- \n" - . $session{'CurrentUser'}->UserObj->Signature ) { + if ( $session{'Attachments'} || + ( $ARGS{'UpdateContent'} ne '' + && $ARGS{'UpdateContent'} ne "-- \n" + . $session{'CurrentUser'}->UserObj->Signature )) { $ARGS{UpdateAttachments} = $session{'Attachments'}; ProcessUpdateMessage( ARGSRef => \%ARGS, Actions => \@Actions, - TicketObj => $Ticket ); + TicketObj => $TicketObj ); delete $session{'Attachments'}; } } -#Process status updates -my @BasicActions = ProcessTicketBasics(ARGSRef => \%ARGS, TicketObj=>$Ticket); -my @results = ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS); + #Process status updates + my @BasicActions = ProcessTicketBasics(ARGSRef => \%ARGS, TicketObj=>$TicketObj); + my @results = ProcessTicketLinks( TicketObj => $TicketObj, ARGSRef => \%ARGS); -push (@Actions, @BasicActions, @results); + push (@Actions, @BasicActions, @results); } </%INIT> diff --git a/rt/html/Ticket/Elements/AddWatchers b/rt/html/Ticket/Elements/AddWatchers index e9f651593..96dd38f08 100644 --- a/rt/html/Ticket/Elements/AddWatchers +++ b/rt/html/Ticket/Elements/AddWatchers @@ -77,6 +77,7 @@ my ($msg, $Users, $Groups); if ($UserString) { $Users = RT::Users->new($session{'CurrentUser'}); $Users->Limit(FIELD => $UserField, VALUE => $UserString, OPERATOR => $UserOp); + $Users->LimitToPrivileged if $PrivilegedOnly; } if ($GroupString) { @@ -94,4 +95,5 @@ $UserString => undef $GroupField => 'Name' $GroupOp => '=' $GroupString => undef +$PrivilegedOnly => undef </%ARGS> diff --git a/rt/html/Ticket/Elements/EditCustomField b/rt/html/Ticket/Elements/EditCustomField index 1fc7d4388..16348061e 100644 --- a/rt/html/Ticket/Elements/EditCustomField +++ b/rt/html/Ticket/Elements/EditCustomField @@ -30,6 +30,8 @@ size="<%$Cols%>" % if ($TicketObj) { value="<%$Values->Count ? $Values->First->Content : ''%>" +% } elsif ($Default) { + value="<%$Default ? $Default : ''%>" % } > % } elsif ($CustomField->Type eq 'FreeformMultiple') { @@ -38,6 +40,8 @@ % while (my $value = $Values->Next ) { % $content .= $value->Content; % } +% } elsif ($Default) { + value="<%$Default ? $Default : ''%>" % } <input type="hidden" name="<%$NamePrefix%><%$CustomField->Id%>-Values-Magic" value="1"> <textarea cols=<%$Cols%> rows=<%$Rows%> name="<%$NamePrefix%><%$CustomField->Id%>-Values"><%$content%></textarea> diff --git a/rt/html/Ticket/Elements/EditLinks b/rt/html/Ticket/Elements/EditLinks index 7a522dda6..bdb8a6b7d 100644 --- a/rt/html/Ticket/Elements/EditLinks +++ b/rt/html/Ticket/Elements/EditLinks @@ -35,10 +35,8 @@ <td class="labeltop"><&|/l&>Depends on</&>:</td> <td class="value"> % while (my $link = $Ticket->DependsOn->Next) { -% my $member = $link->TargetObj; <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>"> - <a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> - [<%$member->Status%>]<br> + <& ShowLink, URI => $link->TargetURI &><br> % } </td> </tr> @@ -48,8 +46,7 @@ % while (my $link = $Ticket->DependedOnBy->Next) { % my $member = $link->BaseObj; <INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-"> - <a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> - [<%$member->Status%>]<br> + <& ShowLink, URI => $link->BaseURI &><br> % } </td> </tr> @@ -57,10 +54,8 @@ <td class="labeltop"><&|/l&>Parents</&>:</td> <td class="value"> % while (my $link = $Ticket->MemberOf->Next) { -% my $member = $link->TargetObj; <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>"> - <a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> - [<%$member->Status%>]<br> + <& ShowLink, URI => $link->TargetURI &><br> % } </td> </tr> @@ -69,9 +64,7 @@ <td class="value"> % while (my $link = $Ticket->Members->Next) { <INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-"> -% my $member = $link->BaseObj; - <a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> - [<%$member->Status%>]<br> + <& ShowLink, URI => $link->BaseURI &><br> % } </td> </tr> @@ -80,12 +73,7 @@ <td class="value"> % while (my $link = $Ticket->RefersTo->Next) { <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>"> -% if ($link->TargetURI->IsLocal) { -% my $member = $link->TargetObj; - <a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]<br> -% } else { - <A HREF="<%$link->TargetURI->Resolver->HREF%>"><%$link->TargetURI->Resolver->AsString%></A><br> -% } + <& ShowLink, URI => $link->TargetURI &><br> %} </td> </tr> @@ -94,12 +82,7 @@ <td class="value"> % while (my $link = $Ticket->ReferredToBy->Next) { <INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-"> -% if ($link->BaseURI->IsLocal) { -% my $member = $link->BaseObj; - <a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]<br> -% } else { - <A HREF="<%$link->BaseURI->Resolver->HREF%>"><%$link->BaseURI->Resolver->AsString%></A><br> -%} + <& ShowLink, URI => $link->BaseURI &><br> % } </td> </tr> diff --git a/rt/html/Ticket/Elements/EditPeople b/rt/html/Ticket/Elements/EditPeople index 1ab8f4ace..a1fc0111a 100644 --- a/rt/html/Ticket/Elements/EditPeople +++ b/rt/html/Ticket/Elements/EditPeople @@ -37,7 +37,7 @@ <& AddWatchers, Ticket => $Ticket, UserString => $UserString, UserOp => $UserOp, UserField => $UserField, GroupString => $GroupString, GroupOp => $GroupOp, - GroupField => $GroupField &> + 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 &> @@ -64,5 +64,6 @@ $UserString => undef $GroupField => undef $GroupOp => undef $GroupString => undef +$PrivilegedOnly => undef $Ticket => undef </%ARGS> diff --git a/rt/html/Ticket/Elements/ShowAttachments b/rt/html/Ticket/Elements/ShowAttachments index 22b60d11b..590a011fb 100644 --- a/rt/html/Ticket/Elements/ShowAttachments +++ b/rt/html/Ticket/Elements/ShowAttachments @@ -47,7 +47,7 @@ if ($size) { </%PERL> <li><font <%$fontsize%>> - <A HREF="<%$RT::WebPath%>/Ticket/Attachment/<%$rev->TransactionObj->Id%>/<%$rev->Id%>/<%$rev->Filename%>"><%$rev->CreatedAsString%> (<% $size %>)</a></font></li> + <A HREF="<%$RT::WebPath%>/Ticket/Attachment/<%$rev->TransactionObj->Id%>/<%$rev->Id%>/<%$rev->Filename | u%>"><%$rev->CreatedAsString%> (<% $size %>)</a></font></li> % } % $fontsize='size="-2"'; % } @@ -63,6 +63,9 @@ 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 diff --git a/rt/html/Ticket/Elements/ShowDates b/rt/html/Ticket/Elements/ShowDates index da7f75bb6..b09b4bf7b 100644 --- a/rt/html/Ticket/Elements/ShowDates +++ b/rt/html/Ticket/Elements/ShowDates @@ -21,6 +21,7 @@ %# %# %# END LICENSE BLOCK + <TABLE> <TR> <TD class="label"><&|/l&>Created</&>:</TD> @@ -35,7 +36,7 @@ <TD class="value"><% $Ticket->StartedObj->AsString %></TD> </TR> <TR> - <TD class="label"><&|/l&>Last Contact</&>:</TD> + <TD class="label"><a href="Display.html?id=<%$Ticket->id%>&Action=SetTold"><&|/l&>Last Contact</&></a>:</TD> <TD class="value"><% $Ticket->ToldObj->AsString %></TD> </TR> <TR> @@ -48,9 +49,15 @@ </TR> <TR> <TD class="label"><&|/l&>Updated</&>:</TD> - <TD class="value"><A HREF="#lasttrans"><% $Ticket->LastUpdated ? (loc("[_1] by [_2]", $Ticket->LastUpdatedAsString, $Ticket->LastUpdatedByObj->Name)) : loc("Never") | h %></a></TD> +% my $UpdatedString = $Ticket->LastUpdated ? (loc("[_1] by [_2]", $Ticket->LastUpdatedAsString, $Ticket->LastUpdatedByObj->Name)) : loc("Never"); +% if ($UpdatedLink) { + <TD class="value"><A HREF="#lasttrans"><% $UpdatedString | h %></a></TD> +% } else { + <TD class="value"><% $UpdatedString | h %></TD> +% } </TR> </TABLE> <%ARGS> $Ticket => undef +$UpdatedLink => 1 </%ARGS> diff --git a/rt/html/Ticket/Elements/ShowHistory b/rt/html/Ticket/Elements/ShowHistory index 2958f8706..194be9b37 100644 --- a/rt/html/Ticket/Elements/ShowHistory +++ b/rt/html/Ticket/Elements/ShowHistory @@ -62,7 +62,7 @@ else { % if ($Transactions->IsLast) { <a name="lasttrans"></a> % } - <& ShowTransaction, Ticket => $Ticket, Transaction => $Transaction, ShowHeaders => $ShowHeaders, Collapsed => $Collapsed, RowNum => $i, ShowTitleBarCommands => $ShowTitleBarCommands &> + <& ShowTransaction, Ticket => $Ticket, Transaction => $Transaction, ShowHeaders => $ShowHeaders, Collapsed => $Collapsed, RowNum => $i, ShowTitleBarCommands => $ShowTitleBarCommands, %ARGS &> % } </TABLE> % if ($ShowDisplayModes or $ShowTitle) { diff --git a/rt/html/Ticket/Elements/ShowMessageStanza b/rt/html/Ticket/Elements/ShowMessageStanza index b0998068f..8e3045a36 100644 --- a/rt/html/Ticket/Elements/ShowMessageStanza +++ b/rt/html/Ticket/Elements/ShowMessageStanza @@ -21,6 +21,8 @@ %# %# %# END LICENSE BLOCK +% if (ref($Message)) { +<font color="<%$colors[$Depth]%>"> <%perl> foreach my $stanza (@$Message) { if ( ref $stanza eq "ARRAY" ) { @@ -36,8 +38,16 @@ foreach my $stanza (@$Message) { $content =~ s/\n/<br>/gi; </%perl> -<font color="<%$colors[$Depth]%>"><%$content |n%><br></font> +<%$content |n%><br> % } +% } # end foreach +</font> +% } else { +% my $content = $Message; +% RT::Interface::Web::EscapeUTF8(\$content); +% $m->comp('/Elements/Callback', content => \$content, %ARGS); +% $content =~ s/\n/<br>/gi; +<%$content |n%><br> % } <%INIT> use URI::URL; diff --git a/rt/html/Ticket/Elements/ShowPeople b/rt/html/Ticket/Elements/ShowPeople index 0b8026949..160da70d9 100644 --- a/rt/html/Ticket/Elements/ShowPeople +++ b/rt/html/Ticket/Elements/ShowPeople @@ -27,15 +27,15 @@ <td class="value"><%$Ticket->OwnerObj->Name%></td> </tr> <tr> - <td class="label"><&|/l&>Requestors</&>:</td> + <td class="labeltop"><&|/l&>Requestors</&>:</td> <td class="value"><%$Ticket->RequestorAddresses%></td> </tr> <tr> - <td class="label"><&|/l&>Cc</&>:</td> + <td class="labeltop"><&|/l&>Cc</&>:</td> <td class="value"><%$Ticket->CcAddresses%></td> </tr> <tr> - <td class="label"><&|/l&>AdminCc</&>:</td> + <td class="labeltop"><&|/l&>AdminCc</&>:</td> <td class="value"><%$Ticket->AdminCcAddresses%></td> </tr> </table> diff --git a/rt/html/Ticket/Elements/ShowTransaction b/rt/html/Ticket/Elements/ShowTransaction index f2f89d35c..2d710fcbc 100644 --- a/rt/html/Ticket/Elements/ShowTransaction +++ b/rt/html/Ticket/Elements/ShowTransaction @@ -38,8 +38,6 @@ unless ($Collapsed) { $attachments->GotoFirstItem; while (my $message=$attachments->Next) { - #we don't want to show any empty transactions, unless they have kids - next unless ($message->ContentLength || $message->Children->Count); my ($headers, $quoted); if ($ShowHeaders && ($ShowHeaders == $Ticket->Id)) { @@ -53,11 +51,18 @@ unless ($Collapsed) { 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 - my $MAX_INLINE_BODY = 13456; + # 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); + $quoted = Text::Quoted::extract($message->Content); + }; + if ($@) { + $quoted = $message->Content; + } } </%PERL> @@ -69,7 +74,12 @@ unless ($Collapsed) { <PRE> <& ShowMessageHeaders, Headers => $headers, Transaction => $Transaction &> </PRE> +% if (!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 { <& ShowMessageStanza, Depth => 0, Message => $quoted, Transaction => $Transaction &> +% } </span> </TD> <TD VALIGN=TOP ALIGN=RIGHT> @@ -78,7 +88,7 @@ unless ($Collapsed) { <BR> % } <%PERL> -my $size = $message->ContentLength; +my $size = $message->ContentLength or next; if ($size) { if ($size > 1024) { @@ -88,7 +98,7 @@ if ($size) { $size = loc("[_1]b", $size); } </%PERL> -<font size=-1><A HREF="<%$RT::WebPath%>/Ticket/Attachment/<%$Transaction->Id%>/<%$message->Id%>/<%$message->Filename%>"><&|/l&>Download</&> <% $message->Filename|| loc('(untitled)') %></a> <% $size %></font> +<font size=-1><A HREF="<%$AttachPath%>/<%$Transaction->Id%>/<%$message->Id%>/<%$message->Filename | u%>"><&|/l&>Download</&> <% $message->Filename|| loc('(untitled)') %></a> <% $size %></font> % } </TD> </TR> @@ -104,6 +114,7 @@ $ShowHeaders => 0 $Collapsed => undef $ShowTitleBarCommands => 1 $RowNum => 1 +$AttachPath => $RT::WebPath."/Ticket/Attachment" </%ARGS> <%INIT> @@ -147,6 +158,7 @@ if ($Transaction->TimeTaken > 0) { $TimeTaken = $Transaction->TimeTaken." min" } my $attachments = $Transaction->Attachments; +$attachments->Columns( qw( Id Filename ContentType Headers Subject Parent ContentEncoding ContentType TransactionId) ); my $titlebar_commands=' '; diff --git a/rt/html/Ticket/Elements/Tabs b/rt/html/Ticket/Elements/Tabs index 81c92e8c2..cba45df91 100644 --- a/rt/html/Ticket/Elements/Tabs +++ b/rt/html/Ticket/Elements/Tabs @@ -45,11 +45,17 @@ 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; + my $item_map = $session{'tickets'}->ItemMap; - # Don't $current_toptab = display prev links if we're on the first ticket + if ($updatesession) { + $session{'i'}++; + $session{'tickets'}->PrepForSerialization(); + } + # Don't $current_toptab = display prev links if we're on the first ticket if ($item_map->{$Ticket->Id}->{prev}) { $searchtabs->{'_a'} = { class => "nav", diff --git a/rt/html/Ticket/Modify.html b/rt/html/Ticket/Modify.html index c97fd0994..e504a3cba 100644 --- a/rt/html/Ticket/Modify.html +++ b/rt/html/Ticket/Modify.html @@ -46,7 +46,7 @@ my $CustomFields = $TicketObj->QueueObj->CustomFields(); $m->comp('/Elements/Callback', TicketObj => $TicketObj, CustomFields => $CustomFields, %ARGS); my @results = ProcessTicketBasics(TicketObj => $TicketObj, ARGSRef => \%ARGS); -my @cf_results = ProcessTicketCustomFieldUpdates(ARGSRef => \%ARGS); +my @cf_results = ProcessTicketCustomFieldUpdates(TicketObj => $TicketObj, ARGSRef => \%ARGS); push (@results, @cf_results); # TODO: display the results, even if we can't display the ticket diff --git a/rt/html/Ticket/ModifyAll.html b/rt/html/Ticket/ModifyAll.html index a50689398..1163f3fa5 100644 --- a/rt/html/Ticket/ModifyAll.html +++ b/rt/html/Ticket/ModifyAll.html @@ -115,7 +115,7 @@ my (@wresults, @results, @dresults, @lresults, @cf_results); unless ($OnlySearchForPeople) { @wresults = ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS); @results = ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS); - @cf_results = ProcessTicketCustomFieldUpdates(ARGSRef => \%ARGS); + @cf_results = ProcessTicketCustomFieldUpdates( TicketObj => $Ticket, ARGSRef => \%ARGS); @dresults = ProcessTicketDates( TicketObj => $Ticket, ARGSRef => \%ARGS); @lresults = ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS); diff --git a/rt/html/Ticket/ModifyPeople.html b/rt/html/Ticket/ModifyPeople.html index 2e41664d9..debd27a97 100644 --- a/rt/html/Ticket/ModifyPeople.html +++ b/rt/html/Ticket/ModifyPeople.html @@ -44,7 +44,7 @@ my (@results, @wresults); my $Ticket = LoadTicket($id); # if we're trying to search for watchers and nothing else -unless ($OnlySearchForPeople) { +unless ($OnlySearchForPeople or $OnlySearchForGroup) { @results = ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS); @wresults = ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS); } @@ -56,6 +56,7 @@ push @results, @wresults; <%ARGS> $OnlySearchForPeople => undef +$OnlySearchForGroup => undef $UserField => undef $UserOp => undef $UserString => undef diff --git a/rt/html/Ticket/Update.html b/rt/html/Ticket/Update.html index e19aacf6a..ad3b21787 100644 --- a/rt/html/Ticket/Update.html +++ b/rt/html/Ticket/Update.html @@ -23,7 +23,7 @@ %# END LICENSE BLOCK <& /Elements/Header, Title => $title &> <& /Ticket/Elements/Tabs, - Ticket => $Ticket , + Ticket => $TicketObj, Title=> $title &> <FORM ACTION="Update.html" NAME="TicketUpdate" @@ -35,20 +35,20 @@ <TABLE> <TR><TD> -<a href="ModifyPeople.html?id=<%$Ticket->Id%>"><&|/l&>Ticket watchers</&></A></TD><TD align=right> +<a href="ModifyPeople.html?id=<%$TicketObj->Id%>"><&|/l&>Ticket watchers</&></A></TD><TD align=right> <&|/l&>Requestor</&>: </TD><TD> -<b><% $Ticket->RequestorAddresses %></b> +<b><% $TicketObj->RequestorAddresses %></b> </TD></TR> <TR><TD> </TD><TD align=right> <&|/l&>Cc</&>: </TD><TD> -<b><% $Ticket->CcAddresses %></b> +<b><% $TicketObj->CcAddresses %></b> </TD></TR> <TR><TD> </TD><TD align=right> <&|/l&>AdminCc</&>: </TD><TD> -<b><% $Ticket->AdminCcAddresses %></b> +<b><% $TicketObj->AdminCcAddresses %></b> </TD></TR> </TR> </TABLE> @@ -60,7 +60,7 @@ <td> <& /Elements/SelectStatus, Name=>"Status", Default => $DefaultStatus &> <&|/l&>Owner</&>: -<& /Elements/SelectOwner, Name=>"Owner", Default => ($ARGS{'Owner'} || $Ticket->OwnerObj->Id()), QueueObj => $Ticket->QueueObj, TicketObj => $Ticket &> +<& /Elements/SelectOwner, Name=>"Owner", Default => ($ARGS{'Owner'} || $TicketObj->OwnerObj->Id()), QueueObj => $TicketObj->QueueObj, TicketObj => $TicketObj &> <&|/l&>Worked</&>: <input size=4 name="UpdateTimeWorked" value="<% $ARGS{UpdateTimeWorked}%>"> <&|/l&>minutes</&></td></tr> <tr><td align=right><&|/l&>Update Type</&>:</td> <td><select name="UpdateType"> @@ -72,7 +72,7 @@ % } </select> </td></tr> -<tr><td align=right><&|/l&>Subject</&>:</td><td> <input name="UpdateSubject" size=60 value="<% ($ARGS{UpdateSubject}) ? $ARGS{UpdateSubject} : $Ticket->Subject()%>"></td></tr> +<tr><td align=right><&|/l&>Subject</&>:</td><td> <input name="UpdateSubject" size=60 value="<% ($ARGS{UpdateSubject}) ? $ARGS{UpdateSubject} : $TicketObj->Subject()%>"></td></tr> <tr><td align=right><&|/l&>Cc</&>:</td><td> <input name="UpdateCc" size=60 value=<% $ARGS{UpdateCc} %>><BR> <i><font size=-2> @@ -101,12 +101,12 @@ value=<% $ARGS{UpdateCc} %>><BR> <& /Elements/Callback, _CallbackName => 'BeforeMessageBox', %ARGS &> % if (exists $ARGS{UpdateContent}) { % delete $ARGS{'QuoteTransaction'}; -<& /Elements/MessageBox, Name=>"UpdateContent", Default=>$ARGS{UpdateContent}, %ARGS&> +<& /Elements/MessageBox, Name=>"UpdateContent", Default=>$ARGS{UpdateContent}, IncludeSignature => 0, %ARGS&> % } else { <& /Elements/MessageBox, Name=>"UpdateContent", %ARGS &> % } </td></tr> - <INPUT TYPE=HIDDEN NAME=id VALUE="<%$Ticket->Id%>"><br> + <INPUT TYPE=HIDDEN NAME=id VALUE="<%$TicketObj->Id%>"><br> </table> @@ -123,10 +123,10 @@ my $CanRespond = 0; my $CanComment = 0; my $title; -my $Ticket = LoadTicket($id); +my $TicketObj = LoadTicket($id); unless($DefaultStatus){ - $DefaultStatus=($ARGS{'Status'} ||$Ticket->Status()); + $DefaultStatus=($ARGS{'Status'} ||$TicketObj->Status()); } if ($DefaultStatus =~ '^new$'){ @@ -134,9 +134,9 @@ if ($DefaultStatus =~ '^new$'){ } if ($DefaultStatus eq 'resolved') { - $title = loc("Resolve ticket #[_1] ([_2])", $Ticket->id, $Ticket->Subject); + $title = loc("Resolve ticket #[_1] ([_2])", $TicketObj->id, $TicketObj->Subject); } else { - $title = loc("Update ticket #[_1] ([_2])", $Ticket->id, $Ticket->Subject); + $title = loc("Update ticket #[_1] ([_2])", $TicketObj->id, $TicketObj->Subject); } # Things needed in the template - we'll do the processing here, just @@ -150,11 +150,11 @@ if (($Action eq 'Comment') or ($ARGS{'UpdateType'} eq 'private')) { } -$CanRespond = 1 if ( $Ticket->CurrentUserHasRight('ReplyToTicket') or - $Ticket->CurrentUserHasRight('ModifyTicket') ); +$CanRespond = 1 if ( $TicketObj->CurrentUserHasRight('ReplyToTicket') or + $TicketObj->CurrentUserHasRight('ModifyTicket') ); -$CanComment = 1 if ( $Ticket->CurrentUserHasRight('CommentOnTicket') or - $Ticket->CurrentUserHasRight('ModifyTicket') ); +$CanComment = 1 if ( $TicketObj->CurrentUserHasRight('CommentOnTicket') or + $TicketObj->CurrentUserHasRight('ModifyTicket') ); # {{{ deal with deleting uploaded attachments @@ -193,7 +193,7 @@ unless (keys %{$session{'Attachments'}} and $ARGS{'UpdateAttach'}) { # }}} if ( exists $ARGS{SubmitTicket} ) { - $m->comp('Display.html', %ARGS); + $m->comp('Display.html', TicketObj => $TicketObj, %ARGS); return; } </%INIT> |