New: Ajout export des produits dans module export

This commit is contained in:
Laurent Destailleur 2006-05-10 22:18:51 +00:00
parent 43fdae34f2
commit ca16cfd19f
6 changed files with 65 additions and 24 deletions

View File

@ -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 '</td><td>';
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 '</td><td width="24">';
print '<a href="'.DOL_URL_ROOT.'/exports/export.php?step=2&amp;datatoexport='.$export->array_export_code[$key].'&amp;action=cleanselect">'.img_picto($langs->trans("NewExport"),'filenew').'</a>';
print '</td></tr>';

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
*
@ -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"));
}
/**

View File

@ -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

View File

@ -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.
ProductDeleted=Product/Service "%s" deleted from database.
ExportDataset_produit_1=Products and services

View File

@ -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

View File

@ -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