[dev] Own Statistic extensions

Thomas Raith thomas.raith at otrs.com
Mon May 15 17:27:06 CEST 2006


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

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.


More information about the dev mailing list