Fix: Fix a lot of broken features when renaming produit to product

This commit is contained in:
Laurent Destailleur 2010-06-02 08:34:44 +00:00
parent cd49e79f60
commit d2d63bcb81
20 changed files with 86 additions and 72 deletions

View File

@ -87,7 +87,7 @@ if ($_GET["action"] == 'create')
$sql.= " FROM ".MAIN_DB_PREFIX."propal"; $sql.= " FROM ".MAIN_DB_PREFIX."propal";
$sql.= " WHERE ref LIKE '".$numpr."%'"; $sql.= " WHERE ref LIKE '".$numpr."%'";
$sql.= " AND entity = ".$conf->entity; $sql.= " AND entity = ".$conf->entity;
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)
{ {
@ -293,9 +293,9 @@ if ($_GET["action"] == 'create')
print '<tr><td>'; print '<tr><td>';
// multiprix // multiprix
if($conf->global->PRODUIT_MULTIPRICES && $soc->price_level) 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 else
$html->select_produits('',"idprod".$i,'',$conf->produit->limit_size); $html->select_produits('',"idprod".$i,'',$conf->product->limit_size);
print '</td>'; print '</td>';
print '<td><input type="text" size="2" name="qty'.$i.'" value="1"></td>'; print '<td><input type="text" size="2" name="qty'.$i.'" value="1"></td>';
print '<td><input type="text" size="2" name="remise'.$i.'" value="'.$soc->remise_client.'">%</td>'; print '<td><input type="text" size="2" name="remise'.$i.'" value="'.$soc->remise_client.'">%</td>';

View File

@ -1780,11 +1780,11 @@ if ($id > 0 || ! empty($ref))
// multiprix // multiprix
if($conf->global->PRODUIT_MULTIPRICES) 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 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 '<br>'; if (! $conf->global->PRODUIT_USE_SEARCH_TO_SELECT) print '<br>';

View File

@ -1174,9 +1174,9 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer)
print '<tr><td>'; print '<tr><td>';
// multiprix // multiprix
if($conf->global->PRODUIT_MULTIPRICES) 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 else
print $html->select_produits('','idprod'.$i,'',$conf->produit->limit_size); print $html->select_produits('','idprod'.$i,'',$conf->product->limit_size);
print '</td>'; print '</td>';
print '<td><input type="text" size="3" name="qty'.$i.'" value="1"></td>'; print '<td><input type="text" size="3" name="qty'.$i.'" value="1"></td>';
print '<td><input type="text" size="3" name="remise_percent'.$i.'" value="'.$soc->remise_client.'">%</td></tr>'; print '<td><input type="text" size="3" name="remise_percent'.$i.'" value="'.$soc->remise_client.'">%</td></tr>';
@ -2019,11 +2019,11 @@ else
// multiprix // multiprix
if($conf->global->PRODUIT_MULTIPRICES) 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 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 '<br>'; if (! $conf->global->PRODUIT_USE_SEARCH_TO_SELECT) print '<br>';

View File

@ -1697,9 +1697,9 @@ if ($_GET['action'] == 'create')
print '<td>'; print '<td>';
// multiprix // multiprix
if($conf->global->PRODUIT_MULTIPRICES) 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 else
$html->select_produits('','idprod'.$i,'',$conf->produit->limit_size); $html->select_produits('','idprod'.$i,'',$conf->product->limit_size);
print '</td>'; print '</td>';
print '<td><input type="text" size="2" name="qty'.$i.'" value="1"></td>'; print '<td><input type="text" size="2" name="qty'.$i.'" value="1"></td>';
print '<td nowrap="nowrap"><input type="text" size="1" name="remise_percent'.$i.'" value="'.$soc->remise_client.'">%</td>'; print '<td nowrap="nowrap"><input type="text" size="1" name="remise_percent'.$i.'" value="'.$soc->remise_client.'">%</td>';
@ -3065,11 +3065,11 @@ else
// multiprix // multiprix
if($conf->global->PRODUIT_MULTIPRICES) 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 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 '<br>'; if (! $conf->global->PRODUIT_USE_SEARCH_TO_SELECT) print '<br>';

View File

@ -1214,9 +1214,9 @@ else
print '<td colspan="3">'; print '<td colspan="3">';
// multiprix // multiprix
if($conf->global->PRODUIT_MULTIPRICES) 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 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 '<br>'; if (! $conf->global->PRODUIT_USE_SEARCH_TO_SELECT) print '<br>';
print '<textarea name="desc" cols="70" rows="'.ROWS_2.'"></textarea>'; print '<textarea name="desc" cols="70" rows="'.ROWS_2.'"></textarea>';
print '</td>'; print '</td>';

View File

@ -341,9 +341,9 @@ class Conf
if (empty($this->global->MAIN_SIZE_LISTE_LIMIT)) $this->global->MAIN_SIZE_LISTE_LIMIT=25; 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->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; 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 // $this->theme et $this->css
if (empty($this->global->MAIN_THEME)) $this->global->MAIN_THEME="eldy"; 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->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->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; $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;
} }
} }

View File

@ -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"]) != "")) 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']); $result=dol_imageResizeOrCrop($fullpath,0,$_POST['sizex'],$_POST['sizey']);
if ($result == $fullpath) if ($result == $fullpath)
@ -63,7 +69,13 @@ if ($_POST["action"] == 'confirm_resize' && (isset($_POST["file"]) != "") && (is
// Crop d'une image // Crop d'une image
if ($_POST["action"] == 'confirm_crop') 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']); $result=dol_imageResizeOrCrop($fullpath,1,$_POST['w'],$_POST['h'],$_POST['x'],$_POST['y']);
if ($result == $fullpath) if ($result == $fullpath)
@ -91,7 +103,7 @@ print_fiche_titre($langs->trans("Image"));
if ($mesg) print '<div class="error">'.$mesg.'</div>'; if ($mesg) print '<div class="error">'.$mesg.'</div>';
$infoarray=dol_getImageSize($conf->produit->dir_output."/".urldecode($_GET["file"])); $infoarray=dol_getImageSize($conf->product->dir_output."/".urldecode($_GET["file"]));
$height=$infoarray['height']; $height=$infoarray['height'];
$width=$infoarray['width']; $width=$infoarray['width'];
print $langs->trans("CurrentInformationOnImage").':'; print $langs->trans("CurrentInformationOnImage").':';
@ -129,7 +141,7 @@ print $langs->trans("DefineNewAreaToPick").'...<br>';
print '<br>'; print '<br>';
print '<img style="border: 1px solid #888888;" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&file='.$original_file.'" alt="Taille origine" id="cropbox" />'; print '<img style="border: 1px solid #888888;" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&file='.$original_file.'" alt="Taille origine" id="cropbox" />';
print '<br>'; print '<br>';
$infoarray=dol_getImageSize($conf->produit->dir_output."/".urldecode($_GET["file"])); $infoarray=dol_getImageSize($conf->product->dir_output."/".urldecode($_GET["file"]));
$height=$infoarray['height']; $height=$infoarray['height'];
$width=$infoarray['width']; $width=$infoarray['width'];
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$_GET['id'].'" method="post" onsubmit="return checkCoords();"> print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$_GET['id'].'" method="post" onsubmit="return checkCoords();">

View File

@ -293,7 +293,7 @@ if ($modulepart)
{ {
$accessallowed=1; $accessallowed=1;
} }
if ($conf->product->enabled) $original_file=$conf->produit->dir_output.'/'.$original_file; if ($conf->product->enabled) $original_file=$conf->product->dir_output.'/'.$original_file;
elseif ($conf->service->enabled) $original_file=$conf->service->dir_output.'/'.$original_file; elseif ($conf->service->enabled) $original_file=$conf->service->dir_output.'/'.$original_file;
} }

View File

@ -105,7 +105,7 @@ if ($_GET["id"])
print '<tr><td width="20%">'.$langs->trans("InternalRef").'</td><td width="40%">'.$product->ref.'</td>'; print '<tr><td width="20%">'.$langs->trans("InternalRef").'</td><td width="40%">'.$product->ref.'</td>';
print '<td class="photo" valign="top" rowspan="6">'; print '<td class="photo" valign="top" rowspan="6">';
$product->show_photos($conf->produit->dir_output,1,1,0); $product->show_photos($conf->product->dir_output,1,1,0);
print '</td></tr>'; print '</td></tr>';
print "<tr>"; print "<tr>";

View File

@ -42,7 +42,7 @@ if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
$product = new Product($db); $product = new Product($db);
$result = $product->fetch($_GET["id"]); $result = $product->fetch($_GET["id"]);
$product->add_photo($conf->produit->dir_output, $_FILES['photofile']); $product->add_photo($conf->product->dir_output, $_FILES['photofile']);
} }
} }
/* /*
@ -140,7 +140,7 @@ if ($_GET["id"])
$nbbyrow=5; $nbbyrow=5;
$pdir = get_exdir($product->id,2) . $product->id ."/photos/"; $pdir = get_exdir($product->id,2) . $product->id ."/photos/";
$dir = $conf->produit->dir_output . '/'. $pdir; $dir = $conf->product->dir_output . '/'. $pdir;
print '<br><table width="100%" valign="top" align="center" border="0" cellpadding="2" cellspacing="2">'; print '<br><table width="100%" valign="top" align="center" border="0" cellpadding="2" cellspacing="2">';

View File

@ -58,7 +58,6 @@ function dol_getImageSize($file)
* \param src_x Position of croping image in source image (not use if mode=0) * \param src_x Position of croping image in source image (not use if mode=0)
* \param src_y Position of croping image in source image (not use if mode=0) * \param src_y Position of croping image in source image (not use if mode=0)
* \return int File name if OK, error message if KO * \return int File name if OK, error message if KO
* \remarks With file=myfile.jpg -> myfile_small.jpg
*/ */
function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x=0, $src_y=0) function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x=0, $src_y=0)
{ {
@ -244,7 +243,7 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x=0, $s
// Free memory // Free memory
imagedestroy($imgThumb); imagedestroy($imgThumb);
clearstatcache(); // File was replaced by a modified on, so we clear file caches. clearstatcache(); // File was replaced by a modified one, so we clear file caches.
return $imgThumbName; return $imgThumbName;
} }

View File

@ -577,7 +577,7 @@ if (! defined('NOLOGIN'))
} }
if (isset($user->conf->PRODUIT_LIMIT_SIZE)) // Can be 0 if (isset($user->conf->PRODUIT_LIMIT_SIZE)) // Can be 0
{ {
$conf->produit->limit_size = $user->conf->PRODUIT_LIMIT_SIZE; $conf->product->limit_size = $user->conf->PRODUIT_LIMIT_SIZE;
} }
// Replace conf->css by personalized value // Replace conf->css by personalized value
if (isset($user->conf->MAIN_THEME) && $user->conf->MAIN_THEME) if (isset($user->conf->MAIN_THEME) && $user->conf->MAIN_THEME)

View File

@ -33,7 +33,7 @@ class ProductDefault extends Product
var $errno = 0; var $errno = 0;
//! Template container //! Template container
var $tpl = array(); var $tpl = array();
/** /**
* \brief Constructeur de la classe * \brief Constructeur de la classe
* \param DB Handler acces base de donnees * \param DB Handler acces base de donnees
@ -53,14 +53,14 @@ class ProductDefault extends Product
$this->next_prev_filter = "canvas='default'"; $this->next_prev_filter = "canvas='default'";
} }
function getTitle() function getTitle()
{ {
global $langs; global $langs;
return $langs->trans("Products"); return $langs->trans("Products");
} }
/** /**
* \brief Lecture des donnees dans la base * \brief Lecture des donnees dans la base
* \param id Product id * \param id Product id
@ -71,7 +71,7 @@ class ProductDefault extends Product
return $result; return $result;
} }
/** /**
* \brief Assigne les valeurs pour les templates * \brief Assigne les valeurs pour les templates
* \param object object * \param object object
@ -81,53 +81,53 @@ class ProductDefault extends Product
global $conf,$langs; global $conf,$langs;
global $html; global $html;
global $formproduct; global $formproduct;
parent::assign_values($action); parent::assign_values($action);
// Stock alert // Stock alert
$this->tpl['seuil_stock_alerte'] = $this->seuil_stock_alerte; $this->tpl['seuil_stock_alerte'] = $this->seuil_stock_alerte;
if ($action == 'create') if ($action == 'create')
{ {
// Title // Title
$this->tpl['title'] = load_fiche_titre($langs->trans("NewProduct")); $this->tpl['title'] = load_fiche_titre($langs->trans("NewProduct"));
} }
if ($action == 'edit') if ($action == 'edit')
{ {
$this->tpl['title'] = load_fiche_titre($langs->trans('Modify').' '.$langs->trans('Product').' : '.$this->ref, ""); $this->tpl['title'] = load_fiche_titre($langs->trans('Modify').' '.$langs->trans('Product').' : '.$this->ref, "");
} }
if ($action == 'create' || $action == 'edit') if ($action == 'create' || $action == 'edit')
{ {
// Finished // Finished
$statutarray=array('1' => $langs->trans("Finished"), '0' => $langs->trans("RowMaterial")); $statutarray=array('1' => $langs->trans("Finished"), '0' => $langs->trans("RowMaterial"));
$this->tpl['finished'] = $html->selectarray('finished',$statutarray,$this->finished); $this->tpl['finished'] = $html->selectarray('finished',$statutarray,$this->finished);
// Weight // Weight
$this->tpl['weight'] = $this->weight; $this->tpl['weight'] = $this->weight;
$this->tpl['weight_units'] = $formproduct->load_measuring_units("weight_units","weight",$this->weight_units); $this->tpl['weight_units'] = $formproduct->load_measuring_units("weight_units","weight",$this->weight_units);
// Length // Length
$this->tpl['length'] = $this->length; $this->tpl['length'] = $this->length;
$this->tpl['length_units'] = $formproduct->load_measuring_units("length_units","size",$this->length_units); $this->tpl['length_units'] = $formproduct->load_measuring_units("length_units","size",$this->length_units);
// Surface // Surface
$this->tpl['surface'] = $this->surface; $this->tpl['surface'] = $this->surface;
$this->tpl['surface_units'] = $formproduct->load_measuring_units("surface_units","surface",$this->surface_units); $this->tpl['surface_units'] = $formproduct->load_measuring_units("surface_units","surface",$this->surface_units);
// Volume // Volume
$this->tpl['volume'] = $this->volume; $this->tpl['volume'] = $this->volume;
$this->tpl['volume_units'] = $formproduct->load_measuring_units("volume_units","volume",$this->volume_units); $this->tpl['volume_units'] = $formproduct->load_measuring_units("volume_units","volume",$this->volume_units);
} }
if ($action == 'view') if ($action == 'view')
{ {
// Photo // Photo
$this->tpl['nblignes'] = 4; $this->tpl['nblignes'] = 4;
if ($this->is_photo_available($conf->produit->dir_output)) if ($this->is_photo_available($conf->product->dir_output))
{ {
$this->tpl['photos'] = $this->show_photos($conf->produit->dir_output,1,1,0,0,0,80); $this->tpl['photos'] = $this->show_photos($conf->product->dir_output,1,1,0,0,0,80);
} }
// Nature // Nature
@ -158,20 +158,20 @@ class ProductDefault extends Product
} }
} }
} }
/** /**
* \brief Fetch datas list * \brief Fetch datas list
*/ */
function LoadListDatas($limit, $offset, $sortfield, $sortorder) function LoadListDatas($limit, $offset, $sortfield, $sortorder)
{ {
global $conf, $langs; global $conf, $langs;
$this->list_datas = array(); $this->list_datas = array();
//$_GET["sall"] = 'LL'; //$_GET["sall"] = 'LL';
// Clean parameters // Clean parameters
$sall=trim(isset($_GET["sall"])?$_GET["sall"]:$_POST["sall"]); $sall=trim(isset($_GET["sall"])?$_GET["sall"]:$_POST["sall"]);
foreach($this->field_list as $field) foreach($this->field_list as $field)
{ {
if ($field['enabled']) if ($field['enabled'])
@ -180,12 +180,12 @@ class ProductDefault extends Product
$$fieldname = trim(isset($_GET[$fieldname])?$_GET[$fieldname]:$_POST[$fieldname]); $$fieldname = trim(isset($_GET[$fieldname])?$_GET[$fieldname]:$_POST[$fieldname]);
} }
} }
$sql = 'SELECT DISTINCT '; $sql = 'SELECT DISTINCT ';
// Fields requiered // Fields requiered
$sql.= 'p.rowid, p.price_base_type, p.fk_product_type, p.seuil_stock_alerte'; $sql.= 'p.rowid, p.price_base_type, p.fk_product_type, p.seuil_stock_alerte';
// Fields not requiered // Fields not requiered
foreach($this->field_list as $field) foreach($this->field_list as $field)
{ {
@ -198,7 +198,7 @@ class ProductDefault extends Product
$sql.= ' FROM '.MAIN_DB_PREFIX.'product as p'; $sql.= ' FROM '.MAIN_DB_PREFIX.'product as p';
$sql.= " WHERE p.entity = ".$conf->entity; $sql.= " WHERE p.entity = ".$conf->entity;
if (!$user->rights->produit->hidden) $sql.=' AND p.hidden = 0'; if (!$user->rights->produit->hidden) $sql.=' AND p.hidden = 0';
if ($sall) if ($sall)
{ {
$clause = ''; $clause = '';
@ -213,7 +213,7 @@ class ProductDefault extends Product
} }
$sql.= ")"; $sql.= ")";
} }
// Search fields // Search fields
foreach($this->field_list as $field) foreach($this->field_list as $field)
{ {
@ -223,7 +223,7 @@ class ProductDefault extends Product
if (${$fieldname}) $sql.= " AND ".$field['name']." LIKE '%".addslashes(${$fieldname})."%'"; if (${$fieldname}) $sql.= " AND ".$field['name']." LIKE '%".addslashes(${$fieldname})."%'";
} }
} }
if (isset($_GET["envente"]) && strlen($_GET["envente"]) > 0) if (isset($_GET["envente"]) && strlen($_GET["envente"]) > 0)
{ {
$sql.= " AND p.envente = ".addslashes($_GET["envente"]); $sql.= " AND p.envente = ".addslashes($_GET["envente"]);
@ -244,17 +244,17 @@ class ProductDefault extends Product
while ($i < min($num,$limit)) while ($i < min($num,$limit))
{ {
$datas = array(); $datas = array();
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$datas["id"] = $obj->rowid; $datas["id"] = $obj->rowid;
foreach($this->field_list as $field) foreach($this->field_list as $field)
{ {
if ($field['enabled']) if ($field['enabled'])
{ {
$alias = $field['alias']; $alias = $field['alias'];
if ($alias == 'ref') if ($alias == 'ref')
{ {
$this->id = $obj->rowid; $this->id = $obj->rowid;
@ -287,7 +287,7 @@ class ProductDefault extends Product
print $sql; print $sql;
} }
} }
} }
?> ?>

View File

@ -68,7 +68,7 @@ class Product extends CommonObject
// Local taxes // Local taxes
var $localtax1_tx; var $localtax1_tx;
var $localtax2_tx; var $localtax2_tx;
//! Type 0 for regular product, 1 for service, 2 for assembly kit, 3 for stock kit //! Type 0 for regular product, 1 for service (Advanced feature: 2 for assembly kit, 3 for stock kit)
var $type; var $type;
var $typestring; var $typestring;

View File

@ -66,7 +66,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"]);
if ($conf->product->enabled) $upload_dir = $conf->produit->dir_output.'/'.dol_sanitizeFileName($product->ref); if ($conf->product->enabled) $upload_dir = $conf->product->dir_output.'/'.dol_sanitizeFileName($product->ref);
elseif ($conf->service->enabled) $upload_dir = $conf->service->dir_output.'/'.dol_sanitizeFileName($product->ref); elseif ($conf->service->enabled) $upload_dir = $conf->service->dir_output.'/'.dol_sanitizeFileName($product->ref);
} }
$modulepart='produit'; $modulepart='produit';

View File

@ -1047,11 +1047,11 @@ if ($_GET["id"] || $_GET["ref"])
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$product->libelle.'</td>'; print '<tr><td>'.$langs->trans("Label").'</td><td>'.$product->libelle.'</td>';
$nblignes=4; $nblignes=4;
if ($product->is_photo_available($conf->produit->dir_output)) if ($product->is_photo_available($conf->product->dir_output))
{ {
// Photo // Photo
print '<td valign="middle" align="center" width="30%" rowspan="'.$nblignes.'">'; print '<td valign="middle" align="center" width="30%" rowspan="'.$nblignes.'">';
print $product->show_photos($conf->produit->dir_output,1,1,0,0,0,80); print $product->show_photos($conf->product->dir_output,1,1,0,0,0,80);
print '</td>'; print '</td>';
} }

View File

@ -44,7 +44,7 @@ if ($user->societe_id) $socid=$user->societe_id;
$result=restrictedArea($user,'produit|service',$id,'product','','',$fieldid); $result=restrictedArea($user,'produit|service',$id,'product','','',$fieldid);
$mesg = ''; $mesg = '';
$dir = (!empty($conf->produit->dir_output)?$conf->produit->dir_output:$conf->service->dir_output); $dir = (!empty($conf->product->dir_output)?$conf->product->dir_output:$conf->service->dir_output);
/* /*
* Actions * Actions

View File

@ -137,11 +137,11 @@ print '</tr>';
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$product->libelle.'</td>'; print '<tr><td>'.$langs->trans("Label").'</td><td>'.$product->libelle.'</td>';
$nblignes=4; $nblignes=4;
if ($product->is_photo_available($conf->produit->dir_output)) if ($product->is_photo_available($conf->product->dir_output))
{ {
// Photo // Photo
print '<td valign="middle" align="center" width="30%" rowspan="'.$nblignes.'">'; print '<td valign="middle" align="center" width="30%" rowspan="'.$nblignes.'">';
print $product->show_photos($conf->produit->dir_output,1,1,0,0,0,80); print $product->show_photos($conf->product->dir_output,1,1,0,0,0,80);
print '</td>'; print '</td>';
} }

View File

@ -127,7 +127,7 @@ if ($_GET["id"] || $_GET["ref"])
// Generation des graphs // Generation des graphs
$WIDTH=380; $WIDTH=380;
$HEIGHT=160; $HEIGHT=160;
$dir = (!empty($conf->produit->dir_temp)?$conf->produit->dir_temp:$conf->service->dir_temp); $dir = (!empty($conf->product->dir_temp)?$conf->product->dir_temp:$conf->service->dir_temp);
if (! file_exists($dir.'/'.$product->id)) if (! file_exists($dir.'/'.$product->id))
{ {
if (create_exdir($dir.'/'.$product->id) < 0) if (create_exdir($dir.'/'.$product->id) < 0)

View File

@ -199,7 +199,7 @@ if ($modulepart)
{ {
$accessallowed=1; $accessallowed=1;
} }
$original_file=(!empty($conf->produit->dir_temp)?$conf->produit->dir_temp:$conf->service->dir_temp).'/'.$original_file; $original_file=(!empty($conf->product->dir_temp)?$conf->product->dir_temp:$conf->service->dir_temp).'/'.$original_file;
} }
// Wrapping for products or services // Wrapping for products or services
@ -209,7 +209,7 @@ if ($modulepart)
{ {
$accessallowed=1; $accessallowed=1;
} }
$original_file=(!empty($conf->produit->dir_output)?$conf->produit->dir_output:$conf->service->dir_output).'/'.$original_file; $original_file=(!empty($conf->product->dir_output)?$conf->product->dir_output:$conf->service->dir_output).'/'.$original_file;
} }
// Wrapping for categories // Wrapping for categories
@ -269,7 +269,7 @@ if ($modulepart)
elseif ($modulepart == 'graph_product') elseif ($modulepart == 'graph_product')
{ {
$accessallowed=1; $accessallowed=1;
$original_file=$conf->produit->dir_temp.'/'.$original_file; $original_file=$conf->product->dir_temp.'/'.$original_file;
} }
// Wrapping pour les code barre // Wrapping pour les code barre