$this->applyFilter('__ALL__', 'trim');
$session = CRM_Core_Session::singleton();
- $this->_cancelURL = $_POST['cancelURL'] ?? NULL;
+ $cancelURL = $_POST['cancelURL'] ?? NULL;
- if (!$this->_cancelURL) {
- $this->_cancelURL = CRM_Utils_System::url('civicrm/admin/contribute', 'reset=1');
+ if (!$cancelURL) {
+ $cancelURL = CRM_Utils_System::url('civicrm/admin/contribute', 'reset=1');
}
- if ($this->_cancelURL) {
- $this->addElement('hidden', 'cancelURL', $this->_cancelURL);
+ if ($cancelURL) {
+ $this->addElement('hidden', 'cancelURL', $cancelURL);
}
$buttons = [
];
$this->addButtons($buttons);
- $session->replaceUserContext($this->_cancelURL);
+ $session->replaceUserContext($cancelURL);
// don't show option for contribution amounts section if membership price set
// this flag is sent to template
*/
protected $_templateId;
- protected $_cancelURL = NULL;
-
/**
* The campaign id of the existing event, we use this to know if we need to update
* the participant records
public function buildQuickForm() {
$session = CRM_Core_Session::singleton();
- $this->_cancelURL = $_POST['cancelURL'] ?? NULL;
+ $cancelURL = $_POST['cancelURL'] ?? NULL;
- if (!$this->_cancelURL) {
+ if (!$cancelURL) {
if ($this->_isTemplate) {
- $this->_cancelURL = CRM_Utils_System::url('civicrm/admin/eventTemplate',
+ $cancelURL = CRM_Utils_System::url('civicrm/admin/eventTemplate',
'reset=1'
);
}
else {
- $this->_cancelURL = CRM_Utils_System::url('civicrm/event/manage',
+ $cancelURL = CRM_Utils_System::url('civicrm/event/manage',
'reset=1'
);
}
}
- if ($this->_cancelURL) {
- $this->addElement('hidden', 'cancelURL', $this->_cancelURL);
+ if ($cancelURL) {
+ $this->addElement('hidden', 'cancelURL', $cancelURL);
}
if ($this->_single) {
$this->addButtons($buttons);
}
- $session->replaceUserContext($this->_cancelURL);
+ $session->replaceUserContext($cancelURL);
$this->add('hidden', 'is_template', $this->_isTemplate);
}
*/
class CRM_Profile_Form_Edit extends CRM_Profile_Form {
protected $_postURL = NULL;
- protected $_cancelURL = NULL;
protected $_errorURL = NULL;
protected $_context;
protected $_blockNo;
if ($this->_context !== 'dialog') {
$this->_postURL = $this->_ufGroup['post_url'];
- $this->_cancelURL = $this->_ufGroup['cancel_url'];
+ $cancelURL = $this->_ufGroup['cancel_url'];
$gidString = $this->_gid;
if (!empty($this->_profileIds)) {
}
}
- if (!$this->_cancelURL) {
- $this->_cancelURL = CRM_Utils_System::url('civicrm/profile',
+ if (!$cancelURL) {
+ $cancelURL = CRM_Utils_System::url('civicrm/profile',
"reset=1&gid={$gidString}"
);
}
// we do this gross hack since qf also does entity replacement
$this->_postURL = str_replace('&', '&', ($this->_postURL ?? ''));
- $this->_cancelURL = str_replace('&', '&', ($this->_cancelURL ?? ''));
+ $cancelURL = str_replace('&', '&', ($cancelURL ?? ''));
// also retain error URL if set
$this->_errorURL = $_POST['errorURL'] ?? NULL;
parent::buildQuickForm();
- $this->assign('cancelURL', $this->_cancelURL);
+ $this->assign('cancelURL', $cancelURL);
$cancelButtonValue = !empty($this->_ufGroup['cancel_button_text']) ? $this->_ufGroup['cancel_button_text'] : ts('Cancel');
$this->assign('cancelButtonText', $cancelButtonValue);