/** * Build all the data structures needed to build the form. */ public function preProcess() { parent::preProcess(); $session = CRM_Core_Session::singleton(); $this->_userContext = $session->readUserContext(); CRM_Utils_System::setTitle(ts('File on Case')); }
/** * Build all the data structures needed to build the form. */ public function preProcess() { CRM_Contact_Form_Task_EmailCommon::preProcessFromAddress($this); parent::preProcess(); // we have all the contribution ids, so now we get the contact ids parent::setContactIDs(); $this->assign('single', $this->_single); }
/** * build all the data structures needed to build the form * * @return void * @access public */ function preProcess() { parent::preProcess(); $rows = array(); // display name and activity details of all selected contacts $activityIDs = implode(',', $this->_activityHolderIds); $query = "\n SELECT at.subject as subject,\n ov.label as activity_type,\n at.activity_date_time as activity_date, \n ct.display_name as display_name\n FROM civicrm_activity at\nINNER JOIN civicrm_contact ct ON ( at.source_contact_id = ct.id ) \n LEFT JOIN civicrm_option_group og ON ( og.name = 'activity_type' )\n LEFT JOIN civicrm_option_value ov ON (at.activity_type_id = ov.value AND og.id = ov.option_group_id ) \n WHERE at.id IN ( {$activityIDs} )"; $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray); while ($dao->fetch()) { $rows[] = array('subject' => $dao->subject, 'activity_type' => $dao->activity_type, 'activity_date' => $dao->activity_date, 'display_name' => $dao->display_name); } $this->assign('rows', $rows); }
/** * build all the data structures needed to build the form * * @return void * @access public */ function preProcess() { /* * initialize the task and row fields */ parent::preProcess(); //get the contact read only fields to display. $readOnlyFields = array_merge(array('sort_name' => ts('Added By'), 'target_sort_name' => ts('With Contact')), CRM_Core_BAO_Setting::valueOptions(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'contact_autocomplete_options', TRUE, NULL, FALSE, 'name', TRUE)); //get the read only field data. $returnProperties = array_fill_keys(array_keys($readOnlyFields), 1); $contactDetails = CRM_Contact_BAO_Contact_Utils::contactDetails($this->_activityHolderIds, 'Activity', $returnProperties); $this->assign('contactDetails', $contactDetails); $this->assign('readOnlyFields', $readOnlyFields); }
/** * Build all the data structures needed to build the form. */ public function preProcess() { parent::preProcess(); $rows = array(); // display name and activity details of all selected contacts $activityIDs = implode(',', $this->_activityHolderIds); $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); $sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); $query = "\n SELECT at.subject as subject,\n ov.label as activity_type,\n at.activity_date_time as activity_date,\n ct.display_name as display_name\n FROM civicrm_activity at\nLEFT JOIN civicrm_activity_contact ac ON ( ac.activity_id = at.id AND ac.record_type_id = {$sourceID} )\nINNER JOIN civicrm_contact ct ON ( ac.contact_id = ct.id )\n LEFT JOIN civicrm_option_group og ON ( og.name = 'activity_type' )\n LEFT JOIN civicrm_option_value ov ON (at.activity_type_id = ov.value AND og.id = ov.option_group_id )\n WHERE at.id IN ( {$activityIDs} )"; $dao = CRM_Core_DAO::executeQuery($query); while ($dao->fetch()) { $rows[] = array('subject' => $dao->subject, 'activity_type' => $dao->activity_type, 'activity_date' => $dao->activity_date, 'display_name' => $dao->display_name); } $this->assign('rows', $rows); }
/** * build all the data structures needed to build the form * * @return void * @access public */ function preProcess() { /* * initialize the task and row fields */ parent::preProcess(); //get the contact read only fields to display. require_once 'CRM/Core/BAO/Preferences.php'; $readOnlyFields = array_merge(array('sort_name' => ts('Name')), CRM_Core_BAO_Preferences::valueOptions('contact_autocomplete_options', true, null, false, 'name', true)); //get the read only field data. $returnProperties = array_fill_keys(array_keys($readOnlyFields), 1); require_once 'CRM/Contact/BAO/Contact/Utils.php'; $contactDetails = CRM_Contact_BAO_Contact_Utils::contactDetails($this->_activityHolderIds, 'Activity', $returnProperties); $this->assign('contactDetails', $contactDetails); $this->assign('readOnlyFields', $readOnlyFields); }
/** * build all the data structures needed to build the form * * @return void * @access public */ function preProcess() { /* * initialize the task and row fields */ parent::preProcess(); $session = CRM_Core_Session::singleton(); $this->_userContext = $session->readUserContext(); CRM_Utils_System::setTitle(ts('File on Case')); $validationFailed = FALSE; // insert validations here // then redirect if ($validationFailed) { CRM_Utils_System::redirect($this->_userContext); } }
/** * Build all the data structures needed to build the form. */ public function preProcess() { // initialize the task and row fields. parent::preProcess(); $session = CRM_Core_Session::singleton(); $this->_userContext = $session->readUserContext(); CRM_Utils_System::setTitle(ts('Send Email to Contacts')); $validate = FALSE; //validations if (count($this->_activityHolderIds) > $this->_maxActivities) { CRM_Core_Session::setStatus(ts("The maximum number of Activities you can select to send an email is %1. You have selected %2. Please select fewer Activities from your search results and try again.", array(1 => $this->_maxActivities, 2 => count($this->_activityHolderIds))), ts("Maximum Exceeded"), "error"); $validate = TRUE; } // then redirect if ($validate) { CRM_Utils_System::redirect($this->_userContext); } }
/** * build all the data structures needed to build the form * * @return void * @access public */ function preProcess() { /* * initialize the task and row fields */ parent::preProcess(); $session = CRM_Core_Session::singleton(); $this->_userContext = $session->readUserContext(); CRM_Utils_System::setTitle(ts('Batch Profile Update for Activities')); $validate = FALSE; //validations if (count($this->_activityHolderIds) > $this->_maxActivities) { CRM_Core_Session::setStatus(ts("The maximum number of Activities you can select for Batch Update is %1. You have selected %2. Please select fewer Activities from your search results and try again.", array(1 => $this->_maxActivities, 2 => count($this->_activityHolderIds))), ts('Maximum Exceeded'), 'error'); $validate = TRUE; } // than redirect if ($validate) { CRM_Utils_System::redirect($this->_userContext); } }
/** * build all the data structures needed to build the form * * @return void * @access public */ function preProcess() { /* * initialize the task and row fields */ parent::preProcess(); $session = CRM_Core_Session::singleton(); $this->_userContext = $session->readUserContext(); CRM_Utils_System::setTitle(ts('Send Email to Contacts')); $validate = false; //validations if (count($this->_activityHolderIds) > $this->_maxActivities) { CRM_Core_Session::setStatus("The maximum number of Activities you can select to send an email is {$this->_maxActivities}. You have selected " . count($this->_activityHolderIds) . ". Please select fewer Activities from your search results and try again."); $validate = true; } if ($validate) { // then redirect CRM_Utils_System::redirect($this->_userContext); } }
/** * Build all the data structures needed to build the form. */ public function preProcess() { // Initialize the task and row fields. parent::preProcess(); // Get the contact read only fields to display. $readOnlyFields = array_merge(array('sort_name' => ts('Added By'), 'target_sort_name' => ts('With Contact')), CRM_Core_BAO_Setting::valueOptions(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'contact_autocomplete_options', TRUE, NULL, FALSE, 'name', TRUE)); // Get the read only field data. $returnProperties = array_fill_keys(array_keys($readOnlyFields), 1); $contactDetails = CRM_Contact_BAO_Contact_Utils::contactDetails($this->_activityHolderIds, 'Activity', $returnProperties); $readOnlyFields['assignee_display_name'] = ts('Assigned to'); if (!empty($contactDetails)) { foreach ($contactDetails as $key => $value) { $assignee = CRM_Activity_BAO_ActivityAssignment::retrieveAssigneeIdsByActivityId($key); foreach ($assignee as $keys => $values) { $assigneeContact[] = CRM_Contact_BAO_Contact::displayname($values); } $contactDetails[$key]['assignee_display_name'] = !empty($assigneeContact) ? implode(';', $assigneeContact) : NULL; } } $this->assign('contactDetails', $contactDetails); $this->assign('readOnlyFields', $readOnlyFields); }
/** * build all the data structures needed to build the form * * @return void * @access public */ function preProcess() { parent::preProcess(); }
/** * build all the data structures needed to build the form * * @return void * @access public */ function preProcess() { parent::preProcess(); CRM_Contact_Form_Task_SMSCommon::preProcessProvider($this); $this->assign('single', $this->_single); }