[Rt-users] Editing a Custom Field on Resolve

Michael S. Liebman m-liebman at northwestern.edu
Fri Apr 16 15:27:35 EDT 2004


As promised, here is a patch against 3.0.10 that will allow you to
edit a Custom Field when you try to resolve a ticket. It only works if
the default action is resolve. It won't work if you click reply and
then change the status to resolve.

To use the patch, copy /path/to/rt3/share/html/Ticket/Update.html to
/path/to/rt3/local/html/Ticket/Update.html. Apply the attached
patch. Edit $CustomFieldName in the <%INIT> section to match the name
of the Custom Field you want to display.

Hope this is helpful to people.

Michael
-- 
Michael S. Liebman                      m-liebman at northwestern.edu
                  http://msl521.freeshell.org/
"I have vision and the rest of the world wears bifocals."
        -Paul Newman in "Butch Cassidy & the Sundance Kid"
-------------- next part --------------
--- share/html/Ticket/Update.html	2003-11-25 22:32:12.000000000 -0500
+++ local/html/Ticket/Update.html	2004-04-16 14:50:39.000000000 -0400
@@ -62,6 +62,20 @@
 <&|/l&>Owner</&>:  
 <& /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>
+
+% # resolution CF if it belongs
+% if($DefaultStatus eq "resolved" and $CustomField->Id) {
+<tr>
+
+<td class="labeltop">
+      <%$CustomField->Name%><br>
+      <i><%$CustomField->FriendlyType%></i>
+</td>
+<td class="entry">
+<& Elements/EditCustomField, CustomField=>$CustomField, TicketObj=>$TicketObj, NamePrefix=>$NamePrefix &>
+</td>
+% }
+</tr>
 <tr><td align=right><&|/l&>Update Type</&>:</td>
 <td><select name="UpdateType">
 % if ($CanComment) {
@@ -123,6 +137,10 @@
 my $CanComment = 0;
 my $title;
 
+my $NamePrefix;
+my $CustomFieldName = "Resolution";
+my $CustomField;
+
 my $TicketObj = LoadTicket($id);
 
 unless($DefaultStatus){
@@ -196,6 +214,10 @@
     $m->comp('Display.html', TicketObj => $TicketObj, %ARGS);
     return;
 }
+
+$NamePrefix = "Ticket-".$TicketObj->Id."-CustomField-";
+$CustomField = $TicketObj->QueueObj->CustomField($CustomFieldName);
+
 </%INIT>
 
 <%ARGS>


More information about the rt-users mailing list