Hello all,

When I do have a related set of tickets for a customer, that I want to
close with a bulk action I can add 'spent time' to this ticket.
After this I see in the accounting tables that every ticket gets this
time assigned. But this is not what we want. We want to enter the total
time used in the bulk action.

To get this done I created a tiny patch for the AgentTicketBulk.pm file.
This just checks if this is the first ticket in a bulk action and if so
it is accounted. If not, no accounting record is created.
This behaviour is selectable with a configuration option in the
Config.pm, called 'CountOneTime'.

I am not a Perl guru, so it could be that this has to be done in a more
intelligent way. But I would like to propose this as a patch to the new
OTRS version.

Patch is attached.

Comments are welcome.

Cheers,
        TonK

-- 
AT Computing
Linux/UNIXperts,
opleiders & oplossers           Tel +31 24 352 72 82
Kerkenbos 12-38                 Tel cursussecretariaat: +31 24 352 72 72
6546 BE  Nijmegen               Fax +31 24 352 72 92
Postbus 1428                    i...@atcomputing.nl
6501 BK  Nijmegen               www.atcomputing.nl

'If you think education is expensive, then try ignorance.'
--- otrs-3.0.4-org/Kernel/Modules/AgentTicketBulk.pm    2010-11-23 
22:56:02.000000000 +0000
+++ otrs-3.0.4/Kernel/Modules/AgentTicketBulk.pm        2011-01-04 
08:38:49.000000000 +0000
@@ -158,6 +158,9 @@
     }
 
     # process tickets
+    my $FirstTicket  = 'Yes';
+    my $CountOneTime = $Self->{ConfigObject}->Get('TicketAccountingCountOne');
+
     my @TicketIDSelected;
     my $ActionFlag = 0;
     TICKET_ID:
@@ -349,13 +352,16 @@
 
             # time units
             if ( $GetParam{'TimeUnits'} ) {
-                $Self->{TicketObject}->TicketAccountTime(
-                    TicketID  => $TicketID,
-                    ArticleID => $ArticleID,
-                    TimeUnit  => $GetParam{'TimeUnits'},
-                    UserID    => $Self->{UserID},
-                );
+                if ( ($CountOneTime == 0) || ($FirstTicket eq 'Yes') ) {
+                    $Self->{TicketObject}->TicketAccountTime(
+                        TicketID  => $TicketID,
+                        ArticleID => $ArticleID,
+                        TimeUnit  => $GetParam{'TimeUnits'},
+                        UserID    => $Self->{UserID},
+                    );
+                }
             }
+            $FirstTicket = 'No';
 
             # merge to
             if ( $GetParam{'MergeToSelection'} eq 'OptionMergeTo' && 
$GetParam{'MergeTo'} ) {
---------------------------------------------------------------------
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs

Reply via email to