_initBaseFields(); return $this; } protected function _initBaseFields() { $this->addElement('autocomplete', 'userId', array('label' => 'Select Existing Customer')); $this->userId->setDataUrl(BASE_URL . '/' . CURRENT_PAGE . '?action=autocompleteUsers'); parent::_initBaseFields(); return $this; } protected function _initButtons() { $this->addElement( 'submit', 'btnCancel', array( 'label' => 'Cancel', 'attribs' => array( 'class' => 'btn', 'onclick' => "window.location.href = '" . htmlspecialchars($this->getCancelUrl()) . "';", 'helper' => 'formInputButton', ), ) ); $this->addElement( 'submit', 'btnSubmit', array( 'label' => 'Proceed to the Next Step >', 'attribs' => array('class' => 'btn btn-primary'), ) ); $this->addDisplayGroup(array('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', array($this->getId(), $this->getElement('userId')->getId()) ); } return parent::render($view); } }