Search the Community
Showing results for tags 'HelperList'.
-
I need to disable edit button based on a my module's renderlist from an admin controller I had created. Eg: if the value has a date >= today edit button should be working it should be disabled. I understand that I could just redirect the edit link to listing page for a date expired case but if it's possible to disable the edit button it would be better Here's the screenshot of what I am trying to do. The cross mark means need to be disabled. As you can see the field right before actions column is also done according to the said condition
- 1 reply
-
- prestashop
- helperlist
-
(and 2 more)
Tagged with:
-
Hi prestashopers. I write a module in which I save information in a complex form - serialized. The display of such information is illegible and unedited, which is why I want to display the input form. I just wanted to insert a value: public function renderForm() { $ unserializedArray = unserialize (AdParameters :: getParametersValue (Tools :: getValue ('id_ad_parameters'))); $ Result = ''; foreach ($ unserializedArray as $ key => $ row) { foreach ($ row as $ element) { $ Result. = '['. $ Element. ']'; } if (isset ($ unserializedArray [$ key + 1])) $ MyValue. = "\ R \ n"; } $ helper-> fields_value ['parameters_value'] = $ MyValue; ................ Form return parent::renderForm(); } AdParameters :: getParametersValue() is function quering DB When I list MyValue everythink is ok but in my list is not ok. However, it does not change the value. I need to replace it in the table and when editing in the form. Can anyone help me with this? Please. if you need a broader explanation, let me know, I'll send them.
-
- helperlist
- backoffice
- (and 10 more)
-
Hello community, I am developing a module and I need use helperList in public function getContent (responsible for module configuration page) but I have a problem. I menaged to generate the table with content and sorting headers that I want but I can't use filtering options which is pretty essential in my case. When I try to sort table I am redirected to module list page with http://localhost/prestashop/admincyferski/index.php?controller=AdminModules&token=some-kind-of-token&submitFilterconfiguration=1#configuration Code of my getContent is this: 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); } I tried with $this->context->link->getAdminLink('AdminModules', false) on true but it didn't work either. Prestashop version is 1.6.1.4
- 2 replies
-
- helperList
- helper
-
(and 2 more)
Tagged with:
-
Hi there fellow developers, I need a bit of help with regard to the actions performed on a list generated by HelperList. The documentation only specifies that having the buttons (edit, delete, view) doesn't do anything but you have to "add proper code for the buttons", but there's no clear example on how to do that, what to add to the controller, and what function is actually called when you click on the buttons. So here's a child admin controller for a module, with a list generated, that part works fine. When you move the mouse over to edit, view, or delete, it's obvious the helper generates links like "update[tablename]", "delete[tablename]", and "view[tablename]", but there's no way you can actually call any function from the same controller. I tried creating public functions update, delete, view, to no avail. How are we supposed to tell the controller or the helper, what function to be called on clicking those buttons ? Here's the function for displaying the list (works perfectly) $db = Db::getInstance(); $sql='SELECT * FROM ' . _DB_PREFIX_ . 'bcard'; $results=$db->ExecuteS($sql); $this->fields_list = array( 'bcard_id' => array( 'title' => $this->l('Id'), 'width' => 140, 'type' => 'text' ), 'bcard_size' => array( 'title' => $this->l('Size'), 'width' => 140, 'type' => 'text' ), 'bcard_description' => array( 'title' => $this->l('Description'), 'width' => 'auto', 'type' => 'text' ) ); $helper= new HelperList(); $helper->shopLinkType = ''; $helper->simple_header = true; $helper->listTotal = count($results); $helper->actions = array('edit', 'delete', 'view','test'); $helper->module = $this; $helper->identifier = 'bcard_id'; $helper->show_toolbar = false; $helper->title = 'List of printable models'; $helper->table = 'bcard'; $helper->token = Tools::getAdminTokenLite('AdminBcardprint'); $helper->currentIndex = AdminController::$currentIndex; return $helper->generateList($results,$this->fields_list); } And here's an example of the link you get on the "Edit" button /[adminfolder]index.php?controller=AdminBcardprint&bcard_id=1&updatebcard&token=..... So where do I construct/build that "update" function ? Is it part of another helper ? Does a parent/core function from somewhere get called ? I've just seen that mr. Xavier Borderie actually admitted in a post, that for version 1.7 a lot of the functionality is still under the hood, and not publicly available, so I'm guessing someone else had to have had this issue too. Can anyone please tell me how can I build those functions for CRUD operations on that list, using either helpers, or custom functions ? Thank you !
- 5 replies
-
- helper list actions
- edit entries
-
(and 1 more)
Tagged with:
-
I make a module and i need make a custom button on my helper list. My code: protected function initList() { // Fix table drag bug. Media::addJsDef(array( 'currentIndex' => AdminController::$currentIndex.'&configure='.$this->name, )); $this->fields_list = array( 'name' => array( 'title' => $this->getTranslator()->trans('Category name', array(), 'Modules.Recpsbeta.Admin'), 'class' => 'fixed-width-xxl', 'type' => 'text', 'search' => false, 'orderby' => false ), 'position' => array( 'title' => $this->getTranslator()->trans('Position', array(), 'Modules.Recpsbeta.Admin'), 'class' => 'fixed-width-xxl', 'position' => 'position', 'search' => false, 'orderby' => false ), 'active' => array( 'title' => $this->getTranslator()->trans('Status', array(), 'Modules.Recpsbeta.Admin'), 'class' => 'fixed-width-xxl', 'active' => 'status', 'align' => 'center', 'type' => 'bool', 'search' => false, 'orderby' => false ), 'id_temp' => array( 'title' => $this->l('id_temp'), 'align' => 'text-center', 'callback' => 'printAll', 'orderby' => false, 'search' => false, 'class' => 'button', //'remove_onclick' => true ), ); if (Shop::isFeatureActive()) $this->fields_list['id_shop'] = array( 'title' => $this->getTranslator()->trans('ID Shop', array(), 'Modules.Recpsbeta.Admin'), 'align' => 'center', 'class' => 'fixed-width-sm', 'type' => 'int', 'search' => false, 'orderby' => false ); $helper = new HelperList(); $helper->shopLinkType = ''; $helper->simple_header = false; $helper->identifier = 'id_rec_ps_beta'; $helper->actions = array('edit', 'delete','pdf'); $helper->show_toolbar = true; $helper->toolbar_btn['new'] = array( 'href' => AdminController::$currentIndex.'&configure='.$this->name.'&add'.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules'), 'desc' => $this->getTranslator()->trans('Add new', array(), 'Modules.Recpsbeta.Admin') ); $helper->toolbar_btn['edit'] = array( 'href' => AdminController::$currentIndex.'&configure='.$this->name.'&setting'.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules'), 'desc' => $this->getTranslator()->trans('Setting', array(), 'Modules.Recpsbeta.Admin'), ); $helper->title = $this->displayName; $helper->table = $this->name; $helper->orderBy = 'position'; $helper->orderWay = 'ASC'; $helper->position_identifier = 'id_rec_ps_beta'; $helper->token = Tools::getAdminTokenLite('AdminModules'); $helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->name; return $helper; } And i call the function of the button: /*---------------------------printAll Function----------------------------*/ public function printAll($id) { return 'loool'; } But i see nothing: Someone help me please? I have not found a solution for days. Thx.
-
i have one module,on config page i render some helperlist.the code is this: protected function renderList() { $query = new DbQuery(); $query->select('*'); $query->from('carrier'); $query->where('active=1 AND deleted=0'); $rates = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query->build()); $fields_list = array( 'id_carrier' => array( 'title' => $this->l('ID'), 'align' => 'center', 'class' => 'fixed-width-xs' ), 'name' => array( 'title' => $this->l('Carrier') ), 'test' => array( 'title' => $this->l('test'), 'callback' => 'getSetCarrier', ), 'active' => array( 'title' => $this->l('Active'), ) ); $helper = new HelperList(); $helper->shopLinkType = 'shop'; $helper->simple_header = true; $helper->actions = array("edit"); $helper->show_toolbar = false; $helper->module = $this; $helper->listTotal = count($rates); $helper->identifier = 'id_carrier'; $helper->title = ''; $helper->table = $this->name; $helper->token = Tools::getAdminTokenLite('AdminModules'); $helper->currentIndex = AdminController::$currentIndex . '&configure=' . $this->name; return $helper->generateList($rates, $fields_list); } public function getSetCarrier() { return 'aaa'; } in the renderList function,i set the callback is getSetCarrier. And in getSetCarrier function,i return string 'aaa'. but,the carrier list is not echo 'aaa'
-
Buenos días, he creado un modulo personalizado y en la configuración del modulo he usado un HelperList para crear el listado sobre una tabla mysql. El listado me lo devuelve bien pero al activar los filtros no me filtra nada y tampoco hace la paginación. ¿Alguien me podría decir que estoy haciendo mal o que me falta para el filtro?. Filtrando con el where en el mysql logro filtrar los resultados pero cuando el resultado de la consulta solo devuelve 1 registro, los campos para filtrar y el botón para reinicializar el buscador desaparecen. Y si realizo un modulo que herede de ModuleAdminController también funciona bien, Pero me gustaría llevar esa funcionalidad al Module que tengo implementado. Ese modulo tiene un formulario de configuración y justo debajo tengo un listado implementado con el HelperList que me gustaría conseguir que filtrara. Gracias!!! $resultados = Db::getInstance()->executes("SELECT * FROM "._DB_PREFIX_."tabla sf ORDER BY id DESC"); $this->fields_list = array( 'id' => array( 'title'=>$this->l('Id'), 'width'=>'auto', 'type'=>'number', 'filter_key' => 'sf!id' ), 'tipo' => array ( 'title' => $this->l('Tipo Factura'), 'width' => 'auto', 'type' => 'text', 'filter_key' => 'sf!tipo' ), ); $helper = new HelperList(); $helper->shopLinkType = ''; $helper->simple_header = false; $helper->listTotal = count($resultados); $helper->actions = array('delete'); $helper->identifier = 'id'; $helper->title = $this->l('Listado'); $helper->_pagination = array(10, 20, 50, 100, 200); $helper->table = 'tabla'; $helper->token = Tools::getAdminTokenLite('AdminModules'); $helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->name; return $helper->generateList($resultados,$this->fields_list);
-
Hi everyone, I have created a helperList and defined the rowActions view, edit and delete. I have noticed that on clicking the row not the buttons, the action of the first rowAction i.e. 'view' in this case is performed. How can I disable it such that only the button click performs the action while clicking anywhere else on the table i.e. on the rows does nothing.
-
Hi everyone I created a helperList in prestashop. On list creation I notified a specific row of buttons on top right corner of the helperList that provided functions related to the database. Is it possible to modify those buttons and add functions related to our own needs? I have added an image of the helperList and marked those buttons with red squares.
-
Hi everyone, I have created a helperList and added an edit action to it. The problem is that the function renderForm linked to the edit action doesn't get called. I have pasted the code of my controller. Any idea what I am doing wrong? class AdminQuotationQuotationsController extends AdminController { public $module; public function __construct() { $this->module = Module::getInstanceByName('quotation'); $this->bootstrap = true; parent::__construct(); } private function createList() { $fields_list = array( 'quotation_name' => array( 'title' => $this->l('quotation_name'), 'width' => 140, 'type' => 'text', ), 'input_1' => array( 'title' => $this->l('input_1'), 'width' => 140, 'type' => 'text', ), ); $helper = new HelperList(); $helper->shopLinkType = ''; $helper->simple_header = false; // Actions to be displayed in the "Actions" column $helper->actions = array( 'edit', ); $helper->identifier = 'id_category'; $helper->show_toolbar = true; $helper->title = 'HelperList'; $helper->table = $this->name.'_categories'; $helper->token = Tools::getAdminTokenLite('AdminModules'); $helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->name; $quotation_data=''; $sql = 'SELECT * FROM '._DB_PREFIX_.'quotationforms'; $results = Db::getInstance()->ExecuteS($sql); if (empty($results)) { $quotation_data = 'Nothing'; } else { $quotation_data = $results; } if(Tools::isSubmit('deleteYOUR_OBJ_NAME_HERE')) {} return $helper->generateList($quotation_data,$fields_list); } public function renderView() { } public function renderForm() { $this->fields_form['input'][] = array( 'type' => 'switch', 'label' => $this->l('Enabled'), 'name' => 'active', 'required' => false, 'class' => 't', 'is_bool' => true, 'values' => array( array( 'id' => 'active_on', 'value' => 1, 'label' => $this->l('Enabled') ), array( 'id' => 'active_off', 'value' => 0, 'label' => $this->l('Disabled') ) ), 'hint' => $this->l('Enable or disable affiliate.') ); $this->fields_form['submit'] = array( 'title' => $this->l('Save'), ); $this->fields_value = (array)$this->obj; return parent::renderForm(); } public function renderList() { return $this->context->smarty->fetch($this->module->getLocalPath() . 'views/templates/admin/configure.tpl').$this->createList(); } }
-
Hello, I found problem with pagination at backoffice. One of my client got big list of categories and features. Everything is fine with paggination but when u get deeper in the tree pagination stop working, because it always trying execute pagination at the begining of the tree. It happening at AdminCategory and AdminFeratures but i think it would happen for every usage of helper list. I could find the soulution but maybe someone is aware of this problem and got the answer? I will be grateful for any help.
-
I know how to add the export option to any admin list. It is done with `$this->allow_export=true` in the corresponding AdminController. But how can you add it to the group view, which is in fact a list of customers for that group?. If I add `$this->allow_export=true` to AdminGroupsController then the list of groups is exportable, but not the list of customers that you get when you click in a group show icon. I looked at the source code and I saw that the list is generated with the `HelperList` class, but I didn't see anything helpful there. Thanks.
-
Nie mogę dojść do ładu z $helper'em HelperList ;(
hakeryk2 posted a question in Wsparcie i pomoc użytkowników
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 Nie pomaga zmiana drugiego parametru w $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false) na true.-
- helperList
- getContent
-
(and 1 more)
Tagged with:
-
Salve a tutti, ho iniziato da poco a lavorare con Prestashop ed ho installata la versione 1.5.6, quindi invoco subito il vostro perdono per la mia ignoranza in materia. Sto realizzando un modulo dotato di pagina di configurazione: in questa pagina, oltre al form di configurazione che ho realizzato tramite HelperForm (e che funziona perfettamente), vorrei che comparisse anche una lista che mi permetta di manipolare una tabella MySQL che ho creato ad-hoc. Cercando sulla documentazione, ho trovato la classe HelperList che fa proprio al caso mio, ma non ho ben capito come si usa: devo mettere tutto alla classe del modulo (che estende la classe Module), o devo creare un'altra classe? Al momento la situazione è questa: class MioModulo extends Module{ public function __construct(){ // Codice del costruttore } public function install(){ // Codice metodo install } public function uninstall(){ // Codice metodo uninstall } public function getContent(){ // Codice metodo getContent } public function renderForm(){ // Codice per generare l'HelperForm $fields_list = array( 'id_order' => array( 'title' => $this->l('Order ID'), 'width' => 80, 'align' => 'center', 'type' => 'int', 'orderby' => true ), 'order_status' => array( 'title' => $this->l('Status'), 'width' => 100, 'align' => 'center', 'type' => 'bool', 'icon' => array( 0 => 'disabled.gif', 1 => 'enabled.gif', 'default' => 'disabled.gif' ) ), 'tracking' => array( 'title' => $this->l('Tracking code'), 'width' => auto, 'type' => 'text', 'search' => false ), 'error_message' => array( 'title' => $this->l('Error message'), 'width' => auto, 'type' => 'text', 'search' => false ), ); $helperList = new HelperList(); $helperList->table = self::$mysql_table_name; $helperList->_select = Db::getInstance()->ExecuteS('SELECT * FROM ' ._DB_PREFIX_. self::$mysql_table_name); $helperList->module = $this; $helperList->title = $this->l('Orders'); $helperList->token = Tools::getAdminTokenLite('AdminModules'); $helperList->currentIndex = AdminController::$currentIndex.'&configure='.$this->name; $helperList->show_toolbar = false; $helperList->simple_header = false; // Actions to be displayed in the "Actions" column $helperList->actions = array('delete', 'view'); return $helper->generateForm($fields_form) . "<br/>" . $helperList->generateList($helperList->_select, $fields_list); } } Il risultato che ottengono, è che accedendo alla pagina di configurazione del mio modulo, vedo in alto l'HelperForm (che ricordo funzionare perfettamente) ed in basso l'HelperList popolata con i record della mia tabella. Però molte cose non funzionano: se ad esempio provo a filtrare i risultati per id o status (le prime due colonne), non succede nulla. Ogni singola riga continua ad essere cliccabile, anche se ho provato a specificare il contrario con $helperList->list_no_link = true; E poi, la cosa che più mi preme, non ho capito bene come/dove aggiungere il codice per far funzionare le azioni che ho richiesto con $helperList->actions = array('delete', 'view'); (infatti se clicco sulle icone, che compaiono correttamente, in realtà non mi fa cancellare o esaminare nulla). Scusate ancora se questi per voi sono argomenti di livello base, ma la documentazione di Prestashop non è proprio delle migliori...
- 3 replies
-
- modulo
- HelperList
-
(and 1 more)
Tagged with:
-
Alors avant toute chose, je précise que j'ai déjà recherché et que je n'ai pas trouvé de solution, je n'ouvre pas ce sujet par flemme. Comme certains, j'essaie de faire apparaître dans mon tableau en admin, les flèches pour modifier mes positions directement (comme les catégories, par exemple). J'ai fouillé et j'ai trouvé un certain nombre de sujet, notamment sur ce forum, mais orienté pour Presta 1.5, et vu que je suis sur 1.6 et que ça ne marche pas, peut être y a-t-il des subtilités ou des différences que je n'ai pas trouvé. Voici mon code : $helper = new HelperList(); $helper->shopLinkType = ''; $helper->actions = array('edit', 'delete', 'view'); $helper->title = $this->l('Catégories'); $helper->token = Tools::getValue('token'); //$helper->currentIndex = AdminController::$currentIndex.'&configure='; $helper->_defaultOrderBy = 'position'; $helper->explicitSelect = true; $fields_list = array( 'id_category' => array( 'title' => $this->l('ID'), 'align' => 'text-center', 'class' => 'fixed-width-xs', 'orderby' => true, 'havingFilter' => true, 'tmpTableFilter' => true, ), 'name' => array( 'title' => $this->l('Name'), ), 'position' => array( 'title' => $this->l('Position'), 'class' => 'fixed-width-xs', 'position' => 'position', 'align' => 'center' ) ); $categories = Db::getInstance()->ExecuteS('SELECT id_category, name, position /* etc */ '); $this->content .= $helper->generateList($categories,$fields_list); Du coup, je me retrouve avec mon tableau qui affiche les bonnes données, sauf les positions dont toutes les valeurs sont incrémentées par rapport à la base de donnée. J'utilise cette méthode et pas celle déjà présente de base dans le constructeur, parce que je voudrais afficher deux tableaux sur la même pas (et j'y arrive) et que c'est le seul moyen que j'ai trouvé. Mais du coup, mon tri ne marche pas... Il manque quelque chose ? Mauvaise syntaxe ? Eléments dans le désordre ?
- 4 replies
-
- Prestashop 1.6
- HelperList
-
(and 2 more)
Tagged with:
-
Bonjour tout le monde Je crée dois actuellement un module coté admin pour avoir une nouvelle page dans l'admin avec des données d'une bdd externe (donc pas la bdd prestashop). 1) J'ai réussi à générer une nouvelle page dans l'admin et à récuperer les données de ma bdd externe grâce aux Helper Prestashop (HelperList ici) seulement après sur le clic des "row actions" par exemple "éditer, supprimer, details) ça ne marche pas, j'ai cru voir que c'était géré avec ObjectModel mais moi j'utilise une bdd externe :/ y'a t'il un moyen quand même ? ou alors un autre moyen pour passer de ma page admin1 à une page admin2 avec transmission de variables en get ou post ? 2) Sinon au pire je n'utiliserai pas les helpers mais dans ce cas comment afficher une page perso dans l'admin avec un tpl perso ? quand j'utilise dans mon controller la méthode initContent avec un display('montpl.tpl') j'ai un bug d'affichage, on dirait que la page s'affiche plusieurs fois (2 headers, 2 sidebar, etc) , enfait le code à l'air d'être injecté avant le doctype... Merci beaucoup à ceux qui seront capable de m'aider ! et bonne journée !
- 1 reply
-
- ObjectModel
- external database
-
(and 2 more)
Tagged with:
-
Bonjour, Je m'initie à prestashop et j'ai commencé par la 1.5. J'essaye donc de comprendre les helpers du backoffice. Je me suis fait un petit module basé sur les helperform et ça marche très bien. De même j'ai implementé un helperlist qui appelle le helperform et ça marche. En revanche quand je mets simple_header = true, les tris, filtres ne fonctionnent pas. $helper = new HelperList(); $helper -> simple_header = true; Y'a-t-il une doc plus détaillée que Doc.prestashop.com/PS15/HelperList ? Une autre façon de poser ma question, pour voir si c'est lié à mon code : comment corriger blockreinsurance avec simple_header=true, au lieu de false comme par défaut dans ce module, pour que les filtres fonctionnent ? Merci d'avance.
-
hi, i am build new module for administration, but i have problem with helperList (http://doc.prestashop.com/display/PS15/HelperList) i can load products to list, but pagination is not working, also helperList returns 0 in total results $helperList = new HelperList(); $helperList->bulk_actions = array( 'delete'=>array( 'text'=>$this->l('Delete selected'), 'confirm'=>$this->l('Delete selected items?')) ); $helperList->_select = Product::getProducts($this->context->language->id, 0, '','id_product','ASC'); $helperList->_defaultOrderBy = 'id_product'; $fields_list = array( 'id_product' => array( 'title' => $this->l('ID'), 'align' => 'center', 'width' => 50, ), 'name' => array( 'title' => $this->l('Name'), 'width' => 'auto' ) ); $helperList->identifier = 'id_product'; $helperList->title = $this->l('Produkty a kategórie'); $helperList->token = Tools::getAdminTokenLite('AdminModules'); $helperList->currentIndex = AdminController::$currentIndex.'&configure='.$this->name; $helperList->table = $this->name.'_products'; return $helperList->generateList($helperList->_select, $fields_list);
-
Hi all guys, I'm an Italian and freshly user of Prestashop 1.5.6, so sorry for my not-so-good English and my low skills with Presta. Here's my problem: I'm developing a custom module that has a configuration page in back-office. I've made this page using a HelperForm as per the guide: http://doc.prestashop.com/display/PS15/Creating+a+PrestaShop+module#CreatingaPrestaShopmodule-Addingaconfigurationpage This form works perfectly. What I'm trying to do now, is show the content of a custom MySQL table UNDER the HelperForm, in the same page. Reading the documentation, it seems to me that I've to use an HelperList, but I'm really confused on how to do it. The best result I've obtained, is to show the list with the correct entries from MySQL table, but I'm not sure I've done it the right way: in fact, I can't make the remove and view actions work, neither the columns filtering. Another problem is that all the rows are "clickable" (even if then nothing happens), and I don't want it. Thanks you all in advance for your time.
-
Bonjour à tous J'ai créé un module qui intègre l'affichage d'une liste de commandes par un HelperList. Le HelperList génère automatiquement une colonne "actions" avec une icone de modification pour chaque ligne. Actuellement le clic sur cette icone (tout comme le clic sur la ligne d'ailleurs) se contente de recharger la page actuelle. Comment agir sur ce clic ? Je souhaiterai en fait renvoyer vers l'edition de la commande en question. merci
- 3 replies
-
- HelperList
- module
-
(and 3 more)
Tagged with:
-
Bonjour à tous J'ai créé un module qui intègre l'affichage d'une liste de commandes par un HelperList. Le HelperList génère automatiquement une colonne "actions" avec une icone de modification pour chaque ligne. Actuellement le clic sur cette icone (tout comme le clic sur la ligne d'ailleurs) se contente de recharger la page actuelle. Comment agir sur ce clic ? Je souhaiterai en fait renvoyer vers l'edition de la commande en question. merci
- 1 reply
-
- helperlist
- action
-
(and 2 more)
Tagged with:
-
Bonsoir, Je travaille sur un module et je bloque sur l'utilisation des HelperList. Dans mon fichier j'ai la fonction GetContent pour la gestion de la configuration du module. Avec la configuration je remplis un formulaire, qui remplit ma base de données jusque là tout est ok. Mais je veux mettre en dessous du formulaire une liste des valeurs qui existent dèjà en base de données. Je fais donc une fonction initList() dans laquelle je déclare une instance de HelperList, (j'ai suivi le dev book). Au bout je retourne mon helper. Quand j'apelle ma fonction dans le GetContent qui me retourne du html, ma log me dit que un helper ne peut pas être parse en html et je le comprends. Donc existe il une fonction de helperlist qui permet d'avoir un rendu html ? ou un lien vers un tuto qui explique correctement comment je peux gérer mon besoin ? Merci d'avance et bonnes fêtes !!!
-
Hi, i'm new in prestashop, i'm from Cuba so sorry for my english. The fact is that i want to use the HelperList class in configuration page of a developed module , i have the next code in getContent function, the list is rendered but records of db table i want to show are not. public function getContent() { $helperList = new HelperList(); $helperList->table = 'product_promoted_form_list'; $helperList->bulk_actions = array('delete'=>array('text'=>$this->l('Delete selected'), 'confirm'=>$this->l('Delete selected items?'))); $helperList->_select = 'id_product, url_product, url_product_image'; $helperList->module = $this; $helperList->title = $this->l('Lista de productos promocionados'); $helperList->token = Tools::getAdminTokenLite('AdminModules'); $helperList->currentIndex = AdminController::$currentIndex . '&configure=' . $this->name; $helperList->show_toolbar = true; $helperList->toolbar_scroll = true; $helper->toolbar_btn = array( 'back' => array( 'href' => AdminController::$currentIndex . '&token=' . Tools::getAdminTokenLite('AdminModules'), 'desc' => $this->l('Back to list') ) ); $helperList->_defaultOrderBy = 'id_product'; $fields_list = array( 'id_product' => array( 'title' => $this->l('ID'), 'align' => 'center', 'width' => 25 ), 'url_product' => array( 'title' => $this->l('Url product'), 'width' => 'auto' ), 'url_product_image' => array( 'title' => $this->l('Url image product'), 'width' => 'auto' ) ); return $helperList->generateList($helperList->_select, $fields_list); } I'll appreciate any help. Regards.