[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [7529] property: configurable filter on buildingparts
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [7529] property: configurable filter on buildingparts |
Date: |
Thu, 25 Aug 2011 10:30:49 +0000 |
Revision: 7529
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7529
Author: sigurdne
Date: 2011-08-25 10:30:46 +0000 (Thu, 25 Aug 2011)
Log Message:
-----------
property: configurable filter on buildingparts
Modified Paths:
--------------
trunk/property/inc/class.uitts.inc.php
Added Paths:
-----------
trunk/property/inc/import/default/cvs_import_bygningsdelstabell_bkb
Modified: trunk/property/inc/class.uitts.inc.php
===================================================================
--- trunk/property/inc/class.uitts.inc.php 2011-08-24 14:19:37 UTC (rev
7528)
+++ trunk/property/inc/class.uitts.inc.php 2011-08-25 10:30:46 UTC (rev
7529)
@@ -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
);
Added: trunk/property/inc/import/default/cvs_import_bygningsdelstabell_bkb
===================================================================
--- trunk/property/inc/import/default/cvs_import_bygningsdelstabell_bkb
(rev 0)
+++ trunk/property/inc/import/default/cvs_import_bygningsdelstabell_bkb
2011-08-25 10:30:46 UTC (rev 7529)
@@ -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;
+ }
+ }
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [7529] property: configurable filter on buildingparts,
Sigurd Nes <=