fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [8792]


From: Erik Holm-Larsen
Subject: [Fmsystem-commits] [8792]
Date: Mon, 06 Feb 2012 10:59:16 +0000

Revision: 8792
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8792
Author:   erikhl
Date:     2012-02-06 10:59:16 +0000 (Mon, 06 Feb 2012)
Log Message:
-----------


Modified Paths:
--------------
    trunk/controller/inc/class.menu.inc.php
    trunk/controller/inc/class.socontrol_group.inc.php
    trunk/controller/inc/class.uicontrol_group.inc.php
    trunk/controller/inc/class.uicontrol_location.inc.php
    trunk/controller/js/controller/ajax.js
    trunk/controller/setup/phpgw_no.lang
    trunk/controller/templates/base/add_component_to_control.xsl
    trunk/controller/templates/base/css/base.css

Added Paths:
-----------
    trunk/controller/templates/base/control_group_component_tabs.xsl
    trunk/controller/templates/base/view_component_for_control_group.xsl

Modified: trunk/controller/inc/class.menu.inc.php
===================================================================
--- trunk/controller/inc/class.menu.inc.php     2012-02-06 08:37:18 UTC (rev 
8791)
+++ trunk/controller/inc/class.menu.inc.php     2012-02-06 10:59:16 UTC (rev 
8792)
@@ -2,7 +2,7 @@
        /**
        * phpGroupWare - controller: a part of a Facilities Management System.
        *
-       * @author Erink Holm-Larsen <address@hidden>
+       * @author Erik Holm-Larsen <address@hidden>
        * @author Torstein Vadla <address@hidden>
        * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc. 
http://www.fsf.org/
        * This file is part of phpGroupWare.
@@ -88,7 +88,15 @@
                                        (
                                                'text'  => 
lang('Control_group'),
                                                'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'controller.uicontrol_group.index') ),
-                                               'image' => array('property', 
'location_1')
+                                               'image' => array('property', 
'location_1'),
+                                               'children' => array(
+                                                                               
        'component_for_control_group' => array
+                                                                               
        (
+                                                                               
                'text'  => lang('component'),
+                                                                               
                'url'   => $GLOBALS['phpgw']->link('/index.php', 
array('menuaction'=> 'controller.uicontrol_group_component.index') ),
+                                                                               
                'image' => array('property', 'entity_1')
+                                                                               
        )
+                                                                               
)
                                        ),
                                        'procedure' => array
                                        (

Modified: trunk/controller/inc/class.socontrol_group.inc.php
===================================================================
--- trunk/controller/inc/class.socontrol_group.inc.php  2012-02-06 08:37:18 UTC 
(rev 8791)
+++ trunk/controller/inc/class.socontrol_group.inc.php  2012-02-06 10:59:16 UTC 
(rev 8792)
@@ -346,4 +346,76 @@
                        //var_dump($control_group);
                        return $control_group;
                }
+               
+               function get_control_groups_by_control_area($control_area_id)
+               {
+                       $controls_array = array();
+
+                       $sql = "SELECT * FROM controller_control_group WHERE 
control_area_id=$control_area_id";
+                       $this->db->query($sql);
+
+                       while($this->db->next_record()) {
+                               $control_group = new 
controller_control_group((int) $this->db->f('id'));
+
+                               
$control_group->set_group_name($this->unmarshal($this->db->f('group_name'), 
'string'));
+                               
$control_group->set_procedure_id($this->unmarshal($this->db->f('procedure_id'), 
'int'));
+                               
$control_group->set_procedure_name($this->unmarshal($this->db->f('procedure_title'),
 'string'));
+                               
$control_group->set_control_area_id($this->unmarshal($this->db->f('control_area_id'),
 'int'));
+                               $category = 
execMethod('phpgwapi.categories.return_single', 
$this->unmarshal($this->db->f('control_area_id', 'int')));
+                               
$control_group->set_control_area_name($category[0]['name']);
+                               
//$control_group->set_control_area_name($this->unmarshal($this->db->f('control_area_name'),
 'string'));
+                               
$control_group->set_building_part_id($this->unmarshal($this->db->f('building_part_id'),
 'int'));
+                               
$control_group->set_building_part_descr($this->unmarshal($this->db->f('building_part_descr'),
 'string'));
+
+                               $control_groups_array[] = 
$control_group->toArray();
+                       }
+
+                       if( count( $control_groups_array ) > 0 ){
+                               return $control_groups_array; 
+                       }
+                       else
+                       {
+                               return null;
+                       }
+               }
+               
+               public function get_control_group_component($noOfObjects = 
null, $bim_type = null)
+               {
+                       $filters = array();
+                       if($noOfObjects != null && is_numeric($noOfObjects))
+                       {
+                               $limit = "LIMIT {$noOfObjects}";
+                       }
+                       else
+                       {
+                               $limit = "LIMIT 10";
+                       }
+
+                       $joins = " {$this->left_join} controller_control_group 
ON (controller_control_group_component_list.control_group_id = 
controller_control_group.id)";
+                       $joins .= " {$this->left_join} fm_bim_item ON 
(controller_control_group_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 controller_control_group.id AS 
control_group_id, controller_control_group.group_name AS control_group_name, 
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_group_component_list {$joins} {$limit}";
+                       $controlGroupArray = array();
+                       //var_dump($sql);
+                       $this->db->query($sql, __LINE__, __FILE__);
+                       $i=1;
+                       while($this->db->next_record())
+                       {
+                               $controlGroupArray[$i]['id'] = 
$this->db->f('control_group_id');
+                               $controlGroupArray[$i]['title'] = 
$this->db->f('control_group_name');
+                               $controlGroupArray[$i]['bim_id'] = 
$this->db->f('bim_id');
+                               $controlGroupArray[$i]['bim_item_guid'] = 
$this->db->f('bim_item_guid');
+                               $controlGroupArray[$i]['bim_type'] = 
$this->db->f('type_name');
+                               $i++;
+                       }
+
+                       return $controlGroupArray;
+               }
+               
+               function add_component_to_control_group($control_group_id, 
$component_id)
+               {
+                       $sql =  "INSERT INTO 
controller_control_group_component_list (control_group_id, component_id) 
values($control_group_id, $component_id)";
+                       $this->db->query($sql);
+               }
        }

Modified: trunk/controller/inc/class.uicontrol_group.inc.php
===================================================================
--- trunk/controller/inc/class.uicontrol_group.inc.php  2012-02-06 08:37:18 UTC 
(rev 8791)
+++ trunk/controller/inc/class.uicontrol_group.inc.php  2012-02-06 10:59:16 UTC 
(rev 8792)
@@ -54,7 +54,8 @@
                        'edit'  =>      true,
                        'view'  =>      true,
                        'add'   =>      true,
-                       'save_group_order'      =>      true
+                       'save_group_order'      =>      true,
+                       'get_control_groups_by_control_area' => true
                );
 
                public function __construct()
@@ -708,5 +709,17 @@
                        }
                }
 
+               // Returns control group list info as JSON
+               public function get_control_groups_by_control_area()
+               {
+                       $control_area_id = phpgw::get_var('control_area_id');
+                       
+                       $control_groups_array = 
$this->so->get_control_groups_by_control_area($control_area_id);
+                       
+                       if(count($control_groups_array)>0)
+                               return json_encode( $control_groups_array );
+                       else
+                               return null;
+               }
 
        }

Modified: trunk/controller/inc/class.uicontrol_location.inc.php
===================================================================
--- trunk/controller/inc/class.uicontrol_location.inc.php       2012-02-06 
08:37:18 UTC (rev 8791)
+++ trunk/controller/inc/class.uicontrol_location.inc.php       2012-02-06 
10:59:16 UTC (rev 8792)
@@ -182,129 +182,174 @@
                
                function register_control_to_location()
                {
-                       if(phpgw::get_var('phpgw_return_as') == 'json') {
-                               return $this->query();
+                       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');
+                               //$location_code = 
phpgw::get_var('location_code');
+                               
+                               $control_location  = null;
+                               $control_location_id = 0;
+                               
+                               foreach($items_checked as $location_code)
+                               {
+                                       $control_location = 
$this->so_control->get_control_location($control_id, $location_code[0]);
+                                       
+                                       if($control_location == null )
+                                       {                                       
+                                               $control_location_id = 
$this->so_control->register_control_to_location($control_id, $location_code[0]);
+                                       }
+                               }
+                               
+                               if($control_location_id > 0)
+                                       return json_encode( array( "status" => 
"saved" ) );
+                               else
+                                       return json_encode( array( "status" => 
"not_saved" ) );
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'controller.uicheck_list_for_component.index'));
+
                        }
-                       $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
+                       else
+                       {
+                               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);
+                               
+                               // Sigurd: START as categories
+                               $cats   = CreateObject('phpgwapi.categories', 
-1, 'controller', '.control');
+                               $cats->supress_info     = true;
+                               
+                               $control_areas = 
$cats->formatted_xslt_list(array('format'=>'filter','globals' => true,'use_acl' 
=> $this->_category_acl));
+                                                               
+                               $control_areas_array2 = array();
+                               foreach($control_areas['cat_list'] as $cat_list)
+                               {
+                                       $control_areas_array2[] = array
                                        (
-                                               '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);
-                       
-                       // Sigurd: START as categories
-                       $cats   = CreateObject('phpgwapi.categories', -1, 
'controller', '.control');
-                       $cats->supress_info     = true;
-                       
-                       $control_areas = 
$cats->formatted_xslt_list(array('format'=>'filter','globals' => true,'use_acl' 
=> $this->_category_acl));
-                                                       
-                       $control_areas_array2 = array();
-                       foreach($control_areas['cat_list'] as $cat_list)
-                       {
-                               $control_areas_array2[] = array
-                               (
-                                       'id'    => $cat_list['cat_id'],
-                                       'name'  => $cat_list['name'],
-                               );              
-                       }
-                       // END as categories
-                       
-                       
-                       $tabs = array( array(
-                                               'label' => 
lang('View_locations_for_control'),
-                                               'link'  => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'controller.uicontrol_location.index'))
-                       
-                                       ), array(
-                                               'label' => 
lang('Add_locations_for_control')
-                                       ));
-                                       
-                       $data = array(
-                               'tabs'                                          
=> $GLOBALS['phpgw']->common->create_tabs($tabs, 1),
-                               'view'                                          
=> "register_control_to_location",
-                               'control_filters'                       => 
array(
-                                       'control_areas_array2'  => 
$control_areas_array2,
-                                       'control_array'                         
=> $control_array
-                               ),
-                               'filter_form'                           => 
array(
-                                       'building_types'                        
=> $building_types,
-                                       'category_types'                        
=> $category_types,
-                                       'district_list'                         
=> $district_list,
-                                       'part_of_town_list'             => 
$part_of_town_list
-                               ),
-                               'datatable' => array(
-                                       'source' => 
self::link(array('menuaction' => 'controller.uicontrol_location.index', 
'phpgw_return_as' => 'json', 'view_type' => 'register_control')),
-                                       'field' => array(
-                                               array(
-                                                       'key' => 
'location_code',
-                                                       'label' => 
lang('Property'),
-                                                       'sortable'      => true,
-                                                       'formatter' => 
'YAHOO.portico.formatLink'
-                                               ),
-                                               array(
-                                                       'key'   =>      
'loc1_name',
-                                                       'label' =>      
lang('Property name'),
-                                                       'sortable'      =>      
false
-                                               ),
-                                               array(
-                                                       'key' => 'adresse1',
-                                                       'label' => 
lang('Address'),
-                                                       'sortable'      => false
-                                               ),
-                                               array(
-                                                       'key' => 'postnummer',
-                                                       'label' => lang('Zip 
code'),
-                                                       'sortable'      => false
-                                               ),
-                                               array(
-                                                       'key' => 'actions',
-                                                       'hidden' => true
-                                               ),
-                                               array(
-                                                       'key' => 'labels',
-                                                       'hidden' => true
-                                               ),
-                                               array(
-                                                       'key' => 'ajax',
-                                                       'hidden' => true
-                                               ),array(
-                                                       'key' => 'parameters',
-                                                       'hidden' => true
-                                               )                               
                
+                                               'id'    => $cat_list['cat_id'],
+                                               'name'  => $cat_list['name'],
+                                       );              
+                               }
+                               // END as categories
+                               
+                               
+                               $tabs = array( array(
+                                                       'label' => 
lang('View_locations_for_control'),
+                                                       'link'  => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'controller.uicontrol_location.index'))
+                               
+                                               ), array(
+                                                       'label' => 
lang('Add_locations_for_control')
+                                               ));
+                                               
+                               $data = array(
+                                       'tabs'                                  
        => $GLOBALS['phpgw']->common->create_tabs($tabs, 1),
+                                       'view'                                  
        => "register_control_to_location",
+                                       'control_filters'                       
=> array(
+                                               'control_areas_array2'  => 
$control_areas_array2,
+                                               'control_array'                 
        => $control_array
+                                       ),
+                                       'filter_form'                           
=> array(
+                                               'building_types'                
        => $building_types,
+                                               'category_types'                
        => $category_types,
+                                               'district_list'                 
        => $district_list,
+                                               'part_of_town_list'             
=> $part_of_town_list
+                                       ),
+                                       'datatable' => array(
+                                               'source' => 
self::link(array('menuaction' => 'controller.uicontrol_location.index', 
'phpgw_return_as' => 'json', 'view_type' => 'register_control')),
+                                               'field' => array(
+                                                       array(
+                                                               'key' => 
'location_code',
+                                                               'label' => 
lang('Property'),
+                                                               'sortable'      
=> true,
+                                                               'formatter' => 
'YAHOO.portico.formatLink'
+                                                       ),
+                                                       array(
+                                                               'key'   =>      
'loc1_name',
+                                                               'label' =>      
lang('Property name'),
+                                                               'sortable'      
=>      false
+                                                       ),
+                                                       array(
+                                                               'key' => 
'adresse1',
+                                                               'label' => 
lang('Address'),
+                                                               'sortable'      
=> false
+                                                       ),
+                                                       array(
+                                                               'key' => 
'postnummer',
+                                                               'label' => 
lang('Zip code'),
+                                                               'sortable'      
=> false
+                                                       ),
+                                                       array(
+                                                                       'key' 
=> '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
+                                                       ),array(
+                                                               'key' => 
'parameters',
+                                                               'hidden' => true
+                                                       )                       
                        
+                                               )
                                        )
-                               )
-                       );
-                       
-                       phpgwapi_yui::load_widget('paginator');
-                       
-                       self::add_javascript('controller', 'yahoo', 
'control_tabs.js');
-                       self::add_javascript('controller', 'controller', 
'jquery.js');
-                       self::add_javascript('controller', 'controller', 
'ajax.js');
-
-                       
self::render_template_xsl(array('control_location/control_location_tabs', 
'control_location/register_control_to_location', 'common'), $data);           
+                               );
+                               
+                               phpgwapi_yui::load_widget('paginator');
+                               
+                               self::add_javascript('controller', 'yahoo', 
'control_tabs.js');
+                               self::add_javascript('controller', 
'controller', 'jquery.js');
+                               self::add_javascript('controller', 
'controller', 'ajax.js');
+       
+                               
self::render_template_xsl(array('control_location/control_location_tabs', 
'control_location/register_control_to_location', 'common'), $data);
+                       }               
                }
                
                // Returns locations for a control
@@ -360,7 +405,7 @@
                        $results['sort'] = 'location_code';
                        $results['dir'] = "ASC";
                                                
-                       array_walk($results['results'], array($this, 
'add_actions'), array($type));
+                       array_walk($results['results'], array($this, 
'add_links'), array($type));
                                                        
                        return $this->yui_results($results);
                }
@@ -394,10 +439,11 @@
                        $value['actions'] = array();
                        $value['labels'] = array();
                        $value['parameters'] = array();
-                       
+/*                     
                        $value['ajax'][] = true;
                        $value['actions'][] = 
html_entity_decode(self::link(array('menuaction' => 
'controller.uicontrol_location.register_control_to_location_2','location_code' 
=> $value['location_code'], 'phpgw_return_as' => 'json')));
                        $value['labels'][] = lang('add_location');
                        $value['parameters'][] = "control_id";
+                       */
                }
        }

Modified: trunk/controller/js/controller/ajax.js
===================================================================
--- trunk/controller/js/controller/ajax.js      2012-02-06 08:37:18 UTC (rev 
8791)
+++ trunk/controller/js/controller/ajax.js      2012-02-06 10:59:16 UTC (rev 
8792)
@@ -38,15 +38,47 @@
                                                  htmlString  += "<option 
value='" + obj[i].id + "'>" + obj[i].title + "</option>";
                                        });
                                                                                
                          
-                                         $("#control_id").innerHTML( 
htmlString );
+                                         $("#control_id").html( htmlString );
                                        }else {
                                        htmlString  += "<option>Ingen 
kontroller</option>"
-                                       $("#control_id").innerHTML( htmlString 
);
+                                       $("#control_id").html( htmlString );
                                }
                          }  
                        });
                        
     });
+
+       // file: uicheck_list.xsl
+       // When control area is selected, controls are fetched from db and 
control select list is populated
+       $("#control_group_area_list option").click(function () {
+                var control_area_id = $(this).val();
+                
+         var requestUrl = 
"index.php?menuaction=controller.uicontrol_group.get_control_groups_by_control_area&phpgw_return_as=json"
+         
+         var htmlString = "";
+         
+         $.ajax({
+                         type: 'POST',
+                         dataType: 'json',
+                         url: requestUrl + "&control_area_id=" + 
control_area_id,
+                         success: function(data) {
+                                 if( data != null){
+                                         var obj = jQuery.parseJSON(data);
+                                               
+                                         $.each(obj, function(i) {
+                                                 htmlString  += "<option 
value='" + obj[i].id + "'>" + obj[i].group_name + "</option>";
+                                       });
+                                                                               
                          
+                                         $("#control_group_id").html( 
htmlString );
+                                       }else {
+                                       htmlString  += "<option>Ingen 
kontrollgrupper</option>"
+                                       $("#control_group_id").html( htmlString 
);
+                               }
+                         }  
+                       });
+                       
+    });
+
        
        // 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

Modified: trunk/controller/setup/phpgw_no.lang
===================================================================
--- trunk/controller/setup/phpgw_no.lang        2012-02-06 08:37:18 UTC (rev 
8791)
+++ trunk/controller/setup/phpgw_no.lang        2012-02-06 10:59:16 UTC (rev 
8792)
@@ -311,4 +311,7 @@
 Document title controller      no      Dokumentets tittel
 Document name  controller      no      Filnavn
 Document description   controller      no      Beskrivelse
-select value   controller      no      Velg
\ No newline at end of file
+select value   controller      no      Velg
+component_for_control_group    controller      no      Utstyr tilknyttet 
kontrollgrupper
+View_component_for_control_group       controller      no      Vis knytning 
mot utstyr
+Add_component_for_control_group        controller      no      Legg til 
knytning mot utstyr
\ No newline at end of file

Modified: trunk/controller/templates/base/add_component_to_control.xsl
===================================================================
--- trunk/controller/templates/base/add_component_to_control.xsl        
2012-02-06 08:37:18 UTC (rev 8791)
+++ trunk/controller/templates/base/add_component_to_control.xsl        
2012-02-06 10:59:16 UTC (rev 8792)
@@ -32,7 +32,7 @@
        </div>
 </xsl:template>
 
-<xsl:template match="control_filters" name="control_filters">
+<xsl:template match="control_filters" name="control_filters" 
xmlns:php="http://php.net/xsl";>
        <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.
@@ -68,7 +68,7 @@
        </div>
 </xsl:template>
 
-<xsl:template match="filter_form">
+<xsl:template match="filter_form" xmlns:php="http://php.net/xsl";>
        <form id="queryForm">
                <xsl:attribute name="method">
                        <xsl:value-of select="phpgw:conditional(not(method), 
'GET', method)"/>
@@ -128,7 +128,7 @@
        </div>
 </xsl:template>
 
-<xsl:template match="datatable">
+<xsl:template match="datatable" xmlns:php="http://php.net/xsl";>
        <script type="text/javascript">
        <![CDATA[
        function checkAll(myclass)
@@ -209,7 +209,7 @@
 </xsl:template>
 
 
-<xsl:template name="datasource-definition">
+<xsl:template name="datasource-definition" xmlns:php="http://php.net/xsl";>
        <script>
                YAHOO.namespace('controller');
         

Added: trunk/controller/templates/base/control_group_component_tabs.xsl
===================================================================
--- trunk/controller/templates/base/control_group_component_tabs.xsl            
                (rev 0)
+++ trunk/controller/templates/base/control_group_component_tabs.xsl    
2012-02-06 10:59:16 UTC (rev 8792)
@@ -0,0 +1,27 @@
+<!-- $Id: control_component_tabs.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
+<!-- separate tabs and  inline tables-->
+
+<xsl:template match="data" xmlns:php="http://php.net/xsl";>
+<div class="yui-navset yui-navset-top" id="control_group_component_tabview">
+       <xsl:choose>
+               <xsl:when test="view = 'view_component_for_control_group'">
+                       <div class="identifier-header">
+                               <h1><xsl:value-of select="php:function('lang', 
'component_for_control_group')"/></h1>
+                       </div>
+                       <!-- Prints tabs array -->
+                       <xsl:value-of disable-output-escaping="yes" 
select="tabs" />
+                        
+                       <xsl:call-template 
name="view_component_for_control_group" />
+               </xsl:when>
+               <xsl:when test="view = 'add_component_to_control_group'">
+                       <div class="identifier-header">
+                               <h1><xsl:value-of select="php:function('lang', 
'Add_component_for_control_group')"/></h1>
+                       </div>
+                       <!-- Prints tabs array -->
+                       <xsl:value-of disable-output-escaping="yes" 
select="tabs" />
+                       <xsl:call-template 
name="add_component_to_control_group" />
+               </xsl:when>
+       </xsl:choose>
+</div>
+       
+</xsl:template>


Property changes on: 
trunk/controller/templates/base/control_group_component_tabs.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Modified: trunk/controller/templates/base/css/base.css
===================================================================
--- trunk/controller/templates/base/css/base.css        2012-02-06 08:37:18 UTC 
(rev 8791)
+++ trunk/controller/templates/base/css/base.css        2012-02-06 10:59:16 UTC 
(rev 8792)
@@ -702,7 +702,7 @@
 }
 
 .check_list li.heading {
-    background: url("/pe/phpgwapi/js/yahoo/assets/skins/sam/sprite.png") 
repeat-x scroll 0 0 #D8D8D8;
+    background: 
url("../../../../phpgwapi/js/yahoo/assets/skins/sam/sprite.png") repeat-x 
scroll 0 0 #D8D8D8;
     height: 20px;
     padding-left: 25px;
 }
@@ -1278,4 +1278,9 @@
 
 input.focus, select.focus{
        border: 2px solid #dae6f4;
-}
\ No newline at end of file
+}
+
+div.controller_checklist {
+       padding: 20px;
+       border: 1px solid #ABABAB;
+}

Added: trunk/controller/templates/base/view_component_for_control_group.xsl
===================================================================
--- trunk/controller/templates/base/view_component_for_control_group.xsl        
                        (rev 0)
+++ trunk/controller/templates/base/view_component_for_control_group.xsl        
2012-02-06 10:59:16 UTC (rev 8792)
@@ -0,0 +1,125 @@
+<!-- $Id$ -->
+<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="view_component_for_control_group">
+       <!-- IMPORTANT!!! Loads YUI javascript -->
+       <xsl:call-template name="common"/>
+
+       <div class="yui-content">
+               <div id="control_details">
+                       <div style="margin: 10px;padding: 10px; width: 25%;">
+                               
+                               <!-- When control area is chosen, an ajax 
request is executed. 
+                                        The operation fetches controls groups 
from db and populates the control group list.
+                                        The ajax operation is handled in 
ajax.js 
+                                --> 
+                                <select style="float:left;" 
id="control_group_area_list" name="control_group_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="name"/>
+                                               </option>                       
+                                       </xsl:for-each>
+                                </select>
+                                
+                                <form id="loc_form" action="" method="GET">
+                       
+                                       <select id="control_group_id" 
name="control_group_id">
+                                       <xsl:choose>
+                                               <xsl:when 
test="control_group_array/child::node()">
+                                                       <xsl:for-each 
select="control_group_array">
+                                                               <xsl:variable 
name="control_group_id"><xsl:value-of select="id"/></xsl:variable>
+                                                               <option 
value="{$control_group_id}">
+                                                                       
<xsl:value-of select="group_name"/>
+                                                               </option>       
                        
+                                                       </xsl:for-each>
+                                               </xsl:when>
+                                               <xsl:otherwise>
+                                                       <option>
+                                                               Ingen 
kontrollgrupper
+                                                       </option>
+                                               </xsl:otherwise>
+                                       </xsl:choose>
+                                               
+                                       </select>
+                               </form>
+                       </div>
+                       
+                       <div id="addedProperties">
+                               <ul id="locations_for_control_group" 
name="locations_for_control_group">
+                                       <xsl:for-each 
select="locations_for_control">
+                                               <li>
+                                                       <div><xsl:value-of 
select="id"/></div>
+                                                       <div><xsl:value-of 
select="title"/></div>
+                                                       <div><xsl:value-of 
select="location_code"/></div>
+                                               </li>                   
+                                       </xsl:for-each>
+                               </ul>
+                       </div>
+                       
+                       <iframe id="yui-history-iframe" 
src="phpgwapi/js/yahoo/history/assets/blank.html" 
style="position:absolute;top:0; left:0;width:1px; 
height:1px;visibility:hidden;"></iframe>
+                       <input id="yui-history-field" type="hidden"/>
+                       
+                       <xsl:apply-templates select="locations_table"/>
+                       <xsl:call-template name="yui_booking_i18n"/>
+               </div>
+       </div>
+</xsl:template>
+
+<xsl:template match="locations_table" xmlns:php="http://php.net/xsl";>
+       
+       <div id="loc_paginator"/>
+       <div style="margin:20px;" id="locations-container"/>
+       <xsl:call-template name="locations-definition" />
+</xsl:template>
+
+<xsl:template name="locations-definition">
+       <script>
+        
+               YAHOO.controller.columnDefs = [
+                               <xsl:for-each select="//locations_table/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 loc_source = '<xsl:value-of select="source"/>';
+               var loc_columnDefs = YAHOO.controller.columnDefs;
+               var loc_form = 'loc_form';
+               var loc_filters = ['control_id'];
+               var loc_container = 'locations-container';
+               var loc_table_id = 'locations_table';
+               var loc_data_table_pag = 'loc_paginator';
+       
+               setDataSource(loc_source, loc_columnDefs, loc_form, 
loc_filters, loc_container, loc_data_table_pag, loc_table_id, null, null, 
null); 
+               
+       </script>
+        
+</xsl:template>


Property changes on: 
trunk/controller/templates/base/view_component_for_control_group.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain




reply via email to

[Prev in Thread] Current Thread [Next in Thread]