本文整理汇总了PHP中CRM_Contact_BAO_Query::qill方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contact_BAO_Query::qill方法的具体用法?PHP CRM_Contact_BAO_Query::qill怎么用?PHP CRM_Contact_BAO_Query::qill使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Contact_BAO_Query
的用法示例。
在下文中一共展示了CRM_Contact_BAO_Query::qill方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildQuickForm
/**
* Build the form object - it consists of
* - displaying the QILL (query in local language)
* - displaying elements for saving the search
*
*
* @return void
*/
public function buildQuickForm()
{
// get the qill
$query = new CRM_Contact_BAO_Query($this->get('queryParams'));
$qill = $query->qill();
// need to save qill for the smarty template
$this->assign('qill', $qill);
// the name and description are actually stored with the group and not the saved search
$this->add('text', 'title', ts('Name'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Group', 'title'), TRUE);
$this->addElement('textarea', 'description', ts('Description'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Group', 'description'));
$groupTypes = CRM_Core_OptionGroup::values('group_type', TRUE);
unset($groupTypes['Access Control']);
if (!CRM_Core_Permission::access('CiviMail')) {
$isWorkFlowEnabled = CRM_Mailing_Info::workflowEnabled();
if ($isWorkFlowEnabled && !CRM_Core_Permission::check('create mailings') && !CRM_Core_Permission::check('schedule mailings') && !CRM_Core_Permission::check('approve mailings')) {
unset($groupTypes['Mailing List']);
}
}
if (!empty($groupTypes)) {
$this->addCheckBox('group_type', ts('Group Type'), $groupTypes, NULL, NULL, NULL, NULL, ' ');
}
//CRM-14190
CRM_Group_Form_Edit::buildParentGroups($this);
// get the group id for the saved search
$groupID = NULL;
if (isset($this->_id)) {
$groupID = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $this->_id, 'id', 'saved_search_id');
$this->addDefaultButtons(ts('Update Smart Group'));
} else {
$this->addDefaultButtons(ts('Save Smart Group'));
}
$this->addRule('title', ts('Name already exists in Database.'), 'objectExists', array('CRM_Contact_DAO_Group', $groupID, 'title'));
}
示例2: browse
/**
* Browse all saved searches.
*
* @return content of the parents run method
*
*/
function browse()
{
$rows = array();
$savedSearch = new CRM_Contact_DAO_SavedSearch();
$savedSearch->is_active = 1;
$savedSearch->selectAdd();
$savedSearch->selectAdd('id, form_values');
$savedSearch->find();
$properties = array('id', 'name', 'description');
while ($savedSearch->fetch()) {
// get name and description from group object
$group = new CRM_Contact_DAO_Group();
$group->saved_search_id = $savedSearch->id;
if ($group->find(TRUE)) {
$permissions = CRM_Group_Page_Group::checkPermission($group->id, $group->title);
if (!CRM_Utils_System::isNull($permissions)) {
$row = array();
$row['name'] = $group->title;
$row['description'] = $group->description;
$row['id'] = $savedSearch->id;
$formValues = unserialize($savedSearch->form_values);
$query = new CRM_Contact_BAO_Query($formValues);
$row['query_detail'] = $query->qill();
$action = array_sum(array_keys(self::links()));
$action = $action & CRM_Core_Action::mask($permissions);
$row['action'] = CRM_Core_Action::formLink(self::links(), $action, array('id' => $row['id']));
$rows[] = $row;
}
}
}
$this->assign('rows', $rows);
return parent::run();
}
示例3: getQILL
/**
* @inheritDoc
*/
public function getQILL()
{
return $this->_query->qill();
}
示例4: buildQuickForm
/**
* Build the form - it consists of
* - displaying the QILL (query in local language)
* - displaying elements for saving the search
*
* @access public
* @return void
*/
function buildQuickForm()
{
// get the qill
$query = new CRM_Contact_BAO_Query($this->get('queryParams'));
$qill = $query->qill();
// need to save qill for the smarty template
$this->assign('qill', $qill);
// the name and description are actually stored with the group and not the saved search
$this->add('text', 'title', ts('Name'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Group', 'title'), true);
$this->addElement('textarea', 'description', ts('Description'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Group', 'description'));
require_once 'CRM/Core/OptionGroup.php';
$groupTypes = CRM_Core_OptionGroup::values('group_type', true);
unset($groupTypes['Access Control']);
if (!CRM_Core_Permission::access('CiviMail')) {
unset($groupTypes['Mailing List']);
}
if (!empty($groupTypes)) {
$this->addCheckBox('group_type', ts('Group Type'), $groupTypes, null, null, null, null, ' ');
}
// get the group id for the saved search
$groupID = null;
if (isset($this->_id)) {
$groupID = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $this->_id, 'id', 'saved_search_id');
$this->addDefaultButtons(ts('Update Smart Group'));
} else {
$this->addDefaultButtons(ts('Save Smart Group'));
}
$this->addRule('title', ts('Name already exists in Database.'), 'objectExists', array('CRM_Contact_DAO_Group', $groupID, 'title'));
}