mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Uniformize code
This commit is contained in:
parent
ad50810c7a
commit
6fa0234409
|
|
@ -319,7 +319,6 @@ foreach ($dirmodels as $reldir)
|
|||
// Info
|
||||
$htmltooltip='';
|
||||
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
|
||||
$askpricesupplier->type=0;
|
||||
$nextval=$module->getNextValue($mysoc,$askpricesupplier);
|
||||
if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
|
||||
$htmltooltip.=''.$langs->trans("NextValue").': ';
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ if (empty($reshook))
|
|||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($object->error,$object->errors,'errors');
|
||||
setEventMessages($object->error,$object->errors,'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
*/
|
||||
function tax_prepare_head(ChargeSociales $object)
|
||||
{
|
||||
global $langs, $conf;
|
||||
global $langs, $conf, $user;
|
||||
|
||||
$h = 0;
|
||||
$head = array();
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 '<input type="hidden" name="id_fourn" value="'.$socid.'">';
|
||||
print '<input type="hidden" name="ref_fourn" value="'.$product->fourn_ref.'">';
|
||||
print '<input type="hidden" name="ref_fourn" value="'.$product->fourn_ref.'">';
|
||||
print '<input type="hidden" name="ref_fourn_price_id" value="'.$rowid.'">';
|
||||
}
|
||||
else
|
||||
|
|
@ -380,7 +380,7 @@ if ($id || $ref)
|
|||
{
|
||||
print '<input class="flat" name="qty" size="5" value="'.$quantity.'">';
|
||||
}
|
||||
print '</td></tr>';
|
||||
print '</td></tr>';
|
||||
|
||||
// Vat rate
|
||||
$default_vat='';
|
||||
|
|
@ -450,7 +450,7 @@ if ($id || $ref)
|
|||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
|
||||
// Delai livraison jours
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('NbDaysToDelivery').'</td>';
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 '<form method="post" action="' . $_SERVER ['PHP_SELF'] . '?id='.$product->id.'" name="search_form">' . "\n";
|
||||
if (! empty($sortfield))
|
||||
print '<input type="hidden" name="sortfield" value="' . $sortfield . '"/>';
|
||||
|
|
@ -187,7 +187,7 @@ if ($id > 0 || ! empty($ref))
|
|||
print '<input type="hidden" name="page" value="' . $page . '"/>';
|
||||
$option .= '&page=' . $page;
|
||||
}
|
||||
|
||||
|
||||
print_barre_liste($langs->trans("CustomersInvoices"),$page,$_SERVER["PHP_SELF"],"&id=".$product->id,$sortfield,$sortorder,'',$num,$totalrecords,'');
|
||||
print '<div class="liste_titre">';
|
||||
print $langs->trans('Period').' ('.$langs->trans("DateInvoice") .') - ';
|
||||
|
|
@ -235,7 +235,7 @@ if ($id > 0 || ! empty($ref))
|
|||
print '<td align="right">'.$invoicestatic->LibStatut($objp->paye,$objp->statut,5).'</td>';
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
|
||||
|
||||
if (!empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
$total_ht+=$objp->total_ht;
|
||||
$total_qty+=$objp->qty;
|
||||
|
|
|
|||
|
|
@ -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 '<table class="border" width="100%">';
|
||||
|
||||
|
||||
// Reference
|
||||
print '<tr>';
|
||||
print '<td width="30%">' . $langs->trans("Ref") . '</td><td colspan="3">';
|
||||
print $form->showrefnav($product, 'ref', '', 1, 'ref');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Libelle
|
||||
print '<tr><td>' . $langs->trans("Label") . '</td><td colspan="3">' . $product->libelle . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Status (to sell)
|
||||
print '<tr><td>' . $langs->trans("Status") . ' (' . $langs->trans("Sell") . ')</td><td colspan="3">';
|
||||
print $product->getLibStatut(2, 0);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
// Status (to buy)
|
||||
print '<tr><td>' . $langs->trans("Status") . ' (' . $langs->trans("Buy") . ')</td><td colspan="3">';
|
||||
print $product->getLibStatut(2, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
show_stats_for_company($product, $socid);
|
||||
|
||||
|
||||
print "</table>";
|
||||
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
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 '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?id=' . $product->id . '" name="search_form">' . "\n";
|
||||
if (! empty($sortfield))
|
||||
print '<input type="hidden" name="sortfield" value="' . $sortfield . '"/>';
|
||||
|
|
@ -199,7 +199,7 @@ if ($id > 0 || ! empty($ref))
|
|||
print '<input type="image" class="liste_titre" name="button_removefilter" src="' . img_picto($langs->trans("Search"), 'searchclear.png', '', '', 1) . '" value="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '" title="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '">';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
$i = 0;
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
|
|
@ -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 "</tr>\n";
|
||||
|
||||
|
||||
if ($num > 0)
|
||||
{
|
||||
$var = True;
|
||||
|
|
@ -219,7 +219,7 @@ if ($id > 0 || ! empty($ref))
|
|||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
$var = ! $var;
|
||||
|
||||
|
||||
print '<tr ' . $bc[$var] . '>';
|
||||
print '<td>';
|
||||
$supplierinvoicestatic->id = $objp->facid;
|
||||
|
|
@ -236,7 +236,7 @@ if ($id > 0 || ! empty($ref))
|
|||
print '<td align="right">' . $supplierinvoicestatic->LibStatut($objp->paye, $objp->statut, 5) . '</td>';
|
||||
print "</tr>\n";
|
||||
$i ++;
|
||||
|
||||
|
||||
if (! empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
$total_ht += $objp->total_ht;
|
||||
$total_qty += $objp->qty;
|
||||
|
|
|
|||
|
|
@ -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 '<table class="border" width="100%">';
|
||||
|
||||
|
||||
// Reference
|
||||
print '<tr>';
|
||||
print '<td width="30%">' . $langs->trans("Ref") . '</td><td colspan="3">';
|
||||
print $form->showrefnav($product, 'ref', '', 1, 'ref');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Libelle
|
||||
print '<tr><td>' . $langs->trans("Label") . '</td><td colspan="3">' . $product->libelle . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Status (to sell)
|
||||
print '<tr><td>' . $langs->trans("Status") . ' (' . $langs->trans("Sell") . ')</td><td colspan="3">';
|
||||
print $product->getLibStatut(2, 0);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
// Status (to buy)
|
||||
print '<tr><td>' . $langs->trans("Status") . ' (' . $langs->trans("Buy") . ')</td><td colspan="3">';
|
||||
print $product->getLibStatut(2, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
show_stats_for_company($product, $socid);
|
||||
|
||||
|
||||
print "</table>";
|
||||
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
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 '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?id=' . $product->id . '" name="search_form">' . "\n";
|
||||
if (! empty($sortfield))
|
||||
print '<input type="hidden" name="sortfield" value="' . $sortfield . '"/>';
|
||||
|
|
@ -189,7 +189,7 @@ if ($id > 0 || ! empty($ref))
|
|||
print '<input type="hidden" name="page" value="' . $page . '"/>';
|
||||
$option .= '&page=' . $page;
|
||||
}
|
||||
|
||||
|
||||
print_barre_liste($langs->trans("Proposals"), $page, $_SERVER["PHP_SELF"], "&id=$product->id", $sortfield, $sortorder, '', $num, $totalrecords, '');
|
||||
print '<div class="liste_titre">';
|
||||
print $langs->trans('Period') . ' (' . $langs->trans("DatePropal") . ') - ';
|
||||
|
|
@ -200,7 +200,7 @@ if ($id > 0 || ! empty($ref))
|
|||
print '<input type="image" class="liste_titre" name="button_removefilter" src="' . img_picto($langs->trans("Search"), 'searchclear.png', '', '', 1) . '" value="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '" title="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '">';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
$i = 0;
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
|
|
@ -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 "</tr>\n";
|
||||
|
||||
|
||||
if ($num > 0)
|
||||
{
|
||||
$var = True;
|
||||
|
|
@ -219,7 +219,7 @@ if ($id > 0 || ! empty($ref))
|
|||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
$var = ! $var;
|
||||
|
||||
|
||||
print '<tr ' . $bc[$var] . '>';
|
||||
print '<td>';
|
||||
$propalstatic->id=$objp->propalid;
|
||||
|
|
@ -236,13 +236,13 @@ if ($id > 0 || ! empty($ref))
|
|||
print '<td align="right">' . $propalstatic->LibStatut($objp->statut, 5) . '</td>';
|
||||
print "</tr>\n";
|
||||
$i ++;
|
||||
|
||||
|
||||
if (! empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
$total_ht += $objp->total_ht;
|
||||
$total_qty += $objp->qty;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
print '<tr class="liste_total">';
|
||||
print '<td>' . $langs->trans('Total') . '</td>';
|
||||
print '<td colspan="2"></td>';
|
||||
|
|
@ -251,12 +251,12 @@ if ($id > 0 || ! empty($ref))
|
|||
print '<td></td>';
|
||||
print "</table>";
|
||||
print '</form>';
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
$db->free($result);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
dol_print_error();
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -291,7 +291,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$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');
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$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');
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user