_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['productCategoryIds'] = null; } $this->_getDataObj()->initFromForm($data); return $this; } protected function _doGenerateCode() { $this->_doc->display404(); } protected function _doGenerateCodeAjax() { $this->_displayJson(array('code' => $this->_getDataObj()->generateCode())); } }