forked from Wavyzz/dolibarr
task #5005 overview: Ajout bouton "suivant" et "prcdent" dans un fiche produit
This commit is contained in:
@@ -219,21 +219,25 @@ function dolibarr_syslog($message, $level=LOG_ERR)
|
||||
|
||||
/**
|
||||
\brief Affiche le header d'une fiche
|
||||
\param links liens
|
||||
\param active 0 par d<>faut
|
||||
\param title titre ("" par defaut)
|
||||
\param links Tableau de titre d'onglets
|
||||
\param active 0=onglet non actif, 1=onglet actif
|
||||
\param title Titre tabelau ("" par defaut)
|
||||
*/
|
||||
function dolibarr_fiche_head($links, $active=0, $title='')
|
||||
{
|
||||
print '<div class="tabs">'."\n";
|
||||
|
||||
if (strlen($title))
|
||||
// Affichage titre
|
||||
if ($title)
|
||||
{
|
||||
$limittitle=30;
|
||||
if (strlen($title) > $limittitle) print '<a class="tabTitle">'.substr($title,0,$limittitle).'...</a>';
|
||||
else print '<a class="tabTitle">'.$title.'</a>';
|
||||
print '<a class="tabTitle">';
|
||||
if (strlen($title) > $limittitle) print substr($title,0,$limittitle).'...';
|
||||
else print $title;
|
||||
print '</a>';
|
||||
}
|
||||
|
||||
// Affichage onglets
|
||||
for ($i = 0 ; $i < sizeof($links) ; $i++)
|
||||
{
|
||||
if ($links[$i][2] == 'image')
|
||||
@@ -254,6 +258,7 @@ function dolibarr_fiche_head($links, $active=0, $title='')
|
||||
}
|
||||
|
||||
print "</div>\n";
|
||||
|
||||
print '<div class="tabBar">'."\n\n";
|
||||
}
|
||||
|
||||
|
||||
@@ -179,6 +179,31 @@ class DoliDb
|
||||
return $this->db;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Renvoie la version du serveur
|
||||
\return string Chaine version
|
||||
*/
|
||||
function getVersion()
|
||||
{
|
||||
$resql=$this->query('SELECT VERSION()');
|
||||
$row=$this->fetch_row($resql);
|
||||
return $row[0];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Renvoie l'id de la connection
|
||||
\return string Id connection
|
||||
*/
|
||||
function getConnectId()
|
||||
{
|
||||
$resql=$this->query('SELECT CONNECTION_ID()');
|
||||
$row=$this->fetch_row($resql);
|
||||
return $row[0];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Cr<43>ation d'une nouvelle base de donn<6E>e
|
||||
\param database nom de la database <20> cr<63>er
|
||||
|
||||
@@ -405,16 +405,28 @@ class Product
|
||||
|
||||
/**
|
||||
* \brief Charge le produit/service en m<>moire
|
||||
* \param id id du produit/service <20> charger
|
||||
* \param id Id du produit/service <20> charger
|
||||
* \param ref Ref du produit/service <20> charger
|
||||
* \return int <0 si ko, >0 si ok
|
||||
*/
|
||||
function fetch ($id)
|
||||
function fetch($id='',$ref='')
|
||||
{
|
||||
global $langs;
|
||||
|
||||
// Verification parametres
|
||||
if (! $id && ! $ref)
|
||||
{
|
||||
$this->error=$langs->trans('ErrorWrongParameters');
|
||||
return -1;
|
||||
}
|
||||
|
||||
$sql = "SELECT rowid, ref, label, description, note, price, tva_tx, envente,";
|
||||
$sql.= " nbvente, fk_product_type, duration, seuil_stock_alerte";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product WHERE rowid = $id";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product";
|
||||
if ($id) $sql.= " WHERE rowid = ".$id;
|
||||
if ($ref) $sql.= " WHERE ref = '".addslashes($ref)."'";
|
||||
|
||||
$result = $this->db->query($sql) ;
|
||||
|
||||
if ( $result )
|
||||
{
|
||||
$result = $this->db->fetch_array();
|
||||
@@ -451,7 +463,7 @@ class Product
|
||||
$this->db->free();
|
||||
|
||||
$sql = "SELECT reel, fk_entrepot";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."product_stock WHERE fk_product = ".$id;
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."product_stock WHERE fk_product = ".$this->id;
|
||||
$result = $this->db->query($sql) ;
|
||||
if ($result)
|
||||
{
|
||||
@@ -491,6 +503,43 @@ class Product
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Charge les propri<72>t<EFBFBD>s ref_previous et ref_next
|
||||
* \param filter filtre
|
||||
* \return int <0 si ko, >0 si ok
|
||||
*/
|
||||
function load_previous_next_ref($filtre='')
|
||||
{
|
||||
$sql = "SELECT MAX(ref)";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product";
|
||||
$sql.= " WHERE ref < '".addslashes($this->ref)."'";
|
||||
if ($filter) $sql.=" AND ".$filter;
|
||||
$result = $this->db->query($sql) ;
|
||||
if (! $result)
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
return -1;
|
||||
}
|
||||
$row = $this->db->fetch_row($result);
|
||||
$this->ref_previous = $row[0];
|
||||
|
||||
$sql = "SELECT MIN(ref)";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product";
|
||||
$sql.= " WHERE ref > '".addslashes($this->ref)."'";
|
||||
if ($filter) $sql.=" AND ".$filter;
|
||||
$result = $this->db->query($sql) ;
|
||||
if (! $result)
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
return -2;
|
||||
}
|
||||
$row = $this->db->fetch_row($result);
|
||||
$this->ref_next = $row[0];
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Charge tableau des stats propale pour le produit/service
|
||||
* \param socid Id societe
|
||||
|
||||
@@ -50,7 +50,8 @@ $types[1] = $langs->trans("Service");
|
||||
llxHeader("","",$langs->trans("BarCode"));
|
||||
|
||||
$product = new Product($db);
|
||||
$result = $product->fetch($_GET["id"]);
|
||||
if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
|
||||
if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
|
||||
|
||||
|
||||
$h=0;
|
||||
@@ -120,9 +121,20 @@ $h++;
|
||||
dolibarr_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref);
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Reference
|
||||
print '<tr>';
|
||||
print '<td width="10%">'.$langs->trans("Ref").'</td><td colspan="2" width="40%">'.$product->ref.'</td>';
|
||||
print '<td width="15%">'.$langs->trans("Ref").'</td><td colspan="2">';
|
||||
$product->load_previous_next_ref();
|
||||
$previous_ref = $product->ref_previous?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_previous.'">'.img_previous().'</a>':'';
|
||||
$next_ref = $product->ref_next?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_next.'">'.img_next().'</a>':'';
|
||||
if ($previous_ref || $next_ref) print '<table class="nobordernopadding" width="100%"><tr class="nobordernopadding"><td class="nobordernopadding">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$product->id.'">'.$product->ref.'</a>';
|
||||
if ($previous_ref || $next_ref) print '</td><td class="nobordernopadding" align="center" width="20">'.$previous_ref.'</td><td class="nobordernopadding" align="center" width="20">'.$next_ref.'</td></tr></table>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Libelle
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="2">'.$product->libelle.'</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@@ -38,20 +38,23 @@ $user->getrights('produit');
|
||||
if (!$user->rights->produit->lire)
|
||||
accessforbidden();
|
||||
|
||||
$productid=empty($_GET['id']) ? 0 : intVal($_GET['id']);
|
||||
$action=empty($_GET['action']) ? (empty($_POST['action']) ? '' : $_POST['action']) : $_GET['action'];
|
||||
if ($productid > 0)
|
||||
|
||||
$product = new Product($db);
|
||||
if ($_GET['id'] || $_GET["ref"])
|
||||
{
|
||||
$product = new Product($db);
|
||||
if ($product->fetch($productid))
|
||||
if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
|
||||
if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
|
||||
|
||||
$prodref = sanitize_string($product->ref);
|
||||
$upload_dir = $conf->produit->dir_output.'/'.$prodref;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Action envoie fichier
|
||||
*/
|
||||
if ( $_POST["sendit"] && $conf->upload)
|
||||
if ($_POST["sendit"] && $conf->upload)
|
||||
{
|
||||
/*
|
||||
* Creation r<>pertoire si n'existe pas
|
||||
@@ -79,7 +82,7 @@ if ( $_POST["sendit"] && $conf->upload)
|
||||
llxHeader();
|
||||
|
||||
|
||||
if ($productid > 0)
|
||||
if ($product->id)
|
||||
{
|
||||
if ( $error_msg )
|
||||
{
|
||||
@@ -157,7 +160,8 @@ if ($productid > 0)
|
||||
$hselected=$h;
|
||||
$h++;
|
||||
|
||||
dolibarr_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref);
|
||||
$titre=$langs->trans("CardProduct".$product->type);
|
||||
dolibarr_fiche_head($head, $hselected, $titre);
|
||||
|
||||
// Construit liste des fichiers
|
||||
clearstatcache();
|
||||
@@ -188,9 +192,23 @@ if ($productid > 0)
|
||||
// print '<div class="error">'.$langs->trans("ErrorCanNotReadDir",$upload_dir).'</div>';
|
||||
}
|
||||
|
||||
print '<table class="border"width="100%">';
|
||||
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td colspan="3">'.$product->ref.'</td></tr>';
|
||||
print '<tr><td width="30%">'.$langs->trans("Label").'</td><td colspan="3">'.$product->libelle.'</td></tr>';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Reference
|
||||
print '<tr>';
|
||||
print '<td width="28%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
||||
$product->load_previous_next_ref();
|
||||
$previous_ref = $product->ref_previous?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_previous.'">'.img_previous().'</a>':'';
|
||||
$next_ref = $product->ref_next?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_next.'">'.img_next().'</a>':'';
|
||||
if ($previous_ref || $next_ref) print '<table class="nobordernopadding" width="100%"><tr class="nobordernopadding"><td class="nobordernopadding">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$product->id.'">'.$product->ref.'</a>';
|
||||
if ($previous_ref || $next_ref) print '</td><td class="nobordernopadding" align="center" width="20">'.$previous_ref.'</td><td class="nobordernopadding" align="center" width="20">'.$next_ref.'</td></tr></table>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Libelle
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$product->libelle.'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.sizeof($filearray).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
|
||||
print '</table>';
|
||||
@@ -263,7 +281,6 @@ if ($productid > 0)
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -44,6 +44,7 @@ if (!$user->rights->produit->lire) accessforbidden();
|
||||
$types[0] = $langs->trans("Product");
|
||||
$types[1] = $langs->trans("Service");
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
@@ -53,6 +54,7 @@ if ($_GET["action"] == 'fastappro')
|
||||
$product->fetch($_GET["id"]);
|
||||
$result = $product->fastappro($user);
|
||||
Header("Location: fiche.php?id=".$_GET["id"]);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
@@ -80,6 +82,7 @@ if ($_POST["action"] == 'add' && $user->rights->produit->creer)
|
||||
if ($id > 0)
|
||||
{
|
||||
Header("Location: fiche.php?id=$id");
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -158,6 +161,8 @@ if ($_GET["action"] == 'clone' && $user->rights->produit->creer)
|
||||
$db->commit();
|
||||
|
||||
Header("Location: fiche.php?id=$id");
|
||||
$db->close();
|
||||
exit;
|
||||
}
|
||||
else if ($id == -3)
|
||||
{
|
||||
@@ -334,13 +339,14 @@ if ($_GET["action"] == 'create' && $user->rights->produit->creer)
|
||||
/*
|
||||
* Fiche produit
|
||||
*/
|
||||
if ($_GET["id"])
|
||||
if ($_GET["id"] || $_GET["ref"])
|
||||
{
|
||||
|
||||
if ($_GET["action"] <> 're-edit')
|
||||
{
|
||||
$product = new Product($db);
|
||||
$result = $product->fetch($_GET["id"]);
|
||||
if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
|
||||
if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
|
||||
}
|
||||
|
||||
if ( $result )
|
||||
@@ -416,7 +422,10 @@ if ($_GET["id"])
|
||||
$head[$h][1] = $langs->trans('Documents');
|
||||
$h++;
|
||||
|
||||
dolibarr_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref);
|
||||
|
||||
$titre=$langs->trans("CardProduct".$product->type);
|
||||
dolibarr_fiche_head($head, $hselected, $titre);
|
||||
|
||||
|
||||
print($mesg);
|
||||
|
||||
@@ -429,7 +438,14 @@ if ($_GET["id"])
|
||||
if ($product->type == 1) $nblignes++;
|
||||
|
||||
// Reference
|
||||
print '<td width="15%">'.$langs->trans("Ref").'</td><td>'.$product->ref.'</td>';
|
||||
print '<td width="15%">'.$langs->trans("Ref").'</td><td>';
|
||||
$product->load_previous_next_ref();
|
||||
$previous_ref = $product->ref_previous?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_previous.'">'.img_previous().'</a>':'';
|
||||
$next_ref = $product->ref_next?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_next.'">'.img_next().'</a>':'';
|
||||
if ($previous_ref || $next_ref) print '<table class="nobordernopadding" width="100%"><tr class="nobordernopadding"><td class="nobordernopadding">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$product->id.'">'.$product->ref.'</a>';
|
||||
if ($previous_ref || $next_ref) print '</td><td class="nobordernopadding" align="center" width="20">'.$previous_ref.'</td><td class="nobordernopadding" align="center" width="20">'.$next_ref.'</td></tr></table>';
|
||||
print '</td>';
|
||||
|
||||
if ($product->is_photo_available($conf->produit->dir_output))
|
||||
{
|
||||
@@ -441,7 +457,7 @@ if ($_GET["id"])
|
||||
|
||||
print '</tr>';
|
||||
|
||||
// Libell<EFBFBD>
|
||||
// Libelle
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$product->libelle.'</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@@ -137,13 +137,13 @@ llxHeader("","",$langs->trans("CardProduct".$product->type));
|
||||
/*
|
||||
* Fiche produit
|
||||
*/
|
||||
if ($_GET["id"])
|
||||
if ($_GET["id"] || $_GET["ref"])
|
||||
{
|
||||
|
||||
if ($_GET["action"] <> 're-edit')
|
||||
{
|
||||
$product = new Product($db);
|
||||
$result = $product->fetch($_GET["id"]);
|
||||
if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
|
||||
if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
|
||||
}
|
||||
|
||||
if ( $result )
|
||||
@@ -230,11 +230,27 @@ if ($_GET["id"])
|
||||
$head[$h][1] = $langs->trans('Documents');
|
||||
$h++;
|
||||
|
||||
dolibarr_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref);
|
||||
$titre=$langs->trans("CardProduct".$product->type);
|
||||
dolibarr_fiche_head($head, $hselected, $titre);
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td width="15%">'.$langs->trans("Ref").'</td><td colspan="2">'.$product->ref.'</td></tr>';
|
||||
|
||||
// Reference
|
||||
print '<tr>';
|
||||
print '<td width="15%">'.$langs->trans("Ref").'</td><td colspan="2">';
|
||||
$product->load_previous_next_ref();
|
||||
$previous_ref = $product->ref_previous?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_previous.'">'.img_previous().'</a>':'';
|
||||
$next_ref = $product->ref_next?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_next.'">'.img_next().'</a>':'';
|
||||
if ($previous_ref || $next_ref) print '<table class="nobordernopadding" width="100%"><tr class="nobordernopadding"><td class="nobordernopadding">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$product->id.'">'.$product->ref.'</a>';
|
||||
if ($previous_ref || $next_ref) print '</td><td class="nobordernopadding" align="center" width="20">'.$previous_ref.'</td><td class="nobordernopadding" align="center" width="20">'.$next_ref.'</td></tr></table>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Libelle
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="2">'.$product->libelle.'</td></tr>';
|
||||
|
||||
// Prix
|
||||
print '<tr><td>'.$langs->trans("SellingPrice").'</td><td colspan="2">'.price($product->price).'</td></tr>';
|
||||
|
||||
// Statut
|
||||
|
||||
@@ -52,7 +52,7 @@ $types[1] = $langs->trans("Service");
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($_POST["sendit"] && defined('MAIN_UPLOAD_DOC') && MAIN_UPLOAD_DOC == 1)
|
||||
if ($_POST["sendit"] && $conf->global->MAIN_UPLOAD_DOC)
|
||||
{
|
||||
if ($_GET["id"])
|
||||
{
|
||||
@@ -80,11 +80,12 @@ if ($_GET["action"] == 'delete' && $_GET["file"])
|
||||
llxHeader("","",$langs->trans("CardProduct0"));
|
||||
|
||||
|
||||
if ($_GET["id"])
|
||||
if ($_GET["id"] || $_GET["ref"])
|
||||
{
|
||||
|
||||
$product = new Product($db);
|
||||
$result = $product->fetch($_GET["id"]);
|
||||
if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
|
||||
if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
|
||||
|
||||
if ($result)
|
||||
{
|
||||
@@ -157,14 +158,26 @@ if ($_GET["id"])
|
||||
$head[$h][1] = $langs->trans('Documents');
|
||||
$h++;
|
||||
|
||||
dolibarr_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref);
|
||||
$titre=$langs->trans("CardProduct".$product->type);
|
||||
dolibarr_fiche_head($head, $hselected, $titre);
|
||||
|
||||
print($mesg);
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Reference
|
||||
print '<tr>';
|
||||
print '<td width="15%">'.$langs->trans("Ref").'</td><td colspan="2">'.$product->ref.'</td>';
|
||||
print '<td width="15%">'.$langs->trans("Ref").'</td><td colspan="2">';
|
||||
$product->load_previous_next_ref();
|
||||
$previous_ref = $product->ref_previous?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_previous.'">'.img_previous().'</a>':'';
|
||||
$next_ref = $product->ref_next?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_next.'">'.img_next().'</a>':'';
|
||||
if ($previous_ref || $next_ref) print '<table class="nobordernopadding" width="100%"><tr class="nobordernopadding"><td class="nobordernopadding">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$product->id.'">'.$product->ref.'</a>';
|
||||
if ($previous_ref || $next_ref) print '</td><td class="nobordernopadding" align="center" width="20">'.$previous_ref.'</td><td class="nobordernopadding" align="center" width="20">'.$next_ref.'</td></tr></table>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Libelle
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="2">'.$product->libelle.'</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@@ -80,7 +80,8 @@ if ($_POST["action"] == 'update_price' &&
|
||||
llxHeader("","",$langs->trans("Price"));
|
||||
|
||||
$product = new Product($db);
|
||||
$result = $product->fetch($_GET["id"]);
|
||||
if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
|
||||
if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
|
||||
|
||||
|
||||
$h=0;
|
||||
@@ -146,12 +147,24 @@ $head[$h][0] = DOL_URL_ROOT.'/product/document.php?id='.$product->id;
|
||||
$head[$h][1] = $langs->trans('Documents');
|
||||
$h++;
|
||||
|
||||
dolibarr_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref);
|
||||
$titre=$langs->trans("CardProduct".$product->type);
|
||||
dolibarr_fiche_head($head, $hselected, $titre);
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Reference
|
||||
print '<tr>';
|
||||
print '<td width="15%">'.$langs->trans("Ref").'</td><td colspan="2">'.$product->ref.'</td>';
|
||||
print '<td width="15%">'.$langs->trans("Ref").'</td><td colspan="2">';
|
||||
$product->load_previous_next_ref();
|
||||
$previous_ref = $product->ref_previous?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_previous.'">'.img_previous().'</a>':'';
|
||||
$next_ref = $product->ref_next?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_next.'">'.img_next().'</a>':'';
|
||||
if ($previous_ref || $next_ref) print '<table class="nobordernopadding" width="100%"><tr class="nobordernopadding"><td class="nobordernopadding">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$product->id.'">'.$product->ref.'</a>';
|
||||
if ($previous_ref || $next_ref) print '</td><td class="nobordernopadding" align="center" width="20">'.$previous_ref.'</td><td class="nobordernopadding" align="center" width="20">'.$next_ref.'</td></tr></table>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Libelle
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="2">'.$product->libelle.'</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@@ -47,16 +47,12 @@ $pagenext = $_GET["page"] + 1;
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="f.datef";
|
||||
|
||||
|
||||
// Securite
|
||||
$socid = 0;
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
$action = '';
|
||||
$socid = $user->societe_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
$socid = 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@@ -67,10 +63,11 @@ else
|
||||
llxHeader();
|
||||
|
||||
|
||||
if ($_GET["id"])
|
||||
if ($_GET["id"] || $_GET["ref"])
|
||||
{
|
||||
$product = new Product($db);
|
||||
$result = $product->fetch($_GET["id"]);
|
||||
if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
|
||||
if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
@@ -101,7 +98,6 @@ if ($_GET["id"])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/photos.php?id=".$product->id;
|
||||
$head[$h][1] = $langs->trans("Photos");
|
||||
$h++;
|
||||
@@ -143,14 +139,24 @@ if ($_GET["id"])
|
||||
$head[$h][1] = $langs->trans('Documents');
|
||||
$h++;
|
||||
|
||||
dolibarr_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref);
|
||||
|
||||
$titre=$langs->trans("CardProduct".$product->type);
|
||||
dolibarr_fiche_head($head, $hselected, $titre);
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Reference
|
||||
print '<tr>';
|
||||
print '<td width="15%">'.$langs->trans("Ref").'</td><td colspan="3">'.$product->ref.'</td>';
|
||||
print '<td width="28%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
||||
$product->load_previous_next_ref();
|
||||
$previous_ref = $product->ref_previous?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_previous.'">'.img_previous().'</a>':'';
|
||||
$next_ref = $product->ref_next?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_next.'">'.img_next().'</a>':'';
|
||||
if ($previous_ref || $next_ref) print '<table class="nobordernopadding" width="100%"><tr class="nobordernopadding"><td class="nobordernopadding">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$product->id.'">'.$product->ref.'</a>';
|
||||
if ($previous_ref || $next_ref) print '</td><td class="nobordernopadding" align="center" width="20">'.$previous_ref.'</td><td class="nobordernopadding" align="center" width="20">'.$next_ref.'</td></tr></table>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Libelle
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$product->libelle.'</td>';
|
||||
print '</tr>';
|
||||
|
||||
@@ -163,10 +169,10 @@ if ($_GET["id"])
|
||||
else print $langs->trans("NotOnSell");
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td valign="top" width="25%">'.$langs->trans("Referers").'</td>';
|
||||
print '<td align="right" width="25%">'.$langs->trans("NbOfCustomers").'</td>';
|
||||
print '<td align="right" width="25%">'.$langs->trans("NbOfReferers").'</td>';
|
||||
print '<td align="right" width="25%">'.$langs->trans("TotalQuantity").'</td>';
|
||||
print '<tr><td valign="top" width="28%">'.$langs->trans("Referers").'</td>';
|
||||
print '<td align="right" width="24%">'.$langs->trans("NbOfCustomers").'</td>';
|
||||
print '<td align="right" width="24%">'.$langs->trans("NbOfReferers").'</td>';
|
||||
print '<td align="right" width="24%">'.$langs->trans("TotalQuantity").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Propals
|
||||
|
||||
@@ -58,11 +58,11 @@ $mesg = '';
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
||||
if ($_GET["id"])
|
||||
if ($_GET["id"] || $_GET["ref"])
|
||||
{
|
||||
$product = new Product($db);
|
||||
$result = $product->fetch($_GET["id"]);
|
||||
if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
|
||||
if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
|
||||
|
||||
if ($result)
|
||||
{
|
||||
@@ -187,13 +187,24 @@ if ($_GET["id"])
|
||||
$head[$h][1] = $langs->trans('Documents');
|
||||
$h++;
|
||||
|
||||
dolibarr_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref);
|
||||
|
||||
$titre=$langs->trans("CardProduct".$product->type);
|
||||
dolibarr_fiche_head($head, $hselected, $titre);
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Reference
|
||||
print '<tr>';
|
||||
print '<td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">'.$product->ref.'</td>';
|
||||
print '<td width="28%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
||||
$product->load_previous_next_ref();
|
||||
$previous_ref = $product->ref_previous?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_previous.'">'.img_previous().'</a>':'';
|
||||
$next_ref = $product->ref_next?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_next.'">'.img_next().'</a>':'';
|
||||
if ($previous_ref || $next_ref) print '<table class="nobordernopadding" width="100%"><tr class="nobordernopadding"><td class="nobordernopadding">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$product->id.'">'.$product->ref.'</a>';
|
||||
if ($previous_ref || $next_ref) print '</td><td class="nobordernopadding" align="center" width="20">'.$previous_ref.'</td><td class="nobordernopadding" align="center" width="20">'.$next_ref.'</td></tr></table>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Libelle
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$product->libelle.'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("SellingPrice").'</td><td colspan="3">'.price($product->price).'</td>';
|
||||
@@ -204,10 +215,10 @@ if ($_GET["id"])
|
||||
else print $langs->trans("NotOnSell");
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td valign="top" width="25%">'.$langs->trans("Referers").'</td>';
|
||||
print '<td align="right" width="25%">'.$langs->trans("NbOfCustomers").'</td>';
|
||||
print '<td align="right" width="25%">'.$langs->trans("NbOfReferers").'</td>';
|
||||
print '<td align="right" width="25%">'.$langs->trans("TotalQuantity").'</td>';
|
||||
print '<tr><td valign="top" width="28%">'.$langs->trans("Referers").'</td>';
|
||||
print '<td align="right" width="24%">'.$langs->trans("NbOfCustomers").'</td>';
|
||||
print '<td align="right" width="24%">'.$langs->trans("NbOfReferers").'</td>';
|
||||
print '<td align="right" width="24%">'.$langs->trans("TotalQuantity").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Propals
|
||||
|
||||
@@ -98,12 +98,13 @@ if ($_POST["action"] == "transfert_stock" && $_POST["cancel"] <> $langs->trans("
|
||||
* Fiche stock
|
||||
*
|
||||
*/
|
||||
if ($_GET["id"])
|
||||
if ($_GET["id"] || $_GET["ref"])
|
||||
{
|
||||
|
||||
$product = new Product($db);
|
||||
if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
|
||||
if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
|
||||
|
||||
if ( $product->fetch($_GET["id"]))
|
||||
if ($result > 0)
|
||||
{
|
||||
$h=0;
|
||||
|
||||
@@ -175,7 +176,14 @@ if ($_GET["id"])
|
||||
|
||||
// Reference
|
||||
print '<tr>';
|
||||
print '<td width="15%">'.$langs->trans("Ref").'</td><td>'.$product->ref.'</td>';
|
||||
print '<td width="15%">'.$langs->trans("Ref").'</td><td>';
|
||||
$product->load_previous_next_ref();
|
||||
$previous_ref = $product->ref_previous?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_previous.'">'.img_previous().'</a>':'';
|
||||
$next_ref = $product->ref_next?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_next.'">'.img_next().'</a>':'';
|
||||
if ($previous_ref || $next_ref) print '<table class="nobordernopadding" width="100%"><tr class="nobordernopadding"><td class="nobordernopadding">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$product->id.'">'.$product->ref.'</a>';
|
||||
if ($previous_ref || $next_ref) print '</td><td class="nobordernopadding" align="center" width="20">'.$previous_ref.'</td><td class="nobordernopadding" align="center" width="20">'.$next_ref.'</td></tr></table>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Libell<6C>
|
||||
@@ -194,7 +202,7 @@ if ($_GET["id"])
|
||||
|
||||
// TVA
|
||||
$langs->load("bills");
|
||||
print '<tr><td>'.$langs->trans("VATRate").'</td><td>'.$product->tva_tx.' %</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("VATRate").'</td><td>'.$product->tva_tx.'%</td></tr>';
|
||||
|
||||
// Stock
|
||||
if ($product->type == 0 && $conf->stock->enabled)
|
||||
@@ -222,7 +230,6 @@ if ($_GET["id"])
|
||||
|
||||
/*
|
||||
* Contenu des stocks
|
||||
*
|
||||
*/
|
||||
print '<br><table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td width="40%">'.$langs->trans("Warehouse").'</td><td width="60%">Valeur du stock</td></tr>';
|
||||
@@ -250,7 +257,6 @@ if ($_GET["id"])
|
||||
|
||||
/*
|
||||
* Correction du stock
|
||||
*
|
||||
*/
|
||||
if ($_GET["action"] == "correction")
|
||||
{
|
||||
@@ -288,9 +294,9 @@ if ($_GET["id"])
|
||||
print '</form>';
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Transfert de pi<70>ces
|
||||
*
|
||||
*/
|
||||
if ($_GET["action"] == "transfert")
|
||||
{
|
||||
@@ -344,13 +350,13 @@ if ($_GET["id"])
|
||||
print '</form>';
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
if ($_GET["action"] == "definir")
|
||||
{
|
||||
print_titre ("Cr<EFBFBD>er un stock");
|
||||
print_titre($langs->trans("SetStock"));
|
||||
print "<form action=\"product.php?id=$product->id\" method=\"post\">\n";
|
||||
print '<input type="hidden" name="action" value="create_stock">';
|
||||
print '<table class="border" width="100%"><tr>';
|
||||
|
||||
@@ -401,10 +401,9 @@ a.tabTitle {
|
||||
color: white;
|
||||
font-weight: normal;
|
||||
padding: 0px 6px;
|
||||
margin: 0em 0.5em;
|
||||
margin: 0px 6px;
|
||||
text-decoration: none;
|
||||
white-space: nowrap;
|
||||
|
||||
border-right: 1px solid #555555;
|
||||
border-left: 1px solid #D8D8D8;
|
||||
border-top: 1px solid #D8D8D8;
|
||||
|
||||
BIN
htdocs/theme/eldy/img/boule.png
Normal file
BIN
htdocs/theme/eldy/img/boule.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 810 B After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 784 B After Width: | Height: | Size: 1.2 KiB |
Reference in New Issue
Block a user