From dd7240b184c0d60f3a2dd5a9e465020c91e60607 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 5 Mar 2014 13:52:14 -0500 Subject: [PATCH] Address location type cleanup --- CRM/Contact/Form/Edit/Address.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) 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( -- 2.25.1