[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [8265] controller: alter from equipment to the more g
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [8265] controller: alter from equipment to the more generic componant, add home-hook, some conversion of space to tabs |
Date: |
Sat, 10 Dec 2011 15:55:31 +0000 |
Revision: 8265
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8265
Author: sigurdne
Date: 2011-12-10 15:55:30 +0000 (Sat, 10 Dec 2011)
Log Message:
-----------
controller: alter from equipment to the more generic componant, add home-hook,
some conversion of space to tabs
Modified Paths:
--------------
trunk/controller/inc/class.menu.inc.php
trunk/controller/inc/class.socheck_item.inc.php
trunk/controller/inc/class.socheck_list.inc.php
trunk/controller/inc/class.socommon.inc.php
trunk/controller/inc/class.socontrol.inc.php
trunk/controller/inc/class.socontrol_area.inc.php
trunk/controller/inc/class.socontrol_group.inc.php
trunk/controller/inc/class.socontrol_group_list.inc.php
trunk/controller/inc/class.soprocedure.inc.php
trunk/controller/inc/class.uicheck_list.inc.php
trunk/controller/inc/class.uicommon.inc.php
trunk/controller/inc/class.uicontrol.inc.php
trunk/controller/inc/class.uicontrol_group.inc.php
trunk/controller/inc/class.uicontrol_item.inc.php
trunk/controller/inc/class.uiprocedure.inc.php
trunk/controller/inc/model/class.check_list.inc.php
trunk/controller/inc/model/class.control.inc.php
trunk/controller/js/controller/ajax.js
trunk/controller/js/yahoo/common.js
trunk/controller/js/yahoo/control_tabs.js
trunk/controller/js/yahoo/datatable.js
trunk/controller/setup/phpgw_no.lang
trunk/controller/setup/setup.inc.php
trunk/controller/setup/tables_current.inc.php
trunk/controller/setup/tables_update.inc.php
trunk/controller/templates/base/add_location_to_control.xsl
trunk/controller/templates/base/choose_control_items.xsl
trunk/controller/templates/base/common.php
trunk/controller/templates/base/common.xsl
trunk/controller/templates/base/control.xsl
trunk/controller/templates/base/control_group_items.xsl
trunk/controller/templates/base/control_groups.xsl
trunk/controller/templates/base/control_item.xsl
trunk/controller/templates/base/control_tabs.xsl
trunk/controller/templates/base/datatable.xsl
trunk/controller/templates/base/edit_check_list.xsl
trunk/controller/templates/base/sort_check_list.xsl
trunk/controller/templates/base/tab_view_check_lists.xsl
trunk/controller/templates/base/view_agg_check_lists_for_location_month.xsl
trunk/controller/templates/base/view_agg_check_lists_for_location_year.xsl
trunk/controller/templates/base/view_check_list.xsl
trunk/controller/templates/base/view_check_lists.xsl
trunk/controller/templates/base/view_check_lists_for_location.xsl
trunk/controller/templates/base/view_control_item_list.xsl
trunk/controller/templates/base/view_locations_for_control.xsl
Added Paths:
-----------
trunk/controller/inc/class.uicheck_list_for_component.inc.php
trunk/controller/inc/hook_home.inc.php
trunk/controller/js/yahoo/component_location.js
trunk/controller/templates/base/add_component_to_control.xsl
trunk/controller/templates/base/component.xsl
trunk/controller/templates/base/control_component.xsl
trunk/controller/templates/base/control_component_tabs.xsl
trunk/controller/templates/base/view_component_for_control.xsl
Removed Paths:
-------------
trunk/controller/inc/class.uicheck_list_for_equipment.inc.php
trunk/controller/js/yahoo/equipment_location.js
trunk/controller/templates/base/add_equipment_to_control.xsl
trunk/controller/templates/base/control_equipment.xsl
trunk/controller/templates/base/control_equipment_tabs.xsl
trunk/controller/templates/base/equipment.xsl
trunk/controller/templates/base/view_equipment_for_control.xsl
Modified: trunk/controller/inc/class.menu.inc.php
===================================================================
--- trunk/controller/inc/class.menu.inc.php 2011-12-09 15:41:52 UTC (rev
8264)
+++ trunk/controller/inc/class.menu.inc.php 2011-12-10 15:55:30 UTC (rev
8265)
@@ -13,7 +13,7 @@
(
'text' => lang('Controller'),
'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=>
'controller.uicontrol.view_control_details') ),
- 'image' => array('property', 'location'),
+ 'image' => array('property',
'location'),
'order' => 10,
'group' => 'office'
)
@@ -27,75 +27,75 @@
(
'text' => lang('Control'),
'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=>
'controller.uicontrol.control_list') ),
- 'image' => array('property',
'location_1'),
+ 'image' => array('property',
'location_1'),
'children' => array(
'location_for_check_list' => array
(
'text' => lang('Location'),
'url' => $GLOBALS['phpgw']->link('/index.php',
array('menuaction'=> 'controller.uicheck_list_for_location.index') ),
-
'image' => array('property', 'location_1')
-
),
-
'equipment_for_check_list' => array
+
'image' => array('property', 'location_1')
+
),
+
'component_for_check_list' => array
(
-
'text' => lang('Equipment'),
-
'url' => $GLOBALS['phpgw']->link('/index.php',
array('menuaction'=> 'controller.uicheck_list_for_equipment.index') ),
-
'image' => array('property', 'entity_1')
-
)
+
'text' => lang('component'),
+
'url' => $GLOBALS['phpgw']->link('/index.php',
array('menuaction'=> 'controller.uicheck_list_for_component.index') ),
+
'image' => array('property', 'entity_1')
+
)
)
),
'location_for_check_list' => array
(
'text' =>
lang('location_connections'),
'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=>
'controller.uicheck_list_for_location.index') ),
- 'image' => array('property',
'location_1')
- ),
+ 'image' => array('property',
'location_1')
+ ),
'control_item' => array
(
'text' => lang('Control_item'),
'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=>
'controller.uicontrol_item.index') ),
- 'image' => array('property',
'location_1')
- ),
- 'control_group' => array
+ 'image' => array('property',
'location_1')
+ ),
+ 'control_group' => array
(
'text' =>
lang('Control_group'),
'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=>
'controller.uicontrol_group.index') ),
- 'image' => array('property',
'location_1')
- ),
- 'procedure' => array
+ 'image' => array('property',
'location_1')
+ ),
+ 'procedure' => array
(
'text' => lang('Procedure'),
'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=>
'controller.uiprocedure.index') ),
- 'image' => array('property',
'location_1'),
- ),
+ 'image' => array('property',
'location_1'),
+ ),
'check_list' => array
(
'text' => lang('Check_list'),
'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=>
'controller.uicheck_list.index') ),
- 'image' => array('property',
'location_1'),
+ 'image' => array('property',
'location_1'),
),
'location_check_list' => array
(
'text' =>
lang('Check_list_location'),
'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=>
'controller.uilocation_check_list.view_agg_check_lists_for_location', 'year' =>
'2011', 'month' => '10') ),
- 'image' => array('property', 'location_1'),
+ 'image' => array('property',
'location_1'),
)
);
}
else
{
$menus['navigation'] = array
- (
+ (
'check_list' => array
(
'text' => lang('Check_list'),
'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=>
'controller.uicheck_list.index') ),
- 'image' => array('property',
'location_1'),
+ 'image' => array('property',
'location_1'),
),
'location_check_list' => array
(
'text' =>
lang('Check_list_location'),
'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=>
'controller.uilocation_check_list.view_check_lists_for_location') ),
- 'image' => array('property', 'location_1'),
+ 'image' => array('property',
'location_1'),
),
);
}
Modified: trunk/controller/inc/class.socheck_item.inc.php
===================================================================
--- trunk/controller/inc/class.socheck_item.inc.php 2011-12-09 15:41:52 UTC
(rev 8264)
+++ trunk/controller/inc/class.socheck_item.inc.php 2011-12-10 15:55:30 UTC
(rev 8265)
@@ -45,8 +45,8 @@
return isset($result) ?
$this->db->get_last_insert_id('controller_check_item', 'id') : 0;
}
- function update($check_item){
-
+ function update($check_item)
+ {
$id = $check_item->get_id();
$values = array(
@@ -58,14 +58,18 @@
$result = $this->db->query('UPDATE controller_check_item SET '
. join(',', $values) . " WHERE id=$id", __LINE__,__FILE__);
- if( isset($result) ){
+ if( isset($result) )
+ {
return $id;
- }else{
+ }
+ else
+ {
return 0;
}
}
- public function get_single($check_item_id){
+ public function get_single($check_item_id)
+ {
$sql = "SELECT ci.*, coi.id as coi_id, coi.* ";
$sql .= "FROM controller_check_item ci, controller_control_item
coi ";
$sql .= "WHERE ci.id = $check_item_id ";
@@ -90,7 +94,9 @@
$check_item->set_control_item($control_item->toArray());
return $check_item;
- }else{
+ }
+ else
+ {
return null;
}
}
Modified: trunk/controller/inc/class.socheck_list.inc.php
===================================================================
--- trunk/controller/inc/class.socheck_list.inc.php 2011-12-09 15:41:52 UTC
(rev 8264)
+++ trunk/controller/inc/class.socheck_list.inc.php 2011-12-10 15:55:30 UTC
(rev 8265)
@@ -14,21 +14,24 @@
*/
public static function get_instance()
{
- if (self::$so == null) {
+ if (self::$so == null)
+ {
self::$so = CreateObject('controller.socheck_list');
}
return self::$so;
}
- public function get_single($check_list_id){
+ public function get_single($check_list_id)
+ {
$sql = "SELECT cl.id as cl_id, cl.status as cl_status,
cl.comment as cl_comment, deadline, ci.id as ci_id, ci.status as ci_status,
control_item_id, ci.comment as ci_comment, check_list_id FROM
controller_check_list cl, controller_check_item ci WHERE cl.id = $check_list_id
AND cl.id = ci.check_list_id;";
$this->db->query($sql);
$counter = 0;
$check_list = null;
- while ($this->db->next_record()) {
-
- if($counter == 0){
+ while ($this->db->next_record())
+ {
+ if($counter == 0)
+ {
$check_list = new
controller_check_list($this->unmarshal($this->db->f('cl_id', true), 'int'));
$check_list->set_status($this->unmarshal($this->db->f('cl_status', true),
'bool'));
$check_list->set_comment($this->unmarshal($this->db->f('cl_comment', true),
'string'));
@@ -46,15 +49,19 @@
$counter++;
}
- if($check_list != null){
+ if($check_list != null)
+ {
$check_list->set_check_item_array($check_items_array);
return $check_list->toArray();
- }else {
+ }
+ else
+ {
return null;
}
}
- public function get_single_with_control_items($check_list_id){
+ public function get_single_with_control_items($check_list_id)
+ {
$sql = "SELECT cl.id as cl_id, cl.status as cl_status,
cl.comment as cl_comment, deadline, ";
$sql .= "ci.id as ci_id, ci.status as ci_status,
control_item_id, ci.comment as ci_comment, check_list_id, ";
$sql .= "coi.title as coi_id, coi.title as coi_title,
coi.required as coi_required, coi.required as coi_required, ";
@@ -68,9 +75,10 @@
$counter = 0;
$check_list = null;
- while ($this->db->next_record()) {
-
- if($counter == 0){
+ while ($this->db->next_record())
+ {
+ if($counter == 0)
+ {
$check_list = new
controller_check_list($this->unmarshal($this->db->f('cl_id', true), 'int'));
$check_list->set_status($this->unmarshal($this->db->f('cl_status', true),
'bool'));
$check_list->set_comment($this->unmarshal($this->db->f('cl_comment', true),
'string'));
@@ -97,16 +105,19 @@
$counter++;
}
- if($check_list != null){
+ if($check_list != null)
+ {
$check_list->set_check_item_array($check_items_array);
return $check_list->toArray();
- }else {
+ }
+ else
+ {
return null;
}
}
- public function get_check_list(){
-
+ public function get_check_list()
+ {
$current_time = time();
$buffer_in_days = 3600*24*7*5;
@@ -116,7 +127,8 @@
$sql = "SELECT p.* FROM controller_control p WHERE
$current_time >= p.start_date AND p.start_date > $buffer_time";
$this->db->query($sql);
- while ($this->db->next_record()) {
+ while ($this->db->next_record())
+ {
$start_date = date("d.m.Y",
$this->db->f('start_date'));
$end_date = date("d.m.Y", $this->db->f('end_date'));
@@ -133,8 +145,8 @@
$control->set_responsibility_id($this->unmarshal($this->db->f('responsibility_id',
true), 'int'));
$control->set_control_area_id($this->unmarshal($this->db->f('control_area_id',
true), 'int'));
$control->set_control_area_name($this->unmarshal($this->db->f('control_area_name',
true), 'string'));
-
$control->set_equipment_type_id($this->unmarshal($this->db->f('equipment_type_id',
true), 'int'));
-
$control->set_equipment_id($this->unmarshal($this->db->f('equipment_id', true),
'int'));
+
$control->set_component_type_id($this->unmarshal($this->db->f('component_type_id',
true), 'int'));
+
$control->set_component_id($this->unmarshal($this->db->f('component_id', true),
'int'));
$control->set_location_code($this->unmarshal($this->db->f('location_code',
true), 'int'));
$control->set_repeat_type($this->unmarshal($this->db->f('repeat_type', true),
'int'));
$control->set_repeat_interval($this->unmarshal($this->db->f('repeat_interval',
true), 'int'));
@@ -145,7 +157,8 @@
return $results;
}
- function get_check_lists_for_control($control_id){
+ function get_check_lists_for_control($control_id)
+ {
$sql = "SELECT cl.id as cl_id, cl.status as cl_status,
cl.comment as cl_comment, deadline, ";
$sql .= "ci.id as ci_id, ci.status as ci_status,
control_item_id, ci.comment as ci_comment, check_list_id ";
$sql .= "FROM controller_check_list cl, controller_check_item
ci ";
@@ -156,11 +169,12 @@
$check_list_id = 0;
$check_list = null;
- while ($this->db->next_record()) {
-
- if( $this->db->f('cl_id', true) != $check_list_id ){
-
- if($check_list_id != 0){
+ while ($this->db->next_record())
+ {
+ if( $this->db->f('cl_id', true) != $check_list_id )
+ {
+ if($check_list_id != 0)
+ {
$check_list->set_check_item_array($check_items_array);
$check_list_array[] =
$check_list->toArray();
}
@@ -184,18 +198,21 @@
$check_list_id = $check_list->get_id();
}
- if($check_list != null){
+ if($check_list != null)
+ {
$check_list->set_check_item_array($check_items_array);
$check_list_array[] = $check_list->toArray();
return $check_list_array;
- }else {
+ }
+ else
+ {
return null;
}
}
- function get_agg_check_lists_for_location( $location_code, $from_date,
$to_date ){
-
+ function get_agg_check_lists_for_location( $location_code, $from_date,
$to_date )
+ {
$sql = "SELECT c.id as c_id, title, cl.id as cl_id,
c.repeat_type, c.repeat_interval, deadline, count(ci.id) ";
$sql .= "FROM controller_check_list cl, controller_control c,
controller_check_item ci ";
$sql .= "WHERE cl.location_code = $location_code ";
@@ -211,10 +228,12 @@
$control_id = 0;
$controls_array = array();
$check_list_array = array();
- while ($this->db->next_record()) {
-
- if( $this->db->f('c_id', true) != $control_id ){
- if($control_id != 0){
+ while ($this->db->next_record())
+ {
+ if( $this->db->f('c_id', true) != $control_id )
+ {
+ if($control_id != 0)
+ {
$controls_array[] = array( "control" =>
$control_array, "check_list" => $check_list_array);
$check_list_array = array();
}
@@ -236,16 +255,20 @@
$control_id = $this->db->f('c_id', true);
}
- if( !empty( $control_array ) ){
+ if( !empty( $control_array ) )
+ {
$controls_array[] = array( "control" => $control_array,
"check_list" => $check_list_array);
return $controls_array;
- }else {
+ }
+ else
+ {
return null;
}
}
- function get_check_lists_for_location( $location_code, $from_date,
$to_date, $repeat_type ){
+ function get_check_lists_for_location( $location_code, $from_date,
$to_date, $repeat_type )
+ {
$sql = "SELECT c.id as c_id, cl.id as cl_id, cl.status as
cl_status, cl.comment as cl_comment, ";
$sql .= "deadline, planned_date, completed_date,
cl.location_code as cl_loc, c.* ";
$sql .= "FROM controller_check_list cl, controller_control c ";
@@ -259,11 +282,12 @@
$control_id = 0;
$control = null;
- while ($this->db->next_record()) {
-
- if( $this->db->f('c_id', true) != $control_id ){
-
- if($control_id != 0){
+ while ($this->db->next_record())
+ {
+ if( $this->db->f('c_id', true) != $control_id )
+ {
+ if($control_id != 0)
+ {
$control->set_check_lists_array($check_lists_array);
$controls_array[] = $control;
}
@@ -280,8 +304,8 @@
$control->set_responsibility_id($this->unmarshal($this->db->f('responsibility_id',
true), 'int'));
$control->set_control_area_id($this->unmarshal($this->db->f('control_area_id',
true), 'int'));
$control->set_control_area_name($this->unmarshal($this->db->f('control_area_name',
true), 'string'));
-
$control->set_equipment_type_id($this->unmarshal($this->db->f('equipment_type_id',
true), 'int'));
-
$control->set_equipment_id($this->unmarshal($this->db->f('equipment_id', true),
'int'));
+
$control->set_component_type_id($this->unmarshal($this->db->f('component_type_id',
true), 'int'));
+
$control->set_component_id($this->unmarshal($this->db->f('component_id', true),
'int'));
$control->set_location_code($this->unmarshal($this->db->f('location_code',
true), 'int'));
$control->set_repeat_type($this->unmarshal($this->db->f('repeat_type', true),
'int'));
$control->set_repeat_interval($this->unmarshal($this->db->f('repeat_interval',
true), 'int'));
@@ -302,12 +326,15 @@
$control_id = $control->get_id();
}
- if($control != null){
+ if($control != null)
+ {
$control->set_check_lists_array($check_lists_array);
$controls_array[] = $control;
return $controls_array;
- }else {
+ }
+ else
+ {
return null;
}
}
@@ -378,10 +405,9 @@
}
function populate(int $control_id, &$control)
- {
-
-
- if($control == null) {
+ {
+ if($control == null)
+ {
$start_date = date("d.m.Y",
$this->db->f('start_date'));
$end_date = date("d.m.Y", $this->db->f('end_date'));
$control = new controller_control((int) $control_id);
@@ -398,8 +424,8 @@
$control->set_control_area_id($this->unmarshal($this->db->f('control_area_id',
true), 'int'));
$control->set_control_area_name($this->unmarshal($this->db->f('control_area_name',
true), 'string'));
//
$control->set_control_group_id($this->unmarshal($this->db->f('control_group_id',
true), 'int'));
-
$control->set_equipment_type_id($this->unmarshal($this->db->f('equipment_type_id',
true), 'int'));
-
$control->set_equipment_id($this->unmarshal($this->db->f('equipment_id', true),
'int'));
+
$control->set_component_type_id($this->unmarshal($this->db->f('component_type_id',
true), 'int'));
+
$control->set_component_id($this->unmarshal($this->db->f('component_id', true),
'int'));
$control->set_location_code($this->unmarshal($this->db->f('location_code',
true), 'int'));
$control->set_repeat_type($this->unmarshal($this->db->f('repeat_type', true),
'int'));
$control->set_repeat_interval($this->unmarshal($this->db->f('repeat_interval',
true), 'int'));
Modified: trunk/controller/inc/class.socommon.inc.php
===================================================================
--- trunk/controller/inc/class.socommon.inc.php 2011-12-09 15:41:52 UTC (rev
8264)
+++ trunk/controller/inc/class.socommon.inc.php 2011-12-10 15:55:30 UTC (rev
8265)
@@ -8,7 +8,7 @@
public function __construct()
{
- $this->db = clone $GLOBALS['phpgw']->db;
+ $this->db = clone $GLOBALS['phpgw']->db;
$this->like = & $this->db->like;
$this->join = & $this->db->join;
$this->left_join = & $this->db->left_join;
@@ -68,10 +68,10 @@
{
return intval($value);
}
- elseif($type == 'float')
- {
- return floatval($value);
- }
+ elseif($type == 'float')
+ {
+ return floatval($value);
+ }
return $value;
}
Modified: trunk/controller/inc/class.socontrol.inc.php
===================================================================
--- trunk/controller/inc/class.socontrol.inc.php 2011-12-09 15:41:52 UTC
(rev 8264)
+++ trunk/controller/inc/class.socontrol.inc.php 2011-12-10 15:55:30 UTC
(rev 8265)
@@ -105,8 +105,8 @@
$control->set_responsibility_id($this->unmarshal($this->db->f('responsibility_id',
true), 'int'));
$control->set_control_area_id($this->unmarshal($this->db->f('control_area_id',
true), 'int'));
$control->set_control_area_name($this->unmarshal($this->db->f('control_area_name',
true), 'string'));
-
$control->set_equipment_type_id($this->unmarshal($this->db->f('equipment_type_id',
true), 'int'));
-
$control->set_equipment_id($this->unmarshal($this->db->f('equipment_id', true),
'int'));
+
$control->set_component_type_id($this->unmarshal($this->db->f('component_type_id',
true), 'int'));
+
$control->set_component_id($this->unmarshal($this->db->f('component_id', true),
'int'));
$control->set_location_code($this->unmarshal($this->db->f('location_code',
true), 'int'));
$control->set_repeat_type($this->unmarshal($this->db->f('repeat_type', true),
'int'));
$control->set_repeat_interval($this->unmarshal($this->db->f('repeat_interval',
true), 'int'));
@@ -159,9 +159,9 @@
$this->db->query($sql);
}
- function add_equipment_to_control($control_id, $equipment_id)
+ function add_component_to_control($control_id, $component_id)
{
- $sql = "INSERT INTO controller_control_equipment_list
(control_id, equipment_id) values($control_id, $equipment_id)";
+ $sql = "INSERT INTO controller_control_component_list
(control_id, component_id) values($control_id, $component_id)";
$this->db->query($sql);
}
@@ -242,7 +242,7 @@
}
else
{
- $cols = 'controller_control.id,
controller_control.title, controller_control.description,
controller_control.start_date, controller_control.end_date,
controller_control.procedure_id, controller_control.control_area_id,
controller_control.requirement_id, controller_control.costresponsibility_id,
controller_control.responsibility_id, controller_control.equipment_type_id,
controller_control.equipment_id, controller_control.location_code,
controller_control.repeat_type, controller_control.repeat_interval,
controller_control.enabled, controller_control_area.title AS control_area_name,
controller_procedure.title AS procedure_name, fm_responsibility_role.name AS
responsibility_name ';
+ $cols = 'controller_control.id,
controller_control.title, controller_control.description,
controller_control.start_date, controller_control.end_date,
controller_control.procedure_id, controller_control.control_area_id,
controller_control.requirement_id, controller_control.costresponsibility_id,
controller_control.responsibility_id, controller_control.component_type_id,
controller_control.component_id, controller_control.location_code,
controller_control.repeat_type, controller_control.repeat_interval,
controller_control.enabled, controller_control_area.title AS control_area_name,
controller_procedure.title AS procedure_name, fm_responsibility_role.name AS
responsibility_name ';
}
$dir = $ascending ? 'ASC' : 'DESC';
@@ -278,8 +278,8 @@
$control->set_control_area_id($this->unmarshal($this->db->f('control_area_id',
true), 'int'));
$control->set_control_area_name($this->unmarshal($this->db->f('control_area_name',
true), 'string'));
//
$control->set_control_group_id($this->unmarshal($this->db->f('control_group_id',
true), 'int'));
-
$control->set_equipment_type_id($this->unmarshal($this->db->f('equipment_type_id',
true), 'int'));
-
$control->set_equipment_id($this->unmarshal($this->db->f('equipment_id', true),
'int'));
+
$control->set_component_type_id($this->unmarshal($this->db->f('component_type_id',
true), 'int'));
+
$control->set_component_id($this->unmarshal($this->db->f('component_id', true),
'int'));
$control->set_location_code($this->unmarshal($this->db->f('location_code',
true), 'int'));
$control->set_repeat_type($this->unmarshal($this->db->f('repeat_type', true),
'int'));
$control->set_repeat_interval($this->unmarshal($this->db->f('repeat_interval',
true), 'int'));
@@ -321,8 +321,8 @@
$control->set_control_area_id($this->unmarshal($this->db->f('control_area_id',
true), 'int'));
$control->set_control_area_name($this->unmarshal($this->db->f('control_area_name',
true), 'string'));
//
$control->set_control_group_id($this->unmarshal($this->db->f('control_group_id',
true), 'int'));
-
$control->set_equipment_type_id($this->unmarshal($this->db->f('equipment_type_id',
true), 'int'));
-
$control->set_equipment_id($this->unmarshal($this->db->f('equipment_id', true),
'int'));
+
$control->set_component_type_id($this->unmarshal($this->db->f('component_type_id',
true), 'int'));
+
$control->set_component_id($this->unmarshal($this->db->f('component_id', true),
'int'));
$control->set_location_code($this->unmarshal($this->db->f('location_code',
true), 'int'));
$control->set_repeat_type($this->unmarshal($this->db->f('repeat_type', true),
'int'));
$control->set_repeat_interval($this->unmarshal($this->db->f('repeat_interval',
true), 'int'));
@@ -399,7 +399,7 @@
return $bimItemArray;
}
- public function get_control_equipment($noOfObjects = null, $bim_type =
null)
+ public function get_control_component($noOfObjects = null, $bim_type =
null)
{
$filters = array();
if($noOfObjects != null && is_numeric($noOfObjects))
@@ -411,8 +411,8 @@
$limit = "LIMIT 10";
}
- $joins = " {$this->left_join} controller_control_equipment_list
ON (c.id = controller_control_equipment_list.control_id)";
- $joins .= " {$this->left_join} fm_bim_item ON
(controller_control_equipment_list.equipment_id = fm_bim_item.id)";
+ $joins = " {$this->left_join} controller_control_component_list
ON (c.id = controller_control_component_list.control_id)";
+ $joins .= " {$this->left_join} fm_bim_item ON
(controller_control_component_list.component_id = fm_bim_item.id)";
$joins .= " {$this->left_join} fm_bim_type ON
(fm_bim_item.type= fm_bim_type.id)";
//$joins .= " {$this->left_join} fm_responsibility_role ON
(c.responsibility_id = fm_responsibility_role.id)";
$sql = "SELECT c.id AS control_id, c.title AS control_title,
fm_bim_type.name AS type_name, fm_bim_item.id AS bim_id, fm_bim_item.guid as
bim_item_guid FROM controller_control c {$joins} {$limit}";
Modified: trunk/controller/inc/class.socontrol_area.inc.php
===================================================================
--- trunk/controller/inc/class.socontrol_area.inc.php 2011-12-09 15:41:52 UTC
(rev 8264)
+++ trunk/controller/inc/class.socontrol_area.inc.php 2011-12-10 15:55:30 UTC
(rev 8265)
@@ -14,7 +14,8 @@
*/
public static function get_instance()
{
- if (self::$so == null) {
+ if (self::$so == null)
+ {
self::$so = CreateObject('controller.socontrol_area');
}
return self::$so;
@@ -142,13 +143,13 @@
function get_control_area_select_array()
{
- $results = array();
+ $results = array();
$results[] = array('id' => 0,'name' => lang('Not
selected'));
$this->db->query("SELECT id, title as name FROM
controller_control_area ORDER BY name ASC", __LINE__, __FILE__);
while ($this->db->next_record())
{
$results[] = array('id' => $this->db->f('id',
false),
- 'name' =>
$this->db->f('name', false));
+ 'name' =>
$this->db->f('name', false));
}
return $results;
}
Modified: trunk/controller/inc/class.socontrol_group.inc.php
===================================================================
--- trunk/controller/inc/class.socontrol_group.inc.php 2011-12-09 15:41:52 UTC
(rev 8264)
+++ trunk/controller/inc/class.socontrol_group.inc.php 2011-12-10 15:55:30 UTC
(rev 8265)
@@ -44,7 +44,8 @@
$result = $this->db->query('INSERT INTO
controller_control_group (' . join(',', $cols) . ') VALUES (' . join(',',
$values) . ')', __LINE__,__FILE__);
- if(isset($result)) {
+ if(isset($result))
+ {
// Get the new control group ID and return it
return
$this->db->get_last_insert_id('controller_control_group', 'id');
}
@@ -130,7 +131,8 @@
$sql = "SELECT * FROM controller_control_group $order";
$this->db->limit_query($sql, $start, __LINE__, __FILE__,
$limit);
- while ($this->db->next_record()) {
+ while ($this->db->next_record())
+ {
$control_group = new
controller_control_group($this->unmarshal($this->db->f('id', true), 'int'));
$control_group->set_group_name($this->unmarshal($this->db->f('group_name',
true), 'string'));
@@ -142,20 +144,20 @@
function get_control_group_select_array()
{
- $results = array();
+ $results = array();
$results[] = array('id' => 0,'name' => lang('Not
selected'));
$this->db->query("SELECT id, group_name as name FROM
controller_control_group ORDER BY name ASC", __LINE__, __FILE__);
while ($this->db->next_record())
{
$results[] = array('id' => $this->db->f('id',
false),
- 'name' =>
$this->db->f('name', false));
+ 'name' =>
$this->db->f('name', false));
}
return $results;
}
function get_building_part_select_array($selected_building_part_id)
{
- $results = array();
+ $results = array();
$results[] = array('id' => 0,'name' => lang('Not
selected'));
$this->db->query("SELECT id, descr as name FROM
fm_building_part ORDER BY id ASC", __LINE__, __FILE__);
while ($this->db->next_record())
@@ -164,13 +166,13 @@
if($selected_building_part_id &&
$selected_building_part_id > 0 && $selected_building_part_id == $curr_id)
{
$results[] = array('id' =>
$this->db->f('id', false),
- 'name' =>
$this->db->f('name', false),
+
'name' => $this->db->f('name', false),
'selected' => 'yes');
}
else
{
$results[] = array('id' =>
$this->db->f('id', false),
- 'name' =>
$this->db->f('name', false));
+
'name' => $this->db->f('name', false));
}
}
return $results;
@@ -290,8 +292,8 @@
$dir = $ascending ? 'ASC' : 'DESC';
$order = $sort_field ? "ORDER BY {$this->marshal($sort_field,
'field')} $dir ": '';
- //var_dump("SELECT {$cols} FROM {$tables} {$joins} WHERE
{$condition} {$order}");
-
+ //var_dump("SELECT {$cols} FROM {$tables} {$joins} WHERE
{$condition} {$order}");
+
return "SELECT {$cols} FROM {$tables} {$joins} WHERE
{$condition} {$order}";
}
@@ -310,6 +312,5 @@
}
//var_dump($control_group);
return $control_group;
- }
-
+ }
}
Modified: trunk/controller/inc/class.socontrol_group_list.inc.php
===================================================================
--- trunk/controller/inc/class.socontrol_group_list.inc.php 2011-12-09
15:41:52 UTC (rev 8264)
+++ trunk/controller/inc/class.socontrol_group_list.inc.php 2011-12-10
15:55:30 UTC (rev 8265)
@@ -143,8 +143,8 @@
$control_group_list = array();
- while($this->db->next_record()){
-
+ while($this->db->next_record())
+ {
$control_group = new
controller_control_group($this->unmarshal($this->db->f('id', true), 'int'));
$control_group->set_group_name($this->unmarshal($this->db->f('group_name',
true), 'string'));
$control_group->set_procedure_id($this->unmarshal($this->db->f('procedure_id'),
'int'));
Modified: trunk/controller/inc/class.soprocedure.inc.php
===================================================================
--- trunk/controller/inc/class.soprocedure.inc.php 2011-12-09 15:41:52 UTC
(rev 8264)
+++ trunk/controller/inc/class.soprocedure.inc.php 2011-12-10 15:55:30 UTC
(rev 8265)
@@ -347,8 +347,8 @@
$dir = $ascending ? 'ASC' : 'DESC';
$order = $sort_field ? "ORDER BY {$this->marshal($sort_field,
'field')} $dir ": '';
- //var_dump("SELECT {$cols} FROM {$tables} {$joins} WHERE
{$condition} {$order}");
-
+ //var_dump("SELECT {$cols} FROM {$tables} {$joins} WHERE
{$condition} {$order}");
+
return "SELECT {$cols} FROM {$tables} {$joins} WHERE
{$condition} {$order}";
}
Modified: trunk/controller/inc/class.uicheck_list.inc.php
===================================================================
--- trunk/controller/inc/class.uicheck_list.inc.php 2011-12-09 15:41:52 UTC
(rev 8264)
+++ trunk/controller/inc/class.uicheck_list.inc.php 2011-12-10 15:55:30 UTC
(rev 8265)
@@ -66,32 +66,32 @@
'item' => array(
array('type' =>
'filter',
'name' =>
'status',
- 'text' => lang('Status'),
- 'list' => array(
- array(
- 'id' => 'none',
- 'name' => lang('Not selected')
- ),
- array(
- 'id' => 'NEW',
- 'name' => lang('NEW')
- ),
- array(
- 'id' => 'PENDING',
- 'name' => lang('PENDING')
- ),
- array(
- 'id' => 'REJECTED',
- 'name' => lang('REJECTED')
- ),
- array(
- 'id' => 'ACCEPTED',
- 'name' => lang('ACCEPTED')
- )
- )
- ),
+ 'text' =>
lang('Status'),
+ 'list' => array(
+ array(
+
'id' => 'none',
+
'name' => lang('Not selected')
+ ),
+ array(
+
'id' => 'NEW',
+
'name' => lang('NEW')
+ ),
+ array(
+
'id' => 'PENDING',
+
'name' => lang('PENDING')
+ ),
+ array(
+
'id' => 'REJECTED',
+
'name' => lang('REJECTED')
+ ),
+ array(
+
'id' => 'ACCEPTED',
+
'name' => lang('ACCEPTED')
+ )
+ )
+ ),
array('type' => 'text',
- 'text' => lang('searchfield'),
+ 'text' =>
lang('searchfield'),
'name' =>
'query'
),
array(
Added: trunk/controller/inc/class.uicheck_list_for_component.inc.php
===================================================================
--- trunk/controller/inc/class.uicheck_list_for_component.inc.php
(rev 0)
+++ trunk/controller/inc/class.uicheck_list_for_component.inc.php
2011-12-10 15:55:30 UTC (rev 8265)
@@ -0,0 +1,455 @@
+<?php
+
+ phpgw::import_class('phpgwapi.yui');
+ phpgw::import_class('controller.uicommon');
+ phpgw::import_class('controller.socontrol_area');
+ //phpgw::import_class('bim.sobimitem');
+
+ class controller_uicheck_list_for_component extends controller_uicommon
+ {
+ var $cat_id;
+ var $start;
+ var $query;
+ var $sort;
+ var $order;
+ var $filter;
+ var $currentapp;
+ var $type_id;
+ var $location_code;
+
+ private $so_control_area;
+ private $so_control;
+ private $so_bim;
+
+ var $public_functions = array(
+
'index' => true,
+
'add_component_to_control' => true,
+
'get_component_types_by_category' => true
+ );
+
+ function __construct()
+ {
+ parent::__construct();
+
+ $this->bo =
CreateObject('property.bolocation',true);
+ $this->bocommon = &
$this->bo->bocommon;
+ $this->so_control_area =
CreateObject('controller.socontrol_area');
+ $this->so_control =
CreateObject('controller.socontrol');
+ //$this->so_bim =
CreateObject('bim.sobimitem_impl');
+ //$this->so_bim = new
sobimitem_impl();
+
+ $this->type_id =
$this->bo->type_id;
+
+ $this->start =
$this->bo->start;
+ $this->query =
$this->bo->query;
+ $this->sort =
$this->bo->sort;
+ $this->order =
$this->bo->order;
+ $this->filter =
$this->bo->filter;
+ $this->cat_id =
$this->bo->cat_id;
+ $this->part_of_town_id =
$this->bo->part_of_town_id;
+ $this->district_id =
$this->bo->district_id;
+ $this->status =
$this->bo->status;
+ $this->allrows =
$this->bo->allrows;
+ $this->lookup =
$this->bo->lookup;
+ $this->location_code =
$this->bo->location_code;
+
+
self::set_active_menu('controller::control::component_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();
+
+ // Fetches prosedures that are related to first control
area in list
+ $control_area_id = $control_areas_array[0]['id'];
+
+ $lists = array
+ (
+ 'building_types' =>
$building_types,
+ 'category_types' =>
$category_types,
+ 'district_list' =>
$district_list,
+ 'part_of_town_list' =>
$part_of_town_list,
+ 'responsibility_roles_list' =>
$responsibility_roles_list,
+ 'control_area_list' =>
$control_areas_array,
+ );
+
+
+
+
+ $data = array(
+ 'datatable' => array(
+ 'source' =>
self::link(array('menuaction' => 'controller.uicheck_list_for_component.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'),
+ 'sotrable' =>
false
+ ),
+ array(
+ 'key' => 'adresse1',
+ 'label' =>
lang('Address'),
+ 'sortable' => false
+ ),
+ array(
+ 'key' => 'postnummer',
+ 'label' => lang('Zip
code'),
+ 'sortable' => false
+ ),
+ array(
+ 'key' => 'checked',
+ 'label' => 'Velg',
+ 'sortable' => false,
+ 'formatter' =>
'YAHOO.widget.DataTable.formatCheckbox',
+ 'className' =>
'mychecks'
+ ),
+ array(
+ 'key' => 'link',
+ 'hidden' => true
+ ),
+ array(
+ 'key' => 'actions',
+ 'hidden' => true
+ ),
+ array(
+ 'key' => 'labels',
+ 'hidden' => true
+ ),
+ array(
+ 'key' => 'ajax',
+ 'hidden' => true
+ ),
+ array(
+ 'key' => 'alert',
+ 'hidden' => true
+ )
+ )
+ ),
+ 'lists' => $lists
+ );
+
+ //self::add_javascript('controller', 'yahoo',
'datatable.js');
+ self::add_javascript('controller', 'controller',
'controller_datatable_test.js');
+ self::add_javascript('controller', 'controller',
'jquery.js');
+ self::add_javascript('controller', 'controller',
'ajax.js');
+ //self::add_javascript('controller', 'yahoo',
'component_location.js');
+
+ //$GLOBALS['phpgw']->js->validate_file( 'yahoo',
'equipmens_location', 'controller' );
+
+ //self::render_template_xsl('datatable', $data);
+ self::render_template_xsl('component', $data);
+*/
+ if(phpgw::get_var('phpgw_return_as') == 'json') {
+ return $this->query();
+ }
+ $bim_types = $this->so_control->get_bim_types();
+
+ $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_component_for_control')
+ ), array(
+ 'label' =>
lang('Add_component_for_control'),
+ 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicheck_list_for_component.add_component_to_control'))
+ ));
+
+ $data = array(
+ 'tabs' =>
$GLOBALS['phpgw']->common->create_tabs($tabs, 0),
+ 'view' =>
"view_component_for_control",
+ 'control_area_array' => $control_areas_array,
+ 'control_array' =>
$control_array,
+ 'locations_table' => array(
+ 'source' =>
self::link(array('menuaction' =>
'controller.uicheck_list_for_component.index','phpgw_return_as' => 'json')),
+ 'field' => array(
+ array(
+ 'key' => 'id',
+ 'label' =>
lang('ControlId'),
+ 'sortable' => true,
+ ),
+ array(
+ 'key' => 'title',
+ 'label' =>
lang('Title'),
+ 'sortable' =>
false
+ ),
+ array(
+ 'key' => 'bim_id',
+ 'label' =>
lang('Bim_id'),
+ 'sortable' => false
+ ),
+ array(
+ 'key' => 'bim_name',
+ 'label' =>
lang('Bim_name'),
+ 'sortable' => false
+ ),
+ array(
+ 'key' => 'bim_type',
+ 'label' =>
lang('Bim_type'),
+ 'sortable' => false
+ )
+ )
+ )
+ );
+
+
+ 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_component_tabs', 'common',
'view_component_for_control'), $data);
+ }
+
+ function add_component_to_control()
+ {
+ if(phpgw::get_var('save_component'))
+ {
+ //add component to control using component item
ID
+ $items_checked = array();
+ $items = phpgw::get_var('values_assign');
+ $item_arr = explode('|',$items);
+ foreach($item_arr as $item)
+ {
+ $items_checked[] = explode(';',$item);
+ }
+ //var_dump($items_checked);
+
+ $control_id = phpgw::get_var('control_id');
+ //var_dump($control_id);
+ if($control_id != null &&
is_numeric($control_id))
+ {
+ //add chosen component to control
+ foreach($items_checked as $it)
+ {
+
$this->so_control->add_component_to_control($control_id, $it[0]);
+ }
+ }
+ $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'controller.uicheck_list_for_component.index'));
+
+ }
+ else
+ {
+ if(phpgw::get_var('phpgw_return_as') == 'json')
{
+ return $this->get_component();
+ }
+
+ $bim_types = $this->so_control->get_bim_types();
+
+ $control_areas_array =
$this->so_control_area->get_control_areas_as_array();
+
+ $tabs = array( array(
+ 'label' =>
lang('View_component_for_control'),
+ 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicheck_list_for_component.index'))
+
+ ), array(
+ 'label' =>
lang('Add_component_for_control')
+ ));
+
+ $data = array(
+ 'tabs'
=> $GLOBALS['phpgw']->common->create_tabs($tabs, 1),
+ 'view'
=> "add_component_to_control",
+ 'control_filters'
=> array(
+ 'control_area_array'
=> $control_areas_array,
+ 'control_array'
=> $control_array
+ ),
+ 'filter_form'
=> array(
+ 'bim_types'
=> $bim_types
+ ),
+ 'datatable' => array(
+ 'source' =>
self::link(array('menuaction' =>
'controller.uicheck_list_for_component.add_component_to_control',
'phpgw_return_as' => 'json')),
+ 'field' => array(
+ array(
+ 'key' => 'id',
+ 'label' =>
lang('ID'),
+ 'sortable'
=> true,
+ 'formatter' =>
'YAHOO.portico.formatLink'
+ ),
+ array(
+ 'key' =>
'guid',
+ 'label' =>
lang('GUID'),
+ 'sortable'
=> false
+ ),
+ array(
+ 'key' => 'type',
+ 'label' =>
lang('type'),
+ 'sortable'
=> false
+ ),
+ array(
+ 'key' =>
'checked',
+ 'label' =>
'Velg',
+ 'sortable' =>
false,
+ 'formatter' =>
'YAHOO.widget.DataTable.formatCheckbox',
+ 'className' =>
'mychecks'
+ ),
+ array(
+ 'key' =>
'actions',
+ 'hidden' => true
+ ),
+ array(
+ 'key' =>
'labels',
+ 'hidden' => true
+ ),
+ array(
+ 'key' => 'ajax',
+ '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_component_tabs', 'common',
'add_component_to_control'), $data);
+ }
+ }
+
+ public function query()
+ {
+ $control_list =
$this->so_control->get_control_component();
+
+ foreach($control_list as $control)
+ {
+ $control['bim_name'] =
$this->so_control->getBimItemAttributeValue($control['bim_item_guid'],
'description');
+ $results['results'][]= $control;
+ }
+
+ $results['total_records'] = 10;
+ $results['start'] = 1;
+ $results['sort'] = 'id';
+ array_walk($results['results'], array($this,
'add_links'), array($type));
+
+ return $this->yui_results($results);
+ }
+
+ public function get_component()
+ {
+
+ /*$start =
phpgw::get_var('start', 'int', 'REQUEST', 0);
+ $query =
phpgw::get_var('query');
+ $sort =
phpgw::get_var('sort');
+ $order =
phpgw::get_var('order');
+ $filter =
phpgw::get_var('filter', 'int');
+ $cat_id =
phpgw::get_var('cat_id');
+ $lookup_tenant =
phpgw::get_var('lookup_tenant', 'bool');
+ $district_id =
phpgw::get_var('district_id', 'int');
+ $part_of_town_id =
phpgw::get_var('part_of_town_id', 'int');
+ $status =
phpgw::get_var('status');
+ $type_id =
phpgw::get_var('type_id', 'int');
+ $allrows =
phpgw::get_var('allrows', 'bool');
+ $location_code =
phpgw::get_var('location_code');*/
+
+ $type_id = phpgw::get_var('bim_type_id');
+
+ $start = phpgw::get_var('startIndex');
+
+ $component_list = array();
+
+ $sort = "ASC";
+
+ $component_list =
$this->so_control->getAllBimItems(10,$type_id);
+ //var_dump($component_list);
+
+
+ $results = array();
+ foreach($component_list as $component)
+ {
+ $component['checked'] = false;
+ $results['results'][]= $component;
+ $i++;
+ }
+
+ $results['total_records'] = count($component_list);
+ $results['start'] = $start;
+ $results['sort'] = 'id';
+ $results['dir'] = "ASC";
+
+ array_walk($results['results'], array($this,
'add_links'), 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['ajax'][] = false;
+ $value['actions'][] =
html_entity_decode(self::link(array('menuaction' => 'property.uilocation.view',
'location_code' => $value['location_code'])));
+ $value['labels'][] = lang('show');
+
+ $value['ajax'][] = true;
+ $value['actions'][] =
html_entity_decode(self::link(array('menuaction' =>
'rental.uicomposite.add_unit', 'location_code' => $value['location_code'])));
+ $value['labels'][] = lang('add_location');
+ }
+
+ public function get_component_types_by_category()
+ {
+ $category = phpgw::get_var('ifc');
+ if($ifc != null)
+ {
+ if($ifc = 1)
+ $ifc = true;
+ else
+ $ifc = false;
+ }
+
+
+ $bim_types = $this->so_control->get_bim_types($ifc);
+ if(count($bim_types)>0)
+ return json_encode( $bim_types );
+ else
+ return null;
+ }
+ }
\ No newline at end of file
Deleted: trunk/controller/inc/class.uicheck_list_for_equipment.inc.php
===================================================================
--- trunk/controller/inc/class.uicheck_list_for_equipment.inc.php
2011-12-09 15:41:52 UTC (rev 8264)
+++ trunk/controller/inc/class.uicheck_list_for_equipment.inc.php
2011-12-10 15:55:30 UTC (rev 8265)
@@ -1,455 +0,0 @@
-<?php
-
- phpgw::import_class('phpgwapi.yui');
- phpgw::import_class('controller.uicommon');
- phpgw::import_class('controller.socontrol_area');
- //phpgw::import_class('bim.sobimitem');
-
- class controller_uicheck_list_for_equipment extends controller_uicommon
- {
- var $cat_id;
- var $start;
- var $query;
- var $sort;
- var $order;
- var $filter;
- var $currentapp;
- var $type_id;
- var $location_code;
-
- private $so_control_area;
- private $so_control;
- private $so_bim;
-
- var $public_functions = array(
-
'index' => true,
-
'add_equipment_to_control' => true,
-
'get_equipment_types_by_category' => true
- );
-
- function __construct()
- {
- parent::__construct();
-
- $this->bo =
CreateObject('property.bolocation',true);
- $this->bocommon = &
$this->bo->bocommon;
- $this->so_control_area =
CreateObject('controller.socontrol_area');
- $this->so_control =
CreateObject('controller.socontrol');
- //$this->so_bim =
CreateObject('bim.sobimitem_impl');
- //$this->so_bim = new
sobimitem_impl();
-
- $this->type_id =
$this->bo->type_id;
-
- $this->start =
$this->bo->start;
- $this->query =
$this->bo->query;
- $this->sort =
$this->bo->sort;
- $this->order =
$this->bo->order;
- $this->filter =
$this->bo->filter;
- $this->cat_id =
$this->bo->cat_id;
- $this->part_of_town_id =
$this->bo->part_of_town_id;
- $this->district_id =
$this->bo->district_id;
- $this->status =
$this->bo->status;
- $this->allrows =
$this->bo->allrows;
- $this->lookup =
$this->bo->lookup;
- $this->location_code =
$this->bo->location_code;
-
-
self::set_active_menu('controller::control::equipment_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();
-
- // Fetches prosedures that are related to first control
area in list
- $control_area_id = $control_areas_array[0]['id'];
-
- $lists = array
- (
- 'building_types' =>
$building_types,
- 'category_types' =>
$category_types,
- 'district_list' =>
$district_list,
- 'part_of_town_list' =>
$part_of_town_list,
- 'responsibility_roles_list' =>
$responsibility_roles_list,
- 'control_area_list' =>
$control_areas_array,
- );
-
-
-
-
- $data = array(
- 'datatable' => array(
- 'source' =>
self::link(array('menuaction' => 'controller.uicheck_list_for_equipment.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'),
- 'sotrable' =>
false
- ),
- array(
- 'key' => 'adresse1',
- 'label' =>
lang('Address'),
- 'sortable' => false
- ),
- array(
- 'key' => 'postnummer',
- 'label' => lang('Zip
code'),
- 'sortable' => false
- ),
- array(
- 'key' => 'checked',
- 'label' => 'Velg',
- 'sortable' => false,
- 'formatter' =>
'YAHOO.widget.DataTable.formatCheckbox',
- 'className' =>
'mychecks'
- ),
- array(
- 'key' => 'link',
- 'hidden' => true
- ),
- array(
- 'key' => 'actions',
- 'hidden' => true
- ),
- array(
- 'key' => 'labels',
- 'hidden' => true
- ),
- array(
- 'key' => 'ajax',
- 'hidden' => true
- ),
- array(
- 'key' => 'alert',
- 'hidden' => true
- )
- )
- ),
- 'lists' => $lists
- );
-
- //self::add_javascript('controller', 'yahoo',
'datatable.js');
- self::add_javascript('controller', 'controller',
'controller_datatable_test.js');
- self::add_javascript('controller', 'controller',
'jquery.js');
- self::add_javascript('controller', 'controller',
'ajax.js');
- //self::add_javascript('controller', 'yahoo',
'equipment_location.js');
-
- //$GLOBALS['phpgw']->js->validate_file( 'yahoo',
'equipmens_location', 'controller' );
-
- //self::render_template_xsl('datatable', $data);
- self::render_template_xsl('equipment', $data);
-*/
- if(phpgw::get_var('phpgw_return_as') == 'json') {
- return $this->query();
- }
- $bim_types = $this->so_control->get_bim_types();
-
- $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_equipment_for_control')
- ), array(
- 'label' =>
lang('Add_equipment_for_control'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicheck_list_for_equipment.add_equipment_to_control'))
- ));
-
- $data = array(
- 'tabs' =>
$GLOBALS['phpgw']->common->create_tabs($tabs, 0),
- 'view' =>
"view_equipment_for_control",
- 'control_area_array' => $control_areas_array,
- 'control_array' =>
$control_array,
- 'locations_table' => array(
- 'source' =>
self::link(array('menuaction' =>
'controller.uicheck_list_for_equipment.index','phpgw_return_as' => 'json')),
- 'field' => array(
- array(
- 'key' => 'id',
- 'label' =>
lang('ControlId'),
- 'sortable' => true,
- ),
- array(
- 'key' => 'title',
- 'label' =>
lang('Title'),
- 'sortable' =>
false
- ),
- array(
- 'key' => 'bim_id',
- 'label' =>
lang('Bim_id'),
- 'sortable' => false
- ),
- array(
- 'key' => 'bim_name',
- 'label' =>
lang('Bim_name'),
- 'sortable' => false
- ),
- array(
- 'key' => 'bim_type',
- 'label' =>
lang('Bim_type'),
- 'sortable' => false
- )
- )
- )
- );
-
-
- 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_equipment_tabs', 'common',
'view_equipment_for_control'), $data);
- }
-
- function add_equipment_to_control()
- {
- if(phpgw::get_var('save_equipment'))
- {
- //add equipment to control using equipment item
ID
- $items_checked = array();
- $items = phpgw::get_var('values_assign');
- $item_arr = explode('|',$items);
- foreach($item_arr as $item)
- {
- $items_checked[] = explode(';',$item);
- }
- //var_dump($items_checked);
-
- $control_id = phpgw::get_var('control_id');
- //var_dump($control_id);
- if($control_id != null &&
is_numeric($control_id))
- {
- //add chosen equipment to control
- foreach($items_checked as $it)
- {
-
$this->so_control->add_equipment_to_control($control_id, $it[0]);
- }
- }
- $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'controller.uicheck_list_for_equipment.index'));
-
- }
- else
- {
- if(phpgw::get_var('phpgw_return_as') == 'json')
{
- return $this->get_equipment();
- }
-
- $bim_types = $this->so_control->get_bim_types();
-
- $control_areas_array =
$this->so_control_area->get_control_areas_as_array();
-
- $tabs = array( array(
- 'label' =>
lang('View_equipment_for_control'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicheck_list_for_equipment.index'))
-
- ), array(
- 'label' =>
lang('Add_equipment_for_control')
- ));
-
- $data = array(
- 'tabs'
=> $GLOBALS['phpgw']->common->create_tabs($tabs, 1),
- 'view'
=> "add_equipment_to_control",
- 'control_filters'
=> array(
- 'control_area_array'
=> $control_areas_array,
- 'control_array'
=> $control_array
- ),
- 'filter_form'
=> array(
- 'bim_types'
=> $bim_types
- ),
- 'datatable' => array(
- 'source' =>
self::link(array('menuaction' =>
'controller.uicheck_list_for_equipment.add_equipment_to_control',
'phpgw_return_as' => 'json')),
- 'field' => array(
- array(
- 'key' => 'id',
- 'label' =>
lang('ID'),
- 'sortable'
=> true,
- 'formatter' =>
'YAHOO.portico.formatLink'
- ),
- array(
- 'key' =>
'guid',
- 'label' =>
lang('GUID'),
- 'sortable'
=> false
- ),
- array(
- 'key' => 'type',
- 'label' =>
lang('type'),
- 'sortable'
=> false
- ),
- array(
- 'key' =>
'checked',
- 'label' =>
'Velg',
- 'sortable' =>
false,
- 'formatter' =>
'YAHOO.widget.DataTable.formatCheckbox',
- 'className' =>
'mychecks'
- ),
- array(
- 'key' =>
'actions',
- 'hidden' => true
- ),
- array(
- 'key' =>
'labels',
- 'hidden' => true
- ),
- array(
- 'key' => 'ajax',
- '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_equipment_tabs', 'common',
'add_equipment_to_control'), $data);
- }
- }
-
- public function query()
- {
- $control_list =
$this->so_control->get_control_equipment();
-
- foreach($control_list as $control)
- {
- $control['bim_name'] =
$this->so_control->getBimItemAttributeValue($control['bim_item_guid'],
'description');
- $results['results'][]= $control;
- }
-
- $results['total_records'] = 10;
- $results['start'] = 1;
- $results['sort'] = 'id';
- array_walk($results['results'], array($this,
'add_links'), array($type));
-
- return $this->yui_results($results);
- }
-
- public function get_equipment()
- {
-
- /*$start =
phpgw::get_var('start', 'int', 'REQUEST', 0);
- $query =
phpgw::get_var('query');
- $sort =
phpgw::get_var('sort');
- $order =
phpgw::get_var('order');
- $filter =
phpgw::get_var('filter', 'int');
- $cat_id =
phpgw::get_var('cat_id');
- $lookup_tenant =
phpgw::get_var('lookup_tenant', 'bool');
- $district_id =
phpgw::get_var('district_id', 'int');
- $part_of_town_id =
phpgw::get_var('part_of_town_id', 'int');
- $status =
phpgw::get_var('status');
- $type_id =
phpgw::get_var('type_id', 'int');
- $allrows =
phpgw::get_var('allrows', 'bool');
- $location_code =
phpgw::get_var('location_code');*/
-
- $type_id = phpgw::get_var('bim_type_id');
-
- $start = phpgw::get_var('startIndex');
-
- $equipment_list = array();
-
- $sort = "ASC";
-
- $equipment_list =
$this->so_control->getAllBimItems(10,$type_id);
- //var_dump($equipment_list);
-
-
- $results = array();
- foreach($equipment_list as $equipment)
- {
- $equipment['checked'] = false;
- $results['results'][]= $equipment;
- $i++;
- }
-
- $results['total_records'] = count($equipment_list);
- $results['start'] = $start;
- $results['sort'] = 'id';
- $results['dir'] = "ASC";
-
- array_walk($results['results'], array($this,
'add_links'), 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['ajax'][] = false;
- $value['actions'][] =
html_entity_decode(self::link(array('menuaction' => 'property.uilocation.view',
'location_code' => $value['location_code'])));
- $value['labels'][] = lang('show');
-
- $value['ajax'][] = true;
- $value['actions'][] =
html_entity_decode(self::link(array('menuaction' =>
'rental.uicomposite.add_unit', 'location_code' => $value['location_code'])));
- $value['labels'][] = lang('add_location');
- }
-
- public function get_equipment_types_by_category()
- {
- $category = phpgw::get_var('ifc');
- if($ifc != null)
- {
- if($ifc = 1)
- $ifc = true;
- else
- $ifc = false;
- }
-
-
- $bim_types = $this->so_control->get_bim_types($ifc);
- if(count($bim_types)>0)
- return json_encode( $bim_types );
- else
- return null;
- }
- }
\ No newline at end of file
Modified: trunk/controller/inc/class.uicommon.inc.php
===================================================================
--- trunk/controller/inc/class.uicommon.inc.php 2011-12-09 15:41:52 UTC (rev
8264)
+++ trunk/controller/inc/class.uicommon.inc.php 2011-12-10 15:55:30 UTC (rev
8265)
@@ -4,8 +4,8 @@
/**
* Cherry pick selected values into a new array
*
- * @param array $array input array
- * @param array $keys array of keys to pick
+ * @param array $array input array
+ * @param array $keys array of keys to pick
*
* @return array containg values from $array for the keys in $keys.
*/
@@ -39,7 +39,7 @@
/**
* Reformat an ISO timestamp into norwegian format
*
- * @param string $date date
+ * @param string $date date
*
* @return string containg timestamp in norwegian format
*/
@@ -313,10 +313,10 @@
return $GLOBALS['phpgw']->js->validate_file($pkg,
str_replace('.js', '', $name), $app);
}
- public function set_active_menu($item)
- {
- $GLOBALS['phpgw_info']['flags']['menu_selection'] = $item;
- }
+ public function set_active_menu($item)
+ {
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] =
$item;
+ }
/**
* A more flexible version of xslttemplate.add_file
@@ -345,8 +345,8 @@
die;
}
- public function render_template($output)
- {
+ public function render_template($output)
+ {
$GLOBALS['phpgw']->common->phpgw_header(true);
if($this->flash_msgs)
{
@@ -361,8 +361,8 @@
}
echo htmlspecialchars_decode($output);
$GLOBALS['phpgw']->common->phpgw_exit();
- }
-
+ }
+
public function add_yui_translation(&$data)
{
$this->add_template_file('yui_booking_i18n');
@@ -385,7 +385,7 @@
'LBL_CHOOSE_DATE' =>
json_encode(lang('Choose a date')),
),
'setupPaginator' => array(
- 'pageReportTemplate' =>
json_encode(lang("Showing items {startRecord} - {endRecord} of
{totalRecords}")),
+ 'pageReportTemplate' =>
json_encode(lang("Showing items {startRecord} - {endRecord} of
{totalRecords}")),
'previousPageLinkLabel' =>
json_encode("< {$previous}"),
'nextPageLinkLabel' =>
json_encode("{$next} >"),
),
@@ -425,7 +425,7 @@
}
- public function check_active($url)
+ public function check_active($url)
{
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
@@ -501,26 +501,26 @@
toolbar:
{buttons: [
{ group: 'textstyle',
label: '{$lang_font_style}',
- buttons: [
- { type: 'push',
label: 'Fet CTRL + SHIFT + B', value: 'bold' }
- ]
- },
- { type: 'separator' },
- { group: 'indentlist',
label: '{$lang_lists}',
- buttons: [
- { type: 'push',
label: 'Opprett punktliste', value: 'insertunorderedlist' },
- { type: 'push',
label: 'Opprett nummerert liste', value: 'insertorderedlist' }
- ]
- },
- { type: 'separator' },
- { group: 'insertitem',
label: '{$lang_insert_item}',
buttons: [
+ { type:
'push', label: 'Fet CTRL + SHIFT + B', value: 'bold' }
+ ]
+ },
+ { type: 'separator' },
+ { group: 'indentlist',
label: '{$lang_lists}',
+ buttons: [
+ { type:
'push', label: 'Opprett punktliste', value: 'insertunorderedlist' },
+ { type:
'push', label: 'Opprett nummerert liste', value: 'insertorderedlist' }
+ ]
+ },
+ { type: 'separator' },
+ { group: 'insertitem',
label: '{$lang_insert_item}',
+ buttons: [
{ type:
'push', label: 'HTML Lenke CTRL + SHIFT + L', value: 'createlink', disabled:
true },
{ type:
'push', label: 'Sett inn bilde', value: 'insertimage' }
]
},
- { type: 'separator' },
- { group: 'undoredo', label:
'Angre/Gjenopprett',
+ { type: 'separator' },
+ { group: 'undoredo',
label: 'Angre/Gjenopprett',
buttons: [
{ type:
'push', label: 'Angre', value: 'undo' },
{ type:
'push', label: 'Gjenopprett', value: 'redo' }
@@ -726,45 +726,45 @@
return self::get_messages($messages, 'info');
}
- /**
+ /**
* Download xls, csv or similar file representation of a data
table
*/
- public function download()
- {
- $list = $this->query();
- $list = $list['ResultSet']['Result'];
+ public function download()
+ {
+ $list = $this->query();
+ $list = $list['ResultSet']['Result'];
- $keys = array();
+ $keys = array();
- if(count($list[0]) > 0) {
- foreach($list[0] as $key => $value) {
- if(!is_array($value)) {
- array_push($keys, $key);
- }
- }
- }
-
- // Remove newlines from output
- $count = count($list);
- for($i = 0; $i < $count; $i++)
- {
+ if(count($list[0]) > 0) {
+ foreach($list[0] as $key => $value) {
+ if(!is_array($value)) {
+ array_push($keys, $key);
+ }
+ }
+ }
+
+ // Remove newlines from output
+ $count = count($list);
+ for($i = 0; $i < $count; $i++)
+ {
foreach ($list[$i] as $key => &$data)
{
$data = str_replace(array("\n","\r\n",
"<br>"),'',$data);
}
- }
+ }
- // Use keys as headings
- $headings = array();
- $count_keys = count($keys);
- for($j=0;$j<$count_keys;$j++)
- {
- array_push($headings, lang($keys[$j]));
- }
+ // Use keys as headings
+ $headings = array();
+ $count_keys = count($keys);
+ for($j=0;$j<$count_keys;$j++)
+ {
+ array_push($headings, lang($keys[$j]));
+ }
- $property_common = CreateObject('property.bocommon');
- $property_common->download($list, $keys, $headings);
- }
+ $property_common = CreateObject('property.bocommon');
+ $property_common->download($list, $keys, $headings);
+ }
/**
* Added because error reporting facilities in phpgw tries to
serialize the PDO
Modified: trunk/controller/inc/class.uicontrol.inc.php
===================================================================
--- trunk/controller/inc/class.uicontrol.inc.php 2011-12-09 15:41:52 UTC
(rev 8264)
+++ trunk/controller/inc/class.uicontrol.inc.php 2011-12-10 15:55:30 UTC
(rev 8265)
@@ -79,42 +79,42 @@
'item' => array(
array('type' =>
'filter',
'name' =>
'status',
- 'text' => lang('Status'),
- 'list' => array(
- array(
- 'id' => 'none',
- 'name' => lang('Not selected')
- ),
- array(
- 'id' => 'NEW',
- 'name' => lang('NEW')
- ),
- array(
- 'id' => 'PENDING',
- 'name' => lang('PENDING')
- ),
- array(
- 'id' => 'REJECTED',
- 'name' => lang('REJECTED')
- ),
- array(
- 'id' => 'ACCEPTED',
- 'name' => lang('ACCEPTED')
- )
- )
- ),
+ 'text' =>
lang('Status'),
+ 'list' => array(
+ array(
+
'id' => 'none',
+
'name' => lang('Not selected')
+ ),
+ array(
+
'id' => 'NEW',
+
'name' => lang('NEW')
+ ),
+ array(
+
'id' => 'PENDING',
+
'name' => lang('PENDING')
+ ),
+ array(
+
'id' => 'REJECTED',
+
'name' => lang('REJECTED')
+ ),
+ array(
+
'id' => 'ACCEPTED',
+
'name' => lang('ACCEPTED')
+ )
+ )
+ ),
array('type' =>
'filter',
'name' =>
'control_areas',
- 'text' => lang('Control_area'),
- 'list' =>
$this->so_control_area->get_control_area_select_array(),
+ 'text' =>
lang('Control_area'),
+ 'list' =>
$this->so_control_area->get_control_area_select_array(),
),
array('type' =>
'filter',
'name' =>
'responsibilities',
- 'text' => lang('Responsibility'),
- 'list' => $this->so->get_roles(),
+ 'text' =>
lang('Responsibility'),
+ 'list' =>
$this->so->get_roles(),
),
array('type' => 'text',
- 'text' => lang('searchfield'),
+ 'text' =>
lang('searchfield'),
'name' =>
'query'
),
array(
@@ -388,8 +388,8 @@
array(
'label' => "2: " .
lang('Choose_control_groups'),
'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'controller.uicontrol.view_control_groups', 'view' => "view_control_groups",
-
'control_id' => $control_id, 'control_group_ids' => $control_group_ids,
-
'control_area_id' => $control->get_control_area_id()))
+
'control_id' => $control_id, 'control_group_ids' => $control_group_ids,
+
'control_area_id' => $control->get_control_area_id()))
),
array('label' => "3: " .
lang('Choose_control_items')),
array(
@@ -401,7 +401,7 @@
'tabs'
=> $GLOBALS['phpgw']->common->create_tabs($tabs, 2),
'view'
=> 'control_items',
'control_group_ids' =>
implode($control_group_ids, ","),
- 'control' =>
$control->toArray(),
+ 'control'
=> $control->toArray(),
'groups_with_control_items' =>
$groups_with_control_items
);
Modified: trunk/controller/inc/class.uicontrol_group.inc.php
===================================================================
--- trunk/controller/inc/class.uicontrol_group.inc.php 2011-12-09 15:41:52 UTC
(rev 8264)
+++ trunk/controller/inc/class.uicontrol_group.inc.php 2011-12-10 15:55:30 UTC
(rev 8265)
@@ -52,37 +52,37 @@
'item' => array(
array('type' =>
'filter',
'name' =>
'status',
- 'text' => lang('Status').':',
- 'list' => array(
- array(
- 'id' => 'none',
- 'name' => lang('Not selected')
- ),
- array(
- 'id' => 'NEW',
- 'name' => lang('NEW')
- ),
- array(
- 'id' => 'PENDING',
- 'name' => lang('PENDING')
- ),
- array(
- 'id' => 'REJECTED',
- 'name' => lang('REJECTED')
- ),
- array(
- 'id' => 'ACCEPTED',
- 'name' => lang('ACCEPTED')
- )
- )
- ),
+ 'text' =>
lang('Status').':',
+ 'list' => array(
+ array(
+
'id' => 'none',
+
'name' => lang('Not selected')
+ ),
+ array(
+
'id' => 'NEW',
+
'name' => lang('NEW')
+ ),
+ array(
+
'id' => 'PENDING',
+
'name' => lang('PENDING')
+ ),
+ array(
+
'id' => 'REJECTED',
+
'name' => lang('REJECTED')
+ ),
+ array(
+
'id' => 'ACCEPTED',
+
'name' => lang('ACCEPTED')
+ )
+ )
+ ),
array('type' =>
'filter',
'name' =>
'control_areas',
- 'text' => lang('Control_area').':',
- 'list' =>
$this->so_control_area->get_control_area_select_array(),
+ 'text' =>
lang('Control_area').':',
+ 'list' =>
$this->so_control_area->get_control_area_select_array(),
),
array('type' => 'text',
- 'text' => lang('searchfield'),
+ 'text' =>
lang('searchfield'),
'name' =>
'query'
),
array(
Modified: trunk/controller/inc/class.uicontrol_item.inc.php
===================================================================
--- trunk/controller/inc/class.uicontrol_item.inc.php 2011-12-09 15:41:52 UTC
(rev 8264)
+++ trunk/controller/inc/class.uicontrol_item.inc.php 2011-12-10 15:55:30 UTC
(rev 8265)
@@ -54,42 +54,42 @@
'item' => array(
array('type' =>
'filter',
'name' =>
'status',
- 'text' => lang('Status').':',
- 'list' => array(
- array(
- 'id' => 'none',
- 'name' => lang('Not selected')
- ),
- array(
- 'id' => 'NEW',
- 'name' => lang('NEW')
- ),
- array(
- 'id' => 'PENDING',
- 'name' => lang('PENDING')
- ),
- array(
- 'id' => 'REJECTED',
- 'name' => lang('REJECTED')
- ),
- array(
- 'id' => 'ACCEPTED',
- 'name' => lang('ACCEPTED')
- )
- )
- ),
+ 'text' =>
lang('Status').':',
+ 'list' => array(
+ array(
+
'id' => 'none',
+
'name' => lang('Not selected')
+ ),
+ array(
+
'id' => 'NEW',
+
'name' => lang('NEW')
+ ),
+ array(
+
'id' => 'PENDING',
+
'name' => lang('PENDING')
+ ),
+ array(
+
'id' => 'REJECTED',
+
'name' => lang('REJECTED')
+ ),
+ array(
+
'id' => 'ACCEPTED',
+
'name' => lang('ACCEPTED')
+ )
+ )
+ ),
array('type' =>
'filter',
'name' =>
'control_groups',
- 'text' => lang('Control_group').':',
- 'list' =>
$this->so_control_group->get_control_group_select_array(),
+ 'text' =>
lang('Control_group').':',
+ 'list' =>
$this->so_control_group->get_control_group_select_array(),
),
array('type' =>
'filter',
'name' =>
'control_areas',
- 'text' => lang('Control_area').':',
- 'list' =>
$this->so_control_area->get_control_area_select_array(),
+ 'text' =>
lang('Control_area').':',
+ 'list' =>
$this->so_control_area->get_control_area_select_array(),
),
array('type' => 'text',
- 'text' => lang('searchfield'),
+ 'text' =>
lang('searchfield'),
'name' =>
'query'
),
array(
Modified: trunk/controller/inc/class.uiprocedure.inc.php
===================================================================
--- trunk/controller/inc/class.uiprocedure.inc.php 2011-12-09 15:41:52 UTC
(rev 8264)
+++ trunk/controller/inc/class.uiprocedure.inc.php 2011-12-10 15:55:30 UTC
(rev 8265)
@@ -46,11 +46,11 @@
'item' => array(
array('type' =>
'filter',
'name' =>
'control_areas',
- 'text' => lang('Control_area').':',
- 'list' =>
$this->so_control_area->get_control_area_select_array(),
+ 'text' =>
lang('Control_area').':',
+ 'list' =>
$this->so_control_area->get_control_area_select_array(),
),
array('type' => 'text',
- 'text' => lang('search'),
+ 'text' =>
lang('search'),
'name' =>
'query'
),
array(
Added: trunk/controller/inc/hook_home.inc.php
===================================================================
--- trunk/controller/inc/hook_home.inc.php (rev 0)
+++ trunk/controller/inc/hook_home.inc.php 2011-12-10 15:55:30 UTC (rev
8265)
@@ -0,0 +1,2 @@
+<?php
+echo '<H1> Hook for controller </H1>';
Modified: trunk/controller/inc/model/class.check_list.inc.php
===================================================================
--- trunk/controller/inc/model/class.check_list.inc.php 2011-12-09 15:41:52 UTC
(rev 8264)
+++ trunk/controller/inc/model/class.check_list.inc.php 2011-12-10 15:55:30 UTC
(rev 8265)
@@ -13,7 +13,7 @@
protected $planned_date;
protected $completed_date;
protected $location_code;
- protected $equipment_id;
+ protected $component_id;
protected $check_item_array = array();
protected $control;
@@ -91,12 +91,12 @@
public function get_location_code() { return
$this->location_code; }
- public function set_equipment_id($equipment_id)
+ public function set_component_id($component_id)
{
- $this->equipment_id = $equipment_id;
+ $this->component_id = $component_id;
}
- public function get_equipment_id() { return
$this->equipment_id; }
+ public function get_component_id() { return
$this->component_id; }
public function set_control($control)
{
@@ -116,4 +116,4 @@
);
}
}
-?>
\ No newline at end of file
+?>
Modified: trunk/controller/inc/model/class.control.inc.php
===================================================================
--- trunk/controller/inc/model/class.control.inc.php 2011-12-09 15:41:52 UTC
(rev 8264)
+++ trunk/controller/inc/model/class.control.inc.php 2011-12-10 15:55:30 UTC
(rev 8265)
@@ -19,8 +19,8 @@
protected $costresponsibility_id;
protected $responsibility_id;
protected $responsibility_name;
- protected $equipment_id;
- protected $equipment_type_id;
+ protected $component_id;
+ protected $component_type_id;
protected $location_code;
protected $control_area_id;
protected $control_area_name;
@@ -137,19 +137,19 @@
public function get_responsibility_name() { return
$this->responsibility_name; }
- public function set_equipment_id($equipment_id)
+ public function set_component_id($component_id)
{
- $this->equipment_id = $equipment_id;
+ $this->component_id = $component_id;
}
- public function get_equipment_id() { return
$this->equipment_id; }
+ public function get_component_id() { return
$this->component_id; }
- public function set_equipment_type_id($equipment_type_id)
+ public function set_component_type_id($component_type_id)
{
- $this->equipment_type_id = $equipment_type_id;
+ $this->component_type_id = $component_type_id;
}
- public function get_equipment_type_id() { return
$this->equipment_type_id; }
+ public function get_component_type_id() { return
$this->component_type_id; }
public function set_location_code($location_code)
{
@@ -225,4 +225,4 @@
);
}
}
-?>
\ No newline at end of file
+?>
Modified: trunk/controller/js/controller/ajax.js
===================================================================
--- trunk/controller/js/controller/ajax.js 2011-12-09 15:41:52 UTC (rev
8264)
+++ trunk/controller/js/controller/ajax.js 2011-12-10 15:55:30 UTC (rev
8265)
@@ -31,12 +31,12 @@
});
- // file: add_equipment_to_control.xsl
- // When equipment category is selected, corresponding equipment types
are fetched from db and equipment type select list is populated
+ // file: add_component_to_control.xsl
+ // When component category is selected, corresponding component types
are fetched from db and component type select list is populated
$("#ifc option").click(function () {
var ifc_id = $(this).val();
- var requestUrl =
"index.php?menuaction=controller.uicheck_list_for_equipment.get_equipment_types_by_category&phpgw_return_as=json"
+ var requestUrl =
"index.php?menuaction=controller.uicheck_list_for_component.get_component_types_by_category&phpgw_return_as=json"
var htmlString = "";
@@ -191,4 +191,4 @@
var infoBox = $(divWrp).find("#info_box");
$(infoBox).hide();
});
-});
\ No newline at end of file
+});
Modified: trunk/controller/js/yahoo/common.js
===================================================================
--- trunk/controller/js/yahoo/common.js 2011-12-09 15:41:52 UTC (rev 8264)
+++ trunk/controller/js/yahoo/common.js 2011-12-10 15:55:30 UTC (rev 8265)
@@ -38,16 +38,16 @@
var daynum = ((Date.UTC(y2k(year),when.getMonth(),when.getDate(),0,0,0)
- Date.UTC(y2k(year),0,1,0,0,0)) /1000/60/60/24) + 1;
if (modDay < 4 ) {
- var weeknum = Math.floor((daynum+modDay-1)/7)+1;
+ var weeknum = Math.floor((daynum+modDay-1)/7)+1;
} else {
- var weeknum = Math.floor((daynum+modDay-1)/7);
- if (weeknum == 0) {
- year--;
- var prevNewYear = new Date(year,0,1);
- var prevmodDay = prevNewYear.getDay();
- if (prevmodDay == 0) prevmodDay = 6; else prevmodDay--;
- if (prevmodDay < 4) weeknum = 53; else weeknum = 52;
- }
+ var weeknum = Math.floor((daynum+modDay-1)/7);
+ if (weeknum == 0) {
+ year--;
+ var prevNewYear = new Date(year,0,1);
+ var prevmodDay = prevNewYear.getDay();
+ if (prevmodDay == 0) prevmodDay = 6; else prevmodDay--;
+ if (prevmodDay < 4) weeknum = 53; else weeknum = 52;
+ }
}
return + weeknum;
}
@@ -173,12 +173,12 @@
YAHOO.portico.setupInlineTablePaginator = function(container) {
var paginatorConfig = {
- rowsPerPage: 10,
- alwaysVisible: false,
- template: "{PreviousPageLink} <strong>{CurrentPageReport}</strong>
{NextPageLink}",
- pageReportTemplate: "Showing items {startRecord} - {endRecord} of
{totalRecords}",
- containers: [YAHOO.util.Dom.get(container)]
- };
+ rowsPerPage: 10,
+ alwaysVisible: false,
+ template: "{PreviousPageLink}
<strong>{CurrentPageReport}</strong> {NextPageLink}",
+ pageReportTemplate: "Showing items {startRecord} - {endRecord}
of {totalRecords}",
+ containers: [YAHOO.util.Dom.get(container)]
+ };
YAHOO.portico.lang('setupPaginator', paginatorConfig);
var pag = new YAHOO.widget.Paginator(paginatorConfig);
@@ -215,8 +215,8 @@
var myDataTable = new YAHOO.widget.DataTable(dataTableContainer,
colDefs, myDataSource, options);
myDataTable.handleDataReturnPayload = function(oRequest, oResponse,
oPayload) {
- oPayload.totalRecords = oResponse.meta.totalResultsAvailable;
- return oPayload;
+ oPayload.totalRecords = oResponse.meta.totalResultsAvailable;
+ return oPayload;
}
myDataTable.doBeforeLoadData = function(nothing, data) {
@@ -253,7 +253,7 @@
var displayContainer = false;
- for(var key in oResponse.results) {
+ for(var key in oResponse.results) {
displayContainer = true;
var imgEl =
dlImages.appendChild(document.createElement('dd')).appendChild(document.createElement('img'));
var captionEl =
dlImages.appendChild(document.createElement('dt'));
@@ -267,7 +267,7 @@
} else {
new YAHOO.util.Element(container).setStyle('display',
'none');
}
- }});
+ }});
};
@@ -552,20 +552,20 @@
YAHOO.portico.setupDatePickers();
});
var showIfNotEmpty = function(event, fieldname) {
- if (document.getElementById(fieldname).value.length > 1) {
- YAHOO.util.Dom.replaceClass(fieldname + "_edit", "hideit", "showit");
- } else {
- YAHOO.util.Dom.replaceClass(fieldname + "_edit", "showit", "hideit");
- }
+ if (document.getElementById(fieldname).value.length > 1) {
+ YAHOO.util.Dom.replaceClass(fieldname + "_edit", "hideit",
"showit");
+ } else {
+ YAHOO.util.Dom.replaceClass(fieldname + "_edit", "showit",
"hideit");
+ }
};
YAHOO.portico.rtfEditorHelper = function(textarea_id, options) {
options = YAHOO.lang.merge({width:522, height:300}, (options || {}));
var descEdit = new YAHOO.widget.SimpleEditor(textarea_id, {
- height: options.height+'px',
- width: options.width+'px',
- dompath: true,
- animate: true,
+ height: options.height+'px',
+ width: options.width+'px',
+ dompath: true,
+ animate: true,
handleSubmit: true
});
descEdit.render();
@@ -573,33 +573,33 @@
};
YAHOO.portico.postToUrl = function(path, params, method) {
- method = method || "post"; // Set method to post by default, if not
specified.
- var form = document.createElement("form");
- form.setAttribute("method", method);
- form.setAttribute("action", path);
+ method = method || "post"; // Set method to post by default, if not
specified.
+ var form = document.createElement("form");
+ form.setAttribute("method", method);
+ form.setAttribute("action", path);
- for(var key in params) {
- var hiddenField = document.createElement("input");
- hiddenField.setAttribute("type", "hidden");
- hiddenField.setAttribute("name", params[key][0]);
- hiddenField.setAttribute("value", params[key][1]);
- form.appendChild(hiddenField);
- }
- document.body.appendChild(form); // Not entirely sure if this is
necessary
- form.submit();
+ for(var key in params) {
+ var hiddenField = document.createElement("input");
+ hiddenField.setAttribute("type", "hidden");
+ hiddenField.setAttribute("name", params[key][0]);
+ hiddenField.setAttribute("value", params[key][1]);
+ form.appendChild(hiddenField);
+ }
+ document.body.appendChild(form); // Not entirely sure if this is
necessary
+ form.submit();
};
(function(){
- var Dom = YAHOO.util.Dom,
- Event = YAHOO.util.Event,
- Panel = YAHOO.widget.Panel,
+ var Dom = YAHOO.util.Dom,
+ Event = YAHOO.util.Event,
+ Panel = YAHOO.widget.Panel,
Lang = YAHOO.lang;
var CSS_PREFIX = 'booking_number_range_';
var InputNumberRange = function(oConfigs) {
- InputNumberRange.superclass.constructor.call(this,
document.createElement('span'), oConfigs);
- this.createEvent('updateEvent');
+ InputNumberRange.superclass.constructor.call(this,
document.createElement('span'), oConfigs);
+ this.createEvent('updateEvent');
this.refresh(['id'],true);
};
@@ -612,20 +612,20 @@
var container = this.get('element');
this.setAttributeConfig('inputEl', {
- readOnly: true,
- value:
container.appendChild(document.createElement('span'))
- });
+ readOnly: true,
+ value:
container.appendChild(document.createElement('span'))
+ });
this.setAttributeConfig('id', {
- writeOnce: true,
- validator: function (value) {
- return /^[a-zA-Z][\w0-9\-_.:]*$/.test(value);
- },
- value: Dom.generateId(),
- method: function (value) {
- this.get('inputEl').id = value;
- }
- });
+ writeOnce: true,
+ validator: function (value) {
+ return
/^[a-zA-Z][\w0-9\-_.:]*$/.test(value);
+ },
+ value: Dom.generateId(),
+ method: function (value) {
+ this.get('inputEl').id = value;
+ }
+ });
this.setAttributeConfig('value', {
value: 0,
@@ -654,8 +654,8 @@
destroy: function () {
var el = this.get('element');
- Event.purgeElement(el, true);
- el.parentNode.removeChild(el);
+ Event.purgeElement(el, true);
+ el.parentNode.removeChild(el);
},
_padValue: function(value)
@@ -708,7 +708,7 @@
render: function (parentEl) {
parentEl = Dom.get(parentEl);
-
+
if (!parentEl) {
YAHOO.log('Missing mandatory argument in
YAHOO.portico.InputNumberRange.render: parentEl','error','Field');
return null;
Added: trunk/controller/js/yahoo/component_location.js
===================================================================
--- trunk/controller/js/yahoo/component_location.js
(rev 0)
+++ trunk/controller/js/yahoo/component_location.js 2011-12-10 15:55:30 UTC
(rev 8265)
@@ -0,0 +1,323 @@
+//--------------------------------------------------------
+// Declaration of event.index vars
+//--------------------------------------------------------
+ //define SelectButton
+ var oMenuButton_0, oMenuButton_1, oMenuButton_2, oMenuButton_3,
oMenuButton_4;//, oMenuButton_5;
+ var selectsButtons = [
+ {order:0, var_URL:'type_id', name:'btn_type_id',
style:'typebutton', dependiente:[], reload:1},
+ {order:1, var_URL:'cat_id', name:'btn_cat_id',
style:'categorybutton', dependiente:[]},
+ {order:2, var_URL:'district_id', name:'btn_district_id',
style:'districtbutton', dependiente:[3]},
+ {order:3,
var_URL:'part_of_town_id',name:'btn_part_of_town_id',style:'partOFTownbutton',dependiente:[]},
+ {order:4, var_URL:'role_id', name:'btn_role_id',
style:'roleIdbutton', dependiente:[]}
+// {order:5, var_URL:'user_id', name:'btn_user_id',
style:'userIdbutton', dependiente:[]}, // dummy - changed to
select
+ ];
+
+ // define buttons
+ var oNormalButton_0, oNormalButton_1;//, oNormalButton_2;
+ var normalButtons = [
+ {order:0, name:'btn_search', funct:"onSearchClick"},
+ {order:1, name:'btn_save', funct:"onSave"}
+ ];
+
+ // define Text buttons
+ var textImput = [
+ {order:0, name:'query', id:'txt_query'}
+ ];
+
+ var toolTips =
+ [
+ {name:'status', title:'Status',
description:'',ColumnDescription:'status'},
+ {name:'btn_export', title:'download', description:'Download
table to your browser',ColumnDescription:''}
+ ];
+
+ var linktoolTips =
+ [
+ {name:'btn_data_search', title:'Data search',
description:'Narrow the search dates'}
+ ];
+
+ var config_values =
+ [
+ {date_search : 0} //if search has link "Data search"
+ ];
+
+ var tableYUI;
+
/********************************************************************************
+ *
+ */
+
+ this.onChangeSelect = function()
+ {
+ var myselect=document.getElementById("sel_user_id");
+ for (var i=0; i<myselect.options.length; i++)
+ {
+ if (myselect.options[i].selected==true)
+ {
+ break;
+ }
+ }
+ eval("path_values.user_id='"+myselect.options[i].value+"'");
+ execute_ds();
+ }
+
+
+ this.myParticularRenderEvent = function()
+ {
+ delete_content_div("message",2); //find it in property.js
+ create_message();
+ tableYUI.deleteTFoot();
+ addFooterDatatable();
+ }
+
+
/********************************************************************************
+ * Delete all message un DIV 'message'
+ */
+ this.create_message = function()
+ {
+ div_message= YAHOO.util.Dom.get("message");
+
+ //SHOW message if exist 'values_ds.message'
+ if(window.values_ds.message)
+ {
+ // succesfull
+ if(window.values_ds.message[0].message)
+ {
+ for(i=0; i<values_ds.message[0].message.length;
i++)
+ {
+ oDiv=document.createElement("DIV");
+ txtNode =
document.createTextNode(values_ds.message[0].message[i].msg);
+ oDiv.appendChild(txtNode);
+ oDiv.style.color = '#009900';
+ oDiv.style.fontWeight = 'bold';
+
+ div_message.appendChild(oDiv);
+ }
+ }
+
+ // error
+ if(window.values_ds.message[0].error)
+ {
+ for(i=0; i<values_ds.message[0].error.length;
i++)
+ {
+ oDiv=document.createElement("DIV");
+ txtNode =
document.createTextNode(values_ds.message[0].error[i].msg);
+ oDiv.appendChild(txtNode);
+ oDiv.style.color = '#FF0000';
+ oDiv.style.fontWeight = 'bold';
+
+ div_message.appendChild(oDiv);
+ }
+ }
+ }
+ window.values_ds.message = null;
+ }
+
+ this.particular_setting = function()
+ {
+ if(flag_particular_setting=='init')
+ {
+ //locate (asign ID) to datatable
+ tableYUI =
YAHOO.util.Dom.getElementsByClassName("yui-dt-data","tbody")[0].parentNode;
+ tableYUI.setAttribute("id","tableYUI");
+
+ //type
+ index =
locate_in_array_options(0,"value",path_values.type_id);
+ if(index)
+ {
+ oMenuButton_0.set("label", ("<em>" +
array_options[0][index][1] + "</em>"));
+ }
+ //category
+ index =
locate_in_array_options(1,"value",path_values.cat_id);
+ if(index)
+ {
+ oMenuButton_1.set("label", ("<em>" +
array_options[1][index][1] + "</em>"));
+ }
+
+ //district
+ index =
locate_in_array_options(2,"value",path_values.district_id);
+ if(index)
+ {
+ oMenuButton_2.set("label", ("<em>" +
array_options[2][index][1] + "</em>"));
+ }
+ //user
+ index =
locate_in_array_options(3,"value",path_values.user_id);
+ if(index)
+ {
+ oMenuButton_3.set("label", ("<em>" +
array_options[3][index][1] + "</em>"));
+ }
+
+// oMenuButton_0.focus();
+ YAHOO.util.Dom.get(textImput[0].id).focus();
+ }
+ else if(flag_particular_setting=='update')
+ {
+ }
+ }
+
+
+/****************************************************************************************/
+
+ this.Exchange_values = function()
+ {
+ //nothing
+ }
+
+/********************************************************************************/
+ var myFormatterCheck = function(elCell, oRecord, oColumn, oData)
+ {
+ var checked = '';
+ var hidden = '';
+ if(oRecord.getData('responsible_item'))
+ {
+ checked = "checked = 'checked'";
+ hidden = "<input type=\"hidden\" class=\"orig_check\"
name=\"values[assign_orig][]\"
value=\""+oRecord.getData('responsible_contact_id')+"_"+oRecord.getData('responsible_item')+"_"+oRecord.getData('location_code')+"\"/>";
+ }
+
+ elCell.innerHTML = hidden + "<center><input type=\"checkbox\"
"+checked+" class=\"mychecks\" name=\"values[assign][]\"
value=\""+oRecord.getData('location_code')+"\"/></center>";
+ }
+
+ var FormatterCenter = function(elCell, oRecord, oColumn, oData)
+ {
+ elCell.innerHTML = "<center>"+oData+"</center>";
+ }
+
+/********************************************************************************/
+
+ this.onSave = function()
+ {
+ //get the last div in th form
+ var divs= YAHOO.util.Dom.getElementsByClassName('field');
+ var mydiv = divs[divs.length-1];
+ //remove all child of mydiv
+ if (mydiv.hasChildNodes())
+ {
+ while ( mydiv.childNodes.length >= 1 )
+ {
+ mydiv.removeChild( mydiv.firstChild );
+ }
+ }
+ // styles for dont show
+ mydiv.style.display = "none";
+
+ valuesForPHP =
YAHOO.util.Dom.getElementsByClassName('mychecks');
+ valuesForPHP_orig =
YAHOO.util.Dom.getElementsByClassName('orig_check');
+
+ var values_return =
+ {
+ assign:[],
+ assign_orig:[]
+ };
+
+ //add all control to form
+ for(i=0;i<valuesForPHP.length;i++)
+ {
+ //values_return.assign[i] = valuesForPHP[i].value;
+ if(valuesForPHP[i].checked)
+ {
+
values_return.assign.push(valuesForPHP[i].value);
+ }
+ }
+
+ for(i=0;i<valuesForPHP_orig.length;i++)
+ {
+ //console.log(valuesForPHP_orig[i].name); // firebug
+ values_return.assign_orig[i] =
valuesForPHP_orig[i].value;
+ }
+
+ var returnfield = document.createElement('input');
+ returnfield.setAttribute('name', 'values_assign');
+ returnfield.setAttribute('type', 'text');
+ returnfield.setAttribute('value',
JSON.stringify(values_return));
+ mydiv.appendChild(returnfield);
+
+ // find out the unique form
+ formObject = document.body.getElementsByTagName('form');
+ // modify the 'form' for send it as POST using asyncronize call
+ YAHOO.util.Connect.setForm(formObject[0]);
+
+ maintain_pagination_order();
+ execute_ds();
+ }
+
+
+//----------------------------------------------------------
+
/********************************************************************************
+ *
+ */
+ this.addFooterDatatable = function()
+ {
+ //Create ROW
+ newTR = document.createElement('tr');
+ var i = 0;
+
+ for(var k=0 ; k<values_ds.headers.name.length; k++)
+ {
+ if (values_ds.headers.input_type[k] != 'hidden')
+ {
+ i++;
+ }
+ }
+
+ td_empty(i+2);
+
+ //RowChecked
+ CreateRowChecked("mychecks");
+
+ //Add to Table
+ myfoot = tableYUI.createTFoot();
+ myfoot.setAttribute("id","myfoot");
+ myfoot.appendChild(newTR.cloneNode(true));
+ //clean value for values_ds.message
+ values_ds.message = null;
+ }
+
+
/********************************************************************************
+ *
+ */
+ check_all = function(myclass)
+ {
+ controls = YAHOO.util.Dom.getElementsByClassName(myclass);
+ for(i=0;i<controls.length;i++)
+ {
+ if(!controls[i].disabled)
+ {
+ //for class=mychecks, they have to be
interchanged
+ if(myclass=="mychecks")
+ {
+ if(controls[i].checked)
+ {
+ controls[i].checked = false;
+ }
+ else
+ {
+ controls[i].checked = true;
+ }
+ }
+ //for the rest, always id checked
+ else
+ {
+ controls[i].checked = true;
+ }
+ }
+ }
+ }
+
+
+ //YAHOO.util.Event.addListener(window, "load", function()
+ YAHOO.util.Event.onDOMReady(function()
+ {
+
YAHOO.util.Dom.getElementsByClassName('toolbar','div')[0].style.display =
'none';
+ var loader = new YAHOO.util.YUILoader();
+ loader.addModule({
+ name: "anyone", //module name; must be unique
+ type: "js", //can be "js" or "css"
+ fullpath: property_js //'property_js' have the path for
property.js, is render in HTML
+ });
+
+ loader.require("anyone");
+
+ //Insert JSON utility on the page
+
+ loader.insert();
+
+ });
+
Modified: trunk/controller/js/yahoo/control_tabs.js
===================================================================
--- trunk/controller/js/yahoo/control_tabs.js 2011-12-09 15:41:52 UTC (rev
8264)
+++ trunk/controller/js/yahoo/control_tabs.js 2011-12-10 15:55:30 UTC (rev
8265)
@@ -1,7 +1,7 @@
YAHOO.util.Event.addListener(window, "load", function() {
/*
- var oArgs = {menuaction:'controller.uicontrol.edit'};
+ var oArgs = {menuaction:'controller.uicontrol.edit'};
var url = phpGWLink('index.php', oArgs, true);
var colDefs = [{key: 'name', label: lang['Name'], formatter:
YAHOO.portico.formatLink}, {key: 'category', label: lang['Category']}, {key:
'actions', label: lang['Actions'], formatter:
YAHOO.portico.formatGenericLink(lang['Edit'], lang['Delete'])}];
YAHOO.portico.inlineTableHelper('details_container', url, colDefs);
Modified: trunk/controller/js/yahoo/datatable.js
===================================================================
--- trunk/controller/js/yahoo/datatable.js 2011-12-09 15:41:52 UTC (rev
8264)
+++ trunk/controller/js/yahoo/datatable.js 2011-12-10 15:55:30 UTC (rev
8265)
@@ -9,30 +9,30 @@
YAHOO.portico.renderUiFormItems = function(container) {
var items = YAHOO.util.Dom.getElementsBy(function(){return true;},
'input', container);
for(var i=0; i < items.length; i++) {
- var type = items[i].getAttribute('type');
- if(type == 'link') {
- new YAHOO.widget.Button(items[i],
- {type: 'link',
- href:
items[i].getAttribute('href')}).addClass(items[i].getAttribute('class'));
- }
- else if(type == 'submit') {
- new YAHOO.widget.Button(items[i], {type: 'submit'});
- }
+ var type = items[i].getAttribute('type');
+ if(type == 'link') {
+ new YAHOO.widget.Button(items[i],
+ {type:
'link',
+ href:
items[i].getAttribute('href')}).addClass(items[i].getAttribute('class'));
+ }
+ else if(type == 'submit') {
+ new YAHOO.widget.Button(items[i], {type: 'submit'});
+ }
}
};
YAHOO.portico.setupPaginator = function() {
var paginatorConfig = {
- rowsPerPage: 10,
- alwaysVisible: false,
- template: "{PreviousPageLink} <strong>{CurrentPageReport}</strong>
{NextPageLink}",
- pageReportTemplate: "Showing items {startRecord} - {endRecord} of
{totalRecords}",
- containers: ['paginator']
- };
+ rowsPerPage: 10,
+ alwaysVisible: false,
+ template: "{PreviousPageLink}
<strong>{CurrentPageReport}</strong> {NextPageLink}",
+ pageReportTemplate: "Showing items {startRecord} - {endRecord}
of {totalRecords}",
+ containers: ['paginator']
+ };
YAHOO.portico.lang('setupPaginator', paginatorConfig);
var pag = new YAHOO.widget.Paginator(paginatorConfig);
- pag.render();
+ pag.render();
return pag;
};
@@ -55,43 +55,43 @@
YAHOO.portico.setupDatasource();
var pag = YAHOO.portico.setupPaginator();
- var fields = [];
- for(var i=0; i < YAHOO.portico.columnDefs.length; i++) {
- fields.push(YAHOO.portico.columnDefs[i].key);
- }
- var baseUrl = YAHOO.portico.dataSourceUrl;
- if(baseUrl[baseUrl.length - 1] != '&') {
- baseUrl += '&';
- }
-
- if (YAHOO.portico.initialSortedBy) {
- baseUrl += 'sort=' + YAHOO.portico.initialSortedBy.key + '&dir=' +
YAHOO.portico.initialSortedBy.dir;
- } else {
- baseUrl += 'sort=' + fields[0];
- }
+ var fields = [];
+ for(var i=0; i < YAHOO.portico.columnDefs.length; i++) {
+ fields.push(YAHOO.portico.columnDefs[i].key);
+ }
+ var baseUrl = YAHOO.portico.dataSourceUrl;
+ if(baseUrl[baseUrl.length - 1] != '&') {
+ baseUrl += '&';
+ }
+ if (YAHOO.portico.initialSortedBy) {
+ baseUrl += 'sort=' + YAHOO.portico.initialSortedBy.key + '&dir=' +
YAHOO.portico.initialSortedBy.dir;
+ } else {
+ baseUrl += 'sort=' + fields[0];
+ }
+
baseUrl += '&results=' + pag.getRowsPerPage() + '&';
- var myDataSource = new YAHOO.util.DataSource(baseUrl);
+ var myDataSource = new YAHOO.util.DataSource(baseUrl);
- myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
- myDataSource.connXhrMode = "queueRequests";
- myDataSource.responseSchema = {
- resultsList: "ResultSet.Result",
- fields: fields,
- metaFields : {
- totalResultsAvailable: "ResultSet.totalResultsAvailable",
- recordsReturned: "ResultSet.recordsReturned",
+ myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
+ myDataSource.connXhrMode = "queueRequests";
+ myDataSource.responseSchema = {
+ resultsList: "ResultSet.Result",
+ fields: fields,
+ metaFields : {
+ totalResultsAvailable:
"ResultSet.totalResultsAvailable",
+ recordsReturned: "ResultSet.recordsReturned",
startIndex: 'ResultSet.startIndex',
sortKey: 'ResultSet.sortKey',
sortDir: 'ResultSet.sortDir'
- }
- };
- var myDataTable = new YAHOO.widget.DataTable("datatable-container",
- YAHOO.portico.columnDefs, myDataSource, {
- paginator: pag,
- dynamicData: true,
- sortedBy: YAHOO.portico.initialSortedBy || {key: fields[0], dir:
YAHOO.widget.DataTable.CLASS_ASC}
- });
+ }
+ };
+ var myDataTable = new YAHOO.widget.DataTable("datatable-container",
+ YAHOO.portico.columnDefs, myDataSource, {
+ paginator: pag,
+ dynamicData: true,
+ sortedBy: YAHOO.portico.initialSortedBy || {key:
fields[0], dir: YAHOO.widget.DataTable.CLASS_ASC}
+ });
//------------
myContextMenu = new YAHOO.widget.ContextMenu("mycontextmenu",
{trigger:myDataTable.getTbodyEl()});
@@ -108,48 +108,48 @@
myContextMenu.render(myDataTable);
//--------------
- var handleSorting = function (oColumn) {
- var sDir = this.getColumnSortDir(oColumn);
- var newState = getState(oColumn.key, sDir);
- History.navigate("state", newState);
- };
- myDataTable.sortColumn = handleSorting;
+ var handleSorting = function (oColumn) {
+ var sDir = this.getColumnSortDir(oColumn);
+ var newState = getState(oColumn.key, sDir);
+ History.navigate("state", newState);
+ };
+ myDataTable.sortColumn = handleSorting;
- var handlePagination = function(state) {
- var sortedBy = this.get("sortedBy");
- var newState = getState(sortedBy.key, sortedBy.dir,
state.recordOffset);
- History.navigate("state", newState);
- };
- pag.unsubscribe("changeRequest", myDataTable.onPaginatorChangeRequest);
- pag.subscribe("changeRequest", handlePagination, myDataTable, true);
- myDataTable.doBeforeLoadData = function(oRequest, oResponse, oPayload) {
- oPayload.totalRecords = oResponse.meta.totalResultsAvailable;
+ var handlePagination = function(state) {
+ var sortedBy = this.get("sortedBy");
+ var newState = getState(sortedBy.key, sortedBy.dir,
state.recordOffset);
+ History.navigate("state", newState);
+ };
+ pag.unsubscribe("changeRequest", myDataTable.onPaginatorChangeRequest);
+ pag.subscribe("changeRequest", handlePagination, myDataTable, true);
+ myDataTable.doBeforeLoadData = function(oRequest, oResponse, oPayload) {
+ oPayload.totalRecords = oResponse.meta.totalResultsAvailable;
oPayload.pagination = {
rowsPerPage: oResponse.meta.paginationRowsPerPage ||
10,
// rowsPerPage: oResponse.meta.recordsReturned || 10,
recordOffset: oResponse.meta.startIndex || 0
- }
+ }
oPayload.sortedBy = {
key: oResponse.meta.sortKey || "id",
dir: (oResponse.meta.sortDir) ? "yui-dt-" +
oResponse.meta.sortDir : "yui-dt-asc"
};
return true;
- }
+ }
YAHOO.util.Event.on(
- YAHOO.util.Selector.query('select'), 'change', function (e) {
- //var val = this.value;
+ YAHOO.util.Selector.query('select'), 'change', function (e) {
+ //var val = this.value;
var state = getState();
YAHOO.util.Dom.setStyle('list_flash', 'display',
'none');
History.navigate('state', state);
});
- YAHOO.util.Event.addListener('queryForm', "submit", function(e){
- YAHOO.util.Event.stopEvent(e);
+ YAHOO.util.Event.addListener('queryForm', "submit", function(e){
+ YAHOO.util.Event.stopEvent(e);
var state = getState();
YAHOO.util.Dom.setStyle('list_flash', 'display', 'none');
History.navigate('state', state);
- });
+ });
YAHOO.util.Event.addListener('list_actions_form', "submit", function(e){
YAHOO.util.Event.stopEvent(e);
Deleted: trunk/controller/js/yahoo/equipment_location.js
===================================================================
--- trunk/controller/js/yahoo/equipment_location.js 2011-12-09 15:41:52 UTC
(rev 8264)
+++ trunk/controller/js/yahoo/equipment_location.js 2011-12-10 15:55:30 UTC
(rev 8265)
@@ -1,323 +0,0 @@
-//--------------------------------------------------------
-// Declaration of event.index vars
-//--------------------------------------------------------
- //define SelectButton
- var oMenuButton_0, oMenuButton_1, oMenuButton_2, oMenuButton_3,
oMenuButton_4;//, oMenuButton_5;
- var selectsButtons = [
- {order:0, var_URL:'type_id', name:'btn_type_id',
style:'typebutton', dependiente:[], reload:1},
- {order:1, var_URL:'cat_id', name:'btn_cat_id',
style:'categorybutton', dependiente:[]},
- {order:2, var_URL:'district_id', name:'btn_district_id',
style:'districtbutton', dependiente:[3]},
- {order:3,
var_URL:'part_of_town_id',name:'btn_part_of_town_id',style:'partOFTownbutton',dependiente:[]},
- {order:4, var_URL:'role_id', name:'btn_role_id',
style:'roleIdbutton', dependiente:[]}
-// {order:5, var_URL:'user_id', name:'btn_user_id',
style:'userIdbutton', dependiente:[]}, // dummy - changed to
select
- ];
-
- // define buttons
- var oNormalButton_0, oNormalButton_1;//, oNormalButton_2;
- var normalButtons = [
- {order:0, name:'btn_search', funct:"onSearchClick"},
- {order:1, name:'btn_save', funct:"onSave"}
- ];
-
- // define Text buttons
- var textImput = [
- {order:0, name:'query', id:'txt_query'}
- ];
-
- var toolTips =
- [
- {name:'status', title:'Status',
description:'',ColumnDescription:'status'},
- {name:'btn_export', title:'download', description:'Download
table to your browser',ColumnDescription:''}
- ];
-
- var linktoolTips =
- [
- {name:'btn_data_search', title:'Data search',
description:'Narrow the search dates'}
- ];
-
- var config_values =
- [
- {date_search : 0} //if search has link "Data search"
- ];
-
- var tableYUI;
-
/********************************************************************************
- *
- */
-
- this.onChangeSelect = function()
- {
- var myselect=document.getElementById("sel_user_id");
- for (var i=0; i<myselect.options.length; i++)
- {
- if (myselect.options[i].selected==true)
- {
- break;
- }
- }
- eval("path_values.user_id='"+myselect.options[i].value+"'");
- execute_ds();
- }
-
-
- this.myParticularRenderEvent = function()
- {
- delete_content_div("message",2); //find it in property.js
- create_message();
- tableYUI.deleteTFoot();
- addFooterDatatable();
- }
-
-
/********************************************************************************
- * Delete all message un DIV 'message'
- */
- this.create_message = function()
- {
- div_message= YAHOO.util.Dom.get("message");
-
- //SHOW message if exist 'values_ds.message'
- if(window.values_ds.message)
- {
- // succesfull
- if(window.values_ds.message[0].message)
- {
- for(i=0; i<values_ds.message[0].message.length;
i++)
- {
- oDiv=document.createElement("DIV");
- txtNode =
document.createTextNode(values_ds.message[0].message[i].msg);
- oDiv.appendChild(txtNode);
- oDiv.style.color = '#009900';
- oDiv.style.fontWeight = 'bold';
-
- div_message.appendChild(oDiv);
- }
- }
-
- // error
- if(window.values_ds.message[0].error)
- {
- for(i=0; i<values_ds.message[0].error.length;
i++)
- {
- oDiv=document.createElement("DIV");
- txtNode =
document.createTextNode(values_ds.message[0].error[i].msg);
- oDiv.appendChild(txtNode);
- oDiv.style.color = '#FF0000';
- oDiv.style.fontWeight = 'bold';
-
- div_message.appendChild(oDiv);
- }
- }
- }
- window.values_ds.message = null;
- }
-
- this.particular_setting = function()
- {
- if(flag_particular_setting=='init')
- {
- //locate (asign ID) to datatable
- tableYUI =
YAHOO.util.Dom.getElementsByClassName("yui-dt-data","tbody")[0].parentNode;
- tableYUI.setAttribute("id","tableYUI");
-
- //type
- index =
locate_in_array_options(0,"value",path_values.type_id);
- if(index)
- {
- oMenuButton_0.set("label", ("<em>" +
array_options[0][index][1] + "</em>"));
- }
- //category
- index =
locate_in_array_options(1,"value",path_values.cat_id);
- if(index)
- {
- oMenuButton_1.set("label", ("<em>" +
array_options[1][index][1] + "</em>"));
- }
-
- //district
- index =
locate_in_array_options(2,"value",path_values.district_id);
- if(index)
- {
- oMenuButton_2.set("label", ("<em>" +
array_options[2][index][1] + "</em>"));
- }
- //user
- index =
locate_in_array_options(3,"value",path_values.user_id);
- if(index)
- {
- oMenuButton_3.set("label", ("<em>" +
array_options[3][index][1] + "</em>"));
- }
-
-// oMenuButton_0.focus();
- YAHOO.util.Dom.get(textImput[0].id).focus();
- }
- else if(flag_particular_setting=='update')
- {
- }
- }
-
-
-/****************************************************************************************/
-
- this.Exchange_values = function()
- {
- //nothing
- }
-
-/********************************************************************************/
- var myFormatterCheck = function(elCell, oRecord, oColumn, oData)
- {
- var checked = '';
- var hidden = '';
- if(oRecord.getData('responsible_item'))
- {
- checked = "checked = 'checked'";
- hidden = "<input type=\"hidden\" class=\"orig_check\"
name=\"values[assign_orig][]\"
value=\""+oRecord.getData('responsible_contact_id')+"_"+oRecord.getData('responsible_item')+"_"+oRecord.getData('location_code')+"\"/>";
- }
-
- elCell.innerHTML = hidden + "<center><input type=\"checkbox\"
"+checked+" class=\"mychecks\" name=\"values[assign][]\"
value=\""+oRecord.getData('location_code')+"\"/></center>";
- }
-
- var FormatterCenter = function(elCell, oRecord, oColumn, oData)
- {
- elCell.innerHTML = "<center>"+oData+"</center>";
- }
-
-/********************************************************************************/
-
- this.onSave = function()
- {
- //get the last div in th form
- var divs= YAHOO.util.Dom.getElementsByClassName('field');
- var mydiv = divs[divs.length-1];
- //remove all child of mydiv
- if (mydiv.hasChildNodes())
- {
- while ( mydiv.childNodes.length >= 1 )
- {
- mydiv.removeChild( mydiv.firstChild );
- }
- }
- // styles for dont show
- mydiv.style.display = "none";
-
- valuesForPHP =
YAHOO.util.Dom.getElementsByClassName('mychecks');
- valuesForPHP_orig =
YAHOO.util.Dom.getElementsByClassName('orig_check');
-
- var values_return =
- {
- assign:[],
- assign_orig:[]
- };
-
- //add all control to form
- for(i=0;i<valuesForPHP.length;i++)
- {
- //values_return.assign[i] = valuesForPHP[i].value;
- if(valuesForPHP[i].checked)
- {
-
values_return.assign.push(valuesForPHP[i].value);
- }
- }
-
- for(i=0;i<valuesForPHP_orig.length;i++)
- {
- //console.log(valuesForPHP_orig[i].name); // firebug
- values_return.assign_orig[i] =
valuesForPHP_orig[i].value;
- }
-
- var returnfield = document.createElement('input');
- returnfield.setAttribute('name', 'values_assign');
- returnfield.setAttribute('type', 'text');
- returnfield.setAttribute('value',
JSON.stringify(values_return));
- mydiv.appendChild(returnfield);
-
- // find out the unique form
- formObject = document.body.getElementsByTagName('form');
- // modify the 'form' for send it as POST using asyncronize call
- YAHOO.util.Connect.setForm(formObject[0]);
-
- maintain_pagination_order();
- execute_ds();
- }
-
-
-//----------------------------------------------------------
-
/********************************************************************************
- *
- */
- this.addFooterDatatable = function()
- {
- //Create ROW
- newTR = document.createElement('tr');
- var i = 0;
-
- for(var k=0 ; k<values_ds.headers.name.length; k++)
- {
- if (values_ds.headers.input_type[k] != 'hidden')
- {
- i++;
- }
- }
-
- td_empty(i+2);
-
- //RowChecked
- CreateRowChecked("mychecks");
-
- //Add to Table
- myfoot = tableYUI.createTFoot();
- myfoot.setAttribute("id","myfoot");
- myfoot.appendChild(newTR.cloneNode(true));
- //clean value for values_ds.message
- values_ds.message = null;
- }
-
-
/********************************************************************************
- *
- */
- check_all = function(myclass)
- {
- controls = YAHOO.util.Dom.getElementsByClassName(myclass);
- for(i=0;i<controls.length;i++)
- {
- if(!controls[i].disabled)
- {
- //for class=mychecks, they have to be
interchanged
- if(myclass=="mychecks")
- {
- if(controls[i].checked)
- {
- controls[i].checked = false;
- }
- else
- {
- controls[i].checked = true;
- }
- }
- //for the rest, always id checked
- else
- {
- controls[i].checked = true;
- }
- }
- }
- }
-
-
- //YAHOO.util.Event.addListener(window, "load", function()
- YAHOO.util.Event.onDOMReady(function()
- {
-
YAHOO.util.Dom.getElementsByClassName('toolbar','div')[0].style.display =
'none';
- var loader = new YAHOO.util.YUILoader();
- loader.addModule({
- name: "anyone", //module name; must be unique
- type: "js", //can be "js" or "css"
- fullpath: property_js //'property_js' have the path for
property.js, is render in HTML
- });
-
- loader.require("anyone");
-
- //Insert JSON utility on the page
-
- loader.insert();
-
- });
-
Modified: trunk/controller/setup/phpgw_no.lang
===================================================================
--- trunk/controller/setup/phpgw_no.lang 2011-12-09 15:41:52 UTC (rev
8264)
+++ trunk/controller/setup/phpgw_no.lang 2011-12-10 15:55:30 UTC (rev
8265)
@@ -271,9 +271,9 @@
Building part controller no Bygningsdel
remove controller no Fjern valgte elementer
Locations controller no Lokasjoner
-Equipment controller no Utstyr
+component controller no Utstyr
Control_locations controller no Lokasjoner
-Control_equipment controller no Utstyr
+Control_component controller no Utstyr
New control controller no Ny kontroll
revisit controller no Revidér
Procedure revision controller no Versjon
@@ -287,16 +287,16 @@
end_date controller no Slutt dato
View_locations_for_control controller no Vis
bygg/kontroll-knytning
Add_locations_for_control controller no Legg til knytning for
bygg
-View_equipment_for_control controller no Vis bygg/utstyr-knytning
-Add_equipment_for_control controller no Legg til knytning mot
utstyr
-equipment_for_control controller no Utstyr tilknyttet kontroll
-Choose_equipment_type controller no Velg utstyrstype
-Choose_equipment_category controller no Velg utstyrskategori
-equipment_category_internal controller no Internt utstyrsregister
-equipment_category_ifc controller no IFC
+View_component_for_control controller no Vis bygg/utstyr-knytning
+Add_component_for_control controller no Legg til knytning mot
utstyr
+component_for_control controller no Utstyr tilknyttet kontroll
+Choose_component_type controller no Velg utstyrstype
+Choose_component_category controller no Velg utstyrskategori
+component_category_internal controller no Internt utstyrsregister
+component_category_ifc controller no IFC
invert_checkboxes controller no Inverter merking
ControlId controller no Kontroll ID
Bim_id controller no Utstyr ID
Bim_name controller no Utstyrsnavn
Bim_type controller no Utstyrstype
-GUID controller no GUID
\ No newline at end of file
+GUID controller no GUID
Modified: trunk/controller/setup/setup.inc.php
===================================================================
--- trunk/controller/setup/setup.inc.php 2011-12-09 15:41:52 UTC (rev
8264)
+++ trunk/controller/setup/setup.inc.php 2011-12-10 15:55:30 UTC (rev
8265)
@@ -1,6 +1,6 @@
<?php
$setup_info['controller']['name'] = 'controller';
- $setup_info['controller']['version'] = '0.1.10';
+ $setup_info['controller']['version'] = '0.1.11';
$setup_info['controller']['app_order'] = 100;
$setup_info['controller']['enable'] = 1;
$setup_info['controller']['app_group'] = 'office';
@@ -28,7 +28,8 @@
$setup_info['controller']['hooks'] = array
(
'menu' => 'controller.menu.get_menu',
- 'config'
+ 'config',
+ 'home',
);
$setup_info['controller']['tables'] = array
@@ -43,5 +44,5 @@
'controller_control_area',
'controller_control_group_list',
'controller_control_location_list',
- 'controller_control_equipment_list'
+ 'controller_control_component_list'
);
Modified: trunk/controller/setup/tables_current.inc.php
===================================================================
--- trunk/controller/setup/tables_current.inc.php 2011-12-09 15:41:52 UTC
(rev 8264)
+++ trunk/controller/setup/tables_current.inc.php 2011-12-10 15:55:30 UTC
(rev 8265)
@@ -12,8 +12,8 @@
'costResponsibility_id' => array('type' =>
'int', 'precision' => 4, 'nullable' => True),
'responsibility_id' => array('type' => 'int',
'precision' => 4, 'nullable' => True),
'control_area_id' => array('type' => 'int',
'precision' => 4, 'nullable' => True),
- 'equipment_type_id' => array('type' => 'int',
'precision' => 4, 'nullable' => True),
- 'equipment_id' => array('type' => 'int',
'precision' => 4, 'nullable' => True),
+ 'component_type_id' => array('type' => 'int',
'precision' => 4, 'nullable' => True),
+ 'component_id' => array('type' => 'int',
'precision' => 4, 'nullable' => True),
'location_code' => array('type' => 'int',
'precision' => 4, 'nullable' => True),
'repeat_type' => array('type' => 'int',
'precision' => 2, 'nullable' => True),
'repeat_interval' => array('type' => 'int',
'precision' => 2, 'nullable' => True),
@@ -73,7 +73,7 @@
'deadline' => array('type' => 'int',
'precision' => 8, 'nullable' => True),
'planned_date' => array('type' => 'int',
'precision' => 8, 'nullable' => True),
'completed_date' => array('type' => 'int',
'precision' => 8, 'nullable' => True),
- 'equipment_id' => array('type' => 'int',
'precision' => 4, 'nullable' => True),
+ 'component_id' => array('type' => 'int',
'precision' => 4, 'nullable' => True),
'location_code' => array('type' => 'int',
'precision' => 4, 'nullable' => True)
),
'pk' => array('id'),
@@ -148,11 +148,11 @@
'ix' => array(),
'uc' => array()
),
- 'controller_control_equipment_list' => array(
+ 'controller_control_component_list' => array(
'fd' => array(
'id' => array('type' => 'auto',
'nullable' => false),
'control_id' => array('type' => 'int',
'precision' => '4', 'nullable' => false),
- 'equipment_id' => array('type' =>
'int', 'precision' => '4', 'nullable' => false)
+ 'component_id' => array('type' =>
'int', 'precision' => '4', 'nullable' => false)
),
'pk' => array('id'),
'fk' => array(),
Modified: trunk/controller/setup/tables_update.inc.php
===================================================================
--- trunk/controller/setup/tables_update.inc.php 2011-12-09 15:41:52 UTC
(rev 8264)
+++ trunk/controller/setup/tables_update.inc.php 2011-12-10 15:55:30 UTC
(rev 8265)
@@ -195,4 +195,32 @@
$GLOBALS['setup_info']['controller']['currentver'] = '0.1.10';
return $GLOBALS['setup_info']['controller']['currentver'];
}
-?>
\ No newline at end of file
+
+ /* Update Controller from v 0.1.10 to 0.1.11
+ * Alter from naming from equipment to more generic component
+ */
+
+ $test[] = '0.1.10';
+ function controller_upgrade0_1_10()
+ {
+ $GLOBALS['phpgw_setup']->oProc->CreateTable(
+ 'controller_control_component_list', array(
+ 'fd' => array(
+ 'id' => array('type' => 'auto',
'nullable' => false),
+ 'control_id' => array('type' => 'int',
'precision' => '4', 'nullable' => false),
+ 'component_id' => array('type' =>
'int', 'precision' => '4', 'nullable' => false)
+ ),
+ 'pk' => array('id'),
+ 'fk' => array(),
+ 'ix' => array(),
+ 'uc' => array()
+ )
+ );
+
+
$GLOBALS['phpgw_setup']->oProc->RenameColumn('controller_check_list','equipment_id','component_id');
+
+
$GLOBALS['phpgw_setup']->oProc->DropTable('controller_control_equipment_list');
+
+ $GLOBALS['setup_info']['controller']['currentver'] = '0.1.11';
+ return $GLOBALS['setup_info']['controller']['currentver'];
+ }
Added: trunk/controller/templates/base/add_component_to_control.xsl
===================================================================
--- trunk/controller/templates/base/add_component_to_control.xsl
(rev 0)
+++ trunk/controller/templates/base/add_component_to_control.xsl
2011-12-10 15:55:30 UTC (rev 8265)
@@ -0,0 +1,247 @@
+<func:function name="phpgw:conditional">
+ <xsl:param name="test"/>
+ <xsl:param name="true"/>
+ <xsl:param name="false"/>
+
+ <func:result>
+ <xsl:choose>
+ <xsl:when test="$test">
+ <xsl:value-of select="$true"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$false"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </func:result>
+</func:function>
+
+<xsl:template name="add_component_to_control" xmlns:php="http://php.net/xsl">
+ <!-- IMPORTANT!!! Loads YUI javascript -->
+ <xsl:call-template name="common"/>
+
+ <div class="yui-content">
+ <div id="control_details">
+ <xsl:call-template name="yui_booking_i18n"/>
+ <xsl:apply-templates select="control_filters" />
+ <xsl:apply-templates select="filter_form" />
+ <xsl:apply-templates select="paging"/>
+ <xsl:apply-templates select="datatable"/>
+ <xsl:apply-templates select="form/list_actions"/>
+ </div>
+ </div>
+</xsl:template>
+
+<xsl:template match="control_filters" name="control_filters">
+ <div style="margin: 10px;padding: 10px; width: 25%;">
+
+ <!-- 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>
+ </xsl:for-each>
+ </select>
+
+ <form id="loc_form" action="" method="GET">
+ <select id="control_id" name="control_id">
+ <xsl:choose>
+ <xsl:when
test="control_array/child::node()">
+ <xsl:for-each
select="control_array">
+ <xsl:variable
name="control_id"><xsl:value-of select="id"/></xsl:variable>
+ <option
value="{$control_id}">
+ <xsl:value-of
select="title"/>
+ </option>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <option>
+ Ingen kontroller
+ </option>
+ </xsl:otherwise>
+ </xsl:choose>
+ </select>
+ </form>
+ </div>
+</xsl:template>
+
+<xsl:template match="filter_form">
+ <form id="queryForm">
+ <xsl:attribute name="method">
+ <xsl:value-of select="phpgw:conditional(not(method),
'GET', method)"/>
+ </xsl:attribute>
+
+ <xsl:attribute name="action">
+ <xsl:value-of select="phpgw:conditional(not(action),
'', action)"/>
+ </xsl:attribute>
+ <xsl:call-template name="filter_list"/>
+ </form>
+
+ <form id="update_table_dummy" method='POST' action='' >
+ </form>
+
+</xsl:template>
+
+<xsl:template name="filter_list" xmlns:php="http://php.net/xsl">
+ <div>
+ <ul id="filters">
+ <li>
+ <select id="ifc" name="ifc">
+ <option value="">
+ <xsl:value-of select="php:function('lang',
'Choose_component_category')"/>
+ </option>
+ <option value="0">
+ <xsl:value-of select="php:function('lang',
'component_category_internal')"/>
+ </option>
+ <option value="1">
+ <xsl:value-of select="php:function('lang',
'component_category_ifc')"/>
+ </option>
+ </select>
+ </li>
+ <li>
+ <select id="bim_type_id" name="bim_type_id">
+ <option value="">
+ <xsl:value-of select="php:function('lang',
'Choose_component_type')"/>
+ </option>
+ <xsl:for-each select="bim_types">
+ <xsl:variable name="bim_type_id"><xsl:value-of
select="id"/></xsl:variable>
+ <option value="{$bim_type_id}">
+ <xsl:value-of select="name"/>
+ </option>
+ </xsl:for-each>
+ </select>
+ </li>
+ </ul>
+ <ul id="search_list">
+ <li>
+ <input type="text" name="query" />
+ </li>
+ <li>
+ <xsl:variable name="lang_search"><xsl:value-of
select="php:function('lang', 'Search')" /></xsl:variable>
+ <input type="submit" name="search"
value="{$lang_search}" title = "{$lang_search}" />
+ </li>
+ </ul>
+
+ </div>
+</xsl:template>
+
+<xsl:template match="datatable">
+ <script type="text/javascript">
+ <![CDATA[
+ function checkAll(myclass)
+ {
+ controls = YAHOO.util.Dom.getElementsByClassName(myclass);
+ for(i=0;i<controls.length;i++)
+ {
+ //for class=mychecks, they have to be interchanged
+ //checkbox is located within td->div->input. To get the
input-object, use controls[i].children[0].children[0]
+ if(myclass=='mychecks')
+ {
+ if(controls[i].children[0].children[0].checked)
+ {
+
controls[i].children[0].children[0].checked = false;
+ }
+ else
+ {
+
controls[i].children[0].children[0].checked = true;
+ }
+ }
+ //for the rest, always id checked
+ else
+ {
+ controls[i].children[0].children[0].checked =
true;
+ }
+ }
+ }
+
+ function savecomponentToControl()
+ {
+ var divs =
YAHOO.util.Dom.getElementsByClassName('component_submit');
+ var mydiv = divs[divs.length-1];
+
+ // styles for dont show
+ mydiv.style.display = "none";
+
+ valuesForPHP =
YAHOO.util.Dom.getElementsByClassName('mychecks');
+ var values_return = ""; //new Array();
+
+ for(i=0;i<valuesForPHP.length;i++)
+ {
+ if(valuesForPHP[i].children[0].children[0].checked)
+ {
+ if(values_return != "")
+ values_return
+="|"+valuesForPHP[i].parentNode.firstChild.firstChild.firstChild.firstChild.nodeValue+';'+valuesForPHP[i].children[0].children[0].value;
+ else
+ values_return +=
valuesForPHP[i].parentNode.firstChild.firstChild.firstChild.firstChild.nodeValue+';'+valuesForPHP[i].children[0].children[0].value;
+ }
+ }
+
+ //alert(document.getElementById('control_id').value);
+ var control_id_value =
document.getElementById('control_id').value;
+
+ var returnfield = document.createElement('input');
+ returnfield.setAttribute('name', 'values_assign');
+ returnfield.setAttribute('type', 'text');
+ returnfield.setAttribute('value', values_return);
+ mydiv.appendChild(returnfield);
+
+ var control_id_field = document.createElement('input');
+ control_id_field.setAttribute('name', 'control_id');
+ control_id_field.setAttribute('type', 'text');
+ control_id_field.setAttribute('value', control_id_value);
+ mydiv.appendChild(control_id_field);
+
+ }
+ ]]>
+ </script>
+ <div id="data_paginator"/>
+ <div id="datatable-container"/>
+ <xsl:call-template name="datasource-definition" />
+ <xsl:variable name="label_submit"><xsl:value-of
select="php:function('lang', 'save')" /></xsl:variable>
+ <xsl:variable name="label_checkAll"><xsl:value-of
select="php:function('lang', 'invert_checkboxes')" /></xsl:variable>
+ <div><input type="button" id="select_all" value="{$label_checkAll}"
onclick="checkAll('mychecks')"/></div>
+ <form action="#" name="component_form" id="component_form"
method="post">
+ <div class="component_submit"><input type="submit"
name="save_component" id="save_component" value="{$label_submit}"
onclick="return savecomponentToControl()"/></div>
+ </form>
+</xsl:template>
+
+
+<xsl:template name="datasource-definition">
+ <script>
+ YAHOO.namespace('controller');
+
+ YAHOO.controller.columnDefs = [
+ <xsl:for-each select="//datatable/field">
+ {
+ key: "<xsl:value-of
select="key"/>",
+ <xsl:if test="label">
+ label: "<xsl:value-of
select="label"/>",
+ </xsl:if>
+ sortable: <xsl:value-of
select="phpgw:conditional(not(sortable = 0), 'true', 'false')"/>,
+ <xsl:if test="hidden">
+ hidden: true,
+ </xsl:if>
+ <xsl:if test="formatter">
+ formatter: <xsl:value-of
select="formatter"/>,
+ </xsl:if>
+ className: "<xsl:value-of
select="className"/>"
+ }<xsl:value-of
select="phpgw:conditional(not(position() = last()), ',', '')"/>
+ </xsl:for-each>
+ ];
+
+ var main_source = '<xsl:value-of select="source"/>';
+ var main_columnDefs = YAHOO.controller.columnDefs;
+ var main_form = 'queryForm';
+ var main_filters = ['bim_type_id'];
+ var main_container = 'datatable-container';
+ var main_table_id = 'datatable';
+ var main_pag = 'data_paginator';
+ var related_table = new Array('locations_table');
+
+ setDataSource(main_source, main_columnDefs, main_form,
main_filters, main_container, main_pag, main_table_id, related_table );
+
+ </script>
+
+</xsl:template>
\ No newline at end of file
Deleted: trunk/controller/templates/base/add_equipment_to_control.xsl
===================================================================
--- trunk/controller/templates/base/add_equipment_to_control.xsl
2011-12-09 15:41:52 UTC (rev 8264)
+++ trunk/controller/templates/base/add_equipment_to_control.xsl
2011-12-10 15:55:30 UTC (rev 8265)
@@ -1,247 +0,0 @@
-<func:function name="phpgw:conditional">
- <xsl:param name="test"/>
- <xsl:param name="true"/>
- <xsl:param name="false"/>
-
- <func:result>
- <xsl:choose>
- <xsl:when test="$test">
- <xsl:value-of select="$true"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$false"/>
- </xsl:otherwise>
- </xsl:choose>
- </func:result>
-</func:function>
-
-<xsl:template name="add_equipment_to_control" xmlns:php="http://php.net/xsl">
- <!-- IMPORTANT!!! Loads YUI javascript -->
- <xsl:call-template name="common"/>
-
- <div class="yui-content">
- <div id="control_details">
- <xsl:call-template name="yui_booking_i18n"/>
- <xsl:apply-templates select="control_filters" />
- <xsl:apply-templates select="filter_form" />
- <xsl:apply-templates select="paging"/>
- <xsl:apply-templates select="datatable"/>
- <xsl:apply-templates select="form/list_actions"/>
- </div>
- </div>
-</xsl:template>
-
-<xsl:template match="control_filters" name="control_filters">
- <div style="margin: 10px;padding: 10px; width: 25%;">
-
- <!-- 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>
- </xsl:for-each>
- </select>
-
- <form id="loc_form" action="" method="GET">
- <select id="control_id" name="control_id">
- <xsl:choose>
- <xsl:when
test="control_array/child::node()">
- <xsl:for-each
select="control_array">
- <xsl:variable
name="control_id"><xsl:value-of select="id"/></xsl:variable>
- <option
value="{$control_id}">
- <xsl:value-of
select="title"/>
- </option>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <option>
- Ingen kontroller
- </option>
- </xsl:otherwise>
- </xsl:choose>
- </select>
- </form>
- </div>
-</xsl:template>
-
-<xsl:template match="filter_form">
- <form id="queryForm">
- <xsl:attribute name="method">
- <xsl:value-of select="phpgw:conditional(not(method),
'GET', method)"/>
- </xsl:attribute>
-
- <xsl:attribute name="action">
- <xsl:value-of select="phpgw:conditional(not(action),
'', action)"/>
- </xsl:attribute>
- <xsl:call-template name="filter_list"/>
- </form>
-
- <form id="update_table_dummy" method='POST' action='' >
- </form>
-
-</xsl:template>
-
-<xsl:template name="filter_list" xmlns:php="http://php.net/xsl">
- <div>
- <ul id="filters">
- <li>
- <select id="ifc" name="ifc">
- <option value="">
- <xsl:value-of select="php:function('lang',
'Choose_equipment_category')"/>
- </option>
- <option value="0">
- <xsl:value-of select="php:function('lang',
'equipment_category_internal')"/>
- </option>
- <option value="1">
- <xsl:value-of select="php:function('lang',
'equipment_category_ifc')"/>
- </option>
- </select>
- </li>
- <li>
- <select id="bim_type_id" name="bim_type_id">
- <option value="">
- <xsl:value-of select="php:function('lang',
'Choose_equipment_type')"/>
- </option>
- <xsl:for-each select="bim_types">
- <xsl:variable name="bim_type_id"><xsl:value-of
select="id"/></xsl:variable>
- <option value="{$bim_type_id}">
- <xsl:value-of select="name"/>
- </option>
- </xsl:for-each>
- </select>
- </li>
- </ul>
- <ul id="search_list">
- <li>
- <input type="text" name="query" />
- </li>
- <li>
- <xsl:variable name="lang_search"><xsl:value-of
select="php:function('lang', 'Search')" /></xsl:variable>
- <input type="submit" name="search"
value="{$lang_search}" title = "{$lang_search}" />
- </li>
- </ul>
-
- </div>
-</xsl:template>
-
-<xsl:template match="datatable">
- <script type="text/javascript">
- <![CDATA[
- function checkAll(myclass)
- {
- controls = YAHOO.util.Dom.getElementsByClassName(myclass);
- for(i=0;i<controls.length;i++)
- {
- //for class=mychecks, they have to be interchanged
- //checkbox is located within td->div->input. To get the
input-object, use controls[i].children[0].children[0]
- if(myclass=='mychecks')
- {
- if(controls[i].children[0].children[0].checked)
- {
-
controls[i].children[0].children[0].checked = false;
- }
- else
- {
-
controls[i].children[0].children[0].checked = true;
- }
- }
- //for the rest, always id checked
- else
- {
- controls[i].children[0].children[0].checked =
true;
- }
- }
- }
-
- function saveEquipmentToControl()
- {
- var divs =
YAHOO.util.Dom.getElementsByClassName('equipment_submit');
- var mydiv = divs[divs.length-1];
-
- // styles for dont show
- mydiv.style.display = "none";
-
- valuesForPHP =
YAHOO.util.Dom.getElementsByClassName('mychecks');
- var values_return = ""; //new Array();
-
- for(i=0;i<valuesForPHP.length;i++)
- {
- if(valuesForPHP[i].children[0].children[0].checked)
- {
- if(values_return != "")
- values_return
+="|"+valuesForPHP[i].parentNode.firstChild.firstChild.firstChild.firstChild.nodeValue+';'+valuesForPHP[i].children[0].children[0].value;
- else
- values_return +=
valuesForPHP[i].parentNode.firstChild.firstChild.firstChild.firstChild.nodeValue+';'+valuesForPHP[i].children[0].children[0].value;
- }
- }
-
- //alert(document.getElementById('control_id').value);
- var control_id_value =
document.getElementById('control_id').value;
-
- var returnfield = document.createElement('input');
- returnfield.setAttribute('name', 'values_assign');
- returnfield.setAttribute('type', 'text');
- returnfield.setAttribute('value', values_return);
- mydiv.appendChild(returnfield);
-
- var control_id_field = document.createElement('input');
- control_id_field.setAttribute('name', 'control_id');
- control_id_field.setAttribute('type', 'text');
- control_id_field.setAttribute('value', control_id_value);
- mydiv.appendChild(control_id_field);
-
- }
- ]]>
- </script>
- <div id="data_paginator"/>
- <div id="datatable-container"/>
- <xsl:call-template name="datasource-definition" />
- <xsl:variable name="label_submit"><xsl:value-of
select="php:function('lang', 'save')" /></xsl:variable>
- <xsl:variable name="label_checkAll"><xsl:value-of
select="php:function('lang', 'invert_checkboxes')" /></xsl:variable>
- <div><input type="button" id="select_all" value="{$label_checkAll}"
onclick="checkAll('mychecks')"/></div>
- <form action="#" name="equipment_form" id="equipment_form"
method="post">
- <div class="equipment_submit"><input type="submit"
name="save_equipment" id="save_equipment" value="{$label_submit}"
onclick="return saveEquipmentToControl()"/></div>
- </form>
-</xsl:template>
-
-
-<xsl:template name="datasource-definition">
- <script>
- YAHOO.namespace('controller');
-
- YAHOO.controller.columnDefs = [
- <xsl:for-each select="//datatable/field">
- {
- key: "<xsl:value-of
select="key"/>",
- <xsl:if test="label">
- label: "<xsl:value-of
select="label"/>",
- </xsl:if>
- sortable: <xsl:value-of
select="phpgw:conditional(not(sortable = 0), 'true', 'false')"/>,
- <xsl:if test="hidden">
- hidden: true,
- </xsl:if>
- <xsl:if test="formatter">
- formatter: <xsl:value-of
select="formatter"/>,
- </xsl:if>
- className: "<xsl:value-of
select="className"/>"
- }<xsl:value-of
select="phpgw:conditional(not(position() = last()), ',', '')"/>
- </xsl:for-each>
- ];
-
- var main_source = '<xsl:value-of select="source"/>';
- var main_columnDefs = YAHOO.controller.columnDefs;
- var main_form = 'queryForm';
- var main_filters = ['bim_type_id'];
- var main_container = 'datatable-container';
- var main_table_id = 'datatable';
- var main_pag = 'data_paginator';
- var related_table = new Array('locations_table');
-
- setDataSource(main_source, main_columnDefs, main_form,
main_filters, main_container, main_pag, main_table_id, related_table );
-
- </script>
-
-</xsl:template>
\ No newline at end of file
Modified: trunk/controller/templates/base/add_location_to_control.xsl
===================================================================
--- trunk/controller/templates/base/add_location_to_control.xsl 2011-12-09
15:41:52 UTC (rev 8264)
+++ trunk/controller/templates/base/add_location_to_control.xsl 2011-12-10
15:55:30 UTC (rev 8265)
@@ -6,7 +6,7 @@
<func:result>
<xsl:choose>
<xsl:when test="$test">
- <xsl:value-of select="$true"/>
+ <xsl:value-of select="$true"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$false"/>
@@ -42,7 +42,7 @@
<option value="{$control_area_id}">
<xsl:value-of select="title"/>
</option>
- </xsl:for-each>
+ </xsl:for-each>
</select>
<form id="loc_form" action="" method="GET">
@@ -54,7 +54,7 @@
<option
value="{$control_id}">
<xsl:value-of
select="title"/>
</option>
- </xsl:for-each>
+ </xsl:for-each>
</xsl:when>
<xsl:otherwise>
<option>
@@ -76,7 +76,7 @@
<xsl:attribute name="action">
<xsl:value-of select="phpgw:conditional(not(action),
'', action)"/>
</xsl:attribute>
- <xsl:call-template name="filter_list"/>
+ <xsl:call-template name="filter_list"/>
</form>
<form id="update_table_dummy" method='POST' action='' >
@@ -85,7 +85,7 @@
</xsl:template>
<xsl:template name="filter_list" xmlns:php="http://php.net/xsl">
- <div>
+ <div>
<ul id="filters">
<li>
<select id="type_id" name="type_id">
@@ -97,10 +97,10 @@
<option value="{$building_type_id}">
<xsl:value-of select="name"/>
</option>
- </xsl:for-each>
+ </xsl:for-each>
</select>
- </li>
- <li>
+ </li>
+ <li>
<select id="cat_id" name="cat_id">
<option value="">
<xsl:value-of select="php:function('lang',
'Choose_building_category')"/>
@@ -110,10 +110,10 @@
<option value="{$category_type_id}">
<xsl:value-of select="name"/>
</option>
- </xsl:for-each>
+ </xsl:for-each>
</select>
- </li>
- <li>
+ </li>
+ <li>
<select id="district_id" name="district_id">
<option value="">
<xsl:value-of
select="php:function('lang', 'Choose_district')"/>
@@ -123,10 +123,10 @@
<option value="{$district_id}">
<xsl:value-of select="name"/>
</option>
- </xsl:for-each>
+ </xsl:for-each>
</select>
- </li>
- <li>
+ </li>
+ <li>
<select id="part_of_town_id" name="part_of_town_id">
<option value="">
<xsl:value-of
select="php:function('lang', 'Choose_part_of_town')"/>
@@ -136,9 +136,9 @@
<option value="{$part_of_town_id}">
<xsl:value-of select="name"/>
</option>
- </xsl:for-each>
+ </xsl:for-each>
</select>
- </li>
+ </li>
</ul>
<ul id="search_list">
<li>
@@ -147,15 +147,15 @@
<li>
<xsl:variable name="lang_search"><xsl:value-of
select="php:function('lang', 'Search')" /></xsl:variable>
<input type="submit" name="search"
value="{$lang_search}" title = "{$lang_search}" />
- </li>
+ </li>
</ul>
- </div>
+ </div>
</xsl:template>
<xsl:template match="datatable">
- <div id="data_paginator"/>
- <div id="datatable-container"/>
+ <div id="data_paginator"/>
+ <div id="datatable-container"/>
<xsl:call-template name="datasource-definition" />
</xsl:template>
@@ -170,14 +170,14 @@
key: "<xsl:value-of
select="key"/>",
<xsl:if test="label">
label: "<xsl:value-of
select="label"/>",
- </xsl:if>
+ </xsl:if>
sortable: <xsl:value-of
select="phpgw:conditional(not(sortable = 0), 'true', 'false')"/>,
<xsl:if test="hidden">
hidden: true,
- </xsl:if>
+ </xsl:if>
<xsl:if test="formatter">
formatter: <xsl:value-of
select="formatter"/>,
- </xsl:if>
+ </xsl:if>
className: "<xsl:value-of
select="className"/>"
}<xsl:value-of
select="phpgw:conditional(not(position() = last()), ',', '')"/>
</xsl:for-each>
Modified: trunk/controller/templates/base/choose_control_items.xsl
===================================================================
--- trunk/controller/templates/base/choose_control_items.xsl 2011-12-09
15:41:52 UTC (rev 8264)
+++ trunk/controller/templates/base/choose_control_items.xsl 2011-12-10
15:55:30 UTC (rev 8265)
@@ -18,12 +18,12 @@
<ul class="control_items">
<xsl:for-each
select="groups_with_control_items">
<ul class="itemlist expand_list">
- <li>
- <xsl:choose>
- <xsl:when
test="group_control_items/child::node()">
- <h4><img
src="controller/images/arrow_left.png" width="14"/><span><xsl:value-of
select="control_group/group_name"/></span></h4>
- <xsl:variable
name="control_group_id"><xsl:value-of select="control_group/id"/></xsl:variable>
- <ul>
+ <li>
+ <xsl:choose>
+ <xsl:when
test="group_control_items/child::node()">
+ <h4><img
src="controller/images/arrow_left.png" width="14"/><span><xsl:value-of
select="control_group/group_name"/></span></h4>
+ <xsl:variable
name="control_group_id"><xsl:value-of select="control_group/id"/></xsl:variable>
+ <ul>
<xsl:for-each select="group_control_items">
<xsl:variable name="control_item_id"><xsl:value-of
select="control_item/id"/></xsl:variable>
<xsl:choose>
Modified: trunk/controller/templates/base/common.php
===================================================================
--- trunk/controller/templates/base/common.php 2011-12-09 15:41:52 UTC (rev
8264)
+++ trunk/controller/templates/base/common.php 2011-12-10 15:55:30 UTC (rev
8265)
@@ -53,7 +53,7 @@
prefix: "<?php echo
$GLOBALS['phpgw_info']['user']['preferences']['common']['currency'].' ' ?>",
thousandsSeparator: ",",
decimalPlaces: 2
- });
+ });
}
//if (oData != undefined) {
// elCell.innerHTML = '<?php echo
$GLOBALS['phpgw_info']['user']['preferences']['common']['currency'].' ' ?>' +
parseFloat(oData).toFixed(2);
@@ -414,10 +414,10 @@
$populate = phpgw::get_var('populate_form');
if(isset($populate)){?>
var qs =
YAHOO.controller.serializeForm(source_properties.form);
- this.wrapper.source.liveData =
this.wrapper.url + qs + '&';
- this.wrapper.source.sendRequest('',
{success: function(sRequest, oResponse, oPayload) {
-
this.wrapper.table.onDataReturnInitializeTable(sRequest, oResponse,
this.wrapper.paginator);
- }, scope: this});
+ this.wrapper.source.liveData =
this.wrapper.url + qs + '&';
+ this.wrapper.source.sendRequest('',
{success: function(sRequest, oResponse, oPayload) {
+
this.wrapper.table.onDataReturnInitializeTable(sRequest, oResponse,
this.wrapper.paginator);
+ }, scope: this});
<?php }
?>
@@ -534,10 +534,10 @@
function formListener(event){
YAHOO.util.Event.stopEvent(event);
var qs = YAHOO.controller.serializeForm(this.properties.form);
- this.source.liveData = this.url + qs + '&';
- this.source.sendRequest('', {success: function(sRequest, oResponse,
oPayload) {
- this.table.onDataReturnInitializeTable(sRequest, oResponse,
this.paginator);
- }, scope: this});
+ this.source.liveData = this.url + qs + '&';
+ this.source.sendRequest('', {success: function(sRequest,
oResponse, oPayload) {
+ this.table.onDataReturnInitializeTable(sRequest,
oResponse, this.paginator);
+ }, scope: this});
}
@@ -664,300 +664,300 @@
}
function formatDate ( format, timestamp ) {
- // http://kevin.vanzonneveld.net
- // + original by: Carlos R. L. Rodrigues (http://www.jsfromhell.com)
- // + parts by: Peter-Paul Koch
(http://www.quirksmode.org/js/beat.html)
- // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
- // + improved by: MeEtc (http://yass.meetcweb.com)
- // + improved by: Brad Touesnard
- // + improved by: Tim Wiel
- // + improved by: Bryan Elliott
- // + improved by: Brett Zamir (http://brett-zamir.me)
- // + improved by: David Randall
- // + input by: Brett Zamir (http://brett-zamir.me)
- // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
- // + improved by: Brett Zamir (http://brett-zamir.me)
- // + improved by: Brett Zamir (http://brett-zamir.me)
- // + derived from: gettimeofday
- // % note 1: Uses global: php_js to store the default timezone
- // * example 1: date('H:m:s \\m \\i\\s \\m\\o\\n\\t\\h', 1062402400);
- // * returns 1: '09:09:40 m is month'
- // * example 2: date('F j, Y, g:i a', 1062462400);
- // * returns 2: 'September 2, 2003, 2:26 am'
- // * example 3: date('Y W o', 1062462400);
- // * returns 3: '2003 36 2003'
- // * example 4: x = date('Y m d', (new Date()).getTime()/1000); //
2009 01 09
- // * example 4: (x+'').length == 10
- // * returns 4: true
+ // http://kevin.vanzonneveld.net
+ // + original by: Carlos R. L. Rodrigues (http://www.jsfromhell.com)
+ // + parts by: Peter-Paul Koch
(http://www.quirksmode.org/js/beat.html)
+ // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
+ // + improved by: MeEtc (http://yass.meetcweb.com)
+ // + improved by: Brad Touesnard
+ // + improved by: Tim Wiel
+ // + improved by: Bryan Elliott
+ // + improved by: Brett Zamir (http://brett-zamir.me)
+ // + improved by: David Randall
+ // + input by: Brett Zamir (http://brett-zamir.me)
+ // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
+ // + improved by: Brett Zamir (http://brett-zamir.me)
+ // + improved by: Brett Zamir (http://brett-zamir.me)
+ // + derived from: gettimeofday
+ // % note 1: Uses global: php_js to store the default
timezone
+ // * example 1: date('H:m:s \\m \\i\\s \\m\\o\\n\\t\\h',
1062402400);
+ // * returns 1: '09:09:40 m is month'
+ // * example 2: date('F j, Y, g:i a', 1062462400);
+ // * returns 2: 'September 2, 2003, 2:26 am'
+ // * example 3: date('Y W o', 1062462400);
+ // * returns 3: '2003 36 2003'
+ // * example 4: x = date('Y m d', (new Date()).getTime()/1000); //
2009 01 09
+ // * example 4: (x+'').length == 10
+ // * returns 4: true
- var jsdate=(
- (typeof(timestamp) == 'undefined') ? new Date() : // Not provided
- (typeof(timestamp) == 'number') ? new Date(timestamp*1000) : // UNIX
timestamp
- new Date(timestamp) // Javascript Date()
- ); // , tal=[]
- var pad = function(n, c){
- if( (n = n + "").length < c ) {
- return new Array(++c - n.length).join("0") + n;
- } else {
- return n;
- }
- };
- var _dst = function (t) {
- // Calculate Daylight Saving Time (derived from gettimeofday() code)
- var dst=0;
- var jan1 = new Date(t.getFullYear(), 0, 1, 0, 0, 0, 0); // jan 1st
- var june1 = new Date(t.getFullYear(), 6, 1, 0, 0, 0, 0); // june 1st
- var temp = jan1.toUTCString();
- var jan2 = new Date(temp.slice(0, temp.lastIndexOf(' ')-1));
- temp = june1.toUTCString();
- var june2 = new Date(temp.slice(0, temp.lastIndexOf(' ')-1));
- var std_time_offset = (jan1 - jan2) / (1000 * 60 * 60);
- var daylight_time_offset = (june1 - june2) / (1000 * 60 * 60);
+ var jsdate=(
+ (typeof(timestamp) == 'undefined') ? new Date() : // Not
provided
+ (typeof(timestamp) == 'number') ? new Date(timestamp*1000) : //
UNIX timestamp
+ new Date(timestamp) // Javascript Date()
+ ); // , tal=[]
+ var pad = function(n, c){
+ if( (n = n + "").length < c ) {
+ return new Array(++c - n.length).join("0") + n;
+ } else {
+ return n;
+ }
+ };
+ var _dst = function (t) {
+ // Calculate Daylight Saving Time (derived from gettimeofday()
code)
+ var dst=0;
+ var jan1 = new Date(t.getFullYear(), 0, 1, 0, 0, 0, 0); // jan
1st
+ var june1 = new Date(t.getFullYear(), 6, 1, 0, 0, 0, 0); //
june 1st
+ var temp = jan1.toUTCString();
+ var jan2 = new Date(temp.slice(0, temp.lastIndexOf(' ')-1));
+ temp = june1.toUTCString();
+ var june2 = new Date(temp.slice(0, temp.lastIndexOf(' ')-1));
+ var std_time_offset = (jan1 - jan2) / (1000 * 60 * 60);
+ var daylight_time_offset = (june1 - june2) / (1000 * 60 * 60);
- if (std_time_offset === daylight_time_offset) {
- dst = 0; // daylight savings time is NOT observed
- }
- else {
- // positive is southern, negative is northern hemisphere
- var hemisphere = std_time_offset - daylight_time_offset;
- if (hemisphere >= 0) {
- std_time_offset = daylight_time_offset;
- }
- dst = 1; // daylight savings time is observed
- }
- return dst;
- };
- var ret = '';
- var txt_weekdays = ["Sunday","Monday","Tuesday","Wednesday",
- "Thursday","Friday","Saturday"];
- var txt_ordin = {1:"st",2:"nd",3:"rd",21:"st",22:"nd",23:"rd",31:"st"};
- var txt_months = ["", "January", "February", "March", "April",
- "May", "June", "July", "August", "September", "October", "November",
- "December"];
+ if (std_time_offset === daylight_time_offset) {
+ dst = 0; // daylight savings time is NOT observed
+ }
+ else {
+ // positive is southern, negative is northern hemisphere
+ var hemisphere = std_time_offset - daylight_time_offset;
+ if (hemisphere >= 0) {
+ std_time_offset = daylight_time_offset;
+ }
+ dst = 1; // daylight savings time is observed
+ }
+ return dst;
+ };
+ var ret = '';
+ var txt_weekdays = ["Sunday","Monday","Tuesday","Wednesday",
+ "Thursday","Friday","Saturday"];
+ var txt_ordin = {1:"st",2:"nd",3:"rd",21:"st",22:"nd",23:"rd",31:"st"};
+ var txt_months = ["", "January", "February", "March", "April",
+ "May", "June", "July", "August", "September", "October",
"November",
+ "December"];
- var f = {
- // Day
- d: function(){
- return pad(f.j(), 2);
- },
- D: function(){
- var t = f.l();
- return t.substr(0,3);
- },
- j: function(){
- return jsdate.getDate();
- },
- l: function(){
- return txt_weekdays[f.w()];
- },
- N: function(){
- return f.w() + 1;
- },
- S: function(){
- return txt_ordin[f.j()] ? txt_ordin[f.j()] : 'th';
- },
- w: function(){
- return jsdate.getDay();
- },
- z: function(){
- return (jsdate - new Date(jsdate.getFullYear() + "/1/1")) /
864e5 >> 0;
- },
+ var f = {
+ // Day
+ d: function(){
+ return pad(f.j(), 2);
+ },
+ D: function(){
+ var t = f.l();
+ return t.substr(0,3);
+ },
+ j: function(){
+ return jsdate.getDate();
+ },
+ l: function(){
+ return txt_weekdays[f.w()];
+ },
+ N: function(){
+ return f.w() + 1;
+ },
+ S: function(){
+ return txt_ordin[f.j()] ? txt_ordin[f.j()] :
'th';
+ },
+ w: function(){
+ return jsdate.getDay();
+ },
+ z: function(){
+ return (jsdate - new Date(jsdate.getFullYear()
+ "/1/1")) / 864e5 >> 0;
+ },
- // Week
- W: function(){
- var a = f.z(), b = 364 + f.L() - a;
- var nd2, nd = (new Date(jsdate.getFullYear() +
"/1/1").getDay() || 7) - 1;
+ // Week
+ W: function(){
+ var a = f.z(), b = 364 + f.L() - a;
+ var nd2, nd = (new Date(jsdate.getFullYear() +
"/1/1").getDay() || 7) - 1;
- if(b <= 2 && ((jsdate.getDay() || 7) - 1) <= 2 - b){
- return 1;
- }
- if(a <= 2 && nd >= 4 && a >= (6 - nd)){
- nd2 = new Date(jsdate.getFullYear() - 1 + "/12/31");
- return date("W", Math.round(nd2.getTime()/1000));
- }
- return (1 + (nd <= 3 ? ((a + nd) / 7) : (a - (7 - nd)) / 7) >>
0);
- },
+ if(b <= 2 && ((jsdate.getDay() || 7) - 1) <= 2
- b){
+ return 1;
+ }
+ if(a <= 2 && nd >= 4 && a >= (6 - nd)){
+ nd2 = new Date(jsdate.getFullYear() - 1
+ "/12/31");
+ return date("W",
Math.round(nd2.getTime()/1000));
+ }
+ return (1 + (nd <= 3 ? ((a + nd) / 7) : (a - (7
- nd)) / 7) >> 0);
+ },
- // Month
- F: function(){
- return txt_months[f.n()];
- },
- m: function(){
- return pad(f.n(), 2);
- },
- M: function(){
- var t = f.F();
- return t.substr(0,3);
- },
- n: function(){
- return jsdate.getMonth() + 1;
- },
- t: function(){
- var n;
- if( (n = jsdate.getMonth() + 1) == 2 ){
- return 28 + f.L();
- }
- if( n & 1 && n < 8 || !(n & 1) && n > 7 ){
@@ Diff output truncated at 153600 characters. @@
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [8265] controller: alter from equipment to the more generic componant, add home-hook, some conversion of space to tabs,
Sigurd Nes <=