fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [9618]


From: Torstein
Subject: [Fmsystem-commits] [9618]
Date: Tue, 19 Jun 2012 07:08:23 +0000

Revision: 9618
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9618
Author:   vator
Date:     2012-06-19 07:08:23 +0000 (Tue, 19 Jun 2012)
Log Message:
-----------


Modified Paths:
--------------
    trunk/controller/inc/component/class.year_calendar.inc.php
    trunk/controller/inc/model/class.check_list.inc.php
    trunk/controller/inc/model/class.component.inc.php
    trunk/controller/templates/base/calendar/view_calendar_month.xsl
    trunk/controller/templates/base/calendar/view_calendar_year.xsl

Modified: trunk/controller/inc/component/class.year_calendar.inc.php
===================================================================
--- trunk/controller/inc/component/class.year_calendar.inc.php  2012-06-19 
07:08:09 UTC (rev 9617)
+++ trunk/controller/inc/component/class.year_calendar.inc.php  2012-06-19 
07:08:23 UTC (rev 9618)
@@ -15,11 +15,9 @@
   public function __construct($control, $year){
     $this->year = $year;
     $this->control = $control;
+    $this->period_start_date_ts = $this->get_start_date_year_ts($year);
+    $this->period_end_date_ts = $this->get_start_date_year_ts($year+1);
         
-    $this->period_start_date_ts = strtotime("01/01/$year");
-    $to_year = $year + 1;
-    $this->period_end_date_ts = strtotime("01/01/$to_year");
-        
     $this->init_calendar();
   }
                
@@ -83,4 +81,10 @@
                
                return $heading_array;
        }
+       
+       public static function get_start_date_year_ts($year){
+         $start_date_year_ts = strtotime("01/01/$year");
+                       
+               return $start_date_year_ts;
+       }
 }
\ No newline at end of file

Modified: trunk/controller/inc/model/class.check_list.inc.php
===================================================================
--- trunk/controller/inc/model/class.check_list.inc.php 2012-06-19 07:08:09 UTC 
(rev 9617)
+++ trunk/controller/inc/model/class.check_list.inc.php 2012-06-19 07:08:23 UTC 
(rev 9618)
@@ -47,6 +47,7 @@
                protected $completed_date;
                protected $location_code;
                protected $component_id;
+               protected $location_id;
                
                // Aggregate fields. Fields not in a table
                protected $num_open_cases;
@@ -136,6 +137,13 @@
                }
                
                public function get_component_id() { return 
$this->component_id; }
+               
+               public function set_location_id($location_id)
+               {
+                       $this->location_id = $location_id;
+               }
+               
+               public function get_location_id() { return $this->location_id; }
 
                public function get_num_open_cases() { return 
$this->num_open_cases; }
                
@@ -170,6 +178,7 @@
                                'completed_date' => $this->get_completed_date(),
                                'location_code' => $this->get_location_code(),
                                'component_id' => $this->get_component_id(),
+                               'location_id' => $this->get_location_id(),
                                'num_open_cases' => $this->get_num_open_cases()
                        );
                }

Modified: trunk/controller/inc/model/class.component.inc.php
===================================================================
--- trunk/controller/inc/model/class.component.inc.php  2012-06-19 07:08:09 UTC 
(rev 9617)
+++ trunk/controller/inc/model/class.component.inc.php  2012-06-19 07:08:23 UTC 
(rev 9618)
@@ -31,10 +31,8 @@
        include_class('controller', 'model', 'inc/model/');
        include_class('controller', 'date_helper', 'inc/helper/');
 
-       class controller_control extends controller_model
+       class controller_component extends controller_model
        {
-               public static $so;
-               
                protected $type;
                protected $id;
                protected $guid;
@@ -44,7 +42,7 @@
                protected $address;
                
                // Objects
-               protected $controls_list_array = array();
+               protected $controls_array = array();
                
                /**
                 * Constructor.  Takes an optional ID.  If a contract is 
created from outside
@@ -103,12 +101,12 @@
                
                public function get_address() { return $this->address; }
                
-               public function set_controls_list_array($controls_list_array)
+               public function set_controls_array($controls_array)
                {
-                       $this->controls_list_array = $controls_list_array;
+                       $this->controls_array = $controls_array;
                }
                
-               public function get_controls_list_array() { return 
$this->controls_list_array; }
+               public function get_controls_array() { return 
$this->controls_array; }
                
                public function serialize()
                {

Modified: trunk/controller/templates/base/calendar/view_calendar_month.xsl
===================================================================
--- trunk/controller/templates/base/calendar/view_calendar_month.xsl    
2012-06-19 07:08:09 UTC (rev 9617)
+++ trunk/controller/templates/base/calendar/view_calendar_month.xsl    
2012-06-19 07:08:23 UTC (rev 9618)
@@ -78,20 +78,23 @@
                        <!-- =====================  SEARCH FOR LOCATION  
================= -->
                        <div id="search-location" class="select-box">
                                <div id="choose-loc">
-                                       <label>Søk etter andre <a 
href="loc_type_2" class="btn active">Bygg</a><a href="loc_type_1" 
class="btn">Eiendom</a>
-                                                       <input id="loc_type" 
type="hidden" name="loc_type" value="2" />
-                                       </label>
-                               </div>
-                               <input type="hidden" id="currentYear">
+                           <input id="loc_type" type="hidden" name="loc_type" 
value="2" />
+                                       <input type="hidden" id="currentYear">
                                        <xsl:attribute name="value">
                                                <xsl:value-of 
select="current_year"/>
                                        </xsl:attribute>
                                </input>
                                <input type="hidden" id="currentMonth">
-                                       <xsl:attribute name="value">
+                                 <xsl:attribute name="value">
                                                <xsl:value-of 
select="current_month_nr"/>
                                        </xsl:attribute>
                                </input>
+                                       <label>Søk etter</label>
+                                       <span>
+                                               <a href="loc_type_2" class="btn 
first active">Bygg</a>
+                                               <a href="loc_type_1" 
class="btn">Eiendom</a>
+                                       </span>
+                               </div>
                                <input type="text" value="" 
id="search-location-name" />
                        </div>
                

Modified: trunk/controller/templates/base/calendar/view_calendar_year.xsl
===================================================================
--- trunk/controller/templates/base/calendar/view_calendar_year.xsl     
2012-06-19 07:08:09 UTC (rev 9617)
+++ trunk/controller/templates/base/calendar/view_calendar_year.xsl     
2012-06-19 07:08:23 UTC (rev 9618)
@@ -77,15 +77,18 @@
                        <!-- =====================  SEARCH FOR LOCATION  
================= -->
                        <div id="search-location" class="select-box">
                                <div id="choose-loc">
-                                       <label>Søk etter andre <a 
href="loc_type_2" class="btn active">Bygg</a><a href="loc_type_1" 
class="btn">Eiendom</a>
-                                                       <input id="loc_type" 
type="hidden" name="loc_type" value="2" />
-                                       </label>
+                                       <input id="loc_type" type="hidden" 
name="loc_type" value="2" />
+                                       <input type="hidden" id="currentYear">
+                                         <xsl:attribute name="value">
+                                                 <xsl:value-of 
select="current_year"/>
+                                         </xsl:attribute>
+                                 </input>
+                                       <label>Søk etter</label>
+                                       <span>
+                                               <a href="loc_type_2" class="btn 
first active">Bygg</a>
+                                               <a href="loc_type_1" 
class="btn">Eiendom</a>
+                                       </span>
                                </div>
-                               <input type="hidden" id="currentYear">
-                                       <xsl:attribute name="value">
-                                               <xsl:value-of 
select="current_year"/>
-                                       </xsl:attribute>
-                               </input>
                                <input type="text" value="" 
id="search-location-name" />
                        </div>
                        
@@ -202,9 +205,12 @@
                                                        <td class="frequency">
                                                        <span>
                                                                <xsl:choose>
-                                                                       
<xsl:when test="control/repeat_interval = 1">
+                                                                       
<xsl:when test="control/repeat_interval = 1 and control/repeat_type &lt; 3">
                                                                                
<span class="pre">Hver</span>
                                                                        
</xsl:when>
+                                                                       
<xsl:when test="control/repeat_interval = 1 and control/repeat_type = 3">
+                                                                               
<span class="pre">Hvert</span>
+                                                                       
</xsl:when>
                                                                        
<xsl:when test="control/repeat_interval = 2">
                                                                                
<span class="pre">Annenhver</span>
                                                                        
</xsl:when>
@@ -228,6 +234,85 @@
                                <tr class="cal_info_msg"><td colspan="3">Ingen 
sjekklister for bygg i angitt periode</td></tr>
                        </xsl:otherwise>
                </xsl:choose>
+               
+               <xsl:for-each select="components_calendar_array">
+               
+               <tr>
+               
+               <td>
+                       <h3><xsl:value-of 
select="component/location_code"/></h3>
+               </td>
+                       <xsl:for-each select="controls_calendar">
+                                       <xsl:variable 
name="control_id"><xsl:value-of select="control/id"/></xsl:variable>
+                               
+                                       <tr>
+                                       
+                         
+                                                                       
+                                               <xsl:choose>
+                                               <xsl:when test="(position() mod 
2) != 1">
+                                                   <xsl:attribute 
name="class">odd</xsl:attribute>
+                                               </xsl:when>
+                                               <xsl:otherwise>
+                                                   <xsl:attribute 
name="class">even</xsl:attribute>
+                                               </xsl:otherwise>
+                                           </xsl:choose>
+                                                       <td class="title">
+                                                       <span><xsl:value-of 
select="control/title"/></span>
+                                                       </td>
+                                                       <td class="assigned">
+                                                       <span><xsl:value-of 
select="control/responsibility_name"/></span>
+                                                       </td>
+                                                       <td class="frequency">
+                                                       <span>
+                                                               <xsl:choose>
+                                                                       
<xsl:when test="control/repeat_interval = 1 and control/repeat_type &lt; 3">
+                                                                               
<span class="pre">Hver</span>
+                                                                       
</xsl:when>
+                                                                       
<xsl:when test="control/repeat_interval = 1 and control/repeat_type = 3">
+                                                                               
<span class="pre">Hvert</span>
+                                                                       
</xsl:when>
+                                                                       
<xsl:when test="control/repeat_interval = 2">
+                                                                               
<span class="pre">Annenhver</span>
+                                                                       
</xsl:when>
+                                                                       
<xsl:when test="control/repeat_interval > 2">
+                                                                               
<span class="pre">Hver</span><span><xsl:value-of 
select="control/repeat_interval"/>.</span>
+                                                                       
</xsl:when>
+                                                               </xsl:choose>
+                                                               
+                                                               <span 
class="val"><xsl:value-of select="control/repeat_type_label"/></span>
+                                                       </span>
+                                                       </td>
+                                                       <xsl:for-each 
select="calendar_array">
+                                                               
<xsl:call-template name="check_list_status_checker" >
+                                                                       
<xsl:with-param name="location_code"><xsl:value-of 
select="//current_location/location_code"/></xsl:with-param>
+                                                               
</xsl:call-template>
+                                                       </xsl:for-each>
+                                       </tr>   
+                               </xsl:for-each> 
+                       
+               </tr>
+               
+               </xsl:for-each>
+               
+               
+               
+               
+               
+               
+               
+               
+               
+               
+               
+               
+               
+               
+               
+               
+               
+               
+               
        </table>
        </div>
 </div>




reply via email to

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