[rt-users] AutoTake - where?
Phil Homewood
pdh at snapgear.com
Sat Jun 1 07:47:55 EDT 2002
Phil Homewood wrote:
> I posted a patch to webrt/Ticket/Update.pm to rt-devel on
> April 25; I subsequently decided it was Too Damn Ugly and
> rewrote it. See attached.
Ack, and that patch got garbled, it seems. Try this one.
-------------- next part --------------
Index: Update.html
===================================================================
RCS file: /cvs/local/rt/webrt/Ticket/Update.html,v
retrieving revision 1.1.1.3
diff -u -r1.1.1.3 Update.html
--- Update.html 23 Jan 2002 00:47:58 -0000 1.1.1.3
+++ Update.html 1 Jun 2002 11:46:31 -0000
@@ -33,7 +32,7 @@
<td>
<& /Elements/SelectStatus, Name=>"Status", Default => $DefaultStatus &>
Owner:
-<& /Elements/SelectOwner, Name=>"Owner", Default => $Ticket->OwnerObj->Id(), QueueObj => $Ticket->QueueObj, TicketObj => $Ticket &>
+<& /Elements/SelectOwner, Name=>"Owner", Default => $DefaultOwner, QueueObj => $Ticket->QueueObj, TicketObj => $Ticket &>
Worked: <input size=4 name="UpdateTimeWorked"> minutes</td></tr>
<tr><td align=right>Update Type:</td>
<td><select name="UpdateType">
@@ -73,6 +72,7 @@
my $CanRespond = 0;
my $CanComment = 0;
my $title;
+my $DefaultOwner;
my $Ticket = LoadTicket($id);
@@ -91,6 +91,15 @@
my $ResponseDefault=$Action eq "Respond" ? "SELECTED" : "";
$DefaultStatus = $Ticket->Status() unless ($DefaultStatus);
+if ($Ticket->OwnerObj->Id == $RT::Nobody->Id() &&
+ $session{'CurrentUser'}->HasQueueRight(Right => 'OwnTicket',
+ QueueObj => $Ticket->QueueObj,
+ TicketObj => $Ticket)) {
+ $DefaultOwner=$session{'CurrentUser'}->Id;
+} else {
+ $DefaultOwner=$Ticket->OwnerObj->Id();
+
+}
$CanRespond = 1 if ( $Ticket->CurrentUserHasRight('ReplyToTicket') or
$Ticket->CurrentUserHasRight('ModifyTicket') );
More information about the rt-users
mailing list