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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Allowing Joomla Users to record Activities involving Contacts
Pages: [1]

Author Topic: Allowing Joomla Users to record Activities involving Contacts  (Read 2281 times)

kenlyle

  • I post occasionally
  • **
  • Posts: 116
  • Karma: 7
Allowing Joomla Users to record Activities involving Contacts
January 13, 2008, 05:18:39 pm
Can I do this?

My Joomla users will be activists of some stripe, and the Contacts will be legislators whom we will be lobbying regarding legislation.  We want to ensure that we have reasonable, consistent, even "coverage" in terms of staying in touch with our legislators.

This seems "core" to Civi's mission, but I am not finding where/how to do make it so...
I don't want to make everyone a Manager in my Joomla backend, either.

Thanks in advance.
Ken
« Last Edit: January 14, 2008, 07:59:19 am by kenlyle »

kenlyle

  • I post occasionally
  • **
  • Posts: 116
  • Karma: 7
Re: Allowing Joomla Users to record Activities involving Contacts
January 14, 2008, 08:13:46 am
This is an Access query/schema that relates the Civi Contact and Individual records through recording a phone call.  My thinking is that this query will be important in building an alternate frontend for inserting the right records into the civicrm_phonecall table.

Here is the SQL:
SELECT civicrm_email.email, civicrm_individual.first_name, civicrm_individual.middle_name, civicrm_individual.last_name, civicrm_phonecall.target_entity_table, civicrm_contact_1.display_name AS ContactBy
FROM (((civicrm_contact INNER JOIN civicrm_individual ON civicrm_contact.id = civicrm_individual.contact_id) INNER JOIN (civicrm_location INNER JOIN civicrm_email ON civicrm_location.id = civicrm_email.location_id) ON civicrm_individual.contact_id = civicrm_location.entity_id) INNER JOIN civicrm_phonecall ON civicrm_contact.id = civicrm_phonecall.target_entity_id) INNER JOIN civicrm_contact AS civicrm_contact_1 ON civicrm_phonecall.source_contact_id = civicrm_contact_1.id
WHERE (((civicrm_phonecall.target_entity_table)="civicrm_contact"));

Hopefully, this helps somebody move this integration effort forward.

Best,
Ken

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Allowing Joomla Users to record Activities involving Contacts
January 14, 2008, 02:12:12 pm
Ken - As you've noted, there is not support as of yet for front-end users to enter Activities. Given that we haven't yet solved the puzzle of supporting "transactional" profile forms in general - I think it will be a while before this is possible using "core" CiviCRM. The most likely approach would seem to be creating a separate component which exposes the form and the uses CiviCRM API's to insert the data.

If anyone decides to work on this - I would STRONGLY ENCOURAGE them to do it in 2.0 because the schema for contacts and activities is substantially changed.

As a side note, you may want to have CiviCRM contact records for BOTH your legislators and your activists (perhaps this was implicit in your description above?). The new activity schema nicely supports 3 "roles" for any activity - the creator contact (i.e. the activist), one or more target contacts (i.e. the legislator), and assignee contact(s) if applicable.
Protect your investment in CiviCRM by  becoming a Member!

kenlyle

  • I post occasionally
  • **
  • Posts: 116
  • Karma: 7
Re: Allowing Joomla Users to record Activities involving Contacts
January 14, 2008, 05:28:19 pm
THANKS! Dave.

Yeah, my activists are Civi Contacts, after jumping through some hoops, they are also Joomla users, and the two are associated in _uf_match.

Thanks for the tips.   I am actually using a brute force approach of addressing the tables directly using code generated by PHPRunner.  I am just about there...The generated PHP code includes a login page that checks the Joomla database for a u/p match (not checking disabled/blocked or user groups at present), then provides access to lists and forms for each table.  I need to figure out how to lookup and store the CiviID from uf_match based on the JoomlaID.  Shouldn't be hard, but I am a complete noob at PHP, hence my use of the code generator.

I will take a crack at using the 2.0 tables.  Hopefully, there's a pretty schema diagram available?

Thanks,
Ken

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Allowing Joomla Users to record Activities involving Contacts
January 15, 2008, 11:24:01 am
We don't have any 'pretty diagrams' yet. Hopefully Ben V or someone else will step up and created a new ERD page for 2.0 soon.
Protect your investment in CiviCRM by  becoming a Member!

kenlyle

  • I post occasionally
  • **
  • Posts: 116
  • Karma: 7
Re: Allowing Joomla Users to record Activities involving Contacts
February 15, 2008, 10:41:13 am
OK, I have packaged the code I generated.  I just checked that the login works, and allows me to connect to the Activities table of Civi 1.9 under Joomla 1.0.13, IOW, the login function checks against the Joomla database, and upon authorization, allows the user access to the menu, which is a list and form which allow adds to the Activities table.

You should be able to just unzip the application somewhere under your web root on any shared hosting environment that has PHP and MySQL.  Change the parameters in include/dbcommon.php as required for your setup.

This simple application was developed in http://www.xlinesoft.com/phprunner/?1102, which I recommend highly as a very productive PHP Generator with a good developer community.

I understand that this is outdated now that 2.0 is in beta, but am posting this in the hopes that maybe someone can use it as is, and that others more capable can extend it.

Download at http://www.stoprealid.info/downloads/civi1a-for-dist.zip

And be a good American patriot and oppose RealID! 

Best,
Ken

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Allowing Joomla Users to record Activities involving Contacts

This forum was archived on 2017-11-26.