本文整理汇总了PHP中CRM_Case_BAO_Case类的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Case_BAO_Case类的具体用法?PHP CRM_Case_BAO_Case怎么用?PHP CRM_Case_BAO_Case使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CRM_Case_BAO_Case类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: upgrade_4_1_alpha1
/**
* @param $rev
*/
public function upgrade_4_1_alpha1($rev)
{
$config = CRM_Core_Config::singleton();
if (in_array('CiviCase', $config->enableComponents)) {
if (!CRM_Case_BAO_Case::createCaseViews()) {
$template = CRM_Core_Smarty::singleton();
$afterUpgradeMessage = '';
if ($afterUpgradeMessage = $template->get_template_vars('afterUpgradeMessage')) {
$afterUpgradeMessage .= "<br/><br/>";
}
$afterUpgradeMessage .= '<div class="crm-upgrade-case-views-error" style="background-color: #E43D2B; padding: 10px;">' . ts("There was a problem creating CiviCase database views. Please create the following views manually before using CiviCase:");
$afterUpgradeMessage .= '<div class="crm-upgrade-case-views-query"><div>' . CRM_Case_BAO_Case::createCaseViewsQuery('upcoming') . '</div><div>' . CRM_Case_BAO_Case::createCaseViewsQuery('recent') . '</div>' . '</div></div>';
$template->assign('afterUpgradeMessage', $afterUpgradeMessage);
}
}
$upgrade = new CRM_Upgrade_Form();
$upgrade->processSQL($rev);
$this->transferPreferencesToSettings();
$this->createNewSettings();
// now modify the config so that the directories are now stored in the settings table
// CRM-8780
$params = array();
CRM_Core_BAO_ConfigSetting::add($params);
// also reset navigation
CRM_Core_BAO_Navigation::resetNavigation();
}
示例2: triggerTrigger
/**
* Trigger a rule for this trigger
*
* @param $op
* @param $objectName
* @param $objectId
* @param $objectRef
*/
public function triggerTrigger($op, $objectName, $objectId, $objectRef)
{
$t = $this->getTriggerDataFromPost($op, $objectName, $objectId, $objectRef);
//trigger for each client
$clients = CRM_Case_BAO_Case::getCaseClients($objectId);
foreach ($clients as $client) {
$triggerData = clone $t;
$triggerData->setEntityData('Relationship', null);
$triggerData->setContactId($client);
CRM_Civirules_Engine::triggerRule($this, $triggerData);
}
//trigger for each case role
$relatedContacts = CRM_Case_BAO_Case::getRelatedContacts($objectId);
foreach ($relatedContacts as $contact) {
$triggerData = clone $t;
$relationshipData = null;
$relationship = new CRM_Contact_BAO_Relationship();
$relationship->contact_id_b = $contact['contact_id'];
$relationship->case_id = $objectId;
if ($relationship->find(true)) {
CRM_Core_DAO::storeValues($relationship, $relationshipData);
}
$triggerData->setEntityData('Relationship', $relationshipData);
$triggerData->setContactId($contact['contact_id']);
CRM_Civirules_Engine::triggerRule($this, $triggerData);
}
}
示例3: 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");
}
示例4: getCaseActivity
static function getCaseActivity()
{
$caseID = CRM_Utils_Type::escape($_GET['caseID'], 'Integer');
$contactID = CRM_Utils_Type::escape($_GET['cid'], 'Integer');
$userID = CRM_Utils_Type::escape($_GET['userID'], 'Integer');
$context = CRM_Utils_Type::escape(CRM_Utils_Array::value('context', $_GET), 'String');
$sortMapper = array(0 => 'display_date', 1 => 'ca.subject', 2 => 'ca.activity_type_id', 3 => 'acc.sort_name', 4 => 'cc.sort_name', 5 => 'ca.status_id');
$sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
$offset = isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0;
$rowCount = isset($_REQUEST['iDisplayLength']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayLength'], 'Integer') : 25;
$sort = isset($_REQUEST['iSortCol_0']) ? CRM_Utils_Array::value(CRM_Utils_Type::escape($_REQUEST['iSortCol_0'], 'Integer'), $sortMapper) : NULL;
$sortOrder = isset($_REQUEST['sSortDir_0']) ? CRM_Utils_Type::escape($_REQUEST['sSortDir_0'], 'String') : 'asc';
$params = $_POST;
if ($sort && $sortOrder) {
$params['sortname'] = $sort;
$params['sortorder'] = $sortOrder;
}
$params['page'] = $offset / $rowCount + 1;
$params['rp'] = $rowCount;
// get the activities related to given case
$activities = CRM_Case_BAO_Case::getCaseActivity($caseID, $params, $contactID, $context, $userID);
$iFilteredTotal = $iTotal = $params['total'];
$selectorElements = array('display_date', 'subject', 'type', 'with_contacts', 'reporter', 'status', 'links', 'class');
echo CRM_Utils_JSON::encodeDataTableSelector($activities, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
CRM_Utils_System::civiExit();
}
示例5: preProcess
/**
* Heart of the viewing process. The runner gets all the meta data for
* the contact and calls the appropriate type of page to view.
*
* @return void
* @access public
*
*/
function preProcess()
{
// Make sure case types have been configured for the component
require_once 'CRM/Core/OptionGroup.php';
$caseType = CRM_Core_OptionGroup::values('case_type');
if (empty($caseType)) {
$this->assign('notConfigured', 1);
return;
}
$session =& CRM_Core_Session::singleton();
$allCases = CRM_Utils_Request::retrieve('all', 'Positive', $session);
CRM_Utils_System::setTitle(ts('CiviCase Dashboard'));
$userID = $session->get('userID');
if (!$allCases) {
$this->assign('myCases', true);
} else {
$this->assign('myCases', false);
}
$this->assign('newClient', false);
if (CRM_Core_Permission::check('add contacts')) {
$this->assign('newClient', true);
}
require_once 'CRM/Case/BAO/Case.php';
$summary = CRM_Case_BAO_Case::getCasesSummary($allCases, $userID);
$upcoming = CRM_Case_BAO_Case::getCases($allCases, $userID, 'upcoming');
$recent = CRM_Case_BAO_Case::getCases($allCases, $userID, 'recent');
$this->assign('casesSummary', $summary);
if (!empty($upcoming)) {
$this->assign('upcomingCases', $upcoming);
}
if (!empty($recent)) {
$this->assign('recentCases', $recent);
}
}
示例6: buildQuickForm
/**
* Function to build the form
*
* @return void
* @access public
*/
public function buildQuickForm()
{
parent::buildQuickForm();
if ($this->_action & CRM_Core_Action::DELETE) {
return;
}
CRM_Utils_System::setTitle(ts('Dropdown Options'));
$this->applyFilter('__ALL__', 'trim');
$this->add('text', 'name', ts('Name'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionGroup', 'name'), TRUE);
$this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array('CRM_Core_DAO_OptionGroup', $this->_id));
$this->add('text', 'title', ts('Group Title'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionGroup', 'title'));
$this->add('text', 'description', ts('Description'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionGroup', 'description'));
$element = $this->add('checkbox', 'is_active', ts('Enabled?'));
if ($this->_action & CRM_Core_Action::UPDATE) {
if (in_array($this->_values['name'], array('encounter_medium', 'case_type', 'case_status'))) {
static $caseCount = NULL;
if (!isset($caseCount)) {
$caseCount = CRM_Case_BAO_Case::caseCount(NULL, FALSE);
}
if ($caseCount > 0) {
$element->freeze();
}
}
if (!empty($this->_values['is_reserved'])) {
$this->freeze(array('name', 'is_active'));
}
}
$this->assign('id', $this->_id);
}
示例7: buildQuickForm
/**
* Function to build the form
*
* @return None
* @access public
*/
public function buildQuickForm()
{
parent::buildQuickForm();
if ($this->_action & CRM_Core_Action::DELETE) {
return;
}
$this->applyFilter('__ALL__', 'trim');
$this->add('text', 'name', ts('Name'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionGroup', 'name'), true);
$this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array('CRM_Core_DAO_OptionGroup', $this->_id));
$this->add('text', 'description', ts('Description'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionGroup', 'description'));
$element = $this->add('checkbox', 'is_active', ts('Enabled?'));
if ($this->_action & CRM_Core_Action::UPDATE) {
if (in_array($this->_values['name'], array('encounter_medium', 'case_type', 'case_status'))) {
static $caseCount = null;
require_once 'CRM/Case/BAO/Case.php';
if (!isset($caseCount)) {
$caseCount = CRM_Case_BAO_Case::caseCount(null, false);
}
if ($caseCount > 0) {
$element->freeze();
}
}
if ($this->_values['is_reserved']) {
$this->freeze(array('name', 'description', 'is_active'));
}
}
$this->assign('id', $this->_id);
}
示例8: __construct
/**
* Class constructor.
*/
public function __construct()
{
// don’t display the ‘Add these Contacts to Group’ button
$this->_add2groupSupported = FALSE;
$dsn = defined('CIVICRM_LOGGING_DSN') ? DB::parseDSN(CIVICRM_LOGGING_DSN) : DB::parseDSN(CIVICRM_DSN);
$this->loggingDB = $dsn['database'];
// used for redirect back to contact summary
$this->cid = CRM_Utils_Request::retrieve('cid', 'Integer', CRM_Core_DAO::$_nullObject);
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
$this->_logTables = array('log_civicrm_contact' => array('fk' => 'id'), 'log_civicrm_email' => array('fk' => 'contact_id', 'log_type' => 'Contact'), 'log_civicrm_phone' => array('fk' => 'contact_id', 'log_type' => 'Contact'), 'log_civicrm_address' => array('fk' => 'contact_id', 'log_type' => 'Contact'), 'log_civicrm_note' => array('fk' => 'entity_id', 'entity_table' => TRUE, 'bracket_info' => array('table' => 'log_civicrm_note', 'column' => 'subject')), 'log_civicrm_note_comment' => array('fk' => 'entity_id', 'table_name' => 'log_civicrm_note', 'joins' => array('table' => 'log_civicrm_note', 'join' => "entity_log_civireport.entity_id = fk_table.id AND entity_log_civireport.entity_table = 'civicrm_note'"), 'entity_table' => TRUE, 'bracket_info' => array('table' => 'log_civicrm_note', 'column' => 'subject')), 'log_civicrm_group_contact' => array('fk' => 'contact_id', 'bracket_info' => array('entity_column' => 'group_id', 'table' => 'log_civicrm_group', 'column' => 'title'), 'action_column' => 'status', 'log_type' => 'Group'), 'log_civicrm_entity_tag' => array('fk' => 'entity_id', 'bracket_info' => array('entity_column' => 'tag_id', 'table' => 'log_civicrm_tag', 'column' => 'name'), 'entity_table' => TRUE), 'log_civicrm_relationship' => array('fk' => 'contact_id_a', 'bracket_info' => array('entity_column' => 'relationship_type_id', 'table' => 'log_civicrm_relationship_type', 'column' => 'label_a_b')), 'log_civicrm_activity_for_target' => array('fk' => 'contact_id', 'table_name' => 'log_civicrm_activity', 'joins' => array('table' => 'log_civicrm_activity_contact', 'join' => "(entity_log_civireport.id = fk_table.activity_id AND fk_table.record_type_id = {$targetID})"), 'bracket_info' => array('entity_column' => 'activity_type_id', 'options' => CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE)), 'log_type' => 'Activity'), 'log_civicrm_activity_for_assignee' => array('fk' => 'contact_id', 'table_name' => 'log_civicrm_activity', 'joins' => array('table' => 'log_civicrm_activity_contact', 'join' => "entity_log_civireport.id = fk_table.activity_id AND fk_table.record_type_id = {$assigneeID}"), 'bracket_info' => array('entity_column' => 'activity_type_id', 'options' => CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE)), 'log_type' => 'Activity'), 'log_civicrm_activity_for_source' => array('fk' => 'contact_id', 'table_name' => 'log_civicrm_activity', 'joins' => array('table' => 'log_civicrm_activity_contact', 'join' => "entity_log_civireport.id = fk_table.activity_id AND fk_table.record_type_id = {$sourceID}"), 'bracket_info' => array('entity_column' => 'activity_type_id', 'options' => CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE)), 'log_type' => 'Activity'), 'log_civicrm_case' => array('fk' => 'contact_id', 'joins' => array('table' => 'log_civicrm_case_contact', 'join' => 'entity_log_civireport.id = fk_table.case_id'), 'bracket_info' => array('entity_column' => 'case_type_id', 'options' => CRM_Case_BAO_Case::buildOptions('case_type_id', 'search'))));
$logging = new CRM_Logging_Schema();
// build _logTables for contact custom tables
$customTables = $logging->entityCustomDataLogTables('Contact');
foreach ($customTables as $table) {
$this->_logTables[$table] = array('fk' => 'entity_id', 'log_type' => 'Contact');
}
// build _logTables for address custom tables
$customTables = $logging->entityCustomDataLogTables('Address');
foreach ($customTables as $table) {
$this->_logTables[$table] = array('fk' => 'contact_id', 'joins' => array('table' => 'log_civicrm_address', 'join' => 'entity_log_civireport.entity_id = fk_table.id'), 'log_type' => 'Contact');
}
// Allow log tables to be extended via report hooks.
CRM_Report_BAO_Hook::singleton()->alterLogTables($this, $this->_logTables);
parent::__construct();
}
示例9: testPipeline
public function testPipeline()
{
$contact = $this->callAPISuccess('contact', 'create', array('first_name' => 'JohnHR', 'contact_type' => 'Individual', 'last_name' => 'Smith', 'email' => 'johnhrsmith@hrtest.com'));
// create case
$newParams = array('case_type_id' => $this->casetype_id, 'creator_id' => $contact['id'], 'status_id' => 1, 'subject' => 'Case for HR Unit Test', 'contact_id' => $contact['id'], 'version' => 3, 'label' => 'test', 'name' => 'test');
// assign case to contact
$caseBAO = CRM_Case_BAO_Case::create($newParams);
$newParams['id'] = $caseBAO->id;
$caseContact = new CRM_Case_DAO_CaseContact();
$caseContact->case_id = $caseBAO->id;
$caseContact->contact_id = $contact['id'];
$caseContact->find(TRUE);
$caseContact->save();
// create activity
$paramsActivity = array('source_contact_id' => $contact['id'], 'activity_type_id' => $this->opencase_activityId, 'subject' => 'Open Case', 'activity_date_time' => '2011-06-02 14:36:13', 'status_id' => 1, 'priority_id' => 2, 'duration' => 120, 'location' => 'Pensulvania', 'details' => 'A test activity', 'case_id' => $caseBAO->id, 'is_current_revision' => 1);
$resultActivity = civicrm_api3('activity', 'create', $paramsActivity);
$opencase_activityIds = $resultActivity['id'];
$analyzer = new CRM_HRCaseUtils_Analyzer($caseBAO->id, $resultActivity['id']);
$analyzer->case_id = $caseBAO->id;
$caseStatus = $caseBAO->status_id;
$activityStatus = $resultActivity['values'][$resultActivity['id']]['status_id'];
$activityTypeId = $resultActivity['values'][$resultActivity['id']]['activity_type_id'];
$this->assertEquals('1', $caseStatus);
// Check case stauts id
$activityCheck = $analyzer->getSingleActivity($activityTypeId);
$this->assertEquals('1', $activityCheck[1]['status_id']);
// Check activity stauts id
$this->assertFalse($analyzer->hasActivity('Interview Prospect'));
$this->assertFalse($analyzer->hasActivity('Background Check'));
$paramsActivity = array('id' => $opencase_activityIds, 'source_contact_id' => $contact['id'], 'activity_type_id' => $this->opencase_activityId, 'subject' => 'Open Case', 'activity_date_time' => '2011-06-02 14:36:13', 'status_id' => 2, 'priority_id' => 2, 'duration' => 120, 'location' => 'Pensulvania', 'details' => 'A test activity', 'case_id' => $caseBAO->id, 'is_current_revision' => 1, 'original_id' => $opencase_activityIds);
$resultActivity = civicrm_api3('activity', 'create', $paramsActivity);
$paramsActivityGet = array('activity_type_id' => $this->activityIds['Interview Prospect'], 'version' => 3);
$resultActivityGet = civicrm_api3('activity', 'get', $paramsActivityGet);
$analyzer = new CRM_HRCaseUtils_Analyzer($caseBAO->id, $resultActivityGet['values'][$resultActivityGet['id']]['id']);
$ActivityIP = $analyzer->getSingleActivity($this->activityIds['Interview Prospect']);
$this->assertEquals('2', $resultActivity['values'][$resultActivity['id']]['status_id']);
$this->assertEquals('1', $ActivityIP[1]['status_id']);
$this->assertFalse($analyzer->hasActivity('Background Check'));
// get second activity
$params = array('activity_type_id' => $this->activityIds['Interview Prospect'], 'sequential' => 1, 'version' => 3);
$result = civicrm_api3('activity', 'get', $params);
$paramsActivity2 = array('id' => $result['id'], 'status_id' => 'Completed', 'version' => 3, 'case_id' => $caseBAO->id, 'activity_type_id' => $this->activityIds['Interview Prospect'], 'original_id' => $result['id']);
$resultActivity2 = civicrm_api3('activity', 'create', $paramsActivity2);
$paramsActivityGet1 = array('activity_type_id' => $this->activityIds['Background Check'], 'version' => 3);
$resultActivityGet1 = civicrm_api3('activity', 'get', $paramsActivityGet1);
$analyzer = new CRM_HRCaseUtils_Analyzer($caseBAO->id, $resultActivityGet1['values'][$resultActivityGet1['id']]['id']);
$ActivityIP1 = $analyzer->getSingleActivity($this->activityIds['Background Check']);
$this->assertEquals('2', $resultActivity2['values'][$resultActivity2['id']]['status_id']);
$this->assertEquals('1', $ActivityIP1[1]['status_id']);
// get second activity
$params = array('activity_type_id' => $this->activityIds['Background Check'], 'sequential' => 1, 'version' => 3);
$result = civicrm_api3('activity', 'get', $params);
$paramsActivity3 = array('id' => $result['id'], 'status_id' => 'Completed', 'version' => 3, 'case_id' => $caseBAO->id, 'activity_type_id' => $this->activityIds['Background Check'], 'original_id' => $result['id']);
$resultActivity3 = civicrm_api3('activity', 'create', $paramsActivity3);
$this->assertEquals('2', $resultActivity3['values'][$resultActivity3['id']]['status_id']);
}
示例10: 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());
return $fields;
}
示例11: postProcess
/**
* process the form after the input has been submitted and validated
*
* @access public
*
* @return None
*/
public function postProcess()
{
$restoredCases = 0;
foreach ($this->_caseIds as $caseId) {
if (CRM_Case_BAO_Case::restoreCase($caseId)) {
$restoredCases++;
}
}
CRM_Core_Session::setStatus($restoredCases, ts('Restored Cases'), 'success');
CRM_Core_Session::setStatus('', ts('Total Selected Case(s): %1', array(1 => count($this->_caseIds))), 'info');
}
示例12: __construct
/**
*/
public function __construct()
{
$this->case_types = CRM_Case_PseudoConstant::caseType();
$this->case_statuses = CRM_Core_OptionGroup::values('case_status');
$rels = CRM_Core_PseudoConstant::relationshipType();
foreach ($rels as $relid => $v) {
$this->rel_types[$relid] = $v['label_b_a'];
}
$this->deleted_labels = array('' => ts('- select -'), 0 => ts('No'), 1 => ts('Yes'));
$this->_columns = array('civicrm_c2' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('client_name' => array('name' => 'sort_name', 'title' => ts('Client'), 'required' => TRUE), 'id' => array('no_display' => TRUE, 'required' => TRUE))), 'civicrm_case' => array('dao' => 'CRM_Case_DAO_Case', 'fields' => array('id' => array('title' => ts('Case ID'), 'required' => TRUE), 'subject' => array('title' => ts('Case Subject'), 'default' => TRUE), 'status_id' => array('title' => ts('Status'), 'default' => TRUE), 'case_type_id' => array('title' => ts('Case Type'), 'default' => TRUE), 'start_date' => array('title' => ts('Start Date'), 'default' => TRUE, 'type' => CRM_Utils_Type::T_DATE), 'end_date' => array('title' => ts('End Date'), 'default' => TRUE, 'type' => CRM_Utils_Type::T_DATE), 'duration' => array('title' => ts('Duration (Days)'), 'default' => FALSE), 'is_deleted' => array('title' => ts('Deleted?'), 'default' => FALSE, 'type' => CRM_Utils_Type::T_INT)), 'filters' => array('start_date' => array('title' => ts('Start Date'), 'operatorType' => CRM_Report_Form::OP_DATE, 'type' => CRM_Utils_Type::T_DATE), 'end_date' => array('title' => ts('End Date'), 'operatorType' => CRM_Report_Form::OP_DATE, 'type' => CRM_Utils_Type::T_DATE), 'case_type_id' => array('title' => ts('Case Type'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Case_BAO_Case::buildOptions('case_type_id', 'search')), 'status_id' => array('title' => ts('Status'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Case_BAO_Case::buildOptions('status_id', 'search')), 'is_deleted' => array('title' => ts('Deleted?'), 'type' => CRM_Report_Form::OP_INT, 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => $this->deleted_labels, 'default' => 0))), 'civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('sort_name' => array('title' => ts('Staff Member'), 'default' => TRUE)), 'filters' => array('sort_name' => array('title' => ts('Staff Member')))), 'civicrm_relationship' => array('dao' => 'CRM_Contact_DAO_Relationship', 'filters' => array('relationship_type_id' => array('title' => ts('Staff Relationship'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->rel_types))), 'civicrm_relationship_type' => array('dao' => 'CRM_Contact_DAO_RelationshipType', 'fields' => array('label_b_a' => array('title' => ts('Relationship'), 'default' => TRUE))), 'civicrm_case_contact' => array('dao' => 'CRM_Case_DAO_CaseContact'));
parent::__construct();
}
示例13: postProcess
/**
* process the form after the input has been submitted and validated
*
* @access public
* @return None
*/
public function postProcess()
{
$restoredCases = 0;
require_once 'CRM/Case/BAO/Case.php';
foreach ($this->_caseIds as $caseId) {
if (CRM_Case_BAO_Case::restoreCase($caseId)) {
$restoredCases++;
}
}
$status = array(ts('Restored Case(s): %1', array(1 => $restoredCases)), ts('Total Selected Case(s): %1', array(1 => count($this->_caseIds))));
CRM_Core_Session::setStatus($status);
}
示例14: 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");
}
示例15: 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);
}