Fix: file add and delte in email forms was broken with firefox 5
This commit is contained in:
parent
c461434bbf
commit
bfeb3ca7fa
@ -20,7 +20,7 @@
|
||||
/**
|
||||
* \file htdocs/admin/mails.php
|
||||
* \brief Page to setup emails sending
|
||||
* \version $Id: mails.php,v 1.72 2011/07/09 06:10:06 hregis Exp $
|
||||
* \version $Id: mails.php,v 1.73 2011/07/10 20:03:39 eldy Exp $
|
||||
*/
|
||||
|
||||
require("../main.inc.php");
|
||||
@ -80,7 +80,7 @@ if ($_POST['addfile'] || $_POST['addfilehtml'])
|
||||
|
||||
// Set tmp user directory
|
||||
$vardir=$conf->user->dir_output."/".$user->id;
|
||||
$upload_dir = $vardir.'/temp/';
|
||||
$upload_dir = $vardir.'/temp';
|
||||
|
||||
if (create_exdir($upload_dir) >= 0)
|
||||
{
|
||||
@ -127,7 +127,7 @@ if (! empty($_POST['removedfile']) || ! empty($_POST['removedfilehtml']))
|
||||
{
|
||||
// Set tmp user directory
|
||||
$vardir=$conf->user->dir_output."/".$user->id;
|
||||
$upload_dir = $vardir.'/temp/';
|
||||
$upload_dir = $vardir.'/temp';
|
||||
|
||||
$keytodelete=isset($_POST['removedfile'])?$_POST['removedfile']:$_POST['removedfilehtml'];
|
||||
$keytodelete--;
|
||||
@ -468,7 +468,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("MAIN_MAIL_EMAIL_FROM",ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).'</td>';
|
||||
print '<td><input class="flat" name="MAIN_MAIL_EMAIL_FROM" size="32" value="' . $conf->global->MAIN_MAIL_EMAIL_FROM;
|
||||
print '"></td></tr>';
|
||||
|
||||
|
||||
// From
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("MAIN_MAIL_ERRORS_TO").'</td>';
|
||||
@ -574,7 +574,7 @@ else
|
||||
print '<td>'.$conf->global->MAIN_MAIL_EMAIL_FROM;
|
||||
if (!empty($conf->global->MAIN_MAIL_EMAIL_FROM) && ! isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail"));
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
// Errors To
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("MAIN_MAIL_ERRORS_TO").'</td>';
|
||||
@ -737,5 +737,5 @@ else
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date: 2011/07/09 06:10:06 $ - $Revision: 1.72 $');
|
||||
llxFooter('$Date: 2011/07/10 20:03:39 $ - $Revision: 1.73 $');
|
||||
?>
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
* \file htdocs/comm/propal.php
|
||||
* \ingroup propale
|
||||
* \brief Page of commercial proposals card and list
|
||||
* \version $Id: propal.php,v 1.609 2011/07/07 21:32:22 eldy Exp $
|
||||
* \version $Id: propal.php,v 1.610 2011/07/10 20:03:41 eldy Exp $
|
||||
*/
|
||||
|
||||
require("../main.inc.php");
|
||||
@ -427,9 +427,9 @@ if ($_POST['addfile'])
|
||||
|
||||
// Set tmp user directory TODO Use a dedicated directory for temp mails files
|
||||
$vardir=$conf->user->dir_output."/".$user->id;
|
||||
$upload_dir = $vardir.'/temp/';
|
||||
$upload_dir_tmp = $vardir.'/temp';
|
||||
|
||||
$mesg=dol_add_file_process($upload_dir,0,0);
|
||||
$mesg=dol_add_file_process($upload_dir_tmp,0,0);
|
||||
|
||||
$action='presend';
|
||||
$_POST["action"]='presend';
|
||||
@ -444,7 +444,7 @@ if (! empty($_POST['removedfile']))
|
||||
|
||||
// Set tmp user directory
|
||||
$vardir=$conf->user->dir_output."/".$user->id;
|
||||
$upload_dir = $vardir.'/temp/';
|
||||
$upload_dir_tmp = $vardir.'/temp';
|
||||
|
||||
$mesg=dol_remove_file_process($_POST['removedfile'],0);
|
||||
|
||||
@ -1291,7 +1291,7 @@ if ($id > 0 || ! empty($ref))
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// adresse de livraison
|
||||
// Delivery address (deprecated)
|
||||
if ($conf->global->PROPALE_ADD_DELIVERY_ADDRESS)
|
||||
{
|
||||
print '<tr><td>';
|
||||
@ -1335,7 +1335,7 @@ if ($id > 0 || ! empty($ref))
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Origine de la demande
|
||||
// Origin of demand
|
||||
print '<tr><td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('Source');
|
||||
@ -1975,6 +1975,6 @@ else
|
||||
}
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date: 2011/07/07 21:32:22 $ - $Revision: 1.609 $');
|
||||
llxFooter('$Date: 2011/07/10 20:03:41 $ - $Revision: 1.610 $');
|
||||
|
||||
?>
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
* \file htdocs/commande/fiche.php
|
||||
* \ingroup commande
|
||||
* \brief Page to show customer order
|
||||
* \version $Id: fiche.php,v 1.524 2011/07/07 21:32:21 eldy Exp $
|
||||
* \version $Id: fiche.php,v 1.525 2011/07/10 20:03:41 eldy Exp $
|
||||
*/
|
||||
|
||||
require("../main.inc.php");
|
||||
@ -931,7 +931,7 @@ if ($action == 'remove_file')
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||
|
||||
$upload_dir = $conf->commande->dir_output . "/";
|
||||
$upload_dir = $conf->commande->dir_output;
|
||||
$file = $upload_dir . '/' . $_GET['file'];
|
||||
dol_delete_file($file);
|
||||
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved").'</div>';
|
||||
@ -947,9 +947,9 @@ if ($_POST['addfile'])
|
||||
|
||||
// Set tmp user directory TODO Use a dedicated directory for temp mails files
|
||||
$vardir=$conf->user->dir_output."/".$user->id;
|
||||
$upload_dir = $vardir.'/temp/';
|
||||
$upload_dir_tmp = $vardir.'/temp';
|
||||
|
||||
$mesg=dol_add_file_process($upload_dir,0,0);
|
||||
$mesg=dol_add_file_process($upload_dir_tmp,0,0);
|
||||
|
||||
$action ='presend';
|
||||
}
|
||||
@ -963,7 +963,7 @@ if (! empty($_POST['removedfile']))
|
||||
|
||||
// Set tmp user directory
|
||||
$vardir=$conf->user->dir_output."/".$user->id;
|
||||
$upload_dir = $vardir.'/temp/';
|
||||
$upload_dir_tmp = $vardir.'/temp';
|
||||
|
||||
$mesg=dol_remove_file_process($_POST['removedfile'],0);
|
||||
|
||||
@ -2134,5 +2134,5 @@ else
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date: 2011/07/07 21:32:21 $ - $Revision: 1.524 $');
|
||||
llxFooter('$Date: 2011/07/10 20:03:41 $ - $Revision: 1.525 $');
|
||||
?>
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
* \file htdocs/compta/facture.php
|
||||
* \ingroup facture
|
||||
* \brief Page to create/see an invoice
|
||||
* \version $Id: facture.php,v 1.847 2011/07/08 10:22:14 hregis Exp $
|
||||
* \version $Id: facture.php,v 1.848 2011/07/10 20:03:40 eldy Exp $
|
||||
*/
|
||||
|
||||
require('../main.inc.php');
|
||||
@ -1191,9 +1191,9 @@ if ($_POST['addfile'])
|
||||
|
||||
// Set tmp user directory
|
||||
$vardir=$conf->user->dir_output."/".$user->id;
|
||||
$upload_dir = $vardir.'/temp/';
|
||||
$upload_dir_tmp = $vardir.'/temp';
|
||||
|
||||
$mesg=dol_add_file_process($upload_dir,0,0);
|
||||
$mesg=dol_add_file_process($upload_dir_tmp,0,0);
|
||||
|
||||
$action='presend';
|
||||
}
|
||||
@ -1207,7 +1207,7 @@ if (! empty($_POST['removedfile']))
|
||||
|
||||
// Set tmp user directory
|
||||
$vardir=$conf->user->dir_output."/".$user->id;
|
||||
$upload_dir = $vardir.'/temp/';
|
||||
$upload_dir_tmp = $vardir.'/temp';
|
||||
|
||||
$mesg=dol_remove_file_process($_POST['removedfile'],0);
|
||||
|
||||
@ -3241,5 +3241,5 @@ else
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date: 2011/07/08 10:22:14 $ - $Revision: 1.847 $');
|
||||
llxFooter('$Date: 2011/07/10 20:03:40 $ - $Revision: 1.848 $');
|
||||
?>
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
* \file htdocs/core/class/html.formmail.class.php
|
||||
* \ingroup core
|
||||
* \brief Fichier de la classe permettant la generation du formulaire html d'envoi de mail unitaire
|
||||
* \version $Id: html.formmail.class.php,v 1.30 2011/07/09 10:26:19 hregis Exp $
|
||||
* \version $Id: html.formmail.class.php,v 1.31 2011/07/10 20:03:41 eldy Exp $
|
||||
*/
|
||||
require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php");
|
||||
|
||||
@ -124,9 +124,9 @@ class FormMail
|
||||
/**
|
||||
* Add a file into the list of attached files (stored in SECTION array)
|
||||
*
|
||||
* @param $path
|
||||
* @param $file
|
||||
* @param $type
|
||||
* @param string $path Full absolute path on filesystem of file, including file name
|
||||
* @param string $file Only filename
|
||||
* @param string $type Mime type
|
||||
*/
|
||||
function add_attached_files($path,$file,$type)
|
||||
{
|
||||
@ -505,14 +505,26 @@ class FormMail
|
||||
$out.= '<tr>';
|
||||
$out.= '<td width="180">'.$langs->trans("MailFile").'</td>';
|
||||
$out.= '<td>';
|
||||
//print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
// FIXME Trick to have param removedfile containing nb of image to delete. But this does not works without javascript
|
||||
$out.= '<input type="hidden" class="removedfilehidden" name="removedfile" value="">'."\n";
|
||||
$out.= '<script type="text/javascript" language="javascript">';
|
||||
$out.= 'jQuery(document).ready(function () {';
|
||||
$out.= ' jQuery(".removedfile").click(function() {';
|
||||
$out.= ' jQuery(".removedfilehidden").val(jQuery(this).val());';
|
||||
$out.= ' });';
|
||||
$out.= '})';
|
||||
$out.= '</script>'."\n";
|
||||
if (sizeof($listofpaths))
|
||||
{
|
||||
foreach($listofpaths as $key => $val)
|
||||
{
|
||||
$out.= '<div id="attachfile_'.$key.'">';
|
||||
$out.= img_mime($listofnames[$key]).' '.$listofnames[$key];
|
||||
if (! $this->withfilereadonly) $out.= ' <input type="image" style="border: 0px;" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/delete.png" value="'.($key+1).'" class="removedfile" id="removedfile_'.$key.'" name="removedfile_'.$key.'" />';
|
||||
if (! $this->withfilereadonly)
|
||||
{
|
||||
$out.= ' <input type="image" style="border: 0px;" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/delete.png" value="'.($key+1).'" class="removedfile" id="removedfile_'.$key.'" name="removedfile_'.$key.'" />';
|
||||
//$out.= ' <a href="'.$_SERVER["PHP_SELF"].'?removedfile='.($key+1).' id="removedfile_'.$key.'">'.img_delete($langs->trans("Delete").'</a>';
|
||||
}
|
||||
$out.= '<br /></div>';
|
||||
}
|
||||
}
|
||||
@ -522,11 +534,9 @@ class FormMail
|
||||
}
|
||||
if ($this->withfile == 2) // Can add other files
|
||||
{
|
||||
//print '<td><td align="right">';
|
||||
$out.= '<input type="file" class="flat" id="addedfile" name="addedfile" value="'.$langs->trans("Upload").'" />';
|
||||
$out.= ' ';
|
||||
$out.= '<input type="submit" class="button" id="'.$addfileaction.'" name="'.$addfileaction.'" value="'.$langs->trans("MailingAddFile").'" />';
|
||||
//print '</td></tr></table>';
|
||||
}
|
||||
$out.= "</td></tr>\n";
|
||||
}
|
||||
@ -546,7 +556,7 @@ class FormMail
|
||||
if ($this->param["models"]=='invoice_supplier_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendSupplierInvoice"); }
|
||||
if ($this->param["models"]=='shipping_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendShipping"); }
|
||||
if ($this->param["models"]=='fichinter_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendFichInter"); }
|
||||
|
||||
|
||||
if ($conf->paypal->enabled && $conf->global->PAYPAL_ADD_PAYMENT_URL)
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/paypal/lib/paypal.lib.php");
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
* \file htdocs/expedition/fiche.php
|
||||
* \ingroup expedition
|
||||
* \brief Fiche descriptive d'une expedition
|
||||
* \version $Id: fiche.php,v 1.209 2011/07/07 21:32:19 eldy Exp $
|
||||
* \version $Id: fiche.php,v 1.210 2011/07/10 20:03:39 eldy Exp $
|
||||
*/
|
||||
|
||||
require("../main.inc.php");
|
||||
@ -291,9 +291,9 @@ if ($_POST['addfile'])
|
||||
|
||||
// Set tmp user directory TODO Use a dedicated directory for temp mails files
|
||||
$vardir=$conf->user->dir_output."/".$user->id;
|
||||
$upload_dir = $vardir.'/temp/';
|
||||
$upload_dir_tmp = $vardir.'/temp';
|
||||
|
||||
$mesg=dol_add_file_process($upload_dir,0,0);
|
||||
$mesg=dol_add_file_process($upload_dir_tmp,0,0);
|
||||
|
||||
$action ='presend';
|
||||
}
|
||||
@ -307,7 +307,7 @@ if (! empty($_POST['removedfile']))
|
||||
|
||||
// Set tmp user directory
|
||||
$vardir=$conf->user->dir_output."/".$user->id;
|
||||
$upload_dir = $vardir.'/temp/';
|
||||
$upload_dir_tmp = $vardir.'/temp';
|
||||
|
||||
$mesg=dol_remove_file_process($_POST['removedfile'],0);
|
||||
|
||||
@ -1381,5 +1381,5 @@ else
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date: 2011/07/07 21:32:19 $ - $Revision: 1.209 $');
|
||||
llxFooter('$Date: 2011/07/10 20:03:39 $ - $Revision: 1.210 $');
|
||||
?>
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
* \file htdocs/fichinter/fiche.php
|
||||
* \brief Fichier fiche intervention
|
||||
* \ingroup ficheinter
|
||||
* \version $Id: fiche.php,v 1.170 2011/07/07 22:02:48 eldy Exp $
|
||||
* \version $Id: fiche.php,v 1.171 2011/07/10 20:03:39 eldy Exp $
|
||||
*/
|
||||
|
||||
require("../main.inc.php");
|
||||
@ -444,6 +444,39 @@ if ($action == 'down' && $user->rights->ficheinter->creer)
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Add file in email form
|
||||
*/
|
||||
if ($_POST['addfile'])
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||
|
||||
// Set tmp user directory TODO Use a dedicated directory for temp mails files
|
||||
$vardir=$conf->user->dir_output."/".$user->id;
|
||||
$upload_dir_tmp = $vardir.'/temp';
|
||||
|
||||
$mesg=dol_add_file_process($upload_dir_tmp,0,0);
|
||||
|
||||
$action='presend';
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove file in email form
|
||||
*/
|
||||
if (! empty($_POST['removedfile']))
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||
|
||||
// Set tmp user directory
|
||||
$vardir=$conf->user->dir_output."/".$user->id;
|
||||
$upload_dir_tmp = $vardir.'/temp';
|
||||
|
||||
$mesg=dol_remove_file_process($_POST['removedfile'],0);
|
||||
|
||||
$action='presend';
|
||||
}
|
||||
|
||||
/*
|
||||
* Send mail
|
||||
*/
|
||||
@ -1148,7 +1181,7 @@ elseif ($fichinterid)
|
||||
$formmail = new FormMail($db);
|
||||
$formmail->fromtype = 'user';
|
||||
$formmail->fromid = $user->id;
|
||||
$formmail->fromname = $user->fullname;
|
||||
$formmail->fromname = $user->getFullName($langs);
|
||||
$formmail->frommail = $user->email;
|
||||
$formmail->withfrom=1;
|
||||
$formmail->withto=empty($_POST["sendto"])?1:$_POST["sendto"];
|
||||
@ -1158,7 +1191,7 @@ elseif ($fichinterid)
|
||||
$formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC;
|
||||
$formmail->withtocccsocid=0;
|
||||
$formmail->withtopic=$langs->trans('SendInterventionRef','__FICHINTERREF__');
|
||||
$formmail->withfile=1;
|
||||
$formmail->withfile=2;
|
||||
$formmail->withbody=1;
|
||||
$formmail->withdeliveryreceipt=1;
|
||||
$formmail->withcancel=1;
|
||||
@ -1186,5 +1219,5 @@ elseif ($fichinterid)
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date: 2011/07/07 22:02:48 $ - $Revision: 1.170 $');
|
||||
llxFooter('$Date: 2011/07/10 20:03:39 $ - $Revision: 1.171 $');
|
||||
?>
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
* \file htdocs/fourn/commande/fiche.php
|
||||
* \ingroup supplier, order
|
||||
* \brief Card supplier order
|
||||
* \version $Id: fiche.php,v 1.231 2011/07/07 21:32:21 eldy Exp $
|
||||
* \version $Id: fiche.php,v 1.232 2011/07/10 20:03:40 eldy Exp $
|
||||
*/
|
||||
|
||||
require("../../main.inc.php");
|
||||
@ -578,9 +578,9 @@ if ($_POST['addfile'])
|
||||
|
||||
// Set tmp user directory TODO Use a dedicated directory for temp mails files
|
||||
$vardir=$conf->user->dir_output."/".$user->id;
|
||||
$upload_dir = $vardir.'/temp/';
|
||||
$upload_dir_tmp = $vardir.'/temp';
|
||||
|
||||
$mesg=dol_add_file_process($upload_dir,0,0);
|
||||
$mesg=dol_add_file_process($upload_dir_tmp,0,0);
|
||||
|
||||
$action='presend';
|
||||
}
|
||||
@ -594,7 +594,7 @@ if (! empty($_POST['removedfile']))
|
||||
|
||||
// Set tmp user directory
|
||||
$vardir=$conf->user->dir_output."/".$user->id;
|
||||
$upload_dir = $vardir.'/temp/';
|
||||
$upload_dir_tmp = $vardir.'/temp';
|
||||
|
||||
$mesg=dol_remove_file_process($_POST['removedfile'],0);
|
||||
|
||||
@ -1545,5 +1545,5 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date: 2011/07/07 21:32:21 $ - $Revision: 1.231 $');
|
||||
llxFooter('$Date: 2011/07/10 20:03:40 $ - $Revision: 1.232 $');
|
||||
?>
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
* \file htdocs/fourn/facture/fiche.php
|
||||
* \ingroup facture, fournisseur
|
||||
* \brief Page for supplier invoice card (view, edit, validate)
|
||||
* \version $Id: fiche.php,v 1.260 2011/07/07 21:32:19 eldy Exp $
|
||||
* \version $Id: fiche.php,v 1.261 2011/07/10 20:03:39 eldy Exp $
|
||||
*/
|
||||
|
||||
require("../../main.inc.php");
|
||||
@ -629,9 +629,9 @@ if ($_POST['addfile'])
|
||||
|
||||
// Set tmp user directory TODO Use a dedicated directory for temp mails files
|
||||
$vardir=$conf->user->dir_output."/".$user->id;
|
||||
$upload_dir = $vardir.'/temp/';
|
||||
$upload_dir_tmp = $vardir.'/temp';
|
||||
|
||||
$mesg=dol_add_file_process($upload_dir,0,0);
|
||||
$mesg=dol_add_file_process($upload_dir_tmp,0,0);
|
||||
|
||||
$_GET["action"]='presend';
|
||||
$_POST["action"]='presend';
|
||||
@ -646,7 +646,7 @@ if (! empty($_POST['removedfile']))
|
||||
|
||||
// Set tmp user directory
|
||||
$vardir=$conf->user->dir_output."/".$user->id;
|
||||
$upload_dir = $vardir.'/temp/';
|
||||
$upload_dir_tmp = $vardir.'/temp';
|
||||
|
||||
$mesg=dol_remove_file_process($_POST['removedfile'],0);
|
||||
|
||||
@ -1916,5 +1916,5 @@ else
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date: 2011/07/07 21:32:19 $ - $Revision: 1.260 $');
|
||||
llxFooter('$Date: 2011/07/10 20:03:39 $ - $Revision: 1.261 $');
|
||||
?>
|
||||
|
||||
@ -53,7 +53,7 @@ PredefinedMailContentSendOrder=Veuillez trouver ci-joint la commande __ORDERREF_
|
||||
PredefinedMailContentSendSupplierOrder=Veuillez trouver ci-joint notre commande __ORDERREF__\n\nCordialement\n\n
|
||||
PredefinedMailContentSendSupplierInvoice=Veuillez trouver ci-joint la facture __FACREF__\n\nCordialement\n\n
|
||||
PredefinedMailContentSendShipping=Veuillez trouver ci-joint le bon d'expédition __SHIPPINGREF__\n\nCordialement\n\n
|
||||
PredefinedMailContentSendFichInter=Veuillez trouver ci-joint le intervention __FICHINTERREF__\n\nCordialement\n\n
|
||||
PredefinedMailContentSendFichInter=Veuillez trouver ci-joint la fiche d'intervention __FICHINTERREF__\n\nCordialement\n\n
|
||||
DemoDesc=Dolibarr est un logiciel de gestion d'activité (professionnelle ou associative) composé de modules fonctionnels indépendants et optionnels. Une démonstration qui inclut tous ces modules n'a pas de sens car les modules ne sont jamais tous utilisés en même temps. Aussi, plusieurs profils type de démo sont disponibles.
|
||||
ChooseYourDemoProfil=Veuillez choisir le profil de démo qui correspond le mieux à votre activité...
|
||||
DemoFundation=Gestion des adhérents d'une association
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
/**
|
||||
* \file htdocs/lib/files.lib.php
|
||||
* \brief Library for file managing functions
|
||||
* \version $Id: files.lib.php,v 1.66 2011/07/06 16:56:01 eldy Exp $
|
||||
* \version $Id: files.lib.php,v 1.67 2011/07/10 20:03:41 eldy Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -709,7 +709,7 @@ function dol_add_file_process($upload_dir,$allowoverwrite=0,$donotupdatesession=
|
||||
|
||||
if (! empty($_FILES['addedfile']['tmp_name']))
|
||||
{
|
||||
if (create_exdir($upload_dir) >= 0)
|
||||
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']);
|
||||
if (is_numeric($resupload) && $resupload > 0)
|
||||
@ -755,10 +755,11 @@ function dol_add_file_process($upload_dir,$allowoverwrite=0,$donotupdatesession=
|
||||
* Remove an uploaded file (for example after submitting a new file a mail form).
|
||||
* All information used are in db, conf, langs, user and _FILES.
|
||||
* @param filenb File nb to delete
|
||||
* @param donotupdatesession 1=Do no edit _SESSION variable
|
||||
* @param donotupdatesession 1=Do not edit _SESSION variable
|
||||
* @param donotdeletefile 1=Do not delete physically file
|
||||
* @return string Message with result of upload and store.
|
||||
*/
|
||||
function dol_remove_file_process($filenb,$donotupdatesession=0)
|
||||
function dol_remove_file_process($filenb,$donotupdatesession=0,$donotdeletefile=0)
|
||||
{
|
||||
global $db,$user,$conf,$langs,$_FILES;
|
||||
|
||||
@ -778,14 +779,16 @@ function dol_remove_file_process($filenb,$donotupdatesession=0)
|
||||
{
|
||||
$pathtodelete=$listofpaths[$keytodelete];
|
||||
$filetodelete=$listofnames[$keytodelete];
|
||||
$result = dol_delete_file($pathtodelete,1);
|
||||
if (empty($donotdeletefile)) $result = dol_delete_file($pathtodelete,1);
|
||||
else $result=0;
|
||||
if ($result >= 0)
|
||||
{
|
||||
$langs->load("other");
|
||||
|
||||
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved",$filetodelete).'</div>';
|
||||
//print_r($_FILES);
|
||||
|
||||
if (empty($donotdeletefile))
|
||||
{
|
||||
$langs->load("other");
|
||||
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved",$filetodelete).'</div>';
|
||||
//print_r($_FILES);
|
||||
}
|
||||
if (empty($donotupdatesession))
|
||||
{
|
||||
include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user