| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
/**
* This is a string which is either a_b or b_a used to determine the relationship between to contacts
- *
*/
public $_rtype;
/**
* This is a string which is used to determine the relationship between to contacts
- *
*/
public $_rtypeId;
/**
* Display name of contact a
- *
*/
public $_display_name_a;
/**
* Display name of contact b
- *
*/
public $_display_name_b;
case CRM_Core_Action::VIEW:
CRM_Utils_System::setTitle(ts('View Relationship for %1', array(1 => $this->_display_name_a)));
break;
+
case CRM_Core_Action::ADD:
CRM_Utils_System::setTitle(ts('Add Relationship for %1', array(1 => $this->_display_name_a)));
break;
+
case CRM_Core_Action::UPDATE:
CRM_Utils_System::setTitle(ts('Edit Relationship for %1', array(1 => $this->_display_name_a)));
break;
+
case CRM_Core_Action::DELETE:
CRM_Utils_System::setTitle(ts('Delete Relationship for %1', array(1 => $this->_display_name_a)));
break;
}
/**
- * This function is used to add the rules for form.
+ * add the rules for form.
*
* @return void
*/
);
$label = $this->_action & CRM_Core_Action::ADD ? ts('Contact(s)') : ts('Contact');
- $contactField = $this->addEntityRef('related_contact_id', $label, array('multiple' => TRUE, 'create' => TRUE), TRUE);
+ $contactField = $this->addEntityRef('related_contact_id', $label, array(
+ 'multiple' => TRUE,
+ 'create' => TRUE,
+ ), TRUE);
// This field cannot be updated
if ($this->_action & CRM_Core_Action::UPDATE) {
$contactField->freeze();
}
if ($valid) {
- CRM_Core_Session::setStatus(ts('Relationship created.', array('count' => $valid, 'plural' => '%count relationships created.')), ts('Saved'), 'success');
+ CRM_Core_Session::setStatus(ts('Relationship created.', array(
+ 'count' => $valid,
+ 'plural' => '%count relationships created.',
+ )), ts('Saved'), 'success');
}
if ($invalid) {
- CRM_Core_Session::setStatus(ts('%count relationship record was not created due to an invalid contact type.', array('count' => $invalid, 'plural' => '%count relationship records were not created due to invalid contact types.')), ts('%count invalid relationship record', array('count' => $invalid, 'plural' => '%count invalid relationship records')));
+ CRM_Core_Session::setStatus(ts('%count relationship record was not created due to an invalid contact type.', array(
+ 'count' => $invalid,
+ 'plural' => '%count relationship records were not created due to invalid contact types.',
+ )), ts('%count invalid relationship record', array(
+ 'count' => $invalid,
+ 'plural' => '%count invalid relationship records',
+ )));
}
if ($duplicate) {
- CRM_Core_Session::setStatus(ts('One relationship was not created because it already exists.', array('count' => $duplicate, 'plural' => '%count relationships were not created because they already exist.')), ts('%count duplicate relationship', array('count' => $duplicate, 'plural' => '%count duplicate relationships')));
+ CRM_Core_Session::setStatus(ts('One relationship was not created because it already exists.', array(
+ 'count' => $duplicate,
+ 'plural' => '%count relationships were not created because they already exist.',
+ )), ts('%count duplicate relationship', array(
+ 'count' => $duplicate,
+ 'plural' => '%count duplicate relationships',
+ )));
}
if ($saved) {
CRM_Core_Session::setStatus(ts('Relationship record has been updated.'), ts('Saved'), 'success');
* @param array $params
* (reference ) an assoc array of name/value pairs.
*
- * @return mixed true or array of errors
- * @static
+ * @return bool|array
+ * mixed true or array of errors
*/
public static function dateRule($params) {
$errors = array();