forked from Wavyzz/dolibarr
Fix: rename function sanitizeFileName into dol_sanitizeFileName to avoir conflict with fckeditor
This commit is contained in:
@@ -71,7 +71,7 @@ if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
|||||||
/*
|
/*
|
||||||
* Creation repertoire si n'existe pas
|
* Creation repertoire si n'existe pas
|
||||||
*/
|
*/
|
||||||
$upload_dir = $conf->commercial->dir_actions.'/'.sanitizeFileName($objectid);
|
$upload_dir = $conf->commercial->dir_actions.'/'.dol_sanitizeFileName($objectid);
|
||||||
if (! is_dir($upload_dir)) create_exdir($upload_dir);
|
if (! is_dir($upload_dir)) create_exdir($upload_dir);
|
||||||
|
|
||||||
if (is_dir($upload_dir))
|
if (is_dir($upload_dir))
|
||||||
@@ -95,7 +95,7 @@ if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
|||||||
*/
|
*/
|
||||||
if ($_GET["action"] == 'delete')
|
if ($_GET["action"] == 'delete')
|
||||||
{
|
{
|
||||||
$upload_dir = $conf->commercial->dir_actions.'/'.sanitizeFileName($objectid);
|
$upload_dir = $conf->commercial->dir_actions.'/'.dol_sanitizeFileName($objectid);
|
||||||
$file = $upload_dir . '/' . urldecode($_GET['urlfile']);
|
$file = $upload_dir . '/' . urldecode($_GET['urlfile']);
|
||||||
dol_delete_file($file);
|
dol_delete_file($file);
|
||||||
}
|
}
|
||||||
@@ -113,7 +113,7 @@ if ($objectid > 0)
|
|||||||
$act = new ActionComm($db);
|
$act = new ActionComm($db);
|
||||||
if ($act->fetch($objectid))
|
if ($act->fetch($objectid))
|
||||||
{
|
{
|
||||||
$upload_dir = $conf->commercial->dir_actions.'/'.sanitizeFileName($objectid);
|
$upload_dir = $conf->commercial->dir_actions.'/'.dol_sanitizeFileName($objectid);
|
||||||
|
|
||||||
$company=new Societe($db);
|
$company=new Societe($db);
|
||||||
$company->fetch($act->societe->id);
|
$company->fetch($act->societe->id);
|
||||||
|
|||||||
@@ -314,8 +314,8 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
|
|||||||
if (($objp->fk_statut <= 1) && $objp->dp < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late"));
|
if (($objp->fk_statut <= 1) && $objp->dp < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late"));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td width="16" align="center" class="nobordernopadding">';
|
print '<td width="16" align="center" class="nobordernopadding">';
|
||||||
$filename=sanitizeFileName($objp->ref);
|
$filename=dol_sanitizeFileName($objp->ref);
|
||||||
$filedir=$conf->propale->dir_output . '/' . sanitizeFileName($objp->ref);
|
$filedir=$conf->propale->dir_output . '/' . dol_sanitizeFileName($objp->ref);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?propalid='.$objp->propalid;
|
$urlsource=$_SERVER['PHP_SELF'].'?propalid='.$objp->propalid;
|
||||||
$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','','','',1);
|
$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','','','',1);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
@@ -513,8 +513,8 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
|
|||||||
if ($obj->dp < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late"));
|
if ($obj->dp < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late"));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td width="16" align="center" class="nobordernopadding">';
|
print '<td width="16" align="center" class="nobordernopadding">';
|
||||||
$filename=sanitizeFileName($obj->ref);
|
$filename=dol_sanitizeFileName($obj->ref);
|
||||||
$filedir=$conf->propale->dir_output . '/' . sanitizeFileName($obj->ref);
|
$filedir=$conf->propale->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?propalid='.$obj->propalid;
|
$urlsource=$_SERVER['PHP_SELF'].'?propalid='.$obj->propalid;
|
||||||
$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','','','',1);
|
$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','','','',1);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|||||||
@@ -404,7 +404,7 @@ if ($_POST['action'] == 'send' && ! $_POST['addfile'] && ! $_POST['cancel'])
|
|||||||
$propal= new Propal($db);
|
$propal= new Propal($db);
|
||||||
if ( $propal->fetch($_POST['propalid']) )
|
if ( $propal->fetch($_POST['propalid']) )
|
||||||
{
|
{
|
||||||
$propalref = sanitizeFileName($propal->ref);
|
$propalref = dol_sanitizeFileName($propal->ref);
|
||||||
$file = $conf->propale->dir_output . '/' . $propalref . '/' . $propalref . '.pdf';
|
$file = $conf->propale->dir_output . '/' . $propalref . '/' . $propalref . '.pdf';
|
||||||
|
|
||||||
if (is_readable($file))
|
if (is_readable($file))
|
||||||
@@ -1785,7 +1785,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
// Send
|
// Send
|
||||||
if ($propal->statut == 1 && $user->rights->propale->envoyer)
|
if ($propal->statut == 1 && $user->rights->propale->envoyer)
|
||||||
{
|
{
|
||||||
$propref = sanitizeFileName($propal->ref);
|
$propref = dol_sanitizeFileName($propal->ref);
|
||||||
$file = $conf->propale->dir_output . '/'.$propref.'/'.$propref.'.pdf';
|
$file = $conf->propale->dir_output . '/'.$propref.'/'.$propref.'.pdf';
|
||||||
if (file_exists($file))
|
if (file_exists($file))
|
||||||
{
|
{
|
||||||
@@ -1849,8 +1849,8 @@ if ($id > 0 || ! empty($ref))
|
|||||||
/*
|
/*
|
||||||
* Documents generes
|
* Documents generes
|
||||||
*/
|
*/
|
||||||
$filename=sanitizeFileName($propal->ref);
|
$filename=dol_sanitizeFileName($propal->ref);
|
||||||
$filedir=$conf->propale->dir_output . "/" . sanitizeFileName($propal->ref);
|
$filedir=$conf->propale->dir_output . "/" . dol_sanitizeFileName($propal->ref);
|
||||||
$urlsource=$_SERVER["PHP_SELF"]."?propalid=".$propal->id;
|
$urlsource=$_SERVER["PHP_SELF"]."?propalid=".$propal->id;
|
||||||
$genallowed=$user->rights->propale->creer;
|
$genallowed=$user->rights->propale->creer;
|
||||||
$delallowed=$user->rights->propale->supprimer;
|
$delallowed=$user->rights->propale->supprimer;
|
||||||
@@ -1910,7 +1910,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
*/
|
*/
|
||||||
if ($_GET['action'] == 'presend')
|
if ($_GET['action'] == 'presend')
|
||||||
{
|
{
|
||||||
$ref = sanitizeFileName($propal->ref);
|
$ref = dol_sanitizeFileName($propal->ref);
|
||||||
$file = $conf->propale->dir_output . '/' . $ref . '/' . $ref . '.pdf';
|
$file = $conf->propale->dir_output . '/' . $ref . '/' . $ref . '.pdf';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@@ -2115,8 +2115,8 @@ else
|
|||||||
|
|
||||||
print '<td width="16" align="right" class="nobordernopadding">';
|
print '<td width="16" align="right" class="nobordernopadding">';
|
||||||
|
|
||||||
$filename=sanitizeFileName($objp->ref);
|
$filename=dol_sanitizeFileName($objp->ref);
|
||||||
$filedir=$conf->propale->dir_output . '/' . sanitizeFileName($objp->ref);
|
$filedir=$conf->propale->dir_output . '/' . dol_sanitizeFileName($objp->ref);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?propalid='.$objp->propalid;
|
$urlsource=$_SERVER['PHP_SELF'].'?propalid='.$objp->propalid;
|
||||||
$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','','','',1);
|
$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','','','',1);
|
||||||
|
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ if ($_GET["propalid"] > 0)
|
|||||||
/*
|
/*
|
||||||
* Documents
|
* Documents
|
||||||
*/
|
*/
|
||||||
$propalref = sanitizeFileName($propal->ref);
|
$propalref = dol_sanitizeFileName($propal->ref);
|
||||||
$dir_output = $conf->propale->dir_output . "/";
|
$dir_output = $conf->propale->dir_output . "/";
|
||||||
$filepath = $dir_output . $propalref . "/";
|
$filepath = $dir_output . $propalref . "/";
|
||||||
$file = $filepath . $propalref . ".pdf";
|
$file = $filepath . $propalref . ".pdf";
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
|||||||
|
|
||||||
if ($propal->fetch($propalid))
|
if ($propal->fetch($propalid))
|
||||||
{
|
{
|
||||||
$upload_dir = $conf->propale->dir_output . "/" . sanitizeFileName($propal->ref);
|
$upload_dir = $conf->propale->dir_output . "/" . dol_sanitizeFileName($propal->ref);
|
||||||
if (! is_dir($upload_dir)) create_exdir($upload_dir);
|
if (! is_dir($upload_dir)) create_exdir($upload_dir);
|
||||||
|
|
||||||
if (is_dir($upload_dir))
|
if (is_dir($upload_dir))
|
||||||
@@ -100,7 +100,7 @@ if ($action=='delete')
|
|||||||
$propalid=$_GET["id"];
|
$propalid=$_GET["id"];
|
||||||
if ($propal->fetch($propalid))
|
if ($propal->fetch($propalid))
|
||||||
{
|
{
|
||||||
$upload_dir = $conf->propale->dir_output . "/" . sanitizeFileName($propal->ref);
|
$upload_dir = $conf->propale->dir_output . "/" . dol_sanitizeFileName($propal->ref);
|
||||||
$file = $upload_dir . '/' . urldecode($_GET['urlfile']);
|
$file = $upload_dir . '/' . urldecode($_GET['urlfile']);
|
||||||
dol_delete_file($file);
|
dol_delete_file($file);
|
||||||
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved").'</div>';
|
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved").'</div>';
|
||||||
@@ -119,7 +119,7 @@ if ($propalid > 0)
|
|||||||
$propal = new Propal($db);
|
$propal = new Propal($db);
|
||||||
if ($propal->fetch($propalid))
|
if ($propal->fetch($propalid))
|
||||||
{
|
{
|
||||||
$upload_dir = $conf->propale->dir_output.'/'.sanitizeFileName($propal->ref);
|
$upload_dir = $conf->propale->dir_output.'/'.dol_sanitizeFileName($propal->ref);
|
||||||
|
|
||||||
$societe = new Societe($db);
|
$societe = new Societe($db);
|
||||||
$societe->fetch($propal->socid);
|
$societe->fetch($propal->socid);
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ if ($_GET["id"] > 0) {
|
|||||||
/*
|
/*
|
||||||
* Documents
|
* Documents
|
||||||
*/
|
*/
|
||||||
$commanderef = sanitizeFileName($commande->ref);
|
$commanderef = dol_sanitizeFileName($commande->ref);
|
||||||
$dir_output = $conf->commande->dir_output . "/";
|
$dir_output = $conf->commande->dir_output . "/";
|
||||||
$filepath = $dir_output . $commanderef . "/";
|
$filepath = $dir_output . $commanderef . "/";
|
||||||
$file = $filepath . $commanderef . ".pdf";
|
$file = $filepath . $commanderef . ".pdf";
|
||||||
|
|||||||
@@ -257,8 +257,8 @@ class Commande extends CommonObject
|
|||||||
{
|
{
|
||||||
// On renomme repertoire facture ($this->ref = ancienne ref, $numfa = nouvelle ref)
|
// On renomme repertoire facture ($this->ref = ancienne ref, $numfa = nouvelle ref)
|
||||||
// afin de ne pas perdre les fichiers attach<63>s
|
// afin de ne pas perdre les fichiers attach<63>s
|
||||||
$comref = sanitizeFileName($this->ref);
|
$comref = dol_sanitizeFileName($this->ref);
|
||||||
$snum = sanitizeFileName($num);
|
$snum = dol_sanitizeFileName($num);
|
||||||
$dirsource = $conf->commande->dir_output.'/'.$comref;
|
$dirsource = $conf->commande->dir_output.'/'.$comref;
|
||||||
$dirdest = $conf->commande->dir_output.'/'.$snum;
|
$dirdest = $conf->commande->dir_output.'/'.$snum;
|
||||||
if (file_exists($dirsource))
|
if (file_exists($dirsource))
|
||||||
@@ -1799,7 +1799,7 @@ class Commande extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// On efface le repertoire de pdf provisoire
|
// On efface le repertoire de pdf provisoire
|
||||||
$comref = sanitizeFileName($this->ref);
|
$comref = dol_sanitizeFileName($this->ref);
|
||||||
if ($conf->commande->dir_output)
|
if ($conf->commande->dir_output)
|
||||||
{
|
{
|
||||||
$dir = $conf->commande->dir_output . "/" . $comref ;
|
$dir = $conf->commande->dir_output . "/" . $comref ;
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ if (! $commande->fetch($_GET['id'],$_GET['ref']) > 0)
|
|||||||
// Envoi fichier
|
// Envoi fichier
|
||||||
if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||||
{
|
{
|
||||||
$upload_dir = $conf->commande->dir_output . "/" . sanitizeFileName($commande->ref);
|
$upload_dir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($commande->ref);
|
||||||
if (! is_dir($upload_dir)) create_exdir($upload_dir);
|
if (! is_dir($upload_dir)) create_exdir($upload_dir);
|
||||||
|
|
||||||
if (is_dir($upload_dir))
|
if (is_dir($upload_dir))
|
||||||
@@ -97,7 +97,7 @@ if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
|||||||
// Delete
|
// Delete
|
||||||
if ($action=='delete')
|
if ($action=='delete')
|
||||||
{
|
{
|
||||||
$upload_dir = $conf->commande->dir_output . "/" . sanitizeFileName($commande->ref);
|
$upload_dir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($commande->ref);
|
||||||
$file = $upload_dir . '/' . urldecode($_GET['urlfile']);
|
$file = $upload_dir . '/' . urldecode($_GET['urlfile']);
|
||||||
dol_delete_file($file);
|
dol_delete_file($file);
|
||||||
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved").'</div>';
|
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved").'</div>';
|
||||||
@@ -114,7 +114,7 @@ $html = new Form($db);
|
|||||||
|
|
||||||
if ($id > 0 || ! empty($ref))
|
if ($id > 0 || ! empty($ref))
|
||||||
{
|
{
|
||||||
$upload_dir = $conf->commande->dir_output.'/'.sanitizeFileName($commande->ref);
|
$upload_dir = $conf->commande->dir_output.'/'.dol_sanitizeFileName($commande->ref);
|
||||||
|
|
||||||
$societe = new Societe($db);
|
$societe = new Societe($db);
|
||||||
$societe->fetch($commande->socid);
|
$societe->fetch($commande->socid);
|
||||||
|
|||||||
@@ -724,7 +724,7 @@ if ($_POST['action'] == 'send' && ! $_POST['addfile'] && ! $_POST['cancel'])
|
|||||||
$result=$commande->fetch($_POST['orderid']);
|
$result=$commande->fetch($_POST['orderid']);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$ref = sanitizeFileName($commande->ref);
|
$ref = dol_sanitizeFileName($commande->ref);
|
||||||
$file = $conf->commande->dir_output . '/' . $ref . '/' . $ref . '.pdf';
|
$file = $conf->commande->dir_output . '/' . $ref . '/' . $ref . '.pdf';
|
||||||
|
|
||||||
if (is_readable($file))
|
if (is_readable($file))
|
||||||
@@ -1966,7 +1966,7 @@ else
|
|||||||
{
|
{
|
||||||
if ($user->rights->commande->envoyer)
|
if ($user->rights->commande->envoyer)
|
||||||
{
|
{
|
||||||
$comref = sanitizeFileName($commande->ref);
|
$comref = dol_sanitizeFileName($commande->ref);
|
||||||
$file = $conf->commande->dir_output . '/'.$comref.'/'.$comref.'.pdf';
|
$file = $conf->commande->dir_output . '/'.$comref.'/'.$comref.'.pdf';
|
||||||
if (file_exists($file))
|
if (file_exists($file))
|
||||||
{
|
{
|
||||||
@@ -2075,7 +2075,7 @@ else
|
|||||||
* Documents generes
|
* Documents generes
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
$comref = sanitizeFileName($commande->ref);
|
$comref = dol_sanitizeFileName($commande->ref);
|
||||||
$file = $conf->commande->dir_output . '/' . $comref . '/' . $comref . '.pdf';
|
$file = $conf->commande->dir_output . '/' . $comref . '/' . $comref . '.pdf';
|
||||||
$relativepath = $comref.'/'.$comref.'.pdf';
|
$relativepath = $comref.'/'.$comref.'.pdf';
|
||||||
$filedir = $conf->commande->dir_output . '/' . $comref;
|
$filedir = $conf->commande->dir_output . '/' . $comref;
|
||||||
@@ -2142,7 +2142,7 @@ else
|
|||||||
*/
|
*/
|
||||||
if ($_GET['action'] == 'presend')
|
if ($_GET['action'] == 'presend')
|
||||||
{
|
{
|
||||||
$ref = sanitizeFileName($commande->ref);
|
$ref = dol_sanitizeFileName($commande->ref);
|
||||||
$file = $conf->commande->dir_output . '/' . $ref . '/' . $ref . '.pdf';
|
$file = $conf->commande->dir_output . '/' . $ref . '/' . $ref . '.pdf';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|||||||
@@ -157,8 +157,8 @@ if ( $db->query($sql) )
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td width="16" align="right" class="nobordernopadding">';
|
print '<td width="16" align="right" class="nobordernopadding">';
|
||||||
$filename=sanitizeFileName($obj->ref);
|
$filename=dol_sanitizeFileName($obj->ref);
|
||||||
$filedir=$conf->commande->dir_output . '/' . sanitizeFileName($obj->ref);
|
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||||
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
|
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
@@ -222,8 +222,8 @@ if ( $db->query($sql) )
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td width="16" align="right" class="nobordernopadding">';
|
print '<td width="16" align="right" class="nobordernopadding">';
|
||||||
$filename=sanitizeFileName($obj->ref);
|
$filename=dol_sanitizeFileName($obj->ref);
|
||||||
$filedir=$conf->commande->dir_output . '/' . sanitizeFileName($obj->ref);
|
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||||
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
|
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
@@ -290,8 +290,8 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td width="16" align="right" class="nobordernopadding">';
|
print '<td width="16" align="right" class="nobordernopadding">';
|
||||||
$filename=sanitizeFileName($obj->ref);
|
$filename=dol_sanitizeFileName($obj->ref);
|
||||||
$filedir=$conf->commande->dir_output . '/' . sanitizeFileName($obj->ref);
|
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||||
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
|
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|||||||
@@ -205,8 +205,8 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td width="16" align="right" class="nobordernopadding">';
|
print '<td width="16" align="right" class="nobordernopadding">';
|
||||||
$filename=sanitizeFileName($objp->ref);
|
$filename=dol_sanitizeFileName($objp->ref);
|
||||||
$filedir=$conf->commande->dir_output . '/' . sanitizeFileName($objp->ref);
|
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid;
|
$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid;
|
||||||
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
|
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ if ($_POST["action"] == 'add')
|
|||||||
// Creation compte
|
// Creation compte
|
||||||
$account = new Account($db,0);
|
$account = new Account($db,0);
|
||||||
|
|
||||||
$account->ref = sanitizeFileName(trim($_POST["ref"]));
|
$account->ref = dol_sanitizeFileName(trim($_POST["ref"]));
|
||||||
$account->label = trim($_POST["label"]);
|
$account->label = trim($_POST["label"]);
|
||||||
$account->courant = $_POST["type"];
|
$account->courant = $_POST["type"];
|
||||||
$account->clos = $_POST["clos"];
|
$account->clos = $_POST["clos"];
|
||||||
|
|||||||
@@ -526,7 +526,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
* Documents g<>n<EFBFBD>r<EFBFBD>s
|
* Documents g<>n<EFBFBD>r<EFBFBD>s
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
$comref = sanitizeFileName($commande->ref);
|
$comref = dol_sanitizeFileName($commande->ref);
|
||||||
$file = $conf->commande->dir_output . '/' . $comref . '/' . $comref . '.pdf';
|
$file = $conf->commande->dir_output . '/' . $comref . '/' . $comref . '.pdf';
|
||||||
$relativepath = $comref.'/'.$comref.'.pdf';
|
$relativepath = $comref.'/'.$comref.'.pdf';
|
||||||
$filedir = $conf->commande->dir_output . '/' . $comref;
|
$filedir = $conf->commande->dir_output . '/' . $comref;
|
||||||
|
|||||||
@@ -148,8 +148,8 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td width="16" align="right" class="nobordernopadding">';
|
print '<td width="16" align="right" class="nobordernopadding">';
|
||||||
$filename=sanitizeFileName($objp->ref);
|
$filename=dol_sanitizeFileName($objp->ref);
|
||||||
$filedir=$conf->commande->dir_output . '/' . sanitizeFileName($objp->ref);
|
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid;
|
$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid;
|
||||||
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
|
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|||||||
@@ -454,7 +454,7 @@ if ($_GET["rowid"] && $_GET["action"] != 'edit')
|
|||||||
/*
|
/*
|
||||||
* Documents g<>n<EFBFBD>r<EFBFBD>s
|
* Documents g<>n<EFBFBD>r<EFBFBD>s
|
||||||
*/
|
*/
|
||||||
$filename=sanitizeFileName($don->id);
|
$filename=dol_sanitizeFileName($don->id);
|
||||||
$filedir=$conf->don->dir_output . '/' . get_exdir($filename,2);
|
$filedir=$conf->don->dir_output . '/' . get_exdir($filename,2);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?rowid='.$don->id;
|
$urlsource=$_SERVER['PHP_SELF'].'?rowid='.$don->id;
|
||||||
// $genallowed=($fac->statut == 1 && ($fac->paye == 0 || $user->admin) && $user->rights->facture->creer);
|
// $genallowed=($fac->statut == 1 && ($fac->paye == 0 || $user->admin) && $user->rights->facture->creer);
|
||||||
|
|||||||
@@ -1150,7 +1150,7 @@ if (($_POST['action'] == 'send' || $_POST['action'] == 'relance') && ! $_POST['a
|
|||||||
$result=$fac->fetch($_POST['facid']);
|
$result=$fac->fetch($_POST['facid']);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$ref = sanitizeFileName($fac->ref);
|
$ref = dol_sanitizeFileName($fac->ref);
|
||||||
$file = $conf->facture->dir_output . '/' . $ref . '/' . $ref . '.pdf';
|
$file = $conf->facture->dir_output . '/' . $ref . '/' . $ref . '.pdf';
|
||||||
|
|
||||||
if (is_readable($file))
|
if (is_readable($file))
|
||||||
@@ -3338,8 +3338,8 @@ else
|
|||||||
/*
|
/*
|
||||||
* Documents g<>n<EFBFBD>r<EFBFBD>s
|
* Documents g<>n<EFBFBD>r<EFBFBD>s
|
||||||
*/
|
*/
|
||||||
$filename=sanitizeFileName($fac->ref);
|
$filename=dol_sanitizeFileName($fac->ref);
|
||||||
$filedir=$conf->facture->dir_output . '/' . sanitizeFileName($fac->ref);
|
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($fac->ref);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$fac->id;
|
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$fac->id;
|
||||||
$genallowed=$user->rights->facture->creer;
|
$genallowed=$user->rights->facture->creer;
|
||||||
$delallowed=$user->rights->facture->supprimer;
|
$delallowed=$user->rights->facture->supprimer;
|
||||||
@@ -3474,7 +3474,7 @@ else
|
|||||||
*/
|
*/
|
||||||
if ($_GET['action'] == 'presend')
|
if ($_GET['action'] == 'presend')
|
||||||
{
|
{
|
||||||
$ref = sanitizeFileName($fac->ref);
|
$ref = dol_sanitizeFileName($fac->ref);
|
||||||
$file = $conf->facture->dir_output . '/' . $ref . '/' . $ref . '.pdf';
|
$file = $conf->facture->dir_output . '/' . $ref . '/' . $ref . '.pdf';
|
||||||
|
|
||||||
// Construit PDF si non existant
|
// Construit PDF si non existant
|
||||||
@@ -3541,7 +3541,7 @@ else
|
|||||||
|
|
||||||
if ($_GET['action'] == 'prerelance')
|
if ($_GET['action'] == 'prerelance')
|
||||||
{
|
{
|
||||||
$ref = sanitizeFileName($fac->ref);
|
$ref = dol_sanitizeFileName($fac->ref);
|
||||||
$file = $conf->facture->dir_output . '/' . $ref . '/' . $ref . '.pdf';
|
$file = $conf->facture->dir_output . '/' . $ref . '/' . $ref . '.pdf';
|
||||||
|
|
||||||
// Construit PDF si non existant
|
// Construit PDF si non existant
|
||||||
@@ -3787,8 +3787,8 @@ else
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td width="16" align="right" class="nobordernopadding">';
|
print '<td width="16" align="right" class="nobordernopadding">';
|
||||||
$filename=sanitizeFileName($objp->facnumber);
|
$filename=dol_sanitizeFileName($objp->facnumber);
|
||||||
$filedir=$conf->facture->dir_output . '/' . sanitizeFileName($objp->facnumber);
|
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$objp->facid;
|
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$objp->facid;
|
||||||
$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','','','',1);
|
$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','','','',1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ if ($_GET["facid"] > 0)
|
|||||||
/*
|
/*
|
||||||
* Documents
|
* Documents
|
||||||
*/
|
*/
|
||||||
$facref = sanitizeFileName($fac->ref);
|
$facref = dol_sanitizeFileName($fac->ref);
|
||||||
$dir_output = $conf->facture->dir_output . "/";
|
$dir_output = $conf->facture->dir_output . "/";
|
||||||
$filepath = $dir_output . $facref . "/";
|
$filepath = $dir_output . $facref . "/";
|
||||||
$file = $filepath . $facref . ".pdf";
|
$file = $filepath . $facref . ".pdf";
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
|||||||
$facture = new Facture($db);
|
$facture = new Facture($db);
|
||||||
if ($facture->fetch($facid))
|
if ($facture->fetch($facid))
|
||||||
{
|
{
|
||||||
$upload_dir = $conf->facture->dir_output . "/" . sanitizeFileName($facture->ref);
|
$upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($facture->ref);
|
||||||
if (! is_dir($upload_dir)) create_exdir($upload_dir);
|
if (! is_dir($upload_dir)) create_exdir($upload_dir);
|
||||||
|
|
||||||
if (is_dir($upload_dir))
|
if (is_dir($upload_dir))
|
||||||
@@ -101,7 +101,7 @@ if ($action=='delete')
|
|||||||
$facid=$_GET["id"];
|
$facid=$_GET["id"];
|
||||||
if ($facture->fetch($facid))
|
if ($facture->fetch($facid))
|
||||||
{
|
{
|
||||||
$upload_dir = $conf->facture->dir_output . "/" . sanitizeFileName($facture->ref);
|
$upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($facture->ref);
|
||||||
$file = $upload_dir . '/' . urldecode($_GET['urlfile']);
|
$file = $upload_dir . '/' . urldecode($_GET['urlfile']);
|
||||||
dol_delete_file($file);
|
dol_delete_file($file);
|
||||||
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved").'</div>';
|
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved").'</div>';
|
||||||
@@ -119,7 +119,7 @@ if ($facid > 0)
|
|||||||
$facture = new Facture($db);
|
$facture = new Facture($db);
|
||||||
if ($facture->fetch($facid))
|
if ($facture->fetch($facid))
|
||||||
{
|
{
|
||||||
$upload_dir = $conf->facture->dir_output.'/'.sanitizeFileName($facture->ref);
|
$upload_dir = $conf->facture->dir_output.'/'.dol_sanitizeFileName($facture->ref);
|
||||||
|
|
||||||
$societe = new Societe($db);
|
$societe = new Societe($db);
|
||||||
$societe->fetch($facture->socid);
|
$societe->fetch($facture->socid);
|
||||||
|
|||||||
@@ -96,8 +96,8 @@ if ($_POST["action"] == "builddoc" && $user->rights->facture->lire)
|
|||||||
create_exdir($diroutputpdf);
|
create_exdir($diroutputpdf);
|
||||||
|
|
||||||
// Save merged file
|
// Save merged file
|
||||||
$filename=strtolower(sanitizeFileName($langs->transnoentities("Unpayed")));
|
$filename=strtolower(dol_sanitizeFileName($langs->transnoentities("Unpayed")));
|
||||||
if ($option=='late') $filename.='_'.strtolower(sanitizeFileName($langs->transnoentities("Late")));
|
if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late")));
|
||||||
if ($pagecount)
|
if ($pagecount)
|
||||||
{
|
{
|
||||||
$file=$diroutputpdf.'/'.$filename.'_'.dol_print_date(mktime(),'dayhourlog').'.pdf';
|
$file=$diroutputpdf.'/'.$filename.'_'.dol_print_date(mktime(),'dayhourlog').'.pdf';
|
||||||
@@ -338,8 +338,8 @@ if ($result)
|
|||||||
|
|
||||||
// PDF Picto
|
// PDF Picto
|
||||||
print '<td width="16" align="right" class="nobordernopadding">';
|
print '<td width="16" align="right" class="nobordernopadding">';
|
||||||
$filename=sanitizeFileName($objp->facnumber);
|
$filename=dol_sanitizeFileName($objp->facnumber);
|
||||||
$filedir=$conf->facture->dir_output . '/' . sanitizeFileName($objp->facnumber);
|
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber);
|
||||||
$foundpdf=$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','','','',1,$param);
|
$foundpdf=$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','','','',1,$param);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|||||||
@@ -555,8 +555,8 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman
|
|||||||
print ' ';
|
print ' ';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td width="16" align="right" class="nobordernopadding">';
|
print '<td width="16" align="right" class="nobordernopadding">';
|
||||||
$filename=sanitizeFileName($obj->ref);
|
$filename=dol_sanitizeFileName($obj->ref);
|
||||||
$filedir=$conf->commande->dir_output . '/' . sanitizeFileName($obj->ref);
|
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||||
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
|
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
@@ -651,8 +651,8 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
|
|||||||
if ($obj->datelimite < ($now - $conf->facture->client->warning_delay)) print img_warning($langs->trans("Late"));
|
if ($obj->datelimite < ($now - $conf->facture->client->warning_delay)) print img_warning($langs->trans("Late"));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td width="16" align="right" class="nobordernopadding">';
|
print '<td width="16" align="right" class="nobordernopadding">';
|
||||||
$filename=sanitizeFileName($obj->facnumber);
|
$filename=dol_sanitizeFileName($obj->facnumber);
|
||||||
$filedir=$conf->facture->dir_output . '/' . sanitizeFileName($obj->facnumber);
|
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->facnumber);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid;
|
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid;
|
||||||
$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','','','',1);
|
$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','','','',1);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|||||||
@@ -491,8 +491,8 @@ if ($id > 0 || ! empty($ref))
|
|||||||
/*
|
/*
|
||||||
* Documents generes
|
* Documents generes
|
||||||
*/
|
*/
|
||||||
$filename=sanitizeFileName($propal->ref);
|
$filename=dol_sanitizeFileName($propal->ref);
|
||||||
$filedir=$conf->propale->dir_output . "/" . sanitizeFileName($propal->ref);
|
$filedir=$conf->propale->dir_output . "/" . dol_sanitizeFileName($propal->ref);
|
||||||
$urlsource=$_SERVER["PHP_SELF"]."?propalid=".$propal->id;
|
$urlsource=$_SERVER["PHP_SELF"]."?propalid=".$propal->id;
|
||||||
$genallowed=0;
|
$genallowed=0;
|
||||||
$delallowed=0;
|
$delallowed=0;
|
||||||
@@ -773,8 +773,8 @@ else
|
|||||||
|
|
||||||
print '<td width="16" align="right" class="nobordernopadding">';
|
print '<td width="16" align="right" class="nobordernopadding">';
|
||||||
|
|
||||||
$filename=sanitizeFileName($objp->ref);
|
$filename=dol_sanitizeFileName($objp->ref);
|
||||||
$filedir=$conf->propale->dir_output . '/' . sanitizeFileName($objp->ref);
|
$filedir=$conf->propale->dir_output . '/' . dol_sanitizeFileName($objp->ref);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?propalid='.$objp->propalid;
|
$urlsource=$_SERVER['PHP_SELF'].'?propalid='.$objp->propalid;
|
||||||
$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','','','',1);
|
$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','','','',1);
|
||||||
|
|
||||||
|
|||||||
@@ -85,8 +85,8 @@ $db->close();
|
|||||||
$output = $v->getVCard();
|
$output = $v->getVCard();
|
||||||
|
|
||||||
$filename =trim(urldecode($v->getFileName())); // "Nom prenom.vcf"
|
$filename =trim(urldecode($v->getFileName())); // "Nom prenom.vcf"
|
||||||
$filenameurlencoded = sanitizeFileName(urlencode($filename));
|
$filenameurlencoded = dol_sanitizeFileName(urlencode($filename));
|
||||||
//$filename = sanitizeFileName($filename);
|
//$filename = dol_sanitizeFileName($filename);
|
||||||
|
|
||||||
Header("Content-Disposition: attachment; filename=\"$filename\"");
|
Header("Content-Disposition: attachment; filename=\"$filename\"");
|
||||||
Header("Content-Length: ".strlen($output));
|
Header("Content-Length: ".strlen($output));
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ $pagenext = $page + 1;
|
|||||||
$contrat = new Contrat($db);
|
$contrat = new Contrat($db);
|
||||||
$contrat->fetch($_GET["id"]);
|
$contrat->fetch($_GET["id"]);
|
||||||
|
|
||||||
$upload_dir = $conf->contrat->dir_output.'/'.sanitizeFileName($contrat->ref);
|
$upload_dir = $conf->contrat->dir_output.'/'.dol_sanitizeFileName($contrat->ref);
|
||||||
$modulepart='contract';
|
$modulepart='contract';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -422,7 +422,7 @@ class EcmDirectory // extends CommonObject
|
|||||||
if ($cursorindex >= 0)
|
if ($cursorindex >= 0)
|
||||||
{
|
{
|
||||||
// Path is label sanitized (no space and no special char) and concatenated
|
// Path is label sanitized (no space and no special char) and concatenated
|
||||||
$ret=sanitizeFileName($this->cats[$cursorindex]['label']).'/'.$ret;
|
$ret=dol_sanitizeFileName($this->cats[$cursorindex]['label']).'/'.$ret;
|
||||||
|
|
||||||
$idtosearch=$this->cats[$cursorindex]['id_mere'];
|
$idtosearch=$this->cats[$cursorindex]['id_mere'];
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ class Expedition extends CommonObject
|
|||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
$this->brouillon = 1;
|
$this->brouillon = 1;
|
||||||
$this->tracking_number = sanitizeFileName($this->tracking_number);
|
$this->tracking_number = dol_sanitizeFileName($this->tracking_number);
|
||||||
|
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
|
|
||||||
@@ -404,7 +404,7 @@ class Expedition extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// On efface le r<>pertoire de pdf provisoire
|
// On efface le r<>pertoire de pdf provisoire
|
||||||
$expeditionref = sanitizeFileName($provref);
|
$expeditionref = dol_sanitizeFileName($provref);
|
||||||
if ($conf->expedition->dir_output)
|
if ($conf->expedition->dir_output)
|
||||||
{
|
{
|
||||||
$dir = $conf->expedition->dir_output . "/" . $expeditionref;
|
$dir = $conf->expedition->dir_output . "/" . $expeditionref;
|
||||||
@@ -538,7 +538,7 @@ class Expedition extends CommonObject
|
|||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
|
|
||||||
// On efface le r<>pertoire de pdf provisoire
|
// On efface le r<>pertoire de pdf provisoire
|
||||||
$expref = sanitizeFileName($this->ref);
|
$expref = dol_sanitizeFileName($this->ref);
|
||||||
if ($conf->expedition->dir_output)
|
if ($conf->expedition->dir_output)
|
||||||
{
|
{
|
||||||
$dir = $conf->expedition->dir_output . "/" . $expref ;
|
$dir = $conf->expedition->dir_output . "/" . $expref ;
|
||||||
|
|||||||
@@ -847,7 +847,7 @@ else
|
|||||||
*/
|
*/
|
||||||
if ($conf->expedition_bon->enabled)
|
if ($conf->expedition_bon->enabled)
|
||||||
{
|
{
|
||||||
$expeditionref = sanitizeFileName($expedition->ref);
|
$expeditionref = dol_sanitizeFileName($expedition->ref);
|
||||||
$filedir = $conf->expedition->dir_bon_expedition . "/" .$expeditionref;
|
$filedir = $conf->expedition->dir_bon_expedition . "/" .$expeditionref;
|
||||||
|
|
||||||
$urlsource = $_SERVER["PHP_SELF"]."?id=".$expedition->id;
|
$urlsource = $_SERVER["PHP_SELF"]."?id=".$expedition->id;
|
||||||
|
|||||||
@@ -1308,8 +1308,8 @@ class Facture extends CommonObject
|
|||||||
{
|
{
|
||||||
// On renomme repertoire facture ($this->ref = ancienne ref, $numfa = nouvelle ref)
|
// On renomme repertoire facture ($this->ref = ancienne ref, $numfa = nouvelle ref)
|
||||||
// afin de ne pas perdre les fichiers attach<63>s
|
// afin de ne pas perdre les fichiers attach<63>s
|
||||||
$facref = sanitizeFileName($this->ref);
|
$facref = dol_sanitizeFileName($this->ref);
|
||||||
$snumfa = sanitizeFileName($numfa);
|
$snumfa = dol_sanitizeFileName($numfa);
|
||||||
$dirsource = $conf->facture->dir_output.'/'.$facref;
|
$dirsource = $conf->facture->dir_output.'/'.$facref;
|
||||||
$dirdest = $conf->facture->dir_output.'/'.$snumfa;
|
$dirdest = $conf->facture->dir_output.'/'.$snumfa;
|
||||||
if (file_exists($dirsource))
|
if (file_exists($dirsource))
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ if ($_GET["id"] > 0) {
|
|||||||
/*
|
/*
|
||||||
* Documents
|
* Documents
|
||||||
*/
|
*/
|
||||||
$fichinterref = sanitizeFileName($fichinter->ref);
|
$fichinterref = dol_sanitizeFileName($fichinter->ref);
|
||||||
$dir_output = $conf->ficheinter->dir_output . "/";
|
$dir_output = $conf->ficheinter->dir_output . "/";
|
||||||
$filepath = $dir_output . $fichinterref . "/";
|
$filepath = $dir_output . $fichinterref . "/";
|
||||||
$file = $filepath . $fichinterref . ".pdf";
|
$file = $filepath . $fichinterref . ".pdf";
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ $pagenext = $page + 1;
|
|||||||
$object = new Fichinter($db);
|
$object = new Fichinter($db);
|
||||||
$object->fetch($_GET["id"]);
|
$object->fetch($_GET["id"]);
|
||||||
|
|
||||||
$upload_dir = $conf->ficheinter->dir_output.'/'.sanitizeFileName($object->ref);
|
$upload_dir = $conf->ficheinter->dir_output.'/'.dol_sanitizeFileName($object->ref);
|
||||||
$modulepart='fichinter';
|
$modulepart='fichinter';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -902,7 +902,7 @@ elseif ($_GET["id"] > 0)
|
|||||||
/*
|
/*
|
||||||
* Built documents
|
* Built documents
|
||||||
*/
|
*/
|
||||||
$filename=sanitizeFileName($fichinter->ref);
|
$filename=dol_sanitizeFileName($fichinter->ref);
|
||||||
$filedir=$conf->ficheinter->dir_output . "/".$fichinter->ref;
|
$filedir=$conf->ficheinter->dir_output . "/".$fichinter->ref;
|
||||||
$urlsource=$_SERVER["PHP_SELF"]."?id=".$fichinter->id;
|
$urlsource=$_SERVER["PHP_SELF"]."?id=".$fichinter->id;
|
||||||
$genallowed=$user->rights->ficheinter->creer;
|
$genallowed=$user->rights->ficheinter->creer;
|
||||||
|
|||||||
@@ -479,7 +479,7 @@ class Fichinter extends CommonObject
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Remove directory with files
|
// Remove directory with files
|
||||||
$fichinterref = sanitizeFileName($this->ref);
|
$fichinterref = dol_sanitizeFileName($this->ref);
|
||||||
if ($conf->ficheinter->dir_output)
|
if ($conf->ficheinter->dir_output)
|
||||||
{
|
{
|
||||||
$dir = $conf->ficheinter->dir_output . "/" . $fichinterref ;
|
$dir = $conf->ficheinter->dir_output . "/" . $fichinterref ;
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ if ($commande->fetch($_GET['id'],$_GET['ref']) < 0)
|
|||||||
// Envoi fichier
|
// Envoi fichier
|
||||||
if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||||
{
|
{
|
||||||
$upload_dir = $conf->fournisseur->dir_commande . "/" . sanitizeFileName($commande->ref);
|
$upload_dir = $conf->fournisseur->dir_commande . "/" . dol_sanitizeFileName($commande->ref);
|
||||||
if (! is_dir($upload_dir)) create_exdir($upload_dir);
|
if (! is_dir($upload_dir)) create_exdir($upload_dir);
|
||||||
|
|
||||||
if (is_dir($upload_dir))
|
if (is_dir($upload_dir))
|
||||||
@@ -98,7 +98,7 @@ if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
|||||||
// Delete
|
// Delete
|
||||||
if ($action=='delete')
|
if ($action=='delete')
|
||||||
{
|
{
|
||||||
$upload_dir = $conf->fournisseur->dir_commande . "/" . sanitizeFileName($commande->ref);
|
$upload_dir = $conf->fournisseur->dir_commande . "/" . dol_sanitizeFileName($commande->ref);
|
||||||
$file = $upload_dir . '/' . urldecode($_GET['urlfile']);
|
$file = $upload_dir . '/' . urldecode($_GET['urlfile']);
|
||||||
dol_delete_file($file);
|
dol_delete_file($file);
|
||||||
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved").'</div>';
|
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved").'</div>';
|
||||||
@@ -117,7 +117,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
{
|
{
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
$upload_dir = $conf->fournisseur->dir_commande.'/'.sanitizeFileName($commande->ref);
|
$upload_dir = $conf->fournisseur->dir_commande.'/'.dol_sanitizeFileName($commande->ref);
|
||||||
|
|
||||||
$soc = new Societe($db);
|
$soc = new Societe($db);
|
||||||
$soc->fetch($commande->socid);
|
$soc->fetch($commande->socid);
|
||||||
|
|||||||
@@ -995,7 +995,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
/*
|
/*
|
||||||
* Documents generes
|
* Documents generes
|
||||||
*/
|
*/
|
||||||
$comfournref = sanitizeFileName($commande->ref);
|
$comfournref = dol_sanitizeFileName($commande->ref);
|
||||||
$file = $conf->fournisseur->dir_commande . '/' . $comfournref . '/' . $comfournref . '.pdf';
|
$file = $conf->fournisseur->dir_commande . '/' . $comfournref . '/' . $comfournref . '.pdf';
|
||||||
$relativepath = $comfournref.'/'.$comfournref.'.pdf';
|
$relativepath = $comfournref.'/'.$comfournref.'.pdf';
|
||||||
$filedir = $conf->fournisseur->dir_commande . '/' . $comfournref;
|
$filedir = $conf->fournisseur->dir_commande . '/' . $comfournref;
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ class FormFile
|
|||||||
$forcenomultilang=0;
|
$forcenomultilang=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$filename = sanitizeFileName($filename);
|
$filename = dol_sanitizeFileName($filename);
|
||||||
$headershown=0;
|
$headershown=0;
|
||||||
$i=0;
|
$i=0;
|
||||||
|
|
||||||
@@ -451,7 +451,7 @@ class FormFile
|
|||||||
// Define relative path used to store the file
|
// Define relative path used to store the file
|
||||||
if (! $relativepath)
|
if (! $relativepath)
|
||||||
{
|
{
|
||||||
$relativepath=sanitizeFileName($object->ref).'/';
|
$relativepath=dol_sanitizeFileName($object->ref).'/';
|
||||||
if ($modulepart == 'facture_fournisseur') $relativepath=get_exdir($object->id,2).$relativepath;
|
if ($modulepart == 'facture_fournisseur') $relativepath=get_exdir($object->id,2).$relativepath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ function commande_delete_preview($db, $commandeid, $commanderef='')
|
|||||||
|
|
||||||
if ($conf->commande->dir_output)
|
if ($conf->commande->dir_output)
|
||||||
{
|
{
|
||||||
$comref = sanitizeFileName($commanderef);
|
$comref = dol_sanitizeFileName($commanderef);
|
||||||
$dir = $conf->commande->dir_output . "/" . $comref ;
|
$dir = $conf->commande->dir_output . "/" . $comref ;
|
||||||
$file = $dir . "/" . $comref . ".pdf.png";
|
$file = $dir . "/" . $comref . ".pdf.png";
|
||||||
$multiple = $file . ".";
|
$multiple = $file . ".";
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ class pdf_edison extends ModelePDFCommandes
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$comref = sanitizeFileName($com->ref);
|
$comref = dol_sanitizeFileName($com->ref);
|
||||||
$dir = $conf->commande->dir_output . "/" . $comref;
|
$dir = $conf->commande->dir_output . "/" . $comref;
|
||||||
$file = $dir . "/" . $comref . ".pdf";
|
$file = $dir . "/" . $comref . ".pdf";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$comref = sanitizeFileName($com->ref);
|
$comref = dol_sanitizeFileName($com->ref);
|
||||||
$dir = $conf->commande->dir_output . "/" . $comref;
|
$dir = $conf->commande->dir_output . "/" . $comref;
|
||||||
$file = $dir . "/" . $comref . ".pdf";
|
$file = $dir . "/" . $comref . ".pdf";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ class html_cerfafr extends ModeleDon
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$donref = sanitizeFileName($don->ref);
|
$donref = dol_sanitizeFileName($don->ref);
|
||||||
$dir = $conf->don->dir_output . "/" . get_exdir($donref,2);
|
$dir = $conf->don->dir_output . "/" . get_exdir($donref,2);
|
||||||
$file = $dir . "/" . $donref . ".html";
|
$file = $dir . "/" . $donref . ".html";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$expref = sanitizeFileName($this->expe->ref);
|
$expref = dol_sanitizeFileName($this->expe->ref);
|
||||||
$dir = $conf->expedition->dir_bon_expedition . "/" . $expref;
|
$dir = $conf->expedition->dir_bon_expedition . "/" . $expref;
|
||||||
$file = $dir . "/" . $expref . ".pdf";
|
$file = $dir . "/" . $expref . ".pdf";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$expref = sanitizeFileName($this->expe->ref);
|
$expref = dol_sanitizeFileName($this->expe->ref);
|
||||||
$dir = $conf->expedition->dir_bon_expedition . "/" . $expref;
|
$dir = $conf->expedition->dir_bon_expedition . "/" . $expref;
|
||||||
$file = $dir . "/" . $expref . ".pdf";
|
$file = $dir . "/" . $expref . ".pdf";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
* Copyright (C) 2005 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
@@ -21,11 +21,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/includes/modules/facture/modules_facture.php
|
* \file htdocs/includes/modules/facture/modules_facture.php
|
||||||
\ingroup facture
|
* \ingroup facture
|
||||||
\brief Fichier contenant la classe m<EFBFBD>re de generation des factures en PDF
|
* \brief Fichier contenant la classe mere de generation des factures en PDF
|
||||||
et la classe m<EFBFBD>re de num<EFBFBD>rotation des factures
|
* et la classe mere de numerotation des factures
|
||||||
\version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/lib/pdf.lib.php');
|
require_once(DOL_DOCUMENT_ROOT.'/lib/pdf.lib.php');
|
||||||
@@ -241,7 +241,7 @@ function facture_meta_create($db, $facid, $message="")
|
|||||||
|
|
||||||
if ($conf->facture->dir_output)
|
if ($conf->facture->dir_output)
|
||||||
{
|
{
|
||||||
$facref = sanitizeFileName($fac->ref);
|
$facref = dol_sanitizeFileName($fac->ref);
|
||||||
$dir = $conf->facture->dir_output . "/" . $facref ;
|
$dir = $conf->facture->dir_output . "/" . $facref ;
|
||||||
$file = $dir . "/" . $facref . ".meta";
|
$file = $dir . "/" . $facref . ".meta";
|
||||||
|
|
||||||
@@ -295,7 +295,7 @@ function facture_delete_preview($db, $facid)
|
|||||||
|
|
||||||
if ($conf->facture->dir_output)
|
if ($conf->facture->dir_output)
|
||||||
{
|
{
|
||||||
$facref = sanitizeFileName($fac->ref);
|
$facref = dol_sanitizeFileName($fac->ref);
|
||||||
$dir = $conf->facture->dir_output . "/" . $facref ;
|
$dir = $conf->facture->dir_output . "/" . $facref ;
|
||||||
$file = $dir . "/" . $facref . ".pdf.png";
|
$file = $dir . "/" . $facref . ".pdf.png";
|
||||||
|
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$facref = sanitizeFileName($fac->ref);
|
$facref = dol_sanitizeFileName($fac->ref);
|
||||||
$dir = $conf->facture->dir_output . "/" . $facref;
|
$dir = $conf->facture->dir_output . "/" . $facref;
|
||||||
$file = $dir . "/" . $facref . ".pdf";
|
$file = $dir . "/" . $facref . ".pdf";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ class pdf_oursin extends ModelePDFFactures
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$facref = sanitizeFileName($fac->ref);
|
$facref = dol_sanitizeFileName($fac->ref);
|
||||||
$dir = $conf->facture->dir_output . "/" . $facref;
|
$dir = $conf->facture->dir_output . "/" . $facref;
|
||||||
$file = $dir . "/" . $facref . ".pdf";
|
$file = $dir . "/" . $facref . ".pdf";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -240,7 +240,7 @@ function fichinter_delete_preview($db, $fichinterid, $fichinterref='')
|
|||||||
|
|
||||||
if ($conf->ficheinter->dir_output)
|
if ($conf->ficheinter->dir_output)
|
||||||
{
|
{
|
||||||
$fichinterref = sanitizeFileName($fichinterref);
|
$fichinterref = dol_sanitizeFileName($fichinterref);
|
||||||
$dir = $conf->ficheinter->dir_output . "/" . $fichinterref ;
|
$dir = $conf->ficheinter->dir_output . "/" . $fichinterref ;
|
||||||
$file = $dir . "/" . $fichinterref . ".pdf.png";
|
$file = $dir . "/" . $fichinterref . ".pdf.png";
|
||||||
$multiple = $file . ".";
|
$multiple = $file . ".";
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ class pdf_soleil extends ModelePDFFicheinter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$fichref = sanitizeFileName($fichinter->ref);
|
$fichref = dol_sanitizeFileName($fichinter->ref);
|
||||||
$dir = $conf->ficheinter->dir_output;
|
$dir = $conf->ficheinter->dir_output;
|
||||||
if (! eregi('specimen',$fichref)) $dir.= "/" . $fichref;
|
if (! eregi('specimen',$fichref)) $dir.= "/" . $fichref;
|
||||||
$file = $dir . "/" . $fichref . ".pdf";
|
$file = $dir . "/" . $fichref . ".pdf";
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ function delivery_order_delete_preview($db, $deliveryid)
|
|||||||
|
|
||||||
if ($conf->livraison->dir_output)
|
if ($conf->livraison->dir_output)
|
||||||
{
|
{
|
||||||
$deliveryref = sanitizeFileName($delivery->ref);
|
$deliveryref = dol_sanitizeFileName($delivery->ref);
|
||||||
$dir = $conf->livraison->dir_output . "/" . $deliveryref ;
|
$dir = $conf->livraison->dir_output . "/" . $deliveryref ;
|
||||||
$file = $dir . "/" . $deliveryref . ".pdf.png";
|
$file = $dir . "/" . $deliveryref . ".pdf.png";
|
||||||
|
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
|||||||
|
|
||||||
$nblignes = sizeof($delivery->lignes);
|
$nblignes = sizeof($delivery->lignes);
|
||||||
|
|
||||||
$deliveryref = sanitizeFileName($delivery->ref);
|
$deliveryref = dol_sanitizeFileName($delivery->ref);
|
||||||
$dir = $conf->expedition->dir_bon_livraison;
|
$dir = $conf->expedition->dir_bon_livraison;
|
||||||
if (! eregi('specimen',$deliveryref)) $dir.= "/" . $deliveryref;
|
if (! eregi('specimen',$deliveryref)) $dir.= "/" . $deliveryref;
|
||||||
$file = $dir . "/" . $deliveryref . ".pdf";
|
$file = $dir . "/" . $deliveryref . ".pdf";
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
|
|
||||||
$nblignes = sizeof($delivery->lignes);
|
$nblignes = sizeof($delivery->lignes);
|
||||||
|
|
||||||
$deliveryref = sanitizeFileName($delivery->ref);
|
$deliveryref = dol_sanitizeFileName($delivery->ref);
|
||||||
$dir = $conf->expedition->dir_bon_livraison;
|
$dir = $conf->expedition->dir_bon_livraison;
|
||||||
if (! eregi('specimen',$deliveryref)) $dir.= "/" . $deliveryref;
|
if (! eregi('specimen',$deliveryref)) $dir.= "/" . $deliveryref;
|
||||||
$file = $dir . "/" . $deliveryref . ".pdf";
|
$file = $dir . "/" . $deliveryref . ".pdf";
|
||||||
|
|||||||
@@ -256,7 +256,7 @@ function propale_delete_preview($db, $propalid, $propalref='')
|
|||||||
|
|
||||||
if ($conf->propale->dir_output)
|
if ($conf->propale->dir_output)
|
||||||
{
|
{
|
||||||
$propalref = sanitizeFileName($propalref);
|
$propalref = dol_sanitizeFileName($propalref);
|
||||||
$dir = $conf->propale->dir_output . "/" . $propalref ;
|
$dir = $conf->propale->dir_output . "/" . $propalref ;
|
||||||
$file = $dir . "/" . $propalref . ".pdf.png";
|
$file = $dir . "/" . $propalref . ".pdf.png";
|
||||||
$multiple = $file . ".";
|
$multiple = $file . ".";
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ class pdf_propale_azur extends ModelePDFPropales
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$propref = sanitizeFileName($propale->ref);
|
$propref = dol_sanitizeFileName($propale->ref);
|
||||||
$dir = $conf->propale->dir_output . "/" . $propref;
|
$dir = $conf->propale->dir_output . "/" . $propref;
|
||||||
$file = $dir . "/" . $propref . ".pdf";
|
$file = $dir . "/" . $propref . ".pdf";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ class pdf_propale_jaune extends ModelePDFPropales
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$propref = sanitizeFileName($propale->ref);
|
$propref = dol_sanitizeFileName($propale->ref);
|
||||||
$dir = $conf->propale->dir_output . "/" . $propref;
|
$dir = $conf->propale->dir_output . "/" . $propref;
|
||||||
$file = $dir . "/" . $propref . ".pdf";
|
$file = $dir . "/" . $propref . ".pdf";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ function supplier_order_delete_preview($db, $propalid)
|
|||||||
|
|
||||||
if ($conf->fournisseur->dir_commande)
|
if ($conf->fournisseur->dir_commande)
|
||||||
{
|
{
|
||||||
$comfournref = sanitizeFileName($comfourn->ref);
|
$comfournref = dol_sanitizeFileName($comfourn->ref);
|
||||||
$dir = $conf->commande->dir_output . "/" . $comfournref ;
|
$dir = $conf->commande->dir_output . "/" . $comfournref ;
|
||||||
$file = $dir . "/" . $comfournref . ".pdf.png";
|
$file = $dir . "/" . $comfournref . ".pdf.png";
|
||||||
|
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$comref = sanitizeFileName($com->ref);
|
$comref = dol_sanitizeFileName($com->ref);
|
||||||
$dir = $conf->fournisseur->dir_commande . "/" . $comref;
|
$dir = $conf->fournisseur->dir_commande . "/" . $comref;
|
||||||
$file = $dir . "/" . $comref . ".pdf";
|
$file = $dir . "/" . $comref . ".pdf";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ class InterfaceNotification
|
|||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||||
|
|
||||||
$action_notify = 2;
|
$action_notify = 2;
|
||||||
$ref = sanitizeFileName($object->ref);
|
$ref = dol_sanitizeFileName($object->ref);
|
||||||
$filepdf = $conf->facture->dir_output . '/' . $ref . '/' . $ref . '.pdf';
|
$filepdf = $conf->facture->dir_output . '/' . $ref . '/' . $ref . '.pdf';
|
||||||
$mesg = 'La facture '.$object->ref." a <20>t<EFBFBD> valid<69>e.\n";
|
$mesg = 'La facture '.$object->ref." a <20>t<EFBFBD> valid<69>e.\n";
|
||||||
|
|
||||||
@@ -118,7 +118,7 @@ class InterfaceNotification
|
|||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||||
|
|
||||||
$action_notify = 1;
|
$action_notify = 1;
|
||||||
$ref = sanitizeFileName($object->ref);
|
$ref = dol_sanitizeFileName($object->ref);
|
||||||
$filepdf = $conf->facture->dir_output . '/' . $ref . '/' . $ref . '.pdf';
|
$filepdf = $conf->facture->dir_output . '/' . $ref . '/' . $ref . '.pdf';
|
||||||
$mesg = 'La fiche intervention '.$object->ref." a <20>t<EFBFBD> valid<69>e.\n";
|
$mesg = 'La fiche intervention '.$object->ref." a <20>t<EFBFBD> valid<69>e.\n";
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@ class InterfaceNotification
|
|||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||||
|
|
||||||
$action_notify = 3;
|
$action_notify = 3;
|
||||||
$ref = sanitizeFileName($object->ref);
|
$ref = dol_sanitizeFileName($object->ref);
|
||||||
$filepdf = $conf->fournisseur->dir_commande . '/' . $ref . '/' . $ref . '.pdf';
|
$filepdf = $conf->fournisseur->dir_commande . '/' . $ref . '/' . $ref . '.pdf';
|
||||||
$mesg = 'La commande fournisseur '.$object->ref." a <20>t<EFBFBD> valid<69>e.\n";
|
$mesg = 'La commande fournisseur '.$object->ref." a <20>t<EFBFBD> valid<69>e.\n";
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
/* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||||
* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2008 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2008 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@@ -19,9 +19,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/install/upgrade2.php
|
* \file htdocs/install/upgrade2.php
|
||||||
\brief Effectue la migration de donnees diverses
|
* \brief Effectue la migration de donnees diverses
|
||||||
\version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
include_once('./inc.php');
|
include_once('./inc.php');
|
||||||
@@ -44,7 +44,7 @@ $error = 0;
|
|||||||
// Ne fonctionne que si on est pas en safe_mode.
|
// Ne fonctionne que si on est pas en safe_mode.
|
||||||
$err=error_reporting();
|
$err=error_reporting();
|
||||||
error_reporting(0);
|
error_reporting(0);
|
||||||
@set_time_limit(60);
|
@set_time_limit(120);
|
||||||
error_reporting($err);
|
error_reporting($err);
|
||||||
|
|
||||||
$setuplang=isset($_POST['selectlang'])?$_POST['selectlang']:(isset($_GET['selectlang'])?$_GET['selectlang']:'auto');
|
$setuplang=isset($_POST['selectlang'])?$_POST['selectlang']:(isset($_GET['selectlang'])?$_GET['selectlang']:'auto');
|
||||||
@@ -892,7 +892,7 @@ function migrate_paiementfourn_facturefourn($db,$langs,$conf)
|
|||||||
$select_sql .= ' FROM '.MAIN_DB_PREFIX.'paiementfourn ';
|
$select_sql .= ' FROM '.MAIN_DB_PREFIX.'paiementfourn ';
|
||||||
$select_sql .= ' WHERE fk_facture_fourn IS NOT NULL';
|
$select_sql .= ' WHERE fk_facture_fourn IS NOT NULL';
|
||||||
|
|
||||||
dolibarr_install_syslog("upgrade2::migrate_paiementfourn_facturefourn sql=".$sql);
|
dolibarr_install_syslog("upgrade2::migrate_paiementfourn_facturefourn sql=".$select_sql);
|
||||||
$select_resql = $db->query($select_sql);
|
$select_resql = $db->query($select_sql);
|
||||||
if ($select_resql)
|
if ($select_resql)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ if (! defined('ADODB_DATE_VERSION')) include_once(DOL_DOCUMENT_ROOT."/includes/a
|
|||||||
* \param newstr String to replace bad chars by
|
* \param newstr String to replace bad chars by
|
||||||
* \return string String cleaned (a-zA-Z_)
|
* \return string String cleaned (a-zA-Z_)
|
||||||
*/
|
*/
|
||||||
function sanitizeFileName($str,$newstr='_')
|
function dol_sanitizeFileName($str,$newstr='_')
|
||||||
{
|
{
|
||||||
return dol_string_nospecial(dol_string_unaccent($str),$newstr);
|
return dol_string_nospecial(dol_string_unaccent($str),$newstr);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -581,7 +581,7 @@ else
|
|||||||
* Documents generated
|
* Documents generated
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$livraisonref = sanitizeFileName($livraison->ref);
|
$livraisonref = dol_sanitizeFileName($livraison->ref);
|
||||||
$filedir = $conf->expedition->dir_bon_livraison . '/' . $livraisonref;
|
$filedir = $conf->expedition->dir_bon_livraison . '/' . $livraisonref;
|
||||||
$urlsource = $_SERVER["PHP_SELF"]."?id=".$livraison->id;
|
$urlsource = $_SERVER["PHP_SELF"]."?id=".$livraison->id;
|
||||||
|
|
||||||
|
|||||||
@@ -416,7 +416,7 @@ class Livraison extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// On efface le repertoire de pdf provisoire
|
// On efface le repertoire de pdf provisoire
|
||||||
$livraisonref = sanitizeFileName($this->ref);
|
$livraisonref = dol_sanitizeFileName($this->ref);
|
||||||
if ($conf->expedition->dir_output)
|
if ($conf->expedition->dir_output)
|
||||||
{
|
{
|
||||||
$dir = $conf->livraison->dir_output . "/" . $livraisonref ;
|
$dir = $conf->livraison->dir_output . "/" . $livraisonref ;
|
||||||
@@ -555,7 +555,7 @@ class Livraison extends CommonObject
|
|||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
|
|
||||||
// On efface le repertoire de pdf provisoire
|
// On efface le repertoire de pdf provisoire
|
||||||
$livref = sanitizeFileName($this->ref);
|
$livref = dol_sanitizeFileName($this->ref);
|
||||||
if ($conf->livraison->dir_output)
|
if ($conf->livraison->dir_output)
|
||||||
{
|
{
|
||||||
$dir = $conf->livraison->dir_output . "/" . $livref ;
|
$dir = $conf->livraison->dir_output . "/" . $livref ;
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ class Product extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
$this->ref = sanitizeFileName(stripslashes($this->ref));
|
$this->ref = dol_sanitizeFileName(stripslashes($this->ref));
|
||||||
|
|
||||||
$err = 0;
|
$err = 0;
|
||||||
if (strlen(trim($this->ref)) == 0)
|
if (strlen(trim($this->ref)) == 0)
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ if ($_GET['id'] || $_GET["ref"])
|
|||||||
if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
|
if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
|
||||||
if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
|
if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
|
||||||
|
|
||||||
$upload_dir = $conf->produit->dir_output.'/'.sanitizeFileName($product->ref);
|
$upload_dir = $conf->produit->dir_output.'/'.dol_sanitizeFileName($product->ref);
|
||||||
}
|
}
|
||||||
$modulepart='produit';
|
$modulepart='produit';
|
||||||
|
|
||||||
|
|||||||
@@ -1501,7 +1501,7 @@ class Propal extends CommonObject
|
|||||||
if ( $this->db->query($sql) )
|
if ( $this->db->query($sql) )
|
||||||
{
|
{
|
||||||
// We remove directory
|
// We remove directory
|
||||||
$propalref = sanitizeFileName($this->ref);
|
$propalref = dol_sanitizeFileName($this->ref);
|
||||||
if ($conf->propale->dir_output)
|
if ($conf->propale->dir_output)
|
||||||
{
|
{
|
||||||
$dir = $conf->propale->dir_output . "/" . $propalref ;
|
$dir = $conf->propale->dir_output . "/" . $propalref ;
|
||||||
|
|||||||
@@ -341,7 +341,7 @@ class Societe extends CommonObject
|
|||||||
$this->prefix_comm=trim($this->prefix_comm);
|
$this->prefix_comm=trim($this->prefix_comm);
|
||||||
|
|
||||||
$this->tva_assuj=trim($this->tva_assuj);
|
$this->tva_assuj=trim($this->tva_assuj);
|
||||||
$this->tva_intra=sanitizeFileName($this->tva_intra,'');
|
$this->tva_intra=dol_sanitizeFileName($this->tva_intra,'');
|
||||||
|
|
||||||
$this->capital=trim($this->capital);
|
$this->capital=trim($this->capital);
|
||||||
if (strlen($this->capital) == 0) $this->capital = 0;
|
if (strlen($this->capital) == 0) $this->capital = 0;
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ if ($_POST["action"] == 'send' || $_POST["action"] == 'relance')
|
|||||||
$fac = new Facture($db,"",$_POST["facid"]);
|
$fac = new Facture($db,"",$_POST["facid"]);
|
||||||
if ( $fac->fetch($_POST["facid"]) )
|
if ( $fac->fetch($_POST["facid"]) )
|
||||||
{
|
{
|
||||||
$facref = sanitizeFileName($fac->ref);
|
$facref = dol_sanitizeFileName($fac->ref);
|
||||||
$file = $conf->facture->dir_output . "/" . $facref . "/" . $facref . ".pdf";
|
$file = $conf->facture->dir_output . "/" . $facref . "/" . $facref . ".pdf";
|
||||||
|
|
||||||
if (is_readable($file))
|
if (is_readable($file))
|
||||||
@@ -497,7 +497,7 @@ if ($_GET["facid"] > 0)
|
|||||||
* REFFACTURE-XXXXXX-detail.pdf ou XXXXX est une forme diverse
|
* REFFACTURE-XXXXXX-detail.pdf ou XXXXX est une forme diverse
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$facref = sanitizeFileName($fac->ref);
|
$facref = dol_sanitizeFileName($fac->ref);
|
||||||
$file = $conf->facture->dir_output . "/" . $facref . "/" . $facref . ".pdf";
|
$file = $conf->facture->dir_output . "/" . $facref . "/" . $facref . ".pdf";
|
||||||
$relativepath = "${facref}/${facref}.pdf";
|
$relativepath = "${facref}/${facref}.pdf";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user