diff --git a/htdocs/exports/index.php b/htdocs/exports/index.php index aae4fdf8196..7fc0dcf5a6d 100644 --- a/htdocs/exports/index.php +++ b/htdocs/exports/index.php @@ -97,7 +97,8 @@ if (sizeof($export->array_export_code)) print img_object($export->array_export_module[$key]->getName(),$export->array_export_module[$key]->picto).' '; print $export->array_export_module[$key]->getName(); print ''; - print $export->array_export_label[$key]; + $string=$langs->trans($export->array_export_label[$key]); + print ($string!=$export->array_export_label[$key]?$string:$export->array_export_label[$key]); print ''; print ''.img_picto($langs->trans("NewExport"),'filenew').''; print ''; diff --git a/htdocs/includes/modules/modProduit.class.php b/htdocs/includes/modules/modProduit.class.php index b2b118fbc0b..f4b8bff1d4b 100644 --- a/htdocs/includes/modules/modProduit.class.php +++ b/htdocs/includes/modules/modProduit.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2005 Laurent Destailleur + * Copyright (C) 2004-2006 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * @@ -90,32 +90,66 @@ class modProduit extends DolibarrModules // Permissions $this->rights = array(); $this->rights_class = 'produit'; + $r=0; - $this->rights[1][0] = 31; // id de la permission - $this->rights[1][1] = 'Lire les produits/services'; // libelle de la permission - $this->rights[1][2] = 'r'; // type de la permission (déprécié à ce jour) - $this->rights[1][3] = 1; // La permission est-elle une permission par défaut - $this->rights[1][4] = 'lire'; + $r++; + $this->rights[$r][0] = 31; // id de la permission + $this->rights[$r][1] = 'Lire les produits/services'; // libelle de la permission + $this->rights[$r][2] = 'r'; // type de la permission (déprécié à ce jour) + $this->rights[$r][3] = 1; // La permission est-elle une permission par défaut + $this->rights[$r][4] = 'lire'; - $this->rights[2][0] = 32; // id de la permission - $this->rights[2][1] = 'Créer modifier les produits/services'; // libelle de la permission - $this->rights[2][2] = 'w'; // type de la permission (déprécié à ce jour) - $this->rights[2][3] = 0; // La permission est-elle une permission par défaut - $this->rights[2][4] = 'creer'; + $r++; + $this->rights[$r][0] = 32; // id de la permission + $this->rights[$r][1] = 'Créer modifier les produits/services'; // libelle de la permission + $this->rights[$r][2] = 'w'; // type de la permission (déprécié à ce jour) + $this->rights[$r][3] = 0; // La permission est-elle une permission par défaut + $this->rights[$r][4] = 'creer'; - $this->rights[3][0] = 33; // id de la permission - $this->rights[3][1] = 'Commander les produits/services'; // libelle de la permission - $this->rights[3][2] = 'w'; // type de la permission (déprécié à ce jour) - $this->rights[3][3] = 0; // La permission est-elle une permission par défaut - $this->rights[3][4] = 'commander'; + $r++; + $this->rights[$r][0] = 33; // id de la permission + $this->rights[$r][1] = 'Commander les produits/services'; // libelle de la permission + $this->rights[$r][2] = 'w'; // type de la permission (déprécié à ce jour) + $this->rights[$r][3] = 0; // La permission est-elle une permission par défaut + $this->rights[$r][4] = 'commander'; - $this->rights[4][0] = 34; // id de la permission - $this->rights[4][1] = 'Supprimer les produits/services'; // libelle de la permission - $this->rights[4][2] = 'd'; // type de la permission (déprécié à ce jour) - $this->rights[4][3] = 0; // La permission est-elle une permission par défaut - $this->rights[4][4] = 'supprimer'; + $r++; + $this->rights[$r][0] = 34; // id de la permission + $this->rights[$r][1] = 'Supprimer les produits/services'; // libelle de la permission + $this->rights[$r][2] = 'd'; // type de la permission (déprécié à ce jour) + $this->rights[$r][3] = 0; // La permission est-elle une permission par défaut + $this->rights[$r][4] = 'supprimer'; - } + $r++; + $this->rights[$r][0] = 38; + $this->rights[$r][1] = 'Exporter les produits'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'export'; + + + // Exports + //-------- + $r=0; + + $r++; + $this->export_code[$r]=$this->id.'_'.$r; + $this->export_label[$r]="ProductsOrServices"; // Translation key + $this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.fk_product_type'=>"Type",'p.price'=>"Price",'p.envente'=>"OnSell",'p.duration'=>"Duration"); + $this->export_entities_array[$r]=array('p.rowid'=>"product",'p.ref'=>"product",'p.label'=>"product",'p.description'=>"product",'p.fk_product_type'=>"product",'p.price'=>"product",'p.envente'=>"product",'p.duration'=>"product"); + $this->export_alias_array[$r]=array('p.rowid'=>"id",'p.ref'=>"ref",'p.label'=>"label",'p.description'=>"description",'p.fk_product_type'=>"type",'p.price'=>"price",'p.envente'=>"onsell",'p.duration'=>"duration"); + $this->export_sql[$r]="select "; + $i=0; + foreach ($this->export_alias_array[$r] as $key => $value) + { + if ($i > 0) $this->export_sql[$r].=', '; + else $i++; + $this->export_sql[$r].=$key.' as '.$value; + } + $this->export_sql[$r].=' from '.MAIN_DB_PREFIX.'product as p'; + $this->export_permission[$r]=array(array("produit","export")); + + } /** diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 4142ef2edef..99928d0b624 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -154,6 +154,7 @@ Permission31=Read products/services Permission32=Create/modify products/services Permission33=Command products/services Permission34=Delete products/services +Permission36=Export products/services Permission41=Read projects Permission42=Create/modify projects Permission44=Delete projects diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index caa6f509469..3228dc614a0 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -12,6 +12,7 @@ ProductCode=Product code ServiceCode=Service code ProductOrService=Product or Service ProductsAndServices=Products and Services +ProductsOrServices=Products or Services ProductsAndServicesOnSell=Products and Services on sell ProductsAndServicesNotOnSell=Products and Services out of sell ProductsAndServicesStatistics=Products and Services statistics @@ -88,4 +89,5 @@ Quantity=Quantity NoMatchFound=No match found DeleteProduct=Delete a product/service ConfirmDeleteProduct=Are you sure you want to delete this product/service ? -ProductDeleted=Product/Service "%s" deleted from database. \ No newline at end of file +ProductDeleted=Product/Service "%s" deleted from database. +ExportDataset_produit_1=Products and services \ No newline at end of file diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 8005066c6c4..99e3c7c47af 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -154,6 +154,7 @@ Permission31=Consulter les produits/services Permission32=Créer/modifier les produits/services Permission33=Commander les produits/services Permission34=Supprimer les produits/services +Permission36=Exporter les produits/services Permission41=Consulter les projets Permission42=Créer/modifier les projets Permission44=Supprimer les projets diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index 1da756c9f3c..b5eb56c0e84 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -11,6 +11,7 @@ NewService=Nouveau service ProductCode=Code produit ServiceCode=Code service ProductOrService=Produit ou Service +ProductsOrServices=Produits ou Services ProductsAndServices=Produits et Services ProductsAndServicesOnSell=Produits et Services en vente ProductsAndServicesNotOnSell=Produits et Services hors vente @@ -99,3 +100,4 @@ ErrorAssociationIsFatherOfThis=L'un des produits s DeleteProduct=Supprimer un produit/service ConfirmDeleteProduct=Etes-vous sûr de vouloir supprimer ce produit/service ? ProductDeleted=Le produit/service "%s" à été supprimé de la base. +ExportDataset_produit_1=Produits et services