+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
* $Id$
*
*/
*/
public $_preEditValues;
+ /**
+ * Explicitly declare the entity api name.
+ */
+ public function getDefaultEntity() {
+ return 'Contact';
+ }
+
+ /**
+ * Explicitly declare the form context.
+ */
+ public function getDefaultContext() {
+ return 'create';
+ }
+
/**
* Build all the data structures needed to build the form.
*
$this->_dedupeButtonName = $this->getButtonName('refresh', 'dedupe');
$this->_duplicateButtonName = $this->getButtonName('upload', 'duplicate');
+ CRM_Core_Resources::singleton()
+ ->addStyleFile('civicrm', 'css/contactSummary.css', 2, 'html-header');
+
$session = CRM_Core_Session::singleton();
if ($this->_action == CRM_Core_Action::ADD) {
// check for add contacts permissions
if ($this->_contactId) {
$defaults = array();
$params = array('id' => $this->_contactId);
- $returnProperities = array('id', 'contact_type', 'contact_sub_type', 'modified_date');
+ $returnProperities = array('id', 'contact_type', 'contact_sub_type', 'modified_date', 'is_deceased');
CRM_Core_DAO::commonRetrieve('CRM_Contact_DAO_Contact', $params, $defaults, $returnProperities);
if (empty($defaults['id'])) {
}
$displayName = CRM_Contact_BAO_Contact::displayName($this->_contactId);
+ if ($defaults['is_deceased']) {
+ $displayName .= ' <span class="crm-contact-deceased">(deceased)</span>';
+ }
$displayName = ts('Edit %1', array(1 => $displayName));
// Check if this is default domain contact CRM-10482
// subtype is a common field. lets keep it here
$subtypes = CRM_Contact_BAO_Contact::buildOptions('contact_sub_type', 'create', array('contact_type' => $this->_contactType));
if (!empty($subtypes)) {
- $sel = $this->add('select', 'contact_sub_type', ts('Contact Type'),
- $subtypes, FALSE,
- array(
- 'id' => 'contact_sub_type',
- 'multiple' => 'multiple',
- 'class' => $buildCustomData . ' crm-select2',
- )
+ $this->addField('contact_sub_type', array(
+ 'label' => ts('Contact Type'),
+ 'options' => $subtypes,
+ 'class' => $buildCustomData,
+ 'multiple' => 'multiple',
+ 'options-url' => FALSE,
+ )
);
}
CRM_Contact_Form_Location::buildQuickForm($this);
// add attachment
- $this->addElement('file', 'image_URL', ts('Browse/Upload Image'), 'size=30 maxlength=60');
- $this->addUploadElement('image_URL');
+ $this->addField('image_URL', array('maxlength' => '60', 'label' => ts('Browse/Upload Image')));
// add the dedupe button
$this->addElement('submit',