<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
*
*/
class CRM_Case_Form_CaseView extends CRM_Core_Form {
- /*
- * check for merge cases.
- */
-
+ /**
+ * Check for merge cases.
+ * @var bool
+ */
private $_mergeCases = FALSE;
/**
- * Function to set variables up before form is built
+ * Set variables up before form is built
*
* @return void
- * @access public
*/
public function preProcess() {
$this->_showRelatedCases = CRM_Utils_Array::value('relatedCases', $_GET);
$recentOther
);
-
//get the related cases for given case.
$relatedCases = $this->get('relatedCases');
if (!isset($relatedCases)) {
}
/**
- * This function sets the default values for the form. For edit/view mode
+ * Set default values for the form. For edit/view mode
* the default values are retrieved from the database
*
- * @access public
*
* @return void
*/
- function setDefaultValues() {
+ public function setDefaultValues() {
$defaults = array();
return $defaults;
}
/**
- * Function to build the form
+ * Build the form object
*
* @return void
- * @access public
*/
public function buildQuickForm() {
//this call is for show related cases.
FALSE, NULL, FALSE
);
}
- else if ($type == $pdfActivityType ) {
- $url = CRM_Utils_System::url('civicrm/activity/pdf/add',
+ elseif ($type == $pdfActivityType) {
+ $url = CRM_Utils_System::url('civicrm/activity/pdf/add',
"action=add&context=standalone&reset=1&cid={$this->_contactID}&caseid={$this->_caseID}&atype=$type",
- FALSE, NULL, FALSE );
+ FALSE, NULL, FALSE);
}
else {
$url = CRM_Utils_System::url('civicrm/case/activity',
$this->assign('hookCaseSummary', $hookCaseSummary);
}
-
- $allTags = CRM_Core_BAO_Tag::getTags('civicrm_case');
+ CRM_Core_BAO_Tag::getTags('civicrm_case', $allTags, NULL,
+ ' ', TRUE);
if (!empty($allTags)) {
$this->add('select', 'case_tag', ts('Tags'), $allTags, FALSE,
* Process the form
*
* @return void
- * @access public
*/
public function postProcess() {
$params = $this->controller->exportValues($this->_name);
/**
* Build the activity selector/datatable
* @param CRM_Core_Form $form
- * @param array $aTypes to include acivities related to current case id $form->_caseID
+ * @param array $aTypes
+ * To include acivities related to current case id $form->_caseID.
*/
- static function activityForm($form, $aTypes = array()) {
+ public static function activityForm($form, $aTypes = array()) {
$caseRelationships = CRM_Case_BAO_Case::getCaseRoles($form->_contactID, $form->_caseID);
//build reporter select
$reporters = array("" => ts(' - any reporter - '));
foreach ($caseRelationships as $key => & $value) {
$reporters[$value['cid']] = $value['name'] . " ( {$value['relation']} )";
}
- $form->add('select', 'reporter_id', ts('Reporter/Role'), $reporters, FALSE, array('id' => 'reporter_id_'.$form->_caseID));
+ $form->add('select', 'reporter_id', ts('Reporter/Role'), $reporters, FALSE, array('id' => 'reporter_id_' . $form->_caseID));
// take all case activity types for search filter, CRM-7187
$aTypesFilter = array();
}
$aTypesFilter = $aTypesFilter + $aTypes;
asort($aTypesFilter);
- $form->add('select', 'activity_type_filter_id', ts('Activity Type'), array('' => ts('- select activity type -')) + $aTypesFilter, FALSE, array('id' => 'activity_type_filter_id_'.$form->_caseID));
+ $form->add('select', 'activity_type_filter_id', ts('Activity Type'), array('' => ts('- select activity type -')) + $aTypesFilter, FALSE, array('id' => 'activity_type_filter_id_' . $form->_caseID));
$activityStatus = CRM_Core_PseudoConstant::activityStatus();
- $form->add('select', 'status_id', ts('Status'), array("" => ts(' - any status - ')) + $activityStatus, FALSE, array('id' => 'status_id_'.$form->_caseID));
+ $form->add('select', 'status_id', ts('Status'), array("" => ts(' - any status - ')) + $activityStatus, FALSE, array('id' => 'status_id_' . $form->_caseID));
// activity dates
- $form->addDate('activity_date_low_'.$form->_caseID, ts('Activity Dates - From'), FALSE, array('formatType' => 'searchDate'));
- $form->addDate('activity_date_high_'.$form->_caseID, ts('To'), FALSE, array('formatType' => 'searchDate'));
+ $form->addDate('activity_date_low_' . $form->_caseID, ts('Activity Dates - From'), FALSE, array('formatType' => 'searchDate'));
+ $form->addDate('activity_date_high_' . $form->_caseID, ts('To'), FALSE, array('formatType' => 'searchDate'));
if (CRM_Core_Permission::check('administer CiviCRM')) {
- $form->add('checkbox', 'activity_deleted', ts('Deleted Activities'), '', FALSE, array('id' => 'activity_deleted_'.$form->_caseID));
+ $form->add('checkbox', 'activity_deleted', ts('Deleted Activities'), '', FALSE, array('id' => 'activity_deleted_' . $form->_caseID));
}
}
}