Hello!
Another piece of code, which really needs some love.
phpgwapi/inc/class.uiaccountsel.inc.php extends the class accounts which
extends accounts_backend.
The constructor of uiaccountsel calls the constructor of accounts which
calls the constructor accounts_backend.
The first problem is that now any public variable from the backend class is
now available in the frontend class. Suppose you define a class variable
with the same name as defined in the accounts_backend class. You will never
know until you started reading the code of the backend class.
As the constructor calls the constructor and calls the constructor, you
don’t use the shared resource to the accounts backend($GLOBALS[‘account’]
for example) but instead you create another connection to the accounts
backend(LDAP for example).
And what’s even more worse. The uiaccountsel is resolving all all your group
members by default. If you are in a big group, this can be many accounts.
If you like to get your task displayed on the startpage, you will include
infolog on the startpage. Which means uiaccountsel get’s used. What happens
if you only want to check your emails and have home as default application.
All your group members get resolved(can be many) but you never will use the
information.
How did we solve this for Tine 2.0?
Big lists like the user list, can be loaded on demand. In the first step we
just display a combo box which just displays the currently selected user. If
the user likes to select another user, we are doing a json request to fetch
the needed data on demand.
Lars Kneschke
CTO OfficeSpot.Net
Metaways Infosystems GmbH
Pickhuben 2-4, D-20457 Hamburg
eGroupWare Support: http://www.egroupware-support.net
OfficeSpot.Net Collaboration Server: http://cs.officespot.net
our proposal for the next major eGroupWare release: http://www.tine20.org
E-Mail: mailto:l.kneschke@metaways.de
Web: http://www.metaways.de
Tel: +49 (0)40 317031-21
Fax: +49 (0)40 317031-921
Mobile: +49 (0)175 9304324
Metaways Infosystems GmbH - Sitz: D-22967 Tremsbüttel
Handelsregister: Amtsgericht Ahrensburg HRB 4508
Geschäftsführung: Hermann Thaele, Lüder-H.Thaele