2
0
forked from Wavyzz/dolibarr

Qual: Mutualized code

This commit is contained in:
Laurent Destailleur
2011-01-24 23:35:21 +00:00
parent a029d1288f
commit 65a007a506
16 changed files with 196 additions and 351 deletions

View File

@@ -83,6 +83,14 @@ function societe_prepare_head($object)
$head[$h][2] = 'category';
$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
complete_head_from_modules($conf,$langs,$object,$head,$h,'thirdparty');
// Notes
if ($user->societe_id == 0)
{
$head[$h][0] = DOL_URL_ROOT.'/societe/socnote.php?socid='.$object->id;
@@ -90,6 +98,7 @@ function societe_prepare_head($object)
$head[$h][2] = 'note';
$h++;
}
// Attached files
if ($user->societe_id == 0)
{
$head[$h][0] = DOL_URL_ROOT.'/societe/document.php?socid='.$object->id;
@@ -97,6 +106,7 @@ function societe_prepare_head($object)
$head[$h][2] = 'document';
$h++;
}
// Notifications
if ($conf->notification->enabled && $user->societe_id == 0)
{
$head[$h][0] = DOL_URL_ROOT.'/societe/notify/fiche.php?socid='.$object->id;
@@ -104,25 +114,6 @@ function societe_prepare_head($object)
$head[$h][2] = 'notify';
$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['thirdparty']))
{
$i=0;
foreach ($conf->tabs_modules['thirdparty'] 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++;
}
}
// Log
if ($user->societe_id == 0)
{

View File

@@ -64,27 +64,18 @@ function contact_prepare_head($object)
$head[$h][2] = 'exportimport';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/contact/info.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,'contact');
$head[$h][0] = DOL_URL_ROOT.'/contact/info.php?id='.$object->id;
$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:/mymodule/mypage.php?id=__ID__');
if (is_array($conf->tabs_modules['contact']))
{
$i=0;
foreach ($conf->tabs_modules['contact'] 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;
}

View File

@@ -40,7 +40,13 @@ function contract_prepare_head($object)
$head[$h][2] = 'contact';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/contrat/note.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,'contract');
$head[$h][0] = DOL_URL_ROOT.'/contrat/note.php?id='.$object->id;
$head[$h][1] = $langs->trans("Note");
$head[$h][2] = 'note';
$h++;
@@ -55,23 +61,6 @@ function contract_prepare_head($object)
$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:/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] = 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;
}

View File

@@ -53,7 +53,13 @@ function fichinter_prepare_head($object)
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/fichinter/note.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,'intervention');
$head[$h][0] = DOL_URL_ROOT.'/fichinter/note.php?id='.$object->id;
$head[$h][1] = $langs->trans('Notes');
$head[$h][2] = 'note';
$h++;
@@ -63,28 +69,11 @@ function fichinter_prepare_head($object)
$head[$h][2] = 'documents';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/fichinter/info.php?id='.$object->id;
$head[$h][0] = DOL_URL_ROOT.'/fichinter/info.php?id='.$object->id;
$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:/mymodule/mypage.php?id=__ID__');
if (is_array($conf->tabs_modules['intervention']))
{
$i=0;
foreach ($conf->tabs_modules['intervention'] 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;
}

View File

@@ -40,7 +40,13 @@ function facturefourn_prepare_head($object)
$head[$h][2] = 'contact';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/fourn/facture/note.php?facid='.$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,'supplier_invoice');
$head[$h][0] = DOL_URL_ROOT.'/fourn/facture/note.php?facid='.$object->id;
$head[$h][1] = $langs->trans('Notes');
$head[$h][2] = 'note';
$h++;
@@ -59,23 +65,6 @@ function facturefourn_prepare_head($object)
$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:/mymodule/mypage.php?id=__ID__');
if (is_array($conf->tabs_modules['invoice_supplier']))
{
$i=0;
foreach ($conf->tabs_modules['invoice_supplier'] 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;
}
@@ -105,7 +94,13 @@ function ordersupplier_prepare_head($object)
$head[$h][2] = 'contact';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/note.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,'supplier_order');
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/note.php?id='.$object->id;
$head[$h][1] = $langs->trans("Notes");
$head[$h][2] = 'note';
$h++;
@@ -124,23 +119,6 @@ function ordersupplier_prepare_head($object)
$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:/mymodule/mypage.php?id=__ID__');
if (is_array($conf->tabs_modules['order_supplier']))
{
$i=0;
foreach ($conf->tabs_modules['order_supplier'] 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;
}

View File

@@ -3760,4 +3760,52 @@ function picto_from_langcode($codelang)
return $ret;
}
/**
* Complete a head array with value added by external modules
* @param conf Object conf
* @param langs Object langs
* @param object Object object
* @param head Object head
* @param h New position to fill
* @param type Value for object where objectvalue can be
* 'thirdparty' to add a tab in third party view
* 'intervention' to add a tab in intervention view
* 'supplier_order' to add a tab in supplier order view
* 'supplier_invoice' to add a tab in supplier invoice view
* 'invoice' to add a tab in customer invoice view
* 'order' to add a tab in customer order view
* '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
*/
function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type)
{
if (is_array($conf->tabs_modules['thirdparty']))
{
$i=0;
foreach ($conf->tabs_modules['thirdparty'] as $value)
{
$values=explode(':',$value);
if (sizeof($values) == 5) // new declaration
{
if ($values[0] != $type) continue;
if ($values[3]) $langs->load($values[3]);
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i',$object->id,$values[4]),1);
$head[$h][1] = $langs->trans($values[2]);
$head[$h][2] = str_replace('+','',$values[1]);
$h++;
}
else if (sizeof($values) == 4) // old declaration, for backward compatibility
{
if ($values[0] != $type) continue;
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++;
}
}
}
}
?>

View File

@@ -59,7 +59,13 @@ function facture_prepare_head($object)
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/note.php?facid='.$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,'invoice');
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/note.php?facid='.$object->id;
$head[$h][1] = $langs->trans('Notes');
$head[$h][2] = 'note';
$h++;
@@ -78,23 +84,6 @@ function facture_prepare_head($object)
$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:/mymodule/mypage.php?id=__ID__');
if (is_array($conf->tabs_modules['invoice']))
{
$i=0;
foreach ($conf->tabs_modules['invoice'] 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;
}

View File

@@ -64,7 +64,13 @@ function member_prepare_head($object)
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/adherents/note.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,'member');
$head[$h][0] = DOL_URL_ROOT.'/adherents/note.php?id='.$object->id;
$head[$h][1] = $langs->trans("Note");
$head[$h][2] = 'note';
$h++;
@@ -79,23 +85,6 @@ function member_prepare_head($object)
$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:/mymodule/mypage.php?id=__ID__');
if (is_array($conf->tabs_modules['member']))
{
$i=0;
foreach ($conf->tabs_modules['member'] 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;
}

View File

@@ -77,7 +77,13 @@ function commande_prepare_head($object)
$head[$h][2] = 'contact';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/commande/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,'order');
$head[$h][0] = DOL_URL_ROOT.'/commande/document.php?id='.$object->id;
/*$filesdir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($commande->ref);
include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php');
$listoffiles=dol_dir_list($filesdir,'files',1);
@@ -96,23 +102,6 @@ function commande_prepare_head($object)
$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:/mymodule/mypage.php?id=__ID__');
if (is_array($conf->tabs_modules['order']))
{
$i=0;
foreach ($conf->tabs_modules['order'] 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;
}

View File

@@ -36,7 +36,7 @@ function prelevement_prepare_head($object)
{
global $langs, $conf, $user;
$langs->load("withdrawals");
$h = 0;
$head = array();
@@ -73,23 +73,12 @@ function prelevement_prepare_head($object)
$head[$h][2] = 'statistics';
$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['prelevement']))
{
$i=0;
foreach ($conf->tabs_modules['prelevement'] 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++;
}
}
// 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,'prelevement');
return $head;
return $head;
}
?>

View File

@@ -105,38 +105,28 @@ function product_prepare_head($object, $user)
$head[$h][2] = 'referers';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/product/document.php?id='.$object->id;
if($object->isproduct()) // Si produit stockable
{
if ($conf->stock->enabled && $user->rights->stock->lire)
{
$head[$h][0] = DOL_URL_ROOT."/product/stock/product.php?id=".$object->id;
$head[$h][1] = $langs->trans("Stock");
$head[$h][2] = 'stock';
$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
complete_head_from_modules($conf,$langs,$object,$head,$h,'product');
$head[$h][0] = DOL_URL_ROOT.'/product/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
$head[$h][2] = 'documents';
$h++;
if($object->isproduct()) // Si produit stockable
{
if ($conf->stock->enabled && $user->rights->stock->lire)
{
$head[$h][0] = DOL_URL_ROOT."/product/stock/product.php?id=".$object->id;
$head[$h][1] = $langs->trans("Stock");
$head[$h][2] = 'stock';
$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['product']))
{
$i=0;
foreach ($conf->tabs_modules['product'] 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++;
}
}
// More tabs from canvas
if (is_array($object->onglets))

View File

@@ -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;
}

View File

@@ -72,7 +72,13 @@ function propal_prepare_head($object)
$head[$h][2] = 'contact';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.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,'propal');
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?id='.$object->id;
$head[$h][1] = $langs->trans('Notes');
$head[$h][2] = 'note';
$h++;
@@ -91,23 +97,6 @@ function propal_prepare_head($object)
$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:/mymodule/mypage.php?id=__ID__');
if (is_array($conf->tabs_modules['propal']))
{
$i=0;
foreach ($conf->tabs_modules['propal'] 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;
}

View File

@@ -49,26 +49,16 @@ function shipping_prepare_head($object)
$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['delivery']))
{
$i=0;
foreach ($conf->tabs_modules['delivery'] 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++;
}
}
// 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,'delivery');
return $head;
return $head;
}
function delivery_prepare_head($object)
{
global $langs, $conf, $user;
@@ -92,24 +82,13 @@ function delivery_prepare_head($object)
$head[$h][2] = 'delivery';
$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['delivery']))
{
$i=0;
foreach ($conf->tabs_modules['delivery'] 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++;
}
}
// 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,'delivery');
return $head;
return $head;
}
/**

View File

@@ -65,27 +65,16 @@ function stock_prepare_head($object)
}
*/
$head[$h][0] = DOL_URL_ROOT.'/product/stock/info.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,'stock');
$head[$h][0] = DOL_URL_ROOT.'/product/stock/info.php?id='.$object->id;
$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:/mymodule/mypage.php?id=__ID__');
if (is_array($conf->tabs_modules['stock']))
{
$i=0;
foreach ($conf->tabs_modules['stock'] 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;
}

View File

@@ -74,6 +74,12 @@ function user_prepare_head($object)
$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
complete_head_from_modules($conf,$langs,$object,$head,$h,'user');
if (! $user->societe_id)
{
$head[$h][0] = DOL_URL_ROOT.'/user/note.php?id='.$object->id;
@@ -87,23 +93,6 @@ function user_prepare_head($object)
$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['user']))
{
$i=0;
foreach ($conf->tabs_modules['user'] 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;
}
@@ -143,24 +132,13 @@ function group_prepare_head($object)
$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['group']))
{
$i=0;
foreach ($conf->tabs_modules['group'] 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++;
}
}
// 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,'group');
return $head;
return $head;
}
@@ -234,7 +212,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
{
// Disable not stable themes
if ($conf->global->MAIN_FEATURES_LEVEL < 1 && preg_match('/bureau2crea/i',$subdir)) continue;
if ($i % $thumbsbyrow == 0)
{
print '<tr '.$bc[$var].'>';