<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
* The set id saved to the session for an update
*
* @var int
- * @access protected
*/
protected $_id;
* set is empty or not
*
* @var bool
- * @access protected
*/
protected $_isGroupEmpty = TRUE;
* Array of existing subtypes set for a custom set
*
* @var array
- * @access protected
*/
protected $_subtypes = array();
* Array of default params
*
* @var array
- * @access protected
*/
protected $_defaults = array();
* @param null
*
* @return void
- * @access public
*/
public function preProcess() {
// current set id
/**
* Global form rule
*
- * @param array $fields the input form values
- * @param array $files the uploaded files if any
+ * @param array $fields
+ * The input form values.
+ * @param array $files
+ * The uploaded files if any.
* @param $self
*
*
* @return true if no errors, else array of errors
- * @access public
* @static
*/
- static function formRule($fields, $files, $self) {
+ public static function formRule($fields, $files, $self) {
$errors = array();
//validate group title as well as name.
$title = $fields['title'];
$name = CRM_Utils_String::munge($title, '_', 64);
$query = 'select count(*) from civicrm_custom_group where ( name like %1 OR title like %2 ) and id != %3';
- $grpCnt = CRM_Core_DAO::singleValueQuery($query, array(1 => array($name, 'String'),
+ $grpCnt = CRM_Core_DAO::singleValueQuery($query, array(
+ 1 => array($name, 'String'),
2 => array($title, 'String'),
- 3 => array((int)$self->_id, 'Integer'),
+ 3 => array((int) $self->_id, 'Integer'),
));
if ($grpCnt) {
$errors['title'] = ts('Custom group \'%1\' already exists in Database.', array(1 => $title));
}
if (!empty($fields['is_multiple'])) {
- $self->assign('showMultiple', TRUE);
+ $self->assign('showMultiple', TRUE);
}
if (empty($fields['is_multiple']) && $fields['style'] == 'Tab with table') {
* @param null
*
* @return void
- * @access public
* @see valid_date
*/
- function addRules() {
+ public function addRules() {
$this->addFormRule(array('CRM_Custom_Form_Group', 'formRule'), $this);
}
* @param null
*
* @return void
- * @access public
*/
public function buildQuickForm() {
$this->applyFilter('__ALL__', 'trim');
ts('Used For'),
array(
'name' => 'extends[0]',
- 'style' => 'vertical-align: top;'
+ 'style' => 'vertical-align: top;',
),
TRUE
);
* @param null
*
* @return array array of default values
- * @access public
*/
- function setDefaultValues() {
+ public function setDefaultValues() {
$defaults = &$this->_defaults;
$this->assign('showMaxMultiple', TRUE);
if ($this->_action == CRM_Core_Action::ADD) {
* @param null
*
* @return void
- * @access public
*/
public function postProcess() {
// get the submitted form values.
/**
* Return a formatted list of relationship name.
*
- * @param array $list array of relationship name.
+ * @param array $list
+ * Array of relationship name.
*
* @return array of relationship name.
*/
- static function getFormattedList(&$list) {
+ public static function getFormattedList(&$list) {
$relName = array();
foreach ($list as $listItemKey => $itemValue) {
return $relName;
}
}
-