[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [11897] property, bim and catch: rename department to
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [11897] property, bim and catch: rename department to org_unit |
Date: |
Wed, 09 Apr 2014 10:21:24 +0000 |
Revision: 11897
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11897
Author: sigurdne
Date: 2014-04-09 10:21:23 +0000 (Wed, 09 Apr 2014)
Log Message:
-----------
property, bim and catch: rename department to org_unit
Modified Paths:
--------------
trunk/bim/setup/setup.inc.php
trunk/bim/setup/tables_current.inc.php
trunk/bim/setup/tables_update.inc.php
trunk/catch/setup/setup.inc.php
trunk/catch/setup/tables_update.inc.php
trunk/frontend/inc/class.uientity.inc.php
trunk/property/inc/class.bobudget.inc.php
trunk/property/inc/class.boentity.inc.php
trunk/property/inc/class.bogeneric.inc.php
trunk/property/inc/class.menu.inc.php
trunk/property/inc/class.soadmin_entity.inc.php
trunk/property/inc/class.sobudget.inc.php
trunk/property/inc/class.soentity.inc.php
trunk/property/inc/class.sogeneric.inc.php
trunk/property/inc/class.uiadmin_entity.inc.php
trunk/property/inc/class.uibudget.inc.php
trunk/property/inc/class.uientity.inc.php
trunk/property/inc/class.uiimport.inc.php
trunk/property/inc/cron/default/synkroniser_avdelinger_med_fellesdata.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/admin_entity.xsl
trunk/property/templates/base/entity.xsl
Modified: trunk/bim/setup/setup.inc.php
===================================================================
--- trunk/bim/setup/setup.inc.php 2014-04-08 08:54:20 UTC (rev 11896)
+++ trunk/bim/setup/setup.inc.php 2014-04-09 10:21:23 UTC (rev 11897)
@@ -12,7 +12,7 @@
*/
$setup_info['bim']['name'] = 'bim';
- $setup_info['bim']['version'] = '0.9.17.507';
+ $setup_info['bim']['version'] = '0.9.17.508';
$setup_info['bim']['app_order'] = 8;
$setup_info['bim']['enable'] = 1;
$setup_info['bim']['app_group'] = 'office';
Modified: trunk/bim/setup/tables_current.inc.php
===================================================================
--- trunk/bim/setup/tables_current.inc.php 2014-04-08 08:54:20 UTC (rev
11896)
+++ trunk/bim/setup/tables_current.inc.php 2014-04-09 10:21:23 UTC (rev
11897)
@@ -60,7 +60,7 @@
'address' => array('type' =>
'varchar','precision' => '150','nullable' => True),
'entry_date' => array('type' =>
'int','precision' => '4','nullable' => True),
'user_id' => array('type' => 'int','precision'
=> '4','nullable' => True),
- 'department_id' => array('type' =>
'int','precision' => '4','nullable' => True),
+ 'org_unit_id' => array('type' =>
'int','precision' => '4','nullable' => True),
),
'pk' => array('type','id'),
'fk' => array(
Modified: trunk/bim/setup/tables_update.inc.php
===================================================================
--- trunk/bim/setup/tables_update.inc.php 2014-04-08 08:54:20 UTC (rev
11896)
+++ trunk/bim/setup/tables_update.inc.php 2014-04-09 10:21:23 UTC (rev
11897)
@@ -183,3 +183,20 @@
return $GLOBALS['setup_info']['bim']['currentver'];
}
}
+
+ /**
+ * Update bim version from 0.9.17.507 to 0.9.17.508
+ */
+ $test[] = '0.9.17.507';
+ function bim_upgrade0_9_17_507()
+ {
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+
$GLOBALS['phpgw_setup']->oProc->RenameColumn('fm_bim_item','department_id','org_unit_id');
+
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
+ $GLOBALS['setup_info']['bim']['currentver'] =
'0.9.17.508';
+ return $GLOBALS['setup_info']['bim']['currentver'];
+ }
+ }
\ No newline at end of file
Modified: trunk/catch/setup/setup.inc.php
===================================================================
--- trunk/catch/setup/setup.inc.php 2014-04-08 08:54:20 UTC (rev 11896)
+++ trunk/catch/setup/setup.inc.php 2014-04-09 10:21:23 UTC (rev 11897)
@@ -27,7 +27,7 @@
*/
$setup_info['catch']['name'] = 'catch';
- $setup_info['catch']['version'] = '0.9.17.517';
+ $setup_info['catch']['version'] = '0.9.17.518';
$setup_info['catch']['app_order'] = 20;
$setup_info['catch']['enable'] = 1;
$setup_info['catch']['globals_checked'] = True;
Modified: trunk/catch/setup/tables_update.inc.php
===================================================================
--- trunk/catch/setup/tables_update.inc.php 2014-04-08 08:54:20 UTC (rev
11896)
+++ trunk/catch/setup/tables_update.inc.php 2014-04-09 10:21:23 UTC (rev
11897)
@@ -546,3 +546,45 @@
}
}
+ /**
+ * Update catch version from 0.9.17.517 to 0.9.17.518
+ * Change name from department to org_unit
+ */
+ $test[] = '0.9.17.517';
+ function catch_upgrade0_9_17_517()
+ {
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+ $GLOBALS['phpgw_setup']->oProc->query("SELECT * FROM
fm_catch_category");
+
+ $categories = array();
+ while ($GLOBALS['phpgw_setup']->oProc->next_record())
+ {
+ $categories[] = array
+ (
+ 'entity_id' =>
$GLOBALS['phpgw_setup']->oProc->f('entity_id'),
+ 'cat_id' =>
$GLOBALS['phpgw_setup']->oProc->f('id')
+ );
+ }
+
+ $tables = $GLOBALS['phpgw_setup']->oProc->m_odb->table_names();
+
+ foreach ($categories as $category)
+ {
+ $table =
"fm_catch_{$category['entity_id']}_{$category['cat_id']}";
+ if(in_array($table, $tables))
+ {
+ $metadata =
$GLOBALS['phpgw_setup']->oProc->m_odb->metadata($table);
+ if(isset($metadata['department_id']))
+ {
+
$GLOBALS['phpgw_setup']->oProc->RenameColumn($table,'department_id','org_unit_id');
+ }
+ }
+ }
+
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
+ $GLOBALS['setup_info']['catch']['currentver'] =
'0.9.17.518';
+ return $GLOBALS['setup_info']['catch']['currentver'];
+ }
+ }
\ No newline at end of file
Modified: trunk/frontend/inc/class.uientity.inc.php
===================================================================
--- trunk/frontend/inc/class.uientity.inc.php 2014-04-08 08:54:20 UTC (rev
11896)
+++ trunk/frontend/inc/class.uientity.inc.php 2014-04-09 10:21:23 UTC (rev
11897)
@@ -102,6 +102,27 @@
parent::__construct();
$this->location_code =
$this->header_state['selected_location'];
$this->bo->location_code = $this->location_code;
+
+ $_org_units = array();
+ if(is_array($this->header_state['org_unit']))
+ {
+ foreach ($this->header_state['org_unit'] as
$org_unit)
+ {
+ $_org_unit_id =
(int)$org_unit['ORG_UNIT_ID'];
+ $_subs =
execMethod('property.sogeneric.read_tree',array('node_id' => $_org_unit_id,
'type' => 'department'));
+ $_org_units[$_org_unit_id] = true;
+ foreach($_subs as $entry)
+ {
+ $_org_units[$entry['id']] =
true;
+ }
+ }
+ }
+ $org_units = array_keys($_org_units);
+ _debug_array($this->header_state['org_unit']);
+ _debug_array($org_units);
+
+ die();
+
}
Modified: trunk/property/inc/class.bobudget.inc.php
===================================================================
--- trunk/property/inc/class.bobudget.inc.php 2014-04-08 08:54:20 UTC (rev
11896)
+++ trunk/property/inc/class.bobudget.inc.php 2014-04-09 10:21:23 UTC (rev
11897)
@@ -81,7 +81,7 @@
$filter =
phpgw::get_var('filter', 'int');
$cat_id =
phpgw::get_var('cat_id', 'int');
$dimb_id =
phpgw::get_var('dimb_id', 'int');
- $department =
phpgw::get_var('department', 'int');
+ $org_unit_id =
phpgw::get_var('org_unit_id', 'int');
$allrows =
phpgw::get_var('allrows', 'bool');
$district_id =
phpgw::get_var('district_id', 'int');
$year =
phpgw::get_var('year', 'int');
@@ -105,7 +105,7 @@
$this->order = isset($order) &&
$order ? $order : '';
$this->cat_id = isset($cat_id) &&
$cat_id ? $cat_id : '';
$this->dimb_id = isset($dimb_id) &&
$dimb_id ? $dimb_id :
'';//$GLOBALS['phpgw_info']['user']['preferences']['property']['dimb'];
- $this->department = isset($department) &&
$department ? $department :
'';//$GLOBALS['phpgw_info']['user']['preferences']['property']['department'];
+ $this->org_unit_id = isset($org_unit_id)
&& $org_unit_id ? $org_unit_id :
'';//$GLOBALS['phpgw_info']['user']['preferences']['property']['org_unit_id'];
$this->part_of_town_id = isset($part_of_town_id) &&
$part_of_town_id ? $part_of_town_id : '';
$this->district_id = isset($district_id)
&& $district_id ? $district_id : '';
@@ -157,7 +157,7 @@
$budget = $this->so->read(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
'filter' => $this->filter,'cat_id' =>
$this->cat_id,'allrows'=>$this->allrows,
'district_id' => $this->district_id,'year' =>
$this->year,'grouping' => $this->grouping,'revision' => $this->revision,
- 'cat_id' => $this->cat_id, 'dimb_id' =>
$this->dimb_id, 'department' => $this->department));
+ 'cat_id' => $this->cat_id, 'dimb_id' =>
$this->dimb_id, 'org_unit_id' => $this->org_unit_id));
$this->total_records =
$this->so->total_records;
$this->sum_budget_cost =
$this->so->sum_budget_cost;
@@ -194,7 +194,7 @@
'sort' => strtoupper($this->sort), 'order' =>
$this->order, 'filter' => $this->filter,
'cat_id' => $this->cat_id,
'allrows'=>$this->allrows, 'district_id' => $this->district_id,
'year' => $this->year,'month' => $this->month,
'grouping' => $this->grouping, 'revision' => $this->revision,
- 'details' => $this->details,'dimb_id' =>
$this->dimb_id, 'department' => $this->department,
+ 'details' => $this->details,'dimb_id' =>
$this->dimb_id, 'org_unit_id' => $this->org_unit_id,
'direction' => $this->direction));
$this->total_records =
$this->so->total_records;
Modified: trunk/property/inc/class.boentity.inc.php
===================================================================
--- trunk/property/inc/class.boentity.inc.php 2014-04-08 08:54:20 UTC (rev
11896)
+++ trunk/property/inc/class.boentity.inc.php 2014-04-09 10:21:23 UTC (rev
11897)
@@ -493,19 +493,19 @@
}
$values = $this->custom->prepare($values,
$this->type_app[$this->type],".{$this->type}.{$data['entity_id']}.{$data['cat_id']}",
$data['view']);
- if($values['department_id'])
+ if($values['org_unit_id'])
{
$bogeneric =
CreateObject('property.sogeneric');
- $bogeneric->get_location_info('department');
- $department =
$bogeneric->read_single(array('id' => $values['department_id']));
- $values['department_name'] =
$department['name'];
- $values['department_name_path'] =
$department['name'];
- if($department['parent_id'])
+ $bogeneric->get_location_info('org_unit');
+ $org_unit = $bogeneric->read_single(array('id'
=> $values['org_unit_id']));
+ $values['org_unit_name'] = $org_unit['name'];
+ $values['org_unit_name_path'] =
$org_unit['name'];
+ if($org_unit['parent_id'])
{
- $path =
$bogeneric->get_path(array('type' => 'department', 'id' =>
$department['parent_id']));
+ $path =
$bogeneric->get_path(array('type' => 'org_unit', 'id' =>
$org_unit['parent_id']));
if($path)
{
- $values['department_name_path']
.= '::' . implode(' > ', $path);
+ $values['org_unit_name_path']
.= '::' . implode(' > ', $path);
}
}
}
Modified: trunk/property/inc/class.bogeneric.inc.php
===================================================================
--- trunk/property/inc/class.bogeneric.inc.php 2014-04-08 08:54:20 UTC (rev
11896)
+++ trunk/property/inc/class.bogeneric.inc.php 2014-04-09 10:21:23 UTC (rev
11897)
@@ -322,6 +322,10 @@
return $history_type;
}
+ /**
+ * Fetch data to populate autocomplete from forms
+ * @return array result to be handled by javascript
+ */
function get_autocomplete()
{
$this->get_location_info();
Modified: trunk/property/inc/class.menu.inc.php
===================================================================
--- trunk/property/inc/class.menu.inc.php 2014-04-08 08:54:20 UTC (rev
11896)
+++ trunk/property/inc/class.menu.inc.php 2014-04-09 10:21:23 UTC (rev
11897)
@@ -206,10 +206,10 @@
'text' => lang('budget
account'),
'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uigeneric.index', 'type' => 'budget_account') )
),
- 'department' => array
+ 'org_unit' => array
(
'text' =>
lang('department'),
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uigeneric.index', 'type' => 'department') )
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uigeneric.index', 'type' => 'org_unit') )
),
'accounting_dimb' => array
(
Modified: trunk/property/inc/class.soadmin_entity.inc.php
===================================================================
--- trunk/property/inc/class.soadmin_entity.inc.php 2014-04-08 08:54:20 UTC
(rev 11896)
+++ trunk/property/inc/class.soadmin_entity.inc.php 2014-04-09 10:21:23 UTC
(rev 11897)
@@ -453,7 +453,7 @@
'parent_id'
=> $this->db->f('parent_id'),
'level'
=> $this->db->f('level'),
'location_id'
=> $this->db->f('location_id'),
- 'department'
=> $this->db->f('department')
+ 'org_unit'
=> $this->db->f('org_unit')
);
}
@@ -580,7 +580,7 @@
$fd['entry_date'] = array('type' => 'int', 'precision'
=> 4, 'nullable' => true);
$fd['user_id'] = array('type' => 'int', 'precision' =>
4, 'nullable' => true);
- $fd['department_id'] = array('type' => 'int',
'precision' => 4, 'nullable' => true);
+ $fd['org_unit_id'] = array('type' => 'int', 'precision'
=> 4, 'nullable' => true);
return $fd;
}
@@ -630,13 +630,13 @@
$values['enable_bulk'],
$values['jasperupload'],
$values['parent_id'],
- $values['department'],
+ $values['org_unit'],
$level
);
$values_insert =
$this->db->validate_insert($values_insert);
- $this->db->query("INSERT INTO {$table}
(location_id,entity_id,id,name,
descr,prefix,lookup_tenant,tracking,location_level,location_link_level,fileupload,loc_link,start_project,start_ticket,is_eav,enable_bulk,jasperupload,parent_id,department,level
) "
+ $this->db->query("INSERT INTO {$table}
(location_id,entity_id,id,name,
descr,prefix,lookup_tenant,tracking,location_level,location_link_level,fileupload,loc_link,start_project,start_ticket,is_eav,enable_bulk,jasperupload,parent_id,org_unit,level
) "
. "VALUES ($values_insert)",__LINE__,__FILE__);
@@ -853,7 +853,7 @@
'jasperupload'
=> $entity['jasperupload'],
'parent_id'
=> $entity['parent_id'],
'level'
=> $level,
- 'department'
=> $entity['department']
+ 'org_unit'
=> $entity['org_unit']
);
$value_set =
$this->db->validate_update($value_set);
Modified: trunk/property/inc/class.sobudget.inc.php
===================================================================
--- trunk/property/inc/class.sobudget.inc.php 2014-04-08 08:54:20 UTC (rev
11896)
+++ trunk/property/inc/class.sobudget.inc.php 2014-04-09 10:21:23 UTC (rev
11897)
@@ -534,7 +534,7 @@
$cat_id = isset($data['cat_id']) ?
$data['cat_id'] : '';
$details = isset($data['details']) ?
$data['details'] : '';
$dimb_id = isset($data['dimb_id']) &&
$data['dimb_id'] ? (int)$data['dimb_id'] : 0;
- $department = isset($data['department'])
&& $data['department'] ? (int)$data['department'] : 0;
+ $org_unit_id = isset($data['org_unit_id']) &&
$data['org_unit_id'] ? (int)$data['org_unit_id'] : 0;
$direction = isset($data['direction']) &&
$data['direction'] ? $data['direction'] : 'expenses';
if(!$year)
@@ -595,20 +595,20 @@
$where = 'AND';
}
- $_department_dimb = array();
- if ($department > 0)
+ $_org_unit_dimb = array();
+ if ($org_unit_id > 0)
{
- $_department_dimb[] = -1;//block in case no one
found
- $this->db->query("SELECT id FROM fm_ecodimb
WHERE department = $department ",__LINE__,__FILE__);
+ $_org_unit_dimb[] = -1;//block in case no one
found
+ $this->db->query("SELECT id FROM fm_ecodimb
WHERE org_unit_id = $org_unit_id ",__LINE__,__FILE__);
while ($this->db->next_record())
{
- $_department_dimb[] =
$this->db->f('id');
+ $_org_unit_dimb[] = $this->db->f('id');
}
}
- if($_department_dimb)
+ if($_org_unit_dimb)
{
- $filtermethod .= " $where fm_project.ecodimb IN
(" . implode(',', $_department_dimb) . ')';
+ $filtermethod .= " $where fm_project.ecodimb IN
(" . implode(',', $_org_unit_dimb) . ')';
$where = 'AND';
}
@@ -781,9 +781,9 @@
$where = 'AND';
}
- if($_department_dimb)
+ if($_org_unit_dimb)
{
- $filtermethod .= " $where
fm_tts_tickets.ecodimb IN (" . implode(',', $_department_dimb) . ')';
+ $filtermethod .= " $where
fm_tts_tickets.ecodimb IN (" . implode(',', $_org_unit_dimb) . ')';
$where = 'AND';
}
@@ -886,9 +886,9 @@
$where = 'AND';
}
- if($_department_dimb)
+ if($_org_unit_dimb)
{
- $filtermethod .= " $where ecodimb IN (" .
implode(',', $_department_dimb) . ')';
+ $filtermethod .= " $where ecodimb IN (" .
implode(',', $_org_unit_dimb) . ')';
$where = 'AND';
}
@@ -946,9 +946,9 @@
$where = 'AND';
}
- if($_department_dimb)
+ if($_org_unit_dimb)
{
- $filtermethod .= " $where
fm_s_agreement_budget.ecodimb IN (" . implode(',', $_department_dimb) . ')';
+ $filtermethod .= " $where
fm_s_agreement_budget.ecodimb IN (" . implode(',', $_org_unit_dimb) . ')';
$where = 'AND';
}
@@ -1033,9 +1033,9 @@
$where = 'AND';
}
- if($_department_dimb)
+ if($_org_unit_dimb)
{
- $filtermethod .= " $where
fm_s_agreement_budget.ecodimb IN (" . implode(',', $_department_dimb) . ')';
+ $filtermethod .= " $where
fm_s_agreement_budget.ecodimb IN (" . implode(',', $_org_unit_dimb) . ')';
$where = 'AND';
}
Modified: trunk/property/inc/class.soentity.inc.php
===================================================================
--- trunk/property/inc/class.soentity.inc.php 2014-04-08 08:54:20 UTC (rev
11896)
+++ trunk/property/inc/class.soentity.inc.php 2014-04-09 10:21:23 UTC (rev
11897)
@@ -308,7 +308,7 @@
$querymethod = " $where (" . implode(' AND
',$_querymethod) . ')';
unset($_querymethod);
}
- $sql = "SELECT id, location_code, p_location_id, p_id,
department_id, xml_representation FROM fm_bim_item WHERE location_id =
{$location_id} $querymethod";
+ $sql = "SELECT id, location_code, p_location_id, p_id,
org_unit_id, xml_representation FROM fm_bim_item WHERE location_id =
{$location_id} $querymethod";
$sql_cnt = "SELECT count(id) as cnt FROM fm_bim_item
WHERE location_id = {$location_id} $querymethod";
@@ -390,9 +390,9 @@
'attrib_id' => false,
);
- $dataset[$j]['department_id'] = array
+ $dataset[$j]['org_unit_id'] = array
(
- 'value' =>
$this->db->f('department_id'),
+ 'value' =>
$this->db->f('org_unit_id'),
'datatype' => false,
'attrib_id' => false,
);
@@ -1608,7 +1608,7 @@
$values['status'] =
$this->db->f('status');
$values['user_id'] =
$this->db->f('user_id');
$values['entry_date'] =
$this->db->f('entry_date');
- $values['department_id'] =
$this->db->f('department_id');
+ $values['org_unit_id'] =
$this->db->f('org_unit_id');
if ( isset($values['attributes']) &&
is_array($values['attributes']) )
{
@@ -1659,7 +1659,7 @@
$values['location_code'] =
$this->db->f('location_code');
$values['user_id'] =
$this->db->f('user_id');
$values['entry_date'] =
$this->db->f('entry_date');
- $values['department_id'] =
$this->db->f('department_id');
+ $values['org_unit_id'] =
$this->db->f('org_unit_id');
$xmldata =
$this->db->f('xml_representation',true);
$xml = new DOMDocument('1.0', 'utf-8');
@@ -2062,7 +2062,7 @@
'location_code' =>
$data['location_code'],
'loc1' =>
$data['loc1'],
'address' =>
$data['address'],
- 'department_id' =>
$data['department_id']
+ 'org_unit_id' =>
$data['org_unit_id']
);
$value_set =
$this->db->validate_update($value_set);
Modified: trunk/property/inc/class.sogeneric.inc.php
===================================================================
--- trunk/property/inc/class.sogeneric.inc.php 2014-04-08 08:54:20 UTC (rev
11896)
+++ trunk/property/inc/class.sogeneric.inc.php 2014-04-09 10:21:23 UTC (rev
11897)
@@ -490,7 +490,7 @@
),
array
(
- 'name'
=> 'department',
+ 'name'
=> 'org_unit_id',
'descr'
=> lang('department'),
'type'
=> 'select',
'nullable'
=> false,
@@ -500,7 +500,7 @@
(
'valueset' => false,
'method' => 'property.bogeneric.get_list',
-
'method_input' => array('type' => 'department', 'selected' =>
'##department##')
+
'method_input' => array('type' => 'org_unit', 'selected' => '##org_unit_id##')
)
)
),
@@ -1631,11 +1631,11 @@
);
break;
- case 'department':
+ case 'org_unit':
$info = array
(
- 'table'
=> 'fm_department',
+ 'table'
=> 'fm_org_unit',
'id'
=> array('name' => 'id', 'type' => 'int'),
'fields'
=> array
(
@@ -1661,7 +1661,7 @@
(
'valueset' => false,
'method' => 'property.bogeneric.get_list',
-
'method_input' => array('type' => 'department', 'role' => 'parent', 'selected'
=> '##parent_id##')
+
'method_input' => array('type' => 'org_unit', 'role' => 'parent', 'selected'
=> '##parent_id##')
)
)
),
@@ -1670,7 +1670,7 @@
'name'
=> lang('department'),
'acl_app'
=> 'property',
'acl_location' =>
'.admin',
- 'menu_selection' =>
'admin::property::accounting::department',
+ 'menu_selection' =>
'admin::property::accounting::org_unit',
'default'
=> array
(
'created_by'
=> array('add' => '$this->account'),
@@ -3387,8 +3387,14 @@
}
+ /**
+ * Get tree from your node
+ * @param array $data - 'node_id' as parent and 'type'
+ * @return array tree
+ */
public function read_tree($data)
{
+ $parent_id = isset($data['node_id']) &&
$data['node_id'] ? (int) $data['node_id'] : 0;
$tree = array();
$this->get_location_info($data['type'],
$data['type_id']);
@@ -3399,7 +3405,14 @@
}
$this->table = $table;
- $filtermthod = 'WHERE (parent_id = 0 OR parent_id IS
NULL)';
+ if($parent_id)
+ {
+ $filtermthod = "WHERE parent_id = {$parent_id}";
+ }
+ else
+ {
+ $filtermthod = 'WHERE (parent_id = 0 OR
parent_id IS NULL)';
+ }
if (isset($data['filter']) && is_array($data['filter']))
{
@@ -3445,10 +3458,6 @@
$node['children'] = $children;
}
}
-if($tree)
-{
-// _debug_array($tree);die();
-}
return $tree;
}
Modified: trunk/property/inc/class.uiadmin_entity.inc.php
===================================================================
--- trunk/property/inc/class.uiadmin_entity.inc.php 2014-04-08 08:54:20 UTC
(rev 11896)
+++ trunk/property/inc/class.uiadmin_entity.inc.php 2014-04-09 10:21:23 UTC
(rev 11897)
@@ -1170,8 +1170,8 @@
'lang_no_location_link_level'
=> lang('None'),
'tracking'
=> true,
'value_tracking'
=> $values['tracking'],
- 'department'
=> true,
- 'value_department'
=> $values['department'],
+ 'org_unit'
=> true,
+ 'value_org_unit'
=> $values['org_unit'],
'fileupload'
=> true,
'value_fileupload'
=> $values['fileupload'],
'value_jasperupload'
=> $values['jasperupload'],
Modified: trunk/property/inc/class.uibudget.inc.php
===================================================================
--- trunk/property/inc/class.uibudget.inc.php 2014-04-08 08:54:20 UTC (rev
11896)
+++ trunk/property/inc/class.uibudget.inc.php 2014-04-09 10:21:23 UTC (rev
11897)
@@ -1090,7 +1090,7 @@
array_unshift ($values_combo_box[4],array
('id'=>'', 'name'=>lang('no category')));
- $values_combo_box[5] =
$this->bocommon->select_category_list(array('type'=>'department'));
+ $values_combo_box[5] =
$this->bocommon->select_category_list(array('type'=>'org_unit'));
array_unshift ($values_combo_box[5], array
('id'=>'','name'=>lang('department')));
$values_combo_box[6] =
$this->bocommon->select_category_list(array('type'=>'dimb'));
@@ -1181,13 +1181,13 @@
),
array
(
- 'id' =>
'sel_department',
- 'name'
=> 'department',
+ 'id' =>
'sel_org_unit_id',
+ 'name'
=> 'org_unit_id',
'value'
=> lang('department'),
'type'
=> 'select',
'style'
=> 'filter',
'values' => $values_combo_box[5],
-
'onchange'=> 'onChangeSelect("department");',
+
'onchange'=> 'onChangeSelect("org_unit_id");',
'tab_index' => 6
),
array
Modified: trunk/property/inc/class.uientity.inc.php
===================================================================
--- trunk/property/inc/class.uientity.inc.php 2014-04-08 08:54:20 UTC (rev
11896)
+++ trunk/property/inc/class.uientity.inc.php 2014-04-09 10:21:23 UTC (rev
11897)
@@ -1526,9 +1526,9 @@
if ((isset($values['save']) && $values['save']) ||
(isset($values['apply']) && $values['apply']))
{
- if($category['department'])
+ if($category['org_unit'])
{
- $values['extra']['department_id'] =
phpgw::get_var('department_id', 'int');
+ $values['extra']['org_unit_id'] =
phpgw::get_var('org_unit_id', 'int');
}
if($GLOBALS['phpgw']->session->is_repost())
{
@@ -2382,17 +2382,17 @@
$property_js =
"/phpgwapi/inc/combine.php?cachedir={$cachedir}&type=javascript&files=" .
str_replace('/', '--', ltrim($property_js,'/'));
}
- if($category['department'] && $mode == 'edit')
+ if($category['org_unit'] && $mode == 'edit')
{
$_autocomplete = <<<JS
YAHOO.util.Event.addListener(window,
"load", function()
{
- var oArgs =
{menuaction:'property.bogeneric.get_autocomplete', type:'department'};
+ var oArgs =
{menuaction:'property.bogeneric.get_autocomplete', type:'org_unit'};
var strURL =
phpGWLink('index.php', oArgs, true);
YAHOO.portico.autocompleteHelper(strURL,
- 'department_name', 'department_id',
'department_container');
+ 'org_unit_name', 'org_unit_id',
'org_unit_container');
});
JS;
@@ -2405,10 +2405,10 @@
'datatable'
=> $datavalues,
'myColumnDefs'
=> $myColumnDefs,
'enable_bulk'
=> $category['enable_bulk'],
- 'department'
=> $category['department'],
- 'value_department_id'
=> $values['department_id'],
- 'value_department_name'
=> $values['department_name'],
- 'value_department_name_path' =>
$values['department_name_path'],
+ 'org_unit'
=> $category['org_unit'],
+ 'value_org_unit_id'
=> $values['org_unit_id'],
+ 'value_org_unit_name'
=> $values['org_unit_name'],
+ 'value_org_unit_name_path' =>
$values['org_unit_name_path'],
'value_location_id'
=> $GLOBALS['phpgw']->locations->get_id($this->type_app[$this->type],
$this->acl_location),
'link_pdf'
=> $GLOBALS['phpgw']->link('/index.php',$pdf_data),
'start_project'
=> $category['start_project'],
Modified: trunk/property/inc/class.uiimport.inc.php
===================================================================
--- trunk/property/inc/class.uiimport.inc.php 2014-04-08 08:54:20 UTC (rev
11896)
+++ trunk/property/inc/class.uiimport.inc.php 2014-04-09 10:21:23 UTC (rev
11897)
@@ -59,7 +59,7 @@
'fm_condition_survey' =>
array('name' => 'fm_condition_survey (' . lang('condition survey') . ')',
'permission' => PHPGW_ACL_READ | PHPGW_ACL_ADD | PHPGW_ACL_EDIT),
'fm_ecodimb'
=> array('name' => 'fm_ecodimb (' . lang('dimb') . ')', 'permission' =>
PHPGW_ACL_READ | PHPGW_ACL_ADD | PHPGW_ACL_EDIT),
'fm_budget'
=> array('name' => 'fm_budget (' . lang('budget') . ')', 'permission'
=> PHPGW_ACL_READ | PHPGW_ACL_ADD | PHPGW_ACL_EDIT),
- 'fm_department'
=> array('name' => 'fm_department (' . lang('department') . ')', 'permission'
=> PHPGW_ACL_READ | PHPGW_ACL_ADD | PHPGW_ACL_EDIT),
+ 'fm_org_unit'
=> array('name' => 'fm_org_unit (' . lang('department') . ')', 'permission' =>
PHPGW_ACL_READ | PHPGW_ACL_ADD | PHPGW_ACL_EDIT),
'fm_eco_periodization_outline' => array('name'
=> 'fm_eco_periodization_outline (' . lang('periodization outline') . ')',
'permission' => PHPGW_ACL_READ | PHPGW_ACL_ADD | PHPGW_ACL_EDIT),
'fm_eco_periodization' =>
array('name' => 'fm_eco_periodization (' . lang('periodization') . ')',
'permission' => PHPGW_ACL_READ | PHPGW_ACL_ADD | PHPGW_ACL_EDIT),
'fm_ecodimd'
=> array('name' => 'fm_ecodimd', 'permission' => PHPGW_ACL_READ | PHPGW_ACL_ADD
| PHPGW_ACL_EDIT),
Modified:
trunk/property/inc/cron/default/synkroniser_avdelinger_med_fellesdata.php
===================================================================
--- trunk/property/inc/cron/default/synkroniser_avdelinger_med_fellesdata.php
2014-04-08 08:54:20 UTC (rev 11896)
+++ trunk/property/inc/cron/default/synkroniser_avdelinger_med_fellesdata.php
2014-04-09 10:21:23 UTC (rev 11897)
@@ -94,13 +94,13 @@
foreach ($parties as $party)
{
- $sql = "SELECT name, parent_id FROM
fm_department WHERE id = {$party}";
+ $sql = "SELECT name, parent_id FROM fm_org_unit
WHERE id = {$party}";
$this->db->query($sql,__LINE__,__FILE__);
if($this->db->next_record())
{
$name =
$this->db->f('name');
$parent_id =
$this->db->f('parent_id');
- $path =
$sogeneric->get_path(array('type' => 'department', 'id' => $parent_id));
+ $path =
$sogeneric->get_path(array('type' => 'org_unit', 'id' => $parent_id));
$parent_name = implode(' > ', $path);
$value_set = array
@@ -295,7 +295,7 @@
'modified_on' => time()
);
- $table = 'fm_department';
+ $table = 'fm_org_unit';
$db->query("SELECT count(*) as cnt FROM
{$table} WHERE id =" . (int)$unit['id'],__LINE__,__FILE__);
$db->next_record();
Modified: trunk/property/setup/setup.inc.php
===================================================================
--- trunk/property/setup/setup.inc.php 2014-04-08 08:54:20 UTC (rev 11896)
+++ trunk/property/setup/setup.inc.php 2014-04-09 10:21:23 UTC (rev 11897)
@@ -12,7 +12,7 @@
*/
$setup_info['property']['name'] = 'property';
- $setup_info['property']['version'] = '0.9.17.680';
+ $setup_info['property']['version'] = '0.9.17.681';
$setup_info['property']['app_order'] = 8;
$setup_info['property']['enable'] = 1;
$setup_info['property']['app_group'] = 'office';
@@ -140,7 +140,7 @@
'fm_tts_tickets',
'fm_tts_history',
'fm_tts_views',
- 'fm_department',
+ 'fm_org_unit',
'fm_ecoart',
'fm_ecoavvik',
'fm_ecobilag_process_code',
Modified: trunk/property/setup/tables_current.inc.php
===================================================================
--- trunk/property/setup/tables_current.inc.php 2014-04-08 08:54:20 UTC (rev
11896)
+++ trunk/property/setup/tables_current.inc.php 2014-04-09 10:21:23 UTC (rev
11897)
@@ -1082,11 +1082,11 @@
'fk' => array(),
'uc' => array()
),
- 'fm_department' => array(
+ 'fm_org_unit' => array(
'fd' => array(
'id' => array('type' => 'int','precision' =>
'4','nullable' => False),
'parent_id' => array('type' =>
'int','precision' => '4','nullable' => true),
- 'name' => array('type' => 'varchar','precision'
=> '60','nullable' => False),
+ 'name' => array('type' => 'varchar','precision'
=> '200','nullable' => False),
'created_on' => array('type' => 'int',
'precision' => 4,'nullable' => False),
'created_by' => array('type' => 'int',
'precision' => 4,'nullable' => False),
'modified_by' => array('type' =>
'int','precision' => 4,'nullable' => true),
@@ -1297,11 +1297,11 @@
'fd' => array(
'id' => array('type' => 'int','precision' =>
'4','nullable' => False),
'descr' => array('type' =>
'varchar','precision' => '50','nullable' => False),
- 'department' => array('type' =>
'int','precision' => '4','nullable' => False),
+ 'org_unit_id' => array('type' =>
'int','precision' => '4','nullable' => False),
),
'pk' => array('id'),
'ix' => array(),
- 'fk' => array('fm_department' => array('department' =>
'id')),
+ 'fk' => array('fm_org_unit' => array('org_unit_id' =>
'id')),
'uc' => array()
),
'fm_ecodimb_role' => array(
Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php 2014-04-08 08:54:20 UTC (rev
11896)
+++ trunk/property/setup/tables_update.inc.php 2014-04-09 10:21:23 UTC (rev
11897)
@@ -7939,7 +7939,7 @@
}
/**
- * Update property version from 0.9.17.670 to 0.9.17.671
+ * Update property version from 0.9.17.679 to 0.9.17.680
* Add department_id to entity tables
*/
$test[] = '0.9.17.679';
@@ -7983,3 +7983,52 @@
}
}
+ /**
+ * Update property version from 0.9.17.680 to 0.9.17.681
+ * Change name from department to org_unit
+ */
+ $test[] = '0.9.17.680';
+ function property_upgrade0_9_17_680()
+ {
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+ $GLOBALS['phpgw_setup']->oProc->query("DELETE FROM fm_cache");
+
+ $GLOBALS['phpgw_setup']->oProc->RenameTable('fm_department',
'fm_org_unit');
+
$GLOBALS['phpgw_setup']->oProc->RenameColumn('fm_entity_category','department','org_unit');
+
$GLOBALS['phpgw_setup']->oProc->RenameColumn('fm_ecodimb','department','org_unit_id');
+
+ $GLOBALS['phpgw_setup']->oProc->query("SELECT * FROM
fm_entity_category");
+
+ $categories = array();
+ while ($GLOBALS['phpgw_setup']->oProc->next_record())
+ {
+ $categories[] = array
+ (
+ 'entity_id' =>
$GLOBALS['phpgw_setup']->oProc->f('entity_id'),
+ 'cat_id' =>
$GLOBALS['phpgw_setup']->oProc->f('id')
+ );
+ }
+
+ $tables = $GLOBALS['phpgw_setup']->oProc->m_odb->table_names();
+
+ foreach ($categories as $category)
+ {
+ $table =
"fm_entity_{$category['entity_id']}_{$category['cat_id']}";
+ if(in_array($table, $tables))
+ {
+ $metadata =
$GLOBALS['phpgw_setup']->oProc->m_odb->metadata($table);
+ if(isset($metadata['department_id']))
+ {
+
$GLOBALS['phpgw_setup']->oProc->RenameColumn($table,'department_id','org_unit_id');
+ }
+ }
+ }
+
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
+ $GLOBALS['setup_info']['property']['currentver'] =
'0.9.17.681';
+ return $GLOBALS['setup_info']['property']['currentver'];
+ }
+ }
+
Modified: trunk/property/templates/base/admin_entity.xsl
===================================================================
--- trunk/property/templates/base/admin_entity.xsl 2014-04-08 08:54:20 UTC
(rev 11896)
+++ trunk/property/templates/base/admin_entity.xsl 2014-04-09 10:21:23 UTC
(rev 11897)
@@ -623,20 +623,20 @@
</xsl:when>
</xsl:choose>
<xsl:choose>
- <xsl:when test="department !=
''">
+ <xsl:when test="org_unit != ''">
<tr>
<td>
-
<xsl:variable name="lang_department">
+
<xsl:variable name="lang_org_unit">
<xsl:value-of select="php:function('lang', 'department')"/>
</xsl:variable>
-
<xsl:value-of select="$lang_department"/>
+
<xsl:value-of select="$lang_org_unit"/>
</td>
<td>
- <input
type="checkbox" name="values[department]" value="1">
+ <input
type="checkbox" name="values[org_unit]" value="1">
<xsl:attribute name="title">
<xsl:value-of select="php:function('lang', 'department')"/>
</xsl:attribute>
-
<xsl:if test="value_department = '1'">
+
<xsl:if test="value_org_unit = '1'">
<xsl:attribute name="checked">
<xsl:text>checked</xsl:text>
</xsl:attribute>
Modified: trunk/property/templates/base/entity.xsl
===================================================================
--- trunk/property/templates/base/entity.xsl 2014-04-08 08:54:20 UTC (rev
11896)
+++ trunk/property/templates/base/entity.xsl 2014-04-09 10:21:23 UTC (rev
11897)
@@ -586,16 +586,16 @@
<xsl:choose>
<xsl:when test="mode='edit'">
<xsl:choose>
-
<xsl:when test="department='1'">
+
<xsl:when test="org_unit='1'">
<tr>
<td>
<xsl:value-of
select="php:function('lang', 'department')"/>
</td>
<td>
<div class="autocomplete">
-
<input id="department_id"
name="department_id" type="hidden" value="{value_department_id}">
+
<input id="org_unit_id"
name="org_unit_id" type="hidden" value="{value_org_unit_id}">
</input>
-
<input id="department_name"
name="department_name" type="text" value="{value_department_name}"
title="{value_department_name_path}" size='60'>
+
<input id="org_unit_name"
name="org_unit_name" type="text" value="{value_org_unit_name}"
title="{value_org_unit_name_path}" size='60'>
<xsl:choose>
<xsl:when
test="disabled!=''">
<xsl:attribute name="disabled">
@@ -604,7 +604,7 @@
</xsl:when>
</xsl:choose>
</input>
-
<div id="department_container"/>
+
<div id="org_unit_container"/>
</div>
</td>
</tr>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [11897] property, bim and catch: rename department to org_unit,
Sigurd Nes <=