diff --git a/htdocs/comm/addpropal.php b/htdocs/comm/addpropal.php
index 03674a54683..4d6718a0915 100644
--- a/htdocs/comm/addpropal.php
+++ b/htdocs/comm/addpropal.php
@@ -87,7 +87,7 @@ if ($_GET["action"] == 'create')
$sql.= " FROM ".MAIN_DB_PREFIX."propal";
$sql.= " WHERE ref LIKE '".$numpr."%'";
$sql.= " AND entity = ".$conf->entity;
-
+
$resql=$db->query($sql);
if ($resql)
{
@@ -293,9 +293,9 @@ if ($_GET["action"] == 'create')
print '
| ';
// multiprix
if($conf->global->PRODUIT_MULTIPRICES && $soc->price_level)
- $html->select_produits('',"idprod".$i,'',$conf->produit->limit_size,$soc->price_level);
+ $html->select_produits('',"idprod".$i,'',$conf->product->limit_size,$soc->price_level);
else
- $html->select_produits('',"idprod".$i,'',$conf->produit->limit_size);
+ $html->select_produits('',"idprod".$i,'',$conf->product->limit_size);
print ' | ';
print ' | ';
print '% | ';
diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php
index 836e02c62e6..9648fb703ad 100644
--- a/htdocs/comm/propal.php
+++ b/htdocs/comm/propal.php
@@ -1780,11 +1780,11 @@ if ($id > 0 || ! empty($ref))
// multiprix
if($conf->global->PRODUIT_MULTIPRICES)
{
- $html->select_produits('','idprod','',$conf->produit->limit_size,$societe->price_level);
+ $html->select_produits('','idprod','',$conf->product->limit_size,$societe->price_level);
}
else
{
- $html->select_produits('','idprod','',$conf->produit->limit_size);
+ $html->select_produits('','idprod','',$conf->product->limit_size);
}
if (! $conf->global->PRODUIT_USE_SEARCH_TO_SELECT) print '
';
diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php
index 7ae856a9a41..5dc4e65c069 100644
--- a/htdocs/commande/fiche.php
+++ b/htdocs/commande/fiche.php
@@ -1174,9 +1174,9 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer)
print '
| ';
// multiprix
if($conf->global->PRODUIT_MULTIPRICES)
- print $html->select_produits('','idprod'.$i,'',$conf->produit->limit_size,$soc->price_level);
+ print $html->select_produits('','idprod'.$i,'',$conf->product->limit_size,$soc->price_level);
else
- print $html->select_produits('','idprod'.$i,'',$conf->produit->limit_size);
+ print $html->select_produits('','idprod'.$i,'',$conf->product->limit_size);
print ' | ';
print ' | ';
print '% |
';
@@ -2019,11 +2019,11 @@ else
// multiprix
if($conf->global->PRODUIT_MULTIPRICES)
{
- $html->select_produits('','idprod','',$conf->produit->limit_size,$soc->price_level);
+ $html->select_produits('','idprod','',$conf->product->limit_size,$soc->price_level);
}
else
{
- $html->select_produits('','idprod','',$conf->produit->limit_size);
+ $html->select_produits('','idprod','',$conf->product->limit_size);
}
if (! $conf->global->PRODUIT_USE_SEARCH_TO_SELECT) print '
';
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index b9a94675da3..18ab40b29c7 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -1697,9 +1697,9 @@ if ($_GET['action'] == 'create')
print '';
// multiprix
if($conf->global->PRODUIT_MULTIPRICES)
- $html->select_produits('','idprod'.$i,'',$conf->produit->limit_size,$soc->price_level);
+ $html->select_produits('','idprod'.$i,'',$conf->product->limit_size,$soc->price_level);
else
- $html->select_produits('','idprod'.$i,'',$conf->produit->limit_size);
+ $html->select_produits('','idprod'.$i,'',$conf->product->limit_size);
print ' | ';
print ' | ';
print '% | ';
@@ -3065,11 +3065,11 @@ else
// multiprix
if($conf->global->PRODUIT_MULTIPRICES)
{
- $html->select_produits((! empty($_POST['idprod'])?$_POST['idprod']:''),'idprod','',$conf->produit->limit_size,$soc->price_level);
+ $html->select_produits((! empty($_POST['idprod'])?$_POST['idprod']:''),'idprod','',$conf->product->limit_size,$soc->price_level);
}
else
{
- $html->select_produits((! empty($_POST['idprod'])?$_POST['idprod']:''),'idprod','',$conf->produit->limit_size);
+ $html->select_produits((! empty($_POST['idprod'])?$_POST['idprod']:''),'idprod','',$conf->product->limit_size);
}
if (! $conf->global->PRODUIT_USE_SEARCH_TO_SELECT) print '
';
diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php
index 3e54e2dad22..8e458fec911 100644
--- a/htdocs/contrat/fiche.php
+++ b/htdocs/contrat/fiche.php
@@ -1214,9 +1214,9 @@ else
print '';
// multiprix
if($conf->global->PRODUIT_MULTIPRICES)
- $form->select_produits('','p_idprod',1,$conf->produit->limit_size,$contrat->societe->price_level);
+ $form->select_produits('','p_idprod',1,$conf->product->limit_size,$contrat->societe->price_level);
else
- $form->select_produits('','p_idprod',1,$conf->produit->limit_size);
+ $form->select_produits('','p_idprod',1,$conf->product->limit_size);
if (! $conf->global->PRODUIT_USE_SEARCH_TO_SELECT) print ' ';
print '';
print ' | ';
diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php
index 972966646d3..6f98527a6ed 100644
--- a/htdocs/core/class/conf.class.php
+++ b/htdocs/core/class/conf.class.php
@@ -341,9 +341,9 @@ class Conf
if (empty($this->global->MAIN_SIZE_LISTE_LIMIT)) $this->global->MAIN_SIZE_LISTE_LIMIT=25;
$this->liste_limit=$this->global->MAIN_SIZE_LISTE_LIMIT;
- // $this->produit->limit_size = constante de taille maximale des select de produit
+ // $this->product->limit_size = constante de taille maximale des select de produit
if (! isset($this->global->PRODUIT_LIMIT_SIZE)) $this->global->PRODUIT_LIMIT_SIZE=100;
- $this->produit->limit_size=$this->global->PRODUIT_LIMIT_SIZE;
+ $this->product->limit_size=$this->global->PRODUIT_LIMIT_SIZE;
// $this->theme et $this->css
if (empty($this->global->MAIN_THEME)) $this->global->MAIN_THEME="eldy";
@@ -412,6 +412,9 @@ class Conf
$this->adherent->cotisation->warning_delay=$this->global->MAIN_DELAY_MEMBERS*24*60*60;
$this->bank->rappro->warning_delay=$this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE*24*60*60;
$this->bank->cheque->warning_delay=(isset($this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT)?$this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT:0)*24*60*60;
+
+ // For backward compatibility
+ $this->produit=$this->product;
}
}
diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php
index 2a2d42d4ec5..8a352b52211 100644
--- a/htdocs/core/photos_resize.php
+++ b/htdocs/core/photos_resize.php
@@ -44,7 +44,13 @@ if ($modulepart=='produit|service' && (! $user->rights->produit->lire && ! $user
if ($_POST["action"] == 'confirm_resize' && (isset($_POST["file"]) != "") && (isset($_POST["sizex"]) != "") && (isset($_POST["sizey"]) != ""))
{
- $fullpath=$conf->produit->dir_output."/".$original_file;
+ $product=new Product($db);
+ $result=$product->fetch($_POST["id"]);
+ $dir=$conf->product->dir_output; // By default
+ if ($product->type == 0) $dir=$conf->product->dir_output;
+ if ($product->type == 1) $dir=$conf->service->dir_output;
+
+ $fullpath=$dir."/".$original_file;
$result=dol_imageResizeOrCrop($fullpath,0,$_POST['sizex'],$_POST['sizey']);
if ($result == $fullpath)
@@ -63,7 +69,13 @@ if ($_POST["action"] == 'confirm_resize' && (isset($_POST["file"]) != "") && (is
// Crop d'une image
if ($_POST["action"] == 'confirm_crop')
{
- $fullpath=$conf->produit->dir_output."/".$original_file;
+ $product=new Product($db);
+ $result=$product->fetch($_POST["id"]);
+ $dir=$conf->product->dir_output; // By default
+ if ($product->type == 0) $dir=$conf->product->dir_output;
+ if ($product->type == 1) $dir=$conf->service->dir_output;
+
+ $fullpath=$dir."/".$original_file;
$result=dol_imageResizeOrCrop($fullpath,1,$_POST['w'],$_POST['h'],$_POST['x'],$_POST['y']);
if ($result == $fullpath)
@@ -91,7 +103,7 @@ print_fiche_titre($langs->trans("Image"));
if ($mesg) print ''.$mesg.'
';
-$infoarray=dol_getImageSize($conf->produit->dir_output."/".urldecode($_GET["file"]));
+$infoarray=dol_getImageSize($conf->product->dir_output."/".urldecode($_GET["file"]));
$height=$infoarray['height'];
$width=$infoarray['width'];
print $langs->trans("CurrentInformationOnImage").':';
@@ -129,7 +141,7 @@ print $langs->trans("DefineNewAreaToPick").'...
';
print '
';
print '
';
print '
';
-$infoarray=dol_getImageSize($conf->produit->dir_output."/".urldecode($_GET["file"]));
+$infoarray=dol_getImageSize($conf->product->dir_output."/".urldecode($_GET["file"]));
$height=$infoarray['height'];
$width=$infoarray['width'];
print '