phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property/inc class.soagreement.inc.php class.so...


From: Sigurd Nes
Subject: [Phpgroupware-cvs] property/inc class.soagreement.inc.php class.so...
Date: Sun, 12 Feb 2006 12:46:47 +0000

CVSROOT:        /sources/phpgroupware
Module name:    property
Branch:         
Changes by:     Sigurd Nes <address@hidden>     06/02/12 12:46:47

Modified files:
        inc            : class.soagreement.inc.php 
                         class.sos_agreement.inc.php 
                         class.uiagreement.inc.php 
                         class.uis_agreement.inc.php 

Log message:
        no message

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.soagreement.inc.php.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.sos_agreement.inc.php.diff?tr1=1.16&tr2=1.17&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uiagreement.inc.php.diff?tr1=1.18&tr2=1.19&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uis_agreement.inc.php.diff?tr1=1.24&tr2=1.25&r1=text&r2=text

Patches:
Index: property/inc/class.soagreement.inc.php
diff -u property/inc/class.soagreement.inc.php:1.10 
property/inc/class.soagreement.inc.php:1.11
--- property/inc/class.soagreement.inc.php:1.10 Mon Jan 30 22:14:19 2006
+++ property/inc/class.soagreement.inc.php      Sun Feb 12 12:46:46 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage agreement
-       * @version $Id: class.soagreement.inc.php,v 1.10 2006/01/30 22:14:19 
sigurdne Exp $
+       * @version $Id: class.soagreement.inc.php,v 1.11 2006/02/12 12:46:46 
sigurdne Exp $
        */
 
        /**
@@ -1246,6 +1246,93 @@
                        $this->oProc->m_odb->Halt_On_Error      = 'report';
                }
 
+               function get_default_column_def($table)
+               {
+                       switch($table)
+                       {
+                               case 'fm_agreement':
+                                       $fd=array(
+                                               'group_id' => array('type' => 
'int','precision' => '4','nullable' => False),
+                                               'id' => array('type' => 
'int','precision' => '4','nullable' => False),
+                                               'vendor_id' => array('type' => 
'int','precision' => '4','nullable' => False),
+                                               'name' => array('type' => 
'varchar','precision' => '100','nullable' => False),
+                                               'descr' => array('type' => 
'text','nullable' => True),
+                                               'status' => array('type' => 
'varchar','precision' => '10','nullable' => True),
+                                               'entry_date' => array('type' => 
'int','precision' => '4','nullable' => True),
+                                               'start_date' => array('type' => 
'int','precision' => '4','nullable' => True),
+                                               'end_date' => array('type' => 
'int','precision' => '4','nullable' => True),
+                                               'termination_date' => 
array('type' => 'int','precision' => '4','nullable' => True),
+                                               'category' => array('type' => 
'int','precision' => '4','nullable' => True),
+                                               'user_id' => array('type' => 
'int','precision' => '4','nullable' => True)
+                                               );
+                                       break;
+                               case 'fm_agreement_detail':
+
+
+                                       break;
+                               default:
+                                       return;
+                                       break;
+                       }
+                       
+                       return $fd;
+               }
+
+               function get_table_def($table)
+               {
+                       $metadata = $this->db->metadata($table);
+
+                       if($this->role=='detail')
+                       {
+                               $filtermethod= ' AND attrib_detail=2';
+                               $pk = array('id');
+                       }
+                       else
+                       {
+                               $filtermethod= ' AND attrib_detail=1';
+                               $pk = array('group_id','id');
+                       }
+
+                       $fd = $this->get_default_column_def($table);
+                       
+                       for ($i=0; $i<count($metadata); $i++)
+                       {
+                               $sql = "SELECT * FROM fm_agreement_attribute 
WHERE column_name = '" . $metadata[$i]['name'] . "' $filtermethod";
+
+                               $this->db->query($sql,__LINE__,__FILE__);
+                               while($this->db->next_record())
+                               {
+                                       if(!$precision = 
$this->db->f('precision_'))
+                                       {
+                                               $precision = 
$this->bocommon->translate_datatype_precision($this->db->f('datatype'));
+                                       }
+
+                                       $fd[$metadata[$i]['name']] = array(
+                                               'type' => 
$this->bocommon->translate_datatype_insert(stripslashes($this->db->f('datatype'))),
+                                               'precision' => $precision,
+                                               'nullable' => 
stripslashes($this->db->f('nullable')),
+                                               'default' => 
stripslashes($this->db->f('default_value')),
+                                               'scale' => $this->db->f('scale')
+                                                       );
+                                       unset($precision);
+                               }
+                       }
+
+                       $table_def = array(
+                               $table =>       array(
+                                       'fd' => $fd
+                                       )
+                               );
+                       
+                       $table_def[$table]['pk'] = $pk;
+                       $table_def[$table]['fk'] = array();                     
+                       $table_def[$table]['ix'] = array();                     
+                       $table_def[$table]['uc'] = array();                     
+
+                       return $table_def;
+               }
+
+
                function edit_attrib($attrib)
                {
                        $attribute_table = 'fm_agreement_attribute';
@@ -1269,43 +1356,61 @@
                                $table = 'fm_agreement';
                        }
 
-                       $this->db->query("SELECT column_name FROM 
$attribute_table WHERE id='" . $attrib['id']. "' $filtermethod");
+                       $this->db->query("SELECT column_name, datatype, 
precision_ FROM $attribute_table WHERE id='" . $attrib['id']. "' 
$filtermethod");
                        $this->db->next_record();
                        $OldColumnName          = $this->db->f('column_name');
+                       $OldDataType            = $this->db->f('datatype');
+                       $OldPrecision           = $this->db->f('precision_');
+
+                       $table_def = $this->get_table_def($table);      
 
                        $this->db->transaction_begin();
 
+                       $value_set=array(
+                               'input_text'    => $attrib['input_text'],
+                               'statustext'    => $attrib['statustext'],
+                               'search'        => $attrib['search'],
+                               'list'          => $attrib['list'],
+                               );
+
+                       $value_set      = 
$this->bocommon->validate_db_update($value_set);
+
+                       $this->db->query("UPDATE $attribute_table set 
$value_set WHERE id=" . $attrib['id'] . $filtermethod);
+
                        $attrib_type=$attrib['column_info']['type'];
-                       if(($OldColumnName !=$attrib['column_name']) || 
($attrib['column_info']['type'] != $this->db->f('datatype')))
+
+                       $this->init_process();
+                       
+                       $this->oProc->m_odb->transaction_begin();
+
+                       $this->oProc->m_aTables = $table_def;
+
+
+                       if($OldColumnName !=$attrib['column_name'])
                        {
-                               $value_set=array(
-                                       'column_name'           => 
$attrib['column_name'],
-                                       'input_text'            => 
$attrib['input_text'],
-                                       'statustext'            => 
$attrib['statustext'],
-                                       'lookup_form'           => 
$attrib['lookup_form'],
-                                       'search'                        => 
$attrib['search'],
-                                       'list'                          => 
$attrib['list'],
-                                       'datatype'                      => 
$attrib['column_info']['type'],
-                                       'precision_'            => 
$attrib['column_info']['precision'],
-                                       'scale'                         => 
$attrib['column_info']['scale'],
-                                       'default_value'         => 
$attrib['column_info']['default'],
-                                       'nullable'                      => 
$attrib['column_info']['nullable']
-                                       );
+                               $value_set=array('column_name'  => 
$attrib['column_name']);
 
                                $value_set      = 
$this->bocommon->validate_db_update($value_set);
 
                                $this->db->query("UPDATE $attribute_table set 
$value_set WHERE id=" . $attrib['id'] . $filtermethod);
 
-                               if($attrib['column_info']['type']=='email' && 
!$attrib['column_info']['precision'])
+                               $this->oProc->RenameColumn($table, 
$OldColumnName, $attrib['column_name']);
+                       }
+
+
+                       if (($OldDataType != $attrib['column_info']['type']) || 
($OldPrecision != $attrib['column_info']['precision']) )
+                       {
+                               if($attrib['column_info']['type']!='R' && 
$attrib['column_info']['type']!='CH' && $attrib['column_info']['type']!='LB')
                                {
-                                       $attrib['column_info']['precision']=64;
+                                       $this->db->query("DELETE FROM 
$choice_table WHERE  attrib_id=" . $attrib['id'] . $filtermethod);
                                }
 
-                               $attrib['column_info']['type']  = 
$this->bocommon->translate_datatype_insert($attrib['column_info']['type']);
-
-                               if($attrib['column_info']['type']=='int' && 
!$attrib['column_info']['precision'])
+                               if(!$attrib['column_info']['precision'])
                                {
-                                       $attrib['column_info']['precision']=4;
+                                       if($precision = 
$this->bocommon->translate_datatype_precision($attrib['column_info']['type']))
+                                       {
+                                               
$attrib['column_info']['precision']=$precision;
+                                       }
                                }
 
                                if(!$attrib['column_info']['default'])
@@ -1313,12 +1418,22 @@
                                        
unset($attrib['column_info']['default']);
                                }
 
-                               $this->init_process();
+                               $value_set=array(
+                                       'column_name'   => 
$attrib['column_name'],
+                                       'datatype'      => 
$attrib['column_info']['type'],
+                                       'precision_'    => 
$attrib['column_info']['precision'],
+                                       'scale'         => 
$attrib['column_info']['scale'],
+                                       'default_value' => 
$attrib['column_info']['default'],
+                                       'nullable'      => 
$attrib['column_info']['nullable']
+                                       );
 
-                               
$this->oProc->AlterColumn($table,$OldColumnName,$attrib['column_name'],$attrib['column_info']);
+                               $value_set      = 
$this->bocommon->validate_db_update($value_set);
 
-                       }
+                               $this->db->query("UPDATE $attribute_table set 
$value_set WHERE id=" . $attrib['id'] . $filtermethod);
 
+                               $attrib['column_info']['type']  = 
$this->bocommon->translate_datatype_insert($attrib['column_info']['type']);
+                               
$this->oProc->AlterColumn($table,$OldColumnName,$attrib['column_name'],$attrib['column_info']);
+                       }
 
                        if($attrib['new_choice'])
                        {
@@ -1341,7 +1456,6 @@
                                . "VALUES ($values)");
                        }
 
-
                        if($attrib['delete_choice'])
                        {
                                for 
($i=0;$i<count($attrib['delete_choice']);$i++)
@@ -1350,21 +1464,14 @@
                                }
                        }
 
-//html_print_r($attrib_type);
-                       if($attrib_type!='R' && $attrib_type!='CH' && 
$attrib_type!='LB')
-                       {
-                               $this->db->query("DELETE FROM $choice_table 
WHERE  attrib_id=" . $attrib['id'] . $filtermethod);
-                       }
-
-
                        $this->db->transaction_commit();
+                       $this->oProc->m_odb->transaction_commit();
 
                        $receipt['message'][] = array('msg'     => 
lang('Attribute has been edited'));
 
-
                        return $receipt;
-
                }
+
                function resort_attrib($data)
                {
 //html_print_r($data);
@@ -1408,6 +1515,7 @@
                                        break;
                        }
                }
+
                function delete_attrib($attrib_id)
                {
                        $table = 'fm_agreement';
Index: property/inc/class.sos_agreement.inc.php
diff -u property/inc/class.sos_agreement.inc.php:1.16 
property/inc/class.sos_agreement.inc.php:1.17
--- property/inc/class.sos_agreement.inc.php:1.16       Mon Jan 30 22:14:19 2006
+++ property/inc/class.sos_agreement.inc.php    Sun Feb 12 12:46:47 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage agreement
-       * @version $Id: class.sos_agreement.inc.php,v 1.16 2006/01/30 22:14:19 
sigurdne Exp $
+       * @version $Id: class.sos_agreement.inc.php,v 1.17 2006/02/12 12:46:47 
sigurdne Exp $
        */
 
        /**
@@ -1231,6 +1231,110 @@
                        $this->oProc->m_odb->Halt_On_Error      = 'report';
                }
 
+               function get_default_column_def($table)
+               {
+                       switch($table)
+                       {
+                               case 'fm_s_agreement':
+                                       $fd=array(
+                                               'id' => array('type' => 'int', 
'precision' => 4,'nullable' => False,'default' => '0'),
+                                               'vendor_id' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
+                                               'name' => array('type' => 
'varchar', 'precision' => 100,'nullable' => False),
+                                               'descr' => array('type' => 
'text','nullable' => True),
+                                               'status' => array('type' => 
'varchar', 'precision' => 10,'nullable' => True),
+                                               'category' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
+                                               'member_of' => array('type' => 
'text','nullable' => True),
+                                               'entry_date' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
+                                               'start_date' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
+                                               'end_date' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
+                                               'termination_date' => 
array('type' => 'int', 'precision' => 4,'nullable' => True),
+                                               'user_id' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
+                                               'actual_cost' => array('type' 
=> 'decimal', 'precision' => 20, 'scale' => 2,'nullable' => True),
+                                               'account_id' => array('type' => 
'varchar', 'precision' => 20,'nullable' => True)
+                                               );
+                                       break;
+                               case 'fm_s_agreement_detail':
+                                       $fd=array(
+                                               'agreement_id' => array('type' 
=> 'int', 'precision' => 4,'nullable' => False,'default' => '0'),
+                                               'id' => array('type' => 'int', 
'precision' => 4,'nullable' => False,'default' => '0'),
+                                               'location_code' => array('type' 
=> 'varchar', 'precision' => 30,'nullable' => True),
+                                               'address' => array('type' => 
'varchar', 'precision' => 150,'nullable' => True),
+                                               'p_num' => array('type' => 
'varchar', 'precision' => 15,'nullable' => True),
+                                               'p_entity_id' => array('type' 
=> 'int', 'precision' => 4,'nullable' => True,'default' => '0'),
+                                               'p_cat_id' => array('type' => 
'int', 'precision' => 4,'nullable' => True,'default' => '0'),
+                                               'descr' => array('type' => 
'text','nullable' => True),
+                                               'unit' => array('type' => 
'varchar', 'precision' => 10,'nullable' => True),
+                                               'quantity' => array('type' => 
'decimal', 'precision' => 20, 'scale' => 2,'nullable' => True),
+                                               'frequency' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
+                                               'user_id' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
+                                               'entry_date' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
+                                               'test' => array('type' => 
'text','nullable' => True),
+                                               'cost' => array('type' => 
'decimal', 'precision' => 20, 'scale' => 2,'nullable' => True)
+                                               );
+                                       break;
+                               default:
+                                       return;
+                                       break;
+                       }
+                       
+                       return $fd;
+               }
+
+               function get_table_def($table)
+               {
+                       $metadata = $this->db->metadata($table);
+
+                       if($this->role=='detail')
+                       {
+                               $filtermethod= ' AND attrib_detail=2';
+                               $pk = array('agreement_id','id');
+                       }
+                       else
+                       {
+                               $filtermethod= ' AND attrib_detail=1';
+                               $pk = array('id');
+                       }
+
+                       $fd = $this->get_default_column_def($table);
+                       
+                       for ($i=0; $i<count($metadata); $i++)
+                       {
+                               $sql = "SELECT * FROM fm_s_agreement_attribute 
WHERE column_name = '" . $metadata[$i]['name'] . "' $filtermethod";
+
+                               $this->db->query($sql,__LINE__,__FILE__);
+                               while($this->db->next_record())
+                               {
+                                       if(!$precision = 
$this->db->f('precision_'))
+                                       {
+                                               $precision = 
$this->bocommon->translate_datatype_precision($this->db->f('datatype'));
+                                       }
+
+                                       $fd[$metadata[$i]['name']] = array(
+                                               'type' => 
$this->bocommon->translate_datatype_insert(stripslashes($this->db->f('datatype'))),
+                                               'precision' => $precision,
+                                               'nullable' => 
stripslashes($this->db->f('nullable')),
+                                               'default' => 
stripslashes($this->db->f('default_value')),
+                                               'scale' => $this->db->f('scale')
+                                                       );
+                                       unset($precision);
+                               }
+                       }
+
+                       $table_def = array(
+                               $table =>       array(
+                                       'fd' => $fd
+                                       )
+                               );
+                       
+                       $table_def[$table]['pk'] = $pk;
+                       $table_def[$table]['fk'] = array();                     
+                       $table_def[$table]['ix'] = array();                     
+                       $table_def[$table]['uc'] = array();                     
+
+                       return $table_def;
+               }
+
+
                function edit_attrib($attrib)
                {
                        $attribute_table = 'fm_s_agreement_attribute';
@@ -1254,43 +1358,60 @@
                                $table = 'fm_s_agreement';
                        }
 
-                       $this->db->query("SELECT column_name FROM 
$attribute_table WHERE id='" . $attrib['id']. "' $filtermethod");
+                       $this->db->query("SELECT column_name, datatype, 
precision_ FROM $attribute_table WHERE id='" . $attrib['id']. "' 
$filtermethod");
                        $this->db->next_record();
                        $OldColumnName          = $this->db->f('column_name');
+                       $OldColumnName          = $this->db->f('column_name');
+                       $OldDataType            = $this->db->f('datatype');
+                       $OldPrecision           = $this->db->f('precision_');
 
+                       $table_def = $this->get_table_def($table);      
                        $this->db->transaction_begin();
 
+                       $value_set=array(
+                               'input_text'    => $attrib['input_text'],
+                               'statustext'    => $attrib['statustext'],
+                               'search'        => $attrib['search'],
+                               'list'          => $attrib['list'],
+                               );
+
+                       $value_set      = 
$this->bocommon->validate_db_update($value_set);
+
+                       $this->db->query("UPDATE $attribute_table set 
$value_set WHERE id=" . $attrib['id'] . $filtermethod);
+
                        $attrib_type=$attrib['column_info']['type'];
-                       if(($OldColumnName !=$attrib['column_name']) || 
($attrib['column_info']['type'] != $this->db->f('datatype')))
+
+                       $this->init_process();
+                       
+                       $this->oProc->m_odb->transaction_begin();
+
+                       $this->oProc->m_aTables = $table_def;
+
+
+                       if($OldColumnName !=$attrib['column_name'])
                        {
-                               $value_set=array(
-                                       'column_name'           => 
$attrib['column_name'],
-                                       'input_text'            => 
$attrib['input_text'],
-                                       'statustext'            => 
$attrib['statustext'],
-                                       'lookup_form'           => 
$attrib['lookup_form'],
-                                       'search'                        => 
$attrib['search'],
-                                       'list'                          => 
$attrib['list'],
-                                       'datatype'                      => 
$attrib['column_info']['type'],
-                                       'precision_'            => 
$attrib['column_info']['precision'],
-                                       'scale'                         => 
$attrib['column_info']['scale'],
-                                       'default_value'         => 
$attrib['column_info']['default'],
-                                       'nullable'                      => 
$attrib['column_info']['nullable']
-                                       );
+                               $value_set=array('column_name'  => 
$attrib['column_name']);
 
                                $value_set      = 
$this->bocommon->validate_db_update($value_set);
 
                                $this->db->query("UPDATE $attribute_table set 
$value_set WHERE id=" . $attrib['id'] . $filtermethod);
 
-                               if($attrib['column_info']['type']=='email' && 
!$attrib['column_info']['precision'])
+                               $this->oProc->RenameColumn($table, 
$OldColumnName, $attrib['column_name']);
+                       }
+
+                       if (($OldDataType != $attrib['column_info']['type']) || 
($OldPrecision != $attrib['column_info']['precision']) )
+                       {
+                               if($attrib['column_info']['type']!='R' && 
$attrib['column_info']['type']!='CH' && $attrib['column_info']['type']!='LB')
                                {
-                                       $attrib['column_info']['precision']=64;
+                                       $this->db->query("DELETE FROM 
$choice_table WHERE  attrib_id=" . $attrib['id'] . $filtermethod);
                                }
 
-                               $attrib['column_info']['type']  = 
$this->bocommon->translate_datatype_insert($attrib['column_info']['type']);
-
-                               if($attrib['column_info']['type']=='int' && 
!$attrib['column_info']['precision'])
+                               if(!$attrib['column_info']['precision'])
                                {
-                                       $attrib['column_info']['precision']=4;
+                                       if($precision = 
$this->bocommon->translate_datatype_precision($attrib['column_info']['type']))
+                                       {
+                                               
$attrib['column_info']['precision']=$precision;
+                                       }
                                }
 
                                if(!$attrib['column_info']['default'])
@@ -1298,12 +1419,22 @@
                                        
unset($attrib['column_info']['default']);
                                }
 
-                               $this->init_process();
+                               $value_set=array(
+                                       'column_name'   => 
$attrib['column_name'],
+                                       'datatype'      => 
$attrib['column_info']['type'],
+                                       'precision_'    => 
$attrib['column_info']['precision'],
+                                       'scale'         => 
$attrib['column_info']['scale'],
+                                       'default_value' => 
$attrib['column_info']['default'],
+                                       'nullable'      => 
$attrib['column_info']['nullable']
+                                       );
 
-                               
$this->oProc->AlterColumn($table,$OldColumnName,$attrib['column_name'],$attrib['column_info']);
+                               $value_set      = 
$this->bocommon->validate_db_update($value_set);
 
-                       }
+                               $this->db->query("UPDATE $attribute_table set 
$value_set WHERE id=" . $attrib['id'] . $filtermethod);
 
+                               $attrib['column_info']['type']  = 
$this->bocommon->translate_datatype_insert($attrib['column_info']['type']);
+                               
$this->oProc->AlterColumn($table,$OldColumnName,$attrib['column_name'],$attrib['column_info']);
+                       }
 
                        if($attrib['new_choice'])
                        {
@@ -1326,7 +1457,6 @@
                                . "VALUES ($values)");
                        }
 
-
                        if($attrib['delete_choice'])
                        {
                                for 
($i=0;$i<count($attrib['delete_choice']);$i++)
@@ -1335,24 +1465,16 @@
                                }
                        }
 
-//html_print_r($attrib_type);
-                       if($attrib_type!='R' && $attrib_type!='CH' && 
$attrib_type!='LB')
-                       {
-                               $this->db->query("DELETE FROM $choice_table 
WHERE  attrib_id=" . $attrib['id'] . $filtermethod);
-                       }
-
-
                        $this->db->transaction_commit();
+                       $this->oProc->m_odb->transaction_commit();
 
                        $receipt['message'][] = array('msg'     => 
lang('Attribute has been edited'));
 
-
                        return $receipt;
-
                }
+
                function resort_attrib($data)
                {
-//html_print_r($data);
                        $attribute_table = 'fm_s_agreement_attribute';
                        if(is_array($data))
                        {
Index: property/inc/class.uiagreement.inc.php
diff -u property/inc/class.uiagreement.inc.php:1.18 
property/inc/class.uiagreement.inc.php:1.19
--- property/inc/class.uiagreement.inc.php:1.18 Fri Feb  3 12:05:49 2006
+++ property/inc/class.uiagreement.inc.php      Sun Feb 12 12:46:47 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage agreement
-       * @version $Id: class.uiagreement.inc.php,v 1.18 2006/02/03 12:05:49 
sigurdne Exp $
+       * @version $Id: class.uiagreement.inc.php,v 1.19 2006/02/12 12:46:47 
sigurdne Exp $
        */
 
        /**
@@ -1788,13 +1788,13 @@
                                        $receipt['error'][] = 
array('msg'=>lang('Datatype type not choosen!'));
                                }
 
-                               
if(!ctype_digit($values['column_info']['precision']))
+                               
if(!ctype_digit($values['column_info']['precision']) && 
$values['column_info']['precision'])
                                {
                                        
$receipt['error'][]=array('msg'=>lang('Please enter precision as integer !'));
                                        
unset($values['column_info']['precision']);
                                }
 
-                               
if(!ctype_digit($values['column_info']['scale']))
+                               
if(!ctype_digit($values['column_info']['scale']) && 
$values['column_info']['scale'])
                                {
                                        
$receipt['error'][]=array('msg'=>lang('Please enter scale as integer !'));
                                        unset($values['column_info']['scale']);
@@ -1843,9 +1843,18 @@
                        );
        //html_print_r($values);
 
-                       if($values['column_info']['type']=='R' || 
$values['column_info']['type']=='CH' || $values['column_info']['type']=='LB')
+                       if(is_array($values['column_info']))
                        {
-                               $multiple_choice= True;
+                               if($values['column_info']['type']=='R' || 
$values['column_info']['type']=='CH' || $values['column_info']['type']=='LB')
+                               {
+                                       $multiple_choice= True;
+                               }
+                               
+                               $column_type = $values['column_info']['type'];
+                               $column_precision 
=$values['column_info']['precision'];
+                               $column_scale =$values['column_info']['scale'];
+                               $column_default 
=$values['column_info']['default'];
+                               $column_nullable 
=$values['column_info']['nullable'];
                        }
 
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
@@ -1889,24 +1898,24 @@
                                'lang_datatype'                         => 
lang('Datatype'),
                                'lang_datatype_statustext'      => lang('Select 
a datatype'),
                                'lang_no_datatype'                      => 
lang('No datatype'),
-                               'datatype_list'                         => 
$this->bocommon->select_datatype($values['column_info']['type']),
+                               'datatype_list'                         => 
$this->bocommon->select_datatype($column_type),
 
                                'lang_precision'                        => 
lang('Precision'),
                                'lang_precision_statustext'     => lang('enter 
the record length'),
-                               'value_precision'                       => 
$values['column_info']['precision'],
+                               'value_precision'                       => 
$column_precision,
 
                                'lang_scale'                            => 
lang('scale'),
                                'lang_scale_statustext'         => lang('enter 
the scale if type is decimal'),
-                               'value_scale'                           => 
$values['column_info']['scale'],
+                               'value_scale'                           => 
$column_scale,
 
                                'lang_default'                          => 
lang('default'),
                                'lang_default_statustext'       => lang('enter 
the default value'),
-                               'value_default'                         => 
$values['column_info']['default'],
+                               'value_default'                         => 
$column_default,
 
                                'lang_nullable'                         => 
lang('Nullable'),
                                'lang_nullable_statustext'      => lang('Chose 
if this column is nullable'),
                                'lang_select_nullable'          => lang('Select 
nullable'),
-                               'nullable_list'                         => 
$this->bocommon->select_nullable($values['column_info']['nullable']),
+                               'nullable_list'                         => 
$this->bocommon->select_nullable($column_nullable),
 
                                'value_list'                            => 
$values['list'],
                                'lang_list'                                     
=> lang('show in list'),
Index: property/inc/class.uis_agreement.inc.php
diff -u property/inc/class.uis_agreement.inc.php:1.24 
property/inc/class.uis_agreement.inc.php:1.25
--- property/inc/class.uis_agreement.inc.php:1.24       Fri Feb  3 12:05:49 2006
+++ property/inc/class.uis_agreement.inc.php    Sun Feb 12 12:46:47 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage agreement
-       * @version $Id: class.uis_agreement.inc.php,v 1.24 2006/02/03 12:05:49 
sigurdne Exp $
+       * @version $Id: class.uis_agreement.inc.php,v 1.25 2006/02/12 12:46:47 
sigurdne Exp $
        */
 
        /**
@@ -1619,7 +1619,7 @@
                                        $receipt['error'][] = 
array('msg'=>lang('Datatype type not choosen!'));
                                }
 
-                               
if(!ctype_digit($values['column_info']['precision']))
+                               
if(!ctype_digit($values['column_info']['precision']) && 
$values['column_info']['precision'])
                                {
                                        
$receipt['error'][]=array('msg'=>lang('Please enter precision as integer !'));
                                        
unset($values['column_info']['precision']);
@@ -1674,9 +1674,18 @@
                        );
        //html_print_r($values);
 
-                       if($values['column_info']['type']=='R' || 
$values['column_info']['type']=='CH' || $values['column_info']['type']=='LB')
+                       if(is_array($values['column_info']))
                        {
-                               $multiple_choice= True;
+                               if($values['column_info']['type']=='R' || 
$values['column_info']['type']=='CH' || $values['column_info']['type']=='LB')
+                               {
+                                       $multiple_choice= True;
+                               }
+                               
+                               $column_type = $values['column_info']['type'];
+                               $column_precision 
=$values['column_info']['precision'];
+                               $column_scale =$values['column_info']['scale'];
+                               $column_default 
=$values['column_info']['default'];
+                               $column_nullable 
=$values['column_info']['nullable'];
                        }
 
 
@@ -1686,27 +1695,27 @@
                        (
                                'lang_choice'                           => 
lang('Choice'),
                                'lang_new_value'                        => 
lang('New value'),
-                               'lang_new_value_statustext'     => lang('New 
value for mulitple choice'),
+                               'lang_new_value_statustext'             => 
lang('New value for mulitple choice'),
                                'multiple_choice'                       => 
$multiple_choice,
                                'value_choice'                          => 
$values['choice'],
                                'lang_delete_value'                     => 
lang('Delete value'),
                                'lang_value'                            => 
lang('value'),
-                               'lang_delete_choice_statustext'=> lang('Delete 
this value from the list of multiple choice'),
+                               'lang_delete_choice_statustext'         => 
lang('Delete this value from the list of multiple choice'),
                                'msgbox_data'                           => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'form_action'                           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
                                'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uis_agreement.list_attribute&type_id='.$type_id
 . '&role=' . $this->role),
-                               'lang_id'                                       
=> lang('Attribute ID'),
-                               'lang_save'                                     
=> lang('save'),
-                               'lang_done'                                     
=> lang('done'),
-                               'value_id'                                      
=> $id,
-
-                               'lang_column_name'                              
=> lang('Column name'),
-                               'value_column_name'                             
=> $values['column_name'],
-                               'lang_column_name_statustext'   => lang('enter 
the name for the column'),
-
-                               'lang_input_text'                               
=> lang('input text'),
-                               'value_input_text'                              
=> $values['input_text'],
-                               'lang_input_name_statustext'    => lang('enter 
the input text for records'),
+                               'lang_id'                               => 
lang('Attribute ID'),
+                               'lang_save'                             => 
lang('save'),
+                               'lang_done'                             => 
lang('done'),
+                               'value_id'                              => $id,
+
+                               'lang_column_name'                      => 
lang('Column name'),
+                               'value_column_name'                     => 
$values['column_name'],
+                               'lang_column_name_statustext'           => 
lang('enter the name for the column'),
+
+                               'lang_input_text'                       => 
lang('input text'),
+                               'value_input_text'                      => 
$values['input_text'],
+                               'lang_input_name_statustext'            => 
lang('enter the input text for records'),
 
                                'lang_id_attribtext'            => lang('Enter 
the attribute ID'),
                                'lang_entity_statustext'        => lang('Select 
a s_agreement type'),
@@ -1721,24 +1730,24 @@
                                'lang_datatype'                         => 
lang('Datatype'),
                                'lang_datatype_statustext'      => lang('Select 
a datatype'),
                                'lang_no_datatype'                      => 
lang('No datatype'),
-                               'datatype_list'                         => 
$this->bocommon->select_datatype($values['column_info']['type']),
+                               'datatype_list'                         => 
$this->bocommon->select_datatype($column_type),
 
                                'lang_precision'                        => 
lang('Precision'),
                                'lang_precision_statustext'     => lang('enter 
the record length'),
-                               'value_precision'                       => 
$values['column_info']['precision'],
+                               'value_precision'                       => 
$column_precision,
 
                                'lang_scale'                            => 
lang('scale'),
                                'lang_scale_statustext'         => lang('enter 
the scale if type is decimal'),
-                               'value_scale'                           => 
$values['column_info']['scale'],
+                               'value_scale'                           => 
$column_scale,
 
                                'lang_default'                          => 
lang('default'),
                                'lang_default_statustext'       => lang('enter 
the default value'),
-                               'value_default'                         => 
$values['column_info']['default'],
+                               'value_default'                         => 
$column_default,
 
                                'lang_nullable'                         => 
lang('Nullable'),
                                'lang_nullable_statustext'      => lang('Chose 
if this column is nullable'),
                                'lang_select_nullable'          => lang('Select 
nullable'),
-                               'nullable_list'                         => 
$this->bocommon->select_nullable($values['column_info']['nullable']),
+                               'nullable_list'                         => 
$this->bocommon->select_nullable($column_nullable),
 
                                'value_list'                            => 
$values['list'],
                                'lang_list'                                     
=> lang('show in list'),




reply via email to

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