ParamObject alle Parameter abrufen

English! place to talk about development, programming and coding
Post Reply
Sid
Znuny newbie
Posts: 27
Joined: 27 Aug 2007, 13:50

ParamObject alle Parameter abrufen

Post by Sid »

Hallo,
kennt jmd einen Workaround wie man im ParamObject (oder irgendwie sonst) ein Array/einen Hash aller Parameter bekommen kann?
Bräuchte das für eine Erweiterung, da ich die keys der Parameter nicht im voraus weiß...
icepizza
Znuny newbie
Posts: 16
Joined: 25 May 2007, 11:06

ParamObject alle Parameter abrufen

Post by icepizza »

Hallo

Willst du einfach wissen was für Objekte in ParamObject enthalten sind?
Test: OTRS 2.3.3 - Suse 10.1
framaba
Znuny advanced
Posts: 109
Joined: 09 Oct 2006, 17:43

ParamObject alle Parameter abrufen

Post by framaba »

Ich hatte mal die Keys von %Ticket wissen wollen, geht mit anderen Hashes dito.


foreach (keys %Ticket) {
$list = $list.$_.":".$Ticket{$_}.",";
}
$Self->{LogObject}->Log(Priority => 'Notice', Message => "$list");
PROD: SLES 9 (x86_64), mysql 5.0.24a, Apache/2.0.49, OTRS 2.0.4
DEVEL: SunOS 5.10, mysql 5.0.51a, Apache/2.2.4, OTRS 2.0.4
Sid
Znuny newbie
Posts: 27
Joined: 27 Aug 2007, 13:50

ParamObject alle Parameter abrufen

Post by Sid »

Ja will wissen welche keys überhaupt vorhanden sind...

habe folgendes mal gemäß CGI modul in Request.pm eingefügt und es klappt ganz gut...

=item GetAllParams()

to get all params as hash

my %Params = $ParamObject->GetAllParams();

=cut

sub GetAllParams {
my $Self = shift;
return $Self->{Query}->Vars();

}
Post Reply