fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [9686]


From: Torstein
Subject: [Fmsystem-commits] [9686]
Date: Wed, 27 Jun 2012 14:59:41 +0000

Revision: 9686
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9686
Author:   vator
Date:     2012-06-27 14:59:40 +0000 (Wed, 27 Jun 2012)
Log Message:
-----------


Modified Paths:
--------------
    trunk/controller/inc/class.uicalendar.inc.php
    trunk/controller/templates/base/calendar/calendar_filters.xsl
    trunk/controller/templates/base/calendar/view_calendar_year.xsl
    trunk/controller/templates/base/css/base.css

Modified: trunk/controller/inc/class.uicalendar.inc.php
===================================================================
--- trunk/controller/inc/class.uicalendar.inc.php       2012-06-27 14:19:42 UTC 
(rev 9685)
+++ trunk/controller/inc/class.uicalendar.inc.php       2012-06-27 14:59:40 UTC 
(rev 9686)
@@ -84,6 +84,8 @@
                        $location_code = phpgw::get_var('location_code');
                        $year = phpgw::get_var('year');
                        $month = phpgw::get_var('month');
+                       $role = phpgw::get_var('role');
+                       $repeat_type = phpgw::get_var('repeat_type');
                        
                        // Validates year. If year is not set, current year is 
chosen
                        $year = $this->validate_year($year);
@@ -91,6 +93,12 @@
                        // Validates month. If year is not set, current month 
in current year is chosen
                        $month = $this->validate_month($month);
                        
+                       // Validates year. 
+                       $repeat_type = 
$this->validate_repeat_type($repeat_type);
+                       
+                       // Validates role. 
+                       $role = $this->validate_role($role);
+                       
                        // Gets timestamp value of first day in month
                        $from_date_ts = 
month_calendar::get_start_month_date_ts($year, intval( $month ));
 
@@ -179,7 +187,9 @@
                                'current_month_nr'                      => 
$month,
                                'location_level'                                
=> $level,
                                'roles_array'                                   
        => $roles_array,
-                               'repeat_type_array'                     => 
$repeat_type_array
+                               'repeat_type_array'                     => 
$repeat_type_array,
+                               'current_role'                                  
        => $role,
+                               'current_repeat_type'           => $repeat_type
                        );
                        
                        self::add_javascript('controller', 'controller', 
'jquery.js');
@@ -202,7 +212,14 @@
                        
                        // Validates year. If year is not set, current year is 
chosen
                        $year = $this->validate_year($year);
+echo " repeat type: " . $repeat_type;
+                       // Validates year. 
+                       $repeat_type = 
$this->validate_repeat_type($repeat_type);
                        
+                       // Validates role. 
+                       $role = $this->validate_role($role);
+                       
+                       echo " repeat type: " . $repeat_type;
                        // Gets timestamp of first day in year
                        $from_date_ts = $this->get_start_date_year_ts($year);
 
@@ -246,7 +263,7 @@
                                        // Loops through controls and populates 
aggregate open cases pr month array.
                                        $agg_open_cases_pr_month_array = 
$this->build_agg_open_cases_pr_month_array($cl_criteria, $year, $from_month, 
$to_month);
                                        
-                                       $year_calendar = new 
year_calendar($control, $year);
+                                       $year_calendar = new 
year_calendar($control, $year, null, $location_code, "location");
                                        $calendar_array = 
$year_calendar->build_agg_month_calendar($agg_open_cases_pr_month_array);
                                                
                                        $controls_calendar_array[] = 
array("control" => $control->toArray(), "calendar_array" => $calendar_array);
@@ -362,7 +379,9 @@
                                'current_year'                                  
        => $year,
                                'location_level'                                
        => $level,
                                'roles_array'                                   
                => $roles_array,
-                               'repeat_type_array'                             
=> $repeat_type_array
+                               'repeat_type_array'                             
=> $repeat_type_array,
+                               'current_role'                                  
                => $role,
+                               'current_repeat_type'                   => 
$repeat_type
                        );
                        
                        
self::render_template_xsl(array('calendar/view_calendar_year', 
'calendar/check_list_status_checker', 
@@ -770,6 +789,26 @@
                        return $validate_year;
                }
                
+               function validate_repeat_type($validate_repeat_type)
+               {
+                       if( $validate_repeat_type != 0 & (empty( 
$validate_repeat_type ) | ($validate_repeat_type > 3)) )
+                       {
+                               $validate_repeat_type = '';
+                       }
+                       
+                       return $validate_repeat_type;
+               }
+               
+         function validate_role($validate_role)
+               {
+                       if( empty( $validate_role ) | 
(!is_numeric($validate_role)) | ($validate_role < 1) )
+                       {
+                               $validate_role = '';
+                       }
+                       
+                       return $validate_role;
+               }
+               
                function validate_month($month)
                {
                        if( empty( $month ) ){

Modified: trunk/controller/templates/base/calendar/calendar_filters.xsl
===================================================================
--- trunk/controller/templates/base/calendar/calendar_filters.xsl       
2012-06-27 14:19:42 UTC (rev 9685)
+++ trunk/controller/templates/base/calendar/calendar_filters.xsl       
2012-06-27 14:59:40 UTC (rev 9686)
@@ -46,20 +46,38 @@
                <select id="filter-role">
                        <xsl:for-each select="roles_array">
                                <xsl:variable name="role_id"><xsl:value-of 
select="id"/></xsl:variable>
-                               <option value="{$role_id}">
-                                       <xsl:value-of 
disable-output-escaping="yes" select="name"/>
-                               </option>
+                               <xsl:choose>
+                                       <xsl:when test="$role_id = 
//current_role">
+                                               <option value="{$role_id}" 
selected="selected">
+                                                       <xsl:value-of 
disable-output-escaping="yes" select="name"/>
+                                               </option>
+                                       </xsl:when>
+                                       <xsl:otherwise>
+                                               <option value="{$role_id}">
+                                                       <xsl:value-of 
disable-output-escaping="yes" select="name"/>
+                                               </option>
+                                       </xsl:otherwise>
+                               </xsl:choose>
                        </xsl:for-each>
                </select>
        </div>
        <div class="filter">
        <label>Filtrer på frekvenstype</label>
-               <select class="required" id="filter-repeat_type" 
name="repeat_type">
-                       <option value="" selected="selected" >Velg 
frekvenstype</option>
+               <select id="filter-repeat_type" name="repeat_type">
+                       <option value="">Velg frekvenstype</option>
                        <xsl:for-each select="repeat_type_array">
-                               <option value="{id}">
+                               <xsl:choose>
+                                       <xsl:when test="id = 
//current_repeat_type">
+                                               <option value="{id}" 
selected="selected">
                                        <xsl:value-of 
disable-output-escaping="yes" select="value"/>
                                </option>
+                                       </xsl:when>
+                                       <xsl:otherwise>
+                                               <option value="{id}">
+                                                       <xsl:value-of 
disable-output-escaping="yes" select="value"/>
+                                               </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-06-27 14:19:42 UTC (rev 9685)
+++ trunk/controller/templates/base/calendar/view_calendar_year.xsl     
2012-06-27 14:59:40 UTC (rev 9686)
@@ -296,7 +296,7 @@
                </xsl:for-each>
                </xsl:when>
                        <xsl:otherwise>
-                               <p>Ingen kontroller for komponenter tilknyttet 
lokasjon</p>
+                               <p class="no-comp-msg">Ingen komponenter 
tilknyttet kontroll</p>
                        </xsl:otherwise>
                        </xsl:choose>
        </div>

Modified: trunk/controller/templates/base/css/base.css
===================================================================
--- trunk/controller/templates/base/css/base.css        2012-06-27 14:19:42 UTC 
(rev 9685)
+++ trunk/controller/templates/base/css/base.css        2012-06-27 14:59:40 UTC 
(rev 9686)
@@ -2104,8 +2104,8 @@
        padding: 5px;   
 }
 
-.home-box {
-       background: none repeat scroll 0 0 #EDF5FF;
-  border-color: #DBE5EF;
-  border-radius: 4px;  
-}
\ No newline at end of file
+.no-comp-msg {
+       font-size: 16px;
+  padding-left: 85px;  
+}
+




reply via email to

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