Fix: Mode connexion http incompatible avec autres
Fix: Graph stats sur facture et commande avec artichow
This commit is contained in:
parent
536a5883e0
commit
85ae98ad58
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||||
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
||||||
@ -21,7 +21,6 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id$
|
||||||
* $Source$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -53,6 +52,8 @@ if (isset($_GET["msg"])) { $mesg=urldecode($_GET["mesg"]); }
|
|||||||
$year=isset($_GET["year"])?$_GET["year"]:"";
|
$year=isset($_GET["year"])?$_GET["year"]:"";
|
||||||
$month=isset($_GET["month"])?$_GET["month"]:"";
|
$month=isset($_GET["month"])?$_GET["month"]:"";
|
||||||
|
|
||||||
|
// Sécurité accés client
|
||||||
|
$module='propale';
|
||||||
if (isset($_GET["socid"]))
|
if (isset($_GET["socid"]))
|
||||||
{
|
{
|
||||||
$objectid=$_GET["socid"];
|
$objectid=$_GET["socid"];
|
||||||
@ -66,10 +67,10 @@ else if (isset($_GET["propalid"]) && $_GET["propalid"] > 0)
|
|||||||
$dbtable='propal';
|
$dbtable='propal';
|
||||||
}
|
}
|
||||||
|
|
||||||
// S<EFBFBD>curit<EFBFBD> d'acc<63>s client et commerciaux
|
// Sécurité d'accès client et commerciaux
|
||||||
$socid = restrictedArea($user, $module, $objectid, $dbtable);
|
$socid = restrictedArea($user, $module, $objectid, $dbtable);
|
||||||
|
|
||||||
// Nombre de ligne pour choix de produit/service pr<EFBFBD>d<EFBFBD>finis
|
// Nombre de ligne pour choix de produit/service predefinis
|
||||||
$NBLINES=4;
|
$NBLINES=4;
|
||||||
|
|
||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
|
|||||||
@ -73,6 +73,7 @@ if (! $mesg)
|
|||||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||||
$px->SetWidth($WIDTH);
|
$px->SetWidth($WIDTH);
|
||||||
$px->SetHeight($HEIGHT);
|
$px->SetHeight($HEIGHT);
|
||||||
|
$px->SetYLabel($langs->trans("NbOfProposals"));
|
||||||
$px->SetShading(3);
|
$px->SetShading(3);
|
||||||
$px->SetHorizTickIncrement(1);
|
$px->SetHorizTickIncrement(1);
|
||||||
$px->SetPrecisionY(0);
|
$px->SetPrecisionY(0);
|
||||||
|
|||||||
@ -50,9 +50,10 @@ llxHeader();
|
|||||||
print_fiche_titre($langs->trans("OrdersStatistics"), $mesg);
|
print_fiche_titre($langs->trans("OrdersStatistics"), $mesg);
|
||||||
|
|
||||||
$stats = new CommandeStats($db, $socid);
|
$stats = new CommandeStats($db, $socid);
|
||||||
|
|
||||||
$year = strftime("%Y", time());
|
$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
|
// Création répertoire pour images générées
|
||||||
$dir=$conf->commande->dir_temp;
|
$dir=$conf->commande->dir_temp;
|
||||||
@ -81,14 +82,21 @@ if (! $mesg)
|
|||||||
{
|
{
|
||||||
$px->SetData($data);
|
$px->SetData($data);
|
||||||
$px->SetPrecisionY(0);
|
$px->SetPrecisionY(0);
|
||||||
|
$i=$startyear;
|
||||||
|
while ($i <= $endyear)
|
||||||
|
{
|
||||||
|
$legend[]=$i;
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
$px->SetLegend($legend);
|
||||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||||
$px->SetLegend(array($year - 1, $year));
|
|
||||||
$px->SetWidth($WIDTH);
|
$px->SetWidth($WIDTH);
|
||||||
$px->SetHeight($HEIGHT);
|
$px->SetHeight($HEIGHT);
|
||||||
$px->SetYLabel($langs->trans("NbOfOrder"));
|
$px->SetYLabel($langs->trans("NbOfOrder"));
|
||||||
$px->SetShading(3);
|
$px->SetShading(3);
|
||||||
$px->SetHorizTickIncrement(1);
|
$px->SetHorizTickIncrement(1);
|
||||||
$px->SetPrecisionY(0);
|
$px->SetPrecisionY(0);
|
||||||
|
$px->mode='depth';
|
||||||
$px->draw($filename);
|
$px->draw($filename);
|
||||||
}
|
}
|
||||||
$rows = $stats->getNbByYear();
|
$rows = $stats->getNbByYear();
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (c) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (c) 2005-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* 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.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id$
|
||||||
* $Source$
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -46,7 +46,9 @@ print_fiche_titre($langs->trans("BillsStatistics"), $mesg);
|
|||||||
|
|
||||||
$stats = new FactureStats($db, $socid);
|
$stats = new FactureStats($db, $socid);
|
||||||
$year = strftime("%Y", time());
|
$year = strftime("%Y", time());
|
||||||
$data = $stats->getNbByMonthWithPrevYear($year);
|
$startyear=$year-2;
|
||||||
|
$endyear=$year;
|
||||||
|
$data = $stats->getNbByMonthWithPrevYear($endyear,$startyear);
|
||||||
|
|
||||||
create_exdir($conf->facture->dir_temp);
|
create_exdir($conf->facture->dir_temp);
|
||||||
|
|
||||||
@ -59,13 +61,21 @@ if (! $mesg)
|
|||||||
{
|
{
|
||||||
$px->SetData($data);
|
$px->SetData($data);
|
||||||
$px->SetPrecisionY(0);
|
$px->SetPrecisionY(0);
|
||||||
|
$i=$startyear;
|
||||||
|
while ($i <= $endyear)
|
||||||
|
{
|
||||||
|
$legend[]=$i;
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
$px->SetLegend($legend);
|
||||||
$px->SetMaxValue($px->GetCeilMaxValue());
|
$px->SetMaxValue($px->GetCeilMaxValue());
|
||||||
$px->SetLegend(array($year - 1, $year));
|
|
||||||
$px->SetWidth($WIDTH);
|
$px->SetWidth($WIDTH);
|
||||||
$px->SetHeight($HEIGHT);
|
$px->SetHeight($HEIGHT);
|
||||||
|
$px->SetYLabel($langs->trans("NbOfInvoices"));
|
||||||
$px->SetShading(3);
|
$px->SetShading(3);
|
||||||
$px->SetHorizTickIncrement(1);
|
$px->SetHorizTickIncrement(1);
|
||||||
$px->SetPrecisionY(0);
|
$px->SetPrecisionY(0);
|
||||||
|
$px->mode='depth';
|
||||||
$px->draw($filename);
|
$px->draw($filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2007 Destailleur Laurent <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
@ -51,14 +51,14 @@ if ($page == -1) { $page = 0 ; }
|
|||||||
|
|
||||||
// Sécurité accés client
|
// Sécurité accés client
|
||||||
$user->getrights('facture');
|
$user->getrights('facture');
|
||||||
|
$module='propale';
|
||||||
if (isset($_GET["socid"]))
|
if (! empty($_GET["socid"]))
|
||||||
{
|
{
|
||||||
$objectid=$_GET["socid"];
|
$objectid=$_GET["socid"];
|
||||||
$module='societe';
|
$module='societe';
|
||||||
$dbtable='';
|
$dbtable='';
|
||||||
}
|
}
|
||||||
else if (isset($_GET["propalid"]) && $_GET["propalid"] > 0)
|
else if (! empty($_GET["propalid"]))
|
||||||
{
|
{
|
||||||
$objectid=$_GET["propalid"];
|
$objectid=$_GET["propalid"];
|
||||||
$module='propale';
|
$module='propale';
|
||||||
|
|||||||
@ -177,10 +177,13 @@ if (! isset($_SESSION["dol_login"]))
|
|||||||
|
|
||||||
// MODE HTTP (Basic)
|
// MODE HTTP (Basic)
|
||||||
if ($test && in_array('http',$authmode) && ! $login)
|
if ($test && in_array('http',$authmode) && ! $login)
|
||||||
|
{
|
||||||
|
if (! empty($_SERVER["REMOTE_USER"]))
|
||||||
{
|
{
|
||||||
$login=$_SERVER["REMOTE_USER"];
|
$login=$_SERVER["REMOTE_USER"];
|
||||||
$test=false;
|
$test=false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// MODE DOLIBARR
|
// MODE DOLIBARR
|
||||||
if ($test && in_array('dolibarr',$authmode) && ! $login)
|
if ($test && in_array('dolibarr',$authmode) && ! $login)
|
||||||
|
|||||||
@ -85,7 +85,7 @@ class Stats
|
|||||||
|
|
||||||
for ($i = 1 ; $i < 13 ; $i++)
|
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;
|
return $data;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user