From 6f799f8e1613e1121b892f411a495f1fabfd88c5 Mon Sep 17 00:00:00 2001 From: simnandez Date: Sat, 13 Oct 2012 18:02:43 +0200 Subject: [PATCH 1/2] New: More import options. Warehouses --- htdocs/core/modules/modStock.class.php | 29 ++++++++++++++++++++++++++ htdocs/langs/ca_ES/stocks.lang | 1 + htdocs/langs/en_US/stocks.lang | 1 + htdocs/langs/es_ES/stocks.lang | 1 + htdocs/langs/fr_FR/stocks.lang | 1 + 5 files changed, 33 insertions(+) diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index 2af2ce148fb..092cb0117d8 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003-2006 Rodolphe Quiedeville * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2012 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -130,6 +131,34 @@ class modStock extends DolibarrModules $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'; $this->export_sql_end[$r] .=' WHERE p.rowid = ps.fk_product AND ps.fk_entrepot = e.rowid'; $this->export_sql_end[$r] .=' AND e.entity = '.$conf->entity; + + + // Imports + //-------- + + $r=0; + + $r++; + $this->import_code[$r]=$this->rights_class.'_'.$r; + $this->import_label[$r]="Warehouses"; // Translation key + $this->import_icon[$r]=$this->picto; + $this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon + $this->import_tables_array[$r]=array('e'=>MAIN_DB_PREFIX.'entrepot'); + $this->import_tables_creator_array[$r]=array('e'=>'fk_user_author'); + $this->import_fields_array[$r]=array('e.label'=>"LocationSummary*", + 'e.description'=>"DescWareHouse",'e.lieu'=>"LieuWareHouse", + 'e.address'=>"Address",'e.cp'=>'Zip','e.fk_pays'=>'CountryCode', + 'e.statut'=>'Status' + ); + + $this->import_convertvalue_array[$r]=array( + 'e.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/cpays.class.php','class'=>'Cpays','method'=>'fetch','dict'=>'DictionnaryCountry') + ); + $this->import_regex_array[$r]=array('e.statut'=>'^[0|1]'); + $this->import_examplevalues_array[$r]=array('e.label'=>"ALM001", + 'e.description'=>"Central Warehouse",'e.lieu'=>"Central", + 'e.address'=>"Route 66",'e.cp'=>'28080','e.fk_pays'=>'US', + 'e.statut'=>'1'); } /** diff --git a/htdocs/langs/ca_ES/stocks.lang b/htdocs/langs/ca_ES/stocks.lang index e4bd2affa13..0bba23324a6 100644 --- a/htdocs/langs/ca_ES/stocks.lang +++ b/htdocs/langs/ca_ES/stocks.lang @@ -2,6 +2,7 @@ CHARSET=UTF-8 WarehouseCard=Fitxa magatzem Warehouse=Magatzem +Warehouses=Magatzems NewWarehouse=Nou magatzem o zona d'emmagatzematge WarehouseEdit=Edició magatzem MenuNewWarehouse=Nou magatzem diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 25ab06d758c..35aa3ca537a 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -2,6 +2,7 @@ CHARSET=UTF-8 WarehouseCard=Warehouse card Warehouse=Warehouse +Warehouses=Warehouses NewWarehouse=New warehouse / Stock area WarehouseEdit=Modify warehouse MenuNewWarehouse=New warehouse diff --git a/htdocs/langs/es_ES/stocks.lang b/htdocs/langs/es_ES/stocks.lang index 55a440302a7..fe51937ac65 100644 --- a/htdocs/langs/es_ES/stocks.lang +++ b/htdocs/langs/es_ES/stocks.lang @@ -2,6 +2,7 @@ CHARSET=UTF-8 WarehouseCard=Ficha almacén Warehouse=Almacén +Warehouses=Almacenes NewWarehouse=Nuevo almacén o zona de almacenaje WarehouseEdit=Edición almacén MenuNewWarehouse=Nuevo almacén diff --git a/htdocs/langs/fr_FR/stocks.lang b/htdocs/langs/fr_FR/stocks.lang index 3c15858ea9a..fb016e23ef3 100644 --- a/htdocs/langs/fr_FR/stocks.lang +++ b/htdocs/langs/fr_FR/stocks.lang @@ -2,6 +2,7 @@ CHARSET=UTF-8 WarehouseCard=Fiche entrepôt Warehouse=Entrepôt +Warehouse=Entrepôts NewWarehouse=Nouvel entrepôt ou zone de stockage WarehouseEdit=Edition entrepôt MenuNewWarehouse=Nouvel entrepôt From 59e8964bc5512cdaeee08493125634a2c4b361bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sun, 14 Oct 2012 23:56:28 +0200 Subject: [PATCH 2/2] Fixed PHP warning on MailmanSPIP module Also simplified the code and removed unused variables from it --- htdocs/core/lib/mailmanspip.lib.php | 33 +++++++++++++---------------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/htdocs/core/lib/mailmanspip.lib.php b/htdocs/core/lib/mailmanspip.lib.php index 329e1d05af8..739413e975a 100644 --- a/htdocs/core/lib/mailmanspip.lib.php +++ b/htdocs/core/lib/mailmanspip.lib.php @@ -24,27 +24,24 @@ /** * Return array head with list of tabs to view object informations * - * @param Object $object Member - * @return array head + * @return array Tabs of the module */ -function mailmanspip_admin_prepare_head($object) +function mailmanspip_admin_prepare_head() { - global $langs, $conf, $user; + global $langs; - $h = 0; - $head = array(); - - $head[$h][0] = DOL_URL_ROOT.'/adherents/admin/mailman.php'; - $head[$h][1] = $langs->trans("Mailman"); - $head[$h][2] = 'mailman'; - $h++; - - $head[$h][0] = DOL_URL_ROOT.'/adherents/admin/spip.php'; - $head[$h][1] = $langs->trans("SPIP"); - $head[$h][2] = 'spip'; - $h++; - - return $head; + return array( + array( + DOL_URL_ROOT.'/adherents/admin/mailman.php', + $langs->trans('Mailman'), + 'mailman' + ), + array( + DOL_URL_ROOT.'/adherents/admin/spip.php', + $langs->trans('SPIP'), + 'spip' + ) + ); } ?> \ No newline at end of file