fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [6586] Property: tenant claim


From: Sigurd Nes
Subject: [Fmsystem-commits] [6586] Property: tenant claim
Date: Fri, 12 Nov 2010 13:29:52 +0000

Revision: 6586
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6586
Author:   sigurdne
Date:     2010-11-12 13:29:50 +0000 (Fri, 12 Nov 2010)
Log Message:
-----------
Property: tenant claim

Modified Paths:
--------------
    trunk/property/inc/class.botenant_claim.inc.php
    trunk/property/inc/class.solocation.inc.php
    trunk/property/inc/class.sotenant_claim.inc.php
    trunk/property/inc/class.uitenant_claim.inc.php

Modified: trunk/property/inc/class.botenant_claim.inc.php
===================================================================
--- trunk/property/inc/class.botenant_claim.inc.php     2010-11-12 11:36:47 UTC 
(rev 6585)
+++ trunk/property/inc/class.botenant_claim.inc.php     2010-11-12 13:29:50 UTC 
(rev 6586)
@@ -181,18 +181,21 @@
                {
                        $project_id     = isset($data['project_id']) && 
$data['project_id'] ? $data['project_id'] : phpgw::get_var('project_id');
 
-                       $claim = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
+                       $claims = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
                                                                                
        'user_id' => $this->user_id,'status' => $this->status,'cat_id' => 
$this->cat_id,
                                                                                
        'allrows'=>$this->allrows,'project_id' => $project_id, 'district_id' => 
$this->district_id,));
                        $this->total_records = $this->so->total_records;
 
-                       foreach ($claim as &$entry)
+                       foreach ($claims as &$entry)
                        {
                                $entry['entry_date']  = 
$GLOBALS['phpgw']->common->show_date($entry['entry_date'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
                                $entry['status'] = lang($entry['status']);
                                $entry['user'] = 
$GLOBALS['phpgw']->accounts->get($entry['user_id'])->__toString();
+                               $location_info = 
execMethod('property.solocation.read_single',$entry['location_code']);
+                               $entry['loc1_name'] = 
$location_info['loc1_name'];
+                               $entry['loc_category'] = 
$location_info['category_name'];
                        }
-                       return $claim;
+                       return $claims;
                }
 
                function check_claim_project($project_id)

Modified: trunk/property/inc/class.solocation.inc.php
===================================================================
--- trunk/property/inc/class.solocation.inc.php 2010-11-12 11:36:47 UTC (rev 
6585)
+++ trunk/property/inc/class.solocation.inc.php 2010-11-12 13:29:50 UTC (rev 
6586)
@@ -1096,7 +1096,9 @@
                        }
 
                        $cols = "fm_location{$type_id}.category as cat_id";
+                       $cols .= ",fm_location{$type_id}_category.descr as 
category_name";
                        $cols_return[]  = 'cat_id';
+                       $cols_return[]  = 'category_name';
 
                        for ($i=1;$i<($type_id);$i++)
                        {
@@ -1132,6 +1134,8 @@
                                $this->cols_return      =       
$this->socommon->fm_cache('cols_return_single_'. $type_id);
                        }
 
+                       $sql .= " {$this->join} fm_location{$type_id}_category 
ON (fm_location{$type_id}.category = fm_location{$type_id}_category.id)";
+
                        $sql .= " WHERE 
fm_location$type_id.location_code='$location_code' ";
 
                        $this->db->query($sql,__LINE__,__FILE__);

Modified: trunk/property/inc/class.sotenant_claim.inc.php
===================================================================
--- trunk/property/inc/class.sotenant_claim.inc.php     2010-11-12 11:36:47 UTC 
(rev 6585)
+++ trunk/property/inc/class.sotenant_claim.inc.php     2010-11-12 13:29:50 UTC 
(rev 6586)
@@ -114,8 +114,8 @@
                                $querymethod = " $where ( first_name 
$this->like '%$query%' OR last_name $this->like '%$query%' OR project_id=" . 
(int)$query .')';
                        }
 
-                       $sql = "SELECT fm_tenant_claim.*, 
fm_tenant_claim_category.descr as category, fm_tenant.last_name, 
fm_tenant.first_name,district_id"
-                        . " FROM fm_tenant_claim "
+                       $sql = "SELECT fm_tenant_claim.*, 
fm_tenant_claim_category.descr as claim_category, fm_tenant.last_name, 
fm_tenant.first_name,district_id,"
+                        . " fm_project.address, fm_project.category, 
fm_project.location_code FROM fm_tenant_claim "
                         . " $this->join fm_tenant_claim_category on 
fm_tenant_claim.category=fm_tenant_claim_category.id"
                         . " $this->join fm_tenant on 
fm_tenant_claim.tenant_id=fm_tenant.id"
                         . " $this->join fm_project ON fm_project.id = 
fm_tenant_claim.project_id"
@@ -150,6 +150,10 @@
                                        'status'                => 
$this->db->f('status'),
                                        'user_id'               => 
$this->db->f('user_id'),
                                        'district_id'   => 
$this->db->f('district_id'),
+                                       'address'               => 
$this->db->f('address',true),
+                                       'category'              => 
$this->db->f('category'),
+                                       'location_code' => 
$this->db->f('location_code'),
+                                       'claim_category'=> 
$this->db->f('claim_category',true),
                                );
                        }
                        return $claims;

Modified: trunk/property/inc/class.uitenant_claim.inc.php
===================================================================
--- trunk/property/inc/class.uitenant_claim.inc.php     2010-11-12 11:36:47 UTC 
(rev 6585)
+++ trunk/property/inc/class.uitenant_claim.inc.php     2010-11-12 13:29:50 UTC 
(rev 6586)
@@ -279,27 +279,39 @@
                        $uicols['name'][1]['name'] = 'district_id';
                        $uicols['name'][1]['value'] = 'district_id';
 
-                       $uicols['name'][2]['name'] = 'Project';
-                       $uicols['name'][2]['value'] = 'project_id';
+                       $uicols['name'][2]['name'] = 'location';
+                       $uicols['name'][2]['value'] = 'location_code';
 
-                       $uicols['name'][3]['name'] = 'name';
-                       $uicols['name'][3]['value'] = 'name';
+                       $uicols['name'][3]['name'] = 'loc1_name';
+                       $uicols['name'][3]['value'] = 'loc1_name';
 
-                       $uicols['name'][4]['name'] = 'time created';
-                       $uicols['name'][4]['value'] = 'entry_date';
+                       $uicols['name'][4]['name'] = 'address';
+                       $uicols['name'][4]['value'] = 'address';
 
-                       $uicols['name'][5]['name'] = 'user';
-                       $uicols['name'][5]['value'] = 'user';
+                       $uicols['name'][5]['name'] = 'category';
+                       $uicols['name'][5]['value'] = 'loc_category';
 
-                       $uicols['name'][6]['name'] = 'category';
-                       $uicols['name'][6]['value'] = 'category';
+                       $uicols['name'][6]['name'] = 'Project';
+                       $uicols['name'][6]['value'] = 'project_id';
 
-                       $uicols['name'][7]['name'] = 'Status';
-                       $uicols['name'][7]['value'] = 'status';
+                       $uicols['name'][7]['name'] = 'name';
+                       $uicols['name'][7]['value'] = 'name';
 
-                       $uicols['name'][8]['name'] = 'tenant_id';
-                       $uicols['name'][8]['value'] = 'tenant_id';
+                       $uicols['name'][8]['name'] = 'time created';
+                       $uicols['name'][8]['value'] = 'entry_date';
 
+                       $uicols['name'][9]['name'] = 'user';
+                       $uicols['name'][9]['value'] = 'user';
+
+                       $uicols['name'][10]['name'] = 'category';
+                       $uicols['name'][10]['value'] = 'claim_category';
+
+                       $uicols['name'][11]['name'] = 'Status';
+                       $uicols['name'][11]['value'] = 'status';
+
+                       $uicols['name'][12]['name'] = 'tenant_id';
+                       $uicols['name'][12]['value'] = 'tenant_id';
+
                        $count_uicols_name = count($uicols['name']);
 
                        $j = 0;




reply via email to

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