a bit confused about ors developers api

English! place to talk about development, programming and coding
Post Reply
eandrex
Znuny expert
Posts: 213
Joined: 04 Nov 2012, 23:58
Znuny Version: OTRS 4.x
Real Name: Esteban
Company: NORTON DE COLOMBIA

a bit confused about ors developers api

Post by eandrex »

So i was reading (http://doc.otrs.org/developer/3.1/en/ht ... rview.html)

and i saw that by default there a basic frameworks object such as:

ParamObject (to get formular params), DBObject (to use existing databse connects), LayoutObject (to use templates and other html layout functions), ConfigObject (to access config settings), LogObject (to use the framework log system), UserObject (to get the user functions from the current user), GroupObject (to get the group functions).

if know LayoutObject is used for html output(i used it for my hello world module "$Output .= $Self->{LayoutObject}->NavigationBar();"....etc)

but, the thing is, what about others modules?
for example "UserObject"

I guess i can see its subs here (http://dev.otrs.org/) under Kernel::System::User?

and there, there is a method called "GetUserData()"

Code: Select all

        my %User = $UserObject->GetUserData(
            UserID => 123,
        );

        or

        my %User = $UserObject->GetUserData(
            User          => 'franz',
            Valid         => 1,       # not required -> 0|1 (default 0)
                                      # returns only data if user is valid
            NoOutOfOffice => 1,       # not required -> 0|1 (default 0)
                                      # returns data without out of office infos
        );
but what if i want to see the data of current logged agent and i dont know his UserID??

thank you :)
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: a bit confused about ors developers api

Post by reneeb »

Agent frontendmodule always know the UserID of the currently logged in agent. It is stored in "$Self->{UserID}"...
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Post Reply