[turba] Dynamic SQL lookup enum attributes

Chuck Hagenbuch chuck at horde.org
Mon Feb 18 22:00:28 UTC 2008


Quoting Peter Paul Elfferich <pp at dia.uva.nl>:

> I'm currently experimenting with accessing our mailing database with Turba.
> This is a relational database using foreign keys to refer to values from
> different tables. By using left joins in the table definition in
> sources.phpthe proper values are displayed in Turba, but I'd also like
> to be able to edit these values.
>
> Is it possible to define a dynamic enum in attributes.php which looks up
> keys and values from related tables? I'd like the values to be listed in a
> pulldown/list and the key to be stored back into the address table when you
> edit the record in turba.

Sure, just put the database code to read the enum into attributes.php.

> We also have N:N related information meaning multiple values from another
> table can be related to an address record through an extra table referring
> to the address table and the other table. (if table x is the address book
> table and table z is a table with relatable values then a table y record
> contains a column referring to x.id and a column referring to z.id). I would
> also like to be able to display and edit these relations in turba using
> multiple selection lists. Is such a thing possible already or is something
> like this in the works?

You might be able to do this with custom code in attributes.php, or  
with hooks. It'd probably take a custom form type to render the UI for  
it, though.

-chuck


More information about the turba mailing list