From 49a403b4a578d88ba163a68939f92e472bbcf631 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 27 Feb 2023 20:34:49 +0100 Subject: [PATCH] NEW Can select the export format during export of journals --- htdocs/accountancy/bookkeeping/list.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index ff69fbc688b..0fbb2764ae6 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -729,6 +729,7 @@ if ($action == 'export_fileconfirm' && $user->hasRight('accounting', 'mouvements // Export files then exit $accountancyexport = new AccountancyExport($db); + $formatexport = GETPOST('formatexport', 'int'); $notexportlettering = GETPOST('notexportlettering', 'alpha'); if (!empty($notexportlettering)) { @@ -745,7 +746,7 @@ if ($action == 'export_fileconfirm' && $user->hasRight('accounting', 'mouvements $withAttachment = !empty(trim(GETPOST('notifiedexportfull', 'alphanohtml'))) ? 1 : 0; // Output data on screen or download - $result = $accountancyexport->export($object->lines, $formatexportset, $withAttachment); + $result = $accountancyexport->export($object->lines, $formatexport, $withAttachment); $error = 0; if ($result < 0) { @@ -856,11 +857,13 @@ $formconfirm = ''; if ($action == 'export_file') { $form_question = array(); - $form_question['notexportlettering'] = array( - 'name' => 'notexportlettering', - 'type' => 'other', - 'label' => '', // TODO Use Selectmodelcsv and show a select combo - 'value' => $langs->trans('Modelcsv').' : '.$listofformat[$formatexportset].'' + $form_question['formatexport'] = array( + 'name' => 'formatexport', + 'type' => 'select', + 'label' => $langs->trans('Modelcsv'), // TODO Use Selectmodelcsv and show a select combo + 'values' => $listofformat, + 'default' => $formatexportset, + 'morecss' => 'minwidth200 maxwidth200' ); $form_question['separator0'] = array('name'=>'separator0', 'type'=>'separator');