Have a question about CiviCRM? Get it answered quickly at the new CiviCRM Stack Exchange Q+A siteThis forum was archived on 25 November 2017. Learn more.How to get involved.What to do if you think you've found a bug.
static function getGroups( ) { $groupList = civicrm_api("Group","get", array (version => '3','sequential' =>'1')); if ( ! empty( $groupList) ) { $groups = array( ); foreach ( $groupList as $list ) { $groups[$list['id']] = $list['title']; } return $groups; } return null; }
require_once 'CDM/Utils.php'; $groups = CDM_Utils::getGroups( ); if ( ! empty( $groups ) ) { $this->_multiValued['groups'] = $groups; $this->addElement( 'advmultiselect', 'events', ts( 'Groups' ), $events, array('size' => 5, 'style' => 'width:200px', 'class' => 'advmultiselect') ); }
{if $form.groups} <tr class="crm-discount-item-form-block-groups"> <td class="label">{$form.groups.label}</td> <td>{$form.groups.html}<br /> <span class="description">{ts}Test{/ts} </td> </tr>{/if}
foreach($groupList[values] as $list)
require_once 'api/api.php';CRM_Core_Error::debug(contactid, $contactid );if ( !empty( $params['groups'] ) ) { $groups = $params['groups']; CRM_Core_Error::debug(groups, $groups ); foreach ($groups as $gadd){ CRM_Core_Error::debug(gadd, $gadd ); civicrm_api("group_contact","create", array (version => '3','sequential' =>'1', 'group_id' => $gadd, 'contact_id' => $contactid)); }}
Warning: Invalid argument supplied for foreach() in CRM_Event_Form_Registration_Register->setDefaultValues() (line 268 of /home/eros/public_html/hedone.us/public/sites/all/modules/civicrm/CRM/Event/Form/Registration/Register.php).