示例#1
0
 function createCustomGroup()
 {
     $params = array('title' => 'Test Custom Group', 'extends' => array('Relationship'), 'weight' => 5, 'style' => 'Inline', 'is_active' => 1, 'max_multiple' => 0);
     $customGroup =& civicrm_custom_group_create($params);
     return null;
 }
示例#2
0
 /**
  * check with Activity - Meeting Type
  */
 function testCustomGroupCreateActivityMeeting()
 {
     $params = array('title' => 'Test_Group_10', 'name' => 'test_group_10', 'extends' => array('Activity', 1), 'weight' => 8, 'collapse_display' => 1, 'style' => 'Inline', 'help_pre' => 'This is Pre Help For Test Group 10', 'help_post' => 'This is Post Help For Test Group 10');
     $customGroup =& civicrm_custom_group_create($params);
     $this->assertEquals($customGroup['is_error'], 0);
     $this->assertNotNull($customGroup['id']);
     $this->assertEquals($customGroup['extends'], 'Activity');
     $this->customGroupDelete($customGroup['id']);
 }
示例#3
0
 /**
  * Function to create custom group
  * 
  * @param string $className
  * @param string $title  name of custom group
  */
 function customGroupCreate($className, $title)
 {
     require_once 'api/v2/CustomGroup.php';
     $params = array('title' => $title, 'class_name' => $className, 'domain_id' => 1, 'style' => 'Inline', 'is_active' => 1);
     $result =& civicrm_custom_group_create($params);
     if (CRM_Utils_Array::value('is_error', $result) || !CRM_Utils_Array::value('id', $result)) {
         throw new Exception('Could not create Custom Group');
     }
     return $result;
 }