fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [8115]


From: Torstein
Subject: [Fmsystem-commits] [8115]
Date: Wed, 16 Nov 2011 07:05:16 +0000

Revision: 8115
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8115
Author:   vator
Date:     2011-11-16 07:05:06 +0000 (Wed, 16 Nov 2011)
Log Message:
-----------


Modified Paths:
--------------
    trunk/controller/js/controller/custom_ui.js
    trunk/controller/templates/base/choose_control_items.xsl
    trunk/controller/templates/base/control_groups.xsl
    trunk/controller/templates/base/control_tabs.xsl
    trunk/controller/templates/base/css/base.css

Modified: trunk/controller/js/controller/custom_ui.js
===================================================================
--- trunk/controller/js/controller/custom_ui.js 2011-11-16 07:02:33 UTC (rev 
8114)
+++ trunk/controller/js/controller/custom_ui.js 2011-11-16 07:05:06 UTC (rev 
8115)
@@ -42,6 +42,25 @@
                $("ul.expand_list").find("li h4 img").attr("src", 
"controller/images/arrow_left.png");
        });
        
+       /* 
=============================================================================== 
*/
+       
+       if( $("#frm_control_items").length > 0 ){
+               var check_box_arr = 
$("#frm_control_items").find("input[type='checkbox']");
+               
+               $(check_box_arr).each(function(index) {
+                       var check_box = check_box_arr[index];
+                       
+                       if( $(check_box).is(':checked') ){
+                               var chbox_id = $(check_box).attr("id");
+                               
+                               var control_group_id = chbox_id.substring( 
chbox_id.indexOf("_")+1, chbox_id.indexOf(":") );
+                               var control_item_id = chbox_id.substring( 
chbox_id.indexOf(":")+1,  chbox_id.length );
+                               
+                               $("#frm_control_items").prepend("<input 
type='hidden' id=hid_" + control_item_id +  " name='control_tag_ids[]' value=" 
+ control_group_id + ":" +  control_item_id + " />");
+                       }
+               });
+       }
+       
        $("#frm_control_items input[type='checkbox']").click(function(){
                var thisCbox = $(this);
                
@@ -56,7 +75,6 @@
                        $("#frm_control_items").prepend("<input type='hidden' 
id=hid_" + control_item_id +  " name='control_tag_ids[]' value=" + 
control_group_id + ":" +  control_item_id + " />");
                }
        });
-       
-       
+               
 });
                

Modified: trunk/controller/templates/base/choose_control_items.xsl
===================================================================
--- trunk/controller/templates/base/choose_control_items.xsl    2011-11-16 
07:02:33 UTC (rev 8114)
+++ trunk/controller/templates/base/choose_control_items.xsl    2011-11-16 
07:05:06 UTC (rev 8115)
@@ -2,14 +2,15 @@
 
 <div class="yui-content tab_content">
        <div>
-                 
-          <!-- ===========================  CHOOSE CONTROL ITEMS  
=============================== -->
+          <!-- ===========================  CHOOSE CONTROL ITEMS  
=============================== -->  
           <h2>Velg dine kontrollpunkt</h2>
           
+          <!-- ==== CHOOSE NONE/ALL ===== -->
                <h4 class="expand_header"><div class="expand_all">Vis 
alle</div><div class="collapse_all">Skjul alle</div></h4>
+               
                <form id="frm_control_items" 
action="index.php?menuaction=controller.uicontrol.save_control_items" 
method="post">       
-                       <xsl:variable name="control_id"><xsl:value-of 
select="control_id"/></xsl:variable>
-                       <input type="hidden" name="control_id" 
value="{control_id}" />
+                       <xsl:variable name="control_id"><xsl:value-of 
select="control/id"/></xsl:variable>
+                       <input type="hidden" name="control_id" 
value="{$control_id}" />
                        
                        <xsl:variable name="control_group_ids"><xsl:value-of 
select="control_group_ids"/></xsl:variable>
                        <input type="hidden" name="control_group_ids" 
value="{control_group_ids}" />            
@@ -18,15 +19,29 @@
                                <xsl:for-each 
select="groups_with_control_items">
                                        <ul class="itemlist expand_list">
                                <li>
-                                       <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="id"/></xsl:variable>
-                                                               
-                                                       <li><xsl:number/>.  
<input type="checkbox"  id="ch_{$control_group_id}:{$control_item_id}" 
value="{$control_group_id}:{$control_item_id}" /><xsl:value-of 
select="title"/></li> 
-                                                       </xsl:for-each>
-                                               </ul>
+                                       <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>
+                                                                               
        <xsl:when test="checked = 1">
+                                                                               
                <li><xsl:number/>.  <input type="checkbox"  checked="checked" 
id="ch_{$control_group_id}:{$control_item_id}" 
value="{$control_group_id}:{$control_item_id}" /><xsl:value-of 
select="control_item/title"/></li>
+                                                                               
        </xsl:when>
+                                                                               
        <xsl:otherwise>
+                                                                               
                <li><xsl:number/>.  <input type="checkbox"  
id="ch_{$control_group_id}:{$control_item_id}" 
value="{$control_group_id}:{$control_item_id}" /><xsl:value-of 
select="control_item/title"/></li>
+                                                                               
        </xsl:otherwise>
+                                                                               
</xsl:choose>
+                                                                       
</xsl:for-each>
+                                                               </ul>
+                                                       </xsl:when>
+                                               <xsl:otherwise>
+                                                       <div 
class="empty_list"><span><xsl:value-of 
select="control_group/group_name"/></span></div>
+                                                       <div>Ingen 
kontrollpunkt</div>
+                                               </xsl:otherwise>
+                                               </xsl:choose>
                                        </li>
                                </ul>
                                </xsl:for-each>
@@ -36,8 +51,7 @@
                                <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save')" /></xsl:variable>
                                <input type="submit" name="save_control_items" 
value="{$lang_save}" title = "{$lang_save}" />
                        </div>
-               </form>
-                                                               
+               </form>                                 
        </div>
 </div>
 </xsl:template>
\ No newline at end of file

Modified: trunk/controller/templates/base/control_groups.xsl
===================================================================
--- trunk/controller/templates/base/control_groups.xsl  2011-11-16 07:02:33 UTC 
(rev 8114)
+++ trunk/controller/templates/base/control_groups.xsl  2011-11-16 07:05:06 UTC 
(rev 8115)
@@ -9,18 +9,22 @@
                        <xsl:variable name="control_area_id"><xsl:value-of 
select="control_area/id"/></xsl:variable>
                        <input type="hidden" name="control_area_id" 
value="{$control_area_id}" />
                        
-                       <xsl:variable name="control_id"><xsl:value-of 
select="control_id"/></xsl:variable>
-                       <input type="hidden" name="control_id" 
value="{control_id}" />
+                       <xsl:variable name="control_id"><xsl:value-of 
select="control/id"/></xsl:variable>
+                       <input type="hidden" name="control_id" 
value="{$control_id}" />
                        
                        <ul class="itemlist">
                                <xsl:for-each select="//control_groups">
-                                       <xsl:variable 
name="control_group_id"><xsl:value-of select="id"/></xsl:variable>
-                               
-                                       <xsl:for-each 
select="chosen_control_groups">
-                                               <xsl:value-of select="."/>
-                                       </xsl:for-each>
-                               
-                               <li><input type="checkbox"  
name="control_group_ids[]" value="{$control_group_id}" /><xsl:value-of 
select="group_name"/></li>
+                                       <xsl:variable 
name="control_group_id"><xsl:value-of select="control_group/id"/></xsl:variable>
+                                       
+                                       <xsl:choose>
+                                               <xsl:when test="checked = 1">
+                                                       <li><input 
type="checkbox" checked="checked" name="control_group_ids[]" 
value="{$control_group_id}" /><xsl:value-of 
select="control_group/group_name"/></li>
+                                               </xsl:when>
+                                               <xsl:otherwise>
+                                                       <li><input 
type="checkbox" name="control_group_ids[]" value="{$control_group_id}" 
/><xsl:value-of select="control_group/group_name"/></li>
+                                               </xsl:otherwise>
+                                       </xsl:choose>
+                               
                                </xsl:for-each>
                        </ul>
                        <div>

Modified: trunk/controller/templates/base/control_tabs.xsl
===================================================================
--- trunk/controller/templates/base/control_tabs.xsl    2011-11-16 07:02:33 UTC 
(rev 8114)
+++ trunk/controller/templates/base/control_tabs.xsl    2011-11-16 07:05:06 UTC 
(rev 8115)
@@ -13,46 +13,39 @@
                </xsl:when>
                <xsl:when test="view = 'control_groups'">
                        <div class="identifier-header">
-                               <h1><xsl:value-of select="php:function('lang', 
'Control_groups')"/> for <xsl:value-of select="control_title" /></h1>
+                               <h1><xsl:value-of select="php:function('lang', 
'Control_groups')"/> for <xsl:value-of select="control/title" /></h1>
                        </div>
                        <xsl:value-of disable-output-escaping="yes" 
select="tabs" />
                        <xsl:call-template name="control_groups" />
                </xsl:when>
                <xsl:when test="view = 'control_locations'">
                        <div class="identifier-header">
-                               <h1><xsl:value-of select="php:function('lang', 
'Control_locations')"/> for <xsl:value-of select="control_title" /></h1>
+                               <h1><xsl:value-of select="php:function('lang', 
'Control_locations')"/> for <xsl:value-of select="control/title" /></h1>
                        </div>
                        <xsl:value-of disable-output-escaping="yes" 
select="tabs" />
                        <xsl:call-template name="control_locations" />
                </xsl:when>
                <xsl:when test="view = 'control_equipment'">
                        <div class="identifier-header">
-                               <h1><xsl:value-of select="php:function('lang', 
'Control_equipment')"/> for <xsl:value-of select="control_title" /></h1>
+                               <h1><xsl:value-of select="php:function('lang', 
'Control_equipment')"/> for <xsl:value-of select="control/title" /></h1>
                        </div>
                        <xsl:value-of disable-output-escaping="yes" 
select="tabs" />
                        <xsl:call-template name="control_equipment" />
                </xsl:when>
                <xsl:when test="view = 'control_items'">
                        <div class="identifier-header">
-                               <h1><xsl:value-of select="php:function('lang', 
'Control_items')"/> for <xsl:value-of select="control_title" /></h1>
+                               <h1><xsl:value-of select="php:function('lang', 
'Control_items')"/> for <xsl:value-of select="control/title" /></h1>
                        </div>
                        <xsl:value-of disable-output-escaping="yes" 
select="tabs" />
                        <xsl:call-template name="control_items" />
                </xsl:when>
                <xsl:when test="view = 'sort_check_list'">
                        <div class="identifier-header">
-                               <h1><xsl:value-of select="php:function('lang', 
'Check_list')"/> for <xsl:value-of select="control_title" /></h1>
+                               <h1><xsl:value-of select="php:function('lang', 
'Check_list')"/> for <xsl:value-of select="control/title" /></h1>
                        </div>
                        <xsl:value-of disable-output-escaping="yes" 
select="tabs" />
                        <xsl:call-template name="sort_check_list" />
                </xsl:when>
-               <xsl:when test="view = 'view_check_lists'">
-                       <div class="identifier-header">
-                               <h1><xsl:value-of select="php:function('lang', 
'Check_list')"/> for <xsl:value-of select="control_title" /></h1>
-                       </div>
-                       <xsl:value-of disable-output-escaping="yes" 
select="tabs" />
-                       <xsl:call-template name="tab_view_check_lists" />
-               </xsl:when>
        </xsl:choose>
 </div>
        

Modified: trunk/controller/templates/base/css/base.css
===================================================================
--- trunk/controller/templates/base/css/base.css        2011-11-16 07:02:33 UTC 
(rev 8114)
+++ trunk/controller/templates/base/css/base.css        2011-11-16 07:05:06 UTC 
(rev 8115)
@@ -878,4 +878,9 @@
     font-weight: bold;
     padding: 0 0 8px;
     text-align: center;
+}
+.empty_list{
+       font-size: 16px;
+    font-weight: bold;
+    padding: 0 0 5px;
 }
\ No newline at end of file




reply via email to

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