Some fix on complete_head_from_modules

This commit is contained in:
Alexandre SPANGARO 2020-08-20 22:17:34 +02:00
parent 90545ac443
commit f1f579ad67
17 changed files with 36 additions and 30 deletions

View File

@ -58,6 +58,7 @@ function expedition_prepare_head(Expedition $object)
$h++;
}
complete_head_from_modules($conf, $langs, $object, $head, $h, 'order');
complete_head_from_modules($conf, $langs, $object, $head, $h, 'order', 'remove');
@ -132,7 +133,7 @@ function expedition_admin_prepare_head()
$h++;
}
complete_head_from_modules($conf, $langs, null, $head, $h, 'expedition_admin');
complete_head_from_modules($conf, $langs, null, $head, $h, 'expedition_admin', 'remove');

View File

@ -85,9 +85,9 @@ function hrm_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, '', $head, $h, 'hrm_admin');
complete_head_from_modules($conf, $langs, null, $head, $h, 'hrm_admin');
complete_head_from_modules($conf, $langs, '', $head, $h, 'hrm_admin', 'remove');
complete_head_from_modules($conf, $langs, null, $head, $h, 'hrm_admin', 'remove');
return $head;
}

View File

@ -87,7 +87,9 @@ function ldap_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); to remove a tab
complete_head_from_modules($conf, $langs, '', $head, $h, 'ldap');
complete_head_from_modules($conf, $langs, null, $head, $h, 'ldap');
complete_head_from_modules($conf, $langs, null, $head, $h, 'ldap', 'remove');
return $head;
}

View File

@ -185,7 +185,7 @@ function member_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, '', $head, $h, 'member_admin');
complete_head_from_modules($conf, $langs, null, $head, $h, 'member_admin');
$head[$h][0] = DOL_URL_ROOT.'/adherents/admin/adherent_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsMember");
@ -202,7 +202,7 @@ function member_admin_prepare_head()
$head[$h][2] = 'website';
$h++;
complete_head_from_modules($conf, $langs, '', $head, $h, 'member_admin', 'remove');
complete_head_from_modules($conf, $langs, null, $head, $h, 'member_admin', 'remove');
return $head;
}

View File

@ -42,6 +42,8 @@ function multicurrencyAdminPrepareHead()
complete_head_from_modules($conf, $langs, null, $head, $h, 'multicurrency');
complete_head_from_modules($conf, $langs, null, $head, $h, 'multicurrency', 'remove');
return $head;
}

View File

@ -47,8 +47,6 @@ function reception_prepare_head(Reception $object)
$head[$h][2] = 'reception';
$h++;
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
$objectsrc = $object;
@ -65,6 +63,12 @@ function reception_prepare_head(Reception $object)
$h++;
}
// Show more tabs from modules
// 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');
$nbNote = 0;
if (!empty($object->note_private)) $nbNote++;
if (!empty($object->note_public)) $nbNote++;
@ -74,12 +78,7 @@ function reception_prepare_head(Reception $object)
$head[$h][2] = 'note';
$h++;
complete_head_from_modules($conf, $langs, $object, $head, $h, 'order', 'remove');
complete_head_from_modules($conf, $langs, $object, $head, $h, 'reception', 'remove');
return $head;
}
@ -102,6 +101,7 @@ function reception_admin_prepare_head()
$head[$h][2] = 'reception';
$h++;
complete_head_from_modules($conf, $langs, null, $head, $h, 'reception_admin');
if (!empty($conf->global->MAIN_SUBMODULE_RECEPTION))
{
@ -119,8 +119,6 @@ function reception_admin_prepare_head()
$h++;
}
complete_head_from_modules($conf, $langs, null, $head, $h, 'reception_admin', 'remove');
return $head;

View File

@ -37,7 +37,7 @@ function resource_prepare_head($object)
$head[$h][0] = dol_buildpath('/resource/card.php', 1).'?id='.$object->id;
$head[$h][1] = $langs->trans("ResourceCard");
$head[$h][2] = 'resource';
$head[$h][2] = 'resource';
$h++;
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && (empty($conf->global->RESOURCE_HIDE_ADD_CONTACT_USER) || empty($conf->global->RESOURCE_HIDE_ADD_CONTACT_THIPARTY)))

View File

@ -27,7 +27,6 @@
*/
function salaries_prepare_head($object)
{
global $db, $langs, $conf;
$h = 0;
@ -86,14 +85,14 @@ function salaries_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, '', $head, $h, 'salaries_admin');
complete_head_from_modules($conf, $langs, null, $head, $h, 'salaries_admin');
$head[$h][0] = DOL_URL_ROOT.'/salaries/admin/salaries_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsSalaries");
$head[$h][2] = 'attributes';
$h++;
complete_head_from_modules($conf, $langs, '', $head, $h, 'salaries_admin', 'remove');
complete_head_from_modules($conf, $langs, null, $head, $h, 'salaries_admin', 'remove');
return $head;
}

View File

@ -26,7 +26,7 @@
*
* @return array Array of tabs
*/
function takepos_prepare_head()
function takepos_admin_prepare_head()
{
global $langs, $conf;
@ -67,7 +67,9 @@ function takepos_prepare_head()
$head[$h][2] = 'other';
$h++;
complete_head_from_modules($conf, $langs, null, $head, $h, 'takepos');
complete_head_from_modules($conf, $langs, null, $head, $h, 'takepos_admin');
complete_head_from_modules($conf, $langs, null, $head, $h, 'takepos_admin', 'remove');
return $head;
}

View File

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

View File

@ -44,9 +44,9 @@ function marges_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); to remove a tab
complete_head_from_modules($conf, $langs, '', $head, $h, 'margesadmin');
complete_head_from_modules($conf, $langs, null, $head, $h, 'margesadmin');
complete_head_from_modules($conf, $langs, '', $head, $h, 'margesadmin', 'remove');
complete_head_from_modules($conf, $langs, null, $head, $h, 'margesadmin', 'remove');
return $head;
}

View File

@ -74,7 +74,7 @@ llxHeader('', $langs->trans("CashDeskSetup"));
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup');
$head = takepos_prepare_head();
$head = takepos_admin_prepare_head();
dol_fiche_head($head, 'appearance', 'TakePOS', -1, 'cash-register');
print '<form action="'.$_SERVER["PHP_SELF"].'?terminal='.(empty($terminal) ? 1 : $terminal).'" method="post">';

View File

@ -79,7 +79,7 @@ llxHeader('', $langs->trans("CashDeskSetup"), '', '', 0, 0, $arrayofjs, $arrayof
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup');
$head = takepos_prepare_head();
$head = takepos_admin_prepare_head();
dol_fiche_head($head, 'bar', 'TakePOS', -1, 'cash-register');

View File

@ -110,7 +110,7 @@ llxHeader('', $langs->trans("CashDeskSetup"));
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup');
$head = takepos_prepare_head();
$head = takepos_admin_prepare_head();
dol_fiche_head($head, 'other', 'TakePOS', -1, 'cash-register');
print '<br>';

View File

@ -78,7 +78,7 @@ llxHeader('', $langs->trans("CashDeskSetup"));
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup');
$head = takepos_prepare_head();
$head = takepos_admin_prepare_head();
dol_fiche_head($head, 'receipt', 'TakePOS', -1, 'cash-register');
print '<form action="'.$_SERVER["PHP_SELF"].'?terminal='.(empty($terminal) ? 1 : $terminal).'" method="post">';

View File

@ -130,7 +130,7 @@ llxHeader('', $langs->trans("CashDeskSetup"));
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup');
$head = takepos_prepare_head();
$head = takepos_admin_prepare_head();
dol_fiche_head($head, 'setup', 'TakePOS', -1, 'cash-register');
// Numbering modules

View File

@ -124,7 +124,7 @@ llxHeader('', $langs->trans("CashDeskSetup"));
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup');
$head = takepos_prepare_head();
$head = takepos_admin_prepare_head();
dol_fiche_head($head, 'terminal'.$terminal, 'TakePOS', -1, 'cash-register');
print '<br>';