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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Joomla Modules
Pages: [1]

Author Topic: Joomla Modules  (Read 898 times)

mcsmom

  • I post frequently
  • ***
  • Posts: 266
  • Karma: 23
    • Official Joomla! Book
  • CiviCRM version: 4 and 3.4
  • CMS version: Joomla!
Joomla Modules
July 31, 2009, 11:46:52 am
Hi,

I created two Joomla modules. One shows the Groups the currently logged in user is a member of and the other shows memberships and expiration dates. Basically I am trying to build up some examples of how to use the CIvi API in Joomla.

To make these modules work you need to add the helper file that is on the linked page and also you need to install and enable the CiviContactSession plugin.

http://joomlacode.org/gf/project/jcivicrm/frs/?action=index

Have fun, comments welcome.

eadesign

  • Guest
Re: Joomla Modules
August 10, 2009, 11:57:03 am
Hy! Very nice work!

I took the module you developed and i tried to modified in order to get the notes for the specific user. The module is : mod_my_civigroups, and i tied to make it "groups and notes...".


The code i tried to use for the Note was the one suggested in the Api documentation.

Code: [Select]
<?php
function testGetNote()
{
    
$params = array(
                    
'entity_table'  => 'civicrm_contact',
                    
'entity_id'     => 102
                    
);

    
$result = & civicrm_note_get( $params );
    if ( 
civicrm_error ( $result )) {
        return 
$result['error_message'];
    } else {
        
print_r( $result );
    }
}
?>


modified...but i got stuck at the entity...hope someone can help


The code from the module is:

Code: [Select]
function testGetGroupContacts()
{
$session =& JFactory::getSession();
$contact_id = $session->get('contact_id');
$params = array('contact_id' => $contact_id   );
$result = civicrm_group_contact_get( $params );
echo '<ul>';
foreach($result AS $result) {
echo '<li> '.$result['title'] .' </ li>';
}
echo '</ul>';
}
testGetGroupContacts();

Thank You!

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: Joomla Modules
August 10, 2009, 01:00:32 pm

i'm not sure what the question is and what you have done so far? you'll need to call the function etc to grab the notes and display the results

as a side note, prefixing functions with the word 'test' is not recommended. that is more a convention for unit tests

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

eadesign

  • Guest
Re: Joomla Modules
August 11, 2009, 01:20:31 am
The firs issue is resolved.

Code: [Select]
function testGetNote()
{
$session =& JFactory::getSession();
$contact_id = $session->get('contact_id');
    $params = array(
                    'entity_table'  => 'civicrm_contact',
                    'entity_id'     => $contact_id,
                    );

    $result = & civicrm_note_get( $params );
    echo '<div>';
foreach($result AS $result) {
echo '<div> '.$result.' </div>';
}
echo '</div>';
}
testGetNote();

Next question is: Can i get notes subject using Api? Should i modify the Note.php in Api or is there some other way?

By the way it wold be fine to get the date....also:)

Tank you.
« Last Edit: August 11, 2009, 01:37:14 am by eadesign »

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Joomla Modules

This forum was archived on 2017-11-26.