diff --git a/dev/skeletons/modMyModule.class.php b/dev/skeletons/modMyModule.class.php index 459088658fe..1046a4993b5 100644 --- a/dev/skeletons/modMyModule.class.php +++ b/dev/skeletons/modMyModule.class.php @@ -103,6 +103,7 @@ class modMyModule extends DolibarrModules // 'product' to add a tab in product view // 'propal' to add a tab in propal view // 'member' to add a tab in fundation member view + // 'contract' to add a tab in contract view // Boxes diff --git a/htdocs/lib/contract.lib.php b/htdocs/lib/contract.lib.php index f908c8782ee..848f013d075 100644 --- a/htdocs/lib/contract.lib.php +++ b/htdocs/lib/contract.lib.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2006-2009 Laurent Destailleur + * Copyright (C) 2009 Regis Houssin * * 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 @@ -53,7 +54,23 @@ function contract_prepare_head($contrat) $head[$h][1] = $langs->trans("Info"); $head[$h][2] = 'info'; $h++; - + + // Show more tabs from modules + // Entries must be declared in modules descriptor with line + // $this->tabs = array('entity:MyModule:@mymodule:/dolibarr/mymodule/mypage.php?id=__ID__'); + if (is_array($conf->tabs_modules['contract'])) + { + $i=0; + foreach ($conf->tabs_modules['contract'] as $value) + { + $values=explode(':',$value); + if ($values[2]) $langs->load($values[2]); + $head[$h][0] = preg_replace('/__ID__/i',$contrat->id,$values[3]); + $head[$h][1] = $langs->trans($values[1]); + $head[$h][2] = 'tab'.$values[1]; + $h++; + } + } return $head; }