function preProcess() { parent::preProcess(); $session = CRM_Core_Session::singleton(); $url = CRM_Utils_System::url('civicrm/eventcalendarsettings'); $session->pushUserContext($url); }
function preProcess() { parent::preProcess(); CRM_Utils_System::setTitle(ts('Settings - Resource Configuration Option')); $this->_sid = CRM_Utils_Request::retrieve('sid', 'Positive', $this, FALSE, 0); $this->assign('sid', $this->_sid); }
public function preProcess() { parent::preProcess(); // set the usercontext $session = CRM_Core_Session::singleton(); $session->replaceUserContext(CRM_Utils_System::url('civicrm/batch', "reset=1")); }
/** * For pre-processing * * @return void */ public function preProcess() { parent::preProcess(); $this->_key = CRM_Utils_Request::retrieve('key', 'String', $this, FALSE, 0); $session = CRM_Core_Session::singleton(); $url = CRM_Utils_System::url('civicrm/admin/extensions', 'reset=1&action=browse'); $session->pushUserContext($url); $this->assign('id', $this->_id); $this->assign('key', $this->_key); switch ($this->_action) { case CRM_Core_Action::ADD: case CRM_Core_Action::DELETE: case CRM_Core_Action::ENABLE: case CRM_Core_Action::DISABLE: $info = CRM_Extension_System::singleton()->getMapper()->keyToInfo($this->_key); $extInfo = CRM_Admin_Page_Extensions::createExtendedInfo($info); $this->assign('extension', $extInfo); break; case CRM_Core_Action::UPDATE: if (!CRM_Extension_System::singleton()->getBrowser()->isEnabled()) { CRM_Core_Error::fatal(ts('The system administrator has disabled this feature.')); } $info = CRM_Extension_System::singleton()->getBrowser()->getExtension($this->_key); $extInfo = CRM_Admin_Page_Extensions::createExtendedInfo($info); $this->assign('extension', $extInfo); break; default: CRM_Core_Error::fatal(ts('Unsupported action')); } }
/** * Function to pre-process * * @return None * @access public */ public function preProcess() { parent::preProcess(); $session =& CRM_Core_Session::singleton(); if (!$this->_gName) { $this->_gName = CRM_Utils_Request::retrieve('group', 'String', $this, false, 0); $this->_gid = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', $this->_gName, 'id', 'name'); } if ($this->_gName) { $this->set('gName', $this->_gName); } else { $this->_gName = $this->get('gName'); } $this->_GName = ucwords(str_replace('_', ' ', $this->_gName)); $url = "civicrm/admin/options/{$this->_gName}"; $params = "group={$this->_gName}&reset=1"; $session->pushUserContext(CRM_Utils_System::url($url, $params)); $this->assign('id', $this->_id); require_once 'CRM/Core/OptionGroup.php'; if ($this->_id && in_array($this->_gName, CRM_Core_OptionGroup::$_domainIDGroups)) { $domainID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', $this->_id, 'domain_id', 'id'); if (CRM_Core_Config::domainID() != $domainID) { CRM_Core_Error::fatal(ts('You do not have permission to access this page')); } } }
/** * Function to build the form * * @return None * @access public */ public function preProcess() { parent::preProcess(); $mapping = new CRM_Core_DAO_Mapping(); $mapping->id = $this->_id; $mapping->find(TRUE); $this->assign('mappingName', $mapping->name); }
public function preProcess() { $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this); $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'add'); $this->assign('action', $this->_action); $this->_BAOName = 'CRM_Core_BAO_MessageTemplate'; $this->set('BAOName', $this->_BAOName); parent::preProcess(); }
public function preProcess() { parent::preProcess(); CRM_Utils_System::setTitle(ts('Manage - Scheduled Jobs')); if ($this->_id) { $refreshURL = CRM_Utils_System::url('civicrm/admin/job', "reset=1&action=update&id={$this->_id}", FALSE, NULL, FALSE); } else { $refreshURL = CRM_Utils_System::url('civicrm/admin/job', "reset=1&action=add", FALSE, NULL, FALSE); } $this->assign('refreshURL', $refreshURL); }
public function preProcess() { parent::preProcess(); CRM_Utils_System::setTitle(ts('Query Runner')); if ($this->_id) { $refreshURL = CRM_Utils_System::url('civicrm/query-runner', "reset=1&action=update&id={$this->_id}", FALSE, NULL, FALSE); } else { $refreshURL = CRM_Utils_System::url('civicrm/query-runner', "reset=1&action=add", FALSE, NULL, FALSE); } $this->assign('refreshURL', $refreshURL); }
/** * Function to for pre-processing * * @return None * @access public */ public function preProcess() { parent::preProcess(); $this->_key = CRM_Utils_Request::retrieve('key', 'String', $this, FALSE, 0); $session = CRM_Core_Session::singleton(); $url = CRM_Utils_System::url('civicrm/admin/extensions', 'reset=1&action=browse'); $session->pushUserContext($url); $this->assign('id', $this->_id); $this->assign('key', $this->_key); $ext = new CRM_Core_Extensions(); $extension = $ext->getExtensions(); $this->assign('extension', get_object_vars($extension[$this->_key])); }
/** * Function to for pre-processing * * @return None * @access public */ public function preProcess() { parent::preProcess(); require_once 'CRM/Utils/Request.php'; $this->_gid = CRM_Utils_Request::retrieve('gid', 'Positive', $this, false, 0); //get optionGroup name in case of email/postal greeting or addressee, CRM-4575 if (!empty($this->_gid)) { $this->_gName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', $this->_gid, 'name'); } $session =& CRM_Core_Session::singleton(); $url = CRM_Utils_System::url('civicrm/admin/optionValue', 'reset=1&action=browse&gid=' . $this->_gid); $session->pushUserContext($url); $this->assign('id', $this->_id); }
public function preProcess() { if (!CRM_Core_Permission::check('administer payment processors')) { CRM_Core_Error::statusBounce('The \'administer payment processors\' permission is required to add or edit a payment processor.'); } parent::preProcess(); CRM_Utils_System::setTitle(ts('Settings - Payment Processor')); // get the payment processor meta information if ($this->_id) { $this->_ppType = CRM_Utils_Request::retrieve('pp', 'String', $this, FALSE, NULL); if (!$this->_ppType) { $this->_ppType = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_PaymentProcessor', $this->_id, 'payment_processor_type_id'); } $this->set('pp', $this->_ppType); } else { $this->_ppType = CRM_Utils_Request::retrieve('pp', 'String', $this, TRUE, NULL); } $this->assign('ppType', $this->_ppType); $ppTypeName = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_PaymentProcessorType', $this->_ppType, 'name'); $this->assign('ppTypeName', $ppTypeName); $this->_ppDAO = new CRM_Financial_DAO_PaymentProcessorType(); $this->_ppDAO->id = $this->_ppType; if (!$this->_ppDAO->find(TRUE)) { CRM_Core_Error::fatal(ts('Could not find payment processor meta information')); } if ($this->_id) { $refreshURL = CRM_Utils_System::url('civicrm/admin/paymentProcessor', "reset=1&action=update&id={$this->_id}", FALSE, NULL, FALSE); } else { $refreshURL = CRM_Utils_System::url('civicrm/admin/paymentProcessor', "reset=1&action=add", FALSE, NULL, FALSE); } //CRM-4129 $destination = CRM_Utils_Request::retrieve('civicrmDestination', 'String', $this); if ($destination) { $destination = urlencode($destination); $refreshURL .= "&civicrmDestination={$destination}"; } $this->assign('refreshURL', $refreshURL); $this->assign('is_recur', $this->_ppDAO->is_recur); $this->_fields = array(array('name' => 'user_name', 'label' => $this->_ppDAO->user_name_label), array('name' => 'password', 'label' => $this->_ppDAO->password_label), array('name' => 'signature', 'label' => $this->_ppDAO->signature_label), array('name' => 'subject', 'label' => $this->_ppDAO->subject_label), array('name' => 'url_site', 'label' => ts('Site URL'), 'rule' => 'url', 'msg' => ts('Enter a valid URL'))); if ($this->_ppDAO->is_recur) { $this->_fields[] = array('name' => 'url_recur', 'label' => ts('Recurring Payments URL'), 'rule' => 'url', 'msg' => ts('Enter a valid URL')); } if (!empty($this->_ppDAO->url_button_default)) { $this->_fields[] = array('name' => 'url_button', 'label' => ts('Button URL'), 'rule' => 'url', 'msg' => ts('Enter a valid URL')); } if (!empty($this->_ppDAO->url_api_default)) { $this->_fields[] = array('name' => 'url_api', 'label' => ts('API URL'), 'rule' => 'url', 'msg' => ts('Enter a valid URL')); } }
function preProcess() { parent::preProcess(); CRM_Utils_System::setTitle(ts('Settings - Payment Processor')); // get the payment processor meta information if ($this->_id) { $this->_ppType = CRM_Utils_Request::retrieve('pp', 'String', $this, false, null); if (!$this->_ppType) { $this->_ppType = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_PaymentProcessor', $this->_id, 'payment_processor_type'); } $this->set('pp', $this->_ppType); } else { $this->_ppType = CRM_Utils_Request::retrieve('pp', 'String', $this, true, null); } $this->assign('ppType', $this->_ppType); require_once 'CRM/Core/DAO/PaymentProcessorType.php'; $this->_ppDAO =& new CRM_Core_DAO_PaymentProcessorType(); $this->_ppDAO->name = $this->_ppType; if (!$this->_ppDAO->find(true)) { CRM_Core_Error::fatal(ts('Could not find payment processor meta information')); } if ($this->_id) { $refreshURL = CRM_Utils_System::url('civicrm/admin/paymentProcessor', "reset=1&action=update&id={$this->_id}", false, null, false); } else { $refreshURL = CRM_Utils_System::url('civicrm/admin/paymentProcessor', "reset=1&action=add", false, null, false); } //CRM-4129 $destination = CRM_Utils_Request::retrieve('destination', 'String', $this); if ($destination) { $destination = urlencode($destination); $refreshURL .= "&destination={$destination}"; } $this->assign('refreshURL', $refreshURL); $this->assign('is_recur', $this->_ppDAO->is_recur); $this->_fields = array(array('name' => 'user_name', 'label' => $this->_ppDAO->user_name_label), array('name' => 'password', 'label' => $this->_ppDAO->password_label), array('name' => 'signature', 'label' => $this->_ppDAO->signature_label), array('name' => 'subject', 'label' => $this->_ppDAO->subject_label), array('name' => 'url_site', 'label' => ts('Site URL'), 'rule' => 'url', 'msg' => ts('Enter a valid URL'))); if ($this->_ppDAO->is_recur) { $this->_fields[] = array('name' => 'url_recur', 'label' => ts('Recurring Payments URL'), 'rule' => 'url', 'msg' => ts('Enter a valid URL')); } if (!empty($this->_ppDAO->url_button_default)) { $this->_fields[] = array('name' => 'url_button', 'label' => ts('Button URL'), 'rule' => 'url', 'msg' => ts('Enter a valid URL')); } if (!empty($this->_ppDAO->url_api_default)) { $this->_fields[] = array('name' => 'url_api', 'label' => ts('API URL'), 'rule' => 'url', 'msg' => ts('Enter a valid URL')); } }
/** * Function to pre-process * * @return None * @access public */ public function preProcess() { parent::preProcess(); $session =& CRM_Core_Session::singleton(); if (!$this->_gName) { $this->_gName = CRM_Utils_Request::retrieve('group', 'String', $this, false, 0); $this->_gid = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', $this->_gName, 'id', 'name'); } if ($this->_gName) { $this->set('gName', $this->_gName); } else { $this->_gName = $this->get('gName'); } $this->_GName = ucwords(str_replace('_', ' ', $this->_gName)); $url = "civicrm/admin/options/{$this->_gName}"; $params = "group={$this->_gName}&reset=1"; $session->pushUserContext(CRM_Utils_System::url($url, $params)); $this->assign('id', $this->_id); }
/** * Function to for pre-processing * * @return None * @access public */ public function preProcess() { parent::preProcess(); $this->_gid = CRM_Utils_Request::retrieve('gid', 'Positive', $this, FALSE, 0); //get optionGroup name in case of email/postal greeting or addressee, CRM-4575 if (!empty($this->_gid)) { $this->_gName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', $this->_gid, 'name'); } $session = CRM_Core_Session::singleton(); $url = CRM_Utils_System::url('civicrm/admin/optionValue', 'reset=1&action=browse&gid=' . $this->_gid); $session->replaceUserContext($url); $this->assign('id', $this->_id); if ($this->_id && in_array($this->_gName, CRM_Core_OptionGroup::$_domainIDGroups)) { $domainID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', $this->_id, 'domain_id', 'id'); if (CRM_Core_Config::domainID() != $domainID) { CRM_Core_Error::fatal(ts('You do not have permission to access this page')); } } }
/** * Pre-process */ public function preProcess() { parent::preProcess(); $session = CRM_Core_Session::singleton(); if (!$this->_gName && !empty($this->urlPath[3])) { $this->_gName = $this->urlPath[3]; } if (!$this->_gName && !empty($_GET['gid'])) { $this->_gName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', (int) $_GET['gid'], 'name'); } if ($this->_gName) { $this->set('gName', $this->_gName); } else { $this->_gName = $this->get('gName'); } $this->_gid = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', $this->_gName, 'id', 'name'); $this->_gLabel = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', $this->_gid, 'title'); $url = "civicrm/admin/options/{$this->_gName}"; $params = "reset=1"; if ($this->_action & CRM_Core_Action::DELETE && in_array($this->_gName, array('email_greeting', 'postal_greeting', 'addressee'))) { // Don't allow delete if the option value belongs to addressee, postal or email greetings and is in use. $findValue = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', $this->_id, 'value'); $queryParam = array(1 => array($findValue, 'Integer')); $columnName = $this->_gName . "_id"; $sql = "SELECT count(id) FROM civicrm_contact WHERE " . $columnName . " = %1"; $isInUse = CRM_Core_DAO::singleValueQuery($sql, $queryParam); if ($isInUse) { $scriptURL = "<a href='" . CRM_Utils_System::docURL2('Update Greetings and Address Data for Contacts', TRUE, NULL, NULL, NULL, "wiki") . "'>" . ts('Learn more about a script that can automatically update contact addressee and greeting options.') . "</a>"; CRM_Core_Session::setStatus(ts('The selected %1 option has <strong>not been deleted</strong> because it is currently in use. Please update these contacts to use a different format before deleting this option. %2', array(1 => $this->_gLabel, 2 => $scriptURL)), ts('Sorry'), 'error'); $redirect = CRM_Utils_System::url($url, $params); CRM_Utils_System::redirect($redirect); } } $session->pushUserContext(CRM_Utils_System::url($url, $params)); $this->assign('id', $this->_id); if ($this->_id && in_array($this->_gName, CRM_Core_OptionGroup::$_domainIDGroups)) { $domainID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', $this->_id, 'domain_id', 'id'); if (CRM_Core_Config::domainID() != $domainID) { CRM_Core_Error::fatal(ts('You do not have permission to access this page.')); } } }
function preProcess() { $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, 0); $this->_cloneID = CRM_Utils_Request::retrieve('cloneID', 'Positive', $this, FALSE, 0); $this->set('BAOName', 'CRM_CiviDiscount_BAO_Item'); parent::preProcess(); $session = CRM_Core_Session::singleton(); $url = CRM_Utils_System::url('civicrm/cividiscount/discount/list', 'reset=1'); $session->pushUserContext($url); // check and ensure that update / delete have a valid id if ($this->_action & (CRM_Core_Action::UPDATE | CRM_Core_Action::DELETE)) { if (!CRM_Utils_Rule::positiveInteger($this->_id)) { CRM_Core_Error::fatal(ts('We need a valid discount ID for update and/or delete')); } } if ($this->_action & CRM_Core_Action::COPY) { if (!CRM_Utils_Rule::positiveInteger($this->_cloneID)) { CRM_Core_Error::fatal(ts('We need a valid discount ID for update and/or delete')); } } CRM_Utils_System::setTitle(ts('Discounts')); $this->_multiValued = array('memberships' => NULL, 'events' => NULL, 'pricesets' => NULL); $this->select2style = array('placeholder' => ts('- none -'), 'multiple' => TRUE, 'class' => 'crm-select2 huge'); }
function preProcess() { parent::preProcess(); CRM_Utils_System::setTitle(ts('Settings - Resource')); $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, 0); }
public function preProcess() { parent::preProcess(); $this->_fields = array(array('name' => 'name', 'label' => ts('Name'), 'required' => TRUE), array('name' => 'title', 'label' => ts('Title'), 'required' => TRUE), array('name' => 'billing_mode', 'label' => ts('Billing Mode'), 'required' => TRUE, 'rule' => 'positiveInteger', 'msg' => ts('Enter a positive integer')), array('name' => 'description', 'label' => ts('Description')), array('name' => 'user_name_label', 'label' => ts('User Name Label')), array('name' => 'password_label', 'label' => ts('Password Label')), array('name' => 'signature_label', 'label' => ts('Signature Label')), array('name' => 'subject_label', 'label' => ts('Subject Label')), array('name' => 'class_name', 'label' => ts('PHP class name'), 'required' => TRUE), array('name' => 'url_site_default', 'label' => ts('Live Site URL'), 'required' => TRUE, 'rule' => 'url', 'msg' => ts('Enter a valid URL')), array('name' => 'url_api_default', 'label' => ts('Live API URL'), 'required' => FALSE, 'rule' => 'url', 'msg' => ts('Enter a valid URL')), array('name' => 'url_recur_default', 'label' => ts('Live Recurring Payments URL'), 'required' => TRUE, 'rule' => 'url', 'msg' => ts('Enter a valid URL')), array('name' => 'url_button_default', 'label' => ts('Live Button URL'), 'rule' => 'url', 'msg' => ts('Enter a valid URL')), array('name' => 'url_site_test_default', 'label' => ts('Test Site URL'), 'required' => TRUE, 'rule' => 'url', 'msg' => ts('Enter a valid URL')), array('name' => 'url_api_test_default', 'label' => ts('Test API URL'), 'required' => FALSE, 'rule' => 'url', 'msg' => ts('Enter a valid URL')), array('name' => 'url_recur_test_default', 'label' => ts('Test Recurring Payments URL'), 'required' => TRUE, 'rule' => 'url', 'msg' => ts('Enter a valid URL')), array('name' => 'url_button_test_default', 'label' => ts('Test Button URL'), 'rule' => 'url', 'msg' => ts('Enter a valid URL'))); }
function preProcess() { parent::preProcess(); CRM_Utils_System::setTitle(ts('Settings - Resource Configuration Set')); }
function preProcess() { parent::preProcess(); CRM_Utils_System::setTitle(ts('Settings - Additional Charges Item')); }