
Hi Thomas, Thomas Raith schrieb:
Hi Alex,
The question is: * how can a table (x,y) be "rotated" to (y,x) (sorry, I'm a perl newbie - could you give me a code snip) or
8<----------------------------------------------------- my @NewStatArray = (); my $Title = shift(@StatArray); foreach my $Key1 (0..$#StatArray) { foreach my $Key2 (0..$#{$StatArray[0]}) { $NewStatArray[$Key2][$Key1] = $StatArray[$Key1][$Key2]; } } $NewStatArray[0][0] = ''; unshift(@NewStatArray, [$Title]); @StatArray = @NewStatArray; ------------------------------------------------------>8
Thanks a lot for you help! I wanted to move your code * from an specific Stat-extension on ~/Kernel/System/Stats/. (where it works) * to ~/Kernel/Module/SystemStats.pm (about line 170) to be executed on certain conditions #-------------------------- my $TitleArrayRef = shift (@Data); my $Title = $TitleArrayRef->[0]; my @NewData = (); foreach my $Key1 (0..$#Data) { foreach my $Key2 (0..$#{$Data[0]}) { $NewData[$Key2][$Key1] = $Data[$Key1][$Key2]; } } @Data = @NewData; my $HeadArrayRef = shift (@Data); #-------------------------- This code seems not to be executed - why? I also edited some other parts in SystemStats.pm but I couldn't recognize any changes in OTRS-behaviour - why? One further problem: My own statistics work fine with print output format, but often apache-errors are sent to the client on graphical output: Some combinations of graph-output-types and resolutions work, others don't. apache-error-log contains: [Tue May 16 07:50:11 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 4. [Tue May 16 07:50:17 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 16. [Tue May 16 07:50:24 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 8. [Tue May 16 07:50:28 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 4. [Tue May 16 07:51:32 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 4. *** glibc detected *** free(): invalid pointer: 0x09be6364 *** [Tue May 16 07:51:37 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 8. [Tue May 16 07:51:47 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 8. *** glibc detected *** free(): invalid pointer: 0x09b971b4 *** [Tue May 16 07:51:51 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 12. [Tue May 16 07:52:48 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 4. [Tue May 16 07:52:54 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 4. [Tue May 16 07:52:58 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 4. [Tue May 16 07:54:31 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 340. [Tue May 16 07:55:01 2006] null: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/SystemStats.pm line 274, <PRODUCT> l ine 8. *** glibc detected *** free(): invalid pointer: 0x09bedef4 *** Do you know this problem?
With kind regards
Thomas
PS: I make a dynamic-statistic-module for OTRS 2.1. Then it is very easy to make stat settings. In a few month OTRS 2.1 is available.
That sounds great! Bye, Alex