fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10782] Logistic, property and bim: prepare for bim i


From: Sigurd Nes
Subject: [Fmsystem-commits] [10782] Logistic, property and bim: prepare for bim inventory
Date: Mon, 11 Feb 2013 10:26:37 +0000

Revision: 10782
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10782
Author:   sigurdne
Date:     2013-02-11 10:26:36 +0000 (Mon, 11 Feb 2013)
Log Message:
-----------
Logistic, property and bim: prepare for bim inventory

Modified Paths:
--------------
    trunk/bim/setup/setup.inc.php
    trunk/bim/setup/tables_current.inc.php
    trunk/bim/setup/tables_update.inc.php
    trunk/logistic/setup/setup.inc.php
    trunk/logistic/setup/tables_current.inc.php
    trunk/property/inc/class.soagreement.inc.php
    trunk/property/inc/class.sogeneric.inc.php
    trunk/property/inc/class.sopricebook.inc.php
    trunk/property/inc/class.sotemplate.inc.php
    trunk/property/inc/class.sowo_hour.inc.php
    trunk/property/inc/class.uiagreement.inc.php
    trunk/property/inc/class.uipricebook.inc.php
    trunk/property/inc/class.uiwo_hour.inc.php
    trunk/property/setup/default_records.inc.php
    trunk/property/setup/setup.inc.php
    trunk/property/setup/tables_current.inc.php
    trunk/property/setup/tables_update.inc.php
    trunk/property/templates/base/hour_data_view.xsl
    trunk/property/templates/base/wo_hour.xsl

Modified: trunk/bim/setup/setup.inc.php
===================================================================
--- trunk/bim/setup/setup.inc.php       2013-02-11 09:43:06 UTC (rev 10781)
+++ trunk/bim/setup/setup.inc.php       2013-02-11 10:26:36 UTC (rev 10782)
@@ -12,7 +12,7 @@
        */
 
        $setup_info['bim']['name']                      = 'bim';
-       $setup_info['bim']['version']           = '0.9.17.505';
+       $setup_info['bim']['version']           = '0.9.17.506';
        $setup_info['bim']['app_order']         = 8;
        $setup_info['bim']['enable']            = 1;
        $setup_info['bim']['app_group']         = 'office';
@@ -34,7 +34,8 @@
        (
                'fm_bim_type',
                'fm_bim_model',
-               'fm_bim_item'
+               'fm_bim_item',
+               'fm_bim_item_inventory'
        );
 
        /* The hooks this app includes, needed for hooks registration */

Modified: trunk/bim/setup/tables_current.inc.php
===================================================================
--- trunk/bim/setup/tables_current.inc.php      2013-02-11 09:43:06 UTC (rev 
10781)
+++ trunk/bim/setup/tables_current.inc.php      2013-02-11 10:26:36 UTC (rev 
10782)
@@ -68,5 +68,30 @@
                                ),
                        'ix' => array(),
                        'uc' => array('guid')
-               )
+               ),
+               'fm_bim_item_inventory' => array(
+                       'fd' => array(
+                               'id' => array('type' => 'int', 'precision' => 
4,'nullable' => False),
+                               'location_id' => array('type' => 'int', 
'precision' => 4,'nullable' => False),
+                               'item_id' => array('type' => 'int', 'precision' 
=> 4,'nullable' => False),
+                               'p_location_id' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
+                               'p_id' => array('type' => 'int', 'precision' => 
4,'nullable' => True),
+                               'unit_id' => array('type' => 'int', 'precision' 
=> 4,'nullable' => False),
+                               'inventory' => array('type' => 'int', 
'precision' => 4,'nullable' => False),
+                               'write_off' => array('type' => 'int', 
'precision' => 4,'nullable' => False),
+                               'bookable' => array('type' => 'int', 
'precision' => 2,'nullable' => False),
+                               'active_from' => array('type' => 'int', 
'precision' => 8,'nullable' => True),
+                               'active_to' => array('type' => 'int', 
'precision' => 8,'nullable' => True),
+                               'created_on' => array('type' => 'int', 
'precision' => 8,'nullable' => False),
+                               'created_by' => array('type' => 'int', 
'precision' => 4,'nullable' => False),
+                               'expired_on' => array('type' => 'int', 
'precision' => 8,'nullable' => True),
+                               'expired_by' => array('type' => 'int', 
'precision' => 8,'nullable' => True),
+                               'remark' => array('type' => 'text','nullable' 
=> True)
+                       ),
+                       'pk' => array('id'),
+                       'fk' => array(),
+                       'ix' => array(),
+                       'uc' => array()
+               ),
+
        );

Modified: trunk/bim/setup/tables_update.inc.php
===================================================================
--- trunk/bim/setup/tables_update.inc.php       2013-02-11 09:43:06 UTC (rev 
10781)
+++ trunk/bim/setup/tables_update.inc.php       2013-02-11 10:26:36 UTC (rev 
10782)
@@ -125,3 +125,44 @@
                        return $GLOBALS['setup_info']['bim']['currentver'];
                }
        }
+       /**
+       * Update bim version from 0.9.17.505 to 0.9.17.506
+       */
+       $test[] = '0.9.17.505';
+       function bim_upgrade0_9_17_505()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               $GLOBALS['phpgw_setup']->oProc->CreateTable(
+                       'fm_bim_item_inventory', array(
+                               'fd' => array(
+                                       'id' => array('type' => 'auto', 
'precision' => 4,'nullable' => False),
+                                       'location_id' => array('type' => 'int', 
'precision' => 4,'nullable' => False),
+                                       'item_id' => array('type' => 'int', 
'precision' => 4,'nullable' => False),
+                                       'p_location_id' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
+                                       'p_id' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
+                                       'unit_id' => array('type' => 'int', 
'precision' => 4,'nullable' => False),
+                                       'inventory' => array('type' => 'int', 
'precision' => 4,'nullable' => False),
+                                       'write_off' => array('type' => 'int', 
'precision' => 4,'nullable' => False),
+                                       'bookable' => array('type' => 'int', 
'precision' => 2,'nullable' => False),
+                                       'active_from' => array('type' => 'int', 
'precision' => 8,'nullable' => True),
+                                       'active_to' => array('type' => 'int', 
'precision' => 8,'nullable' => True),
+                                       'created_on' => array('type' => 'int', 
'precision' => 8,'nullable' => False),
+                                       'created_by' => array('type' => 'int', 
'precision' => 4,'nullable' => False),
+                                       'expired_on' => array('type' => 'int', 
'precision' => 8,'nullable' => True),
+                                       'expired_by' => array('type' => 'int', 
'precision' => 8,'nullable' => True),
+                                       'remark' => array('type' => 
'text','nullable' => True)
+                               ),
+                               'pk' => array('id'),
+                               'fk' => array(),//'fm_bim_item' => 
array('location_id' => 'location_id')), 'item_id'=> 'id')),
+                               'ix' => array(),
+                               'uc' => array()
+                       )
+               );
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['bim']['currentver'] = 
'0.9.17.506';
+                       return $GLOBALS['setup_info']['bim']['currentver'];
+               }
+       }

Modified: trunk/logistic/setup/setup.inc.php
===================================================================
--- trunk/logistic/setup/setup.inc.php  2013-02-11 09:43:06 UTC (rev 10781)
+++ trunk/logistic/setup/setup.inc.php  2013-02-11 10:26:36 UTC (rev 10782)
@@ -11,10 +11,10 @@
                        'lg_project_type',
                        'lg_activity',
                        'lg_requirement',
-                       'lg_requirement_resource_allocation',
                        'lg_resource_type_requirement',
                        'lg_requirement_value',
-                       'lg_calendar'
+                       'lg_calendar',
+                       'lg_requirement_resource_allocation',
        );
 
        $setup_info['logistic']['description'] = 'Bergen kommune logistics 
module';

Modified: trunk/logistic/setup/tables_current.inc.php
===================================================================
--- trunk/logistic/setup/tables_current.inc.php 2013-02-11 09:43:06 UTC (rev 
10781)
+++ trunk/logistic/setup/tables_current.inc.php 2013-02-11 10:26:36 UTC (rev 
10782)
@@ -71,6 +71,24 @@
                                'ix' => array(),
                                'uc' => array()
                ),
+               'lg_calendar' => array(
+                               'fd' => array(
+                                               'id' => array('type' => 'auto', 
'precision' => 4, 'nullable' => false),
+                                               'location_id' => array('type' 
=> 'int', 'precision' => 4, 'nullable' => false),
+                                               'item_id' => array('type' => 
'int', 'precision' => 4, 'nullable' => false),
+                                               'item_inventory_id' => 
array('type' => 'int', 'precision' => 4, 'nullable' => false),
+                                               'create_user' => array('type' 
=> 'int', 'precision' => 4, 'nullable' => false),
+                                               'create_date' => array('type' 
=> 'int', 'precision' => 8, 'nullable' => false),
+                                               'start_date' => array('type' => 
'int', 'precision' => 8, 'nullable' => false),
+                                               'end_date' => array('type' => 
'int', 'precision' => 8, 'nullable' => false),
+                               ),
+                               'pk' => array('id'),
+                               'fk' => array(
+                                               'phpgw_locations' => 
array('location_id' => 'location_id')
+                               ),
+                               'ix' => array(),
+                               'uc' => array()
+               ),
                'lg_requirement_resource_allocation' => array(
                                'fd' => array(
                                                'id' => array('type' => 'auto', 
'precision' => 4, 'nullable' => false),
@@ -124,22 +142,5 @@
                                'ix' => array(),
                                'uc' => array()
                ),
-               'lg_calendar' => array(
-                               'fd' => array(
-                                               'id' => array('type' => 'auto', 
'precision' => 4, 'nullable' => false),
-                                               'location_id' => array('type' 
=> 'int', 'precision' => 4, 'nullable' => false),
-                                               'item_id' => array('type' => 
'int', 'precision' => 4, 'nullable' => false),
-                                               'item_inventory_id' => 
array('type' => 'int', 'precision' => 4, 'nullable' => false),
-                                               'create_user' => array('type' 
=> 'int', 'precision' => 4, 'nullable' => false),
-                                               'create_date' => array('type' 
=> 'int', 'precision' => 8, 'nullable' => false),
-                                               'start_date' => array('type' => 
'int', 'precision' => 8, 'nullable' => false),
-                                               'end_date' => array('type' => 
'int', 'precision' => 8, 'nullable' => false),
-                               ),
-                               'pk' => array('id'),
-                               'fk' => array(
-                                               'phpgw_locations' => 
array('location_id' => 'location_id')
-                               ),
-                               'ix' => array(),
-                               'uc' => array()
-               )
+
 );

Modified: trunk/property/inc/class.soagreement.inc.php
===================================================================
--- trunk/property/inc/class.soagreement.inc.php        2013-02-11 09:43:06 UTC 
(rev 10781)
+++ trunk/property/inc/class.soagreement.inc.php        2013-02-11 10:26:36 UTC 
(rev 10782)
@@ -400,12 +400,15 @@
                        $entity_table = 'fm_activity_price_index';
 
                        $paranthesis ='(';
-                       $joinmethod = " $this->join fm_activities ON ( 
fm_activities.id = $entity_table.activity_id))";
+                       $joinmethod = " {$this->join} fm_activities ON ( 
fm_activities.id = $entity_table.activity_id))";
+                       $paranthesis .='(';
+                       $joinmethod .= " {$this->join} fm_standard_unit ON 
(fm_activities.unit = fm_standard_unit.id))";
 
                        $cols = "fm_activities.*, 
$entity_table.m_cost,$entity_table.w_cost,"
-                               . " 
$entity_table.total_cost,$entity_table.index_count,"
-                               . " 
$entity_table.index_date,$entity_table.activity_id,"
-                               . " 
$entity_table.this_index,$entity_table.agreement_id";
+                               . " 
{$entity_table}.total_cost,$entity_table.index_count,"
+                               . " 
{$entity_table}.index_date,$entity_table.activity_id,"
+                               . " 
{$entity_table}.this_index,$entity_table.agreement_id,"
+                               . " fm_standard_unit.name AS unit_name";
 
 
                        $uicols['name'][]                       = 'activity_id';
@@ -420,7 +423,7 @@
                        $uicols['descr'][]                      = lang('descr');
                        $uicols['input_type'][]         = 'V';
 
-                       $uicols['name'][]                       = 'unit';
+                       $uicols['name'][]                       = 'unit_name';
                        $uicols['descr'][]                      = lang('unit');
                        $uicols['input_type'][]         = 'V';
 
@@ -460,10 +463,12 @@
                                        case 'm_cost':
                                        case 'num':
                                        case 'descr':
-                                       case 'unit':
                                        case 'm_cost':
                                                $ordermethod = "ORDER BY 
{$entity_table}.{$order} {$sort}";
                                                break;
+                                       case 'unit_name':
+                                               $ordermethod = "ORDER BY 
fm_standard_unit.name {$sort}";
+                                               break;
                                        default:
                                                $ordermethod = '';
                                }
@@ -514,6 +519,7 @@
                                                'num'                           
=> $this->db->f('num'),
                                                'descr'                         
=> htmlspecialchars_decode($this->db->f('descr',true)),
                                                'unit'                          
=> $this->db->f('unit'),
+                                               'unit_name'                     
=> $this->db->f('unit_name'),
                                                'm_cost'                        
=> $this->db->f('m_cost'),
                                                'w_cost'                        
=> $this->db->f('w_cost'),
                                                'total_cost'            => 
$this->db->f('total_cost'),

Modified: trunk/property/inc/class.sogeneric.inc.php
===================================================================
--- trunk/property/inc/class.sogeneric.inc.php  2013-02-11 09:43:06 UTC (rev 
10781)
+++ trunk/property/inc/class.sogeneric.inc.php  2013-02-11 10:26:36 UTC (rev 
10782)
@@ -1446,11 +1446,17 @@
                                $info = array
                                        (
                                                'table'                         
=> 'fm_standard_unit',
-                                               'id'                            
=> array('name' => 'id', 'type' => 'varchar'),
+                                               'id'                            
=> array('name' => 'id', 'type' => 'int'),
                                                'fields'                        
=> array
                                                (
                                                        array
                                                        (
+                                                               'name' => 
'name',
+                                                               'descr' => 
lang('name'),
+                                                               'type' => 
'varchar'
+                                                       ),
+                                                       array
+                                                       (
                                                                'name' => 
'descr',
                                                                'descr' => 
lang('descr'),
                                                                'type' => 
'varchar'

Modified: trunk/property/inc/class.sopricebook.inc.php
===================================================================
--- trunk/property/inc/class.sopricebook.inc.php        2013-02-11 09:43:06 UTC 
(rev 10781)
+++ trunk/property/inc/class.sopricebook.inc.php        2013-02-11 10:26:36 UTC 
(rev 10782)
@@ -40,6 +40,7 @@
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->db           = & $GLOBALS['phpgw']->db;
                        $this->join                     = & $this->db->join;
+                       $this->left_join        = & $this->db->left_join;
                        $this->like                     = & $this->db->like;
                }
 
@@ -230,14 +231,16 @@
                                $querymethod = " AND (fm_activities.descr 
$this->like '%$query%' or fm_activities.num $this->like '%$query%')";
                        }
 
-                       $sql = "SELECT fm_activities.num, fm_activities.unit, 
fm_activities.dim_d, fm_activities.ns3420, fm_activities.descr AS descr,"
+                       $sql = "SELECT DISTINCT fm_activities.num, 
fm_activities.unit, fm_activities.dim_d, fm_activities.ns3420, 
fm_activities.descr AS descr,"
                                . " fm_activities.base_descr, 
fm_activity_price_index.activity_id, fm_branch.descr AS branch,"
                                . " fm_agreement.vendor_id, 
fm_activity_price_index.total_cost, fm_activity_price_index.m_cost,"
-                               . " fm_activity_price_index.w_cost, 
fm_activity_price_index.index_count, fm_activity_price_index.this_index, 
fm_agreement.id"
+                               . " fm_activity_price_index.w_cost, 
fm_activity_price_index.index_count, fm_activity_price_index.this_index, 
fm_agreement.id,"
+                               . " fm_standard_unit.name AS unit_name"
                                . " FROM  fm_activities "
                                . " $this->join fm_activity_price_index ON 
fm_activities.id = fm_activity_price_index.activity_id "
                                . " $this->join fm_branch ON 
fm_activities.branch_id = fm_branch.id "
                                . " $this->join fm_agreement ON 
fm_activity_price_index.agreement_id = fm_agreement.id "
+                               . " {$this->join} fm_standard_unit ON 
fm_activities.unit = fm_standard_unit.id"
                                . " WHERE fm_agreement.status='active' AND 
(fm_agreement.vendor_id $vendor_condition and current_index is not null "
                                . " OR (fm_agreement.vendor_id 
$vendor_condition) AND (fm_activity_price_index.this_index IS NULL)) 
$querymethod";
 
@@ -261,21 +264,22 @@
                        {
                                $pricebook[] = array
                                        (
-                                               'activity_id'           => 
$this->db->f('activity_id'),
+                                               'activity_id'   => 
$this->db->f('activity_id'),
                                                'num'                   => 
$this->db->f('num'),
                                                'branch'                => 
$this->db->f('branch'),
                                                'vendor_id'             => 
$this->db->f('vendor_id'),
                                                'm_cost'                => 
$this->db->f('m_cost'),
                                                'w_cost'                => 
$this->db->f('w_cost'),
-                                               'total_cost'            => 
$this->db->f('total_cost'),
-                                               'this_index'            => 
$this->db->f('this_index'),
+                                               'total_cost'    => 
$this->db->f('total_cost'),
+                                               'this_index'    => 
$this->db->f('this_index'),
                                                'unit'                  => 
$this->db->f('unit'),
+                                               'unit_name'             => 
$this->db->f('unit_name'),
                                                'dim_d'                 => 
$this->db->f('dim_d'),
                                                'ns3420_id'             => 
$this->db->f('ns3420'),
                                                'descr'                 => 
htmlspecialchars_decode($this->db->f('descr',true)),
-                                               'base_descr'            => 
htmlspecialchars_decode($this->db->f('base_descr',true)),
-                                               'index_count'           => 
$this->db->f('index_count'),
-                                               'agreement_id'          => 
$this->db->f('fm_agreement.id')
+                                               'base_descr'    => 
htmlspecialchars_decode($this->db->f('base_descr',true)),
+                                               'index_count'   => 
$this->db->f('index_count'),
+                                               'agreement_id'  => 
$this->db->f('fm_agreement.id')
                                        );
                        }
                        //              _debug_array($pricebook);
@@ -481,8 +485,12 @@
                                $querymethod = " and (fm_activities.descr 
$this->like '%$query%' or fm_activities.base_descr $this->like '%$query%' or 
fm_activities.num $this->like '%$query%') ";
                        }
 
-                       $sql = "SELECT fm_activities.id AS activity_id, 
fm_activities.num, fm_activities.base_descr, fm_activities.unit, 
fm_activities.dim_d, fm_branch.descr as branch, fm_activities.descr, ns3420 "
-                               . " FROM  fm_activities $this->join fm_branch 
on fm_activities.branch_id=fm_branch.id"
+                       $sql = "SELECT DISTINCT fm_activities.id AS 
activity_id, fm_activities.num, fm_activities.base_descr,"
+                               . " fm_activities.unit, fm_activities.dim_d, 
fm_branch.descr as branch, fm_activities.descr, ns3420,"
+                               . " fm_standard_unit.name AS unit_name"
+                               . " FROM  fm_activities"
+                               . " {$this->join} fm_branch on 
fm_activities.branch_id=fm_branch.id"
+                               . " {$this->left_join} fm_standard_unit ON 
fm_activities.unit = fm_standard_unit.id"
                                . " $filtermethod $querymethod ";
 
 
@@ -509,6 +517,7 @@
                                                'dim_d'                 => 
$this->db->f('dim_d'),
                                                'ns3420'                => 
$this->db->f('ns3420'),
                                                'unit'                  => 
$this->db->f('unit'),
+                                               'unit_name'             => 
$this->db->f('unit_name'),
                                                'descr'                 => 
htmlspecialchars_decode($this->db->f('descr',true))
                                        );
                        }

Modified: trunk/property/inc/class.sotemplate.inc.php
===================================================================
--- trunk/property/inc/class.sotemplate.inc.php 2013-02-11 09:43:06 UTC (rev 
10781)
+++ trunk/property/inc/class.sotemplate.inc.php 2013-02-11 10:26:36 UTC (rev 
10782)
@@ -162,7 +162,11 @@
                                $querymethod = " AND (hours_descr $this->like 
'%$query%' or fm_template_hours.remark $this->like '%$query%' or ns3420_id 
$this->like '%$query%')";
                        }
 
-                       $sql = "SELECT fm_template_hours.*, chapter_id from 
fm_template_hours  $this->join fm_template on 
fm_template.id=fm_template_hours.template_id $filtermethod $querymethod";
+                       $sql = "SELECT fm_template_hours.*, chapter_id, 
fm_standard_unit.name AS unit_name"
+                       . " FROM fm_template_hours"
+                       . " {$this->join} fm_template on 
fm_template.id=fm_template_hours.template_id"
+                       . " {$this->join} fm_standard_unit ON 
fm_template_hours.unit = fm_standard_unit.id"
+                       . " {$filtermethod} {$querymethod}";
 
                        $this->db->query($sql,__LINE__,__FILE__);
                        $this->total_records = $this->db->num_rows();
@@ -191,6 +195,7 @@
                                                'tolerance'                     
=> $this->db->f('tolerance'),
                                                'activity_id'           => 
$this->db->f('activity_id'),
                                                'unit'                          
=> $this->db->f('unit'),
+                                               'unit_name'                     
=> $this->db->f('unit_name'),
                                                'record'                        
=> $this->db->f('record'),
                                                'cost'                          
=> $this->db->f('cost'),
                                                'billperae'                     
=> $this->db->f('billperae'),

Modified: trunk/property/inc/class.sowo_hour.inc.php
===================================================================
--- trunk/property/inc/class.sowo_hour.inc.php  2013-02-11 09:43:06 UTC (rev 
10781)
+++ trunk/property/inc/class.sowo_hour.inc.php  2013-02-11 10:26:36 UTC (rev 
10782)
@@ -110,10 +110,12 @@
                                $workorder_id = 
(isset($data['workorder_id'])?$data['workorder_id']:0);
                        }
 
-                       $ordermethod = ' order by grouping_id, record , id asc 
';
+                       $ordermethod = ' ORDER BY grouping_id, record , id ASC';
 
-                       $sql = "SELECT fm_wo_hours.*, 
fm_wo_hours_category.descr as wo_hour_category"
-                               . " FROM fm_wo_hours $this->left_join 
fm_wo_hours_category on fm_wo_hours.category = fm_wo_hours_category.id WHERE 
workorder_id='$workorder_id' ";
+                       $sql = "SELECT DISTINCT fm_wo_hours.*, 
fm_wo_hours_category.descr AS wo_hour_category, fm_standard_unit.name AS 
unit_name"
+                               . " FROM fm_wo_hours {$this->left_join} 
fm_wo_hours_category on fm_wo_hours.category = fm_wo_hours_category.id"
+                               . " {$this->left_join} fm_standard_unit ON 
fm_wo_hours.unit = fm_standard_unit.id"
+                               . " WHERE workorder_id='{$workorder_id}'";
 
                        $this->db->query($sql . $ordermethod,__LINE__,__FILE__);
                        $this->total_records = $this->db->num_rows();
@@ -134,6 +136,7 @@
                                                'tolerance'                     
=> $this->db->f('tolerance'),
                                                'activity_id'           => 
$this->db->f('activity_id'),
                                                'unit'                          
=> $this->db->f('unit'),
+                                               'unit_name'                     
=> $this->db->f('unit_name'),
                                                'record'                        
=> $this->db->f('record'),
                                                'cost'                          
=> $this->db->f('cost'),
                                                'billperae'                     
=> $this->db->f('billperae'),

Modified: trunk/property/inc/class.uiagreement.inc.php
===================================================================
--- trunk/property/inc/class.uiagreement.inc.php        2013-02-11 09:43:06 UTC 
(rev 10781)
+++ trunk/property/inc/class.uiagreement.inc.php        2013-02-11 10:26:36 UTC 
(rev 10782)
@@ -1338,7 +1338,7 @@
                                        'values'                =>      
json_encode(array(      array(key => id,                        
label=>$table_header[0]['header'],      sortable=>true,resizeable=>true),
                                        array(key => num,                       
label=>$table_header[1]['header'],      sortable=>true,resizeable=>true),
                                        array(key => descr,                     
label=>$table_header[2]['header'],      sortable=>true,resizeable=>true),
-                                       array(key => unit,                      
label=>$table_header[3]['header'],      sortable=>true,resizeable=>true, 
formatter=>FormatterCenter),
+                                       array(key => unit_name,                 
label=>$table_header[3]['header'],      sortable=>true,resizeable=>true, 
formatter=>FormatterCenter),
                                        array(key => m_cost,            
label=>$table_header[4]['header'],      sortable=>true,resizeable=>true, 
formatter=>FormatterRight),
                                        array(key => w_cost,            
label=>$table_header[5]['header'],      sortable=>true,resizeable=>true, 
formatter=>FormatterRight),
                                        array(key => total_cost,        
label=>$table_header[6]['header'],      sortable=>true,resizeable=>true, 
formatter=>FormatterRight),
@@ -2119,6 +2119,7 @@
 
                        //---datatable1 
settings---------------------------------------------------
                        //Prepare array for $datavalues[1]
+
                        for($y=0;$y<count($content);$y++)
                        {
                                for($z=0;$z<=count($content[$y]['row']);$z++)
@@ -2143,16 +2144,16 @@
                        $myColumnDefs[1] = array
                                (
                                        'name'                  => "1",
-                                       'values'                =>      
json_encode(array(      array(key => activity_id,       
label=>$table_header[0]['header'],      sortable=>true,resizeable=>true),
-                                       array(key => num,                       
label=>$table_header[1]['header'],      sortable=>true,resizeable=>true),
-                                       array(key => descr,                     
label=>$table_header[2]['header'],      sortable=>true,resizeable=>true),
-                                       array(key => unit,                      
label=>$table_header[3]['header'],      sortable=>true,resizeable=>true, 
formatter=>FormatterCenter),
-                                       array(key => m_cost,            
label=>$table_header[4]['header'],      sortable=>true,resizeable=>true, 
formatter=>FormatterRight),
-                                       array(key => w_cost,            
label=>$table_header[5]['header'],      sortable=>true,resizeable=>true, 
formatter=>FormatterRight),
-                                       array(key => total_cost,        
label=>$table_header[6]['header'],      sortable=>true,resizeable=>true, 
formatter=>FormatterRight),
-                                       array(key => this_index,        
label=>$table_header[7]['header'],      sortable=>true,resizeable=>true),
-                                       array(key => index_count,       
label=>$table_header[8]['header'],      sortable=>true,resizeable=>true, 
formatter=>FormatterCenter),
-                                       array(key => index_date,        
label=>$table_header[9]['header'],      sortable=>true,resizeable=>true)
+                                       'values'                =>      
json_encode(array(      array('key' => 'activity_id',   
'label'=>$table_header[0]['header'],    'sortable'=>true,'resizeable'=>true),
+                                       array('key' => 'num',                   
'label'=>$table_header[1]['header'],    'sortable'=>true,'resizeable'=>true),
+                                       array('key' => 'descr',                 
'label'=>$table_header[2]['header'],    'sortable'=>true,'resizeable'=>true),
+                                       array('key' => 'unit_name',             
'label'=>$table_header[3]['header'],    'sortable'=>true,'resizeable'=>true, 
'formatter'=>'FormatterCenter'),
+                                       array('key' => 'm_cost',                
'label'=>$table_header[4]['header'],    'sortable'=>true,'resizeable'=>true, 
'formatter'=>'FormatterRight'),
+                                       array('key' => 'w_cost',                
'label'=>$table_header[5]['header'],    'sortable'=>true,'resizeable'=>true, 
'formatter'=>'FormatterRight'),
+                                       array('key' => 'total_cost',    
'label'=>$table_header[6]['header'],    'sortable'=>true,'resizeable'=>true, 
'formatter'=>'FormatterRight'),
+                                       array('key' => 'this_index',    
'label'=>$table_header[7]['header'],    'sortable'=>true,'resizeable'=>true),
+                                       array('key' => 'index_count',   
'label'=>$table_header[8]['header'],    'sortable'=>true,'resizeable'=>true, 
'formatter'=>'FormatterCenter'),
+                                       array('key' => 'index_date',    
'label'=>$table_header[9]['header'],    'sortable'=>true,'resizeable'=>true)
                                )));
 
                        //---datatable2 
settings---------------------------------------------------

Modified: trunk/property/inc/class.uipricebook.inc.php
===================================================================
--- trunk/property/inc/class.uipricebook.inc.php        2013-02-11 09:43:06 UTC 
(rev 10781)
+++ trunk/property/inc/class.uipricebook.inc.php        2013-02-11 10:26:36 UTC 
(rev 10782)
@@ -1146,7 +1146,7 @@
 
                        $uicols = array (
                                'input_type'    =>      
array(hidden,text,text,text,text,text,text,text),
-                               'name'                  =>      
array(activity_id,num,descr,unit,ns3420,base_descr,branch,dim_d),
+                               'name'                  =>      
array(activity_id,num,descr,unit_name,ns3420,base_descr,branch,dim_d),
                                'formatter'             =>      
array('','','','','','','',''),
                                'descr'                 =>      
array('',lang('Activity 
Num'),lang('Description'),lang('Unit'),lang('NS3420'),lang('Base'),lang('Branch'),lang('Dim
 d'))
                        );

Modified: trunk/property/inc/class.uiwo_hour.inc.php
===================================================================
--- trunk/property/inc/class.uiwo_hour.inc.php  2013-02-11 09:43:06 UTC (rev 
10781)
+++ trunk/property/inc/class.uiwo_hour.inc.php  2013-02-11 10:26:36 UTC (rev 
10782)
@@ -422,6 +422,7 @@
                                                        'quantity'              
                        => $hour['quantity'],
                                                        'cost'                  
                        => $hour['cost'],
                                                        'unit'                  
                        => $hour['unit'],
+                                                       'unit_name'             
                        => $hour['unit_name'],
                                                        'billperae'             
                        => $hour['billperae'],
                                                        'deviation'             
                        => $deviation,
                                                        'result'                
                        => ($hour['deviation']+$hour['cost']),
@@ -834,7 +835,7 @@
                        }
 
                        $uicols = array (
-                               'name'                  =>      
array('hour_id','post','code','hours_descr','unit','billperae','quantity','cost','deviation','result','wo_hour_category','cat_per_cent'),
+                               'name'                  =>      
array('hour_id','post','code','hours_descr','unit_name','billperae','quantity','cost','deviation','result','wo_hour_category','cat_per_cent'),
                                'input_type'    =>      
array('hidden','text','text','text','text','text','text','text','text','text','text','text'),
                                'descr'                 =>      
array('',lang('Post'),lang('Code'),lang('Descr'),lang('Unit'),lang('Bill per 
unit'),lang('Quantity'),lang('Cost'),lang('deviation'),lang('result'),lang('Category'),lang('percent')),
                                'className'             =>      
array('','','','','','rightClasss','rightClasss','rightClasss','rightClasss','rightClasss','','rightClasss')
@@ -1683,6 +1684,7 @@
                                        $table_view_order[$i]['code']           
= $email_data['values_view_order'][$i]['code'];
                                        $table_view_order[$i]['descr']          
= 
$email_data['values_view_order'][$i]['hours_descr']."<br>".$email_data['values_view_order']['remark'];
                                        $table_view_order[$i]['unit']           
= $email_data['values_view_order'][$i]['unit'];
+                                       $table_view_order[$i]['unit_name']      
= $email_data['values_view_order'][$i]['unit_name'];
                                        $table_view_order[$i]['quantity']       
= $email_data['values_view_order'][$i]['quantity'];
                                        $table_view_order[$i]['billperae']      
= $email_data['values_view_order'][$i]['billperae'];
                                        $table_view_order[$i]['cost']           
= $email_data['values_view_order'][$i]['cost'];
@@ -1704,7 +1706,7 @@
                                        'values'        =>      
json_encode(array(      array('key' => 'post',          'label' => 
lang('Post'),                'sortable' => true,'resizeable' => true),
                                                                                
                                array('key' => 'code',          'label' => 
lang('Code'),                'sortable' => true,'resizeable' => true),
                                                                                
                                array('key' => 'descr',         'label' => 
lang('descr'),               'sortable' => true,'resizeable' => true),
-                                                                               
                                array('key' => 'unit',          'label' => 
lang('Unit'),                'sortable' => true,'resizeable' => true),
+                                                                               
                                array('key' => 'unit_name',     'label' => 
lang('Unit'),                'sortable' => true,'resizeable' => true),
                                                                                
                                array('key' => 'quantity',      'label' => 
lang('Quantity'),    'sortable' => true,'resizeable' => true),
                                                                                
                                array('key' => 'billperae',     'label' => 
lang('Bill per unit'),'sortable' => true,'resizeable' => true),
                                                                                
                                array('key' => 'cost',          'label' => 
lang('cost'),                'sortable' => true,'resizeable' => true)))
@@ -1872,7 +1874,7 @@
                                                $translations['post']           
        => $hour['post'],
                                                $translations['code']           
        => $hour['code'],
                                                $translations['descr']          
        => $descr,
-                                               $translations['unit']           
        => $hour['unit'],
+                                               $translations['unit']           
        => $hour['unit_name'],
                                                $translations['quantity']       
        => $hour['quantity'],
                                                $translations['billperae']      
        => $hour['billperae'],
                                                $translations['cost']           
        => $hour['cost']
@@ -2282,7 +2284,7 @@
                        $uicols = array (
                                'input_type'    =>      
array('hidden','text','hidden','hidden','text','text','text','text','text','text','hidden','varchar','select','varchar'),
                                'type'                  =>      
array('','','','','','','','','','','','text','',''),                           
-                               'name'                  =>      
array('activity_id','num','branch','vendor_id','descr','base_descr','unit','w_cost','m_cost','total_cost','this_index','quantity','wo_hour_cat','cat_per_cent'),
+                               'name'                  =>      
array('activity_id','num','branch','vendor_id','descr','base_descr','unit_name','w_cost','m_cost','total_cost','this_index','quantity','wo_hour_cat','cat_per_cent'),
                                'formatter'             =>      
array('','','','','','','','','','','','','',''),
                                'descr'                 =>      
array('',lang('Activity 
Num'),lang('Branch'),lang('Vendor'),lang('Description'),lang('Base'),lang('Unit'),lang('Labour
 cost'),lang('Material cost'),lang('Total 
Cost'),'',lang('Quantity'),lang('category'),lang('percent')),
                                'className'             =>      
array('','','','','','','','rightClasss','rightClasss','rightClasss','','','','')
@@ -2384,7 +2386,7 @@
                        //*************************************************/
 
                        $uicols_details = array (
-                               'name'                  =>      
array('hour_id','post','code','hours_descr','unit','billperae','quantity','cost','deviation','result','wo_hour_category','cat_per_cent'),
+                               'name'                  =>      
array('hour_id','post','code','hours_descr','unit_name','billperae','quantity','cost','deviation','result','wo_hour_category','cat_per_cent'),
                                'input_type'    =>      
array('hidden','text','text','text','text','text','text','text','text','text','text','text'),
                                'descr'                 =>      
array('',lang('Post'),lang('Code'),lang('Descr'),lang('Unit'),lang('Bill per 
unit'),lang('Quantity'),lang('Cost'),lang('deviation'),lang('result'),lang('Category'),lang('percent')),
                                'className'             =>      
array('','','','','','rightClasss','rightClasss','rightClasss','rightClasss','rightClasss','','rightClasss')
@@ -2764,7 +2766,7 @@
                        $uicols = array (
                                'input_type'    =>      
array('text','text','text','text','text','varchar','combo','varchar','hidden','hidden','hidden','hidden','hidden','hidden','hidden','hidden','hidden','hidden'),
                                'type'                  =>      
array('','','','','','text','','','text','','','',''),                          
-                               'name'                  =>      
array('building_part','code','hours_descr','unit','billperae','quantity','wo_hour_cat','cat_per_cent','chapter_id','grouping_descr','new_grouping','activity_id','activity_num','remark','ns3420_id','tolerance','cost','dim_d'),
+                               'name'                  =>      
array('building_part','code','hours_descr','unit_name','billperae','quantity','wo_hour_cat','cat_per_cent','chapter_id','grouping_descr','new_grouping','activity_id','activity_num','remark','ns3420_id','tolerance','cost','dim_d'),
                                'formatter'             =>      
array('','','','','','','','','','','','','','','','','','',''),
                                'descr'                 =>      
array(lang('Building 
part'),lang('Code'),lang('Description'),lang('Unit'),lang('Bill per 
unit'),lang('Quantity'),'','','','','','','','','','','',''),
                                'className'             =>      
array('','','','','rightClasss','','','','','','','','','','','','','')
@@ -2905,7 +2907,7 @@
 
 
                        $uicols_details = array (
-                               'name'                  =>      
array('hour_id','post','code','hours_descr','unit','billperae','quantity','cost','deviation','result','wo_hour_category','cat_per_cent'),
+                               'name'                  =>      
array('hour_id','post','code','hours_descr','unit_name','billperae','quantity','cost','deviation','result','wo_hour_category','cat_per_cent'),
                                'input_type'    =>      
array('hidden','text','text','text','text','text','text','text','text','text','text','text'),
                                'descr'                 =>      
array('',lang('Post'),lang('Code'),lang('Descr'),lang('Unit'),lang('Bill per 
unit'),lang('Quantity'),lang('Cost'),lang('deviation'),lang('result'),lang('Category'),lang('percent')),
                                'className'             =>      
array('','','','','','rightClasss','rightClasss','rightClasss','rightClasss','rightClasss','','rightClasss')

Modified: trunk/property/setup/default_records.inc.php
===================================================================
--- trunk/property/setup/default_records.inc.php        2013-02-11 09:43:06 UTC 
(rev 10781)
+++ trunk/property/setup/default_records.inc.php        2013-02-11 10:26:36 UTC 
(rev 10782)
@@ -279,16 +279,16 @@
 # fm_standard_unit
 #
 
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_standard_unit (id, 
descr) VALUES ('mm', 'Millimeter')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_standard_unit (id, 
descr) VALUES ('m', 'Meter')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_standard_unit (id, 
descr) VALUES ('m2', 'Square meters')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_standard_unit (id, 
descr) VALUES ('m3', 'Cubic meters')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_standard_unit (id, 
descr) VALUES ('km', 'Kilometre')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_standard_unit (id, 
descr) VALUES ('Stk', 'Stk')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_standard_unit (id, 
descr) VALUES ('kg', 'Kilogram')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_standard_unit (id, 
descr) VALUES ('tonn', 'Tonn')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_standard_unit (id, 
descr) VALUES ('h', 'Hours')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_standard_unit (id, 
descr) VALUES ('RS', 'Round Sum')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_standard_unit (id, name, 
descr) VALUES (1, 'mm', 'Millimeter')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_standard_unit (id, name, 
descr) VALUES (2, 'm', 'Meter')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_standard_unit (id, name, 
descr) VALUES (3, 'm2', 'Square meters')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_standard_unit (id, name, 
descr) VALUES (4, 'm3', 'Cubic meters')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_standard_unit (id, name, 
descr) VALUES (5, 'km', 'Kilometre')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_standard_unit (id, name, 
descr) VALUES (6, 'Stk', 'Stk')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_standard_unit (id, name, 
descr) VALUES (7, 'kg', 'Kilogram')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_standard_unit (id, name, 
descr) VALUES (8, 'tonn', 'Tonn')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_standard_unit (id, name, 
descr) VALUES (9, 'h', 'Hours')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_standard_unit (id, name, 
descr) VALUES (10, 'RS', 'Round Sum')");
 
 
 #

Modified: trunk/property/setup/setup.inc.php
===================================================================
--- trunk/property/setup/setup.inc.php  2013-02-11 09:43:06 UTC (rev 10781)
+++ trunk/property/setup/setup.inc.php  2013-02-11 10:26:36 UTC (rev 10782)
@@ -12,7 +12,7 @@
        */
 
        $setup_info['property']['name']                 = 'property';
-       $setup_info['property']['version']              = '0.9.17.663';
+       $setup_info['property']['version']              = '0.9.17.664';
        $setup_info['property']['app_order']    = 8;
        $setup_info['property']['enable']               = 1;
        $setup_info['property']['app_group']    = 'office';

Modified: trunk/property/setup/tables_current.inc.php
===================================================================
--- trunk/property/setup/tables_current.inc.php 2013-02-11 09:43:06 UTC (rev 
10781)
+++ trunk/property/setup/tables_current.inc.php 2013-02-11 10:26:36 UTC (rev 
10782)
@@ -130,8 +130,9 @@
 
                'fm_standard_unit' => array(
                        'fd' => array(
-                               'id' => array('type' => 'varchar','precision' 
=> '20','nullable' => False),
-                               'descr' => array('type' => 
'varchar','precision' => '255','nullable' => False)
+                               'id' => array('type' => 'int','precision' => 
4,'nullable' => False),
+                               'name' => array('type' => 'varchar','precision' 
=> 20,'nullable' => False),
+                               'descr' => array('type' => 
'varchar','precision' => 255,'nullable' => False)
                        ),
                        'pk' => array('id'),
                        'fk' => array(),
@@ -574,7 +575,7 @@
                                'id' => array('type' => 'int','precision' => 
'4','nullable' => False),
                                'num' => array('type' => 'varchar','precision' 
=> '25','nullable' => False),
                                'base_descr' => array('type' => 
'text','nullable' => True),
-                               'unit' => array('type' => 'varchar','precision' 
=> '4','nullable' => True),
+                               'unit' => array('type' => 'int','precision' => 
'4','nullable' => True),
                                'ns3420' => array('type' => 
'varchar','precision' => '15','nullable' => True),
                                'remarkreq' => array('type' => 
'varchar','precision' => '5','nullable' => True,'default' => 'N'),
                                'minperae' => array('type' => 'int','precision' 
=> '4','default' => '0','nullable' => True),
@@ -677,7 +678,7 @@
                                'remark' => array('type' => 'text','nullable' 
=> True),
                                'billperae' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
                                'vendor_id' => array('type' => 
'int','precision' => '4','nullable' => True),
-                               'unit' => array('type' => 'varchar','precision' 
=> '6','nullable' => True),
+                               'unit' => array('type' => 'int','precision' => 
4,'nullable' => True),
                                'ns3420_id' => array('type' => 
'varchar','precision' => '20','nullable' => True),
                                'tolerance' => array('type' => 
'int','precision' => '4','nullable' => True),
                                'building_part' => array('type' => 
'varchar','precision' => '4','nullable' => True),
@@ -744,7 +745,7 @@
                                'remark' => array('type' => 'text','nullable' 
=> True),
                                'billperae' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
                                'vendor_id' => array('type' => 
'int','precision' => '4','nullable' => True),
-                               'unit' => array('type' => 'varchar','precision' 
=> '6','nullable' => True),
+                               'unit' => array('type' => 'int','precision' => 
4,'nullable' => True),
                                'ns3420_id' => array('type' => 
'varchar','precision' => '20','nullable' => True),
                                'tolerance' => array('type' => 
'int','precision' => '4','nullable' => True),
                                'building_part' => array('type' => 
'varchar','precision' => '4','nullable' => True),
@@ -2149,7 +2150,7 @@
                                '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),
+                               'unit' => array('type' => 'int', 'precision' => 
4,'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),

Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php  2013-02-11 09:43:06 UTC (rev 
10781)
+++ trunk/property/setup/tables_update.inc.php  2013-02-11 10:26:36 UTC (rev 
10782)
@@ -7277,4 +7277,88 @@
                }
        }
 
+       /**
+       * Update property version from 0.9.17.663 to 0.9.17.664
+       * Alter id from varchar to ingeter
+       */
+       $test[] = '0.9.17.663';
+       function property_upgrade0_9_17_663()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
 
+               $GLOBALS['phpgw_setup']->oProc->query("DELETE FROM fm_cache");
+               $GLOBALS['phpgw_setup']->oProc->query("SELECT * FROM 
fm_standard_unit");
+               $units = array();
+               $i=1;
+
+               while ($GLOBALS['phpgw_setup']->oProc->next_record())
+               {
+                       $name = $GLOBALS['phpgw_setup']->oProc->f('id');
+
+                       $units[$name] = array
+                       (
+                               'id'    => $i,
+                               'name'  => $name,
+                               'descr' => 
$GLOBALS['phpgw_setup']->oProc->f('descr')
+                       );
+                       $i++;
+               }
+
+               $GLOBALS['phpgw_setup']->oProc->DropTable('fm_standard_unit');
+
+               $GLOBALS['phpgw_setup']->oProc->CreateTable(
+                       'fm_standard_unit',  array(
+                               'fd' => array(
+                                       'id' => array('type' => 
'int','precision' => 4,'nullable' => False),
+                                       'name' => array('type' => 
'varchar','precision' => 20,'nullable' => False),
+                                       'descr' => array('type' => 
'varchar','precision' => 255,'nullable' => False)
+                               ),
+                               'pk' => array('id'),
+                               'fk' => array(),
+                               'ix' => array(),
+                               'uc' => array()
+                       )
+               );
+
+               foreach ($units as $_name => $unit)
+               {
+                       $cols = implode(',', array_keys($unit));
+                       $values = 
$GLOBALS['phpgw_setup']->oProc->validate_insert(array_values($unit));
+                       $sql = "INSERT INTO fm_standard_unit ({$cols}) VALUES 
({$values})";
+                       
$GLOBALS['phpgw_setup']->oProc->query($sql,__LINE__,__FILE__);
+               }
+
+               $tables = 
array('fm_activities','fm_wo_hours','fm_template_hours','fm_s_agreement_detail');
+               foreach ($tables as $table)
+               {
+                       $metadata = 
$GLOBALS['phpgw_setup']->oProc->m_odb->metadata($table);
+                       if(!isset($metadata['unit']))
+                       {
+                               continue;
+                       }
+
+                       
$GLOBALS['phpgw_setup']->oProc->RenameColumn($table,'unit','_unit');
+                       
$GLOBALS['phpgw_setup']->oProc->AddColumn($table,'unit',array(
+                                       'type'                  => 'int',
+                                       'precision'             => 4,
+                                       'nullable'              => true,
+                               )
+                       );
+
+                       reset($units);
+                       foreach ($units as $_name => $unit)
+                       {
+                               $sql = "UPDATE {$table} SET unit = 
{$unit['id']} WHERE _unit = '{$_name}'";
+                               
$GLOBALS['phpgw_setup']->oProc->query($sql,__LINE__,__FILE__);
+                       }
+                       
$GLOBALS['phpgw_setup']->oProc->DropColumn($table,array(),'_unit');
+               }
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.664';
+                       return $GLOBALS['setup_info']['property']['currentver'];
+               }
+       }
+
+

Modified: trunk/property/templates/base/hour_data_view.xsl
===================================================================
--- trunk/property/templates/base/hour_data_view.xsl    2013-02-11 09:43:06 UTC 
(rev 10781)
+++ trunk/property/templates/base/hour_data_view.xsl    2013-02-11 10:26:36 UTC 
(rev 10782)
@@ -75,7 +75,7 @@
                                <xsl:value-of select="remark"/>
                        </td>
                        <td align="left">
-                               <xsl:value-of select="unit"/>
+                               <xsl:value-of select="unit_name"/>
                        </td>
                        <td align="right">
                                <xsl:value-of select="quantity"/>

Modified: trunk/property/templates/base/wo_hour.xsl
===================================================================
--- trunk/property/templates/base/wo_hour.xsl   2013-02-11 09:43:06 UTC (rev 
10781)
+++ trunk/property/templates/base/wo_hour.xsl   2013-02-11 10:26:36 UTC (rev 
10782)
@@ -1041,7 +1041,7 @@
                                <xsl:value-of select="remark"/>
                        </td>
                        <td align="left">
-                               <xsl:value-of select="unit"/>
+                               <xsl:value-of select="unit_name"/>
                        </td>
                        <td align="right">
                                <xsl:value-of select="quantity"/>
@@ -1394,7 +1394,7 @@
                                <xsl:value-of select="remark"/>
                        </td>
                        <td align="left">
-                               <xsl:value-of select="unit"/>
+                               <xsl:value-of select="unit_name"/>
                        </td>
                        <td align="right">
                                <xsl:choose>
@@ -1792,7 +1792,7 @@
                                <xsl:value-of select="base_descr"/>
                        </td>
                        <td align="left">
-                               <xsl:value-of select="unit"/>
+                               <xsl:value-of select="unit_name"/>
                        </td>
                        <td align="right">
                                <xsl:value-of select="w_cost"/>
@@ -1934,7 +1934,7 @@
                                <xsl:value-of select="remark"/>
                        </td>
                        <td align="left">
-                               <xsl:value-of select="unit"/>
+                               <xsl:value-of select="unit_name"/>
                        </td>
                        <td align="right">
                                <xsl:value-of select="quantity"/>




reply via email to

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