From 31ecc1987e8bb468f08a6b5c8ad772bb72a46c4e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 21 Nov 2012 18:52:25 +0100 Subject: [PATCH] Fix: remove old code --- htdocs/exports/export.php | 48 ++++++++++++--------------------------- 1 file changed, 14 insertions(+), 34 deletions(-) diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index f96eb57d648..5f2b0e6d2c0 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -229,11 +229,11 @@ if ($action == 'builddoc') $result=$objexport->build_file($user, $_POST['model'], $datatoexport, $array_selected, $array_filtervalue); if ($result < 0) { - $mesg='
'.$objexport->error.'
'; + setEventMessage($objexport->error, 'errors'); } else { - $mesg='
'.$langs->trans("FileSuccessfullyBuilt").'
'; + setEventMessage($langs->trans("FileSuccessfullyBuilt")); $sqlusedforexport=$objexport->sqlusedforexport; } } @@ -292,21 +292,20 @@ if ($action == 'add_export_model') $result = $objexport->create($user); if ($result >= 0) { - $mesg='
'.$langs->trans("ExportModelSaved",$objexport->model_name).'
'; + setEventMessage($langs->trans("ExportModelSaved",$objexport->model_name)); } else { $langs->load("errors"); if ($objexport->errno == 'DB_ERROR_RECORD_ALREADY_EXISTS') - { - $mesg='
'.$langs->trans("ErrorExportDuplicateProfil").'
'; - } - else $mesg='
'.$objexport->error.'
'; + setEventMessage($langs->trans("ErrorExportDuplicateProfil"), 'errors'); + else + setEventMessage($objexport->error, 'errors'); } } else { - $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("ExportModelName")).'
'; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("ExportModelName")), 'errors'); } } @@ -353,7 +352,7 @@ if ($step == 4 && $action == 'submitFormField') if (is_array($objexport->array_export_TypeFields[0])) { $_SESSION["export_FilterValue_fields"]=array(); - var_dump($_POST); + //var_dump($_POST); foreach($objexport->array_export_TypeFields[0] as $code => $type) // $code: s.fieldname $value: Text|Boolean|List:ccc { $newcode=(string) preg_replace('/\./','_',$code); @@ -362,7 +361,7 @@ if ($step == 4 && $action == 'submitFormField') if (! isset($_POST[$newcode]) || $_POST[$newcode] == '') $filterqualified=0; elseif (preg_match('/^List/',$type) && $_POST[$newcode] <= 0) $filterqualified=0; if ($filterqualified) - { + { //print 'Filter on '.$newcode.' type='.$type.' value='.$_POST[$newcode]."\n"; $objexport->array_export_FilterValue[0][$code] = $_POST[$newcode]; } @@ -447,9 +446,6 @@ if ($step == 1 || ! $datatoexport) print ''; print ''; - - if ($mesg) print $mesg; - } if ($step == 2 && $datatoexport) @@ -595,8 +591,6 @@ if ($step == 2 && $datatoexport) print ''; - if ($mesg) print $mesg; - /* * Barre d'action * @@ -739,7 +733,7 @@ if ($step == 3 && $datatoexport) print ''; print $form->textwithpicto($text,$htmltext); print ''; - + // Filter value print ''; if (! empty($Typefieldsarray[$code])) @@ -764,12 +758,9 @@ if ($step == 3 && $datatoexport) print ''; - if ($mesg) print $mesg; - /* * Barre d'action - * - */ + */ print '
'; // il n'est pas obligatoire de filtrer les champs print ''.$langs->trans("NextStep").''; @@ -847,7 +838,7 @@ if ($step == 4 && $datatoexport) $list=''; foreach($array_filtervalue as $code=>$value) { - if (isset($objexport->array_export_fields[0][$code])) + if (isset($objexport->array_export_fields[0][$code])) { $list.=($list?', ':''); $list.=$langs->trans($objexport->array_export_fields[0][$code])."='".(isset($array_filtervalue[$code])?$array_filtervalue[$code]:'')."'"; @@ -919,11 +910,8 @@ if ($step == 4 && $datatoexport) print ''; - print '
'; - if ($mesg) print $mesg; - /* * Barre d'action * @@ -994,7 +982,6 @@ if ($step == 4 && $datatoexport) print ''; print ''; } - } if ($step == 5 && $datatoexport) @@ -1079,7 +1066,7 @@ if ($step == 5 && $datatoexport) $list=''; foreach($array_filtervalue as $code=>$value) { - if (isset($objexport->array_export_fields[0][$code])) + if (isset($objexport->array_export_fields[0][$code])) { $list.=($list?', ':''); $list.=$langs->trans($objexport->array_export_fields[0][$code])."='".(isset($array_filtervalue[$code])?$array_filtervalue[$code]:'')."'"; @@ -1118,12 +1105,7 @@ if ($step == 5 && $datatoexport) print ''; print ''; - if ($mesg) - { - print ''; - } + if ($sqlusedforexport && $user->admin) { print '
'; - print $mesg; - print '
'; @@ -1144,10 +1126,8 @@ if ($step == 5 && $datatoexport) print '
'; } - print '
'; - llxFooter(); $db->close();