}
elseif ($this->_action & (CRM_Core_Action::DISABLE | CRM_Core_Action::DELETE)) {
$ufGroup['module'] = implode(' , ', CRM_Core_BAO_UFGroup::getUFJoinRecord($this->_id, TRUE));
- $status = 0;
- $status = CRM_Core_BAO_UFGroup::usedByModule($this->_id);
+ $status = 0;
+ $status = CRM_Core_BAO_UFGroup::usedByModule($this->_id);
if ($this->_action & (CRM_Core_Action::DISABLE)) {
if ($status) {
$message = 'This profile is currently used for ' . $ufGroup['module'] . '. If you disable the profile - it will be removed from these forms and/or modules. Do you want to continue?';
$showAdvanced = 0;
$advFields = array(
- 'group', 'post_URL', 'cancel_URL',
- 'add_captcha', 'is_map', 'is_uf_link', 'is_edit_link',
- 'is_update_dupe', 'is_cms_user', 'is_proximity_search',
+ 'group',
+ 'post_URL',
+ 'cancel_URL',
+ 'add_captcha',
+ 'is_map',
+ 'is_uf_link',
+ 'is_edit_link',
+ 'is_update_dupe',
+ 'is_cms_user',
+ 'is_proximity_search',
);
foreach ($advFields as $key) {
if (!empty($defaults[$key])) {
* @param array $self
* Current form object.
*
- * @return true if no errors, else array of errors
- * @static
+ * @return bool|array
+ * true if no errors, else array of errors
*/
public static function formRule($fields, $files, $self) {
$errors = array();
$name .= $self->_id ? '_' . $self->_id : '';
$query = 'select count(*) from civicrm_uf_group where ( name like %1 ) and id != %2';
$pCnt = CRM_Core_DAO::singleValueQuery($query, array(
- 1 => array($name, 'String'),
- 2 => array((int) $self->_id, 'Integer'),
- ));
+ 1 => array($name, 'String'),
+ 2 => array((int) $self->_id, 'Integer'),
+ ));
if ($pCnt) {
$errors['title'] = ts('Profile \'%1\' already exists in Database.', array(1 => $title));
}
$action = CRM_Core_Resources::singleton()->ajaxPopupsEnabled ? '' : '/add';
$url = CRM_Utils_System::url("civicrm/admin/uf/group/field$action", 'reset=1&new=1&gid=' . $ufGroup->id . '&action=' . ($action ? 'add' : 'browse'));
CRM_Core_Session::setStatus(ts('Your CiviCRM Profile \'%1\' has been added. You can add fields to this profile now.',
- array(1 => $ufGroup->title)
- ), ts('Profile Added'), 'success');
+ array(1 => $ufGroup->title)
+ ), ts('Profile Added'), 'success');
}
$session = CRM_Core_Session::singleton();
$session->replaceUserContext($url);