fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [7530] Merge 7526:7529 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [7530] Merge 7526:7529 from trunk
Date: Thu, 25 Aug 2011 10:39:20 +0000

Revision: 7530
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7530
Author:   sigurdne
Date:     2011-08-25 10:39:18 +0000 (Thu, 25 Aug 2011)
Log Message:
-----------
Merge 7526:7529 from trunk

Modified Paths:
--------------
    branches/Version-1_0-branch/activitycalendar/setup/tables_update.inc.php
    branches/Version-1_0-branch/property/inc/class.borequest.inc.php
    branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php
    branches/Version-1_0-branch/property/inc/class.uirequest.inc.php
    branches/Version-1_0-branch/property/inc/class.uitemplate.inc.php
    branches/Version-1_0-branch/property/inc/class.uitts.inc.php
    branches/Version-1_0-branch/property/inc/class.uiwo_hour.inc.php
    branches/Version-1_0-branch/property/inc/hook_config.inc.php
    branches/Version-1_0-branch/property/setup/setup.inc.php
    branches/Version-1_0-branch/property/setup/tables_current.inc.php
    branches/Version-1_0-branch/property/setup/tables_update.inc.php
    branches/Version-1_0-branch/property/templates/base/config.tpl
    branches/Version-1_0-branch/property/templates/base/template.xsl
    branches/Version-1_0-branch/property/templates/base/wo_hour.xsl

Added Paths:
-----------
    
branches/Version-1_0-branch/property/inc/import/default/cvs_import_bygningsdelstabell_bkb

Property Changed:
----------------
    branches/Version-1_0-branch/


Property changes on: branches/Version-1_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525
   + 
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529

Modified: 
branches/Version-1_0-branch/activitycalendar/setup/tables_update.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/setup/tables_update.inc.php    
2011-08-25 10:30:46 UTC (rev 7529)
+++ branches/Version-1_0-branch/activitycalendar/setup/tables_update.inc.php    
2011-08-25 10:39:18 UTC (rev 7530)
@@ -119,14 +119,16 @@
        {
                
$GLOBALS['phpgw_setup']->oProc->AddColumn('activity_activity','contact_person_2_address',array(
                        'type' => 'varchar',
-                       'precision' => '255'
+                       'precision' => '255',
+                       'nullable' => true
                ));
                
$GLOBALS['phpgw_setup']->oProc->AddColumn('activity_activity','contact_person_2_zip',array(
                        'type' => 'varchar',
-                       'precision' => '255'
+                       'precision' => '255',
+                       'nullable' => true
                ));
                
                $GLOBALS['setup_info']['activitycalendar']['currentver'] = 
'0.1.5';
                return $GLOBALS['setup_info']['activitycalendar']['currentver'];
        }
-?>
\ No newline at end of file
+?>

Modified: branches/Version-1_0-branch/property/inc/class.borequest.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.borequest.inc.php    
2011-08-25 10:30:46 UTC (rev 7529)
+++ branches/Version-1_0-branch/property/inc/class.borequest.inc.php    
2011-08-25 10:39:18 UTC (rev 7530)
@@ -312,6 +312,8 @@
                                        'risk'                                  
=> $risk,
                                        'score'                                 
=> $risk * (int)$condition_type_list[$i]['weight'] * 
(int)$conditions[$i]['degree']
                                );
+
+                               
array_unshift($values[0]['condition_type_list']['options'], array 
('id'=>'','name'=> lang('consequence type')));
                        }
 //_debug_array($values);die();
                        return $values;

Modified: branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php    
2011-08-25 10:30:46 UTC (rev 7529)
+++ branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php    
2011-08-25 10:39:18 UTC (rev 7530)
@@ -1160,6 +1160,12 @@
                                        );
                                break;
                        case 'building_part':
+
+                               $config                         = 
CreateObject('phpgwapi.config','property');
+                               $config->read();
+                       
+                               $filter_buildingpart = 
isset($config->config_data['filter_buildingpart']) ? 
$config->config_data['filter_buildingpart'] : array();
+                       
                                $info = array
                                        (
                                                'table'                         
=> 'fm_building_part',
@@ -1171,7 +1177,56 @@
                                                                'name' => 
'descr',
                                                                'descr' => 
lang('descr'),
                                                                'type' => 
'varchar'
-                                                       )
+                                                       ),
+                                                       array
+                                                       (
+                                                               'name' => 
'filter_1',
+                                                               'descr' => 
isset($filter_buildingpart[1]) &&  $filter_buildingpart[1] ? 
$filter_buildingpart[1] : 'Filter 1',
+                                                               'type' => 
'checkbox',
+                                                               'filter'        
=> true,
+                                                               'sortable'      
=> true,
+                                                               'values_def'    
=> array
+                                                               (
+                                                                       
'valueset'              => array(array('id' => 1, 'name' => lang('active'))),
+                                                               )
+
+                                                       ),
+                                                       array
+                                                       (
+                                                               'name' => 
'filter_2',
+                                                               'descr' => 
isset($filter_buildingpart[2]) &&  $filter_buildingpart[2] ? 
$filter_buildingpart[2] : 'Filter 2',
+                                                               'type' => 
'checkbox',
+                                                               'filter'        
=> true,
+                                                               'sortable'      
=> true,
+                                                               'values_def'    
=> array
+                                                               (
+                                                                       
'valueset'              => array(array('id' => 1, 'name' => lang('active'))),
+                                                               )
+                                                       ),
+                                                       array
+                                                       (
+                                                               'name' => 
'filter_3',
+                                                               'descr' => 
isset($filter_buildingpart[3]) &&  $filter_buildingpart[3] ? 
$filter_buildingpart[3] : 'Filter 3',
+                                                               'type' => 
'checkbox',
+                                                               'filter'        
=> true,
+                                                               'sortable'      
=> true,
+                                                               'values_def'    
=> array
+                                                               (
+                                                                       
'valueset'              => array(array('id' => 1, 'name' => lang('active'))),
+                                                               )
+                                                       ),
+                                                       array
+                                                       (
+                                                               'name' => 
'filter_4',
+                                                               'descr' => 
isset($filter_buildingpart[4]) &&  $filter_buildingpart[4] ? 
$filter_buildingpart[4] : 'Filter 4',
+                                                               'type' => 
'checkbox',
+                                                               'filter'        
=> true,
+                                                               'sortable'      
=> true,
+                                                               'values_def'    
=> array
+                                                               (
+                                                                       
'valueset'              => array(array('id' => 1, 'name' => lang('active'))),
+                                                               )
+                                                       ),
                                                ),
                                                'edit_msg'                      
=> lang('edit'),
                                                'add_msg'                       
=> lang('add'),

Modified: branches/Version-1_0-branch/property/inc/class.uirequest.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uirequest.inc.php    
2011-08-25 10:30:46 UTC (rev 7529)
+++ branches/Version-1_0-branch/property/inc/class.uirequest.inc.php    
2011-08-25 10:39:18 UTC (rev 7530)
@@ -1337,6 +1337,15 @@
                                }
                        }
 
+                       $_filter_buildingpart = array();
+                       $filter_buildingpart = 
isset($this->config->config_data['filter_buildingpart']) ? 
$this->config->config_data['filter_buildingpart'] : array();
+                       
+                       if($filter_key = array_search('.project.request', 
$filter_buildingpart))
+                       {
+                               $_filter_buildingpart = 
array("filter_{$filter_key}" => 1);
+                       }
+
+
                        $data = array
                                (
                                        'mode'                                  
                        => $mode,
@@ -1469,7 +1478,7 @@
                                        'regulations'                           
                => execMethod('property.bogeneric.get_list',array('type' => 
'regulations', 'selected' => $values['regulations'], 'fields' => array('descr', 
'external_ref'))),
 
                                        'condition_list'                        
                => $this->bo->select_conditions($id),
-                                       'building_part_list'                    
        => array('options' => 
$this->bocommon->select_category_list(array('type'=> 'building_part','selected' 
=>$values['building_part'], 'order' => 'id', 'id_in_name' => 'num' ))),
+                                       'building_part_list'                    
        => array('options' => 
$this->bocommon->select_category_list(array('type'=> 'building_part','selected' 
=>$values['building_part'], 'order' => 'id', 'id_in_name' => 'num', 'filter' => 
$_filter_buildingpart))),
                                        'value_consume'                         
                => isset($receipt['error']) ? $values['consume_value'] : ''
                                );
 //_debug_array($data);die();

Modified: branches/Version-1_0-branch/property/inc/class.uitemplate.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uitemplate.inc.php   
2011-08-25 10:30:46 UTC (rev 7529)
+++ branches/Version-1_0-branch/property/inc/class.uitemplate.inc.php   
2011-08-25 10:39:18 UTC (rev 7530)
@@ -972,6 +972,17 @@
                                        'hour_id'       => $hour_id
                                );
 
+                       $config                         = 
CreateObject('phpgwapi.config','property');
+                       $config->read();
+                       
+                       $_filter_buildingpart = array();
+                       $filter_buildingpart = 
isset($config->config_data['filter_buildingpart']) ? 
$config->config_data['filter_buildingpart'] : array();
+                       
+                       if($filter_key = array_search('.project', 
$filter_buildingpart))
+                       {
+                               $_filter_buildingpart = 
array("filter_{$filter_key}" => 1);
+                       }
+
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
 
                        $data = array
@@ -1051,13 +1062,8 @@
                                        'lang_new_grouping'                     
=> lang('New grouping'),
                                        'lang_new_grouping_statustext'  => 
lang('Enter a new grouping for this activity if not found in the list'),
 
-                                       'lang_building_part'            => 
lang('building_part'),
-                                       'building_part_list'            => 
$this->bowo_hour->get_building_part_list(isset($values['building_part_id']) ? 
$values['building_part_id'] : ''),
-                                       'select_building_part'          => 
'values[building_part_id]',
-                                       'lang_no_building_part'         => 
lang('Select building part'),
-                                       'lang_building_part_statustext'         
=> lang('Select the building part for this activity.'),
+                                       'building_part_list'                    
=> array('options' => $this->bocommon->select_category_list(array('type'=> 
'building_part','selected' =>$values['building_part_id'], 'order' => 'id', 
'id_in_name' => 'num', 'filter' => $_filter_buildingpart))),
 
-
                                        'ns3420_link'                           
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uilookup.ns3420')),
                                        'lang_ns3420'                           
=> lang('NS3420'),
                                        'value_ns3420_id'                       
=> $values['ns3420_id'],

Modified: branches/Version-1_0-branch/property/inc/class.uitts.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uitts.inc.php        
2011-08-25 10:30:46 UTC (rev 7529)
+++ branches/Version-1_0-branch/property/inc/class.uitts.inc.php        
2011-08-25 10:39:18 UTC (rev 7530)
@@ -748,6 +748,16 @@
                                                                        
'onchange'=> 'onChangeSelect("b_account");',
                                                                        
'tab_index' => 14
                                                );
+
+
+                                               $_filter_buildingpart = array();
+                                               $filter_buildingpart = 
isset($this->bo->config->config_data['filter_buildingpart']) ? 
$this->bo->config->config_data['filter_buildingpart'] : array();
+                       
+                                               if($filter_key = 
array_search('.b_account', $filter_buildingpart))
+                                               {
+                                                       $_filter_buildingpart = 
array("filter_{$filter_key}" => 1);
+                                               }
+
                                                
$datatable['actions']['form'][0]['fields']['field'][] = array
                                                (
                                                                        'id' => 
'sel_building_part', // testing traditional listbox for long list
@@ -755,7 +765,8 @@
                                                                        'value' 
=> lang('building part'),
                                                                        'type' 
=> 'select',
                                                                        'style' 
=> 'filter',
-                                                                       
'values' => $this->bo->get_building_part($this->building_part),
+                                                                       
//'values' => $this->bo->get_building_part($this->building_part),
+                                                                       
'values'        => $this->bocommon->select_category_list(array('type'=> 
'building_part','selected' =>$this->building_part, 'order' => 'id', 
'id_in_name' => 'num', 'filter' => $_filter_buildingpart)),
                                                                        
'onchange'=> 'onChangeSelect("building_part");',
                                                                        
'tab_index' => 15
                                                );
@@ -2992,7 +3003,14 @@
                                        'footer'                                
=> 0
                                );
 
-
+                       $_filter_buildingpart = array();
+                       $filter_buildingpart = 
isset($this->bo->config->config_data['filter_buildingpart']) ? 
$this->bo->config->config_data['filter_buildingpart'] : array();
+                       
+                       if($filter_key = array_search('.b_account', 
$filter_buildingpart))
+                       {
+                               $_filter_buildingpart = 
array("filter_{$filter_key}" => 1);
+                       }
+                       
                        
//----------------------------------------------datatable settings--------      
                
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
                        $cat_select     = 
$this->cats->formatted_xslt_list(array('select_name' => 
'values[cat_id]','selected' => $this->cat_id,'use_acl' => 
$this->_category_acl));
@@ -3104,7 +3122,7 @@
                                        'textareacols'                          
        => 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] : 60,
                                        'textarearows'                          
        => 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] : 6,
                                        'order_cat_list'                        
        => $order_catetory,
-                                       'building_part_list'                    
=> array('options' => $this->bocommon->select_category_list(array('type'=> 
'building_part','selected' =>$ticket['building_part'], 'order' => 'id', 
'id_in_name' => 'num' ))),
+                                       'building_part_list'                    
=> array('options' => $this->bocommon->select_category_list(array('type'=> 
'building_part','selected' =>$ticket['building_part'], 'order' => 'id', 
'id_in_name' => 'num', 'filter' => $_filter_buildingpart))),
                                        'order_dim1_list'                       
        => array('options' => 
$this->bocommon->select_category_list(array('type'=> 'order_dim1','selected' 
=>$ticket['order_dim1'], 'order' => 'id', 'id_in_name' => 'num' ))),
                                        'branch_list'                           
        => 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['tts_branch_list'])
 && 
$GLOBALS['phpgw_info']['user']['preferences']['property']['tts_branch_list']==1 
? array('options' => execMethod('property.boproject.select_branch_list', 
$values['branch_id'])) :'',
                                );

Modified: branches/Version-1_0-branch/property/inc/class.uiwo_hour.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uiwo_hour.inc.php    
2011-08-25 10:30:46 UTC (rev 7529)
+++ branches/Version-1_0-branch/property/inc/class.uiwo_hour.inc.php    
2011-08-25 10:39:18 UTC (rev 7530)
@@ -3149,6 +3149,14 @@
                                        'from'                  => $from
                                );
 
+                       $_filter_buildingpart = array();
+                       $filter_buildingpart = 
isset($this->config->config_data['filter_buildingpart']) ? 
$this->config->config_data['filter_buildingpart'] : array();
+                       
+                       if($filter_key = array_search('.project', 
$filter_buildingpart))
+                       {
+                               $_filter_buildingpart = 
array("filter_{$filter_key}" => 1);
+                       }
+
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
 
                        $data = array
@@ -3232,13 +3240,8 @@
                                        'lang_new_grouping'                     
        => lang('New grouping'),
                                        'lang_new_grouping_statustext'  => 
lang('Enter a new grouping for this activity if not found in the list'),
 
-                                       'lang_building_part'                    
=> lang('building_part'),
-                                       'building_part_list'                    
=> $this->bo->get_building_part_list($values['building_part_id']),
-                                       'select_building_part'                  
=> 'values[building_part_id]',
-                                       'lang_no_building_part'                 
=> lang('Select building part'),
-                                       'lang_building_part_statustext' => 
lang('Select the building part for this activity.'),
+                                       'building_part_list'                    
=> array('options' => $this->bocommon->select_category_list(array('type'=> 
'building_part','selected' =>$values['building_part_id'], 'order' => 'id', 
'id_in_name' => 'num', 'filter' => $_filter_buildingpart))),
 
-
                                        'ns3420_link'                           
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uilookup.ns3420')),
                                        'lang_ns3420'                           
        => lang('NS3420'),
                                        'value_ns3420_id'                       
        => $values['ns3420_id'],

Modified: branches/Version-1_0-branch/property/inc/hook_config.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/hook_config.inc.php        
2011-08-25 10:30:46 UTC (rev 7529)
+++ branches/Version-1_0-branch/property/inc/hook_config.inc.php        
2011-08-25 10:39:18 UTC (rev 7530)
@@ -198,3 +198,55 @@
                }
                return $out;
        }
+
+       /**
+       * Get HTML checkbox with filter buildingpart
+       *
+       * @param $config
+       * @return string HTML listbox to be placed in a table
+       */
+       function filter_buildingpart($config)
+       {
+               $filters = array
+               (
+                       1 => 'Filter 1',
+                       2 => 'Filter 2',
+                       3 => 'Filter 3',
+//                     4 => 'Filter 4'
+               );
+               
+               $locations = array
+               (
+                       '.project' => 
$GLOBALS['phpgw']->translation->translate('project', array(), false, 
'property'),
+                       '.b_account' => 
$GLOBALS['phpgw']->translation->translate('accounting', array(), false, 
'property'),
+                       '.project.request' => 
$GLOBALS['phpgw']->translation->translate('request', array(), false, 
'property'),
+               );
+
+               $filter_assigned = isset($config['filter_buildingpart']) ? 
$config['filter_buildingpart'] : array();
+
+               $out = '';
+               foreach ( $filters as $filter_key => $filter_name)
+               {
+                       $out .=  <<<HTML
+                       <tr><td><label>{$filter_name}</label></td><td><select 
name="newsettings[filter_buildingpart][{$filter_key}]">
+HTML;
+                       $out .= '<option value="">' . lang('none selected') . 
'</option>' . "\n";
+                       foreach ( $locations as $key => $name)
+                       {
+                               $selected = '';
+                               if ( isset($filter_assigned[$filter_key]) && 
$filter_assigned[$filter_key] == $key)
+                               {
+                                       $selected = 'selected =  "selected"';
+                               }
+
+                               $out .=  <<<HTML
+                               <option 
value='{$key}'{$selected}>{$name}</option>
+HTML;
+                       }
+
+                       $out .=  <<<HTML
+                       </select></td></tr>
+HTML;
+               }
+               return $out;
+       }

Copied: 
branches/Version-1_0-branch/property/inc/import/default/cvs_import_bygningsdelstabell_bkb
 (from rev 7529, 
trunk/property/inc/import/default/cvs_import_bygningsdelstabell_bkb)
===================================================================
--- 
branches/Version-1_0-branch/property/inc/import/default/cvs_import_bygningsdelstabell_bkb
                           (rev 0)
+++ 
branches/Version-1_0-branch/property/inc/import/default/cvs_import_bygningsdelstabell_bkb
   2011-08-25 10:39:18 UTC (rev 7530)
@@ -0,0 +1,100 @@
+<?php
+       class import_conversion
+       {
+               protected $db;
+               public $messages = array();
+               public $warnings = array();
+               public $errors = array();
+               public $debug = true;
+               public function __construct()
+               {
+                       if(!$GLOBALS['phpgw']->acl->check('run', 
phpgwapi_acl::READ, 'admin'))
+                       {
+                               die('go away');
+                       }
+                       set_time_limit(1000); //Set the time limit for this 
request to 1000 seconds
+                       $this->account          = 
(int)$GLOBALS['phpgw_info']['user']['account_id'];
+                       $this->db           = & $GLOBALS['phpgw']->db;
+                       $this->db->query("DELETE FROM fm_building_part");
+               }
+
+               public function add($data)
+               {
+                       $debug = $this->debug;
+                       $success = false;
+                       if(!$data[2])
+                       {
+                               return true;
+                       }
+
+                       if($debug)
+                       {
+                               _debug_array($data);
+                       }
+
+                       $value_set = array();
+
+               $value_set['id']                = $data[2];
+                       $value_set['descr']             = 
$this->db->db_addslashes($data[3]);
+               $value_set['filter_1']  = $data[4] ? 1 : '';
+               $value_set['filter_2']  = $data[5] ? 1 : '';
+               $value_set['filter_3']  = $data[6] ? 1 : '';
+               $value_set['filter_4']  = $data[7] ? 1 : '';
+
+
+                       $cols = implode(',', array_keys($value_set));
+                       $values = 
$this->db->validate_insert(array_values($value_set));
+
+                       $sql = "INSERT INTO fm_building_part ({$cols}) VALUES 
({$values})";
+
+                       if($debug)
+                       {
+                               _debug_array($sql);
+                       }
+                       else
+                       {
+                               $success = 
$this->db->query($sql,__LINE__,__FILE__);
+                               if($success)
+                               {
+                                       $this->messages[] = "Successfully 
imported building part: Title ({$data[2]}::{$data[3]})";
+                                       $ok = true;
+                               }
+                               else
+                               {
+                                       $this->errors[] = "Error importing 
building part: Title ({$data[2]}::{$data[3]})";
+                                       $ok = false;
+                               }
+                       }
+
+                       //update ticket
+                       $value_set = array();
+                       if($data[0])
+                       {
+                               $value_set['building_part']             = 
$data[2];
+                               $value_set      = 
$this->db->validate_update($value_set);
+                               $sql = "UPDATE fm_tts_tickets SET {$value_set} 
WHERE building_part = '{$data[0]}'";
+
+
+                               if($debug)
+                               {
+                                       _debug_array($sql);
+                               }
+                               else
+                               {
+                                       $success = 
$this->db->query($sql,__LINE__,__FILE__);
+                                       if($success)
+                                       {
+                                               $this->messages[] = 
"Successfully updatet building part in ticket: Title ({$data[2]}::{$data[3]})";
+                                               $ok = true;
+                                       }
+                                       else
+                                       {
+                                               $this->errors[] = "Error 
updating building part in ticket: Title ({$data[2]}::{$data[3]})";
+                                               $ok = false;
+                                       }
+                               }
+                       }
+
+                       return $ok;
+               }
+       }

Modified: branches/Version-1_0-branch/property/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/setup.inc.php    2011-08-25 
10:30:46 UTC (rev 7529)
+++ branches/Version-1_0-branch/property/setup/setup.inc.php    2011-08-25 
10:39:18 UTC (rev 7530)
@@ -12,7 +12,7 @@
        */
 
        $setup_info['property']['name']                 = 'property';
-       $setup_info['property']['version']              = '0.9.17.622';
+       $setup_info['property']['version']              = '0.9.17.623';
        $setup_info['property']['app_order']    = 8;
        $setup_info['property']['enable']               = 1;
        $setup_info['property']['app_group']    = 'office';

Modified: branches/Version-1_0-branch/property/setup/tables_current.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/tables_current.inc.php   
2011-08-25 10:30:46 UTC (rev 7529)
+++ branches/Version-1_0-branch/property/setup/tables_current.inc.php   
2011-08-25 10:39:18 UTC (rev 7530)
@@ -441,8 +441,12 @@
 
                'fm_building_part' => array(
                        'fd' => array(
-                               'id' => array('type' => 'varchar','precision' 
=> '4','nullable' => False),
-                               'descr' => array('type' => 
'varchar','precision' => '50','nullable' => True)
+                               'id' => array('type' => 'varchar','precision' 
=> '5','nullable' => False),
+                               'descr' => array('type' => 
'varchar','precision' => '50','nullable' => True),
+                               'filter_1' => array('type' => 'int','precision' 
=> '2','nullable' => True),
+                               'filter_2' => array('type' => 'int','precision' 
=> '2','nullable' => True),
+                               'filter_3' => array('type' => 'int','precision' 
=> '2','nullable' => True),
+                               'filter_4' => array('type' => 'int','precision' 
=> '2','nullable' => True),
                        ),
                        'pk' => array('id'),
                        'fk' => array(),

Modified: branches/Version-1_0-branch/property/setup/tables_update.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/tables_update.inc.php    
2011-08-25 10:30:46 UTC (rev 7529)
+++ branches/Version-1_0-branch/property/setup/tables_update.inc.php    
2011-08-25 10:39:18 UTC (rev 7530)
@@ -5407,6 +5407,30 @@
 
 
        /**
+       * Update property version from 0.9.17.622 to 0.9.17.623
+       * Allow filtering of buildingparts depending of type of use
+       * 
+       */
+
+       $test[] = '0.9.17.622';
+       function property_upgrade0_9_17_622()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+               
$GLOBALS['phpgw_setup']->oProc->AlterColumn('fm_building_part','id',array('type'
 => 'varchar','precision' => '5','nullable' => False));
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_building_part','filter_1', 
array('type' => 'int','precision' => '2','nullable' => True));
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_building_part','filter_2', 
array('type' => 'int','precision' => '2','nullable' => True));
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_building_part','filter_3', 
array('type' => 'int','precision' => '2','nullable' => True));
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_building_part','filter_4', 
array('type' => 'int','precision' => '2','nullable' => True));
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.623';
+                       return $GLOBALS['setup_info']['property']['currentver'];
+               }
+       }
+
+
+       /**
        * Update property version from 0.9.17.607 to 0.9.17.608
        * Add more room for address at tickets
        * 

Modified: branches/Version-1_0-branch/property/templates/base/config.tpl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/config.tpl      
2011-08-25 10:30:46 UTC (rev 7529)
+++ branches/Version-1_0-branch/property/templates/base/config.tpl      
2011-08-25 10:39:18 UTC (rev 7530)
@@ -486,6 +486,18 @@
                        <td><input name="newsettings[uploader_filetypes]" 
value="{value_uploader_filetypes}"></td>
                </tr>
 
+       <tr class="row_off">
+               <td>{lang_filter_buildingpart}:</td>
+               <td>
+                               <!--to be able to blank the setting - need an 
empty value
+                               <input type = 'hidden' 
name="newsettings[list_location_level][]" value="">-->
+                               <table>
+                                       {hook_filter_buildingpart}
+                               </table>
+               </td>
+       </tr>
+
+
                <!--
                groupnotification
                -->

Modified: branches/Version-1_0-branch/property/templates/base/template.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/template.xsl    
2011-08-25 10:30:46 UTC (rev 7529)
+++ branches/Version-1_0-branch/property/templates/base/template.xsl    
2011-08-25 10:39:18 UTC (rev 7530)
@@ -464,7 +464,7 @@
 
 
 
-       <xsl:template match="edit_hour">
+       <xsl:template match="edit_hour" xmlns:php="http://php.net/xsl";>
                <script type="text/javascript">
                        self.name="first_Window";
                        function ns3420_lookup()
@@ -576,14 +576,21 @@
                                                </xsl:when>
                                        </xsl:choose>                   
                                        <tr>
-                                               <td valign="top">
-                                                       <xsl:value-of 
select="lang_building_part"/>
+                                               <td>
+                                                       <xsl:value-of 
select="php:function('lang', 'building part')" />
                                                </td>
-                                               <td class="th_text" >
-                                                       <xsl:call-template 
name="building_part_select"/>
+                                               <td>
+                                                       <select 
name="values[building_part_id]" >
+                                                               <xsl:attribute 
name="title">
+                                                                       
<xsl:value-of select="php:function('lang', 'select building part')" />
+                                                               </xsl:attribute>
+                                                               <option 
value="0">
+                                                                       
<xsl:value-of select="php:function('lang', 'select building part')" />
+                                                               </option>
+                                                               
<xsl:apply-templates select="building_part_list/options"/>
+                                                       </select>
                                                </td>
                                        </tr>
-
                                        <xsl:choose>
                                                <xsl:when 
test="value_activity_num !=''">
                                                        <tr>
@@ -753,3 +760,12 @@
                        </table>
                </div>
        </xsl:template>
+
+       <xsl:template match="options">
+               <option value="{id}">
+                       <xsl:if test="selected != 0">
+                               <xsl:attribute name="selected" value="selected" 
/>
+                       </xsl:if>
+                       <xsl:value-of disable-output-escaping="yes" 
select="name"/>
+               </option>
+       </xsl:template>

Modified: branches/Version-1_0-branch/property/templates/base/wo_hour.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/wo_hour.xsl     
2011-08-25 10:30:46 UTC (rev 7529)
+++ branches/Version-1_0-branch/property/templates/base/wo_hour.xsl     
2011-08-25 10:39:18 UTC (rev 7530)
@@ -1964,7 +1964,7 @@
 
 <!-- add / edit -->
 
-       <xsl:template match="edit_hour">
+       <xsl:template match="edit_hour" xmlns:php="http://php.net/xsl";>
                <script type="text/javascript">
                        self.name="first_Window";
                        function ns3420_lookup()
@@ -2087,14 +2087,21 @@
                                                </xsl:when>
                                        </xsl:choose>
                                        <tr>
-                                               <td valign="top">
-                                                       <xsl:value-of 
select="lang_building_part"/>
+                                               <td>
+                                                       <xsl:value-of 
select="php:function('lang', 'building part')" />
                                                </td>
-                                               <td class="th_text" >
-                                                       <xsl:call-template 
name="building_part_select"/>
+                                               <td>
+                                                       <select 
name="values[building_part_id]" >
+                                                               <xsl:attribute 
name="title">
+                                                                       
<xsl:value-of select="php:function('lang', 'select building part')" />
+                                                               </xsl:attribute>
+                                                               <option 
value="0">
+                                                                       
<xsl:value-of select="php:function('lang', 'select building part')" />
+                                                               </option>
+                                                               
<xsl:apply-templates select="building_part_list/options"/>
+                                                       </select>
                                                </td>
                                        </tr>
-
                                        <xsl:choose>
                                                <xsl:when 
test="value_activity_num !=''">
                                                        <tr>
@@ -2448,4 +2455,11 @@
 
        </xsl:template>
 
-
+       <xsl:template match="options">
+               <option value="{id}">
+                       <xsl:if test="selected != 0">
+                               <xsl:attribute name="selected" value="selected" 
/>
+                       </xsl:if>
+                       <xsl:value-of disable-output-escaping="yes" 
select="name"/>
+               </option>
+       </xsl:template>




reply via email to

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