From 39c8a8fc2d1fb6dbbbe605350b17ee3b86b159bf Mon Sep 17 00:00:00 2001 From: gr4devel Date: Thu, 29 Aug 2013 21:32:10 +0200 Subject: [PATCH 1/4] [+] MO : add the option to show all Manufacturer Add the option to show all Manufacturer in blocktopmenu module. --- modules/blocktopmenu/blocktopmenu.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/modules/blocktopmenu/blocktopmenu.php b/modules/blocktopmenu/blocktopmenu.php index 724ea4da3..39558ee6f 100644 --- a/modules/blocktopmenu/blocktopmenu.php +++ b/modules/blocktopmenu/blocktopmenu.php @@ -228,6 +228,8 @@ class Blocktopmenu extends Module // BEGIN Manufacturer $this->_html .= ''; + // Option to show all Manufacturer + $this->_html .= ''; $manufacturers = Manufacturer::getManufacturers(false, $id_lang); foreach ($manufacturers as $manufacturer) $this->_html .= ''; @@ -472,6 +474,11 @@ class Blocktopmenu extends Module $this->_html .= ''.PHP_EOL; break; + // Case to handle the option to show all Manufacturer + case 'ALLMAN': + $this->_html .= ''.PHP_EOL; + break; + case 'MAN': $manufacturer = new Manufacturer((int)$id, (int)$id_lang); if (Validate::isLoadedObject($manufacturer)) @@ -563,6 +570,17 @@ class Blocktopmenu extends Module } break; + // Case to handle the option to show all Manufacturer + case 'ALLMAN': + $this->_menu .= '
  • '.$this->l('All manufacturers').'
      '.PHP_EOL; + $manufacturers = Manufacturer::getManufacturers(); + $link = new Link; + foreach ($manufacturers as $key => $manufacturer) { + $this->_menu .= '
    • '.$manufacturer['name'].'
    • '.PHP_EOL; + } + $this->_menu .= '
    '; + break; + case 'SUP': $selected = ($this->page_name == 'supplier' && (Tools::getValue('id_supplier') == $id)) ? ' class="sfHover"' : ''; $supplier = new Supplier((int)$id, (int)$id_lang); @@ -896,4 +914,4 @@ class Blocktopmenu extends Module } -} \ No newline at end of file +} From 6177589cd38cdb4978e1c24dff568dc45cf242b8 Mon Sep 17 00:00:00 2001 From: gr4devel Date: Mon, 2 Sep 2013 11:57:16 +0200 Subject: [PATCH 2/4] [+] MO : add link to all manufacturer page and the feature to show All Suppliers --- modules/blocktopmenu/blocktopmenu.php | 34 ++++++++++++++++++++------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/modules/blocktopmenu/blocktopmenu.php b/modules/blocktopmenu/blocktopmenu.php index 39558ee6f..a5eb3b3c5 100644 --- a/modules/blocktopmenu/blocktopmenu.php +++ b/modules/blocktopmenu/blocktopmenu.php @@ -221,6 +221,8 @@ class Blocktopmenu extends Module // BEGIN SUPPLIER $this->_html .= ''; + // Option to show all Suppliers + $this->_html .= ''; $suppliers = Supplier::getSuppliers(false, $id_lang); foreach ($suppliers as $supplier) $this->_html .= ''; @@ -228,7 +230,7 @@ class Blocktopmenu extends Module // BEGIN Manufacturer $this->_html .= ''; - // Option to show all Manufacturer + // Option to show all Manufacturers $this->_html .= ''; $manufacturers = Manufacturer::getManufacturers(false, $id_lang); foreach ($manufacturers as $manufacturer) @@ -474,7 +476,7 @@ class Blocktopmenu extends Module $this->_html .= ''.PHP_EOL; break; - // Case to handle the option to show all Manufacturer + // Case to handle the option to show all Manufacturers case 'ALLMAN': $this->_html .= ''.PHP_EOL; break; @@ -485,6 +487,11 @@ class Blocktopmenu extends Module $this->_html .= ''.PHP_EOL; break; + // Case to handle the option to show all Suppliers + case 'ALLSUP': + $this->_html .= ''.PHP_EOL; + break; + case 'SUP': $supplier = new Supplier((int)$id, (int)$id_lang); if (Validate::isLoadedObject($supplier)) @@ -556,6 +563,16 @@ class Blocktopmenu extends Module } break; + // Case to handle the option to show all Manufacturers + case 'ALLMAN': + $link = new Link; + $this->_menu .= '
  • '.$this->l('All manufacturers').'
      '.PHP_EOL; + $manufacturers = Manufacturer::getManufacturers(); + foreach ($manufacturers as $key => $manufacturer) + $this->_menu .= '
    • '.$manufacturer['name'].'
    • '.PHP_EOL; + $this->_menu .= '
    '; + break; + case 'MAN': $selected = ($this->page_name == 'manufacturer' && (Tools::getValue('id_manufacturer') == $id)) ? ' class="sfHover"' : ''; $manufacturer = new Manufacturer((int)$id, (int)$id_lang); @@ -570,14 +587,13 @@ class Blocktopmenu extends Module } break; - // Case to handle the option to show all Manufacturer - case 'ALLMAN': - $this->_menu .= '
  • '.$this->l('All manufacturers').'
      '.PHP_EOL; - $manufacturers = Manufacturer::getManufacturers(); + // Case to handle the option to show all Suppliers + case 'ALLSUP': $link = new Link; - foreach ($manufacturers as $key => $manufacturer) { - $this->_menu .= '
    • '.$manufacturer['name'].'
    • '.PHP_EOL; - } + $this->_menu .= '
    • '.$this->l('All suppliers').'
        '.PHP_EOL; + $suppliers = Supplier::getSuppliers(); + foreach ($suppliers as $key => $supplier) + $this->_menu .= '
      • '.$supplier['name'].'
      • '.PHP_EOL; $this->_menu .= '
      '; break; From 36ca7f294a33a603ab794ee3d040fcd97d070ccb Mon Sep 17 00:00:00 2001 From: gr4devel Date: Mon, 2 Sep 2013 14:15:33 +0200 Subject: [PATCH 3/4] [+] BO : add TinyMCE editor for supplier descrpition in AdminManufacturerSupplier --- controllers/admin/AdminSuppliersController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controllers/admin/AdminSuppliersController.php b/controllers/admin/AdminSuppliersController.php index 22e30efb4..aaca8381f 100644 --- a/controllers/admin/AdminSuppliersController.php +++ b/controllers/admin/AdminSuppliersController.php @@ -94,7 +94,8 @@ class AdminSuppliersControllerCore extends AdminController 'rows' => 10, 'lang' => true, 'hint' => $this->l('Invalid characters:').' <>;=#{}', - 'desc' => $this->l('Will appear in the supplier list') + 'desc' => $this->l('Will appear in the supplier list'), + 'autoload_rte' => 'rte', //Enable TinyMCE editor for short description ), array( 'type' => 'text', From f535d60a2930b93294ad0ccb2f69cecbed32388b Mon Sep 17 00:00:00 2001 From: gr4devel Date: Mon, 2 Sep 2013 14:24:18 +0200 Subject: [PATCH 4/4] [-] fix typo in adding TinyMCE editor for supplier descrpition in AdminSuppliersController --- controllers/admin/AdminSuppliersController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/admin/AdminSuppliersController.php b/controllers/admin/AdminSuppliersController.php index aaca8381f..bfe5618a3 100644 --- a/controllers/admin/AdminSuppliersController.php +++ b/controllers/admin/AdminSuppliersController.php @@ -95,7 +95,7 @@ class AdminSuppliersControllerCore extends AdminController 'lang' => true, 'hint' => $this->l('Invalid characters:').' <>;=#{}', 'desc' => $this->l('Will appear in the supplier list'), - 'autoload_rte' => 'rte', //Enable TinyMCE editor for short description + 'autoload_rte' => 'rte' //Enable TinyMCE editor for short description ), array( 'type' => 'text',