本文整理汇总了PHP中CRM_Activity_BAO_Activity类的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Activity_BAO_Activity类的具体用法?PHP CRM_Activity_BAO_Activity怎么用?PHP CRM_Activity_BAO_Activity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CRM_Activity_BAO_Activity类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: create
/**
* create or update a Volunteer Commendation
*
* This function is invoked from within the web form layer
*
* @param array $params An assoc array of name/value pairs
* - aid: activity id of an existing commendation to update
* - cid: id of contact to be commended
* - vid: id of project for which contact is to be commended
* - details: text about the contact's exceptional volunteerism
* @see self::requiredParamsArePresent for rules re required params
* @return array Result of api.activity.create
* @access public
* @static
*/
public static function create(array $params)
{
// check required params
if (!self::requiredParamsArePresent($params)) {
CRM_Core_Error::fatal('Not enough data to create commendation object.');
}
$activity_statuses = CRM_Activity_BAO_Activity::buildOptions('status_id', 'create');
$api_params = array('activity_type_id' => self::getActivityTypeId(), 'status_id' => CRM_Utils_Array::key('Completed', $activity_statuses));
$aid = CRM_Utils_Array::value('aid', $params);
if ($aid) {
$api_params['id'] = $aid;
}
$cid = CRM_Utils_Array::value('cid', $params);
if ($cid) {
$api_params['target_contact_id'] = $cid;
}
$vid = CRM_Utils_Array::value('vid', $params);
if ($vid) {
$project = CRM_Volunteer_BAO_Project::retrieveByID($vid);
$api_params['subject'] = ts('Volunteer Commendation for %1', array('1' => $project->title, 'domain' => 'org.civicrm.volunteer'));
$customFieldSpec = self::getCustomFields();
$volunteer_project_id_field_name = $customFieldSpec['volunteer_project_id']['custom_n'];
$api_params[$volunteer_project_id_field_name] = $vid;
}
if (array_key_exists('details', $params)) {
$api_params['details'] = CRM_Utils_Array::value('details', $params);
}
return civicrm_api3('Activity', 'create', $api_params);
}
开发者ID:adam-edison,项目名称:org.civicrm.volunteer,代码行数:44,代码来源:Commendation.php
示例2: addResources
/**
* Load needed JS, CSS and settings for the backend Volunteer Management UI
*/
public static function addResources($entity_id, $entity_table)
{
static $loaded = FALSE;
$ccr = CRM_Core_Resources::singleton();
if ($loaded || $ccr->isAjaxMode()) {
return;
}
$loaded = TRUE;
$config = CRM_Core_Config::singleton();
// Vendor libraries
$ccr->addScriptFile('civicrm', 'packages/backbone/json2.js', 100, 'html-header', FALSE);
$ccr->addScriptFile('civicrm', 'packages/backbone/backbone-min.js', 120, 'html-header', FALSE);
$ccr->addScriptFile('civicrm', 'packages/backbone/backbone.marionette.min.js', 125, 'html-header', FALSE);
// Our stylesheet
$ccr->addStyleFile('org.civicrm.volunteer', 'css/volunteer_app.css');
// Add all scripts for our js app
$weight = 0;
$baseDir = CRM_Extension_System::singleton()->getMapper()->keyToBasePath('org.civicrm.volunteer') . '/';
// This glob pattern will recurse the js directory up to 4 levels deep
foreach (glob($baseDir . 'js/backbone/{*,*/*,*/*/*,*/*/*/*}.js', GLOB_BRACE) as $file) {
$fileName = substr($file, strlen($baseDir));
$ccr->addScriptFile('org.civicrm.volunteer', $fileName, $weight++);
}
// Add our template
CRM_Core_Smarty::singleton()->assign('isModulePermissionSupported', CRM_Core_Config::singleton()->userPermissionClass->isModulePermissionSupported());
CRM_Core_Region::instance('page-header')->add(array('template' => 'CRM/Volunteer/Form/Manage.tpl'));
// Fetch event so we can set the default start time for needs
// FIXME: Not the greatest for supporting non-events
$entity = civicrm_api3(str_replace('civicrm_', '', $entity_table), 'getsingle', array('id' => $entity_id));
// Static variables
$ccr->addSetting(array('pseudoConstant' => array('volunteer_need_visibility' => array_flip(CRM_Volunteer_BAO_Need::buildOptions('visibility_id', 'validate')), 'volunteer_role' => CRM_Volunteer_BAO_Need::buildOptions('role_id', 'get'), 'volunteer_status' => CRM_Activity_BAO_Activity::buildOptions('status_id', 'validate')), 'volunteer' => array('default_date' => CRM_Utils_Array::value('start_date', $entity)), 'config' => array('timeInputFormat' => $config->timeInputFormat), 'constants' => array('CRM_Core_Action' => array('NONE' => 0, 'ADD' => 1, 'UPDATE' => 2, 'VIEW' => 4, 'DELETE' => 8, 'BROWSE' => 16, 'ENABLE' => 32, 'DISABLE' => 64, 'EXPORT' => 128, 'BASIC' => 256, 'ADVANCED' => 512, 'PREVIEW' => 1024, 'FOLLOWUP' => 2048, 'MAP' => 4096, 'PROFILE' => 8192, 'COPY' => 16384, 'RENEW' => 32768, 'DETACH' => 65536, 'REVERT' => 131072, 'CLOSE' => 262144, 'REOPEN' => 524288, 'MAX_ACTION' => 1048575))));
// Check for problems
_volunteer_checkResourceUrl();
}
开发者ID:TobiasLounsbury,项目名称:org.civicrm.volunteer,代码行数:37,代码来源:Manage.php
示例3: addResources
/**
* Load needed JS, CSS and settings for the backend Volunteer Management UI
*/
public static function addResources($entity_id, $entity_table)
{
static $loaded = FALSE;
if ($loaded) {
return;
}
$loaded = TRUE;
$config = CRM_Core_Config::singleton();
$ccr = CRM_Core_Resources::singleton();
// Vendor libraries
$ccr->addScriptFile('civicrm', 'packages/backbone/json2.js', 100, 'html-header', FALSE);
$ccr->addScriptFile('civicrm', 'packages/backbone/backbone-min.js', 120, 'html-header');
$ccr->addScriptFile('civicrm', 'packages/backbone/backbone.marionette.min.js', 125, 'html-header', FALSE);
// Our stylesheet
$ccr->addStyleFile('org.civicrm.volunteer', 'css/volunteer_app.css');
// Add all scripts for our js app
$weight = 0;
$baseDir = CRM_Extension_System::singleton()->getMapper()->keyToBasePath('org.civicrm.volunteer') . '/';
// This glob pattern will recurse the js directory up to 4 levels deep
foreach (glob($baseDir . 'js/{*,*/*,*/*/*,*/*/*/*}.js', GLOB_BRACE) as $file) {
$fileName = substr($file, strlen($baseDir));
$ccr->addScriptFile('org.civicrm.volunteer', $fileName, $weight++);
}
// Add our template
CRM_Core_Smarty::singleton()->assign('isModulePermissionSupported', CRM_Core_Config::singleton()->userPermissionClass->isModulePermissionSupported());
CRM_Core_Region::instance('page-header')->add(array('template' => 'CRM/Volunteer/Form/Manage.tpl'));
// Fetch event so we can set the default start time for needs
// FIXME: Not the greatest for supporting non-events
$entity = civicrm_api3(str_replace('civicrm_', '', $entity_table), 'getsingle', array('id' => $entity_id));
// Static variables
$ccr->addSetting(array('pseudoConstant' => array('volunteer_need_visibility' => array_flip(CRM_Volunteer_BAO_Need::buildOptions('visibility_id', 'validate')), 'volunteer_role' => CRM_Volunteer_BAO_Need::buildOptions('role_id', 'get'), 'volunteer_status' => CRM_Activity_BAO_Activity::buildOptions('status_id', 'validate')), 'volunteer' => array('default_date' => CRM_Utils_Array::value('start_date', $entity)), 'config' => array('timeInputFormat' => $config->timeInputFormat)));
// Check for problems
_volunteer_civicrm_check_resource_url();
}
开发者ID:relldoesphp,项目名称:civivolunteer,代码行数:37,代码来源:Manage.php
示例4: postProcess
/**
* Process the form after the input has been submitted and validated.
*/
public function postProcess()
{
$formparams = $this->exportValues();
$caseId = $formparams['unclosed_case_id'];
$filedActivities = 0;
foreach ($this->_activityHolderIds as $key => $id) {
$targetContactValues = $defaults = array();
$params = array('id' => $id);
CRM_Activity_BAO_Activity::retrieve($params, $defaults);
if (CRM_Case_BAO_Case::checkPermission($id, 'File On Case', $defaults['activity_type_id'])) {
if (!CRM_Utils_Array::crmIsEmptyArray($defaults['target_contact'])) {
$targetContactValues = array_combine(array_unique($defaults['target_contact']), explode(';', trim($defaults['target_contact_value'])));
$targetContactValues = implode(',', array_keys($targetContactValues));
}
$params = array('caseID' => $caseId, 'activityID' => $id, 'newSubject' => empty($defaults['subject']) ? '' : $defaults['subject'], 'targetContactIds' => $targetContactValues, 'mode' => 'file');
$error_msg = CRM_Activity_Page_AJAX::_convertToCaseActivity($params);
if (empty($error_msg['error_msg'])) {
$filedActivities++;
} else {
CRM_Core_Session::setStatus($error_msg['error_msg'], ts("Error"), "error");
}
} else {
CRM_Core_Session::setStatus(ts('Not permitted to file activity %1 %2.', array(1 => empty($defaults['subject']) ? '' : $defaults['subject'], 2 => $defaults['activity_date_time'])), ts("Error"), "error");
}
}
CRM_Core_Session::setStatus($filedActivities, ts("Filed Activities"), "success");
CRM_Core_Session::setStatus("", ts('Total Selected Activities: %1', array(1 => count($this->_activityHolderIds))), "info");
}
开发者ID:kcristiano,项目名称:civicrm-core,代码行数:31,代码来源:FileOnCase.php
示例5: array
static function &getFields()
{
$fields = array();
$fields = CRM_Case_BAO_Case::exportableFields();
// add activity related fields
$fields = array_merge($fields, CRM_Activity_BAO_Activity::exportableFields('Case'));
return $fields;
}
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:8,代码来源:Query.php
示例6: _civicrm_api3_volunteer_assignment_create_spec
/**
* Adjust Metadata for Create action
*
* The metadata is used for setting defaults, documentation & validation
* @param array $params array or parameters determined by getfields
*/
function _civicrm_api3_volunteer_assignment_create_spec(&$params)
{
$params['volunteer_need_id']['api.required'] = 1;
$params['assignee_contact_id']['api.required'] = 1;
$params['assignee_contact_id']['api.aliases'] = array('contact_id');
$volunteerStatus = CRM_Activity_BAO_Activity::buildOptions('status_id', 'validate');
$params['status_id']['api.default'] = array_search('Scheduled', $volunteerStatus);
}
开发者ID:adam-edison,项目名称:org.civicrm.volunteer,代码行数:14,代码来源:VolunteerAssignment.php
示例7: setDefaultValues
function setDefaultValues()
{
if (isset($this->_activityId)) {
$params = array('id' => $this->_activityId);
CRM_Activity_BAO_Activity::retrieve($params, $defaults);
$defaults['html_message'] = $defaults['details'];
return $defaults;
}
}
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:9,代码来源:PDF.php
示例8: array_merge
/**
* Get fields.
*
* @param bool $excludeActivityFields
*
* @return array
*/
public static function &getFields($excludeActivityFields = FALSE)
{
$fields = CRM_Case_BAO_Case::exportableFields();
// add activity related fields
if (!$excludeActivityFields) {
$fields = array_merge($fields, CRM_Activity_BAO_Activity::exportableFields('Case'));
}
return $fields;
}
开发者ID:nielosz,项目名称:civicrm-core,代码行数:16,代码来源:Query.php
示例9: array
static function &getFields()
{
require_once 'CRM/Case/BAO/Case.php';
$fields = array();
$fields = CRM_Case_BAO_Case::exportableFields();
// add activity related fields
require_once 'CRM/Activity/BAO/Activity.php';
$fields = array_merge($fields, CRM_Activity_BAO_Activity::exportableFields('Case'));
return $fields;
}
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:10,代码来源:Query.php
示例10: setDefaultValues
/**
* Set default values for the form.
*/
public function setDefaultValues()
{
$defaults = array();
if (isset($this->_activityId)) {
$params = array('id' => $this->_activityId);
CRM_Activity_BAO_Activity::retrieve($params, $defaults);
$defaults['html_message'] = CRM_Utils_Array::value('details', $defaults);
}
$defaults = $defaults + CRM_Contact_Form_Task_PDFLetterCommon::setDefaultValues();
return $defaults;
}
开发者ID:nielosz,项目名称:civicrm-core,代码行数:14,代码来源:PDF.php
示例11: setDefaultValues
/**
* This function sets the default values for the form. For edit/view mode
* the default values are retrieved from the database
*
* @access public
*
* @return None
*/
function setDefaultValues()
{
$targetContactValues = $defaults = array();
$params = array('id' => $this->_activityId);
CRM_Activity_BAO_Activity::retrieve($params, $defaults);
$defaults['case_activity_subject'] = $defaults['subject'];
if (!CRM_Utils_Array::crmIsEmptyArray($defaults['target_contact'])) {
$targetContactValues = array_combine(array_unique($defaults['target_contact']), explode(';', trim($defaults['target_contact_value'])));
}
$this->assign('targetContactValues', empty($targetContactValues) ? FALSE : $targetContactValues);
return $defaults;
}
开发者ID:hguru,项目名称:224Civi,代码行数:20,代码来源:ActivityToCase.php
示例12: postProcess
/**
* process the form after the input has been submitted and validated
*
* @access public
*
* @return void
*/
public function postProcess()
{
$deletedActivities = 0;
foreach ($this->_activityHolderIds as $activityId['id']) {
$moveToTrash = CRM_Case_BAO_Case::isCaseActivity($activityId['id']);
if (CRM_Activity_BAO_Activity::deleteActivity($activityId, $moveToTrash)) {
$deletedActivities++;
}
}
CRM_Core_Session::setStatus($deletedActivities, ts('Deleted Activities'), "success");
CRM_Core_Session::setStatus("", ts('Total Selected Activities: %1', array(1 => count($this->_activityHolderIds))), "info");
}
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:19,代码来源:Delete.php
示例13: setDefaultValues
function setDefaultValues()
{
$defaults = array();
if (isset($this->_activityId)) {
$params = array('id' => $this->_activityId);
CRM_Activity_BAO_Activity::retrieve($params, $defaults);
$defaults['html_message'] = $defaults['details'];
} else {
$defaults['thankyou_update'] = 1;
}
$defaults = $defaults + CRM_Contact_Form_Task_PDFLetterCommon::setDefaultValues();
return $defaults;
}
开发者ID:archcidburnziso,项目名称:civicrm-core,代码行数:13,代码来源:PDFLetter.php
示例14: postProcess
/**
* process the form after the input has been submitted and validated
*
* @access public
* @return None
*/
public function postProcess()
{
$deletedActivities = 0;
foreach ($this->_activityHolderIds as $activityId['id']) {
require_once 'CRM/Case/BAO/Case.php';
$moveToTrash = CRM_Case_BAO_Case::isCaseActivity($activityId['id']);
if (CRM_Activity_BAO_Activity::deleteActivity($activityId, $moveToTrash)) {
$deletedActivities++;
}
}
$status = array(ts('Deleted Activities: %1', array(1 => $deletedActivities)), ts('Total Selected Activities: %1', array(1 => count($this->_activityHolderIds))));
CRM_Core_Session::setStatus($status);
}
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:19,代码来源:Delete.php
示例15: preProcess
/**
* Function to set variables up before form is built
*
* @return void
* @access public
*/
public function preProcess()
{
//get the activity values
$activityId = CRM_Utils_Request::retrieve('id', 'Positive', $this);
$context = CRM_Utils_Request::retrieve('context', 'String', $this);
$cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
//check for required permissions, CRM-6264
if ($activityId && !CRM_Activity_BAO_Activity::checkPermission($activityId, CRM_Core_Action::VIEW)) {
CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
}
$session = CRM_Core_Session::singleton();
if (!in_array($context, array('home', 'dashlet', 'dashletFullscreen'))) {
$url = CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$cid}&selectedChild=activity");
} else {
$url = CRM_Utils_System::url('civicrm/dashboard', 'reset=1');
}
$session->pushUserContext($url);
$defaults = array();
$params = array('id' => $activityId);
CRM_Activity_BAO_Activity::retrieve($params, $defaults);
//set activity type name and description to template
list($activityTypeName, $activityTypeDescription) = CRM_Core_BAO_OptionValue::getActivityTypeDetails($defaults['activity_type_id']);
$this->assign('activityTypeName', $activityTypeName);
$this->assign('activityTypeDescription', $activityTypeDescription);
if (CRM_Utils_Array::value('mailingId', $defaults)) {
$this->_mailing_id = CRM_Utils_Array::value('source_record_id', $defaults);
$mailingReport = CRM_Mailing_BAO_Mailing::report($this->_mailing_id, TRUE);
CRM_Mailing_BAO_Mailing::getMailingContent($mailingReport, $this);
$this->assign('mailingReport', $mailingReport);
$full_open_report = CRM_Mailing_Event_BAO_Opened::getRows($this->_mailing_id, NULL, FALSE, NULL, NULL, NULL, $cid);
$this->assign('openreport', $full_open_report);
$click_thru_report = CRM_Mailing_Event_BAO_TrackableURLOpen::getRows($this->_mailing_id, NULL, FALSE, NULL, NULL, NULL, NULL, $cid);
$this->assign('clickreport', $click_thru_report);
}
foreach ($defaults as $key => $value) {
if (substr($key, -3) != '_id') {
$values[$key] = $value;
}
}
//get the campaign
if ($campaignId = CRM_Utils_Array::value('campaign_id', $defaults)) {
$campaigns = CRM_Campaign_BAO_Campaign::getCampaigns($campaignId);
$values['campaign'] = $campaigns[$campaignId];
}
if ($engagementLevel = CRM_Utils_Array::value('engagement_level', $defaults)) {
$engagementLevels = CRM_Campaign_PseudoConstant::engagementLevel();
$values['engagement_level'] = CRM_Utils_Array::value($engagementLevel, $engagementLevels, $engagementLevel);
}
$values['attachment'] = CRM_Core_BAO_File::attachmentInfo('civicrm_activity', $activityId);
$this->assign('values', $values);
}
开发者ID:hguru,项目名称:224Civi,代码行数:57,代码来源:ActivityView.php
示例16: civicrm_api3_volunteer_util_loadbackbone
/**
* This function will return the needed pieces to load up the backbone/
* marionette project backend from within an angular page.
*
* @param array $params
* Not presently used.
* @return array
* Keyed with "css," "templates," "scripts," and "settings," this array
* contains the dependencies of the backbone-based volunteer app.
*
*/
function civicrm_api3_volunteer_util_loadbackbone($params)
{
$results = array("css" => array(), "templates" => array(), "scripts" => array(), "settings" => array());
$ccr = CRM_Core_Resources::singleton();
$config = CRM_Core_Config::singleton();
$results['css'][] = $ccr->getUrl('org.civicrm.volunteer', 'css/volunteer_app.css');
$baseDir = CRM_Extension_System::singleton()->getMapper()->keyToBasePath('org.civicrm.volunteer') . '/';
// This glob pattern will recurse the js directory up to 4 levels deep
foreach (glob($baseDir . 'js/{*,*/*,*/*/*,*/*/*/*}.js', GLOB_BRACE) as $file) {
$fileName = substr($file, strlen($baseDir));
$results['scripts'][] = $ccr->getUrl('org.civicrm.volunteer', $fileName);
}
$results['templates'][] = 'civicrm/volunteer/backbonetemplates';
$results['settings'] = array('pseudoConstant' => array('volunteer_need_visibility' => array_flip(CRM_Volunteer_BAO_Need::buildOptions('visibility_id', 'validate')), 'volunteer_role' => CRM_Volunteer_BAO_Need::buildOptions('role_id', 'get'), 'volunteer_status' => CRM_Activity_BAO_Activity::buildOptions('status_id', 'validate')), 'volunteer' => array('default_date' => date("Y-m-d H:i:s", strtotime('tomorrow noon'))), 'config' => array('timeInputFormat' => $config->timeInputFormat), 'constants' => array('CRM_Core_Action' => array('NONE' => 0, 'ADD' => 1, 'UPDATE' => 2, 'VIEW' => 4, 'DELETE' => 8, 'BROWSE' => 16, 'ENABLE' => 32, 'DISABLE' => 64, 'EXPORT' => 128, 'BASIC' => 256, 'ADVANCED' => 512, 'PREVIEW' => 1024, 'FOLLOWUP' => 2048, 'MAP' => 4096, 'PROFILE' => 8192, 'COPY' => 16384, 'RENEW' => 32768, 'DETACH' => 65536, 'REVERT' => 131072, 'CLOSE' => 262144, 'REOPEN' => 524288, 'MAX_ACTION' => 1048575)));
return civicrm_api3_create_success($results, "VolunteerUtil", "loadbackbone", $params);
}
开发者ID:JohnFF,项目名称:org.civicrm.volunteer,代码行数:27,代码来源:VolunteerUtil.php
示例17: foreach
/**
* Retrieve a set of Activities specific to given contact Id.
* @param int $contactID.
*
* @return array (reference) array of activities.
* @access public
*/
function &_civicrm_activities_get($contactID, $type = 'all')
{
$activities = CRM_Activity_BAO_Activity::getContactActivity($contactID);
//get the custom data.
if (is_array($activities) && !empty($activities)) {
require_once 'api/v2/Activity.php';
foreach ($activities as $activityId => $values) {
$customParams = array('activity_id' => $activityId, 'activity_type_id' => CRM_Utils_Array::value('activity_type_id', $values));
$customData = civicrm_activity_custom_get($customParams);
if (is_array($customData) && !empty($customData)) {
$activities[$activityId] = array_merge($activities[$activityId], $customData);
}
}
}
return $activities;
}
开发者ID:ksecor,项目名称:civicrm,代码行数:23,代码来源:ActivityContact.php
示例18: setDefaultValues
/**
* Set default values for the form. For edit/view mode
* the default values are retrieved from the database
*
*
* @return array
*/
public function setDefaultValues()
{
$defaults = array();
$params = array('id' => $this->_activityId);
CRM_Activity_BAO_Activity::retrieve($params, $defaults);
$defaults['file_on_case_activity_subject'] = $defaults['subject'];
$defaults['file_on_case_target_contact_id'] = $defaults['target_contact'];
// If this contact has an open case, supply it as a default
$cid = CRM_Utils_Request::retrieve('cid', 'Integer');
if ($cid) {
$cases = civicrm_api3('CaseContact', 'get', array('contact_id' => $cid, 'case_id' => array('!=' => $this->_currentCaseId), 'case_id.status_id' => array('!=' => "Closed"), 'case_id.is_deleted' => 0, 'case_id.end_date' => array('IS NULL' => 1), 'options' => array('limit' => 1), 'return' => 'case_id'));
foreach ($cases['values'] as $record) {
$defaults['file_on_case_unclosed_case_id'] = $record['case_id'];
break;
}
}
return $defaults;
}
开发者ID:kcristiano,项目名称:civicrm-core,代码行数:25,代码来源:ActivityToCase.php
示例19: onChange
public function onChange(CRM_HRCaseUtils_Analyzer $analyzer, $objectRef)
{
if (isset($objectRef->activity_type_id)) {
// Get activity type name & status of the activity being completed
$activityTypeGroup = civicrm_api3('option_group', 'get', array('name' => 'activity_type'));
$activityType = array('value' => $objectRef->activity_type_id, 'option_group_id' => $activityTypeGroup['id']);
$activityTypeID = civicrm_api3('option_value', 'get', $activityType);
$activityTypeID = $activityTypeID['values'][$activityTypeID['id']]['name'];
$activityStatusGroup = civicrm_api3('option_group', 'get', array('name' => 'activity_status'));
$activityStatus = array('value' => $objectRef->status_id, 'option_group_id' => $activityStatusGroup['id']);
$activityStatusID = civicrm_api3('option_value', 'get', $activityStatus);
$activityStatusID = $activityStatusID['values'][$activityStatusID['id']]['name'];
// Schedule Interview Prospect activity
if ($activityTypeID == 'Open Case' && $activityStatusID == 'Completed') {
if ($analyzer->hasActivity($activityTypeID, $activityStatusID)) {
$nextActivity = 'Interview Prospect';
// Get the activity ID for Interview Prospect
$activityID = array('name' => $nextActivity, 'option_group_id' => $activityTypeGroup['id']);
$activityTypeID = civicrm_api3('option_value', 'get', $activityID);
$activityTypeID = $activityTypeID['values'][$activityTypeID['id']]['value'];
$params = self::buildParams($activityTypeID, $nextActivity, $objectRef);
}
} elseif ($activityTypeID == 'Interview Prospect' && $activityStatusID == 'Completed') {
if ($analyzer->hasActivity($activityTypeID, $activityStatusID)) {
$nextActivity = 'Background Check';
// Get the activity ID for Background Check
$activityID = array('name' => $nextActivity, 'option_group_id' => $activityTypeGroup['id']);
$activityTypeID = civicrm_api3('option_value', 'get', $activityID);
$activityTypeID = $activityTypeID['values'][$activityTypeID['id']]['value'];
$params = self::buildParams($activityTypeID, $nextActivity, $objectRef);
}
} elseif ($activityTypeID == 'Background Check' && $activityStatusID == 'Completed') {
return;
}
if (isset($params)) {
$followupActivity = CRM_Activity_BAO_Activity::createFollowupActivity($objectRef->original_id, $params);
if ($followupActivity) {
$caseParams = array('activity_id' => $followupActivity->id, 'case_id' => $objectRef->case_id);
CRM_Case_BAO_Case::processCaseActivity($caseParams);
$analyzer->flush();
}
}
}
}
开发者ID:JoeMurray,项目名称:civihr,代码行数:44,代码来源:Pipeline.php
示例20: postProcess
/**
* Process the form after the input has been submitted and validated.
*
*
* @return void
*/
public function postProcess()
{
$deleted = $failed = 0;
foreach ($this->_activityHolderIds as $activityId['id']) {
$moveToTrash = CRM_Case_BAO_Case::isCaseActivity($activityId['id']);
if (CRM_Activity_BAO_Activity::deleteActivity($activityId, $moveToTrash)) {
$deleted++;
} else {
$failed++;
}
}
if ($deleted) {
$msg = ts('%count activity deleted.', array('plural' => '%count activities deleted.', 'count' => $deleted));
CRM_Core_Session::setStatus($msg, ts('Removed'), 'success');
}
if ($failed) {
CRM_Core_Session::setStatus(ts('1 could not be deleted.', array('plural' => '%count could not be deleted.', 'count' => $failed)), ts('Error'), 'error');
}
}
开发者ID:kidaa30,项目名称:yes,代码行数:25,代码来源:Delete.php
注:本文中的CRM_Activity_BAO_Activity类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论