Added option All/None in export module step 2

This commit is contained in:
Laurent Destailleur 2008-05-16 22:50:38 +00:00
parent 4985b0f314
commit 2dbd038b2c
2 changed files with 53 additions and 22 deletions

View File

@ -1,4 +1,4 @@
#Tue Feb 19 23:17:47 GMT 2008 #Fri May 16 20:28:51 CEST 2008
eclipse.preferences.version=1 eclipse.preferences.version=1
encoding//dev/skeletons/modMyModule.class.php=ISO-8859-1 encoding//dev/skeletons/modMyModule.class.php=ISO-8859-1
encoding//htdocs/about.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/facture.class.php=ISO-8859-1
encoding//htdocs/fichinter/fichinter.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/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/facture/paiementfourn.class.php=ISO-8859-1
encoding//htdocs/fourn/liste.php=ISO-8859-1 encoding//htdocs/fourn/liste.php=ISO-8859-1
encoding//htdocs/html.form.class.php=ISO-8859-1 encoding//htdocs/html.form.class.php=ISO-8859-1

View File

@ -80,14 +80,36 @@ $formfile = new FormFile($db);
if ($action=='selectfield') if ($action=='selectfield')
{ {
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; $array_selected[$_GET["field"]]=sizeof($array_selected)+1;
//print_r($array_selected); //print_r($array_selected);
$_SESSION["export_selected_fields"]=$array_selected; $_SESSION["export_selected_fields"]=$array_selected;
}
} }
if ($action=='unselectfield') if ($action=='unselectfield')
{ {
if ($_GET["field"]=='all')
{
$array_selected=array();
$_SESSION["export_selected_fields"]=$array_selected;
}
else
{
unset($array_selected[$_GET["field"]]); unset($array_selected[$_GET["field"]]);
// Renumerote champs de array_selected (de 1 <20> nb_elements) // Renumber fields of array_selected (from 1 to nb_elements)
asort($array_selected); asort($array_selected);
$i=0; $i=0;
$array_selected_save=$array_selected; $array_selected_save=$array_selected;
@ -98,8 +120,8 @@ if ($action=='unselectfield')
//print "x $code x $i y<br>"; //print "x $code x $i y<br>";
} }
$_SESSION["export_selected_fields"]=$array_selected; $_SESSION["export_selected_fields"]=$array_selected;
}
} }
if ($action=='downfield' || $action=='upfield') if ($action=='downfield' || $action=='upfield')
{ {
$pos=$array_selected[$_GET["field"]]; $pos=$array_selected[$_GET["field"]];
@ -297,14 +319,14 @@ if ($step == 2 && $datatoexport)
print $objexport->array_export_module[0]->getName(); print $objexport->array_export_module[0]->getName();
print '</td></tr>'; print '</td></tr>';
// Lot de donn<EFBFBD>es <20> exporter // Lot de donnees a exporter
print '<tr><td width="25%">'.$langs->trans("DatasetToExport").'</td>'; print '<tr><td width="25%">'.$langs->trans("DatasetToExport").'</td>';
print '<td>'.$objexport->array_export_label[0].'</td></tr>'; print '<td>'.$objexport->array_export_label[0].'</td></tr>';
print '</table>'; print '</table>';
print '<br>'; print '<br>';
// Liste d<EFBFBD>roulante des mod<6F>les d'export // Liste deroulante des modeles d'export
print '<form action="export.php" method="post">'; print '<form action="export.php" method="post">';
print '<input type="hidden" name="action" value="select_model">'; print '<input type="hidden" name="action" value="select_model">';
print '<input type="hidden" name="step" value="2">'; print '<input type="hidden" name="step" value="2">';
@ -322,7 +344,11 @@ if ($step == 2 && $datatoexport)
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Entities").'</td>'; print '<td>'.$langs->trans("Entities").'</td>';
print '<td>'.$langs->trans("ExportableFields").'</td>'; print '<td>'.$langs->trans("ExportableFields").'</td>';
print '<td width="12">&nbsp;</td>'; print '<td width="12" align="middle">';
print '<a title='.$langs->trans("All").' alt='.$langs->trans("All").' href="'.$_SERVER["PHP_SELF"].'?step=2&datatoexport='.$datatoexport.'&action=selectfield&field=all">'.$langs->trans("All")."</a>";
print '/';
print '<a title='.$langs->trans("None").' alt='.$langs->trans("None").' href="'.$_SERVER["PHP_SELF"].'?step=2&datatoexport='.$datatoexport.'&action=unselectfield&field=all">'.$langs->trans("None")."</a>";
print '</td>';
print '<td width="44%">'.$langs->trans("ExportedFields").'</td>'; print '<td width="44%">'.$langs->trans("ExportedFields").'</td>';
print '</tr>'; print '</tr>';
@ -354,17 +380,17 @@ if ($step == 2 && $datatoexport)
print '<td nowrap="nowrap">'.img_object('',$entityicon).' '.$langs->trans($entitylang).'</td>'; print '<td nowrap="nowrap">'.img_object('',$entityicon).' '.$langs->trans($entitylang).'</td>';
if ((isset($array_selected[$code]) && $array_selected[$code]) || $modelchoice == 1) if ((isset($array_selected[$code]) && $array_selected[$code]) || $modelchoice == 1)
{ {
// Champ s<>lectionn<6E> // Selected fields
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print '<td><a href="'.$_SERVER["PHP_SELF"].'?step=2&datatoexport='.$datatoexport.'&action=unselectfield&field='.$code.'">'.img_left().'</a></td>'; print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?step=2&datatoexport='.$datatoexport.'&action=unselectfield&field='.$code.'">'.img_left().'</a></td>';
print '<td>'.$langs->trans($label).' ('.$code.')</td>'; print '<td>'.$langs->trans($label).' ('.$code.')</td>';
$bit=1; $bit=1;
} }
else else
{ {
// Champ non s<>lectionn<6E> // Fields not selected
print '<td>'.$langs->trans($label).' ('.$code.')</td>'; print '<td>'.$langs->trans($label).' ('.$code.')</td>';
print '<td><a href="'.$_SERVER["PHP_SELF"].'?step=2&datatoexport='.$datatoexport.'&action=selectfield&field='.$code.'">'.img_right().'</a></td>'; print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?step=2&datatoexport='.$datatoexport.'&action=selectfield&field='.$code.'">'.img_right().'</a></td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
$bit=0; $bit=0;
} }
@ -389,6 +415,10 @@ if ($step == 2 && $datatoexport)
{ {
print '<a class="butAction" href="export.php?step=3&datatoexport='.$datatoexport.'">'.$langs->trans("NextStep").'</a>'; print '<a class="butAction" href="export.php?step=3&datatoexport='.$datatoexport.'">'.$langs->trans("NextStep").'</a>';
} }
else
{
print '<a class="butActionRefused" href="#">'.$langs->trans("NextStep").'</a>';
}
print '</div>'; print '</div>';