Browse Source

Clean code

Laurent Destailleur 2 years ago
parent
commit
388dd6395b

+ 2 - 0
htdocs/bom/lib/bom.lib.php

@@ -134,6 +134,8 @@ function bomPrepareHead($object)
 	//); // to remove a tab
 	complete_head_from_modules($conf, $langs, $object, $head, $h, 'bom');
 
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'bom', 'remove');
+
 	return $head;
 }
 

+ 3 - 1
htdocs/core/lib/contact.lib.php

@@ -103,7 +103,7 @@ function contact_prepare_head(Contact $object)
 	// Entries must be declared in modules descriptor with line
 	// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
 	// $this->tabs = array('entity:-tabname);   												to remove a tab
-	complete_head_from_modules($conf, $langs, $object, $head, $tab, 'contact');
+	complete_head_from_modules($conf, $langs, $object, $head, $tab, 'contact', 'add', 'core');
 
 	// Notes
 	if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
@@ -147,6 +147,8 @@ function contact_prepare_head(Contact $object)
 	$head[$tab][2] = 'info';
 	$tab++;*/
 
+	complete_head_from_modules($conf, $langs, $object, $head, $tab, 'contact', 'add', 'external');
+
 	complete_head_from_modules($conf, $langs, $object, $head, $tab, 'contact', 'remove');
 
 	return $head;

+ 6 - 2
htdocs/core/lib/contract.lib.php

@@ -55,7 +55,7 @@ function contract_prepare_head(Contrat $object)
 	// Entries must be declared in modules descriptor with line
 	// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
 	// $this->tabs = array('entity:-tabname);   												to remove a tab
-	complete_head_from_modules($conf, $langs, $object, $head, $h, 'contract');
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'contract', 'add', 'core');
 
 	if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
 		$nbNote = 0;
@@ -96,6 +96,8 @@ function contract_prepare_head(Contrat $object)
 	$head[$h][2] = 'agenda';
 	$h++;
 
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'contract', 'add', 'external');
+
 	complete_head_from_modules($conf, $langs, $object, $head, $h, 'contract', 'remove');
 
 	return $head;
@@ -126,7 +128,7 @@ function contract_admin_prepare_head()
 	// Entries must be declared in modules descriptor with line
 	// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
 	// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to remove a tab
-	complete_head_from_modules($conf, $langs, null, $head, $h, 'contract_admin');
+	complete_head_from_modules($conf, $langs, null, $head, $h, 'contract_admin', 'add', 'core');
 
 	$head[$h][0] = DOL_URL_ROOT.'/contrat/admin/contract_extrafields.php';
 	$head[$h][1] = $langs->trans("ExtraFields");
@@ -146,6 +148,8 @@ function contract_admin_prepare_head()
 	$head[$h][2] = 'attributeslines';
 	$h++;
 
+	complete_head_from_modules($conf, $langs, null, $head, $h, 'contract_admin', 'add', 'external');
+
 	complete_head_from_modules($conf, $langs, null, $head, $h, 'contract_admin', 'remove');
 
 	return $head;

+ 3 - 1
htdocs/core/lib/donation.lib.php

@@ -83,7 +83,7 @@ function donation_prepare_head($object)
 	// Entries must be declared in modules descriptor with line
 	// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
 	// $this->tabs = array('entity:-tabname); to remove a tab
-	complete_head_from_modules($conf, $langs, $object, $head, $h, 'donation');
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'donation', 'add', 'core');
 
 	require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
 	require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
@@ -118,6 +118,8 @@ function donation_prepare_head($object)
 	$head[$h][2] = 'info';
 	$h++;
 
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'donation', 'add', 'external');
+
 	complete_head_from_modules($conf, $langs, $object, $head, $h, 'donation', 'remove');
 
 	return $head;

+ 3 - 1
htdocs/core/lib/expensereport.lib.php

@@ -43,7 +43,7 @@ function expensereport_prepare_head($object)
 	// Entries must be declared in modules descriptor with line
 	// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
 	// $this->tabs = array('entity:-tabname);   												to remove a tab
-	complete_head_from_modules($conf, $langs, $object, $head, $h, 'expensereport');
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'expensereport', 'add', 'core');
 
 	require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
 	require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
@@ -80,6 +80,8 @@ function expensereport_prepare_head($object)
 	$head[$h][2] = 'info';
 	$h++;
 
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'donation', 'add', 'external');
+
 	complete_head_from_modules($conf, $langs, $object, $head, $h, 'expensereport', 'remove');
 
 	return $head;

+ 3 - 1
htdocs/core/lib/fichinter.lib.php

@@ -61,7 +61,7 @@ function fichinter_prepare_head($object)
 	// Entries must be declared in modules descriptor with line
 	// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
 	// $this->tabs = array('entity:-tabname);   												to remove a tab
-	complete_head_from_modules($conf, $langs, $object, $head, $h, 'intervention');
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'intervention', 'add', 'core');
 
 	// Tab to link resources
 	if (isModEnabled('resource')) {
@@ -125,6 +125,8 @@ function fichinter_prepare_head($object)
 	$head[$h][2] = 'info';
 	$h++;
 
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'intervention', 'add', 'external');
+
 	complete_head_from_modules($conf, $langs, $object, $head, $h, 'intervention', 'remove');
 
 	return $head;

+ 8 - 2
htdocs/core/lib/fourn.lib.php

@@ -83,7 +83,7 @@ function facturefourn_prepare_head($object)
 	// Entries must be declared in modules descriptor with line
 	// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
 	// $this->tabs = array('entity:-tabname);   												to remove a tab
-	complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_invoice');
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_invoice', 'add', 'core');
 
 	if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
 		$nbNote = 0;
@@ -120,6 +120,8 @@ function facturefourn_prepare_head($object)
 	$head[$h][2] = 'info';
 	$h++;
 
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_invoice', 'add', 'external');
+
 	complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_invoice', 'remove');
 
 	return $head;
@@ -189,7 +191,7 @@ function ordersupplier_prepare_head(CommandeFournisseur $object)
 	// Entries must be declared in modules descriptor with line
 	// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
 	// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to remove a tab
-	complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_order');
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_order', 'add', 'core');
 
 	if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
 		$nbNote = 0;
@@ -229,7 +231,11 @@ function ordersupplier_prepare_head(CommandeFournisseur $object)
 	}
 	$head[$h][2] = 'info';
 	$h++;
+
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_order', 'add', 'external');
+
 	complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_order', 'remove');
+
 	return $head;
 }
 

+ 1 - 1
htdocs/core/lib/functions.lib.php

@@ -9057,7 +9057,7 @@ function getLanguageCodeFromCountryCode($countrycode)
  *      									'ecm'			   to add a tab for another ecm view
  *                                          'stock'            to add a tab for warehouse view
  *  @param  string		$mode  	        	'add' to complete head, 'remove' to remove entries
- *  @param	string		$filterorigmodule	Filter on module origin. 'external' will show only external modules. 'core' only core modules. No filter by default.
+ *  @param	string		$filterorigmodule	Filter on module origin: 'external' will show only external modules. 'core' only core modules. No filter (default) will add both.
  *	@return	void
  */
 function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode = 'add', $filterorigmodule = '')

+ 3 - 6
htdocs/core/lib/hrm.lib.php

@@ -52,17 +52,11 @@ function establishment_prepare_head($object)
 	$head[$h][2] = 'info';
 	$h++;
 
-	complete_head_from_modules($conf, $langs, $object, $head, $h, 'establishment', 'remove');
-
-
-
 	$head[$h][0] = dol_buildpath("/hrm/admin/setup.php", 1);
 	$head[$h][1] = $langs->trans("Settings");
 	$head[$h][2] = 'settings';
 	$h++;
 
-	complete_head_from_modules($conf, $langs, null, $head, $h, 'hrm');
-
 	$head[$h][0] = dol_buildpath("/hrm/admin/about.php", 1);
 	$head[$h][1] = $langs->trans("About");
 	$head[$h][2] = 'about';
@@ -70,6 +64,9 @@ function establishment_prepare_head($object)
 
 	complete_head_from_modules($conf, $langs, null, $head, $h, 'hrm');
 
+
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'establishment', 'remove');
+
 	return $head;
 }
 

+ 3 - 1
htdocs/core/lib/invoice.lib.php

@@ -84,7 +84,7 @@ function facture_prepare_head($object)
 	// Entries must be declared in modules descriptor with line
 	// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
 	// $this->tabs = array('entity:-tabname);   												to remove a tab
-	complete_head_from_modules($conf, $langs, $object, $head, $h, 'invoice');
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'invoice', 'add', 'core');
 
 	if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
 		$nbNote = 0;
@@ -121,6 +121,8 @@ function facture_prepare_head($object)
 	$head[$h][2] = 'info';
 	$h++;
 
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'invoice', 'add', 'external');
+
 	complete_head_from_modules($conf, $langs, $object, $head, $h, 'invoice', 'remove');
 
 	return $head;

+ 3 - 1
htdocs/core/lib/loan.lib.php

@@ -51,7 +51,7 @@ function loan_prepare_head($object)
 	// Entries must be declared in modules descriptor with line
 	// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
 	// $this->tabs = array('entity:-tabname);   												to remove a tab
-	complete_head_from_modules($conf, $langs, $object, $head, $tab, 'loan');
+	complete_head_from_modules($conf, $langs, $object, $head, $tab, 'loan', 'add', 'core');
 
 	require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
 	require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
@@ -82,6 +82,8 @@ function loan_prepare_head($object)
 	$head[$tab][2] = 'info';
 	$tab++;
 
+	complete_head_from_modules($conf, $langs, $object, $head, $tab, 'loan', 'add', 'external');
+
 	complete_head_from_modules($conf, $langs, $object, $head, $tab, 'loan', 'remove');
 
 	return $head;

+ 3 - 1
htdocs/core/lib/member.lib.php

@@ -80,7 +80,7 @@ function member_prepare_head(Adherent $object)
 	// Entries must be declared in modules descriptor with line
 	// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
 	// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to remove a tab
-	complete_head_from_modules($conf, $langs, $object, $head, $h, 'member');
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'member', 'add', 'core');
 
 	$nbNote = 0;
 	if (!empty($object->note_private)) {
@@ -123,6 +123,8 @@ function member_prepare_head(Adherent $object)
 		$h++;
 	}
 
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'member', 'add', 'external');
+
 	complete_head_from_modules($conf, $langs, $object, $head, $h, 'member', 'remove');
 
 	return $head;

+ 3 - 1
htdocs/core/lib/order.lib.php

@@ -96,7 +96,7 @@ function commande_prepare_head(Commande $object)
 	// Entries must be declared in modules descriptor with line
 	// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
 	// $this->tabs = array('entity:-tabname);   												to remove a tab
-	complete_head_from_modules($conf, $langs, $object, $head, $h, 'order');
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'order', 'add', 'core');
 
 	if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
 		$nbNote = 0;
@@ -133,6 +133,8 @@ function commande_prepare_head(Commande $object)
 	$head[$h][2] = 'info';
 	$h++;
 
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'order', 'add', 'external');
+
 	complete_head_from_modules($conf, $langs, $object, $head, $h, 'order', 'remove');
 
 	return $head;

+ 5 - 3
htdocs/core/lib/product.lib.php

@@ -153,7 +153,7 @@ function product_prepare_head($object)
 	// Entries must be declared in modules descriptor with line
 	// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
 	// $this->tabs = array('entity:-tabname);   												to remove a tab
-	complete_head_from_modules($conf, $langs, $object, $head, $h, 'product');
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'product', 'add', 'core');
 
 	// Notes
 	if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
@@ -201,8 +201,6 @@ function product_prepare_head($object)
 	$head[$h][2] = 'documents';
 	$h++;
 
-	complete_head_from_modules($conf, $langs, $object, $head, $h, 'product', 'remove');
-
 	// Log
 	$head[$h][0] = DOL_URL_ROOT.'/product/agenda.php?id='.$object->id;
 	$head[$h][1] = $langs->trans("Events");
@@ -213,6 +211,10 @@ function product_prepare_head($object)
 	$head[$h][2] = 'agenda';
 	$h++;
 
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'product', 'add', 'external');
+
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'product', 'remove');
+
 	return $head;
 }
 

+ 6 - 2
htdocs/core/lib/project.lib.php

@@ -244,7 +244,7 @@ function project_prepare_head(Project $project, $moreparam = '')
 	// Entries must be declared in modules descriptor with line
 	// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
 	// $this->tabs = array('entity:-tabname);   												to remove a tab
-	complete_head_from_modules($conf, $langs, $project, $head, $h, 'project');
+	complete_head_from_modules($conf, $langs, $project, $head, $h, 'project', 'add', 'core');
 
 
 	if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
@@ -320,6 +320,8 @@ function project_prepare_head(Project $project, $moreparam = '')
 	$head[$h][2] = 'agenda';
 	$h++;
 
+	complete_head_from_modules($conf, $langs, $project, $head, $h, 'project', 'add', 'external');
+
 	complete_head_from_modules($conf, $langs, $project, $head, $h, 'project', 'remove');
 
 	return $head;
@@ -381,7 +383,7 @@ function task_prepare_head($object)
 	// Entries must be declared in modules descriptor with line
 	// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
 	// $this->tabs = array('entity:-tabname);   												to remove a tab
-	complete_head_from_modules($conf, $langs, $object, $head, $h, 'task');
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'task', 'add', 'core');
 
 	if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
 		$nbNote = 0;
@@ -425,6 +427,8 @@ function task_prepare_head($object)
 		$h++;
 	}
 
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'task', 'add', 'external');
+
 	complete_head_from_modules($conf, $langs, $object, $head, $h, 'task', 'remove');
 
 	return $head;

+ 3 - 1
htdocs/core/lib/propal.lib.php

@@ -73,7 +73,7 @@ function propal_prepare_head($object)
 	// Entries must be declared in modules descriptor with line
 	// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
 	// $this->tabs = array('entity:-tabname);   												to remove a tab
-	complete_head_from_modules($conf, $langs, $object, $head, $h, 'propal');
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'propal', 'add', 'core');
 
 	if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
 		$nbNote = 0;
@@ -110,6 +110,8 @@ function propal_prepare_head($object)
 	$head[$h][2] = 'info';
 	$h++;
 
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'propal', 'add', 'external');
+
 	complete_head_from_modules($conf, $langs, $object, $head, $h, 'propal', 'remove');
 
 	return $head;

+ 3 - 1
htdocs/core/lib/reception.lib.php

@@ -66,7 +66,7 @@ function reception_prepare_head(Reception $object)
 	// Entries must be declared in modules descriptor with line
 	// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
 	// $this->tabs = array('entity:-tabname);   												to remove a tab
-	complete_head_from_modules($conf, $langs, $object, $head, $h, 'reception');
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'reception', 'add', 'core');
 
 	require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
 	require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
@@ -96,6 +96,8 @@ function reception_prepare_head(Reception $object)
 	$head[$h][2] = 'note';
 	$h++;
 
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'reception', 'add', 'external');
+
 	complete_head_from_modules($conf, $langs, $object, $head, $h, 'reception', 'remove');
 
 	return $head;

+ 3 - 1
htdocs/core/lib/resource.lib.php

@@ -55,7 +55,7 @@ function resource_prepare_head($object)
 	// Entries must be declared in modules descriptor with line
 	// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
 	// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to remove a tab
-	complete_head_from_modules($conf, $langs, $object, $head, $h, 'resource');
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'resource', 'add', 'core');
 
 	if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
 		$nbNote = 0;
@@ -99,6 +99,8 @@ function resource_prepare_head($object)
 	$head[$h][2] = 'info';
 	$h++;*/
 
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'resource', 'add', 'external');
+
 	complete_head_from_modules($conf, $langs, $object, $head, $h, 'resource', 'remove');
 
 	return $head;

+ 3 - 1
htdocs/core/lib/salaries.lib.php

@@ -42,7 +42,7 @@ function salaries_prepare_head($object)
 	// Entries must be declared in modules descriptor with line
 	// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
 	// $this->tabs = array('entity:-tabname);   												to remove a tab
-	complete_head_from_modules($conf, $langs, $object, $head, $h, 'salaries');
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'salaries', 'add', 'core');
 
 	require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
 	require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
@@ -62,6 +62,8 @@ function salaries_prepare_head($object)
 	$head[$h][2] = 'info';
 	$h++;
 
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'salaries', 'add', 'external');
+
 	complete_head_from_modules($conf, $langs, $object, $head, $h, 'salaries', 'remove');
 
 	return $head;

+ 3 - 1
htdocs/core/lib/stock.lib.php

@@ -69,13 +69,15 @@ function stock_prepare_head($object)
 	// Entries must be declared in modules descriptor with line
 	// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
 	// $this->tabs = array('entity:-tabname);   												to remove a tab
-	complete_head_from_modules($conf, $langs, $object, $head, $h, 'stock');
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'stock', 'add', 'core');
 
 	$head[$h][0] = DOL_URL_ROOT.'/product/stock/info.php?id='.$object->id;
 	$head[$h][1] = $langs->trans("Info");
 	$head[$h][2] = 'info';
 	$h++;
 
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'stock', 'add', 'external');
+
 	complete_head_from_modules($conf, $langs, $object, $head, $h, 'stock', 'remove');
 
 	return $head;

+ 3 - 1
htdocs/core/lib/supplier_proposal.lib.php

@@ -59,7 +59,7 @@ function supplier_proposal_prepare_head($object)
 	// Entries must be declared in modules descriptor with line
 	// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
 	// $this->tabs = array('entity:-tabname);   												to remove a tab
-	complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_proposal');
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_proposal', 'add', 'core');
 
 	if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
 		$nbNote = 0;
@@ -96,6 +96,8 @@ function supplier_proposal_prepare_head($object)
 	$head[$h][2] = 'info';
 	$h++;
 
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_proposal', 'add', 'external');
+
 	complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_proposal', 'remove');
 
 	return $head;

+ 4 - 1
htdocs/core/lib/ticket.lib.php

@@ -102,7 +102,7 @@ function ticket_prepare_head($object)
 		$h++;
 	}
 
-	complete_head_from_modules($conf, $langs, $object, $head, $h, 'ticket');
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'ticket', 'add', 'core');
 
 	// Attached files
 	include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@@ -140,6 +140,9 @@ function ticket_prepare_head($object)
 	$head[$h][2] = 'tabTicketLogs';
 	$h++;
 
+
+	complete_head_from_modules($conf, $langs, $object, $head, $h, 'ticket', 'add', 'external');
+
 	complete_head_from_modules($conf, $langs, $object, $head, $h, 'ticket', 'remove');
 
 	return $head;

+ 2 - 0
htdocs/knowledgemanagement/lib/knowledgemanagement.lib.php

@@ -61,5 +61,7 @@ function knowledgemanagementAdminPrepareHead()
 	//); // to remove a tab
 	complete_head_from_modules($conf, $langs, null, $head, $h, 'knowledgemanagement');
 
+	complete_head_from_modules($conf, $langs, null, $head, $h, 'knowledgemanagement', 'remove');
+
 	return $head;
 }

+ 2 - 1
htdocs/margin/lib/margins.lib.php

@@ -96,9 +96,10 @@ function marges_prepare_head()
 		$head[$h][2] = 'checkMargins';
 	}
 
-	complete_head_from_modules($conf, $langs, null, $head, $h, 'margins', 'remove');
 	complete_head_from_modules($conf, $langs, null, $head, $h, 'margins');
 
+	complete_head_from_modules($conf, $langs, null, $head, $h, 'margins', 'remove');
+
 	return $head;
 }
 

+ 2 - 0
htdocs/mrp/lib/mrp.lib.php

@@ -55,5 +55,7 @@ function mrpAdminPrepareHead()
 	//); // to remove a tab
 	complete_head_from_modules($conf, $langs, null, $head, $h, 'mrp');
 
+	complete_head_from_modules($conf, $langs, null, $head, $h, 'mrp', 'remove');
+
 	return $head;
 }

+ 2 - 0
htdocs/partnership/lib/partnership.lib.php

@@ -68,6 +68,8 @@ function partnershipAdminPrepareHead()
 	//); // to remove a tab
 	complete_head_from_modules($conf, $langs, null, $head, $h, 'partnership');
 
+	complete_head_from_modules($conf, $langs, null, $head, $h, 'partnership', 'remove');
+
 	return $head;
 }
 

+ 2 - 0
htdocs/product/inventory/lib/inventory.lib.php

@@ -52,6 +52,8 @@ function inventoryAdminPrepareHead()
 	//); // to remove a tab
 	complete_head_from_modules($conf, $langs, null, $head, $h, 'inventory');
 
+	complete_head_from_modules($conf, $langs, null, $head, $h, 'inventory', 'remove');
+
 	return $head;
 }
 

+ 2 - 0
htdocs/product/stock/stocktransfer/lib/stocktransfer.lib.php

@@ -63,5 +63,7 @@ function stocktransferAdminPrepareHead()
 	//); // to remove a tab
 	complete_head_from_modules($conf, $langs, null, $head, $h, 'stocktransfer');
 
+	complete_head_from_modules($conf, $langs, null, $head, $h, 'stocktransfer', 'remove');
+
 	return $head;
 }

+ 2 - 0
htdocs/recruitment/lib/recruitment.lib.php

@@ -70,5 +70,7 @@ function recruitmentAdminPrepareHead()
 	//); // to remove a tab
 	complete_head_from_modules($conf, $langs, null, $head, $h, 'recruitment');
 
+	complete_head_from_modules($conf, $langs, null, $head, $h, 'recruitment', 'remove');
+
 	return $head;
 }

+ 2 - 0
htdocs/workstation/lib/workstation.lib.php

@@ -61,5 +61,7 @@ function workstationAdminPrepareHead()
 	//); // to remove a tab
 	complete_head_from_modules($conf, $langs, null, $head, $h, 'workstation');
 
+	complete_head_from_modules($conf, $langs, null, $head, $h, 'workstation', 'remove');
+
 	return $head;
 }

+ 2 - 0
htdocs/zapier/lib/zapier.lib.php

@@ -54,5 +54,7 @@ function zapierAdminPrepareHead()
 	//); // to remove a tab
 	complete_head_from_modules($conf, $langs, null, $head, $h, 'zapier');
 
+	complete_head_from_modules($conf, $langs, null, $head, $h, 'zapier', 'remove');
+
 	return $head;
 }