addElement('text', 'dbaName', [ 'label' => 'DBA Name', 'required' => true, 'maxlength' => 255, ]); $this->addElement('text', 'businessName', [ 'label' => 'Full Legal Name of Business', 'required' => true, 'maxlength' => 255, ]); $this->addElement('text', 'federalId', [ 'label' => 'Federal ID/SSN', 'required' => true, 'maxlength' => 255, ]); $this->addElement('select', 'organizationTypeId', [ 'label' => 'Type of Organization', 'required' => true, 'multiOptions' => ['' => 'Select One'] + $this->getConfigArray('organizationTypes'), ]); $this->addElement('checkbox', 'preferredVendor', [ 'label' => 'Preferred Vendor', 'decoration' => 'simple', 'description' => 'Tribal Owned and American Indian Owned Businesses Only', ]); $this->addElement('text', 'preferredVendorCode', [ 'label' => 'Preferred Vendor Code', 'description' => 'Tribal ID #', 'required' => Qs_Request::isGet() || 'y' == Qs_Request::getPostValue('preferredVendor'), ]); return $this; } protected function _initSoleProprietorElements() { $this->addElement('header', 'soleProprietorHeader', ['label' => 'Main Contact']); $this->addElement('text', 'soleProprietorFirstName', [ 'label' => 'First Name', 'required' => true, 'maxlength' => 64, ]); $this->addElement('text', 'soleProprietorLastName', [ 'label' => 'Last Name', 'required' => true, 'maxlength' => 64, ]); $this->addElement('text', 'soleProprietorDlNumber', [ 'label' => 'Driver\'s License Number', 'maxlength' => 64, ]); $this->addElement('select', 'soleProprietorDlState', [ 'label' => 'Driver\'s License Issuance State', 'multiOptions' => ['' => 'Select One'] + (array) StateModel::get4Select(), ]); return $this; } protected function _initBillingAddressElements() { $this->addElement('header', 'addressHeader', ['label' => 'Billing Address']); $form = new AddressForm(); $this->addSubForm($form, 'billingAddress'); return $this; } protected function _initMailingAddressElements() { $this->addElement('header', 'mailingAddressHeader', ['label' => 'Mailing Address']); $form = new AddressForm([ 'sameAs' => [ 'label' => 'Same as Billing Address', 'value' => 'billingAddress', ], ]); $this->addSubForm($form, 'mailingAddress'); return $this; } protected function _initContactElements() { $this->addElement( 'email', 'email', ['label' => 'Email Address', 'required' => true, 'attribs' => ['autocomplete' => 'off']] ); $uniqueValidator = new Qs_Validate_Unique(new Qs_Db_Table('Vendor'), 'email', $this->_getData('id')); $uniqueValidator->setMessage($this->_emailUniqueMessage, Qs_Validate_Unique::NOT_UNIQUE); $this->getElement('email')->addValidator($uniqueValidator); $this->addElement('phone', 'phone', ['label' => 'Phone', 'required' => true]); $this->addElement('phone', 'alternativePhone', ['label' => 'Alternative Phone']); $this->addElement('url', 'websiteUrl', [ 'label' => 'Website', 'description' => 'Example: www.google.com', ]); return $this; } protected function _initUploadElements() { $this->addElement('header', 'uploadHeader', ['label' => 'Upload']); $this->addApplicationFileElement(); return $this; } protected function addApplicationFileElement() { $this->addElement('extendedFile', 'applicationFile', ['label' => 'Upload Application Documents']); return $this; } protected function _initPartners() { $name = 'partners'; $options = [ 'name' => $name, 'label' => 'Partners, Sole Proprietor, and/or Officers (minimum of 1)', 'required' => true, 'labelAttribs' => ['class' => 'form_header'], 'defaults' => Qs_Array::get($this->_defaults, $name, []), 'orientation' => Form\Partner\Table::ORIENTATION_HORIZONTAL, 'enabledHeaders' => true, 'startIndex' => 1, 'itemClass' => Form\Partner\Row::class, 'sortable' => false, 'removable' => true, 'numerable' => false, 'itemName' => 'Person', 'itemsName' => 'Persons', 'minCount' => 1, 'description' => 'All beneficial owners with ownership percentages at 20% and above.', ]; $this->addSubForm(new Form\Partner\Table($options), $name); return $this; } protected function _initBusinessReferences() { $name = 'businessReferences'; $options = [ 'name' => $name, 'label' => 'Business References (minimum of 1)', 'required' => true, 'labelAttribs' => ['class' => 'form_header'], 'defaults' => Qs_Array::get($this->_defaults, $name, []), 'orientation' => Form\BusinessReference\Table::ORIENTATION_HORIZONTAL, 'enabledHeaders' => true, 'startIndex' => 1, 'itemClass' => Form\BusinessReference\Row::class, 'itemOptions' => ['label' => 'Name of Business References'], 'sortable' => false, 'removable' => true, 'numerable' => false, 'itemName' => 'Reference', 'itemsName' => 'References', 'minCount' => 1, 'maxItems' => 3, 'description' => 'Please do not list any of your own businesses as a reference.', ]; $this->addSubForm(new Form\BusinessReference\Table($options), $name); return $this; } }