CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • how are civicrm_event and civicrm_address joined?
Pages: [1]

Author Topic: how are civicrm_event and civicrm_address joined?  (Read 966 times)

usr238496

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 0
  • CiviCRM version: latest
  • CMS version: joomla2.5
  • PHP version: 5 something
how are civicrm_event and civicrm_address joined?
June 20, 2012, 04:00:10 pm
When I create an event, after setting up the main event details (tab1),  the event is saved as a record of the table civicrm_event.

Then when I complete and save tab2 (location details), a record of the civicrm_address is created with the details.

But I cannot seem to find a mapping table, that links the two and the event table doesn't store the id of the address record and the address record doesn't store the event id.

There, must be something somewhere that provides a link.

You did not answer the verification questions correctly - sigh

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: how are civicrm_event and civicrm_address joined?
June 20, 2012, 07:58:01 pm

check:

civicrm_loc_block

used for all non-contact related email/address/phone etc

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

usr238496

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 0
  • CiviCRM version: latest
  • CMS version: joomla2.5
  • PHP version: 5 something
Re: how are civicrm_event and civicrm_address joined?
June 21, 2012, 11:47:30 am
Thanks, but that doesn't seem to be what I am after.

Basicaly, I am trying to pipe all civi events to a google calender.

On the civicrm_post to database hook, I can detect a new event record being created, pull the information I want from that and pipe it to google calender no problems.

But I want to also store the location of the event in g. Calender aswell.

So when the db address record is saved, I can detect this, but I now need to pull the associate event record for this address record as I have a mapping table that maps G.Calender uri to the event record id. So in order to get the gCalender uri I need the event record ID so I can add the details from the location record being saved.

So I need to go from address .ID to event.ID and I cannot seem to find a join anywwhere
You did not answer the verification questions correctly - sigh

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: how are civicrm_event and civicrm_address joined?
June 21, 2012, 02:07:56 pm

I assume u know civievent exposes various rss / ical feeds that can be used to integrate between various calendaring systems. Check:

http://drupal.demo.civicrm.org/civicrm/event/manage?reset=1

and the buttons on the right

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

usr238496

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 0
  • CiviCRM version: latest
  • CMS version: joomla2.5
  • PHP version: 5 something
Re: how are civicrm_event and civicrm_address joined?
June 21, 2012, 05:08:29 pm
Assumption wrong, did not know that :)

Access denied on the link btw
You did not answer the verification questions correctly - sigh

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: how are civicrm_event and civicrm_address joined?
June 22, 2012, 06:50:31 am

you will need to login to the demo server as demo / demo

Might help if you read the books @ http://book.civicrm.org/ to give you a broader idea of the various things civicrm can do

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

usr238496

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 0
  • CiviCRM version: latest
  • CMS version: joomla2.5
  • PHP version: 5 something
Re: how are civicrm_event and civicrm_address joined?
June 26, 2012, 09:10:12 am
No go I'm afraid, G Calender do not provide an API call to insert the ical details. It would have to be a manual front end process.

So back to the original question,

How does civi link the event database record with the location record. There must be a link as when I go to the event screen it brings up the correct location record.

I'd prefer not to have to step through each record, or the source code if some one knows :)
You did not answer the verification questions correctly - sigh

usr238496

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 0
  • CiviCRM version: latest
  • CMS version: joomla2.5
  • PHP version: 5 something
Re: how are civicrm_event and civicrm_address joined?
July 10, 2012, 03:24:43 pm
bumpity bump
You did not answer the verification questions correctly - sigh

Erich Schulz

  • I post frequently
  • ***
  • Posts: 142
  • Karma: 5
    • When no-one understands what you are going on about its time to start a blog
  • CiviCRM version: 4.4
  • CMS version: Drupal 7
  • MySQL version: 5.somthing
  • PHP version: 5.3.3
Re: how are civicrm_event and civicrm_address joined?
February 04, 2013, 07:04:27 pm
Hi user238 - this is not the recomended way of accessing the data...

but i just found this bit of sql:

SELECT
  civicrm_event.id as event_id,
  civicrm_email.email as email,
  civicrm_event.title as summary,
  civicrm_event.start_date as start,
  civicrm_event.end_date as end,
  civicrm_event.description as description,
  civicrm_event.is_show_location as is_show_location,
  civicrm_option_value.label as event_type,
  civicrm_location.name as location_name,
  civicrm_address.street_address as street_address,
  civicrm_address.supplemental_address_1 as supplemental_address_1,
  civicrm_address.supplemental_address_2 as supplemental_address_2,
  civicrm_address.city as city,
  civicrm_address.postal_code as postal_code,
  civicrm_address.postal_code_suffix as postal_code_suffix,
  civicrm_state_province.abbreviation as state,
  civicrm_country.name as country,
  civicrm_location_type.name as location_type
FROM civicrm_event
LEFT JOIN civicrm_location ON (civicrm_location.entity_table = 'civicrm_event' AND
                               civicrm_event.id = civicrm_location.entity_id )
LEFT JOIN civicrm_address ON civicrm_location.id = civicrm_address.location_id
LEFT JOIN civicrm_state_province ON civicrm_address.state_province_id = civicrm_state_province.id
LEFT JOIN civicrm_country ON civicrm_address.country_id = civicrm_country.id
LEFT JOIN civicrm_location_type ON civicrm_location_type.id = civicrm_location.location_type_id
LEFT JOIN civicrm_email ON civicrm_location.id = civicrm_email.location_id
LEFT JOIN  civicrm_option_value ON (
                                    civicrm_event.event_type_id = civicrm_option_value.value AND
                                    civicrm_option_value.option_group_id = %1 )
WHERE civicrm_event.is_active = 1
      AND civicrm_event.domain_id = %2
      AND civicrm_event.is_public = 1
      AND civicrm_event.start_date >= ". $condition .
" ORDER BY   civicrm_event.start_date ASC";


Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • how are civicrm_event and civicrm_address joined?

This forum was archived on 2017-11-26.