[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [9813]
From: |
Torstein |
Subject: |
[Fmsystem-commits] [9813] |
Date: |
Fri, 20 Jul 2012 12:27:59 +0000 |
Revision: 9813
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9813
Author: vator
Date: 2012-07-20 12:27:59 +0000 (Fri, 20 Jul 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/controller/inc/class.uicalendar.inc.php
trunk/controller/inc/component/class.month_calendar.inc.php
trunk/controller/inc/component/class.year_calendar_agg.inc.php
trunk/controller/templates/base/calendar/check_list_status_manager.xsl
trunk/controller/templates/base/calendar/nav_calendar_month.xsl
trunk/controller/templates/base/calendar/nav_calendar_year.xsl
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
Modified: trunk/controller/inc/class.uicalendar.inc.php
===================================================================
--- trunk/controller/inc/class.uicalendar.inc.php 2012-07-20 10:27:57 UTC
(rev 9812)
+++ trunk/controller/inc/class.uicalendar.inc.php 2012-07-20 12:27:59 UTC
(rev 9813)
@@ -422,7 +422,7 @@
// Validates year. If year is not set, current year is
chosen
$year = $this->validate_year($year);
-
+
// Gets timestamp of first day in year
$from_date_ts = $this->get_start_date_year_ts($year);
@@ -431,7 +431,7 @@
$locations_with_calendar_array = array();
- // Process aggregated values for controls with repeat
type day or week
+ // LOCATIONS: Process aggregated values for controls
with repeat type day or week
if( $control->get_repeat_type() <=
controller_control::REPEAT_TYPE_WEEK )
{
foreach($locations_for_control_array as
$location)
@@ -452,7 +452,8 @@
$calendar_array =
$year_calendar->build_calendar($agg_open_cases_pr_month_array);
$locations_with_calendar_array[] =
array( "location" => $location, "calendar_array" => $calendar_array );
}
-
+
+ // COMPONENTS: Process aggregated values for
controls with repeat type day or week
foreach( $components_for_control_array as $component )
{
$short_desc_arr =
execMethod('property.soentity.get_short_description', array('location_id' =>
$component->get_location_id(), 'id' => $component->get_id()));
@@ -529,7 +530,7 @@
);
self::render_template_xsl(
array('calendar/view_calendar_year_for_locations',
'calendar/check_list_status_manager',
-
'calendar/icon_color_map', 'calendar/select_my_locations'), $data);
+
'calendar/icon_color_map', 'calendar/select_my_locations',
'calendar/nav_calendar_year'), $data);
self::add_javascript('controller', 'controller',
'jquery.js');
self::add_javascript('controller', 'controller',
'ajax.js');
@@ -588,7 +589,7 @@
$check_lists_array =
$component_with_check_lists["check_lists_array"];
$month_calendar = new month_calendar( $control,
$year, $month, $component, null, "component" );
- $calendar_array =
$month_calendar->build_calendar( $control->get_check_lists_array() );
+ $calendar_array =
$month_calendar->build_calendar( $check_lists_array );
$components_with_calendar_array[] =
array("component" => $component->toArray(), "calendar_array" =>
$calendar_array);
}
@@ -613,7 +614,7 @@
);
self::render_template_xsl(
array('calendar/view_calendar_month_for_locations',
'calendar/check_list_status_manager',
-
'calendar/icon_color_map', 'calendar/select_my_locations'), $data);
+
'calendar/icon_color_map', 'calendar/select_my_locations',
'calendar/nav_calendar_month'), $data);
self::add_javascript('controller', 'controller',
'jquery.js');
self::add_javascript('controller', 'controller',
'ajax.js');
@@ -797,9 +798,7 @@
function get_start_date_year_ts($year)
{
- $start_date_year_ts = strtotime("01/01/$year");
-
- return $start_date_year_ts;
+ return strtotime("01/01/$year");
}
function get_end_date_year_ts($year)
Modified: trunk/controller/inc/component/class.month_calendar.inc.php
===================================================================
--- trunk/controller/inc/component/class.month_calendar.inc.php 2012-07-20
10:27:57 UTC (rev 9812)
+++ trunk/controller/inc/component/class.month_calendar.inc.php 2012-07-20
12:27:59 UTC (rev 9813)
@@ -75,8 +75,8 @@
}
}
- public function build_calendar( $check_lists_array ){
-
+ public function build_calendar( $check_lists_array )
+ {
foreach($check_lists_array as $check_list){
$check_list_status_manager = new
check_list_status_manager( $check_list );
$check_list_status_info =
$check_list_status_manager->get_status_for_check_list();
Modified: trunk/controller/inc/component/class.year_calendar_agg.inc.php
===================================================================
--- trunk/controller/inc/component/class.year_calendar_agg.inc.php
2012-07-20 10:27:57 UTC (rev 9812)
+++ trunk/controller/inc/component/class.year_calendar_agg.inc.php
2012-07-20 12:27:59 UTC (rev 9813)
@@ -32,7 +32,7 @@
{
$this->calendar_array[ $month_nr ] = null;
}
- else if( $month_nr < date("m") )
+ else if( ($month_nr < date("m")) && (date("Y",
$this->control->get_start_date()) == $this->year) )
{
$this->calendar_array[ $month_nr ]["status"] =
"CONTROLS_NOT_DONE";
$this->calendar_array[ $month_nr ]["info"] = array("view" =>
"LOCATIONS_FOR_CONTROL", "control_id" => $this->control->get_id(), "year" =>
$this->year, "month" => $month_nr);
Modified: trunk/controller/templates/base/calendar/check_list_status_manager.xsl
===================================================================
--- trunk/controller/templates/base/calendar/check_list_status_manager.xsl
2012-07-20 10:27:57 UTC (rev 9812)
+++ trunk/controller/templates/base/calendar/check_list_status_manager.xsl
2012-07-20 12:27:59 UTC (rev 9813)
@@ -136,11 +136,18 @@
<div id="info_box"></div>
<a class="view_info_box">
<xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
-
<xsl:text>&control_id=</xsl:text>
- <xsl:value-of
select="info/control_id"/>
-
<xsl:text>&location_code=</xsl:text>
- <xsl:value-of
select="info/location_code"/>
+ <xsl:choose>
+ <xsl:when
test="info/view = 'LOCATIONS_FOR_CONTROL'">
+
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_month_for_locations</xsl:text>
+
<xsl:text>&control_id=</xsl:text>
+
<xsl:value-of select="info/control_id"/>
+ </xsl:when>
+ <xsl:otherwise>
+
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
+
<xsl:text>&location_code=</xsl:text>
+ <xsl:value-of
select="info/location_code"/>
+ </xsl:otherwise>
+ </xsl:choose>
<xsl:text>&year=</xsl:text>
<xsl:value-of
select="//current_year"/>
<xsl:text>&month=</xsl:text>
@@ -155,50 +162,43 @@
</div>
</xsl:when>
<xsl:when test="status = 'CONTROLS_NOT_DONE'">
- <div class="info_box_wrp">
- <div id="info_box"></div>
- <a class="view_info_box">
- <xsl:attribute name="href">
- <xsl:choose>
- <xsl:when
test="info/view = 'LOCATIONS_FOR_CONTROL'">
-
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_month_for_location</xsl:text>
- </xsl:when>
- <xsl:otherwise>
-
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
-
<xsl:text>&control_id=</xsl:text>
- <xsl:value-of
select="info/control_id"/>
-
<xsl:text>&location_code=</xsl:text>
- <xsl:value-of
select="info/location_code"/>
-
<xsl:text>&year=</xsl:text>
- <xsl:value-of
select="//current_year"/>
-
<xsl:text>&month=</xsl:text>
- <xsl:number />
- </xsl:attribute>
- <span class="ext_info">
-
<xsl:text>&check_list_id=</xsl:text><xsl:value-of
select="info/check_list_id"/>
-
<xsl:text>&phpgw_return_as=json</xsl:text>
- </span>
- <xsl:value-of
select="info/agg_open_errors"/>
- </a>
- </div>
+ <a>
+ <xsl:attribute name="href">
+ <xsl:choose>
+ <xsl:when
test="info/view = 'LOCATIONS_FOR_CONTROL'">
+
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_month_for_locations</xsl:text>
+
<xsl:text>&control_id=</xsl:text>
+
<xsl:value-of select="info/control_id"/>
+ </xsl:when>
+ <xsl:otherwise>
+
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
+
<xsl:text>&location_code=</xsl:text>
+ <xsl:value-of
select="info/location_code"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>&year=</xsl:text>
+ <xsl:value-of
select="//current_year"/>
+ <xsl:text>&month=</xsl:text>
+ <xsl:number />
+ </xsl:attribute>
+ <img height="15"
src="controller/images/status_icon_red_cross.png" />
+ </a>
</xsl:when>
<xsl:when test="status = 'CONTROLS_REGISTERED'">
<a>
<xsl:attribute name="href">
<xsl:choose>
- <xsl:when
test="info/view = 'LOCATIONS_FOR_CONTROL'">
-
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_month_for_locations</xsl:text>
-
<xsl:text>&control_id=</xsl:text>
-
<xsl:value-of select="info/control_id"/>
- </xsl:when>
- <xsl:otherwise>
-
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
-
<xsl:text>&location_code=</xsl:text>
-
<xsl:value-of select="info/location_code"/>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:when
test="info/view = 'LOCATIONS_FOR_CONTROL'">
+
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_month_for_locations</xsl:text>
+
<xsl:text>&control_id=</xsl:text>
+
<xsl:value-of select="info/control_id"/>
+ </xsl:when>
+ <xsl:otherwise>
+
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
+
<xsl:text>&location_code=</xsl:text>
+ <xsl:value-of
select="info/location_code"/>
+ </xsl:otherwise>
+ </xsl:choose>
<xsl:text>&month=</xsl:text>
<xsl:value-of select="info/month"/>
<xsl:text>&year=</xsl:text>
Modified: trunk/controller/templates/base/calendar/nav_calendar_month.xsl
===================================================================
--- trunk/controller/templates/base/calendar/nav_calendar_month.xsl
2012-07-20 10:27:57 UTC (rev 9812)
+++ trunk/controller/templates/base/calendar/nav_calendar_month.xsl
2012-07-20 12:27:59 UTC (rev 9813)
@@ -1,18 +1,30 @@
<!-- $Id: view_calendar_month.xsl 9200 2012-04-21 20:05:34Z vator $ -->
<xsl:template name="nav_calendar_month" xmlns:php="http://php.net/xsl">
+<xsl:param name="view" />
+
<div id="calNav">
<xsl:choose>
<xsl:when test="current_month_nr > 1">
<a class="showPrev month">
<xsl:attribute name="href">
+ <xsl:choose>
+ <xsl:when test="$view =
'LOCATIONS_FOR_CONTROL'">
+
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_month_for_locations</xsl:text>
+
<xsl:text>&control_id=</xsl:text>
+
<xsl:value-of select="control/id" />
+ </xsl:when>
+ <xsl:otherwise>
+
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
+
<xsl:text>&location_code=</xsl:text>
+ <xsl:value-of
select="//current_location/location_code"/>
+ </xsl:otherwise>
+ </xsl:choose>
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
<xsl:text>&year=</xsl:text>
<xsl:value-of select="current_year"/>
<xsl:text>&month=</xsl:text>
<xsl:value-of select="current_month_nr
- 1"/>
- <xsl:text>&location_code=</xsl:text>
- <xsl:value-of
select="//current_location/location_code"/>
</xsl:attribute>
<img height="17"
src="controller/images/left_arrow_simple_light_blue.png" />
<xsl:variable name="month_str">month
<xsl:value-of select="current_month_nr - 1"/> capitalized</xsl:variable>
@@ -22,12 +34,21 @@
<xsl:otherwise>
<a class="showPrev month">
<xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
+ <xsl:choose>
+ <xsl:when test="$view =
'LOCATIONS_FOR_CONTROL'">
+
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_month_for_locations</xsl:text>
+
<xsl:text>&control_id=</xsl:text>
+
<xsl:value-of select="control/id" />
+ </xsl:when>
+ <xsl:otherwise>
+
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
+
<xsl:text>&location_code=</xsl:text>
+ <xsl:value-of
select="//current_location/location_code"/>
+ </xsl:otherwise>
+ </xsl:choose>
<xsl:text>&year=</xsl:text>
<xsl:value-of select="current_year -
1"/>
<xsl:text>&month=12</xsl:text>
- <xsl:text>&location_code=</xsl:text>
- <xsl:value-of
select="//current_location/location_code"/>
</xsl:attribute>
<img height="17"
src="controller/images/left_arrow_simple_light_blue.png" />
<xsl:variable name="month_str">month 12
capitalized</xsl:variable>
@@ -44,13 +65,22 @@
<xsl:when test="12 > current_month_nr">
<a class="showNext">
<xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
+ <xsl:choose>
+ <xsl:when test="$view =
'LOCATIONS_FOR_CONTROL'">
+
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_month_for_locations</xsl:text>
+
<xsl:text>&control_id=</xsl:text>
+
<xsl:value-of select="control/id" />
+ </xsl:when>
+ <xsl:otherwise>
+
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
+
<xsl:text>&location_code=</xsl:text>
+ <xsl:value-of
select="//current_location/location_code"/>
+ </xsl:otherwise>
+ </xsl:choose>
<xsl:text>&year=</xsl:text>
<xsl:value-of select="current_year"/>
<xsl:text>&month=</xsl:text>
<xsl:value-of select="current_month_nr
+ 1"/>
- <xsl:text>&location_code=</xsl:text>
- <xsl:value-of
select="//current_location/location_code"/>
</xsl:attribute>
<xsl:variable name="month_str">month
<xsl:value-of select="current_month_nr + 1"/> capitalized</xsl:variable>
<xsl:value-of select="php:function('lang',
$month_str)" />
@@ -60,12 +90,21 @@
<xsl:otherwise>
<a class="showNext">
<xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
+ <xsl:choose>
+ <xsl:when test="$view =
'LOCATIONS_FOR_CONTROL'">
+
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_month_for_locations</xsl:text>
+
<xsl:text>&control_id=</xsl:text>
+
<xsl:value-of select="control/id" />
+ </xsl:when>
+ <xsl:otherwise>
+
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
+
<xsl:text>&location_code=</xsl:text>
+ <xsl:value-of
select="//current_location/location_code"/>
+ </xsl:otherwise>
+ </xsl:choose>
<xsl:text>&year=</xsl:text>
<xsl:value-of select="current_year +
1"/>
<xsl:text>&month=1</xsl:text>
- <xsl:text>&location_code=</xsl:text>
- <xsl:value-of
select="//current_location/location_code"/>
</xsl:attribute>
<xsl:variable name="month_str">month 1
capitalized</xsl:variable>
<xsl:value-of select="php:function('lang',
$month_str)" />
Modified: trunk/controller/templates/base/calendar/nav_calendar_year.xsl
===================================================================
--- trunk/controller/templates/base/calendar/nav_calendar_year.xsl
2012-07-20 10:27:57 UTC (rev 9812)
+++ trunk/controller/templates/base/calendar/nav_calendar_year.xsl
2012-07-20 12:27:59 UTC (rev 9813)
@@ -1,14 +1,25 @@
<!-- $Id: view_calendar_month.xsl 9200 2012-04-21 20:05:34Z vator $ -->
<xsl:template name="nav_calendar_year" xmlns:php="http://php.net/xsl">
+<xsl:param name="view" />
+
<div id="calNav">
<a class="showPrev">
<xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_year</xsl:text>
+ <xsl:choose>
+ <xsl:when test="$view =
'LOCATIONS_FOR_CONTROL'">
+
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_year_for_locations</xsl:text>
+
<xsl:text>&control_id=</xsl:text>
+ <xsl:value-of
select="control/id" />
+ </xsl:when>
+ <xsl:otherwise>
+
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_year</xsl:text>
+ <xsl:text>&location_code=</xsl:text>
+ <xsl:value-of
select="//current_location/location_code"/>
+ </xsl:otherwise>
+ </xsl:choose>
<xsl:text>&year=</xsl:text>
<xsl:value-of select="current_year - 1"/>
- <xsl:text>&location_code=</xsl:text>
- <xsl:value-of select="current_location/location_code"/>
</xsl:attribute>
<img height="17"
src="controller/images/left_arrow_simple_light_blue.png" />
<xsl:value-of select="current_year - 1"/>
@@ -18,11 +29,20 @@
</span>
<a class="showNext">
<xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_year</xsl:text>
+ <xsl:choose>
+ <xsl:when test="$view =
'LOCATIONS_FOR_CONTROL'">
+
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_year_for_locations</xsl:text>
+
<xsl:text>&control_id=</xsl:text>
+ <xsl:value-of
select="control/id" />
+ </xsl:when>
+ <xsl:otherwise>
+
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_year</xsl:text>
+ <xsl:text>&location_code=</xsl:text>
+ <xsl:value-of
select="//current_location/location_code"/>
+ </xsl:otherwise>
+ </xsl:choose>
<xsl:text>&year=</xsl:text>
<xsl:value-of select="current_year + 1"/>
- <xsl:text>&location_code=</xsl:text>
- <xsl:value-of select="current_location/location_code"/>
</xsl:attribute>
<xsl:value-of select="current_year + 1"/>
<img height="17"
src="controller/images/right_arrow_simple_light_blue.png" />
Modified: trunk/controller/templates/base/calendar/view_calendar_month.xsl
===================================================================
--- trunk/controller/templates/base/calendar/view_calendar_month.xsl
2012-07-20 10:27:57 UTC (rev 9812)
+++ trunk/controller/templates/base/calendar/view_calendar_month.xsl
2012-07-20 12:27:59 UTC (rev 9813)
@@ -177,11 +177,12 @@
</xsl:call-template>
<!-- ===================== CALENDAR NAVIGATION
================= -->
- <xsl:call-template name="nav_calendar_month" />
+ <xsl:call-template name="nav_calendar_month">
+ <xsl:with-param
name="view">CONTROLS_FOR_LOCATION</xsl:with-param>
+ </xsl:call-template>
</div>
<div id="cal_wrp">
-
<!-- ================================ BUILDINGS TABLE
==================================== -->
<h2>Bygg/eiendom</h2>
<table id="calendar" class="month">
Modified:
trunk/controller/templates/base/calendar/view_calendar_month_for_locations.xsl
===================================================================
---
trunk/controller/templates/base/calendar/view_calendar_month_for_locations.xsl
2012-07-20 10:27:57 UTC (rev 9812)
+++
trunk/controller/templates/base/calendar/view_calendar_month_for_locations.xsl
2012-07-20 12:27:59 UTC (rev 9813)
@@ -13,22 +13,24 @@
<!-- ===================== ICON COLOR MAP
================= -->
<xsl:call-template name="icon_color_map" />
-
- <!-- ===================== CALENDAR NAVIGATION
================= -->
+ <!-- ===================== VIEW OVERVIEW FOR YEAR
================= -->
<div id="calNav">
<a class="showPrev month">
<xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_month_for_locations</xsl:text>
+
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_year_for_locations</xsl:text>
<xsl:text>&year=</xsl:text>
<xsl:value-of
select="current_year"/>
- <xsl:text>&month=</xsl:text>
- <xsl:value-of
select="current_month"/>
<xsl:text>&control_id=</xsl:text>
<xsl:value-of
select="control/id"/>
</xsl:attribute>
Ã…rsoversikt
</a>
</div>
+
+ <!-- ===================== CALENDAR NAVIGATION
================= -->
+ <xsl:call-template name="nav_calendar_month">
+ <xsl:with-param
name="view">LOCATIONS_FOR_CONTROL</xsl:with-param>
+ </xsl:call-template>
</div>
<!-- ===================== CALENDAR ================= -->
Modified: trunk/controller/templates/base/calendar/view_calendar_year.xsl
===================================================================
--- trunk/controller/templates/base/calendar/view_calendar_year.xsl
2012-07-20 10:27:57 UTC (rev 9812)
+++ trunk/controller/templates/base/calendar/view_calendar_year.xsl
2012-07-20 12:27:59 UTC (rev 9813)
@@ -131,6 +131,8 @@
<!-- ===================== CALENDAR NAVIGATION
================= -->
<xsl:call-template name="nav_calendar_year" />
+ <xsl:with-param
name="view">CONTROLS_FOR_LOCATION</xsl:with-param>
+ </xsl:call-template>
</div>
<div id="cal_wrp">
Modified:
trunk/controller/templates/base/calendar/view_calendar_year_for_locations.xsl
===================================================================
---
trunk/controller/templates/base/calendar/view_calendar_year_for_locations.xsl
2012-07-20 10:27:57 UTC (rev 9812)
+++
trunk/controller/templates/base/calendar/view_calendar_year_for_locations.xsl
2012-07-20 12:27:59 UTC (rev 9813)
@@ -15,6 +15,10 @@
<!-- ===================== COLOR ICON MAP
================= -->
<xsl:call-template name="icon_color_map" />
+ <!-- ===================== CALENDAR NAVIGATION
================= -->
+ <xsl:call-template name="nav_calendar_year">
+ <xsl:with-param
name="view">LOCATIONS_FOR_CONTROL</xsl:with-param>
+ </xsl:call-template>
</div>
<div id="cal_wrp">
<h2>Bygg/Eiendom</h2>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [9813],
Torstein <=