mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
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
|
||||
/* 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) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
* 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.
|
||||
*
|
||||
* $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<EFBFBD>curit<EFBFBD> d'acc<63>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<EFBFBD>d<EFBFBD>finis
|
||||
// Nombre de ligne pour choix de produit/service predefinis
|
||||
$NBLINES=4;
|
||||
|
||||
$form=new Form($db);
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (c) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (c) 2005-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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$
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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 ";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* 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) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user