Fix: replace with new event message system

This commit is contained in:
Regis Houssin
2012-07-29 16:11:52 +02:00
parent 1591a5ac3b
commit a64723ea74
29 changed files with 147 additions and 175 deletions

View File

@@ -89,22 +89,22 @@ if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
// Used on menu or for setup page for example
$imgThumbMini = vignette($upload_dir . "/" . $_FILES['userfile']['name'], $maxwidthmini, $maxheightmini, '_mini', $quality, "thumbs");
}
$mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>';
setEventMessage($langs->trans("FileTransferComplete"));
}
else
{
$langs->load("errors");
if ($resupload < 0) // Unknown error
{
$mesg = '<div class="error">'.$langs->trans("ErrorFileNotUploaded").'</div>';
setEventMessage($langs->trans("ErrorFileNotUploaded"), 'errors');
}
else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
{
$mesg = '<div class="error">'.$langs->trans("ErrorFileIsInfectedWithAVirus").'</div>';
setEventMessage($langs->trans("ErrorFileIsInfectedWithAVirus"), 'errors');
}
else // Known error
{
$mesg = '<div class="error">'.$langs->trans($resupload).'</div>';
setEventMessage($langs->trans($resupload), 'errors');
}
}
}
@@ -121,8 +121,8 @@ else if ($action == 'confirm_deletefile' && $confirm == 'yes')
$upload_dir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($object->ref);
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
$ret=dol_delete_file($file,0,0,0,$object);
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
$ret=dol_delete_file($file,0,0,0,$object);
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
exit;
@@ -174,8 +174,6 @@ if ($id > 0 || ! empty($ref))
print "</table>\n";
print "</div>\n";
dol_htmloutput_mesg($mesg,$mesgs);
/*
* Confirmation suppression fichier
*/