mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Fix: Can upload files on service if product module is disabled
This commit is contained in:
parent
95a2bc6d0d
commit
60843d28bf
|
|
@ -161,7 +161,7 @@ if ($modulepart)
|
|||
$original_file=$conf->propale->dir_output.'/'.$original_file;
|
||||
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."propal WHERE ref='$refname'";
|
||||
}
|
||||
|
||||
|
||||
// Wrapping pour les commandes
|
||||
if ($modulepart == 'commande')
|
||||
{
|
||||
|
|
@ -173,7 +173,7 @@ if ($modulepart)
|
|||
$original_file=$conf->commande->dir_output.'/'.$original_file;
|
||||
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."commande WHERE ref='$refname'";
|
||||
}
|
||||
|
||||
|
||||
// Wrapping pour les projets
|
||||
if ($modulepart == 'project')
|
||||
{
|
||||
|
|
@ -307,7 +307,7 @@ if ($modulepart)
|
|||
}
|
||||
|
||||
// Wrapping pour les produits et services
|
||||
if ($modulepart == 'produit')
|
||||
if ($modulepart == 'produit' || $modulepart == 'service')
|
||||
{
|
||||
$user->getrights('produit');
|
||||
$user->getrights('service');
|
||||
|
|
@ -315,7 +315,8 @@ if ($modulepart)
|
|||
{
|
||||
$accessallowed=1;
|
||||
}
|
||||
$original_file=$conf->produit->dir_output.'/'.$original_file;
|
||||
if ($conf->produit->enabled) $original_file=$conf->produit->dir_output.'/'.$original_file;
|
||||
elseif ($conf->service->enabled) $original_file=$conf->service->dir_output.'/'.$original_file;
|
||||
$sqlprotectagainstexternals = '';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,11 +21,11 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/product/document.php
|
||||
\ingroup product
|
||||
\brief Page des documents joints sur les produits
|
||||
\version $Id$
|
||||
*/
|
||||
* \file htdocs/product/document.php
|
||||
* \ingroup product
|
||||
* \brief Page des documents joints sur les produits
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
require('./pre.inc.php');
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php");
|
||||
|
|
@ -66,11 +66,11 @@ if ($_GET['id'] || $_GET["ref"])
|
|||
if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
|
||||
if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
|
||||
|
||||
$upload_dir = $conf->produit->dir_output.'/'.dol_sanitizeFileName($product->ref);
|
||||
if ($conf->produit->enabled) $upload_dir = $conf->produit->dir_output.'/'.dol_sanitizeFileName($product->ref);
|
||||
elseif ($conf->service->enabled) $upload_dir = $conf->service->dir_output.'/'.dol_sanitizeFileName($product->ref);
|
||||
}
|
||||
$modulepart='produit';
|
||||
|
||||
|
||||
/*
|
||||
* Action envoie fichier
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user