forked from Wavyzz/dolibarr
Qual: Mutualized code
This commit is contained in:
@@ -52,7 +52,13 @@ function project_prepare_head($object)
|
||||
$h++;
|
||||
}
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/document.php?id='.$object->id;
|
||||
// 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,'project');
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/document.php?id='.$object->id;
|
||||
/*$filesdir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||
include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php');
|
||||
$listoffiles=dol_dir_list($filesdir,'files',1);
|
||||
@@ -66,23 +72,6 @@ function project_prepare_head($object)
|
||||
$head[$h][2] = 'note';
|
||||
$h++;
|
||||
|
||||
// Show more tabs from modules
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:MyModule:@mymodule:/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] = dol_buildpath(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][1] = $langs->trans($values[1]);
|
||||
$head[$h][2] = 'tab'.$values[1];
|
||||
$h++;
|
||||
}
|
||||
}
|
||||
|
||||
// Then tab for sub level of projet, i mean tasks
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Tasks");
|
||||
@@ -132,7 +121,13 @@ function task_prepare_head($object)
|
||||
$head[$h][2] = 'time';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/document.php?id='.$object->id;
|
||||
// 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,'task');
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/document.php?id='.$object->id;
|
||||
/*$filesdir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||
include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php');
|
||||
$listoffiles=dol_dir_list($filesdir,'files',1);
|
||||
@@ -146,23 +141,6 @@ function task_prepare_head($object)
|
||||
$head[$h][2] = 'note';
|
||||
$h++;
|
||||
|
||||
// Show more tabs from modules
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:MyModule:@mymodule:/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] = dol_buildpath(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][1] = $langs->trans($values[1]);
|
||||
$head[$h][2] = 'tab'.$values[1];
|
||||
$h++;
|
||||
}
|
||||
}
|
||||
|
||||
return $head;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user