From 3ef00adb4ac9d06a9e8bbf47d787c64d96cb56e0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 27 Mar 2010 14:50:05 +0000 Subject: [PATCH] Remove pre.inc.php --- htdocs/compta/stats/comp.php | 7 +- htdocs/compta/stats/cumul.php | 124 --------------- htdocs/compta/stats/exercices.php | 254 ------------------------------ htdocs/contrat/contact.php | 2 +- htdocs/contrat/document.php | 2 +- htdocs/contrat/fiche.php | 2 +- htdocs/contrat/index.php | 2 +- htdocs/contrat/info.php | 2 +- htdocs/contrat/liste.php | 2 +- htdocs/contrat/note.php | 2 +- htdocs/contrat/pre.inc.php | 49 ------ htdocs/contrat/services.php | 2 +- htdocs/core/photos_resize.php | 2 +- htdocs/core/pre.inc.php | 41 ----- htdocs/core/searchpostalcode.php | 5 +- htdocs/docs/generate.php | 3 +- htdocs/docs/index.php | 2 +- htdocs/docs/pre.inc.php | 96 ----------- htdocs/domain/index.php | 2 +- htdocs/domain/pre.inc.php | 45 ------ htdocs/ecm/docdir.php | 2 +- htdocs/ecm/docfile.php | 2 +- htdocs/ecm/docmine.php | 2 +- htdocs/ecm/docother.php | 2 +- htdocs/ecm/index.php | 2 +- htdocs/ecm/pre.inc.php | 55 ------- htdocs/ecm/search.php | 2 +- 27 files changed, 26 insertions(+), 687 deletions(-) delete mode 100644 htdocs/compta/stats/cumul.php delete mode 100644 htdocs/compta/stats/exercices.php delete mode 100644 htdocs/contrat/pre.inc.php delete mode 100644 htdocs/core/pre.inc.php delete mode 100644 htdocs/docs/pre.inc.php delete mode 100644 htdocs/domain/pre.inc.php delete mode 100644 htdocs/ecm/pre.inc.php diff --git a/htdocs/compta/stats/comp.php b/htdocs/compta/stats/comp.php index 5273ec249b2..8fbcfa88f93 100644 --- a/htdocs/compta/stats/comp.php +++ b/htdocs/compta/stats/comp.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004 Laurent Destailleur + * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -22,6 +22,7 @@ * \file htdocs/compta/stats/comp.php * \ingroup commercial * \version $Id$ + * TODO Remove or add page in menus */ require('../../main.inc.php'); @@ -262,9 +263,9 @@ function ppt ($db, $year, $socid) print ""; print '"; + print ""; print ""; print '
'; - print "CA Pr�visionnel bas� sur les propal $year"; + print "CA Previsionnel base sur les propal $year"; - print "CA R�alis� $yearCA Realise $yearDelta $year
'; diff --git a/htdocs/compta/stats/cumul.php b/htdocs/compta/stats/cumul.php deleted file mode 100644 index a1d23f96e2a..00000000000 --- a/htdocs/compta/stats/cumul.php +++ /dev/null @@ -1,124 +0,0 @@ - - * Copyright (C) 2004-2005 Laurent Destailleur - * Copyright (C) 2005-2009 Regis Houssin - * - * 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. - */ - -/** - \file htdocs/compta/stats/cumul.php - \brief Page reporting compta chiffre affaire cumule - \version $Id$ -*/ - -require('../../main.inc.php'); - -// Security check -if ($user->societe_id > 0) -{ - $socid = $user->societe_id; -} - -// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES') -$modecompta = $conf->compta->mode; -if ($_GET["modecompta"]) $modecompta=$_GET["modecompta"]; - - - -llxHeader(); - - -print_titre("Chiffre d'affaire cumul� (".$langs->trans("Currency".$conf->monnaie)." HT)"); - -print '
'; - -$sql = "SELECT sum(f.total) as amount , date_format(f.datef,'%Y-%m') as dm"; -$sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; -$sql.= " WHERE f.fk_statut in (1,2)"; -$sql.= " AND f.entity = ".$conf->entity; -if ($modecompta != 'CREANCES-DETTES') $sql.= " AND f.paye = 1"; -if ($socid) $sql.= " AND f.fk_soc = ".$socid; -$sql.= " GROUP BY dm"; - -pt($db, $sql,"Suivi cumul par mois"); - -print ''; - -$sql = "SELECT sum(f.total) as amount, year(f.datef) as dm"; -$sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; -$sql.= " WHERE f.fk_statut in (1,2)"; -$sql.= " AND f.entity = ".$conf->entity; -if ($modecompta != 'CREANCES-DETTES') $sql.= " AND f.paye = 1"; -if ($socid) $sql.= " AND f.fk_soc = ".$socid; -$sql.= " GROUP BY dm"; - - -pt($db, $sql,"Suivi cumul par ann�e"); - -print "
"; - -$db->close(); - -llxFooter('$Date$ - $Revision$'); - - - -/* - * Fonctions - * - */ - -function pt ($db, $sql, $date) -{ - global $langs; - - $bc[0]="class=\"pair\""; - $bc[1]="class=\"impair\""; - - $resql = $db->query($sql); - if ($resql) - { - $num = $db->num_rows($resql); - $i = 0; $total = 0 ; - print ''; - print ""; - print ""; - print ""; - print "\n"; - print "\n"; - $var=True; - while ($i < $num) - { - $obj = $db->fetch_object($resql); - $var=!$var; - $total = $total + $obj->amount; - print ""; - print "\n"; - print "\n"; - print "\n"; - - $i++; - } - print "\n"; - - print "
$date".$langs->trans("Amount")."".$langs->trans("Total")."
$obj->dm".price($obj->amount)."".price($total)."
".$langs->trans("Total")." ".price($total)."
\n"; - $db->free($resql); - } -} - - -llxFooter('$Date$ - $Revision$'); -?> diff --git a/htdocs/compta/stats/exercices.php b/htdocs/compta/stats/exercices.php deleted file mode 100644 index a055d04f716..00000000000 --- a/htdocs/compta/stats/exercices.php +++ /dev/null @@ -1,254 +0,0 @@ - - * Copyright (C) 2004 Laurent Destailleur - * Copyright (C) 2005-2009 Regis Houssin - * - * 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. - */ - -/** - \file htdocs/compta/stats/exercices.php - \brief Page ??? - \version $Id$ -*/ - -require('../../main.inc.php'); - -// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES') -$modecompta = $conf->compta->mode; -if ($_GET["modecompta"]) $modecompta=$_GET["modecompta"]; - -// S�curit� acc�s client -if ($user->societe_id > 0) -{ - $socid = $user->societe_id; -} - - - -llxHeader(); - -print_titre("Comparatif CA ann�e en cours avec ann�e pr�c�dente (".$langs->trans("Currency".$conf->monnaie)." HT, ".$modecompta.")"); -print "
\n"; - - -function factures ($db, $year, $month, $paye) -{ - global $bc,$langs; - - $sql = "SELECT s.nom, s.rowid as socid, f.facnumber, f.total as amount,".$db->pdate("f.datef")." as df, f.paye, f.rowid as facid "; - $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; - $sql.= ", ".MAIN_DB_PREFIX."facture as f"; - $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND f.entity = ".$conf->entity; - $sql.= " AND f.paye = ".$paye; - $sql.= " AND date_format(f.datef, '%Y') = ".$year; - $sql.= " AND round(date_format(f.datef, '%m')) = ".$month; - $sql.= " ORDER BY f.datef DESC "; - - $result = $db->query($sql); - if ($result) { - $num = $db->num_rows(); - if ($num > 0) { - $i = 0; - print "

"; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print "\n"; - $var=True; - while ($i < $num) { - $objp = $db->fetch_object($result); - $var=!$var; - print ""; - print "\n"; - print "\n"; - if ($objp->df > 0 ) { - print "\n"; - } else { - print "\n"; - } - - print "\n"; - - $payes[1] = "oui"; - $payes[0] = "non"; - - - print "\n"; - print "\n"; - - $total = $total + $objp->amount; - - $i++; - } - print ""; - print "
Factures
SocieteNumDateMontantPay�
socid."\">".$objp->nom."facid."\">".$objp->facnumber."".dol_print_date($objp->df)."!!!".price($objp->amount)."".$payes[$objp->paye]."
".$langs->trans("Total")." : ".price($total)."
"; - $db->free(); - } - } -} - - -function pt ($db, $sql, $year) { - global $bc,$langs; - - $result = $db->query($sql); - if ($result) { - $num = $db->num_rows(); - $i = 0; $total = 0 ; - print ''; - print ""; - print ''; - print ''; - $var=True; - $month = 1 ; - - while ($i < $num) { - $obj = $db->fetch_object($result); - $var=!$var; - - if ($obj->dm > $month ) { - for ($b = $month ; $b < $obj->dm ; $b++) { - print ""; - print "\n"; - print "\n"; - print "\n"; - $var=!$var; - $ca[$b] = 0; - } - } - - if ($obj->sum > 0) { - print ""; - print "\n"; - print "\n"; - - print "\n"; - $month = $obj->dm + 1; - $ca[$obj->dm] = $obj->sum; - $total = $total + $obj->sum; - } - $i++; - } - - if ($num) { - $beg = $obj->dm; - } else { - $beg = 1 ; - } - - if ($beg <= 12 ) { - for ($b = $beg + 1 ; $b < 13 ; $b++) { - $var=!$var; - print ""; - print "\n"; - print "\n"; - print "\n"; - $ca[$b] = 0; - } - } - - print ""; - print "
'.$langs->trans("Month").''.$langs->trans("Amount").'
".dol_print_date(dol_mktime(12,0,0,$b, 1, $year),"%b")."0
"; - print dol_print_date(dol_mktime(12,0,0,$obj->dm, 1, $year),"%b")."".price($obj->sum)."
".dol_print_date(dol_mktime(12,0,0,$b, 1, $year),"%b")."0
Total :".price($total)."
"; - - $db->free(); - return $ca; - } else { - print $db->error(); - } -} - -function ppt ($db, $year, $socid) -{ - global $bc,$conf,$langs; - print ""; - - print ""; - print ''; - print "
"; - print "CA ".($year - 1); - - print "CA $yearDelta
"; - - $sql = "SELECT sum(f.total) as sum, round(date_format(f.datef, '%m')) as dm"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; - $sql.= " WHERE f.fk_statut in (1,2)"; - $sql.= " AND f.entity = ".$conf->entity; - $sql.= " AND date_format(f.datef,'%Y') = ".($year-1); - if ($conf->compta->mode != 'CREANCES-DETTES') $sql.= " AND f.paye = 1"; - if ($socid) $sql.= " AND f.fk_soc = ".$socid; - $sql.= " GROUP BY dm"; - - $prev = pt($db, $sql, $year - 1); - - print ""; - - $sql = "SELECT sum(f.total) as sum, round(date_format(f.datef, '%m')) as dm"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; - $sql.= " WHERE f.fk_statut in (1,2)"; - $sql.= " AND f.entity = ".$conf->entity; - $sql.= " AND date_format(f.datef,'%Y') = $year "; - if ($conf->compta->mode != 'CREANCES-DETTES') $sql.= " AND f.paye = 1"; - if ($socid) $sql.= " AND f.fk_soc = ".$socid; - $sql.= " GROUP BY dm"; - - $ca = pt($db, $sql, $year); - - print ""; - - print ''; - print ""; - print ''; - print ''; - print ''; - print "\n"; - - $var = 1 ; - for ($b = 1 ; $b <= 12 ; $b++) - { - $var=!$var; - - $delta = $ca[$b] - $prev[$b]; - $deltat = $deltat + $delta ; - print ""; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - } - - - print ''; - - print '
'.$langs->trans("Month").''.$langs->trans("Amount").'Cumul
".dol_print_date(dol_mktime(12,0,0,$b, 1, $year),"%b")."".price($delta)."".price($deltat)."
Total :'.price($deltat).'
'; - print '
'; - -} - - -$cyear = strftime ("%Y", time()); -ppt($db, $cyear, $socid); - -$db->close(); - - -llxFooter('$Date$ - $Revision$'); -?> diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index 70b8926fe56..ae5042c83f0 100644 --- a/htdocs/contrat/contact.php +++ b/htdocs/contrat/contact.php @@ -24,7 +24,7 @@ \version $Id$ */ -require ("./pre.inc.php"); +require ("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT.'/lib/contract.lib.php'); require_once(DOL_DOCUMENT_ROOT."/contrat/contrat.class.php"); require_once(DOL_DOCUMENT_ROOT."/contact/contact.class.php"); diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index a2fbe03153d..cb3912575fb 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -27,7 +27,7 @@ \version $Id$ */ -require('./pre.inc.php'); +require ("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/contract.lib.php"); require_once(DOL_DOCUMENT_ROOT."/contrat/contrat.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index d61d1e14511..a654d81874e 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -26,7 +26,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require ("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT.'/lib/contract.lib.php'); if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT."/projet/project.class.php"); if ($conf->propal->enabled) require_once(DOL_DOCUMENT_ROOT."/comm/propal/propal.class.php"); diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 33afb91a05e..e40969c9182 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -25,7 +25,7 @@ * \version $Revision$ */ -require("./pre.inc.php"); +require ("../main.inc.php"); require_once (DOL_DOCUMENT_ROOT."/contrat/contrat.class.php"); $langs->load("products"); diff --git a/htdocs/contrat/info.php b/htdocs/contrat/info.php index b7942dd1633..2c2f60b7910 100644 --- a/htdocs/contrat/info.php +++ b/htdocs/contrat/info.php @@ -23,7 +23,7 @@ \version $Id$ */ -require("./pre.inc.php"); +require ("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php"); require_once(DOL_DOCUMENT_ROOT.'/lib/contract.lib.php'); require_once(DOL_DOCUMENT_ROOT."/contrat/contrat.class.php"); diff --git a/htdocs/contrat/liste.php b/htdocs/contrat/liste.php index 926de196648..13fdd46b2a1 100644 --- a/htdocs/contrat/liste.php +++ b/htdocs/contrat/liste.php @@ -25,7 +25,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require ("../main.inc.php"); require_once (DOL_DOCUMENT_ROOT."/contrat/contrat.class.php"); $langs->load("contracts"); diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php index 5b47ffef578..a59872be017 100644 --- a/htdocs/contrat/note.php +++ b/htdocs/contrat/note.php @@ -24,7 +24,7 @@ \version $Id$ */ -require("./pre.inc.php"); +require ("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT.'/lib/contract.lib.php'); if ($conf->contrat->enabled) require_once(DOL_DOCUMENT_ROOT."/contrat/contrat.class.php"); diff --git a/htdocs/contrat/pre.inc.php b/htdocs/contrat/pre.inc.php deleted file mode 100644 index 6f0edff61aa..00000000000 --- a/htdocs/contrat/pre.inc.php +++ /dev/null @@ -1,49 +0,0 @@ - - * Copyright (C) 2005-2006 Laurent Destailleur - * - * 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. - */ - -/** - \file htdocs/contrat/pre.inc.php - \ingroup contrat - \brief Fichier de gestion du menu gauche de l'espace contrat - \version $Id$ -*/ - -require("../main.inc.php"); - -function llxHeader($head = '', $title='', $help_url='') -{ - global $user, $conf, $langs; - $langs->load("contracts"); - - top_menu($head); - - $menu = new Menu(); - - $menu->add(DOL_URL_ROOT."/contrat/index.php", $langs->trans("Contracts")); - $menu->add_submenu(DOL_URL_ROOT."/societe.php", $langs->trans("NewContract")); - $menu->add_submenu(DOL_URL_ROOT."/contrat/liste.php", $langs->trans("List")); - $menu->add_submenu(DOL_URL_ROOT."/contrat/services.php", $langs->trans("MenuServices")); - $menu->add_submenu(DOL_URL_ROOT."/contrat/services.php?mode=0", $langs->trans("MenuInactiveServices"), 2 , true); - $menu->add_submenu(DOL_URL_ROOT."/contrat/services.php?mode=4", $langs->trans("MenuRunningServices"), 2 , true); - $menu->add_submenu(DOL_URL_ROOT."/contrat/services.php?mode=4&filter=expired", $langs->trans("MenuExpiredServices"), 2 , true); - $menu->add_submenu(DOL_URL_ROOT."/contrat/services.php?mode=5", $langs->trans("MenuClosedServices"), 2 , true); - - left_menu($menu->liste, $help_url); -} -?> diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php index 1c3633099dc..8689d5b7e79 100644 --- a/htdocs/contrat/services.php +++ b/htdocs/contrat/services.php @@ -25,7 +25,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require ("../main.inc.php"); require_once (DOL_DOCUMENT_ROOT."/contrat/contrat.class.php"); require_once (DOL_DOCUMENT_ROOT."/product/product.class.php"); require_once (DOL_DOCUMENT_ROOT."/societe.class.php"); diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php index 174473781b5..38647492aee 100644 --- a/htdocs/core/photos_resize.php +++ b/htdocs/core/photos_resize.php @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -require("./pre.inc.php"); +require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/images.lib.php"); require_once(DOL_DOCUMENT_ROOT."/product/product.class.php"); diff --git a/htdocs/core/pre.inc.php b/htdocs/core/pre.inc.php deleted file mode 100644 index 327822b2326..00000000000 --- a/htdocs/core/pre.inc.php +++ /dev/null @@ -1,41 +0,0 @@ - - * Copyright (C) 2004-2010 Laurent Destailleur - * Copyright (C) 2007 Auguria SARL - * - * 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. - */ - -/** - * \file htdocs/core/pre.inc.php - * \ingroup core - * \brief Menu file - * \version $Id$ - */ -require("../main.inc.php"); - - - -function llxHeader($head = '',$help_url='', $title='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='') -{ - global $user, $conf, $langs; - - top_menu($head, $title, $target, $disablejs, $disablehead, $arrayofjs, $arrayofcss); - - $menu = new Menu(); - - left_menu($menu->liste, $help_url); -} -?> diff --git a/htdocs/core/searchpostalcode.php b/htdocs/core/searchpostalcode.php index 81f06df488d..892cdac25d1 100644 --- a/htdocs/core/searchpostalcode.php +++ b/htdocs/core/searchpostalcode.php @@ -37,7 +37,8 @@ * \brief Search the city corresponding to the ZIP code entered. 1st round is sought in the company table, if we have two customers in the same city that is direct. If the search never does anything then we start looking in the table of postcodes. * \version $Id$ */ -require("pre.inc.php"); + +require("../main.inc.php"); $langs->load("companies"); @@ -210,7 +211,7 @@ function run_request($table) } else $sql.= " cp != '' AND cp IS NOT NULL"; $sql.= " ORDER by fk_pays, ville, cp"; - $sql.= ' '.$db->plimit(50); // Avoid pb with bad criteria + $sql.= $db->plimit(50); // Avoid pb with bad criteria //print $sql.'
'; $result=$db->query($sql); diff --git a/htdocs/docs/generate.php b/htdocs/docs/generate.php index 0e0394422a5..b7b2e3719cf 100644 --- a/htdocs/docs/generate.php +++ b/htdocs/docs/generate.php @@ -23,7 +23,8 @@ \version $Id$ */ -require("./pre.inc.php"); +require("../main.inc.php"); + diff --git a/htdocs/docs/index.php b/htdocs/docs/index.php index eacde350700..63bb13083a3 100644 --- a/htdocs/docs/index.php +++ b/htdocs/docs/index.php @@ -23,7 +23,7 @@ * \version $Id$ */ -require("./pre.inc.php"); +require("../main.inc.php"); /* diff --git a/htdocs/docs/pre.inc.php b/htdocs/docs/pre.inc.php deleted file mode 100644 index 0b605fbe556..00000000000 --- a/htdocs/docs/pre.inc.php +++ /dev/null @@ -1,96 +0,0 @@ - - * - * 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. - */ - -/** - * \file htdocs/docs/pre.inc.php - * \brief Fichier gestionnaire du menu de gauche de l'accueil - * \version $Id$ - */ - -require_once("../main.inc.php"); - - -function llxHeader($head = "", $title="", $help_url='') -{ - global $user, $conf, $langs; - - top_menu($head); - - $menu = new Menu(); - - if (! empty($conf->societe->enabled) && $user->rights->societe->lire) - { - $langs->load("companies"); - $menu->add(DOL_URL_ROOT."/societe.php", $langs->trans("ThirdParties")); - - if ($user->rights->societe->creer) - { - $menu->add_submenu(DOL_URL_ROOT."/soc.php?action=create", $langs->trans("MenuNewThirdParty")); - } - - $menu->add_submenu(DOL_URL_ROOT."/contact/index.php",$langs->trans("Contacts")); - } - - if (! empty($conf->categorie->enabled)) - { - $langs->load("categories"); - $menu->add(DOL_URL_ROOT."/categories/index.php?type=0", $langs->trans("Categories")); - } - - if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire) - { - $langs->trans("interventions"); - $menu->add(DOL_URL_ROOT."/fichinter/index.php", $langs->trans("Interventions")); - } - - if (($conf->produit->enabled && $user->rights->produit->lire) || ($conf->service->enabled && $user->rights->service->lire)) - { - $langs->load("products"); - $chaine=""; - if ($conf->produit->enabled) { $chaine.= $langs->trans("Products"); } - if ($conf->produit->enabled && $conf->service->enabled) { $chaine.="/"; } - if ($conf->service->enabled) { $chaine.= $langs->trans("Services"); } - $menu->add(DOL_URL_ROOT."/product/index.php", "$chaine"); - - } - - - if ($conf->commande->enabled && $user->rights->commande->lire) - { - $langs->load("orders"); - $menu->add(DOL_URL_ROOT."/commande/index.php", $langs->trans("Orders")); - } - - if ($conf->document->enabled) - { - $menu->add(DOL_URL_ROOT."/docs/index.php", $langs->trans("DocumentsBuilder")); - $menu->add_submenu(DOL_URL_ROOT."/docs/generate.php", $langs->trans("Build")); - } - - - if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire) - { - $langs->load("suppliers"); - $menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers")); - } - - - - left_menu($menu->liste); -} -?> diff --git a/htdocs/domain/index.php b/htdocs/domain/index.php index e19ef7a0372..1a9c898633f 100644 --- a/htdocs/domain/index.php +++ b/htdocs/domain/index.php @@ -19,7 +19,7 @@ * $Id$ */ -require("./pre.inc.php"); +require("../main.inc.php"); /* diff --git a/htdocs/domain/pre.inc.php b/htdocs/domain/pre.inc.php deleted file mode 100644 index fc4c1c302a3..00000000000 --- a/htdocs/domain/pre.inc.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * 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. - * - * $Id$ - */ - -require_once("../main.inc.php"); - - -function llxHeader($head = "") { - global $user, $conf; - - /* - * - * - */ - top_menu($head); - - $menu = new Menu(); - - $menu->add("/comm/index.php", "Commercial"); - - $menu->add_submenu("/comm/clients.php", "Clients"); - - $menu->add_submenu("/compta/", "Factures"); - - - left_menu($menu->liste); - -} -?> diff --git a/htdocs/ecm/docdir.php b/htdocs/ecm/docdir.php index d29063c4b82..3a2e9bd67e7 100644 --- a/htdocs/ecm/docdir.php +++ b/htdocs/ecm/docdir.php @@ -25,7 +25,7 @@ * \author Laurent Destailleur */ -require("./pre.inc.php"); +require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/ecm/htmlecm.form.class.php"); require_once(DOL_DOCUMENT_ROOT."/ecm/ecmdirectory.class.php"); diff --git a/htdocs/ecm/docfile.php b/htdocs/ecm/docfile.php index 57bb94cd515..2c85d433ffa 100644 --- a/htdocs/ecm/docfile.php +++ b/htdocs/ecm/docfile.php @@ -24,7 +24,7 @@ * \author Laurent Destailleur */ -require("./pre.inc.php"); +require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/ecm/htmlecm.form.class.php"); require_once(DOL_DOCUMENT_ROOT."/ecm/ecmdirectory.class.php"); diff --git a/htdocs/ecm/docmine.php b/htdocs/ecm/docmine.php index e9bf095ef06..a3dcbbe388e 100644 --- a/htdocs/ecm/docmine.php +++ b/htdocs/ecm/docmine.php @@ -25,7 +25,7 @@ * \author Laurent Destailleur */ -require("./pre.inc.php"); +require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/ecm/ecmdirectory.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); diff --git a/htdocs/ecm/docother.php b/htdocs/ecm/docother.php index ce2a2400018..5c9a64d522c 100644 --- a/htdocs/ecm/docother.php +++ b/htdocs/ecm/docother.php @@ -10,7 +10,7 @@ \author Laurent Destailleur */ -require("./pre.inc.php"); +require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); // Load traductions files diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index 41b59536a69..2c7d8302495 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -25,7 +25,7 @@ * \author Laurent Destailleur */ -require("./pre.inc.php"); +require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/ecm.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); diff --git a/htdocs/ecm/pre.inc.php b/htdocs/ecm/pre.inc.php deleted file mode 100644 index 5cc7eb759b9..00000000000 --- a/htdocs/ecm/pre.inc.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * 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. - */ - -/** - * \file htdocs/ecm/pre.inc.php - * \ingroup ecm - * \brief File to manage left menu for ecm module - * \version $Id$ - */ - -require ("../main.inc.php"); - -$user->getrights('ecm'); - -function llxHeader($head = '', $title='', $help_url='', $morehtml='') -{ - global $conf,$langs,$user; - $langs->load("ecm"); - $langs->load("bills"); - $langs->load("propal"); - - top_menu($head, $title); - - $menu = new Menu(); - - $menu->add(DOL_URL_ROOT."/ecm/index.php?mainmenu=ecm&idmenu=".$_SESSION["idmenu"], $langs->trans("MenuECM"),0,$user->rights->ecm->download); - $menu->add_submenu(DOL_URL_ROOT."/ecm/index.php?mainmenu=ecm&idmenu=".$_SESSION["idmenu"], $langs->trans("List"),1,$user->rights->ecm->download); - //$menu->add_submenu(DOL_URL_ROOT."/ecm/index?mainmenu=ecm&action=create&idmenu=".$_SESSION["idmenu"], $langs->trans("ECMNewDocument"),1,$user->rights->ecm->upload); - - $menu->add_submenu(DOL_URL_ROOT."/ecm/search.php?mainmenu=ecm&idmenu=".$_SESSION["idmenu"], $langs->trans("Search"),1,$user->rights->ecm->download); - -/* if ($conf->societe->enabled) $menu->add_submenu(DOL_URL_ROOT."/ecm/docother.php?mainmenu=ecm&idmenu=".$_SESSION["idmenu"], $langs->trans("DocsThirdParties"),2); - if ($conf->contrat->enabled) $menu->add_submenu(DOL_URL_ROOT."/ecm/docother.php?mainmenu=ecm&idmenu=".$_SESSION["idmenu"], $langs->trans("DocsContracts"),2); - if ($conf->propal->enabled) $menu->add_submenu(DOL_URL_ROOT."/ecm/docother.php?mainmenu=ecm&idmenu=".$_SESSION["idmenu"], $langs->trans("DocsProposals"),2); - if ($conf->commande->enabled) $menu->add_submenu(DOL_URL_ROOT."/ecm/docother.php?mainmenu=ecm&idmenu=".$_SESSION["idmenu"], $langs->trans("DocsOrders"),2); - if ($conf->facture->enabled) $menu->add_submenu(DOL_URL_ROOT."/ecm/docother.php?mainmenu=ecm&idmenu=".$_SESSION["idmenu"], $langs->trans("DocsInvoices"),2); -*/ - left_menu($menu->liste, $help_url, $morehtml); -} -?> diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index 3c020f9f00f..059dd4170b1 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -25,7 +25,7 @@ * \author Laurent Destailleur */ -require("./pre.inc.php"); +require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/ecm.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");