Mandi! Bob Crandell
  In chel di` si favelave...

> Am I missing something?

No. See the message attached, i've solved the problem making two views
(i'm using postgres) with the query attached.

That queries partially works, sometime list some address two time,
sometime miss some addresses... i've not debug that views very well
because our experimental hylafax server crashed and never go back. ;(

-- 
dott. Marco Gaiarin                                 GNUPG Key ID: 240A3D66
  Associazione ``La Nostra Famiglia''                http://www.sv.lnf.it/
  Polo FVG  -  Via della Bontà, 7 - 33078  -  San Vito al Tagliamento (PN)
  gaio(at)sv.lnf.it             tel +39-0434-842711    fax +39-0434-842797

        Per favore, aiutate gli Stati Uniti a salvarsi dai brevetti sul
                 software, salvando innanzitutto voi stessi.
                http://punto-informatico.it/p.asp?i=52786&p=2
--- Begin Message ---
Mandi! Marco Gaiarin
  In chel di` si favelave...

> Oh, good idea, i'm using postgres so views are supported... but is not
> viable, at least for my SQL/PG knowledge...
> I can make some correlation (join) between people and addresses, but
> when i try to join the comm infos, they are organized very different
> for a flat table, so i can extract only one information (eg, the work
> fax) for addresses.

Ok, at least for what i've to do (make the phpgw adressbook usable from
whfc HylaFax client) i've solved my problem.
I'm lucky, whfc support two tables, so i've done two view, one to
extract addresses and phone number, another to extract fax number.


I'm very happy, i attach the query in hope to be usefoul...

-- 
dott. Marco Gaiarin                                 GNUPG Key ID: 240A3D66
  Associazione ``La Nostra Famiglia''                http://www.sv.lnf.it/
  Polo FVG  -  Via della Bontà, 7 - 33078  -  San Vito al Tagliamento (PN)
  gaio(at)sv.lnf.it             tel +39-0434-842711    fax +39-0434-842797

    ... votantoniovotantoniovotantoniovotantoniovotantoniovotantonio ...
             resistenza arcobaleno contro la politica grigia

                    http://www.peacelink.it/votantonio
SELECT phpgw_contact_person.first_name || ' ' ||
        phpgw_contact_person.last_name || ' (' || 
        phpgw_contact_org.name || ')' AS id,
        phpgw_contact_person.title || ' ' ||
        phpgw_contact_person.first_name || ' ' ||
        phpgw_contact_person.last_name AS nome,
        phpgw_contact_org.name || ' - ' ||
        phpgw_contact_person.department AS ditta,
        phpgw_contact_addr.add1 || ' ' ||
        phpgw_contact_addr.postal_code || ' ' ||
        phpgw_contact_addr.city || ' (' ||
        phpgw_contact_addr.state || ') ' ||
        phpgw_contact_addr.country AS indirizzo,
        phpgw_contact_comm.comm_data AS telefono
FROM phpgw_contact, phpgw_contact_addr, phpgw_contact_comm,
        phpgw_contact_org, phpgw_contact_org_person, phpgw_contact_person
WHERE phpgw_contact_person.person_id = phpgw_contact.contact_id AND
phpgw_contact_person.person_id = phpgw_contact_org_person.person_id AND
        phpgw_contact_org_person.org_id = phpgw_contact_org.org_id AND
        phpgw_contact_org.org_id = phpgw_contact_addr.contact_id AND
phpgw_contact_addr.contact_id = phpgw_contact_comm.contact_id AND
((phpgw_contact.contact_type_id=1) AND (phpgw_contact.access='public') AND
(phpgw_contact_comm.comm_descr_id=4));


SELECT phpgw_contact_person.first_name || ' ' ||
        phpgw_contact_person.last_name || ' (' || 
        phpgw_contact_org.name || ')' AS id,
        phpgw_contact_comm.comm_data AS fax
FROM phpgw_contact, phpgw_contact_comm,
        phpgw_contact_org, phpgw_contact_org_person, phpgw_contact_person
WHERE phpgw_contact_person.person_id = phpgw_contact.contact_id AND
phpgw_contact_person.person_id = phpgw_contact_org_person.person_id AND
        phpgw_contact_org_person.org_id = phpgw_contact_org.org_id AND
        phpgw_contact_org.org_id = phpgw_contact_comm.contact_id AND
((phpgw_contact.contact_type_id=1) AND (phpgw_contact.access='public') AND
(phpgw_contact_comm.comm_descr_id=13));



_______________________________________________
Phpgroupware-users mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/phpgroupware-users

--- End Message ---
_______________________________________________
Phpgroupware-users mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/phpgroupware-users

Reply via email to