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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -89,7 +89,7 @@ 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');
|
||||
|
||||
|
||||
@ -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');
|
||||
|
||||
|
||||
@ -82,7 +82,7 @@ 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);
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -91,7 +91,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);
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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