diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php
index d2a46e2413d..f20dcad0319 100644
--- a/htdocs/comm/action/class/actioncomm.class.php
+++ b/htdocs/comm/action/class/actioncomm.class.php
@@ -655,8 +655,10 @@ class ActionComm extends CommonObject
{
if ($key == 'notolderthan') $sql.=" AND a.datep >= '".$this->db->idate($now-($value*24*60*60))."'";
if ($key == 'year') $sql.=" AND a.datep BETWEEN '".$this->db->idate(dol_get_first_day($value,1))."' AND '".$this->db->idate(dol_get_last_day($value,12))."'";
- if ($key == 'id') $sql.=' AND a.id='.$value;
- if ($key == 'login')
+ if ($key == 'id') $sql.=" AND a.id=".(is_numeric($value)?$value:0);
+ if ($key == 'idfrom') $sql.=" AND a.id >= ".(is_numeric($value)?$value:0);
+ if ($key == 'idto') $sql.=" AND a.id <= ".(is_numeric($value)?$value:0);
+ if ($key == 'login')
{
$login=$value;
$userforfilter=new User($this->db);
diff --git a/htdocs/lib/databases/pgsql.lib.php b/htdocs/lib/databases/pgsql.lib.php
index 05fbcebe039..900f6b406a3 100644
--- a/htdocs/lib/databases/pgsql.lib.php
+++ b/htdocs/lib/databases/pgsql.lib.php
@@ -504,14 +504,14 @@ class DoliDb
$ret = @pg_query($this->db, $query);
//print $query;
- if (! preg_match("/^COMMIT/i",$query) && ! preg_match("/^ROLLBACK/i",$query))
+ if (! preg_match("/^COMMIT/i",$query) && ! preg_match("/^ROLLBACK/i",$query)) // Si requete utilisateur, on la sauvegarde ainsi que son resultset
{
- // Si requete utilisateur, on la sauvegarde ainsi que son resultset
if (! $ret)
{
$this->lastqueryerror = $query;
$this->lasterror = $this->error();
$this->lasterrno = $this->errno();
+ dol_syslog("Postgresql request error: ".$query, LOG_ERR);
//print "\n>> ".$query."
\n";
//print '>> '.$this->lasterrno.' - '.$this->lasterror.' - '.$this->lastqueryerror."
\n";
diff --git a/htdocs/public/agenda/agendaexport.php b/htdocs/public/agenda/agendaexport.php
index 43d7ff85740..6020c384ca6 100644
--- a/htdocs/public/agenda/agendaexport.php
+++ b/htdocs/public/agenda/agendaexport.php
@@ -46,7 +46,9 @@ if (! empty($_GET["format"])) $format=$_GET["format"];
if (! empty($_GET["type"])) $type=$_GET["type"];
$filters=array();
if (! empty($_GET["year"])) $filters['year']=$_GET["year"];
-if (! empty($_GET["idaction"])) $filters['idaction']=$_GET["idaction"];
+if (! empty($_GET["id"])) $filters['id']=$_GET["id"];
+if (! empty($_GET["idfrom"])) $filters['idfrom']=$_GET["idfrom"];
+if (! empty($_GET["idto"])) $filters['idto']=$_GET["idto"];
if (! empty($_GET["login"])) $filters['login']=$_GET["login"];
if (! empty($_GET["logina"])) $filters['logina']=$_GET["logina"];
if (! empty($_GET["logint"])) $filters['logint']=$_GET["logint"];
@@ -85,8 +87,10 @@ $filename=$shortfilename;
foreach ($filters as $key => $value)
{
if ($key == 'year') $filename.='-year'.$value;
- if ($key == 'idaction') $filename.='-id'.$value;
- if ($key == 'login') $filename.='-login'.$value;
+ if ($key == 'id') $filename.='-id'.$value;
+ if ($key == 'idfrom') $filename.='-idfrom'.$value;
+ if ($key == 'idto') $filename.='-idto'.$value;
+ if ($key == 'login') $filename.='-login'.$value;
if ($key == 'logina') $filename.='-logina'.$value; // Author
if ($key == 'logind') $filename.='-logind'.$value; // Affected to
if ($key == 'logint') $filename.='-logint'.$value; // Done by