phpgroupware-developers
[Top][All Lists]
Advanced

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

Re: [Phpgroupware-developers] Information sharing between modules


From: Dave Hall
Subject: Re: [Phpgroupware-developers] Information sharing between modules
Date: Fri, 16 Aug 2002 09:31:14 +1000

Hi Chris and Brian,

Chris Weiss <address@hidden> wrote:
> I've done this to tts in a way that might work for everything.  I 
> added 2
> fields, reference_app and reference_id.  reference_app i fill in 
> with my
> app's name, and reference_id with the record id in my app.  this 
> way I can do
> joins where reference_app = myapp and reference_id=myid for 
> displaying data
> from my app.  Would be trivial to have the other app check to see 
> if these
> fields are populated before deleting.

This is good, but there is one problem ... it restricts you to a
One-to-One relationship between the contact and your app.  It would be
better to have the possibility of many-to-many relationship between the
contact data and the various apps.  For the stuff I am doing I am
planning to link to the addressbook quite extensively.  

I think this can be adapted to i have done mine as a link table in my
app ... but it could become an addressbook/api table.  This is all from
memory so please imagine any mistakes are corrected :)

TABLE: addressbook_links
link_id - INT AUTO_INCREMENT PRIMARY KEY
contact_id - INT - FK phpgw_addressbook.addressbook_id
app_id - INT - FK appname.app_id (the primary key of the app record)
app_name - VARCHAR(50) - the name of the app it is linking to.

I simple check could be added to the delete method so it call this
method, before deleting:
check_links($id)
{
  $GLOBALS['phpgw']->db->query("SELECT link_id FROM addressbook_links
WHERE contact_id=$id);
  if(($GLOBALS['phpgw']->db->num_found())==0)
  {
    return true;
  }
  else
  {
    return false;
  }
}

Anyway, Just a thought

Cheers

skwashd
Dave Hall

> 
> Brian Johnson (address@hidden) wrote*:
> >
> >Is there an established method (even if just a concept) to link 
> informationbetween
> >modules?  A standard method would be good since many modules 
> require contact
> >information and I couldn't find a current, practical way to do this
> >
> >I don't mean I can't get info, I mean we need a method to prevent 
> the other
> module
> >from deleting records that I'm linking to
> >
> >Currently my only solution seems to be to copy a module I like 
> and add it as
> a
> >customized module to the module I'm working on.  It seems a 
> stupid way to do
> it when
> >the other module with the information is right there
> >
> >
> >
> >_______________________________________________
> >Phpgroupware-developers mailing list
> >address@hidden
> >http://mail.gnu.org/mailman/listinfo/phpgroupware-developers
> >
> 
> 
> 
> _______________________________________________
> Phpgroupware-developers mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/phpgroupware-developers
> 

Attachment: dave.hall.vcf
Description: Card for <dave.hall@mbox.com.au>


reply via email to

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