diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 8bfa60cdf12..d177637c139 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2007 Laurent Destailleur + * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005 Marc Barilley / Ocebo * Copyright (C) 2005-2007 Regis Houssin @@ -21,7 +21,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ */ /** @@ -53,6 +52,8 @@ if (isset($_GET["msg"])) { $mesg=urldecode($_GET["mesg"]); } $year=isset($_GET["year"])?$_GET["year"]:""; $month=isset($_GET["month"])?$_GET["month"]:""; +// Sécurité accés client +$module='propale'; if (isset($_GET["socid"])) { $objectid=$_GET["socid"]; @@ -66,10 +67,10 @@ else if (isset($_GET["propalid"]) && $_GET["propalid"] > 0) $dbtable='propal'; } -// S�curit� d'acc�s client et commerciaux +// Sécurité d'accès client et commerciaux $socid = restrictedArea($user, $module, $objectid, $dbtable); -// Nombre de ligne pour choix de produit/service pr�d�finis +// Nombre de ligne pour choix de produit/service predefinis $NBLINES=4; $form=new Form($db); diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index cb6fd0fd521..a602f41a526 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -73,7 +73,8 @@ if (! $mesg) $px->SetMaxValue($px->GetCeilMaxValue()); $px->SetWidth($WIDTH); $px->SetHeight($HEIGHT); - $px->SetShading(3); + $px->SetYLabel($langs->trans("NbOfProposals")); + $px->SetShading(3); $px->SetHorizTickIncrement(1); $px->SetPrecisionY(0); $px->mode='depth'; diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index befec35edb0..b87341f8e74 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -50,9 +50,10 @@ llxHeader(); print_fiche_titre($langs->trans("OrdersStatistics"), $mesg); $stats = new CommandeStats($db, $socid); - $year = strftime("%Y", time()); -$data = $stats->getNbByMonthWithPrevYear($year); +$startyear=$year-2; +$endyear=$year; +$data = $stats->getNbByMonthWithPrevYear($endyear,$startyear); // Création répertoire pour images générées $dir=$conf->commande->dir_temp; @@ -81,15 +82,22 @@ if (! $mesg) { $px->SetData($data); $px->SetPrecisionY(0); + $i=$startyear; + while ($i <= $endyear) + { + $legend[]=$i; + $i++; + } + $px->SetLegend($legend); $px->SetMaxValue($px->GetCeilMaxValue()); - $px->SetLegend(array($year - 1, $year)); $px->SetWidth($WIDTH); $px->SetHeight($HEIGHT); $px->SetYLabel($langs->trans("NbOfOrder")); $px->SetShading(3); $px->SetHorizTickIncrement(1); $px->SetPrecisionY(0); - $px->draw($filename); + $px->mode='depth'; + $px->draw($filename); } $rows = $stats->getNbByYear(); $num = sizeof($rows); diff --git a/htdocs/compta/facture/stats/facturestats.class.php b/htdocs/compta/facture/stats/facturestats.class.php index 25f3b43b521..930836eddd5 100644 --- a/htdocs/compta/facture/stats/facturestats.class.php +++ b/htdocs/compta/facture/stats/facturestats.class.php @@ -1,6 +1,6 @@ - * Copyright (c) 2005 Laurent Destailleur +/* Copyright (C) 2003 Rodolphe Quiedeville + * Copyright (c) 2005-2007 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 @@ -17,8 +17,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ - * */ /** diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 8f59c1dd21c..bd156e6f30f 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -46,7 +46,9 @@ print_fiche_titre($langs->trans("BillsStatistics"), $mesg); $stats = new FactureStats($db, $socid); $year = strftime("%Y", time()); -$data = $stats->getNbByMonthWithPrevYear($year); +$startyear=$year-2; +$endyear=$year; +$data = $stats->getNbByMonthWithPrevYear($endyear,$startyear); create_exdir($conf->facture->dir_temp); @@ -59,14 +61,22 @@ if (! $mesg) { $px->SetData($data); $px->SetPrecisionY(0); + $i=$startyear; + while ($i <= $endyear) + { + $legend[]=$i; + $i++; + } + $px->SetLegend($legend); $px->SetMaxValue($px->GetCeilMaxValue()); - $px->SetLegend(array($year - 1, $year)); $px->SetWidth($WIDTH); $px->SetHeight($HEIGHT); - $px->SetShading(3); + $px->SetYLabel($langs->trans("NbOfInvoices")); + $px->SetShading(3); $px->SetHorizTickIncrement(1); $px->SetPrecisionY(0); - $px->draw($filename); + $px->mode='depth'; + $px->draw($filename); } $sql = "SELECT count(*) as nb, date_format(datef,'%Y') as dm, sum(total) as total FROM ".MAIN_DB_PREFIX."facture WHERE fk_statut > 0 "; diff --git a/htdocs/compta/propal.php b/htdocs/compta/propal.php index aceb613bbf3..28ecc39e2e9 100644 --- a/htdocs/compta/propal.php +++ b/htdocs/compta/propal.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2007 Destailleur Laurent + * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2007 Regis Houssin * @@ -51,14 +51,14 @@ if ($page == -1) { $page = 0 ; } // Sécurité accés client $user->getrights('facture'); - -if (isset($_GET["socid"])) +$module='propale'; +if (! empty($_GET["socid"])) { $objectid=$_GET["socid"]; $module='societe'; $dbtable=''; } -else if (isset($_GET["propalid"]) && $_GET["propalid"] > 0) +else if (! empty($_GET["propalid"])) { $objectid=$_GET["propalid"]; $module='propale'; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 2c73d1e237a..9dd63ca6240 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -178,8 +178,11 @@ if (! isset($_SESSION["dol_login"])) // MODE HTTP (Basic) if ($test && in_array('http',$authmode) && ! $login) { - $login=$_SERVER["REMOTE_USER"]; - $test=false; + if (! empty($_SERVER["REMOTE_USER"])) + { + $login=$_SERVER["REMOTE_USER"]; + $test=false; + } } // MODE DOLIBARR diff --git a/htdocs/stats.class.php b/htdocs/stats.class.php index 3019f32cf80..2669f71261e 100644 --- a/htdocs/stats.class.php +++ b/htdocs/stats.class.php @@ -85,7 +85,7 @@ class Stats for ($i = 1 ; $i < 13 ; $i++) { - $data[$i-1] = array(ucfirst(substr(strftime("%b",mktime(12,12,12,$i,1,$year)),0,3)), $res[$i]); + $data[$i-1] = array(ucfirst(substr(strftime("%b",mktime(12,0,0,$i,1,$year)),0,3)), $res[$i]); } return $data;