phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property/inc class.soactor.inc.php class.uiacto...


From: Sigurd Nes
Subject: [Phpgroupware-cvs] property/inc class.soactor.inc.php class.uiacto...
Date: Tue, 07 Feb 2006 14:44:28 +0000

CVSROOT:        /sources/phpgroupware
Module name:    property
Branch:         
Changes by:     Sigurd Nes <address@hidden>     06/02/07 14:44:28

Modified files:
        inc            : class.soactor.inc.php class.uiactor.inc.php 

Log message:
        

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.soactor.inc.php.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uiactor.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.11 
property/inc/class.soactor.inc.php:1.12
--- property/inc/class.soactor.inc.php:1.11     Mon Jan 30 22:14:19 2006
+++ property/inc/class.soactor.inc.php  Tue Feb  7 14:44:28 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.11 2006/01/30 22:14:19 
sigurdne Exp $
+       * @version $Id: class.soactor.inc.php,v 1.12 2006/02/07 14:44:28 
sigurdne Exp $
        */
 
        /**
@@ -714,8 +714,8 @@
 
                function init_process()
                {
-                       $this->oProc                                            
= 
CreateObject('phpgwapi.schema_proc',$GLOBALS['phpgw_info']['server']['db_type']);
-                       $this->oProc->m_odb                                     
= $this->db;
+                       $this->oProc                            = 
CreateObject('phpgwapi.schema_proc',$GLOBALS['phpgw_info']['server']['db_type']);
+                       $this->oProc->m_odb                     = $this->db;
                        $this->oProc->m_odb->Halt_On_Error      = 'report';
                }
 
@@ -731,18 +731,22 @@
 
                        $choice_table = 'fm_' . $this->role . '_choice';
 
-                       $this->db->query("SELECT column_name FROM 
$attribute_table WHERE id='" . $attrib['id']. "'");
+                       $this->db->query("SELECT column_name, 
datatype,precision_ FROM $attribute_table WHERE id='" . $attrib['id']. "'");
                        $this->db->next_record();
                        $OldColumnName          = $this->db->f('column_name');
+                       $OldDataType            = $this->db->f('datatype');
+                       $OldPrecision           = $this->db->f('precision_');   
                
 
+                       $this->init_process();
+                       $this->oProc->m_odb->transaction_begin();
                        $this->db->transaction_begin();
 
                        $value_set=array(
                                'input_text'            => 
$attrib['input_text'],
                                'statustext'            => 
$attrib['statustext'],
                                'lookup_form'           => 
$attrib['lookup_form'],
-                               'search'                        => 
$attrib['search'],
-                               'list'                          => 
$attrib['list'],
+                               'search'                => $attrib['search'],
+                               'list'                  => $attrib['list'],
                                );
 
                        $value_set      = 
$this->bocommon->validate_db_update($value_set);
@@ -750,6 +754,7 @@
                        $this->db->query("UPDATE $attribute_table set 
$value_set WHERE id=" . $attrib['id']);
 
                        $attrib_type=$attrib['column_info']['type'];
+                       
                        if(($OldColumnName !=$attrib['column_name']) || 
($attrib['column_info']['type'] != $this->db->f('datatype')))
                        {
                                $value_set=array(
@@ -782,8 +787,7 @@
                                        
unset($attrib['column_info']['default']);
                                }
 
-                               $this->init_process();
-
+                               
                                
$this->oProc->AlterColumn($table,$OldColumnName,$attrib['column_name'],$attrib['column_info']);
 
                        }
@@ -822,7 +826,8 @@
 
 
                        $this->db->transaction_commit();
-
+                       $this->oProc->m_odb->transaction_commit();
+                       
                        $receipt['message'][] = array('msg'     => 
lang('Attribute has been edited'));
 
 
Index: property/inc/class.uiactor.inc.php
diff -u property/inc/class.uiactor.inc.php:1.13 
property/inc/class.uiactor.inc.php:1.14
--- property/inc/class.uiactor.inc.php:1.13     Fri Feb  3 12:05:49 2006
+++ property/inc/class.uiactor.inc.php  Tue Feb  7 14:44:28 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.uiactor.inc.php,v 1.13 2006/02/03 12:05:49 
sigurdne Exp $
+       * @version $Id: class.uiactor.inc.php,v 1.14 2006/02/07 14:44:28 
sigurdne Exp $
        */
 
 
@@ -833,9 +833,17 @@
                        );
        //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'];
                        }
 
 
@@ -870,44 +878,42 @@
                                'lang_id_attribtext'            => lang('Enter 
the attribute ID'),
                                'lang_entity_statustext'        => lang('Select 
a actor type'),
 
-                               'lang_statustext'                       => 
lang('Statustext'),
+                               'lang_statustext'               => 
lang('Statustext'),
                                'lang_statustext_attribtext'=> lang('Enter a 
statustext for the inputfield in forms'),
-                               'value_statustext'                      => 
$values['statustext'],
+                               'value_statustext'              => 
$values['statustext'],
 
                                'lang_done_attribtext'          => lang('Back 
to the list'),
                                'lang_save_attribtext'          => lang('Save 
the attribute'),
 
-                               'lang_datatype'                         => 
lang('Datatype'),
+                               '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']),
+                               'lang_no_datatype'              => lang('No 
datatype'),
+                               'datatype_list'                 => 
$this->bocommon->select_datatype($column_type),
 
-                               'lang_precision'                        => 
lang('Precision'),
+                               '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'                    => 
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'                  => 
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'                 => 
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'),
+                               'value_list'                    => 
$values['list'],
+                               'lang_list'                     => lang('show 
in list'),
                                'lang_list_statustext'          => lang('check 
to show this attribute in location list'),
 
-                               'value_search'                          => 
$values['search'],
+                               'value_search'                  => 
$values['search'],
                                'lang_include_search'           => 
lang('Include in search'),
                                'lang_include_search_statustext'=> lang('check 
to show this attribute in location list'),
-
-
                        );
        //html_print_r($data);
 




reply via email to

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