本文整理汇总了PHP中CRM_Utils_Hook::searchTasks方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Utils_Hook::searchTasks方法的具体用法?PHP CRM_Utils_Hook::searchTasks怎么用?PHP CRM_Utils_Hook::searchTasks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Utils_Hook
的用法示例。
在下文中一共展示了CRM_Utils_Hook::searchTasks方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initTasks
static function initTasks()
{
if (!self::$_tasks) {
self::$_tasks = array(1 => array('title' => ts('Add Contacts to Group'), 'class' => 'CRM_Contact_Form_Task_AddToGroup', 'result' => true), 2 => array('title' => ts('Remove Contacts from Group'), 'class' => 'CRM_Contact_Form_Task_RemoveFromGroup', 'result' => true), 3 => array('title' => ts('Tag Contacts (assign tags)'), 'class' => 'CRM_Contact_Form_Task_AddToTag', 'result' => true), 4 => array('title' => ts('Untag Contacts (remove tags)'), 'class' => 'CRM_Contact_Form_Task_RemoveFromTag', 'result' => true), 5 => array('title' => ts('Export Contacts'), 'class' => array('CRM_Export_Form_Select', 'CRM_Export_Form_Map'), 'result' => false), 6 => array('title' => ts('Send Email to Contacts'), 'class' => 'CRM_Contact_Form_Task_Email', 'result' => false), 7 => array('title' => ts('Send SMS to Contacts'), 'class' => 'CRM_Contact_Form_Task_SMS', 'result' => true), 8 => array('title' => ts('Delete Contacts'), 'class' => 'CRM_Contact_Form_Task_Delete', 'result' => false), 9 => array('title' => ts('Add Contacts to Household'), 'class' => 'CRM_Contact_Form_Task_AddToHousehold', 'result' => true), 10 => array('title' => ts('Add Contacts to Organization'), 'class' => 'CRM_Contact_Form_Task_AddToOrganization', 'result' => true), 11 => array('title' => ts('Record Activity for Contacts'), 'class' => 'CRM_Activity_Form_Activity', 'result' => true), 13 => array('title' => ts('New Smart Group'), 'class' => 'CRM_Contact_Form_Task_SaveSearch', 'result' => true), 14 => array('title' => ts('Update Smart Group'), 'class' => 'CRM_Contact_Form_Task_SaveSearch_Update', 'result' => true), 15 => array('title' => ts('Print Contacts'), 'class' => 'CRM_Contact_Form_Task_Print', 'result' => false), 16 => array('title' => ts('Mailing Labels'), 'class' => 'CRM_Contact_Form_Task_Label', 'result' => true), 17 => array('title' => ts('Batch Update via Profile'), 'class' => array('CRM_Contact_Form_Task_PickProfile', 'CRM_Contact_Form_Task_Batch'), 'result' => true), 19 => array('title' => ts('Print PDF Letter for Contacts'), 'class' => 'CRM_Contact_Form_Task_PDF', 'result' => true), 21 => array('title' => ts('Merge Contacts'), 'class' => 'CRM_Contact_Form_Task_Merge', 'result' => true));
//CRM-4418, check for delete
if (!CRM_Core_Permission::check('delete contacts')) {
unset(self::$_tasks[8]);
}
//show map action only if map provider and key is set
$config =& CRM_Core_Config::singleton();
if ($config->mapProvider && $config->mapAPIKey) {
self::$_tasks[12] = array('title' => ts('Map Contacts'), 'class' => 'CRM_Contact_Form_Task_Map', 'result' => false);
}
if (CRM_Core_Permission::access('CiviEvent')) {
self::$_tasks[18] = array('title' => ts('Add Contacts to Event'), 'class' => 'CRM_Event_Form_Participant', 'result' => true);
}
if (CRM_Core_Permission::access('CiviMail')) {
self::$_tasks[20] = array('title' => ts('Schedule/Send a Mass Mailing'), 'class' => array('CRM_Mailing_Form_Group', 'CRM_Mailing_Form_Settings', 'CRM_Mailing_Form_Upload', 'CRM_Mailing_Form_Test', 'CRM_Mailing_Form_Schedule'), 'result' => false);
}
self::$_tasks += CRM_Core_Component::taskList();
require_once 'CRM/Utils/Hook.php';
CRM_Utils_Hook::searchTasks('contact', self::$_tasks);
asort(self::$_tasks);
}
}
示例2: array
/**
* These tasks are the core set of tasks that the user can perform
* on a contact / group of contacts.
*
* @return array
* the set of tasks for a group of contacts.
*/
public static function &tasks()
{
if (!self::$_tasks) {
self::$_tasks = array(1 => array('title' => ts('Print Mailing Recipients'), 'class' => 'CRM_Mailing_Form_Task_Print', 'result' => FALSE));
CRM_Utils_Hook::searchTasks('mailing', self::$_tasks);
asort(self::$_tasks);
}
return self::$_tasks;
}
示例3: array
/**
* These tasks are the core set of tasks that the user can perform
* on a voter / group of voters
*
* @return array the set of tasks for a group of voters.
* @static
* @access public
*/
static function &tasks()
{
if (!self::$_tasks) {
self::$_tasks = array(1 => array('title' => ts('Record Respondents Interview'), 'class' => array('CRM_Campaign_Form_Task_Interview', 'CRM_Campaign_Form_Task_Release'), 'result' => FALSE), 2 => array('title' => ts('Reserve Respondents'), 'class' => array('CRM_Campaign_Form_Task_Reserve', 'CRM_Campaign_Form_Task_Interview', 'CRM_Campaign_Form_Task_Release'), 'result' => FALSE), 3 => array('title' => ts('Release Respondents'), 'class' => 'CRM_Campaign_Form_Task_Release', 'result' => FALSE), 4 => array('title' => ts('Print Respondents'), 'class' => 'CRM_Campaign_Form_Task_Print', 'result' => FALSE));
}
CRM_Utils_Hook::searchTasks('campaign', self::$_tasks);
asort(self::$_tasks);
return self::$_tasks;
}
示例4: array
/**
* These tasks are the core set of tasks that the user can perform
* on a relationship / group of relationships
*
* @return array
* the set of tasks for a group of relationships
*/
public static function &tasks()
{
if (!self::$_tasks) {
self::$_tasks = array(1 => array('title' => ts('Export Relationships'), 'class' => array('CRM_Relationship_Export_Form_Select', 'CRM_Relationship_Export_Form_Map'), 'result' => FALSE));
CRM_Utils_Hook::searchTasks('relationship', self::$_tasks);
asort(self::$_tasks);
}
return self::$_tasks;
}
示例5: array
/**
* These tasks are the core set of tasks that the user can perform
* on a contact / group of contacts
*
* @return array the set of tasks for a group of contacts
* @static
* @access public
*/
static function &tasks()
{
if (!self::$_tasks) {
self::$_tasks = array(2 => array('title' => ts('Print Bookings'), 'class' => 'CRM_Contribute_Form_Task_Print', 'result' => FALSE));
CRM_Utils_Hook::searchTasks('contribution', self::$_tasks);
asort(self::$_tasks);
}
return self::$_tasks;
}
示例6: array
/**
* These tasks are the core set of tasks that the user can perform
* on a contact / group of contacts
*
* @return array the set of tasks for a group of contacts
* @static
* @access public
*/
static function &tasks()
{
if (!self::$_tasks) {
self::$_tasks = array(1 => array('title' => ts('Delete Grants'), 'class' => 'CRM_Grant_Form_Task_Delete', 'result' => FALSE), 2 => array('title' => ts('Print Grants'), 'class' => 'CRM_Grant_Form_Task_Print', 'result' => FALSE), 3 => array('title' => ts('Export Grants'), 'class' => array('CRM_Export_Form_Select', 'CRM_Export_Form_Map'), 'result' => FALSE), 4 => array('title' => ts('Update Grants'), 'class' => 'CRM_Grant_Form_Task_Update', 'result' => FALSE));
}
if (!CRM_Core_Permission::check('delete in CiviGrant')) {
unset(self::$_tasks[1]);
}
CRM_Utils_Hook::searchTasks('grant', self::$_tasks);
asort(self::$_tasks);
return self::$_tasks;
}
示例7: array
/**
* These tasks are the core set of tasks that the user can perform
* on a contact / group of contacts
*
* @return array the set of tasks for a group of contacts
* @static
* @access public
*/
static function &tasks()
{
if (!self::$_tasks) {
self::$_tasks = array(1 => array('title' => ts('Delete Participants'), 'class' => 'CRM_Event_Form_Task_Delete', 'result' => FALSE), 2 => array('title' => ts('Print Selected Rows'), 'class' => 'CRM_Event_Form_Task_Print', 'result' => FALSE), 3 => array('title' => ts('Export Participants'), 'class' => array('CRM_Export_Form_Select', 'CRM_Export_Form_Map'), 'result' => FALSE), 4 => array('title' => ts('Batch Update Participants Via Profile'), 'class' => array('CRM_Event_Form_Task_PickProfile', 'CRM_Event_Form_Task_Batch'), 'result' => TRUE), 5 => array('title' => ts('Cancel Registration'), 'class' => 'CRM_Event_Form_Task_Cancel', 'result' => FALSE), 6 => array('title' => ts('Send Email to Contacts'), 'class' => 'CRM_Event_Form_Task_Email', 'result' => TRUE), 13 => array('title' => ts('New Smart Group'), 'class' => 'CRM_Event_Form_Task_SaveSearch', 'result' => TRUE), 14 => array('title' => ts('Update Smart Group'), 'class' => 'CRM_Event_Form_Task_SaveSearch_Update', 'result' => TRUE), 15 => array('title' => ts('Change Participant Status'), 'class' => 'CRM_Event_Form_Task_ParticipantStatus', 'result' => TRUE), 16 => array('title' => ts('Print Event Name Badges'), 'class' => 'CRM_Event_Form_Task_Badge', 'result' => FALSE));
//CRM-4418, check for delete
if (!CRM_Core_Permission::check('delete in CiviEvent')) {
unset(self::$_tasks[1]);
}
}
CRM_Utils_Hook::searchTasks('event', self::$_tasks);
asort(self::$_tasks);
return self::$_tasks;
}
示例8: array
/**
* These tasks are the core set of tasks that the user can perform
* on a contact / group of contacts
*
* @return array
* the set of tasks for a group of contacts
*/
public static function &tasks()
{
if (!self::$_tasks) {
self::$_tasks = array(1 => array('title' => ts('Delete cases'), 'class' => 'CRM_Case_Form_Task_Delete', 'result' => FALSE), 2 => array('title' => ts('Print selected rows'), 'class' => 'CRM_Case_Form_Task_Print', 'result' => FALSE), 3 => array('title' => ts('Export cases'), 'class' => array('CRM_Export_Form_Select', 'CRM_Export_Form_Map'), 'result' => FALSE), 4 => array('title' => ts('Restore cases'), 'class' => 'CRM_Case_Form_Task_Restore', 'result' => FALSE), 5 => array('title' => ts('Print/merge Document'), 'class' => 'CRM_Case_Form_Task_PDF', 'result' => FALSE));
//CRM-4418, check for delete
if (!CRM_Core_Permission::check('delete in CiviCase')) {
unset(self::$_tasks[1]);
}
}
CRM_Utils_Hook::searchTasks('case', self::$_tasks);
asort(self::$_tasks);
return self::$_tasks;
}
示例9: array
/**
* These tasks are the core set of tasks that the user can perform
* on a contact / group of contacts
*
* @return array the set of tasks for a group of contacts
* @static
* @access public
*/
static function &tasks()
{
if (!self::$_tasks) {
self::$_tasks = array(1 => array('title' => ts('Delete Cases'), 'class' => 'CRM_Case_Form_Task_Delete', 'result' => false), 2 => array('title' => ts('Print Cases'), 'class' => 'CRM_Case_Form_Task_Print', 'result' => false), 3 => array('title' => ts('Export Cases'), 'class' => array('CRM_Export_Form_Select', 'CRM_Export_Form_Map'), 'result' => false), 4 => array('title' => ts('Restore Cases'), 'class' => 'CRM_Case_Form_Task_Restore', 'result' => false));
//CRM-4418, check for delete
if (!CRM_Core_Permission::check('delete in CiviCase')) {
unset(self::$_tasks[1]);
}
}
require_once 'CRM/Utils/Hook.php';
CRM_Utils_Hook::searchTasks('case', self::$_tasks);
asort(self::$_tasks);
return self::$_tasks;
}
示例10: array
/**
* These tasks are the core set of tasks that the user can perform
* on a contact / group of contacts
*
* @return array
* the set of tasks for a group of contacts
*/
public static function &tasks()
{
if (!self::$_tasks) {
self::$_tasks = array(1 => array('title' => ts('Delete memberships'), 'class' => 'CRM_Member_Form_Task_Delete', 'result' => FALSE), 2 => array('title' => ts('Print selected rows'), 'class' => 'CRM_Member_Form_Task_Print', 'result' => FALSE), 3 => array('title' => ts('Export members'), 'class' => array('CRM_Export_Form_Select', 'CRM_Export_Form_Map'), 'result' => FALSE), 4 => array('title' => ts('Email - send now'), 'class' => 'CRM_Member_Form_Task_Email', 'result' => TRUE), 5 => array('title' => ts('Update multiple memberships'), 'class' => array('CRM_Member_Form_Task_PickProfile', 'CRM_Member_Form_Task_Batch'), 'result' => TRUE), 6 => array('title' => ts('Mailing labels - print'), 'class' => array('CRM_Member_Form_Task_Label'), 'result' => TRUE), 7 => array('title' => ts('PDF letters - print for memberships'), 'class' => 'CRM_Member_Form_Task_PDFLetter', 'result' => FALSE));
//CRM-4418, check for delete
if (!CRM_Core_Permission::check('delete in CiviMember')) {
unset(self::$_tasks[1]);
}
//CRM-12920 - check for edit permission
if (!CRM_Core_Permission::check('edit memberships')) {
unset(self::$_tasks[5]);
}
}
CRM_Utils_Hook::searchTasks('membership', self::$_tasks);
asort(self::$_tasks);
return self::$_tasks;
}
示例11: tasks
/**
* These tasks are the core set of tasks that the user can perform
* on a contact / group of contacts
*
* @return array
* the set of tasks for a group of contacts
*/
public static function tasks()
{
if (!self::$_tasks) {
self::$_tasks = array(1 => array('title' => ts('Delete contributions'), 'class' => 'CRM_Contribute_Form_Task_Delete', 'result' => FALSE), 2 => array('title' => ts('Print selected rows'), 'class' => 'CRM_Contribute_Form_Task_Print', 'result' => FALSE), 3 => array('title' => ts('Export contributions'), 'class' => array('CRM_Export_Form_Select', 'CRM_Export_Form_Map'), 'result' => FALSE), 4 => array('title' => ts('Update multiple contributions'), 'class' => array('CRM_Contribute_Form_Task_PickProfile', 'CRM_Contribute_Form_Task_Batch'), 'result' => TRUE), 5 => array('title' => ts('Email - send now'), 'class' => 'CRM_Contribute_Form_Task_Email', 'result' => TRUE), 6 => array('title' => ts('Update pending contribution status'), 'class' => 'CRM_Contribute_Form_Task_Status', 'result' => TRUE), 7 => array('title' => ts('Receipts - print or email'), 'class' => 'CRM_Contribute_Form_Task_PDF', 'result' => FALSE), 8 => array('title' => ts('Thank-you letters - print or email'), 'class' => 'CRM_Contribute_Form_Task_PDFLetter', 'result' => FALSE), 9 => array('title' => ts('Invoices - print or email'), 'class' => 'CRM_Contribute_Form_Task_Invoice', 'result' => FALSE));
//CRM-4418, check for delete
if (!CRM_Core_Permission::check('delete in CiviContribute')) {
unset(self::$_tasks[1]);
}
//CRM-12920 - check for edit permission
if (!CRM_Core_Permission::check('edit contributions')) {
unset(self::$_tasks[4], self::$_tasks[6]);
}
// remove action "Invoices - print or email"
$invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
$invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
if (!$invoicing) {
unset(self::$_tasks[9]);
}
CRM_Utils_Hook::searchTasks('contribution', self::$_tasks);
asort(self::$_tasks);
}
return self::$_tasks;
}
示例12: array
/**
* These tasks are the core set of tasks that the user can perform
* on a contact / group of contacts
*
* @return array
* the set of tasks for a group of contacts
*/
public static function &tasks()
{
if (!self::$_tasks) {
self::$_tasks = array(1 => array('title' => ts('Delete Contributions'), 'class' => 'CRM_Contribute_Form_Task_Delete', 'result' => FALSE), 2 => array('title' => ts('Print Selected Rows'), 'class' => 'CRM_Contribute_Form_Task_Print', 'result' => FALSE), 3 => array('title' => ts('Export Contributions'), 'class' => array('CRM_Export_Form_Select', 'CRM_Export_Form_Map'), 'result' => FALSE), 4 => array('title' => ts('Batch Update Contributions Via Profile'), 'class' => array('CRM_Contribute_Form_Task_PickProfile', 'CRM_Contribute_Form_Task_Batch'), 'result' => TRUE), 5 => array('title' => ts('Send Email to Contacts'), 'class' => 'CRM_Contribute_Form_Task_Email', 'result' => TRUE), 6 => array('title' => ts('Update Pending Contribution Status'), 'class' => 'CRM_Contribute_Form_Task_Status', 'result' => TRUE), 7 => array('title' => ts('Print or Email Contribution Receipts'), 'class' => 'CRM_Contribute_Form_Task_PDF', 'result' => FALSE), 8 => array('title' => ts('Thank-you Letters for Contributions'), 'class' => 'CRM_Contribute_Form_Task_PDFLetter', 'result' => FALSE), 9 => array('title' => ts('Print or Email Contribution Invoices'), 'class' => 'CRM_Contribute_Form_Task_Invoice', 'result' => FALSE));
//CRM-4418, check for delete
if (!CRM_Core_Permission::check('delete in CiviContribute')) {
unset(self::$_tasks[1]);
}
//CRM-12920 - check for edit permission
if (!CRM_Core_Permission::check('edit contributions')) {
unset(self::$_tasks[4], self::$_tasks[6]);
}
// remove action "Print or Email Contribution Invoices"
$invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
$invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
if (!$invoicing) {
unset(self::$_tasks[9]);
}
CRM_Utils_Hook::searchTasks('contribution', self::$_tasks);
asort(self::$_tasks);
}
return self::$_tasks;
}
示例13: initTasks
public static function initTasks()
{
if (!self::$_tasks) {
self::$_tasks = array(self::GROUP_CONTACTS => array('title' => ts('Add Contacts to Group'), 'class' => 'CRM_Contact_Form_Task_AddToGroup'), self::REMOVE_CONTACTS => array('title' => ts('Remove Contacts from Group'), 'class' => 'CRM_Contact_Form_Task_RemoveFromGroup'), self::TAG_CONTACTS => array('title' => ts('Tag Contacts (assign tags)'), 'class' => 'CRM_Contact_Form_Task_AddToTag'), self::REMOVE_TAGS => array('title' => ts('Untag Contacts (remove tags)'), 'class' => 'CRM_Contact_Form_Task_RemoveFromTag'), self::EXPORT_CONTACTS => array('title' => ts('Export Contacts'), 'class' => array('CRM_Export_Form_Select', 'CRM_Export_Form_Map'), 'result' => FALSE), self::EMAIL_CONTACTS => array('title' => ts('Send Email to Contacts'), 'class' => 'CRM_Contact_Form_Task_Email', 'result' => TRUE), self::SMS_CONTACTS => array('title' => ts('Send SMS to Contacts'), 'class' => 'CRM_Contact_Form_Task_SMS', 'result' => TRUE), self::DELETE_CONTACTS => array('title' => ts('Delete Contacts'), 'class' => 'CRM_Contact_Form_Task_Delete', 'result' => FALSE), self::RECORD_CONTACTS => array('title' => ts('Record Activity for Contacts'), 'class' => 'CRM_Activity_Form_Activity'), self::SAVE_SEARCH => array('title' => ts('New Smart Group'), 'class' => 'CRM_Contact_Form_Task_SaveSearch', 'result' => TRUE), self::SAVE_SEARCH_UPDATE => array('title' => ts('Update Smart Group'), 'class' => 'CRM_Contact_Form_Task_SaveSearch_Update', 'result' => TRUE), self::PRINT_CONTACTS => array('title' => ts('Print Selected Rows'), 'class' => 'CRM_Contact_Form_Task_Print', 'result' => FALSE), self::LABEL_CONTACTS => array('title' => ts('Mailing Labels'), 'class' => 'CRM_Contact_Form_Task_Label', 'result' => TRUE), self::BATCH_UPDATE => array('title' => ts('Batch Update via Profile'), 'class' => array('CRM_Contact_Form_Task_PickProfile', 'CRM_Contact_Form_Task_Batch'), 'result' => TRUE), self::PRINT_FOR_CONTACTS => array('title' => ts('Print PDF Letter for Contacts'), 'class' => 'CRM_Contact_Form_Task_PDF', 'result' => TRUE), self::EMAIL_UNHOLD => array('title' => ts('Unhold Emails'), 'class' => 'CRM_Contact_Form_Task_Unhold'), self::COMMUNICATION_PREFS => array('title' => ts('Alter Contact Communication Preferences'), 'class' => 'CRM_Contact_Form_Task_AlterPreferences'), self::RESTORE => array('title' => ts('Restore Contacts'), 'class' => 'CRM_Contact_Form_Task_Delete', 'result' => FALSE), self::DELETE_PERMANENTLY => array('title' => ts('Delete Permanently'), 'class' => 'CRM_Contact_Form_Task_Delete', 'result' => FALSE));
if (CRM_Contact_BAO_ContactType::isActive('Household')) {
$label = CRM_Contact_BAO_ContactType::getLabel('Household');
self::$_tasks[self::HOUSEHOLD_CONTACTS] = array('title' => ts('Add Contacts to %1', array(1 => $label)), 'class' => 'CRM_Contact_Form_Task_AddToHousehold');
}
if (CRM_Contact_BAO_ContactType::isActive('Organization')) {
$label = CRM_Contact_BAO_ContactType::getLabel('Organization');
self::$_tasks[self::ORGANIZATION_CONTACTS] = array('title' => ts('Add Contacts to %1', array(1 => $label)), 'class' => 'CRM_Contact_Form_Task_AddToOrganization');
}
if (CRM_Core_Permission::check('merge duplicate contacts')) {
self::$_tasks[self::MERGE_CONTACTS] = array('title' => ts('Merge Contacts'), 'class' => 'CRM_Contact_Form_Task_Merge', 'result' => TRUE);
}
//CRM-4418, check for delete
if (!CRM_Core_Permission::check('delete contacts')) {
unset(self::$_tasks[self::DELETE_CONTACTS]);
}
//show map action only if map provider and geoprovider are set (Google doesn't need geoprovider)
// should fix this to be more flexible as providers are added ??
$config = CRM_Core_Config::singleton();
if ($config->mapProvider && ($config->mapProvider == 'Google' || ($config->mapProvider == 'OpenStreetMaps' || $config->geoProvider == 'Google'))) {
self::$_tasks[self::MAP_CONTACTS] = array('title' => ts('Map Contacts'), 'class' => 'CRM_Contact_Form_Task_Map', 'result' => FALSE);
}
if (CRM_Core_Permission::access('CiviEvent')) {
self::$_tasks[self::ADD_EVENT] = array('title' => ts('Add Contacts to Event'), 'class' => 'CRM_Event_Form_Participant');
}
if (defined('CIVICRM_CIVIMAIL_UI_LEGACY')) {
if (CRM_Core_Permission::access('CiviMail')) {
self::$_tasks[self::CREATE_MAILING] = array('title' => ts('Schedule/Send a Mass Mailing'), 'class' => array('CRM_Mailing_Form_Group', 'CRM_Mailing_Form_Settings', 'CRM_Mailing_Form_Upload', 'CRM_Mailing_Form_Test', 'CRM_Mailing_Form_Schedule'), 'result' => FALSE);
} elseif (CRM_Mailing_Info::workflowEnabled() && CRM_Core_Permission::check('create mailings')) {
self::$_tasks[self::CREATE_MAILING] = array('title' => ts('Create a Mass Mailing'), 'class' => array('CRM_Mailing_Form_Group', 'CRM_Mailing_Form_Settings', 'CRM_Mailing_Form_Upload', 'CRM_Mailing_Form_Test'), 'result' => FALSE);
}
} else {
if (CRM_Core_Permission::access('CiviMail') || CRM_Mailing_Info::workflowEnabled() && CRM_Core_Permission::check('create mailings')) {
self::$_tasks[self::CREATE_MAILING] = array('title' => ts('Schedule/Send a Mass Mailing'), 'class' => 'CRM_Mailing_Form_Task_AdhocMailing', 'result' => FALSE);
}
}
self::$_tasks += CRM_Core_Component::taskList();
CRM_Utils_Hook::searchTasks('contact', self::$_tasks);
asort(self::$_tasks);
}
}
示例14: initTasks
static function initTasks()
{
if (!self::$_tasks) {
self::$_tasks = array(1 => array('title' => ts('Add Contacts to Group'), 'class' => 'CRM_Contact_Form_Task_AddToGroup'), 2 => array('title' => ts('Remove Contacts from Group'), 'class' => 'CRM_Contact_Form_Task_RemoveFromGroup'), 3 => array('title' => ts('Tag Contacts (assign tags)'), 'class' => 'CRM_Contact_Form_Task_AddToTag'), 4 => array('title' => ts('Untag Contacts (remove tags)'), 'class' => 'CRM_Contact_Form_Task_RemoveFromTag'), 5 => array('title' => ts('Export Contacts'), 'class' => array('CRM_Export_Form_Select', 'CRM_Export_Form_Map'), 'result' => FALSE), 6 => array('title' => ts('Send Email to Contacts'), 'class' => 'CRM_Contact_Form_Task_Email', 'result' => TRUE), 7 => array('title' => ts('Send SMS to Contacts'), 'class' => 'CRM_Contact_Form_Task_SMS', 'result' => TRUE), 8 => array('title' => ts('Delete Contacts'), 'class' => 'CRM_Contact_Form_Task_Delete', 'result' => FALSE), 11 => array('title' => ts('Record Activity for Contacts'), 'class' => 'CRM_Activity_Form_Activity'), 13 => array('title' => ts('New Smart Group'), 'class' => 'CRM_Contact_Form_Task_SaveSearch', 'result' => TRUE), 14 => array('title' => ts('Update Smart Group'), 'class' => 'CRM_Contact_Form_Task_SaveSearch_Update', 'result' => TRUE), 15 => array('title' => ts('Print Contacts'), 'class' => 'CRM_Contact_Form_Task_Print', 'result' => FALSE), 16 => array('title' => ts('Mailing Labels'), 'class' => 'CRM_Contact_Form_Task_Label', 'result' => TRUE), 17 => array('title' => ts('Batch Update via Profile'), 'class' => array('CRM_Contact_Form_Task_PickProfile', 'CRM_Contact_Form_Task_Batch'), 'result' => TRUE), 19 => array('title' => ts('Print PDF Letter for Contacts'), 'class' => 'CRM_Contact_Form_Task_PDF', 'result' => TRUE), 22 => array('title' => ts('Unhold Emails'), 'class' => 'CRM_Contact_Form_Task_Unhold'), 25 => array('title' => ts('Alter Contact Communication Preferences'), 'class' => 'CRM_Contact_Form_Task_AlterPreferences'), self::RESTORE => array('title' => ts('Restore Contacts'), 'class' => 'CRM_Contact_Form_Task_Delete', 'result' => FALSE), self::DELETE_PERMANENTLY => array('title' => ts('Delete Permanently'), 'class' => 'CRM_Contact_Form_Task_Delete', 'result' => FALSE));
if (CRM_Contact_BAO_ContactType::isActive('Household')) {
$label = CRM_Contact_BAO_ContactType::getLabel('Household');
self::$_tasks[9] = array('title' => ts('Add Contacts to %1', array(1 => $label)), 'class' => 'CRM_Contact_Form_Task_AddToHousehold');
}
if (CRM_Contact_BAO_ContactType::isActive('Organization')) {
$label = CRM_Contact_BAO_ContactType::getLabel('Organization');
self::$_tasks[10] = array('title' => ts('Add Contacts to %1', array(1 => $label)), 'class' => 'CRM_Contact_Form_Task_AddToOrganization');
}
if (CRM_Core_Permission::check('merge duplicate contacts')) {
self::$_tasks[21] = array('title' => ts('Merge Contacts'), 'class' => 'CRM_Contact_Form_Task_Merge', 'result' => TRUE);
}
//CRM-4418, check for delete
if (!CRM_Core_Permission::check('delete contacts')) {
unset(self::$_tasks[8]);
}
//show map action only if map provider and geoprovider are set (Google doesn't need geoprovider)
// should fix this to be more flexible as providers are added ??
$config = CRM_Core_Config::singleton();
if ($config->mapProvider && ($config->mapProvider == 'Google' || ($config->mapProvider == 'OpenStreetMaps' || $config->geoProvider == 'Google'))) {
self::$_tasks[12] = array('title' => ts('Map Contacts'), 'class' => 'CRM_Contact_Form_Task_Map', 'result' => FALSE);
}
if (CRM_Core_Permission::access('CiviEvent')) {
self::$_tasks[18] = array('title' => ts('Add Contacts to Event'), 'class' => 'CRM_Event_Form_Participant');
}
if (CRM_Core_Permission::access('CiviMail')) {
self::$_tasks[20] = array('title' => ts('Schedule/Send a Mass Mailing'), 'class' => array('CRM_Mailing_Form_Group', 'CRM_Mailing_Form_Settings', 'CRM_Mailing_Form_Upload', 'CRM_Mailing_Form_Test', 'CRM_Mailing_Form_Schedule'), 'result' => FALSE);
} elseif (CRM_Mailing_Info::workflowEnabled() && CRM_Core_Permission::check('create mailings')) {
self::$_tasks[20] = array('title' => ts('Create a Mass Mailing'), 'class' => array('CRM_Mailing_Form_Group', 'CRM_Mailing_Form_Settings', 'CRM_Mailing_Form_Upload', 'CRM_Mailing_Form_Test'), 'result' => FALSE);
}
self::$_tasks += CRM_Core_Component::taskList();
CRM_Utils_Hook::searchTasks('contact', self::$_tasks);
asort(self::$_tasks);
}
}
示例15: initTasks
public static function initTasks()
{
if (!self::$_tasks) {
self::$_tasks = array(self::GROUP_CONTACTS => array('title' => ts('Group - add contacts'), 'class' => 'CRM_Contact_Form_Task_AddToGroup'), self::REMOVE_CONTACTS => array('title' => ts('Group - remove contacts'), 'class' => 'CRM_Contact_Form_Task_RemoveFromGroup'), self::TAG_CONTACTS => array('title' => ts('Tag - add to contacts'), 'class' => 'CRM_Contact_Form_Task_AddToTag'), self::REMOVE_TAGS => array('title' => ts('Tag - remove from contacts'), 'class' => 'CRM_Contact_Form_Task_RemoveFromTag'), self::EXPORT_CONTACTS => array('title' => ts('Export contacts'), 'class' => array('CRM_Export_Form_Select', 'CRM_Export_Form_Map'), 'result' => FALSE), self::EMAIL_CONTACTS => array('title' => ts('Email - send now (to 50 or less)'), 'class' => 'CRM_Contact_Form_Task_Email', 'result' => TRUE), self::DELETE_CONTACTS => array('title' => ts('Delete contacts'), 'class' => 'CRM_Contact_Form_Task_Delete', 'result' => FALSE), self::RECORD_CONTACTS => array('title' => ts('Add activity'), 'class' => 'CRM_Activity_Form_Activity'), self::SAVE_SEARCH => array('title' => ts('Smart group - create'), 'class' => 'CRM_Contact_Form_Task_SaveSearch', 'result' => TRUE), self::SAVE_SEARCH_UPDATE => array('title' => ts('Smart group - update'), 'class' => 'CRM_Contact_Form_Task_SaveSearch_Update', 'result' => TRUE), self::PRINT_CONTACTS => array('title' => ts('Print selected rows'), 'class' => 'CRM_Contact_Form_Task_Print', 'result' => FALSE), self::LABEL_CONTACTS => array('title' => ts('Mailing labels - print'), 'class' => 'CRM_Contact_Form_Task_Label', 'result' => TRUE), self::BATCH_UPDATE => array('title' => ts('Batch update contacts via profile'), 'class' => array('CRM_Contact_Form_Task_PickProfile', 'CRM_Contact_Form_Task_Batch'), 'result' => TRUE), self::PRINT_FOR_CONTACTS => array('title' => ts('PDF letters - print'), 'class' => 'CRM_Contact_Form_Task_PDF', 'result' => TRUE), self::EMAIL_UNHOLD => array('title' => ts('Email - unhold addresses'), 'class' => 'CRM_Contact_Form_Task_Unhold'), self::COMMUNICATION_PREFS => array('title' => ts('Communication preferences - alter'), 'class' => 'CRM_Contact_Form_Task_AlterPreferences'), self::RESTORE => array('title' => ts('Restore contacts from trash'), 'class' => 'CRM_Contact_Form_Task_Delete', 'result' => FALSE), self::DELETE_PERMANENTLY => array('title' => ts('Delete permanently'), 'class' => 'CRM_Contact_Form_Task_Delete', 'result' => FALSE));
//CRM-16329, if SMS provider is configured show sms action.
$providersCount = CRM_SMS_BAO_Provider::activeProviderCount();
if ($providersCount) {
self::$_tasks[self::SMS_CONTACTS] = array('title' => ts('SMS - schedule/send'), 'class' => 'CRM_Contact_Form_Task_SMS', 'result' => TRUE);
}
if (CRM_Contact_BAO_ContactType::isActive('Household')) {
$label = CRM_Contact_BAO_ContactType::getLabel('household');
self::$_tasks[self::HOUSEHOLD_CONTACTS] = array('title' => ts('Add relationship - to %1', array(1 => $label)), 'class' => 'CRM_Contact_Form_Task_AddToHousehold');
}
if (CRM_Contact_BAO_ContactType::isActive('Organization')) {
$label = CRM_Contact_BAO_ContactType::getLabel('organization');
self::$_tasks[self::ORGANIZATION_CONTACTS] = array('title' => ts('Add relationship - to %1', array(1 => $label)), 'class' => 'CRM_Contact_Form_Task_AddToOrganization');
}
if (CRM_Core_Permission::check('merge duplicate contacts')) {
self::$_tasks[self::MERGE_CONTACTS] = array('title' => ts('Merge contacts'), 'class' => 'CRM_Contact_Form_Task_Merge', 'result' => TRUE);
}
//CRM-4418, check for delete
if (!CRM_Core_Permission::check('delete contacts')) {
unset(self::$_tasks[self::DELETE_CONTACTS]);
}
//show map action only if map provider and geoprovider are set (Google doesn't need geoprovider)
// should fix this to be more flexible as providers are added ??
$config = CRM_Core_Config::singleton();
if ($config->mapProvider && ($config->mapProvider == 'Google' || ($config->mapProvider == 'OpenStreetMaps' || $config->geoProvider == 'Google'))) {
self::$_tasks[self::MAP_CONTACTS] = array('title' => ts('Map contacts'), 'class' => 'CRM_Contact_Form_Task_Map', 'result' => FALSE);
}
if (CRM_Core_Permission::access('CiviEvent')) {
self::$_tasks[self::ADD_EVENT] = array('title' => ts('Register participants for event'), 'class' => 'CRM_Event_Form_Participant');
}
if (CRM_Core_Permission::access('CiviMail') || CRM_Mailing_Info::workflowEnabled() && CRM_Core_Permission::check('create mailings')) {
self::$_tasks[self::CREATE_MAILING] = array('title' => ts('Email - schedule/send via CiviMail'), 'class' => 'CRM_Mailing_Form_Task_AdhocMailing', 'result' => FALSE);
}
self::$_tasks += CRM_Core_Component::taskList();
CRM_Utils_Hook::searchTasks('contact', self::$_tasks);
asort(self::$_tasks);
}
}