本文整理汇总了PHP中CRM_Contribute_BAO_Query::buildSearchForm方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contribute_BAO_Query::buildSearchForm方法的具体用法?PHP CRM_Contribute_BAO_Query::buildSearchForm怎么用?PHP CRM_Contribute_BAO_Query::buildSearchForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Contribute_BAO_Query
的用法示例。
在下文中一共展示了CRM_Contribute_BAO_Query::buildSearchForm方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildQuickForm
/**
* Build the form object.
*/
public function buildQuickForm()
{
if ($this->_batchStatusId == 2) {
$this->add('submit', 'export_batch', ts('Export Batch'));
}
// do not build rest of form unless it is open batch
if ($this->_batchStatusId != 1) {
return;
}
parent::buildQuickForm();
$this->add('submit', 'close_batch', ts('Close Batch'));
$this->add('submit', 'export_batch', ts('Close & Export Batch'));
// text for sort_name
$this->addElement('text', 'sort_name', ts('Contributor Name or Email'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'sort_name'));
$this->_group = CRM_Core_PseudoConstant::nestedGroup();
// multiselect for groups
if ($this->_group) {
$this->add('select', 'group', ts('Groups'), $this->_group, FALSE, array('id' => 'group', 'multiple' => 'multiple', 'class' => 'crm-select2'));
}
$contactTags = CRM_Core_BAO_Tag::getTags();
if ($contactTags) {
$this->add('select', 'contact_tags', ts('Tags'), $contactTags, FALSE, array('id' => 'contact_tags', 'multiple' => 'multiple', 'class' => 'crm-select2'));
}
CRM_Contribute_BAO_Query::buildSearchForm($this);
$this->addElement('checkbox', 'toggleSelects', NULL, NULL);
$this->add('select', 'trans_remove', ts('Task'), array('' => ts('- actions -')) + array('Remove' => ts('Remove from Batch')));
$this->add('submit', 'rSubmit', ts('Go'), array('class' => 'crm-form-submit', 'id' => 'GoRemove'));
self::$_entityID = CRM_Utils_Request::retrieve('bid', 'Positive');
$this->addButtons(array(array('type' => 'submit', 'name' => ts('Search'), 'isDefault' => TRUE)));
$this->addElement('checkbox', 'toggleSelect', NULL, NULL);
$this->add('select', 'trans_assign', ts('Task'), array('' => ts('- actions -')) + array('Assign' => ts('Assign to Batch')));
$this->add('submit', 'submit', ts('Go'), array('class' => 'crm-form-submit', 'id' => 'Go'));
$this->applyFilter('__ALL__', 'trim');
$this->addElement('hidden', 'batch_id', self::$_entityID);
$this->add('text', 'name', ts('Batch Name'));
}
示例2: buildQuickForm
/**
* Build the form object.
*/
public function buildQuickForm()
{
parent::buildQuickForm();
// text for sort_name
$this->addElement('text', 'sort_name', ts('Contributor Name or Email'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'sort_name'));
$this->_group = CRM_Core_PseudoConstant::nestedGroup();
// multiselect for groups
if ($this->_group) {
$this->add('select', 'group', ts('Groups'), $this->_group, FALSE, array('id' => 'group', 'multiple' => 'multiple', 'class' => 'crm-select2'));
}
// multiselect for tags
$contactTags = CRM_Core_BAO_Tag::getTags();
if ($contactTags) {
$this->add('select', 'contact_tags', ts('Tags'), $contactTags, FALSE, array('id' => 'contact_tags', 'multiple' => 'multiple', 'class' => 'crm-select2'));
}
CRM_Contribute_BAO_Query::buildSearchForm($this);
$rows = $this->get('rows');
if (is_array($rows)) {
if (!$this->_single) {
$this->addRowSelectors($rows);
}
$permission = CRM_Core_Permission::getPermission();
$queryParams = $this->get('queryParams');
$softCreditFiltering = FALSE;
if (!empty($queryParams)) {
$softCreditFiltering = CRM_Contribute_BAO_Query::isSoftCreditOptionEnabled($queryParams);
}
$tasks = CRM_Contribute_Task::permissionedTaskTitles($permission, $softCreditFiltering);
$this->addTaskMenu($tasks);
}
}
示例3: buildQuickForm
/**
* Build the form
*
* @access public
* @return void
*/
function buildQuickForm()
{
// text for sort_name
$this->addElement('text', 'sort_name', ts('Contributor Name or Email'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'sort_name'));
require_once 'CRM/Contribute/BAO/Query.php';
CRM_Contribute_BAO_Query::buildSearchForm($this);
/*
* add form checkboxes for each row. This is needed out here to conform to QF protocol
* of all elements being declared in builQuickForm
*/
$rows = $this->get('rows');
if (is_array($rows)) {
if (!$this->_single) {
$this->addElement('checkbox', 'toggleSelect', null, null, array('onclick' => "toggleTaskAction( true ); return toggleCheckboxVals('mark_x_',this);"));
foreach ($rows as $row) {
$this->addElement('checkbox', $row['checkbox'], null, null, array('onclick' => "toggleTaskAction( true ); return checkSelectedBox('" . $row['checkbox'] . "', '" . $this->getName() . "');"));
}
}
$total = $cancel = 0;
require_once "CRM/Core/Permission.php";
$permission = CRM_Core_Permission::getPermission();
require_once 'CRM/Contribute/Task.php';
$tasks = array('' => ts('- more actions -')) + CRM_Contribute_Task::permissionedTaskTitles($permission);
$this->add('select', 'task', ts('Actions:') . ' ', $tasks);
$this->add('submit', $this->_actionButtonName, ts('Go'), array('class' => 'form-submit', 'id' => 'Go', 'onclick' => "return checkPerformAction('mark_x', '" . $this->getName() . "', 0);"));
$this->add('submit', $this->_printButtonName, ts('Print'), array('class' => 'form-submit', 'onclick' => "return checkPerformAction('mark_x', '" . $this->getName() . "', 1);"));
// need to perform tasks on all or selected items ? using radio_ts(task selection) for it
$this->addElement('radio', 'radio_ts', null, '', 'ts_sel', array('checked' => 'checked'));
$this->addElement('radio', 'radio_ts', null, '', 'ts_all', array('onclick' => $this->getName() . ".toggleSelect.checked = false; toggleCheckboxVals('mark_x_',this); toggleTaskAction( true );"));
}
// add buttons
$this->addButtons(array(array('type' => 'refresh', 'name' => ts('Search'), 'isDefault' => true)));
}
示例4: buildQuickForm
/**
* Build the form
*
* @access public
*
* @return void
*/
function buildQuickForm()
{
// text for sort_name
$this->addElement('text', 'sort_name', ts('Contributor Name or Email'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'sort_name'));
$this->_group = CRM_Core_PseudoConstant::group();
// multiselect for groups
if ($this->_group) {
$this->add('select', 'group', ts('Groups'), $this->_group, FALSE, array('id' => 'group', 'multiple' => 'multiple', 'class' => 'crm-select2'));
}
// multiselect for tags
$contactTags = CRM_Core_BAO_Tag::getTags();
if ($contactTags) {
$this->add('select', 'contact_tags', ts('Tags'), $contactTags, FALSE, array('id' => 'contact_tags', 'multiple' => 'multiple', 'class' => 'crm-select2'));
}
CRM_Contribute_BAO_Query::buildSearchForm($this);
/*
* add form checkboxes for each row. This is needed out here to conform to QF protocol
* of all elements being declared in builQuickForm
*/
$rows = $this->get('rows');
if (is_array($rows)) {
if (!$this->_single) {
$this->addElement('checkbox', 'toggleSelect', NULL, NULL, array('onclick' => "toggleTaskAction( true );", 'class' => 'select-rows'));
foreach ($rows as $row) {
$this->addElement('checkbox', $row['checkbox'], NULL, NULL, array('onclick' => "toggleTaskAction( true );", 'class' => 'select-row'));
}
}
$total = $cancel = 0;
$permission = CRM_Core_Permission::getPermission();
$tasks = array('' => ts('- actions -')) + CRM_Contribute_Task::permissionedTaskTitles($permission);
$this->add('select', 'task', ts('Actions:') . ' ', $tasks);
$this->add('submit', $this->_actionButtonName, ts('Go'), array('class' => 'form-submit', 'id' => 'Go', 'onclick' => "return checkPerformAction('mark_x', '" . $this->getName() . "', 0);"));
// need to perform tasks on all or selected items ? using radio_ts(task selection) for it
$this->addElement('radio', 'radio_ts', NULL, '', 'ts_sel', array('checked' => 'checked'));
$this->addElement('radio', 'radio_ts', NULL, '', 'ts_all', array('class' => 'select-rows', 'onclick' => $this->getName() . ".toggleSelect.checked = false; toggleTaskAction( true );"));
}
// add buttons
$this->addButtons(array(array('type' => 'refresh', 'name' => ts('Search'), 'isDefault' => TRUE)));
}