forked from Wavyzz/dolibarr
Fix: replace with new event message system
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user