[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [8638]
From: |
Torstein |
Subject: |
[Fmsystem-commits] [8638] |
Date: |
Sat, 21 Jan 2012 11:36:07 +0000 |
Revision: 8638
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8638
Author: vator
Date: 2012-01-21 11:36:06 +0000 (Sat, 21 Jan 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/controller/inc/class.menu.inc.php
trunk/controller/inc/class.uicheck_list_for_location.inc.php
trunk/controller/inc/class.uicontrol_location.inc.php
Modified: trunk/controller/inc/class.menu.inc.php
===================================================================
--- trunk/controller/inc/class.menu.inc.php 2012-01-21 11:30:19 UTC (rev
8637)
+++ trunk/controller/inc/class.menu.inc.php 2012-01-21 11:36:06 UTC (rev
8638)
@@ -61,7 +61,7 @@
'location_for_check_list' => array
(
'text' => lang('Location'),
-
'url' => $GLOBALS['phpgw']->link('/index.php',
array('menuaction'=> 'controller.uicheck_list_for_location.index') ),
+
'url' => $GLOBALS['phpgw']->link('/index.php',
array('menuaction'=> 'controller.uicontrol_location.index') ),
'image' => array('property', 'location_1')
),
'component_for_check_list' => array
Modified: trunk/controller/inc/class.uicheck_list_for_location.inc.php
===================================================================
--- trunk/controller/inc/class.uicheck_list_for_location.inc.php
2012-01-21 11:30:19 UTC (rev 8637)
+++ trunk/controller/inc/class.uicheck_list_for_location.inc.php
2012-01-21 11:36:06 UTC (rev 8638)
@@ -99,223 +99,6 @@
self::set_active_menu('controller::control::location_for_check_list');
}
- function index()
- {
- if(phpgw::get_var('phpgw_return_as') == 'json') {
- return $this->query();
- }
- $building_types =
execMethod('property.soadmin_location.read',array());
-
- $type_id = 1;
-
- $category_types =
$this->bocommon->select_category_list(array(
-
'format'=>'filter',
-
'selected' =>
$this->cat_id,
-
'type'
=>'location',
-
'type_id'
=>$type_id,
-
'order'=>'descr'
-
));
-
- $district_list =
$this->bocommon->select_district_list('filter',$this->district_id);
- $default_value = array ('id'=>'','name'=>lang('no
district'));
- array_unshift($district_list,$default_value);
-
- $part_of_town_list =
$this->bocommon->select_part_of_town('filter',$this->part_of_town_id,$this->district_id);
- $default_value = array ('id'=>'','name'=>lang('no part
of town'));
- array_unshift($part_of_town_list,$default_value);
-
- $_role_criteria = array
- (
- 'type' =>
'responsibility_role',
- 'filter' =>
array('location' => ".location.{$type_id}"),
- 'order' => 'name'
- );
-
- $responsibility_roles_list =
execMethod('property.sogeneric.get_list',$_role_criteria);
- $default_value = array ('id'=>'','name'=>lang('no
role'));
- array_unshift ($responsibility_roles,$default_value);
-
- $control_areas_array =
$this->so_control_area->get_control_areas_as_array();
- $controls_array =
$this->so_control->get_controls_by_control_area($control_areas_array[0]['id']);
- $control_id = $control_areas_array[0]['id'];
-
- if($control_id == null)
- $control_id = 0;
-
- $tabs = array( array(
- 'label' =>
lang('View_locations_for_control')
- ), array(
- 'label' =>
lang('Add_locations_for_control'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicheck_list_for_location.add_location_to_control'))
- ));
-
- $data = array(
- 'tabs' =>
$GLOBALS['phpgw']->common->create_tabs($tabs, 0),
- 'view' =>
"view_locations_for_control",
- 'control_area_array' => $control_areas_array,
- 'control_array' =>
$control_array,
- 'locations_table' => array(
- 'source' =>
self::link(array('menuaction' =>
'controller.uicontrol.get_locations_for_control', 'control_id' => $control_id
,'phpgw_return_as' => 'json')),
- 'field' => array(
- array(
- 'key' => 'id',
- 'label' =>
lang('ControlId'),
- 'sortable' => true,
- ),
- array(
- 'key' => 'title',
- 'label' =>
lang('Property name'),
- 'sortable' =>
false
- ),
- array(
- 'key' =>
'location_code',
- 'label' =>
lang('location_code'),
- 'sortable' => false
- ),
- array(
- 'key' => 'loc1_name',
- 'label' =>
lang('Location_name'),
- 'sortable' => false
- ),
- array(
- 'key' => 'actions',
- 'hidden' => true
- ),
- array(
- 'key' => 'labels',
- 'hidden' => true
- ),
- array(
- 'key' => 'ajax',
- 'hidden' => true
- ),array(
- 'key' => 'parameters',
- 'hidden' => true
- )
- )
- )
- );
-
- phpgwapi_yui::load_widget('paginator');
-
- self::add_javascript('controller', 'yahoo',
'control_tabs.js');
- self::add_javascript('controller', 'controller',
'jquery.js');
- self::add_javascript('controller', 'controller',
'ajax.js');
-
-
self::render_template_xsl(array('control_location_tabs', 'common',
'view_locations_for_control'), $data);
- }
-
- function add_location_to_control()
- {
- if(phpgw::get_var('phpgw_return_as') == 'json') {
- return $this->query();
- }
- $building_types =
execMethod('property.soadmin_location.read',array());
-
- $type_id = 1;
-
- $category_types =
$this->bocommon->select_category_list(array(
-
'format'=>'filter',
-
'selected' =>
$this->cat_id,
-
'type'
=>'location',
-
'type_id'
=>$type_id,
-
'order'=>'descr'
-
));
-
- $district_list =
$this->bocommon->select_district_list('filter',$this->district_id);
- $default_value = array ('id'=>'','name'=>lang('no
district'));
- array_unshift($district_list,$default_value);
-
- $part_of_town_list =
$this->bocommon->select_part_of_town('filter',$this->part_of_town_id,$this->district_id);
- $default_value = array ('id'=>'','name'=>lang('no part
of town'));
- array_unshift($part_of_town_list,$default_value);
-
- $_role_criteria = array
- (
- 'type' =>
'responsibility_role',
- 'filter' =>
array('location' => ".location.{$type_id}"),
- 'order' => 'name'
- );
-
- $responsibility_roles_list =
execMethod('property.sogeneric.get_list',$_role_criteria);
- $default_value = array ('id'=>'','name'=>lang('no
role'));
- array_unshift ($responsibility_roles,$default_value);
-
- $control_areas_array =
$this->so_control_area->get_control_areas_as_array();
-
- $tabs = array( array(
- 'label' =>
lang('View_locations_for_control'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicheck_list_for_location.index'))
-
- ), array(
- 'label' =>
lang('Add_locations_for_control')
- ));
-
- $data = array(
- 'tabs'
=> $GLOBALS['phpgw']->common->create_tabs($tabs, 1),
- 'view'
=> "add_location_to_control",
- 'control_filters' =>
array(
- 'control_area_array' =>
$control_areas_array,
- 'control_array'
=> $control_array
- ),
- 'filter_form' =>
array(
- 'building_types'
=> $building_types,
- 'category_types'
=> $category_types,
- 'district_list'
=> $district_list,
- 'part_of_town_list' =>
$part_of_town_list
- ),
- 'datatable' => array(
- 'source' =>
self::link(array('menuaction' => 'controller.uicheck_list_for_location.index',
'phpgw_return_as' => 'json')),
- 'field' => array(
- array(
- 'key' =>
'location_code',
- 'label' =>
lang('Property'),
- 'sortable' => true,
- 'formatter' =>
'YAHOO.portico.formatLink'
- ),
- array(
- 'key' =>
'loc1_name',
- 'label' =>
lang('Property name'),
- 'sortable' =>
false
- ),
- array(
- 'key' => 'adresse1',
- 'label' =>
lang('Address'),
- 'sortable' => false
- ),
- array(
- 'key' => 'postnummer',
- 'label' => lang('Zip
code'),
- 'sortable' => false
- ),
- array(
- 'key' => 'actions',
- 'hidden' => true
- ),
- array(
- 'key' => 'labels',
- 'hidden' => true
- ),
- array(
- 'key' => 'ajax',
- 'hidden' => true
- ),array(
- 'key' => 'parameters',
- 'hidden' => true
- )
- )
- )
- );
-
- phpgwapi_yui::load_widget('paginator');
-
- self::add_javascript('controller', 'yahoo',
'control_tabs.js');
- self::add_javascript('controller', 'controller',
'jquery.js');
- self::add_javascript('controller', 'controller',
'ajax.js');
-
-
self::render_template_xsl(array('control_location_tabs', 'common',
'add_location_to_control'), $data);
- }
-
function add_check_list(){
$location_code = phpgw::get_var('location_code');
$control_id = phpgw::get_var('control_id');
@@ -535,49 +318,5 @@
self::render_template_xsl(array('check_list/check_list_tab_menu','check_list/view_control_info'),
$data);
}
- public function query(){
- $type_id = phpgw::get_var('type_id');
- $return_results = phpgw::get_var('results', 'int',
'REQUEST', 0);
-
- $type_id = $type_id ? $type_id : 1;
-
- $location_list = array();
-
- $this->bo->sort = "ASC";
- $this->bo->start = phpgw::get_var('startIndex');
-
- $location_list = $this->bo->read(array('user_id' =>
$user_id, 'role_id' =>$role_id,
'type_id'=>$type_id,'lookup_tenant'=>$lookup_tenant,
-
'lookup'=>$lookup,'allrows'=>$this->allrows,'dry_run'
=>$dry_run));
-
- $rows_total = $this->bo->read(array('type_id' =>
$type_id, 'allrows' => true));
-
- foreach($location_list as $location)
- {
- $results['results'][]= $location;
- }
-
- $results['total_records'] = count($rows_total);
- $results['start'] = $this->start;
- $results['sort'] = 'location_code';
- $results['dir'] = "ASC";
-
- array_walk($results['results'], array($this,
'add_actions'), array($type));
-
- return $this->yui_results($results);
- }
-
- public function add_actions(&$value, $key, $params)
- {
- unset($value['query_location']);
-
- $value['ajax'] = array();
- $value['actions'] = array();
- $value['labels'] = array();
- $value['parameters'] = array();
-
- $value['ajax'][] = true;
- $value['actions'][] =
html_entity_decode(self::link(array('menuaction' =>
'controller.uicontrol.add_location_to_control', 'location_code' =>
$value['location_code'])));
- $value['labels'][] = lang('add_location');
- $value['parameters'][] = "control_id";
- }
+ public function query(){}
}
Modified: trunk/controller/inc/class.uicontrol_location.inc.php
===================================================================
--- trunk/controller/inc/class.uicontrol_location.inc.php 2012-01-21
11:30:19 UTC (rev 8637)
+++ trunk/controller/inc/class.uicontrol_location.inc.php 2012-01-21
11:36:06 UTC (rev 8638)
@@ -146,7 +146,7 @@
'label' =>
lang('View_locations_for_control')
), array(
'label' =>
lang('Add_locations_for_control'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicheck_list_for_location.add_location_to_control'))
+ 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol_location.add_location_to_control'))
));
$data = array(
@@ -245,7 +245,7 @@
$tabs = array( array(
'label' =>
lang('View_locations_for_control'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicheck_list_for_location.index'))
+ 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol_location.index'))
), array(
'label' =>
lang('Add_locations_for_control')
@@ -265,7 +265,7 @@
'part_of_town_list' =>
$part_of_town_list
),
'datatable' => array(
- 'source' =>
self::link(array('menuaction' => 'controller.uicheck_list_for_location.index',
'phpgw_return_as' => 'json')),
+ 'source' =>
self::link(array('menuaction' => 'controller.uicontrol_location.index',
'phpgw_return_as' => 'json')),
'field' => array(
array(
'key' =>
'location_code',
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [8638],
Torstein <=