From 2dbd038b2c1dc3d63b8342472b9e2328f1fe2809 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 16 May 2008 22:50:38 +0000 Subject: [PATCH] Added option All/None in export module step 2 --- .settings/org.eclipse.core.resources.prefs | 3 +- htdocs/exports/export.php | 72 +++++++++++++++------- 2 files changed, 53 insertions(+), 22 deletions(-) diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs index 6d75876341b..8d58222fb08 100644 --- a/.settings/org.eclipse.core.resources.prefs +++ b/.settings/org.eclipse.core.resources.prefs @@ -1,4 +1,4 @@ -#Tue Feb 19 23:17:47 GMT 2008 +#Fri May 16 20:28:51 CEST 2008 eclipse.preferences.version=1 encoding//dev/skeletons/modMyModule.class.php=ISO-8859-1 encoding//htdocs/about.php=ISO-8859-1 @@ -40,6 +40,7 @@ encoding//htdocs/expedition/stats/month.php=ISO-8859-1 encoding//htdocs/facture.class.php=ISO-8859-1 encoding//htdocs/fichinter/fichinter.class.php=ISO-8859-1 encoding//htdocs/fourn/facture/fiche.php=ISO-8859-1 +encoding//htdocs/fourn/facture/paiement.php=UTF-8 encoding//htdocs/fourn/facture/paiementfourn.class.php=ISO-8859-1 encoding//htdocs/fourn/liste.php=ISO-8859-1 encoding//htdocs/html.form.class.php=ISO-8859-1 diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index 8b179ec21cc..582e682d05a 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -80,26 +80,48 @@ $formfile = new FormFile($db); if ($action=='selectfield') { - $array_selected[$_GET["field"]]=sizeof($array_selected)+1; - //print_r($array_selected); - $_SESSION["export_selected_fields"]=$array_selected; + if ($_GET["field"]=='all') + { + $fieldsarray=$objexport->array_export_alias[0]; + foreach($fieldsarray as $key=>$val) + { + if (! empty($array_selected[$key])) continue; // If already selected, select next + $array_selected[$key]=sizeof($array_selected)+1; + //print_r($array_selected); + $_SESSION["export_selected_fields"]=$array_selected; + } + } + else + { + $array_selected[$_GET["field"]]=sizeof($array_selected)+1; + //print_r($array_selected); + $_SESSION["export_selected_fields"]=$array_selected; + } + } if ($action=='unselectfield') { - unset($array_selected[$_GET["field"]]); - // Renumerote champs de array_selected (de 1 � nb_elements) - asort($array_selected); - $i=0; - $array_selected_save=$array_selected; - foreach($array_selected as $code=>$value) + if ($_GET["field"]=='all') { - $i++; - $array_selected[$code]=$i; - //print "x $code x $i y
"; + $array_selected=array(); + $_SESSION["export_selected_fields"]=$array_selected; + } + else + { + unset($array_selected[$_GET["field"]]); + // Renumber fields of array_selected (from 1 to nb_elements) + asort($array_selected); + $i=0; + $array_selected_save=$array_selected; + foreach($array_selected as $code=>$value) + { + $i++; + $array_selected[$code]=$i; + //print "x $code x $i y
"; + } + $_SESSION["export_selected_fields"]=$array_selected; } - $_SESSION["export_selected_fields"]=$array_selected; } - if ($action=='downfield' || $action=='upfield') { $pos=$array_selected[$_GET["field"]]; @@ -297,14 +319,14 @@ if ($step == 2 && $datatoexport) print $objexport->array_export_module[0]->getName(); print ''; - // Lot de donn�es � exporter + // Lot de donnees a exporter print ''.$langs->trans("DatasetToExport").''; print ''.$objexport->array_export_label[0].''; print ''; print '
'; - // Liste d�roulante des mod�les d'export + // Liste deroulante des modeles d'export print '
'; print ''; print ''; @@ -322,7 +344,11 @@ if ($step == 2 && $datatoexport) print ''; print ''.$langs->trans("Entities").''; print ''.$langs->trans("ExportableFields").''; - print ' '; + print ''; + print ''.$langs->trans("All").""; + print '/'; + print ''.$langs->trans("None").""; + print ''; print ''.$langs->trans("ExportedFields").''; print ''; @@ -354,17 +380,17 @@ if ($step == 2 && $datatoexport) print ''.img_object('',$entityicon).' '.$langs->trans($entitylang).''; if ((isset($array_selected[$code]) && $array_selected[$code]) || $modelchoice == 1) { - // Champ s�lectionn� + // Selected fields print ' '; - print ''.img_left().''; + print ''.img_left().''; print ''.$langs->trans($label).' ('.$code.')'; $bit=1; } else { - // Champ non s�lectionn� + // Fields not selected print ''.$langs->trans($label).' ('.$code.')'; - print ''.img_right().''; + print ''.img_right().''; print ' '; $bit=0; } @@ -389,6 +415,10 @@ if ($step == 2 && $datatoexport) { print ''.$langs->trans("NextStep").''; } + else + { + print ''.$langs->trans("NextStep").''; + } print '';