+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
- $this->case_types = CRM_Case_PseudoConstant::caseType();
- $rels = CRM_Core_PseudoConstant::relationshipType();
+ $this->case_types = CRM_Case_PseudoConstant::caseType();
+ $rels = CRM_Core_PseudoConstant::relationshipType();
- $this->deleted_labels = array('' => ts('- select -'), 0 => ts('No'), 1 => ts('Yes'));
+ $this->deleted_labels = array(
+ '' => ts('- select -'),
+ 0 => ts('No'),
+ 1 => ts('Yes'),
+ );
$this->caseActivityTypes = array();
foreach (CRM_Case_PseudoConstant::caseActivityType() as $typeDetail) {
$this->caseActivityTypes = array();
foreach (CRM_Case_PseudoConstant::caseActivityType() as $typeDetail) {
'type' => CRM_Utils_Type::T_DATE,
),
'status_id' => array('title' => ts('Case Status')),
'case_type_id' => array('title' => ts('Case Type')),
'type' => CRM_Utils_Type::T_DATE,
),
'status_id' => array('title' => ts('Case Status')),
'case_type_id' => array('title' => ts('Case Type')),
'operatorType' => CRM_Report_Form::OP_DATE,
'type' => CRM_Utils_Type::T_DATE,
),
'operatorType' => CRM_Report_Form::OP_DATE,
'type' => CRM_Utils_Type::T_DATE,
),
'operatorType' => CRM_Report_Form::OP_DATE,
'type' => CRM_Utils_Type::T_DATE,
),
'operatorType' => CRM_Report_Form::OP_DATE,
'type' => CRM_Utils_Type::T_DATE,
),
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
'options' => $this->case_statuses,
),
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
'options' => $this->case_statuses,
),
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
'options' => $this->case_types,
),
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
'options' => $this->case_types,
),
'type' => CRM_Utils_Type::T_INT,
'operatorType' => CRM_Report_Form::OP_SELECT,
'options' => $this->deleted_labels,
'type' => CRM_Utils_Type::T_INT,
'operatorType' => CRM_Report_Form::OP_SELECT,
'options' => $this->deleted_labels,
'client_sort_name' => array(
'name' => 'sort_name',
'title' => ts('Client Name'),
'client_sort_name' => array(
'name' => 'sort_name',
'title' => ts('Client Name'),
'name' => 'relationship_type_id',
'title' => ts('Case Role(s)'),
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
'name' => 'relationship_type_id',
'title' => ts('Case Role(s)'),
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
),
'country_id' => array('title' => ts('Country')),
),
'grouping' => 'contact-fields',
),
'country_id' => array('title' => ts('Country')),
),
'grouping' => 'contact-fields',
'type' => CRM_Utils_Type::T_INT,
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
'options' => CRM_Core_PseudoConstant::country(),
),
'type' => CRM_Utils_Type::T_INT,
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
'options' => CRM_Core_PseudoConstant::country(),
),
'type' => CRM_Utils_Type::T_INT,
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
'options' => CRM_Core_PseudoConstant::stateProvince(),
),
),
),
'type' => CRM_Utils_Type::T_INT,
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
'options' => CRM_Core_PseudoConstant::stateProvince(),
),
),
),
'worldregion_id' => array(
'name' => 'id',
'title' => ts('World Region'),
'worldregion_id' => array(
'name' => 'id',
'title' => ts('World Region'),
'name' => 'activity_date_time',
'title' => ts('Last Action Date'),
'operatorType' => CRM_Report_Form::OP_DATE,
'name' => 'activity_date_time',
'title' => ts('Last Action Date'),
'operatorType' => CRM_Report_Form::OP_DATE,
'name' => 'activity_type_id',
'title' => ts('Activity type of the last completed activity'),
),
'name' => 'activity_type_id',
'title' => ts('Activity type of the last completed activity'),
),
$elements = array();
$elements[] = &$this->createElement('select', 'case_activity_all_dates', NULL,
array(
$elements = array();
$elements[] = &$this->createElement('select', 'case_activity_all_dates', NULL,
array(
- $this->_caseDetailExtra = array('case_activity_all_dates' => array('title' => ts('List of all dates of activities of Type'),
+ $this->_caseDetailExtra = array(
+ 'case_activity_all_dates' => array(
+ 'title' => ts('List of all dates of activities of Type'),
if (CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_DATE) {
$relative = CRM_Utils_Array::value("{$fieldName}_relative", $this->_params);
if (CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_DATE) {
$relative = CRM_Utils_Array::value("{$fieldName}_relative", $this->_params);
- $from = CRM_Utils_Array::value("{$fieldName}_from", $this->_params);
- $to = CRM_Utils_Array::value("{$fieldName}_to", $this->_params);
+ $from = CRM_Utils_Array::value("{$fieldName}_from", $this->_params);
+ $to = CRM_Utils_Array::value("{$fieldName}_to", $this->_params);
$clause = $this->dateClause($field['dbAlias'], $relative, $from, $to, $field['type']);
}
else {
$op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
$clause = $this->dateClause($field['dbAlias'], $relative, $from, $to, $field['type']);
}
else {
$op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
foreach ($this->_params['case_type_id_value'] as $key => $value) {
if (strpos($value, CRM_Core_DAO::VALUE_SEPARATOR) === FALSE) {
foreach ($this->_params['case_type_id_value'] as $key => $value) {
if (strpos($value, CRM_Core_DAO::VALUE_SEPARATOR) === FALSE) {
- $select = "select COUNT( DISTINCT( {$this->_aliases['civicrm_address']}.country_id))";
- $sql = "{$select} {$this->_from} {$this->_where}";
+ $select = "select COUNT( DISTINCT( {$this->_aliases['civicrm_address']}.country_id))";
+ $sql = "{$select} {$this->_from} {$this->_where}";
$countryCount = CRM_Core_DAO::singleValueQuery($sql);
//CaseType statistics
if (array_key_exists('filters', $statistics)) {
foreach ($statistics['filters'] as $id => $value) {
if ($value['title'] == 'Case Type') {
$countryCount = CRM_Core_DAO::singleValueQuery($sql);
//CaseType statistics
if (array_key_exists('filters', $statistics)) {
foreach ($statistics['filters'] as $id => $value) {
if ($value['title'] == 'Case Type') {
- $statistics['filters'][$id]['value'] = 'Is ' . $this->case_types[substr($statistics['filters'][$id]
- ['value'], -3, -2
- )];
+ $statistics['filters'][$id]['value'] = 'Is ' .
+ $this->case_types[substr($statistics['filters'][$id]['value'], -3, -2
+ )];
LEFT JOIN civicrm_activity civireport_activity_all_{$activityType} ON ( civireport_activity_all_{$activityType}.id = civireport_case_activity_all_{$activityType}.activity_id AND civireport_activity_all_{$activityType}.activity_type_id = {$activityType})";
$this->_columnHeaders['case_activity_all_dates'] = array(
LEFT JOIN civicrm_activity civireport_activity_all_{$activityType} ON ( civireport_activity_all_{$activityType}.id = civireport_case_activity_all_{$activityType}.activity_id AND civireport_activity_all_{$activityType}.activity_type_id = {$activityType})";
$this->_columnHeaders['case_activity_all_dates'] = array(
- 'title' => $this->_caseDetailExtra['case_activity_all_dates']['title'] . ": {$this->caseActivityTypes[$activityType]}",
+ 'title' => $this->_caseDetailExtra['case_activity_all_dates']['title'] .
+ ": {$this->caseActivityTypes[$activityType]}",
- function checkEnabledFields() {
- if (isset($this->_params['worldregion_id_value']) && !empty($this->_params['worldregion_id_value'])) {
+ public function checkEnabledFields() {
+ if (isset($this->_params['worldregion_id_value']) &&
+ !empty($this->_params['worldregion_id_value'])
+ ) {
CRM_Utils_Array::value('activity_date_time_to', $this->_params)
) {
$this->_activityLast = TRUE;
CRM_Utils_Array::value('activity_date_time_to', $this->_params)
) {
$this->_activityLast = TRUE;
}
if (array_key_exists('civicrm_case_subject', $row)) {
if ($value = $row['civicrm_case_subject']) {
}
if (array_key_exists('civicrm_case_subject', $row)) {
if ($value = $row['civicrm_case_subject']) {
- $caseId = $row['civicrm_case_id'];
- $contactId = $row['civicrm_contact_id'];
- $rows[$rowNum]['civicrm_case_subject'] = "<a href= 'javascript:viewCase( $caseId,$contactId );'>$value</a>";
+ $url = CRM_Utils_System::url("civicrm/case/ajax/details",
+ "caseId={$row['civicrm_case_id']}&contactId={$row['civicrm_contact_id']}",
+ $this->_absoluteUrl
+ );
+ $rows[$rowNum]['civicrm_case_subject'] = "<a class=\"crm-popup\" href=\"$url\">$value</a>";
- if (array_key_exists('civicrm_activity_last_completed_last_completed_activity_subject', $row) && empty($row['civicrm_activity_last_completed_last_completed_activity_subject'])) {
+ if (array_key_exists('civicrm_activity_last_completed_last_completed_activity_subject', $row) &&
+ empty($row['civicrm_activity_last_completed_last_completed_activity_subject'])
+ ) {