[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [8702]
From: |
Torstein |
Subject: |
[Fmsystem-commits] [8702] |
Date: |
Mon, 30 Jan 2012 08:21:36 +0000 |
Revision: 8702
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8702
Author: vator
Date: 2012-01-30 08:21:35 +0000 (Mon, 30 Jan 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/controller/inc/class.uicalendar.inc.php
trunk/controller/inc/class.uicontrol.inc.php
trunk/controller/inc/class.uicontrol_location.inc.php
trunk/controller/templates/base/control_location/add_location_to_control.xsl
trunk/controller/templates/base/control_location/view_locations_for_control.xsl
Modified: trunk/controller/inc/class.uicalendar.inc.php
===================================================================
--- trunk/controller/inc/class.uicalendar.inc.php 2012-01-29 20:12:08 UTC
(rev 8701)
+++ trunk/controller/inc/class.uicalendar.inc.php 2012-01-30 08:21:35 UTC
(rev 8702)
@@ -202,7 +202,7 @@
// Puts aggregate values for daily controls in a twelve
month array
foreach($controls_for_location_array as $control){
- if($control->get_repeat_type() == 0){
+ if($control->get_repeat_type() == 0 |
$control->get_repeat_type() == 1){
$controls_calendar_array =
$this->calendar_builder->build_agg_calendar_array($controls_calendar_array,
$control, $location_code, $year);
}
}
Modified: trunk/controller/inc/class.uicontrol.inc.php
===================================================================
--- trunk/controller/inc/class.uicontrol.inc.php 2012-01-29 20:12:08 UTC
(rev 8701)
+++ trunk/controller/inc/class.uicontrol.inc.php 2012-01-30 08:21:35 UTC
(rev 8702)
@@ -274,8 +274,6 @@
$tabs = $this->make_tab_menu($control_id);
- print_r( $tabs );
-
$data = array
(
'tabs'
=> $GLOBALS['phpgw']->common->create_tabs($tabs, 0),
@@ -542,7 +540,6 @@
if($control_id > 0){
- echo " Detaljer ";
$control = $this->so->get_single($control_id);
$tabs[] = array(
@@ -555,7 +552,6 @@
if(count($saved_control_groups) > 0)
{
- echo " Grupper ";
$tabs[] = array(
'label' => "2:
" . lang('Choose_control_groups'),
'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_control_groups',
@@ -566,7 +562,6 @@
if(count($saved_control_items) > 0)
{
- echo " Punkter ";
$tabs[] = array(
'label'
=> "3: " . lang('Choose_control_items'),
'link'
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_control_items',
@@ -596,13 +591,6 @@
));
}
-
-
-
-
- echo " 2: ";
- print_r($tabs);
-
return $tabs;
}
Modified: trunk/controller/inc/class.uicontrol_location.inc.php
===================================================================
--- trunk/controller/inc/class.uicontrol_location.inc.php 2012-01-29
20:12:08 UTC (rev 8701)
+++ trunk/controller/inc/class.uicontrol_location.inc.php 2012-01-30
08:21:35 UTC (rev 8702)
@@ -98,44 +98,24 @@
if(phpgw::get_var('phpgw_return_as') == 'json') {
return $this->query();
}
- $building_types =
execMethod('property.soadmin_location.read',array());
- $type_id = 1;
+ // Sigurd: START as categories
+ $cats = CreateObject('phpgwapi.categories', -1,
'controller', '.control');
+ $cats->supress_info = true;
- $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'
- );
+ $control_areas =
$cats->formatted_xslt_list(array('format'=>'filter','globals' => true,'use_acl'
=> $this->_category_acl));
+
+ $control_areas_array2 = array();
+ foreach($control_areas['cat_list'] as $cat_list)
+ {
+ $control_areas_array2[] = array
+ (
+ 'id' => $cat_list['cat_id'],
+ 'name' => $cat_list['name'],
+ );
+ }
+ // END as categories
- $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(
@@ -146,8 +126,7 @@
$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,
+ 'control_areas_array2' =>
$control_areas_array2,
'locations_table' => array(
'source' =>
self::link(array('menuaction' =>
'controller.uicontrol.get_locations_for_control', 'control_id' => $control_id
,'phpgw_return_as' => 'json')),
'field' => array(
@@ -237,6 +216,24 @@
$control_areas_array =
$this->so_control_area->get_control_areas_as_array();
+ // Sigurd: START as categories
+ $cats = CreateObject('phpgwapi.categories', -1,
'controller', '.control');
+ $cats->supress_info = true;
+
+ $control_areas =
$cats->formatted_xslt_list(array('format'=>'filter','globals' => true,'use_acl'
=> $this->_category_acl));
+
+ $control_areas_array2 = array();
+ foreach($control_areas['cat_list'] as $cat_list)
+ {
+ $control_areas_array2[] = array
+ (
+ 'id' => $cat_list['cat_id'],
+ 'name' => $cat_list['name'],
+ );
+ }
+ // END as categories
+
+
$tabs = array( array(
'label' =>
lang('View_locations_for_control'),
'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol_location.index'))
@@ -249,7 +246,7 @@
'tabs'
=> $GLOBALS['phpgw']->common->create_tabs($tabs, 1),
'view'
=> "add_location_to_control",
'control_filters' =>
array(
- 'control_area_array' =>
$control_areas_array,
+ 'control_areas_array2' =>
$control_areas_array2,
'control_array'
=> $control_array
),
'filter_form' =>
array(
Modified:
trunk/controller/templates/base/control_location/add_location_to_control.xsl
===================================================================
---
trunk/controller/templates/base/control_location/add_location_to_control.xsl
2012-01-29 20:12:08 UTC (rev 8701)
+++
trunk/controller/templates/base/control_location/add_location_to_control.xsl
2012-01-30 08:21:35 UTC (rev 8702)
@@ -38,13 +38,13 @@
<!-- When control area is chosen, an ajax request is executed.
The operation fetches controls from db and populates the control list.
The ajax opearation is handled in ajax.js -->
<select style="float:left;" id="control_area_list"
name="control_area_list">
- <xsl:for-each select="control_area_array">
- <xsl:variable
name="control_area_id"><xsl:value-of select="id"/></xsl:variable>
- <option value="{$control_area_id}">
- <xsl:value-of select="title"/>
- </option>
+ <option value="">Velg kontrollområde</option>
+ <xsl:for-each select="control_areas_array2">
+ <option value="{id}">
+ <xsl:value-of
disable-output-escaping="yes" select="name"/>
+ </option>
</xsl:for-each>
- </select>
+ </select>
<form id="loc_form" action="" method="GET">
<select id="control_id" name="control_id">
Modified:
trunk/controller/templates/base/control_location/view_locations_for_control.xsl
===================================================================
---
trunk/controller/templates/base/control_location/view_locations_for_control.xsl
2012-01-29 20:12:08 UTC (rev 8701)
+++
trunk/controller/templates/base/control_location/view_locations_for_control.xsl
2012-01-30 08:21:35 UTC (rev 8702)
@@ -17,6 +17,7 @@
</func:function>
<xsl:template name="view_locations_for_control">
+
<!-- IMPORTANT!!! Loads YUI javascript -->
<xsl:call-template name="common"/>
@@ -29,13 +30,13 @@
The ajax operation is handled in
ajax.js
-->
<select style="float:left;"
id="control_area_list" name="control_area_list">
- <xsl:for-each
select="control_area_array">
- <xsl:variable
name="control_area_id"><xsl:value-of select="id"/></xsl:variable>
- <option
value="{$control_area_id}">
- <xsl:value-of
select="title"/>
- </option>
+ <option value="">Velg
kontrollområde</option>
+ <xsl:for-each
select="control_areas_array2">
+ <option value="{id}">
+ <xsl:value-of
disable-output-escaping="yes" select="name"/>
+ </option>
</xsl:for-each>
- </select>
+ </select>
<form id="loc_form" action="" method="GET">
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [8702],
Torstein <=