本文整理汇总了PHP中CRM_Core_PseudoConstant::tag方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_PseudoConstant::tag方法的具体用法?PHP CRM_Core_PseudoConstant::tag怎么用?PHP CRM_Core_PseudoConstant::tag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_PseudoConstant
的用法示例。
在下文中一共展示了CRM_Core_PseudoConstant::tag方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildQuickForm
/**
* Function to build the form
*
* @return None
* @access public
*/
public function buildQuickForm()
{
if ($this->_action == CRM_Core_Action::DELETE) {
if ($this->_id && ($tag = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Tag', $this->_id, 'name', 'parent_id'))) {
CRM_Core_Session::setStatus(ts("This tag cannot be deleted! You must Delete all its child tags ('%1', etc) prior to deleting this tag.", array(1 => $tag)));
$url = CRM_Utils_System::url('civicrm/admin/tag', "reset=1");
CRM_Utils_System::redirect($url);
return true;
} else {
$this->addButtons(array(array('type' => 'next', 'name' => ts('Delete'), 'isDefault' => true), array('type' => 'cancel', 'name' => ts('Cancel'))));
}
} else {
$this->applyFilter('__ALL__', 'trim');
$this->add('text', 'name', ts('Name'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_Tag', 'name'), true);
$this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array('CRM_Core_DAO_Tag', $this->_id));
$this->add('text', 'description', ts('Description'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_Tag', 'description'));
//@lobo haven't a clue why the checkbox isn't displayed (it should be checked by default
$this->add('checkbox', 'is_selectable', ts("If it's a tag or a category"));
$allTag = array('' => '- ' . ts('select') . ' -') + CRM_Core_PseudoConstant::tag();
if ($this->_id) {
unset($allTag[$this->_id]);
}
$this->add('select', 'parent_id', ts('Parent Tag'), $allTag);
parent::buildQuickForm();
}
}
示例2: __construct
function __construct()
{
$this->_columns = array('civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'grouping' => 'contact-fields', 'fields' => array('display_name' => array('title' => ts('Contact Name'), 'no_repeat' => true, 'default' => true), 'id' => array('no_display' => true, 'required' => true)), 'group_bys' => array('id' => array('title' => ts('Contact'), 'default' => true))), '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', 'grouping' => 'contact-fields', 'fields' => array('country_id' => array('title' => ts('Country')), 'state_province_id' => array('title' => ts('State/Province'))), 'group_bys' => array('country_id' => array('title' => ts('Country')), 'state_province_id' => array('title' => ts('State/Province')))), 'civicrm_contribution_type' => array('dao' => 'CRM_Contribute_DAO_ContributionType', 'fields' => array('contribution_type' => null), 'grouping' => 'contri-fields', 'group_bys' => array('contribution_type' => array('name' => 'id'))), 'civicrm_contribution' => array('dao' => 'CRM_Contribute_DAO_Contribution', 'fields' => array('contribution_source' => null, 'total_amount1' => array('name' => 'total_amount', 'alias' => 'contribution1', 'title' => ts('Range One Stat'), 'type' => CRM_Utils_Type::T_MONEY, 'default' => true, 'required' => true, 'statistics' => array('sum' => ts('Total Amount'), 'count' => ts('Count')), 'clause' => '
contribution1_total_amount_count, contribution1_total_amount_sum'), 'total_amount2' => array('name' => 'total_amount', 'alias' => 'contribution2', 'title' => ts('Range Two Stat'), 'type' => CRM_Utils_Type::T_MONEY, 'default' => true, 'required' => true, 'statistics' => array('sum' => ts('Total Amount'), 'count' => ts('Count')), 'clause' => '
contribution2_total_amount_count, contribution2_total_amount_sum')), 'grouping' => 'contri-fields', 'filters' => array('receive_date1' => array('title' => ts('Date Range One'), 'default' => 'previous.year', 'type' => CRM_Utils_Type::T_DATE, 'operatorType' => CRM_Report_Form::OP_DATE, 'name' => 'receive_date', 'alias' => 'contribution1'), 'receive_date2' => array('title' => ts('Date Range Two'), 'default' => 'this.year', 'type' => CRM_Utils_Type::T_DATE, 'operatorType' => CRM_Report_Form::OP_DATE, 'name' => 'receive_date', 'alias' => 'contribution2'), 'total_amount1' => array('title' => ts('Range One Amount'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_INT, 'name' => 'receive_date', 'dbAlias' => 'contribution1_total_amount_sum'), 'total_amount2' => array('title' => ts('Range Two Amount'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_INT, 'name' => 'receive_date', 'dbAlias' => 'contribution2_total_amount_sum'), 'contribution_status_id' => array('operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Contribute_PseudoConstant::contributionStatus(), 'default' => array('1'))), 'group_bys' => array('contribution_source' => null)), 'civicrm_group' => array('dao' => 'CRM_Contact_DAO_GroupContact', 'alias' => 'cgroup', 'filters' => array('gid' => array('name' => 'group_id', 'title' => ts('Group'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'group' => true, 'options' => CRM_Core_PseudoConstant::group()))), 'civicrm_tag' => array('dao' => 'CRM_Core_DAO_Tag', 'filters' => array('tid' => array('name' => 'tag_id', 'title' => ts('Tag'), 'tag' => true, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_PseudoConstant::tag()))));
parent::__construct();
}
示例3: __construct
function __construct()
{
$this->_columns = array('civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('display_name' => array('title' => ts('Contact Name'), 'required' => true, 'no_repeat' => true), 'gender_id' => array('title' => ts('Gender'), 'default' => true), 'birth_date' => array('title' => ts('Birthdate'), 'default' => false), 'id' => array('no_display' => true, 'required' => true)), 'filters' => array('sort_name' => array('title' => ts('Contact Name')), 'contact_type' => array('title' => ts('Contact Type'), 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => array('' => ts('-select-'), 'Individual' => ts('Individual'), 'Organization' => ts('Organization'), 'Household' => ts('Household')), 'default' => 'Individual'), 'id' => array('title' => ts('Contact ID'), 'no_display' => true)), 'grouping' => 'contact-fields'), 'civicrm_email' => array('dao' => 'CRM_Core_DAO_Email', 'fields' => array('email' => array('title' => ts('Email'), 'no_repeat' => true)), 'grouping' => 'contact-fields'), 'civicrm_address' => array('dao' => 'CRM_Core_DAO_Address', 'grouping' => 'contact-fields', 'fields' => array('street_address' => array('default' => false), 'city' => array('default' => true), 'postal_code' => null, 'state_province_id' => array('title' => ts('State/Province')), 'country_id' => array('title' => ts('Country'), 'default' => false))), 'civicrm_phone' => array('dao' => 'CRM_Core_DAO_Phone', 'fields' => array('phone' => null), 'grouping' => 'contact-fields'), 'civicrm_activity' => array('dao' => 'CRM_Activity_DAO_Activity', 'fields' => array('id' => array('title' => ts('Activity ID'), 'no_display' => true, '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('Case Start'), 'required' => true), 'end_date' => array('title' => ts('Case End'), 'required' => true)), 'filters' => array('case_id_filter' => array('name' => 'id', 'title' => ts('Cases?'), 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => array(1 => ts('Exclude non-case'), 2 => ts('Exclude cases'), 3 => ts('Include Both')), 'default' => 3), 'start_date' => array('title' => ts('Case Start'), 'operatorType' => CRM_Report_Form::OP_DATE), 'end_date' => array('title' => ts('Case End'), 'operatorType' => CRM_Report_Form::OP_DATE))), 'civicrm_group' => array('dao' => 'CRM_Contact_DAO_Group', 'alias' => 'cgroup', 'filters' => array('gid' => array('name' => 'group_id', 'title' => ts('Group'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'group' => true, 'options' => CRM_Core_PseudoConstant::group()))), 'civicrm_tag' => array('dao' => 'CRM_Core_DAO_Tag', 'filters' => array('tid' => array('name' => 'tag_id', 'title' => ts('Tag'), 'tag' => true, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_PseudoConstant::tag()))));
$open_case_val = CRM_Core_OptionGroup::getValue('activity_type', 'Open Case', 'name');
$crmDAO =& CRM_Core_DAO::executeQuery("SELECT cg.table_name, cg.extends AS ext, cf.label, cf.column_name FROM civicrm_custom_group cg INNER JOIN civicrm_custom_field cf ON cg.id = cf.custom_group_id\nwhere (cg.extends='Contact' OR cg.extends='Individual' OR cg.extends_entity_column_value='{$open_case_val}') AND cg.is_active=1 AND cf.is_active=1 ORDER BY cg.table_name");
$curTable = '';
$curExt = '';
$curFields = array();
while ($crmDAO->fetch()) {
if ($curTable == '') {
$curTable = $crmDAO->table_name;
$curExt = $crmDAO->ext;
} elseif ($curTable != $crmDAO->table_name) {
$this->_columns[$curTable] = array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => $curFields, 'ext' => $curExt);
$curTable = $crmDAO->table_name;
$curExt = $crmDAO->ext;
$curFields = array();
}
$curFields[$crmDAO->column_name] = array('title' => $crmDAO->label);
}
if (!empty($curFields)) {
$this->_columns[$curTable] = array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => $curFields, 'ext' => $curExt);
}
$this->_genders = CRM_Core_PseudoConstant::gender();
parent::__construct();
}
示例4: buildForm
function buildForm(&$form)
{
$this->setTitle(ts('Include / Exclude Search'));
$groups = CRM_Core_PseudoConstant::group();
$tags = CRM_Core_PseudoConstant::tag();
if (count($groups) == 0 || count($tags) == 0) {
CRM_Core_Session::setStatus(ts("Atleast one Group and Tag must be present, for Custom Group / Tag search."));
$url = CRM_Utils_System::url('civicrm/contact/search/custom/list', 'reset=1');
CRM_Utils_System::redirect($url);
}
$inG =& $form->addElement('advmultiselect', 'includeGroups', ts('Include Group(s)') . ' ', $groups, array('size' => 5, 'style' => 'width:240px', 'class' => 'advmultiselect'));
$outG =& $form->addElement('advmultiselect', 'excludeGroups', ts('Exclude Group(s)') . ' ', $groups, array('size' => 5, 'style' => 'width:240px', 'class' => 'advmultiselect'));
$andOr = array('1' => ts('Show contacts that meet the Groups criteria AND the Tags criteria'), '0' => ts('Show contacts that meet the Groups criteria OR the Tags criteria'));
$form->addRadio('andOr', ts('AND/OR'), $andOr, TRUE, '<br />', TRUE);
$int =& $form->addElement('advmultiselect', 'includeTags', ts('Include Tag(s)') . ' ', $tags, array('size' => 5, 'style' => 'width:240px', 'class' => 'advmultiselect'));
$outt =& $form->addElement('advmultiselect', 'excludeTags', ts('Exclude Tag(s)') . ' ', $tags, array('size' => 5, 'style' => 'width:240px', 'class' => 'advmultiselect'));
//add/remove buttons for groups
$inG->setButtonAttributes('add', array('value' => ts('Add >>')));
$outG->setButtonAttributes('add', array('value' => ts('Add >>')));
$inG->setButtonAttributes('remove', array('value' => ts('<< Remove')));
$outG->setButtonAttributes('remove', array('value' => ts('<< Remove')));
//add/remove buttons for tags
$int->setButtonAttributes('add', array('value' => ts('Add >>')));
$outt->setButtonAttributes('add', array('value' => ts('Add >>')));
$int->setButtonAttributes('remove', array('value' => ts('<< Remove')));
$outt->setButtonAttributes('remove', array('value' => ts('<< Remove')));
/**
* if you are using the standard template, this array tells the template what elements
* are part of the search criteria
*/
$form->assign('elements', array('includeGroups', 'excludeGroups', 'andOr', 'includeTags', 'excludeTags'));
}
示例5: buildQuickForm
/**
* Build the form
*
* @access public
* @return void
*/
function buildQuickForm()
{
// add select for tag
$this->_tags = array('' => ' - select tag - ') + CRM_Core_PseudoConstant::tag();
$this->add('select', 'tag_id', ts('Select Tag'), $this->_tags, true);
$this->addDefaultButtons(ts('Tag Contacts'));
}
示例6: __construct
function __construct()
{
// UI for selecting columns to appear in the report list
// array conatining the columns, group_bys and filters build and provided to Form
$this->_columns = array('civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('display_name' => array('title' => ts('Member Name'), 'no_repeat' => true, 'required' => true), 'id' => array('no_display' => true, 'required' => true)), 'grouping' => 'contact-fields'), 'civicrm_membership_type' => array('dao' => 'CRM_Member_DAO_MembershipType', 'grouping' => 'member-fields', 'filters' => array('tid' => array('name' => 'id', 'title' => ts('Membership Types'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Member_PseudoConstant::membershipType()))), 'civicrm_membership' => array('dao' => 'CRM_Member_DAO_Membership', 'grouping' => 'member-fields', 'fields' => array('membership_type_id' => array('title' => 'Membership Type', 'required' => true, 'type' => CRM_Utils_Type::T_STRING), 'membership_start_date' => array('title' => ts('Current Cycle Start Date')), 'membership_end_date' => array('title' => ts('Membership Lapse Date'), 'required' => true)), 'filters' => array('membership_end_date' => array('title' => 'Lapsed Memberships', 'operatorType' => CRM_Report_Form::OP_DATE))), 'civicrm_membership_status' => array('dao' => 'CRM_Member_DAO_MembershipStatus', 'alias' => 'mem_status', 'fields' => array('name' => array('title' => ts('Current Status'), 'required' => true)), 'grouping' => 'member-fields'), 'civicrm_address' => array('dao' => 'CRM_Core_DAO_Address', 'fields' => array('street_address' => null, 'city' => null, 'postal_code' => null, 'state_province_id' => array('title' => ts('State/Province')), 'country_id' => array('title' => ts('Country'), 'default' => true)), 'grouping' => 'contact-fields'), 'civicrm_email' => array('dao' => 'CRM_Core_DAO_Email', 'fields' => array('email' => null), 'grouping' => 'contact-fields'), 'civicrm_group' => array('dao' => 'CRM_Contact_DAO_GroupContact', 'alias' => 'cgroup', 'filters' => array('gid' => array('name' => 'group_id', 'title' => ts('Group'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'group' => true, 'options' => CRM_Core_PseudoConstant::group()))), 'civicrm_tag' => array('dao' => 'CRM_Core_DAO_Tag', 'filters' => array('tagid' => array('name' => 'tag_id', 'title' => ts('Tag'), 'tag' => true, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_PseudoConstant::tag()))));
parent::__construct();
}
示例7: buildForm
function buildForm(&$form)
{
$groups =& CRM_Core_PseudoConstant::group();
$tags =& CRM_Core_PseudoConstant::tag();
if (count($groups) == 0 || count($tags) == 0) {
CRM_Core_Session::setStatus(ts("Atleast one Group and Tag must be present, for Custom Group / Tag search."));
$url = CRM_Utils_System::url('civicrm/contact/search/custom/list', 'reset=1');
CRM_Utils_System::redirect($url);
}
$inG =& $form->addElement('advmultiselect', 'includeGroups', ts('Include Group(s)') . ' ', $groups, array('size' => 5, 'style' => 'width:240px', 'class' => 'advmultiselect'));
$outG =& $form->addElement('advmultiselect', 'excludeGroups', ts('Exclude Group(s)') . ' ', $groups, array('size' => 5, 'style' => 'width:240px', 'class' => 'advmultiselect'));
$andOr =& $form->addElement('checkbox', 'andOr', 'Combine With (AND, Uncheck For OR)', null, array('checked' => 'checked'));
$int =& $form->addElement('advmultiselect', 'includeTags', ts('Include Tag(s)') . ' ', $tags, array('size' => 5, 'style' => 'width:240px', 'class' => 'advmultiselect'));
$outt =& $form->addElement('advmultiselect', 'excludeTags', ts('Exclude Tag(s)') . ' ', $tags, array('size' => 5, 'style' => 'width:240px', 'class' => 'advmultiselect'));
//add/remove buttons for groups
$inG->setButtonAttributes('add', array('value' => ts('Add >>')));
$outG->setButtonAttributes('add', array('value' => ts('Add >>')));
$inG->setButtonAttributes('remove', array('value' => ts('<< Remove')));
$outG->setButtonAttributes('remove', array('value' => ts('<< Remove')));
//add/remove buttons for tags
$int->setButtonAttributes('add', array('value' => ts('Add >>')));
$outt->setButtonAttributes('add', array('value' => ts('Add >>')));
$int->setButtonAttributes('remove', array('value' => ts('<< Remove')));
$outt->setButtonAttributes('remove', array('value' => ts('<< Remove')));
/**
* if you are using the standard template, this array tells the template what elements
* are part of the search criteria
*/
$form->assign('elements', array('includeGroups', 'excludeGroups', 'andOr', 'includeTags', 'excludeTags'));
}
示例8: buildQuickForm
/**
* Function to build the form
*
* @return None
* @access public
*/
public function buildQuickForm()
{
// get categories for the contact id
$entityTag =& CRM_Core_BAO_EntityTag::getTag($this->_contactId);
$this->assign('tagged', $entityTag);
// get the list of all the categories
$allTag =& CRM_Core_PseudoConstant::tag();
// need to append the array with the " checked " if contact is tagged with the tag
foreach ($allTag as $tagID => $varValue) {
if (in_array($tagID, $entityTag)) {
$tagAttribute = array('onclick' => "return changeRowColor(\"rowidtag_{$tagID}\")", 'checked' => 'checked', 'id' => "tag_{$tagID}");
} else {
$tagAttribute = array('onclick' => "return changeRowColor(\"rowidtag_{$tagID}\")", 'id' => "tag_{$tagID}");
}
$tagChk[$tagID] = $this->createElement('checkbox', $tagID, '', '', $tagAttribute);
}
$this->addGroup($tagChk, 'tagList', null, null, true);
$tags = new CRM_Core_BAO_Tag();
$tree = $tags->getTree();
$this->assign('tree', $tags->getTree());
$this->assign('tag', $allTag);
if ($this->_action & CRM_Core_Action::BROWSE) {
$this->freeze();
} else {
$this->addButtons(array(array('type' => 'next', 'name' => ts('Update Tags'), 'isDefault' => true), array('type' => 'cancel', 'name' => ts('Cancel'))));
}
}
示例9: buildQuickForm
/**
* Build the form
*
* @access public
* @return void
*/
function buildQuickForm()
{
// add select for tag
$this->_tags = CRM_Core_PseudoConstant::tag();
foreach ($this->_tags as $tagID => $tagName) {
$this->_tagElement =& $this->addElement('checkbox', "tag[{$tagID}]", null, $tagName);
}
$this->addDefaultButtons(ts('Tag Contacts'));
}
示例10: preProcess
/**
* Function to set variables up before form is built
*
* @return void
* @access public
*/
public function preProcess()
{
//get the data from the session
$dataValues = $this->get('dataValues');
$mapper = $this->get('mapper');
$invalidRowCount = $this->get('invalidRowCount');
$conflictRowCount = $this->get('conflictRowCount');
$mismatchCount = $this->get('unMatchCount');
$columnNames = $this->get('columnNames');
//assign column names
$this->assign('columnNames', $columnNames);
//get the mapping name displayed if the mappingId is set
$mappingId = $this->get('loadMappingId');
if ($mappingId) {
$mapDAO = new CRM_Core_DAO_Mapping();
$mapDAO->id = $mappingId;
$mapDAO->find(TRUE);
$this->assign('loadedMapping', $mappingId);
$this->assign('savedName', $mapDAO->name);
}
$this->assign('rowDisplayCount', 2);
$groups = CRM_Core_PseudoConstant::group();
$this->set('groups', $groups);
$tag = CRM_Core_PseudoConstant::tag();
if ($tag) {
$this->set('tag', $tag);
}
if ($invalidRowCount) {
$urlParams = 'type=' . CRM_Import_Parser::ERROR . '&parser=CRM_Import_Parser';
$this->set('downloadErrorRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
}
if ($conflictRowCount) {
$urlParams = 'type=' . CRM_Import_Parser::CONFLICT . '&parser=CRM_Import_Parser';
$this->set('downloadConflictRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
}
if ($mismatchCount) {
$urlParams = 'type=' . CRM_Import_Parser::NO_MATCH . '&parser=CRM_Import_Parser';
$this->set('downloadMismatchRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
}
$properties = array('mapper', 'locations', 'phones', 'ims', 'dataValues', 'columnCount', 'totalRowCount', 'validRowCount', 'invalidRowCount', 'conflictRowCount', 'downloadErrorRecordsUrl', 'downloadConflictRecordsUrl', 'downloadMismatchRecordsUrl', 'related', 'relatedContactDetails', 'relatedContactLocType', 'relatedContactPhoneType', 'relatedContactImProvider', 'websites', 'relatedContactWebsiteType');
foreach ($properties as $property) {
$this->assign($property, $this->get($property));
}
$statusID = $this->get('statusID');
if (!$statusID) {
$statusID = md5(uniqid(rand(), TRUE));
$this->set('statusID', $statusID);
}
$statusUrl = CRM_Utils_System::url('civicrm/ajax/status', "id={$statusID}", FALSE, NULL, FALSE);
$this->assign('statusUrl', $statusUrl);
$showColNames = TRUE;
if ('CRM_Import_DataSource_CSV' == $this->get('dataSource') && !$this->get('skipColumnHeader')) {
$showColNames = FALSE;
}
$this->assign('showColNames', $showColNames);
}
示例11: __construct
function __construct()
{
$yearsInPast = 8;
$yearsInFuture = 2;
$date = CRM_Core_SelectValues::date('custom', null, $yearsInPast, $yearsInFuture);
$count = $date['maxYear'];
while ($date['minYear'] <= $count) {
$optionYear[$date['minYear']] = $date['minYear'];
$date['minYear']++;
}
$this->_columns = array('civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'grouping' => 'contact-field', 'fields' => array('display_name' => array('title' => ts('Donor Name'), 'default' => true, 'required' => true)), 'filters' => array('sort_name' => array('title' => ts('Donor Name'), 'operator' => 'like'))), 'civicrm_email' => array('dao' => 'CRM_Core_DAO_Email', 'grouping' => 'contact-field', 'fields' => array('email' => array('title' => ts('Email'), 'default' => true))), 'civicrm_phone' => array('dao' => 'CRM_Core_DAO_Phone', 'grouping' => 'contact-field', 'fields' => array('phone' => array('title' => ts('Phone No'), 'default' => true))), 'civicrm_contribution' => array('dao' => 'CRM_Contribute_DAO_Contribution', 'fields' => array('contact_id' => array('title' => ts('contactId'), 'no_display' => true, 'required' => true, 'no_repeat' => true), 'total_amount' => array('title' => ts('Total Amount'), 'no_display' => true, 'required' => true, 'no_repeat' => true), 'receive_date' => array('title' => ts('Year'), 'no_display' => true, 'required' => true, 'no_repeat' => true)), 'filters' => array('yid' => array('name' => 'receive_date', 'title' => ts('This Year'), 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => $optionYear, 'default' => date('Y'), 'clause' => "contribution_civireport.contact_id NOT IN\n((SELECT distinct contri.contact_id FROM civicrm_contribution contri \n WHERE YEAR(contri.receive_date) = \$value AND contri.is_test = 0) ) AND contribution_civireport.contact_id IN ((SELECT distinct contri.contact_id FROM civicrm_contribution contri \n WHERE YEAR(contri.receive_date) = (\$value-1) AND contri.is_test = 0) ) "), 'contribution_status_id' => array('operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Contribute_PseudoConstant::contributionStatus(), 'default' => array('1')))), 'civicrm_group' => array('dao' => 'CRM_Contact_DAO_GroupContact', 'alias' => 'cgroup', 'filters' => array('gid' => array('name' => 'group_id', 'title' => ts('Group'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'group' => true, 'options' => CRM_Core_PseudoConstant::group()))), 'civicrm_tag' => array('dao' => 'CRM_Core_DAO_Tag', 'filters' => array('tid' => array('name' => 'tag_id', 'title' => ts('Tag'), 'tag' => true, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_PseudoConstant::tag()))));
parent::__construct();
}
示例12: buildForm
function buildForm(&$form)
{
$form->add('select', 'contact_type', ts('Find...'), CRM_Core_SelectValues::contactType());
// add select for groups
$group = array('' => ts('- any group -')) + CRM_Core_PseudoConstant::group();
$form->addElement('select', 'group', ts('in'), $group);
// add select for categories
$tag = array('' => ts('- any tag -')) + CRM_Core_PseudoConstant::tag();
$form->addElement('select', 'tag', ts('Tagged'), $tag);
// text for sort_name
$form->add('text', 'sort_name', ts('Name'));
$form->assign('elements', array('sort_name', 'contact_type', 'group', 'tag'));
}
示例13: civicrm_entity_tag_display
/**
*
* @param <type> $params
* @return <type>
*/
function civicrm_entity_tag_display(&$params)
{
if (!array_key_exists('contact_id', $params)) {
return civicrm_create_error(ts('contact_id is a required field'));
}
require_once 'CRM/Core/BAO/EntityTag.php';
$values =& CRM_Core_BAO_EntityTag::getTag($params['contact_id']);
$result = array();
$tags = CRM_Core_PseudoConstant::tag();
foreach ($values as $v) {
$result[] = $tags[$v];
}
return implode(',', $result);
}
示例14: preProcess
/**
* Function to set variables up before form is built
*
* @return void
* @access public
*/
function preProcess()
{
$skipColumnHeader = $this->controller->exportValue('UploadFile', 'skipColumnHeader');
//get the data from the session
$dataValues = $this->get('dataValues');
$mapper = $this->get('mapper');
$invalidRowCount = $this->get('invalidRowCount');
$conflictRowCount = $this->get('conflictRowCount');
$mismatchCount = $this->get('unMatchCount');
//get the mapping name displayed if the mappingId is set
$mappingId = $this->get('loadMappingId');
if ($mappingId) {
$mapDAO =& new CRM_Core_DAO_Mapping();
$mapDAO->id = $mappingId;
$mapDAO->find(true);
$this->assign('loadedMapping', $mappingId);
$this->assign('savedName', $mapDAO->name);
}
if ($skipColumnHeader) {
$this->assign('skipColumnHeader', $skipColumnHeader);
$this->assign('rowDisplayCount', 3);
} else {
$this->assign('rowDisplayCount', 2);
}
$groups =& CRM_Core_PseudoConstant::group();
$this->set('groups', $groups);
$tag =& CRM_Core_PseudoConstant::tag();
if ($tag) {
$this->set('tag', $tag);
}
if ($invalidRowCount) {
$this->set('downloadErrorRecordsUrl', CRM_Utils_System::url('civicrm/export', 'type=1'));
}
if ($conflictRowCount) {
$this->set('downloadConflictRecordsUrl', CRM_Utils_System::url('civicrm/export', 'type=2'));
}
if ($mismatchCount) {
$this->set('downloadMismatchRecordsUrl', CRM_Utils_System::url('civicrm/export', 'type=4'));
}
$properties = array('mapper', 'locations', 'phones', 'dataValues', 'columnCount', 'totalRowCount', 'validRowCount', 'invalidRowCount', 'conflictRowCount', 'downloadErrorRecordsUrl', 'downloadConflictRecordsUrl', 'downloadMismatchRecordsUrl', 'related', 'relatedContactDetails', 'relatedContactLocType', 'relatedContactPhoneType');
foreach ($properties as $property) {
$this->assign($property, $this->get($property));
}
}
示例15: buildForm
function buildForm(&$form)
{
/**
* You can define a custom title for the search form
*/
$this->setTitle('Find Contribution Amounts by Tag');
/**
* Define the search form fields here
*/
$form->addDate('start_date', ts('Contribution Date From'), false, array('formatType' => 'custom'));
$form->addDate('end_date', ts('...through'), false, array('formatType' => 'custom'));
$tag = array('' => ts('- any tag -')) + CRM_Core_PseudoConstant::tag();
$form->addElement('select', 'tag', ts('Tagged'), $tag);
/**
* If you are using the sample template, this array tells the template fields to render
* for the search form.
*/
$form->assign('elements', array('start_date', 'end_date', 'tag'));
}