From 6fa0234409683beb49a2aa14668b90e45ccf5148 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 7 Apr 2015 03:00:11 +0200 Subject: [PATCH] Uniformize code --- htdocs/admin/askpricesupplier.php | 1 - htdocs/categories/categorie.php | 2 +- htdocs/compta/bank/class/account.class.php | 2 +- htdocs/compta/sociales/document.php | 4 +- htdocs/contact/card.php | 2 +- htdocs/contact/document.php | 2 +- htdocs/core/lib/contact.lib.php | 2 +- htdocs/core/lib/product.lib.php | 5 +- htdocs/core/lib/tax.lib.php | 2 +- htdocs/fichinter/document.php | 2 +- htdocs/loan/document.php | 4 +- htdocs/margin/tabs/productMargins.php | 2 +- .../product/actions_card_product.class.php | 2 +- .../service/actions_card_service.class.php | 2 +- htdocs/product/card.php | 2 +- htdocs/product/composition/card.php | 2 +- htdocs/product/document.php | 2 +- htdocs/product/fournisseurs.php | 12 ++--- htdocs/product/photos.php | 2 +- htdocs/product/price.php | 2 +- htdocs/product/stats/card.php | 2 +- htdocs/product/stats/commande.php | 2 +- htdocs/product/stats/commande_fournisseur.php | 2 +- htdocs/product/stats/contrat.php | 2 +- htdocs/product/stats/facture.php | 16 +++--- htdocs/product/stats/facture_fournisseur.php | 50 ++++++++--------- htdocs/product/stats/propal.php | 54 +++++++++---------- htdocs/product/stock/product.php | 2 +- htdocs/product/traduction.php | 4 +- htdocs/societe/admin/societe.php | 2 +- htdocs/societe/admin/societe_extrafields.php | 2 +- 31 files changed, 96 insertions(+), 98 deletions(-) diff --git a/htdocs/admin/askpricesupplier.php b/htdocs/admin/askpricesupplier.php index 6307e81042c..d2072a0c79c 100644 --- a/htdocs/admin/askpricesupplier.php +++ b/htdocs/admin/askpricesupplier.php @@ -319,7 +319,6 @@ foreach ($dirmodels as $reldir) // Info $htmltooltip=''; $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
'; - $askpricesupplier->type=0; $nextval=$module->getNextValue($mysoc,$askpricesupplier); if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip.=''.$langs->trans("NextValue").': '; diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php index 76af3708c8b..1cd605ea9ca 100644 --- a/htdocs/categories/categorie.php +++ b/htdocs/categories/categorie.php @@ -341,7 +341,7 @@ else if ($id || $ref) llxHeader("","",$langs->trans("CardProduct".$product->type)); - $head=product_prepare_head($product, $user); + $head=product_prepare_head($product); $titre=$langs->trans("CardProduct".$product->type); $picto=($product->type== Product::TYPE_SERVICE?'service':'product'); dol_fiche_head($head, 'category', $titre,0,$picto); diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 900a970d949..b6215165d35 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -781,8 +781,8 @@ class Account extends CommonObject $result=$this->deleteExtraFields(); if ($result < 0) { - return -1; dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR); + return -1; } } diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php index ad5af8f84c2..f87791dfed9 100644 --- a/htdocs/compta/sociales/document.php +++ b/htdocs/compta/sociales/document.php @@ -88,8 +88,8 @@ llxHeader("",$langs->trans("SocialContribution"),$help_url); if ($object->id) { $alreadypayed=$object->getSommePaiement(); - - $head=tax_prepare_head($object, $user); + + $head=tax_prepare_head($object); dol_fiche_head($head, 'documents', $langs->trans("SocialContribution"), 0, 'bill'); diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index f8ebe12cd9b..5936e596fb7 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -255,7 +255,7 @@ if (empty($reshook)) } else { - setEventMessage($object->error,$object->errors,'errors'); + setEventMessages($object->error,$object->errors,'errors'); } } diff --git a/htdocs/contact/document.php b/htdocs/contact/document.php index 970f3543c45..2241a1e67f1 100644 --- a/htdocs/contact/document.php +++ b/htdocs/contact/document.php @@ -79,7 +79,7 @@ llxHeader("",$langs->trans("Contact"), $helpurl); if ($object->id) { - $head = contact_prepare_head($object, $user); + $head = contact_prepare_head($object); dol_fiche_head($head, 'documents', $langs->trans("Contact"), 0, 'contact'); diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php index ba2d8ad5772..278402679f8 100644 --- a/htdocs/core/lib/contact.lib.php +++ b/htdocs/core/lib/contact.lib.php @@ -94,7 +94,7 @@ function contact_prepare_head(Contact $object) $head[$tab][2] = 'category'; $tab++; } - + // Info $head[$tab][0] = DOL_URL_ROOT.'/contact/info.php?id='.$object->id; $head[$tab][1] = $langs->trans("Info"); diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index a02747bb8aa..a35ab95a24a 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -28,12 +28,11 @@ * Prepare array with list of tabs * * @param Product $object Object related to tabs - * @param User $user Object user * @return array Array of tabs to show */ -function product_prepare_head($object, $user) +function product_prepare_head($object) { - global $langs, $conf; + global $langs, $conf, $user; $langs->load("products"); $h = 0; diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index bee6999d183..f6623362dcc 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -36,7 +36,7 @@ */ function tax_prepare_head(ChargeSociales $object) { - global $langs, $conf; + global $langs, $conf, $user; $h = 0; $head = array(); diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php index fd039efff24..bd6746c98e4 100644 --- a/htdocs/fichinter/document.php +++ b/htdocs/fichinter/document.php @@ -88,7 +88,7 @@ if ($object->id) { $object->fetch_thirdparty(); - $head=fichinter_prepare_head($object, $user); + $head=fichinter_prepare_head($object); dol_fiche_head($head, 'documents', $langs->trans("InterventionCard"), 0, 'intervention'); diff --git a/htdocs/loan/document.php b/htdocs/loan/document.php index 788048a215b..3831f73a7ea 100644 --- a/htdocs/loan/document.php +++ b/htdocs/loan/document.php @@ -81,8 +81,8 @@ llxHeader("",$langs->trans("Loan"),$help_url); if ($object->id) { $alreadypayed=$object->getSumPayment(); - - $head = loan_prepare_head($object, $user); + + $head = loan_prepare_head($object); dol_fiche_head($head, 'documents', $langs->trans("Loan"), 0, 'bill'); diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index 2123f683c21..eb3ac32c424 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -77,7 +77,7 @@ if ($id > 0 || ! empty($ref)) */ if ($result > 0) { - $head=product_prepare_head($object, $user); + $head=product_prepare_head($object); $titre=$langs->trans("CardProduct".$object->type); $picto=($object->type== Product::TYPE_SERVICE?'service':'product'); dol_fiche_head($head, 'margin', $titre, 0, $picto); diff --git a/htdocs/product/canvas/product/actions_card_product.class.php b/htdocs/product/canvas/product/actions_card_product.class.php index 84140ee3f6a..260c8996fc4 100644 --- a/htdocs/product/canvas/product/actions_card_product.class.php +++ b/htdocs/product/canvas/product/actions_card_product.class.php @@ -138,7 +138,7 @@ class ActionsCardProduct if ($action == 'view') { - $head = product_prepare_head($this->object,$user); + $head = product_prepare_head($this->object); $this->tpl['showrefnav'] = $form->showrefnav($this->object,'ref','',1,'ref'); diff --git a/htdocs/product/canvas/service/actions_card_service.class.php b/htdocs/product/canvas/service/actions_card_service.class.php index 5926beab083..f7de783cd99 100644 --- a/htdocs/product/canvas/service/actions_card_service.class.php +++ b/htdocs/product/canvas/service/actions_card_service.class.php @@ -137,7 +137,7 @@ class ActionsCardService if ($action == 'view') { - $head = product_prepare_head($this->object,$user); + $head = product_prepare_head($this->object); $this->tpl['showrefnav'] = $form->showrefnav($this->object,'ref','',1,'ref'); diff --git a/htdocs/product/card.php b/htdocs/product/card.php index eecec0705f7..1803c35629b 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1306,7 +1306,7 @@ else // Fiche en mode visu else { - $head=product_prepare_head($object, $user); + $head=product_prepare_head($object); $titre=$langs->trans("CardProduct".$object->type); $picto=($object->type== Product::TYPE_SERVICE?'service':'product'); dol_fiche_head($head, 'card', $titre, 0, $picto); diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 96f2a589429..fc3a41a8861 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -174,7 +174,7 @@ if ($action == 'search') llxHeader("","",$langs->trans("CardProduct".$object->type)); -$head=product_prepare_head($object, $user); +$head=product_prepare_head($object); $titre=$langs->trans("CardProduct".$object->type); $picto=($object->type==Product::TYPE_SERVICE?'service':'product'); dol_fiche_head($head, 'subproduct', $titre, 0, $picto); diff --git a/htdocs/product/document.php b/htdocs/product/document.php index 9a71eac4f55..810a131be60 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -100,7 +100,7 @@ llxHeader("","",$langs->trans("CardProduct".$object->type)); if ($object->id) { - $head=product_prepare_head($object, $user); + $head=product_prepare_head($object); $titre=$langs->trans("CardProduct".$object->type); $picto=($object->type== Product::TYPE_SERVICE?'service':'product'); dol_fiche_head($head, 'documents', $titre, 0, $picto); diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index c2196aba00b..f35e6628ad6 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -143,7 +143,7 @@ if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel")) $_POST["price"] = 0; } } - + $product = new ProductFournisseur($db); $result=$product->fetch($id); if ($result <= 0) @@ -191,7 +191,7 @@ if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel")) } else { - if ($price_expression !== '') + if ($price_expression !== '') { //Check the expression validity by parsing it $priceparser = new PriceParser($db); @@ -257,7 +257,7 @@ if ($id || $ref) * En mode visu */ - $head=product_prepare_head($product, $user); + $head=product_prepare_head($product); $titre=$langs->trans("CardProduct".$product->type); $picto=($product->type== Product::TYPE_SERVICE?'service':'product'); dol_fiche_head($head, 'suppliers', $titre, 0, $picto); @@ -323,7 +323,7 @@ if ($id || $ref) $supplier->fetch($socid); print $supplier->getNomUrl(1); print ''; - print ''; + print ''; print ''; } else @@ -380,7 +380,7 @@ if ($id || $ref) { print ''; } - print ''; + print ''; // Vat rate $default_vat=''; @@ -450,7 +450,7 @@ if ($id || $ref) print ''; print ''; - + // Delai livraison jours print ''; print ''.$langs->trans('NbDaysToDelivery').''; diff --git a/htdocs/product/photos.php b/htdocs/product/photos.php index 8a6e2ddbd6b..c6245cf203c 100644 --- a/htdocs/product/photos.php +++ b/htdocs/product/photos.php @@ -100,7 +100,7 @@ if ($object->id) /* * En mode visu */ - $head=product_prepare_head($object, $user); + $head=product_prepare_head($object); $titre=$langs->trans("CardProduct".$object->type); $picto=($object->type== Product::TYPE_SERVICE?'service':'product'); dol_fiche_head($head, 'photos', $titre, 0, $picto); diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 3e7ba24d3dd..2c9ab9a7794 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -353,7 +353,7 @@ if (! empty($id) || ! empty($ref)) llxHeader("", "", $langs->trans("CardProduct" . $object->type)); -$head = product_prepare_head($object, $user); +$head = product_prepare_head($object); $titre = $langs->trans("CardProduct" . $object->type); $picto = ($object->type == Product::TYPE_SERVICE ? 'service' : 'product'); dol_fiche_head($head, 'price', $titre, 0, $picto); diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index 788068ea5ec..ce161a1af60 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -67,7 +67,7 @@ if (! empty($id) || ! empty($ref)) if ($result) { - $head=product_prepare_head($object, $user); + $head=product_prepare_head($object); $titre=$langs->trans("CardProduct".$object->type); $picto=($object->type==Product::TYPE_SERVICE?'service':'product'); diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php index 81b251d795b..7dcf6139534 100644 --- a/htdocs/product/stats/commande.php +++ b/htdocs/product/stats/commande.php @@ -89,7 +89,7 @@ if ($id > 0 || ! empty($ref)) if ($result > 0) { - $head=product_prepare_head($product, $user); + $head=product_prepare_head($product); $titre=$langs->trans("CardProduct".$product->type); $picto=($product->type==Product::TYPE_SERVICE?'service':'product'); dol_fiche_head($head, 'referers', $titre, 0, $picto); diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index f0444356bcc..e6ced5ad905 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -96,7 +96,7 @@ if ($id > 0 || ! empty($ref)) { llxHeader("", "", $langs->trans("CardProduct" . $product->type)); if ($result > 0) { - $head = product_prepare_head($product, $user); + $head = product_prepare_head($product); $titre = $langs->trans("CardProduct" . $product->type); $picto = ($product->type == Product::TYPE_SERVICE ? 'service' : 'product'); dol_fiche_head($head, 'referers', $titre, 0, $picto); diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php index aa535f02575..d098ca3399b 100644 --- a/htdocs/product/stats/contrat.php +++ b/htdocs/product/stats/contrat.php @@ -79,7 +79,7 @@ if ($id > 0 || ! empty($ref)) if ($result > 0) { - $head=product_prepare_head($product,$user); + $head=product_prepare_head($product); $titre=$langs->trans("CardProduct".$product->type); $picto=($product->type==Product::TYPE_SERVICE?'service':'product'); dol_fiche_head($head, 'referers', $titre, 0, $picto); diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index c0fa1481269..1f4e9b985e5 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -90,7 +90,7 @@ if ($id > 0 || ! empty($ref)) if ($result > 0) { - $head=product_prepare_head($product, $user); + $head=product_prepare_head($product); $titre=$langs->trans("CardProduct".$product->type); $picto=($product->type==Product::TYPE_SERVICE?'service':'product'); dol_fiche_head($head, 'referers', $titre, 0, $picto); @@ -148,7 +148,7 @@ if ($id > 0 || ! empty($ref)) 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; $sql.= " ORDER BY $sortfield $sortorder "; - + //Calcul total qty and amount for global if full scan list $total_ht=0; $total_qty=0; @@ -163,21 +163,21 @@ if ($id > 0 || ! empty($ref)) } } } - + $sql.= $db->plimit($conf->liste_limit +1, $offset); $result = $db->query($sql); - if ($result) + if ($result) { $num = $db->num_rows($result); - + if (! empty($id)) $option .= '&id='.$product->id; if (! empty($search_month)) $option .= '&search_month='.$search_month; if (! empty($search_year)) $option .= '&search_year='.$search_year; - + print '
' . "\n"; if (! empty($sortfield)) print ''; @@ -187,7 +187,7 @@ if ($id > 0 || ! empty($ref)) print ''; $option .= '&page=' . $page; } - + print_barre_liste($langs->trans("CustomersInvoices"),$page,$_SERVER["PHP_SELF"],"&id=".$product->id,$sortfield,$sortorder,'',$num,$totalrecords,''); print '
'; print $langs->trans('Period').' ('.$langs->trans("DateInvoice") .') - '; @@ -235,7 +235,7 @@ if ($id > 0 || ! empty($ref)) print ''.$invoicestatic->LibStatut($objp->paye,$objp->statut,5).''; print "\n"; $i++; - + if (!empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $total_ht+=$objp->total_ht; $total_qty+=$objp->qty; diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php index 275a2ff8604..debb0698c44 100644 --- a/htdocs/product/stats/facture_fournisseur.php +++ b/htdocs/product/stats/facture_fournisseur.php @@ -82,52 +82,52 @@ if ($id > 0 || ! empty($ref)) { $product = new Product($db); $result = $product->fetch($id, $ref); - + $parameters = array('id' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $product, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - + llxHeader("", "", $langs->trans("CardProduct" . $product->type)); - + if ($result > 0) { - $head = product_prepare_head($product, $user); + $head = product_prepare_head($product); $titre = $langs->trans("CardProduct" . $product->type); $picto = ($product->type == Product::TYPE_SERVICE ? 'service' : 'product'); dol_fiche_head($head, 'referers', $titre, 0, $picto); - + $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $product, $action); // Note that $action and $object may have been modified by hook if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - + print ''; - + // Reference print ''; print ''; print ''; - + // Libelle print ''; print ''; - + // Status (to sell) print ''; - + // Status (to buy) print ''; - + show_stats_for_company($product, $socid); - + print "
' . $langs->trans("Ref") . ''; print $form->showrefnav($product, 'ref', '', 1, 'ref'); print '
' . $langs->trans("Label") . '' . $product->libelle . '
' . $langs->trans("Status") . ' (' . $langs->trans("Sell") . ')'; print $product->getLibStatut(2, 0); print '
' . $langs->trans("Status") . ' (' . $langs->trans("Buy") . ')'; print $product->getLibStatut(2, 1); print '
"; - + print '
'; - + if ($user->rights->fournisseur->facture->lire) { $sql = "SELECT distinct s.nom as name, s.rowid as socid, s.code_client, f.ref, d.total_ht as total_ht,"; @@ -142,14 +142,14 @@ if ($id > 0 || ! empty($ref)) $sql .= " AND f.entity = " . $conf->entity; $sql .= " AND d.fk_facture_fourn = f.rowid"; $sql .= " AND d.fk_product =" . $product->id; - if (! empty($search_month)) + if (! empty($search_month)) $sql .= ' AND MONTH(f.datef) IN (' . $search_month . ')'; - if (! empty($search_year)) + if (! empty($search_year)) $sql .= ' AND YEAR(f.datef) IN (' . $search_year . ')'; 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; $sql .= " ORDER BY $sortfield $sortorder "; - + // Calcul total qty and amount for global if full scan list $total_ht = 0; $total_qty = 0; @@ -164,21 +164,21 @@ if ($id > 0 || ! empty($ref)) } } } - + $sql .= $db->plimit($conf->liste_limit + 1, $offset); - + $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); - + if (! empty($id)) $option .= '&id=' . $product->id; if (! empty($search_month)) $option .= '&search_month=' . $search_month; if (! empty($search_year)) $option .= '&search_year=' . $search_year; - + print '' . "\n"; if (! empty($sortfield)) print ''; @@ -199,7 +199,7 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; print ''; - + $i = 0; print ''; print ''; @@ -211,7 +211,7 @@ if ($id > 0 || ! empty($ref)) print_liste_field_titre($langs->trans("AmountHT"), $_SERVER["PHP_SELF"], "f.total_ht", "", $option, 'align="right"', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Status"), $_SERVER["PHP_SELF"], "f.paye,f.fk_statut", "", $option, 'align="right"', $sortfield, $sortorder); print "\n"; - + if ($num > 0) { $var = True; @@ -219,7 +219,7 @@ if ($id > 0 || ! empty($ref)) { $objp = $db->fetch_object($result); $var = ! $var; - + print ''; print ''; print "\n"; $i ++; - + if (! empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $total_ht += $objp->total_ht; $total_qty += $objp->qty; diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index 4eae4c238e1..1776ba571e0 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -80,52 +80,52 @@ if ($id > 0 || ! empty($ref)) { $product = new Product($db); $result = $product->fetch($id, $ref); - + $parameters = array ('id' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $product, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - + llxHeader("", "", $langs->trans("CardProduct" . $product->type)); - + if ($result > 0) { - $head = product_prepare_head($product, $user); + $head = product_prepare_head($product); $titre = $langs->trans("CardProduct" . $product->type); $picto = ($product->type == Product::TYPE_SERVICE ? 'service' : 'product'); dol_fiche_head($head, 'referers', $titre, 0, $picto); - + $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $product, $action); // Note that $action and $object may have been modified by hook if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - + print '
'; $supplierinvoicestatic->id = $objp->facid; @@ -236,7 +236,7 @@ if ($id > 0 || ! empty($ref)) print '' . $supplierinvoicestatic->LibStatut($objp->paye, $objp->statut, 5) . '
'; - + // Reference print ''; print ''; print ''; - + // Libelle print ''; print ''; - + // Status (to sell) print ''; - + // Status (to buy) print ''; - + show_stats_for_company($product, $socid); - + print "
' . $langs->trans("Ref") . ''; print $form->showrefnav($product, 'ref', '', 1, 'ref'); print '
' . $langs->trans("Label") . '' . $product->libelle . '
' . $langs->trans("Status") . ' (' . $langs->trans("Sell") . ')'; print $product->getLibStatut(2, 0); print '
' . $langs->trans("Status") . ' (' . $langs->trans("Buy") . ')'; print $product->getLibStatut(2, 1); print '
"; - + print ''; - + if ($user->rights->propale->lire) { $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, p.rowid as propalid, p.ref, d.total_ht as amount,"; $sql .= " p.ref_client,"; @@ -150,7 +150,7 @@ if ($id > 0 || ! empty($ref)) if ($socid) $sql .= " AND p.fk_soc = " . $socid; $sql .= " ORDER BY $sortfield $sortorder "; - + // Calcul total qty and amount for global if full scan list $total_ht = 0; $total_qty = 0; @@ -165,21 +165,21 @@ if ($id > 0 || ! empty($ref)) } } } - + $sql .= $db->plimit($conf->liste_limit + 1, $offset); - + $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); - + if (! empty($id)) $option .= '&id=' . $product->id; if (! empty($search_month)) $option .= '&search_month=' . $search_month; if (! empty($search_year)) $option .= '&search_year=' . $search_year; - + print '' . "\n"; if (! empty($sortfield)) print ''; @@ -189,7 +189,7 @@ if ($id > 0 || ! empty($ref)) print ''; $option .= '&page=' . $page; } - + print_barre_liste($langs->trans("Proposals"), $page, $_SERVER["PHP_SELF"], "&id=$product->id", $sortfield, $sortorder, '', $num, $totalrecords, ''); print '
'; print $langs->trans('Period') . ' (' . $langs->trans("DatePropal") . ') - '; @@ -200,7 +200,7 @@ if ($id > 0 || ! empty($ref)) print ''; print '
'; print ''; - + $i = 0; print ''; print ''; @@ -211,7 +211,7 @@ if ($id > 0 || ! empty($ref)) print_liste_field_titre($langs->trans("AmountHT"), $_SERVER["PHP_SELF"], "p.total", "", $option, 'align="right"', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Status"), $_SERVER["PHP_SELF"], "p.fk_statut", "", $option, 'align="right"', $sortfield, $sortorder); print "\n"; - + if ($num > 0) { $var = True; @@ -219,7 +219,7 @@ if ($id > 0 || ! empty($ref)) { $objp = $db->fetch_object($result); $var = ! $var; - + print ''; print ''; print "\n"; $i ++; - + if (! empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $total_ht += $objp->total_ht; $total_qty += $objp->qty; } } - } + } print ''; print ''; print ''; @@ -251,12 +251,12 @@ if ($id > 0 || ! empty($ref)) print ''; print "
'; $propalstatic->id=$objp->propalid; @@ -236,13 +236,13 @@ if ($id > 0 || ! empty($ref)) print '' . $propalstatic->LibStatut($objp->statut, 5) . '
' . $langs->trans('Total') . '
"; print '
'; - print '
'; + print '
'; } else { dol_print_error($db); } $db->free($result); - } + } } } else { dol_print_error(); diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index d4a190a482a..c6942e8c8e2 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -384,7 +384,7 @@ if ($id > 0 || $ref) if ($result > 0) { - $head=product_prepare_head($product, $user); + $head=product_prepare_head($product); $titre=$langs->trans("CardProduct".$product->type); $picto=($product->type==Product::TYPE_SERVICE?'service':'product'); dol_fiche_head($head, 'stock', $titre, 0, $picto); diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php index 480f739285d..413cb589dff 100644 --- a/htdocs/product/traduction.php +++ b/htdocs/product/traduction.php @@ -143,7 +143,7 @@ $cancel != $langs->trans("Cancel") && $product->fetch($id); $langtodelete=GETPOST('langdel','alpha'); - + if ( $product->delMultiLangs($langtodelete) > 0 ) { $action = ''; @@ -168,7 +168,7 @@ llxHeader("","",$langs->trans("Translation")); $form = new Form($db); $formadmin=new FormAdmin($db); -$head=product_prepare_head($product, $user); +$head=product_prepare_head($product); $titre=$langs->trans("CardProduct".$product->type); $picto=($product->type==Product::TYPE_SERVICE?'service':'product'); dol_fiche_head($head, 'translation', $titre, 0, $picto); diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 881946cb1cd..3dd00e8d860 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -291,7 +291,7 @@ $linkback=''.$langs->trans("BackToM print_fiche_titre($langs->trans("CompanySetup"),$linkback,'setup'); -$head = societe_admin_prepare_head(null); +$head = societe_admin_prepare_head(); dol_fiche_head($head, 'general', $langs->trans("ThirdParties"), 0, 'company'); diff --git a/htdocs/societe/admin/societe_extrafields.php b/htdocs/societe/admin/societe_extrafields.php index 928cac01f7c..a680703e811 100644 --- a/htdocs/societe/admin/societe_extrafields.php +++ b/htdocs/societe/admin/societe_extrafields.php @@ -69,7 +69,7 @@ $linkback=''.$langs->trans("BackToM print_fiche_titre($langs->trans("CompanySetup"),$linkback,'setup'); -$head = societe_admin_prepare_head(null); +$head = societe_admin_prepare_head(); dol_fiche_head($head, 'attributes', $langs->trans("ThirdParties"), 0, 'company');