3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
19 * This class is to build the form for Deleting Set
21 class CRM_Price_Form_DeleteSet
extends CRM_Core_Form
{
31 * The title of the set being deleted.
38 * Set up variables to build the form.
42 public function preProcess() {
43 $this->_sid
= $this->get('sid');
45 $this->_title
= CRM_Core_DAO
::getFieldValue('CRM_Price_DAO_PriceSet',
51 * Build the form object.
55 public function buildQuickForm() {
56 $this->assign('title', $this->_title
);
60 'name' => ts('Delete Price Set'),
65 'name' => ts('Cancel'),
71 * Process the form when submitted.
75 public function postProcess() {
76 if (CRM_Price_BAO_PriceSet
::deleteSet($this->_sid
)) {
77 CRM_Core_Session
::setStatus(ts('The Price Set \'%1\' has been deleted.',
79 ), ts('Deleted'), 'success');
82 CRM_Core_Session
::setStatus(ts('The Price Set \'%1\' has not been deleted! You must delete all price fields in this set prior to deleting the set.',
84 ), 'Unable to Delete', 'error');