New: Amélioration de la fonction d'export pour afficher picto de l'entité à laquelle appartient un champ.
This commit is contained in:
parent
161f96b418
commit
89e4d8afa5
@ -124,6 +124,8 @@ class Export
|
|||||||
$this->array_export_sql[$i]=$module->export_sql[$r];
|
$this->array_export_sql[$i]=$module->export_sql[$r];
|
||||||
// Tableau des champ à exporter (clé=champ, valeur=libellé)
|
// Tableau des champ à exporter (clé=champ, valeur=libellé)
|
||||||
$this->array_export_fields[$i]=$module->export_fields_array[$r];
|
$this->array_export_fields[$i]=$module->export_fields_array[$r];
|
||||||
|
// Tableau des entites à exporter (clé=champ, valeur=entite)
|
||||||
|
$this->array_export_entities[$i]=$module->export_entities_array[$r];
|
||||||
// Tableau des alias à exporter (clé=champ, valeur=alias)
|
// Tableau des alias à exporter (clé=champ, valeur=alias)
|
||||||
$this->array_export_alias[$i]=$module->export_alias_array[$r];
|
$this->array_export_alias[$i]=$module->export_alias_array[$r];
|
||||||
|
|
||||||
|
|||||||
@ -38,6 +38,9 @@ $user->getrights();
|
|||||||
if (! $user->societe_id == 0)
|
if (! $user->societe_id == 0)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
|
$entitytoicon=array('invoice'=>'bill','invoice_line'=>'bill');
|
||||||
|
$entitytolang=array('user'=>'User','company'=>'Company','contact'=>'Contact','invoice'=>'Bill','invoice_line'=>'InvoiceLine');
|
||||||
|
|
||||||
$array_selected=isset($_SESSION["export_selected_fields"])?$_SESSION["export_selected_fields"]:array();
|
$array_selected=isset($_SESSION["export_selected_fields"])?$_SESSION["export_selected_fields"]:array();
|
||||||
$datatoexport=isset($_GET["datatoexport"])?$_GET["datatoexport"]:'';
|
$datatoexport=isset($_GET["datatoexport"])?$_GET["datatoexport"]:'';
|
||||||
$action=isset($_GET["action"]) ? $_GET["action"] : (isset($_POST["action"])?$_POST["action"]:'');
|
$action=isset($_GET["action"]) ? $_GET["action"] : (isset($_POST["action"])?$_POST["action"]:'');
|
||||||
@ -223,7 +226,9 @@ if ($step == 2 && $datatoexport)
|
|||||||
print $langs->trans("SelectExportFields").'<br>';
|
print $langs->trans("SelectExportFields").'<br>';
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td width="48%">'.$langs->trans("ExportableFields").'</td>';
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td>'.$langs->trans("Entities").'</td>';
|
||||||
|
print '<td>'.$langs->trans("ExportableFields").'</td>';
|
||||||
print '<td width="4%"> </td>';
|
print '<td width="4%"> </td>';
|
||||||
print '<td width="48%">'.$langs->trans("ExportedFields").'</td>';
|
print '<td width="48%">'.$langs->trans("ExportedFields").'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -231,12 +236,13 @@ if ($step == 2 && $datatoexport)
|
|||||||
// Champs exportables
|
// Champs exportables
|
||||||
$fieldsarray=$objexport->array_export_fields[0];
|
$fieldsarray=$objexport->array_export_fields[0];
|
||||||
|
|
||||||
# $this->array_export_module[$i]=$module;
|
# $this->array_export_module[0]=$module;
|
||||||
# $this->array_export_code[$i]=$module->export_code[$r];
|
# $this->array_export_code[0]=$module->export_code[$r];
|
||||||
# $this->array_export_label[$i]=$module->export_label[$r];
|
# $this->array_export_label[0]=$module->export_label[$r];
|
||||||
# $this->array_export_fields_code[$i]=$module->export_fields_code[$r];
|
# $this->array_export_sql[0]=$module->export_sql[$r];
|
||||||
# $this->array_export_fields_label[$i]=$module->export_fields_label[$r];
|
# $this->array_export_fields[0]=$module->export_fields_array[$r];
|
||||||
# $this->array_export_sql[$i]=$module-
|
# $this->array_export_entities[0]=$module->export_fields_entities[$r];
|
||||||
|
# $this->array_export_alias[0]=$module->export_fields_alias[$r];
|
||||||
|
|
||||||
$var=true;
|
$var=true;
|
||||||
foreach($fieldsarray as $code=>$label)
|
foreach($fieldsarray as $code=>$label)
|
||||||
@ -244,6 +250,11 @@ if ($step == 2 && $datatoexport)
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
|
|
||||||
|
$entity=$objexport->array_export_entities[0][$code];
|
||||||
|
$entityicon=$entitytoicon[$entity]?$entitytoicon[$entity]:$entity;
|
||||||
|
$entitylang=$entitytolang[$entity]?$entitytolang[$entity]:$entity;
|
||||||
|
|
||||||
|
print '<td>'.img_object('',$entityicon).' '.$langs->trans($entitylang).'</td>';
|
||||||
if (isset($array_selected[$code]) && $array_selected[$code])
|
if (isset($array_selected[$code]) && $array_selected[$code])
|
||||||
{
|
{
|
||||||
// Champ sélectionné
|
// Champ sélectionné
|
||||||
@ -253,6 +264,7 @@ if ($step == 2 && $datatoexport)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// Champ non sélectionné
|
||||||
print '<td>'.$langs->trans($label).' ('.$code.')</td>';
|
print '<td>'.$langs->trans($label).' ('.$code.')</td>';
|
||||||
print '<td><a href="'.$_SERVER["PHP_SELF"].'?step=2&datatoexport='.$datatoexport.'&action=selectfield&field='.$code.'">'.img_right().'</a></td>';
|
print '<td><a href="'.$_SERVER["PHP_SELF"].'?step=2&datatoexport='.$datatoexport.'&action=selectfield&field='.$code.'">'.img_right().'</a></td>';
|
||||||
print '<td> </td>';
|
print '<td> </td>';
|
||||||
@ -334,7 +346,9 @@ if ($step == 3 && $datatoexport)
|
|||||||
print $langs->trans("ChooseFieldsOrdersAndTitle").'<br>';
|
print $langs->trans("ChooseFieldsOrdersAndTitle").'<br>';
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td width="48%">'.$langs->trans("ExportedFields").'</td>';
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td>'.$langs->trans("Entities").'</td>';
|
||||||
|
print '<td>'.$langs->trans("ExportedFields").'</td>';
|
||||||
print '<td align="right" colspan="2">'.$langs->trans("Position").'</td>';
|
print '<td align="right" colspan="2">'.$langs->trans("Position").'</td>';
|
||||||
print '<td> </td>';
|
print '<td> </td>';
|
||||||
print '<td>'.$langs->trans("FieldsTitle").'</td>';
|
print '<td>'.$langs->trans("FieldsTitle").'</td>';
|
||||||
@ -346,6 +360,12 @@ if ($step == 3 && $datatoexport)
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
|
|
||||||
|
$entity=$objexport->array_export_entities[0][$code];
|
||||||
|
$entityicon=$entitytoicon[$entity]?$entitytoicon[$entity]:$entity;
|
||||||
|
$entitylang=$entitytolang[$entity]?$entitytolang[$entity]:$entity;
|
||||||
|
|
||||||
|
print '<td>'.img_object('',$entityicon).' '.$langs->trans($entitylang).'</td>';
|
||||||
|
|
||||||
print '<td>'.$langs->trans($objexport->array_export_fields[0][$code]).' ('.$code.')</td>';
|
print '<td>'.$langs->trans($objexport->array_export_fields[0][$code]).' ('.$code.')</td>';
|
||||||
|
|
||||||
print '<td align="right" width="100">';
|
print '<td align="right" width="100">';
|
||||||
|
|||||||
@ -8,6 +8,8 @@ BillsCustomersUnpayedForCompany=Unpayed customers' invoices for %s
|
|||||||
BillsSuppliersUnpayed=Unpayed suppliers' invoices
|
BillsSuppliersUnpayed=Unpayed suppliers' invoices
|
||||||
BillsUnpayed=Unpayed
|
BillsUnpayed=Unpayed
|
||||||
BillsStatistics=Invoices statistics
|
BillsStatistics=Invoices statistics
|
||||||
|
Invoice=Invoice
|
||||||
|
InvoiceLine=Invoice line
|
||||||
CardBill=Invoice card
|
CardBill=Invoice card
|
||||||
SupplierBill=Supplier invoice
|
SupplierBill=Supplier invoice
|
||||||
SupplierBills=suppliers invoices
|
SupplierBills=suppliers invoices
|
||||||
|
|||||||
@ -291,6 +291,8 @@ BuildPDF=Build PDF
|
|||||||
RebuildPDF=Rebuild PDF
|
RebuildPDF=Rebuild PDF
|
||||||
BuildDoc=Build Doc
|
BuildDoc=Build Doc
|
||||||
RebuildDoc=Rebuild Doc
|
RebuildDoc=Rebuild Doc
|
||||||
|
Entity=Entity
|
||||||
|
Entities=Entities
|
||||||
# Countries
|
# Countries
|
||||||
CountryFR=France
|
CountryFR=France
|
||||||
CountryBE=Belgium
|
CountryBE=Belgium
|
||||||
|
|||||||
@ -8,6 +8,8 @@ BillsCustomersUnpayedForCompany=Factures clients impay
|
|||||||
BillsSuppliersUnpayed=Factures fournisseurs impayées
|
BillsSuppliersUnpayed=Factures fournisseurs impayées
|
||||||
BillsUnpayed=Impayées
|
BillsUnpayed=Impayées
|
||||||
BillsStatistics=Statistiques factures
|
BillsStatistics=Statistiques factures
|
||||||
|
Invoice=Facture
|
||||||
|
InvoiceLine=Ligne de facture
|
||||||
CardBill=Fiche facture
|
CardBill=Fiche facture
|
||||||
SupplierBill=Facture fournisseur
|
SupplierBill=Facture fournisseur
|
||||||
SupplierBills=Factures fournisseurs
|
SupplierBills=Factures fournisseurs
|
||||||
|
|||||||
@ -291,6 +291,8 @@ BuildPDF=G
|
|||||||
RebuildPDF=Regénérer le PDF
|
RebuildPDF=Regénérer le PDF
|
||||||
BuildDoc=Générer le doc
|
BuildDoc=Générer le doc
|
||||||
RebuildDoc=Regénérer le doc
|
RebuildDoc=Regénérer le doc
|
||||||
|
Entity=Entité
|
||||||
|
Entities=Entités
|
||||||
# Countries
|
# Countries
|
||||||
CountryFR=France
|
CountryFR=France
|
||||||
CountryBE=Belgique
|
CountryBE=Belgique
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user