fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [17401] controlle: add checkbox as control_item_type


From: sigurdne
Subject: [Fmsystem-commits] [17401] controlle: add checkbox as control_item_type
Date: Wed, 6 Dec 2017 06:52:49 -0500 (EST)

Revision: 17401
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=17401
Author:   sigurdne
Date:     2017-12-06 06:52:48 -0500 (Wed, 06 Dec 2017)
Log Message:
-----------
controlle: add checkbox as control_item_type

Modified Paths:
--------------
    trunk/controller/inc/class.uicontrol_item.inc.php
    trunk/controller/inc/model/class.control_item.inc.php
    trunk/controller/js/controller/ajax.js
    trunk/controller/setup/phpgw_no.lang
    trunk/controller/templates/mobilefrontend/case/add_case.xsl

Modified: trunk/controller/inc/class.uicontrol_item.inc.php
===================================================================
--- trunk/controller/inc/class.uicontrol_item.inc.php   2017-12-05 19:55:49 UTC 
(rev 17400)
+++ trunk/controller/inc/class.uicontrol_item.inc.php   2017-12-06 11:52:48 UTC 
(rev 17401)
@@ -346,7 +346,7 @@
                                
$control_item->set_options_array($option_values_array);
 
                                // Add new control item option values
-                               if (($transaction_status) & 
($saved_control_item_id > 0) & ($control_item->get_type() == 
'control_item_type_3' | $control_item->get_type() == 'control_item_type_4'))
+                               if (($transaction_status) & 
($saved_control_item_id > 0) & ($control_item->get_type() == 
'control_item_type_3' | $control_item->get_type() == 'control_item_type_4' | 
$control_item->get_type() == 'control_item_type_5'))
                                {
                                        $control_item_options_array = 
$control_item->get_options_array();
 

Modified: trunk/controller/inc/model/class.control_item.inc.php
===================================================================
--- trunk/controller/inc/model/class.control_item.inc.php       2017-12-05 
19:55:49 UTC (rev 17400)
+++ trunk/controller/inc/model/class.control_item.inc.php       2017-12-06 
11:52:48 UTC (rev 17401)
@@ -33,8 +33,14 @@
        {
 
                public static $so;
-               public $type_array = array("control_item_type_1", 
"control_item_type_2", "control_item_type_3",
-                       "control_item_type_4");
+               public $type_array = array(
+                       "control_item_type_1", // Comment
+                       "control_item_type_2", // Measurement
+                       "control_item_type_3", // Listbox
+                       "control_item_type_4", // Radiobuttons
+                       "control_item_type_5", // Checkbox
+                       );
+
                protected $id;
                protected $title;
                protected $required;

Modified: trunk/controller/js/controller/ajax.js
===================================================================
--- trunk/controller/js/controller/ajax.js      2017-12-05 19:55:49 UTC (rev 
17400)
+++ trunk/controller/js/controller/ajax.js      2017-12-06 11:52:48 UTC (rev 
17401)
@@ -462,16 +462,20 @@
 
                var control_item_type = $(this).find("input[type=radio]").val();
 
-               if (control_item_type == "control_item_type_3" | 
control_item_type == "control_item_type_4")
+               if (control_item_type == "control_item_type_3" | 
control_item_type == "control_item_type_4" | control_item_type == 
"control_item_type_5")
                {
                        if (control_item_type == "control_item_type_3")
                        {
                                
$("#add_control_item_option_panel").find(".type").text("Nedtrekksliste");
                        }
-                       else
+                       else if (control_item_type == "control_item_type_4")
                        {
                                
$("#add_control_item_option_panel").find(".type").text("Radioknapper");
                        }
+                       else
+                       {
+                               
$("#add_control_item_option_panel").find(".type").text("Avkrysning");
+                       }
 
                        $("#add_control_item_option_panel").slideDown(500);
                }

Modified: trunk/controller/setup/phpgw_no.lang
===================================================================
--- trunk/controller/setup/phpgw_no.lang        2017-12-05 19:55:49 UTC (rev 
17400)
+++ trunk/controller/setup/phpgw_no.lang        2017-12-06 11:52:48 UTC (rev 
17401)
@@ -19,6 +19,7 @@
 control_item_type_2    controller      no      Ved innskriving av måling i et 
tekstfelt
 control_item_type_3    controller      no      Ved valg av verdi fra 
nedtrekksliste
 control_item_type_4    controller      no      Ved valg av verdi fra 
radioknapper
+control_item_type_5    controller      no      Ved valg av verdi fra Avkrysning
 control_helptext       controller      no      Her kommer hjelpetekst for å 
opprette en kontroll
 Check_list     controller      no      Sjekkliste
 chosen attributes      controller      no      Valgte datafelter

Modified: trunk/controller/templates/mobilefrontend/case/add_case.xsl
===================================================================
--- trunk/controller/templates/mobilefrontend/case/add_case.xsl 2017-12-05 
19:55:49 UTC (rev 17400)
+++ trunk/controller/templates/mobilefrontend/case/add_case.xsl 2017-12-06 
11:52:48 UTC (rev 17401)
@@ -260,6 +260,39 @@
                                                                                
                                                <input type="submit" 
class="pure-button pure-button-primary" name="save_control" value="Lagre 
sak/måling" title="{$lang_save}" />
 
                                                                                
                                        </xsl:when>
+                                                                               
                                        <xsl:when test="type = 
'control_item_type_5'">
+
+                                                                               
                                                <input name="type" 
type="hidden" value="control_item_type_5" />
+                                                                               
                                                <input name="status" 
type="hidden" value="1" />
+
+                                                                               
                                                <div class="pure-control-group">
+                                                                               
                                                        <label 
class="pure-checkbox">Velg verdi fra lister</label>
+                                                                               
                                                        <xsl:for-each 
select="options_array">
+                                                                               
                                                                <input 
name="option_value" value="option_value" type="checkbox">
+                                                                               
                                                                        <xsl:if 
test="required = 1">
+                                                                               
                                                                                
<xsl:attribute name="class" >
+                                                                               
                                                                                
        <xsl:text>required</xsl:text>
+                                                                               
                                                                                
</xsl:attribute>
+                                                                               
                                                                        
</xsl:if>
+                                                                               
                                                                </input>
+                                                                               
                                                                <xsl:value-of 
select="option_value"/>
+
+                                                                               
                                                        </xsl:for-each>
+                                                                               
                                                </div>
+                                                                               
                                                <div class="pure-control-group">
+                                                                               
                                                        <label class="comment">
+                                                                               
                                                                <xsl:value-of 
select="php:function('lang', 'comment')" />
+                                                                               
                                                        </label>
+                                                                               
                                                        <textarea 
name="case_descr" class="pure-input-1">
+                                                                               
                                                                <xsl:value-of 
select="comment"/>
+                                                                               
                                                        </textarea>
+                                                                               
                                                </div>
+                                                                               
                                                <xsl:variable name="lang_save">
+                                                                               
                                                        <xsl:value-of 
select="php:function('lang', 'register_error')" />
+                                                                               
                                                </xsl:variable>
+                                                                               
                                                <input type="submit" 
class="pure-button pure-button-primary" name="save_control" value="Lagre 
sak/måling" title="{$lang_save}" />
+
+                                                                               
                                        </xsl:when>
                                                                                
                                </xsl:choose>
                                                                                
                        </form>
                                                                                
                </li>




reply via email to

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