_hasFilter) { parent::_addFilterItem(); $status = Qs_Request::getRequestValue('status'); if (null === $status && !$this->_getDataObj()->getFilter('status')) { $status = $this->_getDataObj()->getStatuses(); $status = key($status); $this->_getDataObj()->addFilter(array('status' => $status)); } } return $this; } protected function _initFromForm(Qs_Form $form) { $data = $form->getValues(); if (empty($data['startDate'])) { $data['startDate'] = null; } if (empty($data['endDate']) || $data['hasNoExpirationDate'] == 'y') { $data['endDate'] = null; } if ($data['isRelated'] == 'n') { $data['productId'] = 0; } $this->_getDataObj()->initFromForm($data); return $this; } protected function _doProductAutocomplete() { $this->_doProductAutocompleteAjax(); return $this; } protected function _doProductAutocompleteAjax() { $data = $this->_getDataObj()->getData4Autocomplete(Qs_Request::getRequestValue('term')); $this->_displayJson($data); } protected function _doGenerateCode() { $this->_doc->display404(); } protected function _doGenerateCodeAjax() { $this->_displayJson(array('code' => $this->_getDataObj()->generateCode())); } }