/** * Set variables up before form is built. * * @return void */ public function preProcess() { $this->_addProfileBottom = CRM_Utils_Array::value('addProfileBottom', $_GET, FALSE); $this->_profileBottomNum = CRM_Utils_Array::value('addProfileNum', $_GET, 0); $this->_addProfileBottomAdd = CRM_Utils_Array::value('addProfileBottomAdd', $_GET, FALSE); $this->_profileBottomNumAdd = CRM_Utils_Array::value('addProfileNumAdd', $_GET, 0); parent::preProcess(); $this->assign('addProfileBottom', $this->_addProfileBottom); $this->assign('profileBottomNum', $this->_profileBottomNum); $urlParams = "id={$this->_id}&addProfileBottom=1&qfKey={$this->controller->_key}"; $this->assign('addProfileParams', $urlParams); if ($addProfileBottom = CRM_Utils_Array::value('custom_post_id_multiple', $_POST)) { foreach (array_keys($addProfileBottom) as $profileNum) { self::buildMultipleProfileBottom($this, $profileNum); } } $this->assign('addProfileBottomAdd', $this->_addProfileBottomAdd); $this->assign('profileBottomNumAdd', $this->_profileBottomNumAdd); $urlParamsAdd = "id={$this->_id}&addProfileBottomAdd=1&qfKey={$this->controller->_key}"; $this->assign('addProfileParamsAdd', $urlParamsAdd); if ($addProfileBottomAdd = CRM_Utils_Array::value('additional_custom_post_id_multiple', $_POST)) { foreach (array_keys($addProfileBottomAdd) as $profileNum) { self::buildMultipleProfileBottom($this, $profileNum, 'additional_', ts('Profile for Additional Participants')); } } }
/** * Function to set variables up before form is built * * @return void * @access public */ function preProcess() { parent::preProcess(); $newReminder = CRM_Utils_Request::retrieve('new', 'Boolean', $this, FALSE, FALSE); if ($this->_action & CRM_Core_Action::UPDATE && !$newReminder) { $field = 'civicrm_event'; if ($this->_isTemplate) { $field = 'event_template'; } $reminderList = CRM_Core_BAO_ActionSchedule::getList(FALSE, $field, $this->_id); if ($reminderList && is_array($reminderList)) { // Add action links to each of the reminders foreach ($reminderList as &$format) { $action = CRM_Core_Action::UPDATE + CRM_Core_Action::DELETE; if ($format['is_active']) { $action += CRM_Core_Action::DISABLE; } else { $action += CRM_Core_Action::ENABLE; } $links = CRM_Admin_Page_ScheduleReminders::links(); $links[CRM_Core_Action::DELETE]['qs'] .= "&context=event&eventId={$this->_id}"; $links[CRM_Core_Action::UPDATE]['qs'] .= "&context=event&eventId={$this->_id}"; $format['action'] = CRM_Core_Action::formLink($links, $action, array('id' => $format['id']), ts('more'), FALSE, 'event.reminder.list', 'Event', $this->_id); } } else { $reminderList = TRUE; } $this->assign('rows', $reminderList); // Update tab "disabled" css class $this->ajaxResponse['tabValid'] = !empty($reminderList) && is_array($reminderList); } }
/** * Set variables up before form is built. * * @return void */ public function preProcess() { parent::preProcess(); $setTab = CRM_Utils_Request::retrieve('setTab', 'Int', $this, FALSE, 0); $mapping = CRM_Utils_Array::first(CRM_Core_BAO_ActionSchedule::getMappings(array('id' => $this->_isTemplate ? CRM_Event_ActionMapping::EVENT_TPL_MAPPING_ID : CRM_Event_ActionMapping::EVENT_NAME_MAPPING_ID))); $reminderList = CRM_Core_BAO_ActionSchedule::getList(FALSE, $mapping, $this->_id); if ($reminderList && is_array($reminderList)) { // Add action links to each of the reminders foreach ($reminderList as &$format) { $action = CRM_Core_Action::UPDATE + CRM_Core_Action::DELETE; if ($format['is_active']) { $action += CRM_Core_Action::DISABLE; } else { $action += CRM_Core_Action::ENABLE; } $scheduleReminder = new CRM_Admin_Page_ScheduleReminders(); $links = $scheduleReminder->links(); $links[CRM_Core_Action::DELETE]['qs'] .= "&context=event&compId={$this->_id}"; $links[CRM_Core_Action::UPDATE]['qs'] .= "&context=event&compId={$this->_id}"; $format['action'] = CRM_Core_Action::formLink($links, $action, array('id' => $format['id']), ts('more'), FALSE, 'actionSchedule.manage.action', 'ActionSchedule', $this->_id); } } $this->assign('rows', $reminderList); $this->assign('setTab', $setTab); $this->assign('component', 'event'); // Update tab "disabled" css class $this->ajaxResponse['tabValid'] = is_array($reminderList) && count($reminderList) > 0; $this->setPageTitle(ts('Scheduled Reminder')); }
/** * Function to set variables up before form is built * * @return void * @access public */ function preProcess() { //custom data related code $this->_cdType = CRM_Utils_Array::value('type', $_GET); $this->assign('cdType', false); if ($this->_cdType) { $this->assign('cdType', true); return CRM_Custom_Form_CustomData::preProcess($this); } parent::preProcess(); if ($this->_id) { $this->assign('entityID', $this->_id); $eventType = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $this->_id, 'event_type_id'); } else { $eventType = 'null'; } $showLocation = false; // when custom data is included in this page if (CRM_Utils_Array::value("hidden_custom", $_POST)) { $this->set('type', 'Event'); $this->set('subType', CRM_Utils_Array::value('event_type_id', $_POST)); $this->set('entityId', $this->_id); CRM_Custom_Form_Customdata::preProcess($this); CRM_Custom_Form_Customdata::buildQuickForm($this); CRM_Custom_Form_Customdata::setDefaultValues($this); } }
/** * Set variables up before form is built. * * @return void */ public function preProcess() { $this->_addProfileBottom = CRM_Utils_Array::value('addProfileBottom', $_GET, FALSE); $this->_profileBottomNum = CRM_Utils_Array::value('addProfileNum', $_GET, 0); $this->_addProfileBottomAdd = CRM_Utils_Array::value('addProfileBottomAdd', $_GET, FALSE); $this->_profileBottomNumAdd = CRM_Utils_Array::value('addProfileNumAdd', $_GET, 0); parent::preProcess(); $this->assign('addProfileBottom', $this->_addProfileBottom); $this->assign('profileBottomNum', $this->_profileBottomNum); $urlParams = "id={$this->_id}&addProfileBottom=1&qfKey={$this->controller->_key}"; $this->assign('addProfileParams', $urlParams); if ($addProfileBottom = CRM_Utils_Array::value('custom_post_id_multiple', $_POST)) { foreach (array_keys($addProfileBottom) as $profileNum) { self::buildMultipleProfileBottom($this, $profileNum); } } $this->assign('perm', 0); $ufGroups = CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFField', 'uf_group_id'); $ufCreate = CRM_ACL_API::group(CRM_Core_Permission::CREATE, NULL, 'civicrm_uf_group', $ufGroups); $ufEdit = CRM_ACL_API::group(CRM_Core_Permission::EDIT, NULL, 'civicrm_uf_group', $ufGroups); $checkPermission = array(array('administer CiviCRM', 'manage event profiles')); if (CRM_Core_Permission::check($checkPermission) || !empty($ufCreate) || !empty($ufEdit)) { $this->assign('perm', 1); } $this->assign('addProfileBottomAdd', $this->_addProfileBottomAdd); $this->assign('profileBottomNumAdd', $this->_profileBottomNumAdd); $urlParamsAdd = "id={$this->_id}&addProfileBottomAdd=1&qfKey={$this->controller->_key}"; $this->assign('addProfileParamsAdd', $urlParamsAdd); if ($addProfileBottomAdd = CRM_Utils_Array::value('additional_custom_post_id_multiple', $_POST)) { foreach (array_keys($addProfileBottomAdd) as $profileNum) { self::buildMultipleProfileBottom($this, $profileNum, 'additional_', ts('Profile for Additional Participants')); } } }
/** * Function to set variables up before form is built * * @access public */ public function preProcess() { parent::preProcess(); $unmet = CRM_Volunteer_Upgrader::checkExtensionDependencies(); if (in_array('com.ginkgostreet.multiform', $unmet)) { $msg = CRM_Volunteer_Upgrader::getUnmetDependencyErrorMessage('com.ginkgostreet.multiform'); $this->assign('msg', $msg); } $this->assign('isModulePermissionSupported', CRM_Core_Config::singleton()->userPermissionClass->isModulePermissionSupported()); }
/** * Set variables up before form is built. * * @return void */ public function preProcess() { parent::preProcess(); if ($this->_isTemplate) { $this->_title = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $this->_id, 'template_title'); } else { $this->_title = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $this->_id, 'title'); } if (!CRM_Event_BAO_Event::checkPermission($this->_id, CRM_Core_Permission::DELETE)) { CRM_Core_Error::fatal(ts('You do not have permission to access this page.')); } }
/** * Function to set variables up before form is built * * @return void * @access public */ public function preProcess() { parent::preProcess(); //check for delete if (!CRM_Core_Permission::checkActionPermission('CiviEvent', $this->_action)) { CRM_Core_Error::fatal(ts('You do not have permission to access this page')); } if ($this->_isTemplate) { $this->_title = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $this->_id, 'template_title'); } else { $this->_title = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $this->_id, 'title'); } }
/** * Function to set variables up before form is built * * @return void * @access public */ function preProcess() { parent::preProcess(); $this->_values = $this->get('values'); if ($this->_id && empty($this->_values)) { //get location values. $params = array('entity_id' => $this->_id, 'entity_table' => 'civicrm_event'); $this->_values = CRM_Core_BAO_Location::getValues($params); //get event values. $params = array('id' => $this->_id); CRM_Event_BAO_Event::retrieve($params, $this->_values); $this->set('values', $this->_values); } //location blocks. CRM_Contact_Form_Location::preProcess($this); }
/** * Set variables up before form is built. */ public function preProcess() { parent::preProcess(); if ($this->_id) { $this->assign('entityID', $this->_id); $eventType = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $this->_id, 'event_type_id'); } else { $eventType = 'null'; } $showLocation = FALSE; // when custom data is included in this page if (!empty($_POST['hidden_custom'])) { $this->set('type', 'Event'); $this->set('subType', CRM_Utils_Array::value('event_type_id', $_POST)); $this->set('entityId', $this->_id); CRM_Custom_Form_CustomData::preProcess($this, NULL, $this->_eventType, 1, 'Event', $this->_id); CRM_Custom_Form_CustomData::buildQuickForm($this); CRM_Custom_Form_CustomData::setDefaultValues($this); } }
public function preProcess() { parent::preProcess(); $this->assign('currentEventId', $this->_id); $checkParentExistsForThisId = CRM_Core_BAO_RecurringEntity::getParentFor($this->_id, 'civicrm_event'); //If this ID has parent, send parent id if ($checkParentExistsForThisId) { /** * Get connected event information list */ //Get all connected event ids $allEventIdsArray = CRM_Core_BAO_RecurringEntity::getEntitiesForParent($checkParentExistsForThisId, 'civicrm_event'); $allEventIds = array(); if (!empty($allEventIdsArray)) { foreach ($allEventIdsArray as $key => $val) { $allEventIds[] = $val['id']; } if (!empty($allEventIds)) { $params = array(); $query = "\n SELECT *\n FROM civicrm_event\n WHERE id IN (" . implode(",", $allEventIds) . ")\n ORDER BY start_date asc\n "; $dao = CRM_Core_DAO::executeQuery($query, $params, TRUE, 'CRM_Event_DAO_Event'); $permissions = CRM_Event_BAO_Event::checkPermission(); while ($dao->fetch()) { if (in_array($dao->id, $permissions[CRM_Core_Permission::VIEW])) { $manageEvent[$dao->id] = array(); CRM_Core_DAO::storeValues($dao, $manageEvent[$dao->id]); } } } $this->assign('rows', $manageEvent); } } $parentEventParams = array('id' => $this->_id); $parentEventValues = array(); $parentEventReturnProperties = array('start_date', 'end_date'); $parentEventAttributes = CRM_Core_DAO::commonRetrieve('CRM_Event_DAO_Event', $parentEventParams, $parentEventValues, $parentEventReturnProperties); $this->_parentEventStartDate = $parentEventAttributes->start_date; $this->_parentEventEndDate = $parentEventAttributes->end_date; }
/** * Function to set variables up before form is built * * @return void * @access public */ function preProcess() { parent::preProcess(); $newReminder = CRM_Utils_Request::retrieve('new', 'Boolean', $this, FALSE, FALSE); if ($this->_action & CRM_Core_Action::UPDATE && !$newReminder) { $reminderList = CRM_Core_BAO_ActionSchedule::getList(FALSE, 'civicrm_event', $this->_id); if (is_array($reminderList)) { // Add action links to each of the reminders foreach ($reminderList as &$format) { $action = CRM_Core_Action::UPDATE + CRM_Core_Action::DELETE; if ($format['is_active']) { $action += CRM_Core_Action::DISABLE; } else { $action += CRM_Core_Action::ENABLE; } $links = CRM_Admin_Page_ScheduleReminders::links(); $links[CRM_Core_Action::DELETE]['qs'] .= "&context=event&eventId={$this->_id}"; $links[CRM_Core_Action::UPDATE]['qs'] .= "&context=event&eventId={$this->_id}"; $format['action'] = CRM_Core_Action::formLink($links, $action, array('id' => $format['id'])); } $this->assign('rows', $reminderList); } } }
/** * Set variables up before form is built. */ public function preProcess() { parent::preProcess(); }
/** * Set variables up before form is built. * * @return void */ public function preProcess() { CRM_Core_Resources::singleton()->addStyleFile('org.civicrm.webtracking', 'css/web-tracking-form.css'); parent::preProcess(); }
/** * set variables up before form is built * * @access public */ public function preProcess() { parent::preProcess(); /*// Retrieve the profile IDs associated with the project; if none exist, // create a dummy using CiviVolunteer's built-in profile. Note: this is // necessary to ensure backwards compatibility with versions pre-dating the // profile selection widget. // Prior to php 5.5 you must store to a var before testing for empty // http://joomla.stackexchange.com/questions/5565/fatal-error-cant-use-method-return-value-in-write-context // hence re-instating the extra line of code $profileIDs = $this->getProfileIDS(); if (empty($profileIDS)) { $this->_profile_ids[] = civicrm_api3('UFGroup', 'getvalue', array( 'name' => 'volunteer_sign_up', 'return' => 'id', )); }*/ }
/** * Set variables up before form is built. * * @return void */ public function preProcess() { if ($this->isLoadingTabContent()) { $this->loadAngular = TRUE; $project = $this->getProject(); if (!$project) { $project = $this->initializeProject(); } $entity = $project->getEntityAttributes(); $entityTitle = $entity['title']; CRM_Core_Resources::singleton()->addVars('org.civicrm.volunteer', array("hash" => "#/volunteer/manage/" . $project->id, "projectId" => $project->id, "entityTable" => $project->entity_table, "entityId" => $project->entity_id, "entityTitle" => $entityTitle, "context" => 'eventTab')); } else { parent::preProcess(); } }