New: Add picto on tab titles

This commit is contained in:
Laurent Destailleur 2009-08-06 13:21:23 +00:00
parent 63fa194ff6
commit 8761c985b7
16 changed files with 270 additions and 254 deletions

View File

@ -219,7 +219,8 @@ else if ($_GET["id"] || $_GET["ref"])
$head=product_prepare_head($product, $user); $head=product_prepare_head($product, $user);
$titre=$langs->trans("CardProduct".$product->type); $titre=$langs->trans("CardProduct".$product->type);
dol_fiche_head($head, 'category', $titre); $picto=($product->type==1?'service':'product');
dol_fiche_head($head, 'category', $titre,0,$picto);
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';

View File

@ -123,7 +123,8 @@ if ($product->id)
$head=product_prepare_head($product, $user); $head=product_prepare_head($product, $user);
$titre=$langs->trans("CardProduct".$product->type); $titre=$langs->trans("CardProduct".$product->type);
dol_fiche_head($head, 'documents', $titre); $picto=($product->type==1?'service':'product');
dol_fiche_head($head, 'documents', $titre, 0, $picto);
// Construit liste des fichiers // Construit liste des fichiers

View File

@ -812,7 +812,8 @@ if ($_GET["id"] || $_GET["ref"])
{ {
$head=product_prepare_head($product, $user); $head=product_prepare_head($product, $user);
$titre=$langs->trans("CardProduct".$product->type); $titre=$langs->trans("CardProduct".$product->type);
dol_fiche_head($head, 'card', $titre); $picto=($product->type==1?'service':'product');
dol_fiche_head($head, 'card', $titre, 0, $picto);
print "\n<!-- CUT HERE -->\n"; print "\n<!-- CUT HERE -->\n";
// Confirmation de la suppression de la facture // Confirmation de la suppression de la facture
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')

View File

@ -20,11 +20,11 @@
*/ */
/** /**
\file htdocs/product/fournisseurs.php * \file htdocs/product/fournisseurs.php
\ingroup product * \ingroup product
\brief Page de l'onglet fournisseur de produits * \brief Page de l'onglet fournisseur de 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");
@ -61,29 +61,29 @@ if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT &&
if ($_GET["action"] == 'remove_pf') if ($_GET["action"] == 'remove_pf')
{ {
$product = new ProductFournisseur($db); $product = new ProductFournisseur($db);
if ($product->fetch($_GET["id"]) > 0) if ($product->fetch($_GET["id"]) > 0)
{ {
if ($_GET["rowid"]) if ($_GET["rowid"])
{ {
$result=$product->remove_product_fournisseur_price($_GET["rowid"]); $result=$product->remove_product_fournisseur_price($_GET["rowid"]);
$_GET["action"] = ''; $_GET["action"] = '';
$mesg = '<div class="ok">'.$langs->trans("PriceRemoved").'.</div>'; $mesg = '<div class="ok">'.$langs->trans("PriceRemoved").'.</div>';
} }
else else
{ {
// Deprecated. Should not occurs // Deprecated. Should not occurs
if ($product->remove_fournisseur($_GET["socid"]) > 0) if ($product->remove_fournisseur($_GET["socid"]) > 0)
{ {
$_GET["action"] = ''; $_GET["action"] = '';
$mesg = '<div class="ok">'.$langs->trans("SupplierRemoved").'.</div>'; $mesg = '<div class="ok">'.$langs->trans("SupplierRemoved").'.</div>';
} }
else else
{ {
$_GET["action"] = ''; $_GET["action"] = '';
} }
} }
} }
} }
if ($_POST["action"] == 'updateprice' && $_POST["cancel"] <> $langs->trans("Cancel")) if ($_POST["action"] == 'updateprice' && $_POST["cancel"] <> $langs->trans("Cancel"))
@ -161,9 +161,9 @@ if ($_POST["action"] == 'updateprice' && $_POST["cancel"] <> $langs->trans("Canc
if ($_POST["cancel"] == $langs->trans("Cancel")) if ($_POST["cancel"] == $langs->trans("Cancel"))
{ {
$action = ''; $action = '';
Header("Location: fournisseurs.php?id=".$_GET["id"]); Header("Location: fournisseurs.php?id=".$_GET["id"]);
exit; exit;
} }
@ -190,12 +190,13 @@ if ($_GET["id"] || $_GET["ref"])
if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit') if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit')
{ {
/* /*
* En mode visu * En mode visu
*/ */
$head=product_prepare_head($product, $user); $head=product_prepare_head($product, $user);
$titre=$langs->trans("CardProduct".$product->type); $titre=$langs->trans("CardProduct".$product->type);
dol_fiche_head($head, 'suppliers', $titre); $picto=($product->type==1?'service':'product');
dol_fiche_head($head, 'suppliers', $titre, 0, $picto);
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';

View File

@ -20,10 +20,10 @@
*/ */
/** /**
\file htdocs/product/photos.php * \file htdocs/product/photos.php
\ingroup product * \ingroup product
\brief Onglet photos de la fiche produit * \brief Onglet photos de la fiche produit
\version $Id$ * \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
@ -75,7 +75,7 @@ if ($_GET["action"] == 'addthumb' && $_GET["file"])
/* /*
* * View
*/ */
$html = new Form($db); $html = new Form($db);
@ -96,7 +96,8 @@ if ($_GET["id"] || $_GET["ref"])
*/ */
$head=product_prepare_head($product, $user); $head=product_prepare_head($product, $user);
$titre=$langs->trans("CardProduct".$product->type); $titre=$langs->trans("CardProduct".$product->type);
dol_fiche_head($head, 'photos', $titre); $picto=($product->type==1?'service':'product');
dol_fiche_head($head, 'photos', $titre, 0, $picto);
/* /*
* Confirmation de la suppression de photo * Confirmation de la suppression de photo

View File

@ -120,7 +120,8 @@ llxHeader("","",$langs->trans("CardProduct".$product->type));
$head=product_prepare_head($product, $user); $head=product_prepare_head($product, $user);
$titre=$langs->trans("CardProduct".$product->type); $titre=$langs->trans("CardProduct".$product->type);
dol_fiche_head($head, 'price', $titre); $picto=($product->type==1?'service':'product');
dol_fiche_head($head, 'price', $titre, 0, $picto);
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';

View File

@ -146,7 +146,8 @@ if ($mesg) {
$head=product_prepare_head($product, $user); $head=product_prepare_head($product, $user);
$titre=$langs->trans("CardProduct".$product->type); $titre=$langs->trans("CardProduct".$product->type);
dol_fiche_head($head, 'subproduct', $titre); $picto=($product->type==1?'service':'product');
dol_fiche_head($head, 'subproduct', $titre, 0, $picto);
/* /*
* Fiche produit * Fiche produit

View File

@ -83,7 +83,8 @@ if ($_GET["id"] || $_GET["ref"])
*/ */
$head=product_prepare_head($product, $user); $head=product_prepare_head($product, $user);
$titre=$langs->trans("CardProduct".$product->type); $titre=$langs->trans("CardProduct".$product->type);
dol_fiche_head($head, 'referers', $titre); $picto=($product->type==1?'service':'product');
dol_fiche_head($head, 'referers', $titre, 0, $picto);
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';

View File

@ -19,11 +19,11 @@
*/ */
/** /**
\file htdocs/product/stats/commande_fournisseur.php \file htdocs/product/stats/commande_fournisseur.php
\ingroup product, service, commande \ingroup product, service, commande
\brief Page des stats des commandes fournisseurs pour un produit \brief Page des stats des commandes fournisseurs pour un produit
\version $Id$ \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
@ -65,38 +65,39 @@ $html = new Form($db);
if ($_GET["id"] || $_GET["ref"]) if ($_GET["id"] || $_GET["ref"])
{ {
$product = new Product($db); $product = new Product($db);
if ($_GET["ref"]) if ($_GET["ref"])
{ {
$result = $product->fetch('',$_GET["ref"]); $result = $product->fetch('',$_GET["ref"]);
$_GET["id"]=$product->id; $_GET["id"]=$product->id;
} }
if ($_GET["id"]) $result = $product->fetch($_GET["id"]); if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
llxHeader("","",$langs->trans("CardProduct".$product->type)); llxHeader("","",$langs->trans("CardProduct".$product->type));
if ($result > 0) if ($result > 0)
{ {
/* /*
* En mode visu * En mode visu
*/ */
$head=product_prepare_head($product, $user); $head=product_prepare_head($product, $user);
$titre=$langs->trans("CardProduct".$product->type); $titre=$langs->trans("CardProduct".$product->type);
dol_fiche_head($head, 'referers', $titre); $picto=($product->type==1?'service':'product');
dol_fiche_head($head, 'referers', $titre, 0, $picto);
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Reference // Reference
print '<tr>'; print '<tr>';
print '<td width="15%">'.$langs->trans("Ref").'</td><td colspan="3">'; print '<td width="15%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $html->showrefnav($product,'ref','',1,'ref'); print $html->showrefnav($product,'ref','',1,'ref');
print '</td></tr>'; print '</td></tr>';
// Libelle // Libelle
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$product->libelle.'</td></tr>'; print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$product->libelle.'</td></tr>';
// Prix // Prix
print '<tr><td>'.$langs->trans("SellingPrice").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("SellingPrice").'</td><td colspan="3">';
if ($product->price_base_type == 'TTC') if ($product->price_base_type == 'TTC')
{ {
print price($product->price_ttc).' '.$langs->trans($product->price_base_type); print price($product->price_ttc).' '.$langs->trans($product->price_base_type);
@ -107,88 +108,88 @@ if ($_GET["id"] || $_GET["ref"])
} }
print '</td></tr>'; print '</td></tr>';
// Statut // Statut
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">';
print $product->getLibStatut(2); print $product->getLibStatut(2);
print '</td></tr>'; print '</td></tr>';
show_stats_for_company($product,$socid); show_stats_for_company($product,$socid);
print "</table>"; print "</table>";
print '</div>'; print '</div>';
$sql = "SELECT distinct(s.nom), s.rowid as socid, s.code_client, c.rowid, c.total_ht as total_ht, c.ref,"; $sql = "SELECT distinct(s.nom), s.rowid as socid, s.code_client, c.rowid, c.total_ht as total_ht, c.ref,";
$sql.= " ".$db->pdate("c.date_creation")." as date, c.fk_statut as statut, c.rowid as commandeid"; $sql.= " ".$db->pdate("c.date_creation")." as date, c.fk_statut as statut, c.rowid as commandeid";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user "; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user ";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as c"; $sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as c";
$sql.= ", ".MAIN_DB_PREFIX."commande_fournisseurdet as d"; $sql.= ", ".MAIN_DB_PREFIX."commande_fournisseurdet as d";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE c.fk_soc = s.rowid"; $sql.= " WHERE c.fk_soc = s.rowid";
$sql.= " AND s.entity = ".$conf->entity; $sql.= " AND s.entity = ".$conf->entity;
$sql.= " AND d.fk_commande = c.rowid"; $sql.= " AND d.fk_commande = c.rowid";
$sql.= " AND d.fk_product =".$product->id; $sql.= " AND d.fk_product =".$product->id;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($socid) $sql.= " AND c.fk_soc = ".$socid; if ($socid) $sql.= " AND c.fk_soc = ".$socid;
$sql.= " ORDER BY $sortfield $sortorder "; $sql.= " ORDER BY $sortfield $sortorder ";
$sql.= $db->plimit($conf->liste_limit +1, $offset); $sql.= $db->plimit($conf->liste_limit +1, $offset);
$result = $db->query($sql); $result = $db->query($sql);
if ($result) if ($result)
{ {
$num = $db->num_rows($result); $num = $db->num_rows($result);
print_barre_liste($langs->trans("SuppliersOrders"),$page,$_SERVER["PHP_SELF"],"&amp;id=$product->id",$sortfield,$sortorder,'',$num,0,''); print_barre_liste($langs->trans("SuppliersOrders"),$page,$_SERVER["PHP_SELF"],"&amp;id=$product->id",$sortfield,$sortorder,'',$num,0,'');
$i = 0; $i = 0;
print "<table class=\"noborder\" width=\"100%\">"; print "<table class=\"noborder\" width=\"100%\">";
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"c.rowid","","&amp;id=".$_GET["id"],'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"c.rowid","","&amp;id=".$_GET["id"],'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","&amp;id=".$_GET["id"],'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","&amp;id=".$_GET["id"],'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("SupplierCode"),$_SERVER["PHP_SELF"],"s.code_client","","&amp;id=".$_GET["id"],'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("SupplierCode"),$_SERVER["PHP_SELF"],"s.code_client","","&amp;id=".$_GET["id"],'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"c.date_creation","","&amp;id=".$_GET["id"],'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"c.date_creation","","&amp;id=".$_GET["id"],'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"c.total_ht","","&amp;id=".$_GET["id"],'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"c.total_ht","","&amp;id=".$_GET["id"],'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"c.fk_statut","","&amp;id=".$_GET["id"],'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"c.fk_statut","","&amp;id=".$_GET["id"],'align="right"',$sortfield,$sortorder);
print "</tr>\n"; print "</tr>\n";
$commandestatic=new Commande($db); $commandestatic=new Commande($db);
if ($num > 0) if ($num > 0)
{ {
$var=True; $var=True;
while ($i < $num && $i < $conf->liste_limit) while ($i < $num && $i < $conf->liste_limit)
{ {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$var=!$var; $var=!$var;
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print '<td><a href="'.DOL_URL_ROOT.'/fourn/commande/fiche.php?id='.$objp->commandeid.'">'.img_object($langs->trans("ShowOrder"),"order").' '; print '<td><a href="'.DOL_URL_ROOT.'/fourn/commande/fiche.php?id='.$objp->commandeid.'">'.img_object($langs->trans("ShowOrder"),"order").' ';
print $objp->ref; print $objp->ref;
print "</a></td>\n"; print "</a></td>\n";
print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).'</a></td>'; print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).'</a></td>';
print "<td>".$objp->code_client."</td>\n"; print "<td>".$objp->code_client."</td>\n";
print "<td align=\"center\">"; print "<td align=\"center\">";
print dol_print_date($objp->date)."</td>"; print dol_print_date($objp->date)."</td>";
print "<td align=\"right\">".price($objp->total_ht)."</td>\n"; print "<td align=\"right\">".price($objp->total_ht)."</td>\n";
print '<td align="right">'.$commandestatic->LibStatut($objp->statut,$objp->facture,5).'</td>'; print '<td align="right">'.$commandestatic->LibStatut($objp->statut,$objp->facture,5).'</td>';
print "</tr>\n"; print "</tr>\n";
$i++; $i++;
} }
} }
} }
else else
{ {
dol_print_error($db); dol_print_error($db);
} }
print "</table>"; print "</table>";
print '<br>'; print '<br>';
$db->free($result); $db->free($result);
} }
} }
else else
{ {
dol_print_error(); dol_print_error();
} }
$db->close(); $db->close();

View File

@ -84,7 +84,8 @@ if ($_GET["id"] || $_GET["ref"])
*/ */
$head=product_prepare_head($product,$user); $head=product_prepare_head($product,$user);
$titre=$langs->trans("CardProduct".$product->type); $titre=$langs->trans("CardProduct".$product->type);
dol_fiche_head($head, 'referers', $titre); $picto=($product->type==1?'service':'product');
dol_fiche_head($head, 'referers', $titre, 0, $picto);
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';

View File

@ -19,11 +19,11 @@
*/ */
/** /**
\file htdocs/product/stats/facture.php \file htdocs/product/stats/facture.php
\ingroup product, service, facture \ingroup product, service, facture
\brief Page des stats des factures clients pour un produit \brief Page des stats des factures clients pour un produit
\version $Id$ \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
@ -69,39 +69,40 @@ $html = new Form($db);
if ($_GET["id"] || $_GET["ref"]) if ($_GET["id"] || $_GET["ref"])
{ {
$product = new Product($db); $product = new Product($db);
if ($_GET["ref"]) if ($_GET["ref"])
{ {
$result = $product->fetch('',$_GET["ref"]); $result = $product->fetch('',$_GET["ref"]);
$_GET["id"]=$product->id; $_GET["id"]=$product->id;
} }
if ($_GET["id"]) $result = $product->fetch($_GET["id"]); if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
llxHeader("","",$langs->trans("CardProduct".$product->type)); llxHeader("","",$langs->trans("CardProduct".$product->type));
/* /*
* En mode visu * En mode visu
*/ */
if ($result > 0) if ($result > 0)
{ {
$head=product_prepare_head($product, $user); $head=product_prepare_head($product, $user);
$titre=$langs->trans("CardProduct".$product->type); $titre=$langs->trans("CardProduct".$product->type);
dol_fiche_head($head, 'referers', $titre); $picto=($product->type==1?'service':'product');
dol_fiche_head($head, 'referers', $titre, 0, $picto);
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Reference // Reference
print '<tr>'; print '<tr>';
print '<td width="15%">'.$langs->trans("Ref").'</td><td colspan="3">'; print '<td width="15%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $html->showrefnav($product,'ref','',1,'ref'); print $html->showrefnav($product,'ref','',1,'ref');
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
// Libelle // Libelle
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$product->libelle.'</td>'; print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$product->libelle.'</td>';
print '</tr>'; print '</tr>';
// Price // Price
print '<tr><td>'.$langs->trans("SellingPrice").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("SellingPrice").'</td><td colspan="3">';
if ($product->price_base_type == 'TTC') if ($product->price_base_type == 'TTC')
{ {
print price($product->price_ttc).' '.$langs->trans($product->price_base_type); print price($product->price_ttc).' '.$langs->trans($product->price_base_type);
@ -112,90 +113,90 @@ if ($_GET["id"] || $_GET["ref"])
} }
print '</td></tr>'; print '</td></tr>';
// Statut // Statut
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">';
print $product->getLibStatut(2); print $product->getLibStatut(2);
print '</td></tr>'; print '</td></tr>';
show_stats_for_company($product,$socid); show_stats_for_company($product,$socid);
print "</table>"; print "</table>";
print '</div>'; print '</div>';
$sql = "SELECT distinct(s.nom), s.rowid as socid, s.code_client, f.facnumber, f.total as total_ht,"; $sql = "SELECT distinct(s.nom), s.rowid as socid, s.code_client, f.facnumber, f.total as total_ht,";
$sql.= " ".$db->pdate("f.datef")." as date, f.paye, f.fk_statut as statut, f.rowid as facid"; $sql.= " ".$db->pdate("f.datef")." as date, f.paye, f.fk_statut as statut, f.rowid as facid";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user "; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."facture as f"; $sql.= ", ".MAIN_DB_PREFIX."facture as f";
$sql.= ", ".MAIN_DB_PREFIX."facturedet as d"; $sql.= ", ".MAIN_DB_PREFIX."facturedet as d";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE f.fk_soc = s.rowid"; $sql.= " WHERE f.fk_soc = s.rowid";
$sql.= " AND s.entity = ".$conf->entity; $sql.= " AND s.entity = ".$conf->entity;
$sql.= " AND d.fk_facture = f.rowid"; $sql.= " AND d.fk_facture = f.rowid";
$sql.= " AND d.fk_product =".$product->id; $sql.= " AND d.fk_product =".$product->id;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($socid) $sql.= " AND f.fk_soc = $socid"; if ($socid) $sql.= " AND f.fk_soc = $socid";
$sql.= " ORDER BY $sortfield $sortorder "; $sql.= " ORDER BY $sortfield $sortorder ";
$sql.= $db->plimit($conf->liste_limit +1, $offset); $sql.= $db->plimit($conf->liste_limit +1, $offset);
$result = $db->query($sql); $result = $db->query($sql);
if ($result) if ($result)
{ {
$num = $db->num_rows($result); $num = $db->num_rows($result);
print_barre_liste($langs->trans("CustomersInvoices"),$page,$_SERVER["PHP_SELF"],"&amp;id=$product->id",$sortfield,$sortorder,'',$num,0,''); print_barre_liste($langs->trans("CustomersInvoices"),$page,$_SERVER["PHP_SELF"],"&amp;id=$product->id",$sortfield,$sortorder,'',$num,0,'');
$i = 0; $i = 0;
print "<table class=\"noborder\" width=\"100%\">"; print "<table class=\"noborder\" width=\"100%\">";
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"s.rowid","","&amp;id=".$_GET["id"],'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"s.rowid","","&amp;id=".$_GET["id"],'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","&amp;id=".$_GET["id"],'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","&amp;id=".$_GET["id"],'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","","&amp;id=".$_GET["id"],'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","","&amp;id=".$_GET["id"],'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"f.datef","","&amp;id=".$_GET["id"],'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"f.datef","","&amp;id=".$_GET["id"],'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"f.total_ht","","&amp;id=".$_GET["id"],'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"f.total_ht","","&amp;id=".$_GET["id"],'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"f.paye,f.fk_statut","","&amp;id=".$_GET["id"],'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"f.paye,f.fk_statut","","&amp;id=".$_GET["id"],'align="right"',$sortfield,$sortorder);
print "</tr>\n"; print "</tr>\n";
if ($num > 0) if ($num > 0)
{ {
$var=True; $var=True;
while ($i < $num && $i < $conf->liste_limit) while ($i < $num && $i < $conf->liste_limit)
{ {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$var=!$var; $var=!$var;
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print '<td>'; print '<td>';
$invoicestatic->id=$objp->facid; $invoicestatic->id=$objp->facid;
$invoicestatic->ref=$objp->facnumber; $invoicestatic->ref=$objp->facnumber;
print $invoicestatic->getNomUrl(1); print $invoicestatic->getNomUrl(1);
print "</td>\n"; print "</td>\n";
print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).'</a></td>'; print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).'</a></td>';
print "<td>".$objp->code_client."</td>\n"; print "<td>".$objp->code_client."</td>\n";
print "<td align=\"center\">"; print "<td align=\"center\">";
print dol_print_date($objp->date)."</td>"; print dol_print_date($objp->date)."</td>";
print "<td align=\"right\">".price($objp->total_ht)."</td>\n"; print "<td align=\"right\">".price($objp->total_ht)."</td>\n";
print '<td align="right">'.$invoicestatic->LibStatut($objp->paye,$objp->statut,5).'</td>'; print '<td align="right">'.$invoicestatic->LibStatut($objp->paye,$objp->statut,5).'</td>';
print "</tr>\n"; print "</tr>\n";
$i++; $i++;
} }
} }
} }
else else
{ {
dol_print_error($db); dol_print_error($db);
} }
print "</table>"; print "</table>";
print '<br>'; print '<br>';
$db->free($result); $db->free($result);
} }
} }
else else
{ {
dol_print_error(); dol_print_error();
} }
$db->close(); $db->close();

View File

@ -85,7 +85,8 @@ if ($_GET["id"] || $_GET["ref"])
*/ */
$head=product_prepare_head($product, $user); $head=product_prepare_head($product, $user);
$titre=$langs->trans("CardProduct".$product->type); $titre=$langs->trans("CardProduct".$product->type);
dol_fiche_head($head, 'referers', $titre); $picto=($product->type==1?'service':'product');
dol_fiche_head($head, 'referers', $titre, 0, $picto);
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';

View File

@ -67,7 +67,8 @@ if ($_GET["id"] || $_GET["ref"])
{ {
$head=product_prepare_head($product, $user); $head=product_prepare_head($product, $user);
$titre=$langs->trans("CardProduct".$product->type); $titre=$langs->trans("CardProduct".$product->type);
dol_fiche_head($head, 'stats', $titre); $picto=($product->type==1?'service':'product');
dol_fiche_head($head, 'stats', $titre, 0, $picto);
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';

View File

@ -81,7 +81,8 @@ if ($_GET["id"] || $_GET["ref"])
*/ */
$head=product_prepare_head($product, $user); $head=product_prepare_head($product, $user);
$titre=$langs->trans("CardProduct".$product->type); $titre=$langs->trans("CardProduct".$product->type);
dol_fiche_head($head, 'referers', $titre); $picto=($product->type==1?'service':'product');
dol_fiche_head($head, 'referers', $titre,0,$picto);
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';

View File

@ -125,7 +125,8 @@ if ($_GET["id"] || $_GET["ref"])
{ {
$head=product_prepare_head($product, $user); $head=product_prepare_head($product, $user);
$titre=$langs->trans("CardProduct".$product->type); $titre=$langs->trans("CardProduct".$product->type);
dol_fiche_head($head, 'stock', $titre); $picto=($product->type==1?'service':'product');
dol_fiche_head($head, 'stock', $titre, 0, $picto);
$html = new Form($db); $html = new Form($db);

View File

@ -22,10 +22,10 @@
*/ */
/** /**
\file htdocs/product/traduction.php * \file htdocs/product/traduction.php
\ingroup product * \ingroup product
\brief Page de traduction des produits * \brief Page de traduction des produits
\version $Revision$ * \version $Revision$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
@ -119,12 +119,11 @@ $_POST["cancel"] != $langs->trans("Cancel") &&
if ( $product->setMultiLangs() > 0 ) if ( $product->setMultiLangs() > 0 )
{ {
$_GET["action"] = ''; $_GET["action"] = '';
$mesg = 'Fiche mise <20> jour';
} }
else else
{ {
$_GET["action"] = 'edit'; $_GET["action"] = 'edit';
$mesg = 'Fiche non mise <20> jour !' . "<br>" . $product->mesg_error; $mesg = $product->mesg_error;
} }
} }
@ -134,7 +133,7 @@ if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
/* /*
* Affichage * View
*/ */
llxHeader("","",$langs->trans("Translation")); llxHeader("","",$langs->trans("Translation"));
@ -143,7 +142,8 @@ $html = new Form($db);
$head=product_prepare_head($product, $user); $head=product_prepare_head($product, $user);
$titre=$langs->trans("CardProduct".$product->type); $titre=$langs->trans("CardProduct".$product->type);
dol_fiche_head($head, 'translation', $titre); $picto=($product->type==1?'service':'product');
dol_fiche_head($head, 'translation', $titre, 0, $picto);
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
@ -253,6 +253,7 @@ if ($_GET["action"] == 'add' || ($user->rights->produit->creer || $user->rights-
$select.= "<option value='$value'>$value</option>"; $select.= "<option value='$value'>$value</option>";
$select.='</select>'; $select.='</select>';
print '<br>';
print '<form action="" method="post">'; print '<form action="" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="vadd">'; print '<input type="hidden" name="action" value="vadd">';
@ -264,7 +265,7 @@ if ($_GET["action"] == 'add' || ($user->rights->produit->creer || $user->rights-
print '<tr><td valign="top" width="15%">'.$langs->trans('Note').'</td><td><textarea name="note" rows="3" cols="80"></textarea></td></tr>'; print '<tr><td valign="top" width="15%">'.$langs->trans('Note').'</td><td><textarea name="note" rows="3" cols="80"></textarea></td></tr>';
print '</tr>'; print '</tr>';
print '</table>'; print '</table>';
print '<br /><table class="noborder" width="100%">'; print '<br /><table class="nobordernopadding" width="100%">';
print '<tr><td colspan="3" align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'">&nbsp;'; print '<tr><td colspan="3" align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'">&nbsp;';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></td></tr>'; print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></td></tr>';
print '</table>'; print '</table>';