<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
*/
public function buildQuickForm() {
parent::buildQuickForm();
+ $this->setPageTitle(ts('Relationship Type'));
if ($this->_action & CRM_Core_Action::DELETE) {
-
return;
}
CRM_Core_DAO::getAttribute('CRM_Contact_DAO_RelationshipType', 'description')
);
-
-
- $contactTypes = CRM_Contact_BAO_ContactType::getSelectElements();
+ $contactTypes = CRM_Contact_BAO_ContactType::getSelectElements(FALSE, TRUE, '__');
// add select for contact type
$contactTypeA = &$this->add('select', 'contact_types_a', ts('Contact Type A') . ' ',
}
}
+ /**
+ * @return array
+ */
function setDefaultValues() {
if ($this->_action != CRM_Core_Action::DELETE &&
isset($this->_id)
$baoName::retrieve($params, $defaults);
$defaults['contact_types_a'] = CRM_Utils_Array::value('contact_type_a', $defaults);
if (!empty($defaults['contact_sub_type_a'])) {
- $defaults['contact_types_a'] .= CRM_Core_DAO::VALUE_SEPARATOR . $defaults['contact_sub_type_a'];
+ $defaults['contact_types_a'] .= '__' . $defaults['contact_sub_type_a'];
}
$defaults['contact_types_b'] = $defaults['contact_type_b'];
if (!empty($defaults['contact_sub_type_b'])) {
- $defaults['contact_types_b'] .= CRM_Core_DAO::VALUE_SEPARATOR . $defaults['contact_sub_type_b'];
+ $defaults['contact_types_b'] .= '__' . $defaults['contact_sub_type_b'];
}
return $defaults;
}
$ids['relationshipType'] = $this->_id;
}
- $cTypeA = CRM_Utils_System::explode(CRM_Core_DAO::VALUE_SEPARATOR,
+ $cTypeA = CRM_Utils_System::explode('__',
$params['contact_types_a'],
2
);
- $cTypeB = CRM_Utils_System::explode(CRM_Core_DAO::VALUE_SEPARATOR,
+ $cTypeB = CRM_Utils_System::explode('__',
$params['contact_types_b'],
2
);
CRM_Core_Session::setStatus(ts('The Relationship Type has been saved.'), ts('Saved'), 'success');
}
}
- //end of function
+
}