Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
d85bd3d41c
@ -68,43 +68,11 @@ $upload_dir = $conf->adherent->dir_output . "/" . get_exdir($id,2,0,1) . '/' . $
|
||||
*/
|
||||
|
||||
// Envoie fichier
|
||||
if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
|
||||
|
||||
if (dol_mkdir($upload_dir) >= 0)
|
||||
{
|
||||
$resupload=dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),0,0,$_FILES['userfile']['error']);
|
||||
if (is_numeric($resupload) && $resupload > 0)
|
||||
{
|
||||
if (image_format_supported($upload_dir . "/" . $_FILES['userfile']['name']) == 1)
|
||||
{
|
||||
// Create small thumbs for image (Ratio is near 16/9)
|
||||
// Used on logon for example
|
||||
$imgThumbSmall = vignette($upload_dir . "/" . $_FILES['userfile']['name'], $maxwidthsmall, $maxheightsmall, '_small', $quality, "thumbs");
|
||||
// Create mini thumbs for image (Ratio is near 16/9)
|
||||
// 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>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
if ($resupload < 0) // Unknown error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileNotUploaded").'</div>';
|
||||
}
|
||||
else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileIsInfectedWithAVirus").'</div>';
|
||||
}
|
||||
else // Known error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans($resupload).'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
dol_add_file_process($upload_dir,0,1,'userfile');
|
||||
}
|
||||
|
||||
// Suppression fichier
|
||||
@ -139,7 +107,9 @@ if ($id > 0)
|
||||
/*
|
||||
* Affichage onglets
|
||||
*/
|
||||
if ($conf->notification->enabled) $langs->load("mails");
|
||||
if (! empty($conf->notification->enabled))
|
||||
$langs->load("mails");
|
||||
|
||||
$head = member_prepare_head($member);
|
||||
|
||||
$form=new Form($db);
|
||||
@ -210,8 +180,6 @@ if ($id > 0)
|
||||
|
||||
print '</div>';
|
||||
|
||||
dol_htmloutput_mesg($mesg,$mesgs);
|
||||
|
||||
/*
|
||||
* Confirmation suppression fichier
|
||||
*/
|
||||
|
||||
@ -83,40 +83,7 @@ if (GETPOST('addfile') || GETPOST('addfilehtml'))
|
||||
// Set tmp user directory
|
||||
$vardir=$conf->user->dir_output."/".$user->id;
|
||||
$upload_dir = $vardir.'/temp';
|
||||
|
||||
if (dol_mkdir($upload_dir) >= 0)
|
||||
{
|
||||
$resupload=dol_move_uploaded_file($_FILES['addedfile']['tmp_name'], $upload_dir . "/" . $_FILES['addedfile']['name'], 1, 0, $_FILES['addedfile']['error']);
|
||||
if (is_numeric($resupload) && $resupload > 0)
|
||||
{
|
||||
$mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>';
|
||||
|
||||
include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php');
|
||||
$formmail = new FormMail($db);
|
||||
$formmail->add_attached_files($upload_dir . "/" . $_FILES['addedfile']['name'],$_FILES['addedfile']['name'],$_FILES['addedfile']['type']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
if ($resupload < 0) // Unknown error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileNotUploaded").'</div>';
|
||||
}
|
||||
else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileIsInfectedWithAVirus").'</div>';
|
||||
}
|
||||
else // Known error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans($resupload).'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFailToCreateDir",$upload_dir).'</div>';
|
||||
}
|
||||
dol_add_file_process($upload_dir,0,0);
|
||||
|
||||
if ($_POST['addfile']) $action='test';
|
||||
if ($_POST['addfilehtml']) $action='testhtml';
|
||||
|
||||
@ -39,42 +39,11 @@ $upload_dir=$conf->admin->dir_temp;
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
|
||||
|
||||
$result=dol_mkdir($upload_dir); // Create dir if not exists
|
||||
if ($result >= 0)
|
||||
{
|
||||
$resupload=dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),1,0,$_FILES['userfile']['error']);
|
||||
|
||||
if (is_numeric($resupload) && $resupload > 0)
|
||||
{
|
||||
$mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>';
|
||||
|
||||
include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php');
|
||||
$formmail = new FormMail($db);
|
||||
$formmail->add_attached_files($upload_dir . "/" . $_FILES['addedfile']['name'],$_FILES['addedfile']['name'],$_FILES['addedfile']['type']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
if ($resupload < 0) // Unknown error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileNotUploaded").'</div>';
|
||||
}
|
||||
else if (preg_match('/ErrorFileIsInfectedWithAVirus.(.*)/',$resupload,$reg)) // Files infected by a virus
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileIsInfectedWithAVirus");
|
||||
$mesg.= '<br>'.$langs->trans("Information").': '.$langs->trans($reg[1]);
|
||||
$mesg.= '</div>';
|
||||
}
|
||||
else // Known error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans($resupload).'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
dol_add_file_process($upload_dir,0,0);
|
||||
}
|
||||
|
||||
if ($_GET["action"] == 'activate_captcha')
|
||||
|
||||
@ -50,8 +50,8 @@ if (! $user->admin) accessforbidden();
|
||||
if ($action == 'delete')
|
||||
{
|
||||
$file=$conf->admin->dir_output.'/backup/'.GETPOST('urlfile');
|
||||
$ret=dol_delete_file($file, 1);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
$ret=dol_delete_file($file, 1);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||
$action='';
|
||||
}
|
||||
|
||||
@ -58,10 +58,10 @@ if ($file && ! $what)
|
||||
|
||||
if ($action == 'delete')
|
||||
{
|
||||
$file=$conf->admin->dir_output.'/backup/'.GETPOST('urlfile');
|
||||
$ret=dol_delete_file($file, 1);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||
$file=$conf->admin->dir_output.'/backup/'.GETPOST('urlfile');
|
||||
$ret=dol_delete_file($file, 1);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||
$action='';
|
||||
}
|
||||
|
||||
|
||||
@ -68,42 +68,8 @@ if (! $sortfield) $sortfield="name";
|
||||
*/
|
||||
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
// Creation repertoire si n'existe pas
|
||||
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid);
|
||||
|
||||
if (dol_mkdir($upload_dir) >= 0)
|
||||
{
|
||||
$resupload=dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),0,0,$_FILES['userfile']['error']);
|
||||
if (is_numeric($resupload) && $resupload > 0)
|
||||
{
|
||||
if (image_format_supported($upload_dir . "/" . $_FILES['userfile']['name']) == 1)
|
||||
{
|
||||
// Create small thumbs for image (Ratio is near 16/9)
|
||||
// Used on logon for example
|
||||
$imgThumbSmall = vignette($upload_dir . "/" . $_FILES['userfile']['name'], $maxwidthsmall, $maxheightsmall, '_small', $quality, "thumbs");
|
||||
// Create mini thumbs for image (Ratio is near 16/9)
|
||||
// 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>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
if ($resupload < 0) // Unknown error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileNotUploaded").'</div>';
|
||||
}
|
||||
else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileIsInfectedWithAVirus").'</div>';
|
||||
}
|
||||
else // Known error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans($resupload).'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
dol_add_file_process($upload_dir,0,1,'userfile');
|
||||
}
|
||||
|
||||
/*
|
||||
@ -112,10 +78,10 @@ if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
if ($action == 'delete')
|
||||
{
|
||||
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid);
|
||||
$file = $upload_dir . '/' . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||
$ret=dol_delete_file($file);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||
$file = $upload_dir . '/' . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||
$ret=dol_delete_file($file);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||
$action='';
|
||||
}
|
||||
|
||||
@ -291,8 +257,6 @@ if ($objectid > 0)
|
||||
|
||||
print '</div>';
|
||||
|
||||
if ($mesg) { print $mesg."<br>"; }
|
||||
|
||||
|
||||
// Affiche formulaire upload
|
||||
$formfile=new FormFile($db);
|
||||
|
||||
@ -272,12 +272,12 @@ else if ($action == 'add' && $user->rights->propale->creer)
|
||||
header("Location: ".DOL_URL_ROOT.'/comm/addpropal.php?socid='.$socid.'&action=create');
|
||||
exit;
|
||||
}
|
||||
if (empty($duration))
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ValidityDuration")), 'errors');
|
||||
header("Location: ".DOL_URL_ROOT.'/comm/addpropal.php?socid='.$socid.'&action=create');
|
||||
exit;
|
||||
}
|
||||
if (empty($duration))
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ValidityDuration")), 'errors');
|
||||
header("Location: ".DOL_URL_ROOT.'/comm/addpropal.php?socid='.$socid.'&action=create');
|
||||
exit;
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
@ -913,8 +913,8 @@ else if ($action == 'remove_file' && $user->rights->propale->creer)
|
||||
$langs->load("other");
|
||||
$upload_dir = $conf->propal->dir_output;
|
||||
$file = $upload_dir . '/' . GETPOST('file');
|
||||
$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');
|
||||
}
|
||||
}
|
||||
|
||||
@ -75,43 +75,8 @@ if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
if ($object->id > 0)
|
||||
{
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
$upload_dir = $conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||
|
||||
if (dol_mkdir($upload_dir) >= 0)
|
||||
{
|
||||
$resupload=dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),0,0,$_FILES['userfile']['error']);
|
||||
if (is_numeric($resupload) && $resupload > 0)
|
||||
{
|
||||
if (image_format_supported($upload_dir . "/" . $_FILES['userfile']['name']) == 1)
|
||||
{
|
||||
// Create small thumbs for image (Ratio is near 16/9)
|
||||
// Used on logon for example
|
||||
$imgThumbSmall = vignette($upload_dir . "/" . $_FILES['userfile']['name'], $maxwidthsmall, $maxheightsmall, '_small', $quality, "thumbs");
|
||||
// Create mini thumbs for image (Ratio is near 16/9)
|
||||
// Used on menu or for setup page for example
|
||||
$imgThumbMini = vignette($upload_dir . "/" . $_FILES['userfile']['name'], $maxwidthmini, $maxheightmini, '_mini', $quality, "thumbs");
|
||||
}
|
||||
setEventMessage($langs->trans("FileTransferComplete"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
if ($resupload < 0) // Unknown error
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFileNotUploaded"), 'errors');
|
||||
}
|
||||
else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFileIsInfectedWithAVirus"), 'errors');
|
||||
}
|
||||
else // Known error
|
||||
{
|
||||
setEventMessage($langs->trans($resupload), 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
dol_add_file_process($upload_dir,0,1,'userfile');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -72,42 +72,8 @@ if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
if ($object->fetch($id))
|
||||
{
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
$upload_dir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||
|
||||
if (dol_mkdir($upload_dir) >= 0)
|
||||
{
|
||||
$resupload=dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),0,0,$_FILES['userfile']['error']);
|
||||
if (is_numeric($resupload) && $resupload > 0)
|
||||
{
|
||||
if (image_format_supported($upload_dir . "/" . $_FILES['userfile']['name']) == 1)
|
||||
{
|
||||
// Create small thumbs for image (Ratio is near 16/9)
|
||||
// Used on logon for example
|
||||
$imgThumbSmall = vignette($upload_dir . "/" . $_FILES['userfile']['name'], $maxwidthsmall, $maxheightsmall, '_small', $quality, "thumbs");
|
||||
// Create mini thumbs for image (Ratio is near 16/9)
|
||||
// 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>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
if ($resupload < 0) // Unknown error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileNotUploaded").'</div>';
|
||||
}
|
||||
else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileIsInfectedWithAVirus").'</div>';
|
||||
}
|
||||
else // Known error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans($resupload).'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
dol_add_file_process($upload_dir,0,1,'userfile');
|
||||
}
|
||||
}
|
||||
|
||||
@ -121,8 +87,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 +140,6 @@ if ($id > 0 || ! empty($ref))
|
||||
print "</table>\n";
|
||||
print "</div>\n";
|
||||
|
||||
dol_htmloutput_mesg($mesg,$mesgs);
|
||||
|
||||
/*
|
||||
* Confirmation suppression fichier
|
||||
*/
|
||||
|
||||
@ -1004,9 +1004,9 @@ else if ($action == 'remove_file')
|
||||
$langs->load("other");
|
||||
$upload_dir = $conf->commande->dir_output;
|
||||
$file = $upload_dir . '/' . GETPOST('file');
|
||||
$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');
|
||||
$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');
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
|
||||
@ -1563,9 +1563,9 @@ else if ($action == 'remove_file')
|
||||
$langs->load("other");
|
||||
$upload_dir = $conf->facture->dir_output;
|
||||
$file = $upload_dir . '/' . GETPOST('file');
|
||||
$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');
|
||||
$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');
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
|
||||
@ -75,42 +75,8 @@ if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
if ($object->fetch($id))
|
||||
{
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
$upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||
|
||||
if (dol_mkdir($upload_dir) >= 0)
|
||||
{
|
||||
$resupload=dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),0,0,$_FILES['userfile']['error']);
|
||||
if (is_numeric($resupload) && $resupload > 0)
|
||||
{
|
||||
if (image_format_supported($upload_dir . "/" . $_FILES['userfile']['name']) == 1)
|
||||
{
|
||||
// Create small thumbs for image (Ratio is near 16/9)
|
||||
// Used on logon for example
|
||||
$imgThumbSmall = vignette($upload_dir . "/" . $_FILES['userfile']['name'], $maxwidthsmall, $maxheightsmall, '_small', $quality, "thumbs");
|
||||
// Create mini thumbs for image (Ratio is near 16/9)
|
||||
// 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>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
if ($resupload < 0) // Unknown error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileNotUploaded").'</div>';
|
||||
}
|
||||
else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileIsInfectedWithAVirus").'</div>';
|
||||
}
|
||||
else // Known error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans($resupload).'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
dol_add_file_process($upload_dir,0,1,'userfile');
|
||||
}
|
||||
}
|
||||
|
||||
@ -124,8 +90,8 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
||||
|
||||
$upload_dir = $conf->facture->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;
|
||||
@ -204,8 +170,6 @@ if ($id > 0 || ! empty($ref))
|
||||
print "</table>\n";
|
||||
print "</div>\n";
|
||||
|
||||
dol_htmloutput_mesg($mesg,$mesgs);
|
||||
|
||||
/*
|
||||
* Confirmation suppression fichier
|
||||
*/
|
||||
|
||||
@ -73,39 +73,15 @@ $modulepart='tax';
|
||||
|
||||
if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
if (dol_mkdir($upload_dir) >= 0)
|
||||
{
|
||||
$resupload=dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),0,0,$_FILES['userfile']['error']);
|
||||
if (is_numeric($resupload) && $resupload > 0)
|
||||
{
|
||||
if (image_format_supported($upload_dir . "/" . $_FILES['userfile']['name']) == 1)
|
||||
{
|
||||
// Create small thumbs for image (Ratio is near 16/9)
|
||||
// Used on logon for example
|
||||
$imgThumbSmall = vignette($upload_dir . "/" . $_FILES['userfile']['name'], $maxwidthsmall, $maxheightsmall, '_small', $quality, "thumbs");
|
||||
// Create mini thumbs for image (Ratio is near 16/9)
|
||||
// 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>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
if ($resupload < 0) // Unknown error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileNotUploaded").'</div>';
|
||||
}
|
||||
else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileIsInfectedWithAVirus").'</div>';
|
||||
}
|
||||
else // Known error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans($resupload).'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
dol_add_file_process($upload_dir,0,1,'userfile');
|
||||
}
|
||||
|
||||
if ($action == 'delete')
|
||||
{
|
||||
$file = $upload_dir . '/' . GETPOST("urlfile"); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||
$ret=dol_delete_file($file);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||
}
|
||||
|
||||
|
||||
@ -120,19 +96,6 @@ llxHeader("",$langs->trans("SocialContribution"),$help_url);
|
||||
|
||||
if ($object->id)
|
||||
{
|
||||
if ( $error_msg )
|
||||
{
|
||||
echo '<div class="error">'.$error_msg.'</div><br>';
|
||||
}
|
||||
|
||||
if ($action == 'delete')
|
||||
{
|
||||
$file = $upload_dir . '/' . GETPOST("urlfile"); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||
$ret=dol_delete_file($file);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||
}
|
||||
|
||||
$head=tax_prepare_head($object, $user);
|
||||
|
||||
dol_fiche_head($head, 'documents', $langs->trans("SocialContribution"), 0, 'bill');
|
||||
|
||||
@ -78,39 +78,7 @@ $modulepart='contract';
|
||||
*/
|
||||
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
if (dol_mkdir($upload_dir) >= 0)
|
||||
{
|
||||
$resupload=dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),0,0,$_FILES['userfile']['error']);
|
||||
if (is_numeric($resupload) && $resupload > 0)
|
||||
{
|
||||
if (image_format_supported($upload_dir . "/" . $_FILES['userfile']['name']) == 1)
|
||||
{
|
||||
// Create small thumbs for image (Ratio is near 16/9)
|
||||
// Used on logon for example
|
||||
$imgThumbSmall = vignette($upload_dir . "/" . $_FILES['userfile']['name'], $maxwidthsmall, $maxheightsmall, '_small', $quality, "thumbs");
|
||||
// Create mini thumbs for image (Ratio is near 16/9)
|
||||
// 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>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
if ($resupload < 0) // Unknown error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileNotUploaded").'</div>';
|
||||
}
|
||||
else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileIsInfectedWithAVirus").'</div>';
|
||||
}
|
||||
else // Known error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans($resupload).'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
dol_add_file_process($upload_dir,0,1,'userfile');
|
||||
}
|
||||
|
||||
// Delete
|
||||
@ -121,8 +89,8 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
||||
$langs->load("other");
|
||||
|
||||
$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='.$object->id);
|
||||
exit;
|
||||
@ -172,8 +140,6 @@ if ($object->id)
|
||||
|
||||
print '</div>';
|
||||
|
||||
dol_htmloutput_mesg($mesg,$mesgs);
|
||||
|
||||
/*
|
||||
* Confirmation suppression fichier
|
||||
*/
|
||||
|
||||
@ -927,27 +927,37 @@ function dol_init_file_process($pathtoscan='')
|
||||
* @param string $upload_dir Directory to store upload files
|
||||
* @param int $allowoverwrite 1=Allow overwrite existing file
|
||||
* @param int $donotupdatesession 1=Do no edit _SESSION variable
|
||||
* @param string $varfiles _FILES var name
|
||||
* @return void
|
||||
*/
|
||||
function dol_add_file_process($upload_dir,$allowoverwrite=0,$donotupdatesession=0)
|
||||
function dol_add_file_process($upload_dir,$allowoverwrite=0,$donotupdatesession=0,$varfiles='addedfile')
|
||||
{
|
||||
global $db,$user,$conf,$langs,$_FILES;
|
||||
|
||||
if (! empty($_FILES['addedfile']['tmp_name']))
|
||||
if (! empty($_FILES[$varfiles]['tmp_name']))
|
||||
{
|
||||
if (dol_mkdir($upload_dir) >= 0)
|
||||
{
|
||||
$resupload = dol_move_uploaded_file($_FILES['addedfile']['tmp_name'], $upload_dir . "/" . $_FILES['addedfile']['name'],$allowoverwrite,0, $_FILES['addedfile']['error']);
|
||||
$resupload = dol_move_uploaded_file($_FILES[$varfiles]['tmp_name'], $upload_dir . "/" . $_FILES[$varfiles]['name'],$allowoverwrite,0, $_FILES[$varfiles]['error']);
|
||||
if (is_numeric($resupload) && $resupload > 0)
|
||||
{
|
||||
setEventMessage($langs->trans("FileTransferComplete"));
|
||||
|
||||
if (empty($donotupdatesession))
|
||||
{
|
||||
include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php');
|
||||
$formmail = new FormMail($db);
|
||||
$formmail->add_attached_files($upload_dir . "/" . $_FILES['addedfile']['name'],$_FILES['addedfile']['name'],$_FILES['addedfile']['type']);
|
||||
$formmail->add_attached_files($upload_dir . "/" . $_FILES[$varfiles]['name'],$_FILES[$varfiles]['name'],$_FILES[$varfiles]['type']);
|
||||
}
|
||||
else if (image_format_supported($upload_dir . "/" . $_FILES[$varfiles]['name']) == 1)
|
||||
{
|
||||
// Create small thumbs for image (Ratio is near 16/9)
|
||||
// Used on logon for example
|
||||
$imgThumbSmall = vignette($upload_dir . "/" . $_FILES[$varfiles]['name'], 160, 120, '_small', 50, "thumbs");
|
||||
// Create mini thumbs for image (Ratio is near 16/9)
|
||||
// Used on menu or for setup page for example
|
||||
$imgThumbMini = vignette($upload_dir . "/" . $_FILES[$varfiles]['name'], 160, 120, '_mini', 50, "thumbs");
|
||||
}
|
||||
|
||||
setEventMessage($langs->trans("FileTransferComplete"));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1006,10 +1016,10 @@ function dol_remove_file_process($filenb,$donotupdatesession=0,$donotdeletefile=
|
||||
else $result=0;
|
||||
if ($result >= 0)
|
||||
{
|
||||
if (empty($donotdeletefile))
|
||||
{
|
||||
if (empty($donotdeletefile))
|
||||
{
|
||||
$langs->load("other");
|
||||
setEventMessage($langs->trans("FileWasRemoved",$filetodelete));
|
||||
setEventMessage($langs->trans("FileWasRemoved",$filetodelete));
|
||||
}
|
||||
if (empty($donotupdatesession))
|
||||
{
|
||||
|
||||
@ -85,15 +85,15 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
$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');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -110,8 +110,8 @@ if (GETPOST('action') == 'confirm_deletefile' && GETPOST('confirm') == 'yes')
|
||||
{
|
||||
$langs->load("other");
|
||||
$file = $upload_dir . "/" . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||
$ret=dol_delete_file($file);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
$ret=dol_delete_file($file);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||
|
||||
$result=$ecmdir->changeNbOfFiles('-');
|
||||
|
||||
@ -55,15 +55,15 @@ if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
$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');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -80,8 +80,8 @@ if ($_POST['action'] == 'confirm_deletefile' && $_POST['confirm'] == 'yes')
|
||||
{
|
||||
$langs->load("other");
|
||||
$file = $upload_dir . "/" . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||
$ret=dol_delete_file($file);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
$ret=dol_delete_file($file);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||
}
|
||||
|
||||
|
||||
@ -106,15 +106,15 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
$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');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -165,8 +165,8 @@ if ($action == 'confirm_deletefile')
|
||||
$upload_dir = $conf->ecm->dir_output.'/'.$relativepath;
|
||||
$file = $upload_dir . "/" . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||
|
||||
$ret=dol_delete_file($file);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
$ret=dol_delete_file($file);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||
|
||||
$result=$ecmdir->changeNbOfFiles('-');
|
||||
|
||||
@ -75,40 +75,7 @@ if (GETPOST('sendit','alpha') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
|
||||
|
||||
if (dol_mkdir($upload_dir) >= 0)
|
||||
{
|
||||
$resupload=dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),0,0,$_FILES['userfile']['error']);
|
||||
if (is_numeric($resupload) && $resupload > 0)
|
||||
{
|
||||
if (image_format_supported($upload_dir . "/" . $_FILES['userfile']['name']) == 1)
|
||||
{
|
||||
// Create small thumbs for company (Ratio is near 16/9)
|
||||
// Used on logon for example
|
||||
$imgThumbSmall = vignette($upload_dir . "/" . $_FILES['userfile']['name'], $maxwidthsmall, $maxheightsmall, '_small', $quality, "thumbs");
|
||||
|
||||
// Create mini thumbs for company (Ratio is near 16/9)
|
||||
// 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>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
if ($resupload < 0) // Unknown error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileNotUploaded").'</div>';
|
||||
}
|
||||
else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileIsInfectedWithAVirus").'</div>';
|
||||
}
|
||||
else // Known error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans($resupload).'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
dol_add_file_process($upload_dir,0,1,'userfile');
|
||||
}
|
||||
|
||||
// Delete
|
||||
@ -120,8 +87,8 @@ else if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
$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 +141,6 @@ if ($object->id)
|
||||
|
||||
print '</div>';
|
||||
|
||||
dol_htmloutput_mesg($mesg,$mesgs);
|
||||
|
||||
/*
|
||||
* Confirmation suppression fichier
|
||||
*/
|
||||
|
||||
@ -212,8 +212,8 @@ else if ($action == 'remove_file')
|
||||
$langs->load("other");
|
||||
$upload_dir = $conf->ficheinter->dir_output;
|
||||
$file = $upload_dir . '/' . GETPOST('file');
|
||||
$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');
|
||||
}
|
||||
}
|
||||
|
||||
@ -79,39 +79,7 @@ $object->fetch_thirdparty();
|
||||
// Envoi fichier
|
||||
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
if (dol_mkdir($upload_dir) >= 0)
|
||||
{
|
||||
$resupload=dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),0,0,$_FILES['userfile']['error']);
|
||||
if (is_numeric($resupload) && $resupload > 0)
|
||||
{
|
||||
if (image_format_supported($upload_dir . "/" . $_FILES['userfile']['name']) == 1)
|
||||
{
|
||||
// Create small thumbs for image (Ratio is near 16/9)
|
||||
// Used on logon for example
|
||||
$imgThumbSmall = vignette($upload_dir . "/" . $_FILES['userfile']['name'], $maxwidthsmall, $maxheightsmall, '_small', $quality, "thumbs");
|
||||
// Create mini thumbs for image (Ratio is near 16/9)
|
||||
// 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>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
if ($resupload < 0) // Unknown error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileNotUploaded").'</div>';
|
||||
}
|
||||
else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileIsInfectedWithAVirus").'</div>';
|
||||
}
|
||||
else // Known error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans($resupload).'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
dol_add_file_process($upload_dir,0,1,'userfile');
|
||||
}
|
||||
|
||||
else if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
||||
@ -121,8 +89,8 @@ else if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
||||
$langs->load("other");
|
||||
|
||||
$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;
|
||||
@ -207,8 +175,6 @@ if ($object->id > 0)
|
||||
|
||||
print "</div>\n";
|
||||
|
||||
dol_htmloutput_mesg($mesg,$mesgs);
|
||||
|
||||
/*
|
||||
* Confirmation suppression fichier
|
||||
*/
|
||||
|
||||
@ -614,8 +614,8 @@ else if ($action == 'remove_file' && $user->rights->fournisseur->commande->creer
|
||||
$langs->load("other");
|
||||
$upload_dir = $conf->fournisseur->commande->dir_output;
|
||||
$file = $upload_dir . '/' . GETPOST('file');
|
||||
$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');
|
||||
}
|
||||
}
|
||||
|
||||
@ -64,7 +64,7 @@ $object = new FactureFournisseur($db);
|
||||
*/
|
||||
|
||||
// Envoi fichier
|
||||
if ($_POST['sendit'] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
|
||||
|
||||
@ -73,40 +73,7 @@ if ($_POST['sendit'] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
$ref=dol_sanitizeFileName($facture->ref);
|
||||
$upload_dir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($facture->id,2).$ref;
|
||||
|
||||
if (dol_mkdir($upload_dir) >= 0)
|
||||
{
|
||||
$resupload=dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),0,0,$_FILES['userfile']['error']);
|
||||
if (is_numeric($resupload) && $resupload > 0)
|
||||
{
|
||||
if (image_format_supported($upload_dir . "/" . $_FILES['userfile']['name']) == 1)
|
||||
{
|
||||
// Create small thumbs for image (Ratio is near 16/9)
|
||||
// Used on logon for example
|
||||
$imgThumbSmall = vignette($upload_dir . "/" . $_FILES['userfile']['name'], $maxwidthsmall, $maxheightsmall, '_small', $quality, "thumbs");
|
||||
// Create mini thumbs for image (Ratio is near 16/9)
|
||||
// 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>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
if ($resupload < 0) // Unknown error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileNotUploaded").'</div>';
|
||||
}
|
||||
else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileIsInfectedWithAVirus").'</div>';
|
||||
}
|
||||
else // Known error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans($resupload).'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
dol_add_file_process($upload_dir,0,1,'userfile');
|
||||
}
|
||||
}
|
||||
|
||||
@ -123,8 +90,8 @@ if ($action=='delete')
|
||||
$upload_dir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($facture->id,2).$ref;
|
||||
|
||||
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||
$ret=dol_delete_file($file);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
$ret=dol_delete_file($file);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||
}
|
||||
}
|
||||
@ -238,10 +205,6 @@ if ($facid > 0)
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
|
||||
// Affiche formulaire upload
|
||||
$formfile=new FormFile($db);
|
||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/fourn/facture/document.php?facid='.$object->id,'',0,0,$user->rights->fournisseur->facture->creer,50,$object);
|
||||
|
||||
@ -829,8 +829,8 @@ elseif ($action == 'remove_file')
|
||||
{
|
||||
$upload_dir = $conf->fournisseur->facture->dir_output . "/";
|
||||
$file = $upload_dir . '/' . GETPOST('file');
|
||||
$ret=dol_delete_file($file);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
$ret=dol_delete_file($file);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -106,15 +106,15 @@ if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
$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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,39 +74,19 @@ $modulepart='produit';
|
||||
|
||||
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
if (dol_mkdir($upload_dir) >= 0)
|
||||
{
|
||||
$resupload=dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),0,0,$_FILES['userfile']['error']);
|
||||
if (is_numeric($resupload) && $resupload > 0)
|
||||
{
|
||||
if (image_format_supported($upload_dir . "/" . $_FILES['userfile']['name']) == 1)
|
||||
{
|
||||
// Create small thumbs for image (Ratio is near 16/9)
|
||||
// Used on logon for example
|
||||
$imgThumbSmall = vignette($upload_dir . "/" . $_FILES['userfile']['name'], $maxwidthsmall, $maxheightsmall, '_small', $quality, "thumbs");
|
||||
// Create mini thumbs for image (Ratio is near 16/9)
|
||||
// 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>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
if ($resupload < 0) // Unknown error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileNotUploaded").'</div>';
|
||||
}
|
||||
else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileIsInfectedWithAVirus").'</div>';
|
||||
}
|
||||
else // Known error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans($resupload).'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
dol_add_file_process($upload_dir,0,1,'userfile');
|
||||
}
|
||||
|
||||
// Delete
|
||||
if ($action=='delete')
|
||||
{
|
||||
$langs->load("other");
|
||||
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||
$ret=dol_delete_file($file);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
@ -121,18 +101,6 @@ llxHeader("","",$langs->trans("CardProduct".$object->type));
|
||||
|
||||
if ($object->id)
|
||||
{
|
||||
if (! empty($mesg)) {
|
||||
dol_htmloutput_mesg($mesg);
|
||||
}
|
||||
|
||||
if ($action=='delete')
|
||||
{
|
||||
$file = $upload_dir . '/' . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||
$ret=dol_delete_file($file);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||
}
|
||||
|
||||
$head=product_prepare_head($object, $user);
|
||||
$titre=$langs->trans("CardProduct".$object->type);
|
||||
$picto=($object->type==1?'service':'product');
|
||||
|
||||
@ -69,43 +69,10 @@ if (! $sortfield) $sortfield="name";
|
||||
*/
|
||||
|
||||
// Envoi fichier
|
||||
if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
$upload_dir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||
|
||||
if (dol_mkdir($upload_dir) >= 0)
|
||||
{
|
||||
$resupload=dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),0,0,$_FILES['userfile']['error']);
|
||||
if (is_numeric($resupload) && $resupload > 0)
|
||||
{
|
||||
if (image_format_supported($upload_dir . "/" . $_FILES['userfile']['name']) == 1)
|
||||
{
|
||||
// Create small thumbs for image (Ratio is near 16/9)
|
||||
// Used on logon for example
|
||||
$imgThumbSmall = vignette($upload_dir . "/" . $_FILES['userfile']['name'], $maxwidthsmall, $maxheightsmall, '_small', $quality, "thumbs");
|
||||
// Create mini thumbs for image (Ratio is near 16/9)
|
||||
// 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>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
if ($resupload < 0) // Unknown error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileNotUploaded").'</div>';
|
||||
}
|
||||
else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileIsInfectedWithAVirus").'</div>';
|
||||
}
|
||||
else // Known error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans($resupload).'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
dol_add_file_process($upload_dir,0,1,'userfile');
|
||||
}
|
||||
|
||||
// Delete
|
||||
@ -114,8 +81,8 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->projet->s
|
||||
$langs->load("other");
|
||||
$upload_dir = $conf->projet->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='.$object->id);
|
||||
exit;
|
||||
@ -199,9 +166,6 @@ if ($object->id > 0)
|
||||
print "</table>\n";
|
||||
print "</div>\n";
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
|
||||
// Affiche formulaire upload
|
||||
$formfile=new FormFile($db);
|
||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/projet/document.php?id='.$object->id,'',0,0,($userWrite>0),50,$object);
|
||||
|
||||
@ -251,8 +251,8 @@ if ($action == 'remove_file' && $user->rights->projet->creer)
|
||||
$langs->load("other");
|
||||
$upload_dir = $conf->projet->dir_output . "/";
|
||||
$file = $upload_dir . '/' . GETPOST('file');
|
||||
$ret=dol_delete_file($file);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
$ret=dol_delete_file($file);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,41 +69,9 @@ $projectstatic = new Project($db);
|
||||
*/
|
||||
|
||||
// Envoi fichier
|
||||
if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
if (dol_mkdir($upload_dir) >= 0)
|
||||
{
|
||||
$resupload=dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),0,0,$_FILES['userfile']['error']);
|
||||
if (is_numeric($resupload) && $resupload > 0)
|
||||
{
|
||||
if (image_format_supported($upload_dir . "/" . $_FILES['userfile']['name']) == 1)
|
||||
{
|
||||
// Create small thumbs for image (Ratio is near 16/9)
|
||||
// Used on logon for example
|
||||
$imgThumbSmall = vignette($upload_dir . "/" . $_FILES['userfile']['name'], $maxwidthsmall, $maxheightsmall, '_small', $quality, "thumbs");
|
||||
// Create mini thumbs for image (Ratio is near 16/9)
|
||||
// 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>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
if ($resupload < 0) // Unknown error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileNotUploaded").'</div>';
|
||||
}
|
||||
else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileIsInfectedWithAVirus").'</div>';
|
||||
}
|
||||
else // Known error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans($resupload).'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
dol_add_file_process($upload_dir,0,1,'userfile');
|
||||
}
|
||||
|
||||
// Delete
|
||||
@ -111,8 +79,8 @@ if ($action=='delete')
|
||||
{
|
||||
$langs->load("other");
|
||||
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||
$ret=dol_delete_file($file);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
$ret=dol_delete_file($file);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
|
||||
exit;
|
||||
@ -271,8 +239,6 @@ if ($object->id > 0)
|
||||
|
||||
print '<br>';
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
|
||||
// Affiche formulaire upload
|
||||
$formfile=new FormFile($db);
|
||||
|
||||
@ -76,43 +76,11 @@ if ($id > 0 || ! empty($ref))
|
||||
// TODO Use an include to mutualize this code for action sendit and confirm_deletefile
|
||||
|
||||
// Post file
|
||||
if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
if ($object->id)
|
||||
{
|
||||
if (dol_mkdir($upload_dir) >= 0)
|
||||
{
|
||||
$resupload=dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),0,0,$_FILES['userfile']['error']);
|
||||
if (is_numeric($resupload) && $resupload > 0)
|
||||
{
|
||||
if (image_format_supported($upload_dir . "/" . $_FILES['userfile']['name']) == 1)
|
||||
{
|
||||
// Create small thumbs for image (Ratio is near 16/9)
|
||||
// Used on logon for example
|
||||
$imgThumbSmall = vignette($upload_dir . "/" . $_FILES['userfile']['name'], $maxwidthsmall, $maxheightsmall, '_small', $quality, "thumbs");
|
||||
// Create mini thumbs for image (Ratio is near 16/9)
|
||||
// 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>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
if (is_numeric($resupload) && $resupload < 0) // Unknown error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileNotUploaded").'</div>';
|
||||
}
|
||||
else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileIsInfectedWithAVirus").'</div>';
|
||||
}
|
||||
else // Known error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans($resupload).'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
dol_add_file_process($upload_dir,0,1,'userfile');
|
||||
}
|
||||
}
|
||||
|
||||
@ -123,8 +91,8 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
||||
{
|
||||
$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='.$object->id);
|
||||
exit;
|
||||
@ -205,8 +173,6 @@ if ($object->id)
|
||||
|
||||
print '</div>';
|
||||
|
||||
dol_htmloutput_mesg($mesg,$mesgs);
|
||||
|
||||
/*
|
||||
* Confirmation suppression fichier
|
||||
*/
|
||||
|
||||
@ -462,8 +462,8 @@ if (empty($reshook))
|
||||
$langs->load("other");
|
||||
$upload_dir = $conf->societe->dir_output;
|
||||
$file = $upload_dir . '/' . GETPOST('file');
|
||||
$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');
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user