'Member has changed Location at mncar.org' ); /** * @param $form Form * @return Form */ function _bindFormFields($form) { $locationTypes = $this->DBObj->getDLocationType4Select(); $locationTypes = array_values($locationTypes); $locationTypes = array_combine($locationTypes, $locationTypes); $locationTypes['Other'] = 'Other'; $form->addElement('text', 'name', 'Location Name'); $form->addElement('select', 'type', 'Location Type', $locationTypes); $form->addRuleRequired(array('name')); $phoneFormat = ' Format: (xxx) xxx-xxxx'; $phoneAttributes = array('class'=>'titled_phone' ,'onblur'=>'hidehint(this);', 'onfocus'=>'showhint(this);', 'onkeyup'=>"formatPhone(this);"); $form->addElement('extended_text', 'phone', 'Location Phone Number', $phoneAttributes, null, $phoneFormat); $form->addElement('extended_text', 'fax', 'Location Fax Number', $phoneAttributes, null, $phoneFormat); $form->addElement('extended_text', 'website', 'Location Web Site', array('class'=>'inp_website', 'style'=>'width:91%'), 'http://'); $form->addElement('text', 'contact_name', 'Office Contact Name'); $form->addElement('extended_text', 'contact_phone', 'Office Contact Phone #', $phoneAttributes, null, $phoneFormat); $this->formAddPhoneRule($form, array('phone', 'fax', 'contact_phone')); // LOCATION PHYSICAL ADDRESS $form->addElement('header', 'header_location_physical_address', 'LOCATION PHYSICAL ADDRESS'); $form->addElement('text', 'physical_address', 'Street Address'); $form->addRuleRequired(array('physical_address')); $gAddress = array(); $gAddress[] = $form->createElement('text', 'physical_city', 'City ', array('size'=>25, 'class'=>'city')); $gAddress[] = $form->createElement('select', 'physical_state', 'State ', array(''=>'') + (array) $this->DBObj->getDState4Select()); $gAddress[] = $form->createElement('text', 'physical_zip', 'Zip Code ', array('size'=>15, 'class'=>'zip')); $form->addGroup($gAddress, 'gPhysicalAddress', 'City, State, Zip Code', ' ', false); $form->addRule('gPhysicalAddress', 'City, State, Zip Code are required', 'required'); $form->addGroupRule('gPhysicalAddress', array( 'physical_city'=>array( array('Physical Address. City is required', 'required'), array('Physical Address. City is required', 'required', null, 'client'), ), 'physical_state'=>array( array('Physical Address. State is required', 'required'), array('Physical Address. State is required', 'required', null, 'client'), ), 'physical_zip'=>array( array('Physical Address. Zip Code is required', 'required'), array('Physical Address. Zip Code is required', 'required', null, 'client'), ), )); // LOCATION MAILING ADDRESS $form->addElement('header', 'header_location_mailing_address', 'LOCATION MAILING ADDRESS'); $form->addElement('advcheckbox', 'mailing_as_physical', null, 'Tick if the mailing address is the same as the physical address', null, array('n','y')); $this->Doc->addContent(array('tpl'=>'text.tpl', 'text'=>" ")); $form->addElement('text', 'mailing_address', 'Street Address'); $gAddress = array(); $gAddress[] = $form->createElement('text', 'mailing_city', 'City ', array('size'=>25, 'class'=>'city')); $gAddress[] = $form->createElement('select', 'mailing_state', 'State ', array(''=>'') + (array)$this->DBObj->getDState4Select()); $gAddress[] = $form->createElement('text', 'mailing_zip', 'Zip Code ', array('size'=>15, 'class'=>'zip')); $form->addGroup($gAddress, 'gMailingAddress', 'City, State, Zip Code', ' ', false); if ($_REQUEST['mailing_as_physical'] != 'y') { $form->addRuleRequired(array('mailing_address'), 'server'); $form->addGroupRule('gMailingAddress', array( 'mailing_city'=>array( array('City is required', 'required'), ), 'mailing_state'=>array( array('State is required', 'required'), ), 'mailing_zip'=>array( array('Zip Code is required', 'required'), ), )); } $form->addElement('header', 'header_location_notes', 'LOCATION NOTES'); $form->addElement('textarea', 'note', null, array('style'=>'width:99%; height:100px;')); $form->setSubmitTitle('Submit'); $form->setCancelType(''); $this->Doc->addItemProp('JSs', 'js/format_phone.js'); return $form; } }