diff --git a/dev/skeletons/modMyModule.class.php b/dev/skeletons/modMyModule.class.php
index 6107560d656..9200524f259 100644
--- a/dev/skeletons/modMyModule.class.php
+++ b/dev/skeletons/modMyModule.class.php
@@ -111,9 +111,9 @@ class modMyModule extends DolibarrModules
$this->const = array();
// Array to add new pages in new tabs
- // Example: $this->tabs = array('objecttype:+tabname1:Title1:mylangfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__', // To add a new tab identified by code tabname1
- // 'objecttype:+tabname2:Title2:mylangfile@mymodule:$user->rights->othermodule->read:/mymodule/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2
- // 'objecttype:-tabname'); // To remove an existing tab identified by code tabname
+ // Example: $this->tabs = array('objecttype:+tabname1:Title1:mylangfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__', // To add a new tab identified by code tabname1
+ // 'objecttype:+tabname2:Title2:mylangfile@mymodule:$user->rights->othermodule->read:/mymodule/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2
+ // 'objecttype:-tabname':NU:conditiontoremove); // To remove an existing tab identified by code tabname
// where objecttype can be
// 'thirdparty' to add a tab in third party view
// 'intervention' to add a tab in intervention view
diff --git a/htdocs/commissions/lib/commissions.lib.php b/htdocs/commissions/lib/commissions.lib.php
index 89fba20a60c..ef99fd6ee3a 100644
--- a/htdocs/commissions/lib/commissions.lib.php
+++ b/htdocs/commissions/lib/commissions.lib.php
@@ -41,8 +41,10 @@ function commissions_admin_prepare_head()
// 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:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
- complete_head_from_modules($conf,$langs,'',$head,$h,'commissionsadmin');
+ // $this->tabs = array('entity:-tabname); to remove a tab
+ complete_head_from_modules($conf,$langs,'',$head,$h,'commissionsadmin');
+
+ complete_head_from_modules($conf,$langs,'',$head,$h,'commissionsadmin','remove');
return $head;
}
diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php
index ab1636aeabc..a44c45128c1 100644
--- a/htdocs/core/lib/agenda.lib.php
+++ b/htdocs/core/lib/agenda.lib.php
@@ -443,9 +443,11 @@ function calendars_prepare_head($param)
// 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:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
+ // $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'agenda');
+ complete_head_from_modules($conf,$langs,$object,$head,$h,'agenda','remove');
+
return $head;
}
diff --git a/htdocs/core/lib/categories.lib.php b/htdocs/core/lib/categories.lib.php
index ba3f0de1145..c330e55a388 100644
--- a/htdocs/core/lib/categories.lib.php
+++ b/htdocs/core/lib/categories.lib.php
@@ -51,9 +51,11 @@ function categories_prepare_head($object,$type)
// 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:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
+ // $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'categories_'.$type);
+ complete_head_from_modules($conf,$langs,$object,$head,$h,'categories_'.$type,'remove');
+
return $head;
}
diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php
index 8009ba6e31d..2e41d7276fa 100644
--- a/htdocs/core/lib/contact.lib.php
+++ b/htdocs/core/lib/contact.lib.php
@@ -63,7 +63,7 @@ function contact_prepare_head($object)
// 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:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
+ // $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'contact');
$head[$h][0] = DOL_URL_ROOT.'/contact/info.php?id='.$object->id;
@@ -71,7 +71,7 @@ function contact_prepare_head($object)
$head[$h][2] = 'info';
$h++;
-
+ complete_head_from_modules($conf,$langs,$object,$head,$h,'contact','remove');
return $head;
}
diff --git a/htdocs/core/lib/contract.lib.php b/htdocs/core/lib/contract.lib.php
index 90a15cf958e..238bfb2a7b3 100644
--- a/htdocs/core/lib/contract.lib.php
+++ b/htdocs/core/lib/contract.lib.php
@@ -38,7 +38,7 @@ function contract_prepare_head($object)
$head[$h][1] = $langs->trans("ContractCard");
$head[$h][2] = 'card';
$h++;
-
+
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
$head[$h][0] = DOL_URL_ROOT.'/contrat/contact.php?id='.$object->id;
@@ -50,9 +50,9 @@ function contract_prepare_head($object)
// 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:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
+ // $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'contract');
-
+
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
$head[$h][0] = DOL_URL_ROOT.'/contrat/note.php?id='.$object->id;
@@ -71,6 +71,8 @@ function contract_prepare_head($object)
$head[$h][2] = 'info';
$h++;
+ complete_head_from_modules($conf,$langs,$object,$head,$h,'contract','remove');
+
return $head;
}
diff --git a/htdocs/core/lib/fichinter.lib.php b/htdocs/core/lib/fichinter.lib.php
index 08732c271af..463375baca0 100644
--- a/htdocs/core/lib/fichinter.lib.php
+++ b/htdocs/core/lib/fichinter.lib.php
@@ -42,7 +42,7 @@ function fichinter_prepare_head($object)
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card';
$h++;
-
+
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
$head[$h][0] = DOL_URL_ROOT.'/fichinter/contact.php?id='.$object->id;
@@ -62,9 +62,9 @@ function fichinter_prepare_head($object)
// 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:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
+ // $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'intervention');
-
+
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
$head[$h][0] = DOL_URL_ROOT.'/fichinter/note.php?id='.$object->id;
@@ -83,7 +83,9 @@ function fichinter_prepare_head($object)
$head[$h][2] = 'info';
$h++;
- return $head;
+ complete_head_from_modules($conf,$langs,$object,$head,$h,'intervention','remove');
+
+ return $head;
}
?>
diff --git a/htdocs/core/lib/fourn.lib.php b/htdocs/core/lib/fourn.lib.php
index 887cae3115d..21db6d63fb8 100644
--- a/htdocs/core/lib/fourn.lib.php
+++ b/htdocs/core/lib/fourn.lib.php
@@ -52,7 +52,7 @@ function facturefourn_prepare_head($object)
// 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:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
+ // $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'supplier_invoice');
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
@@ -77,7 +77,9 @@ function facturefourn_prepare_head($object)
$head[$h][2] = 'info';
$h++;
- return $head;
+ complete_head_from_modules($conf,$langs,$object,$head,$h,'supplier_invoice','remove');
+
+ return $head;
}
diff --git a/htdocs/core/lib/holiday.lib.php b/htdocs/core/lib/holiday.lib.php
new file mode 100644
index 00000000000..6d96d2bd1f3
--- /dev/null
+++ b/htdocs/core/lib/holiday.lib.php
@@ -0,0 +1,53 @@
+
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ * or see http://www.gnu.org/
+ */
+
+/**
+ * \file htdocs/core/lib/holiday.lib.php
+ * \brief Ensemble de fonctions de base pour les adherents
+ */
+
+/**
+ * Return array head with list of tabs to view object informations
+ *
+ * @param Object $object Holiday
+ * @return array head
+ */
+function holiday_prepare_head($object)
+{
+ global $langs, $conf, $user;
+
+ $h = 0;
+ $head = array();
+
+ $head[$h][0] = DOL_URL_ROOT . '/holiday/fiche.php?id='.$object->id;
+ $head[$h][1] = $langs->trans("Card");
+ $head[$h][2] = 'card';
+ $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,'holiday');
+
+ complete_head_from_modules($conf,$langs,$object,$head,$h,'holiday','remove');
+
+ return $head;
+}
+
+?>
diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php
index 8d3990942c1..7fd7ab97248 100644
--- a/htdocs/core/lib/invoice.lib.php
+++ b/htdocs/core/lib/invoice.lib.php
@@ -39,7 +39,7 @@ function facture_prepare_head($object)
$head[$h][1] = $langs->trans('CardBill');
$head[$h][2] = 'compta';
$h++;
-
+
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/contact.php?facid='.$object->id;
@@ -68,9 +68,9 @@ function facture_prepare_head($object)
// 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:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
+ // $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'invoice');
-
+
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/note.php?facid='.$object->id;
@@ -93,6 +93,8 @@ function facture_prepare_head($object)
$head[$h][2] = 'info';
$h++;
+ complete_head_from_modules($conf,$langs,$object,$head,$h,'invoice','remove');
+
return $head;
}
diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php
index 88e740c1245..835708295c3 100644
--- a/htdocs/core/lib/member.lib.php
+++ b/htdocs/core/lib/member.lib.php
@@ -183,9 +183,11 @@ function member_stats_prepare_head($object)
// 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:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
+ // $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'member_stats');
+ complete_head_from_modules($conf,$langs,$object,$head,$h,'member_stats','remove');
+
return $head;
}
?>
diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php
index 3fc1bc73f04..f5c8b41f0ec 100644
--- a/htdocs/core/lib/order.lib.php
+++ b/htdocs/core/lib/order.lib.php
@@ -67,7 +67,7 @@ function commande_prepare_head($object)
$head[$h][2] = 'preview';
$h++;
}
-
+
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
$head[$h][0] = DOL_URL_ROOT.'/commande/contact.php?id='.$object->id;
@@ -79,7 +79,7 @@ function commande_prepare_head($object)
// 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:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
+ // $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'order');
$head[$h][0] = DOL_URL_ROOT.'/commande/document.php?id='.$object->id;
@@ -90,7 +90,7 @@ function commande_prepare_head($object)
$head[$h][1] = $langs->trans('Documents');
$head[$h][2] = 'documents';
$h++;
-
+
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
$head[$h][0] = DOL_URL_ROOT.'/commande/note.php?id='.$object->id;
@@ -104,7 +104,9 @@ function commande_prepare_head($object)
$head[$h][2] = 'info';
$h++;
- return $head;
+ complete_head_from_modules($conf,$langs,$object,$head,$h,'order','remove');
+
+ return $head;
}
?>
diff --git a/htdocs/core/lib/prelevement.lib.php b/htdocs/core/lib/prelevement.lib.php
index c370172430a..2b4f6264068 100644
--- a/htdocs/core/lib/prelevement.lib.php
+++ b/htdocs/core/lib/prelevement.lib.php
@@ -75,9 +75,11 @@ function prelevement_prepare_head($object)
// 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:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
+ // $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'prelevement');
+ complete_head_from_modules($conf,$langs,$object,$head,$h,'prelevement','remove');
+
return $head;
}
diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php
index cb345399733..ee547ca49d7 100644
--- a/htdocs/core/lib/product.lib.php
+++ b/htdocs/core/lib/product.lib.php
@@ -113,7 +113,7 @@ function product_prepare_head($object, $user)
// 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:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
+ // $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'product');
$head[$h][0] = DOL_URL_ROOT.'/product/document.php?id='.$object->id;
@@ -158,8 +158,8 @@ function product_admin_prepare_head($object=null)
// 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:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
+ // $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_admin');
$head[$h][0] = DOL_URL_ROOT.'/product/admin/product_extrafields.php';
diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php
index e5dddb11ea5..1c7b202a460 100644
--- a/htdocs/core/lib/project.lib.php
+++ b/htdocs/core/lib/project.lib.php
@@ -61,7 +61,7 @@ function project_prepare_head($object)
// 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:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
+ // $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'project');
$head[$h][0] = DOL_URL_ROOT.'/projet/document.php?id='.$object->id;
@@ -96,7 +96,9 @@ function project_prepare_head($object)
$head[$h][2] = 'gantt';
$h++;
- return $head;
+ complete_head_from_modules($conf,$langs,$object,$head,$h,'project','remove');
+
+ return $head;
}
@@ -130,7 +132,7 @@ function task_prepare_head($object)
// 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:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
+ // $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'task');
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/document.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');;
@@ -147,6 +149,8 @@ function task_prepare_head($object)
$head[$h][2] = 'task_notes';
$h++;
+ complete_head_from_modules($conf,$langs,$object,$head,$h,'task','remove');
+
return $head;
}
diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php
index a0922fc4c4c..9c44b578f14 100644
--- a/htdocs/core/lib/propal.lib.php
+++ b/htdocs/core/lib/propal.lib.php
@@ -73,7 +73,7 @@ function propal_prepare_head($object)
// 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:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
+ // $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'propal');
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
@@ -98,6 +98,8 @@ function propal_prepare_head($object)
$head[$h][2] = 'info';
$h++;
+ complete_head_from_modules($conf,$langs,$object,$head,$h,'propal','remove');
+
return $head;
}
diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php
index d031bdd167c..5ba774d1b3e 100644
--- a/htdocs/core/lib/sendings.lib.php
+++ b/htdocs/core/lib/sendings.lib.php
@@ -66,10 +66,12 @@ function shipping_prepare_head($object)
// 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:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
+ // $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,'delivery');
+ complete_head_from_modules($conf,$langs,$object,$head,$h,'delivery','remove');
+
return $head;
}
@@ -105,10 +107,12 @@ function delivery_prepare_head($object)
// 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:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
+ // $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,'delivery');
+ complete_head_from_modules($conf,$langs,$object,$head,$h,'delivery','remove');
+
return $head;
}
diff --git a/htdocs/core/lib/stock.lib.php b/htdocs/core/lib/stock.lib.php
index 7fb81297cb3..22694c39217 100644
--- a/htdocs/core/lib/stock.lib.php
+++ b/htdocs/core/lib/stock.lib.php
@@ -66,7 +66,7 @@ function stock_prepare_head($object)
// 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:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
+ // $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'stock');
$head[$h][0] = DOL_URL_ROOT.'/product/stock/info.php?id='.$object->id;
@@ -74,7 +74,9 @@ function stock_prepare_head($object)
$head[$h][2] = 'info';
$h++;
- return $head;
+ complete_head_from_modules($conf,$langs,$object,$head,$h,'stock','remove');
+
+ return $head;
}
?>
\ No newline at end of file
diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php
index eab91d27d4b..96ae34899fb 100644
--- a/htdocs/core/lib/tax.lib.php
+++ b/htdocs/core/lib/tax.lib.php
@@ -45,7 +45,7 @@ function tax_prepare_head($object)
// 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:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
+ // $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'tax');
$head[$h][0] = DOL_URL_ROOT.'/compta/sociales/document.php?id='.$object->id;
@@ -58,6 +58,8 @@ function tax_prepare_head($object)
$head[$h][2] = 'info';
$h++;
+ complete_head_from_modules($conf,$langs,$object,$head,$h,'tax','remove');
+
return $head;
}
diff --git a/htdocs/core/lib/trip.lib.php b/htdocs/core/lib/trip.lib.php
index d2c150cf7da..e0380e6ef55 100644
--- a/htdocs/core/lib/trip.lib.php
+++ b/htdocs/core/lib/trip.lib.php
@@ -33,23 +33,25 @@ function trip_prepare_head($object)
$h = 0;
$head = array();
-
+
$head[$h][0] = DOL_URL_ROOT . '/compta/deplacement/fiche.php?id=' . $object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card';
$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:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
+ // $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,'trip');
-
+
$head[$h][0] = DOL_URL_ROOT . '/compta/deplacement/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,'trip','remove');
+
return $head;
}
diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php
index e0dea4a81cd..a9e074a1fc5 100644
--- a/htdocs/core/lib/usergroups.lib.php
+++ b/htdocs/core/lib/usergroups.lib.php
@@ -81,8 +81,8 @@ function user_prepare_head($object)
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
- // $this->tabs = array('entity:+tabname:Title:@mymodule:conditiontoshow:/mymodule/mypage.php?id=__ID__'); to add new tab
- // $this->tabs = array('entity:-tabname:Title:@mymodule:conditiontoshow:/mymodule/mypage.php?id=__ID__'); to remove a tab
+ // $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,'user');
if (! empty($user->societe_id))
@@ -98,6 +98,8 @@ function user_prepare_head($object)
$h++;
}
+ complete_head_from_modules($conf,$langs,$object,$head,$h,'user','remove');
+
return $head;
}
@@ -140,9 +142,11 @@ function group_prepare_head($object)
// 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:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
+ // $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'group');
+ complete_head_from_modules($conf,$langs,$object,$head,$h,'group','remove');
+
return $head;
}
diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php
index 1fe9810414f..be90f452158 100644
--- a/htdocs/holiday/class/holiday.class.php
+++ b/htdocs/holiday/class/holiday.class.php
@@ -90,11 +90,11 @@ class Holiday extends CommonObject
$error=0;
$now=dol_now();
-
+
// Check parameters
if (empty($this->fk_user) || ! is_numeric($this->fk_user) || $this->fk_user < 0) { $this->error="ErrorBadParameter"; return -1; }
if (empty($this->fk_validator) || ! is_numeric($this->fk_validator) || $this->fk_validator < 0) { $this->error="ErrorBadParameter"; return -1; }
-
+
// Insert request
$sql = "INSERT INTO ".MAIN_DB_PREFIX."holiday(";
@@ -191,7 +191,8 @@ class Holiday extends CommonObject
{
$obj = $this->db->fetch_object($resql);
- $this->rowid = $obj->rowid;
+ $this->id = $obj->rowid;
+ $this->rowid = $obj->rowid; // deprecated
$this->fk_user = $obj->fk_user;
$this->date_create = $this->db->jdate($obj->date_create);
$this->description = $obj->description;
@@ -206,8 +207,6 @@ class Holiday extends CommonObject
$this->date_cancel = $this->db->jdate($obj->date_cancel);
$this->fk_user_cancel = $obj->fk_user_cancel;
$this->detail_refuse = $obj->detail_refuse;
-
-
}
$this->db->free($resql);
@@ -1601,17 +1600,17 @@ class Holiday extends CommonObject
function initAsSpecimen()
{
global $user,$langs;
-
+
// Initialise parameters
$this->id=0;
$this->specimen=1;
-
+
$this->fk_user=1;
$this->description='SPECIMEN description';
$this->date_debut=dol_now();
$this->date_fin=dol_now()+(24*3600);
$this->fk_validator=1;
}
-
+
}
?>
diff --git a/htdocs/holiday/fiche.php b/htdocs/holiday/fiche.php
index 147d57bda7f..b09f08720e3 100644
--- a/htdocs/holiday/fiche.php
+++ b/htdocs/holiday/fiche.php
@@ -30,6 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/holiday.lib.php';
require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php';
// Get parameters
@@ -752,9 +753,9 @@ else
//print_fiche_titre($langs->trans('TitreRequestCP'));
// Si il y a une erreur
- if (GETPOST('error'))
+ if (GETPOST('error'))
{
- switch(GETPOST('error'))
+ switch(GETPOST('error'))
{
case 'datefin' :
$errors[] = $langs->transnoentitiesnoconv('ErrorEndDateCP');
@@ -829,16 +830,8 @@ else
if ($ret == 'html') print '
';
}
+ $head=holiday_prepare_head($cp);
- $h=0;
- $head = array();
- $head[$h][0] = DOL_URL_ROOT . '/holiday/fiche.php?id='.$id;
- $head[$h][1] = $langs->trans("Card");
- $head[$h][2] = 'card';
- $h++;
-
- complete_head_from_modules($conf,$langs,$cp,$head,$h,'holiday');
-
dol_fiche_head($head,'card',$langs->trans("CPTitreMenu"),0,'holiday');
diff --git a/htdocs/margin/lib/margins.lib.php b/htdocs/margin/lib/margins.lib.php
index 99e46b1161c..34cecb83e05 100644
--- a/htdocs/margin/lib/margins.lib.php
+++ b/htdocs/margin/lib/margins.lib.php
@@ -40,10 +40,12 @@ function marges_admin_prepare_head()
// 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:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
+ // $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,'',$head,$h,'margesadmin','remove');
+
return $head;
}
diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php
index 151920e614f..02ee4895bc1 100755
--- a/htdocs/paypal/lib/paypal.lib.php
+++ b/htdocs/paypal/lib/paypal.lib.php
@@ -182,8 +182,10 @@ function paypaladmin_prepare_head()
// 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:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
- complete_head_from_modules($conf,$langs,$object,$head,$h,'paypaladmin');
+ // $this->tabs = array('entity:-tabname); to remove a tab
+ complete_head_from_modules($conf,$langs,$object,$head,$h,'paypaladmin');
+
+ complete_head_from_modules($conf,$langs,$object,$head,$h,'paypaladmin','remove');
return $head;
}