fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [8823] Added control_item_type to new/show/edit of co


From: Erik Holm-Larsen
Subject: [Fmsystem-commits] [8823] Added control_item_type to new/show/edit of control_item
Date: Thu, 09 Feb 2012 13:29:56 +0000

Revision: 8823
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8823
Author:   erikhl
Date:     2012-02-09 13:29:56 +0000 (Thu, 09 Feb 2012)
Log Message:
-----------
Added control_item_type to new/show/edit of control_item

Modified Paths:
--------------
    trunk/controller/inc/class.socontrol_item.inc.php
    trunk/controller/inc/class.uicontrol_item.inc.php
    trunk/controller/setup/setup.inc.php
    trunk/controller/templates/base/control_item/control_item.xsl

Modified: trunk/controller/inc/class.socontrol_item.inc.php
===================================================================
--- trunk/controller/inc/class.socontrol_item.inc.php   2012-02-09 12:54:55 UTC 
(rev 8822)
+++ trunk/controller/inc/class.socontrol_item.inc.php   2012-02-09 13:29:56 UTC 
(rev 8823)
@@ -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.
@@ -60,6 +60,7 @@
                        $cols = array(
                                        'title',
                                        'required',
+                                       'type',
                                        'what_to_do',
                                        'how_to_do',
                                        'control_group_id'
@@ -68,6 +69,7 @@
                        $values = array(
                                $this->marshal($control_item->get_title(), 
'string'),
                                $this->marshal(($control_item->get_required() ? 
'true' : 'false'), 'bool'),
+                               $this->marshal($control_item->get_type(), 
'string'),
                                $this->marshal($control_item->get_what_to_do(), 
'string'),
                                $this->marshal($control_item->get_how_to_do(), 
'string'),
                                
$this->marshal($control_item->get_control_group_id(), 'int')
@@ -102,6 +104,7 @@
                        $values = array(
                                'title = ' . 
$this->marshal($control_item->get_title(), 'string'),
                                'required = ' . 
$this->marshal(($control_item->get_required() ? 'true' : 'false'), 'bool'),
+                               'type = ' . 
$this->marshal($control_item->get_type(), 'string'),
                                'what_to_do = ' . 
$this->marshal($control_item->get_what_to_do(), 'string'),
                                'how_to_do = ' . 
$this->marshal($control_item->get_how_to_do(), 'string'),
                                'control_group_id = ' . 
$this->marshal($control_item->get_control_group_id(), 'int')
@@ -168,6 +171,7 @@
                                $control_item = new 
controller_control_item($this->unmarshal($this->db->f('id', true), 'int'));
                                
$control_item->set_title($this->unmarshal($this->db->f('title', true), 
'string'));
                                
$control_item->set_required($this->unmarshal($this->db->f('required', true), 
'boolean'));
+                               
$control_item->set_type($this->unmarshal($this->db->f('type', true), 'string'));
                                
$control_item->set_what_to_do($this->unmarshal($this->db->f('what_to_do', 
true), 'string'));
                                
$control_item->set_how_to_do($this->unmarshal($this->db->f('how_to_do', true), 
'string'));
                                
$control_item->set_control_group_id($this->unmarshal($this->db->f('control_group_id',
 true), 'int'));
@@ -259,7 +263,7 @@
                        }
                        else
                        {
-                               $cols = 'controller_control_item.id, 
controller_control_item.title, required, what_to_do, how_to_do, 
controller_control_item.control_area_id, 
controller_control_item.control_group_id, controller_control_group.group_name 
AS control_group_name';
+                               $cols = 'controller_control_item.id, 
controller_control_item.title, required, what_to_do, how_to_do, 
controller_control_item.control_area_id, controller_control_item.type, 
controller_control_item.control_group_id, controller_control_group.group_name 
AS control_group_name';
                        }
 
                        $dir = $ascending ? 'ASC' : 'DESC';
@@ -291,6 +295,7 @@
                                $category = 
execMethod('phpgwapi.categories.return_single', 
$this->unmarshal($this->db->f('control_area_id', true), 'int'));
                                
$control_item->set_control_area_name($category[0]['name']);
                                
$control_item->set_control_group_name($this->unmarshal($this->db->f('control_group_name',
 true), 'string'));
+                               
$control_item->set_type($this->unmarshal($this->db->f('type', true), 'string'));
                        }
 
                        return $control_item;

Modified: trunk/controller/inc/class.uicontrol_item.inc.php
===================================================================
--- trunk/controller/inc/class.uicontrol_item.inc.php   2012-02-09 12:54:55 UTC 
(rev 8822)
+++ trunk/controller/inc/class.uicontrol_item.inc.php   2012-02-09 13:29:56 UTC 
(rev 8823)
@@ -272,6 +272,7 @@
                                {
                                        
$control_item->set_title(phpgw::get_var('title'));
                                        
$control_item->set_required(phpgw::get_var('required') == 'on' ? true : false);
+                                       
$control_item->set_type(phpgw::get_var('measurement') == 'on' ? 
'control_item_type_2' : 'control_item_type_1');
                                        $control_item->set_what_to_do( 
phpgw::get_var('what_to_do','html') );
                                        $control_item->set_how_to_do( 
phpgw::get_var('how_to_do','html') );
                                        $control_item->set_control_group_id( 
phpgw::get_var('control_group_id') );

Modified: trunk/controller/setup/setup.inc.php
===================================================================
--- trunk/controller/setup/setup.inc.php        2012-02-09 12:54:55 UTC (rev 
8822)
+++ trunk/controller/setup/setup.inc.php        2012-02-09 13:29:56 UTC (rev 
8823)
@@ -49,6 +49,7 @@
                'controller_control_group_list',
                'controller_control_location_list',
                'controller_control_component_list',
+               'controller_control_group_component_list',
                'controller_document',
                'controller_document_types',
                'controller_check_item_case',

Modified: trunk/controller/templates/base/control_item/control_item.xsl
===================================================================
--- trunk/controller/templates/base/control_item/control_item.xsl       
2012-02-09 12:54:55 UTC (rev 8822)
+++ trunk/controller/templates/base/control_item/control_item.xsl       
2012-02-09 13:29:56 UTC (rev 8823)
@@ -66,6 +66,34 @@
                                        </xsl:choose>
                                        </dd>
                                        <dt>
+                                               <label 
for="required">Måling</label>
+                                       </dt>
+                                       <dd>
+                                       <xsl:variable 
name="measurement_item"><xsl:value-of select="control_item/type" 
/></xsl:variable>
+                                       <xsl:choose>
+                                               <xsl:when test="editable">
+                                                       <xsl:choose>
+                                                               <xsl:when 
test="$measurement_item='control_item_type_2'">
+                                                                       <input 
type="checkbox" name="measurement" id="measurement" checked="true"/>
+                                                               </xsl:when>
+                                                               <xsl:otherwise>
+                                                                       <input 
type="checkbox" name="measurement" id="measurement"/>
+                                                               </xsl:otherwise>
+                                                       </xsl:choose>
+                                               </xsl:when>
+                                               <xsl:otherwise>
+                                                       <xsl:choose>
+                                                               <xsl:when 
test="$measurement_item='control_item_type_2'">
+                                                                       <input 
type="checkbox" name="measurement" id="measurement" checked="true" 
disabled="true"/>
+                                                               </xsl:when>
+                                                               <xsl:otherwise>
+                                                                       <input 
type="checkbox" name="measurement" id="measurement" disabled="true" />
+                                                               </xsl:otherwise>
+                                                       </xsl:choose>
+                                               </xsl:otherwise>
+                                       </xsl:choose>
+                                       </dd>
+                                       <dt>
                                                <label for="what_to_do">Hva 
skal utføres</label>
                                        </dt>
                                        <dd>




reply via email to

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