[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] property/inc class.soadmin_location.inc.php cla...
From: |
Sigurd Nes |
Subject: |
[Phpgroupware-cvs] property/inc class.soadmin_location.inc.php cla... |
Date: |
Thu, 02 Mar 2006 12:45:16 +0000 |
CVSROOT: /sources/phpgroupware
Module name: property
Branch:
Changes by: Sigurd Nes <address@hidden> 06/03/02 12:45:16
Modified files:
inc : class.soadmin_location.inc.php
class.soactor.inc.php
Log message:
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.soadmin_location.inc.php.diff?tr1=1.20&tr2=1.21&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.soactor.inc.php.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
Patches:
Index: property/inc/class.soactor.inc.php
diff -u property/inc/class.soactor.inc.php:1.13
property/inc/class.soactor.inc.php:1.14
--- property/inc/class.soactor.inc.php:1.13 Tue Feb 7 19:22:01 2006
+++ property/inc/class.soactor.inc.php Thu Mar 2 12:45:16 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage admin
- * @version $Id: class.soactor.inc.php,v 1.13 2006/02/07 19:22:01
sigurdne Exp $
+ * @version $Id: class.soactor.inc.php,v 1.14 2006/03/02 12:45:16
sigurdne Exp $
*/
/**
@@ -777,11 +777,11 @@
switch($this->role)
{
case 'owner':
- $fd['abid'] =array('type' =>
'int','precision' => '4','nullable' => False);
- $fd['org_name'] =array('type' =>
'varchar','precision' => '50','nullable' => True);
+ // $fd['abid'] =array('type' =>
'int','precision' => '4','nullable' => False);
+ // $fd['org_name'] =array('type' =>
'varchar','precision' => '50','nullable' => True);
$fd['contact_name'] =array('type' =>
'varchar','precision' => '50','nullable' => True);
$fd['member_of'] =array('type' =>
'varchar','precision' => '255','nullable' => True);
- $fd['remark'] =array('type' =>
'varchar','precision' => '255','nullable' => True);
+ // $fd['remark'] =array('type' =>
'varchar','precision' => '255','nullable' => True);
break;
case 'tenant':
$fd['member_of'] = array('type' =>
'varchar','precision' => '255','nullable' => True);
Index: property/inc/class.soadmin_location.inc.php
diff -u property/inc/class.soadmin_location.inc.php:1.20
property/inc/class.soadmin_location.inc.php:1.21
--- property/inc/class.soadmin_location.inc.php:1.20 Thu Mar 2 11:42:50 2006
+++ property/inc/class.soadmin_location.inc.php Thu Mar 2 12:45:16 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage admin
- * @version $Id: class.soadmin_location.inc.php,v 1.20 2006/03/02
11:42:50 sigurdne Exp $
+ * @version $Id: class.soadmin_location.inc.php,v 1.21 2006/03/02
12:45:16 sigurdne Exp $
*/
/**
@@ -568,19 +568,19 @@
if ($this->db->next_record())
{
- $attrib['id']
= $this->db->f('id');
- $attrib['column_name']
= $this->db->f('column_name');
- $attrib['input_text']
= $this->db->f('input_text');
- $attrib['statustext']
= $this->db->f('statustext');
+ $attrib['id'] =
$this->db->f('id');
+ $attrib['column_name'] =
$this->db->f('column_name');
+ $attrib['input_text'] =
$this->db->f('input_text');
+ $attrib['statustext'] =
$this->db->f('statustext');
$attrib['column_info']['precision'] =
$this->db->f('precision_');
$attrib['column_info']['scale'] =
$this->db->f('scale');
$attrib['column_info']['default'] =
$this->db->f('default_value');
$attrib['column_info']['nullable'] =
$this->db->f('nullable');
$attrib['column_info']['type'] =
$this->db->f('datatype');
- $attrib['type_id']
= $type_id;
- $attrib['type_name']
= $this->db->f('type_name');
- $attrib['lookup_form']
= $this->db->f('lookup_form');
- $attrib['list']
= $this->db->f('list');
+ $attrib['type_id'] =
$type_id;
+ $attrib['type_name'] =
$this->db->f('type_name');
+ $attrib['lookup_form'] =
$this->db->f('lookup_form');
+ $attrib['list'] =
$this->db->f('list');
if($this->db->f('datatype')=='R' ||
$this->db->f('datatype')=='CH' || $this->db->f('datatype')=='LB')
{
$attrib['choice'] =
$this->read_attrib_choice($type_id,$id);
@@ -695,7 +695,6 @@
function save_config($values='',$column_name='')
{
-
$this->db->query("SELECT * FROM fm_location_config
WHERE column_name='$column_name' ",__LINE__,__FILE__);
$this->db->next_record();
@@ -704,9 +703,10 @@
$column_info['scale'] = $this->db->f('scale');
$column_info['default'] =
$this->db->f('default_value');
$column_info['nullable'] =
$this->db->f('nullable');
- $location_type =
$this->db->f('location_type');
+ $location_type =
$this->db->f('location_type');
$table_def = $this->get_table_def($location_type);
+ $history_table_def =
$this->get_table_history_def($table_def,$location_type);
if(!($location_type==$values[$column_name]))
{
@@ -722,11 +722,11 @@
$this->oProc->AddColumn('fm_location'.$values[$column_name],'street_number',
array('type'=>'varchar','precision'=>10));
$this->oProc->AddColumn('fm_location'.$values[$column_name] .
'_history','street_number', array('type'=>'varchar','precision'=>10));
$this->oProc->DropColumn('fm_location' .$location_type
,$table_def['fm_location'.$location_type],'street_number');
-
$this->oProc->DropColumn('fm_location' .$location_type .
'_history',$table_def['fm_location'.$location_type],'street_number');
+
$this->oProc->DropColumn('fm_location' .$location_type .
'_history',$history_table_def['fm_location'.$location_type] .
'_history','street_number');
}
$this->oProc->DropColumn('fm_location'
.$location_type ,$table_def['fm_location'.$location_type], $column_name);
- $this->oProc->DropColumn('fm_location'
.$location_type . '_history',$table_def['fm_location'.$location_type .
'_history'], $column_name);
+ $this->oProc->DropColumn('fm_location'
.$location_type . '_history',$history_table_def['fm_location'.$location_type .
'_history'], $column_name);
$this->db->query("UPDATE
fm_location_config set
location_type = '".
$values[$column_name] . "' WHERE column_name='" . $column_name .
"'",__LINE__,__FILE__);
@@ -745,6 +745,7 @@
return $receipt;
}
+
function edit_attrib($attrib)
{
$choice_table ='fm_location_choice';
@@ -761,14 +762,8 @@
$OldColumnPrecision = $this->db->f('precision_');
$table_def = $this->get_table_def($attrib['type_id']);
- $history_table_def['fm_location'.$attrib['type_id'] .
'_history'] = $table_def['fm_location'.$attrib['type_id']];
- $history_table_def['fm_location'.$attrib['type_id'] .
'_history']['fd']['exp_date']=array('type' => 'timestamp','nullable' =>
False,'default' => 'current_timestamp');
-
- $history_table_def['fm_location'.$attrib['type_id'] .
'_history']['pk'] = array();
- $history_table_def['fm_location'.$attrib['type_id'] .
'_history']['fk'] = array();
- $history_table_def['fm_location'.$attrib['type_id'] .
'_history']['ix'] = array();
- $history_table_def['fm_location'.$attrib['type_id'] .
'_history']['uc'] = array();
-
+ $history_table_def =
$this->get_table_history_def($table_def,$attrib['type_id']);
+
if($this->receipt['error'])
{
return $this->receipt;
@@ -983,6 +978,21 @@
}
+ function get_table_history_def($table_def,$type_id)
+ {
+
+ $history_table_def['fm_location'.$type_id . '_history']
= $table_def['fm_location'.$type_id];
+ $history_table_def['fm_location'.$type_id .
'_history']['fd']['exp_date']=array('type' => 'timestamp','nullable' =>
False,'default' => 'current_timestamp');
+
+ $history_table_def['fm_location'.$type_id .
'_history']['pk'] = array();
+ $history_table_def['fm_location'.$type_id .
'_history']['fk'] = array();
+ $history_table_def['fm_location'.$type_id .
'_history']['ix'] = array();
+ $history_table_def['fm_location'.$type_id .
'_history']['uc'] = array();
+
+ return $history_table_def;
+ }
+
+
function select_location_type()
{
$this->db->query("SELECT * FROM fm_location_type ORDER
BY id ");