fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [9206]


From: Torstein
Subject: [Fmsystem-commits] [9206]
Date: Mon, 23 Apr 2012 06:21:39 +0000

Revision: 9206
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9206
Author:   vator
Date:     2012-04-23 06:21:38 +0000 (Mon, 23 Apr 2012)
Log Message:
-----------


Modified Paths:
--------------
    trunk/controller/inc/class.uicalendar.inc.php
    trunk/controller/js/controller/ajax.js
    trunk/controller/templates/base/calendar/view_calendar_month.xsl
    trunk/controller/templates/base/calendar/view_calendar_year.xsl

Modified: trunk/controller/inc/class.uicalendar.inc.php
===================================================================
--- trunk/controller/inc/class.uicalendar.inc.php       2012-04-22 09:37:41 UTC 
(rev 9205)
+++ trunk/controller/inc/class.uicalendar.inc.php       2012-04-23 06:21:38 UTC 
(rev 9206)
@@ -144,8 +144,15 @@
                                        $curr_control['repeat_type'] = "År";
                        }
 
+                       //$location_list = 
$this->bo->read(array('type_id'=>$type_id,'lookup_tenant'=>$lookup_tenant,'lookup'=>$lookup,'allrows'=>$this->allrows,'dry_run'
 =>$dry_run));
+                       
                        $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
+                       //lookup=1&type_id=1&lookup_name=0
+                       $property_array = 
execMethod('property.solocation.read', array('type_id' => 1, 'allrows' => 
true));
+                       //$property_array = 
execMethod('property.bolocation.read', array('type_id' => 1, 'lookup_name' => 
0, 'lookup' => 1));
+                       //print_r( $property_array );
                        
+                       
                        $month_array = array("Januar", "Februar", "Mars", 
"April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", 
"Desember");
                        
                        for($i=1;$i<=$num_days_in_month;$i++){
@@ -156,6 +163,7 @@
                        (               
                                'my_locations'                    => 
$my_locations,
                                'view_location_code'      => $location_code,
+                               'property_array'                  => 
$property_array,
                                'location_array'                  => 
$location_array,
                                'heading_array'                   => 
$heading_array,
                                'controls_calendar_array' => 
$controls_calendar_array,

Modified: trunk/controller/js/controller/ajax.js
===================================================================
--- trunk/controller/js/controller/ajax.js      2012-04-22 09:37:41 UTC (rev 
9205)
+++ trunk/controller/js/controller/ajax.js      2012-04-23 06:21:38 UTC (rev 
9206)
@@ -1,17 +1,29 @@
 $(document).ready(function(){
 
-       $("#loc1").change(function () {
-               var loc1 = $(this).val();
-               $("#loc2").html( "<option></option>" );
-               $("#loc3").html( "<option></option>" );
-               $("#loc4").html( "<option></option>" );
-               $("#loc5").html( "<option></option>" );
-
-               if(!loc1)
+       $(".choose_loc").live( "change", function () {
+               var thisSelectBox = $(this);
+               var loc_code = $(this).val();
+               var loc_id = $(this).attr("id");
+               var loc_arr = loc_id.split('_');
+               var loc_level = parseInt(loc_arr[1]);
+               var new_loc_id = "loc_" + (parseInt(loc_level)+1);
+               
+               var id = "";
+               var new_loc_code = "";
+               var level;
+               for(level = 1;level <= loc_level;level++){
+                       id = "loc_" + level;
+                       if(level > 1)
+                               new_loc_code += "-" + $("#" + id).val();
+                       else
+                               new_loc_code += $("#" + id).val();
+               }
+               
+               if(!loc_code)
                {
                        return false;
                }
-               var oArgs = {menuaction:'registration.boreg.get_locations', 
location_code:loc1};
+               var oArgs = {menuaction:'registration.boreg.get_locations', 
location_code:new_loc_code};
                var requestUrl = phpGWLink('registration/main.php', oArgs, 
true);
       
                var htmlString = "";
@@ -23,19 +35,24 @@
                        success: function(data) {
                                if( data != null)
                                {
-                                       htmlString  = "<option value = ''>" + 
data.length + " lokasjone(r) funnet</option>"
+                                       htmlString  = "<select 
class='choose_loc' name='" + new_loc_id  + "' id='" + new_loc_id  + "' >" +
+                                                                 "<option 
value = ''>" + data.length + " lokasjone(r) funnet</option>";
+                                                                 
+                                                                 
                                        var obj = data;
 
                                        $.each(obj, function(i) {
                                                htmlString  += "<option 
value='" + obj[i].id + "'>" + obj[i].name + "</option>";
                                        });
 
-                                       $("#loc2").html( htmlString );
+                                       htmlString += "</select>";
+                                       
+                                       $(thisSelectBox).after( htmlString );
                                }
                                else
                                {
                                        htmlString  += "<option>Ingen 
lokasjoner</option>"
-                                       $("#loc2").html( htmlString );
+                                       $(new_loc_id).html( htmlString );
                                }
                        } 
                });     

Modified: trunk/controller/templates/base/calendar/view_calendar_month.xsl
===================================================================
--- trunk/controller/templates/base/calendar/view_calendar_month.xsl    
2012-04-22 09:37:41 UTC (rev 9205)
+++ trunk/controller/templates/base/calendar/view_calendar_month.xsl    
2012-04-23 06:21:38 UTC (rev 9206)
@@ -50,7 +50,7 @@
                                <li><img height="15" 
src="controller/images/status_icon_red_cross.png" /><span>Kontroll ikke 
gjennomført</span></li>
                        </ul>
                        
-                       <a style="font-weight: bold;font-size: 
14px;float:left;">
+                       <a style="display:block;font-weight: bold;font-size: 
14px;float:left;">
                                <xsl:attribute name="href">
                                        
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_year</xsl:text>
                                        <xsl:text>&amp;year=</xsl:text>
@@ -60,6 +60,25 @@
                                </xsl:attribute>
                                Årsoversikt
                        </a>
+                       
+                               <select id="loc_1" class="choose_loc">
+                                       <xsl:for-each select="property_array">
+                                               <xsl:variable 
name="loc_code"><xsl:value-of select="location_code"/></xsl:variable>
+                                               <xsl:choose>
+                                                       <xsl:when 
test="location_code = $view_location_code">
+                                                               <option 
value="{$loc_code}" selected="selected">
+                                                                       
<xsl:value-of disable-output-escaping="yes" select="loc1_name"/>
+                                                               </option>
+                                                       </xsl:when>
+                                                       <xsl:otherwise>
+                                                               <option 
value="{$loc_code}">
+                                                                       
<xsl:value-of disable-output-escaping="yes" select="loc1_name"/>
+                                                               </option>
+                                                       </xsl:otherwise>
+                                               </xsl:choose>
+                                       </xsl:for-each>
+                               </select>                               
+                       
                </div>
                
                

Modified: trunk/controller/templates/base/calendar/view_calendar_year.xsl
===================================================================
--- trunk/controller/templates/base/calendar/view_calendar_year.xsl     
2012-04-22 09:37:41 UTC (rev 9205)
+++ trunk/controller/templates/base/calendar/view_calendar_year.xsl     
2012-04-23 06:21:38 UTC (rev 9206)
@@ -61,6 +61,9 @@
                                <li><img height="15" 
src="controller/images/status_icon_red_empty.png" /><span>Kontroll gjennomført 
med åpne saker</span></li>
                                <li><img height="15" 
src="controller/images/status_icon_red_cross.png" /><span>Kontroll ikke 
gjennomført</span></li>
                        </ul>
+                       
+               
+                       
                </div>
                <div id="cal_wrp">
                <ul class="calendar">




reply via email to

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