diff --git a/ChangeLog b/ChangeLog index e8521a931fe..808cd473548 100644 --- a/ChangeLog +++ b/ChangeLog @@ -28,6 +28,7 @@ For users: - Other minor changes (features, look, fixes) - Changes in wizard installer to allow building autoexe installer for Windows with Apache and Mysql included. +- Add new predefined exports wizards (stocks, suppliers, taxes...). For developers: - Update code skeletons examples. diff --git a/dev/skeletons/modMyModule.class.php b/dev/skeletons/modMyModule.class.php index 07e1a6b306b..105c6afbb7d 100644 --- a/dev/skeletons/modMyModule.class.php +++ b/dev/skeletons/modMyModule.class.php @@ -86,6 +86,7 @@ class modMyModule extends DolibarrModules $this->requiredby = array(); // List of modules id to disable if this one is disabled $this->phpmin = array(4,1); // Minimum version of PHP required by module $this->need_dolibarr_version = array(2,4); // Minimum version of Dolibarr required by module + $this->langfiles = array("mymodule"); // Constants $this->const = array(); // List of parameters diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index 3ff868d7671..8b179ec21cc 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -31,6 +31,7 @@ require_once(DOL_DOCUMENT_ROOT.'/includes/modules/export/modules_export.php'); $langs->load("exports"); + if (! $user->societe_id == 0) accessforbidden(); @@ -41,7 +42,7 @@ $entitytoicon=array( 'tax'=>'generic' ,'tax_type'=>'generic', 'account'=>'account', 'payment'=>'payment', - 'product'=>'product','stock'=>'stock', + 'product'=>'product','stock'=>'generic','warehouse'=>'stock', 'other'=>'generic', ); $entitytolang=array( // Translation code @@ -53,7 +54,7 @@ $entitytolang=array( // Translation code 'tax'=>'SocialContribution','tax_type'=>'DictionnarySocialContributions', 'account'=>'BankTransactions', 'payment'=>'Payment', - 'product'=>'Product','stock'=>'Stock', + 'product'=>'Product','stock'=>'Stock','warehouse'=>'Warehouse', 'other'=>'Other' ); @@ -200,6 +201,7 @@ if ($step == 2 && $action == 'select_model') * Affichage Pages des Etapes */ + if ($step == 1 || ! $datatoexport) { llxHeader('',$langs->trans("NewExport")); @@ -268,7 +270,8 @@ if ($step == 1 || ! $datatoexport) if ($step == 2 && $datatoexport) { llxHeader('',$langs->trans("NewExport")); - + + /* * Affichage onglets */ diff --git a/htdocs/includes/modules/modStock.class.php b/htdocs/includes/modules/modStock.class.php index abcdea06a63..3e8860c2d5b 100644 --- a/htdocs/includes/modules/modStock.class.php +++ b/htdocs/includes/modules/modStock.class.php @@ -65,9 +65,10 @@ class modStock extends DolibarrModules $this->config_page_url = array("stock.php"); - // D�pendences + // Dependencies $this->depends = array("modProduit"); $this->requiredby = array(); + $this->langfiles = array("stocks"); // Constantes $this->const = array(); @@ -123,7 +124,7 @@ class modStock extends DolibarrModules $this->export_label[$r]="Stocks"; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_permission[$r]=array(array("stock","lire")); $this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",'p.fk_product_type'=>"Type",'p.label'=>"Label",'p.description'=>"Description",'p.note'=>"Note",'p.price'=>"Price",'p.tva_tx'=>'VAT','p.envente'=>"OnSell",'p.duration'=>"Duration",'p.datec'=>'DateCreation','p.tms'=>'DateModification','ps.reel'=>'RealStock','e.rowid'=>'IdWarehouse','e.label'=>'LabelWareHouse','e.label'=>'DescWareHouse','e.lieu'=>'LieuWareHouse','e.address'=>'Address','e.cp'=>'Zip','e.ville'=>'Town'); - $this->export_entities_array[$r]=array('p.rowid'=>"product",'p.ref'=>"product",'p.fk_product_type'=>"product",'p.label'=>"product",'p.description'=>"product",'p.note'=>"product",'p.price'=>"product",'p.tva_tx'=>'product','p.envente'=>"product",'p.duration'=>"product",'p.datec'=>'product','p.tms'=>'product','ps.reel'=>'other','e.rowid'=>'stock','e.label'=>'stock','e.label'=>'stock','e.lieu'=>'stock','e.address'=>'stock','e.cp'=>'stock','e.ville'=>'stock'); + $this->export_entities_array[$r]=array('p.rowid'=>"product",'p.ref'=>"product",'p.fk_product_type'=>"product",'p.label'=>"product",'p.description'=>"product",'p.note'=>"product",'p.price'=>"product",'p.tva_tx'=>'product','p.envente'=>"product",'p.duration'=>"product",'p.datec'=>'product','p.tms'=>'product','ps.reel'=>'stock','e.rowid'=>'warehouse','e.label'=>'warehouse','e.label'=>'warehouse','e.lieu'=>'warehouse','e.address'=>'warehouse','e.cp'=>'warehouse','e.ville'=>'warehouse'); $this->export_alias_array[$r]=array('p.rowid'=>"id",'p.ref'=>"ref",'p.fk_product_type'=>"type",'p.label'=>"label",'p.description'=>"description",'p.note'=>"note",'p.price'=>"price",'p.tva_tx'=>'vat','p.envente'=>"onsell",'p.duration'=>"duration",'p.datec'=>'datecreation','p.tms'=>'datemodification','ps.reel'=>'quantity','e.rowid'=>'idwarehouse','e.label'=>'labelwarehouse','e.label'=>'descwarehouse','e.lieu'=>'lieuwarehouse','e.address'=>'addresswarehouse','e.cp'=>'zipwarehouse','e.ville'=>'townwarehouse'); $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'product as p, '.MAIN_DB_PREFIX.'product_stock as ps, '.MAIN_DB_PREFIX.'entrepot as e'; @@ -136,7 +137,7 @@ class modStock extends DolibarrModules */ function init() { - $sql = array(); + $sql = array(); return $this->_init($sql); } diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 8771568d981..99024adfffb 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -49,4 +49,7 @@ TheoreticalStock=Stock th MininumStock=Minimum stock StockUp=Stock up MininumStockShort=Stock min -StockUpShort=Stock up \ No newline at end of file +StockUpShort=Stock up +IdWarehouse=Id warehouse +DescWareHouse=Description warehouse +LieuWareHouse=Localisation warehouse \ No newline at end of file diff --git a/htdocs/langs/fr_FR/stocks.lang b/htdocs/langs/fr_FR/stocks.lang index 560d6baee60..a6e0bc5c553 100644 --- a/htdocs/langs/fr_FR/stocks.lang +++ b/htdocs/langs/fr_FR/stocks.lang @@ -49,4 +49,7 @@ TheoreticalStock=Stock th MininumStock=Stock minimum StockUp=Stock maximum MininumStockShort=Stock min -StockUpShort=Stock max \ No newline at end of file +StockUpShort=Stock max +IdWarehouse=Id entrepôt +DescWareHouse=Description entrepôt +LieuWareHouse=Lieu entrepôt diff --git a/htdocs/user/info.php b/htdocs/user/info.php index 130cf1652b1..1761a5b63bb 100644 --- a/htdocs/user/info.php +++ b/htdocs/user/info.php @@ -29,7 +29,7 @@ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT.'/lib/usergroups.lib.php'); require_once(DOL_DOCUMENT_ROOT."/user.class.php"); -$langs->load("user"); +$langs->load("users"); // Sécurité accés client et commerciaux $id = isset($_GET["id"])?$_GET["id"]:''; diff --git a/htdocs/user/note.php b/htdocs/user/note.php index 8240f4ecece..b42781937c6 100644 --- a/htdocs/user/note.php +++ b/htdocs/user/note.php @@ -36,6 +36,7 @@ $id=isset($_GET["id"])?$_GET["id"]:(isset($_POST["id"])?$_POST["id"]:""); $langs->load("companies"); $langs->load("members"); $langs->load("bills"); +$langs->load("users"); $fuser = new User($db); $fuser->id = $id;