[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [6973] property: generalize
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [6973] property: generalize |
Date: |
Fri, 11 Feb 2011 09:47:41 +0000 |
Revision: 6973
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6973
Author: sigurdne
Date: 2011-02-11 09:47:41 +0000 (Fri, 11 Feb 2011)
Log Message:
-----------
property: generalize
Modified Paths:
--------------
trunk/property/inc/class.sogab.inc.php
trunk/property/inc/class.uiwo_hour.inc.php
Modified: trunk/property/inc/class.sogab.inc.php
===================================================================
--- trunk/property/inc/class.sogab.inc.php 2011-02-11 09:03:26 UTC (rev
6972)
+++ trunk/property/inc/class.sogab.inc.php 2011-02-11 09:47:41 UTC (rev
6973)
@@ -71,9 +71,11 @@
$check_payments =
isset($data['check_payments']) ? $data['check_payments'] : '';
}
+
+
if ($order)
{
- $ordermethod = " order by
fm_gab_location.$order $sort";
+ $ordermethod = " order by
fm_gab_location.{$order} {$sort}";
}
else
{
@@ -85,39 +87,52 @@
if ($cat_id > 0)
{
- $filtermethod .= " $where
fm_gab_location.category='$cat_id' ";
+ $filtermethod .= " {$where}
fm_gab_location.category='{$cat_id}' ";
$where = 'AND';
}
if ($address)
{
- $filtermethod .= " $where
fm_gab_location.address $this->like '%$address%' ";
+ $filtermethod .= " {$where}
fm_gab_location.address {$this->like} '%{$address}%' ";
$where = 'AND';
}
if ($location_code)
{
- $filtermethod .= " $where
fm_gab_location.location_code $this->like '$location_code%' ";
+ $location_code = explode('-',$location_code);
+ $i = 1;
+ foreach($location_code as $_loc)
+ {
+ $loc[] = $_loc;
+ if($i == $this->gab_insert_level)
+ {
+ break;
+ }
+ $i++;
+ }
+ $location_code = implode('-', $loc);
+
+ $filtermethod .= " {$where}
fm_gab_location.location_code {$this->like} '{$location_code}%' ";
$where = 'AND';
}
if ($gaards_nr)
{
- $filtermethod .= " $where SUBSTRING(gab_id,5,5)
$this->like '%$gaards_nr' ";
+ $filtermethod .= " {$where}
SUBSTRING(gab_id,5,5) {$this->like} '%$gaards_nr' ";
$where = 'AND';
}
if ($bruksnr)
{
- $filtermethod .= " $where
SUBSTRING(gab_id,10,4) $this->like '%$bruksnr' ";
+ $filtermethod .= " {$where}
SUBSTRING(gab_id,10,4) {$this->like} '%$bruksnr' ";
$where = 'AND';
}
if ($feste_nr)
{
- $filtermethod .= " $where
SUBSTRING(gab_id,14,4) $this->like '%$feste_nr' ";
+ $filtermethod .= " {$where}
SUBSTRING(gab_id,14,4) {$this->like} '%$feste_nr' ";
$where = 'AND';
}
if ($seksjons_nr)
{
- $filtermethod .= " $where
SUBSTRING(gab_id,18,3) $this->like '%$seksjons_nr' ";
+ $filtermethod .= " {$where}
SUBSTRING(gab_id,18,3) {{$this->like}} '%$seksjons_nr' ";
$where = 'AND';
}
Modified: trunk/property/inc/class.uiwo_hour.inc.php
===================================================================
--- trunk/property/inc/class.uiwo_hour.inc.php 2011-02-11 09:03:26 UTC (rev
6972)
+++ trunk/property/inc/class.uiwo_hour.inc.php 2011-02-11 09:47:41 UTC (rev
6973)
@@ -1339,22 +1339,7 @@
$location_code =
isset($common_data['workorder']['location_code']) &&
$common_data['workorder']['location_code'] ?
$common_data['workorder']['location_code'] : $project['location_code'];
- $location_code = explode('-',$location_code);
-
- $gab_insert_level =
isset($this->config->config_data['gab_insert_level']) &&
$this->config->config_data['gab_insert_level'] ?
$this->config->config_data['gab_insert_level'] : 3;
- $i = 1;
- foreach($location_code as $_loc)
- {
- $loc[] = $_loc;
- if($i == $gab_insert_level)
- {
- break;
- }
- $i++;
- }
- $location_code = implode('-', $loc);
-
$gabinfos = execMethod('property.sogab.read',
array('location_code' => $location_code, 'allrows' => true));
if($gabinfos != null && is_array($gabinfos) &&
count($gabinfos) == 1)
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [6973] property: generalize,
Sigurd Nes <=