Skip to content
Snippets Groups Projects
Commit d18770c1 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Merge remote-tracking branch 'origin/3.5' into 3.6

parents ade688b5 490b0c5f
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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;
......
......@@ -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
......
......@@ -3,6 +3,7 @@
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
*
* 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 = '&amp;type='.$type;
if ($type == 1) {
$title = $langs->trans("ListServiceByPopularity");
} else {
$title = $langs->trans("ListProductByPopularity");
if ($type == 1) $title = $langs->trans("ListServiceByPopularity");
}
}
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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment