diff --git a/ChangeLog b/ChangeLog index 5afacc88e5a..a8f276f9c81 100644 --- a/ChangeLog +++ b/ChangeLog @@ -156,6 +156,9 @@ removed. You must now use the 6 parameters way. See file modMyModule.class.php f ***** 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 +Fix: [ bug #1752 ] Date filter of margins module, filters since 12H instead of 00H +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/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 0b0bc8c8a5c..6f494cb6f48 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -387,7 +387,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 @@ -397,7 +397,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 @@ -832,7 +832,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; diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index e5e6d70ba66..ab12b32716e 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 diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php index 7d1f4da5682..fe619531f48 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);