
Hi, I wrote a report module for OTRS. Here's what README file provided in tar.gz in attached to this message says. Report module for OTRS (Ticket Timings) --------------------------------------- Created by Damir Dzeko, based on code of AgentUtilities module written by Martin Edenhofer, the author of OTRS, with a lot of help of Edgar Meij. Unpack this where appropriate. I've used slightly modified version of Standard theme called Redwood and so the template files and icons are located there. Feel free to move them wherever you need them. You'll need to manually edit files: Kernel/Config/Defaults.pm Kernel/Config/ModulesCustom.pm Parts that need to be added/edited are provided in files: Kernel/Config/Defaults.pm.Report Kernel/Config/ModulesCustom.pm.Report which can later be removed. For date calculations module Date::Manip is used. It is not provided and you'll have to install it manually either from CPAN or as a package in your favourite software distribution. Me being a user of Debian GNU/Linux did it with: apt-get install libdate-manip-perl For business time calculations (workhours and workdays) Date::Manip needs to know of holidays in your country. I live in Croatia and so I wrote the .DateManip.cnf.hr which you can modify and use. You'll need to rename it to .DateManip.cnf and place in the home-directory of user who will be running scripts. On Debian systems such user is called www-data. So I placed .DateManip.cnf in it's home: /var/www. For you it might be different. I refer you to read documentation of Date::Manip. User who will be accessing the module through web-interface needs to have sufficient privileges in stats group or else OTRS wont even show him the icon/link to module. Business logic is located in the module itself: Kernel/Modules/Report.pm. There are few things to consider there. I used very simple logic that calculates three timings: - total time the ticket got updated (from first to last history record) - time the customer spent waiting for first real answer from agent - total time customer spent waiting for answer from agent All three timings are returned as both real time (real wallclock minutes) and business minutes. A day of business is calculated as 8 hours (hard- coded) if the period falls into one working week (5 days). For larger periods a day is 24 hours (converted to minutes that is 1440). I did not cover phone-calls nor cases when agent opens ticket (and many other strange cases when ticket gets reopened, ...). I encourage you to do it yourself by modifying function TicketTimes(). Happy hacking, Damir

Hi Damir, Damir Dzeko wrote:
I wrote a report module for OTRS.
Here's what README file provided in tar.gz in attached to this message says.
Report module for OTRS (Ticket Timings) --------------------------------------- [...]
I tested it. It's really cool! :) And I like the idea of business minutes... Your package is a really good module. :) I want also provide infos about OTRS 2.0 (current cvs head) so maybe it helps you to port this module some day to OTRS 2.0. :) The Kernel::System::Time got one new key function: [http://dev.otrs.org/] WorkingTime() get the working time in secondes between this times my $WorkingTime = $TimeObject->WorkingTime( StartTime => $Created, StopTime => $Self->SystemTime(), ); [...] It calculates the working time between StartTime and StopTime (witch is also used in the frontend of OTRS 2.0) based on Kernel/Config.pm options: [...] # TimeWorkingHours # (counted hours for working time used) $Self->{TimeWorkingHours} = { Mon => [ 8,9,10,11,12,13,14,15,16,17,18,19,20 ], Tue => [ 8,9,10,11,12,13,14,15,16,17,18,19,20 ], Wed => [ 8,9,10,11,12,13,14,15,16,17,18,19,20 ], Thu => [ 8,9,10,11,12,13,14,15,16,17,18,19,20 ], Fri => [ 8,9,10,11,12,13,14,15,16,17,18,19,20 ], Sat => [ ], Sun => [ ], }; # TimeVacationDays # adde new days with: # "$Self->{TimeVacationDays}->{10}->{27} = 'Some Info';" $Self->{TimeVacationDays} = { 1 => { 01 => 'New Year\'s Eve!', }, 5 => { 1 => '1 St. May', }, 12 => { 24 => 'Christmas', 25 => 'First Christmas Day', 26 => 'Second Christmas Day', 31 => 'Silvester', }, }; # TimeVacationDaysOneTime # adde new own days with: # "$Self->{TimeVacationDaysOneTime}->{1977}-{10}->{27} = 'Some Info';" $Self->{TimeVacationDaysOneTime} = { # 2004 => { # 6 => { # 07 => 'Some Day', # }, # 12 => { # 24 => 'Some A Day', # 31 => 'Some B Day', # }, # }, }; [...] PS: An I also post on the dev list about a new OTRS package format. So it's easier to provied own written modules. :) Thanks Damir! Martin Edenhofer -- ((otrs.de)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg http://www.otrs.de/ :: Manage your communication!
participants (2)
-
Damir Dzeko
-
Martin Edenhofer