[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [7190] catch: more on postprocessing
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [7190] catch: more on postprocessing |
Date: |
Wed, 06 Apr 2011 19:25:07 +0000 |
Revision: 7190
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7190
Author: sigurdne
Date: 2011-04-06 19:25:04 +0000 (Wed, 06 Apr 2011)
Log Message:
-----------
catch: more on postprocessing
Modified Paths:
--------------
trunk/catch/inc/custom/default/update_location_at_record_nlsh.php
Modified: trunk/catch/inc/custom/default/update_location_at_record_nlsh.php
===================================================================
--- trunk/catch/inc/custom/default/update_location_at_record_nlsh.php
2011-04-06 10:14:45 UTC (rev 7189)
+++ trunk/catch/inc/custom/default/update_location_at_record_nlsh.php
2011-04-06 19:25:04 UTC (rev 7190)
@@ -19,24 +19,25 @@
{
$ids[] = $this->db->f('id');
}
-
+
foreach ($ids as $_id)
{
$value_set = array();
$this->db->query("SELECT * FROM $target_table WHERE id
= {$_id}",__LINE__,__FILE__);
$this->db->next_record();
-
- if($location_id = $this->db->f('location_id') &&
$target_id = (int)$this->db->f('target_id'))
+
+ $location_id = $this->db->f('location_id');
+ $target_id = $this->db->f('target_id');
+ if($location_id && $target_id)
{
$origin =
$GLOBALS['phpgw']->locations->get_name($location_id);
$origin_table =
$GLOBALS['phpgw']->locations->get_attrib_table($origin['appname'],
$origin['location']);
$origin_arr = explode('_', $origin_table);
$p_entity_id = $origin_arr[2];
$p_cat_id = $origin_arr[3];
-
if($origin_table)
{
- $this->db2->query("SELECT location_code
FROM {$origin_table} WHERE id = $target_id",__LINE__,__FILE__);
+ $this->db2->query("SELECT location_code
FROM {$origin_table} WHERE num = '{$target_id}'",__LINE__,__FILE__);
$this->db2->next_record();
$origin_location_code =
$this->db2->f('location_code');
$value_set['location_code'] =
$origin_location_code;
@@ -44,12 +45,16 @@
$value_set['p_entity_id'] =
$p_entity_id;
$value_set['p_cat_id'] =
$p_cat_id;
$origin_location_code_arr =
explode('-',$origin_location_code);
- if(isset($origin_location_code_arr[4]))
+ if($origin_location_code_arr)
{
- $value_set['loc5']
= $origin_location_code_arr[4];
+ $j=1;
+
foreach($origin_location_code_arr as $_loc)
+ {
+ $value_set["loc{$j}"]
= $_loc;
+ $j++;
+ }
}
}
-
}
else
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [7190] catch: more on postprocessing,
Sigurd Nes <=