Jako, że dokumentacja helperList jest dosyć szczątkowa to chciałbym zapytać tutaj. Mam moduł w których na podstronie konfiguracji modułu czyli w funkcji getContent() chciałbym wyświetlić pewną tabelkę i mieć możliwość sortowania tych wyników przy wyświetleniu i problem jest taki, że lista się wyświetla, panele do sortowania wyników również, jednak sama próba wybrania czegokolwiek przez sortowanie kończy się powrotem na listę modułów w sklepie. Kod getContent wklejam poniżej:
Question
hakeryk2
Witam,
Jako, że dokumentacja helperList jest dosyć szczątkowa to chciałbym zapytać tutaj. Mam moduł w których na podstronie konfiguracji modułu czyli w funkcji getContent() chciałbym wyświetlić pewną tabelkę i mieć możliwość sortowania tych wyników przy wyświetleniu i problem jest taki, że lista się wyświetla, panele do sortowania wyników również, jednak sama próba wybrania czegokolwiek przez sortowanie kończy się powrotem na listę modułów w sklepie. Kod getContent wklejam poniżej:
public function getContent() { $employees = $this->getAllEmployeesId(); $employees_names = array(); foreach ($employees as $id){ $e = new EmployeeCore($id); $employees_names[$id] = $e->firstname.' '.$e->lastname; } $ingerence_status = array ( 0 => $this->l('Bezobsługowe'), 1 => $this->l('Do decyzji'), 2 => $this->l('Obsługowe') ); $sql = 'SELECT * FROM '._DB_PREFIX_.$this->name; $result = Db::getInstance()->executeS($sql); $this->fields_list = array( 'id' => array( 'title' => 'ID ', 'width' => 'auto', 'type' => 'text', 'class' => 'fixed-width-xs' ), 'id_order' => array( 'title' => $this->l('ID Zamówienia'), 'width' => 'auto', 'type' => 'text', 'class' => 'fixed-width-xs' ), 'id_employee' => array( 'title' => $this->l('Pracownik'), 'width' => 'auto', 'type' => 'select', 'filter_key' => 'id_employee', 'list' => $employees_names ), 'submitted_by' => array( 'title' => $this->l('Przydzielił'), 'width' => 'auto', 'type' => 'select', 'filter_key' => 'submitted_by', 'list' => $employees_names ), 'ingerence' => array( 'title' => 'Status', 'width' => 'auto', 'type' => 'select', 'list' => $ingerence_status, 'filter_key' => 'ingerence', ), 'date' => array( 'title' => $this->l('Data'), 'width' => 'auto', 'type' => 'date', 'filter_key' => 'date', ), ); $helper = new HelperList(); $helper->allow_export = true; $helper->context = Context::getContext(); $helper->title = $this->displayName; $helper->className = $this->name; $helper->show_toolbar = true; $helper->simple_header = false; $helper->identifier = 'id'; $helper->actions = array('edit', 'delete', 'view'); $helper->shopLinkType = ''; $helper->token = Tools::getAdminTokenLite('AdminModules'); $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false) . '&configure=' . $this->name . '&tab_module='.$this->tab.'&modulename='.$this->name; return $helper->generateList($result, $this->fields_list); }Ktoś mógłby pomóc mnie w nakierowaniu na rozwiązanie problemu? Strona na którą zostaje przekierowany po kliknięciu na dowolny filtr wyników posiada na końcu adresu URL tylko http://localhost/prestashop/admincyferski/index.php?controller=AdminModules&token=jakiśtamtoken&submitFilterconfiguration=1#configuration
Edited by hakeryk2 (see edit history)Nie pomaga zmiana drugiego parametru w $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false) na true.
Link to comment
Share on other sites
0 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now