2
0
forked from Wavyzz/dolibarr

New: A module can add a new tab in third party view tabs

This commit is contained in:
Laurent Destailleur
2009-03-12 01:44:02 +00:00
parent 2570312475
commit 65f707dea0
11 changed files with 94 additions and 45 deletions

View File

@@ -75,6 +75,7 @@ For developers:
- Renamed all function dolibarr_xxx into dol_xxx to have same prefix everywhere. - Renamed all function dolibarr_xxx into dol_xxx to have same prefix everywhere.
- Rewrite clone feature for supplier invoice to work like other clone features. - Rewrite clone feature for supplier invoice to work like other clone features.
- First change to manage a future feature "stock PMP value". - First change to manage a future feature "stock PMP value".
- A module can add a new tab in third party view tabs.
***** Changelog for 2.5 compared to 2.4 ***** ***** Changelog for 2.5 compared to 2.4 *****

View File

@@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2009 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
@@ -90,8 +90,18 @@ class modMyModule extends DolibarrModules
//Example: $this->const=array(0=>array('MODULE_MY_NEW_CONST1','chaine','myvalue','This is a constant to add',0), //Example: $this->const=array(0=>array('MODULE_MY_NEW_CONST1','chaine','myvalue','This is a constant to add',0),
// 1=>array('MODULE_MY_NEW_CONST2','chaine','myvalue','This is another constant to add',0) ); // 1=>array('MODULE_MY_NEW_CONST2','chaine','myvalue','This is another constant to add',0) );
// New pages on tabs // Array to add new pages in new tabs
$this->tabs = array('entity:Title:@mymodule:/mymodule/mynewtab.php?id=__ID__'); $this->tabs = array('entity:Title:@mymodule:/mymodule/mynewtab.php?id=__ID__');
// where entity 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
// Boxes // Boxes

View File

@@ -81,8 +81,12 @@ class modAgenda extends DolibarrModules
//----------- //-----------
$this->const = array(); $this->const = array();
// Boites // New pages on tabs
//------- // -----------------
$this->tabs = array();
// Boxes
//------
$this->boxes = array(); $this->boxes = array();
$this->boxes[0][1] = "box_actions.php"; $this->boxes[0][1] = "box_actions.php";

View File

@@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com> * Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* *
@@ -27,10 +27,10 @@
*/ */
/** /**
* Enter description here... * Return array of tabs to used on pages for third parties cards.
* *
* @param unknown_type $objsoc * @param $objsoc Object company shown
* @return unknown * @return array Array of tabs
*/ */
function societe_prepare_head($objsoc) function societe_prepare_head($objsoc)
{ {
@@ -120,12 +120,30 @@ function societe_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['thirdparty']))
{
$i=0;
foreach ($conf->tabs_modules['thirdparty'] as $value)
{
$values=split(':',$value);
if ($values[2]) $langs->load($values[2]);
$head[$h][0] = eregi_replace('__ID__',$objsoc->id,$values[3]);
$head[$h][1] = $langs->trans($values[1]);
$head[$h][2] = 'tab'.$values[1];
$h++;
}
}
return $head; return $head;
} }
/** /**
* Enter description here... * Return array of tabs to used on page
* *
* @param unknown_type $objsoc * @param unknown_type $objsoc
* @return unknown * @return unknown

View File

@@ -68,7 +68,9 @@ function fichinter_prepare_head($fichinter)
$head[$h][2] = 'info'; $head[$h][2] = 'info';
$h++; $h++;
// More tabs from modules // 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['intervention'])) if (is_array($conf->tabs_modules['intervention']))
{ {
$i=0; $i=0;

View File

@@ -55,7 +55,9 @@ function facturefourn_prepare_head($fac)
$head[$h][2] = 'info'; $head[$h][2] = 'info';
$h++; $h++;
// More tabs from modules // 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['supplier_invoice'])) if (is_array($conf->tabs_modules['supplier_invoice']))
{ {
$i=0; $i=0;
@@ -114,7 +116,9 @@ function ordersupplier_prepare_head($commande)
$head[$h][2] = 'info'; $head[$h][2] = 'info';
$h++; $h++;
// More tabs from modules // 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['supplier_order'])) if (is_array($conf->tabs_modules['supplier_order']))
{ {
$i=0; $i=0;

View File

@@ -73,7 +73,9 @@ function facture_prepare_head($fac)
$head[$h][2] = 'info'; $head[$h][2] = 'info';
$h++; $h++;
// More tabs from modules // 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['invoice'])) if (is_array($conf->tabs_modules['invoice']))
{ {
$i=0; $i=0;

View File

@@ -65,7 +65,9 @@ function member_prepare_head($member)
$head[$h][2] = 'info'; $head[$h][2] = 'info';
$h++; $h++;
// More tabs from modules // 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['member'])) if (is_array($conf->tabs_modules['member']))
{ {
$i=0; $i=0;

View File

@@ -90,7 +90,9 @@ function commande_prepare_head($commande)
$head[$h][2] = 'info'; $head[$h][2] = 'info';
$h++; $h++;
// More tabs from modules // 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['order'])) if (is_array($conf->tabs_modules['order']))
{ {
$i=0; $i=0;

View File

@@ -118,7 +118,9 @@ function product_prepare_head($product, $user)
} }
} }
// More tabs from modules // 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['product'])) if (is_array($conf->tabs_modules['product']))
{ {
$i=0; $i=0;

View File

@@ -86,7 +86,9 @@ function propal_prepare_head($propal)
$head[$h][2] = 'info'; $head[$h][2] = 'info';
$h++; $h++;
// More tabs from modules // 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['propal'])) if (is_array($conf->tabs_modules['propal']))
{ {
$i=0; $i=0;