Can add tabs from an external module on all entities

This commit is contained in:
Laurent Destailleur 2008-12-11 20:12:44 +00:00
parent 02a4e8e1e0
commit f5931aa6f0
7 changed files with 230 additions and 126 deletions

View File

@ -16,19 +16,16 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* or see http://www.gnu.org/ * or see http://www.gnu.org/
*
* $Id$
* $Source$
*/ */
/** /**
\file htdocs/lib/fichinter.lib.php * \file htdocs/lib/fichinter.lib.php
\brief Ensemble de fonctions de base pour le module fichinter * \brief Ensemble de fonctions de base pour le module fichinter
\ingroup fichinter * \ingroup fichinter
\version $Revision$ * \version $Id$
*
Ensemble de fonctions de base de dolibarr sous forme d'include * Ensemble de fonctions de base de dolibarr sous forme d'include
*/ */
function fichinter_prepare_head($fichinter) function fichinter_prepare_head($fichinter)
{ {
@ -66,6 +63,21 @@ function fichinter_prepare_head($fichinter)
$head[$h][2] = 'info'; $head[$h][2] = 'info';
$h++; $h++;
// More tabs from modules
if (is_array($conf->tabs_modules['intervention']))
{
$i=0;
foreach ($conf->tabs_modules['intervention'] as $value)
{
$values=split(':',$value);
if ($values[2]) $langs->load($values[2]);
$head[$h][0] = eregi_replace('__ID__',$fichinter->id,$values[3]);
$head[$h][1] = $langs->trans($values[1]);
$head[$h][2] = 'tab'.$values[1];
$h++;
}
}
return $head; return $head;
} }

View File

@ -50,6 +50,21 @@ function facturefourn_prepare_head($fac)
$head[$h][2] = 'info'; $head[$h][2] = 'info';
$h++; $h++;
// More tabs from modules
if (is_array($conf->tabs_modules['supplier_invoice']))
{
$i=0;
foreach ($conf->tabs_modules['supplier_invoice'] as $value)
{
$values=split(':',$value);
if ($values[2]) $langs->load($values[2]);
$head[$h][0] = eregi_replace('__ID__',$fac->id,$values[3]);
$head[$h][1] = $langs->trans($values[1]);
$head[$h][2] = 'tab'.$values[1];
$h++;
}
}
return $head; return $head;
} }
@ -85,6 +100,21 @@ function ordersupplier_prepare_head($commande)
$head[$h][2] = 'info'; $head[$h][2] = 'info';
$h++; $h++;
// More tabs from modules
if (is_array($conf->tabs_modules['supplier_order']))
{
$i=0;
foreach ($conf->tabs_modules['supplier_order'] as $value)
{
$values=split(':',$value);
if ($values[2]) $langs->load($values[2]);
$head[$h][0] = eregi_replace('__ID__',$commande->id,$values[3]);
$head[$h][1] = $langs->trans($values[1]);
$head[$h][2] = 'tab'.$values[1];
$h++;
}
}
return $head; return $head;
} }

View File

@ -18,12 +18,13 @@
*/ */
/** /**
\file htdocs/lib/invoice.lib.php * \file htdocs/lib/invoice.lib.php
\brief Ensemble de fonctions de base pour le module factures * \brief Ensemble de fonctions de base pour le module factures
\version $Id$ * \ingroup invoice
* \version $Id$ *
Ensemble de fonctions de base de dolibarr sous forme d'include *
*/ * Ensemble de fonctions de base de dolibarr sous forme d'include
*/
function facture_prepare_head($fac) function facture_prepare_head($fac)
{ {
@ -72,6 +73,21 @@ function facture_prepare_head($fac)
$head[$h][2] = 'info'; $head[$h][2] = 'info';
$h++; $h++;
// More tabs from modules
if (is_array($conf->tabs_modules['invoice']))
{
$i=0;
foreach ($conf->tabs_modules['invoice'] as $value)
{
$values=split(':',$value);
if ($values[2]) $langs->load($values[2]);
$head[$h][0] = eregi_replace('__ID__',$fac->id,$values[3]);
$head[$h][1] = $langs->trans($values[1]);
$head[$h][2] = 'tab'.$values[1];
$h++;
}
}
return $head; return $head;
} }

View File

@ -15,18 +15,15 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* or see http://www.gnu.org/ * or see http://www.gnu.org/
*
* $Id$
* $Source$
*/ */
/** /**
\file htdocs/lib/member.lib.php * \file htdocs/lib/member.lib.php
\brief Ensemble de fonctions de base pour les adhérents * \brief Ensemble de fonctions de base pour les adhérents
\version $Revision$ * \version $Id$
*
Ensemble de fonctions de base de dolibarr sous forme d'include * Ensemble de fonctions de base de dolibarr sous forme d'include
*/ */
function member_prepare_head($member) function member_prepare_head($member)
{ {
@ -68,6 +65,21 @@ function member_prepare_head($member)
$head[$h][2] = 'info'; $head[$h][2] = 'info';
$h++; $h++;
// More tabs from modules
if (is_array($conf->tabs_modules['member']))
{
$i=0;
foreach ($conf->tabs_modules['member'] as $value)
{
$values=split(':',$value);
if ($values[2]) $langs->load($values[2]);
$head[$h][0] = eregi_replace('__ID__',$member->id,$values[3]);
$head[$h][1] = $langs->trans($values[1]);
$head[$h][2] = 'tab'.$values[1];
$h++;
}
}
return $head; return $head;
} }

View File

@ -90,6 +90,21 @@ function commande_prepare_head($commande)
$head[$h][2] = 'info'; $head[$h][2] = 'info';
$h++; $h++;
// More tabs from modules
if (is_array($conf->tabs_modules['order']))
{
$i=0;
foreach ($conf->tabs_modules['order'] as $value)
{
$values=split(':',$value);
if ($values[2]) $langs->load($values[2]);
$head[$h][0] = eregi_replace('__ID__',$commande->id,$values[3]);
$head[$h][1] = $langs->trans($values[1]);
$head[$h][2] = 'tab'.$values[1];
$h++;
}
}
return $head; return $head;
} }

View File

@ -21,8 +21,12 @@
/** /**
* \file htdocs/lib/product.lib.php * \file htdocs/lib/product.lib.php
* \brief Ensemble de fonctions de base pour le module produit et service * \brief Ensemble de fonctions de base pour le module produit et service
* \ingroup product
* \version $Id$ * \version $Id$
*
* Ensemble de fonctions de base de dolibarr sous forme d'include
*/ */
function product_prepare_head($product, $user) function product_prepare_head($product, $user)
{ {
global $langs, $conf; global $langs, $conf;

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -18,13 +18,13 @@
*/ */
/** /**
\file htdocs/lib/propal.lib.php * \file htdocs/lib/propal.lib.php
\brief Ensemble de fonctions de base pour le module propal * \brief Ensemble de fonctions de base pour le module propal
\ingroup propal * \ingroup propal
\version $Id$ * \version $Id$
*
Ensemble de fonctions de base de dolibarr sous forme d'include * Ensemble de fonctions de base de dolibarr sous forme d'include
*/ */
function propal_prepare_head($propal) function propal_prepare_head($propal)
{ {
@ -86,6 +86,21 @@ function propal_prepare_head($propal)
$head[$h][2] = 'info'; $head[$h][2] = 'info';
$h++; $h++;
// More tabs from modules
if (is_array($conf->tabs_modules['propal']))
{
$i=0;
foreach ($conf->tabs_modules['propal'] as $value)
{
$values=split(':',$value);
if ($values[2]) $langs->load($values[2]);
$head[$h][0] = eregi_replace('__ID__',$propal->id,$values[3]);
$head[$h][1] = $langs->trans($values[1]);
$head[$h][2] = 'tab'.$values[1];
$h++;
}
}
return $head; return $head;
} }