From 4996a4b2174feaa1e207a694e3a5e8657e36e726 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Apr 2013 12:23:12 +0200 Subject: [PATCH 1/4] Fix: regex not complete --- htdocs/core/class/menubase.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index 5ebccdeb1bd..6777c37b374 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -535,7 +535,7 @@ class Menubase if ($menu['perms']) { $tmpcond=$menu['perms']; - if ($leftmenu == 'all') $tmpcond=preg_replace('/\$leftmenu\s*==\s*["\'a-zA-Z]+/','1==1',$tmpcond); // Force part of condition to true + if ($leftmenu == 'all') $tmpcond=preg_replace('/\$leftmenu\s*==\s*["\'a-zA-Z_]+/','1==1',$tmpcond); // Force part of condition to true $perms = verifCond($tmpcond); //print "verifCond rowid=".$menu['rowid']." ".$tmpcond.":".$perms."
\n"; } @@ -545,7 +545,7 @@ class Menubase if ($menu['enabled']) { $tmpcond=$menu['enabled']; - if ($leftmenu == 'all') $tmpcond=preg_replace('/\$leftmenu\s*==\s*["\'a-zA-Z]+/','1==1',$tmpcond); // Force part of condition to true + if ($leftmenu == 'all') $tmpcond=preg_replace('/\$leftmenu\s*==\s*["\'a-zA-Z_]+/','1==1',$tmpcond); // Force part of condition to true $enabled = verifCond($tmpcond); if ($conf->use_javascript_ajax && ! empty($conf->global->MAIN_MENU_USE_JQUERY_ACCORDION) && preg_match('/^\$leftmenu/',$menu['enabled'])) $enabled=1; //print "verifCond rowid=".$menu['rowid']." ".$tmpcond.":".$enabled."
\n"; From 607ebbfe8b3ba0ff6486732001d6eded6eccf2f3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Apr 2013 19:42:21 +0200 Subject: [PATCH 2/4] Qual: Replace tab with div --- htdocs/adherents/stats/index.php | 12 +++++++----- htdocs/comm/propal/stats/index.php | 14 +++++++++----- htdocs/commande/stats/index.php | 15 +++++++++------ htdocs/compta/deplacement/stats/index.php | 14 +++++++++----- htdocs/compta/facture/stats/index.php | 14 +++++++++----- 5 files changed, 43 insertions(+), 26 deletions(-) diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index 8e19ce15ffe..c76be008596 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -143,8 +143,7 @@ $head = member_stats_prepare_head($adh); dol_fiche_head($head, 'statssubscription', $langs->trans("Statistics"), 0, 'user'); -print ''; -print '
'; +print '
'; // Show filter box /*print '
'; @@ -210,8 +209,8 @@ foreach ($data as $val) print '
'; -print ''; -print ''; +print '
'; + // Show graphs print '
'; @@ -223,7 +222,10 @@ else { } print '
'; -print ''; + +print '
'; +print '
'; + dol_fiche_end(); diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index a76b21a0371..acbccbba6f8 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -216,8 +216,9 @@ complete_head_from_modules($conf,$langs,null,$head,$h,'propal_stats'); dol_fiche_head($head,'byyear',$langs->trans("Statistics")); -print ''; -print '
'; + +print '
'; + //if (empty($socid)) //{ @@ -282,8 +283,8 @@ foreach ($data as $val) print '
'; -print ''; -print ''; +print '
'; + // Show graphs print '
'; @@ -297,7 +298,10 @@ else { } print '
'; -print ''; + +print '
'; +print '
'; + dol_fiche_end(); diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 1c8a52e201a..f8ab42c8807 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -1,6 +1,6 @@ - * Copyright (c) 2004-2012 Laurent Destailleur + * Copyright (c) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Marcos GarcĂ­a * @@ -237,8 +237,9 @@ complete_head_from_modules($conf,$langs,null,$head,$h,$type); dol_fiche_head($head,'byyear',$langs->trans("Statistics")); -print ''; -print '
'; + +print '
'; + //if (empty($socid)) //{ @@ -305,8 +306,8 @@ foreach ($data as $val) print '
'; -print ''; -print ''; +print '
'; + // Show graphs print '
'; @@ -320,7 +321,9 @@ else { } print '
'; -print ''; + +print '
'; +print '
'; dol_fiche_end(); diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index 2c8bf25fd5c..9e4fe35f3e9 100755 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -204,8 +204,9 @@ complete_head_from_modules($conf,$langs,null,$head,$h,'trip_stats'); dol_fiche_head($head,'byyear',$langs->trans("Statistics")); -print ''; -print '
'; + +print '
'; + // Show filter box print ''; @@ -266,8 +267,8 @@ foreach ($data as $val) print '
'; -print ''; -print ''; +print '
'; + // Show graphs print '
'; @@ -281,7 +282,10 @@ else { } print '
'; -print ''; + +print '
'; +print '
'; + dol_fiche_end(); diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 7fc43f1edfe..e51d012ebac 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -214,8 +214,9 @@ complete_head_from_modules($conf,$langs,null,$head,$h,$type); dol_fiche_head($head,'byyear',$langs->trans("Statistics")); -print ''; -print '
'; + +print '
'; + //if (empty($socid)) //{ @@ -280,8 +281,8 @@ foreach ($data as $val) print '
'; -print ''; -print ''; +print '
'; + // Show graphs print '
'; @@ -295,7 +296,10 @@ else { } print '
'; -print ''; + +print '
'; +print '
'; + dol_fiche_end(); From 58bb2df24c01dfd1bad158a53f48dc6765367e12 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Apr 2013 20:58:42 +0200 Subject: [PATCH 3/4] Qual: Uniformize columns --- htdocs/install/mysql/migration/3.3.0-3.4.0.sql | 1 + htdocs/install/mysql/tables/llx_socpeople.sql | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql index d36cd39c441..2055bc2b1ab 100755 --- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql +++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql @@ -210,3 +210,4 @@ ALTER TABLE llx_user ADD COLUMN fk_state integer DEFAULT 0; ALTER TABLE llx_user ADD COLUMN fk_country integer DEFAULT 0; ALTER TABLE llx_product_price ADD COLUMN import_key varchar(14) AFTER price_by_qty; +ALTER TABLE llx_socpeople ADD COLUMN ref_ext varchar(128) after entity; diff --git a/htdocs/install/mysql/tables/llx_socpeople.sql b/htdocs/install/mysql/tables/llx_socpeople.sql index 565e3b0cfee..4dbd835a7f8 100644 --- a/htdocs/install/mysql/tables/llx_socpeople.sql +++ b/htdocs/install/mysql/tables/llx_socpeople.sql @@ -25,6 +25,7 @@ create table llx_socpeople tms timestamp, fk_soc integer, -- lien vers la societe entity integer DEFAULT 1 NOT NULL, -- multi company id + ref_ext varchar(128), -- reference into an external system (not used by dolibarr) civilite varchar(6), lastname varchar(50), firstname varchar(50), From 677fb46136fbe2199af059c141952cf76d0f19f9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Apr 2013 21:13:51 +0200 Subject: [PATCH 4/4] Optimize size of graph --- htdocs/adherents/stats/index.php | 4 ++-- htdocs/comm/propal/stats/index.php | 4 ++-- htdocs/commande/stats/index.php | 4 ++-- htdocs/compta/deplacement/stats/index.php | 4 ++-- htdocs/compta/facture/stats/index.php | 4 ++-- htdocs/core/class/dolgraph.class.php | 17 ++++++++++++++++- htdocs/expedition/stats/month.php | 4 ++-- 7 files changed, 28 insertions(+), 13 deletions(-) diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index 8e19ce15ffe..ba32f7edf04 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -28,8 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherentstats.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; -$WIDTH=500; -$HEIGHT=200; +$WIDTH=DolGraph::getDefaultGraphSizeForStats('width'); +$HEIGHT=DolGraph::getDefaultGraphSizeForStats('height'); $userid=GETPOST('userid','int'); if ($userid < 0) $userid=0; $socid=GETPOST('socid','int'); if ($socid < 0) $socid=0; diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index a76b21a0371..7e0025d5ad0 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -28,8 +28,8 @@ require '../../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propalestats.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; -$WIDTH=500; -$HEIGHT=200; +$WIDTH=DolGraph::getDefaultGraphSizeForStats('width'); +$HEIGHT=DolGraph::getDefaultGraphSizeForStats('height'); $userid=GETPOST('userid','int'); if ($userid < 0) $userid=0; $socid=GETPOST('socid','int'); if ($socid < 0) $socid=0; diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 1c8a52e201a..440f8a6da28 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -29,8 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commandestats.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; -$WIDTH=500; -$HEIGHT=200; +$WIDTH=DolGraph::getDefaultGraphSizeForStats('width'); +$HEIGHT=DolGraph::getDefaultGraphSizeForStats('height'); $mode=GETPOST("mode")?GETPOST("mode"):'customer'; if ($mode == 'customer' && ! $user->rights->commande->lire) accessforbidden(); diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index 2c8bf25fd5c..75f059751a3 100755 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -29,8 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacementstats.class $langs->load("trips"); -$WIDTH=500; -$HEIGHT=200; +$WIDTH=DolGraph::getDefaultGraphSizeForStats('width'); +$HEIGHT=DolGraph::getDefaultGraphSizeForStats('height'); $userid=GETPOST('userid','int'); if ($userid < 0) $userid=0; $socid=GETPOST('socid','int'); if ($socid < 0) $socid=0; diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 7fc43f1edfe..733d8f467c5 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -27,8 +27,8 @@ require '../../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php'; -$WIDTH=500; -$HEIGHT=200; +$WIDTH=DolGraph::getDefaultGraphSizeForStats('width'); +$HEIGHT=DolGraph::getDefaultGraphSizeForStats('height'); $mode=GETPOST("mode")?GETPOST("mode"):'customer'; if ($mode == 'customer' && ! $user->rights->facture->lire) accessforbidden(); diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 087fd03b237..dd512b25f02 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -785,7 +785,7 @@ class DolGraph $this->_stringtoshow =''."\n"; $this->_stringtoshow.='
'.$this->title.'

'; - $this->_stringtoshow.='
'."\n"; + $this->_stringtoshow.='
'."\n"; $this->_stringtoshow.='