fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [16577]


From: nelson . guerra
Subject: [Fmsystem-commits] [16577]
Date: Wed, 12 Apr 2017 00:24:25 -0400 (EDT)

Revision: 16577
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16577
Author:   nelson224
Date:     2017-04-12 00:24:25 -0400 (Wed, 12 Apr 2017)
Log Message:
-----------


Modified Paths:
--------------
    branches/dev-syncromind-2/property/inc/class.soreport.inc.php

Modified: branches/dev-syncromind-2/property/inc/class.soreport.inc.php
===================================================================
--- branches/dev-syncromind-2/property/inc/class.soreport.inc.php       
2017-04-11 16:09:58 UTC (rev 16576)
+++ branches/dev-syncromind-2/property/inc/class.soreport.inc.php       
2017-04-12 04:24:25 UTC (rev 16577)
@@ -53,6 +53,7 @@
                                        (
                                        'id' => $this->db->f('id'),
                                        'dataset_id' => 
$this->db->f('dataset_id'),
+                                       'report_name' => 
$this->db->f('report_name'),
                                        'report_definition' => 
$this->db->f('report_definition')
                                );
                        }
@@ -76,7 +77,7 @@
                        }
                        else
                        {
-                               $ordermethod = " ORDER BY id DESC";
+                               $ordermethod = " ORDER BY a.id DESC";
                        }
 
                        $where = 'WHERE';
@@ -83,7 +84,7 @@
 
                        if ($dataset_id > 0)
                        {
-                               $filtermethod .= " $where 
fm_view_dataset.id={$dataset_id}";
+                               $filtermethod .= " $where 
a.dataset_id={$dataset_id}";
                                $where = 'AND';
                        }
 
@@ -90,11 +91,11 @@
                        if ($query)
                        {
                                $query = $this->db->db_addslashes($query);
-                               $querymethod = " $where ( 
fm_view_dataset.dataset_name {$this->like} '%$query%')";
+                               $querymethod = " $where ( b.dataset_name 
{$this->like} '%$query%' OR a.report_name {$this->like} '%$query%')";
                        }
 
-                       $sql = "SELECT fm_view_dataset_report.id, 
fm_view_dataset.dataset_name"
-                               . " FROM fm_view_dataset_report {$this->join} 
fm_view_dataset ON fm_view_dataset_report.dataset_id = fm_view_dataset.id"
+                       $sql = "SELECT a.id, a.report_name, b.dataset_name"
+                               . " FROM fm_view_dataset_report a {$this->join} 
fm_view_dataset b ON a.dataset_id = b.id"
                                . " {$filtermethod} {$querymethod}";
 
                        $sql_count = 'SELECT count(fm_view_dataset_report.id) 
AS cnt FROM fm_view_dataset_report';
@@ -117,6 +118,7 @@
                                $values[] = array
                                        (
                                        'id' => $this->db->f('id'),
+                                       'report_name' => 
$this->db->f('report_name'),
                                        'dataset_name' => 
$this->db->f('dataset_name')
                                );
                        }
@@ -326,6 +328,7 @@
                        $values_insert = array
                                (
                                'dataset_id' => $data['dataset_id'],
+                               'report_name' => $data['report_name'],
                                'report_definition' => 
json_encode($data['report_definition']),
                                'owner_id' => 
$GLOBALS['phpgw_info']['user']['account_id'],
                                'entry_date' => time()
@@ -356,6 +359,7 @@
                        $value_set = array
                                (
                                'dataset_id' => $data['dataset_id'],
+                               'report_name' => $data['report_name'],
                                'report_definition' => 
json_encode($data['report_definition']),
                                'owner_id' => 
$GLOBALS['phpgw_info']['user']['account_id'],
                                'entry_date' => time()
@@ -469,8 +473,8 @@
 
                        $this->db->transaction_begin();
                        
+                       $this->db->query("DELETE FROM fm_view_dataset_report 
WHERE dataset_id ='{$id}'", __LINE__, __FILE__);
                        $this->db->query("DELETE FROM fm_view_dataset WHERE id 
='{$id}'", __LINE__, __FILE__);
-                       $this->db->query("DELETE FROM fm_view_dataset_report 
WHERE dataset_id ='{$id}'", __LINE__, __FILE__);
 
                        if ($this->db->transaction_commit())
                        {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]