From 2b5407c31de7ebd37c423d5fe3d61b673083ab1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 31 Aug 2018 08:29:51 +0200 Subject: [PATCH] Update export.php --- htdocs/accountancy/admin/export.php | 30 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php index 79588db5ac1..0308df2f400 100644 --- a/htdocs/accountancy/admin/export.php +++ b/htdocs/accountancy/admin/export.php @@ -5,7 +5,7 @@ * Copyright (C) 2014 Marcos García * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2017 Frédéric France + * Copyright (C) 2017-2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -50,11 +50,11 @@ $main_option = array ( $configuration = AccountancyExport::getTypeConfig(); -$listparam = $configuration[param]; +$listparam = $configuration['param']; -$listformat = $configuration[format]; +$listformat = $configuration['format']; -$listcr = $configuration[cr]; +$listcr = $configuration['cr']; $model_option = array ( @@ -117,7 +117,7 @@ if ($action == 'update') { if (! $error) { // reload $configuration = AccountancyExport::getTypeConfig(); - $listparam = $configuration[param]; + $listparam = $configuration['param']; setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { setEventMessages($langs->trans("Error"), null, 'errors'); @@ -142,27 +142,27 @@ print ' {'."\n"; foreach ($listparam as $key => $param) { print ' if (jQuery("#ACCOUNTING_EXPORT_MODELCSV").val()=="'.$key.'")'."\n"; print ' {'."\n"; - print ' //console.log("'.$param[label].'");'."\n"; - if (empty($param[ACCOUNTING_EXPORT_FORMAT])) { + print ' //console.log("'.$param['label'].'");'."\n"; + if (empty($param['ACCOUNTING_EXPORT_FORMAT'])) { print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").val("'.$conf->global->ACCOUNTING_EXPORT_FORMAT.'");'."\n"; print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").prop("disabled", true);'."\n"; } else { - print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").val("'.$param[ACCOUNTING_EXPORT_FORMAT].'");'."\n"; + print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").val("'.$param['ACCOUNTING_EXPORT_FORMAT'].'");'."\n"; print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").removeAttr("disabled");'."\n"; } - if (empty($param[ACCOUNTING_EXPORT_SEPARATORCSV])) { + if (empty($param['ACCOUNTING_EXPORT_SEPARATORCSV'])) { print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").val("");'."\n"; print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").prop("disabled", true);'."\n"; } else { print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").val("'.$conf->global->ACCOUNTING_EXPORT_SEPARATORCSV.'");'."\n"; print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").removeAttr("disabled");'."\n"; } - if (empty($param[ACCOUNTING_EXPORT_ENDLINE])) { + if (empty($param['ACCOUNTING_EXPORT_ENDLINE'])) { print ' jQuery("#ACCOUNTING_EXPORT_ENDLINE").prop("disabled", true);'."\n"; } else { print ' jQuery("#ACCOUNTING_EXPORT_ENDLINE").removeAttr("disabled");'."\n"; } - if (empty($param[ACCOUNTING_EXPORT_DATE])) { + if (empty($param['ACCOUNTING_EXPORT_DATE'])) { print ' jQuery("#ACCOUNTING_EXPORT_DATE").val("");'."\n"; print ' jQuery("#ACCOUNTING_EXPORT_DATE").prop("disabled", true);'."\n"; } else { @@ -257,15 +257,15 @@ if ($num2) { print ''; // Param - $label = $key[label]; + $label = $key['label']; print '' . $langs->trans($label) . ''; // Value print ''; - if (is_array($key[param])) { - print $form->selectarray($label, $key[param], $conf->global->$label, 0); + if (is_array($key['param'])) { + print $form->selectarray($label, $key['param'], $conf->global->$label, 0); } else { - print ''; + print ''; } print '';