Jump to content

Galaron

Members
  • Posts

    8
  • Joined

  • Last visited

Profile Information

  • Activity
    Freelancer

Galaron's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Mmh, doesn't work. Field is rendered but stays empty when I enter module configuration page.
  2. Hi all, I'm facing a problem with the HelperForm and an input of password type: I'm developing a module for PrestaShop 1.6 with Bootstrap support and in my renderForm() method I declare my form fields like this: $fields_form[0]['form'] = array( 'legend' => array( 'title' => $this->l('Settings'), 'icon' => 'icon-cogs' ), 'input' => array( // All my fields here ), 'submit' => array( 'title' => $this->l('Save'), 'class' => 'button pull-right' ) ); One of these fields is an input of type password and I've declared it like this: array( 'type' => 'password', 'label' => $this->l('Password'), 'desc' => $this->l('My pwd description'), 'name' => 'MY_PASSWORD', 'required' => true ) And at the end of same method, just before the return statement, I load the current value like this: $helper->fields_value['MY_PASSWORD'] = Configuration::get('MY_PASSWORD'); The problem is that when I enter in the configuration page of my module, the password field is rendered with the Bootstrap nice CSS, but it is always empty. If I write inside it and then I save settings it works (I mean I get no error) but when page reload that field is empty again. If I change is type as a common text field like this: array( 'type' => 'text', 'label' => $this->l('Password'), 'desc' => $this->l('My pwd description'), 'name' => 'MY_PASSWORD', 'required' => true ) the problem vanish and it work as intended. Thanks you all for your time and attention.
  3. Up (sorry for double post, but i really need help on this issue)
  4. 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.
  5. Ciao Luigi, intanto volevo ringraziarti per l'attenzione. Il problema però persiste: nei tuoi appunti ho trovato un tutorial su come usare l'HelperForm, che però io ho già implementato con successo. Ora mi servirebbe implementare una HelperList, ma non ho capito bene come si fa. Come ho già scritto nel primo post, la lista si vede ed è popolata con i record della tabella, ma non riesco a farci nulla: cancellare i record, esaminarli, filtrarli, ecc... Se mi sono spiegato male, faccio mea culpa e non esitare a farmelo notare. Purtroppo con Prestashop non sono ancora ferratissimo...
  6. 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...
×
×
  • Create New...