Skip to content
Snippets Groups Projects
Commit eb8ac6c1 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

New: Modules can add their own tab on projects cards

parent aea99b1d
Branches
No related tags found
No related merge requests found
...@@ -25,9 +25,9 @@ For users: ...@@ -25,9 +25,9 @@ For users:
- Fix: Running sending-email.php - Fix: Running sending-email.php
For developers: For developers:
- Reorganize /dev directory. - Qual: Reorganize /dev directory.
- Change the way items are linked together. - Qual: Change the way items are linked together.
- New: Modules can add their own tab on projects cards.
***** ChangeLog for 2.7.1 compared to 2.7 ***** ***** ChangeLog for 2.7.1 compared to 2.7 *****
......
...@@ -52,6 +52,23 @@ function project_prepare_head($objsoc) ...@@ -52,6 +52,23 @@ function project_prepare_head($objsoc)
$h++; $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['project']))
{
$i=0;
foreach ($conf->tabs_modules['project'] as $value)
{
$values=explode(':',$value);
if ($values[2]) $langs->load($values[2]);
$head[$h][0] = preg_replace('/__ID__/i',$objsoc->id,$values[3]);
$head[$h][1] = $langs->trans($values[1]);
$head[$h][2] = 'tab'.$values[1];
$h++;
}
}
return $head; return $head;
} }
...@@ -83,6 +100,23 @@ function task_prepare_head($object) ...@@ -83,6 +100,23 @@ function task_prepare_head($object)
$head[$h][2] = 'who'; $head[$h][2] = 'who';
$h++; $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['task']))
{
$i=0;
foreach ($conf->tabs_modules['task'] as $value)
{
$values=explode(':',$value);
if ($values[2]) $langs->load($values[2]);
$head[$h][0] = preg_replace('/__ID__/i',$objsoc->id,$values[3]);
$head[$h][1] = $langs->trans($values[1]);
$head[$h][2] = 'tab'.$values[1];
$h++;
}
}
return $head; return $head;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment