| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
/**
* Set variables up before form is built
*
- * @param null
*
* @return void
*/
*
* @return bool|array
* true if no errors, else array of errors
- * @static
*/
public static function formRule($fields, $files, $self) {
$errors = array();
* add the rules (mainly global rules) for form.
* All local rules are added near the element
*
- * @param null
*
* @return void
* @see valid_date
/**
* Build the form object
*
- * @param null
*
* @return void
*/
$contactTypes = array('Contact', 'Individual', 'Household', 'Organization');
$this->assign('contactTypes', json_encode($contactTypes));
- $sel1 = array("" => "- select -") + CRM_Core_SelectValues::customGroupExtends();
+ $sel1 = array("" => ts("- select -")) + CRM_Core_SelectValues::customGroupExtends();
$sel2 = array();
$activityType = CRM_Core_PseudoConstant::activityType(FALSE, TRUE, FALSE, 'label', TRUE);
if ($main == 'Relationship') {
$relName = self::getFormattedList($sel2[$main]);
$sel2[$main] = array(
- '' => ts("- Any -")
- ) + $relName;
+ '' => ts("- Any -"),
+ ) + $relName;
}
else {
$sel2[$main] = array(
- '' => ts("- Any -")
- ) + $sel2[$main];
+ '' => ts("- Any -"),
+ ) + $sel2[$main];
}
}
}
$contactSubTypes[$key] = $key;
}
$sel2['Contact'] = array(
- "" => "-- Any --"
- ) + $contactSubTypes;
+ "" => ("- Any -"),
+ ) + $contactSubTypes;
}
else {
if (!isset($this->_id)) {
),
);
if (!$this->_isGroupEmpty && !empty($this->_subtypes)) {
- $buttons[0]['js'] = array('onclick' => "return warnDataLoss()");
+ $buttons[0]['class'] = 'crm-warnDataLoss';
}
$this->addButtons($buttons);
- // views are implemented as frozen form
+ // TODO: Is this condition ever true? Can this code be removed?
if ($this->_action & CRM_Core_Action::VIEW) {
$this->freeze();
$this->addElement('button', 'done', ts('Done'), array('onclick' => "location.href='civicrm/admin/custom/group?reset=1&action=browse'"));
* Set default values for the form. Note that in edit/view mode
* the default values are retrieved from the database
*
- * @param null
*
* @return array
* array of default values
/**
* Process the form
*
- * @param null
*
* @return void
*/
* Array of relationship name.
*
* @return array
- * of relationship name.
+ * Array of relationship name.
*/
public static function getFormattedList(&$list) {
$relName = array();
}
return $relName;
}
+
}