[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [14067] add functions to overlay
From: |
Saul |
Subject: |
[Fmsystem-commits] [14067] add functions to overlay |
Date: |
Tue, 29 Sep 2015 23:53:41 +0000 |
Revision: 14067
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14067
Author: psaul
Date: 2015-09-29 23:53:40 +0000 (Tue, 29 Sep 2015)
Log Message:
-----------
add functions to overlay
Modified Paths:
--------------
branches/dev-syncromind/booking/js/booking/schedule.js
Modified: branches/dev-syncromind/booking/js/booking/schedule.js
===================================================================
--- branches/dev-syncromind/booking/js/booking/schedule.js 2015-09-29
23:51:43 UTC (rev 14066)
+++ branches/dev-syncromind/booking/js/booking/schedule.js 2015-09-29
23:53:40 UTC (rev 14067)
@@ -27,7 +27,7 @@
d.setDate(d.getDate() + i);
var x = (i<6) ? i+1 : 0;
schedule.dates[keys[x]] = d;
- colDefs.push({key: keys[x], label: lang['WEEKDAYS_FULL'][x] + '<br>' +
lang['MONTHS_LONG'][d.getMonth()] + ' ' + d.getDate(), formatter: colFormatter,
date: d});
+ colDefs.push({key: keys[x], label: lang['WEEKDAYS_FULL'][x] + '<br>' +
lang['MONTHS_LONG'][d.getMonth()] + ' ' + d.getDate(), formatter: colFormatter,
date: d, day: d.getDate()});
}
var r = [{n: 'ResultSet'},{n: 'Result'}];
// createta d u c r cl
@@ -62,7 +62,7 @@
url = url.substr(0, (url.indexOf("#date")));
url += '#date=' + date.getFullYear() + '-' + (date.getMonth()+1) + '-' +
date.getDate();
location.replace(url);
- schedule.renderSchedule('schedule_container', schedule.datasourceUrl,
date, schedule.backendScheduleColorFormatter, schedule.includeResource);
+ schedule.renderSchedule('schedule_container', schedule.datasourceUrl,
date, schedule.colFormatter, schedule.includeResource);
schedule.date = date;
}
@@ -95,7 +95,61 @@
location.reload();
};
+schedule.newApplicationForm = function(date, _from, _to, resource) {
+ resource = (resource) ? resource : null;
+ date = (date) ? date : schedule.date;
+ _from = _from ? '%20' + _from: '';
+ _to = _to ? '%20' + _to: '';
+ var url = schedule.newApplicationUrl;
+ var state = date.getFullYear() + '-' + (date.getMonth()+1) + '-' +
date.getDate();
+ var day = date.getDay();
+ var weekday=new Array(7);
+ weekday[0]="sunday";
+ weekday[1]="monday";
+ weekday[2]="tuesday";
+ weekday[3]="wednesday";
+ weekday[4]="thursday";
+ weekday[5]="friday";
+ weekday[6]="saturday";
+ url += '&from_[]=' + state + _from + '&to_[]=' + state + _to +
'&resource=' + resource + '&weekday=' + weekday[day];
+ window.location.href = url;
+}
+schedule.showInfo = function(url, resource) {
+ var content_overlay = document.getElementById('content_overlay');
+ var overlay = document.createElement('div');
+ var img = document.createElement('img');
+
img.setAttribute('src','/portico/phpgwapi/templates/pure/images/loading_overlay.gif');
+ overlay.appendChild(img);
+ content_overlay.appendChild(overlay);
+ var hc = $('#content_overlay').height();
+ var ho = $('#schedule_overlay').height();
+ var top = (hc-(ho+42))/2;
+ overlay.style.top = top+"px";
+ overlay.style.display = 'block';
+ resource = (resource) ? resource : null;
+ url = url.replace(/&/gi, '&') + '&resource=' + resource;
+ overlay.setAttribute('id', 'schedule_overlay');
+ content_overlay.appendChild(overlay);
+ $.get(url, function(data){
+ overlay.innerHTML = data;
+ var hc = $('#content_overlay').height();
+ var ho = $('#schedule_overlay').height();
+ var top = (hc-(ho+42))/2;
+ overlay.style.top = top+"px";
+ overlay.style.display = 'block';
+ })
+ .fail(function() {
+ $('#schedule_overlay').hide().remove();
+ alert( "Failed to load booking details page" );
+ });
+}
+
+schedule.closeOverlay = function(){
+ $('#schedule_overlay').hide().remove();
+}
+
+
/*
colors = ['color1', 'color2', 'color3', 'color4', 'color5', 'color6',
'color7', 'color8', 'color9', 'color10',
'color11', 'color12', 'color13', 'color14', 'color15',
'color16', 'color17', 'color18', 'color19', 'color20',
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [14067] add functions to overlay,
Saul <=