phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property/class.bometer.php, 1.1.1.3


From: nomail
Subject: [Phpgroupware-cvs] property/class.bometer.php, 1.1.1.3
Date: Fri, 21 May 2004 15:44:50 -0000

Update of /property
Modified Files:
        Branch: 
          class.bometer.php

date: 2004/04/23 21:26:33;  author: sigurdne;  state: Exp;  lines: +260 -260

Log Message:
no message
=====================================================================
Index: property/class.bometer.php
diff -u property/class.bometer.php:1.1.1.2 property/class.bometer.php:1.1.1.3
--- property/class.bometer.php:1.1.1.2  Fri Apr 23 20:25:23 2004
+++ property/class.bometer.php  Fri Apr 23 21:26:33 2004
@@ -1,260 +1,260 @@
-<?php
-       
/**************************************************************************\
-       * phpGroupWare - property                                               
   *
-       * http://www.phpgroupware.org                                           
   *
-       *                                                                       
   *
-       * Facilities Management                                                 
   *
-       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
-       * 
------------------------------------------------------------------------ *
-       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
-       * This program is part of the GNU project, see http://www.gnu.org/      
   *
-       * 
------------------------------------------------------------------------ *
-       * 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 the 
   *
-       * Free Software Foundation; either version 2 of the License, or (at 
your   *
-       * option) any later version.                                            
   *
-       
\**************************************************************************/
-
-       class property_bometer
-       {
-               var $start;
-               var $query;
-               var $filter;
-               var $sort;
-               var $order;
-               var $cat_id;
-
-               var $public_functions = array
-               (
-                       'read'                          => True,
-                       'read_single'           => True,
-                       'save'                          => True,
-                       'delete'                        => True,
-                       'check_perms'           => True
-               );
-
-               var $soap_functions = array(
-                       'list' => array(
-                               'in'  => 
array('int','int','struct','string','int'),
-                               'out' => array('array')
-                       ),
-                       'read' => array(
-                               'in'  => array('int','struct'),
-                               'out' => array('array')
-                       ),
-                       'save' => array(
-                               'in'  => array('int','struct'),
-                               'out' => array()
-                       ),
-                       'delete' => array(
-                               'in'  => array('int','struct'),
-                               'out' => array()
-                       )
-               );
-
-               function property_bometer($session=False)
-               {
-                       $this->currentapp       = 'property'; 
//$GLOBALS['phpgw_info']['flags']['currentapp'];
-                       $this->so               = 
CreateObject($this->currentapp.'_someter');
-                       $this->bocommon = 
CreateObject($this->currentapp.'_bocommon');
-                       $this->fm_session       = 
CreateObject($this->currentapp.'_session');
-
-                       if ($session)
-                       {
-                               $this->read_sessiondata();
-                               $this->use_session = True;
-                       }
-
-                       $start  = get_var('start',array('POST','GET'));
-                       $query  = get_var('query',array('POST','GET'));
-                       $sort   = get_var('sort',array('POST','GET'));
-                       $order  = get_var('order',array('POST','GET'));
-                       $filter = get_var('filter',array('POST','GET'));
-                       $cat_id = get_var('cat_id',array('POST','GET'));
-
-                       if ($start)
-                       {
-                               $this->start=$start;
-                       }
-                       else
-                       {
-                               $this->start=0;
-                       }
-
-                       if(isset($query))
-                       {
-                               $this->query = $query;
-                       }
-                       if(!empty($filter))
-                       {
-                               $this->filter = $filter;
-                       }
-                       if(isset($sort))
-                       {
-                               $this->sort = $sort;
-                       }
-                       if(isset($order))
-                       {
-                               $this->order = $order;
-                       }
-                       if(isset($cat_id))
-                       {
-                               $this->cat_id = $cat_id;
-                       }
-               }
-
-               function save_sessiondata($data)
-               {
-                       if ($this->use_session)
-                       {
-                               
$this->fm_session->appsession('session_data','meter',$data);
-                       }
-               }
-
-               function read_sessiondata()
-               {
-                       $data = 
$this->fm_session->appsession('session_data','meter');
-
-                       $this->start    = $data['start'];
-                       $this->query    = $data['query'];
-                       $this->filter   = $data['filter'];
-                       $this->sort             = $data['sort'];
-                       $this->order    = $data['order'];
-                       $this->cat_id   = $data['cat_id'];
-               }
-
-               function get_category_list($format='',$selected='')
-               {
-                       switch($format)
-                       {
-                               case 'select':
-                                       
$this->bocommon->xsl_add_file(array('cat_select'));
-                                       break;
-                               case 'filter':
-                                       
$this->bocommon->xsl_add_file(array('cat_filter'));
-                                       break;
-                       }
-
-                       $categories= $this->so->get_category_list();
-
-                       while (is_array($categories) && list(,$category) = 
each($categories))
-                       {
-                               $sel_category = '';
-                               if ($category['id']==$selected)
-                               {
-                                       $sel_category = 'selected';
-                               }
-
-                               $category_list[] = array
-                               (
-                                       'cat_id'        => $category['id'],
-                                       'name'          => $category['name'],
-                                       'selected'      => $sel_category
-                               );
-                       }
-
-                       for ($i=0;$i<count($category_list);$i++)
-                       {
-                               if ($category_list[$i]['selected'] != 
'selected')
-                               {
-                                       unset($category_list[$i]['selected']);
-                               }
-                       }
-
-                       return $category_list;
-               }
-
-               function read()
-               {
-                       $meter = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
-                                                                               
        'filter' => $this->filter,'cat_id' => $this->cat_id));
-                       $this->total_records = $this->so->total_records;
-
-                       $this->uicols   = $this->so->uicols;
-/*                     $cols_extra             = $this->so->cols_extra;
-                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
-                       $solocation = 
CreateObject($this->currentapp.'_solocation');
-
-                       for ($i=0; $i<count($meter); $i++)
-                       {
-                               $meter[$i]['user']              = 
$GLOBALS['phpgw']->accounts->id2name($meter[$i]['user_id']);
-                               $meter[$i]['entry_date'] = 
$GLOBALS['phpgw']->common->show_date($meter[$i]['entry_date'],$dateformat);
-                               
$location_data=$solocation->read_single($meter[$i]['location_code']);
-
-                               for ($j=0;$j<count($cols_extra);$j++)
-                               {
-                                       $meter[$i][$cols_extra[$j]] = 
$location_data[$cols_extra[$j]];
-                               }
-
-                       }
-*/
-                       return $meter;
-               }
-
-               function read_single($meter_id)
-               {
-                       $meter= $this->so->read_single($meter_id);
-
-                       if($meter['location_code'])
-                       {
-                               $solocation = 
CreateObject($this->currentapp.'_solocation');
-
-                               $meter['location_data'] 
=$solocation->read_single($meter['location_code']);
-                       }
-
-                       if($meter['p_num'])
-                       {
-                               $soadmin_entity = 
CreateObject($this->currentapp.'_soadmin_entity');
-                               $category = 
$soadmin_entity->read_single_category($meter['p_entity_id'],$meter['p_cat_id']);
-
-                               
$meter['p'][$meter['p_entity_id']]['p_num']=$meter['p_num'];
-                               
$meter['p'][$meter['p_entity_id']]['p_entity_id']=$meter['p_entity_id'];
-                               
$meter['p'][$meter['p_entity_id']]['p_cat_id']=$meter['p_cat_id'];
-                               
$meter['p'][$meter['p_entity_id']]['p_cat_name'] = $category['name'];
-                       }
-
-                       return $meter;
-               }
-
-               function check_meter_num($num)
-               {
-                       return $this->so->check_meter_num($num);
-               }
-
-               function save($values,$action='')
-               {
-                       while (is_array($values['location']) && list(,$value) = 
each($values['location']))
-                       {
-                               if($value)
-                               {
-                                       $location[] = $value;
-                               }
-                       }
-
-                       $values['location_code']=implode("-", $location);
-
-                       if ($action=='edit')
-                       {
-                               $receipt = $this->so->edit($values);
-                       }
-                       else
-                       {
-                               $receipt = $this->so->add($values);
-                       }
-                       return $receipt;
-               }
-
-               function delete($params)
-               {
-                       if (is_array($params))
-                       {
-                               $this->so->delete($params[0]);
-                       }
-                       else
-                       {
-                               $this->so->delete($params);
-                       }
-               }
-
-       }
-?>
+<?php
+       
/**************************************************************************\
+       * phpGroupWare - property                                               
   *
+       * http://www.phpgroupware.org                                           
   *
+       *                                                                       
   *
+       * Facilities Management                                                 
   *
+       * Written by Sigurd Nes [sigurdne at online.no]                         
   *
+       * 
------------------------------------------------------------------------ *
+       * Copyright 2000 - 2003 Free Software Foundation, Inc                   
   *
+       * This program is part of the GNU project, see http://www.gnu.org/      
   *
+       * 
------------------------------------------------------------------------ *
+       * 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 the 
   *
+       * Free Software Foundation; either version 2 of the License, or (at 
your   *
+       * option) any later version.                                            
   *
+       
\**************************************************************************/
+
+       class property_bometer
+       {
+               var $start;
+               var $query;
+               var $filter;
+               var $sort;
+               var $order;
+               var $cat_id;
+
+               var $public_functions = array
+               (
+                       'read'                          => True,
+                       'read_single'           => True,
+                       'save'                          => True,
+                       'delete'                        => True,
+                       'check_perms'           => True
+               );
+
+               var $soap_functions = array(
+                       'list' => array(
+                               'in'  => 
array('int','int','struct','string','int'),
+                               'out' => array('array')
+                       ),
+                       'read' => array(
+                               'in'  => array('int','struct'),
+                               'out' => array('array')
+                       ),
+                       'save' => array(
+                               'in'  => array('int','struct'),
+                               'out' => array()
+                       ),
+                       'delete' => array(
+                               'in'  => array('int','struct'),
+                               'out' => array()
+                       )
+               );
+
+               function property_bometer($session=False)
+               {
+                       $this->currentapp       = 'property'; 
//$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $this->so               = 
CreateObject($this->currentapp.'_someter');
+                       $this->bocommon = 
CreateObject($this->currentapp.'_bocommon');
+                       $this->fm_session       = 
CreateObject($this->currentapp.'_session');
+
+                       if ($session)
+                       {
+                               $this->read_sessiondata();
+                               $this->use_session = True;
+                       }
+
+                       $start  = get_var('start',array('POST','GET'));
+                       $query  = get_var('query',array('POST','GET'));
+                       $sort   = get_var('sort',array('POST','GET'));
+                       $order  = get_var('order',array('POST','GET'));
+                       $filter = get_var('filter',array('POST','GET'));
+                       $cat_id = get_var('cat_id',array('POST','GET'));
+
+                       if ($start)
+                       {
+                               $this->start=$start;
+                       }
+                       else
+                       {
+                               $this->start=0;
+                       }
+
+                       if(isset($query))
+                       {
+                               $this->query = $query;
+                       }
+                       if(!empty($filter))
+                       {
+                               $this->filter = $filter;
+                       }
+                       if(isset($sort))
+                       {
+                               $this->sort = $sort;
+                       }
+                       if(isset($order))
+                       {
+                               $this->order = $order;
+                       }
+                       if(isset($cat_id))
+                       {
+                               $this->cat_id = $cat_id;
+                       }
+               }
+
+               function save_sessiondata($data)
+               {
+                       if ($this->use_session)
+                       {
+                               
$this->fm_session->appsession('session_data','meter',$data);
+                       }
+               }
+
+               function read_sessiondata()
+               {
+                       $data = 
$this->fm_session->appsession('session_data','meter');
+
+                       $this->start    = $data['start'];
+                       $this->query    = $data['query'];
+                       $this->filter   = $data['filter'];
+                       $this->sort             = $data['sort'];
+                       $this->order    = $data['order'];
+                       $this->cat_id   = $data['cat_id'];
+               }
+
+               function get_category_list($format='',$selected='')
+               {
+                       switch($format)
+                       {
+                               case 'select':
+                                       
$this->bocommon->xsl_add_file(array('cat_select'));
+                                       break;
+                               case 'filter':
+                                       
$this->bocommon->xsl_add_file(array('cat_filter'));
+                                       break;
+                       }
+
+                       $categories= $this->so->get_category_list();
+
+                       while (is_array($categories) && list(,$category) = 
each($categories))
+                       {
+                               $sel_category = '';
+                               if ($category['id']==$selected)
+                               {
+                                       $sel_category = 'selected';
+                               }
+
+                               $category_list[] = array
+                               (
+                                       'cat_id'        => $category['id'],
+                                       'name'          => $category['name'],
+                                       'selected'      => $sel_category
+                               );
+                       }
+
+                       for ($i=0;$i<count($category_list);$i++)
+                       {
+                               if ($category_list[$i]['selected'] != 
'selected')
+                               {
+                                       unset($category_list[$i]['selected']);
+                               }
+                       }
+
+                       return $category_list;
+               }
+
+               function read()
+               {
+                       $meter = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
+                                                                               
        'filter' => $this->filter,'cat_id' => $this->cat_id));
+                       $this->total_records = $this->so->total_records;
+
+                       $this->uicols   = $this->so->uicols;
+/*                     $cols_extra             = $this->so->cols_extra;
+                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+                       $solocation = 
CreateObject($this->currentapp.'_solocation');
+
+                       for ($i=0; $i<count($meter); $i++)
+                       {
+                               $meter[$i]['user']              = 
$GLOBALS['phpgw']->accounts->id2name($meter[$i]['user_id']);
+                               $meter[$i]['entry_date'] = 
$GLOBALS['phpgw']->common->show_date($meter[$i]['entry_date'],$dateformat);
+                               
$location_data=$solocation->read_single($meter[$i]['location_code']);
+
+                               for ($j=0;$j<count($cols_extra);$j++)
+                               {
+                                       $meter[$i][$cols_extra[$j]] = 
$location_data[$cols_extra[$j]];
+                               }
+
+                       }
+*/
+                       return $meter;
+               }
+
+               function read_single($meter_id)
+               {
+                       $meter= $this->so->read_single($meter_id);
+
+                       if($meter['location_code'])
+                       {
+                               $solocation = 
CreateObject($this->currentapp.'_solocation');
+
+                               $meter['location_data'] 
=$solocation->read_single($meter['location_code']);
+                       }
+
+                       if($meter['p_num'])
+                       {
+                               $soadmin_entity = 
CreateObject($this->currentapp.'_soadmin_entity');
+                               $category = 
$soadmin_entity->read_single_category($meter['p_entity_id'],$meter['p_cat_id']);
+
+                               
$meter['p'][$meter['p_entity_id']]['p_num']=$meter['p_num'];
+                               
$meter['p'][$meter['p_entity_id']]['p_entity_id']=$meter['p_entity_id'];
+                               
$meter['p'][$meter['p_entity_id']]['p_cat_id']=$meter['p_cat_id'];
+                               
$meter['p'][$meter['p_entity_id']]['p_cat_name'] = $category['name'];
+                       }
+
+                       return $meter;
+               }
+
+               function check_meter_num($num)
+               {
+                       return $this->so->check_meter_num($num);
+               }
+
+               function save($values,$action='')
+               {
+                       while (is_array($values['location']) && list(,$value) = 
each($values['location']))
+                       {
+                               if($value)
+                               {
+                                       $location[] = $value;
+                               }
+                       }
+
+                       $values['location_code']=implode("-", $location);
+
+                       if ($action=='edit')
+                       {
+                               $receipt = $this->so->edit($values);
+                       }
+                       else
+                       {
+                               $receipt = $this->so->add($values);
+                       }
+                       return $receipt;
+               }
+
+               function delete($params)
+               {
+                       if (is_array($params))
+                       {
+                               $this->so->delete($params[0]);
+                       }
+                       else
+                       {
+                               $this->so->delete($params);
+                       }
+               }
+
+       }
+?>




reply via email to

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