diff --git a/html/export.php b/html/export.php
index 1e4d89241..af4962e3e 100644
--- a/html/export.php
+++ b/html/export.php
@@ -42,135 +42,8 @@ if ( $action=='X' || ! isset($_GET['act']) || $g_user->check_print($_GET['act'])
redirect("do.php?".dossier::get());
exit();
}
+// get file and execute it
- switch( $_GET['act'])
- {
- case 'CSV:histo':
- require_once('export_histo_csv.php');
- exit();
- break;
- case 'CSV:ledger':
- require_once('export_ledger_csv.php');
- exit();
- break;
- case 'PDF:ledger':
- require_once('export_ledger_pdf.php');
- exit();
- break;
-
- case 'CSV:postedetail':
- require_once('export_poste_detail_csv.php');
- exit();
- break;
- case 'PDF:postedetail':
- require_once('export_poste_detail_pdf.php');
- exit();
- break;
- case 'CSV:fichedetail':
- require_once('export_fiche_detail_csv.php');
- exit();
- break;
- case 'PDF:fichedetail':
- require_once('export_fiche_detail_pdf.php');
- exit();
- break;
-
- case 'CSV:fiche_balance':
- require_once('export_fiche_balance_csv.php');
- exit();
- break;
- case 'PDF:fiche_balance':
- require_once('export_fiche_balance_pdf.php');
- exit();
- break;
- case 'CSV:report':
- require_once('export_form_csv.php');
- exit();
- break;
- case 'PDF:report':
- require_once('export_form_pdf.php');
- exit();
- break;
- case 'CSV:fiche':
- require_once('export_fiche_csv.php');
- exit();
- break;
- case 'PDF:fiche':
- require_once('export_fiche_pdf.php');
- exit();
- break;
- case 'CSV:glcompte':
- require_once('export_gl_csv.php');
- exit();
- break;
- case 'PDF:glcompte':
- require_once('export_gl_pdf.php');
- exit();
- break;
- case 'PDF:sec':
- require_once('export_security_pdf.php');
- exit();
- break;
- case 'CSV:AncList':
- require_once('export_anc_list_csv.php');
- exit();
- break;
- case 'CSV:AncBalSimple':
- require_once('export_anc_balance_simple_csv.php');
- exit();
- break;
- case 'PDF:AncBalSimple':
- require_once('export_anc_balance_simple_pdf.php');
- exit();
- break;
- case 'CSV:AncBalDouble':
- require_once('export_anc_balance_double_csv.php');
- exit();
- break;
- case 'PDF:AncBalDouble':
- require_once('export_anc_balance_double_pdf.php');
- exit();
- break;
- case 'CSV:balance':
- require_once('export_balance_csv.php');
- exit();
- break;
- case 'PDF:balance':
- require_once('export_balance_pdf.php');
- exit();
- break;
- case 'CSV:AncTable':
- require_once('export_anc_table_csv.php');
- exit();
- break;
- case 'CSV:AncAccList':
- require_once('export_anc_acc_list_csv.php');
- exit();
- break;
- case 'CSV:AncBalGroup':
- require_once('export_anc_balance_group_csv.php');
- exit();
- break;
- case 'OTH:Bilan':
- require_once 'export_bilan_oth.php';
- exit();
- break;
- case 'CSV:AncGrandLivre':
- require_once 'export_anc_grandlivre_csv.php';
- break;
- case 'CSV:reportinit':
- require_once('export_reportinit_csv.php');
- break;
- case 'CSV:ActionGestion':
- require_once 'export_follow_up_csv.php';
- break;
- case 'CSV:StockHisto': // Export Historique mouvement stock
- require_once 'export_stock_histo.csv';
- break;
- case 'CSV:StockResmList' : // 'Export Résumé list stock
- require_once 'export_stock_resume_list.php';
- break;
- default:
- alert('Action inconnue '.$_GET['act']);
- exit();
- }
\ No newline at end of file
+ $prfile=$cn->get_value("select me_file from menu_ref where me_code=$1",array($_GET['act']));
+ require_once $prfile;
+ ?>
\ No newline at end of file
diff --git a/include/export_stock_histo.csv b/include/export_stock_histo.csv
deleted file mode 100644
index 7492be85c..000000000
--- a/include/export_stock_histo.csv
+++ /dev/null
@@ -1,63 +0,0 @@
-create_query_histo($_GET);
-$sql .= " order by real_date asc";
-
-$res=$cn->exec_sql($sql);
-$max_row=Database::num_row($res);
-header('Pragma: public');
-header('Content-type: application/csv');
-header('Content-Disposition: attachment;filename="histo-stock.csv"',FALSE);
-printf('"Date";');
- printf('"%s";','Code Stock');
- printf('"%s";','Depot');
- printf('"%s";','Fiche');
- printf('"%s";','Commentaire');
- printf('%s;','Quantité');
- printf('"%s";','IN/OUT');
- printf("\n\r");
-for ($i=0;$i<$max_row;$i++)
-{
- $row=Database::fetch_array($res,$i);
- printf('"%s";',$row['cdate']);
- printf('"%s";',$row['sg_code']);
- printf('"%s";',$row['r_name']);
- printf('"%s";',$row['qcode']);
- $row['ccomment']=str_replace('"','',$row['ccomment']);
- printf('"%s";',$row['ccomment']);
- printf('%s;',nbm($row['sg_quantity']));
- printf('"%s";',$row['direction']);
- printf("\n\r");
-
-}
-
-?>
\ No newline at end of file
diff --git a/sql/upgrade.sql b/sql/upgrade.sql
index f35ba45c7..f5f0c1767 100644
--- a/sql/upgrade.sql
+++ b/sql/upgrade.sql
@@ -388,4 +388,38 @@ CREATE TABLE stock_change
ALTER TABLE stock_goods ADD CONSTRAINT stock_goods_c_id_fkey FOREIGN KEY (c_id) REFERENCES stock_change (c_id) MATCH SIMPLE
ON UPDATE CASCADE ON DELETE CASCADE;
-update action_gestion set ag_id=-1 ;
\ No newline at end of file
+update action_gestion set ag_id=-1 ;
+
+update menu_ref set me_code='CSV:reportinit' where me_code='CVS:reportinit';
+ update menu_ref set me_file='export_histo_csv.php' where me_code='CSV:histo';
+ update menu_ref set me_file='export_ledger_csv.php' where me_code='CSV:ledger';
+ update menu_ref set me_file='export_ledger_pdf.php' where me_code='PDF:ledger';
+ update menu_ref set me_file='export_poste_detail_csv.php' where me_code='CSV:postedetail';
+ update menu_ref set me_file='export_poste_detail_pdf.php' where me_code='PDF:postedetail';
+ update menu_ref set me_file='export_fiche_detail_csv.php' where me_code='CSV:fichedetail';
+ update menu_ref set me_file='export_fiche_detail_pdf.php' where me_code='PDF:fichedetail';
+ update menu_ref set me_file='export_fiche_balance_csv.php' where me_code='CSV:fiche_balance';
+ update menu_ref set me_file='export_fiche_balance_pdf.php' where me_code='PDF:fiche_balance';
+ update menu_ref set me_file='export_form_csv.php' where me_code='CSV:report';
+ update menu_ref set me_file='export_form_pdf.php' where me_code='PDF:report';
+ update menu_ref set me_file='export_fiche_csv.php' where me_code='CSV:fiche';
+ update menu_ref set me_file='export_fiche_pdf.php' where me_code='PDF:fiche';
+ update menu_ref set me_file='export_gl_csv.php' where me_code='CSV:glcompte';
+ update menu_ref set me_file='export_gl_pdf.php' where me_code='PDF:glcompte';
+ update menu_ref set me_file='export_security_pdf.php' where me_code='PDF:sec';
+ update menu_ref set me_file='export_anc_list_csv.php' where me_code='CSV:AncList';
+ update menu_ref set me_file='export_anc_balance_simple_csv.php' where me_code='CSV:AncBalSimple';
+ update menu_ref set me_file='export_anc_balance_simple_pdf.php' where me_code='PDF:AncBalSimple';
+ update menu_ref set me_file='export_anc_balance_double_csv.php' where me_code='CSV:AncBalDouble';
+ update menu_ref set me_file='export_anc_balance_double_pdf.php' where me_code='PDF:AncBalDouble';
+ update menu_ref set me_file='export_balance_csv.php' where me_code='CSV:balance';
+ update menu_ref set me_file='export_balance_pdf.php' where me_code='PDF:balance';
+ update menu_ref set me_file='export_anc_table_csv.php' where me_code='CSV:AncTable';
+ update menu_ref set me_file='export_anc_acc_list_csv.php' where me_code='CSV:AncAccList';
+ update menu_ref set me_file='export_anc_balance_group_csv.php' where me_code='CSV:AncBalGroup';
+ update menu_ref set me_file='export_bilan_oth.php' where me_code='OTH:Bilan';
+ update menu_ref set me_file='export_anc_grandlivre_csv.php' where me_code='CSV:AncGrandLivre';
+ update menu_ref set me_file='export_reportinit_csv.php' where me_code='CSV:reportinit';
+ update menu_ref set me_file='export_follow_up_csv.php' where me_code='CSV:ActionGestion';
+ update menu_ref set me_file='export_stock_histo_csv.php' where me_code='CSV:StockHisto';
+ update menu_ref set me_file='export_stock_resume_list.php' where me_code='CSV:StockResmList';