From 1c2c1ff3d877d31d12d870d319a7318a9e18e4f5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Dec 2014 19:09:15 +0100 Subject: [PATCH 1/5] Update codesniffer to remove travis errors. --- dev/codesniffer/ruleset.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dev/codesniffer/ruleset.xml b/dev/codesniffer/ruleset.xml index 7e4ae92274c..2b4cda4184b 100755 --- a/dev/codesniffer/ruleset.xml +++ b/dev/codesniffer/ruleset.xml @@ -21,6 +21,9 @@ 0 + + 0 + 0 From 416f13c708cbfbff3e0ff0e1997867e3b37b9a0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 23 Dec 2014 16:00:04 +0100 Subject: [PATCH 2/5] Fix: [ bug #1752 ] Date filter of margins module, filters since 12H instead of 00H --- ChangeLog | 1 + htdocs/margin/agentMargins.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 949492346b2..d24728054e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.5.7 compared to 3.5.6 ***** Fix: Paypal link were broken dur to SSL v3 closed. +Fix: [ bug #1752 ] Date filter of margins module, filters since 12H instead of 00H ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index e618931ee77..da7bf758f1d 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -57,9 +57,9 @@ $pagenext = $page + 1; $startdate=$enddate=''; if (!empty($_POST['startdatemonth'])) - $startdate = dol_mktime(12, 0, 0, $_POST['startdatemonth'], $_POST['startdateday'], $_POST['startdateyear']); + $startdate = dol_mktime(0, 0, 0, $_POST['startdatemonth'], $_POST['startdateday'], $_POST['startdateyear']); if (!empty($_POST['enddatemonth'])) - $enddate = dol_mktime(12, 0, 0, $_POST['enddatemonth'], $_POST['enddateday'], $_POST['enddateyear']); + $enddate = dol_mktime(23, 59, 59, $_POST['enddatemonth'], $_POST['enddateday'], $_POST['enddateyear']); /* * View From f4def9ea288c0677117087f883e1625a01b1f358 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 26 Dec 2014 00:07:24 +0100 Subject: [PATCH 3/5] Fix: [ bug #1769 ] Error when installing to a PostgreSQL DB that contains numbers --- ChangeLog | 1 + htdocs/core/db/pgsql.class.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 949492346b2..48cc3247cb5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.5.7 compared to 3.5.6 ***** Fix: Paypal link were broken dur to SSL v3 closed. +Fix: [ bug #1769 ] Error when installing to a PostgreSQL DB that contains numbers ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index efb9888f8b3..3af1c4bef83 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -1021,7 +1021,7 @@ class DoliDBPgsql extends DoliDB // Test charset match LC_TYPE (pgsql error otherwise) //print $charset.' '.setlocale(LC_CTYPE,'0'); exit; - $sql='CREATE DATABASE '.$database.' OWNER '.$owner.' ENCODING \''.$charset.'\''; + $sql='CREATE DATABASE "'.$database.'" OWNER "'.$owner.'" ENCODING \''.$charset.'\''; dol_syslog($sql,LOG_DEBUG); $ret=$this->query($sql); return $ret; From 1d39c1acc22fdd7d2767fea7061b24b3242477d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 26 Dec 2014 00:12:16 +0100 Subject: [PATCH 4/5] Fix: [ bug #1768 ] PHP Warning when error connecting to a PostgreSQL server in install script --- htdocs/core/db/pgsql.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index efb9888f8b3..f0f1f0333c8 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -402,7 +402,7 @@ class DoliDBPgsql extends DoliDB if ((! empty($host) && $host == "socket") && ! defined('NOLOCALSOCKETPGCONNECT')) { $con_string = "dbname='".$name."' user='".$login."' password='".$passwd."'"; // $name may be empty - $this->db = pg_connect($con_string); + $this->db = @pg_connect($con_string); } // if local connection failed or not requested, use TCP/IP @@ -412,7 +412,7 @@ class DoliDBPgsql extends DoliDB if (! $port) $port = 5432; $con_string = "host='".$host."' port='".$port."' dbname='".$name."' user='".$login."' password='".$passwd."'"; - $this->db = pg_connect($con_string); + $this->db = @pg_connect($con_string); } // now we test if at least one connect method was a success From 8e47fe9e1c0d6983fdffcab77d927c3528dda030 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 26 Dec 2014 00:19:09 +0100 Subject: [PATCH 5/5] Fix: [ bug #1757 ] Sorting breaks product/service statistics --- ChangeLog | 1 + htdocs/product/popuprop.php | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 949492346b2..624f4ca15a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.5.7 compared to 3.5.6 ***** Fix: Paypal link were broken dur to SSL v3 closed. +Fix: [ bug #1757 ] Sorting breaks product/service statistics ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php index 5404dd1848a..b89fbc3b911 100644 --- a/htdocs/product/popuprop.php +++ b/htdocs/product/popuprop.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2005 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2014 Marcos GarcĂ­a * * 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 @@ -71,7 +72,9 @@ llxHeader('','',$helpurl); $sql = "SELECT count(*) as c"; $sql.= " FROM ".MAIN_DB_PREFIX."product"; $sql.= ' WHERE entity IN ('.getEntity('product', 1).')'; -if (isset($type)) $sql.= " AND fk_product_type = ".$type; +if ($type !== '') { + $sql.= " AND fk_product_type = ".$type; +} $result=$db->query($sql); if ($result) @@ -82,11 +85,14 @@ if ($result) $param = ''; $title = $langs->trans("ListProductServiceByPopularity"); -if (isset($type)) -{ +if ($type !== '') { $param = '&type='.$type; - $title = $langs->trans("ListProductByPopularity"); - if ($type == 1) $title = $langs->trans("ListServiceByPopularity"); + + if ($type == 1) { + $title = $langs->trans("ListServiceByPopularity"); + } else { + $title = $langs->trans("ListProductByPopularity"); + } } print_barre_liste($title, $page, "popuprop.php",$param,"","","",$num); @@ -106,7 +112,9 @@ $sql.= " FROM ".MAIN_DB_PREFIX."propaldet as pd"; $sql.= ", ".MAIN_DB_PREFIX."product as p"; $sql.= ' WHERE p.entity IN ('.getEntity('product', 1).')'; $sql.= " AND p.rowid = pd.fk_product"; -if (isset($type)) $sql.= " AND fk_product_type = ".$type; +if ($type !== '') { + $sql.= " AND fk_product_type = ".$type; +} $sql.= " GROUP BY (p.rowid)"; $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit, $offset);