Hi there,

Attached is a patch to enable a 'RequiredLock' setting for 
Frontend::Module::AgentTicketBulk, much like other frontend modules have a 
similar setting, based on rel-2_4.

Kind regards,

-- 
Jeroen van Meeuwen
Senior Engineer, Kolab Systems AG

e: [email protected]
t: +316 42 801 403
w: http://www.kolabsys.com

pgp: 9342 BF08
From 560afde81846de1a8857f32b4d22f7bf1ed2f48f Mon Sep 17 00:00:00 2001
From: Jeroen van Meeuwen (Ergo Project) <[email protected]>
Date: Wed, 23 Jun 2010 19:57:51 +0200
Subject: [PATCH 09/10] Enable locking configuration in Agent Ticket Bulk actions;

  Set $Self->{'Frontend::Module::AgentTicketBulk'}->{'RequiredLock'} = 0; to disable locking in Ticket Bulk actions
---
 Kernel/Modules/AgentTicketBulk.pm |   50 ++++++++++++++++++++-----------------
 1 files changed, 27 insertions(+), 23 deletions(-)

diff --git a/Kernel/Modules/AgentTicketBulk.pm b/Kernel/Modules/AgentTicketBulk.pm
index 9f996ee..d3716aa 100644
--- a/Kernel/Modules/AgentTicketBulk.pm
+++ b/Kernel/Modules/AgentTicketBulk.pm
@@ -90,30 +90,37 @@ sub Run {
             next;
         }
 
-        # check if it's already locked by somebody else
-        if ( $Self->{TicketObject}->LockIsTicketLocked( TicketID => $TicketID ) ) {
-            my $AccessOk = $Self->{TicketObject}->OwnerCheck(
-                TicketID => $TicketID,
-                OwnerID  => $Self->{UserID},
-            );
-            if ( !$AccessOk ) {
-                $Output .= $Self->{LayoutObject}->Notify(
-                    Info => 'Ticket %s is locked for an other agent!", "$Quote{"'
-                        . $Ticket{TicketNumber}
-                        . '"}',
+        $Param{TicketIDHidden} .= "<input type='hidden' name='TicketID' value='$TicketID'>\n";
+
+        if ( $Self->{Config}->{RequiredLock} ) {
+            # check if it's already locked by somebody else
+            if ( $Self->{TicketObject}->LockIsTicketLocked( TicketID => $TicketID ) ) {
+                my $AccessOk = $Self->{TicketObject}->OwnerCheck(
+                    TicketID => $TicketID,
+                    OwnerID  => $Self->{UserID},
                 );
-                next;
+                if ( !$AccessOk ) {
+                    $Output .= $Self->{LayoutObject}->Notify(
+                        Info => 'Ticket %s is locked for an other agent!", "$Quote{"'
+                            . $Ticket{TicketNumber}
+                            . '"}',
+                    );
+                    next;
+                }
             }
-        }
 
-        $Param{TicketIDHidden} .= "<input type='hidden' name='TicketID' value='$TicketID'>\n";
+            # set lock
+            $Self->{TicketObject}->LockSet(
+                TicketID => $TicketID,
+                Lock     => 'lock',
+                UserID   => $Self->{UserID},
+            );
 
-        # set lock
-        $Self->{TicketObject}->LockSet(
-            TicketID => $TicketID,
-            Lock     => 'lock',
-            UserID   => $Self->{UserID},
-        );
+            $Output .= $Self->{LayoutObject}->Notify(
+                Data => $Ticket{TicketNumber} . ': $Text{"Ticket locked!"}',
+            );
+
+        }
 
         # set user id
         $Self->{TicketObject}->OwnerSet(
@@ -121,9 +128,6 @@ sub Run {
             UserID    => $Self->{UserID},
             NewUserID => $Self->{UserID},
         );
-        $Output .= $Self->{LayoutObject}->Notify(
-            Data => $Ticket{TicketNumber} . ': $Text{"Ticket locked!"}',
-        );
 
         # do some actions on tickets
         if ( $Self->{Subaction} eq 'Do' ) {
-- 
1.7.0.1

---------------------------------------------------------------------
OTRS mailing list: dev - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/dev
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev

NEW! ENTERPRISE SUBSCRIPTION - Get more information NOW!
http://www.otrs.com/en/support/enterprise-subscription/

Reply via email to