phpgroupware-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Phpgroupware-developers] db object?


From: Ralf Becker
Subject: Re: [Phpgroupware-developers] db object?
Date: Thu, 21 Mar 2002 09:37:15 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-DE; rv:0.9.4) Gecko/20011019 Netscape6/6.2

Hi Peter,

you might look at phpgwapi/inc/class.sbox2.inc.php, there is a function GetAdress which does exactly what you are looking for. It shows a button to search the adressbook and the selected address or (after a search) a selectbox to select within the result of the search. You might have a look into infolog for the look and feel or see the documentation within the class-file.

Ralf

Peter Moulding wrote:

I fiddled with db objects in tts but ran aground. Perhaps someone could
provide some guidance on the phpGroupWare way.

I added an extra field, ticket_company, to tts. ticket_company contains
phpgw_addressbook.id. I tried to model it on group so every where group
exists, I copied the code and changed group to company. That worked.

Company has to appear as name so I looked at the accounts code and tried
to use similar code to access phpgw_addressbook.org_name via
phpgw_addressbook.id. That did not work.

To get the code working, I wrote my own function in
tts/functions.inc.php and have the function cache the result from the
top of the page so there are no database accesses when the tts code is
accessing the database.

What I want to do is use the correct phpGroupWare way of accessing a
database from anywhere on a page even when there are other database
actions in progress. I presume that means creating a new db object. Is
there a simple example I can copy in one of the applications?

The data is returned to an array for lookup and is currently stored in a
static variable. It could be of the form:
$GLOBALS['phpgw']['addressbook'][phpgw_addressbook.id]['org_name'] =
"value";
What is the phpGroupWare way of retaining a lookup list for all pages
within one application?

The company name is retrieved from the table multiple times in the tts
ticket view page and there are multiple lookups in the tts index page.
Because of the small number of company names involved, it is more
efficient to perform one SQL request on first usage than to perform a
series of discrete requests. The total list is then used to prime drop
down boxes. There may be other pages where I want just one entry.

Once I get the hang of your db extraction and global table, I should be
able to work on any of the apps.

Peter

_______________________________________________
Phpgroupware-developers mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/phpgroupware-developers




--
----------------------------------------------------------------------
Ralf Becker
OUTDOOR UNLIMITED Training GmbH                Telefon 0631 / 31657-0
Leibnizstraße 17                               Telefax 0631 / 31657-26
D-67663 Kaiserslautern            EMail address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]