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


PHP CRM_Contact_Form_Search::buildQuickForm方法代码示例

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


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

示例1: buildQuickForm

 /**
  * Build the form
  *
  * @access public
  *
  * @return void
  */
 function buildQuickForm()
 {
     // text for sort_name or email criteria
     $config = CRM_Core_Config::singleton();
     $label = empty($config->includeEmailInName) ? ts('Name') : ts('Name or Email');
     $this->add('text', 'sort_name', $label);
     $searchOptions = CRM_Core_BAO_Setting::valueOptions(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'advanced_search_options');
     if (!empty($searchOptions['contactType'])) {
         $contactTypes = array('' => ts('- any contact type -')) + CRM_Contact_BAO_ContactType::getSelectElements();
         $this->add('select', 'contact_type', ts('is...'), $contactTypes);
     }
     if (!empty($searchOptions['groups'])) {
         // Arrange groups into hierarchical listing (child groups follow their parents and have indentation spacing in title)
         $groupHierarchy = CRM_Contact_BAO_Group::getGroupsHierarchy($this->_group, NULL, '  ', TRUE);
         // add select for groups
         $group = array('' => ts('- any group -')) + $groupHierarchy;
         $this->_groupElement =& $this->addElement('select', 'group', ts('in'), $group);
     }
     if (!empty($searchOptions['tags'])) {
         // tag criteria
         if (!empty($this->_tag)) {
             $tag = array('' => ts('- any tag -')) + $this->_tag;
             $this->_tagElement =& $this->addElement('select', 'tag', ts('with'), $tag);
         }
     }
     parent::buildQuickForm();
 }
开发者ID:archcidburnziso,项目名称:civicrm-core,代码行数:34,代码来源:Basic.php

示例2: buildQuickForm

 /**
  * Build the form object.
  *
  *
  * @return void
  */
 public function buildQuickForm()
 {
     // text for sort_name or email criteria
     $config = CRM_Core_Config::singleton();
     $label = empty($config->includeEmailInName) ? ts('Name') : ts('Name or Email');
     $this->add('text', 'sort_name', $label);
     $searchOptions = CRM_Core_BAO_Setting::valueOptions(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'advanced_search_options');
     $shortCuts = array();
     //@todo FIXME - using the CRM_Core_DAO::VALUE_SEPARATOR creates invalid html - if you can find the form
     // this is loaded onto then replace with something like '__' & test
     $separator = CRM_Core_DAO::VALUE_SEPARATOR;
     if (!empty($searchOptions['contactType'])) {
         $contactTypes = array('' => ts('- any contact type -')) + CRM_Contact_BAO_ContactType::getSelectElements(FALSE, TRUE, $separator);
         $this->add('select', 'contact_type', ts('is...'), $contactTypes, FALSE, array('class' => 'crm-select2'));
     }
     // add select for groups
     if (!empty($searchOptions['groups'])) {
         $this->addSelect('group', array('entity' => 'group_contact', 'label' => ts('in'), 'context' => 'search', 'placeholder' => ts('- any group -')));
     }
     if (!empty($searchOptions['tags'])) {
         // tag criteria
         if (!empty($this->_tag)) {
             $this->addSelect('tag', array('entity' => 'entity_tag', 'label' => ts('with'), 'context' => 'search', 'placeholder' => ts('- any tag -')));
         }
     }
     parent::buildQuickForm();
 }
开发者ID:vincent1892,项目名称:contact_report,代码行数:33,代码来源:Basic.php

示例3: buildQuickForm

 /**
  * Build the form object.
  */
 public function buildQuickForm()
 {
     $this->addSortNameField();
     $searchOptions = CRM_Core_BAO_Setting::valueOptions(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'advanced_search_options');
     if (!empty($searchOptions['contactType'])) {
         $contactTypes = array('' => ts('- any contact type -')) + CRM_Contact_BAO_ContactType::getSelectElements();
         $this->add('select', 'contact_type', ts('is...'), $contactTypes, FALSE, array('class' => 'crm-select2'));
     }
     // add select for groups
     if (!empty($searchOptions['groups'])) {
         $this->addField('group', array('entity' => 'group_contact', 'label' => ts('in'), 'placeholder' => ts('- any group -')));
     }
     if (!empty($searchOptions['tags'])) {
         // tag criteria
         if (!empty($this->_tag)) {
             $this->addField('tag', array('entity' => 'entity_tag', 'label' => ts('with'), 'placeholder' => ts('- any tag -')));
         }
     }
     parent::buildQuickForm();
 }
开发者ID:nielosz,项目名称:civicrm-core,代码行数:23,代码来源:Basic.php

示例4: buildQuickForm

 /**
  * Build the form object.
  */
 public function buildQuickForm()
 {
     // text for sort_name or email criteria
     $config = CRM_Core_Config::singleton();
     $label = empty($config->includeEmailInName) ? ts('Name') : ts('Name or Email');
     $this->add('text', 'sort_name', $label);
     $searchOptions = CRM_Core_BAO_Setting::valueOptions(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'advanced_search_options');
     if (!empty($searchOptions['contactType'])) {
         $contactTypes = array('' => ts('- any contact type -')) + CRM_Contact_BAO_ContactType::getSelectElements();
         $this->add('select', 'contact_type', ts('is...'), $contactTypes, FALSE, array('class' => 'crm-select2'));
     }
     // add select for groups
     if (!empty($searchOptions['groups'])) {
         $this->addSelect('group', array('entity' => 'group_contact', 'label' => ts('in'), 'context' => 'search', 'placeholder' => ts('- any group -')));
     }
     if (!empty($searchOptions['tags'])) {
         // tag criteria
         if (!empty($this->_tag)) {
             $this->addSelect('tag', array('entity' => 'entity_tag', 'label' => ts('with'), 'context' => 'search', 'placeholder' => ts('- any tag -')));
         }
     }
     parent::buildQuickForm();
 }
开发者ID:nyimbi,项目名称:civicrm-core,代码行数:26,代码来源:Basic.php

示例5: buildQuickForm

 /**
  * Build the form
  *
  * @access public
  *
  * @return void
  */
 function buildQuickForm()
 {
     $this->set('context', 'advanced');
     $this->_searchPane = CRM_Utils_Array::value('searchPane', $_GET);
     $this->_searchOptions = CRM_Core_BAO_Setting::valueOptions(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'advanced_search_options');
     if (!$this->_searchPane || $this->_searchPane == 'basic') {
         CRM_Contact_Form_Search_Criteria::basic($this);
     }
     $allPanes = array();
     $paneNames = array(ts('Address Fields') => 'location', ts('Custom Fields') => 'custom', ts('Activities') => 'activity', ts('Relationships') => 'relationship', ts('Demographics') => 'demographics', ts('Notes') => 'notes', ts('Change Log') => 'changeLog');
     //check if there are any custom data searchable fields
     $groupDetails = array();
     $extends = array_merge(array('Contact', 'Individual', 'Household', 'Organization'), CRM_Contact_BAO_ContactType::subTypes());
     $groupDetails = CRM_Core_BAO_CustomGroup::getGroupDetail(NULL, TRUE, $extends);
     // if no searchable fields unset panel
     if (empty($groupDetails)) {
         unset($paneNames[ts('Custom Fields')]);
     }
     foreach ($paneNames as $name => $type) {
         if (!$this->_searchOptions[$type]) {
             unset($paneNames[$name]);
         }
     }
     $components = CRM_Core_Component::getEnabledComponents();
     $componentPanes = array();
     foreach ($components as $name => $component) {
         if (in_array($name, array_keys($this->_searchOptions)) && $this->_searchOptions[$name] && CRM_Core_Permission::access($component->name)) {
             $componentPanes[$name] = $component->registerAdvancedSearchPane();
             $componentPanes[$name]['name'] = $name;
         }
     }
     usort($componentPanes, array('CRM_Utils_Sort', 'cmpFunc'));
     foreach ($componentPanes as $name => $pane) {
         // FIXME: we should change the use of $name here to keyword
         $paneNames[$pane['title']] = $pane['name'];
     }
     $hookPanes = array();
     CRM_Contact_BAO_Query_Hook::singleton()->registerAdvancedSearchPane($hookPanes);
     $paneNames = array_merge($paneNames, $hookPanes);
     $this->_paneTemplatePath = array();
     foreach ($paneNames as $name => $type) {
         if (!array_key_exists($type, $this->_searchOptions) && !in_array($type, $hookPanes)) {
             continue;
         }
         $allPanes[$name] = array('url' => CRM_Utils_System::url('civicrm/contact/search/advanced', "snippet=1&searchPane={$type}&qfKey={$this->controller->_key}"), 'open' => 'false', 'id' => $type);
         // see if we need to include this paneName in the current form
         if ($this->_searchPane == $type || CRM_Utils_Array::value("hidden_{$type}", $_POST) || CRM_Utils_Array::value("hidden_{$type}", $this->_formValues)) {
             $allPanes[$name]['open'] = 'true';
             if (CRM_Utils_Array::value($type, $components)) {
                 $c = $components[$type];
                 $this->add('hidden', "hidden_{$type}", 1);
                 $c->buildAdvancedSearchPaneForm($this);
                 $this->_paneTemplatePath[$type] = $c->getAdvancedSearchPaneTemplatePath();
             } else {
                 if (in_array($type, $hookPanes)) {
                     CRM_Contact_BAO_Query_Hook::singleton()->buildAdvancedSearchPaneForm($this, $type);
                     CRM_Contact_BAO_Query_Hook::singleton()->setAdvancedSearchPaneTemplatePath($this->_paneTemplatePath, $type);
                 } else {
                     CRM_Contact_Form_Search_Criteria::$type($this);
                     $template = ucfirst($type);
                     $this->_paneTemplatePath[$type] = "CRM/Contact/Form/Search/Criteria/{$template}.tpl";
                 }
             }
         }
     }
     $this->assign('allPanes', $allPanes);
     if (!$this->_searchPane) {
         parent::buildQuickForm();
     } else {
         $this->assign('suppressForm', TRUE);
     }
 }
开发者ID:hguru,项目名称:224Civi,代码行数:79,代码来源:Advanced.php

示例6: buildQuickForm

 public function buildQuickForm()
 {
     $fields = self::fields();
     // Get fields of type date
     // FIXME: This is a hack until our fields contain this meta-data
     $dateFields = array();
     foreach ($fields as $name => $field) {
         if (strpos($name, '_date') || CRM_Utils_Array::value('data_type', $field) == 'Date') {
             $dateFields[] = $name;
         }
     }
     // Add javascript
     CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'templates/CRM/Contact/Form/Search/Builder.js')->addSetting(array('searchBuilder' => array('newBlock' => $this->get('newBlock'), 'dateFields' => $dateFields, 'fieldOptions' => self::fieldOptions())));
     //get the saved search mapping id
     $mappingId = NULL;
     if ($this->_ssID) {
         $mappingId = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_SavedSearch', $this->_ssID, 'mapping_id');
     }
     CRM_Core_BAO_Mapping::buildMappingForm($this, 'Search Builder', $mappingId, $this->_columnCount, $this->_blockCount);
     parent::buildQuickForm();
 }
开发者ID:hguru,项目名称:224Civi,代码行数:21,代码来源:Builder.php

示例7: buildQuickForm

 function buildQuickForm()
 {
     $this->_customClass->buildForm($this);
     parent::buildQuickForm();
 }
开发者ID:hguru,项目名称:224Civi,代码行数:5,代码来源:Custom.php

示例8: buildQuickForm

 /**
  * Build the form
  *
  * @access public
  * @return void
  */
 function buildQuickForm()
 {
     // text for sort_name or email criteria
     $this->add('text', 'sort_name', ts('Name or Email'));
     require_once 'CRM/Core/BAO/Preferences.php';
     $searchOptions = CRM_Core_BAO_Preferences::valueOptions('advanced_search_options');
     if (CRM_Utils_Array::value('contactType', $searchOptions)) {
         require_once 'CRM/Contact/BAO/ContactType.php';
         $contactTypes = array('' => ts('- any contact type -')) + CRM_Contact_BAO_ContactType::getSelectElements();
         $this->add('select', 'contact_type', ts('is...'), $contactTypes);
     }
     if (CRM_Utils_Array::value('groups', $searchOptions)) {
         $config =& CRM_Core_Config::singleton();
         if ($config->groupTree) {
             $this->add('hidden', 'group', null, array('id' => 'group'));
             $group = CRM_Utils_Array::value('group', $this->_formValues);
             $selectedGroups = explode(',', $group);
             if (is_array($selectedGroups)) {
                 $groupNames = null;
                 $groupIds = array();
                 foreach ($selectedGroups as $groupId) {
                     if ($groupNames) {
                         $groupNames .= '<br/>';
                     }
                     $groupNames .= $this->_group[$groupId];
                 }
                 $groupIds[] = $groupId;
             }
             $this->assign('groupIds', implode(',', $groupIds));
             $this->assign('groupNames', $groupNames);
         } else {
             // add select for groups
             $group = array('' => ts('- any group -')) + $this->_group;
             $this->_groupElement =& $this->addElement('select', 'group', ts('in'), $group);
         }
     }
     if (CRM_Utils_Array::value('tags', $searchOptions)) {
         // tag criteria
         $tag = array('' => ts('- any tag -')) + $this->_tag;
         $this->_tagElement =& $this->addElement('select', 'tag', ts('with'), $tag);
     }
     parent::buildQuickForm();
 }
开发者ID:bhirsch,项目名称:voipdev,代码行数:49,代码来源:Basic.php

示例9: buildQuickForm

 public function buildQuickForm()
 {
     //get the saved search mapping id
     $mappingId = null;
     if ($this->_ssID) {
         $mappingId = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_SavedSearch', $this->_ssID, 'mapping_id');
     }
     CRM_Core_BAO_Mapping::buildMappingForm($this, 'Search Builder', $mappingId, $this->_columnCount, $this->_blockCount);
     parent::buildQuickForm();
 }
开发者ID:ksecor,项目名称:civicrm,代码行数:10,代码来源:Builder.php

示例10: buildQuickForm

 /**
  * Build the form
  *
  * @access public
  *
  * @return void
  */
 function buildQuickForm()
 {
     // text for sort_name or email criteria
     $config = CRM_Core_Config::singleton();
     $label = empty($config->includeEmailInName) ? ts('Name') : ts('Name or Email');
     $this->add('text', 'sort_name', $label);
     $searchOptions = CRM_Core_BAO_Setting::valueOptions(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'advanced_search_options');
     if (CRM_Utils_Array::value('contactType', $searchOptions)) {
         $contactTypes = array('' => ts('- any contact type -')) + CRM_Contact_BAO_ContactType::getSelectElements();
         $this->add('select', 'contact_type', ts('is...'), $contactTypes);
     }
     if (CRM_Utils_Array::value('groups', $searchOptions)) {
         if ($config->groupTree) {
             $this->add('hidden', 'group', NULL, array('id' => 'group'));
             $group = CRM_Utils_Array::value('group', $this->_formValues);
             $selectedGroups = explode(',', $group);
             if (is_array($selectedGroups)) {
                 $groupNames = NULL;
                 $groupIds = array();
                 foreach ($selectedGroups as $groupId) {
                     if ($groupNames) {
                         $groupNames .= '<br/>';
                     }
                     $groupNames .= $this->_group[$groupId];
                 }
                 $groupIds[] = $groupId;
             }
             $this->assign('groupIds', implode(',', $groupIds));
             $this->assign('groupNames', $groupNames);
         } else {
             // add select for groups
             $group = array('' => ts('- any group -')) + $this->_group;
             $this->_groupElement =& $this->addElement('select', 'group', ts('in'), $group);
         }
     }
     if (CRM_Utils_Array::value('tags', $searchOptions)) {
         // tag criteria
         if (!empty($this->_tag)) {
             $tag = array('' => ts('- any tag -')) + $this->_tag;
             $this->_tagElement =& $this->addElement('select', 'tag', ts('with'), $tag);
         }
     }
     parent::buildQuickForm();
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:51,代码来源:Basic.php

示例11: buildQuickForm

 /**
  * Build the form
  *
  * @access public
  *
  * @return void
  */
 function buildQuickForm()
 {
     // text for sort_name or email criteria
     $config = CRM_Core_Config::singleton();
     $label = empty($config->includeEmailInName) ? ts('Name') : ts('Name or Email');
     $this->add('text', 'sort_name', $label);
     $searchOptions = CRM_Core_BAO_Setting::valueOptions(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'advanced_search_options');
     $shortCuts = array();
     //@todo FIXME - using the CRM_Core_DAO::VALUE_SEPARATOR creates invalid html - if you can find the form
     // this is loaded onto then replace with something like '__' & test
     $separator = CRM_Core_DAO::VALUE_SEPARATOR;
     if (!empty($searchOptions['contactType'])) {
         $contactTypes = array('' => ts('- any contact type -')) + CRM_Contact_BAO_ContactType::getSelectElements(FALSE, TRUE, $separator);
         $this->add('select', 'contact_type', ts('is...'), $contactTypes, FALSE, array('class' => 'crm-select2'));
     }
     if (!empty($searchOptions['groups'])) {
         // Arrange groups into hierarchical listing (child groups follow their parents and have indentation spacing in title)
         $groupHierarchy = CRM_Contact_BAO_Group::getGroupsHierarchy($this->_group, NULL, '&nbsp;&nbsp;', TRUE);
         // add select for groups
         $group = array('' => ts('- any group -')) + $groupHierarchy;
         $this->add('select', 'group', ts('in'), $group, FALSE, array('class' => 'crm-select2'));
     }
     if (!empty($searchOptions['tags'])) {
         // tag criteria
         if (!empty($this->_tag)) {
             $tag = array('' => ts('- any tag -')) + $this->_tag;
             $this->add('select', 'tag', ts('with'), $tag, FALSE, array('class' => 'crm-select2'));
         }
     }
     parent::buildQuickForm();
 }
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:38,代码来源:Basic.php

示例12: buildQuickForm

 /**
  * Build quick form.
  */
 public function buildQuickForm()
 {
     $fields = self::fields();
     // Get fields of type date
     // FIXME: This is a hack until our fields contain this meta-data
     $dateFields = array();
     $stringFields = array();
     $searchByLabelFields = array();
     foreach ($fields as $name => $field) {
         if (strpos($name, '_date') || CRM_Utils_Array::value('data_type', $field) == 'Date') {
             $dateFields[] = $name;
         }
         // it's necessary to know which of the fields are from string data type
         if (isset($field['type']) && $field['type'] === CRM_Utils_Type::T_STRING) {
             $stringFields[] = $name;
         }
         // it's necessary to know which of the fields are searchable by label
         if (isset($field['searchByLabel']) && $field['searchByLabel']) {
             $searchByLabelFields[] = $name;
         }
     }
     // Add javascript
     CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'templates/CRM/Contact/Form/Search/Builder.js', 1, 'html-header')->addSetting(array('searchBuilder' => array('newBlock' => $this->get('newBlock'), 'dateFields' => $dateFields, 'fieldOptions' => self::fieldOptions(), 'stringFields' => $stringFields, 'searchByLabelFields' => $searchByLabelFields, 'generalOperators' => array('' => ts('-operator-')) + CRM_Core_SelectValues::getSearchBuilderOperators(), 'stringOperators' => array('' => ts('-operator-')) + CRM_Core_SelectValues::getSearchBuilderOperators(CRM_Utils_Type::T_STRING))));
     //get the saved search mapping id
     $mappingId = NULL;
     if ($this->_ssID) {
         $mappingId = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_SavedSearch', $this->_ssID, 'mapping_id');
     }
     CRM_Core_BAO_Mapping::buildMappingForm($this, 'Search Builder', $mappingId, $this->_columnCount, $this->_blockCount);
     parent::buildQuickForm();
 }
开发者ID:nielosz,项目名称:civicrm-core,代码行数:34,代码来源:Builder.php


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