<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
/**
* Function to build the form
*
- * @return None
+ * @return void
* @access public
*/
function preProcess() {
}
}
- if ($this->_currentlyViewedContactId) {
- CRM_Contact_Page_View::setTitle($this->_currentlyViewedContactId);
- }
-
$session = CRM_Core_Session::singleton();
$session->pushUserContext($url);
}
*
* @access public
*
- * @return None
+ * @return void
*/
function setDefaultValues() {
$this->_defaults = parent::setDefaultValues();
public function buildQuickForm() {
$this->_fields['source_contact_id']['label'] = ts('Reported By');
- $this->_fields['status_id']['attributes'] = array('' => ts('- select -')) + CRM_Core_PseudoConstant::activityStatus();
+ unset($this->_fields['status_id']['attributes']['required']);
if ($this->_caseType) {
$xmlProcessor = new CRM_Case_XMLProcessor_Process();
$this->assign('urlPath', 'civicrm/case/activity');
$encounterMediums = CRM_Case_PseudoConstant::encounterMedium();
+ // Fixme: what's the justification for this? It seems like it is just re-adding an option in case it is the default and disabled.
+ // Is that really a big problem?
if ($this->_activityTypeFile == 'OpenCase') {
$this->_encounterMedium = CRM_Core_DAO::getFieldValue('CRM_Activity_DAO_Activity', $this->_activityId,
'medium_id'
$this->addGroup($checkBoxes, 'contact_check');
$this->addElement('checkbox', 'toggleSelect', NULL, NULL,
- array('onclick' => "return toggleCheckboxVals('contact_check',this);")
+ array('class' => 'select-rows')
);
$this->assign('searchRows', $this->_relatedContacts);
}
*
* @access public
*
- * @return None
+ * @return void
*/
public function postProcess($params = NULL) {
$transaction = new CRM_Core_Transaction();
// store the submitted values in an array
$params = $this->controller->exportValues($this->_name);
- if ($params['source_contact_id']) {
- $params['source_contact_id'] = $params['source_contact_qid'];
- }
//set parent id if its edit mode
if ($parentId = CRM_Utils_Array::value('parent_id', $this->_defaults)) {
}
// format activity custom data
- if (CRM_Utils_Array::value('hidden_custom', $params)) {
+ if (!empty($params['hidden_custom'])) {
if ($this->_activityId) {
// unset custom fields-id from params since we want custom
// fields to be saved for new activity.
}
// assigning formatted value
- if (CRM_Utils_Array::value('assignee_contact_id', $params)) {
+ if (!empty($params['assignee_contact_id'])) {
$params['assignee_contact_id'] = explode(',', $params['assignee_contact_id']);
}
else {
// have been modified/created by user
if (isset($newActParams)) {
// set proper original_id
- if (CRM_Utils_Array::value('original_id', $this->_defaults)) {
+ if (!empty($this->_defaults['original_id'])) {
$newActParams['original_id'] = $this->_defaults['original_id'];
}
else {
// copy files attached to old activity if any, to new one,
// as long as users have not selected the 'delete attachment' option.
- if (!CRM_Utils_Array::value('is_delete_attachment', $newActParams)) {
+ if (empty($newActParams['is_delete_attachment'])) {
CRM_Core_BAO_File::copyEntityFile('civicrm_activity', $this->_activityId,
'civicrm_activity', $activity->id
);
$caseParams = $params;
$caseParams['id'] = $this->_caseId;
- if (CRM_Utils_Array::value('case_type_id', $caseParams)) {
+ if (!empty($caseParams['case_type_id'])) {
$caseParams['case_type_id'] = CRM_Core_DAO::VALUE_SEPARATOR . $caseParams['case_type_id'] . CRM_Core_DAO::VALUE_SEPARATOR;
}
- if (CRM_Utils_Array::value('case_status_id', $caseParams)) {
+ if (!empty($caseParams['case_status_id'])) {
$caseParams['status_id'] = $caseParams['case_status_id'];
}
$mailStatus = ts("A copy of the activity has also been sent to selected contacts(s).");
}
else {
- $this->_relatedContacts = CRM_Activity_BAO_ActivityAssignment::getAssigneeNames($activity->id, TRUE, FALSE);
+ $this->_relatedContacts = CRM_Activity_BAO_ActivityAssignment::getAssigneeNames(array($activity->id), TRUE, FALSE);
$mailStatus .= ' ' . ts("A copy of the activity has also been sent to assignee contacts(s).");
}
// create follow up activity if needed
$followupStatus = '';
- if (CRM_Utils_Array::value('followup_activity_type_id', $params)) {
+ if (!empty($params['followup_activity_type_id'])) {
$followupActivity = CRM_Activity_BAO_Activity::createFollowupActivity($activity->id, $params);
if ($followupActivity) {