if ($this->_mode == self::MODE_EDIT) {
//specifies the action being done on a multi record field
$multiRecordAction = CRM_Utils_Request::retrieve('multiRecord', 'String', $this);
- $this->_multiRecord = (!is_numeric($multiRecordAction)) ?
- CRM_Core_Action::resolve($multiRecordAction) : $multiRecordAction;
+ $this->_multiRecord = (!is_numeric($multiRecordAction)) ? CRM_Core_Action::resolve($multiRecordAction) : $multiRecordAction;
if ($this->_multiRecord) {
$this->set('multiRecord', $this->_multiRecord);
}
if ($this->_multiRecord) {
if ($this->_multiRecord != CRM_Core_Action::ADD) {
$this->_recordId = CRM_Utils_Request::retrieve('recordId', 'Positive', $this);
- } else {
+ }
+ else {
$this->_recordId = NULL;
$this->set('recordId', NULL);
}
CRM_Core_Error::fatal(ts('The requested Profile (gid=%1) requires record id while performing this action',
array(1 => $this->_gid)
));
- } elseif (empty($this->_multiRecordFields)) {
- CRM_Core_Error::fatal(ts('No Multi-Record Fields configured for this profile (gid=%1)',
+ }
+ elseif (empty($this->_multiRecordFields)) {
+ CRM_Core_Error::fatal(ts('No Multi-Record Fields configured for this profile (gid=%1)',
array(1 => $this->_gid)
));
}
if (array_key_exists($this->_recordId, $getValues)) {
$this->_recordExists = TRUE;
- } else {
+ }
+ else {
$this->_recordExists = FALSE;
if ($this->_multiRecord & CRM_Core_Action::UPDATE) {
CRM_Core_Session::setStatus(ts('Note: The record %1 doesnot exists. Upon save a new record will be create', array(1 => $this->_recordId)), ts('Record doesnot exist'), 'alert');
}
}
- } elseif (!empty($this->_multiRecordFields)
- && (!$this->_multiRecord || !in_array($this->_multiRecord, array(CRM_Core_Action::DELETE, CRM_Core_Action::UPDATE)) )) {
+ }
+ elseif (!empty($this->_multiRecordFields)
+ && (!$this->_multiRecord || !in_array($this->_multiRecord, array(CRM_Core_Action::DELETE, CRM_Core_Action::UPDATE)))) {
CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js', 1, 'html-header');
//multirecord listing page
$multiRecordFieldListing = TRUE;
if ($this->_multiRecord && !empty($this->_multiRecordFields)) {
$this->_fields = $this->_multiRecordFields;
$this->_multiRecordProfile = TRUE;
- } elseif ($this->_multiRecord && empty($this->_multiRecordFields)) {
+ }
+ elseif ($this->_multiRecord && empty($this->_multiRecordFields)) {
CRM_Core_Session::setStatus(ts('This feature is not currently available.'), ts('Sorry'), 'error');
CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm', 'reset=1'));
}
$fieldIds[] = CRM_Core_BAO_CustomField::getKeyID($key);
}
- $defaultValues = array( );
+ $defaultValues = array();
if ($this->_multiRecord && $this->_multiRecord == CRM_Core_Action::UPDATE) {
$defaultValues = CRM_Core_BAO_CustomValueTable::getEntityValues($this->_id, NULL, $fieldIds, TRUE);
if ($this->_recordExists == TRUE) {
$defaultValues = $defaultValues[$this->_recordId];
- } else {
+ }
+ else {
$defaultValues = NULL;
}
}
$this->_mode,
$value
);
- } else {
+ }
+ else {
$this->_defaults[$name] = "";
}
}
case self::MODE_REGISTER:
CRM_Utils_Hook::buildProfile($this->_ufGroup['name']);
break;
+
case self::MODE_SEARCH:
CRM_Utils_Hook::searchProfile($this->_ufGroup['name']);
break;
+
default:
}
if (
($profileType != 'Contact' && !$this->_isContactActivityProfile) &&
- (($profileSubType && !empty($contactSubtypes) && (!in_array($profileSubType,$contactSubtypes))) ||
+ (($profileSubType && !empty($contactSubtypes) && (!in_array($profileSubType, $contactSubtypes))) ||
($profileType != $contactType))
) {
$return = TRUE;
if ($this->_currentUserID) {
$this->_isAddCaptcha = FALSE;
}
- else if (!$this->_isAddCaptcha && !empty($addCaptcha)) {
+ elseif (!$this->_isAddCaptcha && !empty($addCaptcha)) {
$this->_isAddCaptcha = TRUE;
}
/**
* Global form rule
*
- * @param array $fields the input form values
- * @param array $files the uploaded files if any
- * @param CRM_Core_Form $form the form object
+ * @param array $fields
+ * The input form values.
+ * @param array $files
+ * The uploaded files if any.
+ * @param CRM_Core_Form $form
+ * The form object.
*
* @return true if no errors, else array of errors
* @static
1 => array($this->_recordId, 'Integer'),
2 => array($this->_id, 'Integer')
);
- CRM_Core_DAO::executeQuery($sql, $sqlParams);
- CRM_Core_Session::setStatus(ts('Your record has been deleted.'), ts('Deleted'), 'success');
+ CRM_Core_DAO::executeQuery($sql, $sqlParams);
+ CRM_Core_Session::setStatus(ts('Your record has been deleted.'), ts('Deleted'), 'success');
}
}
return;