fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [6727] property: formatting / sql-fix


From: Sigurd Nes
Subject: [Fmsystem-commits] [6727] property: formatting / sql-fix
Date: Tue, 04 Jan 2011 10:01:50 +0000

Revision: 6727
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6727
Author:   sigurdne
Date:     2011-01-04 10:01:50 +0000 (Tue, 04 Jan 2011)
Log Message:
-----------
property: formatting / sql-fix

Modified Paths:
--------------
    trunk/property/inc/class.boalarm.inc.php
    trunk/property/inc/class.soalarm.inc.php
    trunk/property/inc/class.uialarm.inc.php

Modified: trunk/property/inc/class.boalarm.inc.php
===================================================================
--- trunk/property/inc/class.boalarm.inc.php    2011-01-04 07:32:40 UTC (rev 
6726)
+++ trunk/property/inc/class.boalarm.inc.php    2011-01-04 10:01:50 UTC (rev 
6727)
@@ -245,7 +245,7 @@
                {
                        if(!$method)
                        {
-                               $method = 'property' .'.boalarm.send_alarm';
+                               $method = 'property.boalarm.send_alarm';
                        }
 //                     echo "<p>save_alarm(event_id=$event_id, alarm="; 
print_r($alarm); echo ")</p>\n";
 

Modified: trunk/property/inc/class.soalarm.inc.php
===================================================================
--- trunk/property/inc/class.soalarm.inc.php    2011-01-04 07:32:40 UTC (rev 
6726)
+++ trunk/property/inc/class.soalarm.inc.php    2011-01-04 10:01:50 UTC (rev 
6727)
@@ -77,32 +77,35 @@
 
                function read($data)
                {
-                       if(is_array($data))
+                       $id                     = isset($data['id']) && 
$data['id'] ? $data['id'] : 0;
+                       $start          = isset($data['start']) && 
$data['start'] ? $data['start'] : 0;
+                       $filter         = isset($data['filter']) ? 
$data['filter'] : '';
+                       $query          = isset($data['query']) ? 
$data['query'] : '';
+                       $sort           = isset($data['sort']) && $data['sort'] 
? $data['sort'] : 'DESC';
+                       $order          = isset($data['order']) ? 
$data['order'] : '';
+                       $allrows        = isset($data['allrows']) ? 
$data['allrows'] : '';
+
+                       if($order == 'undefined')
                        {
-                               $id     = (isset($data['id'])?$data['id']:0);
-                               $start  = 
(isset($data['start'])?$data['start']:0);
-                               $filter = 
(isset($data['filter'])?$data['filter']:'');
-                               $query = 
(isset($data['query'])?$data['query']:'');
-                               $sort = 
(isset($data['sort'])?$data['sort']:'DESC');
-                               $order = 
(isset($data['order'])?$data['order']:'');
-                               $allrows                = 
(isset($data['allrows'])?$data['allrows']:'');
+                               $order = '';
                        }
 
                        if ($order)
                        {
-                               $ordermethod = " order by $order $sort";
+                               $ordermethod .= " ORDER BY $order $sort";
                        }
                        else
                        {
-                               $ordermethod = ' order by id DESC';
+                               $ordermethod = ' ORDER BY id DESC';
                        }
 
                        $where = 'WHERE';
+
+                       $filtermethod = '';
                        if ($filter > 0)
                        {
-                               $filtermethod .= " $where owner='$filter' ";
+                               $filtermethod .= " $where owner='{$filter}' ";
                                $where = 'AND';
-
                        }
 
                        $id = $this->db->db_addslashes($id);
@@ -110,7 +113,7 @@
                        {
                                $filtermethod = "$where id $this->like '%$id%' 
AND id!='##last-check-run##'";
                        }
-                       elseif (!$id)
+                       else if (!$id)
                        {
                                $filtermethod = $where . ' next<='.time()." AND 
id!='##last-check-run##'";
                        }

Modified: trunk/property/inc/class.uialarm.inc.php
===================================================================
--- trunk/property/inc/class.uialarm.inc.php    2011-01-04 07:32:40 UTC (rev 
6726)
+++ trunk/property/inc/class.uialarm.inc.php    2011-01-04 10:01:50 UTC (rev 
6727)
@@ -64,7 +64,7 @@
 
                        $this->start            = $this->bo->start;
                        $this->query            = $this->bo->query;
-                       $this->sort             = $this->bo->sort;
+                       $this->sort                     = $this->bo->sort;
                        $this->order            = $this->bo->order;
                        $this->filter           = $this->bo->filter;
                        $this->method_id        = $this->bo->method_id;
@@ -230,28 +230,6 @@
 
                        foreach ($list as $alarm)
                        {
-                               $times  = '';
-                               $data   = '';
-
-                               if(is_array($alarm['times']))
-                               {
-                                       foreach ($alarm['times'] as $key => 
$value)
-                                       {
-                                               $times .= "{$key} => {$value} ";
-                                       }
-                               }
-                               else
-                               {
-                                       $times = 
$GLOBALS['phpgw']->common->show_date($alarm['times']);
-                               }
-                               if(is_array($alarm['data']))
-                               {
-                                       foreach ($alarm['data']as $key => 
$value)
-                                       {
-                                               $data .= "{$key} => {$value} ";
-                                       }
-                               }
-
                                $link_edit                              = '';
                                $lang_edit_statustext   = '';
                                $text_edit                              = '';
@@ -267,15 +245,15 @@
                                        $link_edit                              
= "-";
                                }
 
-                               $check_box = "<input type=\"checkbox\" 
name=\"values[alarm][".$alarm[id]."]\" value=\"".$alarm[id]."\" 
class=\"myValuesForPHP\">";
+                               $check_box = "<input type=\"checkbox\" 
name=\"values[alarm][".$alarm['id']."]\" value=\"".$alarm['id']."\" 
class=\"myValuesForPHP\">";
 
                                $content[] = array
                                        (
                                                'id'                            
        => $alarm['id'],
                                                'next_run'                      
        => $GLOBALS['phpgw']->common->show_date($alarm['next']),
-                                               'times'                         
        => $times,
+                                               'times'                         
        => is_array($alarm['times']) ? print_r($alarm['times'],true) : 
$GLOBALS['phpgw']->common->show_date($alarm['times']),
                                                'method'                        
        => $alarm['method'],
-                                               'data'                          
        => $data,
+                                               'data'                          
        => print_r($alarm['data'],true),
                                                'enabled'                       
        => $alarm['enabled'],
                                                'user'                          
        => $alarm['user'],
                                                'check_box'                     
        => $check_box,




reply via email to

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