diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index dd9dc9d3aab..e8a3d23c883 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -33,6 +33,7 @@ require('./pre.inc.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.'/paiement.class.php'); +require_once(DOL_DOCUMENT_ROOT.'/lib/invoice.lib.php'); require_once(DOL_DOCUMENT_ROOT.'/lib/CMailFile.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'); diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index 0ce9f742fc0..8c91ca25a8f 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -30,6 +30,7 @@ require ("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/facture.class.php"); require_once(DOL_DOCUMENT_ROOT."/contact.class.php"); +require_once(DOL_DOCUMENT_ROOT.'/lib/invoice.lib.php'); $langs->load("facture"); // $langs->load("orders"); diff --git a/htdocs/compta/facture/info.php b/htdocs/compta/facture/info.php index 790c0c86ec1..5f371bcff5c 100644 --- a/htdocs/compta/facture/info.php +++ b/htdocs/compta/facture/info.php @@ -28,6 +28,7 @@ */ require("./pre.inc.php"); +require_once(DOL_DOCUMENT_ROOT.'/lib/invoice.lib.php'); $langs->load("bills"); diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php index 0e2187194a3..124ccf88d65 100644 --- a/htdocs/compta/facture/note.php +++ b/htdocs/compta/facture/note.php @@ -27,8 +27,9 @@ \version $Revision$ */ - require("./pre.inc.php"); +require_once(DOL_DOCUMENT_ROOT.'/lib/invoice.lib.php'); + $user->getrights('facture'); if (!$user->rights->facture->lire) @@ -74,10 +75,12 @@ if ($_GET["facid"]) { $soc = new Societe($db, $fac->socidp); $soc->fetch($fac->socidp); - $head = facture_prepare_head($fac); + + $head = facture_prepare_head($fac); $hselected = 2; if ($conf->use_preview_tabs) $hselected++; if ($fac->mode_reglement_code == 'PRE') $hselected++; + dolibarr_fiche_head($head, $hselected, $langs->trans("Bill")." : $fac->ref"); diff --git a/htdocs/compta/facture/pre.inc.php b/htdocs/compta/facture/pre.inc.php index c3aa32f82b2..093a19c49e9 100644 --- a/htdocs/compta/facture/pre.inc.php +++ b/htdocs/compta/facture/pre.inc.php @@ -56,44 +56,4 @@ function llxHeader($head = "", $title="", $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; -} - - ?> diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php index 9e5a25982dd..e96fdcd4c5a 100644 --- a/htdocs/lib/functions.inc.php +++ b/htdocs/lib/functions.inc.php @@ -1,4 +1,4 @@ - * Copyright (C) 2003 Jean-Louis Bergamo * Copyright (C) 2004-2005 Laurent Destailleur diff --git a/htdocs/lib/invoice.lib.php b/htdocs/lib/invoice.lib.php new file mode 100644 index 00000000000..e03f7d1ae23 --- /dev/null +++ b/htdocs/lib/invoice.lib.php @@ -0,0 +1,70 @@ + + * + * 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; +} + +?> \ No newline at end of file diff --git a/htdocs/lib/lib.js b/htdocs/lib/lib.js index 2653a9fd698..ed4fefa3f00 100644 --- a/htdocs/lib/lib.js +++ b/htdocs/lib/lib.js @@ -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 // ***************************************