2
0
forked from Wavyzz/dolibarr
This commit is contained in:
Laurent Destailleur
2012-02-04 10:48:47 +01:00
parent c93488e078
commit 62a356b6eb
20 changed files with 218 additions and 133 deletions

View File

@@ -500,9 +500,9 @@ function dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $not
/**
* Define head array for tabs of security setup pages
* Prepare array with list of tabs
*
* @return array Array of head
* @return array Array of tabs to shoc
*/
function security_prepare_head()
{

View File

@@ -356,9 +356,9 @@ function show_array_last_actions_done($max=5)
/**
* Define head array for tabs of agenda setup pages
* Prepare array with list of tabs
*
* @return Array of head
* @return array Array of tabs to shoc
*/
function agenda_prepare_head()
{
@@ -386,28 +386,29 @@ function agenda_prepare_head()
}
/**
* Define head array for tabs of agenda setup pages
* @param action Object action
* @return Array of head
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to shoc
*/
function actions_prepare_head($action)
function actions_prepare_head($object)
{
global $langs, $conf, $user;
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/comm/action/fiche.php?id='.$action->id;
$head[$h][0] = DOL_URL_ROOT.'/comm/action/fiche.php?id='.$object->id;
$head[$h][1] = $langs->trans("CardAction");
$head[$h][2] = 'card';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/comm/action/document.php?id='.$action->id;
$head[$h][0] = DOL_URL_ROOT.'/comm/action/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
$head[$h][2] = 'documents';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/comm/action/info.php?id='.$action->id;
$head[$h][0] = DOL_URL_ROOT.'/comm/action/info.php?id='.$object->id;
$head[$h][1] = $langs->trans('Info');
$head[$h][2] = 'info';
$h++;

View File

@@ -22,51 +22,57 @@
* \ingroup banque
*/
function bank_prepare_head($obj)
/**
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to shoc
*/
function bank_prepare_head($object)
{
global $langs, $conf, $user;
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/compta/bank/fiche.php?id='.$obj->id;
$head[$h][0] = DOL_URL_ROOT.'/compta/bank/fiche.php?id='.$object->id;
$head[$h][1] = $langs->trans("AccountCard");
$head[$h][2] = 'bankname';
$h++;
if ($obj->type == 0 || $obj->type == 1)
if ($object->type == 0 || $object->type == 1)
{
$head[$h][0] = DOL_URL_ROOT.'/compta/bank/bankid_fr.php?id='.$obj->id;
$head[$h][0] = DOL_URL_ROOT.'/compta/bank/bankid_fr.php?id='.$object->id;
$head[$h][1] = $langs->trans("RIB");
$head[$h][2] = 'bankid';
$h++;
}
$head[$h][0] = DOL_URL_ROOT."/compta/bank/account.php?account=".$obj->id;
$head[$h][0] = DOL_URL_ROOT."/compta/bank/account.php?account=".$object->id;
$head[$h][1] = $langs->trans("Transactions");
$head[$h][2] = 'journal';
$h++;
// if ($conf->global->MAIN_FEATURES_LEVEL >= 1)
// {
$head[$h][0] = DOL_URL_ROOT."/compta/bank/treso.php?account=".$obj->id;
$head[$h][0] = DOL_URL_ROOT."/compta/bank/treso.php?account=".$object->id;
$head[$h][1] = $langs->trans("PlannedTransactions");
$head[$h][2] = 'cash';
$h++;
// }
$head[$h][0] = DOL_URL_ROOT."/compta/bank/annuel.php?account=".$obj->id;
$head[$h][0] = DOL_URL_ROOT."/compta/bank/annuel.php?account=".$object->id;
$head[$h][1] = $langs->trans("IOMonthlyReporting");
$head[$h][2] = 'annual';
$h++;
$head[$h][0] = DOL_URL_ROOT."/compta/bank/graph.php?account=".$obj->id;
$head[$h][0] = DOL_URL_ROOT."/compta/bank/graph.php?account=".$object->id;
$head[$h][1] = $langs->trans("Graph");
$head[$h][2] = 'graph';
$h++;
if ($obj->courant != 2)
if ($object->courant != 2)
{
$head[$h][0] = DOL_URL_ROOT."/compta/bank/releve.php?account=".$obj->id;
$head[$h][0] = DOL_URL_ROOT."/compta/bank/releve.php?account=".$object->id;
$head[$h][1] = $langs->trans("AccountStatements");
$head[$h][2] = 'statement';
$h++;

View File

@@ -22,6 +22,12 @@
* \ingroup categorie
*/
/**
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to shoc
*/
function categories_prepare_head($object,$type)
{
global $langs, $conf, $user;

View File

@@ -23,10 +23,10 @@
*/
/**
* Enter description here...
* Prepare array with list of tabs
*
* @param $object
* @return array
* @param Object $object Object related to tabs
* @return array Array of tabs to shoc
*/
function contact_prepare_head($object)
{

View File

@@ -22,6 +22,12 @@
* \brief Ensemble de fonctions de base pour le module contrat
*/
/**
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to shoc
*/
function contract_prepare_head($object)
{
global $langs, $conf;

View File

@@ -22,29 +22,29 @@
*/
/**
* Enter description here...
* Prepare array with list of tabs
*
* @param $mil
* @return array
* @param Object $object Object related to tabs
* @return array Array of tabs to shoc
*/
function emailing_prepare_head($mil)
function emailing_prepare_head($object)
{
global $langs, $conf;
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT."/comm/mailing/fiche.php?id=".$mil->id;
$head[$h][0] = DOL_URL_ROOT."/comm/mailing/fiche.php?id=".$object->id;
$head[$h][1] = $langs->trans("MailCard");
$head[$h][2] = 'card';
$h++;
$head[$h][0] = DOL_URL_ROOT."/comm/mailing/cibles.php?id=".$mil->id;
$head[$h][0] = DOL_URL_ROOT."/comm/mailing/cibles.php?id=".$object->id;
$head[$h][1] = $langs->trans("MailRecipients");
$head[$h][2] = 'targets';
$h++;
$head[$h][0] = DOL_URL_ROOT."/comm/mailing/info.php?id=".$mil->id;
$head[$h][0] = DOL_URL_ROOT."/comm/mailing/info.php?id=".$object->id;
$head[$h][1] = $langs->trans("Info");
$head[$h][2] = 'info';
$h++;

View File

@@ -23,6 +23,12 @@
* \ingroup fichinter
*/
/**
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to shoc
*/
function fichinter_prepare_head($object)
{
global $langs, $conf, $user;

View File

@@ -24,10 +24,10 @@
*/
/**
* Initialize the array of tabs for supplier invoice
* Prepare array with list of tabs
*
* @param Facture $object Invoice object
* @return array Array of head tabs
* @param Object $object Object related to tabs
* @return array Array of tabs to shoc
*/
function facturefourn_prepare_head($object)
{
@@ -74,6 +74,12 @@ function facturefourn_prepare_head($object)
}
/**
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to shoc
*/
function ordersupplier_prepare_head($object)
{
global $langs, $conf;

View File

@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
@@ -25,6 +25,12 @@
* \ingroup commande
*/
/**
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to shoc
*/
function commande_prepare_head($object)
{
global $langs, $conf, $user;

View File

@@ -26,9 +26,10 @@
/**
* Prepare head for prelevement screen and return it
* @param object Object BonPrelevement
* @return array head
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to shoc
*/
function prelevement_prepare_head($object)
{

View File

@@ -24,6 +24,13 @@
* \ingroup product
*/
/**
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @param User $user Object user
* @return array Array of tabs to shoc
*/
function product_prepare_head($object, $user)
{
global $langs, $conf;

View File

@@ -1,22 +1,22 @@
<?php
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*/
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*/
/**
* \file htdocs/core/lib/project.lib.php
@@ -26,6 +26,12 @@
require_once(DOL_DOCUMENT_ROOT."/projet/class/project.class.php");
/**
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to shoc
*/
function project_prepare_head($object)
{
global $langs, $conf, $user;
@@ -94,9 +100,10 @@ function project_prepare_head($object)
/**
* \file htdocs/core/lib/project.lib.php
* \brief Ensemble de fonctions de base pour le module projet
* \ingroup societe
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to shoc
*/
function task_prepare_head($object)
{

View File

@@ -23,6 +23,12 @@
* \ingroup propal
*/
/**
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to shoc
*/
function propal_prepare_head($object)
{
global $langs, $conf, $user;

View File

@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2008-2009 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
@@ -24,6 +24,12 @@ require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
require_once(DOL_DOCUMENT_ROOT."/expedition/class/expedition.class.php");
/**
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to shoc
*/
function shipping_prepare_head($object)
{
global $langs, $conf, $user;
@@ -47,16 +53,22 @@ function shipping_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,'delivery');
// 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;
}
/**
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to shoc
*/
function delivery_prepare_head($object)
{
global $langs, $conf, $user;
@@ -80,13 +92,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:+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');
// 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;
}
/**
@@ -114,9 +126,9 @@ function show_list_sending_receive($origin='commande',$origin_id,$filter='')
$sql.= " FROM ".MAIN_DB_PREFIX."expeditiondet as ed";
$sql.= ", ".MAIN_DB_PREFIX."expedition as e";
$sql.= ", ".MAIN_DB_PREFIX.$origin."det as obj";
//if ($conf->livraison_bon->enabled) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."livraison as l ON l.fk_expedition = e.rowid LEFT JOIN ".MAIN_DB_PREFIX."livraisondet as ld ON ld.fk_livraison = l.rowid AND obj.rowid = ld.fk_origin_line";
//if ($conf->livraison_bon->enabled) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."livraison as l ON l.fk_expedition = e.rowid LEFT JOIN ".MAIN_DB_PREFIX."livraisondet as ld ON ld.fk_livraison = l.rowid AND obj.rowid = ld.fk_origin_line";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON obj.fk_product = p.rowid";
$sql.= " WHERE obj.fk_".$origin." = ".$origin_id;
$sql.= " WHERE obj.fk_".$origin." = ".$origin_id;
if ($filter) $sql.=$filter;
$sql.= " AND obj.rowid = ed.fk_origin_line";
$sql.= " AND ed.fk_expedition = e.rowid";
@@ -143,11 +155,11 @@ function show_list_sending_receive($origin='commande',$origin_id,$filter='')
print '<td align="center">'.$langs->trans("DateDeliveryPlanned").'</td>';
print '<td align="center">'.$langs->trans("QtyShipped").'</td>';
if ($conf->livraison_bon->enabled)
{
print '<td>'.$langs->trans("DeliveryOrder").'</td>';
//print '<td align="center">'.$langs->trans("QtyReceived").'</td>';
{
print '<td>'.$langs->trans("DeliveryOrder").'</td>';
//print '<td align="center">'.$langs->trans("QtyReceived").'</td>';
print '<td align="right">'.$langs->trans("DeliveryDate").'</td>';
}
}
print "</tr>\n";
$var=True;
@@ -163,27 +175,29 @@ function show_list_sending_receive($origin='commande',$origin_id,$filter='')
// Description
if ($objp->fk_product > 0)
{
// Define output language
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
{
$object = new $origin($db);
$object->fetch($origin_id);
$object->fetch_thirdparty();
$prod = new Product($db, $objp->fk_product);
$outputlangs = $langs;
$newlang='';
if (empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id'];
if (empty($newlang)) $newlang=$object->client->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
$label = (! empty($prod->multilangs[$outputlangs->defaultlang]["libelle"])) ? $prod->multilangs[$outputlangs->defaultlang]["libelle"] : $objp->product;
}
else
$label = $objp->product;
// Define output language
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
{
$object = new $origin($db);
$object->fetch($origin_id);
$object->fetch_thirdparty();
$prod = new Product($db, $objp->fk_product);
$outputlangs = $langs;
$newlang='';
if (empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id'];
if (empty($newlang)) $newlang=$object->client->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
$label = (! empty($prod->multilangs[$outputlangs->defaultlang]["libelle"])) ? $prod->multilangs[$outputlangs->defaultlang]["libelle"] : $objp->product;
}
else
{
$label = $objp->product;
}
print '<td>';

View File

@@ -22,10 +22,10 @@
*/
/**
* Prepare array for tabs of warehouses cards
* Prepare array with list of tabs
*
* @param $object
* @return array
* @param Object $object Object related to tabs
* @return array Array of tabs to shoc
*/
function stock_prepare_head($object)
{

View File

@@ -25,11 +25,11 @@
/**
* Prepare array for tabs of warehouses cards
*
* @param $object
* @return array
*/
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to shoc
*/
function tax_prepare_head($object)
{
global $langs, $conf;

View File

@@ -26,16 +26,16 @@
/**
* Return if a child id is in descendance of parentid
*
* @param $fulltree Full tree. Tree must be an array of records that looks like:
* id = id record
* id_mere = id record mother
* id_children = array of direct child id
* label = record label
* fullpath = Full path of id
* level = Level of record
* @param $parentid Parent id
* @param $childid Child id
* @return int 1=Yes, 0=No
* @param array $fulltree Full tree. Tree must be an array of records that looks like:
* id = id record
* id_mere = id record mother
* id_children = array of direct child id
* label = record label
* fullpath = Full path of id
* level = Level of record
* @param int $parentid Parent id
* @param int $childid Child id
* @return int 1=Yes, 0=No
*/
function is_in_subtree($fulltree,$parentid,$childid)
{
@@ -73,10 +73,11 @@ function is_in_subtree($fulltree,$parentid,$childid)
/**
* Show picto of a tree view
* @param fulltree Array of entries in correct order
* @param key Key of value to show picto
* @param selected Selected value
* @return array (0 or 1 if at least one of this level after, 0 or 1 if at least one of higher level after)
*
* @param array &$fulltree Array of entries in correct order
* @param string $key Key of value to show picto
* @param int $selected Selected value
* @return array (0 or 1 if at least one of this level after, 0 or 1 if at least one of higher level after)
*/
function tree_showpad(&$fulltree,$key,$selected=0)
{
@@ -141,8 +142,10 @@ function tree_showpad(&$fulltree,$key,$selected=0)
/**
* Show an element with correct offset
* @param $tab Array of all elements
* @param $rang Level of offset
*
* @param array $tab Array of all elements
* @param int $rang Level of offset
* @return void
*/
function tree_showline($tab,$rang)
{
@@ -212,9 +215,11 @@ function tree_showline($tab,$rang)
/**
* Recursive function to output menu tree
* @param $tab Array of elements
* @param $pere Id of parent
* @param $rang Level of element
*
* @param array $tab Array of elements
* @param int $pere Id of parent
* @param int $rang Level of element
* @return void
*/
function tree_recur($tab,$pere,$rang)
{

View File

@@ -22,10 +22,10 @@
*/
/**
* Enter description here...
* Prepare array with list of tabs
*
* @param $object
* @return array
* @param Object $object Object related to tabs
* @return array Array of tabs to shoc
*/
function trip_prepare_head($object)
{

View File

@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
*
* This program is free software; you can redistribute it and/or modify
@@ -22,6 +22,13 @@
* \file htdocs/core/lib/usergroups.lib.php
* \brief Ensemble de fonctions de base pour la gestion des utilisaterus et groupes
*/
/**
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to shoc
*/
function user_prepare_head($object)
{
global $langs, $conf, $user;
@@ -141,11 +148,12 @@ function group_prepare_head($object)
/**
* Show list of themes. Show all thumbs of themes
* Show list of themes. Show all thumbs of themes
*
* @param User $fuser User concerned or '' for global theme
* @param int $edit 1 to add edit form
* @param boolean $foruserprofile Show for user profile view
* @param User $fuser User concerned or '' for global theme
* @param int $edit 1 to add edit form
* @param boolean $foruserprofile Show for user profile view
* @return void
*/
function show_theme($fuser,$edit=0,$foruserprofile=false)
{