Fix: remove old code

This commit is contained in:
Regis Houssin 2012-11-21 18:52:25 +01:00
parent c0c13b862a
commit 31ecc1987e

View File

@ -229,11 +229,11 @@ if ($action == 'builddoc')
$result=$objexport->build_file($user, $_POST['model'], $datatoexport, $array_selected, $array_filtervalue); $result=$objexport->build_file($user, $_POST['model'], $datatoexport, $array_selected, $array_filtervalue);
if ($result < 0) if ($result < 0)
{ {
$mesg='<div class="error">'.$objexport->error.'</div>'; setEventMessage($objexport->error, 'errors');
} }
else else
{ {
$mesg='<div class="ok">'.$langs->trans("FileSuccessfullyBuilt").'</div>'; setEventMessage($langs->trans("FileSuccessfullyBuilt"));
$sqlusedforexport=$objexport->sqlusedforexport; $sqlusedforexport=$objexport->sqlusedforexport;
} }
} }
@ -292,21 +292,20 @@ if ($action == 'add_export_model')
$result = $objexport->create($user); $result = $objexport->create($user);
if ($result >= 0) if ($result >= 0)
{ {
$mesg='<div class="ok">'.$langs->trans("ExportModelSaved",$objexport->model_name).'</div>'; setEventMessage($langs->trans("ExportModelSaved",$objexport->model_name));
} }
else else
{ {
$langs->load("errors"); $langs->load("errors");
if ($objexport->errno == 'DB_ERROR_RECORD_ALREADY_EXISTS') if ($objexport->errno == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{ setEventMessage($langs->trans("ErrorExportDuplicateProfil"), 'errors');
$mesg='<div class="error">'.$langs->trans("ErrorExportDuplicateProfil").'</div>'; else
} setEventMessage($objexport->error, 'errors');
else $mesg='<div class="error">'.$objexport->error.'</div>';
} }
} }
else else
{ {
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("ExportModelName")).'</div>'; 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])) if (is_array($objexport->array_export_TypeFields[0]))
{ {
$_SESSION["export_FilterValue_fields"]=array(); $_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 foreach($objexport->array_export_TypeFields[0] as $code => $type) // $code: s.fieldname $value: Text|Boolean|List:ccc
{ {
$newcode=(string) preg_replace('/\./','_',$code); $newcode=(string) preg_replace('/\./','_',$code);
@ -447,9 +446,6 @@ if ($step == 1 || ! $datatoexport)
print '</table>'; print '</table>';
print '</div>'; print '</div>';
if ($mesg) print $mesg;
} }
if ($step == 2 && $datatoexport) if ($step == 2 && $datatoexport)
@ -595,8 +591,6 @@ if ($step == 2 && $datatoexport)
print '</div>'; print '</div>';
if ($mesg) print $mesg;
/* /*
* Barre d'action * Barre d'action
* *
@ -764,12 +758,9 @@ if ($step == 3 && $datatoexport)
print '</div>'; print '</div>';
if ($mesg) print $mesg;
/* /*
* Barre d'action * Barre d'action
* */
*/
print '<div class="tabsAction">'; print '<div class="tabsAction">';
// il n'est pas obligatoire de filtrer les champs // il n'est pas obligatoire de filtrer les champs
print '<a class="butAction" href="javascript:FilterField.submit();">'.$langs->trans("NextStep").'</a>'; print '<a class="butAction" href="javascript:FilterField.submit();">'.$langs->trans("NextStep").'</a>';
@ -919,11 +910,8 @@ if ($step == 4 && $datatoexport)
print '</table>'; print '</table>';
print '</div>'; print '</div>';
if ($mesg) print $mesg;
/* /*
* Barre d'action * Barre d'action
* *
@ -994,7 +982,6 @@ if ($step == 4 && $datatoexport)
print '</table>'; print '</table>';
print '</form>'; print '</form>';
} }
} }
if ($step == 5 && $datatoexport) if ($step == 5 && $datatoexport)
@ -1118,12 +1105,7 @@ if ($step == 5 && $datatoexport)
print '</div>'; print '</div>';
print '<table width="100%">'; print '<table width="100%">';
if ($mesg)
{
print '<tr><td colspan="2">';
print $mesg;
print '</td></tr>';
}
if ($sqlusedforexport && $user->admin) if ($sqlusedforexport && $user->admin)
{ {
print '<tr><td>'; print '<tr><td>';
@ -1144,10 +1126,8 @@ if ($step == 5 && $datatoexport)
print '</table>'; print '</table>';
} }
print '<br>'; print '<br>';
llxFooter(); llxFooter();
$db->close(); $db->close();