package TTXReports; # # This module is a part of Trouble Ticket Express package # http://www.troubleticketexpress.com # # COPYRIGHT: 2002-2005, United Web Coders # http://www.unitedwebcoders.com # # $Revision: 224 $ # $Date: 2006-07-24 11:32:24 -0400 (Mon, 24 Jul 2006) $ # $TTXReports::VERSION='2.22'; BEGIN { $TTXReports::REVISION = '$Revision: 224 $'; if ($TTXReports::REVISION =~ /(\d+)/) { $TTXReports::REVISION = $1; } }; use strict; use TTXCommon; use TTXConfig; require TTXUser; require TTXBarChart; require TTXDictionary; my @months = ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); # =================================================================== checkpoint sub checkpoint { my $cfg = $_[0]; my $grantlist = $cfg->get('grant.reports'); if ($grantlist ne undef) { my $uid = $cfg->get('_USER')->get('login'); if (!grep(/^$uid$/, split(/,/,$grantlist))) { return 0; } } return 1; } # ========================================================================= main sub main { my ($cfg, $query, $data) = @_; return 'helpdesk' if !checkpoint($cfg); for (my $i = 0; $i < 12; ++$i) { $months[$i] = TTXDictionary::translate($months[$i]); } my $basewidth = $cfg->get('HTMLBASEWIDTH') || 700; my %rtitle = ( overview => 'Overview', operperf => 'Operator Performance', aging360 => 'Ticket Aging', aging => 'Hot Tickets', slevel => 'Service Level' ); $data->{PAGEHEADING} = '[%Reports%]'; $data->{REPORTQUERY} =<