2011-06-15 Ramon Novoa <rnovoa@artica.es>

* pandoradb.oracle.sql: Removed unneeded code.

	* operation/events/events_list.php: Do not show duplicate messages when
	  grouping events.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4451 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
ramonn 2011-06-15 09:23:28 +00:00
parent 324102f2d7
commit 61c25ee46f
3 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2011-06-15 Ramon Novoa <rnovoa@artica.es>
* pandoradb.oracle.sql: Removed unneeded code.
* operation/events/events_list.php: Do not show duplicate messages when
grouping events.
2011-06-15 Sergio Martin <sergio.martin@artica.es>
* include/functions_events.php: Fixed repeated values into

View File

@ -270,7 +270,7 @@ if ($group_rep == 0) {
else {
switch ($config["dbtype"]) {
case "mysql":
$sql = "SELECT *, GROUP_CONCAT(user_comment SEPARATOR '') AS user_comment,
$sql = "SELECT *, GROUP_CONCAT(DISTINCT user_comment SEPARATOR '') AS user_comment,
MAX(estado) AS estado, COUNT(*) AS event_rep, MAX(utimestamp) AS timestamp_rep
FROM tevento
WHERE 1=1 ".$sql_post."
@ -278,7 +278,7 @@ else {
ORDER BY timestamp_rep DESC LIMIT ".$offset.",".$pagination;
break;
case "postgresql":
$sql = "SELECT *, array_to_string(array_agg(user_comment), '') AS user_comment,
$sql = "SELECT *, array_to_string(array_agg(DISTINCT user_comment), '') AS user_comment,
MAX(estado) AS estado, COUNT(*) AS event_rep, MAX(utimestamp) AS timestamp_rep
FROM tevento
WHERE 1=1 ".$sql_post."
@ -289,6 +289,7 @@ else {
$set = array();
$set['limit'] = $pagination;
$set['offset'] = $offset;
// TODO: Remove duplicate user comments
$sql = "SELECT a.*, b.event_rep, b.timestamp_rep
FROM (select * from tevento WHERE 1=1 ".$sql_post.") a,
(select min(id_evento) as id_evento, to_char(evento) as evento,

View File

@ -26,7 +26,6 @@
CREATE OR REPLACE FUNCTION UNIX_TIMESTAMP (oracletime IN DATE DEFAULT SYSDATE) RETURN INTEGER AS unixtime INTEGER; BEGIN unixtime := (oracletime - to_date('19700101','YYYYMMDD')) * 86400; RETURN unixtime; END;;
CREATE OR REPLACE FUNCTION NOW RETURN TIMESTAMP AS t_now TIMESTAMP; BEGIN SELECT LOCALTIMESTAMP INTO t_now FROM dual; RETURN t_now; END;;
CREATE AGGREGATE array_agg (anyelement) (sfunc = array_append, stype = anyarray, initcond = '{}');;
CREATE TABLE taddress (
id_a NUMBER(10, 0) NOT NULL PRIMARY KEY,