_initBaseFields(); return $this; } protected function _initBaseFields() { $this->addElement('autocomplete', 'userId', ['label' => 'Select Existing Customer']); $this->userId->setDataUrl(BASE_URL . '/' . CURRENT_PAGE . '?action=autocompleteUsers'); parent::_initBaseFields(); return $this; } protected function _initButtons() { $this->addElement( 'submit', 'btnCancel', [ 'label' => 'Cancel', 'attribs' => [ 'class' => 'btn', 'onclick' => "window.location.href = '" . htmlspecialchars($this->getCancelUrl()) . "';", 'helper' => 'formInputButton', ], ] ); $this->addElement( 'submit', 'btnSubmit', [ 'label' => 'Proceed to the Next Step >', 'attribs' => ['class' => 'btn btn-primary'], ] ); $this->addDisplayGroup(['btnCancel', 'btnSubmit'], 'submitGroup'); return $this; } public function render(Zend_View_Interface $view = null) { /** @var $doc App_Doc_Admin */ $doc = Zend_Registry::get('doc'); if ($this->getElement('userId')) { $doc->addScript('js/app/ECommerce/order/admin.js'); $doc->addInitObject( 'App_ECommerce_Order_Admin_CustomerTab', [$this->getId(), $this->getElement('userId')->getId()] ); } return parent::render($view); } }