fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [9388]


From: Torstein
Subject: [Fmsystem-commits] [9388]
Date: Mon, 14 May 2012 06:15:23 +0000

Revision: 9388
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9388
Author:   vator
Date:     2012-05-14 06:15:23 +0000 (Mon, 14 May 2012)
Log Message:
-----------


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

Added Paths:
-----------
    trunk/controller/images/simple_left_arrow.png
    trunk/controller/images/simple_left_arrow.psd
    trunk/controller/images/simple_right_arrow.psd
    trunk/controller/templates/base/calendar/select_my_locations.xsl

Added: trunk/controller/images/simple_left_arrow.png
===================================================================
(Binary files differ)


Property changes on: trunk/controller/images/simple_left_arrow.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/controller/images/simple_left_arrow.psd
===================================================================
(Binary files differ)


Property changes on: trunk/controller/images/simple_left_arrow.psd
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/controller/images/simple_right_arrow.psd
===================================================================
(Binary files differ)


Property changes on: trunk/controller/images/simple_right_arrow.psd
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Modified: trunk/controller/inc/class.uicalendar.inc.php
===================================================================
--- trunk/controller/inc/class.uicalendar.inc.php       2012-05-13 21:23:16 UTC 
(rev 9387)
+++ trunk/controller/inc/class.uicalendar.inc.php       2012-05-14 06:15:23 UTC 
(rev 9388)
@@ -130,20 +130,20 @@
                        $data = array
                        (               
                                'my_locations'                    => 
$my_locations,
-                               'view_location_code'      => $location_code,
                                'property_array'                  => 
$property_array,
                                'current_location'                => 
$location_array,
                                'heading_array'                   => 
month_calendar::get_heading_array($year, $month),
                                'controls_calendar_array' => 
$controls_calendar_array,
                                'date_format'                     => 
$date_format,
                                'current_year'                    => $year,
-                               'current_month_nr'                => $month
+                               'current_month_nr'                => $month,
                        );
                        
                        self::add_javascript('controller', 'controller', 
'jquery.js');
                        self::add_javascript('controller', 'controller', 
'ajax.js');
                        
-                       
self::render_template_xsl(array('calendar/view_calendar_month', 
'calendar/check_list_status_checker', 'calendar/icon_color_map'), $data);
+                       
self::render_template_xsl(array('calendar/view_calendar_month', 
'calendar/check_list_status_checker', 
+                                                                               
        'calendar/icon_color_map', 'calendar/select_my_locations'), $data);
                }
                
                public function view_calendar_for_year()
@@ -233,20 +233,19 @@
                        
                        $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
                        
-                       $heading_array = array("Jan", "Feb", "Mar", "Apr", 
"Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des");
-                       
                        $data = array
                        (
                                'my_locations'                    => 
$my_locations,
-                               'view_location_code'      => $location_code,
                                'current_location'        => $location_array,
-                               'heading_array'                   => 
$heading_array,
+                               'heading_array'                   => 
year_calendar::get_heading_array(),
                                'controls_calendar_array' => 
$controls_calendar_array,
                                'date_format'                     => 
$date_format,
                                'current_year'                    => $year,
                        );
                        
-                       self::render_template_xsl( 
array('calendar/view_calendar_year', 'calendar/check_list_status_checker', 
'calendar/icon_color_map'), $data);
+                       
self::render_template_xsl(array('calendar/view_calendar_year', 
'calendar/check_list_status_checker', 
+                                                                               
        'calendar/icon_color_map', 'calendar/select_my_locations'), $data);
+                       
                        self::add_javascript('controller', 'controller', 
'jquery.js');
                        self::add_javascript('controller', 'controller', 
'ajax.js');
                }
@@ -301,7 +300,7 @@
                        
                        $criteria = array
                        (
-                               'user_id' => 
$GLOBALS['phpgw_info']['user']['account_id'], // 
+                               'user_id' => 
$GLOBALS['phpgw_info']['user']['account_id'], //
                                'type_id' => 1, // Nivå i bygningsregisteret 
1:eiendom
                                'role_id' => 0, // For å begrense til en 
bestemt rolle - ellers listes alle roller for brukeren
                                'allrows' => false
@@ -310,20 +309,19 @@
                        $location_finder = new location_finder();
                        $my_locations = $location_finder->get_responsibilities( 
$criteria );
                        
-                       $heading_array = array("Jan", "Feb", "Mar", "Apr", 
"Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des");
-
                        $data = array
                        (
                                'my_locations'                                  
=> $my_locations,
                                'control'                                       
        => $control->toArray(),
-                               'heading_array'                                 
=> $heading_array,
+                               'heading_array'                                 
=> year_calendar::get_heading_array(),
                                'locations_with_calendar_array' => 
$locations_with_calendar_array,
                                'date_format'                                   
=> $date_format,
-                               'period'                                        
        => $year,
-                               'year'                                          
        => $year,
+                               'current_year'                                  
=> $year,
                        );
                        
-                       self::render_template_xsl( 
array('calendar/view_calendar_year_for_locations', 
'calendar/check_list_status_checker', 'calendar/icon_color_map'), $data);
+                       self::render_template_xsl( 
array('calendar/view_calendar_year_for_locations', 
'calendar/check_list_status_checker', 
+                                                                               
         'calendar/icon_color_map', 'calendar/select_my_locations'), $data);
+                       
                        self::add_javascript('controller', 'controller', 
'jquery.js');
                        self::add_javascript('controller', 'controller', 
'ajax.js');
                }
@@ -382,18 +380,18 @@
                        (               
                                'control'                                       
        => $control->toArray(),
                                'my_locations'                                  
=> $my_locations,
-                               'view_location_code'                    => 
$location_code,
                                'property_array'                                
=> $property_array,
                                'location_array'                                
=> $location_array,
+                               'heading_array'                                 
=> month_calendar::get_heading_array($year, $month),
                                'locations_with_calendar_array' => 
$locations_with_calendar_array,
                                'date_format'                                   
=> $date_format,
-                               'month_nr'                                      
        => $month,
-                               'year'                                          
        => $year,
-                               'heading_array'                                 
=> month_calendar::get_heading_array($year, $month),
-                               'period'                                        
        => month_calendar::get_month_name($month-1),
+                               'current_month_nr'                              
=> $month,
+                               'current_year'                                  
=> $year,
                        );
                        
-                       self::render_template_xsl( 
array('calendar/view_calendar_month_for_locations', 
'calendar/check_list_status_checker', 'calendar/icon_color_map'), $data);
+                       self::render_template_xsl( 
array('calendar/view_calendar_month_for_locations', 
'calendar/check_list_status_checker', 
+                                                                               
         'calendar/icon_color_map', 'calendar/select_my_locations'), $data);
+                       
                        self::add_javascript('controller', 'controller', 
'jquery.js');
                        self::add_javascript('controller', 'controller', 
'ajax.js');
                }

Modified: trunk/controller/inc/component/class.year_calendar.inc.php
===================================================================
--- trunk/controller/inc/component/class.year_calendar.inc.php  2012-05-13 
21:23:16 UTC (rev 9387)
+++ trunk/controller/inc/component/class.year_calendar.inc.php  2012-05-14 
06:15:23 UTC (rev 9388)
@@ -76,4 +76,14 @@
                return $this->calendar_array;
        }
        
+       public static function get_heading_array(){
+                       
+               $heading_array = array();
+               
+               for($i=1;$i<=12;$i++){
+                       $heading_array[$i] = "$i";      
+               }
+               
+               return $heading_array;
+       }
 }
\ No newline at end of file

Modified: trunk/controller/js/controller/ajax.js
===================================================================
--- trunk/controller/js/controller/ajax.js      2012-05-13 21:23:16 UTC (rev 
9387)
+++ trunk/controller/js/controller/ajax.js      2012-05-14 06:15:23 UTC (rev 
9388)
@@ -109,7 +109,12 @@
                                        htmlString  += "<option>Ingen 
kontroller</option>"
                                        $("#cat_id").html( htmlString );
                                }
-                         }  
+                         }
+                 error: function(XMLHttpRequest, textStatus, errorThrown) {
+                   if (XMLHttpRequest.status === 401) {
+                     location.href = '/';
+                   }
+                 }
                        });
                        
     });

Added: trunk/controller/templates/base/calendar/select_my_locations.xsl
===================================================================
--- trunk/controller/templates/base/calendar/select_my_locations.xsl            
                (rev 0)
+++ trunk/controller/templates/base/calendar/select_my_locations.xsl    
2012-05-14 06:15:23 UTC (rev 9388)
@@ -0,0 +1,31 @@
+<!-- $Id: view_calendar_month.xsl 9200 2012-04-21 20:05:34Z vator $ -->
+<xsl:template name="select_my_locations" xmlns:php="http://php.net/xsl";>
+
+<form action="#">
+       <input type="hidden" name="period_type" value="view_year" />
+       <input type="hidden" name="year">
+      <xsl:attribute name="value">
+       <xsl:value-of select="current_year"/>
+      </xsl:attribute>
+       </input>
+
+       <select id="choose_my_location">
+               <xsl:for-each select="my_locations">
+                       <xsl:variable name="loc_code"><xsl:value-of 
select="current_location/location_code"/></xsl:variable>
+                       <xsl:choose>
+                               <xsl:when test="location_code = 
current_location/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>                                       
+</form>
+                               
+</xsl:template>


Property changes on: 
trunk/controller/templates/base/calendar/select_my_locations.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Modified: trunk/controller/templates/base/calendar/view_calendar_month.xsl
===================================================================
--- trunk/controller/templates/base/calendar/view_calendar_month.xsl    
2012-05-13 21:23:16 UTC (rev 9387)
+++ trunk/controller/templates/base/calendar/view_calendar_month.xsl    
2012-05-14 06:15:23 UTC (rev 9388)
@@ -1,8 +1,6 @@
 <!-- $Id$ -->
-<xsl:template match="data" name="view_check_lists" 
xmlns:php="http://php.net/xsl";>
+<xsl:template match="data" xmlns:php="http://php.net/xsl";>
 <xsl:variable name="date_format">d/m-Y</xsl:variable>
-<xsl:variable name="location_code"><xsl:value-of 
select="location_array/location_code"/></xsl:variable>
-<xsl:variable name="view_location_code"><xsl:value-of 
select="view_location_code"/></xsl:variable>
 
 <div id="main_content">
        <div id="control_plan">
@@ -11,36 +9,13 @@
                        <xsl:variable name="month_str">month <xsl:value-of 
select="current_month_nr"/> capitalized</xsl:variable>
                        <h3>Kalenderoversikt for <xsl:value-of 
select="php:function('lang', $month_str)" /><span class="year"><xsl:value-of 
select="current_year"/></span></h3>
                
-                       <form action="#">
-                               <input type="hidden" name="period_type" 
value="view_year" />
-                               <input type="hidden" name="year">
-                             <xsl:attribute name="value">
-                               <xsl:value-of select="year"/>
-                             </xsl:attribute>
-                               </input>
-
-                               <select id="choose_my_location">
-                                       <xsl:for-each select="my_locations">
-                                               <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>                                       
-                       </form>
+                       <!-- =====================  SELECT MY LOCATIONS  
================= -->
+                       <xsl:call-template name="select_my_locations" />
                </div>
                
                <div class="middle">
                        
+                       <!-- =====================  COLOR ICON MAP  
================= -->
                        <xsl:call-template name="icon_color_map" />
                        
                        <a id="showYear">
@@ -151,12 +126,12 @@
                <div id="cal_wrp">
                        <table id="calendar" class="month">
                                <tr class="heading">
-                                               <th 
class="title"><span>Tittel</span></th>
-                                               <th 
class="assigned"><span>Tildelt</span></th>
-                                               <th 
class="frequency"><span>Frekvens</span></th>
-                                               <xsl:for-each 
select="heading_array">
-                                                       <th><span><xsl:value-of 
select="."/></span></th>
-                                               </xsl:for-each>
+                                       <th 
class="title"><span>Tittel</span></th>
+                                       <th 
class="assigned"><span>Tildelt</span></th>
+                                       <th 
class="frequency"><span>Frekvens</span></th>
+                                       <xsl:for-each select="heading_array">
+                                               <th><span><xsl:value-of 
select="."/></span></th>
+                                       </xsl:for-each>
                                </tr>
                                <xsl:choose>    
                                        <xsl:when 
test="controls_calendar_array/child::node()">
@@ -199,7 +174,7 @@
                                <xsl:for-each select="calendar_array">
                                        
                                        <xsl:call-template 
name="check_list_status_checker" >
-                                               <xsl:with-param 
name="location_code"><xsl:value-of 
select="$view_location_code"/></xsl:with-param>
+                                               <xsl:with-param 
name="location_code"><xsl:value-of 
select="current_location/location_code"/></xsl:with-param>
                                        </xsl:call-template>
                                        
                                </xsl:for-each>

Modified: 
trunk/controller/templates/base/calendar/view_calendar_month_for_locations.xsl
===================================================================
--- 
trunk/controller/templates/base/calendar/view_calendar_month_for_locations.xsl  
    2012-05-13 21:23:16 UTC (rev 9387)
+++ 
trunk/controller/templates/base/calendar/view_calendar_month_for_locations.xsl  
    2012-05-14 06:15:23 UTC (rev 9388)
@@ -1,8 +1,6 @@
 <!-- $Id: view_calendar_year.xsl 9206 2012-04-23 06:21:38Z vator $ -->
 <xsl:template match="data"  xmlns:php="http://php.net/xsl";>
 <xsl:variable name="date_format">d/m-Y</xsl:variable>
-<xsl:variable name="current_year"><xsl:value-of 
select="current_year"/></xsl:variable>
-<xsl:variable name="current_month"><xsl:value-of 
select="current_month"/></xsl:variable>
 
 <div id="main_content">
        <div id="control_plan">
@@ -35,7 +33,7 @@
                                <xsl:attribute name="href">
                                        
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_year_for_locations</xsl:text>
                                        <xsl:text>&amp;year=</xsl:text>
-                                       <xsl:value-of select="year"/>
+                                       <xsl:value-of select="current_year"/>
                                        <xsl:text>&amp;control_id=</xsl:text>
                                        <xsl:value-of select="control/id"/>
                                </xsl:attribute>

Modified: trunk/controller/templates/base/calendar/view_calendar_year.xsl
===================================================================
--- trunk/controller/templates/base/calendar/view_calendar_year.xsl     
2012-05-13 21:23:16 UTC (rev 9387)
+++ trunk/controller/templates/base/calendar/view_calendar_year.xsl     
2012-05-14 06:15:23 UTC (rev 9388)
@@ -1,8 +1,6 @@
 <!-- $Id$ -->
 <xsl:template match="data"  xmlns:php="http://php.net/xsl";>
 <xsl:variable name="date_format">d/m-Y</xsl:variable>
-<xsl:variable name="year"><xsl:value-of select="year"/></xsl:variable>
-<xsl:variable name="view_location_code"><xsl:value-of 
select="view_location_code"/></xsl:variable>
 
 <div id="main_content">
 
@@ -11,35 +9,13 @@
                        <h1>Kontrollplan for bygg/eiendom: <xsl:value-of 
select="current_location/loc1_name"/></h1>
                        <h3>Kalenderoversikt for <span 
class="year"><xsl:value-of select="current_year"/></span></h3>
                        
-                       <form action="#">
-                               <input type="hidden" name="period_type" 
value="view_year" />
-                               <input type="hidden" name="year">
-                             <xsl:attribute name="value">
-                               <xsl:value-of select="year"/>
-                             </xsl:attribute>
-                               </input>
-
-                               <select id="choose_my_location">
-                                       <xsl:for-each select="my_locations">
-                                               <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>                                       
-                       </form>
+                       <!-- =====================  SELECT MY LOCATIONS  
================= -->
+                       <xsl:call-template name="select_my_locations" />
+                       
                </div>
                <div class="middle">
                                        
+                       <!-- =====================  COLOR ICON MAP  
================= -->
                        <xsl:call-template name="icon_color_map" />
                        
                        <div id="calNav">
@@ -81,7 +57,7 @@
                                                                        
<xsl:text>&amp;year=</xsl:text>
                                                                        
<xsl:value-of select="//current_year"/>
                                                                        
<xsl:text>&amp;location_code=</xsl:text>
-                                                                       
<xsl:value-of select="$view_location_code"/>
+                                                                       
<xsl:value-of select="current_location/location_code"/>
                                                                        
<xsl:text>&amp;month=</xsl:text>
                                                                        
<xsl:number/>
                                                                </xsl:attribute>
@@ -133,7 +109,7 @@
                                                        </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="$view_location_code"/></xsl:with-param>
+                                                                       
<xsl:with-param name="location_code"><xsl:value-of 
select="current_location/location_code"/></xsl:with-param>
                                                                
</xsl:call-template>
                                                        </xsl:for-each>
                                        </tr>   

Modified: 
trunk/controller/templates/base/calendar/view_calendar_year_for_locations.xsl
===================================================================
--- 
trunk/controller/templates/base/calendar/view_calendar_year_for_locations.xsl   
    2012-05-13 21:23:16 UTC (rev 9387)
+++ 
trunk/controller/templates/base/calendar/view_calendar_year_for_locations.xsl   
    2012-05-14 06:15:23 UTC (rev 9388)
@@ -1,7 +1,6 @@
 <!-- $Id: view_calendar_year.xsl 9206 2012-04-23 06:21:38Z vator $ -->
 <xsl:template match="data"  xmlns:php="http://php.net/xsl";>
 <xsl:variable name="date_format">d/m-Y</xsl:variable>
-<xsl:variable name="year"><xsl:value-of select="year"/></xsl:variable>
 
 <div id="main_content">
 
@@ -10,26 +9,15 @@
                        <h1>Kontrollplan for <xsl:value-of 
select="control/title"/></h1>
                        <h3>Periode: <xsl:value-of select="period"/></h3>
                        
-                       <form action="#">
-                               <input type="hidden" name="period_type" 
value="view_year" />
-                               <input type="hidden" name="year">
-                             <xsl:attribute name="value">
-                               <xsl:value-of select="year"/>
-                             </xsl:attribute>
-                               </input>
-
-                               <select id="choose_my_location">
-                                       <xsl:for-each select="my_locations">
-                                               <xsl:variable 
name="loc_code"><xsl:value-of select="location_code"/></xsl:variable>
-                                               <option value="{$loc_code}">
-                                                       <xsl:value-of 
disable-output-escaping="yes" select="loc1_name"/>
-                                               </option>
-                                       </xsl:for-each>
-                               </select>                                       
-                       </form>
+                       <!-- =====================  SELECT MY LOCATIONS  
================= -->
+                       <xsl:call-template name="select_my_locations" />
+                       
                </div>
                <div class="middle">
+               
+                       <!-- =====================  COLOR ICON MAP  
================= -->
                        <xsl:call-template name="icon_color_map" />
+                       
                </div>
                <div id="cal_wrp">
                        <table id="calendar">
@@ -46,13 +34,15 @@
                                                                <xsl:attribute 
name="href">
                                                                        
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_month_for_locations</xsl:text>
                                                                        
<xsl:text>&amp;year=</xsl:text>
-                                                                       
<xsl:value-of select="$current_year"/>
+                                                                       
<xsl:value-of select="current_year"/>
                                                                        
<xsl:text>&amp;month=</xsl:text>
                                                                        
<xsl:number/>
                                                                        
<xsl:text>&amp;control_id=</xsl:text>
                                                                        
<xsl:value-of select="//control/id"/>
                                                                </xsl:attribute>
-                                                               <xsl:value-of 
select="."/>
+                                                               
+                                                               <xsl:variable 
name="month_str">short_month <xsl:value-of select="."/> 
capitalized</xsl:variable>
+                                                               <xsl:value-of 
select="php:function('lang', $month_str)" />
                                                        </a>                    
        
                                                </th>
                                        </xsl:for-each>

Modified: trunk/controller/templates/base/css/base.css
===================================================================
--- trunk/controller/templates/base/css/base.css        2012-05-13 21:23:16 UTC 
(rev 9387)
+++ trunk/controller/templates/base/css/base.css        2012-05-14 06:15:23 UTC 
(rev 9388)
@@ -1042,7 +1042,7 @@
 }
 #calNav .current {
     font-size: 21px;
-    padding-left: 230px;
+    padding-left: 200px;
 }
 /* ======================  CALENDAR INFO BOX ========================== */
 




reply via email to

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