+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
* $Id$
*
*/
private $_mergeCases = FALSE;
/**
- * Set variables up before form is built
+ * Set variables up before form is built.
*
* @return void
*/
if ($this->_showRelatedCases) {
$relatedCases = $this->get('relatedCases');
if (!isset($relatedCases)) {
- $cId = CRM_Utils_Request::retrieve('cid', 'Integer', CRM_Core_DAO::$_nullObject);
- $caseId = CRM_Utils_Request::retrieve('id', 'Integer', CRM_Core_DAO::$_nullObject);
+ $cId = CRM_Utils_Request::retrieve('cid', 'Integer', CRM_Core_DAO::$_nullObject);
+ $caseId = CRM_Utils_Request::retrieve('id', 'Integer', CRM_Core_DAO::$_nullObject);
$relatedCases = CRM_Case_BAO_Case::getRelatedCases($caseId, $cId);
}
$this->assign('relatedCases', $relatedCases);
//validate case id.
$this->_userCases = array();
- $session = CRM_Core_Session::singleton();
- $userID = $session->get('userID');
+ $session = CRM_Core_Session::singleton();
+ $userID = $session->get('userID');
if (!$this->_hasAccessToAllCases) {
$this->_userCases = CRM_Case_BAO_Case::getCases(FALSE, $userID, 'any');
if (!array_key_exists($this->_caseID, $this->_userCases)) {
$returnProperties = array('case_type_id', 'subject', 'status_id', 'start_date');
CRM_Core_DAO::commonRetrieve('CRM_Case_BAO_Case', $params, $values, $returnProperties);
- $statuses = CRM_Case_PseudoConstant::caseStatus('label', FALSE);
+ $statuses = CRM_Case_PseudoConstant::caseStatus('label', FALSE);
$caseTypeName = CRM_Case_BAO_Case::getCaseType($this->_caseID, 'name');
- $caseType = CRM_Case_BAO_Case::getCaseType($this->_caseID);
+ $caseType = CRM_Case_BAO_Case::getCaseType($this->_caseID);
$this->_caseDetails = array(
'case_type' => $caseType,
$recentOther
);
-
//get the related cases for given case.
$relatedCases = $this->get('relatedCases');
if (!isset($relatedCases)) {
}
$this->assign('hasRelatedCases', (bool) $relatedCases);
if ($relatedCases) {
- $this->assign('relatedCaseLabel', ts('%1 Related Case', array('count' => count($relatedCases), 'plural' => '%1 Related Cases')));
+ $this->assign('relatedCaseLabel', ts('%1 Related Case', array(
+ 'count' => count($relatedCases),
+ 'plural' => '%1 Related Cases',
+ )));
$this->assign('relatedCaseUrl', CRM_Utils_System::url('civicrm/contact/view/case', array(
'id' => $this->_caseID,
'cid' => $this->_contactID,
}
/**
- * Build the form object
+ * Build the form object.
*
* @return void
*/
->addScriptFile('civicrm', 'templates/CRM/Case/Form/CaseView.js', 2, 'html-header');
$xmlProcessor = new CRM_Case_XMLProcessor_Process();
- $caseRoles = $xmlProcessor->get($this->_caseType, 'CaseRoles');
- $reports = $xmlProcessor->get($this->_caseType, 'ActivitySets');
+ $caseRoles = $xmlProcessor->get($this->_caseType, 'CaseRoles');
+ $reports = $xmlProcessor->get($this->_caseType, 'ActivitySets');
//adding case manager.CRM-4510.
$managerRoleId = $xmlProcessor->getCaseManagerRoleId($this->_caseType);
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->add('select', 'merge_case_id',
ts('Select Case for Merge'),
array(
- '' => ts('- select case -')) + $otherCases,
+ '' => ts('- select case -'),
+ ) + $otherCases,
FALSE,
array('class' => 'crm-select2 huge')
);
$this->getButtonName('next', 'merge_case'),
ts('Merge'),
array(
- 'class' => 'crm-form-submit-inline hiddenElement',
+ 'class' => 'hiddenElement',
)
);
}
$this->assign('globalGroupInfo', $globalGroupInfo);
// List of relationship types
- $baoRel = new CRM_Contact_BAO_Relationship();
- $relType = $baoRel->getRelationType('Individual');
+ $baoRel = new CRM_Contact_BAO_Relationship();
+ $relType = $baoRel->getRelationType('Individual');
$roleTypes = array();
foreach ($relType as $k => $v) {
$roleTypes[substr($k, 0, strpos($k, '_'))] = $v;
}
/**
- * Process the form
+ * Process the form.
*
* @return void
*/
$session->pushUserContext($url);
if (!empty($params['timeline_id']) && !empty($_POST['_qf_CaseView_next'])) {
- $session = CRM_Core_Session::singleton();
- $this->_uid = $session->get('userID');
- $xmlProcessor = new CRM_Case_XMLProcessor_Process();
+ $session = CRM_Core_Session::singleton();
+ $this->_uid = $session->get('userID');
+ $xmlProcessor = new CRM_Case_XMLProcessor_Process();
$xmlProcessorParams = array(
'clientID' => $this->_contactID,
'creatorID' => $this->_uid,
$reports = $xmlProcessor->get($this->_caseType, 'ActivitySets');
CRM_Core_Session::setStatus(ts('Activities from the %1 activity set have been added to this case.',
- array(1 => $reports[$params['timeline_id']])
+ array(1 => $reports[$params['timeline_id']])
), ts('Done'), 'success');
}
elseif ($this->_mergeCases &&
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));
}
}
+
}