[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [11325] bkbooking: stavanger open application from ca
From: |
Kjell Arne Espedal |
Subject: |
[Fmsystem-commits] [11325] bkbooking: stavanger open application from calendar i connectet to season for building |
Date: |
Thu, 26 Sep 2013 06:54:06 +0000 |
Revision: 11325
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11325
Author: kjell
Date: 2013-09-26 06:53:59 +0000 (Thu, 26 Sep 2013)
Log Message:
-----------
bkbooking: stavanger open application from calendar i connectet to season for
building
Modified Paths:
--------------
branches/stavangerkommune/booking/inc/class.sobuilding.inc.php
branches/stavangerkommune/booking/js/booking/schedule.js
branches/stavangerkommune/bookingfrontend/inc/class.uibuilding.inc.php
branches/stavangerkommune/bookingfrontend/templates/stavanger/building_schedule.xsl
Modified: branches/stavangerkommune/booking/inc/class.sobuilding.inc.php
===================================================================
--- branches/stavangerkommune/booking/inc/class.sobuilding.inc.php
2013-09-25 16:23:28 UTC (rev 11324)
+++ branches/stavangerkommune/booking/inc/class.sobuilding.inc.php
2013-09-26 06:53:59 UTC (rev 11325)
@@ -34,6 +34,16 @@
);
}
+ function get_endofseason($id)
+ {
+ $this->db->limit_query("SELECT to_ FROM bb_season WHERE
status = 'PUBLISHED' AND active=1 AND building_id =" . intval($id), 0,
__LINE__, __FILE__, 1);
+ if(!$this->db->next_record())
+ {
+ return false;
+ }
+ return $this->db->f('to_', false);
+ }
+
function get_metainfo($id)
{
$this->db->limit_query("SELECT name, district, city,
description FROM bb_building where id=" . intval($id), 0, __LINE__, __FILE__,
1);
Modified: branches/stavangerkommune/booking/js/booking/schedule.js
===================================================================
--- branches/stavangerkommune/booking/js/booking/schedule.js 2013-09-25
16:23:28 UTC (rev 11324)
+++ branches/stavangerkommune/booking/js/booking/schedule.js 2013-09-26
06:53:59 UTC (rev 11325)
@@ -35,7 +35,7 @@
if(booking) {
if(!colorMap[booking.name]) {
colorMap[booking.name] = colors.length ? colors.shift()
: 'color60';
- }
+ }1
var color = colorMap[booking.name];
YAHOO.util.Dom.addClass(elCell, 'info');
YAHOO.util.Dom.addClass(elCell, color);
@@ -215,7 +215,10 @@
weekday[5]="friday";
weekday[6]="saturday";
url += '&from_[]=' + state + _from + '&to_[]=' + state + _to +
'&resource=' + resource + '&weekday=' + weekday[day];
- window.location.href = url;
+ if (YAHOO.booking.endOfSeason > date) {
+ window.location.href = url;
+ }
+
}
YAHOO.booking.setupWeekPicker = function(container) {
Modified: branches/stavangerkommune/bookingfrontend/inc/class.uibuilding.inc.php
===================================================================
--- branches/stavangerkommune/bookingfrontend/inc/class.uibuilding.inc.php
2013-09-25 16:23:28 UTC (rev 11324)
+++ branches/stavangerkommune/bookingfrontend/inc/class.uibuilding.inc.php
2013-09-26 06:53:59 UTC (rev 11325)
@@ -24,6 +24,11 @@
} else {
$building['application_link'] =
self::link(array('menuaction' => 'bookingfrontend.uibuilding.schedule', 'id' =>
$building['id']));
}
+
+ $building['endOfSeason'] =
$this->bo->so->get_endOfSeason($building['id'])." 23:59:59";
+ if (strlen($building['endOfSeason']) < 18) {
+ $building['endOfSeason'] = false;
+ }
$building['datasource_url'] = self::link(array(
'menuaction' =>
'bookingfrontend.uibooking.building_schedule',
'building_id' => $building['id'],
@@ -36,7 +41,7 @@
{
$building['date'] = phpgw::get_var('date',
'GET');
}
-
+
self::add_javascript('booking', 'booking',
'schedule.js');
self::render_template('building_schedule',
array('building' => $building, 'backend' => $backend));
}
@@ -45,15 +50,7 @@
{
$backend = phpgw::get_var('backend', 'GET');
$building =
$this->bo->get_schedule(phpgw::get_var('id', 'GET'),
'bookingfrontend.uibuilding');
- if ($building['deactivate_application'] == 0) {
- $building['application_link'] =
self::link(array(
- 'menuaction' =>
'bookingfrontend.uiapplication.add',
- 'building_id' => $building['id'],
- 'building_name' => $building['name'],
- ));
- } else {
- $building['application_link'] =
self::link(array('menuaction' => 'bookingfrontend.uibuilding.extraschedule',
'id' => $building['id']));
- }
+ $building['application_link'] =
self::link(array('menuaction' => 'bookingfrontend.uibuilding.extraschedule',
'id' => $building['id']));
$building['datasource_url'] = self::link(array(
'menuaction' =>
'bookingfrontend.uibooking.building_extraschedule',
'building_id' => $building['id'],
Modified:
branches/stavangerkommune/bookingfrontend/templates/stavanger/building_schedule.xsl
===================================================================
---
branches/stavangerkommune/bookingfrontend/templates/stavanger/building_schedule.xsl
2013-09-25 16:23:28 UTC (rev 11324)
+++
branches/stavangerkommune/bookingfrontend/templates/stavanger/building_schedule.xsl
2013-09-26 06:53:59 UTC (rev 11325)
@@ -38,11 +38,13 @@
YAHOO.booking.setupWeekPicker('cal_container');
YAHOO.booking.datasourceUrl = '<xsl:value-of
select="building/datasource_url"/>';
YAHOO.booking.newApplicationUrl = '<xsl:value-of
select="building/application_link"/>';
-
+ YAHOO.booking.endOfSeason = parseISO8601('<xsl:value-of
select="building/endOfSeason"/>');
+
var handleHistoryNavigation = function (state) {
YAHOO.booking.date = parseISO8601(state);
YAHOO.booking.renderSchedule('schedule_container',
YAHOO.booking.datasourceUrl, YAHOO.booking.date,
YAHOO.booking.frontendScheduleColorFormatter, true);
};
+
var initialRequest = YAHOO.util.History.getBookmarkedState("date") ||
'<xsl:value-of select="building/date"/>';
YAHOO.util.History.register("date", initialRequest,
handleHistoryNavigation);
YAHOO.util.History.onReady(function() {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [11325] bkbooking: stavanger open application from calendar i connectet to season for building,
Kjell Arne Espedal <=