<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
class CRM_Price_Form_Set extends CRM_Core_Form {
/**
- * the set id saved to the session for an update
+ * The set id saved to the session for an update
*
* @var int
* @access protected
protected $_sid;
/**
- * Function to set variables up before form is built
+ * Set variables up before form is built
*
* @param null
*
}
/**
- * global form rule
+ * Global form rule
*
* @param array $fields the input form values
* @param array $files the uploaded files if any
// gives the ascii value
$asciiValue = ord($title{0});
if ($asciiValue >= 48 && $asciiValue <= 57) {
- $errors['title'] = ts("Set's Name should not start with digit");
+ $errors['title'] = ts("Name cannot not start with a digit");
}
return empty($errors) ? TRUE : $errors;
}
/**
- * Function to actually build the form
+ * Build the form object
*
* @param null
*
}
/**
- * This function sets the default values for the form. Note that in edit/view mode
+ * Set default values for the form. Note that in edit/view mode
* the default values are retrieved from the database
*
* @param null
CRM_Core_Session::setStatus(ts('The Set \'%1\' has been saved.', array(1 => $set->title)), ts('Saved'), 'success');
}
else {
- $url = CRM_Utils_System::url('civicrm/admin/price/field', 'reset=1&action=add&sid=' . $set->id);
+ // Jump directly to adding a field if popups are disabled
+ $action = CRM_Core_Resources::singleton()->ajaxPopupsEnabled ? 'browse' : 'add';
+ $url = CRM_Utils_System::url('civicrm/admin/price/field', array('reset' => 1, 'action' => $action, 'sid' => $set->id, 'new' => 1));
CRM_Core_Session::setStatus(ts("Your Set '%1' has been added. You can add fields to this set now.",
array(1 => $set->title)
), ts('Saved'), 'success');