Deplace la fonction facture_prepare_head dans lib/invoice.lib.php de manière a ne l'avoir qu'une seule fois est centralisée.
This commit is contained in:
parent
bffc2d4db3
commit
0ef09f1a80
@ -33,6 +33,7 @@ require('./pre.inc.php');
|
|||||||
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php");
|
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/facture.class.php');
|
require_once(DOL_DOCUMENT_ROOT.'/facture.class.php');
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/paiement.class.php');
|
require_once(DOL_DOCUMENT_ROOT.'/paiement.class.php');
|
||||||
|
require_once(DOL_DOCUMENT_ROOT.'/lib/invoice.lib.php');
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/lib/CMailFile.class.php');
|
require_once(DOL_DOCUMENT_ROOT.'/lib/CMailFile.class.php');
|
||||||
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/project.class.php');
|
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/project.class.php');
|
||||||
if ($conf->propal->enabled) require_once(DOL_DOCUMENT_ROOT.'/propal.class.php');
|
if ($conf->propal->enabled) require_once(DOL_DOCUMENT_ROOT.'/propal.class.php');
|
||||||
|
|||||||
@ -30,6 +30,7 @@
|
|||||||
require ("./pre.inc.php");
|
require ("./pre.inc.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/facture.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/facture.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/contact.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/contact.class.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT.'/lib/invoice.lib.php');
|
||||||
|
|
||||||
$langs->load("facture");
|
$langs->load("facture");
|
||||||
// $langs->load("orders");
|
// $langs->load("orders");
|
||||||
|
|||||||
@ -28,6 +28,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT.'/lib/invoice.lib.php');
|
||||||
|
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
|
|
||||||
|
|||||||
@ -27,8 +27,9 @@
|
|||||||
\version $Revision$
|
\version $Revision$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT.'/lib/invoice.lib.php');
|
||||||
|
|
||||||
|
|
||||||
$user->getrights('facture');
|
$user->getrights('facture');
|
||||||
if (!$user->rights->facture->lire)
|
if (!$user->rights->facture->lire)
|
||||||
@ -74,10 +75,12 @@ if ($_GET["facid"])
|
|||||||
{
|
{
|
||||||
$soc = new Societe($db, $fac->socidp);
|
$soc = new Societe($db, $fac->socidp);
|
||||||
$soc->fetch($fac->socidp);
|
$soc->fetch($fac->socidp);
|
||||||
$head = facture_prepare_head($fac);
|
|
||||||
|
$head = facture_prepare_head($fac);
|
||||||
$hselected = 2;
|
$hselected = 2;
|
||||||
if ($conf->use_preview_tabs) $hselected++;
|
if ($conf->use_preview_tabs) $hselected++;
|
||||||
if ($fac->mode_reglement_code == 'PRE') $hselected++;
|
if ($fac->mode_reglement_code == 'PRE') $hselected++;
|
||||||
|
|
||||||
dolibarr_fiche_head($head, $hselected, $langs->trans("Bill")." : $fac->ref");
|
dolibarr_fiche_head($head, $hselected, $langs->trans("Bill")." : $fac->ref");
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -56,44 +56,4 @@ function llxHeader($head = "", $title="", $help_url='') {
|
|||||||
left_menu($menu->liste, $help_url);
|
left_menu($menu->liste, $help_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
function facture_prepare_head($fac)
|
|
||||||
{
|
|
||||||
global $langs, $conf;
|
|
||||||
$h = 0;
|
|
||||||
$head = array();
|
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/compta/facture.php?facid='.$fac->id;
|
|
||||||
$head[$h][1] = $langs->trans('CardBill');
|
|
||||||
$hselected = $h;
|
|
||||||
$h++;
|
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/contact.php?facid='.$fac->id;
|
|
||||||
$head[$h][1] = $langs->trans('Contact');
|
|
||||||
$h++;
|
|
||||||
|
|
||||||
if ($conf->use_preview_tabs)
|
|
||||||
{
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/apercu.php?facid='.$fac->id;
|
|
||||||
$head[$h][1] = $langs->trans('Preview');
|
|
||||||
$h++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($fac->mode_reglement_code == 'PRE')
|
|
||||||
{
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$fac->id;
|
|
||||||
$head[$h][1] = $langs->trans('StandingOrders');
|
|
||||||
$h++;
|
|
||||||
}
|
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/note.php?facid='.$fac->id;
|
|
||||||
$head[$h][1] = $langs->trans('Note');
|
|
||||||
$h++;
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/info.php?facid='.$fac->id;
|
|
||||||
$head[$h][1] = $langs->trans('Info');
|
|
||||||
$h++;
|
|
||||||
|
|
||||||
return $head;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<?PHP
|
<?php
|
||||||
/* Copyright (C) 2000-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2000-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
|||||||
70
htdocs/lib/invoice.lib.php
Normal file
70
htdocs/lib/invoice.lib.php
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2005 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
|
||||||
|
* 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, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
* or see http://www.gnu.org/
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
* $Source$
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
\file htdocs/lib/invoice.lib.php
|
||||||
|
\brief Ensemble de fonctions de base pour le module factures
|
||||||
|
\version $Revision$
|
||||||
|
|
||||||
|
Ensemble de fonctions de base de dolibarr sous forme d'include
|
||||||
|
*/
|
||||||
|
|
||||||
|
function facture_prepare_head($fac)
|
||||||
|
{
|
||||||
|
global $langs, $conf;
|
||||||
|
$h = 0;
|
||||||
|
$head = array();
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture.php?facid='.$fac->id;
|
||||||
|
$head[$h][1] = $langs->trans('CardBill');
|
||||||
|
$hselected = $h;
|
||||||
|
$h++;
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/contact.php?facid='.$fac->id;
|
||||||
|
$head[$h][1] = $langs->trans('BillContacts');
|
||||||
|
$h++;
|
||||||
|
|
||||||
|
if ($conf->use_preview_tabs)
|
||||||
|
{
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/apercu.php?facid='.$fac->id;
|
||||||
|
$head[$h][1] = $langs->trans('Preview');
|
||||||
|
$h++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($fac->mode_reglement_code == 'PRE')
|
||||||
|
{
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$fac->id;
|
||||||
|
$head[$h][1] = $langs->trans('StandingOrders');
|
||||||
|
$h++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/note.php?facid='.$fac->id;
|
||||||
|
$head[$h][1] = $langs->trans('Note');
|
||||||
|
$h++;
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/info.php?facid='.$fac->id;
|
||||||
|
$head[$h][1] = $langs->trans('Info');
|
||||||
|
$h++;
|
||||||
|
|
||||||
|
return $head;
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
@ -23,6 +23,42 @@ function autofilltownfromzip_save_refresh_create()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Pour les tooltips
|
||||||
|
//******************
|
||||||
|
|
||||||
|
function ShowTip(fArg)
|
||||||
|
{
|
||||||
|
var tooltipOBJ = (document.getElementById) ? document.getElementById('tt' + fArg) : eval("document.all['tt" + fArg + "']");
|
||||||
|
if (tooltipOBJ != null) {
|
||||||
|
var tooltipLft = (document.body.offsetwidth?document.body.offsetwidth:document.body.style.pixelWidth) - (tooltipOBJ.offsetWidth?tooltipOBJ.offsetWidth:(tooltipOBJ.style.pixelWidth?tooltipOBJ.style.pixelWidth:300)) - 30;
|
||||||
|
var tooltipTop = 10;
|
||||||
|
if (navigator.appName == 'Netscape') {
|
||||||
|
tooltipTop = (document.body.scrolltop>=0?document.body.scrolltop+10:event.clientY+10);
|
||||||
|
tooltipOBJ.style.top = tooltipTop+"px";
|
||||||
|
tooltipOBJ.style.left = tooltipLft+"px";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
tooltipTop = (document.body.scrolltop>=0?document.body.scrolltop+10:event.clientY+10);
|
||||||
|
tooltipTop = (document.body.scrollTop>=0?document.body.scrollTop+10:event.clientY+10);
|
||||||
|
|
||||||
|
if ((event.clientX > tooltipLft) && (event.clientY < (tooltipOBJ.scrollHeight?tooltipOBJ.scrollHeight:tooltipOBJ.style.pixelHeight) + 10)) {
|
||||||
|
tooltipTop = (document.body.scrolltop?document.body.scrolltop:document.body.offsetTop) + event.clientY + 20;
|
||||||
|
}
|
||||||
|
|
||||||
|
tooltipOBJ.style.left = tooltipLft;
|
||||||
|
tooltipOBJ.style.top = tooltipTop;
|
||||||
|
}
|
||||||
|
tooltipOBJ.style.visibility = "visible";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function HideTip(fArg)
|
||||||
|
{
|
||||||
|
var tooltipOBJ = (document.getElementById) ? document.getElementById('tt' + fArg) : eval("document.all['tt" + fArg + "']");
|
||||||
|
if (tooltipOBJ != null) {
|
||||||
|
tooltipOBJ.style.visibility = "hidden";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Pour la saisie des dates par calendrier
|
// Pour la saisie des dates par calendrier
|
||||||
// ***************************************
|
// ***************************************
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user