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;
|
$original_file=$conf->propale->dir_output.'/'.$original_file;
|
||||||
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."propal WHERE ref='$refname'";
|
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."propal WHERE ref='$refname'";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wrapping pour les commandes
|
// Wrapping pour les commandes
|
||||||
if ($modulepart == 'commande')
|
if ($modulepart == 'commande')
|
||||||
{
|
{
|
||||||
@ -173,7 +173,7 @@ if ($modulepart)
|
|||||||
$original_file=$conf->commande->dir_output.'/'.$original_file;
|
$original_file=$conf->commande->dir_output.'/'.$original_file;
|
||||||
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."commande WHERE ref='$refname'";
|
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."commande WHERE ref='$refname'";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wrapping pour les projets
|
// Wrapping pour les projets
|
||||||
if ($modulepart == 'project')
|
if ($modulepart == 'project')
|
||||||
{
|
{
|
||||||
@ -307,7 +307,7 @@ if ($modulepart)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Wrapping pour les produits et services
|
// Wrapping pour les produits et services
|
||||||
if ($modulepart == 'produit')
|
if ($modulepart == 'produit' || $modulepart == 'service')
|
||||||
{
|
{
|
||||||
$user->getrights('produit');
|
$user->getrights('produit');
|
||||||
$user->getrights('service');
|
$user->getrights('service');
|
||||||
@ -315,7 +315,8 @@ if ($modulepart)
|
|||||||
{
|
{
|
||||||
$accessallowed=1;
|
$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 = '';
|
$sqlprotectagainstexternals = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -21,11 +21,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/product/document.php
|
* \file htdocs/product/document.php
|
||||||
\ingroup product
|
* \ingroup product
|
||||||
\brief Page des documents joints sur les produits
|
* \brief Page des documents joints sur les produits
|
||||||
\version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require('./pre.inc.php');
|
require('./pre.inc.php');
|
||||||
require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.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["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.'/'.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';
|
$modulepart='produit';
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Action envoie fichier
|
* Action envoie fichier
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user