本文整理汇总了PHP中CRM_Case_PseudoConstant::caseStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Case_PseudoConstant::caseStatus方法的具体用法?PHP CRM_Case_PseudoConstant::caseStatus怎么用?PHP CRM_Case_PseudoConstant::caseStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Case_PseudoConstant
的用法示例。
在下文中一共展示了CRM_Case_PseudoConstant::caseStatus方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preProcess
/**
* Function to set variables up before form is built
*
* @return void
* @access public
*/
public function preProcess()
{
$this->_contactID = $this->get('cid');
$this->_caseID = $this->get('id');
$this->assign('caseID', $this->_caseID);
$this->assign('contactID', $this->_contactID);
//retrieve details about case
$params = array('id' => $this->_caseID);
$returnProperties = array('case_type_id', 'subject', 'status_id', 'start_date');
CRM_Core_DAO::commonRetrieve('CRM_Case_BAO_Case', $params, $values, $returnProperties);
$values['case_type_id'] = explode(CRM_Case_BAO_Case::VALUE_SEPERATOR, CRM_Utils_Array::value('case_type_id', $values));
$statuses = CRM_Case_PseudoConstant::caseStatus();
$caseTypeName = CRM_Case_PseudoConstant::caseTypeName($this->_caseID);
$caseType = CRM_Core_OptionGroup::getLabel('case_type', $caseTypeName['id']);
$this->_caseDetails = array('case_type' => $caseType, 'case_status' => $statuses[$values['case_status_id']], 'case_subject' => CRM_Utils_Array::value('subject', $values), 'case_start_date' => $values['case_start_date']);
$this->_caseType = $caseTypeName['name'];
$this->assign('caseDetails', $this->_caseDetails);
$newActivityUrl = CRM_Utils_System::url('civicrm/case/activity', "action=add&reset=1&cid={$this->_contactID}&caseid={$this->_caseID}&atype=", false, null, false);
$this->assign('newActivityUrl', $newActivityUrl);
$reportUrl = CRM_Utils_System::url('civicrm/case/report', "reset=1&cid={$this->_contactID}&caseid={$this->_caseID}&asn=", false, null, false);
$this->assign('reportUrl', $reportUrl);
// add to recently viewed
require_once 'CRM/Utils/Recent.php';
require_once 'CRM/Contact/BAO/Contact.php';
$url = CRM_Utils_System::url('civicrm/contact/view/case', "action=view&reset=1&id={$this->_caseID}&cid={$this->_contactID}&context=home");
$displayName = CRM_Contact_BAO_Contact::displayName($this->_contactID);
$this->assign('displayName', $displayName);
$title = $displayName . ' - ' . $caseType;
// add the recently created case
CRM_Utils_Recent::add($title, $url, $this->_caseID, 'Case', $this->_contactID, null);
}
示例2: __construct
/**
* CRM_Casereports_Form_Report_Opportunities constructor.
*/
function __construct()
{
$this->setUserSelectList();
$this->_caseStatusList = CRM_Case_PseudoConstant::caseStatus();
$this->_columns = array('pum_opportunity' => array('alias' => 'opp', 'fields' => array('case_id' => array('required' => TRUE, 'no_display' => TRUE, 'no_repeat' => TRUE), 'status_id' => array('no_display' => TRUE, 'required' => TRUE), 'client_id' => array('no_display' => TRUE, 'required' => TRUE), 'account_id' => array('no_display' => TRUE, 'required' => TRUE), 'client_name' => array('title' => ts("Client"), 'default' => TRUE), 'account_name' => array('title' => ts("Case Manager"), 'default' => TRUE), 'subject' => array('title' => ts('Subject'), 'no_repeat' => TRUE, 'default' => TRUE), 'status' => array('title' => ts('Status'), 'no_repeat' => TRUE, 'default' => TRUE), 'deadline' => array('title' => ts('Deadline'), 'no_repeat' => TRUE, 'type' => CRM_Utils_Type::T_DATE, 'default' => TRUE), 'quote_amount' => array('title' => ts('Quote Amount'), 'no_repeat' => TRUE, 'type' => CRM_Utils_Type::T_MONEY, 'default' => TRUE)), 'filters' => array('account_id' => array('title' => ts('Opportunities for User'), 'default' => 0, 'pseudofield' => 1, 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->_userSelectList), 'status_id' => array('title' => ts('Status'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->_caseStatusList)), 'order_bys' => array('case_status' => array('title' => ts('Case Status'), 'name' => 'status', 'default' => 1))));
$this->_groupFilter = FALSE;
$this->_tagFilter = FALSE;
parent::__construct();
}
示例3: __construct
/**
* Constructor method
*/
function __construct()
{
$this->_caseTypes = CRM_Case_PseudoConstant::caseType();
$this->_caseStatus = CRM_Case_PseudoConstant::caseStatus();
$this->setUserSelectList();
$this->_deletedLabels = array('' => ts('- select -'), 0 => ts('No'), 1 => ts('Yes'));
$this->_columns = array('pum_main' => array('fields' => array('case_id' => array('no_display' => TRUE, 'required' => TRUE), 'customer_name' => array('name' => 'customer_name', 'title' => ts('Client'), 'required' => TRUE), 'customer_id' => array('name' => 'customer_id', 'no_display' => TRUE, 'required' => TRUE), 'country_name' => array('name' => 'country_name', 'title' => ts('Country'), 'default' => TRUE), 'representative' => array('name' => 'representative', 'title' => ts('Representative'), 'default' => TRUE), 'representative_id' => array('name' => 'representative_id', 'no_display' => TRUE, 'required' => TRUE), 'case_type' => array('name' => 'case_type_id', 'title' => ts('Case Type'), 'default' => TRUE), 'case_status' => array('name' => 'case_status_id', 'title' => ts('Case Status'), 'default' => TRUE), 'expert' => array('name' => 'expert', 'title' => ts('Expert'), 'default' => TRUE), 'expert_id' => array('name' => 'expert_id', 'no_display' => TRUE, 'required' => TRUE), 'start_date' => array('name' => 'start_date', 'title' => ts('Activity Start Date'), 'default' => TRUE), 'end_date' => array('name' => 'end_date', 'title' => ts('Activity End Date'), 'default' => TRUE), 'ma_expert_approval' => array('name' => 'ma_expert_approval', 'title' => ts('Expert approves Main. Act'), 'default' => TRUE), 'pq_approved_sc' => array('name' => 'pq_approved_sc', 'title' => ts('PQ approved by SC'), 'default' => TRUE), 'pq_approved_cc' => array('name' => 'pq_approved_cc', 'title' => ts('PQ approved by CC'), 'default' => TRUE), 'cust_approves_expert' => array('name' => 'cust_approves_expert', 'title' => ts('Customer approves Expert'), 'default' => TRUE), 'briefing_date' => array('name' => 'briefing_date', 'title' => ts('Briefing Date'), 'default' => TRUE), 'briefing_status' => array('name' => 'briefing_status', 'title' => ts('Briefing Status'), 'default' => TRUE)), 'filters' => array('user_id' => array('title' => ts('Main Activities for User'), 'default' => 0, 'pseudofield' => 1, 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => $this->_userSelectList), 'case_type_id' => array('title' => ts('Case Type'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->_caseTypes), 'case_status_id' => array('title' => ts('Status'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->_caseStatus)), 'order_bys' => array('start_date' => array('title' => ts('Activity Start Date'), 'name' => 'start_date', 'default' => 1))), 'case_status_weight' => array('dao' => 'CRM_Core_DAO_OptionValue', 'fields' => array('case_status_label' => array('name' => 'label', 'no_display' => TRUE, 'required' => TRUE), 'weight' => array('no_display' => TRUE, 'required' => TRUE)), 'order_bys' => array('case_status_label' => array('title' => ts('Case Status'), 'name' => 'label', 'default' => 1))));
parent::__construct();
}
示例4: caseStatus
/**
* Get all the case statues
*
* @access public
* @return array - array reference of all case statues
* @static
*/
public static function caseStatus()
{
if (!self::$caseStatus) {
self::$caseStatus = array();
require_once 'CRM/Core/OptionGroup.php';
self::$caseStatus = CRM_Core_OptionGroup::values('case_status');
}
return self::$caseStatus;
}
示例5: __construct
/**
* Constructor method
*/
function __construct()
{
$this->_caseStatusList = CRM_Case_PseudoConstant::caseStatus();
$this->setUserSelectList();
$this->setSectorList();
$this->_deletedLabels = array('' => ts('- select -'), 0 => ts('No'), 1 => ts('Yes'));
$this->_columns = array('pum_expert' => array('fields' => array('case_id' => array('no_display' => TRUE, 'required' => TRUE), 'expert_name' => array('name' => 'expert_name', 'title' => ts('Expert'), 'required' => TRUE), 'sector_coordinator_name' => array('name' => 'sector_coordinator_name', 'title' => ts('Sector Coordinator'), 'required' => TRUE), 'status' => array('name' => 'status', 'title' => ts('Status'), 'default' => TRUE), 'sector_coordinator_id' => array('no_display' => TRUE, 'required' => TRUE), 'expert_id' => array('no_display' => TRUE, 'required' => TRUE)), 'filters' => array('user_id' => array('title' => ts('Expert Applications for User'), 'default' => 0, 'pseudofield' => 1, 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => $this->_userSelectList), 'status_id' => array('title' => ts('Status'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->_caseStatusList)), 'order_bys' => array('status' => array('title' => ts('Case Status'), 'name' => 'status', 'default' => 1))));
parent::__construct();
}
示例6: testSequence
public function testSequence()
{
$actStatuses = array_flip(\CRM_Core_PseudoConstant::activityStatus('name'));
$caseStatuses = array_flip(\CRM_Case_PseudoConstant::caseStatus('name'));
// Create case; schedule first activity
\CRM_Utils_Time::setTime('2013-11-30 01:00:00');
$case = $this->callAPISuccess('case', 'create', $this->_params);
$analyzer = new \Civi\CCase\Analyzer($case['id']);
$this->assertEquals($caseStatuses['Open'], self::ag($analyzer->getCase(), 'status_id'));
$this->assertApproxTime('2013-11-30 01:00:00', self::ag($analyzer->getSingleActivity('Medical evaluation'), 'activity_date_time'));
$this->assertEquals($actStatuses['Scheduled'], self::ag($analyzer->getSingleActivity('Medical evaluation'), 'status_id'));
$this->assertFalse($analyzer->hasActivity('Mental health evaluation'));
$this->assertFalse($analyzer->hasActivity('Secure temporary housing'));
// Edit details of first activity -- but don't finish it yet!
\CRM_Utils_Time::setTime('2013-11-30 01:30:00');
$this->callApiSuccess('Activity', 'create', array('id' => self::ag($analyzer->getSingleActivity('Medical evaluation'), 'id'), 'subject' => 'This is the new subject'));
$analyzer = new \Civi\CCase\Analyzer($case['id']);
$this->assertEquals($caseStatuses['Open'], self::ag($analyzer->getCase(), 'status_id'));
$this->assertApproxTime('2013-11-30 01:00:00', self::ag($analyzer->getSingleActivity('Medical evaluation'), 'activity_date_time'));
$this->assertEquals($actStatuses['Scheduled'], self::ag($analyzer->getSingleActivity('Medical evaluation'), 'status_id'));
$this->assertFalse($analyzer->hasActivity('Mental health evaluation'));
$this->assertFalse($analyzer->hasActivity('Secure temporary housing'));
// Complete first activity; schedule second
\CRM_Utils_Time::setTime('2013-11-30 02:00:00');
$this->callApiSuccess('Activity', 'create', array('id' => self::ag($analyzer->getSingleActivity('Medical evaluation'), 'id'), 'status_id' => $actStatuses['Completed']));
$analyzer->flush();
$this->assertEquals($caseStatuses['Open'], self::ag($analyzer->getCase(), 'status_id'));
$this->assertApproxTime('2013-11-30 01:00:00', self::ag($analyzer->getSingleActivity('Medical evaluation'), 'activity_date_time'));
$this->assertEquals($actStatuses['Completed'], self::ag($analyzer->getSingleActivity('Medical evaluation'), 'status_id'));
$this->assertApproxTime('2013-11-30 02:00:00', self::ag($analyzer->getSingleActivity('Mental health evaluation'), 'activity_date_time'));
$this->assertEquals($actStatuses['Scheduled'], self::ag($analyzer->getSingleActivity('Mental health evaluation'), 'status_id'));
$this->assertFalse($analyzer->hasActivity('Secure temporary housing'));
// Complete second activity; schedule third
\CRM_Utils_Time::setTime('2013-11-30 03:00:00');
$this->callApiSuccess('Activity', 'create', array('id' => self::ag($analyzer->getSingleActivity('Mental health evaluation'), 'id'), 'status_id' => $actStatuses['Completed']));
$analyzer->flush();
$this->assertEquals($caseStatuses['Open'], self::ag($analyzer->getCase(), 'status_id'));
$this->assertApproxTime('2013-11-30 01:00:00', self::ag($analyzer->getSingleActivity('Medical evaluation'), 'activity_date_time'));
$this->assertEquals($actStatuses['Completed'], self::ag($analyzer->getSingleActivity('Medical evaluation'), 'status_id'));
$this->assertApproxTime('2013-11-30 02:00:00', self::ag($analyzer->getSingleActivity('Mental health evaluation'), 'activity_date_time'));
$this->assertEquals($actStatuses['Completed'], self::ag($analyzer->getSingleActivity('Mental health evaluation'), 'status_id'));
$this->assertApproxTime('2013-11-30 03:00:00', self::ag($analyzer->getSingleActivity('Secure temporary housing'), 'activity_date_time'));
$this->assertEquals($actStatuses['Scheduled'], self::ag($analyzer->getSingleActivity('Secure temporary housing'), 'status_id'));
// Complete third activity; close case
\CRM_Utils_Time::setTime('2013-11-30 04:00:00');
$this->callApiSuccess('Activity', 'create', array('id' => self::ag($analyzer->getSingleActivity('Secure temporary housing'), 'id'), 'status_id' => $actStatuses['Completed']));
$analyzer->flush();
$this->assertApproxTime('2013-11-30 01:00:00', self::ag($analyzer->getSingleActivity('Medical evaluation'), 'activity_date_time'));
$this->assertEquals($actStatuses['Completed'], self::ag($analyzer->getSingleActivity('Medical evaluation'), 'status_id'));
$this->assertApproxTime('2013-11-30 02:00:00', self::ag($analyzer->getSingleActivity('Mental health evaluation'), 'activity_date_time'));
$this->assertEquals($actStatuses['Completed'], self::ag($analyzer->getSingleActivity('Mental health evaluation'), 'status_id'));
$this->assertApproxTime('2013-11-30 03:00:00', self::ag($analyzer->getSingleActivity('Secure temporary housing'), 'activity_date_time'));
$this->assertEquals($actStatuses['Completed'], self::ag($analyzer->getSingleActivity('Secure temporary housing'), 'status_id'));
$this->assertEquals($caseStatuses['Closed'], self::ag($analyzer->getCase(), 'status_id'));
// */
}
示例7: buildQuickForm
static function buildQuickForm(&$form)
{
require_once 'CRM/Case/PseudoConstant.php';
$form->_caseStatus = CRM_Case_PseudoConstant::caseStatus();
$form->_defaultCaseStatus = CRM_Core_DAO::getFieldValue('CRM_Case_DAO_Case', $form->_caseId, 'status_id');
if (!array_key_exists($form->_defaultCaseStatus, $form->_caseStatus)) {
$form->_caseStatus[$form->_defaultCaseStatus] = CRM_Core_OptionGroup::getLabel('case_status', $form->_defaultCaseStatus, false);
}
$form->add('select', 'case_status_id', ts('Case Status'), $form->_caseStatus, true);
}
示例8: __construct
function __construct()
{
$this->case_statuses = CRM_Case_PseudoConstant::caseStatus();
$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('display_name' => array('title' => ts('Client'), '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('Start Date'), 'default' => true), 'end_date' => array('title' => ts('End Date'), 'default' => true), 'status_id' => array('title' => ts('Status'), 'default' => true), '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), 'end_date' => array('title' => ts('End Date'), 'operatorType' => CRM_Report_Form::OP_DATE), 'status_id' => array('title' => ts('Status'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->case_statuses), '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'), '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();
}
示例9: buildQuickForm
static function buildQuickForm(&$form)
{
$form->removeElement('status_id');
$form->removeElement('priority_id');
$form->_caseStatus = CRM_Case_PseudoConstant::caseStatus();
$form->_defaultCaseStatus = CRM_Core_DAO::getFieldValue('CRM_Case_DAO_Case', $form->_caseId, 'status_id');
if (!array_key_exists($form->_defaultCaseStatus, $form->_caseStatus)) {
$form->_caseStatus[$form->_defaultCaseStatus] = CRM_Core_OptionGroup::getLabel('case_status', $form->_defaultCaseStatus, FALSE);
}
$form->add('select', 'case_status_id', ts('Case Status'), $form->_caseStatus, TRUE);
}
示例10: __construct
function __construct()
{
$this->case_statuses = CRM_Case_PseudoConstant::caseStatus();
$this->case_types = CRM_Case_PseudoConstant::caseType();
$rels = CRM_Core_PseudoConstant::relationshipType();
foreach ($rels as $relid => $v) {
$this->rel_types[$relid] = $v['label_b_a'];
}
$this->_columns = array('civicrm_case' => array('dao' => 'CRM_Case_DAO_Case', 'fields' => array('id' => array('title' => ts('Case ID'), 'no_display' => true, 'required' => true), 'subject' => array('title' => ts('Subject'), 'required' => true), 'start_date' => array('title' => ts('Start Date')), 'end_date' => array('title' => ts('End Date')), 'status_id' => array('title' => ts('Case Status')), 'case_type_id' => array('title' => ts('Case Type'))), '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), 'status_id' => array('title' => ts('Case Status'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->case_statuses), 'case_type_id' => array('title' => ts('Case Type'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->case_types))), 'civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('display_name' => array('title' => ts('Client Name'), 'required' => true), 'id' => array('no_display' => true, 'required' => true)), 'filters' => array('display_name' => array('title' => ts('Client Name')))), 'civicrm_relationship' => array('dao' => 'CRM_Contact_DAO_Relationship', 'fields' => array('relationship_type_id' => array('title' => ts('Case Role'))), 'filters' => array('relationship_type_id' => array('title' => ts('Case Role'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->rel_types))), 'civicrm_relationship_type' => array('dao' => 'CRM_Contact_DAO_RelationshipType'), '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', 'fields' => array('street_address' => null, 'state_province_id' => array('title' => ts('State/Province')), 'country_id' => array('title' => ts('Country'))), 'grouping' => 'contact-fields', 'filters' => array('country_id' => array('title' => ts('Country'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_PseudoConstant::country()), 'state_province_id' => array('title' => ts('State/Province'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_PseudoConstant::stateProvince()))), 'civicrm_worldregion' => array('dao' => 'CRM_Core_DAO_Worldregion', 'filters' => array('worldregion_id' => array('name' => 'id', 'title' => ts('WorldRegion'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_PseudoConstant::worldRegion()))), 'civicrm_country' => array('dao' => 'CRM_Core_DAO_Country'), 'civicrm_activity' => array('dao' => 'CRM_Activity_DAO_Activity', 'fields' => array('activity_subject' => array('name' => 'subject', 'title' => ts('Activity Subject'), 'no_display' => true)), 'filters' => array('activity_date_time' => array('title' => ts('Last Action Date'), 'operatorType' => CRM_Report_Form::OP_DATE))), 'civicrm_case_contact' => array('dao' => 'CRM_Case_DAO_CaseContact'));
$this->_options = array('my_cases' => array('title' => ts('My Cases'), 'type' => 'checkbox'));
parent::__construct();
}
示例11: __construct
/**
*
*/
function __construct()
{
$this->case_statuses = CRM_Case_PseudoConstant::caseStatus();
$this->case_types = CRM_Case_PseudoConstant::caseType();
$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->caseActivityTypes = array();
foreach (CRM_Case_PseudoConstant::caseActivityType() as $typeDetail) {
$this->caseActivityTypes[$typeDetail['id']] = $typeDetail['label'];
}
$this->_columns = array('civicrm_case' => array('dao' => 'CRM_Case_DAO_Case', 'fields' => array('id' => array('title' => ts('Case ID'), 'no_display' => TRUE, 'required' => TRUE), 'subject' => array('title' => ts('Subject'), 'required' => TRUE), 'start_date' => array('title' => ts('Start Date'), 'type' => CRM_Utils_Type::T_DATE), 'end_date' => array('title' => ts('End Date'), 'type' => CRM_Utils_Type::T_DATE), 'status_id' => array('title' => ts('Case Status')), 'case_type_id' => array('title' => ts('Case Type')), '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), 'status_id' => array('title' => ts('Case Status'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->case_statuses), 'case_type_id' => array('title' => ts('Case Type'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->case_types), 'is_deleted' => array('title' => ts('Deleted?'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => $this->deleted_labels, 'default' => 0))), 'civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('client_sort_name' => array('name' => 'sort_name', 'title' => ts('Client Name'), 'required' => TRUE), 'id' => array('no_display' => TRUE, 'required' => TRUE)), 'filters' => array('sort_name' => array('title' => ts('Client Name')))), 'civicrm_relationship' => array('dao' => 'CRM_Contact_DAO_Relationship', 'fields' => array('case_role' => array('name' => 'relationship_type_id', 'title' => ts('Case Role(s)'))), 'filters' => array('case_role' => array('name' => 'relationship_type_id', 'title' => ts('Case Role(s)'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->rel_types))), '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', 'fields' => array('street_address' => NULL, 'state_province_id' => array('title' => ts('State/Province')), 'country_id' => array('title' => ts('Country'))), 'grouping' => 'contact-fields', 'filters' => array('country_id' => array('title' => ts('Country'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_PseudoConstant::country()), 'state_province_id' => array('title' => ts('State/Province'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_PseudoConstant::stateProvince()))), 'civicrm_worldregion' => array('dao' => 'CRM_Core_DAO_Worldregion', 'filters' => array('worldregion_id' => array('name' => 'id', 'title' => ts('WorldRegion'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_PseudoConstant::worldRegion()))), 'civicrm_country' => array('dao' => 'CRM_Core_DAO_Country'), 'civicrm_activity_last' => array('dao' => 'CRM_Activity_DAO_Activity', 'filters' => array('last_activity_date_time' => array('name' => 'activity_date_time', 'title' => ts('Last Action Date'), 'operatorType' => CRM_Report_Form::OP_DATE)), 'alias' => 'civireport_activity_last'), 'civicrm_activity_last_completed' => array('dao' => 'CRM_Activity_DAO_Activity', 'fields' => array('last_completed_activity_subject' => array('name' => 'subject', 'title' => ts('Subject of the last completed activity in the case')), 'last_completed_activity_type' => array('name' => 'activity_type_id', 'title' => ts('Activity type of the last completed activity')))));
$this->_options = array('my_cases' => array('title' => ts('My Cases'), 'type' => 'checkbox'));
parent::__construct();
}
示例12: buildQuickForm
/**
* @param CRM_Core_Form $form
*/
public static function buildQuickForm(&$form)
{
$form->removeElement('status_id');
$form->removeElement('priority_id');
$form->_caseStatus = CRM_Case_PseudoConstant::caseStatus();
foreach ($form->_caseId as $key => $val) {
$form->_oldCaseStatus[] = $form->_defaultCaseStatus[] = CRM_Core_DAO::getFieldValue('CRM_Case_DAO_Case', $val, 'status_id');
}
foreach ($form->_defaultCaseStatus as $keydefault => $valdefault) {
if (!array_key_exists($valdefault, $form->_caseStatus)) {
$form->_caseStatus[$valdefault] = CRM_Core_OptionGroup::getLabel('case_status', $valdefault, FALSE);
}
}
$element = $form->add('select', 'case_status_id', ts('Case Status'), $form->_caseStatus, TRUE);
// check if the case status id passed in url is a valid one, set as default and freeze
if (CRM_Utils_Request::retrieve('case_status_id', 'Positive', $form)) {
$caseStatusId = CRM_Utils_Request::retrieve('case_status_id', 'Positive', $form);
$caseStatus = CRM_Case_PseudoConstant::caseStatus();
$form->_defaultCaseStatus = array_key_exists($caseStatusId, $caseStatus) ? $caseStatusId : NULL;
$element->freeze();
}
}
示例13: beginPostProcess
/**
* Function to process the form
*
* @access public
* @return None
*/
public function beginPostProcess(&$form, &$params)
{
if ($form->_context == 'caseActivity') {
return;
}
// set the contact, when contact is selected
if (CRM_Utils_Array::value('contact_select_id', $params)) {
$params['contact_id'] = CRM_Utils_Array::value('contact_select_id', $params);
$form->_currentlyViewedContactId = $params['contact_id'];
}
// for open case start date should be set to current date
$params['start_date'] = CRM_Utils_Date::processDate($params['start_date']);
require_once 'CRM/Case/PseudoConstant.php';
$caseStatus = CRM_Case_PseudoConstant::caseStatus();
// for resolved case the end date should set to now
if ($params['status_id'] == array_search('Resolved', $caseStatus)) {
$params['end_date'] = $params['now'];
}
// rename activity_location param to the correct column name for activity DAO
$params['location'] = $params['activity_location'];
}
示例14: isCaseConfigured
/**
* Function to check case configuration.
*
* @param null $contactId
*
* @return array $configured
*/
static function isCaseConfigured($contactId = NULL)
{
$configured = array_fill_keys(array('configured', 'allowToAddNewCase', 'redirectToCaseAdmin'), FALSE);
//lets check for case configured.
$allCasesCount = CRM_Case_BAO_Case::caseCount(NULL, FALSE);
$configured['configured'] = $allCasesCount ? TRUE : FALSE;
if (!$configured['configured']) {
//do check for case type and case status.
$caseTypes = CRM_Case_PseudoConstant::caseType('title', FALSE);
if (!empty($caseTypes)) {
$configured['configured'] = TRUE;
if (!$configured['configured']) {
$caseStatuses = CRM_Case_PseudoConstant::caseStatus('label', FALSE);
if (!empty($caseStatuses)) {
$configured['configured'] = TRUE;
}
}
}
}
if ($configured['configured']) {
//do check for active case type and case status.
$caseTypes = CRM_Case_PseudoConstant::caseType();
if (!empty($caseTypes)) {
$caseStatuses = CRM_Case_PseudoConstant::caseStatus();
if (!empty($caseStatuses)) {
$configured['allowToAddNewCase'] = TRUE;
}
}
//do we need to redirect user to case admin.
if (!$configured['allowToAddNewCase'] && $contactId) {
//check for current contact case count.
$currentContatCasesCount = CRM_Case_BAO_Case::caseCount($contactId);
//redirect user to case admin page.
if (!$currentContatCasesCount) {
$configured['redirectToCaseAdmin'] = TRUE;
}
}
}
return $configured;
}
示例15: caseDetails
function caseDetails()
{
$caseId = CRM_Utils_Type::escape($_GET['caseId'], 'Integer');
$sql = "SELECT civicrm_case.*, civicrm_case_type.title as case_type\n FROM civicrm_case\n INNER JOIN civicrm_case_type ON civicrm_case.case_type_id = civicrm_case_type.id\n WHERE civicrm_case.id = %1";
$dao = CRM_Core_DAO::executeQuery($sql, array(1 => array($caseId, 'Integer')));
if ($dao->fetch()) {
$caseStatuses = CRM_Case_PseudoConstant::caseStatus();
$cs = $caseStatuses[$dao->status_id];
$caseDetails = "<table><tr><td>" . ts('Case Subject') . "</td><td>{$dao->subject}</td></tr>\n <tr><td>" . ts('Case Type') . "</td><td>{$dao->case_type}</td></tr>\n <tr><td>" . ts('Case Status') . "</td><td>{$cs}</td></tr>\n <tr><td>" . ts('Case Start Date') . "</td><td>" . CRM_Utils_Date::customFormat($dao->start_date) . "</td></tr>\n <tr><td>" . ts('Case End Date') . "</td><td></td></tr>" . CRM_Utils_Date::customFormat($dao->end_date) . "</table>";
echo $caseDetails;
} else {
echo ts('Could not find valid Case!');
}
CRM_Utils_System::civiExit();
}