diff --git a/htdocs/compta/charges.php b/htdocs/compta/charges.php deleted file mode 100644 index 72c1fca1772..00000000000 --- a/htdocs/compta/charges.php +++ /dev/null @@ -1,97 +0,0 @@ - - * Copyright (C) 2004-2005 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. - * - * $Id$ - */ - -/** - \file htdocs/compta/charges.php - \ingroup compta - \brief Page liste des charges sociales - \version $Revision$ -*/ - -require("./pre.inc.php"); - -$langs->load("compta"); -$langs->load("tax"); - - -/* - * Action ajout en bookmark - */ -if ($action == 'add_bookmark') { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."bookmark (fk_soc, dateb, fk_user) VALUES (".$socid.", ".$db->idate(mktime()).",".$user->id.");"; - if (! $db->query($sql) ) { - print $db->error(); - } -} - -if ($action == 'del_bookmark') { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."bookmark WHERE rowid=$bid"; - $result = $db->query($sql); -} - - - -llxHeader(); - -print_titre($langs->trans("Charges")); - -print ''; - -print ''; - -print '
'; - - -print ''; -print ""; -print ""; -print "\n"; - -$sql = "SELECT c.libelle as nom, sum(s.amount) as total"; -$sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c, ".MAIN_DB_PREFIX."chargesociales as s"; -$sql .= " WHERE s.fk_type = c.id AND s.paye = 1"; -$sql .= " GROUP BY lower(c.libelle) ASC"; - -if ( $db->query($sql) ) { - $num = $db->num_rows(); - $i = 0; - - while ($i < $num) { - $obj = $db->fetch_object(); - $var = !$var; - print ""; - print ''; - print ''; - $i++; - } -} else { - dolibarr_print_error($db); -} - - -print "
Factures
'.$obj->nom.''.price($obj->total).'

"; - -print '
'; - -$db->close(); - -llxFooter('$Date$ - $Revision$'); -?> diff --git a/htdocs/compta/sociales/charges.php b/htdocs/compta/sociales/charges.php index 3d6e3fdbf24..4f3af0eecf4 100644 --- a/htdocs/compta/sociales/charges.php +++ b/htdocs/compta/sociales/charges.php @@ -29,11 +29,14 @@ require(DOL_DOCUMENT_ROOT."/chargesociales.class.php"); $langs->load("compta"); $langs->load("bills"); -if (!$user->admin && !$user->rights->tax->charges) - accessforbidden(); - $chid=isset($_GET["id"])?$_GET["id"]:$_POST["id"]; +// Security check +$socid = isset($_GET["socid"])?$_GET["socid"]:''; +if ($user->societe_id) $socid=$user->societe_id; +$result = restrictedArea($user, 'tax', '', '', 'charges'); + + diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index e09386ce657..b44ceeb0e46 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -27,9 +27,10 @@ require("./pre.inc.php"); require(DOL_DOCUMENT_ROOT."/chargesociales.class.php"); - -if (!$user->admin && ! $user->rights->tax->charges->lire) - accessforbidden(); +// Security check +$socid = isset($_GET["socid"])?$_GET["socid"]:''; +if ($user->societe_id) $socid=$user->societe_id; +$result = restrictedArea($user, 'tax', '', '', 'charges'); $sortfield = isset($_GET["sortfield"])?$_GET["sortfield"]:$_POST["sortfield"]; diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index a5292b9e99b..317af8f7cc1 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -57,10 +57,15 @@ if($min == 0 or $min!=floatval(strval($min))){ $modetax = $conf->global->TAX_MODE; if ($_GET["modetax"]) $modetax=$_GET["modetax"]; +// Security check +$socid = isset($_GET["socid"])?$_GET["socid"]:''; +if ($user->societe_id) $socid=$user->societe_id; +$result = restrictedArea($user, 'tax', '', '', 'charges'); + /* - * Code + * View */ llxHeader(); @@ -184,8 +189,9 @@ if (is_array($coll_list)) } else { + $langs->load("errors"); if ($coll_list == -1) - print ''.$langs->trans("NoAccountancyModuleLoaded").''; + print ''.$langs->trans("ErrorNoAccountancyModuleLoaded").''; else if ($coll_list == -2) print ''.$langs->trans("FeatureNotYetAvailable").''; else @@ -255,8 +261,9 @@ if (is_array($coll_list)) } else { + $langs->load("errors"); if ($coll_list == -1) - print ''.$langs->trans("NoAccountancyModuleLoaded").''; + print ''.$langs->trans("ErrorNoAccountancyModuleLoaded").''; else if ($coll_list == -2) print ''.$langs->trans("FeatureNotYetAvailable").''; else diff --git a/htdocs/compta/tva/fiche.php b/htdocs/compta/tva/fiche.php index d4d34a974c1..706e8984360 100644 --- a/htdocs/compta/tva/fiche.php +++ b/htdocs/compta/tva/fiche.php @@ -35,6 +35,11 @@ $id=$_REQUEST["id"]; $mesg = ''; +// Security check +$socid = isset($_GET["socid"])?$_GET["socid"]:''; +if ($user->societe_id) $socid=$user->societe_id; +$result = restrictedArea($user, 'tax', '', '', 'charges'); + /** * Action ajout paiement tva diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index 76f837b4110..5d963cf576c 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -39,6 +39,11 @@ if ($year == 0 ) $year_start = $year; } +// Security check +$socid = isset($_GET["socid"])?$_GET["socid"]:''; +if ($user->societe_id) $socid=$user->societe_id; +$result = restrictedArea($user, 'tax', '', '', 'charges'); + /** @@ -200,7 +205,7 @@ function pt ($db, $sql, $date) /* - * + * View */ llxHeader(); diff --git a/htdocs/compta/tva/quadri.php b/htdocs/compta/tva/quadri.php index 6e5374c770f..0901ee4b1b8 100644 --- a/htdocs/compta/tva/quadri.php +++ b/htdocs/compta/tva/quadri.php @@ -40,6 +40,10 @@ if ($year == 0 ) $year_start = $year; } +// Security check +$socid = isset($_GET["socid"])?$_GET["socid"]:''; +if ($user->societe_id) $socid=$user->societe_id; +$result = restrictedArea($user, 'tax', '', '', 'charges'); /** @@ -168,8 +172,9 @@ function tva_paye($db, $y,$q) } } + /** - * Main script + * View */ llxHeader(); diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index c2352a5290c..346d72f407e 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -57,10 +57,15 @@ $q=(! empty($_GET["q"]))?$_GET["q"]:1; $modetax = $conf->global->TAX_MODE; if ($_GET["modetax"]) $modetax=$_GET["modetax"]; +// Security check +$socid = isset($_GET["socid"])?$_GET["socid"]:''; +if ($user->societe_id) $socid=$user->societe_id; +$result = restrictedArea($user, 'tax', '', '', 'charges'); -/** - * Affichage page + +/* + * View */ llxHeader(); @@ -151,8 +156,9 @@ $x_paye = vat_by_quarter($db, $y, $q, $modetax, 'buy'); if (! is_array($x_coll) || ! is_array($x_paye)) { + $langs->load("errors"); if ($x_coll == -1) - print ''.$langs->trans("NoAccountancyModuleLoaded").''; + print ''.$langs->trans("ErrorNoAccountancyModuleLoaded").''; else if ($x_coll == -2) print ''.$langs->trans("FeatureNotYetAvailable").''; else diff --git a/htdocs/compta/tva/reglement.php b/htdocs/compta/tva/reglement.php index 4c4be8b320f..85f06913425 100644 --- a/htdocs/compta/tva/reglement.php +++ b/htdocs/compta/tva/reglement.php @@ -30,6 +30,16 @@ require_once(DOL_DOCUMENT_ROOT."/compta/tva/tva.class.php"); $langs->load("compta"); $langs->load("compta"); +// Security check +$socid = isset($_GET["socid"])?$_GET["socid"]:''; +if ($user->societe_id) $socid=$user->societe_id; +$result = restrictedArea($user, 'tax', '', '', 'charges'); + + + +/* + * View + */ llxHeader(); diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index f6224e384a9..122476e6135 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -32,3 +32,4 @@ ErrorFieldCanNotContainSpecialCharacters=Field %s must not contains speci WarningAllowUrlFopenMustBeOn=Parameter allow_url_fopen must be set to on in filer php.ini for having this module working completely. You must modify this file manually. WarningBuildScriptNotRunned=Script %s was not yet ran to build graphics. WarningBookmarkAlreadyExists=A bookmark with this title or this target (URL) already exists. +ErrorNoAccountancyModuleLoaded=No accountancy module activated \ No newline at end of file diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang index f75734a44ab..4fb479c53b2 100644 --- a/htdocs/langs/fr_FR/errors.lang +++ b/htdocs/langs/fr_FR/errors.lang @@ -31,4 +31,5 @@ ErrorDirAlreadyExists=Un r ErrorFieldCanNotContainSpecialCharacters=Le champ %s ne peut contenir de caractères spéciaux. WarningAllowUrlFopenMustBeOn=Attention, le paramètre allow_url_fopen doit etre positionné à on dans le fichier php.ini pour que ce module soit pleinement opérationnel. Vous devez modifier ce fichier manuellement. WarningBuildScriptNotRunned=Le script %s n'a pas encore été lancé pour générer les graphiques. -WarningBookmarkAlreadyExists=Un marque-page avec ce titre ou cette destination (URL) existe déjà. \ No newline at end of file +WarningBookmarkAlreadyExists=Un marque-page avec ce titre ou cette destination (URL) existe déjà. +ErrorNoAccountancyModuleLoaded=Aucun module de comptabilité activé \ No newline at end of file