From: Coleman Watts Date: Wed, 5 Mar 2014 18:52:14 +0000 (-0500) Subject: Address location type cleanup X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=dd7240b184c0d60f3a2dd5a9e465020c91e60607;p=civicrm-core.git Address location type cleanup --- diff --git a/CRM/Contact/Form/Edit/Address.php b/CRM/Contact/Form/Edit/Address.php index 38fbdf182b..e73aace3fd 100644 --- a/CRM/Contact/Form/Edit/Address.php +++ b/CRM/Contact/Form/Edit/Address.php @@ -67,18 +67,15 @@ class CRM_Contact_Form_Edit_Address { $js = array(); if (!$inlineEdit) { - $js = array('onChange' => 'checkLocation( this.id );'); + $js = array('onChange' => 'checkLocation( this.id );', 'placeholder' => NULL); } - $form->addSelect("address[$blockId][location_type_id]", array('entity' => 'address', 'class' => 'eight', 'placeholder' => NULL) + $js); + //make location type required for inline edit + $form->addSelect("address[$blockId][location_type_id]", array('entity' => 'address', 'class' => 'eight') + $js, $inlineEdit); if (!$inlineEdit) { $js = array('id' => 'Address_' . $blockId . '_IsPrimary', 'onClick' => 'singleSelect( this.id );'); } - else { - //make location type required for inline edit - $form->addRule( "address[$blockId][location_type_id]", ts('%1 is a required field.', array(1 => ts('Location Type'))), 'required'); - } $form->addElement( 'checkbox', @@ -88,8 +85,8 @@ class CRM_Contact_Form_Edit_Address { $js ); - if ( !$inlineEdit ) { - $js = array('id' => 'Address_' . $blockId . '_IsBilling', 'onClick' => 'singleSelect( this.id );'); + if (!$inlineEdit) { + $js = array('id' => 'Address_' . $blockId . '_IsBilling', 'onClick' => 'singleSelect( this.id );'); } $form->addElement(