From 815ae3cb0969eddd3ba56720a275450d7d0ce282 Mon Sep 17 00:00:00 2001 From: Matt Sidnell <54064522+pstructures@users.noreply.github.com> Date: Fri, 27 Mar 2020 21:51:34 +0000 Subject: [PATCH 1/5] Ability to add new tabs on company admin section I have added the option to add a tab from a module to the main company setup section. I need this ability so thought that others might too. --- htdocs/core/lib/admin.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 7d3658d4f97..dd7313f1d0b 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1781,7 +1781,8 @@ function company_admin_prepare_head() $h++; complete_head_from_modules($conf, $langs, null, $head, $h, 'company_admin', 'remove'); - + complete_head_from_modules($conf, $langs, null, $head, $h, 'company_admin', 'add'); + return $head; } From f93bdf6b22efebbdac98b78663e7c43804d56b61 Mon Sep 17 00:00:00 2001 From: Matt Sidnell <54064522+pstructures@users.noreply.github.com> Date: Fri, 27 Mar 2020 23:09:40 +0000 Subject: [PATCH 2/5] Fix so company_admin tabs do not show in Societe fix --- htdocs/core/lib/company.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index eac9f404188..1047081d0d4 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -402,7 +402,7 @@ function societe_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, 'company_admin'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'societe_admin'); $head[$h][0] = DOL_URL_ROOT.'/societe/admin/societe_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsThirdParties"); @@ -414,7 +414,7 @@ function societe_admin_prepare_head() $head[$h][2] = 'attributes_contacts'; $h++; - complete_head_from_modules($conf, $langs, null, $head, $h, 'company_admin', 'remove'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'societe_admin', 'remove'); return $head; } From 6f07b87cdeffc6bd93f47f094270ceb2def847d0 Mon Sep 17 00:00:00 2001 From: Matt Sidnell <54064522+pstructures@users.noreply.github.com> Date: Fri, 27 Mar 2020 23:22:02 +0000 Subject: [PATCH 3/5] Update admin.lib.php --- htdocs/core/lib/admin.lib.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index dd7313f1d0b..27a846ab5fa 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1782,7 +1782,6 @@ function company_admin_prepare_head() complete_head_from_modules($conf, $langs, null, $head, $h, 'company_admin', 'remove'); complete_head_from_modules($conf, $langs, null, $head, $h, 'company_admin', 'add'); - return $head; } From 95de8d1992c203d532cd35e4e88e18d4fd9368e8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 30 Mar 2020 19:23:25 +0200 Subject: [PATCH 4/5] Update admin.lib.php --- htdocs/core/lib/admin.lib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 27a846ab5fa..a31159c22d2 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1780,8 +1780,10 @@ function company_admin_prepare_head() $head[$h][2] = 'accountant'; $h++; - complete_head_from_modules($conf, $langs, null, $head, $h, 'company_admin', 'remove'); - complete_head_from_modules($conf, $langs, null, $head, $h, 'company_admin', 'add'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'mycompany_admin', 'add'); + + complete_head_from_modules($conf, $langs, null, $head, $h, 'mycompany_admin', 'remove'); + return $head; } From 06277ec6e040984f491946b04a9f1a8695af934c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 30 Mar 2020 19:24:00 +0200 Subject: [PATCH 5/5] Update company.lib.php --- htdocs/core/lib/company.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 1047081d0d4..eac9f404188 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -402,7 +402,7 @@ function societe_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, 'societe_admin'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'company_admin'); $head[$h][0] = DOL_URL_ROOT.'/societe/admin/societe_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsThirdParties"); @@ -414,7 +414,7 @@ function societe_admin_prepare_head() $head[$h][2] = 'attributes_contacts'; $h++; - complete_head_from_modules($conf, $langs, null, $head, $h, 'societe_admin', 'remove'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'company_admin', 'remove'); return $head; }