'type' => 'select',
'label' => ts('Followup Activity'),
'attributes' => array(
- '' => '- ' . ts('select activity') . ' -') +
+ '' => '- ' . ts('select activity') . ' -'
+ ) +
CRM_Core_PseudoConstant::ActivityType(FALSE)
),
// Add optional 'Subject' field for the Follow-up Activiity, CRM-4491
//check for required permissions, CRM-6264
if ($this->_activityId &&
in_array($this->_action, array(
- CRM_Core_Action::UPDATE, CRM_Core_Action::VIEW)) &&
+ CRM_Core_Action::UPDATE,
+ CRM_Core_Action::VIEW
+ )) &&
!CRM_Activity_BAO_Activity::checkPermission($this->_activityId, $this->_action)
) {
CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
// Assign pageTitle to be "Activity - "+ activity name
if (isset($activityTName)) {
- $pageTitle = 'Activity - ' . CRM_Utils_Array::value($this->_activityTypeId, $activityTName);
- $this->assign('pageTitle', $pageTitle);
+ $pageTitle = 'Activity - ' . CRM_Utils_Array::value($this->_activityTypeId, $activityTName);
+ $this->assign('pageTitle', $pageTitle);
}
//check the mode when this form is called either single or as
}
if ($this->_context == 'fulltext') {
- $keyName = '&qfKey';
+ $keyName = '&qfKey';
$urlParams = 'force=1';
$urlString = 'civicrm/contact/search/custom';
if ($this->_action == CRM_Core_Action::UPDATE) {
$this->assign('searchKey', $qfKey);
}
elseif (in_array($this->_context, array(
- 'standalone', 'home', 'dashlet', 'dashletFullscreen'))) {
+ 'standalone',
+ 'home',
+ 'dashlet',
+ 'dashletFullscreen'
+ ))
+ ) {
$urlParams = 'reset=1';
$urlString = 'civicrm/dashboard';
}
}
$path = CRM_Utils_System::currentPath();
if ($this->_compContext == 'advanced' ||
- $path == 'civicrm/contact/search/advanced') {
+ $path == 'civicrm/contact/search/advanced'
+ ) {
$urlString = 'civicrm/contact/search/advanced';
}
- else if ($path == 'civicrm/contact/search') {
- $urlString = 'civicrm/contact/search';
- }
else {
- $urlString = 'civicrm/activity/search';
+ if ($path == 'civicrm/contact/search') {
+ $urlString = 'civicrm/contact/search';
+ }
+ else {
+ $urlString = 'civicrm/activity/search';
+ }
}
$this->assign('searchKey', $qfKey);
}
// figure out the file name for activity type, if any
if ($this->_activityTypeId &&
$this->_activityTypeFile =
- CRM_Activity_BAO_Activity::getFileForActivityTypeId($this->_activityTypeId, $this->_crmDir)
+ CRM_Activity_BAO_Activity::getFileForActivityTypeId($this->_activityTypeId, $this->_crmDir)
) {
$this->assign('activityTypeFile', $this->_activityTypeFile);
$this->assign('crmDir', $this->_crmDir);
// if we're editing...
if (isset($this->_activityId)) {
- $defaults['source_contact_qid'] = CRM_Utils_Array::value( 'source_contact_id',
- $defaults );
- $defaults['source_contact_id'] = CRM_Utils_Array::value( 'source_contact',
- $defaults );
+ $defaults['source_contact_qid'] = CRM_Utils_Array::value('source_contact_id',
+ $defaults);
+ $defaults['source_contact_id'] = CRM_Utils_Array::value('source_contact',
+ $defaults);
if (!CRM_Utils_Array::crmIsEmptyArray($defaults['target_contact'])) {
$target_contact_value = explode(';', trim($defaults['target_contact_value']));
$this->assign('current_activity_date_time', $defaults['activity_date_time']);
list($defaults['activity_date_time'],
$defaults['activity_date_time_time']
- ) = CRM_Utils_Date::setDateDefaults($defaults['activity_date_time'], 'activityDateTime');
+ ) = CRM_Utils_Date::setDateDefaults($defaults['activity_date_time'], 'activityDateTime');
}
//set the assigneed contact count to template
$button = ts('Restore');
}
$this->addButtons(array(
- array(
- 'type' => 'next',
- 'name' => $button,
- 'spacing' => ' ',
- 'isDefault' => TRUE
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel')
- )
- ));
+ array(
+ 'type' => 'next',
+ 'name' => $button,
+ 'spacing' => ' ',
+ 'isDefault' => TRUE
+ ),
+ array(
+ 'type' => 'cancel',
+ 'name' => ts('Cancel')
+ )
+ ));
return;
}
//enable form element (ActivityLinks sets this true)
$this->assign('suppressForm', FALSE);
- $element = &$this->add('select', 'activity_type_id', ts('Activity Type'),
+ $element = & $this->add('select', 'activity_type_id', ts('Activity Type'),
$this->_fields['followup_activity_type_id']['attributes'],
FALSE, array(
'onchange' =>
$this->assign('tokenUrl', $tokenUrl);
$admin = CRM_Core_Permission::check('administer CiviCRM');
- //allow to edit sourcecontactfield field if context is civicase.
+ //allow to edit source contact field field if context is civicase.
if ($this->_context == 'caseActivity') {
$admin = TRUE;
}
$this->assign('admin', $admin);
- $sourceContactField = &$this->add($this->_fields['source_contact_id']['type'],
+ $sourceContactField = & $this->add($this->_fields['source_contact_id']['type'],
'source_contact_id',
$this->_fields['source_contact_id']['label'],
NULL,
$this->addButtons($buttons);
}
else {
- $message = array('completed' => ts('Are you sure? This is a COMPLETED activity with the DATE in the FUTURE. Click Cancel to change the date / status. Otherwise, click OK to save.'),
+ $message = array(
+ 'completed' => ts('Are you sure? This is a COMPLETED activity with the DATE in the FUTURE. Click Cancel to change the date / status. Otherwise, click OK to save.'),
'scheduled' => ts('Are you sure? This is a SCHEDULED activity with the DATE in the PAST. Click Cancel to change the date / status. Otherwise, click OK to save.'),
);
$js = array('onclick' => "return activityStatus(" . json_encode($message) . ");");
$this->addFormRule(array('CRM_Activity_Form_Activity', 'formRule'), $this);
if (CRM_Core_BAO_Setting::getItem(
- CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
- 'activity_assignee_notification'
- )
+ CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
+ 'activity_assignee_notification'
+ )
) {
$this->assign('activityAssigneeNotification', TRUE);
}
!CRM_Utils_Array::crmIsEmptyArray($params['target_contact_id'])
) {
$targetContacts = $params['target_contact_id'];
- foreach($targetContacts as $targetContactId) {
+ foreach ($targetContacts as $targetContactId) {
$params['target_contact_id'] = array($targetContactId);
// save activity
$activity[] = $this->processActivity($params);
)
) {
$mailToContacts = array();
- //FIX ME : add more parameters to 'getNames' function
- $assigneeContacts = CRM_Activity_BAO_ActivityContact::getNames($activity->id, $assigneeID, TRUE, FALSE);
+ $assigneeContacts = CRM_Activity_BAO_ActivityContact::getNames($activity->id, $assigneeID);
//build an associative array with unique email addresses.
foreach ($activityAssigned as $id => $dnc) {
}
if (!CRM_Utils_array::crmIsEmptyArray($mailToContacts)) {
- //include attachments while sendig a copy of activity.
+ //include attachments while sending a copy of activity.
$attachments = CRM_Core_BAO_File::getEntityFile('civicrm_activity', $activity->id);
- $ics = new CRM_Activity_BAO_ICalendar( $activity );
- $ics->addAttachment( $attachments, $mailToContacts );
+ $ics = new CRM_Activity_BAO_ICalendar($activity);
+ $ics->addAttachment($attachments, $mailToContacts);
// CRM-8400 add param with _currentlyViewedContactId for URL link in mail
CRM_Case_BAO_Case::sendActivityCopy(NULL, $activity->id, $mailToContacts, $attachments, NULL);