当前位置: 首页>>代码示例>>PHP>>正文


PHP CRM_Core_PseudoConstant::relationshipType方法代码示例

本文整理汇总了PHP中CRM_Core_PseudoConstant::relationshipType方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_PseudoConstant::relationshipType方法的具体用法?PHP CRM_Core_PseudoConstant::relationshipType怎么用?PHP CRM_Core_PseudoConstant::relationshipType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CRM_Core_PseudoConstant的用法示例。


在下文中一共展示了CRM_Core_PseudoConstant::relationshipType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 function __construct()
 {
     $this->fetchActivityTypes();
     $this->fetchCaseStatusses();
     $rels = CRM_Core_PseudoConstant::relationshipType();
     $coach_rel_type_id = false;
     foreach ($rels as $relid => $v) {
         $this->rel_types[$relid] = $v['label_b_a'];
         if ($v['label_b_a'] == 'Coach') {
             $coach_rel_type_id = $relid;
         }
     }
     $coaches = array();
     if ($coach_rel_type_id) {
         $coaches = $this->coaches($coach_rel_type_id);
     }
     $this->_groupFilter = FALSE;
     $this->_tagFilter = FALSE;
     $this->_columns = array('civicrm_activity`' => array('dao' => 'CRM_Activity_DAO_Activity', 'fields' => array(), 'filters' => array('activity_type_id' => array('title' => ts('Activity type'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_OptionGroup::values('activity_type'), 'pseudofield' => true, 'default' => $this->_activityTypes), 'case_status' => array('title' => ts('Status'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_OptionGroup::values('case_status'), 'pseudofield' => true, 'default' => $this->_openedCaseStatusses), 'case_role' => array('title' => ts('Role on case'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->rel_types), 'coach' => array('title' => ts('Coach'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $coaches, 'pseudofield' => true), 'my_cases' => array('title' => ts('My cases'), 'type' => CRM_Utils_Type::T_BOOLEAN, 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => array('0' => ts('No'), '1' => ts('Yes')), 'default' => '1', 'pseudofield' => TRUE))));
     parent::__construct();
     $this->fetchCaseType();
     $this->fetchChequenummer();
     $this->fetchStatusGroup();
     $this->fetchCoachIdentifier();
 }
开发者ID:CiviCooP,项目名称:be.werkenmetzin.casereports,代码行数:25,代码来源:coach.php

示例2: __construct

 function __construct()
 {
     $this->case_statuses = CRM_Case_PseudoConstant::caseStatus();
     $rels = CRM_Core_PseudoConstant::relationshipType();
     foreach ($rels as $relid => $v) {
         $this->rel_types[$relid] = $v['label_b_a'];
     }
     $this->deleted_labels = array('' => ts('- select -'), 0 => ts('No'), 1 => ts('Yes'));
     $this->_columns = array('civicrm_c2' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('display_name' => array('title' => ts('Client'), 'required' => true))), 'civicrm_case' => array('dao' => 'CRM_Case_DAO_Case', 'fields' => array('id' => array('title' => ts('Case ID'), 'required' => true), 'start_date' => array('title' => ts('Start Date'), 'default' => true), 'end_date' => array('title' => ts('End Date'), 'default' => true), 'status_id' => array('title' => ts('Status'), 'default' => true), 'duration' => array('title' => ts('Duration (Days)'), 'default' => false), 'is_deleted' => array('title' => ts('Deleted?'), 'default' => false, 'type' => CRM_Utils_Type::T_INT)), 'filters' => array('start_date' => array('title' => ts('Start Date'), 'operatorType' => CRM_Report_Form::OP_DATE), 'end_date' => array('title' => ts('End Date'), 'operatorType' => CRM_Report_Form::OP_DATE), 'status_id' => array('title' => ts('Status'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->case_statuses), 'is_deleted' => array('title' => ts('Deleted?'), 'type' => CRM_Report_Form::OP_INT, 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => $this->deleted_labels, 'default' => 0))), 'civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('sort_name' => array('title' => ts('Staff Member'), 'default' => true)), 'filters' => array('sort_name' => array('title' => ts('Staff Member')))), 'civicrm_relationship' => array('dao' => 'CRM_Contact_DAO_Relationship', 'filters' => array('relationship_type_id' => array('title' => ts('Staff Relationship'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->rel_types))), 'civicrm_relationship_type' => array('dao' => 'CRM_Contact_DAO_RelationshipType', 'fields' => array('label_b_a' => array('title' => ts('Relationship'), 'default' => true))), 'civicrm_case_contact' => array('dao' => 'CRM_Case_DAO_CaseContact'));
     parent::__construct();
 }
开发者ID:bhirsch,项目名称:voipdev,代码行数:11,代码来源:Summary.php

示例3: __construct

 public function __construct()
 {
     $this->case_types = CRM_Case_PseudoConstant::caseType();
     $this->case_statuses = CRM_Core_OptionGroup::values('case_status');
     $rels = CRM_Core_PseudoConstant::relationshipType();
     foreach ($rels as $relid => $v) {
         $this->rel_types[$relid] = $v['label_b_a'];
     }
     $this->deleted_labels = array('' => ts('- select -'), 0 => ts('No'), 1 => ts('Yes'));
     $this->_columns = array('civicrm_c2' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('client_name' => array('name' => 'sort_name', 'title' => ts('Client'), 'required' => TRUE), 'id' => array('no_display' => TRUE, 'required' => TRUE))), 'civicrm_case' => array('dao' => 'CRM_Case_DAO_Case', 'fields' => array('id' => array('title' => ts('Case ID'), 'required' => TRUE), 'subject' => array('title' => ts('Case Subject'), 'default' => FALSE), 'status_id' => array('title' => ts('Status'), 'default' => FALSE), 'case_type_id' => array('title' => ts('Case Type'), 'default' => FALSE), 'start_date' => array('title' => ts('Start Date'), 'default' => TRUE, 'type' => CRM_Utils_Type::T_DATE), 'end_date' => array('title' => ts('End Date'), 'default' => FALSE, 'type' => CRM_Utils_Type::T_DATE), 'duration' => array('title' => ts('Duration (Days)'), 'default' => FALSE), 'is_deleted' => array('title' => ts('Deleted?'), 'default' => FALSE, 'type' => CRM_Utils_Type::T_INT)), 'filters' => array('start_date' => array('title' => ts('Start Date'), 'operatorType' => CRM_Report_Form::OP_DATE, 'type' => CRM_Utils_Type::T_DATE), 'end_date' => array('title' => ts('End Date'), 'operatorType' => CRM_Report_Form::OP_DATE, 'type' => CRM_Utils_Type::T_DATE), 'case_type_id' => array('title' => ts('Case Type'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->case_types), 'status_id' => array('title' => ts('Status'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->case_statuses), 'is_deleted' => array('title' => ts('Deleted?'), 'type' => CRM_Report_Form::OP_INT, 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => $this->deleted_labels, 'default' => 0))), 'civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('sort_name' => array('title' => ts('Staff Member'), 'default' => FALSE)), 'filters' => array('my_cases' => array('title' => ts('My cases'), 'type' => CRM_Utils_Type::T_BOOLEAN, 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => array('0' => ts('No'), '1' => ts('Yes')), 'pseudofield' => TRUE))), 'civicrm_relationship' => array('dao' => 'CRM_Contact_DAO_Relationship', 'filters' => array('relationship_type_id' => array('title' => ts('Staff Relationship'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->rel_types))), 'civicrm_relationship_type' => array('dao' => 'CRM_Contact_DAO_RelationshipType', 'fields' => array('label_b_a' => array('title' => ts('Relationship'), 'default' => FALSE))), 'civicrm_case_contact' => array('dao' => 'CRM_Case_DAO_CaseContact'), 'civicrm_activity' => array('filters' => array('activity_type_id' => array('title' => ts('Activity Type'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE), 'pseudofield' => TRUE))));
     parent::__construct();
 }
开发者ID:CiviCooP,项目名称:be.werkenmetzin.casereports,代码行数:12,代码来源:Facturatie.php

示例4: __construct

 function __construct()
 {
     $this->case_statuses = CRM_Case_PseudoConstant::caseStatus();
     $this->case_types = CRM_Case_PseudoConstant::caseType();
     $rels = CRM_Core_PseudoConstant::relationshipType();
     foreach ($rels as $relid => $v) {
         $this->rel_types[$relid] = $v['label_b_a'];
     }
     $this->_columns = array('civicrm_case' => array('dao' => 'CRM_Case_DAO_Case', 'fields' => array('id' => array('title' => ts('Case ID'), 'no_display' => true, 'required' => true), 'subject' => array('title' => ts('Subject'), 'required' => true), 'start_date' => array('title' => ts('Start Date')), 'end_date' => array('title' => ts('End Date')), 'status_id' => array('title' => ts('Case Status')), 'case_type_id' => array('title' => ts('Case Type'))), 'filters' => array('start_date' => array('title' => ts('Start Date'), 'operatorType' => CRM_Report_Form::OP_DATE, 'type' => CRM_Utils_Type::T_DATE), 'end_date' => array('title' => ts('End Date'), 'operatorType' => CRM_Report_Form::OP_DATE, 'type' => CRM_Utils_Type::T_DATE), 'status_id' => array('title' => ts('Case Status'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->case_statuses), 'case_type_id' => array('title' => ts('Case Type'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->case_types))), 'civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('display_name' => array('title' => ts('Client Name'), 'required' => true), 'id' => array('no_display' => true, 'required' => true)), 'filters' => array('display_name' => array('title' => ts('Client Name')))), 'civicrm_relationship' => array('dao' => 'CRM_Contact_DAO_Relationship', 'fields' => array('relationship_type_id' => array('title' => ts('Case Role'))), 'filters' => array('relationship_type_id' => array('title' => ts('Case Role'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->rel_types))), 'civicrm_relationship_type' => array('dao' => 'CRM_Contact_DAO_RelationshipType'), 'civicrm_email' => array('dao' => 'CRM_Core_DAO_Email', 'fields' => array('email' => array('title' => ts('Email'), 'no_repeat' => true)), 'grouping' => 'contact-fields'), 'civicrm_phone' => array('dao' => 'CRM_Core_DAO_Phone', 'fields' => array('phone' => array('title' => ts('Phone'), 'no_repeat' => true)), 'grouping' => 'contact-fields'), 'civicrm_address' => array('dao' => 'CRM_Core_DAO_Address', 'fields' => array('street_address' => null, 'state_province_id' => array('title' => ts('State/Province')), 'country_id' => array('title' => ts('Country'))), 'grouping' => 'contact-fields', 'filters' => array('country_id' => array('title' => ts('Country'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_PseudoConstant::country()), 'state_province_id' => array('title' => ts('State/Province'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_PseudoConstant::stateProvince()))), 'civicrm_worldregion' => array('dao' => 'CRM_Core_DAO_Worldregion', 'filters' => array('worldregion_id' => array('name' => 'id', 'title' => ts('WorldRegion'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_PseudoConstant::worldRegion()))), 'civicrm_country' => array('dao' => 'CRM_Core_DAO_Country'), 'civicrm_activity' => array('dao' => 'CRM_Activity_DAO_Activity', 'fields' => array('activity_subject' => array('name' => 'subject', 'title' => ts('Activity Subject'), 'no_display' => true)), 'filters' => array('activity_date_time' => array('title' => ts('Last Action Date'), 'operatorType' => CRM_Report_Form::OP_DATE))), 'civicrm_case_contact' => array('dao' => 'CRM_Case_DAO_CaseContact'));
     $this->_options = array('my_cases' => array('title' => ts('My Cases'), 'type' => 'checkbox'));
     parent::__construct();
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:12,代码来源:Detail.php

示例5: array

 function &allRelationshipTypes()
 {
     static $relationshipTypes = array();
     if (!$relationshipTypes) {
         $relationshipInfo = CRM_Core_PseudoConstant::relationshipType();
         $relationshipTypes = array();
         foreach ($relationshipInfo as $id => $info) {
             $relationshipTypes[$id] = $info['label_b_a'];
         }
     }
     return $relationshipTypes;
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:12,代码来源:XMLProcessor.php

示例6: __construct

 /**
  *
  */
 function __construct()
 {
     $this->case_statuses = CRM_Case_PseudoConstant::caseStatus();
     $this->case_types = CRM_Case_PseudoConstant::caseType();
     $rels = CRM_Core_PseudoConstant::relationshipType();
     foreach ($rels as $relid => $v) {
         $this->rel_types[$relid] = $v['label_b_a'];
     }
     $this->deleted_labels = array('' => ts('- select -'), 0 => ts('No'), 1 => ts('Yes'));
     $this->caseActivityTypes = array();
     foreach (CRM_Case_PseudoConstant::caseActivityType() as $typeDetail) {
         $this->caseActivityTypes[$typeDetail['id']] = $typeDetail['label'];
     }
     $this->_columns = array('civicrm_case' => array('dao' => 'CRM_Case_DAO_Case', 'fields' => array('id' => array('title' => ts('Case ID'), 'no_display' => TRUE, 'required' => TRUE), 'subject' => array('title' => ts('Subject'), 'required' => TRUE), 'start_date' => array('title' => ts('Start Date'), 'type' => CRM_Utils_Type::T_DATE), 'end_date' => array('title' => ts('End Date'), 'type' => CRM_Utils_Type::T_DATE), 'status_id' => array('title' => ts('Case Status')), 'case_type_id' => array('title' => ts('Case Type')), 'is_deleted' => array('title' => ts('Deleted?'), 'default' => FALSE, 'type' => CRM_Utils_Type::T_INT)), 'filters' => array('start_date' => array('title' => ts('Start Date'), 'operatorType' => CRM_Report_Form::OP_DATE, 'type' => CRM_Utils_Type::T_DATE), 'end_date' => array('title' => ts('End Date'), 'operatorType' => CRM_Report_Form::OP_DATE, 'type' => CRM_Utils_Type::T_DATE), 'status_id' => array('title' => ts('Case Status'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->case_statuses), 'case_type_id' => array('title' => ts('Case Type'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->case_types), 'is_deleted' => array('title' => ts('Deleted?'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => $this->deleted_labels, 'default' => 0))), 'civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('client_sort_name' => array('name' => 'sort_name', 'title' => ts('Client Name'), 'required' => TRUE), 'id' => array('no_display' => TRUE, 'required' => TRUE)), 'filters' => array('sort_name' => array('title' => ts('Client Name')))), 'civicrm_relationship' => array('dao' => 'CRM_Contact_DAO_Relationship', 'fields' => array('case_role' => array('name' => 'relationship_type_id', 'title' => ts('Case Role(s)'))), 'filters' => array('case_role' => array('name' => 'relationship_type_id', 'title' => ts('Case Role(s)'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->rel_types))), 'civicrm_email' => array('dao' => 'CRM_Core_DAO_Email', 'fields' => array('email' => array('title' => ts('Email'), 'no_repeat' => TRUE)), 'grouping' => 'contact-fields'), 'civicrm_phone' => array('dao' => 'CRM_Core_DAO_Phone', 'fields' => array('phone' => array('title' => ts('Phone'), 'no_repeat' => TRUE)), 'grouping' => 'contact-fields'), 'civicrm_address' => array('dao' => 'CRM_Core_DAO_Address', 'fields' => array('street_address' => NULL, 'state_province_id' => array('title' => ts('State/Province')), 'country_id' => array('title' => ts('Country'))), 'grouping' => 'contact-fields', 'filters' => array('country_id' => array('title' => ts('Country'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_PseudoConstant::country()), 'state_province_id' => array('title' => ts('State/Province'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_PseudoConstant::stateProvince()))), 'civicrm_worldregion' => array('dao' => 'CRM_Core_DAO_Worldregion', 'filters' => array('worldregion_id' => array('name' => 'id', 'title' => ts('WorldRegion'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_PseudoConstant::worldRegion()))), 'civicrm_country' => array('dao' => 'CRM_Core_DAO_Country'), 'civicrm_activity_last' => array('dao' => 'CRM_Activity_DAO_Activity', 'filters' => array('last_activity_date_time' => array('name' => 'activity_date_time', 'title' => ts('Last Action Date'), 'operatorType' => CRM_Report_Form::OP_DATE)), 'alias' => 'civireport_activity_last'), 'civicrm_activity_last_completed' => array('dao' => 'CRM_Activity_DAO_Activity', 'fields' => array('last_completed_activity_subject' => array('name' => 'subject', 'title' => ts('Subject of the last completed activity in the case')), 'last_completed_activity_type' => array('name' => 'activity_type_id', 'title' => ts('Activity type of the last completed activity')))));
     $this->_options = array('my_cases' => array('title' => ts('My Cases'), 'type' => 'checkbox'));
     parent::__construct();
 }
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:20,代码来源:Detail.php

示例7: view

 /**
  * View details of a relationship.
  */
 public function view()
 {
     $viewRelationship = CRM_Contact_BAO_Relationship::getRelationship($this->_contactId, NULL, NULL, NULL, $this->_id);
     //To check whether selected contact is a contact_id_a in
     //relationship type 'a_b' in relationship table, if yes then
     //revert the permissionship text in template
     $relationship = new CRM_Contact_DAO_Relationship();
     $relationship->id = $viewRelationship[$this->_id]['id'];
     if ($relationship->find(TRUE)) {
         if ($viewRelationship[$this->_id]['rtype'] == 'a_b' && $this->_contactId == $relationship->contact_id_a) {
             $this->assign("is_contact_id_a", TRUE);
         }
     }
     $relType = $viewRelationship[$this->_id]['civicrm_relationship_type_id'];
     $this->assign('viewRelationship', $viewRelationship);
     $employerId = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_contactId, 'employer_id');
     $this->assign('isCurrentEmployer', FALSE);
     $relTypes = CRM_Utils_Array::index(array('name_a_b'), CRM_Core_PseudoConstant::relationshipType('name'));
     if ($viewRelationship[$this->_id]['employer_id'] == $this->_contactId) {
         $this->assign('isCurrentEmployer', TRUE);
     } elseif ($relType == $relTypes['Employee of']['id'] && $viewRelationship[$this->_id]['cid'] == $employerId) {
         // make sure we are viewing employee of relationship
         $this->assign('isCurrentEmployer', TRUE);
     }
     $viewNote = CRM_Core_BAO_Note::getNote($this->_id);
     $this->assign('viewNote', $viewNote);
     $groupTree = CRM_Core_BAO_CustomGroup::getTree('Relationship', $this, $this->_id, 0, $relType);
     CRM_Core_BAO_CustomGroup::buildCustomDataView($this, $groupTree, FALSE, NULL, NULL, NULL, $this->_id);
     $rType = CRM_Utils_Array::value('rtype', $viewRelationship[$this->_id]);
     // add viewed contribution to recent items list
     $url = CRM_Utils_System::url('civicrm/contact/view/rel', "action=view&reset=1&id={$viewRelationship[$this->_id]['id']}&cid={$this->_contactId}&context=home");
     $session = CRM_Core_Session::singleton();
     $recentOther = array();
     if ($session->get('userID') == $this->_contactId || CRM_Contact_BAO_Contact_Permission::allow($this->_contactId, CRM_Core_Permission::EDIT)) {
         $recentOther = array('editUrl' => CRM_Utils_System::url('civicrm/contact/view/rel', "action=update&reset=1&id={$viewRelationship[$this->_id]['id']}&cid={$this->_contactId}&rtype={$rType}&context=home"), 'deleteUrl' => CRM_Utils_System::url('civicrm/contact/view/rel', "action=delete&reset=1&id={$viewRelationship[$this->_id]['id']}&cid={$this->_contactId}&rtype={$rType}&context=home"));
     }
     $displayName = CRM_Contact_BAO_Contact::displayName($this->_contactId);
     $this->assign('displayName', $displayName);
     CRM_Utils_System::setTitle(ts('View Relationship for') . ' ' . $displayName);
     $title = $displayName . ' (' . $viewRelationship[$this->_id]['relation'] . ' ' . CRM_Contact_BAO_Contact::displayName($viewRelationship[$this->_id]['cid']) . ')';
     // add the recently viewed Relationship
     CRM_Utils_Recent::add($title, $url, $viewRelationship[$this->_id]['id'], 'Relationship', $this->_contactId, NULL, $recentOther);
 }
开发者ID:konadave,项目名称:civicrm-core,代码行数:46,代码来源:Relationship.php

示例8: createManagedRelationshipTypes

 /**
  * Get a list of managed relationship-types by searching CiviCase XML files.
  *
  * @param \CRM_Case_XMLRepository $xmlRepo
  * @param \CRM_Core_ManagedEntities $me
  *
  * @return array
  * @see CRM_Utils_Hook::managed
  */
 public static function createManagedRelationshipTypes(CRM_Case_XMLRepository $xmlRepo, CRM_Core_ManagedEntities $me)
 {
     $result = array();
     if (!isset(Civi::$statics[__CLASS__]['reltypes'])) {
         $relationshipInfo = CRM_Core_PseudoConstant::relationshipType('label', TRUE, NULL);
         Civi::$statics[__CLASS__]['reltypes'] = CRM_Utils_Array::collect(CRM_Case_XMLProcessor::REL_TYPE_CNAME, $relationshipInfo);
     }
     $validRelTypes = Civi::$statics[__CLASS__]['reltypes'];
     $relTypes = $xmlRepo->getAllDeclaredRelationshipTypes();
     foreach ($relTypes as $relType) {
         $managed = array('module' => 'civicrm', 'name' => "civicase:rel:{$relType}", 'entity' => 'RelationshipType', 'update' => 'never', 'cleanup' => 'unused', 'params' => array('version' => 3, 'name_a_b' => "{$relType} is", 'name_b_a' => $relType, 'label_a_b' => "{$relType} is", 'label_b_a' => $relType, 'description' => $relType, 'contact_type_a' => 'Individual', 'contact_type_b' => 'Individual', 'contact_sub_type_a' => NULL, 'contact_sub_type_b' => NULL));
         // We'll create managed-entity if this record doesn't exist yet
         // or if we previously decided to manage this record.
         if (!in_array($relType, $validRelTypes)) {
             $result[] = $managed;
         } elseif ($me->get($managed['module'], $managed['name'])) {
             $result[] = $managed;
         }
     }
     return $result;
 }
开发者ID:konadave,项目名称:civicrm-core,代码行数:30,代码来源:ManagedEntities.php

示例9: preProcess

 function preProcess()
 {
     //custom data related code
     $this->_cdType = CRM_Utils_Array::value('type', $_GET);
     $this->assign('cdType', false);
     if ($this->_cdType) {
         $this->assign('cdType', true);
         return CRM_Custom_Form_CustomData::preProcess($this);
     }
     $this->_contactId = $this->get('contactId');
     $this->_relationshipId = $this->get('id');
     $this->_rtype = CRM_Utils_Request::retrieve('rtype', 'String', $this);
     $this->_rtypeId = CRM_Utils_Request::retrieve('relTypeId', 'String', $this);
     $this->_display_name_a = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_contactId, 'display_name');
     $this->assign('sort_name_a', $this->_display_name_a);
     $this->_caseId = CRM_Utils_Request::retrieve('caseID', 'Integer', $this);
     //get the relationship values.
     $this->_values = array();
     if ($this->_relationshipId) {
         $params = array('id' => $this->_relationshipId);
         CRM_Core_DAO::commonRetrieve('CRM_Contact_DAO_Relationship', $params, $this->_values);
     }
     if (!$this->_rtypeId) {
         $params = $this->controller->exportValues($this->_name);
         if (isset($params['relationship_type_id'])) {
             $this->_rtypeId = $params['relationship_type_id'];
         } else {
             if (!empty($this->_values)) {
                 $this->_rtypeId = $this->_values['relationship_type_id'] . '_' . $this->_rtype;
             }
         }
     }
     //get the relationship type id
     $this->_relationshipTypeId = str_replace(array('_a_b', '_b_a'), array('', ''), $this->_rtypeId);
     //get the relationship type
     if (!$this->_rtype) {
         $this->_rtype = str_replace($this->_relationshipTypeId . '_', '', $this->_rtypeId);
     }
     $this->assign("rtype", $this->_rtype);
     require_once 'CRM/Core/PseudoConstant.php';
     //use name as it remain constant, CRM-3336
     $this->_allRelationshipNames = CRM_Core_PseudoConstant::relationshipType('name');
     // when custom data is included in this page
     if (CRM_Utils_Array::value("hidden_custom", $_POST)) {
         CRM_Custom_Form_Customdata::preProcess($this);
         CRM_Custom_Form_Customdata::buildQuickForm($this);
         CRM_Custom_Form_Customdata::setDefaultValues($this);
     }
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:49,代码来源:Relationship.php

示例10: preProcess

 public function preProcess()
 {
     $this->_contactId = $this->get('contactId');
     $this->_contactType = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_contactId, 'contact_type');
     $this->_relationshipId = $this->get('id');
     $this->_rtype = CRM_Utils_Request::retrieve('rtype', 'String', $this);
     $this->_rtypeId = CRM_Utils_Request::retrieve('relTypeId', 'String', $this);
     $this->_display_name_a = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_contactId, 'display_name');
     $this->assign('display_name_a', $this->_display_name_a);
     // Set page title based on action
     switch ($this->_action) {
         case CRM_Core_Action::VIEW:
             CRM_Utils_System::setTitle(ts('View Relationship for %1', array(1 => $this->_display_name_a)));
             break;
         case CRM_Core_Action::ADD:
             CRM_Utils_System::setTitle(ts('Add Relationship for %1', array(1 => $this->_display_name_a)));
             break;
         case CRM_Core_Action::UPDATE:
             CRM_Utils_System::setTitle(ts('Edit Relationship for %1', array(1 => $this->_display_name_a)));
             break;
         case CRM_Core_Action::DELETE:
             CRM_Utils_System::setTitle(ts('Delete Relationship for %1', array(1 => $this->_display_name_a)));
             break;
     }
     $this->_caseId = CRM_Utils_Request::retrieve('caseID', 'Integer', $this);
     //get the relationship values.
     $this->_values = array();
     if ($this->_relationshipId) {
         $params = array('id' => $this->_relationshipId);
         CRM_Core_DAO::commonRetrieve('CRM_Contact_DAO_Relationship', $params, $this->_values);
     }
     if (!$this->_rtypeId) {
         $params = $this->controller->exportValues($this->_name);
         if (isset($params['relationship_type_id'])) {
             $this->_rtypeId = $params['relationship_type_id'];
         } elseif (!empty($this->_values)) {
             $this->_rtypeId = $this->_values['relationship_type_id'] . '_' . $this->_rtype;
         }
     }
     //get the relationship type id
     $this->_relationshipTypeId = str_replace(array('_a_b', '_b_a'), array('', ''), $this->_rtypeId);
     //get the relationship type
     if (!$this->_rtype) {
         $this->_rtype = str_replace($this->_relationshipTypeId . '_', '', $this->_rtypeId);
     }
     //need to assign custom data type and subtype to the template - FIXME: explain why
     $this->assign('customDataType', 'Relationship');
     $this->assign('customDataSubType', $this->_relationshipTypeId);
     $this->assign('entityID', $this->_relationshipId);
     //use name as it remain constant, CRM-3336
     $this->_allRelationshipNames = CRM_Core_PseudoConstant::relationshipType('name');
     // Current employer?
     if ($this->_action & CRM_Core_Action::UPDATE) {
         if ($this->_allRelationshipNames[$this->_relationshipTypeId]["name_a_b"] == 'Employee of') {
             $this->_isCurrentEmployer = $this->_values['contact_id_b'] == CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_values['contact_id_a'], 'employer_id');
         }
     }
     // when custom data is included in this page
     if (!empty($_POST['hidden_custom'])) {
         CRM_Custom_Form_CustomData::preProcess($this);
         CRM_Custom_Form_CustomData::buildQuickForm($this);
         CRM_Custom_Form_CustomData::setDefaultValues($this);
     }
 }
开发者ID:BorislavZlatanov,项目名称:civicrm-core,代码行数:64,代码来源:Relationship.php

示例11: array

 /**
  * @return array
  */
 function &allRelationshipTypes()
 {
     if (self::$relationshipTypes === NULL) {
         $relationshipInfo = CRM_Core_PseudoConstant::relationshipType('label', TRUE);
         self::$relationshipTypes = array();
         foreach ($relationshipInfo as $id => $info) {
             self::$relationshipTypes[$id] = $info[CRM_Case_XMLProcessor::REL_TYPE_CNAME];
         }
     }
     return self::$relationshipTypes;
 }
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:14,代码来源:XMLProcessor.php

示例12: __construct

 /**
  * Class constructor
  */
 public function __construct()
 {
     // initialize all the vars
     $this->numIndividual = self::INDIVIDUAL_PERCENT * self::NUM_CONTACT / 100;
     $this->numHousehold = self::HOUSEHOLD_PERCENT * self::NUM_CONTACT / 100;
     $this->numOrganization = self::ORGANIZATION_PERCENT * self::NUM_CONTACT / 100;
     $this->numStrictIndividual = $this->numIndividual - $this->numHousehold * self::NUM_INDIVIDUAL_PER_HOUSEHOLD;
     // Parse data file
     foreach ((array) simplexml_load_file(self::DATA_FILENAME) as $key => $val) {
         $val = (array) $val;
         $this->sampleData[$key] = (array) $val['item'];
     }
     // Init DB
     $config = CRM_Core_Config::singleton();
     // Relationship types indexed by name_a_b from the table civicrm_relationship_type
     $this->relTypes = CRM_Utils_Array::index(array('name_a_b'), CRM_Core_PseudoConstant::relationshipType('name'));
 }
开发者ID:FundingWorks,项目名称:civicrm-core,代码行数:20,代码来源:GenerateData.php

示例13: getOnbehalfIds

 /**                                                           
  * Function to get individual id for onbehalf contribution
  * @param  int   $contributionId  contribution id 
  * @param  int   $contributorId   contributer id
  * @return array $ids             containing organization id and individual id
  * @access public 
  */
 function getOnbehalfIds($contributionId, $contributorId = null)
 {
     $ids = array();
     if (!$contributionId) {
         return $ids;
     }
     // fetch contributor id if null
     if (!$contributorId) {
         require_once 'CRM/Core/DAO.php';
         $contributorId = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_Contribution', $contributionId, 'contact_id');
     }
     require_once 'CRM/Core/PseudoConstant.php';
     $activityTypeIds = CRM_Core_PseudoConstant::activityType(true, false, false, 'name');
     $activityTypeId = array_search("Contribution", $activityTypeIds);
     if ($activityTypeId && $contributorId) {
         $activityQuery = "\nSELECT source_contact_id \n  FROM civicrm_activity \n WHERE activity_type_id   = %1 \n   AND source_record_id   = %2";
         $params = array(1 => array($activityTypeId, 'Integer'), 2 => array($contributionId, 'Integer'));
         $sourceContactId = CRM_Core_DAO::singleValueQuery($activityQuery, $params);
         // for on behalf contribution source is individual and contributor is organization
         if ($sourceContactId && $sourceContactId != $contributorId) {
             $relationshipTypeIds = CRM_Core_PseudoConstant::relationshipType('name');
             // get rel type id for employee of relation
             foreach ($relationshipTypeIds as $id => $typeVals) {
                 if ($typeVals['name_a_b'] == 'Employee of') {
                     $relationshipTypeId = $id;
                     break;
                 }
             }
             require_once 'CRM/Contact/DAO/Relationship.php';
             $rel = new CRM_Contact_DAO_Relationship();
             $rel->relationship_type_id = $relationshipTypeId;
             $rel->contact_id_a = $sourceContactId;
             $rel->contact_id_b = $contributorId;
             if ($rel->find(true)) {
                 $ids['individual_id'] = $rel->contact_id_a;
                 $ids['organization_id'] = $rel->contact_id_b;
             }
         }
     }
     return $ids;
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:48,代码来源:Contribution.php

示例14: getValidContactTypeList

 static function getValidContactTypeList($relType)
 {
     // string looks like 4_a_b
     $rel_parts = explode('_', $relType);
     $allRelationshipType = CRM_Core_PseudoConstant::relationshipType('label');
     $contactProfiles = CRM_Core_BAO_UFGroup::getReservedProfiles('Contact', NULL);
     if ($rel_parts[1] == 'a') {
         $leftType = $allRelationshipType[$rel_parts[0]]['contact_type_b'];
     } else {
         $leftType = $allRelationshipType[$rel_parts[0]]['contact_type_a'];
     }
     // Handle 'All Contacts' contact type for left side of relationship ($leftType is empty in this case)
     // In this case all reserved profiles are available
     if ($leftType == '') {
         $contactTypes = $contactProfiles;
     } else {
         $contactTypes = array();
         foreach ($contactProfiles as $key => $value) {
             $groupTypes = CRM_Core_BAO_UFGroup::profileGroups($key);
             if (in_array($leftType, $groupTypes)) {
                 $contactTypes = array($key => $value);
             }
         }
     }
     return $contactTypes;
 }
开发者ID:hguru,项目名称:224Civi,代码行数:26,代码来源:Relationship.php

示例15: basic

 static function basic(&$form)
 {
     $form->addElement('hidden', 'hidden_basic', 1);
     if ($form->_searchOptions['contactType']) {
         // add checkboxes for contact type
         $contact_type = array();
         $contactTypes = CRM_Contact_BAO_ContactType::getSelectElements();
         if ($contactTypes) {
             $form->add('select', 'contact_type', ts('Contact Type(s)'), $contactTypes, FALSE, array('id' => 'contact_type', 'multiple' => 'multiple', 'title' => ts('- select -')));
         }
     }
     if ($form->_searchOptions['groups']) {
         // multiselect for groups
         if ($form->_group) {
             $form->add('select', 'group', ts('Groups'), $form->_group, FALSE, array('id' => 'group', 'multiple' => 'multiple', 'title' => ts('- select -')));
         }
     }
     if ($form->_searchOptions['tags']) {
         // multiselect for categories
         $contactTags = CRM_Core_BAO_Tag::getTags();
         if ($contactTags) {
             $form->add('select', 'contact_tags', ts('Tags'), $contactTags, FALSE, array('id' => 'contact_tags', 'multiple' => 'multiple', 'title' => ts('- select -')));
         }
         $parentNames = CRM_Core_BAO_Tag::getTagSet('civicrm_contact');
         CRM_Core_Form_Tag::buildQuickForm($form, $parentNames, 'civicrm_contact', NULL, TRUE, FALSE, TRUE);
     }
     // add text box for last name, first name, street name, city
     $form->addElement('text', 'sort_name', ts('Find...'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'sort_name'));
     // add text box for last name, first name, street name, city
     $form->add('text', 'email', ts('Contact Email'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'sort_name'));
     //added contact source
     $form->add('text', 'contact_source', ts('Contact Source'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'source'));
     //added job title
     $attributes['job_title']['size'] = 30;
     $form->addElement('text', 'job_title', ts('Job Title'), $attributes['job_title'], 'size="30"');
     //added internal ID
     $attributes['id']['size'] = 30;
     $form->addElement('text', 'id', ts('Contact ID'), $attributes['id'], 'size="30"');
     //added external ID
     $attributes['external_identifier']['size'] = 30;
     $form->addElement('text', 'external_identifier', ts('External ID'), $attributes['external_identifier'], 'size="30"');
     $config = CRM_Core_Config::singleton();
     if (CRM_Core_Permission::check('access deleted contacts') and $config->contactUndelete) {
         $form->add('checkbox', 'deleted_contacts', ts('Search in Trash') . '<br />' . ts('(deleted contacts)'));
     }
     // add checkbox for cms users only
     $form->addYesNo('uf_user', ts('CMS User?'));
     // tag all search
     $form->add('text', 'tag_search', ts('All Tags'));
     // add search profiles
     // FIXME: This is probably a part of profiles - need to be
     // FIXME: eradicated from here when profiles are reworked.
     $types = array('Participant', 'Contribution', 'Membership');
     // get component profiles
     $componentProfiles = array();
     $componentProfiles = CRM_Core_BAO_UFGroup::getProfiles($types);
     $ufGroups = CRM_Core_BAO_UFGroup::getModuleUFGroup('Search Profile', 1);
     $accessibleUfGroups = CRM_Core_Permission::ufGroup(CRM_Core_Permission::VIEW);
     $searchProfiles = array();
     foreach ($ufGroups as $key => $var) {
         if (!array_key_exists($key, $componentProfiles) && in_array($key, $accessibleUfGroups)) {
             $searchProfiles[$key] = $var['title'];
         }
     }
     $form->addElement('select', 'uf_group_id', ts('Search Views'), array('0' => ts('- default view -')) + $searchProfiles);
     $componentModes = CRM_Contact_Form_Search::getModeSelect();
     // unset contributions or participants if user does not have
     // permission on them
     if (!CRM_Core_Permission::access('CiviContribute')) {
         unset($componentModes['2']);
     }
     if (!CRM_Core_Permission::access('CiviEvent')) {
         unset($componentModes['3']);
     }
     if (!CRM_Core_Permission::access('CiviMember')) {
         unset($componentModes['5']);
     }
     if (!CRM_Core_Permission::check('view all activities')) {
         unset($componentModes['4']);
     }
     if (count($componentModes) > 1) {
         $form->addElement('select', 'component_mode', ts('Display Results As'), $componentModes);
     }
     $form->addElement('select', 'operator', ts('Search Operator'), array('AND' => ts('AND'), 'OR' => ts('OR')));
     // add the option to display relationships
     $rTypes = CRM_Core_PseudoConstant::relationshipType();
     $rSelect = array('' => ts('- Select Relationship Type-'));
     foreach ($rTypes as $rid => $rValue) {
         if ($rValue['label_a_b'] == $rValue['label_b_a']) {
             $rSelect[$rid] = $rValue['label_a_b'];
         } else {
             $rSelect["{$rid}_a_b"] = $rValue['label_a_b'];
             $rSelect["{$rid}_b_a"] = $rValue['label_b_a'];
         }
     }
     $form->addElement('select', 'display_relationship_type', ts('Display Results as Relationship'), $rSelect);
     // checkboxes for DO NOT phone, email, mail
     // we take labels from SelectValues
     $t = CRM_Core_SelectValues::privacy();
     $form->add('select', 'privacy_options', ts('Privacy'), $t, FALSE, array('id' => 'privacy_options', 'multiple' => 'multiple', 'title' => ts('- select -')));
//.........这里部分代码省略.........
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:101,代码来源:Criteria.php


注:本文中的CRM_Core_PseudoConstant::relationshipType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。