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


PHP CRM_Contact_Form_Task::buildQuickForm方法代码示例

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


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

示例1: buildQuickForm

 function buildQuickForm()
 {
     // first: sort out the contacts
     $contacts = array();
     $households = array();
     $organisations = array();
     foreach ($this->_contactIds as $contact_id) {
         $contact = civicrm_api3('Contact', 'getsingle', array('id' => $contact_id));
         if ($contact['contact_type'] == 'Individual') {
             $contacts[$contact_id] = $contact;
         } elseif ($contact['contact_type'] == 'Household') {
             $households[$contact_id] = $contact;
         } else {
             $organisations[$contact_id] = $contact;
         }
     }
     $this->assign('contacts', $contacts);
     $this->assign('households', $households);
     $this->assign('ignored', $organisations);
     $patterns = $this->calculatePatterns($contacts);
     $patterns['custom'] = ts("Custom Name", array('domain' => 'de.systopia.householdmerge'));
     // adjust title
     CRM_Utils_System::setTitle(ts("Merge %1 contacts into a Household", array(1 => count($contacts), 'domain' => 'de.systopia.householdmerge')));
     // Add switch and ID list
     $this->add('hidden', 'hh_option');
     $this->add('hidden', 'hh_contacts', implode(',', array_keys($contacts)));
     // Add "CREATE NEW" elements
     $this->add('text', 'household_name', ts('Household Name', array('domain' => 'de.systopia.householdmerge')), array('size' => 32, 'placeholder' => ts("Enter household name", array('domain' => 'de.systopia.householdmerge'))), FALSE);
     $pattern_select = $this->add('select', 'household_name_pattern', ts('Household Name', array('domain' => 'de.systopia.householdmerge')), $patterns, TRUE);
     $pattern_select->setSelected('custom');
     // Add "MERGE INTO" elements
     $this->add('text', 'existing_household', ts('Enter Household ID', array('domain' => 'de.systopia.householdmerge')), array('size' => 5), false);
     $this->addButtons(array(array('type' => 'submit', 'name' => ts('Merge', array('domain' => 'de.systopia.householdmerge')), 'isDefault' => TRUE), array('type' => 'cancel', 'name' => ts('Abort', array('domain' => 'de.systopia.householdmerge')), 'isDefault' => FALSE)));
     parent::buildQuickForm();
 }
开发者ID:systopia,项目名称:de.systopia.householdmerge,代码行数:35,代码来源:Merge.php

示例2: buildQuickForm

 function buildQuickForm()
 {
     $mysql = 'SELECT id FROM veda_civicrm_wordmailmerge';
     $tableCount = CRM_Core_DAO::executeQuery($mysql);
     $noofRows = array();
     while ($tableCount->fetch()) {
         $noofRows = $tableCount->id;
     }
     $rowCount = count($noofRows);
     if ($rowCount == 0) {
         $this->add('select', 'message_template', ts('Message Template'), array('' => '- select -'), TRUE);
         CRM_Core_Session::setStatus(ts("No attachement in the template."));
     } else {
         $sql = " SELECT cmt.id, cmt.msg_title FROM civicrm_msg_template cmt\n               RIGHT JOIN veda_civicrm_wordmailmerge vcw ON ( vcw.msg_template_id = cmt.id)";
         $dao = CRM_Core_DAO::executeQuery($sql);
         while ($dao->fetch()) {
             $msgTemplatesResult[$dao->id] = $dao->msg_title;
         }
         // add form elements
         $this->add('select', 'message_template', ts('Message Template'), array('' => '- select -') + $msgTemplatesResult, TRUE);
         // if mergeSameAddress method exists
         if (method_exists('CRM_Core_BAO_Address', 'mergeSameAddress')) {
             //add checkbox for merge contacts with same address
             $this->add('checkbox', 'merge_letter_for_same_address', ts('Merge letter for same address'), NULL);
         }
         $this->addButtons(array(array('type' => 'submit', 'name' => ts('Merge'), 'isDefault' => TRUE)));
     }
     // export form elements
     $this->assign('elementNames', $this->getRenderableElementNames());
     parent::buildQuickForm();
 }
开发者ID:krishgopi,项目名称:uk.co.vedaconsulting.module.wordmailmerge,代码行数:31,代码来源:WordMailMergeForm.php


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