+ $params['id'] = $this->getEntityId();
+ $priceField = $this->submit($params);
+ if (!is_a($priceField, 'CRM_Core_Error')) {
+ // Required by extensions implementing the postProcess hook (to get the ID of new entities)
+ $this->setEntityId($priceField->id);
+ CRM_Core_Session::setStatus(ts('Price Field \'%1\' has been saved.', [1 => $priceField->label]), ts('Saved'), 'success');
+ }
+ $buttonName = $this->controller->getButtonName();
+ $session = CRM_Core_Session::singleton();
+ if ($buttonName == $this->getButtonName('next', 'new')) {
+ CRM_Core_Session::setStatus(ts(' You can add another price set field.'), '', 'info');
+ $session->replaceUserContext(CRM_Utils_System::url('civicrm/admin/price/field', 'reset=1&action=add&sid=' . $this->_sid));
+ }
+ else {
+ $session->replaceUserContext(CRM_Utils_System::url('civicrm/admin/price/field', 'reset=1&action=browse&sid=' . $this->_sid));
+ }
+ }
+
+ public function submit($params) {