[WIP] Updated dhtmlx calendar

bzr revid: fme@openerp.com-20121024134859-pru7zenpiz0la8mq
This commit is contained in:
Fabien Meghazi 2012-10-24 15:48:59 +02:00
parent 81e7d9ba3d
commit b79406cb89
202 changed files with 12017 additions and 14724 deletions

View File

@ -9,12 +9,14 @@ OpenERP Web Calendar view.
'version': '2.0',
'depends': ['web'],
'js': [
'static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_debug.js',
'static/lib/dhtmlxScheduler/sources/ext/ext_minical.js',
'static/lib/dhtmlxScheduler/sources/dhtmlxscheduler.js',
'static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_minical.js',
'static/src/js/calendar.js'
],
'css': [
'static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_ext.css',
#'static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler.css',
'static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_dhx_terrace.css',
#'static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_glossy.css',
'static/src/css/web_calendar.css'
],
'qweb' : [

File diff suppressed because one or more lines are too long

View File

@ -1,194 +1,218 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
dhtmlx=function(a){for(var b in a)dhtmlx[b]=a[b];return dhtmlx};
dhtmlx.extend_api=function(a,b,c){var d=window[a];if(d)window[a]=function(a){if(a&&typeof a=="object"&&!a.tagName&&!(a instanceof Array)){var c=d.apply(this,b._init?b._init(a):arguments),g;for(g in dhtmlx)if(b[g])this[b[g]](dhtmlx[g]);for(g in a)if(b[g])this[b[g]](a[g]);else g.indexOf("on")==0&&this.attachEvent(g,a[g])}else c=d.apply(this,arguments);b._patch&&b._patch(this);return c||this},window[a].prototype=d.prototype,c&&dhtmlXHeir(window[a].prototype,c)};
window.dhtmlx||(dhtmlx=function(a){for(var b in a)dhtmlx[b]=a[b];return dhtmlx});
dhtmlx.extend_api=function(a,b,c){var d=window[a];if(d)window[a]=function(a){if(a&&typeof a=="object"&&!a.tagName){var c=d.apply(this,b._init?b._init(a):arguments),g;for(g in dhtmlx)if(b[g])this[b[g]](dhtmlx[g]);for(g in a)if(b[g])this[b[g]](a[g]);else g.indexOf("on")==0&&this.attachEvent(g,a[g])}else c=d.apply(this,arguments);b._patch&&b._patch(this);return c||this},window[a].prototype=d.prototype,c&&dhtmlXHeir(window[a].prototype,c)};
dhtmlxAjax={get:function(a,b){var c=new dtmlXMLLoaderObject(!0);c.async=arguments.length<3;c.waitCall=b;c.loadXML(a);return c},post:function(a,b,c){var d=new dtmlXMLLoaderObject(!0);d.async=arguments.length<4;d.waitCall=c;d.loadXML(a,!0,b);return d},getSync:function(a){return this.get(a,null,!0)},postSync:function(a,b){return this.post(a,b,null,!0)}};
function dtmlXMLLoaderObject(a,b,c,d){this.xmlDoc="";this.async=typeof c!="undefined"?c:!0;this.onloadAction=a||null;this.mainObject=b||null;this.waitCall=null;this.rSeed=d||!1;return this}
dtmlXMLLoaderObject.prototype.waitLoadFunction=function(a){var b=!0;return this.check=function(){if(a&&a.onloadAction!=null&&(!a.xmlDoc.readyState||a.xmlDoc.readyState==4)&&b){b=!1;if(typeof a.onloadAction=="function")a.onloadAction(a.mainObject,null,null,null,a);if(a.waitCall)a.waitCall.call(this,a),a.waitCall=null}}};
dtmlXMLLoaderObject.prototype.getXMLTopNode=function(a,b){if(this.xmlDoc.responseXML){var c=this.xmlDoc.responseXML.getElementsByTagName(a);c.length==0&&a.indexOf(":")!=-1&&(c=this.xmlDoc.responseXML.getElementsByTagName(a.split(":")[1]));var d=c[0]}else d=this.xmlDoc.documentElement;if(d)return this._retry=!1,d;if(_isIE&&!this._retry){var e=this.xmlDoc.responseText,b=this.xmlDoc;this._retry=!0;this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM");this.xmlDoc.async=!1;this.xmlDoc.loadXML(e);return this.getXMLTopNode(a,
b)}dhtmlxError.throwError("LoadXML","Incorrect XML",[b||this.xmlDoc,this.mainObject]);return document.createElement("DIV")};dtmlXMLLoaderObject.prototype.loadXMLString=function(a){try{var b=new DOMParser;this.xmlDoc=b.parseFromString(a,"text/xml")}catch(c){this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM"),this.xmlDoc.async=this.async,this.xmlDoc.loadXML(a)}this.onloadAction(this.mainObject,null,null,null,this);if(this.waitCall)this.waitCall(),this.waitCall=null};
function dtmlXMLLoaderObject(a,b,c,d){this.xmlDoc="";this.async=typeof c!="undefined"?c:!0;this.onloadAction=a||null;this.mainObject=b||null;this.waitCall=null;this.rSeed=d||!1;return this}dtmlXMLLoaderObject.count=0;
dtmlXMLLoaderObject.prototype.waitLoadFunction=function(a){var b=!0;return this.check=function(){if(a&&a.onloadAction!=null&&(!a.xmlDoc.readyState||a.xmlDoc.readyState==4)&&b){b=!1;dtmlXMLLoaderObject.count++;if(typeof a.onloadAction=="function")a.onloadAction(a.mainObject,null,null,null,a);if(a.waitCall)a.waitCall.call(this,a),a.waitCall=null}}};
dtmlXMLLoaderObject.prototype.getXMLTopNode=function(a,b){if(this.xmlDoc.responseXML){var c=this.xmlDoc.responseXML.getElementsByTagName(a);c.length==0&&a.indexOf(":")!=-1&&(c=this.xmlDoc.responseXML.getElementsByTagName(a.split(":")[1]));var d=c[0]}else d=this.xmlDoc.documentElement;if(d)return this._retry=!1,d;if(!this._retry)return this._retry=!0,b=this.xmlDoc,this.loadXMLString(this.xmlDoc.responseText.replace(/^[\s]+/,""),!0),this.getXMLTopNode(a,b);dhtmlxError.throwError("LoadXML","Incorrect XML",
[b||this.xmlDoc,this.mainObject]);return document.createElement("DIV")};dtmlXMLLoaderObject.prototype.loadXMLString=function(a,b){if(_isIE)this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM"),this.xmlDoc.async=this.async,this.xmlDoc.onreadystatechange=function(){},this.xmlDoc.loadXML(a);else{var c=new DOMParser;this.xmlDoc=c.parseFromString(a,"text/xml")}if(!b){if(this.onloadAction)this.onloadAction(this.mainObject,null,null,null,this);if(this.waitCall)this.waitCall(),this.waitCall=null}};
dtmlXMLLoaderObject.prototype.loadXML=function(a,b,c,d){this.rSeed&&(a+=(a.indexOf("?")!=-1?"&":"?")+"a_dhx_rSeed="+(new Date).valueOf());this.filePath=a;this.xmlDoc=!_isIE&&window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");if(this.async)this.xmlDoc.onreadystatechange=new this.waitLoadFunction(this);this.xmlDoc.open(b?"POST":"GET",a,this.async);d?(this.xmlDoc.setRequestHeader("User-Agent","dhtmlxRPC v0.1 ("+navigator.userAgent+")"),this.xmlDoc.setRequestHeader("Content-type",
"text/xml")):b&&this.xmlDoc.setRequestHeader("Content-type","application/x-www-form-urlencoded");this.xmlDoc.setRequestHeader("X-Requested-With","XMLHttpRequest");this.xmlDoc.send(c);this.async||(new this.waitLoadFunction(this))()};dtmlXMLLoaderObject.prototype.destructor=function(){return this.xmlDoc=this.mainObject=this.onloadAction=null};
"text/xml")):b&&this.xmlDoc.setRequestHeader("Content-type","application/x-www-form-urlencoded");this.xmlDoc.setRequestHeader("X-Requested-With","XMLHttpRequest");this.xmlDoc.send(c);this.async||(new this.waitLoadFunction(this))()};
dtmlXMLLoaderObject.prototype.destructor=function(){return this.setXSLParamValue=this.getXMLTopNode=this.xmlNodeToJSON=this.doSerialization=this.loadXMLString=this.loadXML=this.doXSLTransToString=this.doXSLTransToObject=this.doXPathOpera=this.doXPath=this.xmlDoc=this.mainObject=this.onloadAction=this.filePath=this.rSeed=this.async=this._retry=this._getAllNamedChilds=this._filterXPath=null};
dtmlXMLLoaderObject.prototype.xmlNodeToJSON=function(a){for(var b={},c=0;c<a.attributes.length;c++)b[a.attributes[c].name]=a.attributes[c].value;b._tagvalue=a.firstChild?a.firstChild.nodeValue:"";for(c=0;c<a.childNodes.length;c++){var d=a.childNodes[c].tagName;d&&(b[d]||(b[d]=[]),b[d].push(this.xmlNodeToJSON(a.childNodes[c])))}return b};function callerFunction(a,b){return this.handler=function(c){if(!c)c=window.event;a(c,b);return!0}}function getAbsoluteLeft(a){return getOffset(a).left}
function getAbsoluteTop(a){return getOffset(a).top}function getOffsetSum(a){for(var b=0,c=0;a;)b+=parseInt(a.offsetTop),c+=parseInt(a.offsetLeft),a=a.offsetParent;return{top:b,left:c}}
function getOffsetRect(a){var b=a.getBoundingClientRect(),c=document.body,d=document.documentElement,e=window.pageYOffset||d.scrollTop||c.scrollTop,f=window.pageXOffset||d.scrollLeft||c.scrollLeft,g=d.clientTop||c.clientTop||0,h=d.clientLeft||c.clientLeft||0,i=b.top+e-g,k=b.left+f-h;return{top:Math.round(i),left:Math.round(k)}}function getOffset(a){return a.getBoundingClientRect&&!_isChrome?getOffsetRect(a):getOffsetSum(a)}
function getOffsetRect(a){var b=a.getBoundingClientRect(),c=document.body,d=document.documentElement,e=window.pageYOffset||d.scrollTop||c.scrollTop,f=window.pageXOffset||d.scrollLeft||c.scrollLeft,g=d.clientTop||c.clientTop||0,h=d.clientLeft||c.clientLeft||0,k=b.top+e-g,i=b.left+f-h;return{top:Math.round(k),left:Math.round(i)}}function getOffset(a){return a.getBoundingClientRect?getOffsetRect(a):getOffsetSum(a)}
function convertStringToBoolean(a){typeof a=="string"&&(a=a.toLowerCase());switch(a){case "1":case "true":case "yes":case "y":case 1:case !0:return!0;default:return!1}}function getUrlSymbol(a){return a.indexOf("?")!=-1?"&":"?"}function dhtmlDragAndDropObject(){if(window.dhtmlDragAndDrop)return window.dhtmlDragAndDrop;this.dragStartObject=this.dragStartNode=this.dragNode=this.lastLanding=0;this.tempDOMM=this.tempDOMU=null;this.waitDrag=0;window.dhtmlDragAndDrop=this;return this}
dhtmlDragAndDropObject.prototype.removeDraggableItem=function(a){a.onmousedown=null;a.dragStarter=null;a.dragLanding=null};dhtmlDragAndDropObject.prototype.addDraggableItem=function(a,b){a.onmousedown=this.preCreateDragCopy;a.dragStarter=b;this.addDragLanding(a,b)};dhtmlDragAndDropObject.prototype.addDragLanding=function(a,b){a.dragLanding=b};
dhtmlDragAndDropObject.prototype.preCreateDragCopy=function(a){if(!((a||event)&&(a||event).button==2)){if(window.dhtmlDragAndDrop.waitDrag)return window.dhtmlDragAndDrop.waitDrag=0,document.body.onmouseup=window.dhtmlDragAndDrop.tempDOMU,document.body.onmousemove=window.dhtmlDragAndDrop.tempDOMM,!1;window.dhtmlDragAndDrop.waitDrag=1;window.dhtmlDragAndDrop.tempDOMU=document.body.onmouseup;window.dhtmlDragAndDrop.tempDOMM=document.body.onmousemove;window.dhtmlDragAndDrop.dragStartNode=this;window.dhtmlDragAndDrop.dragStartObject=
this.dragStarter;document.body.onmouseup=window.dhtmlDragAndDrop.preCreateDragCopy;document.body.onmousemove=window.dhtmlDragAndDrop.callDrag;window.dhtmlDragAndDrop.downtime=(new Date).valueOf();a&&a.preventDefault&&a.preventDefault();return!1}};
dhtmlDragAndDropObject.prototype.callDrag=function(a){if(!a)a=window.event;dragger=window.dhtmlDragAndDrop;if(!((new Date).valueOf()-dragger.downtime<100)){if(a.button==0&&_isIE)return dragger.stopDrag();if(!dragger.dragNode&&dragger.waitDrag){dragger.dragNode=dragger.dragStartObject._createDragNode(dragger.dragStartNode,a);if(!dragger.dragNode)return dragger.stopDrag();dragger.dragNode.onselectstart=function(){return!1};dragger.gldragNode=dragger.dragNode;document.body.appendChild(dragger.dragNode);
document.body.onmouseup=dragger.stopDrag;dragger.waitDrag=0;dragger.dragNode.pWindow=window;dragger.initFrameRoute()}if(dragger.dragNode.parentNode!=window.document.body){var b=dragger.gldragNode;if(dragger.gldragNode.old)b=dragger.gldragNode.old;b.parentNode.removeChild(b);var c=dragger.dragNode.pWindow;if(_isIE){var d=document.createElement("Div");d.innerHTML=dragger.dragNode.outerHTML;dragger.dragNode=d.childNodes[0]}else dragger.dragNode=dragger.dragNode.cloneNode(!0);dragger.dragNode.pWindow=
window;dragger.gldragNode.old=dragger.dragNode;document.body.appendChild(dragger.dragNode);c.dhtmlDragAndDrop.dragNode=dragger.dragNode}dragger.dragNode.style.left=a.clientX+15+(dragger.fx?dragger.fx*-1:0)+(document.body.scrollLeft||document.documentElement.scrollLeft)+"px";dragger.dragNode.style.top=a.clientY+3+(dragger.fy?dragger.fy*-1:0)+(document.body.scrollTop||document.documentElement.scrollTop)+"px";var e=a.srcElement?a.srcElement:a.target;dragger.checkLanding(e,a)}};
dhtmlDragAndDropObject.prototype.calculateFramePosition=function(a){if(window.name){for(var b=parent.frames[window.name].frameElement.offsetParent,c=0,d=0;b;)c+=b.offsetLeft,d+=b.offsetTop,b=b.offsetParent;if(parent.dhtmlDragAndDrop){var e=parent.dhtmlDragAndDrop.calculateFramePosition(1);c+=e.split("_")[0]*1;d+=e.split("_")[1]*1}if(a)return c+"_"+d;else this.fx=c;this.fy=d}return"0_0"};
dhtmlDragAndDropObject.prototype.preCreateDragCopy=function(a){if(!((a||window.event)&&(a||event).button==2)){if(window.dhtmlDragAndDrop.waitDrag)return window.dhtmlDragAndDrop.waitDrag=0,document.body.onmouseup=window.dhtmlDragAndDrop.tempDOMU,document.body.onmousemove=window.dhtmlDragAndDrop.tempDOMM,!1;window.dhtmlDragAndDrop.dragNode&&window.dhtmlDragAndDrop.stopDrag(a);window.dhtmlDragAndDrop.waitDrag=1;window.dhtmlDragAndDrop.tempDOMU=document.body.onmouseup;window.dhtmlDragAndDrop.tempDOMM=
document.body.onmousemove;window.dhtmlDragAndDrop.dragStartNode=this;window.dhtmlDragAndDrop.dragStartObject=this.dragStarter;document.body.onmouseup=window.dhtmlDragAndDrop.preCreateDragCopy;document.body.onmousemove=window.dhtmlDragAndDrop.callDrag;window.dhtmlDragAndDrop.downtime=(new Date).valueOf();a&&a.preventDefault&&a.preventDefault();return!1}};
dhtmlDragAndDropObject.prototype.callDrag=function(a){if(!a)a=window.event;dragger=window.dhtmlDragAndDrop;if(!((new Date).valueOf()-dragger.downtime<100)){if(!dragger.dragNode)if(dragger.waitDrag){dragger.dragNode=dragger.dragStartObject._createDragNode(dragger.dragStartNode,a);if(!dragger.dragNode)return dragger.stopDrag();dragger.dragNode.onselectstart=function(){return!1};dragger.gldragNode=dragger.dragNode;document.body.appendChild(dragger.dragNode);document.body.onmouseup=dragger.stopDrag;dragger.waitDrag=
0;dragger.dragNode.pWindow=window;dragger.initFrameRoute()}else return dragger.stopDrag(a,!0);if(dragger.dragNode.parentNode!=window.document.body&&dragger.gldragNode){var b=dragger.gldragNode;if(dragger.gldragNode.old)b=dragger.gldragNode.old;b.parentNode.removeChild(b);var c=dragger.dragNode.pWindow;b.pWindow&&b.pWindow.dhtmlDragAndDrop.lastLanding&&b.pWindow.dhtmlDragAndDrop.lastLanding.dragLanding._dragOut(b.pWindow.dhtmlDragAndDrop.lastLanding);if(_isIE){var d=document.createElement("Div");d.innerHTML=
dragger.dragNode.outerHTML;dragger.dragNode=d.childNodes[0]}else dragger.dragNode=dragger.dragNode.cloneNode(!0);dragger.dragNode.pWindow=window;dragger.gldragNode.old=dragger.dragNode;document.body.appendChild(dragger.dragNode);c.dhtmlDragAndDrop.dragNode=dragger.dragNode}dragger.dragNode.style.left=a.clientX+15+(dragger.fx?dragger.fx*-1:0)+(document.body.scrollLeft||document.documentElement.scrollLeft)+"px";dragger.dragNode.style.top=a.clientY+3+(dragger.fy?dragger.fy*-1:0)+(document.body.scrollTop||
document.documentElement.scrollTop)+"px";var e=a.srcElement?a.srcElement:a.target;dragger.checkLanding(e,a)}};dhtmlDragAndDropObject.prototype.calculateFramePosition=function(a){if(window.name){for(var b=parent.frames[window.name].frameElement.offsetParent,c=0,d=0;b;)c+=b.offsetLeft,d+=b.offsetTop,b=b.offsetParent;if(parent.dhtmlDragAndDrop){var e=parent.dhtmlDragAndDrop.calculateFramePosition(1);c+=e.split("_")[0]*1;d+=e.split("_")[1]*1}if(a)return c+"_"+d;else this.fx=c;this.fy=d}return"0_0"};
dhtmlDragAndDropObject.prototype.checkLanding=function(a,b){a&&a.dragLanding?(this.lastLanding&&this.lastLanding.dragLanding._dragOut(this.lastLanding),this.lastLanding=a,this.lastLanding=this.lastLanding.dragLanding._dragIn(this.lastLanding,this.dragStartNode,b.clientX,b.clientY,b),this.lastLanding_scr=_isIE?b.srcElement:b.target):a&&a.tagName!="BODY"?this.checkLanding(a.parentNode,b):(this.lastLanding&&this.lastLanding.dragLanding._dragOut(this.lastLanding,b.clientX,b.clientY,b),this.lastLanding=
0,this._onNotFound&&this._onNotFound())};
dhtmlDragAndDropObject.prototype.stopDrag=function(a,b){dragger=window.dhtmlDragAndDrop;if(!b){dragger.stopFrameRoute();var c=dragger.lastLanding;dragger.lastLanding=null;c&&c.dragLanding._drag(dragger.dragStartNode,dragger.dragStartObject,c,_isIE?event.srcElement:a.target)}dragger.lastLanding=null;dragger.dragNode&&dragger.dragNode.parentNode==document.body&&dragger.dragNode.parentNode.removeChild(dragger.dragNode);dragger.dragNode=0;dragger.gldragNode=0;dragger.fx=0;dragger.fy=0;dragger.dragStartNode=
0;dragger.dragStartObject=0;document.body.onmouseup=dragger.tempDOMU;document.body.onmousemove=dragger.tempDOMM;dragger.tempDOMU=null;dragger.tempDOMM=null;dragger.waitDrag=0};dhtmlDragAndDropObject.prototype.stopFrameRoute=function(a){a&&window.dhtmlDragAndDrop.stopDrag(1,1);for(var b=0;b<window.frames.length;b++)try{window.frames[b]!=a&&window.frames[b].dhtmlDragAndDrop&&window.frames[b].dhtmlDragAndDrop.stopFrameRoute(window)}catch(c){}try{parent.dhtmlDragAndDrop&&parent!=window&&parent!=a&&parent.dhtmlDragAndDrop.stopFrameRoute(window)}catch(d){}};
dhtmlDragAndDropObject.prototype.initFrameRoute=function(a,b){if(a)window.dhtmlDragAndDrop.preCreateDragCopy({}),window.dhtmlDragAndDrop.dragStartNode=a.dhtmlDragAndDrop.dragStartNode,window.dhtmlDragAndDrop.dragStartObject=a.dhtmlDragAndDrop.dragStartObject,window.dhtmlDragAndDrop.dragNode=a.dhtmlDragAndDrop.dragNode,window.dhtmlDragAndDrop.gldragNode=a.dhtmlDragAndDrop.dragNode,window.document.body.onmouseup=window.dhtmlDragAndDrop.stopDrag,window.waitDrag=0,!_isIE&&b&&(!_isFF||w<1.8)&&window.dhtmlDragAndDrop.calculateFramePosition();
try{parent.dhtmlDragAndDrop&&parent!=window&&parent!=a&&parent.dhtmlDragAndDrop.initFrameRoute(window)}catch(c){}for(var d=0;d<window.frames.length;d++)try{window.frames[d]!=a&&window.frames[d].dhtmlDragAndDrop&&window.frames[d].dhtmlDragAndDrop.initFrameRoute(window,!a||b?1:0)}catch(e){}};w=_OperaRv=x=_isChrome=_isMacOS=_isKHTML=_isOpera=_isIE=_isFF=!1;navigator.userAgent.indexOf("Macintosh")!=-1&&(_isMacOS=!0);navigator.userAgent.toLowerCase().indexOf("chrome")>-1&&(_isChrome=!0);
if(navigator.userAgent.indexOf("Safari")!=-1||navigator.userAgent.indexOf("Konqueror")!=-1){var x=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Safari")+7,5));if(x>525){_isFF=!0;var w=1.9}else _isKHTML=!0}else navigator.userAgent.indexOf("Opera")!=-1?(_isOpera=!0,_OperaRv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Opera")+6,3))):navigator.appName.indexOf("Microsoft")!=-1?(_isIE=!0,navigator.appVersion.indexOf("MSIE 8.0")!=-1&&document.compatMode!="BackCompat"&&
(_isIE=8)):(_isFF=!0,w=parseFloat(navigator.userAgent.split("rv:")[1]));
dhtmlDragAndDropObject.prototype.initFrameRoute=function(a,b){if(a)window.dhtmlDragAndDrop.preCreateDragCopy(),window.dhtmlDragAndDrop.dragStartNode=a.dhtmlDragAndDrop.dragStartNode,window.dhtmlDragAndDrop.dragStartObject=a.dhtmlDragAndDrop.dragStartObject,window.dhtmlDragAndDrop.dragNode=a.dhtmlDragAndDrop.dragNode,window.dhtmlDragAndDrop.gldragNode=a.dhtmlDragAndDrop.dragNode,window.document.body.onmouseup=window.dhtmlDragAndDrop.stopDrag,window.waitDrag=0,!_isIE&&b&&(!_isFF||_FFrv<1.8)&&window.dhtmlDragAndDrop.calculateFramePosition();
try{parent.dhtmlDragAndDrop&&parent!=window&&parent!=a&&parent.dhtmlDragAndDrop.initFrameRoute(window)}catch(c){}for(var d=0;d<window.frames.length;d++)try{window.frames[d]!=a&&window.frames[d].dhtmlDragAndDrop&&window.frames[d].dhtmlDragAndDrop.initFrameRoute(window,!a||b?1:0)}catch(e){}};_OperaRv=_KHTMLrv=_FFrv=_isChrome=_isMacOS=_isKHTML=_isOpera=_isIE=_isFF=!1;navigator.userAgent.indexOf("Macintosh")!=-1&&(_isMacOS=!0);navigator.userAgent.toLowerCase().indexOf("chrome")>-1&&(_isChrome=!0);
if(navigator.userAgent.indexOf("Safari")!=-1||navigator.userAgent.indexOf("Konqueror")!=-1)_KHTMLrv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Safari")+7,5)),_KHTMLrv>525?(_isFF=!0,_FFrv=1.9):_isKHTML=!0;else if(navigator.userAgent.indexOf("Opera")!=-1)_isOpera=!0,_OperaRv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Opera")+6,3));else if(navigator.appName.indexOf("Microsoft")!=-1){if(_isIE=!0,(navigator.appVersion.indexOf("MSIE 8.0")!=-1||navigator.appVersion.indexOf("MSIE 9.0")!=
-1||navigator.appVersion.indexOf("MSIE 10.0")!=-1)&&document.compatMode!="BackCompat")_isIE=8}else _isFF=!0,_FFrv=parseFloat(navigator.userAgent.split("rv:")[1]);
dtmlXMLLoaderObject.prototype.doXPath=function(a,b,c,d){if(_isKHTML||!_isIE&&!window.XPathResult)return this.doXPathOpera(a,b);if(_isIE)return b||(b=this.xmlDoc.nodeName?this.xmlDoc:this.xmlDoc.responseXML),b||dhtmlxError.throwError("LoadXML","Incorrect XML",[b||this.xmlDoc,this.mainObject]),c!=null&&b.setProperty("SelectionNamespaces","xmlns:xsl='"+c+"'"),d=="single"?b.selectSingleNode(a):b.selectNodes(a)||[];else{var e=b;b||(b=this.xmlDoc.nodeName?this.xmlDoc:this.xmlDoc.responseXML);b||dhtmlxError.throwError("LoadXML",
"Incorrect XML",[b||this.xmlDoc,this.mainObject]);b.nodeName.indexOf("document")!=-1?e=b:(e=b,b=b.ownerDocument);var f=XPathResult.ANY_TYPE;if(d=="single")f=XPathResult.FIRST_ORDERED_NODE_TYPE;var g=[],h=b.evaluate(a,e,function(){return c},f,null);if(f==XPathResult.FIRST_ORDERED_NODE_TYPE)return h.singleNodeValue;for(var i=h.iterateNext();i;)g[g.length]=i,i=h.iterateNext();return g}};function z(){if(!this.catches)this.catches=[];return this}z.prototype.catchError=function(a,b){this.catches[a]=b};
z.prototype.throwError=function(a,b,c){if(this.catches[a])return this.catches[a](a,b,c);if(this.catches.ALL)return this.catches.ALL(a,b,c);alert("Error type: "+a+"\nDescription: "+b);return null};window.dhtmlxError=new z;
"Incorrect XML",[b||this.xmlDoc,this.mainObject]);b.nodeName.indexOf("document")!=-1?e=b:(e=b,b=b.ownerDocument);var f=XPathResult.ANY_TYPE;if(d=="single")f=XPathResult.FIRST_ORDERED_NODE_TYPE;var g=[],h=b.evaluate(a,e,function(){return c},f,null);if(f==XPathResult.FIRST_ORDERED_NODE_TYPE)return h.singleNodeValue;for(var k=h.iterateNext();k;)g[g.length]=k,k=h.iterateNext();return g}};function v(){if(!this.catches)this.catches=[];return this}v.prototype.catchError=function(a,b){this.catches[a]=b};
v.prototype.throwError=function(a,b,c){if(this.catches[a])return this.catches[a](a,b,c);if(this.catches.ALL)return this.catches.ALL(a,b,c);alert("Error type: "+a+"\nDescription: "+b);return null};window.dhtmlxError=new v;
dtmlXMLLoaderObject.prototype.doXPathOpera=function(a,b){var c=a.replace(/[\/]+/gi,"/").split("/"),d=null,e=1;if(!c.length)return[];if(c[0]==".")d=[b];else if(c[0]=="")d=(this.xmlDoc.responseXML||this.xmlDoc).getElementsByTagName(c[e].replace(/\[[^\]]*\]/g,"")),e++;else return[];for(;e<c.length;e++)d=this._getAllNamedChilds(d,c[e]);c[e-1].indexOf("[")!=-1&&(d=this._filterXPath(d,c[e-1]));return d};
dtmlXMLLoaderObject.prototype._filterXPath=function(a,b){for(var c=[],b=b.replace(/[^\[]*\[\@/g,"").replace(/[\[\]\@]*/g,""),d=0;d<a.length;d++)a[d].getAttribute(b)&&(c[c.length]=a[d]);return c};
dtmlXMLLoaderObject.prototype._getAllNamedChilds=function(a,b){var c=[];_isKHTML&&(b=b.toUpperCase());for(var d=0;d<a.length;d++)for(var e=0;e<a[d].childNodes.length;e++)_isKHTML?a[d].childNodes[e].tagName&&a[d].childNodes[e].tagName.toUpperCase()==b&&(c[c.length]=a[d].childNodes[e]):a[d].childNodes[e].tagName==b&&(c[c.length]=a[d].childNodes[e]);return c};function dhtmlXHeir(a,b){for(var c in b)typeof b[c]=="function"&&(a[c]=b[c]);return a}
function dhtmlxEvent(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c)}dtmlXMLLoaderObject.prototype.xslDoc=null;dtmlXMLLoaderObject.prototype.setXSLParamValue=function(a,b,c){if(!c)c=this.xslDoc;if(c.responseXML)c=c.responseXML;var d=this.doXPath("/xsl:stylesheet/xsl:variable[@name='"+a+"']",c,"http://www.w3.org/1999/XSL/Transform","single");if(d!=null)d.firstChild.nodeValue=b};
dtmlXMLLoaderObject.prototype.doXSLTransToObject=function(a,b){if(!a)a=this.xslDoc;if(a.responseXML)a=a.responseXML;if(!b)b=this.xmlDoc;if(b.responseXML)b=b.responseXML;if(_isIE){d=new ActiveXObject("Msxml2.DOMDocument.3.0");try{b.transformNodeToObject(a,d)}catch(c){d=b.transformNode(a)}}else{if(!this.XSLProcessor)this.XSLProcessor=new XSLTProcessor,this.XSLProcessor.importStylesheet(a);var d=this.XSLProcessor.transformToDocument(b)}return d};
dtmlXMLLoaderObject.prototype.doXSLTransToString=function(a,b){var c=this.doXSLTransToObject(a,b);return typeof c=="string"?c:this.doSerialization(c)};dtmlXMLLoaderObject.prototype.doSerialization=function(a){if(!a)a=this.xmlDoc;if(a.responseXML)a=a.responseXML;if(_isIE)return a.xml;else{var b=new XMLSerializer;return b.serializeToString(a)}};
dhtmlxEventable=function(a){a.dhx_SeverCatcherPath="";a.attachEvent=function(a,c,d){a="ev_"+a.toLowerCase();this[a]||(this[a]=new this.eventCatcher(d||this));return a+":"+this[a].addEvent(c)};a.callEvent=function(a,c){a="ev_"+a.toLowerCase();return this[a]?this[a].apply(this,c):!0};a.checkEvent=function(a){return!!this["ev_"+a.toLowerCase()]};a.eventCatcher=function(a){var c=[],d=function(){for(var d=!0,f=0;f<c.length;f++)if(c[f]!=null)var g=c[f].apply(a,arguments),d=d&&g;return d};d.addEvent=function(a){typeof a!=
"function"&&(a=eval(a));return a?c.push(a)-1:!1};d.removeEvent=function(a){c[a]=null};return d};a.detachEvent=function(a){if(a!=!1){var c=a.split(":");this[c[0]].removeEvent(c[1])}};a.detachAllEvents=function(){for(var a in this)a.indexOf("ev_")==0&&delete this[a]}};
function dataProcessor(a){this.serverProcessor=a;this.action_param="!nativeeditor_status";this.object=null;this.updatedRows=[];this.autoUpdate=!0;this.updateMode="cell";this._tMode="GET";this.post_delim="_";this._waitMode=0;this._in_progress={};this._invalid={};this.mandatoryFields=[];this.messages=[];this.styles={updated:"font-weight:bold;",inserted:"font-weight:bold;",deleted:"text-decoration : line-through;",invalid:"background-color:FFE0E0;",invalid_cell:"border-bottom:2px solid red;",clear:"font-weight:normal;text-decoration:none;"};
this.enableUTFencoding(!0);dhtmlxEventable(this);return this}
dhtmlxEventable=function(a){a.attachEvent=function(a,c,d){a="ev_"+a.toLowerCase();this[a]||(this[a]=new this.eventCatcher(d||this));return a+":"+this[a].addEvent(c)};a.callEvent=function(a,c){a="ev_"+a.toLowerCase();return this[a]?this[a].apply(this,c):!0};a.checkEvent=function(a){return!!this["ev_"+a.toLowerCase()]};a.eventCatcher=function(a){var c=[],d=function(){for(var d=!0,f=0;f<c.length;f++)if(c[f]!=null)var g=c[f].apply(a,arguments),d=d&&g;return d};d.addEvent=function(a){typeof a!="function"&&
(a=eval(a));return a?c.push(a)-1:!1};d.removeEvent=function(a){c[a]=null};return d};a.detachEvent=function(a){if(a!=!1){var c=a.split(":");this[c[0]].removeEvent(c[1])}};a.detachAllEvents=function(){for(var a in this)a.indexOf("ev_")==0&&delete this[a]};a=null};if(!window.dhtmlx)window.dhtmlx={};
(function(){function a(a,b){var d=a.callback;c(!1);a.box.parentNode.removeChild(a.box);p=a.box=null;d&&d(b)}function b(b){if(p){var b=b||event,c=b.which||event.keyCode;dhtmlx.message.keyboard&&((c==13||c==32)&&a(p,!0),c==27&&a(p,!1));b.preventDefault&&b.preventDefault();return!(b.cancelBubble=!0)}}function c(a){if(!c.cover)c.cover=document.createElement("DIV"),c.cover.onkeydown=b,c.cover.className="dhx_modal_cover",document.body.appendChild(c.cover);var d=document.body.scrollHeight;c.cover.style.display=
a?"inline-block":"none"}function d(a,b){var c="dhtmlx_"+a.toLowerCase().replace(/ /g,"_")+"_button";return"<div class='dhtmlx_popup_button "+c+"' result='"+b+"' ><div>"+a+"</div></div>"}function e(a){if(!l.area)l.area=document.createElement("DIV"),l.area.className="dhtmlx_message_area",l.area.style[l.position]="5px",document.body.appendChild(l.area);l.hide(a.id);var b=document.createElement("DIV");b.innerHTML="<div>"+a.text+"</div>";b.className="dhtmlx-info dhtmlx-"+a.type;b.onclick=function(){l.hide(a.id);
a=null};l.position=="bottom"&&l.area.firstChild?l.area.insertBefore(b,l.area.firstChild):l.area.appendChild(b);a.expire>0&&(l.timers[a.id]=window.setTimeout(function(){l.hide(a.id)},a.expire));l.pull[a.id]=b;b=null;return a.id}function f(b,c,e){var f=document.createElement("DIV");f.className=" dhtmlx_modal_box dhtmlx-"+b.type;f.setAttribute("dhxbox",1);var g="";if(b.width)f.style.width=b.width;if(b.height)f.style.height=b.height;b.title&&(g+='<div class="dhtmlx_popup_title">'+b.title+"</div>");g+=
'<div class="dhtmlx_popup_text"><span>'+(b.content?"":b.text)+'</span></div><div class="dhtmlx_popup_controls">';c&&(g+=d(b.ok||"OK",!0));e&&(g+=d(b.cancel||"Cancel",!1));if(b.buttons)for(var h=0;h<b.buttons.length;h++)g+=d(b.buttons[h],h);g+="</div>";f.innerHTML=g;if(b.content){var i=b.content;typeof i=="string"&&(i=document.getElementById(i));if(i.style.display=="none")i.style.display="";f.childNodes[b.title?1:0].appendChild(i)}f.onclick=function(c){var c=c||event,d=c.target||c.srcElement;if(!d.className)d=
d.parentNode;d.className.split(" ")[0]=="dhtmlx_popup_button"&&(result=d.getAttribute("result"),result=result=="true"||(result=="false"?!1:result),a(b,result))};b.box=f;if(c||e)p=b;return f}function g(a,d,e){var g=a.tagName?a:f(a,d,e);a.hidden||c(!0);document.body.appendChild(g);var h=Math.abs(Math.floor(((window.innerWidth||document.documentElement.offsetWidth)-g.offsetWidth)/2)),i=Math.abs(Math.floor(((window.innerHeight||document.documentElement.offsetHeight)-g.offsetHeight)/2));g.style.top=a.position==
"top"?"-3px":i+"px";g.style.left=h+"px";g.onkeydown=b;g.focus();a.hidden&&dhtmlx.modalbox.hide(g);return g}function h(a){return g(a,!0,!1)}function k(a){return g(a,!0,!0)}function i(a){return g(a)}function j(a,b,c){typeof a!="object"&&(typeof b=="function"&&(c=b,b=""),a={text:a,type:b,callback:c});return a}function m(a,b,c,d){typeof a!="object"&&(a={text:a,type:b,expire:c,id:d});a.id=a.id||l.uid();a.expire=a.expire||l.expire;return a}var p=null;document.attachEvent?document.attachEvent("onkeydown",
b):document.addEventListener("keydown",b,!0);dhtmlx.alert=function(){text=j.apply(this,arguments);text.type=text.type||"confirm";return h(text)};dhtmlx.confirm=function(){text=j.apply(this,arguments);text.type=text.type||"alert";return k(text)};dhtmlx.modalbox=function(){text=j.apply(this,arguments);text.type=text.type||"alert";return i(text)};dhtmlx.modalbox.hide=function(a){for(;a&&a.getAttribute&&!a.getAttribute("dhxbox");)a=a.parentNode;a&&(a.parentNode.removeChild(a),c(!1))};var l=dhtmlx.message=
function(a,b,c,d){a=m.apply(this,arguments);a.type=a.type||"info";var f=a.type.split("-")[0];switch(f){case "alert":return h(a);case "confirm":return k(a);case "modalbox":return i(a);default:return e(a)}};l.seed=(new Date).valueOf();l.uid=function(){return l.seed++};l.expire=4E3;l.keyboard=!0;l.position="top";l.pull={};l.timers={};l.hideAll=function(){for(var a in l.pull)l.hide(a)};l.hide=function(a){var b=l.pull[a];b&&b.parentNode&&(window.setTimeout(function(){b.parentNode.removeChild(b);b=null},
2E3),b.className+=" hidden",l.timers[a]&&window.clearTimeout(l.timers[a]),delete l.pull[a])}})();
function dataProcessor(a){this.serverProcessor=a;this.action_param="!nativeeditor_status";this.object=null;this.updatedRows=[];this.autoUpdate=!0;this.updateMode="cell";this._tMode="GET";this.post_delim="_";this._waitMode=0;this._in_progress={};this._invalid={};this.mandatoryFields=[];this.messages=[];this.styles={updated:"font-weight:bold;",inserted:"font-weight:bold;",deleted:"text-decoration : line-through;",invalid:"background-color:FFE0E0;",invalid_cell:"border-bottom:2px solid red;",error:"color:red;",
clear:"font-weight:normal;text-decoration:none;"};this.enableUTFencoding(!0);dhtmlxEventable(this);return this}
dataProcessor.prototype={setTransactionMode:function(a,b){this._tMode=a;this._tSend=b},escape:function(a){return this._utf?encodeURIComponent(a):escape(a)},enableUTFencoding:function(a){this._utf=convertStringToBoolean(a)},setDataColumns:function(a){this._columns=typeof a=="string"?a.split(","):a},getSyncState:function(){return!this.updatedRows.length},enableDataNames:function(a){this._endnm=convertStringToBoolean(a)},enablePartialDataSend:function(a){this._changed=convertStringToBoolean(a)},setUpdateMode:function(a,
b){this.autoUpdate=a=="cell";this.updateMode=a;this.dnd=b},ignore:function(a,b){this._silent_mode=!0;a.call(b||window);this._silent_mode=!1},setUpdated:function(a,b,c){if(!this._silent_mode){var d=this.findRow(a),c=c||"updated",e=this.obj.getUserData(a,this.action_param);e&&c=="updated"&&(c=e);b?(this.set_invalid(a,!1),this.updatedRows[d]=a,this.obj.setUserData(a,this.action_param,c),this._in_progress[a]&&(this._in_progress[a]="wait")):this.is_invalid(a)||(this.updatedRows.splice(d,1),this.obj.setUserData(a,
this.action_param,""));b||this._clearUpdateFlag(a);this.markRow(a,b,c);b&&this.autoUpdate&&this.sendData(a)}},_clearUpdateFlag:function(){},markRow:function(a,b,c){var d="",e=this.is_invalid(a);e&&(d=this.styles[e],b=!0);if(this.callEvent("onRowMark",[a,b,c,e])&&(d=this.styles[b?c:"clear"]+d,this.obj[this._methods[0]](a,d),e&&e.details)){d+=this.styles[e+"_cell"];for(var f=0;f<e.details.length;f++)if(e.details[f])this.obj[this._methods[1]](a,f,d)}},getState:function(a){return this.obj.getUserData(a,
this.action_param)},is_invalid:function(a){return this._invalid[a]},set_invalid:function(a,b,c){c&&(b={value:b,details:c,toString:function(){return this.value.toString()}});this._invalid[a]=b},checkBeforeUpdate:function(){return!0},sendData:function(a){if(!this._waitMode||!(this.obj.mytype=="tree"||this.obj._h2)){this.obj.editStop&&this.obj.editStop();if(typeof a=="undefined"||this._tSend)return this.sendAllData();if(this._in_progress[a])return!1;this.messages=[];if(!this.checkBeforeUpdate(a)&&this.callEvent("onValidatationError",
[a,this.messages]))return!1;this._beforeSendData(this._getRowData(a),a)}},_beforeSendData:function(a,b){if(!this.callEvent("onBeforeUpdate",[b,this.getState(b),a]))return!1;this._sendData(a,b)},serialize:function(a,b){if(typeof a=="string")return a;if(typeof b!="undefined")return this.serialize_one(a,"");else{var c=[],d=[],e;for(e in a)a.hasOwnProperty(e)&&(c.push(this.serialize_one(a[e],e+this.post_delim)),d.push(e));c.push("ids="+this.escape(d.join(",")));return c.join("&")}},serialize_one:function(a,
b){if(typeof a=="string")return a;var c=[],d;for(d in a)a.hasOwnProperty(d)&&c.push(this.escape((b||"")+d)+"="+this.escape(a[d]));return c.join("&")},_sendData:function(a,b){if(a){if(!this.callEvent("onBeforeDataSending",b?[b,this.getState(b),a]:[null,null,a]))return!1;b&&(this._in_progress[b]=(new Date).valueOf());var c=new dtmlXMLLoaderObject(this.afterUpdate,this,!0),d=this.serverProcessor+(this._user?getUrlSymbol(this.serverProcessor)+["dhx_user="+this._user,"dhx_version="+this.obj.getUserData(0,
"version")].join("&"):"");this._tMode!="POST"?c.loadXML(d+(d.indexOf("?")!=-1?"&":"?")+this.serialize(a,b)):c.loadXML(d,!0,this.serialize(a,b));this._waitMode++}},sendAllData:function(){if(this.updatedRows.length){this.messages=[];for(var a=!0,b=0;b<this.updatedRows.length;b++)a&=this.checkBeforeUpdate(this.updatedRows[b]);if(!a&&!this.callEvent("onValidatationError",["",this.messages]))return!1;if(this._tSend)this._sendData(this._getAllData());else for(b=0;b<this.updatedRows.length;b++)if(!this._in_progress[this.updatedRows[b]]&&
!this.is_invalid(this.updatedRows[b])&&(this._beforeSendData(this._getRowData(this.updatedRows[b]),this.updatedRows[b]),this._waitMode&&(this.obj.mytype=="tree"||this.obj._h2)))break}},_getAllData:function(){for(var a={},b=!1,c=0;c<this.updatedRows.length;c++){var d=this.updatedRows[c];!this._in_progress[d]&&!this.is_invalid(d)&&this.callEvent("onBeforeUpdate",[d,this.getState(d)])&&(a[d]=this._getRowData(d,d+this.post_delim),b=!0,this._in_progress[d]=(new Date).valueOf())}return b?a:null},setVerificator:function(a,
b){this.mandatoryFields[a]=b||function(a){return a!=""}},clearVerificator:function(a){this.mandatoryFields[a]=!1},findRow:function(a){for(var b=0,b=0;b<this.updatedRows.length;b++)if(a==this.updatedRows[b])break;return b},defineAction:function(a,b){if(!this._uActions)this._uActions=[];this._uActions[a]=b},afterUpdateCallback:function(a,b,c,d){var e=a,f=c!="error"&&c!="invalid";f||this.set_invalid(a,c);if(this._uActions&&this._uActions[c]&&!this._uActions[c](d))return delete this._in_progress[e];this._in_progress[e]!=
"wait"&&this.setUpdated(a,!1);var g=a;switch(c){case "update":case "updated":case "inserted":case "insert":b!=a&&(this.obj[this._methods[2]](a,b),a=b);break;case "delete":case "deleted":return this.obj.setUserData(a,this.action_param,"true_deleted"),this.obj[this._methods[3]](a),delete this._in_progress[e],this.callEvent("onAfterUpdate",[a,c,b,d])}this._in_progress[e]!="wait"?(f&&this.obj.setUserData(a,this.action_param,""),delete this._in_progress[e]):(delete this._in_progress[e],this.setUpdated(b,
!0,this.obj.getUserData(a,this.action_param)));this.callEvent("onAfterUpdate",[a,c,b,d])},afterUpdate:function(a,b,c,d,e){e.getXMLTopNode("data");if(e.xmlDoc.responseXML){for(var f=e.doXPath("//data/action"),g=0;g<f.length;g++){var h=f[g],i=h.getAttribute("type"),k=h.getAttribute("sid"),j=h.getAttribute("tid");a.afterUpdateCallback(k,j,i,h)}a.finalizeUpdate()}},finalizeUpdate:function(){this._waitMode&&this._waitMode--;(this.obj.mytype=="tree"||this.obj._h2)&&this.updatedRows.length&&this.sendData();
this.callEvent("onAfterUpdateFinish",[]);this.updatedRows.length||this.callEvent("onFullSync",[])},init:function(a){this.obj=a;this.obj._dp_init&&this.obj._dp_init(this)},setOnAfterUpdate:function(a){this.attachEvent("onAfterUpdate",a)},enableDebug:function(){},setOnBeforeUpdateHandler:function(a){this.attachEvent("onBeforeDataSending",a)},setAutoUpdate:function(a,b){a=a||2E3;this._user=b||(new Date).valueOf();this._need_update=!1;this._loader=null;this._update_busy=!1;this.attachEvent("onAfterUpdate",
function(a,b,c,g){this.afterAutoUpdate(a,b,c,g)});this.attachEvent("onFullSync",function(){this.fullSync()});var c=this;window.setInterval(function(){c.loadUpdate()},a)},afterAutoUpdate:function(a,b){return b=="collision"?(this._need_update=!0,!1):!0},fullSync:function(){if(this._need_update==!0)this._need_update=!1,this.loadUpdate();return!0},getUpdates:function(a,b){if(this._update_busy)return!1;else this._update_busy=!0;this._loader=this._loader||new dtmlXMLLoaderObject(!0);this._loader.async=
!0;this._loader.waitCall=b;this._loader.loadXML(a)},_v:function(a){return a.firstChild?a.firstChild.nodeValue:""},_a:function(a){for(var b=[],c=0;c<a.length;c++)b[c]=this._v(a[c]);return b},loadUpdate:function(){var a=this,b=this.obj.getUserData(0,"version"),c=this.serverProcessor+getUrlSymbol(this.serverProcessor)+["dhx_user="+this._user,"dhx_version="+b].join("&"),c=c.replace("editing=true&","");this.getUpdates(c,function(){var b=a._loader.doXPath("//userdata");a.obj.setUserData(0,"version",a._v(b[0]));
var c=a._loader.doXPath("//update");if(c.length){a._silent_mode=!0;for(var f=0;f<c.length;f++){var g=c[f].getAttribute("status"),h=c[f].getAttribute("id"),i=c[f].getAttribute("parent");switch(g){case "inserted":a.callEvent("insertCallback",[c[f],h,i]);break;case "updated":a.callEvent("updateCallback",[c[f],h,i]);break;case "deleted":a.callEvent("deleteCallback",[c[f],h,i])}}a._silent_mode=!1}a._update_busy=!1;a=null})}};
[a,this.messages]))return!1;this._beforeSendData(this._getRowData(a),a)}},_beforeSendData:function(a,b){if(!this.callEvent("onBeforeUpdate",[b,this.getState(b),a]))return!1;this._sendData(a,b)},serialize:function(a,b){if(typeof a=="string")return a;if(typeof b!="undefined")return this.serialize_one(a,"");else{var c=[],d=[],e;for(e in a)a.hasOwnProperty(e)&&(c.push(this.serialize_one(a[e],e+this.post_delim)),d.push(e));c.push("ids="+this.escape(d.join(",")));dhtmlx.security_key&&c.push("dhx_security="+
dhtmlx.security_key);return c.join("&")}},serialize_one:function(a,b){if(typeof a=="string")return a;var c=[],d;for(d in a)a.hasOwnProperty(d)&&c.push(this.escape((b||"")+d)+"="+this.escape(a[d]));return c.join("&")},_sendData:function(a,b){if(a){if(!this.callEvent("onBeforeDataSending",b?[b,this.getState(b),a]:[null,null,a]))return!1;b&&(this._in_progress[b]=(new Date).valueOf());var c=new dtmlXMLLoaderObject(this.afterUpdate,this,!0),d=this.serverProcessor+(this._user?getUrlSymbol(this.serverProcessor)+
["dhx_user="+this._user,"dhx_version="+this.obj.getUserData(0,"version")].join("&"):"");this._tMode!="POST"?c.loadXML(d+(d.indexOf("?")!=-1?"&":"?")+this.serialize(a,b)):c.loadXML(d,!0,this.serialize(a,b));this._waitMode++}},sendAllData:function(){if(this.updatedRows.length){this.messages=[];for(var a=!0,b=0;b<this.updatedRows.length;b++)a&=this.checkBeforeUpdate(this.updatedRows[b]);if(!a&&!this.callEvent("onValidatationError",["",this.messages]))return!1;if(this._tSend)this._sendData(this._getAllData());
else for(b=0;b<this.updatedRows.length;b++)if(!this._in_progress[this.updatedRows[b]]&&!this.is_invalid(this.updatedRows[b])&&(this._beforeSendData(this._getRowData(this.updatedRows[b]),this.updatedRows[b]),this._waitMode&&(this.obj.mytype=="tree"||this.obj._h2)))break}},_getAllData:function(){for(var a={},b=!1,c=0;c<this.updatedRows.length;c++){var d=this.updatedRows[c];!this._in_progress[d]&&!this.is_invalid(d)&&this.callEvent("onBeforeUpdate",[d,this.getState(d)])&&(a[d]=this._getRowData(d,d+this.post_delim),
b=!0,this._in_progress[d]=(new Date).valueOf())}return b?a:null},setVerificator:function(a,b){this.mandatoryFields[a]=b||function(a){return a!=""}},clearVerificator:function(a){this.mandatoryFields[a]=!1},findRow:function(a){for(var b=0,b=0;b<this.updatedRows.length;b++)if(a==this.updatedRows[b])break;return b},defineAction:function(a,b){if(!this._uActions)this._uActions=[];this._uActions[a]=b},afterUpdateCallback:function(a,b,c,d){var e=a,f=c!="error"&&c!="invalid";f||this.set_invalid(a,c);if(this._uActions&&
this._uActions[c]&&!this._uActions[c](d))return delete this._in_progress[e];this._in_progress[e]!="wait"&&this.setUpdated(a,!1);var g=a;switch(c){case "update":case "updated":case "inserted":case "insert":b!=a&&(this.obj[this._methods[2]](a,b),a=b);break;case "delete":case "deleted":return this.obj.setUserData(a,this.action_param,"true_deleted"),this.obj[this._methods[3]](a),delete this._in_progress[e],this.callEvent("onAfterUpdate",[a,c,b,d])}this._in_progress[e]!="wait"?(f&&this.obj.setUserData(a,
this.action_param,""),delete this._in_progress[e]):(delete this._in_progress[e],this.setUpdated(b,!0,this.obj.getUserData(a,this.action_param)));this.callEvent("onAfterUpdate",[a,c,b,d])},afterUpdate:function(a,b,c,d,e){e.getXMLTopNode("data");if(e.xmlDoc.responseXML){for(var f=e.doXPath("//data/action"),g=0;g<f.length;g++){var h=f[g],k=h.getAttribute("type"),i=h.getAttribute("sid"),j=h.getAttribute("tid");a.afterUpdateCallback(i,j,k,h)}a.finalizeUpdate()}},finalizeUpdate:function(){this._waitMode&&
this._waitMode--;(this.obj.mytype=="tree"||this.obj._h2)&&this.updatedRows.length&&this.sendData();this.callEvent("onAfterUpdateFinish",[]);this.updatedRows.length||this.callEvent("onFullSync",[])},init:function(a){this.obj=a;this.obj._dp_init&&this.obj._dp_init(this)},setOnAfterUpdate:function(a){this.attachEvent("onAfterUpdate",a)},enableDebug:function(){},setOnBeforeUpdateHandler:function(a){this.attachEvent("onBeforeDataSending",a)},setAutoUpdate:function(a,b){a=a||2E3;this._user=b||(new Date).valueOf();
this._need_update=!1;this._loader=null;this._update_busy=!1;this.attachEvent("onAfterUpdate",function(a,b,c,g){this.afterAutoUpdate(a,b,c,g)});this.attachEvent("onFullSync",function(){this.fullSync()});var c=this;window.setInterval(function(){c.loadUpdate()},a)},afterAutoUpdate:function(a,b){return b=="collision"?(this._need_update=!0,!1):!0},fullSync:function(){if(this._need_update==!0)this._need_update=!1,this.loadUpdate();return!0},getUpdates:function(a,b){if(this._update_busy)return!1;else this._update_busy=
!0;this._loader=this._loader||new dtmlXMLLoaderObject(!0);this._loader.async=!0;this._loader.waitCall=b;this._loader.loadXML(a)},_v:function(a){return a.firstChild?a.firstChild.nodeValue:""},_a:function(a){for(var b=[],c=0;c<a.length;c++)b[c]=this._v(a[c]);return b},loadUpdate:function(){var a=this,b=this.obj.getUserData(0,"version"),c=this.serverProcessor+getUrlSymbol(this.serverProcessor)+["dhx_user="+this._user,"dhx_version="+b].join("&"),c=c.replace("editing=true&","");this.getUpdates(c,function(){var b=
a._loader.doXPath("//userdata");a.obj.setUserData(0,"version",a._v(b[0]));var c=a._loader.doXPath("//update");if(c.length){a._silent_mode=!0;for(var f=0;f<c.length;f++){var g=c[f].getAttribute("status"),h=c[f].getAttribute("id"),k=c[f].getAttribute("parent");switch(g){case "inserted":a.callEvent("insertCallback",[c[f],h,k]);break;case "updated":a.callEvent("updateCallback",[c[f],h,k]);break;case "deleted":a.callEvent("deleteCallback",[c[f],h,k])}}a._silent_mode=!1}a._update_busy=!1;a=null})}};
if(window.dhtmlXGridObject)dhtmlXGridObject.prototype._init_point_connector=dhtmlXGridObject.prototype._init_point,dhtmlXGridObject.prototype._init_point=function(){var a=function(a){a=a.replace(/(\?|\&)connector[^\f]*/g,"");return a+(a.indexOf("?")!=-1?"&":"?")+"connector=true"+(this.hdr.rows.length>0?"&dhx_no_header=1":"")},b=function(b){return a.call(this,b)+(this._connector_sorting||"")+(this._connector_filter||"")},c=function(a,c,d){this._connector_sorting="&dhx_sort["+c+"]="+d;return b.call(this,
a)},d=function(a,c,d){for(var h=0;h<c.length;h++)c[h]="dhx_filter["+c[h]+"]="+encodeURIComponent(d[h]);this._connector_filter="&"+c.join("&");return b.call(this,a)};this.attachEvent("onCollectValues",function(a){return this._con_f_used[a]?typeof this._con_f_used[a]=="object"?this._con_f_used[a]:!1:!0});this.attachEvent("onDynXLS",function(){this.xmlFileUrl=b.call(this,this.xmlFileUrl);return!0});this.attachEvent("onBeforeSorting",function(a,b,d){if(b=="connector"){var h=this;this.clearAndLoad(c.call(this,
this.xmlFileUrl,a,d),function(){h.setSortImgState(!0,a,d)});return!1}return!0});this.attachEvent("onFilterStart",function(a,b){return this._con_f_used.length?(this.clearAndLoad(d.call(this,this.xmlFileUrl,a,b)),!1):!0});this.attachEvent("onXLE",function(){});this._init_point_connector&&this._init_point_connector()},dhtmlXGridObject.prototype._con_f_used=[],dhtmlXGridObject.prototype._in_header_connector_text_filter=function(a,b){this._con_f_used[b]||(this._con_f_used[b]=1);return this._in_header_text_filter(a,
b)},dhtmlXGridObject.prototype._in_header_connector_select_filter=function(a,b){this._con_f_used[b]||(this._con_f_used[b]=2);return this._in_header_select_filter(a,b)},dhtmlXGridObject.prototype.load_connector=dhtmlXGridObject.prototype.load,dhtmlXGridObject.prototype.load=function(a,b,c){if(!this._colls_loaded&&this.cellType){for(var d=[],e=0;e<this.cellType.length;e++)(this.cellType[e].indexOf("co")==0||this._con_f_used[e]==2)&&d.push(e);d.length&&(arguments[0]+=(arguments[0].indexOf("?")!=-1?"&":
"?")+"connector=true&dhx_colls="+d.join(","))}return this.load_connector.apply(this,arguments)},dhtmlXGridObject.prototype._parseHead_connector=dhtmlXGridObject.prototype._parseHead,dhtmlXGridObject.prototype._parseHead=function(a,b,c){this._parseHead_connector.apply(this,arguments);if(!this._colls_loaded){for(var d=this.xmlLoader.doXPath("./coll_options",arguments[0]),e=0;e<d.length;e++){var f=d[e].getAttribute("for"),g=[],h=null;this.cellType[f]=="combo"&&(h=this.getColumnCombo(f));this.cellType[f].indexOf("co")==
0&&(h=this.getCombo(f));for(var i=this.xmlLoader.doXPath("./item",d[e]),k=0;k<i.length;k++){var j=i[k].getAttribute("value");if(h){var l=i[k].getAttribute("label")||j;h.addOption?h.addOption([[j,l]]):h.put(j,l);g[g.length]=l}else g[g.length]=j}this._con_f_used[f*1]&&(this._con_f_used[f*1]=g)}this._colls_loaded=!0}};
if(window.dataProcessor)dataProcessor.prototype.init_original=dataProcessor.prototype.init,dataProcessor.prototype.init=function(a){this.init_original(a);a._dataprocessor=this;this.setTransactionMode("POST",!0);this.serverProcessor+=(this.serverProcessor.indexOf("?")!=-1?"&":"?")+"editing=true"};dhtmlxError.catchError("LoadXML",function(a,b,c){c[0].status!=0&&alert(c[0].responseText)});window.dhtmlXScheduler=window.scheduler={version:3};dhtmlxEventable(scheduler);
0&&(h=this.getCombo(f));for(var k=this.xmlLoader.doXPath("./item",d[e]),i=0;i<k.length;i++){var j=k[i].getAttribute("value");if(h){var m=k[i].getAttribute("label")||j;h.addOption?h.addOption([[j,m]]):h.put(j,m);g[g.length]=m}else g[g.length]=j}this._con_f_used[f*1]&&(this._con_f_used[f*1]=g)}this._colls_loaded=!0}};
if(window.dataProcessor)dataProcessor.prototype.init_original=dataProcessor.prototype.init,dataProcessor.prototype.init=function(a){this.init_original(a);a._dataprocessor=this;this.setTransactionMode("POST",!0);this.serverProcessor+=(this.serverProcessor.indexOf("?")!=-1?"&":"?")+"editing=true"};dhtmlxError.catchError("LoadXML",function(a,b,c){c[0].status!=0&&alert(c[0].responseText)});window.dhtmlXScheduler=window.scheduler={version:"3.5.0"};dhtmlxEventable(scheduler);
scheduler.init=function(a,b,c){b=b||new Date;c=c||"week";scheduler.date.init();this._obj=typeof a=="string"?document.getElementById(a):a;this._els=[];this._scroll=!0;this._quirks=_isIE&&document.compatMode=="BackCompat";this._quirks7=_isIE&&navigator.appVersion.indexOf("MSIE 8")==-1;this.get_elements();this.init_templates();this.set_actions();dhtmlxEvent(window,"resize",function(){window.clearTimeout(scheduler._resize_timer);scheduler._resize_timer=window.setTimeout(function(){scheduler.callEvent("onSchedulerResize",
[])&&scheduler.update_view()},100)});this.set_sizes();scheduler.callEvent("onSchedulerReady",[]);this.setCurrentView(b,c)};scheduler.xy={nav_height:22,min_event_height:40,scale_width:50,bar_height:20,scroll_width:18,scale_height:20,month_scale_height:20,menu_width:25,margin_top:0,margin_left:0,editor_width:140};scheduler.keys={edit_save:13,edit_cancel:27};
[])&&(scheduler.update_view(),scheduler.callEvent("onAfterSchedulerResize",[]))},100)});this.set_sizes();scheduler.callEvent("onSchedulerReady",[]);this.setCurrentView(b,c)};scheduler.xy={nav_height:22,min_event_height:40,scale_width:50,bar_height:20,scroll_width:18,scale_height:20,month_scale_height:20,menu_width:25,margin_top:0,margin_left:0,editor_width:140,lightbox_additional_height:50};scheduler.keys={edit_save:13,edit_cancel:27};
scheduler.set_sizes=function(){var a=this._x=this._obj.clientWidth-this.xy.margin_left,b=this._y=this._obj.clientHeight-this.xy.margin_top,c=this._table_view?0:this.xy.scale_width+this.xy.scroll_width,d=this._table_view?-1:this.xy.scale_width;this.set_xy(this._els.dhx_cal_navline[0],a,this.xy.nav_height,0,0);this.set_xy(this._els.dhx_cal_header[0],a-c,this.xy.scale_height,d,this.xy.nav_height+(this._quirks?-1:1));var e=this._els.dhx_cal_navline[0].offsetHeight;if(e>0)this.xy.nav_height=e;var f=this.xy.scale_height+
this.xy.nav_height+(this._quirks?-2:0);this.set_xy(this._els.dhx_cal_data[0],a,b-(f+2),0,f+2)};scheduler.set_xy=function(a,b,c,d,e){a.style.width=Math.max(0,b)+"px";a.style.height=Math.max(0,c)+"px";if(arguments.length>3)a.style.left=d+"px",a.style.top=e+"px"};
scheduler.get_elements=function(){for(var a=this._obj.getElementsByTagName("DIV"),b=0;b<a.length;b++){var c=a[b].className;this._els[c]||(this._els[c]=[]);this._els[c].push(a[b]);var d=scheduler.locale.labels[a[b].getAttribute("name")||c];if(d)a[b].innerHTML=d}};
scheduler.set_actions=function(){for(var a in this._els)if(this._click[a])for(var b=0;b<this._els[a].length;b++)this._els[a][b].onclick=scheduler._click[a];this._obj.onselectstart=function(){return!1};this._obj.onmousemove=function(a){scheduler._on_mouse_move(a||event)};this._obj.onmousedown=function(a){scheduler._on_mouse_down(a||event)};this._obj.onmouseup=function(a){scheduler._on_mouse_up(a||event)};this._obj.ondblclick=function(a){scheduler._on_dbl_click(a||event)}};
scheduler.select=function(a){if(!this._table_view&&this.getEvent(a)._timed&&this._select_id!=a)this.editStop(!1),this.unselect(),this._select_id=a,this.updateEvent(a)};scheduler.unselect=function(a){if(!(a&&a!=this._select_id)){var b=this._select_id;this._select_id=null;b&&this.updateEvent(b)}};scheduler.getState=function(){return{mode:this._mode,date:this._date,min_date:this._min_date,max_date:this._max_date,editor_id:this._edit_id,lightbox_id:this._lightbox_id,new_event:this._new_event}};
scheduler._click={dhx_cal_data:function(a){var b=a?a.target:event.srcElement,c=scheduler._locate_event(b),a=a||event;if(!(c&&!scheduler.callEvent("onClick",[c,a])||scheduler.config.readonly))if(c){scheduler.select(c);var d=b.className;if(d.indexOf("_icon")!=-1)scheduler._click.buttons[d.split(" ")[1].replace("icon_","")](c)}else scheduler._close_not_saved()},dhx_cal_prev_button:function(){scheduler._click.dhx_cal_next_button(0,-1)},dhx_cal_next_button:function(a,b){scheduler.setCurrentView(scheduler.date.add(scheduler.date[scheduler._mode+
"_start"](scheduler._date),b||1,scheduler._mode))},dhx_cal_today_button:function(){scheduler.setCurrentView(new Date)},dhx_cal_tab:function(){var a=this.getAttribute("name"),b=a.substring(0,a.search("_tab"));scheduler.setCurrentView(scheduler._date,b)},buttons:{"delete":function(a){var b=scheduler.locale.labels.confirm_deleting;(!b||confirm(b))&&scheduler.deleteEvent(a)},edit:function(a){scheduler.edit(a)},save:function(){scheduler.editStop(!0)},details:function(a){scheduler.showLightbox(a)},cancel:function(){scheduler.editStop(!1)}}};
scheduler.addEventNow=function(a,b,c){var d={};a&&a.constructor.toString().match(/object/i)!==null&&(d=a,a=null);var e=(this.config.event_duration||this.config.time_step)*6E4;a||(a=Math.round((new Date).valueOf()/e)*e);var f=new Date(a);if(!b){var g=this.config.first_hour;g>f.getHours()&&(f.setHours(g),a=f.valueOf());b=a+e}var h=new Date(b);f.valueOf()==h.valueOf()&&h.setTime(h.valueOf()+e);d.start_date=d.start_date||f;d.end_date=d.end_date||h;d.text=d.text||this.locale.labels.new_event;d.id=this._drag_id=
this.uid();this._drag_mode="new-size";this._loading=!0;this.addEvent(d);this.callEvent("onEventCreated",[this._drag_id,c]);this._loading=!1;this._drag_event={};this._on_mouse_up(c)};
scheduler._on_dbl_click=function(a,b){b=b||a.target||a.srcElement;if(!this.config.readonly){var c=b.className.split(" ")[0];switch(c){case "dhx_scale_holder":case "dhx_scale_holder_now":case "dhx_month_body":case "dhx_wa_day_data":if(!scheduler.config.dblclick_create)break;var d=this._mouse_coords(a),e=this._min_date.valueOf()+(d.y*this.config.time_step+(this._table_view?0:d.x)*1440)*6E4,e=this._correct_shift(e);this.addEventNow(e,null,a);break;case "dhx_body":case "dhx_wa_ev_body":case "dhx_cal_event_line":case "dhx_cal_event_clear":var f=
this._locate_event(b);if(!this.callEvent("onDblClick",[f,a]))break;this.config.details_on_dblclick||this._table_view||!this.getEvent(f)._timed?this.showLightbox(f):this.edit(f);break;case "":if(b.parentNode)return scheduler._on_dbl_click(a,b.parentNode);default:var g=this["dblclick_"+c];g&&g.call(this,a)}}};
scheduler.get_elements=function(){for(var a=this._obj.getElementsByTagName("DIV"),b=0;b<a.length;b++){var c=a[b].className;c&&(c=c.split(" ")[0]);this._els[c]||(this._els[c]=[]);this._els[c].push(a[b]);var d=scheduler.locale.labels[a[b].getAttribute("name")||c];if(d)a[b].innerHTML=d}};
scheduler.set_actions=function(){for(var a in this._els)if(this._click[a])for(var b=0;b<this._els[a].length;b++)this._els[a][b].onclick=scheduler._click[a];this._obj.onselectstart=function(){return!1};this._obj.onmousemove=function(a){scheduler._on_mouse_move(a||event)};this._obj.onmousedown=function(a){scheduler._on_mouse_down(a||event)};this._obj.onmouseup=function(a){scheduler._on_mouse_up(a||event)};this._obj.ondblclick=function(a){scheduler._on_dbl_click(a||event)};this._obj.oncontextmenu=function(a){var b=
a||event,e=b.target||b.srcElement,f=scheduler.callEvent("onContextMenu",[scheduler._locate_event(e),b]);return f}};scheduler.select=function(a){if(this._select_id!=a)this.editStop(!1),this.unselect(),this._select_id=a,this.updateEvent(a)};scheduler.unselect=function(a){if(!(a&&a!=this._select_id)){var b=this._select_id;this._select_id=null;b&&this.updateEvent(b)}};
scheduler.getState=function(){return{mode:this._mode,date:this._date,min_date:this._min_date,max_date:this._max_date,editor_id:this._edit_id,lightbox_id:this._lightbox_id,new_event:this._new_event,select_id:this._select_id,expanded:this.expanded,drag_id:this._drag_id,drag_mode:this._drag_mode}};
scheduler._click={dhx_cal_data:function(a){var b=a?a.target:event.srcElement,c=scheduler._locate_event(b),a=a||event;if(c){if(!scheduler.callEvent("onClick",[c,a])||scheduler.config.readonly)return}else scheduler.callEvent("onEmptyClick",[scheduler.getActionData(a).date,a]);if(c&&scheduler.config.select){scheduler.select(c);var d=b.className;if(d.indexOf("_icon")!=-1)scheduler._click.buttons[d.split(" ")[1].replace("icon_","")](c)}else scheduler._close_not_saved()},dhx_cal_prev_button:function(){scheduler._click.dhx_cal_next_button(0,
-1)},dhx_cal_next_button:function(a,b){scheduler.setCurrentView(scheduler.date.add(scheduler.date[scheduler._mode+"_start"](scheduler._date),b||1,scheduler._mode))},dhx_cal_today_button:function(){scheduler.setCurrentView(new Date)},dhx_cal_tab:function(){var a=this.getAttribute("name"),b=a.substring(0,a.search("_tab"));scheduler.setCurrentView(scheduler._date,b)},buttons:{"delete":function(a){var b=scheduler.locale.labels.confirm_deleting;scheduler._dhtmlx_confirm(b,scheduler.locale.labels.title_confirm_deleting,
function(){scheduler.deleteEvent(a)})},edit:function(a){scheduler.edit(a)},save:function(){scheduler.editStop(!0)},details:function(a){scheduler.showLightbox(a)},cancel:function(){scheduler.editStop(!1)}}};scheduler._dhtmlx_confirm=function(a,b,c){if(!a)return c();var d={text:a};if(b)d.title=b;if(c)d.callback=function(a){a&&c()};dhtmlx.confirm(d)};
scheduler.addEventNow=function(a,b,c){var d={};a&&a.constructor.toString().match(/object/i)!==null&&(d=a,a=null);var e=(this.config.event_duration||this.config.time_step)*6E4;a||(a=Math.round((new Date).valueOf()/e)*e);var f=new Date(a);if(!b){var g=this.config.first_hour;g>f.getHours()&&(f.setHours(g),a=f.valueOf());b=a.valueOf()+e}var h=new Date(b);f.valueOf()==h.valueOf()&&h.setTime(h.valueOf()+e);d.start_date=d.start_date||f;d.end_date=d.end_date||h;d.text=d.text||this.locale.labels.new_event;
d.id=this._drag_id=this.uid();this._drag_mode="new-size";this._loading=!0;this.addEvent(d);this.callEvent("onEventCreated",[this._drag_id,c]);this._loading=!1;this._drag_event={};this._on_mouse_up(c)};
scheduler._on_dbl_click=function(a,b){b=b||a.target||a.srcElement;if(!this.config.readonly){var c=b.className.split(" ")[0];switch(c){case "dhx_scale_holder":case "dhx_scale_holder_now":case "dhx_month_body":case "dhx_wa_day_data":case "dhx_marked_timespan":if(!scheduler.config.dblclick_create)break;this.addEventNow(this.getActionData(a).date,null,a);break;case "dhx_cal_event":case "dhx_wa_ev_body":case "dhx_agenda_line":case "dhx_grid_event":case "dhx_cal_event_line":case "dhx_cal_event_clear":var d=
this._locate_event(b);if(!this.callEvent("onDblClick",[d,a]))break;this.config.details_on_dblclick||this._table_view||!this.getEvent(d)._timed||!this.config.select?this.showLightbox(d):this.edit(d);break;case "dhx_time_block":case "dhx_cal_container":break;default:var e=this["dblclick_"+c];if(e)e.call(this,a);else if(b.parentNode&&b!=this)return scheduler._on_dbl_click(a,b.parentNode)}}};
scheduler._mouse_coords=function(a){var b,c=document.body,d=document.documentElement;b=a.pageX||a.pageY?{x:a.pageX,y:a.pageY}:{x:a.clientX+(c.scrollLeft||d.scrollLeft||0)-c.clientLeft,y:a.clientY+(c.scrollTop||d.scrollTop||0)-c.clientTop};b.x-=getAbsoluteLeft(this._obj)+(this._table_view?0:this.xy.scale_width);b.y-=getAbsoluteTop(this._obj)+this.xy.nav_height+(this._dy_shift||0)+this.xy.scale_height-this._els.dhx_cal_data[0].scrollTop;b.ev=a;var e=this["mouse_"+this._mode];if(e)return e.call(this,
b);if(this._table_view){for(var f=0,f=1;f<this._colsS.heights.length;f++)if(this._colsS.heights[f]>b.y)break;b.y=(Math.max(0,Math.ceil(b.x/this._cols[0])-1)+Math.max(0,f-1)*7)*1440/this.config.time_step;b.x=0}else b.x=Math.max(0,Math.ceil(b.x/this._cols[0])-1),b.y=Math.max(0,Math.ceil(b.y*60/(this.config.time_step*this.config.hour_size_px))-1)+this.config.first_hour*(60/this.config.time_step);return b};
scheduler._close_not_saved=function(){if((new Date).valueOf()-(scheduler._new_event||0)>500&&scheduler._edit_id){var a=scheduler.locale.labels.confirm_closing;(!a||confirm(a))&&scheduler.editStop(scheduler.config.positive_closing)}};scheduler._correct_shift=function(a,b){return a-=((new Date(scheduler._min_date)).getTimezoneOffset()-(new Date(a)).getTimezoneOffset())*6E4*(b?-1:1)};
scheduler._on_mouse_move=function(a){if(this._drag_mode){var b=this._mouse_coords(a);if(!this._drag_pos||b.custom||this._drag_pos.x!=b.x||this._drag_pos.y!=b.y){this._edit_id!=this._drag_id&&this._close_not_saved();this._drag_pos=b;if(this._drag_mode=="create"){this._close_not_saved();this._loading=!0;var c=this._min_date.valueOf()+(b.y*this.config.time_step+(this._table_view?0:b.x)*1440)*6E4,c=this._correct_shift(c);if(!this._drag_start){this._drag_start=c;return}var d=c;if(d==this._drag_start)return;
this._drag_id=this.uid();this.addEvent(new Date(this._drag_start),new Date(d),this.locale.labels.new_event,this._drag_id,b.fields);this.callEvent("onEventCreated",[this._drag_id,a]);this._loading=!1;this._drag_mode="new-size"}var e=this.getEvent(this._drag_id);if(this._drag_mode=="move")c=this._min_date.valueOf()+(b.y*this.config.time_step+b.x*1440)*6E4,!b.custom&&this._table_view&&(c+=this.date.time_part(e.start_date)*1E3),c=this._correct_shift(c),d=e.end_date.valueOf()-(e.start_date.valueOf()-c);
else{c=e.start_date.valueOf();if(this._table_view)d=this._min_date.valueOf()+b.y*this.config.time_step*6E4+(b.custom?0:864E5),this._mode=="month"&&(d=this._correct_shift(d,!1));else if(d=this.date.date_part(new Date(e.end_date)).valueOf()+b.y*this.config.time_step*6E4,this._els.dhx_cal_data[0].style.cursor="s-resize",this._mode=="week"||this._mode=="day")d=this._correct_shift(d);if(this._drag_mode=="new-size")if(d<=this._drag_start)var f=b.shift||(this._table_view&&!b.custom?864E5:0),c=d-(b.shift?
0:f),d=this._drag_start+(f||this.config.time_step*6E4);else c=this._drag_start;else d<=c&&(d=c+this.config.time_step*6E4)}var g=new Date(d-1),h=new Date(c);if(this._table_view||g.getDate()==h.getDate()&&g.getHours()<this.config.last_hour||scheduler._wa&&scheduler._wa._dnd)e.start_date=h,e.end_date=new Date(d),this.config.update_render?this.update_view():this.updateEvent(this._drag_id);this._table_view&&this.for_rendered(this._drag_id,function(a){a.className+=" dhx_in_move"})}}else if(scheduler.checkEvent("onMouseMove")){var i=
this._locate_event(a.target||a.srcElement);this.callEvent("onMouseMove",[i,a])}};scheduler._on_mouse_context=function(a,b){return this.callEvent("onContextMenu",[this._locate_event(b),a])};
scheduler._on_mouse_down=function(a,b){if(!this.config.readonly&&!this._drag_mode){b=b||a.target||a.srcElement;if(a.button==2||a.ctrlKey)return this._on_mouse_context(a,b);switch(b.className.split(" ")[0]){case "dhx_cal_event_line":case "dhx_cal_event_clear":if(this._table_view)this._drag_mode="move";break;case "dhx_header":case "dhx_title":case "dhx_wa_ev_body":this._drag_mode="move";break;case "dhx_footer":this._drag_mode="resize";break;case "dhx_scale_holder":case "dhx_scale_holder_now":case "dhx_month_body":case "dhx_matrix_cell":this._drag_mode=
"create";break;case "":if(b.parentNode)return scheduler._on_mouse_down(a,b.parentNode);default:this._drag_id=this._drag_mode=null}if(this._drag_mode){var c=this._locate_event(b);!this.config["drag_"+this._drag_mode]||!this.callEvent("onBeforeDrag",[c,this._drag_mode,a])?this._drag_mode=this._drag_id=0:(this._drag_id=c,this._drag_event=scheduler._lame_copy({},this._copy_event(this.getEvent(this._drag_id)||{})))}this._drag_start=null}};
scheduler._on_mouse_up=function(a){if(this._drag_mode&&this._drag_id){this._els.dhx_cal_data[0].style.cursor="default";var b=this.getEvent(this._drag_id);if(this._drag_event._dhx_changed||!this._drag_event.start_date||b.start_date.valueOf()!=this._drag_event.start_date.valueOf()||b.end_date.valueOf()!=this._drag_event.end_date.valueOf()){var c=this._drag_mode=="new-size";if(this.callEvent("onBeforeEventChanged",[b,a,c]))if(c&&this.config.edit_on_create){this.unselect();this._new_event=new Date;if(this._table_view||
this.config.details_on_create)return this._drag_mode=null,this.showLightbox(this._drag_id);this._drag_pos=!0;this._select_id=this._edit_id=this._drag_id}else this._new_event||this.callEvent(c?"onEventAdded":"onEventChanged",[this._drag_id,this.getEvent(this._drag_id)]);else c?this.deleteEvent(b.id,!0):(this._drag_event._dhx_changed=!1,scheduler._lame_copy(b,this._drag_event),this.updateEvent(b.id))}this._drag_pos&&this.render_view_data()}this._drag_pos=this._drag_mode=null};
scheduler.update_view=function(){this._reset_scale();if(this._load_mode&&this._load())return this._render_wait=!0;this.render_view_data()};
scheduler.setCurrentView=function(a,b){a=a||this._date;b=b||this._mode;if(this.callEvent("onBeforeViewChange",[this._mode,this._date,b,a])){var c="dhx_cal_data",d=this._mode==b&&this.config.preserve_scroll?this._els[c][0].scrollTop:!1;if(this[this._mode+"_view"]&&b&&this._mode!=b)this[this._mode+"_view"](!1);this._close_not_saved();var e="dhx_multi_day";this._els[e]&&(this._els[e][0].parentNode.removeChild(this._els[e][0]),this._els[e]=null);this._mode=b;this._date=a;this._table_view=this._mode==
"month";for(var f=this._els.dhx_cal_tab,g=0;g<f.length;g++)f[g].className="dhx_cal_tab"+(f[g].getAttribute("name")==this._mode+"_tab"?" active":"");var h=this[this._mode+"_view"];h?h(!0):this.update_view();if(typeof d=="number")this._els[c][0].scrollTop=d;this.callEvent("onViewChange",[this._mode,this._date])}};
scheduler._render_x_header=function(a,b,c,d){var e=document.createElement("DIV");e.className="dhx_scale_bar";this.set_xy(e,this._cols[a]-1,this.xy.scale_height-2,b,0);e.innerHTML=this.templates[this._mode+"_scale_date"](c,this._mode);d.appendChild(e)};
scheduler._reset_scale=function(){if(this.templates[this._mode+"_date"]){var a=this._els.dhx_cal_header[0],b=this._els.dhx_cal_data[0],c=this.config;a.innerHTML="";b.scrollTop=0;b.innerHTML="";var d=(c.readonly||!c.drag_resize?" dhx_resize_denied":"")+(c.readonly||!c.drag_move?" dhx_move_denied":"");if(d)b.className="dhx_cal_data"+d;this._cols=[];this._colsS={height:0};this._dy_shift=0;this.set_sizes();var e=parseInt(a.style.width),f=0,g,h,i,k;h=this.date[this._mode+"_start"](new Date(this._date.valueOf()));
g=i=this._table_view?scheduler.date.week_start(h):h;k=this.date.date_part(new Date);var j=scheduler.date.add(h,1,this._mode),l=7;if(!this._table_view){var o=this.date["get_"+this._mode+"_end"];o&&(j=o(h));l=Math.round((j.valueOf()-h.valueOf())/864E5)}this._min_date=g;this._els.dhx_cal_date[0].innerHTML=this.templates[this._mode+"_date"](h,j,this._mode);for(var m=0;m<l;m++){this._cols[m]=Math.floor(e/(l-m));this._render_x_header(m,f,g,a);if(!this._table_view){var n=document.createElement("DIV"),p=
"dhx_scale_holder";g.valueOf()==k.valueOf()&&(p="dhx_scale_holder_now");n.className=p+" "+this.templates.week_date_class(g,k);this.set_xy(n,this._cols[m]-1,c.hour_size_px*(c.last_hour-c.first_hour),f+this.xy.scale_width+1,0);b.appendChild(n);this.callEvent("onScaleAdd",[n,g])}g=this.date.add(g,1,"day");e-=this._cols[m];f+=this._cols[m];this._colsS[m]=(this._cols[m-1]||0)+(this._colsS[m-1]||(this._table_view?0:this.xy.scale_width+2));this._colsS.col_length=l+1}this._max_date=g;this._colsS[l]=this._cols[l-
1]+this._colsS[l-1];if(this._table_view)this._reset_month_scale(b,h,i);else{this._reset_hours_scale(b,h,i);if(c.multi_day){var q="dhx_multi_day";this._els[q]&&(this._els[q][0].parentNode.removeChild(this._els[q][0]),this._els[q]=null);var v=this._els.dhx_cal_navline[0],s=v.offsetHeight+this._els.dhx_cal_header[0].offsetHeight+1,r=document.createElement("DIV");r.className=q;r.style.visibility="hidden";this.set_xy(r,this._colsS[this._colsS.col_length-1]+this.xy.scroll_width,0,0,s);b.parentNode.insertBefore(r,
b);var u=r.cloneNode(!0);u.className=q+"_icon";u.style.visibility="hidden";this.set_xy(u,this.xy.scale_width,0,0,s);r.appendChild(u);this._els[q]=[r,u];this._els[q][0].onclick=this._click.dhx_cal_data}if(this.config.mark_now){var t=new Date;if(t<this._max_date&&t>this._min_date&&t.getHours()>=this.config.first_hour&&t.getHours()<this.config.last_hour){var A=this.locate_holder_day(t),B=t.getHours()*60+t.getMinutes(),y=document.createElement("DIV");y.className="dhx_now_time";y.style.top=Math.round((B*
6E4-this.config.first_hour*36E5)*this.config.hour_size_px/36E5)%(this.config.hour_size_px*24)+1+"px";b.childNodes[A].appendChild(y)}}}}};
b);if(this._table_view){if(!this._cols||!this._colsS)return b;for(var f=0,f=1;f<this._colsS.heights.length;f++)if(this._colsS.heights[f]>b.y)break;b.y=Math.ceil((Math.max(0,b.x/this._cols[0])+Math.max(0,f-1)*7)*1440/this.config.time_step);if(scheduler._drag_mode||this._mode=="month")b.y=(Math.max(0,Math.ceil(b.x/this._cols[0])-1)+Math.max(0,f-1)*7)*1440/this.config.time_step;b.x=0}else b.x=Math.min(this._cols.length-1,Math.max(0,Math.ceil(b.x/this._cols[0])-1)),b.y=Math.max(0,Math.ceil(b.y*60/(this.config.time_step*
this.config.hour_size_px))-1)+this.config.first_hour*(60/this.config.time_step);return b};scheduler._close_not_saved=function(){if((new Date).valueOf()-(scheduler._new_event||0)>500&&scheduler._edit_id){var a=scheduler.locale.labels.confirm_closing;scheduler._dhtmlx_confirm(a,scheduler.locale.labels.title_confirm_closing,function(){scheduler.editStop(scheduler.config.positive_closing)})}};
scheduler._correct_shift=function(a,b){return a-=((new Date(scheduler._min_date)).getTimezoneOffset()-(new Date(a)).getTimezoneOffset())*6E4*(b?-1:1)};
scheduler._on_mouse_move=function(a){if(this._drag_mode){var b=this._mouse_coords(a);if(!this._drag_pos||b.custom||this._drag_pos.x!=b.x||this._drag_pos.y!=b.y){var c,d;this._edit_id!=this._drag_id&&this._close_not_saved();this._drag_pos=b;if(this._drag_mode=="create"){this._close_not_saved();this._loading=!0;c=this._get_date_from_pos(b).valueOf();var e=this.callEvent("onBeforeEventCreated",[a]);if(!e)return;if(!this._drag_start){this._drag_start=c;return}d=c;if(d==this._drag_start)return;this._drag_id=
this.uid();this.addEvent(new Date(this._drag_start),new Date(d),this.locale.labels.new_event,this._drag_id,b.fields);this.callEvent("onEventCreated",[this._drag_id,a]);this._loading=!1;this._drag_mode="new-size"}var f=this.getEvent(this._drag_id);if(this._drag_mode=="move")c=this._min_date.valueOf()+(b.y*this.config.time_step+b.x*1440)*6E4,!b.custom&&this._table_view&&(c+=this.date.time_part(f.start_date)*1E3),c=this._correct_shift(c),d=f.end_date.valueOf()-(f.start_date.valueOf()-c);else{c=f.start_date.valueOf();
d=f.end_date.valueOf();if(this._table_view){var g=this._min_date.valueOf()+b.y*this.config.time_step*6E4+(b.custom?0:864E5);this._mode=="month"&&(g=this._correct_shift(g,!1));b.resize_from_start?c=g:d=g}else if(d=this.date.date_part(new Date(f.end_date)).valueOf()+b.y*this.config.time_step*6E4,this._els.dhx_cal_data[0].style.cursor="s-resize",this._mode=="week"||this._mode=="day")d=this._correct_shift(d);if(this._drag_mode=="new-size")if(d<=this._drag_start){var h=b.shift||(this._table_view&&!b.custom?
864E5:0);c=d-(b.shift?0:h);d=this._drag_start+(h||this.config.time_step*6E4)}else c=this._drag_start;else d<=c&&(d=c+this.config.time_step*6E4)}var k=new Date(d-1),i=new Date(c);if(this._table_view||k.getDate()==i.getDate()&&k.getHours()<this.config.last_hour||scheduler._allow_dnd)if(f.start_date=i,f.end_date=new Date(d),this.config.update_render){var j=scheduler._els.dhx_cal_data[0].scrollTop;this.update_view();scheduler._els.dhx_cal_data[0].scrollTop=j}else this.updateEvent(this._drag_id);this._table_view&&
this.for_rendered(this._drag_id,function(a){a.className+=" dhx_in_move"})}}else if(scheduler.checkEvent("onMouseMove")){var m=this._locate_event(a.target||a.srcElement);this.callEvent("onMouseMove",[m,a])}};
scheduler._on_mouse_down=function(a,b){if(!this.config.readonly&&!this._drag_mode){var b=b||a.target||a.srcElement,c=b.className&&b.className.split(" ")[0];switch(c){case "dhx_cal_event_line":case "dhx_cal_event_clear":if(this._table_view)this._drag_mode="move";break;case "dhx_event_move":case "dhx_wa_ev_body":this._drag_mode="move";break;case "dhx_event_resize":this._drag_mode="resize";break;case "dhx_scale_holder":case "dhx_scale_holder_now":case "dhx_month_body":case "dhx_matrix_cell":case "dhx_marked_timespan":this._drag_mode=
"create";this.unselect(this._select_id);break;case "":if(b.parentNode)return scheduler._on_mouse_down(a,b.parentNode);default:if(scheduler.checkEvent("onMouseDown")&&scheduler.callEvent("onMouseDown",[c])&&b.parentNode&&b!=this)return scheduler._on_mouse_down(a,b.parentNode);this._drag_id=this._drag_mode=null}if(this._drag_mode){var d=this._locate_event(b);!this.config["drag_"+this._drag_mode]||!this.callEvent("onBeforeDrag",[d,this._drag_mode,a])?this._drag_mode=this._drag_id=0:(this._drag_id=d,
this._drag_event=scheduler._lame_clone(this.getEvent(this._drag_id)||{}))}this._drag_start=null}};
scheduler._on_mouse_up=function(a){if(this._drag_mode&&this._drag_id){this._els.dhx_cal_data[0].style.cursor="default";var b=this.getEvent(this._drag_id);if(this._drag_event._dhx_changed||!this._drag_event.start_date||b.start_date.valueOf()!=this._drag_event.start_date.valueOf()||b.end_date.valueOf()!=this._drag_event.end_date.valueOf()){var c=this._drag_mode=="new-size";if(this.callEvent("onBeforeEventChanged",[b,a,c,this._drag_event])){var d=this._drag_id;this._drag_id=this._drag_mode=null;if(c&&
this.config.edit_on_create){this.unselect();this._new_event=new Date;if(this._table_view||this.config.details_on_create||!this.config.select)return this.showLightbox(d);this._drag_pos=!0;this._select_id=this._edit_id=d}else this._new_event||this.callEvent(c?"onEventAdded":"onEventChanged",[d,this.getEvent(d)])}else c?this.deleteEvent(b.id,!0):(this._drag_event._dhx_changed=!1,scheduler._lame_copy(b,this._drag_event),this.updateEvent(b.id))}this._drag_pos&&this.render_view_data()}this._drag_pos=this._drag_mode=
this._drag_id=null};scheduler.update_view=function(){this._reset_scale();if(this._load_mode&&this._load())return this._render_wait=!0;this.render_view_data()};
scheduler.updateView=function(a,b){var a=a||this._date,b=b||this._mode,c="dhx_cal_data";this._mode?this._obj.className=this._obj.className.replace("dhx_scheduler_"+this._mode,"dhx_scheduler_"+b):this._obj.className+=" dhx_scheduler_"+b;var d=this._mode==b&&this.config.preserve_scroll?this._els[c][0].scrollTop:!1;if(this[this._mode+"_view"]&&b&&this._mode!=b)this[this._mode+"_view"](!1);this._close_not_saved();var e="dhx_multi_day";this._els[e]&&(this._els[e][0].parentNode.removeChild(this._els[e][0]),
this._els[e]=null);this._mode=b;this._date=a;this._table_view=this._mode=="month";for(var f=this._els.dhx_cal_tab,g=0;g<f.length;g++){var h=f[g].className,h=h.replace(/ active/g,"");f[g].getAttribute("name")==this._mode+"_tab"&&(h+=" active");f[g].className=h}var k=this[this._mode+"_view"];k?k(!0):this.update_view();if(typeof d=="number")this._els[c][0].scrollTop=d};
scheduler.setCurrentView=function(a,b){this.callEvent("onBeforeViewChange",[this._mode,this._date,b,a])&&(this.updateView(a,b),this.callEvent("onViewChange",[this._mode,this._date]))};scheduler._render_x_header=function(a,b,c,d){var e=document.createElement("DIV");e.className="dhx_scale_bar";this.set_xy(e,this._cols[a]-1,this.xy.scale_height-2,b,0);e.innerHTML=this.templates[this._mode+"_scale_date"](c,this._mode);d.appendChild(e)};
scheduler._reset_scale=function(){if(this.templates[this._mode+"_date"]){var a=this._els.dhx_cal_header[0],b=this._els.dhx_cal_data[0],c=this.config;a.innerHTML="";b.scrollTop=0;b.innerHTML="";var d=(c.readonly||!c.drag_resize?" dhx_resize_denied":"")+(c.readonly||!c.drag_move?" dhx_move_denied":"");if(d)b.className="dhx_cal_data"+d;this._scales={};this._cols=[];this._colsS={height:0};this._dy_shift=0;this.set_sizes();var e=parseInt(a.style.width,10),f=0,g,h,k,i;h=this.date[this._mode+"_start"](new Date(this._date.valueOf()));
g=k=this._table_view?scheduler.date.week_start(h):h;i=this.date.date_part(new Date);var j=scheduler.date.add(h,1,this._mode),m=7;if(!this._table_view){var p=this.date["get_"+this._mode+"_end"];p&&(j=p(h));m=Math.round((j.valueOf()-h.valueOf())/864E5)}this._min_date=g;this._els.dhx_cal_date[0].innerHTML=this.templates[this._mode+"_date"](h,j,this._mode);for(var l=0;l<m;l++){this._cols[l]=Math.floor(e/(m-l));this._render_x_header(l,f,g,a);if(!this._table_view){var n=document.createElement("DIV"),r=
"dhx_scale_holder";g.valueOf()==i.valueOf()&&(r="dhx_scale_holder_now");n.className=r+" "+this.templates.week_date_class(g,i);this.set_xy(n,this._cols[l]-1,c.hour_size_px*(c.last_hour-c.first_hour),f+this.xy.scale_width+1,0);b.appendChild(n);this.callEvent("onScaleAdd",[n,g])}g=this.date.add(g,1,"day");e-=this._cols[l];f+=this._cols[l];this._colsS[l]=(this._cols[l-1]||0)+(this._colsS[l-1]||(this._table_view?0:this.xy.scale_width+2));this._colsS.col_length=m+1}this._max_date=g;this._colsS[m]=this._cols[m-
1]+this._colsS[m-1];if(this._table_view)this._reset_month_scale(b,h,k);else if(this._reset_hours_scale(b,h,k),c.multi_day){var o="dhx_multi_day";this._els[o]&&(this._els[o][0].parentNode.removeChild(this._els[o][0]),this._els[o]=null);var q=this._els.dhx_cal_navline[0],s=q.offsetHeight+this._els.dhx_cal_header[0].offsetHeight+1,t=document.createElement("DIV");t.className=o;t.style.visibility="hidden";this.set_xy(t,this._colsS[this._colsS.col_length-1]+this.xy.scroll_width,0,0,s);b.parentNode.insertBefore(t,
b);var u=t.cloneNode(!0);u.className=o+"_icon";u.style.visibility="hidden";this.set_xy(u,this.xy.scale_width,0,0,s);t.appendChild(u);this._els[o]=[t,u];this._els[o][0].onclick=this._click.dhx_cal_data}}};
scheduler._reset_hours_scale=function(a){var b=document.createElement("DIV");b.className="dhx_scale_holder";for(var c=new Date(1980,1,1,this.config.first_hour,0,0),d=this.config.first_hour*1;d<this.config.last_hour;d++){var e=document.createElement("DIV");e.className="dhx_scale_hour";e.style.height=this.config.hour_size_px-(this._quirks?0:1)+"px";e.style.width=this.xy.scale_width+"px";e.innerHTML=scheduler.templates.hour_scale(c);b.appendChild(e);c=this.date.add(c,1,"hour")}a.appendChild(b);if(this.config.scroll_hour)a.scrollTop=
this.config.hour_size_px*(this.config.scroll_hour-this.config.first_hour)};
scheduler._reset_month_scale=function(a,b,c){var d=scheduler.date.add(b,1,"month"),e=new Date;this.date.date_part(e);this.date.date_part(c);var f=Math.ceil(Math.round((d.valueOf()-c.valueOf())/864E5)/7),g=[],h=Math.floor(a.clientHeight/f)-22;this._colsS.height=h+22;for(var i=this._colsS.heights=[],k=0;k<=7;k++)g[k]=" style='height:"+h+"px; width:"+((this._cols[k]||0)-1)+"px;' ";var j=0;this._min_date=c;for(var l="<table cellpadding='0' cellspacing='0'>",k=0;k<f;k++){l+="<tr>";for(var o=0;o<7;o++){l+=
"<td";var m="";c<b?m="dhx_before":c>=d?m="dhx_after":c.valueOf()==e.valueOf()&&(m="dhx_now");l+=" class='"+m+" "+this.templates.month_date_class(c,e)+"' ";l+="><div class='dhx_month_head'>"+this.templates.month_day(c)+"</div><div class='dhx_month_body' "+g[o]+"></div></td>";c=this.date.add(c,1,"day")}l+="</tr>";i[k]=j;j+=this._colsS.height}l+="</table>";this._max_date=c;a.innerHTML=l;return c};
scheduler.getLabel=function(a,b){for(var c=this.config.lightbox.sections,d=0;d<c.length;d++)if(c[d].map_to==a)for(var e=c[d].options,f=0;f<e.length;f++)if(e[f].key==b)return e[f].label;return""};scheduler.updateCollection=function(a,b){var c=scheduler.serverList(a);if(!c)return!1;c.splice(0,c.length);c.push.apply(c,b||[]);scheduler.callEvent("onOptionsLoad",[]);scheduler.resetLightbox();return!0};scheduler._lame_copy=function(a,b){for(var c in b)a[c]=b[c];return a};
scheduler.date={init:function(){for(var a=scheduler.locale.date.month_short,b=scheduler.locale.date.month_short_hash={},c=0;c<a.length;c++)b[a[c]]=c;a=scheduler.locale.date.month_full;b=scheduler.locale.date.month_full_hash={};for(c=0;c<a.length;c++)b[a[c]]=c},date_part:function(a){a.setHours(0);a.setMinutes(0);a.setSeconds(0);a.setMilliseconds(0);return a},time_part:function(a){return(a.valueOf()/1E3-a.getTimezoneOffset()*60)%86400},week_start:function(a){var b=a.getDay();scheduler.config.start_on_monday&&
(b===0?b=6:b--);return this.date_part(this.add(a,-1*b,"day"))},month_start:function(a){a.setDate(1);return this.date_part(a)},year_start:function(a){a.setMonth(0);return this.month_start(a)},day_start:function(a){return this.date_part(a)},add:function(a,b,c){var d=new Date(a.valueOf());switch(c){case "day":d.setDate(d.getDate()+b);if(a.getDate()==d.getDate()&&b){do d.setTime(d.getTime()+36E5);while(a.getDate()==d.getDate())}break;case "week":d.setDate(d.getDate()+7*b);break;case "month":d.setMonth(d.getMonth()+
b);break;case "year":d.setYear(d.getFullYear()+b);break;case "hour":d.setHours(d.getHours()+b);break;case "minute":d.setMinutes(d.getMinutes()+b);break;default:return scheduler.date["add_"+c](a,b,c)}return d},to_fixed:function(a){return a<10?"0"+a:a},copy:function(a){return new Date(a.valueOf())},date_to_str:function(a,b){a=a.replace(/%[a-zA-Z]/g,function(a){switch(a){case "%d":return'"+scheduler.date.to_fixed(date.getDate())+"';case "%m":return'"+scheduler.date.to_fixed((date.getMonth()+1))+"';case "%j":return'"+date.getDate()+"';
case "%n":return'"+(date.getMonth()+1)+"';case "%y":return'"+scheduler.date.to_fixed(date.getFullYear()%100)+"';case "%Y":return'"+date.getFullYear()+"';case "%D":return'"+scheduler.locale.date.day_short[date.getDay()]+"';case "%l":return'"+scheduler.locale.date.day_full[date.getDay()]+"';case "%M":return'"+scheduler.locale.date.month_short[date.getMonth()]+"';case "%F":return'"+scheduler.locale.date.month_full[date.getMonth()]+"';case "%h":return'"+scheduler.date.to_fixed((date.getHours()+11)%12+1)+"';
case "%g":return'"+((date.getHours()+11)%12+1)+"';case "%G":return'"+date.getHours()+"';case "%H":return'"+scheduler.date.to_fixed(date.getHours())+"';case "%i":return'"+scheduler.date.to_fixed(date.getMinutes())+"';case "%a":return'"+(date.getHours()>11?"pm":"am")+"';case "%A":return'"+(date.getHours()>11?"PM":"AM")+"';case "%s":return'"+scheduler.date.to_fixed(date.getSeconds())+"';case "%W":return'"+scheduler.date.to_fixed(scheduler.date.getISOWeek(date))+"';default:return a}});b&&(a=a.replace(/date\.get/g,
"date.getUTC"));return new Function("date",'return "'+a+'";')},str_to_date:function(a,b){for(var c="var temp=date.split(/[^0-9a-zA-Z]+/g);",d=a.match(/%[a-zA-Z]/g),e=0;e<d.length;e++)switch(d[e]){case "%j":case "%d":c+="set[2]=temp["+e+"]||1;";break;case "%n":case "%m":c+="set[1]=(temp["+e+"]||1)-1;";break;case "%y":c+="set[0]=temp["+e+"]*1+(temp["+e+"]>50?1900:2000);";break;case "%g":case "%G":case "%h":case "%H":c+="set[3]=temp["+e+"]||0;";break;case "%i":c+="set[4]=temp["+e+"]||0;";break;case "%Y":c+=
"set[0]=temp["+e+"]||0;";break;case "%a":case "%A":c+="set[3]=set[3]%12+((temp["+e+"]||'').toLowerCase()=='am'?0:12);";break;case "%s":c+="set[5]=temp["+e+"]||0;";break;case "%M":c+="set[1]=scheduler.locale.date.month_short_hash[temp["+e+"]]||0;";break;case "%F":c+="set[1]=scheduler.locale.date.month_full_hash[temp["+e+"]]||0;"}var f="set[0],set[1],set[2],set[3],set[4],set[5]";b&&(f=" Date.UTC("+f+")");return new Function("date","var set=[0,0,1,0,0,0]; "+c+" return new Date("+f+");")},getISOWeek:function(a){if(!a)return!1;
var b=a.getDay();b===0&&(b=7);var c=new Date(a.valueOf());c.setDate(a.getDate()+(4-b));var d=c.getFullYear(),e=Math.round((c.getTime()-(new Date(d,0,1)).getTime())/864E5),f=1+Math.floor(e/7);return f},getUTCISOWeek:function(a){return this.getISOWeek(a)}};
scheduler._reset_month_scale=function(a,b,c){var d=scheduler.date.add(b,1,"month"),e=new Date;this.date.date_part(e);this.date.date_part(c);var f=Math.ceil(Math.round((d.valueOf()-c.valueOf())/864E5)/7),g=[],h=Math.floor(a.clientHeight/f)-22;this._colsS.height=h+22;for(var k=this._colsS.heights=[],i=0;i<=7;i++)g[i]=" style='height:"+h+"px; width:"+((this._cols[i]||0)-1)+"px;' ";var j=0;this._min_date=c;for(var m="<table cellpadding='0' cellspacing='0'>",p=[],i=0;i<f;i++){m+="<tr>";for(var l=0;l<7;l++){m+=
"<td";var n="";c<b?n="dhx_before":c>=d?n="dhx_after":c.valueOf()==e.valueOf()&&(n="dhx_now");m+=" class='"+n+" "+this.templates.month_date_class(c,e)+"' ";m+="><div class='dhx_month_head'>"+this.templates.month_day(c)+"</div><div class='dhx_month_body' "+g[l]+"></div></td>";p.push(c);c=this.date.add(c,1,"day")}m+="</tr>";k[i]=j;j+=this._colsS.height}m+="</table>";this._max_date=c;a.innerHTML=m;this._scales={};for(var r=a.getElementsByTagName("div"),i=0;i<p.length;i++){var o=r[i*2+1],q=p[i];this._scales[+q]=
o}for(i=0;i<p.length;i++)q=p[i],this.callEvent("onScaleAdd",[this._scales[+q],q]);return c};scheduler.getLabel=function(a,b){for(var c=this.config.lightbox.sections,d=0;d<c.length;d++)if(c[d].map_to==a)for(var e=c[d].options,f=0;f<e.length;f++)if(e[f].key==b)return e[f].label;return""};scheduler.updateCollection=function(a,b){var c=scheduler.serverList(a);if(!c)return!1;c.splice(0,c.length);c.push.apply(c,b||[]);scheduler.callEvent("onOptionsLoad",[]);scheduler.resetLightbox();return!0};
scheduler._lame_clone=function(a,b){var c,d,e,b=b||[];for(c=0;c<b.length;c+=2)if(a===b[c])return b[c+1];if(a&&typeof a=="object"){e={};d=[Array,Date,Number,String,Boolean];for(c=0;c<d.length;c++)a instanceof d[c]&&(e=c?new d[c](a):new d[c]);b.push(a,e);for(c in a)Object.prototype.hasOwnProperty.apply(a,[c])&&(e[c]=scheduler._lame_clone(a[c],b))}return e||a};scheduler._lame_copy=function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a};
scheduler._get_date_from_pos=function(a){var b=this._min_date.valueOf()+(a.y*this.config.time_step+(this._table_view?0:a.x)*1440)*6E4;return new Date(this._correct_shift(b))};scheduler.getActionData=function(a){var b=this._mouse_coords(a);return{date:this._get_date_from_pos(b),section:b.section}};
scheduler.date={init:function(){for(var a=scheduler.locale.date.month_short,b=scheduler.locale.date.month_short_hash={},c=0;c<a.length;c++)b[a[c]]=c;a=scheduler.locale.date.month_full;b=scheduler.locale.date.month_full_hash={};for(c=0;c<a.length;c++)b[a[c]]=c},date_part:function(a){a.setHours(0);a.setMinutes(0);a.setSeconds(0);a.setMilliseconds(0);a.getHours()!=0&&a.setTime(a.getTime()+36E5*(24-a.getHours()));return a},time_part:function(a){return(a.valueOf()/1E3-a.getTimezoneOffset()*60)%86400},
week_start:function(a){var b=a.getDay();scheduler.config.start_on_monday&&(b===0?b=6:b--);return this.date_part(this.add(a,-1*b,"day"))},month_start:function(a){a.setDate(1);return this.date_part(a)},year_start:function(a){a.setMonth(0);return this.month_start(a)},day_start:function(a){return this.date_part(a)},add:function(a,b,c){var d=new Date(a.valueOf());switch(c){case "week":b*=7;case "day":d.setDate(d.getDate()+b);!a.getHours()&&d.getHours()&&d.setTime(d.getTime()+36E5*(24-d.getHours()));break;
case "month":var e=d.getMonth()+b,f=new Date(d);d.setMonth(e);d.getMonth()!=e&&d.getMonth()!=e%12&&(f.setDate(1),f.setMonth(e),f.setDate((new Date(f.getFullYear(),e+1,0)).getDate()),d=f);break;case "year":d.setYear(d.getFullYear()+b);break;case "hour":d.setHours(d.getHours()+b);break;case "minute":d.setMinutes(d.getMinutes()+b);break;default:return scheduler.date["add_"+c](a,b,c)}return d},to_fixed:function(a){return a<10?"0"+a:a},copy:function(a){return new Date(a.valueOf())},date_to_str:function(a,
b){a=a.replace(/%[a-zA-Z]/g,function(a){switch(a){case "%d":return'"+scheduler.date.to_fixed(date.getDate())+"';case "%m":return'"+scheduler.date.to_fixed((date.getMonth()+1))+"';case "%j":return'"+date.getDate()+"';case "%n":return'"+(date.getMonth()+1)+"';case "%y":return'"+scheduler.date.to_fixed(date.getFullYear()%100)+"';case "%Y":return'"+date.getFullYear()+"';case "%D":return'"+scheduler.locale.date.day_short[date.getDay()]+"';case "%l":return'"+scheduler.locale.date.day_full[date.getDay()]+"';
case "%M":return'"+scheduler.locale.date.month_short[date.getMonth()]+"';case "%F":return'"+scheduler.locale.date.month_full[date.getMonth()]+"';case "%h":return'"+scheduler.date.to_fixed((date.getHours()+11)%12+1)+"';case "%g":return'"+((date.getHours()+11)%12+1)+"';case "%G":return'"+date.getHours()+"';case "%H":return'"+scheduler.date.to_fixed(date.getHours())+"';case "%i":return'"+scheduler.date.to_fixed(date.getMinutes())+"';case "%a":return'"+(date.getHours()>11?"pm":"am")+"';case "%A":return'"+(date.getHours()>11?"PM":"AM")+"';
case "%s":return'"+scheduler.date.to_fixed(date.getSeconds())+"';case "%W":return'"+scheduler.date.to_fixed(scheduler.date.getISOWeek(date))+"';default:return a}});b&&(a=a.replace(/date\.get/g,"date.getUTC"));return new Function("date",'return "'+a+'";')},str_to_date:function(a,b){for(var c="var temp=date.match(/[a-zA-Z]+|[0-9]+/g);",d=a.match(/%[a-zA-Z]/g),e=0;e<d.length;e++)switch(d[e]){case "%j":case "%d":c+="set[2]=temp["+e+"]||1;";break;case "%n":case "%m":c+="set[1]=(temp["+e+"]||1)-1;";break;
case "%y":c+="set[0]=temp["+e+"]*1+(temp["+e+"]>50?1900:2000);";break;case "%g":case "%G":case "%h":case "%H":c+="set[3]=temp["+e+"]||0;";break;case "%i":c+="set[4]=temp["+e+"]||0;";break;case "%Y":c+="set[0]=temp["+e+"]||0;";break;case "%a":case "%A":c+="set[3]=set[3]%12+((temp["+e+"]||'').toLowerCase()=='am'?0:12);";break;case "%s":c+="set[5]=temp["+e+"]||0;";break;case "%M":c+="set[1]=scheduler.locale.date.month_short_hash[temp["+e+"]]||0;";break;case "%F":c+="set[1]=scheduler.locale.date.month_full_hash[temp["+
e+"]]||0;"}var f="set[0],set[1],set[2],set[3],set[4],set[5]";b&&(f=" Date.UTC("+f+")");return new Function("date","var set=[0,0,1,0,0,0]; "+c+" return new Date("+f+");")},getISOWeek:function(a){if(!a)return!1;var b=a.getDay();b===0&&(b=7);var c=new Date(a.valueOf());c.setDate(a.getDate()+(4-b));var d=c.getFullYear(),e=Math.round((c.getTime()-(new Date(d,0,1)).getTime())/864E5),f=1+Math.floor(e/7);return f},getUTCISOWeek:function(a){return this.getISOWeek(a)},convert_to_utc:function(a){return new Date(a.getUTCFullYear(),
a.getUTCMonth(),a.getUTCDate(),a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds())}};
scheduler.locale={date:{month_full:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),month_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),day_full:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},labels:{dhx_cal_today_button:"Today",day_tab:"Day",week_tab:"Week",month_tab:"Month",new_event:"New event",icon_save:"Save",icon_cancel:"Cancel",icon_details:"Details",
icon_edit:"Edit",icon_delete:"Delete",confirm_closing:"",confirm_deleting:"Event will be deleted permanently, are you sure?",section_description:"Description",section_time:"Time period",full_day:"Full day",confirm_recurring:"Do you want to edit the whole set of repeated events?",section_recurring:"Repeat event",button_recurring:"Disabled",button_recurring_open:"Enabled",agenda_tab:"Agenda",date:"Date",description:"Description",year_tab:"Year",week_agenda_tab:"Agenda"}};
icon_edit:"Edit",icon_delete:"Delete",confirm_closing:"",confirm_deleting:"Event will be deleted permanently, are you sure?",section_description:"Description",section_time:"Time period",full_day:"Full day",confirm_recurring:"Do you want to edit the whole set of repeated events?",section_recurring:"Repeat event",button_recurring:"Disabled",button_recurring_open:"Enabled",button_edit_series:"Edit series",button_edit_occurrence:"Edit occurrence",agenda_tab:"Agenda",date:"Date",description:"Description",
year_tab:"Year",week_agenda_tab:"Agenda",grid_tab:"Grid"}};
scheduler.config={default_date:"%j %M %Y",month_date:"%F %Y",load_date:"%Y-%m-%d",week_date:"%l",day_date:"%D, %F %j",hour_date:"%H:%i",month_day:"%d",xml_date:"%m/%d/%Y %H:%i",api_date:"%d-%m-%Y %H:%i",hour_size_px:42,time_step:5,start_on_monday:1,first_hour:0,last_hour:24,readonly:!1,drag_resize:1,drag_move:1,drag_create:1,dblclick_create:1,edit_on_create:1,details_on_create:0,click_form_details:0,cascade_event_display:!1,cascade_event_count:4,cascade_event_margin:30,drag_lightbox:!0,preserve_scroll:!0,
server_utc:!1,positive_closing:!1,icons_edit:["icon_save","icon_cancel"],icons_select:["icon_details","icon_edit","icon_delete"],buttons_left:["dhx_save_btn","dhx_cancel_btn"],buttons_right:["dhx_delete_btn"],lightbox:{sections:[{name:"description",height:200,map_to:"text",type:"textarea",focus:!0},{name:"time",height:72,type:"time",map_to:"auto"}]},repeat_date_of_end:"01.01.2010"};scheduler.templates={};
scheduler.init_templates=function(){var a=scheduler.date.date_to_str,b=scheduler.config,c=function(a,b){for(var c in b)a[c]||(a[c]=b[c])};c(scheduler.templates,{day_date:a(b.default_date),month_date:a(b.month_date),week_date:function(a,b){return scheduler.templates.day_date(a)+" &ndash; "+scheduler.templates.day_date(scheduler.date.add(b,-1,"day"))},day_scale_date:a(b.default_date),month_scale_date:a(b.week_date),week_scale_date:a(b.day_date),hour_scale:a(b.hour_date),time_picker:a(b.hour_date),event_date:a(b.hour_date),
month_day:a(b.month_day),xml_date:scheduler.date.str_to_date(b.xml_date,b.server_utc),load_format:a(b.load_date,b.server_utc),xml_format:a(b.xml_date,b.server_utc),api_date:scheduler.date.str_to_date(b.api_date),event_header:function(a,b){return scheduler.templates.event_date(a)+" - "+scheduler.templates.event_date(b)},event_text:function(a,b,c){return c.text},event_class:function(){return""},month_date_class:function(){return""},week_date_class:function(){return""},event_bar_date:function(a){return scheduler.templates.event_date(a)+
" "},event_bar_text:function(a,b,c){return c.text}});this.callEvent("onTemplatesReady",[])};scheduler.uid=function(){if(!this._seed)this._seed=(new Date).valueOf();return this._seed++};scheduler._events={};scheduler.clearAll=function(){this._events={};this._loaded={};this.clear_view()};
select:!0,server_utc:!1,positive_closing:!1,icons_edit:["icon_save","icon_cancel"],icons_select:["icon_details","icon_edit","icon_delete"],buttons_left:["dhx_save_btn","dhx_cancel_btn"],buttons_right:["dhx_delete_btn"],lightbox:{sections:[{name:"description",height:200,map_to:"text",type:"textarea",focus:!0},{name:"time",height:72,type:"time",map_to:"auto"}]},highlight_displayed_event:!0,displayed_event_color:"#ffc5ab",displayed_event_text_color:"#7e2727"};scheduler.templates={};
scheduler.init_templates=function(){var a=scheduler.locale.labels;a.dhx_save_btn=a.icon_save;a.dhx_cancel_btn=a.icon_cancel;a.dhx_delete_btn=a.icon_delete;var b=scheduler.date.date_to_str,c=scheduler.config,d=function(a,b){for(var c in b)a[c]||(a[c]=b[c])};d(scheduler.templates,{day_date:b(c.default_date),month_date:b(c.month_date),week_date:function(a,b){return scheduler.templates.day_date(a)+" &ndash; "+scheduler.templates.day_date(scheduler.date.add(b,-1,"day"))},day_scale_date:b(c.default_date),
month_scale_date:b(c.week_date),week_scale_date:b(c.day_date),hour_scale:b(c.hour_date),time_picker:b(c.hour_date),event_date:b(c.hour_date),month_day:b(c.month_day),xml_date:scheduler.date.str_to_date(c.xml_date,c.server_utc),load_format:b(c.load_date,c.server_utc),xml_format:b(c.xml_date,c.server_utc),api_date:scheduler.date.str_to_date(c.api_date),event_header:function(a,b){return scheduler.templates.event_date(a)+" - "+scheduler.templates.event_date(b)},event_text:function(a,b,c){return c.text},
event_class:function(){return""},month_date_class:function(){return""},week_date_class:function(){return""},event_bar_date:function(a){return scheduler.templates.event_date(a)+" "},event_bar_text:function(a,b,c){return c.text}});this.callEvent("onTemplatesReady",[])};scheduler.uid=function(){if(!this._seed)this._seed=(new Date).valueOf();return this._seed++};scheduler._events={};scheduler.clearAll=function(){this._events={};this._loaded={};this.clear_view()};
scheduler.addEvent=function(a,b,c,d,e){if(!arguments.length)return this.addEventNow();var f=a;if(arguments.length!=1)f=e||{},f.start_date=a,f.end_date=b,f.text=c,f.id=d;f.id=f.id||scheduler.uid();f.text=f.text||"";if(typeof f.start_date=="string")f.start_date=this.templates.api_date(f.start_date);if(typeof f.end_date=="string")f.end_date=this.templates.api_date(f.end_date);var g=(this.config.event_duration||this.config.time_step)*6E4;f.start_date.valueOf()==f.end_date.valueOf()&&f.end_date.setTime(f.end_date.valueOf()+
g);f._timed=this.is_one_day_event(f);var h=!this._events[f.id];this._events[f.id]=f;this.event_updated(f);this._loading||this.callEvent(h?"onEventAdded":"onEventChanged",[f.id,f])};scheduler.deleteEvent=function(a,b){var c=this._events[a];if(b||this.callEvent("onBeforeEventDelete",[a,c])&&this.callEvent("onConfirmedBeforeEventDelete",[a,c]))c&&(delete this._events[a],this.unselect(a),this.event_updated(c)),this.callEvent("onEventDeleted",[a])};scheduler.getEvent=function(a){return this._events[a]};
g);f._timed=this.is_one_day_event(f);var h=!this._events[f.id];this._events[f.id]=f;this.event_updated(f);this._loading||this.callEvent(h?"onEventAdded":"onEventChanged",[f.id,f]);return f.id};scheduler.deleteEvent=function(a,b){var c=this._events[a];if(b||this.callEvent("onBeforeEventDelete",[a,c])&&this.callEvent("onConfirmedBeforeEventDelete",[a,c]))c&&(delete this._events[a],this.unselect(a),this.event_updated(c)),this.callEvent("onEventDeleted",[a,c])};scheduler.getEvent=function(a){return this._events[a]};
scheduler.setEvent=function(a,b){this._events[a]=b};scheduler.for_rendered=function(a,b){for(var c=this._rendered.length-1;c>=0;c--)this._rendered[c].getAttribute("event_id")==a&&b(this._rendered[c],c)};scheduler.changeEventId=function(a,b){if(a!=b){var c=this._events[a];if(c)c.id=b,this._events[b]=c,delete this._events[a];this.for_rendered(a,function(a){a.setAttribute("event_id",b)});if(this._select_id==a)this._select_id=b;if(this._edit_id==a)this._edit_id=b;this.callEvent("onEventIdChange",[a,b])}};
(function(){for(var a="text,Text,start_date,StartDate,end_date,EndDate".split(","),b=function(a){return function(b){return scheduler.getEvent(b)[a]}},c=function(a){return function(b,c){var d=scheduler.getEvent(b);d[a]=c;d._changed=!0;d._timed=this.is_one_day_event(d);scheduler.event_updated(d,!0)}},d=0;d<a.length;d+=2)scheduler["getEvent"+a[d+1]]=b(a[d]),scheduler["setEvent"+a[d+1]]=c(a[d])})();scheduler.event_updated=function(a){this.is_visible_events(a)?this.render_view_data():this.clear_event(a.id)};
scheduler.is_visible_events=function(a){return a.start_date<this._max_date&&this._min_date<a.end_date};scheduler.is_one_day_event=function(a){var b=a.end_date.getDate()-a.start_date.getDate();return b?(b<0&&(b=Math.ceil((a.end_date.valueOf()-a.start_date.valueOf())/864E5)),b==1&&!a.end_date.getHours()&&!a.end_date.getMinutes()&&(a.start_date.getHours()||a.start_date.getMinutes())):a.start_date.getMonth()==a.end_date.getMonth()&&a.start_date.getFullYear()==a.end_date.getFullYear()};
scheduler.get_visible_events=function(){var a=[],b=this["filter_"+this._mode],c;for(c in this._events)if(this.is_visible_events(this._events[c])&&(this._table_view||this.config.multi_day||this._events[c]._timed))(!b||b(c,this._events[c]))&&a.push(this._events[c]);return a};
scheduler.render_view_data=function(a,b){if(!a){if(this._not_render){this._render_wait=!0;return}this._render_wait=!1;this.clear_view();a=this.get_visible_events()}if(this.config.multi_day&&!this._table_view){for(var c=[],d=[],e=0;e<a.length;e++)a[e]._timed?c.push(a[e]):d.push(a[e]);this._rendered_location=this._els.dhx_multi_day[0];this._table_view=!0;this.render_data(d,b);this._table_view=!1;this._rendered_location=this._els.dhx_cal_data[0];this._table_view=!1;this.render_data(c,b)}else this._rendered_location=
this._els.dhx_cal_data[0],this.render_data(a,b)};scheduler.render_data=function(a,b){for(var a=this._pre_render_events(a,b),c=0;c<a.length;c++)this._table_view?this.render_event_bar(a[c]):this.render_event(a[c])};
scheduler._pre_render_events=function(a,b){var c=this.xy.bar_height,d=this._colsS.heights,e=this._colsS.heights=[0,0,0,0,0,0,0],f=this._els.dhx_cal_data[0],a=this._table_view?this._pre_render_events_table(a,b):this._pre_render_events_line(a,b);if(this._table_view)if(b)this._colsS.heights=d;else{var g=f.firstChild;if(g.rows){for(var h=0;h<g.rows.length;h++){e[h]++;if(e[h]*c>this._colsS.height-22){for(var i=g.rows[h].cells,k=0;k<i.length;k++)i[k].childNodes[1].style.height=e[h]*c+"px";e[h]=(e[h-1]||
0)+i[0].offsetHeight}e[h]=(e[h-1]||0)+g.rows[h].cells[0].offsetHeight}e.unshift(0);if(g.parentNode.offsetHeight<g.parentNode.scrollHeight&&!g._h_fix){for(h=0;h<g.rows.length;h++){var j=g.rows[h].cells[6].childNodes[0],l=j.offsetWidth-scheduler.xy.scroll_width+"px";j.style.width=l;j.nextSibling.style.width=l}g._h_fix=!0}}else if(!a.length&&this._els.dhx_multi_day[0].style.visibility=="visible"&&(e[0]=-1),a.length||e[0]==-1){var o=g.parentNode.childNodes,m=(e[0]+1)*c+1+"px";f.style.top=this._els.dhx_cal_navline[0].offsetHeight+
this._els.dhx_cal_header[0].offsetHeight+parseInt(m)+"px";f.style.height=this._obj.offsetHeight-parseInt(f.style.top)-(this.xy.margin_top||0)+"px";var n=this._els.dhx_multi_day[0];n.style.height=m;n.style.visibility=e[0]==-1?"hidden":"visible";n=this._els.dhx_multi_day[1];n.style.height=m;n.style.visibility=e[0]==-1?"hidden":"visible";n.className=e[0]?"dhx_multi_day_icon":"dhx_multi_day_icon_small";this._dy_shift=(e[0]+1)*c;e[0]=0}}return a};
scheduler._get_event_sday=function(a){return Math.floor((a.start_date.valueOf()-this._min_date.valueOf())/864E5)};
scheduler._pre_render_events_line=function(a,b){a.sort(function(a,b){return a.start_date.valueOf()==b.start_date.valueOf()?a.id>b.id?1:-1:a.start_date>b.start_date?1:-1});for(var c=[],d=[],e=0;e<a.length;e++){var f=a[e],g=f.start_date.getHours(),h=f.end_date.getHours();f._sday=this._get_event_sday(f);c[f._sday]||(c[f._sday]=[]);if(!b){f._inner=!1;for(var i=c[f._sday];i.length&&i[i.length-1].end_date<=f.start_date;)i.splice(i.length-1,1);for(var k=!1,j=0;j<i.length;j++)if(i[j].end_date.valueOf()<f.start_date.valueOf()){k=
!0;f._sorder=i[j]._sorder;i.splice(j,1);f._inner=!0;break}if(i.length)i[i.length-1]._inner=!0;if(!k)if(i.length)if(i.length<=i[i.length-1]._sorder){if(i[i.length-1]._sorder)for(j=0;j<i.length;j++){var l=!1;for(k=0;k<i.length;k++)if(i[k]._sorder==j){l=!0;break}if(!l){f._sorder=j;break}}else f._sorder=0;f._inner=!0}else{l=i[0]._sorder;for(j=1;j<i.length;j++)if(i[j]._sorder>l)l=i[j]._sorder;f._sorder=l+1;f._inner=!1}else f._sorder=0;i.push(f);i.length>(i.max_count||0)?(i.max_count=i.length,f._count=
i.length):f._count=f._count?f._count:1}if(g<this.config.first_hour||h>=this.config.last_hour)if(d.push(f),a[e]=f=this._copy_event(f),g<this.config.first_hour&&(f.start_date.setHours(this.config.first_hour),f.start_date.setMinutes(0)),h>=this.config.last_hour&&(f.end_date.setMinutes(0),f.end_date.setHours(this.config.last_hour)),f.start_date>f.end_date||g==this.config.last_hour)a.splice(e,1),e--}if(!b){for(e=0;e<a.length;e++)a[e]._count=c[a[e]._sday].max_count;for(e=0;e<d.length;e++)d[e]._count=c[d[e]._sday].max_count}return a};
scheduler._time_order=function(a){a.sort(function(a,c){return a.start_date.valueOf()==c.start_date.valueOf()?a._timed&&!c._timed?1:!a._timed&&c._timed?-1:a.id>c.id?1:-1:a.start_date>c.start_date?1:-1})};
scheduler._pre_render_events_table=function(a,b){this._time_order(a);for(var c=[],d=[[],[],[],[],[],[],[]],e=this._colsS.heights,f,g=this._cols.length,h=0;h<a.length;h++){var i=a[h],k=f||i.start_date,j=i.end_date;if(k<this._min_date)k=this._min_date;if(j>this._max_date)j=this._max_date;var l=this.locate_holder_day(k,!1,i);i._sday=l%g;var o=this.locate_holder_day(j,!0,i)||g;i._eday=o%g||g;i._length=o-l;i._sweek=Math.floor((this._correct_shift(k.valueOf(),1)-this._min_date.valueOf())/(864E5*g));var m=
d[i._sweek],n;for(n=0;n<m.length;n++)if(m[n]._eday<=i._sday)break;if(!i._sorder||!b)i._sorder=n;if(i._sday+i._length<=g)f=null,c.push(i),m[n]=i,e[i._sweek]=m.length-1;else{var p=this._copy_event(i);p._length=g-i._sday;p._eday=g;p._sday=i._sday;p._sweek=i._sweek;p._sorder=i._sorder;p.end_date=this.date.add(k,p._length,"day");c.push(p);m[n]=p;f=p.end_date;e[i._sweek]=m.length-1;h--}}return c};scheduler._copy_dummy=function(){this.start_date=new Date(this.start_date);this.end_date=new Date(this.end_date)};
scheduler._copy_event=function(a){this._copy_dummy.prototype=a;return new this._copy_dummy};scheduler._rendered=[];scheduler.clear_view=function(){for(var a=0;a<this._rendered.length;a++){var b=this._rendered[a];b.parentNode&&b.parentNode.removeChild(b)}this._rendered=[]};scheduler.updateEvent=function(a){var b=this.getEvent(a);this.clear_event(a);b&&this.is_visible_events(b)&&this.render_view_data([b],!0)};
scheduler.clear_event=function(a){this.for_rendered(a,function(a,c){a.parentNode&&a.parentNode.removeChild(a);scheduler._rendered.splice(c,1)})};
scheduler.render_event=function(a){var b=scheduler.xy.menu_width;if(!(a._sday<0)){var c=scheduler.locate_holder(a._sday);if(c){var d=a.start_date.getHours()*60+a.start_date.getMinutes(),e=a.end_date.getHours()*60+a.end_date.getMinutes()||scheduler.config.last_hour*60,f=Math.round((d*6E4-this.config.first_hour*36E5)*this.config.hour_size_px/36E5)%(this.config.hour_size_px*24)+1,g=Math.max(scheduler.xy.min_event_height,(e-d)*this.config.hour_size_px/60)+1,h=Math.floor((c.clientWidth-b)/a._count),i=
a._sorder*h+1;a._inner||(h*=a._count-a._sorder);if(this.config.cascade_event_display)var k=this.config.cascade_event_count,j=this.config.cascade_event_margin,i=a._sorder%k*j,l=a._inner?(a._count-a._sorder-1)%k*j/2:0,h=Math.floor(c.clientWidth-b-i-l);var o=this._render_v_bar(a.id,b+i,f,h,g,a._text_style,scheduler.templates.event_header(a.start_date,a.end_date,a),scheduler.templates.event_text(a.start_date,a.end_date,a));this._rendered.push(o);c.appendChild(o);i=i+parseInt(c.style.left,10)+b;if(this._edit_id==
a.id){o.style.zIndex=1;h=Math.max(h-4,scheduler.xy.editor_width);o=document.createElement("DIV");o.setAttribute("event_id",a.id);this.set_xy(o,h,g-20,i,f+14);o.className="dhx_cal_editor";var m=document.createElement("DIV");this.set_xy(m,h-6,g-26);m.style.cssText+=";margin:2px 2px 2px 2px;overflow:hidden;";o.appendChild(m);this._els.dhx_cal_data[0].appendChild(o);this._rendered.push(o);m.innerHTML="<textarea class='dhx_cal_editor'>"+a.text+"</textarea>";if(this._quirks7)m.firstChild.style.height=g-
12+"px";this._editor=m.firstChild;this._editor.onkeypress=function(a){if((a||event).shiftKey)return!0;var b=(a||event).keyCode;b==scheduler.keys.edit_save&&scheduler.editStop(!0);b==scheduler.keys.edit_cancel&&scheduler.editStop(!1)};this._editor.onselectstart=function(a){return(a||event).cancelBubble=!0};m.firstChild.focus();this._els.dhx_cal_data[0].scrollLeft=0;m.firstChild.select()}if(this._select_id==a.id){if(this.config.cascade_event_display&&this._drag_mode)o.style.zIndex=1;for(var n=this.config["icons_"+
(this._edit_id==a.id?"edit":"select")],p="",q=a.color?"background-color:"+a.color+";":"",v=a.textColor?"color:"+a.textColor+";":"",s=0;s<n.length;s++)p+="<div class='dhx_menu_icon "+n[s]+"' style='"+q+""+v+"' title='"+this.locale.labels[n[s]]+"'></div>";var r=this._render_v_bar(a.id,i-b+1,f,b,n.length*20+26,"","<div style='"+q+""+v+"' class='dhx_menu_head'></div>",p,!0);r.style.left=i-b+1;this._els.dhx_cal_data[0].appendChild(r);this._rendered.push(r)}}}};
scheduler._render_v_bar=function(a,b,c,d,e,f,g,h,i){var k=document.createElement("DIV"),j=this.getEvent(a),l="dhx_cal_event",o=scheduler.templates.event_class(j.start_date,j.end_date,j);o&&(l=l+" "+o);var m=j.color?"background-color:"+j.color+";":"",n=j.textColor?"color:"+j.textColor+";":"",p='<div event_id="'+a+'" class="'+l+'" style="position:absolute; top:'+c+"px; left:"+b+"px; width:"+(d-4)+"px; height:"+e+"px;"+(f||"")+'">';p+='<div class="dhx_header" style=" width:'+(d-6)+"px;"+m+'" >&nbsp;</div>';
p+='<div class="dhx_title" style="'+m+""+n+'">'+g+"</div>";p+='<div class="dhx_body" style=" width:'+(d-(this._quirks?4:14))+"px; height:"+(e-(this._quirks?20:30))+"px;"+m+""+n+'">'+h+"</div>";p+='<div class="dhx_footer" style=" width:'+(d-8)+"px;"+(i?" margin-top:-1px;":"")+""+m+""+n+'" ></div></div>';k.innerHTML=p;return k.firstChild};scheduler.locate_holder=function(a){return this._mode=="day"?this._els.dhx_cal_data[0].firstChild:this._els.dhx_cal_data[0].childNodes[a]};
scheduler.locate_holder_day=function(a,b){var c=Math.floor((this._correct_shift(a,1)-this._min_date)/864E5);b&&this.date.time_part(a)&&c++;return c};
scheduler.render_event_bar=function(a){var b=this._rendered_location,c=this._colsS[a._sday],d=this._colsS[a._eday];d==c&&(d=this._colsS[a._eday+1]);var e=this.xy.bar_height,f=this._colsS.heights[a._sweek]+(this._colsS.height?this.xy.month_scale_height+2:2)+a._sorder*e,g=document.createElement("DIV"),h=a._timed?"dhx_cal_event_clear":"dhx_cal_event_line",i=scheduler.templates.event_class(a.start_date,a.end_date,a);i&&(h=h+" "+i);var k=a.color?"background-color:"+a.color+";":"",j=a.textColor?"color:"+
a.textColor+";":"",l='<div event_id="'+a.id+'" class="'+h+'" style="position:absolute; top:'+f+"px; left:"+c+"px; width:"+(d-c-15)+"px;"+j+""+k+""+(a._text_style||"")+'">';a._timed&&(l+=scheduler.templates.event_bar_date(a.start_date,a.end_date,a));l+=scheduler.templates.event_bar_text(a.start_date,a.end_date,a)+"</div>";l+="</div>";g.innerHTML=l;this._rendered.push(g.firstChild);b.appendChild(g.firstChild)};
scheduler._locate_event=function(a){for(var b=null;a&&!b&&a.getAttribute;)b=a.getAttribute("event_id"),a=a.parentNode;return b};scheduler.edit=function(a){if(this._edit_id!=a)this.editStop(!1,a),this._edit_id=a,this.updateEvent(a)};scheduler.editStop=function(a,b){if(!(b&&this._edit_id==b)){var c=this.getEvent(this._edit_id);if(c){if(a)c.text=this._editor.value;this._editor=this._edit_id=null;this.updateEvent(c.id);this._edit_stop_event(c,a)}}};
scheduler._edit_stop_event=function(a,b){this._new_event?(b?this.callEvent("onEventAdded",[a.id,a]):this.deleteEvent(a.id,!0),this._new_event=null):b&&this.callEvent("onEventChanged",[a.id,a])};scheduler.getEvents=function(a,b){var c=[],d;for(d in this._events){var e=this._events[d];e&&e.start_date<b&&e.end_date>a&&c.push(e)}return c};scheduler._loaded={};
scheduler.get_visible_events=function(a){var b=[],c;for(c in this._events)this.is_visible_events(this._events[c])&&(!a||this._events[c]._timed)&&this.filter_event(c,this._events[c])&&b.push(this._events[c]);return b};scheduler.filter_event=function(a,b){var c=this["filter_"+this._mode];return c?c(a,b):!0};
scheduler.render_view_data=function(a,b){if(!a){if(this._not_render){this._render_wait=!0;return}this._render_wait=!1;this.clear_view();a=this.get_visible_events(!(this._table_view||this.config.multi_day))}if(this.config.multi_day&&!this._table_view){for(var c=[],d=[],e=0;e<a.length;e++)a[e]._timed?c.push(a[e]):d.push(a[e]);this._rendered_location=this._els.dhx_multi_day[0];this._table_view=!0;this.render_data(d,b);this._table_view=!1;this._rendered_location=this._els.dhx_cal_data[0];this._table_view=
!1;this.render_data(c,b)}else this._rendered_location=this._els.dhx_cal_data[0],this.render_data(a,b)};scheduler.render_data=function(a,b){for(var a=this._pre_render_events(a,b),c=0;c<a.length;c++)this._table_view?this.render_event_bar(a[c]):this.render_event(a[c])};
scheduler._pre_render_events=function(a,b){var c=this.xy.bar_height,d=this._colsS.heights,e=this._colsS.heights=[0,0,0,0,0,0,0],f=this._els.dhx_cal_data[0],a=this._table_view?this._pre_render_events_table(a,b):this._pre_render_events_line(a,b);if(this._table_view)if(b)this._colsS.heights=d;else{var g=f.firstChild;if(g.rows){for(var h=0;h<g.rows.length;h++){e[h]++;if(e[h]*c>this._colsS.height-22){for(var k=g.rows[h].cells,i=0;i<k.length;i++)k[i].childNodes[1].style.height=e[h]*c+"px";e[h]=(e[h-1]||
0)+k[0].offsetHeight}e[h]=(e[h-1]||0)+g.rows[h].cells[0].offsetHeight}e.unshift(0);if(g.parentNode.offsetHeight<g.parentNode.scrollHeight&&!g._h_fix){for(h=0;h<g.rows.length;h++){var j=g.rows[h].cells[6].childNodes[0],m=j.offsetWidth-scheduler.xy.scroll_width+"px";j.style.width=m;j.nextSibling.style.width=m}g._h_fix=!0}}else if(!a.length&&this._els.dhx_multi_day[0].style.visibility=="visible"&&(e[0]=-1),a.length||e[0]==-1){var p=g.parentNode.childNodes,l=(e[0]+1)*c+1+"px";f.style.top=this._els.dhx_cal_navline[0].offsetHeight+
this._els.dhx_cal_header[0].offsetHeight+parseInt(l,10)+"px";f.style.height=this._obj.offsetHeight-parseInt(f.style.top,10)-(this.xy.margin_top||0)+"px";var n=this._els.dhx_multi_day[0];n.style.height=l;n.style.visibility=e[0]==-1?"hidden":"visible";n=this._els.dhx_multi_day[1];n.style.height=l;n.style.visibility=e[0]==-1?"hidden":"visible";n.className=e[0]?"dhx_multi_day_icon":"dhx_multi_day_icon_small";this._dy_shift=(e[0]+1)*c;e[0]=0}}return a};
scheduler._get_event_sday=function(a){return Math.floor((a.start_date.valueOf()-this._min_date.valueOf())/864E5)};scheduler._get_event_mapped_end_date=function(a){var b=a.end_date;if(this.config.separate_short_events){var c=(a.end_date-a.start_date)/6E4;c<this._min_mapped_duration&&(b=this.date.add(b,this._min_mapped_duration-c,"minute"))}return b};
scheduler._pre_render_events_line=function(a,b){a.sort(function(a,b){return a.start_date.valueOf()==b.start_date.valueOf()?a.id>b.id?1:-1:a.start_date>b.start_date?1:-1});var c=[],d=[];this._min_mapped_duration=Math.ceil(this.xy.min_event_height*60/this.config.hour_size_px);for(var e=0;e<a.length;e++){var f=a[e],g=f.start_date,h=f.end_date,k=g.getHours(),i=h.getHours();f._sday=this._get_event_sday(f);c[f._sday]||(c[f._sday]=[]);if(!b){f._inner=!1;for(var j=c[f._sday];j.length;){var m=j[j.length-1],
p=this._get_event_mapped_end_date(m);if(p.valueOf()<=f.start_date.valueOf())j.splice(j.length-1,1);else break}for(var l=!1,n=0;n<j.length;n++)if(m=j[n],p=this._get_event_mapped_end_date(m),p.valueOf()<=f.start_date.valueOf()){l=!0;f._sorder=m._sorder;j.splice(n,1);f._inner=!0;break}if(j.length)j[j.length-1]._inner=!0;if(!l)if(j.length)if(j.length<=j[j.length-1]._sorder){if(j[j.length-1]._sorder)for(n=0;n<j.length;n++){for(var r=!1,o=0;o<j.length;o++)if(j[o]._sorder==n){r=!0;break}if(!r){f._sorder=
n;break}}else f._sorder=0;f._inner=!0}else{r=j[0]._sorder;for(n=1;n<j.length;n++)if(j[n]._sorder>r)r=j[n]._sorder;f._sorder=r+1;f._inner=!1}else f._sorder=0;j.push(f);j.length>(j.max_count||0)?(j.max_count=j.length,f._count=j.length):f._count=f._count?f._count:1}if(k<this.config.first_hour||i>=this.config.last_hour)if(d.push(f),a[e]=f=this._copy_event(f),k<this.config.first_hour&&(f.start_date.setHours(this.config.first_hour),f.start_date.setMinutes(0)),i>=this.config.last_hour&&(f.end_date.setMinutes(0),
f.end_date.setHours(this.config.last_hour)),f.start_date>f.end_date||k==this.config.last_hour)a.splice(e,1),e--}if(!b){for(e=0;e<a.length;e++)a[e]._count=c[a[e]._sday].max_count;for(e=0;e<d.length;e++)d[e]._count=c[d[e]._sday].max_count}return a};scheduler._time_order=function(a){a.sort(function(a,c){return a.start_date.valueOf()==c.start_date.valueOf()?a._timed&&!c._timed?1:!a._timed&&c._timed?-1:a.id>c.id?1:-1:a.start_date>c.start_date?1:-1})};
scheduler._pre_render_events_table=function(a,b){this._time_order(a);for(var c=[],d=[[],[],[],[],[],[],[]],e=this._colsS.heights,f,g=this._cols.length,h={},k=0;k<a.length;k++){var i=a[k],j=i.id;h[j]||(h[j]={first_chunk:!0,last_chunk:!0});var m=h[j],p=f||i.start_date,l=i.end_date;if(p<this._min_date)m.first_chunk=!1,p=this._min_date;if(l>this._max_date)m.last_chunk=!1,l=this._max_date;var n=this.locate_holder_day(p,!1,i);i._sday=n%g;var r=this.locate_holder_day(l,!0,i)||g;i._eday=r%g||g;i._length=
r-n;i._sweek=Math.floor((this._correct_shift(p.valueOf(),1)-this._min_date.valueOf())/(864E5*g));var o=d[i._sweek],q;for(q=0;q<o.length;q++)if(o[q]._eday<=i._sday)break;if(!i._sorder||!b)i._sorder=q;if(i._sday+i._length<=g)f=null,c.push(i),o[q]=i,e[i._sweek]=o.length-1,i._first_chunk=m.first_chunk,i._last_chunk=m.last_chunk;else{var s=this._copy_event(i);s.id=i.id;s._length=g-i._sday;s._eday=g;s._sday=i._sday;s._sweek=i._sweek;s._sorder=i._sorder;s.end_date=this.date.add(p,s._length,"day");if(s._first_chunk=
m.first_chunk)m.first_chunk=!1;c.push(s);o[q]=s;f=s.end_date;e[i._sweek]=o.length-1;k--}}return c};scheduler._copy_dummy=function(){var a=new Date(this.start_date),b=new Date(this.end_date);this.start_date=a;this.end_date=b};scheduler._copy_event=function(a){this._copy_dummy.prototype=a;return new this._copy_dummy};scheduler._rendered=[];scheduler.clear_view=function(){for(var a=0;a<this._rendered.length;a++){var b=this._rendered[a];b.parentNode&&b.parentNode.removeChild(b)}this._rendered=[]};
scheduler.updateEvent=function(a){var b=this.getEvent(a);this.clear_event(a);if(b&&this.is_visible_events(b)&&this.filter_event(a,b)&&(this._table_view||this.config.multi_day||b._timed))this.config.update_render?this.render_view_data():this.render_view_data([b],!0)};scheduler.clear_event=function(a){this.for_rendered(a,function(a,c){a.parentNode&&a.parentNode.removeChild(a);scheduler._rendered.splice(c,1)})};
scheduler.render_event=function(a){var b=scheduler.xy.menu_width;if(!(a._sday<0)){var c=scheduler.locate_holder(a._sday);if(c){var d=a.start_date.getHours()*60+a.start_date.getMinutes(),e=a.end_date.getHours()*60+a.end_date.getMinutes()||scheduler.config.last_hour*60,f=a._count||1,g=a._sorder||0,h=Math.round((d*6E4-this.config.first_hour*36E5)*this.config.hour_size_px/36E5)%(this.config.hour_size_px*24),k=Math.max(scheduler.xy.min_event_height,(e-d)*this.config.hour_size_px/60),i=Math.floor((c.clientWidth-
b)/f),j=g*i+1;a._inner||(i*=f-g);if(this.config.cascade_event_display)var m=this.config.cascade_event_count,p=this.config.cascade_event_margin,j=g%m*p,l=a._inner?(f-g-1)%m*p/2:0,i=Math.floor(c.clientWidth-b-j-l);var n=this._render_v_bar(a.id,b+j,h,i,k,a._text_style,scheduler.templates.event_header(a.start_date,a.end_date,a),scheduler.templates.event_text(a.start_date,a.end_date,a));this._rendered.push(n);c.appendChild(n);j=j+parseInt(c.style.left,10)+b;if(this._edit_id==a.id){n.style.zIndex=1;i=Math.max(i-
4,scheduler.xy.editor_width);n=document.createElement("DIV");n.setAttribute("event_id",a.id);this.set_xy(n,i,k-20,j,h+14);n.className="dhx_cal_editor";var r=document.createElement("DIV");this.set_xy(r,i-6,k-26);r.style.cssText+=";margin:2px 2px 2px 2px;overflow:hidden;";n.appendChild(r);this._els.dhx_cal_data[0].appendChild(n);this._rendered.push(n);r.innerHTML="<textarea class='dhx_cal_editor'>"+a.text+"</textarea>";if(this._quirks7)r.firstChild.style.height=k-12+"px";this._editor=r.firstChild;this._editor.onkeydown=
function(a){if((a||event).shiftKey)return!0;var b=(a||event).keyCode;b==scheduler.keys.edit_save&&scheduler.editStop(!0);b==scheduler.keys.edit_cancel&&scheduler.editStop(!1)};this._editor.onselectstart=function(a){return(a||event).cancelBubble=!0};r.firstChild.focus();this._els.dhx_cal_data[0].scrollLeft=0;r.firstChild.select()}if(this.xy.menu_width!==0&&this._select_id==a.id){if(this.config.cascade_event_display&&this._drag_mode)n.style.zIndex=1;for(var o=this.config["icons_"+(this._edit_id==a.id?
"edit":"select")],q="",s=a.color?"background-color: "+a.color+";":"",t=a.textColor?"color: "+a.textColor+";":"",u=0;u<o.length;u++)q+="<div class='dhx_menu_icon "+o[u]+"' style='"+s+""+t+"' title='"+this.locale.labels[o[u]]+"'></div>";var w=this._render_v_bar(a.id,j-b+1,h,b,o.length*20+26-2,"","<div style='"+s+""+t+"' class='dhx_menu_head'></div>",q,!0);w.style.left=j-b+1;this._els.dhx_cal_data[0].appendChild(w);this._rendered.push(w)}}}};
scheduler._render_v_bar=function(a,b,c,d,e,f,g,h,k){var i=document.createElement("DIV"),j=this.getEvent(a),m=k?"dhx_cal_event dhx_cal_select_menu":"dhx_cal_event",p=scheduler.templates.event_class(j.start_date,j.end_date,j);p&&(m=m+" "+p);var l=j.color?"background:"+j.color+";":"",n=j.textColor?"color:"+j.textColor+";":"",r='<div event_id="'+a+'" class="'+m+'" style="position:absolute; top:'+c+"px; left:"+b+"px; width:"+(d-4)+"px; height:"+e+"px;"+(f||"")+'"></div>';i.innerHTML=r;var o=i.cloneNode(!0).firstChild;
if(!scheduler.renderEvent||k||!scheduler.renderEvent(o,j)){var o=i.firstChild,q='<div class="dhx_event_move dhx_header" style=" width:'+(d-6)+"px;"+l+'" >&nbsp;</div>';q+='<div class="dhx_event_move dhx_title" style="'+l+""+n+'">'+g+"</div>";q+='<div class="dhx_body" style=" width:'+(d-(this._quirks?4:14))+"px; height:"+(e-(this._quirks?20:30)+1)+"px;"+l+""+n+'">'+h+"</div>";var s="dhx_event_resize dhx_footer";k&&(s="dhx_resize_denied "+s);q+='<div class="'+s+'" style=" width:'+(d-8)+"px;"+(k?" margin-top:-1px;":
"")+""+l+""+n+'" ></div>';o.innerHTML=q}return o};scheduler.locate_holder=function(a){return this._mode=="day"?this._els.dhx_cal_data[0].firstChild:this._els.dhx_cal_data[0].childNodes[a]};scheduler.locate_holder_day=function(a,b){var c=Math.floor((this._correct_shift(a,1)-this._min_date)/864E5);b&&this.date.time_part(a)&&c++;return c};
scheduler.render_event_bar=function(a){var b=this._rendered_location,c=this._colsS[a._sday],d=this._colsS[a._eday];d==c&&(d=this._colsS[a._eday+1]);var e=this.xy.bar_height,f=this._colsS.heights[a._sweek]+(this._colsS.height?this.xy.month_scale_height+2:2)+a._sorder*e,g=document.createElement("DIV"),h="dhx_cal_event_clear";a._timed||(h="dhx_cal_event_line",a.hasOwnProperty("_first_chunk")&&a._first_chunk&&(h+=" dhx_cal_event_line_start"),a.hasOwnProperty("_last_chunk")&&a._last_chunk&&(h+=" dhx_cal_event_line_end"));
var k=scheduler.templates.event_class(a.start_date,a.end_date,a);k&&(h=h+" "+k);var i=a.color?"background:"+a.color+";":"",j=a.textColor?"color:"+a.textColor+";":"",m='<div event_id="'+a.id+'" class="'+h+'" style="position:absolute; top:'+f+"px; left:"+c+"px; width:"+(d-c-15)+"px;"+j+""+i+""+(a._text_style||"")+'">',a=scheduler.getEvent(a.id);a._timed&&(m+=scheduler.templates.event_bar_date(a.start_date,a.end_date,a));m+=scheduler.templates.event_bar_text(a.start_date,a.end_date,a)+"</div>";m+="</div>";
g.innerHTML=m;this._rendered.push(g.firstChild);b.appendChild(g.firstChild)};scheduler._locate_event=function(a){for(var b=null;a&&!b&&a.getAttribute;)b=a.getAttribute("event_id"),a=a.parentNode;return b};scheduler.edit=function(a){if(this._edit_id!=a)this.editStop(!1,a),this._edit_id=a,this.updateEvent(a)};
scheduler.editStop=function(a,b){if(!(b&&this._edit_id==b)){var c=this.getEvent(this._edit_id);if(c){if(a)c.text=this._editor.value;this._editor=this._edit_id=null;this.updateEvent(c.id);this._edit_stop_event(c,a)}}};scheduler._edit_stop_event=function(a,b){this._new_event?(b?this.callEvent("onEventAdded",[a.id,a]):a&&this.deleteEvent(a.id,!0),this._new_event=null):b&&this.callEvent("onEventChanged",[a.id,a])};
scheduler.getEvents=function(a,b){var c=[],d;for(d in this._events){var e=this._events[d];e&&(!a&&!b||e.start_date<b&&e.end_date>a)&&c.push(e)}return c};scheduler.getRenderedEvent=function(a){if(a){for(var b=scheduler._rendered,c=0;c<b.length;c++){var d=b[c];if(d.getAttribute("event_id")==a)return d}return null}};
scheduler.showEvent=function(a,b){var c=typeof a=="number"||typeof a=="string"?scheduler.getEvent(a):a,b=b||scheduler._mode;if(c&&(!this.checkEvent("onBeforeEventDisplay")||this.callEvent("onBeforeEventDisplay",[c,b]))){var d=scheduler.config.scroll_hour;scheduler.config.scroll_hour=c.start_date.getHours();var e=scheduler.config.preserve_scroll;scheduler.config.preserve_scroll=!1;var f=c.color,g=c.textColor;if(scheduler.config.highlight_displayed_event)c.color=scheduler.config.displayed_event_color,
c.textColor=scheduler.config.displayed_event_text_color;scheduler.setCurrentView(new Date(c.start_date),b);c.color=f;c.textColor=g;scheduler.config.scroll_hour=d;scheduler.config.preserve_scroll=e;if(scheduler.matrix&&scheduler.matrix[b])scheduler._els.dhx_cal_data[0].scrollTop=getAbsoluteTop(scheduler.getRenderedEvent(c.id));scheduler.callEvent("onAfterEventDisplay",[c,b])}};scheduler._loaded={};
scheduler._load=function(a,b){a=a||this._load_url;a+=(a.indexOf("?")==-1?"?":"&")+"timeshift="+(new Date).getTimezoneOffset();this.config.prevent_cache&&(a+="&uid="+this.uid());var c,b=b||this._date;if(this._load_mode){for(var d=this.templates.load_format,b=this.date[this._load_mode+"_start"](new Date(b.valueOf()));b>this._min_date;)b=this.date.add(b,-1,this._load_mode);c=b;for(var e=!0;c<this._max_date;)c=this.date.add(c,1,this._load_mode),this._loaded[d(b)]&&e?b=this.date.add(b,1,this._load_mode):
e=!1;var f=c;do c=f,f=this.date.add(c,-1,this._load_mode);while(f>b&&this._loaded[d(f)]);if(c<=b)return!1;for(dhtmlxAjax.get(a+"&from="+d(b)+"&to="+d(c),function(a){scheduler.on_load(a)});b<c;)this._loaded[d(b)]=!0,b=this.date.add(b,1,this._load_mode)}else dhtmlxAjax.get(a,function(a){scheduler.on_load(a)});this.callEvent("onXLS",[]);return!0};
scheduler.on_load=function(a){this._loading=!0;var b;b=this._process?this[this._process].parse(a.xmlDoc.responseText):this._magic_parser(a);this._not_render=!0;for(var c=0;c<b.length;c++)this.callEvent("onEventLoading",[b[c]])&&this.addEvent(b[c]);this._not_render=!1;this._render_wait&&this.render_view_data();this._loading=!1;this._after_call&&this._after_call();this._after_call=null;this.callEvent("onXLE",[])};scheduler.json={};
scheduler.json.parse=function(a){if(typeof a=="string")eval("scheduler._temp = "+a+";"),a=scheduler._temp;for(var b=[],c=0;c<a.length;c++)a[c].start_date=scheduler.templates.xml_date(a[c].start_date),a[c].end_date=scheduler.templates.xml_date(a[c].end_date),b.push(a[c]);return b};scheduler.parse=function(a,b){this._process=b;this.on_load({xmlDoc:{responseText:a}})};scheduler.load=function(a,b,c){if(typeof b=="string")this._process=b,b=c;this._load_url=a;this._after_call=b;this._load(a,this._date)};
scheduler.on_load=function(a){var b;b=this._process?this[this._process].parse(a.xmlDoc.responseText):this._magic_parser(a);scheduler._process_loading(b);this.callEvent("onXLE",[])};scheduler._process_loading=function(a){this._not_render=this._loading=!0;for(var b=0;b<a.length;b++)this.callEvent("onEventLoading",[a[b]])&&this.addEvent(a[b]);this._not_render=!1;this._render_wait&&this.render_view_data();this._loading=!1;this._after_call&&this._after_call();this._after_call=null};scheduler.json={};
scheduler.json.parse=function(a){if(typeof a=="string")scheduler._temp=eval("("+a+")"),a=scheduler._temp?scheduler._temp.data||scheduler._temp:[];if(a.dhx_security)dhtmlx.security_key=a.dhx_security;var b=scheduler._temp&&scheduler._temp.collections?scheduler._temp.collections:{},c=!1,d;for(d in b)if(b.hasOwnProperty(d)){var c=!0,e=b[d],f=scheduler.serverList[d];if(f){f.splice(0,f.length);for(var g=0;g<e.length;g++){var h=e[g],k={key:h.value,label:h.label},i;for(i in h)if(h.hasOwnProperty(i)&&!(i==
"value"||i=="label"))k[i]=h[i];f.push(k)}}}c&&scheduler.callEvent("onOptionsLoad",[]);for(var j=[],m=0;m<a.length;m++)a[m].start_date=scheduler.templates.xml_date(a[m].start_date),a[m].end_date=scheduler.templates.xml_date(a[m].end_date),j.push(a[m]);return j};scheduler.parse=function(a,b){this._process=b;this.on_load({xmlDoc:{responseText:a}})};scheduler.load=function(a,b,c){if(typeof b=="string")this._process=b,b=c;this._load_url=a;this._after_call=b;this._load(a,this._date)};
scheduler.setLoadMode=function(a){a=="all"&&(a="");this._load_mode=a};scheduler.refresh=function(){alert("not implemented")};scheduler.serverList=function(a,b){return b?this.serverList[a]=b.slice(0):this.serverList[a]=this.serverList[a]||[]};scheduler._userdata={};
scheduler._magic_parser=function(a){var b;if(!a.getXMLTopNode){var c=a.xmlDoc.responseText,a=new dtmlXMLLoaderObject(function(){});a.loadXMLString(c)}b=a.getXMLTopNode("data");if(b.tagName!="data")return[];for(var d=a.doXPath("//coll_options"),e=0;e<d.length;e++){var f=d[e].getAttribute("for"),g=this.serverList[f];if(g){g.splice(0,g.length);for(var h=a.doXPath(".//item",d[e]),i=0;i<h.length;i++){for(var k=h[i],j=k.attributes,l={key:h[i].getAttribute("value"),label:h[i].getAttribute("label")},o=0;o<
j.length;o++){var m=j[o];if(!(m.nodeName=="value"||m.nodeName=="label"))l[m.nodeName]=m.nodeValue}g.push(l)}}}d.length&&scheduler.callEvent("onOptionsLoad",[]);for(var n=a.doXPath("//userdata"),e=0;e<n.length;e++){var p=this.xmlNodeToJSON(n[e]);this._userdata[p.name]=p.text}var q=[];b=a.doXPath("//event");for(e=0;e<b.length;e++)q[e]=this.xmlNodeToJSON(b[e]),q[e].text=q[e].text||q[e]._tagvalue,q[e].start_date=this.templates.xml_date(q[e].start_date),q[e].end_date=this.templates.xml_date(q[e].end_date);
return q};scheduler.xmlNodeToJSON=function(a){for(var b={},c=0;c<a.attributes.length;c++)b[a.attributes[c].name]=a.attributes[c].value;for(c=0;c<a.childNodes.length;c++){var d=a.childNodes[c];d.nodeType==1&&(b[d.tagName]=d.firstChild?d.firstChild.nodeValue:"")}if(!b.text)b.text=a.firstChild?a.firstChild.nodeValue:"";return b};
scheduler._magic_parser=function(a){var b;if(!a.getXMLTopNode){var c=a.xmlDoc.responseText,a=new dtmlXMLLoaderObject(function(){});a.loadXMLString(c)}b=a.getXMLTopNode("data");if(b.tagName!="data")return[];var d=b.getAttribute("dhx_security");if(d)dhtmlx.security_key=d;for(var e=a.doXPath("//coll_options"),f=0;f<e.length;f++){var g=e[f].getAttribute("for"),h=this.serverList[g];if(h){h.splice(0,h.length);for(var k=a.doXPath(".//item",e[f]),i=0;i<k.length;i++){for(var j=k[i],m=j.attributes,p={key:k[i].getAttribute("value"),
label:k[i].getAttribute("label")},l=0;l<m.length;l++){var n=m[l];if(!(n.nodeName=="value"||n.nodeName=="label"))p[n.nodeName]=n.nodeValue}h.push(p)}}}e.length&&scheduler.callEvent("onOptionsLoad",[]);for(var r=a.doXPath("//userdata"),f=0;f<r.length;f++){var o=this.xmlNodeToJSON(r[f]);this._userdata[o.name]=o.text}var q=[];b=a.doXPath("//event");for(f=0;f<b.length;f++)q[f]=this.xmlNodeToJSON(b[f]),q[f].text=q[f].text||q[f]._tagvalue,q[f].start_date=this.templates.xml_date(q[f].start_date),q[f].end_date=
this.templates.xml_date(q[f].end_date);return q};scheduler.xmlNodeToJSON=function(a){for(var b={},c=0;c<a.attributes.length;c++)b[a.attributes[c].name]=a.attributes[c].value;for(c=0;c<a.childNodes.length;c++){var d=a.childNodes[c];d.nodeType==1&&(b[d.tagName]=d.firstChild?d.firstChild.nodeValue:"")}if(!b.text)b.text=a.firstChild?a.firstChild.nodeValue:"";return b};
scheduler.attachEvent("onXLS",function(){if(this.config.show_loading===!0){var a;a=this.config.show_loading=document.createElement("DIV");a.className="dhx_loading";a.style.left=Math.round((this._x-128)/2)+"px";a.style.top=Math.round((this._y-15)/2)+"px";this._obj.appendChild(a)}});scheduler.attachEvent("onXLE",function(){var a;if((a=this.config.show_loading)&&typeof a=="object")this._obj.removeChild(a),this.config.show_loading=!0});
scheduler.ical={parse:function(a){var b=a.match(RegExp(this.c_start+"[^\u000c]*"+this.c_end,""));if(b.length){b[0]=b[0].replace(/[\r\n]+(?=[a-z \t])/g," ");b[0]=b[0].replace(/\;[^:\r\n]*/g,"");for(var c=[],d,e=RegExp("(?:"+this.e_start+")([^\u000c]*?)(?:"+this.e_end+")","g");d=e.exec(b);){for(var f={},g,h=/[^\r\n]+[\r\n]+/g;g=h.exec(d[1]);)this.parse_param(g.toString(),f);if(f.uid&&!f.id)f.id=f.uid;c.push(f)}return c}},parse_param:function(a,b){var c=a.indexOf(":");if(c!=-1){var d=a.substr(0,c).toLowerCase(),
e=a.substr(c+1).replace(/\\\,/g,",").replace(/[\r\n]+$/,"");d=="summary"?d="text":d=="dtstart"?(d="start_date",e=this.parse_date(e,0,0)):d=="dtend"&&(d="end_date",e=b.start_date&&b.start_date.getHours()==0?this.parse_date(e,24,0):this.parse_date(e,23,59));b[d]=e}},parse_date:function(a,b,c){var d=a.split("T");d[1]&&(b=d[1].substr(0,2),c=d[1].substr(2,2));var e=d[0].substr(0,4),f=parseInt(d[0].substr(4,2),10)-1,g=d[0].substr(6,2);return scheduler.config.server_utc&&!d[1]?new Date(Date.UTC(e,f,g,b,
c)):new Date(e,f,g,b,c)},c_start:"BEGIN:VCALENDAR",e_start:"BEGIN:VEVENT",e_end:"END:VEVENT",c_end:"END:VCALENDAR"};scheduler.formSection=function(a){for(var b=this.config.lightbox.sections,c=0;c<b.length;c++)if(b[c].name==a)break;var d=b[c],e=document.getElementById(d.id).nextSibling;return{getValue:function(a){return scheduler.form_blocks[d.type].get_value(e,a||{},d)},setValue:function(a,b){return scheduler.form_blocks[d.type].set_value(e,a,b||{},d)}}};
e=a.substr(c+1).replace(/\\\,/g,",").replace(/[\r\n]+$/,"");d=="summary"?d="text":d=="dtstart"?(d="start_date",e=this.parse_date(e,0,0)):d=="dtend"&&(d="end_date",e=this.parse_date(e,0,0));b[d]=e}},parse_date:function(a,b,c){var d=a.split("T");d[1]&&(b=d[1].substr(0,2),c=d[1].substr(2,2));var e=d[0].substr(0,4),f=parseInt(d[0].substr(4,2),10)-1,g=d[0].substr(6,2);return scheduler.config.server_utc&&!d[1]?new Date(Date.UTC(e,f,g,b,c)):new Date(e,f,g,b,c)},c_start:"BEGIN:VCALENDAR",e_start:"BEGIN:VEVENT",
e_end:"END:VEVENT",c_end:"END:VCALENDAR"};scheduler.lightbox={};
scheduler.formSection=function(a){for(var b=this.config.lightbox.sections,c=0;c<b.length;c++)if(b[c].name==a)break;var d=b[c];scheduler._lightbox||scheduler.getLightbox();var e=document.getElementById(d.id),f=e.nextSibling,g={section:d,header:e,node:f,getValue:function(a){return scheduler.form_blocks[d.type].get_value(f,a||{},d)},setValue:function(a,b){return scheduler.form_blocks[d.type].set_value(f,a,b||{},d)}},h=scheduler.lightbox["get_"+d.type+"_control"];return h?h(g):g};
scheduler.lightbox.get_template_control=function(a){a.control=a.node;return a};scheduler.lightbox.get_select_control=function(a){a.control=a.node.getElementsByTagName("select")[0];return a};scheduler.lightbox.get_textarea_control=function(a){a.control=a.node.getElementsByTagName("textarea")[0];return a};scheduler.lightbox.get_time_control=function(a){a.control=a.node.getElementsByTagName("select");return a};
scheduler.form_blocks={template:{render:function(a){var b=(a.height||"30")+"px";return"<div class='dhx_cal_ltext dhx_cal_template' style='height:"+b+";'></div>"},set_value:function(a,b){a.innerHTML=b||""},get_value:function(a){return a.innerHTML||""},focus:function(){}},textarea:{render:function(a){var b=(a.height||"130")+"px";return"<div class='dhx_cal_ltext' style='height:"+b+";'><textarea></textarea></div>"},set_value:function(a,b){a.firstChild.value=b||""},get_value:function(a){return a.firstChild.value},
focus:function(a){var b=a.firstChild;b.select();b.focus()}},select:{render:function(a){for(var b=(a.height||"23")+"px",c="<div class='dhx_cal_ltext' style='height:"+b+";'><select style='width:100%;'>",d=0;d<a.options.length;d++)c+="<option value='"+a.options[d].key+"'>"+a.options[d].label+"</option>";c+="</select></div>";return c},set_value:function(a,b){if(typeof b=="undefined")b=(a.firstChild.options[0]||{}).value;a.firstChild.value=b||""},get_value:function(a){return a.firstChild.value},focus:function(a){var b=
a.firstChild;b.select&&b.select();b.focus()}},time:{render:function(){var a=scheduler.config,b=this.date.date_part(new Date),c=1440,d=0;scheduler.config.limit_time_select&&(c=60*a.last_hour+1,d=60*a.first_hour,b.setHours(a.first_hour));for(var e="<select>",f=d,g=b.getDate();f<c;){var h=this.templates.time_picker(b);e+="<option value='"+f+"'>"+h+"</option>";b.setTime(b.valueOf()+this.config.time_step*6E4);var i=b.getDate()!=g?1:0,f=i*1440+b.getHours()*60+b.getMinutes()}e+="</select> <select>";for(f=
1;f<32;f++)e+="<option value='"+f+"'>"+f+"</option>";e+="</select> <select>";for(f=0;f<12;f++)e+="<option value='"+f+"'>"+this.locale.date.month_full[f]+"</option>";e+="</select> <select>";b=b.getFullYear()-5;for(f=0;f<10;f++)e+="<option value='"+(b+f)+"'>"+(b+f)+"</option>";e+="</select> ";return"<div style='height:30px;padding-top:0px;font-size:inherit;' class='dhx_section_time'>"+e+"<span style='font-weight:normal; font-size:10pt;'> &nbsp;&ndash;&nbsp; </span>"+e+"</div>"},set_value:function(a,
b,c){function d(a,b,c){a[b+0].value=Math.round((c.getHours()*60+c.getMinutes())/scheduler.config.time_step)*scheduler.config.time_step;a[b+1].value=c.getDate();a[b+2].value=c.getMonth();a[b+3].value=c.getFullYear()}var e=a.getElementsByTagName("select");if(scheduler.config.full_day){if(!a._full_day){var f="<label class='dhx_fullday'><input type='checkbox' name='full_day' value='true'> "+scheduler.locale.labels.full_day+"&nbsp;</label></input>";scheduler.config.wide_form||(f=a.previousSibling.innerHTML+
f);a.previousSibling.innerHTML=f;a._full_day=!0}var g=a.previousSibling.getElementsByTagName("input")[0],h=scheduler.date.time_part(c.start_date)===0&&scheduler.date.time_part(c.end_date)===0&&c.end_date.valueOf()-c.start_date.valueOf()<1728E5;g.checked=h;for(var i in e)e[i].disabled=g.checked;g.onclick=function(){if(g.checked){var a=new Date(c.start_date),b=new Date(c.end_date);scheduler.date.date_part(a);b=scheduler.date.add(a,1,"day")}for(var f in e)e[f].disabled=g.checked;d(e,0,a||c.start_date);
d(e,4,b||c.end_date)}}if(scheduler.config.auto_end_date&&scheduler.config.event_duration)for(var k=function(){c.start_date=new Date(e[3].value,e[2].value,e[1].value,0,e[0].value);c.end_date.setTime(c.start_date.getTime()+scheduler.config.event_duration*6E4);d(e,4,c.end_date)},j=0;j<4;j++)e[j].onchange=k;d(e,0,c.start_date);d(e,4,c.end_date)},get_value:function(a,b){s=a.getElementsByTagName("select");b.start_date=new Date(s[3].value,s[2].value,s[1].value,0,s[0].value);b.end_date=new Date(s[7].value,
s[6].value,s[5].value,0,s[4].value);if(b.end_date<=b.start_date)b.end_date=scheduler.date.add(b.start_date,scheduler.config.time_step,"minute")},focus:function(a){a.getElementsByTagName("select")[0].focus()}}};
focus:function(a){var b=a.firstChild;b.select();b.focus()}},select:{render:function(a){for(var b=(a.height||"23")+"px",c="<div class='dhx_cal_ltext' style='height:"+b+";'><select style='width:100%;'>",d=0;d<a.options.length;d++)c+="<option value='"+a.options[d].key+"'>"+a.options[d].label+"</option>";c+="</select></div>";return c},set_value:function(a,b,c,d){var e=a.firstChild;if(!e._dhx_onchange&&d.onchange)e.onchange=d.onchange,e._dhx_onchange=!0;if(typeof b=="undefined")b=(e.options[0]||{}).value;
e.value=b||""},get_value:function(a){return a.firstChild.value},focus:function(a){var b=a.firstChild;b.select&&b.select();b.focus()}},time:{render:function(a){var b=scheduler.config,c=this.date.date_part(new Date),d=1440,e=0;scheduler.config.limit_time_select&&(d=60*b.last_hour+1,e=60*b.first_hour,c.setHours(b.first_hour));var f="<select>",g=e,h=c.getDate();for(a._time_values=[];g<d;){var k=this.templates.time_picker(c);f+="<option value='"+g+"'>"+k+"</option>";a._time_values.push(g);c.setTime(c.valueOf()+
this.config.time_step*6E4);var i=c.getDate()!=h?1:0,g=i*1440+c.getHours()*60+c.getMinutes()}f+="</select> <select>";for(g=1;g<32;g++)f+="<option value='"+g+"'>"+g+"</option>";f+="</select> <select>";for(g=0;g<12;g++)f+="<option value='"+g+"'>"+this.locale.date.month_full[g]+"</option>";f+="</select> <select>";c=c.getFullYear()-5;for(g=0;g<10;g++)f+="<option value='"+(c+g)+"'>"+(c+g)+"</option>";f+="</select> ";return"<div style='height:30px;padding-top:0px;font-size:inherit;' class='dhx_section_time'>"+
f+"<span style='font-weight:normal; font-size:10pt;'> &nbsp;&ndash;&nbsp; </span>"+f+"</div>"},set_value:function(a,b,c,d){function e(a,b,c){for(var e=d._time_values,f=c.getHours()*60+c.getMinutes(),g=f,h=!1,i=0;i<e.length;i++){var j=e[i];if(j===f){h=!0;break}j<f&&(g=j)}a[b+0].value=h?f:g;a[b+1].value=c.getDate();a[b+2].value=c.getMonth();a[b+3].value=c.getFullYear()}var f=scheduler.config,g=a.getElementsByTagName("select");if(f.full_day){if(!a._full_day){var h="<label class='dhx_fullday'><input type='checkbox' name='full_day' value='true'> "+
scheduler.locale.labels.full_day+"&nbsp;</label></input>";scheduler.config.wide_form||(h=a.previousSibling.innerHTML+h);a.previousSibling.innerHTML=h;a._full_day=!0}var k=a.previousSibling.getElementsByTagName("input")[0];k.checked=scheduler.date.time_part(c.start_date)===0&&scheduler.date.time_part(c.end_date)===0;g[0].disabled=k.checked;g[g.length/2].disabled=k.checked;k.onclick=function(){if(k.checked){var b={};scheduler.form_blocks.time.get_value(a,b);var d=scheduler.date.date_part(b.start_date),
f=scheduler.date.date_part(b.end_date);if(+f==+d||+f>=+d&&(c.end_date.getHours()!=0||c.end_date.getMinutes()!=0))f=scheduler.date.add(f,1,"day")}g[0].disabled=k.checked;g[g.length/2].disabled=k.checked;e(g,0,d||c.start_date);e(g,4,f||c.end_date)}}if(f.auto_end_date&&f.event_duration)for(var i=function(){var a=new Date(g[3].value,g[2].value,g[1].value,0,g[0].value),b=new Date(a.getTime()+scheduler.config.event_duration*6E4);e(g,4,b)},j=0;j<4;j++)g[j].onchange=i;e(g,0,c.start_date);e(g,4,c.end_date)},
get_value:function(a,b){s=a.getElementsByTagName("select");b.start_date=new Date(s[3].value,s[2].value,s[1].value,0,s[0].value);b.end_date=new Date(s[7].value,s[6].value,s[5].value,0,s[4].value);if(b.end_date<=b.start_date)b.end_date=scheduler.date.add(b.start_date,scheduler.config.time_step,"minute");return{start_date:new Date(b.start_date),end_date:new Date(b.end_date)}},focus:function(a){a.getElementsByTagName("select")[0].focus()}}};
scheduler.showCover=function(a){if(a){a.style.display="block";var b=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop,c=window.pageXOffset||document.body.scrollLeft||document.documentElement.scrollLeft,d=window.innerHeight||document.documentElement.clientHeight;a.style.top=b?Math.round(b+Math.max((d-a.offsetHeight)/2,0))+"px":Math.round(Math.max((d-a.offsetHeight)/2,0)+9)+"px";a.style.left=document.documentElement.scrollWidth>document.body.offsetWidth?Math.round(c+(document.body.offsetWidth-
a.offsetWidth)/2)+"px":Math.round((document.body.offsetWidth-a.offsetWidth)/2)+"px"}this.show_cover()};scheduler.showLightbox=function(a){if(a&&this.callEvent("onBeforeLightbox",[a])){var b=this._get_lightbox();this.showCover(b);this._fill_lightbox(a,b);this.callEvent("onLightbox",[a])}};
scheduler._fill_lightbox=function(a,b){var c=this.getEvent(a),d=b.getElementsByTagName("span");scheduler.templates.lightbox_header?(d[1].innerHTML="",d[2].innerHTML=scheduler.templates.lightbox_header(c.start_date,c.end_date,c)):(d[1].innerHTML=this.templates.event_header(c.start_date,c.end_date,c),d[2].innerHTML=(this.templates.event_bar_text(c.start_date,c.end_date,c)||"").substr(0,70));for(var e=this.config.lightbox.sections,f=0;f<e.length;f++){var g=document.getElementById(e[f].id).nextSibling,
h=this.form_blocks[e[f].type];h.set_value.call(this,g,c[e[f].map_to],c,e[f]);e[f].focus&&h.focus.call(this,g)}scheduler._lightbox_id=a};scheduler._lightbox_out=function(a){for(var b=this.config.lightbox.sections,c=0;c<b.length;c++){var d=document.getElementById(b[c].id),d=d?d.nextSibling:d,e=this.form_blocks[b[c].type],f=e.get_value.call(this,d,a,b[c]);b[c].map_to!="auto"&&(a[b[c].map_to]=f)}return a};
scheduler._empty_lightbox=function(){var a=scheduler._lightbox_id,b=this.getEvent(a),c=this._get_lightbox();this._lightbox_out(b);b._timed=this.is_one_day_event(b);this.setEvent(b.id,b);this._edit_stop_event(b,!0);this.render_view_data()};scheduler.hide_lightbox=function(){this.hideCover(this._get_lightbox());this._lightbox_id=null;this.callEvent("onAfterLightbox",[])};scheduler.hideCover=function(a){if(a)a.style.display="none";this.hide_cover()};
a.offsetWidth)/2)+"px":Math.round((document.body.offsetWidth-a.offsetWidth)/2)+"px"}this.show_cover()};scheduler.showLightbox=function(a){if(a)if(this.callEvent("onBeforeLightbox",[a])){var b=this.getLightbox();this.showCover(b);this._fill_lightbox(a,b);this.callEvent("onLightbox",[a])}else if(this._new_event)this._new_event=null};
scheduler._fill_lightbox=function(a,b){var c=this.getEvent(a),d=b.getElementsByTagName("span");scheduler.templates.lightbox_header?(d[1].innerHTML="",d[2].innerHTML=scheduler.templates.lightbox_header(c.start_date,c.end_date,c)):(d[1].innerHTML=this.templates.event_header(c.start_date,c.end_date,c),d[2].innerHTML=(this.templates.event_bar_text(c.start_date,c.end_date,c)||"").substr(0,70));for(var e=this.config.lightbox.sections,f=0;f<e.length;f++){var g=e[f],h=document.getElementById(g.id).nextSibling,
k=this.form_blocks[g.type],i=c[g.map_to]!==void 0?c[g.map_to]:g.default_value;k.set_value.call(this,h,i,c,g);e[f].focus&&k.focus.call(this,h)}scheduler._lightbox_id=a};scheduler._lightbox_out=function(a){for(var b=this.config.lightbox.sections,c=0;c<b.length;c++){var d=document.getElementById(b[c].id),d=d?d.nextSibling:d,e=this.form_blocks[b[c].type],f=e.get_value.call(this,d,a,b[c]);b[c].map_to!="auto"&&(a[b[c].map_to]=f)}return a};
scheduler._empty_lightbox=function(a){var b=scheduler._lightbox_id,c=this.getEvent(b),d=this.getLightbox();this._lame_copy(c,a);c._timed=this.is_one_day_event(c);this.setEvent(c.id,c);this._edit_stop_event(c,!0);this.render_view_data()};scheduler.hide_lightbox=function(){this.hideCover(this.getLightbox());this._lightbox_id=null;this.callEvent("onAfterLightbox",[])};scheduler.hideCover=function(a){if(a)a.style.display="none";this.hide_cover()};
scheduler.hide_cover=function(){this._cover&&this._cover.parentNode.removeChild(this._cover);this._cover=null};scheduler.show_cover=function(){this._cover=document.createElement("DIV");this._cover.className="dhx_cal_cover";var a=document.height!==void 0?document.height:document.body.offsetHeight,b=document.documentElement?document.documentElement.scrollHeight:0;this._cover.style.height=Math.max(a,b)+"px";document.body.appendChild(this._cover)};
scheduler.save_lightbox=function(){if(!this.checkEvent("onEventSave")||this.callEvent("onEventSave",[this._lightbox_id,this._lightbox_out({id:this._lightbox_id}),this._new_event]))this._empty_lightbox(),this.hide_lightbox()};scheduler.startLightbox=function(a,b){this._lightbox_id=a;this.showCover(b)};scheduler.endLightbox=function(a,b){this._edit_stop_event(scheduler.getEvent(this._lightbox_id),a);a&&scheduler.render_view_data();this.hideCover(b)};
scheduler.resetLightbox=function(){scheduler._lightbox&&scheduler._lightbox.parentNode.removeChild(scheduler._lightbox);scheduler._lightbox=null};scheduler.cancel_lightbox=function(){this.callEvent("onEventCancel",[this._lightbox_id,this._new_event]);this.endLightbox(!1);this.hide_lightbox()};
scheduler._init_lightbox_events=function(){this._get_lightbox().onclick=function(a){var b=a?a.target:event.srcElement;if(!b.className)b=b.previousSibling;if(b&&b.className)switch(b.className){case "dhx_save_btn":scheduler.save_lightbox();break;case "dhx_delete_btn":var c=scheduler.locale.labels.confirm_deleting;if(!c||confirm(c))scheduler.deleteEvent(scheduler._lightbox_id),scheduler._new_event=null,scheduler.hide_lightbox();break;case "dhx_cancel_btn":scheduler.cancel_lightbox();break;default:if(b.getAttribute("dhx_button"))scheduler.callEvent("onLightboxButton",
[b.className,b,a]);else if(b.className.indexOf("dhx_custom_button_")!=-1){var d=b.parentNode.getAttribute("index"),e=scheduler.form_blocks[scheduler.config.lightbox.sections[d].type],f=b.parentNode.parentNode;e.button_click(d,b,f,f.nextSibling)}}};this._get_lightbox().onkeydown=function(a){switch((a||event).keyCode){case scheduler.keys.edit_save:if((a||event).shiftKey)break;scheduler.save_lightbox();break;case scheduler.keys.edit_cancel:scheduler.cancel_lightbox()}}};
scheduler.setLightboxSize=function(){var a=this._lightbox;if(a){var b=a.childNodes[1];b.style.height="0px";b.style.height=b.scrollHeight+"px";a.style.height=b.scrollHeight+50+"px";b.style.height=b.scrollHeight+"px"}};scheduler._init_dnd_events=function(){dhtmlxEvent(document.body,"mousemove",scheduler._move_while_dnd);dhtmlxEvent(document.body,"mouseup",scheduler._finish_dnd);scheduler._init_dnd_events=function(){}};
scheduler._move_while_dnd=function(a){if(scheduler._dnd_start_lb){if(!document.dhx_unselectable)document.body.className+=" dhx_unselectable",document.dhx_unselectable=!0;var b=scheduler._get_lightbox(),c=a&&a.target?[a.pageX,a.pageY]:[event.clientX,event.clientY];b.style.top=scheduler._lb_start[1]+c[1]-scheduler._dnd_start_lb[1]+"px";b.style.left=scheduler._lb_start[0]+c[0]-scheduler._dnd_start_lb[0]+"px"}};
scheduler._ready_to_dnd=function(a){var b=scheduler._get_lightbox();scheduler._lb_start=[parseInt(b.style.left,10),parseInt(b.style.top,10)];scheduler._dnd_start_lb=a&&a.target?[a.pageX,a.pageY]:[event.clientX,event.clientY]};scheduler._finish_dnd=function(){if(scheduler._lb_start)scheduler._lb_start=scheduler._dnd_start_lb=!1,document.body.className=document.body.className.replace(" dhx_unselectable",""),document.dhx_unselectable=!1};
scheduler._get_lightbox=function(){if(!this._lightbox){var a=document.createElement("DIV");a.className="dhx_cal_light";scheduler.config.wide_form&&(a.className+=" dhx_cal_light_wide");scheduler.form_blocks.recurring&&(a.className+=" dhx_cal_light_rec");/msie|MSIE 6/.test(navigator.userAgent)&&(a.className+=" dhx_ie6");a.style.visibility="hidden";var b=this._lightbox_template,c=this.config.buttons_left;scheduler.locale.labels.dhx_save_btn=scheduler.locale.labels.icon_save;scheduler.locale.labels.dhx_cancel_btn=
scheduler.locale.labels.icon_cancel;scheduler.locale.labels.dhx_delete_btn=scheduler.locale.labels.icon_delete;for(var d=0;d<c.length;d++)b+="<div class='dhx_btn_set'><div dhx_button='1' class='"+c[d]+"'></div><div>"+scheduler.locale.labels[c[d]]+"</div></div>";c=this.config.buttons_right;for(d=0;d<c.length;d++)b+="<div class='dhx_btn_set' style='float:right;'><div dhx_button='1' class='"+c[d]+"'></div><div>"+scheduler.locale.labels[c[d]]+"</div></div>";b+="</div>";a.innerHTML=b;if(scheduler.config.drag_lightbox)a.firstChild.onmousedown=
scheduler._ready_to_dnd,a.firstChild.onselectstart=function(){return!1},a.firstChild.style.cursor="pointer",scheduler._init_dnd_events();document.body.insertBefore(a,document.body.firstChild);this._lightbox=a;for(var e=this.config.lightbox.sections,b="",d=0;d<e.length;d++){var f=this.form_blocks[e[d].type];if(f){e[d].id="area_"+this.uid();var g="";e[d].button&&(g="<div class='dhx_custom_button' index='"+d+"'><div class='dhx_custom_button_"+e[d].button+"'></div><div>"+this.locale.labels["button_"+
e[d].button]+"</div></div>");this.config.wide_form&&(b+="<div class='dhx_wrap_section'>");b+="<div id='"+e[d].id+"' class='dhx_cal_lsection'>"+g+this.locale.labels["section_"+e[d].name]+"</div>"+f.render.call(this,e[d]);b+="</div>"}}var h=a.getElementsByTagName("div");h[1].innerHTML=b;this.setLightboxSize();this._init_lightbox_events(this);a.style.display="none";a.style.visibility="visible"}return this._lightbox};scheduler._lightbox_template="<div class='dhx_cal_ltitle'><span class='dhx_mark'>&nbsp;</span><span class='dhx_time'></span><span class='dhx_title'></span></div><div class='dhx_cal_larea'></div>";
scheduler.save_lightbox=function(){var a=this._lightbox_out({},this._lame_copy(this.getEvent(this._lightbox_id)));if(!this.checkEvent("onEventSave")||this.callEvent("onEventSave",[this._lightbox_id,a,this._new_event]))this._empty_lightbox(a),this.hide_lightbox()};scheduler.startLightbox=function(a,b){this._lightbox_id=a;this._lightbox=b;this.showCover(b)};
scheduler.endLightbox=function(a,b){this._edit_stop_event(scheduler.getEvent(this._lightbox_id),a);a&&scheduler.render_view_data();this.hideCover(b);this._lightbox_id=null};scheduler.resetLightbox=function(){scheduler._lightbox&&scheduler._lightbox.parentNode.removeChild(scheduler._lightbox);scheduler._lightbox=null};scheduler.cancel_lightbox=function(){this.callEvent("onEventCancel",[this._lightbox_id,this._new_event]);this.endLightbox(!1);this.hide_lightbox()};
scheduler._init_lightbox_events=function(){this.getLightbox().onclick=function(a){var b=a?a.target:event.srcElement;if(!b.className)b=b.previousSibling;if(b&&b.className)switch(b.className){case "dhx_save_btn":scheduler.save_lightbox();break;case "dhx_delete_btn":var c=scheduler.locale.labels.confirm_deleting;scheduler._dhtmlx_confirm(c,scheduler.locale.labels.title_confirm_deleting,function(){scheduler.deleteEvent(scheduler._lightbox_id);scheduler._new_event=null;scheduler.hide_lightbox()});break;
case "dhx_cancel_btn":scheduler.cancel_lightbox();break;default:if(b.getAttribute("dhx_button"))scheduler.callEvent("onLightboxButton",[b.className,b,a]);else{var d,e,f;if(b.className.indexOf("dhx_custom_button")!=-1)b.className.indexOf("dhx_custom_button_")!=-1?(d=b.parentNode.getAttribute("index"),f=b.parentNode.parentNode):(d=b.getAttribute("index"),f=b.parentNode,b=b.firstChild);d&&(e=scheduler.form_blocks[scheduler.config.lightbox.sections[d].type],e.button_click(d,b,f,f.nextSibling))}}};this.getLightbox().onkeydown=
function(a){switch((a||event).keyCode){case scheduler.keys.edit_save:if((a||event).shiftKey)break;scheduler.save_lightbox();break;case scheduler.keys.edit_cancel:scheduler.cancel_lightbox()}}};scheduler.setLightboxSize=function(){var a=this._lightbox;if(a){var b=a.childNodes[1];b.style.height="0px";b.style.height=b.scrollHeight+"px";a.style.height=b.scrollHeight+scheduler.xy.lightbox_additional_height+"px";b.style.height=b.scrollHeight+"px"}};
scheduler._init_dnd_events=function(){dhtmlxEvent(document.body,"mousemove",scheduler._move_while_dnd);dhtmlxEvent(document.body,"mouseup",scheduler._finish_dnd);scheduler._init_dnd_events=function(){}};
scheduler._move_while_dnd=function(a){if(scheduler._dnd_start_lb){if(!document.dhx_unselectable)document.body.className+=" dhx_unselectable",document.dhx_unselectable=!0;var b=scheduler.getLightbox(),c=a&&a.target?[a.pageX,a.pageY]:[event.clientX,event.clientY];b.style.top=scheduler._lb_start[1]+c[1]-scheduler._dnd_start_lb[1]+"px";b.style.left=scheduler._lb_start[0]+c[0]-scheduler._dnd_start_lb[0]+"px"}};
scheduler._ready_to_dnd=function(a){var b=scheduler.getLightbox();scheduler._lb_start=[parseInt(b.style.left,10),parseInt(b.style.top,10)];scheduler._dnd_start_lb=a&&a.target?[a.pageX,a.pageY]:[event.clientX,event.clientY]};scheduler._finish_dnd=function(){if(scheduler._lb_start)scheduler._lb_start=scheduler._dnd_start_lb=!1,document.body.className=document.body.className.replace(" dhx_unselectable",""),document.dhx_unselectable=!1};
scheduler.getLightbox=function(){if(!this._lightbox){var a=document.createElement("DIV");a.className="dhx_cal_light";scheduler.config.wide_form&&(a.className+=" dhx_cal_light_wide");scheduler.form_blocks.recurring&&(a.className+=" dhx_cal_light_rec");/msie|MSIE 6/.test(navigator.userAgent)&&(a.className+=" dhx_ie6");a.style.visibility="hidden";for(var b=this._lightbox_template,c=this.config.buttons_left,d=0;d<c.length;d++)b+="<div class='dhx_btn_set dhx_left_btn_set "+c[d]+"_set'><div dhx_button='1' class='"+
c[d]+"'></div><div>"+scheduler.locale.labels[c[d]]+"</div></div>";c=this.config.buttons_right;for(d=0;d<c.length;d++)b+="<div class='dhx_btn_set dhx_right_btn_set "+c[d]+"_set' style='float:right;'><div dhx_button='1' class='"+c[d]+"'></div><div>"+scheduler.locale.labels[c[d]]+"</div></div>";b+="</div>";a.innerHTML=b;if(scheduler.config.drag_lightbox)a.firstChild.onmousedown=scheduler._ready_to_dnd,a.firstChild.onselectstart=function(){return!1},a.firstChild.style.cursor="pointer",scheduler._init_dnd_events();
document.body.insertBefore(a,document.body.firstChild);this._lightbox=a;for(var e=this.config.lightbox.sections,b="",d=0;d<e.length;d++){var f=this.form_blocks[e[d].type];if(f){e[d].id="area_"+this.uid();var g="";e[d].button&&(g="<div class='dhx_custom_button' index='"+d+"'><div class='dhx_custom_button_"+e[d].button+"'></div><div>"+this.locale.labels["button_"+e[d].button]+"</div></div>");this.config.wide_form&&(b+="<div class='dhx_wrap_section'>");b+="<div id='"+e[d].id+"' class='dhx_cal_lsection'>"+
g+this.locale.labels["section_"+e[d].name]+"</div>"+f.render.call(this,e[d]);b+="</div>"}}for(var h=a.getElementsByTagName("div"),d=0;d<h.length;d++){var k=h[d];if(k.className=="dhx_cal_larea"){k.innerHTML=b;break}}this.setLightboxSize();this._init_lightbox_events(this);a.style.display="none";a.style.visibility="visible"}return this._lightbox};scheduler._lightbox_template="<div class='dhx_cal_ltitle'><span class='dhx_mark'>&nbsp;</span><span class='dhx_time'></span><span class='dhx_title'></span></div><div class='dhx_cal_larea'></div>";
scheduler._dp_init=function(a){a._methods=["setEventTextStyle","","changeEventId","deleteEvent"];this.attachEvent("onEventAdded",function(b){!this._loading&&this.validId(b)&&a.setUpdated(b,!0,"inserted")});this.attachEvent("onConfirmedBeforeEventDelete",function(b){if(this.validId(b)){var c=a.getState(b);if(c=="inserted"||this._new_event)return a.setUpdated(b,!1),!0;if(c=="deleted")return!1;if(c=="true_deleted")return!0;a.setUpdated(b,!0,"deleted");return!1}});this.attachEvent("onEventChanged",function(b){!this._loading&&
this.validId(b)&&a.setUpdated(b,!0,"updated")});a._getRowData=function(a){var c=this.obj.getEvent(a),d={},e;for(e in c)e.indexOf("_")!=0&&(d[e]=c[e]&&c[e].getUTCFullYear?this.obj.templates.xml_format(c[e]):c[e]);return d};a._clearUpdateFlag=function(){};a.attachEvent("insertCallback",scheduler._update_callback);a.attachEvent("updateCallback",scheduler._update_callback);a.attachEvent("deleteCallback",function(a,c){this.obj.setUserData(c,this.action_param,"true_deleted");this.obj.deleteEvent(c)})};
scheduler.setUserData=function(a,b,c){a?this.getEvent(a)[b]=c:this._userdata[b]=c};scheduler.getUserData=function(a,b){return a?this.getEvent(a)[b]:this._userdata[b]};scheduler.setEventTextStyle=function(a,b){this.for_rendered(a,function(a){a.style.cssText+=";"+b});var c=this.getEvent(a);c._text_style=b;this.event_updated(c)};scheduler.validId=function(){return!0};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,7 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
scheduler.config.active_link_view="day";
scheduler.attachEvent("onTemplatesReady",function(){var d=scheduler.date.str_to_date(scheduler.config.api_date),b=scheduler.date.date_to_str(scheduler.config.api_date),e=scheduler.templates.month_day;scheduler.templates.month_day=function(a){return"<a jump_to='"+b(a)+"' href='#'>"+e(a)+"</a>"};var f=scheduler.templates.week_scale_date;scheduler.templates.week_scale_date=function(a){return"<a jump_to='"+b(a)+"' href='#'>"+f(a)+"</a>"};dhtmlxEvent(this._obj,"click",function(a){var b=a.target||event.srcElement,
c=b.getAttribute("jump_to");if(c)return scheduler.setCurrentView(d(c),"day"),a&&a.preventDefault&&a.preventDefault(),!1})});
c=b.getAttribute("jump_to");if(c)return scheduler.setCurrentView(d(c),scheduler.config.active_link_view),a&&a.preventDefault&&a.preventDefault(),!1})});

View File

@ -1,10 +1,11 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
scheduler.date.add_agenda=function(b){return new Date(b.valueOf())};scheduler.dblclick_dhx_agenda_area=function(){!this.config.readonly&&this.config.dblclick_create&&this.addEventNow()};scheduler.templates.agenda_time=function(b,d,a){return a._timed?this.day_date(a.start_date,a.end_date,a)+" "+this.event_date(b):scheduler.templates.day_date(b)+" &ndash; "+scheduler.templates.day_date(d)};scheduler.templates.agenda_text=function(b,d,a){return a.text};scheduler.date.agenda_start=function(b){return b};
scheduler.attachEvent("onTemplatesReady",function(){function b(b){if(b){var a=scheduler.locale.labels;scheduler._els.dhx_cal_header[0].innerHTML="<div class='dhx_agenda_line'><div>"+a.date+"</div><span style='padding-left:25px'>"+a.description+"</span></div>";scheduler._table_view=!0;scheduler.set_sizes()}}function d(){var b=scheduler._date,a=scheduler.get_visible_events();a.sort(function(a,b){return a.start_date>b.start_date?1:-1});for(var d="<div class='dhx_agenda_area'>",e=0;e<a.length;e++){var c=
a[e],f=c.color?"background-color:"+c.color+";":"",h=c.textColor?"color:"+c.textColor+";":"";d+="<div class='dhx_agenda_line' event_id='"+c.id+"' style='"+h+""+f+""+(c._text_style||"")+"'><div>"+scheduler.templates.agenda_time(c.start_date,c.end_date,c)+"</div>";d+="<div class='dhx_event_icon icon_details'>&nbsp</div>";d+="<span>"+scheduler.templates.agenda_text(c.start_date,c.end_date,c)+"</span></div>"}d+="<div class='dhx_v_border'></div></div>";scheduler._els.dhx_cal_data[0].innerHTML=d;scheduler._els.dhx_cal_data[0].childNodes[0].scrollTop=
scheduler._agendaScrollTop||0;var g=scheduler._els.dhx_cal_data[0].firstChild.childNodes;scheduler._els.dhx_cal_date[0].innerHTML="";scheduler._rendered=[];for(e=0;e<g.length-1;e++)scheduler._rendered[e]=g[e]}scheduler.attachEvent("onSchedulerResize",function(){return this._mode=="agenda"?(this.agenda_view(!0),!1):!0});var a=scheduler.render_data;scheduler.render_data=function(b){if(this._mode=="agenda")d();else return a.apply(this,arguments)};var f=scheduler.render_view_data;scheduler.render_view_data=
function(){this._mode=="agenda"?(scheduler._agendaScrollTop=scheduler._els.dhx_cal_data[0].childNodes[0].scrollTop,scheduler._els.dhx_cal_data[0].childNodes[0].scrollTop=0,scheduler._els.dhx_cal_data[0].style.overflowY="hidden"):scheduler._els.dhx_cal_data[0].style.overflowY="auto";return f.apply(this,arguments)};scheduler.agenda_view=function(a){scheduler._min_date=scheduler.config.agenda_start||new Date;scheduler._max_date=scheduler.config.agenda_end||new Date(9999,1,1);scheduler._table_view=!0;
b(a);a&&d()}});
scheduler.date.add_agenda=function(a){return scheduler.date.add(a,1,"year")};scheduler.templates.agenda_time=function(a,d,c){return c._timed?this.day_date(c.start_date,c.end_date,c)+" "+this.event_date(a):scheduler.templates.day_date(a)+" &ndash; "+scheduler.templates.day_date(d)};scheduler.templates.agenda_text=function(a,d,c){return c.text};scheduler.templates.agenda_date=function(){return""};scheduler.date.agenda_start=function(){return scheduler.date.date_part(new Date)};
scheduler.attachEvent("onTemplatesReady",function(){function a(c){if(c){var a=scheduler.locale.labels;scheduler._els.dhx_cal_header[0].innerHTML="<div class='dhx_agenda_line'><div>"+a.date+"</div><span style='padding-left:25px'>"+a.description+"</span></div>";scheduler._table_view=!0;scheduler.set_sizes()}}function d(){var c=scheduler._date,a=scheduler.get_visible_events();a.sort(function(b,a){return b.start_date>a.start_date?1:-1});for(var d="<div class='dhx_agenda_area'>",e=0;e<a.length;e++){var b=
a[e],g=b.color?"background:"+b.color+";":"",h=b.textColor?"color:"+b.textColor+";":"",i=scheduler.templates.event_class(b.start_date,b.end_date,b);d+="<div class='dhx_agenda_line"+(i?" "+i:"")+"' event_id='"+b.id+"' style='"+h+""+g+""+(b._text_style||"")+"'><div class='dhx_agenda_event_time'>"+scheduler.templates.agenda_time(b.start_date,b.end_date,b)+"</div>";d+="<div class='dhx_event_icon icon_details'>&nbsp</div>";d+="<span>"+scheduler.templates.agenda_text(b.start_date,b.end_date,b)+"</span></div>"}d+=
"<div class='dhx_v_border'></div></div>";scheduler._els.dhx_cal_data[0].innerHTML=d;scheduler._els.dhx_cal_data[0].childNodes[0].scrollTop=scheduler._agendaScrollTop||0;var f=scheduler._els.dhx_cal_data[0].childNodes[0],k=f.childNodes[f.childNodes.length-1];k.style.height=f.offsetHeight<scheduler._els.dhx_cal_data[0].offsetHeight?"100%":f.offsetHeight+"px";var j=scheduler._els.dhx_cal_data[0].firstChild.childNodes;scheduler._els.dhx_cal_date[0].innerHTML=scheduler.templates.agenda_date(scheduler._min_date,
scheduler._max_date,scheduler._mode);scheduler._rendered=[];for(e=0;e<j.length-1;e++)scheduler._rendered[e]=j[e]}var c=scheduler.dblclick_dhx_cal_data;scheduler.dblclick_dhx_cal_data=function(){if(this._mode=="agenda")!this.config.readonly&&this.config.dblclick_create&&this.addEventNow();else if(c)return c.apply(this,arguments)};scheduler.attachEvent("onSchedulerResize",function(){return this._mode=="agenda"?(this.agenda_view(!0),!1):!0});var g=scheduler.render_data;scheduler.render_data=function(a){if(this._mode==
"agenda")d();else return g.apply(this,arguments)};var h=scheduler.render_view_data;scheduler.render_view_data=function(){if(this._mode=="agenda")scheduler._agendaScrollTop=scheduler._els.dhx_cal_data[0].childNodes[0].scrollTop,scheduler._els.dhx_cal_data[0].childNodes[0].scrollTop=0;return h.apply(this,arguments)};scheduler.agenda_view=function(c){scheduler._min_date=scheduler.config.agenda_start||scheduler.date.agenda_start(scheduler._date);scheduler._max_date=scheduler.config.agenda_end||scheduler.date.add_agenda(scheduler._min_date,
1);scheduler._table_view=!0;a(c);c&&d()}});

View File

@ -0,0 +1,9 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
(function(){scheduler.config.all_timed="short";scheduler.config.update_render=!0;var i=function(a){return!((a.end_date-a.start_date)/36E5>=24)},j=scheduler._pre_render_events_line;scheduler._pre_render_events_line=function(a,f){if(!this.config.all_timed)return j.call(this,a,f);for(var c=0;c<a.length;c++){var d=a[c];if(!d._timed)if(this.config.all_timed=="short"&&!i(d))a.splice(c--,1);else{var b=this._lame_copy({},d);b.start_date=new Date(b.start_date);var h=scheduler.date.add(d.start_date,1,"day"),
h=scheduler.date.date_part(h);if(d.end_date<h)b.end_date=new Date(d.end_date);else if(b.end_date=h,this.config.last_hour!=24)b.end_date=scheduler.date.date_part(new Date(b.start_date)),b.end_date.setHours(this.config.last_hour);var g=!1;b.start_date<this._max_date&&b.end_date>this._min_date&&b.start_date<b.end_date&&(a[c]=b,g=!0);b.start_date>b.end_date&&a.splice(c--,1);var e=this._lame_copy({},d);e.end_date=new Date(e.end_date);e.start_date=e.start_date<this._min_date?new Date(this._min_date):this.date.add(d.start_date,
1,"day");e.start_date.setHours(this.config.first_hour);e.start_date.setMinutes(0);e.start_date<this._max_date&&e.start_date<e.end_date&&(g?a.splice(c+1,0,e):a[c--]=e)}}var k=this._drag_mode=="move"?!1:f;return j.call(this,a,k)};var g=scheduler.get_visible_events;scheduler.get_visible_events=function(a){return!this.config.all_timed?g.call(this,a):g.call(this,!1)};scheduler.attachEvent("onBeforeViewChange",function(a,f,c){scheduler._allow_dnd=c=="day"||c=="week";return!0});scheduler.render_view_data=
function(a,f){if(!a){if(this._not_render){this._render_wait=!0;return}this._render_wait=!1;this.clear_view();a=this.get_visible_events(!(this._table_view||this.config.multi_day))}if(this.config.multi_day&&!this._table_view){for(var c=[],d=[],b=0;b<a.length;b++)a[b]._timed||this.config.all_timed===!0||this.config.all_timed=="short"&&i(a[b])?c.push(a[b]):d.push(a[b]);this._rendered_location=this._els.dhx_cal_data[0];this._table_view=!1;this.render_data(c,f);this._rendered_location=this._els.dhx_multi_day[0];
this._table_view=!0;this.render_data(d,f);this._table_view=!1}else this._rendered_location=this._els.dhx_cal_data[0],this.render_data(a,f)}})();

View File

@ -1,8 +1,8 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
(function(){function h(a){var b=scheduler._props?scheduler._props[scheduler._mode]:null,f=scheduler.matrix?scheduler.matrix[scheduler._mode]:null,c=b||f;if(b)var d=c.map_to;if(f)d=c.y_property;c&&a&&(n=scheduler.getEvent(a)[d])}function g(a){var b=[];if(a.rec_type){for(var f=scheduler.getRecDates(a),c=0;c<f.length;c++)for(var d=scheduler.getEvents(f[c].start_date,f[c].end_date),i=0;i<d.length;i++)(d[i].event_pid||d[i].id)!=a.id&&b.push(d[i]);b.push(a)}else b=scheduler.getEvents(a.start_date,a.end_date);
var e=scheduler._props?scheduler._props[scheduler._mode]:null,g=scheduler.matrix?scheduler.matrix[scheduler._mode]:null,m=e||g;if(e)var j=m.map_to;if(g)j=m.y_property;var k=!0;if(m){for(var h=0,l=0;l<b.length;l++)b[l][j]==a[j]&&b[l].id!=a.id&&h++;h>=scheduler.config.collision_limit&&(a[j]=n,k=!1)}else b.length>scheduler.config.collision_limit&&(k=!1);return!k?!scheduler.callEvent("onEventCollision",[a,b]):k}var n,e;scheduler.config.collision_limit=1;scheduler.attachEvent("onBeforeDrag",function(a){h(a);
return!0});scheduler.attachEvent("onBeforeLightbox",function(a){var b=scheduler.getEvent(a);e=[b.start_date,b.end_date];h(a);return!0});scheduler.attachEvent("onEventChanged",function(a){if(!a)return!0;var b=scheduler.getEvent(a);if(!g(b)){if(!e)return!1;b.start_date=e[0];b.end_date=e[1];b._timed=this.is_one_day_event(b)}return!0});scheduler.attachEvent("onBeforeEventChanged",function(a){return g(a)});scheduler.attachEvent("onEventSave",function(a,b){return b.rec_type?(scheduler._roll_back_dates(b),
g(b)):!0})})();
(function(){function h(b){var a=scheduler._props?scheduler._props[scheduler._mode]:null,i=scheduler.matrix?scheduler.matrix[scheduler._mode]:null,e=a||i;if(a)var f=e.map_to;if(i)f=e.y_property;e&&b&&(n=scheduler.getEvent(b)[f])}function g(b){var a=[],i=scheduler.config.collision_limit;if(b.rec_type)for(var e=scheduler.getRecDates(b),f=0;f<e.length;f++)for(var d=scheduler.getEvents(e[f].start_date,e[f].end_date),j=0;j<d.length;j++)(d[j].event_pid||d[j].id)!=b.id&&a.push(d[j]);else for(var a=scheduler.getEvents(b.start_date,
b.end_date),c=0;c<a.length;c++)if(a[c].id==b.id){a.splice(c,1);break}var g=scheduler._props?scheduler._props[scheduler._mode]:null,h=scheduler.matrix?scheduler.matrix[scheduler._mode]:null,m=g||h;if(g)var k=m.map_to;if(h)k=m.y_property;var l=!0;if(m){for(var o=0,c=0;c<a.length;c++)a[c][k]==b[k]&&a[c].id!=b.id&&o++;o>=i&&(l=!1)}else a.length>=i&&(l=!1);if(!l){var p=!scheduler.callEvent("onEventCollision",[b,a]);p||(b[k]=n||b[k]);return p}return l}var n,d;scheduler.config.collision_limit=1;scheduler.attachEvent("onBeforeDrag",
function(b){h(b);return!0});scheduler.attachEvent("onBeforeLightbox",function(b){var a=scheduler.getEvent(b);d=[a.start_date,a.end_date];h(b);return!0});scheduler.attachEvent("onEventChanged",function(b){if(!b)return!0;var a=scheduler.getEvent(b);if(!g(a)){if(!d)return!1;a.start_date=d[0];a.end_date=d[1];a._timed=this.is_one_day_event(a)}return!0});scheduler.attachEvent("onBeforeEventChanged",function(b){return g(b)});scheduler.attachEvent("onEventSave",function(b,a){a=scheduler._lame_clone(a);a.id=
b;a.rec_type&&scheduler._roll_back_dates(data_copy);return g(a)})})();

View File

@ -1,6 +1,6 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
(function(){function g(e,b,a){var c=e+"="+a+(b?"; "+b:"");document.cookie=c}function h(e){var b=e+"=";if(document.cookie.length>0){var a=document.cookie.indexOf(b);if(a!=-1){a+=b.length;var c=document.cookie.indexOf(";",a);if(c==-1)c=document.cookie.length;return document.cookie.substring(a,c)}}return""}var f=!0;scheduler.attachEvent("onBeforeViewChange",function(e,b,a,c){if(f){f=!1;var d=h("scheduler_settings");if(d)return d=d.split("@"),d[0]=this.templates.xml_date(d[0]),this.setCurrentView(d[0],
d[1]),!1}var i=this.templates.xml_format(c||b)+"@"+(a||e);g("scheduler_settings","expires=Sun, 31 Jan 9999 22:00:00 GMT",i);return!0})})();
(function(){function g(e,b,a){var c=e+"="+a+(b?"; "+b:"");document.cookie=c}function h(e){var b=e+"=";if(document.cookie.length>0){var a=document.cookie.indexOf(b);if(a!=-1){a+=b.length;var c=document.cookie.indexOf(";",a);if(c==-1)c=document.cookie.length;return document.cookie.substring(a,c)}}return""}var f=!0;scheduler.attachEvent("onBeforeViewChange",function(e,b,a,c){if(f){f=!1;var d=h("scheduler_settings");if(d)return d=unescape(d).split("@"),d[0]=this.templates.xml_date(d[0]),window.setTimeout(function(){scheduler.setCurrentView(d[0],
d[1])},1),!1}var i=escape(this.templates.xml_format(c||b)+"@"+(a||e));g("scheduler_settings","expires=Sun, 31 Jan 9999 22:00:00 GMT",i);return!0})})();

View File

@ -0,0 +1,8 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
(function(){scheduler.config.fix_tab_position=!0;scheduler.config.use_select_menu_space=!0;scheduler.config.hour_size_px=44;scheduler.xy.nav_height=59;scheduler.xy.bar_height=24;scheduler.config.wide_form=!0;scheduler.xy.lightbox_additional_height=90;scheduler.config.displayed_event_color="#ff4a4a";scheduler.config.displayed_event_text_color="#ffef80";scheduler.templates.event_bar_date=function(c){return"\u2022 <b>"+scheduler.templates.event_date(c)+"</b> "};scheduler.attachEvent("onLightbox",function(){for(var c=
scheduler.getLightbox(),d=c.getElementsByTagName("div"),b=0;b<d.length;b++){var e=d[b];if(e.className=="dhx_close_icon"){e.onclick=function(){scheduler.endLightbox(!1,c)};break}}});scheduler._lightbox_template="<div class='dhx_cal_ltitle'><span class='dhx_mark'>&nbsp;</span><span class='dhx_time'></span><span class='dhx_title'></span><div class='dhx_close_icon'></div></div><div class='dhx_cal_larea'></div>";scheduler.attachEvent("onTemplatesReady",function(){var c=scheduler.date.date_to_str("%d"),
d=scheduler.templates.month_day;scheduler.templates.month_day=function(a){if(this._mode=="month"){var b=c(a);a.getDate()==1&&(b=scheduler.locale.date.month_full[a.getMonth()]+" "+b);+a==+scheduler.date.date_part(new Date)&&(b=scheduler.locale.labels.dhx_cal_today_button+" "+b);return b}else return d.call(this,a)};if(scheduler.config.fix_tab_position)for(var b=scheduler._els.dhx_cal_navline[0].getElementsByTagName("div"),e=[],f=211,g=0;g<b.length;g++){var a=b[g],h=a.getAttribute("name");if(h)switch(a.style.right=
"auto",h){case "day_tab":a.style.left="14px";a.className+=" dhx_cal_tab_first";break;case "week_tab":a.style.left="75px";break;case "month_tab":a.style.left="136px";a.className+=" dhx_cal_tab_last";break;default:a.style.left=f+"px",a.className+=" dhx_cal_tab_standalone",f=f+14+a.offsetWidth}}})})();

View File

@ -1,10 +1,11 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
scheduler.form_blocks.combo={render:function(a){var d="";d+="<div class='"+a.type+"' style='height:"+(a.height||20)+"px;' ></div>";return d},set_value:function(a,d,c,b){a._combo&&a._combo.destructor();window.dhx_globalImgPath=b.image_path||"/";a._combo=new dhtmlXCombo(a,b.name,a.offsetWidth-8);a._combo.enableFilteringMode(!!b.filtering,b.script_path||null,!!b.cache);if(b.script_path)a._combo.setComboValue(c[b.map_to]||null);else{for(var f=[],e=0;e<b.options.length;e++){var g=[];g.push(b.options[e].key);
g.push(b.options[e].label);f.push(g)}a._combo.addOption(f);if(c[b.map_to]){var h=a._combo.getIndexByValue(c[b.map_to]);a._combo.selectOption(h)}}},get_value:function(a){var d=a._combo.getSelectedValue();return d},focus:function(){}};
scheduler.form_blocks.radio={render:function(a){var d="";d+="<div class='dhx_cal_ltext dhx_cal_radio' style='height:"+a.height+"px;' >";for(var c=0;c<a.options.length;c++){var b=scheduler.uid();d+="<input id='"+b+"' type='radio' name='"+a.name+"' value='"+a.options[c].key+"'><label for='"+b+"'> "+a.options[c].label+"</label>";a.vertical&&(d+="<br/>")}d+="</div>";return d},set_value:function(a,d,c,b){for(var f=a.getElementsByTagName("input"),e=0;e<f.length;e++)if(f[e].checked=!1,f[e].value==c[b.map_to])f[e].checked=
!0},get_value:function(a){for(var d=a.getElementsByTagName("input"),c=0;c<d.length;c++)if(d[c].checked)return d[c].value},focus:function(){}};
scheduler.form_blocks.checkbox={render:function(){return scheduler.config.wide_form?'<div class="dhx_cal_wide_checkbox"></div>':""},set_value:function(a,d,c,b){var a=document.getElementById(b.id),f=scheduler.uid(),e=!1;typeof b.checked_value!="undefined"&&c[b.map_to]==b.checked_value&&(e=!0);a.className+=" dhx_cal_checkbox";var g="<input id='"+f+"' type='checkbox' value='true' name='"+b.name+"'"+(e?"checked='true'":"")+"'>",h="<label for='"+f+"'>"+(scheduler.locale.labels["section_"+b.name]||b.name)+
"</label>";scheduler.config.wide_form?(a.innerHTML=h,a.nextSibling.innerHTML=g):a.innerHTML=g+h},get_value:function(a,d,c){var a=document.getElementById(c.id),b=a.getElementsByTagName("input")[0];b||(b=a.nextSibling.getElementsByTagName("input")[0]);return b.checked?c.checked_value||!0:c.unchecked_value||!1},focus:function(){}};
scheduler.form_blocks.combo={render:function(b){if(!b.cached_options)b.cached_options={};var d="";d+="<div class='"+b.type+"' style='height:"+(b.height||20)+"px;' ></div>";return d},set_value:function(b,d,c,a){b._combo&&b._combo.destructor();window.dhx_globalImgPath=a.image_path||"/";b._combo=new dhtmlXCombo(b,a.name,b.offsetWidth-8);a.options_height&&b._combo.setOptionHeight(a.options_height);var e=b._combo;e.enableFilteringMode(!!a.filtering,a.script_path||null,!!a.cache);if(a.script_path){var f=
c[a.map_to];f?a.cached_options[f]?(e.addOption(f,a.cached_options[f]),e.disable(1),e.selectOption(0),e.disable(0)):dhtmlxAjax.get(a.script_path+"?id="+f+"&uid="+scheduler.uid(),function(b){var c=b.doXPath("//option")[0],d=c.childNodes[0].nodeValue;a.cached_options[f]=d;e.addOption(f,d);e.disable(1);e.selectOption(0);e.disable(0)}):e.setComboValue(null)}else{for(var g=[],h=0;h<a.options.length;h++){var i=[];i.push(a.options[h].key);i.push(a.options[h].label);g.push(i)}e.addOption(g);if(c[a.map_to]){var j=
e.getIndexByValue(c[a.map_to]);e.selectOption(j)}}},get_value:function(b,d,c){var a=b._combo.getSelectedValue();c.script_path&&(c.cached_options[a]=b._combo.getSelectedText());return a},focus:function(){}};
scheduler.form_blocks.radio={render:function(b){var d="";d+="<div class='dhx_cal_ltext dhx_cal_radio' style='height:"+b.height+"px;' >";for(var c=0;c<b.options.length;c++){var a=scheduler.uid();d+="<input id='"+a+"' type='radio' name='"+b.name+"' value='"+b.options[c].key+"'><label for='"+a+"'> "+b.options[c].label+"</label>";b.vertical&&(d+="<br/>")}d+="</div>";return d},set_value:function(b,d,c,a){for(var e=b.getElementsByTagName("input"),f=0;f<e.length;f++){e[f].checked=!1;var g=c[a.map_to]||d;
if(e[f].value==g)e[f].checked=!0}},get_value:function(b){for(var d=b.getElementsByTagName("input"),c=0;c<d.length;c++)if(d[c].checked)return d[c].value},focus:function(){}};
scheduler.form_blocks.checkbox={render:function(){return scheduler.config.wide_form?'<div class="dhx_cal_wide_checkbox"></div>':""},set_value:function(b,d,c,a){var b=document.getElementById(a.id),e=scheduler.uid(),f=typeof a.checked_value!="undefined"?c[a.map_to]==a.checked_value:!!d;b.className+=" dhx_cal_checkbox";var g="<input id='"+e+"' type='checkbox' value='true' name='"+a.name+"'"+(f?"checked='true'":"")+"'>",h="<label for='"+e+"'>"+(scheduler.locale.labels["section_"+a.name]||a.name)+"</label>";
scheduler.config.wide_form?(b.innerHTML=h,b.nextSibling.innerHTML=g):b.innerHTML=g+h;if(a.handler){var i=b.getElementsByTagName("input")[0];i.onclick=a.handler}},get_value:function(b,d,c){var b=document.getElementById(c.id),a=b.getElementsByTagName("input")[0];a||(a=b.nextSibling.getElementsByTagName("input")[0]);return a.checked?c.checked_value||!0:c.unchecked_value||!1},focus:function(){}};

View File

@ -1,6 +1,6 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
scheduler.expand=function(){var a=scheduler._obj;do a._position=a.style.position||"",a.style.position="static";while((a=a.parentNode)&&a.style);a=scheduler._obj;a.style.position="absolute";a._width=a.style.width;a._height=a.style.height;a.style.width=a.style.height="100%";a.style.top=a.style.left="0px";var b=document.body;b.scrollTop=0;if(b=b.parentNode)b.scrollTop=0;document.body._overflow=document.body.style.overflow||"";document.body.style.overflow="hidden";scheduler._maximize()};
scheduler.collapse=function(){var a=scheduler._obj;do a.style.position=a._position;while((a=a.parentNode)&&a.style);a=scheduler._obj;a.style.width=a._width;a.style.height=a._height;document.body.style.overflow=document.body._overflow;scheduler._maximize()};scheduler.attachEvent("onTemplatesReady",function(){var a=document.createElement("DIV");a.className="dhx_expand_icon";scheduler.toggleIcon=a;scheduler._obj.appendChild(a);a.onclick=function(){scheduler.expanded?scheduler.collapse():scheduler.expand()}});

View File

@ -0,0 +1,28 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
(function(){scheduler.grid={sort_rules:{"int":function(b,d,a){return a(b)*1<a(d)*1?1:-1},str:function(b,d,a){return a(b)<a(d)?1:-1},date:function(b,d,a){return new Date(a(b))<new Date(a(d))?1:-1}},_getObjName:function(b){return"grid_"+b},_getViewName:function(b){return b.replace(/^grid_/,"")}}})();
scheduler.createGridView=function(b){function d(a){return!(a!==void 0&&(a*1!=a||a<0))}var a=b.name||"grid",c=scheduler.grid._getObjName(a);scheduler.config[a+"_start"]=b.from||new Date(0);scheduler.config[a+"_end"]=b.to||new Date(9999,1,1);scheduler[c]=b;scheduler[c].defPadding=8;scheduler[c].columns=scheduler[c].fields;delete scheduler[c].fields;for(var e=scheduler[c].columns,f=0;f<e.length;f++){if(d(e[f].width))e[f].initialWidth=e[f].width;d(e[f].paddingLeft)||delete e[f].paddingLeft;d(e[f].paddingRight)||
delete e[f].paddingRight}scheduler[c].select=b.select===void 0?!0:b.select;scheduler.locale.labels[a+"_tab"]===void 0&&(scheduler.locale.labels[a+"_tab"]=scheduler[c].label||scheduler.locale.labels.grid_tab);scheduler[c]._selected_divs=[];scheduler.date[a+"_start"]=function(a){return a};scheduler.date["add_"+a]=function(a,b){var c=new Date(a);c.setMonth(c.getMonth()+b);return c};scheduler.templates[a+"_date"]=function(a,b){return scheduler.templates.day_date(a)+" - "+scheduler.templates.day_date(b)};
scheduler.attachEvent("onTemplatesReady",function(){scheduler.templates[a+"_full_date"]=function(a,b,c){return c._timed?this.day_date(c.start_date,c.end_date,c)+" "+this.event_date(a):scheduler.templates.day_date(a)+" &ndash; "+scheduler.templates.day_date(b)};scheduler.templates[a+"_single_date"]=function(a){return scheduler.templates.day_date(a)+" "+this.event_date(a)};scheduler.attachEvent("onDblClick",function(b){return this._mode==a?(scheduler._click.buttons.details(b),!1):!0});scheduler.attachEvent("onClick",
function(b,d){return this._mode==a&&scheduler[c].select?(scheduler.grid.unselectEvent("",a),scheduler.grid.selectEvent(b,a,d),!1):!0});scheduler.templates[a+"_field"]=function(a,b){return b[a]};scheduler.attachEvent("onSchedulerResize",function(){return this._mode==a?(this[a+"_view"](!0),window.setTimeout(function(){scheduler.callEvent("onAfterSchedulerResize",[])},1),!1):!0});var b=scheduler.render_data;scheduler.render_data=function(d){if(this._mode==a)scheduler.grid._fill_grid_tab(c);else return b.apply(this,
arguments)};var d=scheduler.render_view_data;scheduler.render_view_data=function(){if(this._mode==a)scheduler.grid._gridScrollTop=scheduler._els.dhx_cal_data[0].childNodes[0].scrollTop,scheduler._els.dhx_cal_data[0].childNodes[0].scrollTop=0;scheduler._els.dhx_cal_data[0].style.overflowY="auto";return d.apply(this,arguments)}});scheduler[a+"_view"]=function(b){b?(scheduler._min_date=scheduler[c].paging?scheduler.date[a+"_start"](new Date(scheduler._date)):scheduler.config[a+"_start"],scheduler._max_date=
scheduler[c].paging?scheduler.date.add(scheduler._min_date,1,a):scheduler.config[a+"_end"],scheduler.grid.set_full_view(c),scheduler._els.dhx_cal_date[0].innerHTML=scheduler._min_date>new Date(0)&&scheduler._max_date<new Date(9999,1,1)?scheduler.templates[a+"_date"](scheduler._min_date,scheduler._max_date):"",scheduler.grid._fill_grid_tab(c),scheduler._gridView=c):(scheduler.grid._sort_marker=null,delete scheduler._gridView,scheduler._rendered=[],scheduler[c]._selected_divs=[])}};
scheduler.dblclick_dhx_grid_area=function(){!this.config.readonly&&this.config.dblclick_create&&this.addEventNow()};if(scheduler._click.dhx_cal_header)scheduler._old_header_click=scheduler._click.dhx_cal_header;
scheduler._click.dhx_cal_header=function(b){if(scheduler._gridView){var d=b||window.event,a=scheduler.grid.get_sort_params(d,scheduler._gridView);scheduler.grid.draw_sort_marker(d.originalTarget||d.srcElement,a.dir);scheduler.clear_view();scheduler.grid._fill_grid_tab(scheduler._gridView,a)}else if(scheduler._old_header_click)return scheduler._old_header_click.apply(this,arguments)};
scheduler.grid.selectEvent=function(b,d,a){if(scheduler.callEvent("onBeforeRowSelect",[b,a])){var c=scheduler.grid._getObjName(d);scheduler.for_rendered(b,function(a){a.className+=" dhx_grid_event_selected";scheduler[c]._selected_divs.push(a)});scheduler._select_id=b}};scheduler.grid._unselectDiv=function(b){b.className=b.className.replace(/ dhx_grid_event_selected/,"")};
scheduler.grid.unselectEvent=function(b,d){var a=scheduler.grid._getObjName(d);if(a&&scheduler[a]._selected_divs)if(b)for(c=0;c<scheduler[a]._selected_divs.length;c++){if(scheduler[a]._selected_divs[c].getAttribute("event_id")==b){scheduler.grid._unselectDiv(scheduler[a]._selected_divs[c]);scheduler[a]._selected_divs.slice(c,1);break}}else{for(var c=0;c<scheduler[a]._selected_divs.length;c++)scheduler.grid._unselectDiv(scheduler[a]._selected_divs[c]);scheduler[a]._selected_divs=[]}};
scheduler.grid.get_sort_params=function(b,d){var a=b.originalTarget||b.srcElement;if(a.className=="dhx_grid_view_sort")a=a.parentNode;for(var c=!a.className||a.className.indexOf("dhx_grid_sort_asc")==-1?"asc":"desc",e=0,f=0;f<a.parentNode.childNodes.length;f++)if(a.parentNode.childNodes[f]==a){e=f;break}var i=null;if(scheduler[d].columns[e].template)var g=scheduler[d].columns[e].template,i=function(a){return g(a.start_date,a.end_date,a)};else{var k=scheduler[d].columns[e].id;k=="date"&&(k="start_date");
i=function(a){return a[k]}}var h=scheduler[d].columns[e].sort;typeof h!="function"&&(h=scheduler.grid.sort_rules[h]||scheduler.grid.sort_rules.str);return{dir:c,value:i,rule:h}};
scheduler.grid.draw_sort_marker=function(b,d){if(b.className=="dhx_grid_view_sort")b=b.parentNode;if(scheduler.grid._sort_marker)scheduler.grid._sort_marker.className=scheduler.grid._sort_marker.className.replace(/( )?dhx_grid_sort_(asc|desc)/,""),scheduler.grid._sort_marker.removeChild(scheduler.grid._sort_marker.lastChild);b.className+=" dhx_grid_sort_"+d;scheduler.grid._sort_marker=b;var a="<div class='dhx_grid_view_sort' style='left:"+(+b.style.width.replace("px","")-15+b.offsetLeft)+"px'>&nbsp;</div>";
b.innerHTML+=a};scheduler.grid.sort_grid=function(b){var b=b||{dir:"desc",value:function(a){return a.start_date},rule:scheduler.grid.sort_rules.date},d=scheduler.get_visible_events();b.dir=="desc"?d.sort(function(a,c){return b.rule(a,c,b.value)}):d.sort(function(a,c){return-b.rule(a,c,b.value)});return d};scheduler.grid.set_full_view=function(b){if(b){var d=scheduler.locale.labels,a=scheduler.grid._print_grid_header(b);scheduler._els.dhx_cal_header[0].innerHTML=a;scheduler._table_view=!0;scheduler.set_sizes()}};
scheduler.grid._calcPadding=function(b,d){var a=(b.paddingLeft!==void 0?1*b.paddingLeft:scheduler[d].defPadding)+(b.paddingRight!==void 0?1*b.paddingRight:scheduler[d].defPadding);return a};
scheduler.grid._getStyles=function(b,d){for(var a=[],c="",e=0;d[e];e++)switch(c=d[e]+":",d[e]){case "text-align":b.align&&a.push(c+b.align);break;case "vertical-align":b.valign&&a.push(c+b.valign);break;case "padding-left":b.paddingLeft!=void 0&&a.push(c+(b.paddingLeft||"0")+"px");break;case "padding-left":b.paddingRight!=void 0&&a.push(c+(b.paddingRight||"0")+"px")}return a};
scheduler.grid._fill_grid_tab=function(b,d){for(var a=scheduler._date,c=scheduler.grid.sort_grid(d),e=scheduler[b].columns,f="<div>",i=-2,g=0;g<e.length;g++){var k=scheduler.grid._calcPadding(e[g],b);i+=e[g].width+k;g<e.length-1&&(f+="<div class='dhx_grid_v_border' style='left:"+i+"px'></div>")}f+="</div>";f+="<div class='dhx_grid_area'><table>";for(g=0;g<c.length;g++)f+=scheduler.grid._print_event_row(c[g],b);f+="</table></div>";scheduler._els.dhx_cal_data[0].innerHTML=f;scheduler._els.dhx_cal_data[0].scrollTop=
scheduler.grid._gridScrollTop||0;var h=scheduler._els.dhx_cal_data[0].getElementsByTagName("tr");scheduler._rendered=[];for(g=0;g<h.length;g++)scheduler._rendered[g]=h[g]};
scheduler.grid._print_event_row=function(b,d){var a=[];b.color&&a.push("background:"+b.color);b.textColor&&a.push("color:"+b.textColor);b._text_style&&a.push(b._text_style);scheduler[d].rowHeight&&a.push("height:"+scheduler[d].rowHeight+"px");var c="";a.length&&(c="style='"+a.join(";")+"'");for(var e=scheduler[d].columns,f=scheduler.templates.event_class(b.start_date,b.end_date,b),i="<tr class='dhx_grid_event"+(f?" "+f:"")+"' event_id='"+b.id+"' "+c+">",g=scheduler.grid._getViewName(d),k=["text-align",
"vertical-align","padding-left","padding-right"],h=0;h<e.length;h++){var j;j=e[h].template?e[h].template(b.start_date,b.end_date,b):e[h].id=="date"?scheduler.templates[g+"_full_date"](b.start_date,b.end_date,b):e[h].id=="start_date"||e[h].id=="end_date"?scheduler.templates[g+"_single_date"](b[e[h].id]):scheduler.templates[g+"_field"](e[h].id,b);var l=scheduler.grid._getStyles(e[h],k),m=e[h].css?' class="'+e[h].css+'"':"";i+="<td style='width:"+e[h].width+"px;"+l.join(";")+"' "+m+">"+j+"</td>"}i+=
"<td class='dhx_grid_dummy'></td></tr>";return i};
scheduler.grid._print_grid_header=function(b){for(var d="<div class='dhx_grid_line'>",a=scheduler[b].columns,c=[],e=a.length,f=scheduler._obj.clientWidth-2*a.length-20,i=0;i<a.length;i++){var g=a[i].initialWidth*1;!isNaN(g)&&a[i].initialWidth!=""&&a[i].initialWidth!=null&&typeof a[i].initialWidth!="boolean"?(e--,f-=g,c[i]=g):c[i]=null}for(var k=Math.floor(f/e),h=["text-align","padding-left","padding-right"],j=0;j<a.length;j++){var l=!c[j]?k:c[j];a[j].width=l-scheduler.grid._calcPadding(a[j],b);var m=
scheduler.grid._getStyles(a[j],h);d+="<div style='width:"+(a[j].width-1)+"px;"+m.join(";")+"'>"+(a[j].label===void 0?a[j].id:a[j].label)+"</div>"}d+="</div>";return d};

View File

@ -1,5 +1,5 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
scheduler.attachEvent("onTemplatesReady",function(){for(var c=document.body.getElementsByTagName("DIV"),b=0;b<c.length;b++){var a=c[b].className||"",a=a.split(":");if(a.length==2&&a[0]=="template"){var d='return "'+(c[b].innerHTML||"").replace(/\"/g,'\\"').replace(/[\n\r]+/g,"")+'";',d=unescape(d).replace(/\{event\.([a-z]+)\}/g,function(b,a){return'"+ev.'+a+'+"'});scheduler.templates[a[1]]=Function("start","end","ev",d);c[b].style.display="none"}}});

View File

@ -1,6 +1,7 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
(function(){var b=!1;scheduler.attachEvent("onBeforeLightbox",function(){return b=!0});scheduler.attachEvent("onAfterLightbox",function(){b=!1;return!0});dhtmlxEvent(document,_isOpera?"keypress":"keydown",function(a){a=a||event;if(!b)if(a.keyCode==37||a.keyCode==39){a.cancelBubble=!0;var e=scheduler.date.add(scheduler._date,a.keyCode==37?-1:1,scheduler._mode);scheduler.setCurrentView(e);return!0}else if(a.ctrlKey&&a.keyCode==67)scheduler._copy_id=scheduler._select_id;else if(a.ctrlKey&&a.keyCode==
86){var c=scheduler.getEvent(scheduler._copy_id);if(c){var d=scheduler._copy_event(c);d.id=scheduler.uid();scheduler.addEvent(d)}}})})();
(function(){var g=!1,h,d=null;scheduler.attachEvent("onBeforeLightbox",function(){return g=!0});scheduler.attachEvent("onAfterLightbox",function(){g=!1;return!0});scheduler.attachEvent("onMouseMove",function(b,a){h=scheduler.getActionData(a).date});dhtmlxEvent(document,_isOpera?"keypress":"keydown",function(b){b=b||event;if(!g){var a=window.scheduler;if(b.keyCode==37||b.keyCode==39){b.cancelBubble=!0;var j=a.date.add(a._date,b.keyCode==37?-1:1,a._mode);a.setCurrentView(j);return!0}var e=a._select_id;
if(b.ctrlKey&&b.keyCode==67){if(e)a._buffer_id=e,d=!0,a.callEvent("onEventCopied",[a.getEvent(e)]);return!0}if(b.ctrlKey&&b.keyCode==88&&e){d=!1;a._buffer_id=e;var c=a.getEvent(e);a.updateEvent(c.id);a.callEvent("onEventCut",[c])}if(b.ctrlKey&&b.keyCode==86){if(c=a.getEvent(a._buffer_id)){var i=c.end_date-c.start_date;if(d){var f=a._lame_clone(c);f.id=a.uid();f.start_date=new Date(h);f.end_date=new Date(f.start_date.valueOf()+i);a.addEvent(f);a.callEvent("onEventPasted",[d,f,c])}else{var k=a._lame_copy({},
c);c.start_date=new Date(h);c.end_date=new Date(c.start_date.valueOf()+i);a.render_view_data();a.callEvent("onEventPasted",[d,c,k]);d=!0}}return!0}}})})();

View File

@ -1,12 +1,31 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
scheduler.config.limit_start=new Date(-3999,0,0);scheduler.config.limit_end=new Date(3999,0,0);scheduler.config.limit_view=!1;
(function(){var g=null,k={},l={},m=!1;scheduler.blockTime=function(b,a){var c=this.config.first_hour*60,d=this.config.last_hour*60;a=="fullday"&&(a=[c,d]);typeof b=="object"?k[this.date.date_part(b).valueOf()]=a:l[b]=a;for(var e=0;e<a.length;e+=2)a[e]<c&&(a[e]=c),a[e+1]>d&&(a[e+1]=d);m=!0};scheduler.attachEvent("onScaleAdd",function(b,a){var c=k[a.valueOf()]||l[a.getDay()];if(c)for(var d=0;d<c.length;d+=2){var e=c[d],f=c[d+1],h=document.createElement("DIV");h.className="dhx_time_block";var j;h.style.top=
Math.round((e*6E4-this.config.first_hour*36E5)*this.config.hour_size_px/36E5)%(this.config.hour_size_px*24)+"px";h.style.height=Math.round((f-e-1)*6E4*this.config.hour_size_px/36E5)%(this.config.hour_size_px*24)+"px";b.appendChild(h)}});scheduler.attachEvent("onBeforeViewChange",function(b,a,c,d){d=d||a;c=c||b;return scheduler.config.limit_view&&(d.valueOf()>scheduler.config.limit_end.valueOf()||this.date.add(d,1,c)<=scheduler.config.limit_start.valueOf())?(setTimeout(function(){scheduler.setCurrentView(scheduler._date,
c)},1),!1):!0});var f=function(b){var a=scheduler.config,c=b.start_date.valueOf()>=a.limit_start.valueOf()&&b.end_date.valueOf()<=a.limit_end.valueOf();if(c&&m&&b._timed){var d=scheduler.date.date_part(new Date(b.start_date.valueOf())),e=k[d.valueOf()]||l[d.getDay()],f=b.start_date.getHours()*60+b.start_date.getMinutes(),h=b.end_date.getHours()*60+b.end_date.getMinutes();if(e)for(var j=0;j<e.length;j+=2){var g=e[j],i=e[j+1];if(g<h&&i>f){if(f<=i&&f>=g){if(i==1440||h<i){c=!1;break}if(scheduler._drag_id&&
scheduler._drag_mode=="new-size")b.start_date.setHours(0),b.start_date.setMinutes(i);else{c=!1;break}}if(h>=g&&h<i)if(scheduler._drag_id&&scheduler._drag_mode=="new-size")b.end_date.setHours(0),b.end_date.setMinutes(g);else{c=!1;break}}}}if(!c)scheduler._drag_id=null,scheduler._drag_mode=null,scheduler.callEvent("onLimitViolation",[b.id,b]);return c};scheduler.attachEvent("onBeforeDrag",function(b){return!b?!0:f(scheduler.getEvent(b))});scheduler.attachEvent("onClick",function(b){return f(scheduler.getEvent(b))});
scheduler.attachEvent("onBeforeLightbox",function(b){var a=scheduler.getEvent(b);g=[a.start_date,a.end_date];return f(a)});scheduler.attachEvent("onEventAdded",function(b){if(!b)return!0;var a=scheduler.getEvent(b);if(!f(a)){if(a.start_date<scheduler.config.limit_start)a.start_date=new Date(scheduler.config.limit_start);if(a.start_date.valueOf()>=scheduler.config.limit_end.valueOf())a.start_date=this.date.add(scheduler.config.limit_end,-1,"day");if(a.end_date<scheduler.config.limit_start)a.end_date=
new Date(scheduler.config.limit_start);if(a.end_date.valueOf()>=scheduler.config.limit_end.valueOf())a.end_date=this.date.add(scheduler.config.limit_end,-1,"day");if(a.start_date.valueOf()>=a.end_date.valueOf())a.end_date=this.date.add(a.start_date,this.config.event_duration||this.config.time_step,"minute");a._timed=this.is_one_day_event(a)}return!0});scheduler.attachEvent("onEventChanged",function(b){if(!b)return!0;var a=scheduler.getEvent(b);if(!f(a)){if(!g)return!1;a.start_date=g[0];a.end_date=
g[1];a._timed=this.is_one_day_event(a)}return!0});scheduler.attachEvent("onBeforeEventChanged",function(b){return f(b)})})();
scheduler.config.limit_start=null;scheduler.config.limit_end=null;scheduler.config.limit_view=!1;scheduler.config.check_limits=!0;scheduler.config.mark_now=!0;scheduler.config.display_marked_timespans=!0;
(function(){var u=null,s="dhx_time_block",F=function(b,a,c){a instanceof Date&&c instanceof Date?(b.start_date=a,b.end_date=c):(b.days=a,b.zones=c);return b},E=function(b,a,c){var d=typeof b=="object"?b:{days:b};d.type=s;d.css="";if(a){if(c)d.sections=c;d=F(d,b,a)}return d};scheduler.blockTime=function(b,a,c){var d=E(b,a,c);return scheduler.addMarkedTimespan(d)};scheduler.unblockTime=function(b,a,c){var a=a||"fullday",d=E(b,a,c);return scheduler.deleteMarkedTimespan(d)};scheduler.attachEvent("onBeforeViewChange",
function(b,a,c,d){d=d||a;c=c||b;return scheduler.config.limit_view&&(d.valueOf()>scheduler.config.limit_end.valueOf()||this.date.add(d,1,c)<=scheduler.config.limit_start.valueOf())?(setTimeout(function(){scheduler.setCurrentView(scheduler._date,c)},1),!1):!0});var x=function(b,a,c){var d=c[a]&&c[a][s]?c[a][s]:c[b]&&c[b][s]?c[b][s]:[];return d},t=function(b){if(!b)return!0;if(!scheduler.config.check_limits)return!0;for(var a=scheduler,c=a._mode,d=scheduler._marked_timespans,e=a.config,h=[],h=b.rec_type?
scheduler.getRecDates(b):[b],g=!0,i=0;i<h.length;i++){var f=h[i];if(g=e.limit_start&&e.limit_end?f.start_date.valueOf()>=e.limit_start.valueOf()&&f.end_date.valueOf()<=e.limit_end.valueOf():!0)for(var j=new Date(f.start_date.valueOf()),p=scheduler.date.add(j,1,"day");j<f.end_date;j=scheduler.date.date_part(p),p=a.date.add(j,1,"day")){var n=+scheduler.date.date_part(new Date(j)),o=j.getDay(),k=[];if(a._props&&a._props[c]){var m=a._props[c],q=d[c];if(q&&q[f[m.map_to]])for(var r=q[f[m.map_to]],v=x(o,
n,r),l=0;l<v.length;l++)k=scheduler._add_timespan_zones(k,v[l].zones)}if(a.matrix&&a.matrix[c]){var s=a.matrix[c],t=d[c];if(t&&t[f[s.y_property]])for(var u=t[f[s.y_property]],A=x(o,n,u),l=0;l<A.length;l++)k=scheduler._add_timespan_zones(k,A[l].zones)}for(var D=d.global,B=x(o,n,D),l=0;l<B.length;l++)k=scheduler._add_timespan_zones(k,B[l].zones);var C=scheduler._get_zone_minutes(j),y=f.end_date>p||f.end_date.getDate()!=j.getDate()?1440:scheduler._get_zone_minutes(f.end_date);if(k)for(l=0;l<k.length;l+=
2){var z=k[l],w=k[l+1];if(z<y&&w>C){if(C<=w&&C>=z){if(w==1440||y<w){g=!1;break}if(f._timed&&a._drag_id&&a._drag_mode=="new-size")f.start_date.setHours(0),f.start_date.setMinutes(w);else{g=!1;break}}if(y>=z&&y<w||C<z&&y>w)if(f._timed&&a._drag_id&&a._drag_mode=="new-size")f.end_date.setHours(0),f.end_date.setMinutes(z);else{g=!1;break}}}}if(!g)a._drag_id=null,a._drag_mode=null,g=a.checkEvent("onLimitViolation")?a.callEvent("onLimitViolation",[f.id,f]):g}return g};scheduler.attachEvent("onMouseDown",
function(b){return!(b=s)});scheduler.attachEvent("onBeforeDrag",function(b){return!b?!0:t(scheduler.getEvent(b))});scheduler.attachEvent("onClick",function(b){return t(scheduler.getEvent(b))});scheduler.attachEvent("onBeforeLightbox",function(b){var a=scheduler.getEvent(b);u=[a.start_date,a.end_date];return t(a)});scheduler.attachEvent("onEventSave",function(b,a){if(a.rec_type){var c=scheduler._lame_clone(a);scheduler._roll_back_dates(c)}return t(a)});scheduler.attachEvent("onEventAdded",function(b){if(!b)return!0;
var a=scheduler.getEvent(b);if(!t(a)&&scheduler.config.limit_start&&scheduler.config.limit_end){if(a.start_date<scheduler.config.limit_start)a.start_date=new Date(scheduler.config.limit_start);if(a.start_date.valueOf()>=scheduler.config.limit_end.valueOf())a.start_date=this.date.add(scheduler.config.limit_end,-1,"day");if(a.end_date<scheduler.config.limit_start)a.end_date=new Date(scheduler.config.limit_start);if(a.end_date.valueOf()>=scheduler.config.limit_end.valueOf())a.end_date=this.date.add(scheduler.config.limit_end,
-1,"day");if(a.start_date.valueOf()>=a.end_date.valueOf())a.end_date=this.date.add(a.start_date,this.config.event_duration||this.config.time_step,"minute");a._timed=this.is_one_day_event(a)}return!0});scheduler.attachEvent("onEventChanged",function(b){if(!b)return!0;var a=scheduler.getEvent(b);if(!t(a)){if(!u)return!1;a.start_date=u[0];a.end_date=u[1];a._timed=this.is_one_day_event(a)}return!0});scheduler.attachEvent("onBeforeEventChanged",function(b){return t(b)});scheduler.attachEvent("onBeforeEventCreated",
function(b){var a=scheduler.getActionData(b).date,c={_timed:!0,start_date:a,end_date:scheduler.date.add(a,scheduler.config.time_step,"minute")};return t(c)});scheduler.attachEvent("onViewChange",function(){scheduler.markNow()});scheduler.attachEvent("onSchedulerResize",function(){window.setTimeout(function(){scheduler.markNow()},1);return!0});scheduler.attachEvent("onTemplatesReady",function(){scheduler._mark_now_timer=window.setInterval(function(){scheduler.markNow()},6E4)});scheduler.markNow=function(b){var a=
"dhx_now_time";this._els[a]||(this._els[a]=[]);var c=scheduler.config.now_date||new Date,d=this.config;scheduler._remove_mark_now();if(!b&&d.mark_now&&c<this._max_date&&c>this._min_date&&c.getHours()>=d.first_hour&&c.getHours()<d.last_hour){var e=this.locate_holder_day(c);this._els[a]=scheduler._append_mark_now(e,c)}};scheduler._append_mark_now=function(b,a){var c="dhx_now_time",d=scheduler._get_zone_minutes(a),e={zones:[d,d+1],css:c,type:c};if(this._table_view){if(this._mode=="month")return e.days=
+scheduler.date.date_part(a),scheduler._render_marked_timespan(e,null,null)}else if(this._props&&this._props[this._mode]){for(var h=this._els.dhx_cal_data[0].childNodes,g=[],i=0;i<h.length-1;i++){var f=b+i;e.days=f;var j=scheduler._render_marked_timespan(e,null,f)[0];g.push(j)}return g}else return e.days=b,scheduler._render_marked_timespan(e,null,b)};scheduler._remove_mark_now=function(){for(var b="dhx_now_time",a=this._els[b],c=0;c<a.length;c++){var d=a[c],e=d.parentNode;e&&e.removeChild(d)}this._els[b]=
[]};scheduler._marked_timespans={global:{}};scheduler._get_zone_minutes=function(b){return b.getHours()*60+b.getMinutes()};scheduler._prepare_timespan_options=function(b){var a=[],c=[];if(b.days=="fullweek")b.days=[0,1,2,3,4,5,6];if(b.days instanceof Array){for(var d=b.days.slice(),e=0;e<d.length;e++){var h=scheduler._lame_clone(b);h.days=d[e];a.push.apply(a,scheduler._prepare_timespan_options(h))}return a}if(!b||!(b.start_date&&b.end_date&&b.end_date>b.start_date||b.days!==void 0&&b.zones))return a;
var g=0,i=1440;if(b.zones=="fullday")b.zones=[g,i];if(b.zones&&b.invert_zones)b.zones=scheduler.invertZones(b.zones);b.id=scheduler.uid();b.css=b.css||"";b.type=b.type||"default";var f=b.sections;if(f)for(var j in f){if(f.hasOwnProperty(j)){var p=f[j];p instanceof Array||(p=[p]);for(e=0;e<p.length;e++){var n=scheduler._lame_copy({},b);n.sections={};n.sections[j]=p[e];c.push(n)}}}else c.push(b);for(var o=0;o<c.length;o++){var k=c[o],m=k.start_date,q=k.end_date;if(m&&q)for(var r=scheduler.date.date_part(new Date(m)),
v=scheduler.date.add(r,1,"day");r<q;){n=scheduler._lame_copy({},k);delete n.start_date;delete n.end_date;n.days=r.valueOf();var l=m>r?scheduler._get_zone_minutes(m):g,s=q>v||q.getDate()!=r.getDate()?i:scheduler._get_zone_minutes(q);n.zones=[l,s];a.push(n);r=v;v=scheduler.date.add(v,1,"day")}else{if(k.days instanceof Date)k.days=scheduler.date.date_part(k.days).valueOf();k.zones=b.zones.slice();a.push(k)}}return a};scheduler._get_dates_by_index=function(b,a,c){for(var d=[],a=a||scheduler._min_date,
c=c||scheduler._max_date,e=a.getDay(),h=b-e>=0?b-e:7-a.getDay()+b,g=scheduler.date.add(a,h,"day");g<c;g=scheduler.date.add(g,1,"week"))d.push(g);return d};scheduler._get_css_classes_by_config=function(b){var a=[];b.type==s&&(a.push(s),b.css&&a.push(s+"_reset"));a.push("dhx_marked_timespan",b.css);return a.join(" ")};scheduler._get_block_by_config=function(b){var a=document.createElement("DIV");if(b.html)typeof b.html=="string"?a.innerHTML=b.html:a.appendChild(b.html);return a};scheduler._render_marked_timespan=
function(b,a,c){var d=[],e=scheduler.config,h=this._min_date,g=this._max_date,i=!1;if(!e.display_marked_timespans)return d;if(!c&&c!==0)if(b.days<7)c=b.days;else{var f=new Date(b.days),i=+f;if(!(+g>=+f&&+h<=+f))return d;var j=f.getDay(),c=scheduler.config.start_on_monday?j==0?6:j-1:j}var p=b.zones,n=scheduler._get_css_classes_by_config(b);if(scheduler._table_view&&scheduler._mode=="month"){var o=[],k=[];if(a)o.push(a),k.push(c);else for(var k=i?[i]:scheduler._get_dates_by_index(c),m=0;m<k.length;m++)o.push(this._scales[k[m]]);
for(m=0;m<o.length;m++)for(var a=o[m],c=k[m],q=0;q<p.length;q+=2){var r=p[m],s=p[m+1];if(s<=r)return[];var l=scheduler._get_block_by_config(b);l.className=n;var t=a.offsetHeight-1,u=a.offsetWidth-1,x=Math.floor((this._correct_shift(c,1)-h.valueOf())/(864E5*this._cols.length)),A=this.locate_holder_day(c,!1)%this._cols.length,D=this._colsS[A],B=this._colsS.heights[x]+(this._colsS.height?this.xy.month_scale_height+2:2)-1;l.style.top=B+"px";l.style.lineHeight=l.style.height=t+"px";l.style.left=D+Math.round(r/
1440*u)+"px";l.style.width=Math.round((s-r)/1440*u)+"px";a.appendChild(l);d.push(l)}}else{a=a?a:scheduler.locate_holder(c);for(m=0;m<p.length;m+=2){r=Math.max(p[m],e.first_hour*60);s=Math.min(p[m+1],e.last_hour*60);if(s<=r)return[];l=scheduler._get_block_by_config(b);l.className=n;l.style.top=Math.round((r*6E4-this.config.first_hour*36E5)*this.config.hour_size_px/36E5)%(this.config.hour_size_px*24)+"px";l.style.lineHeight=l.style.height=Math.max(Math.round((s-r-1)*6E4*this.config.hour_size_px/36E5)%
(this.config.hour_size_px*24),1)+"px";a.appendChild(l);d.push(l)}}return d};scheduler.markTimespan=function(b){var a=scheduler._prepare_timespan_options(b);if(a.length){for(var c=[],d=0;d<a.length;d++){var e=a[d],h=scheduler._render_marked_timespan(e,null,null);h.length&&c.push.apply(c,h)}return c}};scheduler.unmarkTimespan=function(b){if(b)for(var a=0;a<b.length;a++){var c=b[a];c.parentNode.removeChild(c)}};scheduler._marked_timespans_ids={};scheduler.addMarkedTimespan=function(b){var a=scheduler._prepare_timespan_options(b),
c="global";if(a.length){var d=a[0].id,e=scheduler._marked_timespans,h=scheduler._marked_timespans_ids;h[d]||(h[d]=[]);for(var g=0;g<a.length;g++){var i=a[g],f=i.days,j=i.zones,p=i.css,n=i.sections,o=i.type;if(n)for(var k in n){if(n.hasOwnProperty(k)){e[k]||(e[k]={});var m=n[k],q=e[k];q[m]||(q[m]={});q[m][f]||(q[m][f]={});q[m][f][o]||(q[m][f][o]=[]);var r=q[m][f][o];i._array=r;r.push(i);h[d].push(i)}}else e[c][f]||(e[c][f]={}),e[c][f][o]||(e[c][f][o]=[]),r=e[c][f][o],i._array=r,r.push(i),h[d].push(i)}return d}};
scheduler._add_timespan_zones=function(b,a){var c=b.slice(),a=a.slice();if(!c.length)return a;for(var d=0;d<c.length;d+=2)for(var e=c[d],h=c[d+1],g=d+2==c.length,i=0;i<a.length;i+=2){var f=a[i],j=a[i+1];if(j>h&&f<=h||f<e&&j>=e)c[d]=Math.min(e,f),c[d+1]=Math.max(h,j),d-=2;else{if(!g)continue;var p=e>f?0:2;c.splice(d+p,0,f,j)}a.splice(i--,2);break}return c};scheduler._subtract_timespan_zones=function(b,a){for(var c=b.slice(),d=0;d<c.length;d+=2)for(var e=c[d],h=c[d+1],g=0;g<a.length;g+=2){var i=a[g],
f=a[g+1];if(f>e&&i<h){var j=!1;e>=i&&h<=f&&c.splice(d,2);e<i&&(c.splice(d,2,e,i),j=!0);h>f&&c.splice(j?d+2:d,j?0:2,f,h);d-=2;break}}return c};scheduler.invertZones=function(b){return scheduler._subtract_timespan_zones([0,1440],b.slice())};scheduler._delete_marked_timespan_by_id=function(b){var a=scheduler._marked_timespans_ids[b];if(a)for(var c=0;c<a.length;c++)for(var d=a[c],e=d._array,h=0;h<e.length;h++)if(e[h]==d){e.splice(h,1);break}};scheduler._delete_marked_timespan_by_config=function(b){var a=
scheduler._marked_timespans,c=b.sections,d=b.days,e=b.type||"default",h=[];if(c)for(var g in c){if(c.hasOwnProperty(g)&&a[g]){var i=c[g];a[g][i]&&a[g][i][d]&&a[g][i][d][e]&&(h=a[g][i][d][e])}}else a.global[d]&&a.global[d][e]&&(h=a.global[d][e]);for(var f=0;f<h.length;f++){var j=h[f],p=scheduler._subtract_timespan_zones(j.zones,b.zones);if(p.length)j.zones=p;else{h.splice(f,1);f--;for(var n=scheduler._marked_timespans_ids[j.id],o=0;o<n.length;o++)if(n[o]==j){n.splice(o,1);break}}}};scheduler.deleteMarkedTimespan=
function(b){if(!arguments.length)scheduler._marked_timespans={global:{}};if(typeof b!="object")scheduler._delete_marked_timespan_by_id(b);else for(var a=scheduler._prepare_timespan_options(b),c=0;c<a.length;c++){var d=a[c];scheduler._delete_marked_timespan_by_config(a[c])}};scheduler._get_types_to_render=function(b,a){var c=b?b:{},d;for(d in a||{})a.hasOwnProperty(d)&&(c[d]=a[d]);return c};scheduler._get_configs_to_render=function(b){var a=[],c;for(c in b)b.hasOwnProperty(c)&&a.push.apply(a,b[c]);
return a};scheduler.attachEvent("onScaleAdd",function(b,a){if(!(scheduler._table_view&&scheduler._mode!="month")){var c=a.getDay(),d=a.valueOf(),e=this._mode,h=scheduler._marked_timespans,g=[];if(this._props&&this._props[e]){var i=this._props[e],f=i.options,j=(i.position||0)+Math.floor((this._correct_shift(a.valueOf(),1)-this._min_date.valueOf())/864E5),p=f[j],a=scheduler.date.date_part(new Date(this._date)),c=a.getDay(),d=a.valueOf();if(h[e]&&h[e][p.key]){var n=h[e][p.key],o=scheduler._get_types_to_render(n[c],
n[d]);g.push.apply(g,scheduler._get_configs_to_render(o))}}var k=h.global,m=k[d]||k[c];g.push.apply(g,scheduler._get_configs_to_render(m));for(var q=0;q<g.length;q++)scheduler._render_marked_timespan(g[q],b,a)}})})();

View File

@ -1,28 +1,28 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
scheduler.xy.map_date_width=188;scheduler.xy.map_description_width=400;scheduler.config.map_resolve_event_location=!0;scheduler.config.map_resolve_user_location=!0;scheduler.config.map_initial_position=new google.maps.LatLng(48.724,8.215);scheduler.config.map_error_position=new google.maps.LatLng(15,15);scheduler.config.map_infowindow_max_width=300;scheduler.config.map_type=google.maps.MapTypeId.ROADMAP;scheduler.config.map_zoom_after_resolve=15;scheduler.locale.labels.marker_geo_success="It seems you are here.";
scheduler.locale.labels.marker_geo_fail="Sorry, could not get your current position using geolocation.";scheduler.templates.marker_date=scheduler.date.date_to_str("%Y-%m-%d %H:%i");scheduler.templates.marker_text=function(f,g,e){return"<div><b>"+e.text+"</b><br/><br/>"+(e.event_location||"")+"<br/><br/>"+scheduler.templates.marker_date(f)+" - "+scheduler.templates.marker_date(g)+"</div>"};
scheduler.dblclick_dhx_map_area=function(){!this.config.readonly&&this.config.dblclick_create&&this.addEventNow({start_date:scheduler._date,end_date:scheduler.date.add(scheduler._date,1,"hour")})};scheduler.templates.map_time=function(f,g,e){return e._timed?this.day_date(e.start_date,e.end_date,e)+" "+this.event_date(f):scheduler.templates.day_date(f)+" &ndash; "+scheduler.templates.day_date(g)};scheduler.templates.map_text=function(f,g,e){return e.text};scheduler.date.map_start=function(f){return f};
scheduler.date.add_map=function(f){return new Date(f.valueOf())};scheduler.templates.map_date=function(){return""};scheduler._latLngUpdate=!1;
scheduler.attachEvent("onSchedulerReady",function(){function f(a){if(a){var c=scheduler.locale.labels;scheduler._els.dhx_cal_header[0].innerHTML="<div class='dhx_map_line' style='width: "+(scheduler.xy.map_date_width+scheduler.xy.map_description_width+2)+"px;' ><div style='width: "+scheduler.xy.map_date_width+"px;'>"+c.date+"</div><div class='headline_description' style='width: "+scheduler.xy.map_description_width+"px;'>"+c.description+"</div></div>";scheduler._table_view=!0;scheduler.set_sizes()}}
function g(){scheduler._selected_event_id=null;scheduler.map._infowindow.close();for(var a in scheduler.map._markers)scheduler.map._markers[a].setMap(null),delete scheduler.map._markers[a],scheduler.map._infowindows_content[a]&&delete scheduler.map._infowindows_content[a]}function e(){var a=scheduler.get_visible_events();a.sort(function(a,b){return a.start_date<b.start_date?-1:a.start_date.valueOf()==b.start_date.valueOf()?a.text<b.text?-1:a.text==b.text?0:1:1});for(var c="<div class='dhx_map_area'>",
d=0;d<a.length;d++){var b=a[d],h=b.id==scheduler._selected_event_id?"dhx_map_line highlight":"dhx_map_line",e=b.color?"background-color:"+b.color+";":"",f=b.textColor?"color:"+b.textColor+";":"";c+="<div class='"+h+"' event_id='"+b.id+"' style='"+e+""+f+""+(b._text_style||"")+" width: "+(scheduler.xy.map_date_width+scheduler.xy.map_description_width+2)+"px;'><div style='width: "+scheduler.xy.map_date_width+"px;' >"+scheduler.templates.map_time(b.start_date,b.end_date,b)+"</div>";c+="<div class='dhx_event_icon icon_details'>&nbsp</div>";
scheduler.dblclick_dhx_map_area=function(){!this.config.readonly&&this.config.dblclick_create&&this.addEventNow({start_date:scheduler._date,end_date:scheduler.date.add(scheduler._date,scheduler.config.time_step,"minute")})};scheduler.templates.map_time=function(f,g,e){return e._timed?this.day_date(e.start_date,e.end_date,e)+" "+this.event_date(f):scheduler.templates.day_date(f)+" &ndash; "+scheduler.templates.day_date(g)};scheduler.templates.map_text=function(f,g,e){return e.text};
scheduler.date.map_start=function(f){return f};scheduler.date.add_map=function(f){return new Date(f.valueOf())};scheduler.templates.map_date=function(){return""};scheduler._latLngUpdate=!1;
scheduler.attachEvent("onSchedulerReady",function(){function f(a){if(a){var c=scheduler.locale.labels;scheduler._els.dhx_cal_header[0].innerHTML="<div class='dhx_map_line' style='width: "+(scheduler.xy.map_date_width+scheduler.xy.map_description_width+2)+"px;' ><div class='headline_date' style='width: "+scheduler.xy.map_date_width+"px;'>"+c.date+"</div><div class='headline_description' style='width: "+scheduler.xy.map_description_width+"px;'>"+c.description+"</div></div>";scheduler._table_view=!0;
scheduler.set_sizes()}}function g(){scheduler._selected_event_id=null;scheduler.map._infowindow.close();var a=scheduler.map._markers,c;for(c in a)a.hasOwnProperty(c)&&(a[c].setMap(null),delete scheduler.map._markers[c],scheduler.map._infowindows_content[c]&&delete scheduler.map._infowindows_content[c])}function e(){var a=scheduler.get_visible_events();a.sort(function(a,b){return a.start_date.valueOf()==b.start_date.valueOf()?a.id>b.id?1:-1:a.start_date>b.start_date?1:-1});for(var c="<div class='dhx_map_area'>",
d=0;d<a.length;d++){var b=a[d],h=b.id==scheduler._selected_event_id?"dhx_map_line highlight":"dhx_map_line",e=b.color?"background:"+b.color+";":"",f=b.textColor?"color:"+b.textColor+";":"";c+="<div class='"+h+"' event_id='"+b.id+"' style='"+e+""+f+""+(b._text_style||"")+" width: "+(scheduler.xy.map_date_width+scheduler.xy.map_description_width+2)+"px;'><div style='width: "+scheduler.xy.map_date_width+"px;' >"+scheduler.templates.map_time(b.start_date,b.end_date,b)+"</div>";c+="<div class='dhx_event_icon icon_details'>&nbsp</div>";
c+="<div class='line_description' style='width:"+(scheduler.xy.map_description_width-25)+"px;'>"+scheduler.templates.map_text(b.start_date,b.end_date,b)+"</div></div>"}c+="<div class='dhx_v_border' style='left: "+(scheduler.xy.map_date_width-2)+"px;'></div><div class='dhx_v_border_description'></div></div>";scheduler._els.dhx_cal_data[0].scrollTop=0;scheduler._els.dhx_cal_data[0].innerHTML=c;scheduler._els.dhx_cal_data[0].style.width=scheduler.xy.map_date_width+scheduler.xy.map_description_width+
1+"px";var g=scheduler._els.dhx_cal_data[0].firstChild.childNodes;scheduler._els.dhx_cal_date[0].innerHTML=scheduler.templates[scheduler._mode+"_date"](scheduler._min_date,scheduler._max_date,scheduler._mode);scheduler._rendered=[];for(d=0;d<g.length-2;d++)scheduler._rendered[d]=g[d]}function k(a){var c=document.getElementById(a),d=scheduler._y-scheduler.xy.nav_height;d<0&&(d=0);var b=scheduler._x-scheduler.xy.map_date_width-scheduler.xy.map_description_width-1;b<0&&(b=0);c.style.height=d+"px";c.style.width=
b+"px";c.style.marginLeft=scheduler.xy.map_date_width+scheduler.xy.map_description_width+1+"px";c.style.marginTop=scheduler.xy.nav_height+2+"px"}(function(){scheduler._isMapPositionSet=!1;var a=document.createElement("div");a.className="dhx_map";a.id="dhx_gmap";a.style.dispay="none";var c=scheduler._obj;c.appendChild(a);scheduler._els.dhx_gmap=[];scheduler._els.dhx_gmap.push(a);k("dhx_gmap");var d={zoom:scheduler.config.map_inital_zoom||10,center:scheduler.config.map_initial_position,mapTypeId:scheduler.config.map_type||
google.maps.MapTypeId.ROADMAP},b=new google.maps.Map(document.getElementById("dhx_gmap"),d);b.disableDefaultUI=!1;b.disableDoubleClickZoom=!scheduler.config.readonly;google.maps.event.addListener(b,"dblclick",function(a){if(!scheduler.config.readonly&&scheduler.config.dblclick_create){var b=a.latLng;geocoder.geocode({latLng:b},function(a,c){if(c==google.maps.GeocoderStatus.OK)b=a[0].geometry.location,scheduler.addEventNow({lat:b.lat(),lng:b.lng(),event_location:a[0].formatted_address,start_date:scheduler._date,
end_date:scheduler.date.add(scheduler._date,1,"hour")})})}});var e={content:""};if(scheduler.config.map_infowindow_max_width)e.maxWidth=scheduler.config.map_infowindow_max_width;scheduler.map={_points:[],_markers:[],_infowindow:new google.maps.InfoWindow(e),_infowindows_content:[],_initialization_count:-1,_obj:b};geocoder=new google.maps.Geocoder;scheduler.config.map_resolve_user_location&&navigator.geolocation&&(scheduler._isMapPositionSet||navigator.geolocation.getCurrentPosition(function(a){var c=
end_date:scheduler.date.add(scheduler._date,scheduler.config.time_step,"minute")})})}});var e={content:""};if(scheduler.config.map_infowindow_max_width)e.maxWidth=scheduler.config.map_infowindow_max_width;scheduler.map={_points:[],_markers:[],_infowindow:new google.maps.InfoWindow(e),_infowindows_content:[],_initialization_count:-1,_obj:b};geocoder=new google.maps.Geocoder;scheduler.config.map_resolve_user_location&&navigator.geolocation&&(scheduler._isMapPositionSet||navigator.geolocation.getCurrentPosition(function(a){var c=
new google.maps.LatLng(a.coords.latitude,a.coords.longitude);b.setCenter(c);b.setZoom(scheduler.config.map_zoom_after_resolve||10);scheduler.map._infowindow.setContent(scheduler.locale.labels.marker_geo_success);scheduler.map._infowindow.position=b.getCenter();scheduler.map._infowindow.open(b);scheduler._isMapPositionSet=!0},function(){scheduler.map._infowindow.setContent(scheduler.locale.labels.marker_geo_fail);scheduler.map._infowindow.setPosition(b.getCenter());scheduler.map._infowindow.open(b);
scheduler._isMapPositionSet=!0}));google.maps.event.addListener(b,"resize",function(){a.style.zIndex="5";b.setZoom(b.getZoom())});google.maps.event.addListener(b,"tilesloaded",function(){a.style.zIndex="5"});a.style.display="none"})();scheduler.attachEvent("onSchedulerResize",function(){return this._mode=="map"?(this.map_view(!0),!1):!0});var l=scheduler.render_data;scheduler.render_data=function(a,c){if(this._mode=="map"){e();for(var d=scheduler.get_visible_events(),b=0;b<d.length;b++)scheduler.map._markers[d[b].id]||
i(d[b],!1,!1)}else return l.apply(this,arguments)};scheduler.map_view=function(a){scheduler.map._initialization_count++;var c=scheduler._els.dhx_gmap[0];scheduler._els.dhx_cal_data[0].style.width=scheduler.xy.map_date_width+scheduler.xy.map_description_width+1+"px";scheduler._min_date=scheduler.config.map_start||new Date;scheduler._max_date=scheduler.config.map_end||new Date(9999,1,1);scheduler._table_view=!0;f(a);if(a){g();e();c.style.display="block";k("dhx_gmap");for(var d=scheduler.map._obj.getCenter(),
i(d[b],!1,!1)}else return l.apply(this,arguments)};scheduler.map_view=function(a){scheduler.map._initialization_count++;var c=scheduler._els.dhx_gmap[0];scheduler._els.dhx_cal_data[0].style.width=scheduler.xy.map_date_width+scheduler.xy.map_description_width+1+"px";scheduler._min_date=scheduler.config.map_start||new Date;scheduler._max_date=scheduler.config.map_end||scheduler.date.add(new Date,1,"year");scheduler._table_view=!0;f(a);if(a){g();e();c.style.display="block";k("dhx_gmap");for(var d=scheduler.map._obj.getCenter(),
b=scheduler.get_visible_events(),h=0;h<b.length;h++)scheduler.map._markers[b[h].id]||i(b[h])}else c.style.display="none";google.maps.event.trigger(scheduler.map._obj,"resize");scheduler.map._initialization_count===0&&d&&scheduler.map._obj.setCenter(d);scheduler._selected_event_id&&m(scheduler._selected_event_id)};var m=function(a){scheduler.map._obj.setCenter(scheduler.map._points[a]);scheduler.callEvent("onClick",[a])},i=function(a,c,d){var b=scheduler.config.map_error_position;a.lat&&a.lng&&(b=
new google.maps.LatLng(a.lat,a.lng));var e=scheduler.templates.marker_text(a.start_date,a.end_date,a);scheduler._new_event||(scheduler.map._infowindows_content[a.id]=e,scheduler.map._markers[a.id]&&scheduler.map._markers[a.id].setMap(null),scheduler.map._markers[a.id]=new google.maps.Marker({position:b,map:scheduler.map._obj}),google.maps.event.addListener(scheduler.map._markers[a.id],"click",function(){scheduler.map._infowindow.setContent(scheduler.map._infowindows_content[a.id]);scheduler.map._infowindow.open(scheduler.map._obj,
scheduler.map._markers[a.id]);scheduler._selected_event_id=a.id;scheduler.render_data()}),scheduler.map._points[a.id]=b,c&&scheduler.map._obj.setCenter(scheduler.map._points[a.id]),d&&scheduler.callEvent("onClick",[a.id]))};scheduler.attachEvent("onClick",function(a){if(this._mode=="map"){scheduler._selected_event_id=a;for(var c=0;c<scheduler._rendered.length;c++)scheduler._rendered[c].className="dhx_map_line",scheduler._rendered[c].getAttribute("event_id")==a&&(scheduler._rendered[c].className+=
" highlight");scheduler.map._points[a]&&scheduler.map._markers[a]&&(scheduler.map._obj.setCenter(scheduler.map._points[a]),google.maps.event.trigger(scheduler.map._markers[a],"click"))}return!0});var j=function(a){a.event_location&&geocoder?geocoder.geocode({address:a.event_location,language:scheduler.uid().toString()},function(c,d){var b={};if(d!=google.maps.GeocoderStatus.OK){if(b=scheduler.callEvent("onLocationError",[a.id]),!b||b===!0)b=scheduler.config.map_error_position}else b=c[0].geometry.location;
a.lat=b.lat();a.lng=b.lng();scheduler._selected_event_id=a.id;scheduler._latLngUpdate=!0;scheduler.callEvent("onEventChanged",[a.id,a]);i(a,!0,!0)}):i(a,!0,!0)},n=function(a){a.event_location&&geocoder&&geocoder.geocode({address:a.event_location,language:scheduler.uid().toString()},function(c,d){var b={};if(d!=google.maps.GeocoderStatus.OK){if(b=scheduler.callEvent("onLocationError",[a.id]),!b||b===!0)b=scheduler.config.map_error_position}else b=c[0].geometry.location;a.lat=b.lat();a.lng=b.lng();
scheduler._latLngUpdate=!0;scheduler.callEvent("onEventChanged",[a.id,a])})},o=function(a,c,d,b){setTimeout(function(){var b=a.apply(c,d);a=obj=d=null;return b},b||1)};scheduler.attachEvent("onEventChanged",function(a){if(this._latLngUpdate)this._latLngUpdate=!1;else{var c=scheduler.getEvent(a);c.start_date<scheduler._min_date&&c.end_date>scheduler._min_date||c.start_date<scheduler._max_date&&c.end_date>scheduler._max_date||c.start_date.valueOf()>=scheduler._min_date&&c.end_date.valueOf()<=scheduler._max_date?
scheduler._latLngUpdate=!0;scheduler.callEvent("onEventChanged",[a.id,a])})},o=function(a,c,d,b){setTimeout(function(){var b=a.apply(c,d);a=c=d=null;return b},b||1)};scheduler.attachEvent("onEventChanged",function(a){if(this._latLngUpdate)this._latLngUpdate=!1;else{var c=scheduler.getEvent(a);c.start_date<scheduler._min_date&&c.end_date>scheduler._min_date||c.start_date<scheduler._max_date&&c.end_date>scheduler._max_date||c.start_date.valueOf()>=scheduler._min_date&&c.end_date.valueOf()<=scheduler._max_date?
(scheduler.map._markers[a]&&scheduler.map._markers[a].setMap(null),j(c)):(scheduler._selected_event_id=null,scheduler.map._infowindow.close(),scheduler.map._markers[a]&&scheduler.map._markers[a].setMap(null))}return!0});scheduler.attachEvent("onEventIdChange",function(a,c){var d=scheduler.getEvent(c);if(d.start_date<scheduler._min_date&&d.end_date>scheduler._min_date||d.start_date<scheduler._max_date&&d.end_date>scheduler._max_date||d.start_date.valueOf()>=scheduler._min_date&&d.end_date.valueOf()<=
scheduler._max_date)scheduler.map._markers[a]&&(scheduler.map._markers[a].setMap(null),delete scheduler.map._markers[a]),scheduler.map._infowindows_content[a]&&delete scheduler.map._infowindows_content[a],j(d);return!0});scheduler.attachEvent("onEventAdded",function(a,c){if(!scheduler._dataprocessor&&(c.start_date<scheduler._min_date&&c.end_date>scheduler._min_date||c.start_date<scheduler._max_date&&c.end_date>scheduler._max_date||c.start_date.valueOf()>=scheduler._min_date&&c.end_date.valueOf()<=
scheduler._max_date))scheduler.map._markers[a]&&scheduler.map._markers[a].setMap(null),j(c);return!0});scheduler.attachEvent("onBeforeEventDelete",function(a){scheduler.map._markers[a]&&scheduler.map._markers[a].setMap(null);scheduler._selected_event_id=null;scheduler.map._infowindow.close();return!0});scheduler._event_resolve_delay=1500;scheduler.attachEvent("onEventLoading",function(a){scheduler.config.map_resolve_event_location&&a.event_location&&!a.lat&&!a.lng&&(scheduler._event_resolve_delay+=

View File

@ -1,26 +1,26 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
scheduler.templates.calendar_month=scheduler.date.date_to_str("%F %Y");scheduler.templates.calendar_scale_date=scheduler.date.date_to_str("%D");scheduler.templates.calendar_date=scheduler.date.date_to_str("%d");
scheduler.renderCalendar=function(b,c){var a=null,d=b.date||new Date;typeof d=="string"&&(d=this.templates.api_date(d));if(c)a=this._render_calendar(c.parentNode,d,b,c),scheduler.unmarkCalendar(a);else{var e=b.container,f=b.position;typeof e=="string"&&(e=document.getElementById(e));typeof f=="string"&&(f=document.getElementById(f));if(f&&typeof f.left=="undefined")var n=getOffset(f),f={top:n.top+f.offsetHeight,left:n.left};e||(e=scheduler._get_def_cont(f));a=this._render_calendar(e,d,b);a.onclick=
function(a){var a=a||event,b=a.target||a.srcElement;if(b.className.indexOf("dhx_month_head")!=-1){var c=b.parentNode.className;if(c.indexOf("dhx_after")==-1&&c.indexOf("dhx_before")==-1){var d=scheduler.templates.xml_date(this.getAttribute("date"));d.setDate(parseInt(b.innerHTML,10));scheduler.unmarkCalendar(this);scheduler.markCalendar(this,d,"dhx_calendar_click");this._last_date=d;this.conf.handler&&this.conf.handler.call(scheduler,d,this)}}}}for(var m=scheduler.date.month_start(d),k=scheduler.date.add(m,
1,"month"),p=this.getEvents(m,k),i=0;i<p.length;i++){var o=p[i],l=o.start_date;l.valueOf()<m.valueOf()&&(l=m);for(l=scheduler.date.date_part(new Date(l.valueOf()));l<o.end_date;)if(this.markCalendar(a,l,"dhx_year_event"),l=this.date.add(l,1,"day"),l.valueOf()>=k.valueOf())break}this._markCalendarCurrentDate(a);a.conf=b;return a};
scheduler._get_def_cont=function(b){if(!this._def_count)this._def_count=document.createElement("DIV"),this._def_count.style.cssText="position:absolute;z-index:10100;width:251px; height:175px;",this._def_count.onclick=function(b){(b||event).cancelBubble=!0},document.body.appendChild(this._def_count);this._def_count.style.left=b.left+"px";this._def_count.style.top=b.top+"px";this._def_count._created=new Date;return this._def_count};
scheduler._locateCalendar=function(b,c){var a=b.childNodes[2].childNodes[0];typeof c=="string"&&(c=scheduler.templates.api_date(c));var d=b.week_start+c.getDate()-1;return a.rows[Math.floor(d/7)].cells[d%7].firstChild};scheduler.markCalendar=function(b,c,a){this._locateCalendar(b,c).className+=" "+a};scheduler.unmarkCalendar=function(b,c,a){c=c||b._last_date;a=a||"dhx_calendar_click";if(c){var d=this._locateCalendar(b,c);d.className=(d.className||"").replace(RegExp(a,"g"))}};
scheduler._week_template=function(b){for(var c=b||250,a=0,d=document.createElement("div"),e=this.date.week_start(new Date),f=0;f<7;f++)this._cols[f]=Math.floor(c/(7-f)),this._render_x_header(f,a,e,d),e=this.date.add(e,1,"day"),c-=this._cols[f],a+=this._cols[f];d.lastChild.className+=" dhx_scale_bar_last";return d};scheduler.updateCalendar=function(b,c){b.conf.date=c;this.renderCalendar(b.conf,b)};scheduler._mini_cal_arrows=["&nbsp","&nbsp"];
scheduler._render_calendar=function(b,c,a,d){var e=scheduler.templates,f=this._cols;this._cols=[];var n=this._mode;this._mode="calendar";var m=this._colsS;this._colsS={height:0};var k=new Date(this._min_date),p=new Date(this._max_date),i=new Date(scheduler._date),o=e.month_day;e.month_day=e.calendar_date;var c=this.date.month_start(c),l=this._week_template(b.offsetWidth-1),g;d?g=d:(g=document.createElement("DIV"),g.className="dhx_cal_container dhx_mini_calendar");g.setAttribute("date",this.templates.xml_format(c));
g.innerHTML="<div class='dhx_year_month'></div><div class='dhx_year_week'>"+l.innerHTML+"</div><div class='dhx_year_body'></div>";g.childNodes[0].innerHTML=this.templates.calendar_month(c);if(a.navigation){var h=document.createElement("DIV");h.className="dhx_cal_prev_button";h.style.cssText="left:1px;top:2px;position:absolute;";h.innerHTML=this._mini_cal_arrows[0];g.firstChild.appendChild(h);h.onclick=function(){scheduler.updateCalendar(g,scheduler.date.add(g._date,-1,"month"));scheduler._date.getMonth()==
g._date.getMonth()&&scheduler._date.getFullYear()==g._date.getFullYear()&&scheduler._markCalendarCurrentDate(g)};h=document.createElement("DIV");h.className="dhx_cal_next_button";h.style.cssText="left:auto; right:1px;top:2px;position:absolute;";h.innerHTML=this._mini_cal_arrows[1];g.firstChild.appendChild(h);h.onclick=function(){scheduler.updateCalendar(g,scheduler.date.add(g._date,1,"month"));scheduler._date.getMonth()==g._date.getMonth()&&scheduler._date.getFullYear()==g._date.getFullYear()&&scheduler._markCalendarCurrentDate(g)}}g._date=
new Date(c);g.week_start=(c.getDay()-(this.config.start_on_monday?1:0)+7)%7;var u=this.date.week_start(c);this._reset_month_scale(g.childNodes[2],c,u);for(var j=g.childNodes[2].firstChild.rows,q=j.length;q<6;q++){var t=j[j.length-1];j[0].parentNode.appendChild(t.cloneNode(!0));for(var r=parseInt(t.childNodes[t.childNodes.length-1].childNodes[0].innerHTML),r=r<10?r:0,s=0;s<j[q].childNodes.length;s++)j[q].childNodes[s].className="dhx_after",j[q].childNodes[s].childNodes[0].innerHTML=scheduler.date.to_fixed(++r)}d||
b.appendChild(g);g.childNodes[1].style.height=g.childNodes[1].childNodes[0].offsetHeight<=0?"0px":g.childNodes[1].childNodes[0].offsetHeight-1+"px";this._cols=f;this._mode=n;this._colsS=m;this._min_date=k;this._max_date=p;scheduler._date=i;e.month_day=o;return g};
scheduler.destroyCalendar=function(b,c){if(!b&&this._def_count&&this._def_count.firstChild&&(c||(new Date).valueOf()-this._def_count._created.valueOf()>500))b=this._def_count.firstChild;if(b&&(b.onclick=null,b.innerHTML="",b.parentNode&&b.parentNode.removeChild(b),this._def_count))this._def_count.style.top="-1000px"};scheduler.isCalendarVisible=function(){return this._def_count&&parseInt(this._def_count.style.top,10)>0?this._def_count:!1};
scheduler.attachEvent("onTemplatesReady",function(){dhtmlxEvent(document.body,"click",function(){scheduler.destroyCalendar()})});scheduler.templates.calendar_time=scheduler.date.date_to_str("%d-%m-%Y");
scheduler.form_blocks.calendar_time={render:function(){var b="<input class='dhx_readonly' type='text' readonly='true'>",c=scheduler.config,a=this.date.date_part(new Date);c.first_hour&&a.setHours(c.first_hour);b+=" <select>";for(var d=60*c.first_hour;d<60*c.last_hour;d+=this.config.time_step*1){var e=this.templates.time_picker(a);b+="<option value='"+d+"'>"+e+"</option>";a=this.date.add(a,this.config.time_step,"minute")}b+="</select>";var f=scheduler.config.full_day;return"<div style='height:30px;padding-top:0; font-size:inherit;' class='dhx_section_time'>"+
b+"<span style='font-weight:normal; font-size:10pt;'> &nbsp;&ndash;&nbsp; </span>"+b+"</div>"},set_value:function(b,c,a){function d(a,b,c){n(a,b,c);a.value=scheduler.templates.calendar_time(b);a._date=scheduler.date.date_part(new Date(b))}var e=b.getElementsByTagName("input"),f=b.getElementsByTagName("select"),n=function(a,b,c){a.onclick=function(){scheduler.destroyCalendar(null,!0);scheduler.renderCalendar({position:a,date:new Date(this._date),navigation:!0,handler:function(b){a.value=scheduler.templates.calendar_time(b);
a._date=new Date(b);scheduler.destroyCalendar();scheduler.config.event_duration&&scheduler.config.auto_end_date&&c==0&&o()}})}};if(scheduler.config.full_day){if(!b._full_day){var m="<label class='dhx_fullday'><input type='checkbox' name='full_day' value='true'> "+scheduler.locale.labels.full_day+"&nbsp;</label></input>";scheduler.config.wide_form||(m=b.previousSibling.innerHTML+m);b.previousSibling.innerHTML=m;b._full_day=!0}var k=b.previousSibling.getElementsByTagName("input")[0],p=scheduler.date.time_part(a.start_date)==
0&&scheduler.date.time_part(a.end_date)==0&&a.end_date.valueOf()-a.start_date.valueOf()<1728E5;k.checked=p;for(var i in f)f[i].disabled=k.checked;for(i=0;i<e.length;i++)e[i].disabled=k.checked;k.onclick=function(){if(k.checked==!0){var b=new Date(a.start_date),c=new Date(a.end_date);scheduler.date.date_part(b);c=scheduler.date.add(b,1,"day")}var h=b||a.start_date,i=c||a.end_date;d(e[0],h);d(e[1],i);f[0].value=h.getHours()*60+h.getMinutes();f[1].value=i.getHours()*60+i.getMinutes();for(var j in f)f[j].disabled=
k.checked;for(j=0;j<e.length;j++)e[j].disabled=k.checked}}if(scheduler.config.event_duration&&scheduler.config.auto_end_date){var o=function(){a.start_date=scheduler.date.add(e[0]._date,f[0].value,"minute");a.end_date.setTime(a.start_date.getTime()+scheduler.config.event_duration*6E4);e[1].value=scheduler.templates.calendar_time(a.end_date);e[1]._date=scheduler.date.date_part(new Date(a.end_date));f[1].value=a.end_date.getHours()*60+a.end_date.getMinutes()};f[0].onchange=o}d(e[0],a.start_date,0);
d(e[1],a.end_date,1);n=function(){};f[0].value=a.start_date.getHours()*60+a.start_date.getMinutes();f[1].value=a.end_date.getHours()*60+a.end_date.getMinutes()},get_value:function(b,c){var a=b.getElementsByTagName("input"),d=b.getElementsByTagName("select");c.start_date=scheduler.date.add(a[0]._date,d[0].value,"minute");c.end_date=scheduler.date.add(a[1]._date,d[1].value,"minute");if(c.end_date<=c.start_date)c.end_date=scheduler.date.add(c.start_date,scheduler.config.time_step,"minute")},focus:function(){}};
scheduler.linkCalendar=function(b,c){var a=function(){var a=scheduler._date,e=new Date(a.valueOf());c&&(e=c(e));e.setDate(1);scheduler.updateCalendar(b,e);return!0};scheduler.attachEvent("onViewChange",a);scheduler.attachEvent("onXLE",a);scheduler.attachEvent("onEventAdded",a);scheduler.attachEvent("onEventChanged",a);scheduler.attachEvent("onAfterEventDelete",a);a()};
scheduler._markCalendarCurrentDate=function(b){var c=scheduler._date,a=scheduler._mode;if(b._date.getMonth()==c.getMonth()&&b._date.getFullYear()==c.getFullYear())if(a=="day"||this._props&&this._props[a])scheduler.markCalendar(b,c,"dhx_calendar_click");else if(a=="week")for(var d=scheduler.date.week_start(new Date(c.valueOf())),e=0;e<7;e++){var f=d.getMonth()+d.getYear()*12-c.getMonth()-c.getYear()*12;f||scheduler.markCalendar(b,d,"dhx_calendar_click");d=scheduler.date.add(d,1,"day")}};
scheduler.templates.calendar_month=scheduler.date.date_to_str("%F %Y");scheduler.templates.calendar_scale_date=scheduler.date.date_to_str("%D");scheduler.templates.calendar_date=scheduler.date.date_to_str("%d");scheduler.config.minicalendar={mark_events:!0};scheduler._synced_minicalendars=[];
scheduler.renderCalendar=function(a,b,c){var d=null,f=a.date||new Date;typeof f=="string"&&(f=this.templates.api_date(f));if(b)d=this._render_calendar(b.parentNode,f,a,b),scheduler.unmarkCalendar(d);else{var e=a.container,h=a.position;typeof e=="string"&&(e=document.getElementById(e));typeof h=="string"&&(h=document.getElementById(h));if(h&&typeof h.left=="undefined")var k=getOffset(h),h={top:k.top+h.offsetHeight,left:k.left};e||(e=scheduler._get_def_cont(h));d=this._render_calendar(e,f,a);d.onclick=
function(a){var a=a||event,b=a.target||a.srcElement;if(b.className.indexOf("dhx_month_head")!=-1){var c=b.parentNode.className;if(c.indexOf("dhx_after")==-1&&c.indexOf("dhx_before")==-1){var d=scheduler.templates.xml_date(this.getAttribute("date"));d.setDate(parseInt(b.innerHTML,10));scheduler.unmarkCalendar(this);scheduler.markCalendar(this,d,"dhx_calendar_click");this._last_date=d;this.conf.handler&&this.conf.handler.call(scheduler,d,this)}}}}if(scheduler.config.minicalendar.mark_events)for(var j=
scheduler.date.month_start(f),n=scheduler.date.add(j,1,"month"),l=this.getEvents(j,n),s=this["filter_"+this._mode],p=0;p<l.length;p++){var g=l[p];if(!s||s(g.id,g)){var i=g.start_date;i.valueOf()<j.valueOf()&&(i=j);for(i=scheduler.date.date_part(new Date(i.valueOf()));i<g.end_date;)if(this.markCalendar(d,i,"dhx_year_event"),i=this.date.add(i,1,"day"),i.valueOf()>=n.valueOf())break}}this._markCalendarCurrentDate(d);d.conf=a;a.sync&&!c&&this._synced_minicalendars.push(d);return d};
scheduler._get_def_cont=function(a){if(!this._def_count)this._def_count=document.createElement("DIV"),this._def_count.className="dhx_minical_popup",this._def_count.onclick=function(a){(a||event).cancelBubble=!0},document.body.appendChild(this._def_count);this._def_count.style.left=a.left+"px";this._def_count.style.top=a.top+"px";this._def_count._created=new Date;return this._def_count};
scheduler._locateCalendar=function(a,b){var c=a.childNodes[2].childNodes[0];typeof b=="string"&&(b=scheduler.templates.api_date(b));var d=a.week_start+b.getDate()-1;return c.rows[Math.floor(d/7)].cells[d%7].firstChild};scheduler.markCalendar=function(a,b,c){this._locateCalendar(a,b).className+=" "+c};scheduler.unmarkCalendar=function(a,b,c){b=b||a._last_date;c=c||"dhx_calendar_click";if(b){var d=this._locateCalendar(a,b);d.className=(d.className||"").replace(RegExp(c,"g"))}};
scheduler._week_template=function(a){for(var b=a||250,c=0,d=document.createElement("div"),f=this.date.week_start(new Date),e=0;e<7;e++)this._cols[e]=Math.floor(b/(7-e)),this._render_x_header(e,c,f,d),f=this.date.add(f,1,"day"),b-=this._cols[e],c+=this._cols[e];d.lastChild.className+=" dhx_scale_bar_last";return d};scheduler.updateCalendar=function(a,b){a.conf.date=b;this.renderCalendar(a.conf,a,!0)};scheduler._mini_cal_arrows=["&nbsp","&nbsp"];
scheduler._render_calendar=function(a,b,c,d){var f=scheduler.templates,e=this._cols;this._cols=[];var h=this._mode;this._mode="calendar";var k=this._colsS;this._colsS={height:0};var j=new Date(this._min_date),n=new Date(this._max_date),l=new Date(scheduler._date),s=f.month_day;f.month_day=f.calendar_date;var b=this.date.month_start(b),p=this._week_template(a.offsetWidth-1),g;d?g=d:(g=document.createElement("DIV"),g.className="dhx_cal_container dhx_mini_calendar");g.setAttribute("date",this.templates.xml_format(b));
g.innerHTML="<div class='dhx_year_month'></div><div class='dhx_year_week'>"+p.innerHTML+"</div><div class='dhx_year_body'></div>";g.childNodes[0].innerHTML=this.templates.calendar_month(b);if(c.navigation)for(var i=function(a,b){var c=scheduler.date.add(a._date,b,"month");scheduler.updateCalendar(a,c);scheduler._date.getMonth()==a._date.getMonth()&&scheduler._date.getFullYear()==a._date.getFullYear()&&scheduler._markCalendarCurrentDate(a)},w=["dhx_cal_prev_button","dhx_cal_next_button"],x=["left:1px;top:2px;position:absolute;",
"left:auto; right:1px;top:2px;position:absolute;"],y=[-1,1],z=function(a){return function(){if(c.sync)for(var b=scheduler._synced_minicalendars,d=0;d<b.length;d++)i(b[d],a);else i(g,a)}},o=0;o<2;o++){var q=document.createElement("DIV");q.className=w[o];q.style.cssText=x[o];q.innerHTML=this._mini_cal_arrows[o];g.firstChild.appendChild(q);q.onclick=z(y[o])}g._date=new Date(b);g.week_start=(b.getDay()-(this.config.start_on_monday?1:0)+7)%7;var A=this.date.week_start(b);this._reset_month_scale(g.childNodes[2],
b,A);for(var m=g.childNodes[2].firstChild.rows,r=m.length;r<6;r++){var v=m[m.length-1];m[0].parentNode.appendChild(v.cloneNode(!0));for(var t=parseInt(v.childNodes[v.childNodes.length-1].childNodes[0].innerHTML),t=t<10?t:0,u=0;u<m[r].childNodes.length;u++)m[r].childNodes[u].className="dhx_after",m[r].childNodes[u].childNodes[0].innerHTML=scheduler.date.to_fixed(++t)}d||a.appendChild(g);g.childNodes[1].style.height=g.childNodes[1].childNodes[0].offsetHeight-1+"px";this._cols=e;this._mode=h;this._colsS=
k;this._min_date=j;this._max_date=n;scheduler._date=l;f.month_day=s;return g};scheduler.destroyCalendar=function(a,b){if(!a&&this._def_count&&this._def_count.firstChild&&(b||(new Date).valueOf()-this._def_count._created.valueOf()>500))a=this._def_count.firstChild;if(a&&(a.onclick=null,a.innerHTML="",a.parentNode&&a.parentNode.removeChild(a),this._def_count))this._def_count.style.top="-1000px"};
scheduler.isCalendarVisible=function(){return this._def_count&&parseInt(this._def_count.style.top,10)>0?this._def_count:!1};scheduler.attachEvent("onTemplatesReady",function(){dhtmlxEvent(document.body,"click",function(){scheduler.destroyCalendar()})});scheduler.templates.calendar_time=scheduler.date.date_to_str("%d-%m-%Y");
scheduler.form_blocks.calendar_time={render:function(){var a="<input class='dhx_readonly' type='text' readonly='true'>",b=scheduler.config,c=this.date.date_part(new Date),d=1440,f=0;b.limit_time_select&&(f=60*b.first_hour,d=60*b.last_hour+1);c.setHours(f/60);a+=" <select>";for(var e=f;e<d;e+=this.config.time_step*1){var h=this.templates.time_picker(c);a+="<option value='"+e+"'>"+h+"</option>";c=this.date.add(c,this.config.time_step,"minute")}a+="</select>";var k=scheduler.config.full_day;return"<div style='height:30px;padding-top:0; font-size:inherit;' class='dhx_section_time'>"+
a+"<span style='font-weight:normal; font-size:10pt;'> &nbsp;&ndash;&nbsp; </span>"+a+"</div>"},set_value:function(a,b,c){function d(a,b,c){h(a,b,c);a.value=scheduler.templates.calendar_time(b);a._date=scheduler.date.date_part(new Date(b))}var f=a.getElementsByTagName("input"),e=a.getElementsByTagName("select"),h=function(a,b,c){a.onclick=function(){scheduler.destroyCalendar(null,!0);scheduler.renderCalendar({position:a,date:new Date(this._date),navigation:!0,handler:function(b){a.value=scheduler.templates.calendar_time(b);
a._date=new Date(b);scheduler.destroyCalendar();scheduler.config.event_duration&&scheduler.config.auto_end_date&&c==0&&l()}})}};if(scheduler.config.full_day){if(!a._full_day){var k="<label class='dhx_fullday'><input type='checkbox' name='full_day' value='true'> "+scheduler.locale.labels.full_day+"&nbsp;</label></input>";scheduler.config.wide_form||(k=a.previousSibling.innerHTML+k);a.previousSibling.innerHTML=k;a._full_day=!0}var j=a.previousSibling.getElementsByTagName("input")[0],n=scheduler.date.time_part(c.start_date)==
0&&scheduler.date.time_part(c.end_date)==0;j.checked=n;e[0].disabled=j.checked;e[1].disabled=j.checked;j.onclick=function(){if(j.checked==!0){var b={};scheduler.form_blocks.calendar_time.get_value(a,b);var h=scheduler.date.date_part(b.start_date),g=scheduler.date.date_part(b.end_date);if(+g==+h||+g>=+h&&(c.end_date.getHours()!=0||c.end_date.getMinutes()!=0))g=scheduler.date.add(g,1,"day")}var i=h||c.start_date,k=g||c.end_date;d(f[0],i);d(f[1],k);e[0].value=i.getHours()*60+i.getMinutes();e[1].value=
k.getHours()*60+k.getMinutes();e[0].disabled=j.checked;e[1].disabled=j.checked}}if(scheduler.config.event_duration&&scheduler.config.auto_end_date){var l=function(){start_date=scheduler.date.add(f[0]._date,e[0].value,"minute");end_date=new Date(start_date.getTime()+scheduler.config.event_duration*6E4);f[1].value=scheduler.templates.calendar_time(end_date);f[1]._date=scheduler.date.date_part(new Date(end_date));e[1].value=end_date.getHours()*60+end_date.getMinutes()};e[0].onchange=l}d(f[0],c.start_date,
0);d(f[1],c.end_date,1);h=function(){};e[0].value=c.start_date.getHours()*60+c.start_date.getMinutes();e[1].value=c.end_date.getHours()*60+c.end_date.getMinutes()},get_value:function(a,b){var c=a.getElementsByTagName("input"),d=a.getElementsByTagName("select");b.start_date=scheduler.date.add(c[0]._date,d[0].value,"minute");b.end_date=scheduler.date.add(c[1]._date,d[1].value,"minute");if(b.end_date<=b.start_date)b.end_date=scheduler.date.add(b.start_date,scheduler.config.time_step,"minute")},focus:function(){}};
scheduler.linkCalendar=function(a,b){var c=function(){var c=scheduler._date,f=new Date(c.valueOf());b&&(f=b(f));f.setDate(1);scheduler.updateCalendar(a,f);return!0};scheduler.attachEvent("onViewChange",c);scheduler.attachEvent("onXLE",c);scheduler.attachEvent("onEventAdded",c);scheduler.attachEvent("onEventChanged",c);scheduler.attachEvent("onAfterEventDelete",c);c()};
scheduler._markCalendarCurrentDate=function(a){var b=scheduler._date,c=scheduler._mode,d=scheduler.date.month_start(new Date(a._date)),f=scheduler.date.add(d,1,"month");if(c=="day"||this._props&&this._props[c])d.valueOf()<=b.valueOf()&&f>b&&scheduler.markCalendar(a,b,"dhx_calendar_click");else if(c=="week")for(var e=scheduler.date.week_start(new Date(b.valueOf())),h=0;h<7;h++)d.valueOf()<=e.valueOf()&&f>e&&scheduler.markCalendar(a,e,"dhx_calendar_click"),e=scheduler.date.add(e,1,"day")};
scheduler.attachEvent("onEventCancel",function(){scheduler.destroyCalendar(null,!0)});

View File

@ -1,7 +1,7 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
scheduler.form_blocks.multiselect={render:function(d){for(var a="<div class='dhx_multi_select_"+d.name+"' style='overflow: auto; height: "+d.height+"px; position: relative;' >",b=0;b<d.options.length;b++)a+="<label><input type='checkbox' value='"+d.options[b].key+"'/>"+d.options[b].label+"</label>",convertStringToBoolean(d.vertical)&&(a+="<br/>");a+="</div>";return a},set_value:function(d,a,b,c){function h(b){for(var c=d.getElementsByTagName("input"),a=0;a<c.length;a++)c[a].checked=!!b[c[a].value]}
for(var f=d.getElementsByTagName("input"),e=0;e<f.length;e++)f[e].checked=!1;if(!scheduler._new_event)if(f=[],b[c.map_to]){for(var i=b[c.map_to].split(","),e=0;e<i.length;e++)f[i[e]]=!0;h(f)}else{var g=document.createElement("div");g.className="dhx_loading";g.style.cssText="position: absolute; top: 40%; left: 40%;";d.appendChild(g);dhtmlxAjax.get(c.script_url+"?dhx_crosslink_"+c.map_to+"="+b.id+"&uid="+scheduler.uid(),function(b){for(var a=b.doXPath("//data/item"),e=[],f=0;f<a.length;f++)e[a[f].getAttribute(c.map_to)]=
for(var f=d.getElementsByTagName("input"),e=0;e<f.length;e++)f[e].checked=!1;f=[];if(b[c.map_to]){for(var i=b[c.map_to].split(","),e=0;e<i.length;e++)f[i[e]]=!0;h(f)}else if(!scheduler._new_event&&c.script_url){var g=document.createElement("div");g.className="dhx_loading";g.style.cssText="position: absolute; top: 40%; left: 40%;";d.appendChild(g);dhtmlxAjax.get(c.script_url+"?dhx_crosslink_"+c.map_to+"="+b.id+"&uid="+scheduler.uid(),function(b){for(var a=b.doXPath("//data/item"),e=[],f=0;f<a.length;f++)e[a[f].getAttribute(c.map_to)]=
!0;h(e);d.removeChild(g)})}},get_value:function(d){for(var a=[],b=d.getElementsByTagName("input"),c=0;c<b.length;c++)b[c].checked&&a.push(b[c].value);return a.join(",")},focus:function(){}};

View File

@ -1,5 +1,5 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
(function(){function e(a){var b=function(){};b.prototype=a;return b}var d=scheduler._load;scheduler._load=function(a,b){a=a||this._load_url;if(typeof a=="object")for(var f=e(this._loaded),c=0;c<a.length;c++)this._loaded=new f,d.call(this,a[c],b);else d.apply(this,arguments)}})();

View File

@ -1,9 +1,8 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
scheduler._extra_xle=!1;scheduler.attachEvent("onXLE",function(){if(!scheduler._extra_xle){var a=!1,c;for(c in scheduler._events)if(scheduler._events[c].text){a=!0;break}if((localStorage._updated_events||!a)&&localStorage._events){scheduler._extra_xle=!0;scheduler.parse(localStorage._events,"json");scheduler._extra_xle=!1;var b=scheduler._dataprocessor,e=JSON.parse(localStorage._updated_events);b.setUpdateMode("off");for(var d in e)b.setUpdated(d,!0,e[d]);b.sendData();b.setUpdateMode("cell")}}});
scheduler.attachEvent("onBeforeEventDelete",function(a){var c=scheduler._dataprocessor.getState(a);if(c=="inserted"&&localStorage._updated_events){var b=JSON.parse(localStorage._updated_events);delete b[a];for(a in b){localStorage._updated_events=JSON.stringify(b);break}}return!0});var old_delete_event=scheduler.deleteEvent;scheduler.deleteEvent=function(a,c){old_delete_event.apply(this,arguments);localStorage._events=scheduler.toJSON()};scheduler._offline={};
scheduler._offline._after_update_events=[];var old_dp_init=scheduler._dp_init;
scheduler._dp_init=function(a){old_dp_init.apply(this,arguments);a.attachEvent("onAfterUpdate",function(c){scheduler._offline._after_update_events.push(c);return!0});a.attachEvent("onAfterUpdateFinish",function(){localStorage._events=scheduler.toJSON();for(var c=JSON.parse(localStorage._updated_events),b=0;b<scheduler._offline._after_update_events.length;b++)delete c[scheduler._offline._after_update_events[b]];var a=!1,d;for(d in c){a=!0;break}a?(localStorage._updated_events=JSON.stringify(c),scheduler._offline._after_update_event=
[]):delete localStorage._updated_events;return!0});a.attachEvent("onBeforeDataSending",function(a,b,e){var d={};localStorage._updated_events&&(d=JSON.parse(localStorage._updated_events));for(var f in e){var g=scheduler._dataprocessor.action_param;if(d[f]&&(d[f][g]=="inserted"||e[f][g]=="deleted")||!d[f])d[f]=e[f][g]}localStorage._events=scheduler.toJSON();localStorage._updated_events=JSON.stringify(d);return!0});dhtmlxError.catchError("LoadXML",function(){for(var a in scheduler._dataprocessor._in_progress)delete scheduler._dataprocessor._in_progress[a]})};
scheduler.load=function(a,c,b){if(typeof c=="string")var f=this._process=c,c=b;this._load_url=a;this._after_call=c;a.$proxy?a.load(this,typeof f=="string"?f:null):this._load(a,this._date)};scheduler._dp_init_backup=scheduler._dp_init;
scheduler._dp_init=function(a){a._sendData=function(c,b){if(c){if(!this.callEvent("onBeforeDataSending",b?[b,this.getState(b),c]:[null,null,c]))return!1;b&&(this._in_progress[b]=(new Date).valueOf());if(this.serverProcessor.$proxy){var a=this._tMode!="POST"?"get":"post",d=[],e;for(e in c)d.push({id:e,data:c[e],operation:this.getState(e)});this.serverProcessor._send(d,a,this)}else{var h=new dtmlXMLLoaderObject(this.afterUpdate,this,!0),g=this.serverProcessor+(this._user?getUrlSymbol(this.serverProcessor)+
["dhx_user="+this._user,"dhx_version="+this.obj.getUserData(0,"version")].join("&"):"");this._tMode!="POST"?h.loadXML(g+(g.indexOf("?")!=-1?"&":"?")+this.serialize(c,b)):h.loadXML(g,!0,this.serialize(c,b));this._waitMode++}}};a._updatesToParams=function(c){for(var b={},a=0;a<c.length;a++)b[c[a].id]=c[a].data;return this.serialize(b)};a._processResult=function(a,b,f){if(f.status!=200)for(var d in this._in_progress){var e=this.getState(d);this.afterUpdateCallback(d,d,e,null)}else b=new dtmlXMLLoaderObject(function(){},
this,!0),b.loadXMLString(a),b.xmlDoc=f,this.afterUpdate(this,null,null,null,b)};this._dp_init_backup(a)};if(window.dataProcessor)dataProcessor.prototype.init=function(a){this.init_original(a);a._dataprocessor=this;this.setTransactionMode("POST",!0);this.serverProcessor.$proxy||(this.serverProcessor+=(this.serverProcessor.indexOf("?")!=-1?"&":"?")+"editing=true")};

View File

@ -1,6 +1,6 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
scheduler.attachEvent("onTemplatesReady",function(){var a=new dhtmlDragAndDropObject,g=a.stopDrag,b;a.stopDrag=function(d){b=d||event;return g.apply(this,arguments)};a.addDragLanding(scheduler._els.dhx_cal_data[0],{_drag:function(d){var a=scheduler.attachEvent("onEventCreated",function(a,b){if(!scheduler.callEvent("onExternalDragIn",[a,d,b]))this._drag_mode=this._drag_id=null,this.deleteEvent(a)});if(scheduler.matrix&&scheduler.matrix[scheduler._mode])scheduler.dblclick_dhx_matrix_cell(b);else{var f=
document.createElement("div");f.className="dhx_month_body";var c={},e;for(e in b)c[e]=b[e];c.target=c.srcElement=f;scheduler._on_dbl_click(c)}scheduler.detachEvent(a)},_dragIn:function(a){return a},_dragOut:function(){return this}})});
scheduler.attachEvent("onTemplatesReady",function(){var a=new dhtmlDragAndDropObject,e=a.stopDrag,b;a.stopDrag=function(c){b=c||event;return e.apply(this,arguments)};a.addDragLanding(scheduler._els.dhx_cal_data[0],{_drag:function(c,a,e,h){if(!scheduler.checkEvent("onBeforeExternalDragIn")||scheduler.callEvent("onBeforeExternalDragIn",[c,a,e,h,b])){var i=scheduler.attachEvent("onEventCreated",function(a,b){if(!scheduler.callEvent("onExternalDragIn",[a,c,b]))this._drag_mode=this._drag_id=null,this.deleteEvent(a)});
if(scheduler.matrix&&scheduler.matrix[scheduler._mode])scheduler.dblclick_dhx_matrix_cell(b);else{var g=document.createElement("div");g.className="dhx_month_body";var d={},f;for(f in b)d[f]=b[f];d.target=d.srcElement=g;scheduler._on_dbl_click(d)}scheduler.detachEvent(i)}},_dragIn:function(a){return a},_dragOut:function(){return this}})});

View File

@ -1,14 +1,17 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
scheduler.toPDF=function(x,f,m,n){function g(c){return c.replace(html_regexp,"")}function j(c){c=parseFloat(c);return isNaN(c)?"auto":100*c/(o+1)}function t(c){c=parseFloat(c);return isNaN(c)?"auto":100*c/k}function q(c){var a="";if(scheduler.matrix&&scheduler.matrix[scheduler._mode])c=c[0].childNodes;for(var b=0;b<c.length;b++)a+="\n<column><![CDATA["+g(c[b].innerHTML)+"]]\></column>";o=c[0].offsetWidth;return a}function y(c,a){for(var b=parseInt(c.style.left),d=0;d<scheduler._cols.length;d++)if(b-=
scheduler._cols[d],b<0)return d;return a}function z(c,a){for(var b=parseInt(c.style.top),d=0;d<scheduler._colsS.heights.length;d++)if(scheduler._colsS.heights[d]>b)return d;return a}function w(c){for(var a="",b=c.firstChild.rows,d=0;d<b.length;d++){for(var e=[],h=0;h<b[d].cells.length;h++)e.push(b[d].cells[h].firstChild.innerHTML);a+="\n<row height='"+c.firstChild.rows[d].cells[0].offsetHeight+"'><![CDATA["+g(e.join("|"))+"]]\></row>";k=c.firstChild.rows[0].cells[0].offsetHeight}return a}function A(c){var a=
"<data profile='"+c+"'";m&&(a+=" header='"+m+"'");n&&(a+=" footer='"+n+"'");a+=">";a+="<scale mode='"+scheduler._mode+"' today='"+scheduler._els.dhx_cal_date[0].innerHTML+"'>";if(scheduler._mode=="agenda"){var b=scheduler._els.dhx_cal_header[0].childNodes[0].childNodes;a+="<column>"+g(b[0].innerHTML)+"</column><column>"+g(b[1].innerHTML)+"</column>"}else if(scheduler._mode=="year")for(var b=scheduler._els.dhx_cal_data[0].childNodes,d=0;d<b.length;d++)a+="<month label='"+g(b[d].childNodes[0].innerHTML)+
"'>",a+=q(b[d].childNodes[1].childNodes),a+=w(b[d].childNodes[2]),a+="</month>";else{a+="<x>";b=scheduler._els.dhx_cal_header[0].childNodes;a+=q(b);a+="</x>";var e=scheduler._els.dhx_cal_data[0];if(scheduler.matrix&&scheduler.matrix[scheduler._mode]){a+="<y>";for(d=0;d<e.firstChild.rows.length;d++)a+="<row><![CDATA["+e.firstChild.rows[d].cells[0].innerHTML+"]]\></row>";a+="</y>";k=e.firstChild.rows[0].cells[0].offsetHeight}else if(e.firstChild.tagName=="TABLE")a+=w(e);else{for(e=e.childNodes[e.childNodes.length-
1];e.className.indexOf("dhx_scale_holder")==-1;)e=e.previousSibling;e=e.childNodes;a+="<y>";for(d=0;d<e.length;d++)a+="\n<row><![CDATA["+g(e[d].innerHTML)+"]]\></row>";a+="</y>";k=e[0].offsetHeight}}a+="</scale>";return a}function r(c,a){return(window.getComputedStyle?window.getComputedStyle(c,null)[a]:c.currentStyle?c.currentStyle[a]:null)||""}function B(){var c="",a=scheduler._rendered;if(scheduler._mode=="agenda")for(var b=0;b<a.length;b++)c+="<event><head>"+g(a[b].childNodes[0].innerHTML)+"</head><body>"+
g(a[b].childNodes[2].innerHTML)+"</body></event>";else if(scheduler._mode=="year"){a=scheduler.get_visible_events();for(b=0;b<a.length;b++){var d=a[b].start_date;if(d.valueOf()<scheduler._min_date.valueOf())d=scheduler._min_date;for(;d<a[b].end_date;){var e=d.getMonth()+12*(d.getFullYear()-scheduler._min_date.getFullYear())-scheduler.week_starts._month,h=scheduler.week_starts[e]+d.getDate()-1;c+="<event day='"+h%7+"' week='"+Math.floor(h/7)+"' month='"+e+"'></event>";d=scheduler.date.add(d,1,"day");
if(d.valueOf()>=scheduler._max_date.valueOf())break}}}else for(b=0;b<a.length;b++){var f=j(a[b].style.left),i=j(a[b].style.width),l=t(a[b].style.top),m=t(a[b].style.height),n=a[b].className.split(" ")[0].replace("dhx_cal_",""),o=scheduler.getEvent(a[b].getAttribute("event_id")),h=o._sday,s=o._sweek;if(scheduler._mode!="month"){if(scheduler.matrix&&scheduler.matrix[scheduler._mode])h=0,s=a[b].parentNode.parentNode.parentNode.rowIndex,i+=j(10);else{i+=j(i*20/100);f-=j(20-f*20/100);if(a[b].parentNode==
scheduler._els.dhx_cal_data[0])continue;f+=j(a[b].parentNode.style.left);f-=j(51)}if(scheduler._mode=="timeline"){var q=k;k=180;l=t(a[b].style.top);k=q}}else m=parseInt(a[b].offsetHeight),l=parseInt(a[b].style.top)-22,h=y(a[b],h),s=z(a[b],s);c+="\n<event week='"+s+"' day='"+h+"' type='"+n+"' x='"+f+"' y='"+l+"' width='"+i+"' height='"+m+"'>";if(n=="event"){c+="<header><![CDATA["+g(a[b].childNodes[1].innerHTML)+"]]\></header>";var u=p?r(a[b].childNodes[2],"color"):"",v=p?r(a[b].childNodes[2],"backgroundColor"):
"";c+="<body backgroundColor='"+v+"' color='"+u+"'><![CDATA["+g(a[b].childNodes[2].innerHTML)+"]]\></body>"}else u=p?r(a[b],"color"):"",v=p?r(a[b],"backgroundColor"):"",c+="<body backgroundColor='"+v+"' color='"+u+"'><![CDATA["+g(a[b].innerHTML)+"]]\></body>";c+="</event>"}return c}function C(){var c="</data>";return c}var o=0,k=0,p=!1;f=="fullcolor"&&(p=!0,f="color");f=f||"color";html_regexp=RegExp("<[^>]*>","g");var l=(new Date).valueOf(),i=document.createElement("div");i.style.display="none";document.body.appendChild(i);
i.innerHTML='<form id="'+l+'" method="post" target="_blank" action="'+x+'" accept-charset="utf-8" enctype="application/x-www-form-urlencoded"><input type="hidden" name="mycoolxmlbody"/> </form>';document.getElementById(l).firstChild.value=A(f).replace("\u2013","-")+B()+C();document.getElementById(l).submit();i.parentNode.removeChild(i);grid=null};
scheduler.toPDF=function(A,k,t,u){function g(d){return d.replace(newline_regexp,"\n").replace(html_regexp,"")}function m(d){d=parseFloat(d);return isNaN(d)?"auto":100*d/(q+1)}function x(d){d=parseFloat(d);return isNaN(d)?"auto":100*d/n}function v(d){var a="";if(scheduler.matrix&&scheduler.matrix[scheduler._mode]){if(scheduler.matrix[scheduler._mode].second_scale)var b=d[1].childNodes;d=d[0].childNodes}for(var c=0;c<d.length;c++)a+="\n<column><![CDATA["+g(d[c].innerHTML)+"]]\></column>";q=d[0].offsetWidth;
if(b)for(var f=0,e=d[0].offsetWidth,h=1,c=0;c<b.length;c++)a+="\n<column second_scale='"+h+"'><![CDATA["+g(b[c].innerHTML)+"]]\></column>",f+=b[c].offsetWidth,f>=e&&(e+=d[h]?d[h].offsetWidth:0,h++),q=b[0].offsetWidth;return a}function B(d,a){for(var b=parseInt(d.style.left,10),c=0;c<scheduler._cols.length;c++)if(b-=scheduler._cols[c],b<0)return c;return a}function C(d,a){for(var b=parseInt(d.style.top,10),c=0;c<scheduler._colsS.heights.length;c++)if(scheduler._colsS.heights[c]>b)return c;return a}
function z(d){for(var a="",b=d.firstChild.rows,c=0;c<b.length;c++){for(var f=[],e=0;e<b[c].cells.length;e++)f.push(b[c].cells[e].firstChild.innerHTML);a+="\n<row height='"+d.firstChild.rows[c].cells[0].offsetHeight+"'><![CDATA["+g(f.join("|"))+"]]\></row>";n=d.firstChild.rows[0].cells[0].offsetHeight}return a}function D(d){var a="<data profile='"+d+"'";t&&(a+=" header='"+t+"'");u&&(a+=" footer='"+u+"'");a+=">";var b=scheduler._mode;scheduler.matrix&&scheduler.matrix[scheduler._mode]&&(b=scheduler.matrix[scheduler._mode].render==
"cell"?"matrix":"timeline");a+="<scale mode='"+b+"' today='"+scheduler._els.dhx_cal_date[0].innerHTML+"'>";if(scheduler._mode=="week_agenda")for(var c=scheduler._els.dhx_cal_data[0].getElementsByTagName("DIV"),f=0;f<c.length;f++)c[f].className=="dhx_wa_scale_bar"&&(a+="<column>"+g(c[f].innerHTML)+"</column>");else if(scheduler._mode=="agenda"||scheduler._mode=="map")c=scheduler._els.dhx_cal_header[0].childNodes[0].childNodes,a+="<column>"+g(c[0].innerHTML)+"</column><column>"+g(c[1].innerHTML)+"</column>";
else if(scheduler._mode=="year"){c=scheduler._els.dhx_cal_data[0].childNodes;for(f=0;f<c.length;f++)a+="<month label='"+g(c[f].childNodes[0].innerHTML)+"'>",a+=v(c[f].childNodes[1].childNodes),a+=z(c[f].childNodes[2]),a+="</month>"}else{a+="<x>";c=scheduler._els.dhx_cal_header[0].childNodes;a+=v(c);a+="</x>";var e=scheduler._els.dhx_cal_data[0];if(scheduler.matrix&&scheduler.matrix[scheduler._mode]){a+="<y>";for(f=0;f<e.firstChild.rows.length;f++){var h=e.firstChild.rows[f];a+="<row><![CDATA["+g(h.cells[0].innerHTML)+
"]]\></row>"}a+="</y>";n=e.firstChild.rows[0].cells[0].offsetHeight}else if(e.firstChild.tagName=="TABLE")a+=z(e);else{for(e=e.childNodes[e.childNodes.length-1];e.className.indexOf("dhx_scale_holder")==-1;)e=e.previousSibling;e=e.childNodes;a+="<y>";for(f=0;f<e.length;f++)a+="\n<row><![CDATA["+g(e[f].innerHTML)+"]]\></row>";a+="</y>";n=e[0].offsetHeight}}a+="</scale>";return a}function l(d,a){return(window.getComputedStyle?window.getComputedStyle(d,null)[a]:d.currentStyle?d.currentStyle[a]:null)||
""}function E(){var d="",a=scheduler._rendered;if(scheduler._mode=="agenda"||scheduler._mode=="map")for(var b=0;b<a.length;b++)d+="<event><head>"+g(a[b].childNodes[0].innerHTML)+"</head><body>"+g(a[b].childNodes[2].innerHTML)+"</body></event>";else if(scheduler._mode=="week_agenda")for(b=0;b<a.length;b++)d+="<event day='"+a[b].parentNode.getAttribute("day")+"'><body>"+g(a[b].innerHTML)+"</body></event>";else if(scheduler._mode=="year"){a=scheduler.get_visible_events();for(b=0;b<a.length;b++){var c=
a[b].start_date;if(c.valueOf()<scheduler._min_date.valueOf())c=scheduler._min_date;for(;c<a[b].end_date;){var f=c.getMonth()+12*(c.getFullYear()-scheduler._min_date.getFullYear())-scheduler.week_starts._month,e=scheduler.week_starts[f]+c.getDate()-1,h=j?l(scheduler._get_year_cell(c),"color"):"",o=j?l(scheduler._get_year_cell(c),"backgroundColor"):"";d+="<event day='"+e%7+"' week='"+Math.floor(e/7)+"' month='"+f+"' backgroundColor='"+o+"' color='"+h+"'></event>";c=scheduler.date.add(c,1,"day");if(c.valueOf()>=
scheduler._max_date.valueOf())break}}}else{var k=scheduler.matrix&&scheduler.matrix[scheduler._mode];if(k&&k.render=="cell"){a=scheduler._els.dhx_cal_data[0].getElementsByTagName("TD");for(b=0;b<a.length;b++)h=j?l(a[b],"color"):"",o=j?l(a[b],"backgroundColor"):"",d+="\n<event><body backgroundColor='"+o+"' color='"+h+"'><![CDATA["+g(a[b].innerHTML)+"]]\></body></event>"}else for(b=0;b<a.length;b++){var i=m(a[b].style.left),r=m(a[b].style.width);if(!isNaN(r*1)){var s=x(a[b].style.top),q=x(a[b].style.height),
p=a[b].className.split(" ")[0].replace("dhx_cal_","");if(p!=="dhx_tooltip_line"){var y=scheduler.getEvent(a[b].getAttribute("event_id")),e=y._sday,w=y._sweek,t=y._length||0;if(scheduler._mode!="month"){if(scheduler.matrix&&scheduler.matrix[scheduler._mode]){var e=0,u=a[b].parentNode.parentNode.parentNode,w=u.rowIndex;r+=m(10)}else{scheduler.xy.menu_width&&(r+=m(r*20/100),i-=m(15-i*20/100));if(a[b].parentNode==scheduler._els.dhx_cal_data[0])continue;i+=m(a[b].parentNode.style.left);i-=m(51)}if(scheduler.matrix&&
scheduler.matrix[scheduler._mode]){var v=n;n=a[b].parentNode.offsetHeight;s=x(a[b].style.top);s-=s*0.2;n=v}}else q=parseInt(a[b].offsetHeight,10),s=parseInt(a[b].style.top,10)-22,e=B(a[b],e),w=C(a[b],w);d+="\n<event week='"+w+"' day='"+e+"' type='"+p+"' x='"+i+"' y='"+s+"' width='"+r+"' height='"+q+"' len='"+t+"'>";p=="event"?(d+="<header><![CDATA["+g(a[b].childNodes[1].innerHTML)+"]]\></header>",h=j?l(a[b].childNodes[2],"color"):"",o=j?l(a[b].childNodes[2],"backgroundColor"):"",d+="<body backgroundColor='"+
o+"' color='"+h+"'><![CDATA["+g(a[b].childNodes[2].innerHTML)+"]]\></body>"):(h=j?l(a[b],"color"):"",o=j?l(a[b],"backgroundColor"):"",d+="<body backgroundColor='"+o+"' color='"+h+"'><![CDATA["+g(a[b].innerHTML)+"]]\></body>");d+="</event>"}}}}return d}function F(){var d="</data>";return d}var q=0,n=0,j=!1;k=="fullcolor"&&(j=!0,k="color");k=k||"color";html_regexp=RegExp("<[^>]*>","g");newline_regexp=RegExp("<br[^>]*>","g");var p=(new Date).valueOf(),i=document.createElement("div");i.style.display=
"none";document.body.appendChild(i);i.innerHTML='<form id="'+p+'" method="post" target="_blank" action="'+A+'" accept-charset="utf-8" enctype="application/x-www-form-urlencoded"><input type="hidden" name="mycoolxmlbody"/> </form>';document.getElementById(p).firstChild.value=encodeURIComponent(D(k).replace("\u2013","-")+E()+F());document.getElementById(p).submit();i.parentNode.removeChild(i);grid=null};

View File

@ -1,9 +1,9 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
scheduler.attachEvent("onTemplatesReady",function(){function h(d,b,c,f){for(var e=b.getElementsByTagName(d),a=c.getElementsByTagName(d),g=a.length-1;g>=0;g--)if(c=a[g],f){var i=document.createElement("SPAN");i.className="dhx_text_disabled";i.innerHTML=f(e[g]);c.parentNode.insertBefore(i,c);c.parentNode.removeChild(c)}else c.disabled=!0}scheduler.attachEvent("onBeforeLightbox",function(d){if(this.config.readonly_form||this.getEvent(d).readonly)this.config.readonly_active=!0;else return this.config.readonly_active=
!1,!0;for(var b=0;b<this.config.lightbox.sections.length;b++)this.config.lightbox.sections[b].focus=!1;return!0});var k=scheduler._fill_lightbox;scheduler._fill_lightbox=function(){var d=this.config.lightbox.sections;if(this.config.readonly_active)for(var b=0;b<d.length;b++)if(d[b].type=="recurring"){var c=document.getElementById(d[b].id);c.style.display=c.nextSibling.style.display="none";d.splice(b,1);b--}var f=k.apply(this,arguments);if(this.config.readonly_active){var e=this._get_lightbox(),a=
this._lightbox_r=e.cloneNode(!0);a.id=scheduler.uid();a.style.color="red";h("textarea",e,a,function(a){return a.value});h("input",e,a,!1);h("select",e,a,function(a){return a.options[Math.max(a.selectedIndex||0,0)].text});a.removeChild(a.childNodes[2]);a.removeChild(a.childNodes[3]);e.parentNode.insertBefore(a,e);j.call(this,a);scheduler._lightbox&&scheduler._lightbox.parentNode.removeChild(scheduler._lightbox);this._lightbox=a;this.setLightboxSize();this._lightbox=null;a.onclick=function(a){var b=
a?a.target:event.srcElement;if(!b.className)b=b.previousSibling;if(b&&b.className)switch(b.className){case "dhx_cancel_btn":scheduler.callEvent("onEventCancel",[scheduler._lightbox_id]),scheduler._edit_stop_event(scheduler.getEvent(scheduler._lightbox_id),!1),scheduler.hide_lightbox()}}}return f};var j=scheduler.showCover;scheduler.showCover=function(){this.config.readonly_active||j.apply(this,arguments)};var l=scheduler.hide_lightbox;scheduler.hide_lightbox=function(){if(this._lightbox_r)this._lightbox_r.parentNode.removeChild(this._lightbox_r),
this._lightbox_r=null;return l.apply(this,arguments)}});
scheduler.attachEvent("onTemplatesReady",function(){function c(e,b,a,h){for(var i=b.getElementsByTagName(e),g=a.getElementsByTagName(e),f=g.length-1;f>=0;f--)if(a=g[f],h){var d=document.createElement("SPAN");d.className="dhx_text_disabled";d.innerHTML=h(i[f]);a.parentNode.insertBefore(d,a);a.parentNode.removeChild(a)}else a.disabled=!0}var r=scheduler.config.lightbox.sections,k=null,n=scheduler.config.buttons_left.slice(),o=scheduler.config.buttons_right.slice();scheduler.attachEvent("onBeforeLightbox",
function(e){if(this.config.readonly_form||this.getEvent(e).readonly){this.config.readonly_active=!0;for(var b=0;b<this.config.lightbox.sections.length;b++)this.config.lightbox.sections[b].focus=!1}else this.config.readonly_active=!1,scheduler.config.buttons_left=n.slice(),scheduler.config.buttons_right=o.slice();var a=this.config.lightbox.sections;if(this.config.readonly_active){for(var h=!1,b=0;b<a.length;b++)if(a[b].type=="recurring"){k=a[b];this.config.readonly_active&&a.splice(b,1);break}!h&&
!this.config.readonly_active&&k&&a.splice(a.length-2,0,k);for(var i=["dhx_delete_btn","dhx_save_btn"],g=[scheduler.config.buttons_left,scheduler.config.buttons_right],b=0;b<i.length;b++)for(var f=i[b],d=0;d<g.length;d++){for(var c=g[d],l=-1,j=0;j<c.length;j++)if(c[j]==f){l=j;break}l!=-1&&c.splice(l,1)}}this.resetLightbox();return!0});var p=scheduler._fill_lightbox;scheduler._fill_lightbox=function(){var e=p.apply(this,arguments);if(this.config.readonly_active){var b=this.getLightbox(),a=this._lightbox_r=
b.cloneNode(!0);a.id=scheduler.uid();c("textarea",b,a,function(a){return a.value});c("input",b,a,!1);c("select",b,a,function(a){return a.options[Math.max(a.selectedIndex||0,0)].text});b.parentNode.insertBefore(a,b);m.call(this,a);scheduler._lightbox&&scheduler._lightbox.parentNode.removeChild(scheduler._lightbox);this._lightbox=a;this.setLightboxSize();this._lightbox=null;a.onclick=function(a){var b=a?a.target:event.srcElement;if(!b.className)b=b.previousSibling;if(b&&b.className)switch(b.className){case "dhx_cancel_btn":scheduler.callEvent("onEventCancel",
[scheduler._lightbox_id]),scheduler._edit_stop_event(scheduler.getEvent(scheduler._lightbox_id),!1),scheduler.hide_lightbox()}}}return e};var m=scheduler.showCover;scheduler.showCover=function(){this.config.readonly_active||m.apply(this,arguments)};var q=scheduler.hide_lightbox;scheduler.hide_lightbox=function(){if(this._lightbox_r)this._lightbox_r.parentNode.removeChild(this._lightbox_r),this._lightbox_r=null;return q.apply(this,arguments)}});

View File

@ -1,35 +1,39 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
scheduler.config.occurrence_timestamp_in_utc=!1;
scheduler.form_blocks.recurring={render:function(){return scheduler.__recurring_template},_ds:{},_init_set_value:function(a,b,c){function d(a){for(var b=0;b<a.length;b++){var c=a[b];c.type=="checkbox"||c.type=="radio"?(g[c.name]||(g[c.name]=[]),g[c.name].push(c)):g[c.name]=c}}function f(a){for(var b=g[a],c=0;c<b.length;c++)if(b[c].checked)return b[c].value}function e(){m("dhx_repeat_day").style.display="none";m("dhx_repeat_week").style.display="none";m("dhx_repeat_month").style.display="none";m("dhx_repeat_year").style.display=
"none";m("dhx_repeat_"+this.value).style.display="block"}function h(a){var b=[f("repeat")];for(p[b[0]](b,a);b.length<5;)b.push("");var c="";if(g.end[0].checked)a.end=new Date(9999,1,1),c="no";else if(g.end[2].checked)a.end=i(g.date_of_end.value);else{scheduler.transpose_type(b.join("_"));var c=Math.max(1,g.occurences_count.value),e=b[0]=="week"&&b[4]&&b[4].toString().indexOf(scheduler.config.start_on_monday?1:0)==-1?1:0;a.end=scheduler.date.add(new Date(a.start),c+e,b.join("_"))}return b.join("_")+
"#"+c}function j(a,b){var c=a.split("#"),a=c[0].split("_");q[a[0]](a,b);var e=g.repeat[{day:0,week:1,month:2,year:3}[a[0]]];switch(c[1]){case "no":g.end[0].checked=!0;break;case "":g.end[2].checked=!0;g.date_of_end.value=k(b.end);break;default:g.end[1].checked=!0,g.occurences_count.value=c[1]}e.checked=!0;e.onclick()}scheduler.form_blocks.recurring._ds={start:c.start_date,end:c._end_date};var i=scheduler.date.str_to_date(scheduler.config.repeat_date),k=scheduler.date.date_to_str(scheduler.config.repeat_date),
l=a.getElementsByTagName("FORM")[0],g=[];d(l.getElementsByTagName("INPUT"));d(l.getElementsByTagName("SELECT"));var m=function(a){return document.getElementById(a)};scheduler.form_blocks.recurring._get_repeat_code=h;var p={month:function(a,b){f("month_type")=="d"?(a.push(Math.max(1,g.month_count.value)),b.start.setDate(g.month_day.value)):(a.push(Math.max(1,g.month_count2.value)),a.push(g.month_day2.value),a.push(Math.max(1,g.month_week2.value)),b.start.setDate(1));b._start=!0},week:function(a,b){a.push(Math.max(1,
g.week_count.value));a.push("");a.push("");for(var c=[],e=g.week_day,d=0;d<e.length;d++)e[d].checked&&c.push(e[d].value);c.length||c.push(b.start.getDay());b.start=scheduler.date.week_start(b.start);b._start=!0;a.push(c.sort().join(","))},day:function(a){f("day_type")=="d"?a.push(Math.max(1,g.day_count.value)):(a.push("week"),a.push(1),a.push(""),a.push(""),a.push("1,2,3,4,5"),a.splice(0,1))},year:function(a,b){f("year_type")=="d"?(a.push("1"),b.start.setMonth(0),b.start.setDate(g.year_day.value),
b.start.setMonth(g.year_month.value)):(a.push("1"),a.push(g.year_day2.value),a.push(g.year_week2.value),b.start.setDate(1),b.start.setMonth(g.year_month2.value));b._start=!0}},q={week:function(a){g.week_count.value=a[1];for(var b=g.week_day,c=a[4].split(","),e={},d=0;d<c.length;d++)e[c[d]]=!0;for(d=0;d<b.length;d++)b[d].checked=!!e[b[d].value]},month:function(a,b){a[2]==""?(g.month_type[0].checked=!0,g.month_count.value=a[1],g.month_day.value=b.start.getDate()):(g.month_type[1].checked=!0,g.month_count2.value=
a[1],g.month_week2.value=a[3],g.month_day2.value=a[2])},day:function(a){g.day_type[0].checked=!0;g.day_count.value=a[1]},year:function(a,b){a[2]==""?(g.year_type[0].checked=!0,g.year_day.value=b.start.getDate(),g.year_month.value=b.start.getMonth()):(g.year_type[1].checked=!0,g.year_week2.value=a[3],g.year_day2.value=a[2],g.year_month2.value=b.start.getMonth())}};scheduler.form_blocks.recurring._set_repeat_code=j;for(var n=0;n<l.elements.length;n++){var o=l.elements[n];switch(o.name){case "repeat":o.onclick=
e}}scheduler._lightbox._rec_init_done=!0},set_value:function(a,b,c){var d=scheduler.form_blocks.recurring;scheduler._lightbox._rec_init_done||d._init_set_value(a,b,c);a.open=!c.rec_type;a.blocked=c.event_pid&&c.event_pid!="0"?!0:!1;var f=d._ds;f.start=c.start_date;f.end=c._end_date;d.button_click(0,a.previousSibling.firstChild.firstChild,a,a);b&&d._set_repeat_code(b,f)},get_value:function(a,b){if(a.open){var c=scheduler.form_blocks.recurring._ds;b.rec_type=scheduler.form_blocks.recurring._get_repeat_code(c);
c._start?(b.start_date=new Date(c.start),b._start_date=new Date(c.start),c._start=!1):b._start_date=null;b._end_date=b.end_date=c.end;b.rec_pattern=b.rec_type.split("#")[0]}else b.rec_type=b.rec_pattern="",b._end_date=b.end_date;return b.rec_type},focus:function(){},button_click:function(a,b,c,d){!d.open&&!d.blocked?(d.style.height="115px",b.style.backgroundPosition="-5px 0px",b.nextSibling.innerHTML=scheduler.locale.labels.button_recurring_open):(d.style.height="0px",b.style.backgroundPosition="-5px 20px",
b.nextSibling.innerHTML=scheduler.locale.labels.button_recurring);d.open=!d.open;scheduler.setLightboxSize()}};scheduler._rec_markers={};scheduler._rec_markers_pull={};scheduler._add_rec_marker=function(a,b){a._pid_time=b;this._rec_markers[a.id]=a;this._rec_markers_pull[a.event_pid]||(this._rec_markers_pull[a.event_pid]={});this._rec_markers_pull[a.event_pid][b]=a};scheduler._get_rec_marker=function(a,b){var c=this._rec_markers_pull[b];return c?c[a]:null};
scheduler._get_rec_markers=function(a){return this._rec_markers_pull[a]||[]};scheduler._rec_temp=[];scheduler.attachEvent("onEventLoading",function(a){a.event_pid!=0&&scheduler._add_rec_marker(a,a.event_length*1E3);if(a.rec_type)a.rec_pattern=a.rec_type.split("#")[0];return!0});
scheduler.attachEvent("onEventIdChange",function(a,b){if(!this._ignore_call){this._ignore_call=!0;for(var c=0;c<this._rec_temp.length;c++){var d=this._rec_temp[c];if(d.event_pid==a)d.event_pid=b,this.changeEventId(d.id,b+"#"+d.id.split("#")[1])}delete this._ignore_call}});
scheduler.attachEvent("onBeforeEventDelete",function(a){var b=this.getEvent(a);if(a.toString().indexOf("#")!=-1||b.event_pid&&b.event_pid!="0"&&b.rec_type!="none"){var a=a.split("#"),c=this.uid(),d=a[1]?a[1]:b._pid_time/1E3,f=this._copy_event(b);f.id=c;f.event_pid=b.event_pid||a[0];f.event_length=d;f.rec_type=f.rec_pattern="none";this.addEvent(f);this._add_rec_marker(f,d*1E3)}else{b.rec_type&&this._roll_back_dates(b);var e=this._get_rec_markers(a),h;for(h in e)if(e.hasOwnProperty(h))a=e[h].id,this.getEvent(a)&&
this.deleteEvent(a,!0)}return!0});
scheduler.attachEvent("onEventChanged",function(a){if(this._loading)return!0;var b=this.getEvent(a);if(a.toString().indexOf("#")!=-1){var a=a.split("#"),c=this.uid();this._not_render=!0;var d=this._copy_event(b);d.id=c;d.event_pid=a[0];d.event_length=a[1];d.rec_type=d.rec_pattern="";this.addEvent(d);this._not_render=!1;this._add_rec_marker(d,a[1]*1E3)}else{b.rec_type&&this._roll_back_dates(b);var f=this._get_rec_markers(a),e;for(e in f)f.hasOwnProperty(e)&&(delete this._rec_markers[f[e].id],this.deleteEvent(f[e].id,
!0));delete this._rec_markers_pull[a];for(var h=!1,j=0;j<this._rendered.length;j++)this._rendered[j].getAttribute("event_id")==a&&(h=!0);if(!h)this._select_id=null}return!0});scheduler.attachEvent("onEventAdded",function(a){if(!this._loading){var b=this.getEvent(a);b.rec_type&&!b.event_length&&this._roll_back_dates(b)}return!0});scheduler.attachEvent("onEventSave",function(a,b){var c=this.getEvent(a);if(!c.rec_type&&b.rec_type&&(a+"").indexOf("#")==-1)this._select_id=null;return!0});
scheduler.attachEvent("onEventCreated",function(a){var b=this.getEvent(a);if(!b.rec_type)b.rec_type=b.rec_pattern=b.event_length=b.event_pid="";return!0});scheduler.attachEvent("onEventCancel",function(a){var b=this.getEvent(a);b.rec_type&&(this._roll_back_dates(b),this.render_view_data())});
"none";m("dhx_repeat_"+this.value).style.display="block"}function h(a){var b=[f("repeat")];for(q[b[0]](b,a);b.length<5;)b.push("");var c="";if(g.end[0].checked)a.end=new Date(9999,1,1),c="no";else if(g.end[2].checked)a.end=j(g.date_of_end.value);else{scheduler.transpose_type(b.join("_"));var c=Math.max(1,g.occurences_count.value),e=b[0]=="week"&&b[4]&&b[4].toString().indexOf(scheduler.config.start_on_monday?1:0)==-1?1:0;a.end=scheduler.date.add(new Date(a.start),c+e,b.join("_"))}return b.join("_")+
"#"+c}function i(a,b){var c=a.split("#"),a=c[0].split("_");r[a[0]](a,b);var e=g.repeat[{day:0,week:1,month:2,year:3}[a[0]]];switch(c[1]){case "no":g.end[0].checked=!0;break;case "":g.end[2].checked=!0;g.date_of_end.value=l(b.end);break;default:g.end[1].checked=!0,g.occurences_count.value=c[1]}e.checked=!0;e.onclick()}scheduler.form_blocks.recurring._ds={start:c.start_date,end:c._end_date};var k=scheduler.date.str_to_date(scheduler.config.repeat_date),j=function(a){var b=k(a);scheduler.config.include_end_by&&
(b=scheduler.date.add(b,1,"day"));return b},l=scheduler.date.date_to_str(scheduler.config.repeat_date),n=a.getElementsByTagName("FORM")[0],g=[];d(n.getElementsByTagName("INPUT"));d(n.getElementsByTagName("SELECT"));if(!scheduler.config.repeat_date_of_end){var s=scheduler.date.date_to_str(scheduler.config.repeat_date);scheduler.config.repeat_date_of_end=s(scheduler.date.add(new Date,30,"day"))}g.date_of_end.value=scheduler.config.repeat_date_of_end;var m=function(a){return document.getElementById(a)};
scheduler.form_blocks.recurring._get_repeat_code=h;var q={month:function(a,b){f("month_type")=="d"?(a.push(Math.max(1,g.month_count.value)),b.start.setDate(g.month_day.value)):(a.push(Math.max(1,g.month_count2.value)),a.push(g.month_day2.value),a.push(Math.max(1,g.month_week2.value)),b.start.setDate(1));b._start=!0},week:function(a,b){a.push(Math.max(1,g.week_count.value));a.push("");a.push("");for(var c=[],e=g.week_day,d=0;d<e.length;d++)e[d].checked&&c.push(e[d].value);c.length||c.push(b.start.getDay());
b.start=scheduler.date.week_start(b.start);b._start=!0;a.push(c.sort().join(","))},day:function(a){f("day_type")=="d"?a.push(Math.max(1,g.day_count.value)):(a.push("week"),a.push(1),a.push(""),a.push(""),a.push("1,2,3,4,5"),a.splice(0,1))},year:function(a,b){f("year_type")=="d"?(a.push("1"),b.start.setMonth(0),b.start.setDate(g.year_day.value),b.start.setMonth(g.year_month.value)):(a.push("1"),a.push(g.year_day2.value),a.push(g.year_week2.value),b.start.setDate(1),b.start.setMonth(g.year_month2.value));
b._start=!0}},r={week:function(a){g.week_count.value=a[1];for(var b=g.week_day,c=a[4].split(","),e={},d=0;d<c.length;d++)e[c[d]]=!0;for(d=0;d<b.length;d++)b[d].checked=!!e[b[d].value]},month:function(a,b){a[2]==""?(g.month_type[0].checked=!0,g.month_count.value=a[1],g.month_day.value=b.start.getDate()):(g.month_type[1].checked=!0,g.month_count2.value=a[1],g.month_week2.value=a[3],g.month_day2.value=a[2])},day:function(a){g.day_type[0].checked=!0;g.day_count.value=a[1]},year:function(a,b){a[2]==""?
(g.year_type[0].checked=!0,g.year_day.value=b.start.getDate(),g.year_month.value=b.start.getMonth()):(g.year_type[1].checked=!0,g.year_week2.value=a[3],g.year_day2.value=a[2],g.year_month2.value=b.start.getMonth())}};scheduler.form_blocks.recurring._set_repeat_code=i;for(var o=0;o<n.elements.length;o++){var p=n.elements[o];switch(p.name){case "repeat":p.onclick=e}}scheduler._lightbox._rec_init_done=!0},set_value:function(a,b,c){var d=scheduler.form_blocks.recurring;scheduler._lightbox._rec_init_done||
d._init_set_value(a,b,c);a.open=!c.rec_type;a.blocked=c.event_pid&&c.event_pid!="0"?!0:!1;var f=d._ds;f.start=c.start_date;f.end=c._end_date;d.button_click(0,a.previousSibling.firstChild.firstChild,a,a);b&&d._set_repeat_code(b,f)},get_value:function(a,b){if(a.open){var c=scheduler.form_blocks.recurring._ds,d={};this.formSection("time").getValue(d);c.start=d.start_date;b.rec_type=scheduler.form_blocks.recurring._get_repeat_code(c);c._start?(b.start_date=new Date(c.start),b._start_date=new Date(c.start),
c._start=!1):b._start_date=null;b._end_date=b.end_date=c.end;b.rec_pattern=b.rec_type.split("#")[0]}else b.rec_type=b.rec_pattern="",b._end_date=b.end_date;return b.rec_type},focus:function(){},button_click:function(a,b,c,d){!d.open&&!d.blocked?(d.style.height="115px",b.style.backgroundPosition="-5px 0px",b.nextSibling.innerHTML=scheduler.locale.labels.button_recurring_open):(d.style.height="0px",b.style.backgroundPosition="-5px 20px",b.nextSibling.innerHTML=scheduler.locale.labels.button_recurring);
d.open=!d.open;scheduler.setLightboxSize()}};scheduler._rec_markers={};scheduler._rec_markers_pull={};scheduler._add_rec_marker=function(a,b){a._pid_time=b;this._rec_markers[a.id]=a;this._rec_markers_pull[a.event_pid]||(this._rec_markers_pull[a.event_pid]={});this._rec_markers_pull[a.event_pid][b]=a};scheduler._get_rec_marker=function(a,b){var c=this._rec_markers_pull[b];return c?c[a]:null};scheduler._get_rec_markers=function(a){return this._rec_markers_pull[a]||[]};scheduler._rec_temp=[];
(function(){var a=scheduler.addEvent;scheduler.addEvent=function(b,c,d,f,e){var h=a.apply(this,arguments);if(h){var i=scheduler.getEvent(h);i.event_pid!=0&&scheduler._add_rec_marker(i,i.event_length*1E3);if(i.rec_type)i.rec_pattern=i.rec_type.split("#")[0]}}})();scheduler.attachEvent("onEventIdChange",function(a,b){if(!this._ignore_call){this._ignore_call=!0;for(var c=0;c<this._rec_temp.length;c++){var d=this._rec_temp[c];if(d.event_pid==a)d.event_pid=b,this.changeEventId(d.id,b+"#"+d.id.split("#")[1])}delete this._ignore_call}});
scheduler.attachEvent("onBeforeEventDelete",function(a){var b=this.getEvent(a);if(a.toString().indexOf("#")!=-1||b.event_pid&&b.event_pid!="0"&&b.rec_type&&b.rec_type!="none"){var a=a.split("#"),c=this.uid(),d=a[1]?a[1]:b._pid_time/1E3,f=this._copy_event(b);f.id=c;f.event_pid=b.event_pid||a[0];var e=d;f.event_length=e;f.rec_type=f.rec_pattern="none";this.addEvent(f);this._add_rec_marker(f,e*1E3)}else{b.rec_type&&this._lightbox_id&&this._roll_back_dates(b);var h=this._get_rec_markers(a),i;for(i in h)if(h.hasOwnProperty(i))a=
h[i].id,this.getEvent(a)&&this.deleteEvent(a,!0)}return!0});
scheduler.attachEvent("onEventChanged",function(a){if(this._loading)return!0;var b=this.getEvent(a);if(a.toString().indexOf("#")!=-1){var a=a.split("#"),c=this.uid();this._not_render=!0;var d=this._copy_event(b);d.id=c;d.event_pid=a[0];var f=a[1];d.event_length=f;d.rec_type=d.rec_pattern="";this.addEvent(d);this._not_render=!1;this._add_rec_marker(d,f*1E3)}else{b.rec_type&&this._lightbox_id&&this._roll_back_dates(b);var e=this._get_rec_markers(a),h;for(h in e)e.hasOwnProperty(h)&&(delete this._rec_markers[e[h].id],
this.deleteEvent(e[h].id,!0));delete this._rec_markers_pull[a];for(var i=!1,k=0;k<this._rendered.length;k++)this._rendered[k].getAttribute("event_id")==a&&(i=!0);if(!i)this._select_id=null}return!0});scheduler.attachEvent("onEventAdded",function(a){if(!this._loading){var b=this.getEvent(a);b.rec_type&&!b.event_length&&this._roll_back_dates(b)}return!0});
scheduler.attachEvent("onEventSave",function(a,b){var c=this.getEvent(a);if(!c.rec_type&&b.rec_type&&(a+"").indexOf("#")==-1)this._select_id=null;return!0});scheduler.attachEvent("onEventCreated",function(a){var b=this.getEvent(a);if(!b.rec_type)b.rec_type=b.rec_pattern=b.event_length=b.event_pid="";return!0});scheduler.attachEvent("onEventCancel",function(a){var b=this.getEvent(a);b.rec_type&&(this._roll_back_dates(b),this.render_view_data())});
scheduler._roll_back_dates=function(a){a.event_length=(a.end_date.valueOf()-a.start_date.valueOf())/1E3;a.end_date=a._end_date;a._start_date&&(a.start_date.setMonth(0),a.start_date.setDate(a._start_date.getDate()),a.start_date.setMonth(a._start_date.getMonth()),a.start_date.setFullYear(a._start_date.getFullYear()))};scheduler.validId=function(a){return a.toString().indexOf("#")==-1};scheduler.showLightbox_rec=scheduler.showLightbox;
scheduler.showLightbox=function(a){var b=this.getEvent(a).event_pid;a.toString().indexOf("#")!=-1&&(b=a.split("#")[0]);if(!b||b==0||!this.locale.labels.confirm_recurring||!confirm(this.locale.labels.confirm_recurring))return this.showLightbox_rec(a);b=this.getEvent(b);b._end_date=b.end_date;b.end_date=new Date(b.start_date.valueOf()+b.event_length*1E3);return this.showLightbox_rec(b.id)};scheduler.get_visible_events_rec=scheduler.get_visible_events;
scheduler.get_visible_events=function(){for(var a=0;a<this._rec_temp.length;a++)delete this._events[this._rec_temp[a].id];this._rec_temp=[];for(var b=this.get_visible_events_rec(),c=[],a=0;a<b.length;a++)b[a].rec_type?b[a].rec_pattern!="none"&&this.repeat_date(b[a],c):c.push(b[a]);return c};(function(){var a=scheduler.is_one_day_event;scheduler.is_one_day_event=function(b){return b.rec_type?!0:a.call(this,b)}})();scheduler.transponse_size={day:1,week:7,month:1,year:12};
scheduler.date.day_week=function(a,b,c){a.setDate(1);var c=(c-1)*7,d=a.getDay(),f=b*1+c-d+1;a.setDate(f<=c?f+7:f)};scheduler.transpose_day_week=function(a,b,c,d,f){for(var e=(a.getDay()||(scheduler.config.start_on_monday?7:0))-c,h=0;h<b.length;h++)if(b[h]>e)return a.setDate(a.getDate()+b[h]*1-e-(d?c:f));this.transpose_day_week(a,b,c+d,null,c)};
scheduler.transpose_type=function(a){var b="transpose_"+a;if(!this.date[b]){var c=a.split("_"),d=864E5,f="add_"+a,e=this.transponse_size[c[0]]*c[1];if(c[0]=="day"||c[0]=="week"){var h=null;if(c[4]&&(h=c[4].split(","),scheduler.config.start_on_monday)){for(var j=0;j<h.length;j++)h[j]=h[j]*1||7;h.sort()}this.date[b]=function(a,b){var c=Math.floor((b.valueOf()-a.valueOf())/(d*e));c>0&&a.setDate(a.getDate()+c*e);h&&scheduler.transpose_day_week(a,h,1,e)};this.date[f]=function(a,b){var c=new Date(a.valueOf());
scheduler.showLightbox=function(a){var b=this.locale,c=scheduler.config.lightbox_recurring,d=this.getEvent(a).event_pid,f=a.toString().indexOf("#")!=-1;f&&(d=a.split("#")[0]);if(!d||d==0||!b.labels.confirm_recurring||c=="instance"||c=="series"&&!f)return this.showLightbox_rec(a);var e=function(){d=this.getEvent(d);d._end_date=d.end_date;d.end_date=new Date(d.start_date.valueOf()+d.event_length*1E3);return this.showLightbox_rec(d.id)};if(c=="ask"){var h=this;dhtmlx.modalbox({text:b.labels.confirm_recurring,
title:b.labels.title_confirm_recurring,width:"500px",position:"middle",buttons:[b.labels.button_edit_series,b.labels.button_edit_occurrence,b.labels.icon_cancel],callback:function(b){switch(+b){case 0:return e.call(h);case 1:return h.showLightbox_rec(a)}}})}else e()};scheduler.get_visible_events_rec=scheduler.get_visible_events;
scheduler.get_visible_events=function(a){for(var b=0;b<this._rec_temp.length;b++)delete this._events[this._rec_temp[b].id];this._rec_temp=[];for(var c=this.get_visible_events_rec(a),d=[],b=0;b<c.length;b++)c[b].rec_type?c[b].rec_pattern!="none"&&this.repeat_date(c[b],d):d.push(c[b]);return d};
(function(){var a=scheduler.is_one_day_event;scheduler.is_one_day_event=function(b){return b.rec_type?!0:a.call(this,b)};var b=scheduler.updateEvent;scheduler.updateEvent=function(a){var d=scheduler.getEvent(a);d&&d.rec_type&&a.toString().indexOf("#")===-1?scheduler.update_view():b.call(this,a)}})();scheduler.transponse_size={day:1,week:7,month:1,year:12};scheduler.date.day_week=function(a,b,c){a.setDate(1);var c=(c-1)*7,d=a.getDay(),f=b*1+c-d+1;a.setDate(f<=c?f+7:f)};
scheduler.transpose_day_week=function(a,b,c,d,f){for(var e=(a.getDay()||(scheduler.config.start_on_monday?7:0))-c,h=0;h<b.length;h++)if(b[h]>e)return a.setDate(a.getDate()+b[h]*1-e-(d?c:f));this.transpose_day_week(a,b,c+d,null,c)};
scheduler.transpose_type=function(a){var b="transpose_"+a;if(!this.date[b]){var c=a.split("_"),d=864E5,f="add_"+a,e=this.transponse_size[c[0]]*c[1];if(c[0]=="day"||c[0]=="week"){var h=null;if(c[4]&&(h=c[4].split(","),scheduler.config.start_on_monday)){for(var i=0;i<h.length;i++)h[i]=h[i]*1||7;h.sort()}this.date[b]=function(a,b){var c=Math.floor((b.valueOf()-a.valueOf())/(d*e));c>0&&a.setDate(a.getDate()+c*e);h&&scheduler.transpose_day_week(a,h,1,e)};this.date[f]=function(a,b){var c=new Date(a.valueOf());
if(h)for(var d=0;d<b;d++)scheduler.transpose_day_week(c,h,0,e);else c.setDate(c.getDate()+b*e);return c}}else if(c[0]=="month"||c[0]=="year")this.date[b]=function(a,b){var d=Math.ceil((b.getFullYear()*12+b.getMonth()*1-(a.getFullYear()*12+a.getMonth()*1))/e);d>=0&&a.setMonth(a.getMonth()+d*e);c[3]&&scheduler.date.day_week(a,c[2],c[3])},this.date[f]=function(a,b){var d=new Date(a.valueOf());d.setMonth(d.getMonth()+b*e);c[3]&&scheduler.date.day_week(d,c[2],c[3]);return d}}};
scheduler.repeat_date=function(a,b,c,d,f){var d=d||this._min_date,f=f||this._max_date,e=new Date(a.start_date.valueOf());if(!a.rec_pattern&&a.rec_type)a.rec_pattern=a.rec_type.split("#")[0];this.transpose_type(a.rec_pattern);for(scheduler.date["transpose_"+a.rec_pattern](e,d);e<a.start_date||e.valueOf()+a.event_length*1E3<=d.valueOf();)e=this.date.add(e,1,a.rec_pattern);for(;e<f&&e<a.end_date;){var h=this._get_rec_marker(e.valueOf(),a.id);if(h)c&&b.push(h);else{var j=new Date(e.valueOf()+a.event_length*
1E3),i=this._copy_event(a);i.text=a.text;i.start_date=e;i.event_pid=a.id;i.id=a.id+"#"+Math.ceil(e.valueOf()/1E3);i.end_date=j;var k=i.start_date.getTimezoneOffset()-i.end_date.getTimezoneOffset();if(k)i.end_date=k>0?new Date(e.valueOf()+a.event_length*1E3-k*6E4):new Date(i.end_date.valueOf()+k*6E4);i._timed=this.is_one_day_event(i);if(!i._timed&&!this._table_view&&!this.config.multi_day)break;b.push(i);c||(this._events[i.id]=i,this._rec_temp.push(i))}e=this.date.add(e,1,a.rec_pattern)}};
scheduler.getRecDates=function(a,b){var c=typeof a=="object"?a:scheduler.getEvent(a),d=0,f=[],b=b||1E3,e=new Date(c.start_date.valueOf()),h=new Date(e.valueOf());if(!c.rec_type)return[{start_date:c.start_date,end_date:c.end_date}];this.transpose_type(c.rec_pattern);for(scheduler.date["transpose_"+c.rec_pattern](e,h);e<c.start_date||e.valueOf()+c.event_length*1E3<=h.valueOf();)e=this.date.add(e,1,c.rec_pattern);for(;e<c.end_date;){var j=this._get_rec_marker(e.valueOf(),c.id),i=!0;if(j)j.rec_type==
"none"?i=!1:f.push({start_date:j.start_date,end_date:j.end_date});else{var k=new Date(e.valueOf()+c.event_length*1E3),l=new Date(e);f.push({start_date:l,end_date:k})}e=this.date.add(e,1,c.rec_pattern);if(i&&(d++,d==b))break}return f};
scheduler.repeat_date=function(a,b,c,d,f){var d=d||this._min_date,f=f||this._max_date,e=new Date(a.start_date.valueOf());if(!a.rec_pattern&&a.rec_type)a.rec_pattern=a.rec_type.split("#")[0];this.transpose_type(a.rec_pattern);for(scheduler.date["transpose_"+a.rec_pattern](e,d);e<a.start_date||scheduler._fix_daylight_saving_date(e,d,a,e,new Date(e.valueOf()+a.event_length*1E3)).valueOf()<=d.valueOf()||e.valueOf()+a.event_length*1E3<=d.valueOf();)e=this.date.add(e,1,a.rec_pattern);for(;e<f&&e<a.end_date;){var h=
scheduler.config.occurrence_timestamp_in_utc?Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds()):e.valueOf(),i=this._get_rec_marker(h,a.id);if(i)c&&b.push(i);else{var k=new Date(e.valueOf()+a.event_length*1E3),j=this._copy_event(a);j.text=a.text;j.start_date=e;j.event_pid=a.id;j.id=a.id+"#"+Math.ceil(h/1E3);j.end_date=k;j.end_date=scheduler._fix_daylight_saving_date(j.start_date,j.end_date,a,e,j.end_date);j._timed=this.is_one_day_event(j);if(!j._timed&&!this._table_view&&
!this.config.multi_day)break;b.push(j);c||(this._events[j.id]=j,this._rec_temp.push(j))}e=this.date.add(e,1,a.rec_pattern)}};scheduler._fix_daylight_saving_date=function(a,b,c,d,f){var e=a.getTimezoneOffset()-b.getTimezoneOffset();return e?e>0?new Date(d.valueOf()+c.event_length*1E3-e*6E4):new Date(b.valueOf()-e*6E4):new Date(f.valueOf())};
scheduler.getRecDates=function(a,b){var c=typeof a=="object"?a:scheduler.getEvent(a),d=0,f=[],b=b||100,e=new Date(c.start_date.valueOf()),h=new Date(e.valueOf());if(!c.rec_type)return[{start_date:c.start_date,end_date:c.end_date}];if(c.rec_type=="none")return[];this.transpose_type(c.rec_pattern);for(scheduler.date["transpose_"+c.rec_pattern](e,h);e<c.start_date||e.valueOf()+c.event_length*1E3<=h.valueOf();)e=this.date.add(e,1,c.rec_pattern);for(;e<c.end_date;){var i=this._get_rec_marker(e.valueOf(),
c.id),k=!0;if(i)i.rec_type=="none"?k=!1:f.push({start_date:i.start_date,end_date:i.end_date});else{var j=new Date(e),l=new Date(e.valueOf()+c.event_length*1E3),l=scheduler._fix_daylight_saving_date(j,l,c,e,l);f.push({start_date:j,end_date:l})}e=this.date.add(e,1,c.rec_pattern);if(k&&(d++,d==b))break}return f};
scheduler.getEvents=function(a,b){var c=[],d;for(d in this._events){var f=this._events[d];if(f&&f.start_date<b&&f.end_date>a)if(f.rec_pattern){if(f.rec_pattern!="none"){var e=[];this.repeat_date(f,e,!0,a,b);for(var h=0;h<e.length;h++)!e[h].rec_pattern&&e[h].start_date<b&&e[h].end_date>a&&!this._rec_markers[e[h].id]&&c.push(e[h])}}else f.id.toString().indexOf("#")==-1&&c.push(f)}return c};scheduler.config.repeat_date="%m.%d.%Y";
scheduler.config.lightbox.sections=[{name:"description",height:130,map_to:"text",type:"textarea",focus:!0},{name:"recurring",type:"recurring",map_to:"rec_type",button:"recurring"},{name:"time",height:72,type:"time",map_to:"auto"}];scheduler._copy_dummy=function(){this.start_date=new Date(this.start_date);this.end_date=new Date(this.end_date);this.event_length=this.event_pid=this.rec_pattern=this.rec_type=this._timed=null};
scheduler.__recurring_template='<div class="dhx_form_repeat"> <form> <div class="dhx_repeat_left"> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />Daily</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>Weekly</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />Monthly</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />Yearly</label> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_center"> <div style="display:none;" id="dhx_repeat_day"> <label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>Every</label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />day<br /> <label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>Every workday</label> </div> <div style="display:none;" id="dhx_repeat_week"> Repeat every<input class="dhx_repeat_text" type="text" name="week_count" value="1" />week next days:<br /> <table class="dhx_repeat_days"> <tr> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />Monday</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />Thursday</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />Tuesday</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />Friday</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />Wednesday</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />Saturday</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />Sunday</label><br /><br /> </td> </tr> </table> </div> <div id="dhx_repeat_month"> <label><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>Repeat</label><input class="dhx_repeat_text" type="text" name="month_day" value="1" />day every<input class="dhx_repeat_text" type="text" name="month_count" value="1" />month<br /> <label><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/>On</label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><select name="month_day2"><option value="1" selected >Monday<option value="2">Tuesday<option value="3">Wednesday<option value="4">Thursday<option value="5">Friday<option value="6">Saturday<option value="0">Sunday</select>every<input class="dhx_repeat_text" type="text" name="month_count2" value="1" />month<br /> </div> <div style="display:none;" id="dhx_repeat_year"> <label><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/>Every</label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />day<select name="year_month"><option value="0" selected >January<option value="1">February<option value="2">March<option value="3">April<option value="4">May<option value="5">June<option value="6">July<option value="7">August<option value="8">September<option value="9">October<option value="10">November<option value="11">December</select>month<br /> <label><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/>On</label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >Monday<option value="2">Tuesday<option value="3">Wednesday<option value="4">Thursday<option value="5">Friday<option value="6">Saturday<option value="7">Sunday</select>of<select name="year_month2"><option value="0" selected >January<option value="1">February<option value="2">March<option value="3">April<option value="4">May<option value="5">June<option value="6">July<option value="7">August<option value="8">September<option value="9">October<option value="10">November<option value="11">December</select><br /> </div> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_right"> <label><input class="dhx_repeat_radio" type="radio" name="end" checked/>No end date</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />After</label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />occurrences<br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />End by</label><input class="dhx_repeat_date" type="text" name="date_of_end" value="'+scheduler.config.repeat_date_of_end+
'" /><br /> </div> </form> </div> <div style="clear:both"> </div>';
scheduler.config.lightbox.sections=[{name:"description",height:130,map_to:"text",type:"textarea",focus:!0},{name:"recurring",type:"recurring",map_to:"rec_type",button:"recurring"},{name:"time",height:72,type:"time",map_to:"auto"}];scheduler._copy_dummy=function(){var a=new Date(this.start_date),b=new Date(this.end_date);this.start_date=a;this.end_date=b;this.event_length=this.event_pid=this.rec_pattern=this.rec_type=null};scheduler.config.include_end_by=!1;scheduler.config.lightbox_recurring="ask";
scheduler.__recurring_template='<div class="dhx_form_repeat"> <form> <div class="dhx_repeat_left"> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />Daily</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>Weekly</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />Monthly</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />Yearly</label> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_center"> <div style="display:none;" id="dhx_repeat_day"> <label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>Every</label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />day<br /> <label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>Every workday</label> </div> <div style="display:none;" id="dhx_repeat_week"> Repeat every<input class="dhx_repeat_text" type="text" name="week_count" value="1" />week next days:<br /> <table class="dhx_repeat_days"> <tr> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />Monday</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />Thursday</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />Tuesday</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />Friday</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />Wednesday</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />Saturday</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />Sunday</label><br /><br /> </td> </tr> </table> </div> <div id="dhx_repeat_month"> <label><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>Repeat</label><input class="dhx_repeat_text" type="text" name="month_day" value="1" />day every<input class="dhx_repeat_text" type="text" name="month_count" value="1" />month<br /> <label><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/>On</label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><select name="month_day2"><option value="1" selected >Monday<option value="2">Tuesday<option value="3">Wednesday<option value="4">Thursday<option value="5">Friday<option value="6">Saturday<option value="0">Sunday</select>every<input class="dhx_repeat_text" type="text" name="month_count2" value="1" />month<br /> </div> <div style="display:none;" id="dhx_repeat_year"> <label><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/>Every</label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />day<select name="year_month"><option value="0" selected >January<option value="1">February<option value="2">March<option value="3">April<option value="4">May<option value="5">June<option value="6">July<option value="7">August<option value="8">September<option value="9">October<option value="10">November<option value="11">December</select>month<br /> <label><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/>On</label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >Monday<option value="2">Tuesday<option value="3">Wednesday<option value="4">Thursday<option value="5">Friday<option value="6">Saturday<option value="7">Sunday</select>of<select name="year_month2"><option value="0" selected >January<option value="1">February<option value="2">March<option value="3">April<option value="4">May<option value="5">June<option value="6">July<option value="7">August<option value="8">September<option value="9">October<option value="10">November<option value="11">December</select><br /> </div> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_right"> <label><input class="dhx_repeat_radio" type="radio" name="end" checked/>No end date</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />After</label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />occurrences<br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />End by</label><input class="dhx_repeat_date" type="text" name="date_of_end" value="'+
scheduler.config.repeat_date_of_end+'" /><br /> </div> </form> </div> <div style="clear:both"> </div>';

View File

@ -1,8 +1,9 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
scheduler.data_attributes=function(){var f=[],d=scheduler.templates.xml_format,c;for(c in this._events){var e=this._events[c],a;for(a in e)a.substr(0,1)!="_"&&f.push([a,a=="start_date"||a=="end_date"?d:null]);break}return f};
scheduler.toXML=function(f){var d=[],c=this.data_attributes(),e;for(e in this._events){var a=this._events[e];if(a.id.toString().indexOf("#")==-1){d.push("<event>");for(var b=0;b<c.length;b++)d.push("<"+c[b][0]+"><![CDATA["+(c[b][1]?c[b][1](a[c[b][0]]):a[c[b][0]])+"]]\></"+c[b][0]+">");d.push("</event>")}}return(f||"")+"<data>"+d.join("\n")+"</data>"};
scheduler.toJSON=function(){var f=[],d=this.data_attributes(),c;for(c in this._events){var e=this._events[c];if(e.id.toString().indexOf("#")==-1){for(var e=this._events[c],a=[],b=0;b<d.length;b++)a.push(" "+d[b][0]+':"'+((d[b][1]?d[b][1](e[d[b][0]]):e[d[b][0]])||"").toString().replace(/\n/g,"")+'" ');f.push("{"+a.join(",")+"}")}}return"["+f.join(",\n")+"]"};
scheduler.toICal=function(f){var d="BEGIN:VCALENDAR\nVERSION:2.0\nPRODID:-//dhtmlXScheduler//NONSGML v2.2//EN\nDESCRIPTION:",c="END:VCALENDAR",e=scheduler.date.date_to_str("%Y%m%dT%H%i%s"),a=[],b;for(b in this._events){var g=this._events[b];g.id.toString().indexOf("#")==-1&&(a.push("BEGIN:VEVENT"),a.push("DTSTART:"+e(g.start_date)),a.push("DTEND:"+e(g.end_date)),a.push("SUMMARY:"+g.text),a.push("END:VEVENT"))}return d+(f||"")+"\n"+a.join("\n")+"\n"+c};
scheduler.data_attributes=function(){var g=[],c=scheduler.templates.xml_format,b;for(b in this._events){var e=this._events[b],d;for(d in e)d.substr(0,1)!="_"&&g.push([d,d=="start_date"||d=="end_date"?c:null]);break}return g};
scheduler.toXML=function(g){var c=[],b=this.data_attributes(),e;for(e in this._events){var d=this._events[e];if(d.id.toString().indexOf("#")==-1){c.push("<event>");for(var a=0;a<b.length;a++)c.push("<"+b[a][0]+"><![CDATA["+(b[a][1]?b[a][1](d[b[a][0]]):d[b[a][0]])+"]]\></"+b[a][0]+">");c.push("</event>")}}return(g||"")+"<data>"+c.join("\n")+"</data>"};
scheduler.toJSON=function(){var g=[],c=this.data_attributes(),b;for(b in this._events){var e=this._events[b];if(e.id.toString().indexOf("#")==-1){for(var e=this._events[b],d=[],a=0;a<c.length;a++)d.push(' "'+c[a][0]+'": "'+((c[a][1]?c[a][1](e[c[a][0]]):e[c[a][0]])||"").toString().replace(/\n/g,"")+'" ');g.push("{"+d.join(",")+"}")}}return"["+g.join(",\n")+"]"};
scheduler.toICal=function(g){var c="BEGIN:VCALENDAR\nVERSION:2.0\nPRODID:-//dhtmlXScheduler//NONSGML v2.2//EN\nDESCRIPTION:",b="END:VCALENDAR",e=scheduler.date.date_to_str("%Y%m%dT%H%i%s"),d=scheduler.date.date_to_str("%Y%m%d"),a=[],h;for(h in this._events){var f=this._events[h];f.id.toString().indexOf("#")==-1&&(a.push("BEGIN:VEVENT"),!f._timed||!f.start_date.getHours()&&!f.start_date.getMinutes()?a.push("DTSTART:"+d(f.start_date)):a.push("DTSTART:"+e(f.start_date)),!f._timed||!f.end_date.getHours()&&
!f.end_date.getMinutes()?a.push("DTEND:"+d(f.end_date)):a.push("DTEND:"+e(f.end_date)),a.push("SUMMARY:"+f.text),a.push("END:VEVENT"))}return c+(g||"")+"\n"+a.join("\n")+"\n"+b};

View File

@ -1,34 +1,44 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
(function(){function B(){for(var a=scheduler.get_visible_events(),b=[],c=0;c<this.y_unit.length;c++)b[c]=[];b[f]||(b[f]=[]);for(c=0;c<a.length;c++){for(var f=this.order[a[c][this.y_property]],d=0;this._trace_x[d+1]&&a[c].start_date>=this._trace_x[d+1];)d++;for(;this._trace_x[d]&&a[c].end_date>this._trace_x[d];)b[f][d]||(b[f][d]=[]),b[f][d].push(a[c]),d++}return b}function v(a,b,c){var f=0,d=b?a.end_date:a.start_date;if(d.valueOf()>scheduler._max_date.valueOf())d=scheduler._max_date;var i=d-scheduler._min_date_timeline;
if(i<0)k=0;else{var g=Math.round(i/(c*scheduler._cols[0]));if(g>scheduler._cols.length)g=scheduler._cols.length;for(var e=0;e<g;e++)f+=scheduler._cols[e];var j=scheduler.date.add(scheduler._min_date_timeline,scheduler.matrix[scheduler._mode].x_step*g,scheduler.matrix[scheduler._mode].x_unit),i=d-j,k=Math.floor(i/c)}f+=b?k-14:k+1;return f}function C(a){var b="<table style='table-layout:fixed;' cellspacing='0' cellpadding='0'>",c=[];scheduler._load_mode&&scheduler._load();if(this.render=="cell")c=B.call(this);
else for(var f=scheduler.get_visible_events(),d=0;d<f.length;d++){var i=this.order[f[d][this.y_property]];c[i]||(c[i]=[]);c[i].push(f[d])}for(var g=0,e=0;e<scheduler._cols.length;e++)g+=scheduler._cols[e];var j=new Date;this._step=j=(scheduler.date.add(j,this.x_step*this.x_size,this.x_unit)-j)/g;this._summ=g;var k=scheduler._colsS.heights=[];this._events_height={};for(e=0;e<this.y_unit.length;e++){var h=this._logic(this.render,this.y_unit[e],this);scheduler._merge(h,{height:this.dy});if(this.section_autoheight&&
this.y_unit.length*h.height<a.offsetHeight)h.height=Math.max(h.height,Math.floor((a.offsetHeight-1)/this.y_unit.length));scheduler._merge(h,{tr_className:"",style_height:"height:"+h.height+"px;",style_width:"width:"+(this.dx-1)+"px;",td_className:"dhx_matrix_scell"+(scheduler.templates[this.name+"_scaley_class"](this.y_unit[e].key,this.y_unit[e].label,this)?" "+scheduler.templates[this.name+"_scaley_class"](this.y_unit[e].key,this.y_unit[e].label,this):""),td_content:scheduler.templates[this.name+
"_scale_label"](this.y_unit[e].key,this.y_unit[e].label,this.y_unit[e]),summ_width:"width:"+g+"px;",table_className:""});var o="";if(c[e]&&this.render!="cell"){c[e].sort(function(a,d){return a.start_date>d.start_date?1:-1});for(var l=[],d=0;d<c[e].length;d++){for(var m=c[e][d],n=0;l[n]&&l[n].end_date>m.start_date;)n++;l[n]=m;o+=scheduler.render_timeline_event.call(this,m,n)}}if(this.fit_events){var w=this._events_height[this.y_unit[e].key]||0;h.height=w>h.height?w:h.height;h.style_height="height:"+
h.height+"px;"}b+="<tr class='"+h.tr_className+"' style='"+h.style_height+"'><td class='"+h.td_className+"' style='"+h.style_width+" height:"+(h.height-1)+"px;'>"+h.td_content+"</td>";if(this.render=="cell")for(d=0;d<scheduler._cols.length;d++)b+="<td class='dhx_matrix_cell "+scheduler.templates[this.name+"_cell_class"](c[e][d],this._trace_x[d],this.y_unit[e])+"' style='width:"+(scheduler._cols[d]-1)+"px'><div style='width:"+(scheduler._cols[d]-1)+"px'>"+scheduler.templates[this.name+"_cell_value"](c[e][d])+
"</div></td>";else{b+="<td><div style='"+h.summ_width+" "+h.style_height+" position:relative;' class='dhx_matrix_line'>";b+=o;b+="<table class='"+h.table_className+"' cellpadding='0' cellspacing='0' style='"+h.summ_width+" "+h.style_height+"' >";for(d=0;d<scheduler._cols.length;d++)b+="<td class='dhx_matrix_cell "+scheduler.templates[this.name+"_cell_class"](c[e],this._trace_x[d],this.y_unit[e])+"' style='width:"+(scheduler._cols[d]-1)+"px'><div style='width:"+(scheduler._cols[d]-1)+"px'></div></td>";
b+="</table>";b+="</div></td>"}b+="</tr>"}b+="</table>";this._matrix=c;a.innerHTML=b;scheduler._rendered=[];for(var q=document.getElementsByTagName("DIV"),e=0;e<q.length;e++)q[e].getAttribute("event_id")&&scheduler._rendered.push(q[e]);for(e=0;e<a.firstChild.rows.length;e++)k.push(a.firstChild.rows[e].offsetHeight)}function D(a){var b=scheduler.xy.scale_height,c=this._header_resized||scheduler.xy.scale_height;scheduler._cols=[];scheduler._colsS={height:0};this._trace_x=[];var f=scheduler._x-this.dx-
18,d=[this.dx],i=scheduler._els.dhx_cal_header[0];i.style.width=d[0]+f+"px";for(var g=scheduler._min_date_timeline=scheduler._min_date,e=0;e<this.x_size;e++)this._trace_x[e]=new Date(g),g=scheduler.date.add(g,this.x_step,this.x_unit),scheduler._cols[e]=Math.floor(f/(this.x_size-e)),f-=scheduler._cols[e],d[e+1]=d[e]+scheduler._cols[e];a.innerHTML="<div></div>";if(this.second_scale){for(var j=this.second_scale.x_unit,k=[this._trace_x[0]],h=[],o=[this.dx,this.dx],l=0,m=0;m<this._trace_x.length;m++){var n=
this._trace_x[m],w=E(j,n,k[l]);w&&(++l,k[l]=n,o[l+1]=o[l]);var q=l+1;h[l]=scheduler._cols[m]+(h[l]||0);o[q]+=scheduler._cols[m]}a.innerHTML="<div></div><div></div>";var p=a.firstChild;p.style.height=c+"px";var v=a.lastChild;v.style.position="relative";for(var r=0;r<k.length;r++){var t=k[r],u=scheduler.templates[this.name+"_second_scalex_class"](t),x=document.createElement("DIV");x.className="dhx_scale_bar dhx_second_scale_bar"+(u?" "+u:"");scheduler.set_xy(x,h[r]-1,c-3,o[r],0);x.innerHTML=scheduler.templates[this.name+
"_second_scale_date"](t);p.appendChild(x)}}scheduler.xy.scale_height=c;for(var a=a.lastChild,s=0;s<this._trace_x.length;s++){g=this._trace_x[s];scheduler._render_x_header(s,d[s],g,a);var y=scheduler.templates[this.name+"_scalex_class"](g);y&&(a.lastChild.className+=" "+y)}scheduler.xy.scale_height=b;var z=this._trace_x;a.onclick=function(a){var d=A(a);d&&scheduler.callEvent("onXScaleClick",[d.x,z[d.x],a||event])};a.ondblclick=function(a){var d=A(a);d&&scheduler.callEvent("onXScaleDblClick",[d.x,z[d.x],
a||event])}}function E(a,b,c){switch(a){case "day":return!(b.getDate()==c.getDate()&&b.getMonth()==c.getMonth()&&b.getFullYear()==c.getFullYear());case "week":return!(scheduler.date.getISOWeek(b)==scheduler.date.getISOWeek(c)&&b.getFullYear()==c.getFullYear());case "month":return!(b.getMonth()==c.getMonth()&&b.getFullYear()==c.getFullYear());case "year":return b.getFullYear()!=c.getFullYear();default:return!1}}function p(a){if(a){scheduler.set_sizes();t();var b=scheduler._min_date;D.call(this,scheduler._els.dhx_cal_header[0]);
C.call(this,scheduler._els.dhx_cal_data[0]);scheduler._min_date=b;scheduler._els.dhx_cal_date[0].innerHTML=scheduler.templates[this.name+"_date"](scheduler._min_date,scheduler._max_date);scheduler._table_view=!0}}function u(){if(scheduler._tooltip)scheduler._tooltip.style.display="none",scheduler._tooltip.date=""}function F(a,b,c){if(a.render=="cell"){var f=b.x+"_"+b.y,d=a._matrix[b.y][b.x];if(!d)return u();d.sort(function(a,d){return a.start_date>d.start_date?1:-1});if(scheduler._tooltip){if(scheduler._tooltip.date==
f)return;scheduler._tooltip.innerHTML=""}else{var i=scheduler._tooltip=document.createElement("DIV");i.className="dhx_tooltip";document.body.appendChild(i);i.onclick=scheduler._click.dhx_cal_data}for(var g="",e=0;e<d.length;e++){var j=d[e].color?"background-color:"+d[e].color+";":"",k=d[e].textColor?"color:"+d[e].textColor+";":"";g+="<div class='dhx_tooltip_line' event_id='"+d[e].id+"' style='"+j+""+k+"'>";g+="<div class='dhx_tooltip_date'>"+(d[e]._timed?scheduler.templates.event_date(d[e].start_date):
"")+"</div>";g+="<div class='dhx_event_icon icon_details'>&nbsp;</div>";g+=scheduler.templates[a.name+"_tooltip"](d[e].start_date,d[e].end_date,d[e])+"</div>"}scheduler._tooltip.style.display="";scheduler._tooltip.style.top="0px";scheduler._tooltip.style.left=document.body.offsetWidth-c.left-scheduler._tooltip.offsetWidth<0?c.left-scheduler._tooltip.offsetWidth+"px":c.left+b.src.offsetWidth+"px";scheduler._tooltip.date=f;scheduler._tooltip.innerHTML=g;scheduler._tooltip.style.top=document.body.offsetHeight-
c.top-scheduler._tooltip.offsetHeight<0?c.top-scheduler._tooltip.offsetHeight+b.src.offsetHeight+"px":c.top+"px"}}function t(){dhtmlxEvent(scheduler._els.dhx_cal_data[0],"mouseover",function(a){var b=scheduler.matrix[scheduler._mode];if(b){var c=scheduler._locate_cell_timeline(a),a=a||event,f=a.target||a.srcElement;if(c)return F(b,c,getOffset(c.src))}u()});t=function(){}}function G(a){for(var b=a.parentNode.childNodes,c=0;c<b.length;c++)if(b[c]==a)return c;return-1}function A(a){for(var a=a||event,
b=a.target?a.target:a.srcElement;b&&b.tagName!="DIV";)b=b.parentNode;if(b&&b.tagName=="DIV"){var c=b.className.split(" ")[0];if(c=="dhx_scale_bar")return{x:G(b),y:-1,src:b,scale:!0}}}scheduler.matrix={};scheduler._merge=function(a,b){for(var c in b)typeof a[c]=="undefined"&&(a[c]=b[c])};scheduler.createTimelineView=function(a){scheduler._merge(a,{section_autoheight:!0,name:"matrix",x:"time",y:"time",x_step:1,x_unit:"hour",y_unit:"day",y_step:1,x_start:0,x_size:24,y_start:0,y_size:7,render:"cell",
dx:200,dy:50,fit_events:!0,second_scale:!1,_logic:function(a,b,c){var e={};scheduler.checkEvent("onBeforeViewRender")&&(e=scheduler.callEvent("onBeforeViewRender",[a,b,c]));return e}});scheduler.checkEvent("onTimelineCreated")&&scheduler.callEvent("onTimelineCreated",[a]);var b=scheduler.render_data;scheduler.render_data=function(d,c){if(this._mode==a.name)if(c)for(var f=0;f<d.length;f++)this.clear_event(d[f]),this.render_timeline_event.call(this.matrix[this._mode],d[f],0,!0);else p.call(a,!0);else return b.apply(this,
arguments)};scheduler.matrix[a.name]=a;scheduler.templates[a.name+"_cell_value"]=function(a){return a?a.length:""};scheduler.templates[a.name+"_cell_class"]=function(){return""};scheduler.templates[a.name+"_scalex_class"]=function(){return""};scheduler.templates[a.name+"_second_scalex_class"]=function(){return""};scheduler.templates[a.name+"_scaley_class"]=function(){return""};scheduler.templates[a.name+"_scale_label"]=function(a,b){return b};scheduler.templates[a.name+"_tooltip"]=function(a,b,c){return c.text};
scheduler.templates[a.name+"_date"]=function(a,b){return a.getDay()==b.getDay()&&b-a<864E5?scheduler.templates.day_date(a):scheduler.templates.week_date(a,b)};scheduler.templates[a.name+"_scale_date"]=scheduler.date.date_to_str(a.x_date||scheduler.config.hour_date);scheduler.templates[a.name+"_second_scale_date"]=scheduler.date.date_to_str(a.second_scale&&a.second_scale.x_date?a.second_scale.x_date:scheduler.config.hour_date);scheduler.date["add_"+a.name]=function(b,c){return scheduler.date.add(b,
(a.x_length||a.x_size)*c*a.x_step,a.x_unit)};scheduler.date[a.name+"_start"]=scheduler.date[a.x_unit+"_start"]||scheduler.date.day_start;scheduler.attachEvent("onSchedulerResize",function(){return this._mode==a.name?(p.call(a,!0),!1):!0});scheduler.attachEvent("onOptionsLoad",function(){a.order={};scheduler.callEvent("onOptionsLoadStart",[]);for(var b=0;b<a.y_unit.length;b++)a.order[a.y_unit[b].key]=b;scheduler.callEvent("onOptionsLoadFinal",[]);scheduler._date&&a.name==scheduler._mode&&scheduler.setCurrentView(scheduler._date,
scheduler._mode)});scheduler.callEvent("onOptionsLoad",[a]);scheduler[a.name+"_view"]=function(){scheduler.renderMatrix.apply(a,arguments)};if(a.render!="cell"){var c=new Date,f=scheduler.date.add(c,a.x_step,a.x_unit).valueOf()-c.valueOf();scheduler["mouse_"+a.name]=function(b){var c=this._drag_event;if(this._drag_id)c=this.getEvent(this._drag_id),this._drag_event._dhx_changed=!0;b.x-=a.dx;for(var g=0,e=0,j=0;e<this._cols.length-1;e++)if(g+=this._cols[e],g>b.x)break;for(g=0;j<this._colsS.heights.length;j++)if(g+=
this._colsS.heights[j],g>b.y)break;b.fields={};a.y_unit[j]||(j=a.y_unit.length-1);b.fields[a.y_property]=c[a.y_property]=a.y_unit[j].key;b.x=0;this._drag_mode=="new-size"&&c.start_date*1==this._drag_start*1&&e++;var k=e>=a._trace_x.length?scheduler.date.add(a._trace_x[a._trace_x.length-1],a.x_step,a.x_unit):a._trace_x[e];b.y=Math.round((k-this._min_date)/(6E4*this.config.time_step));b.custom=!0;b.shift=f;return b}}};scheduler.render_timeline_event=function(a,b,c){var f=v(a,!1,this._step),d=v(a,!0,
this._step),i=scheduler.xy.bar_height,g=2+b*i,e=i+g-2,j=a[this.y_property];if(!this._events_height[j]||this._events_height[j]<e)this._events_height[j]=e;var k=scheduler.templates.event_class(a.start_date,a.end_date,a),k="dhx_cal_event_line "+(k||""),h=a.color?"background-color:"+a.color+";":"",o=a.textColor?"color:"+a.textColor+";":"",l='<div event_id="'+a.id+'" class="'+k+'" style="'+h+""+o+"position:absolute; top:"+g+"px; left:"+f+"px; width:"+Math.max(0,d-f)+"px;"+(a._text_style||"")+'">'+scheduler.templates.event_bar_text(a.start_date,
a.end_date,a)+"</div>";if(c){var m=document.createElement("DIV");m.innerHTML=l;var n=this.order[j],p=scheduler._els.dhx_cal_data[0].firstChild.rows[n].cells[1].firstChild;scheduler._rendered.push(m.firstChild);p.appendChild(m.firstChild)}else return l};scheduler.renderMatrix=function(a){scheduler._els.dhx_cal_data[0].scrollTop=0;var b=scheduler.date[this.name+"_start"](scheduler._date);scheduler._min_date=scheduler.date.add(b,this.x_start*this.x_step,this.x_unit);scheduler._max_date=scheduler.date.add(scheduler._min_date,
this.x_size*this.x_step,this.x_unit);scheduler._table_view=!0;if(this.second_scale){if(a&&!this._header_resized)this._header_resized=scheduler.xy.scale_height,scheduler.xy.scale_height*=2,scheduler._els.dhx_cal_header[0].className+=" dhx_second_cal_header";if(!a&&this._header_resized){scheduler.xy.scale_height/=2;this._header_resized=!1;var c=scheduler._els.dhx_cal_header[0];c.className=c.className.replace(/ dhx_second_cal_header/gi,"")}}p.call(this,a)};scheduler._locate_cell_timeline=function(a){for(var a=
a||event,b=a.target?a.target:a.srcElement;b&&b.tagName!="TD";)b=b.parentNode;if(b&&b.tagName=="TD"){var c=b.className.split(" ")[0];if(c=="dhx_matrix_cell")if(scheduler._isRender("cell"))return{x:b.cellIndex-1,y:b.parentNode.rowIndex,src:b};else{for(var f=b.parentNode;f&&f.tagName!="TD";)f=f.parentNode;return{x:b.cellIndex,y:f.parentNode.rowIndex,src:b}}else if(c=="dhx_matrix_scell")return{x:-1,y:b.parentNode.rowIndex,src:b,scale:!0}}return!1};var H=scheduler._click.dhx_cal_data;scheduler._click.dhx_cal_data=
function(a){var b=H.apply(this,arguments),c=scheduler.matrix[scheduler._mode];if(c){var f=scheduler._locate_cell_timeline(a);f&&(f.scale?scheduler.callEvent("onYScaleClick",[f.y,c.y_unit[f.y],a||event]):scheduler.callEvent("onCellClick",[f.x,f.y,c._trace_x[f.x],(c._matrix[f.y]||{})[f.x]||[],a||event]))}return b};scheduler.dblclick_dhx_matrix_cell=function(a){var b=scheduler.matrix[scheduler._mode];if(b){var c=scheduler._locate_cell_timeline(a);c&&(c.scale?scheduler.callEvent("onYScaleDblClick",[c.y,
b.y_unit[c.y],a||event]):scheduler.callEvent("onCellDblClick",[c.x,c.y,b._trace_x[c.x],(b._matrix[c.y]||{})[c.x]||[],a||event]))}};scheduler.dblclick_dhx_matrix_scell=function(a){return scheduler.dblclick_dhx_matrix_cell(a)};scheduler._isRender=function(a){return scheduler.matrix[scheduler._mode]&&scheduler.matrix[scheduler._mode].render==a};scheduler.attachEvent("onCellDblClick",function(a,b,c,f,d){if(!(this.config.readonly||d.type=="dblclick"&&!this.config.dblclick_create)){var i=scheduler.matrix[scheduler._mode],
g={};g.start_date=i._trace_x[a];g.end_date=i._trace_x[a+1]?i._trace_x[a+1]:scheduler.date.add(i._trace_x[a],i.x_step,i.x_unit);g[scheduler.matrix[scheduler._mode].y_property]=i.y_unit[b].key;scheduler.addEventNow(g,null,d)}});scheduler.attachEvent("onBeforeDrag",function(){return scheduler._isRender("cell")?!1:!0})})();
(function(){function E(){for(var a=scheduler.get_visible_events(),c=[],b=0;b<this.y_unit.length;b++)c[b]=[];c[e]||(c[e]=[]);for(b=0;b<a.length;b++){for(var e=this.order[a[b][this.y_property]],f=0;this._trace_x[f+1]&&a[b].start_date>=this._trace_x[f+1];)f++;for(;this._trace_x[f]&&a[b].end_date>this._trace_x[f];)c[e][f]||(c[e][f]=[]),c[e][f].push(a[b]),f++}return c}function t(a,c,b){var e=0,f=c?a.end_date:a.start_date;if(f.valueOf()>scheduler._max_date.valueOf())f=scheduler._max_date;var g=f-scheduler._min_date_timeline;
if(g<0)k=0;else{var i=Math.round(g/(b*scheduler._cols[0]));if(i>scheduler._cols.length)i=scheduler._cols.length;for(var d=0;d<i;d++)e+=scheduler._cols[d];var j=scheduler.date.add(scheduler._min_date_timeline,scheduler.matrix[scheduler._mode].x_step*i,scheduler.matrix[scheduler._mode].x_unit),g=f-j,k=Math.floor(g/b)}e+=c?k-14:k+1;return e}function F(a){var c="";if(a&&this.render!="cell"){a.sort(function(a,b){return a.start_date.valueOf()==b.start_date.valueOf()?a.id>b.id?1:-1:a.start_date>b.start_date?
1:-1});for(var b=[],e=a.length,f=0;f<e;f++){var g=a[f];for(g._inner=!1;b.length;)if(b[b.length-1].end_date.valueOf()<=g.start_date.valueOf())b.splice(b.length-1,1);else break;for(var i=!1,d=0;d<b.length;d++){var j=b[d];if(j.end_date.valueOf()<=g.start_date.valueOf()){i=!0;g._sorder=j._sorder;b.splice(d,1);g._inner=!0;break}}if(b.length)b[b.length-1]._inner=!0;if(!i)if(b.length)if(b.length<=b[b.length-1]._sorder){if(b[b.length-1]._sorder)for(var k=0;k<b.length;k++){for(var h=!1,l=0;l<b.length;l++)if(b[l]._sorder==
k){h=!0;break}if(!h){g._sorder=k;break}}else g._sorder=0;g._inner=!0}else{for(var h=b[0]._sorder,m=1;m<b.length;m++)if(b[m]._sorder>h)h=b[m]._sorder;g._sorder=h+1;g._inner=!1}else g._sorder=0;b.push(g);b.length>(b.max_count||0)?(b.max_count=b.length,g._count=b.length):g._count=g._count?g._count:1}for(var n=0;n<a.length;n++)a[n]._count=b.max_count;for(var o=0;o<e;o++)c+=scheduler.render_timeline_event.call(this,a[o],!1)}return c}function G(a){var c="<table style='table-layout:fixed;' cellspacing='0' cellpadding='0'>",
b=[];scheduler._load_mode&&scheduler._load();if(this.render=="cell")b=E.call(this);else for(var e=scheduler.get_visible_events(),f=0;f<e.length;f++){var g=this.order[e[f][this.y_property]];b[g]||(b[g]=[]);b[g].push(e[f])}for(var i=0,d=0;d<scheduler._cols.length;d++)i+=scheduler._cols[d];var j=new Date;this._step=j=(scheduler.date.add(j,this.x_step*this.x_size,this.x_unit)-j)/i;this._summ=i;var k=scheduler._colsS.heights=[];this._events_height={};this._section_height={};for(d=0;d<this.y_unit.length;d++){var h=
this._logic(this.render,this.y_unit[d],this);scheduler._merge(h,{height:this.dy});if(this.section_autoheight){if(this.y_unit.length*h.height<a.offsetHeight)h.height=Math.max(h.height,Math.floor((a.offsetHeight-1)/this.y_unit.length));this._section_height[this.y_unit[d].key]=h.height}scheduler._merge(h,{tr_className:"",style_height:"height:"+h.height+"px;",style_width:"width:"+(this.dx-1)+"px;",td_className:"dhx_matrix_scell"+(scheduler.templates[this.name+"_scaley_class"](this.y_unit[d].key,this.y_unit[d].label,
this.y_unit[d])?" "+scheduler.templates[this.name+"_scaley_class"](this.y_unit[d].key,this.y_unit[d].label,this.y_unit[d]):""),td_content:scheduler.templates[this.name+"_scale_label"](this.y_unit[d].key,this.y_unit[d].label,this.y_unit[d]),summ_width:"width:"+i+"px;",table_className:""});var l=F.call(this,b[d]);if(this.fit_events){var m=this._events_height[this.y_unit[d].key]||0;h.height=m>h.height?m:h.height;h.style_height="height:"+h.height+"px;";this._section_height[this.y_unit[d].key]=h.height}c+=
"<tr class='"+h.tr_className+"' style='"+h.style_height+"'><td class='"+h.td_className+"' style='"+h.style_width+" height:"+(h.height-1)+"px;'>"+h.td_content+"</td>";if(this.render=="cell")for(f=0;f<scheduler._cols.length;f++)c+="<td class='dhx_matrix_cell "+scheduler.templates[this.name+"_cell_class"](b[d][f],this._trace_x[f],this.y_unit[d])+"' style='width:"+(scheduler._cols[f]-1)+"px'><div style='width:"+(scheduler._cols[f]-1)+"px'>"+scheduler.templates[this.name+"_cell_value"](b[d][f])+"</div></td>";
else{c+="<td><div style='"+h.summ_width+" "+h.style_height+" position:relative;' class='dhx_matrix_line'>";c+=l;c+="<table class='"+h.table_className+"' cellpadding='0' cellspacing='0' style='"+h.summ_width+" "+h.style_height+"' >";for(f=0;f<scheduler._cols.length;f++)c+="<td class='dhx_matrix_cell "+scheduler.templates[this.name+"_cell_class"](b[d],this._trace_x[f],this.y_unit[d])+"' style='width:"+(scheduler._cols[f]-1)+"px'><div style='width:"+(scheduler._cols[f]-1)+"px'></div></td>";c+="</table>";
c+="</div></td>"}c+="</tr>"}c+="</table>";this._matrix=b;a.innerHTML=c;scheduler._rendered=[];for(var n=scheduler._obj.getElementsByTagName("DIV"),d=0;d<n.length;d++)n[d].getAttribute("event_id")&&scheduler._rendered.push(n[d]);this._scales={};for(d=0;d<a.firstChild.rows.length;d++){k.push(a.firstChild.rows[d].offsetHeight);var o=this.y_unit[d].key,p=this._scales[o]=scheduler._isRender("cell")?a.firstChild.rows[d]:a.firstChild.rows[d].childNodes[1].getElementsByTagName("div")[0];scheduler.callEvent("onScaleAdd",
[p,o])}}function H(a){var c=scheduler.xy.scale_height,b=this._header_resized||scheduler.xy.scale_height;scheduler._cols=[];scheduler._colsS={height:0};this._trace_x=[];var e=scheduler._x-this.dx-18,f=[this.dx],g=scheduler._els.dhx_cal_header[0];g.style.width=f[0]+e+"px";for(var i=scheduler._min_date_timeline=scheduler._min_date,d=0;d<this.x_size;d++)this._trace_x[d]=new Date(i),i=scheduler.date.add(i,this.x_step,this.x_unit),scheduler._cols[d]=Math.floor(e/(this.x_size-d)),e-=scheduler._cols[d],f[d+
1]=f[d]+scheduler._cols[d];a.innerHTML="<div></div>";if(this.second_scale){for(var j=this.second_scale.x_unit,k=[this._trace_x[0]],h=[],l=[this.dx,this.dx],m=0,n=0;n<this._trace_x.length;n++){var o=this._trace_x[n],p=z(j,o,k[m]);p&&(++m,k[m]=o,l[m+1]=l[m]);var r=m+1;h[m]=scheduler._cols[n]+(h[m]||0);l[r]+=scheduler._cols[n]}a.innerHTML="<div></div><div></div>";var u=a.firstChild;u.style.height=b+"px";var s=a.lastChild;s.style.position="relative";for(var v=0;v<k.length;v++){var t=k[v],x=scheduler.templates[this.name+
"_second_scalex_class"](t),w=document.createElement("DIV");w.className="dhx_scale_bar dhx_second_scale_bar"+(x?" "+x:"");scheduler.set_xy(w,h[v]-1,b-3,l[v],0);w.innerHTML=scheduler.templates[this.name+"_second_scale_date"](t);u.appendChild(w)}}scheduler.xy.scale_height=b;for(var a=a.lastChild,q=0;q<this._trace_x.length;q++){i=this._trace_x[q];scheduler._render_x_header(q,f[q],i,a);var y=scheduler.templates[this.name+"_scalex_class"](i);y&&(a.lastChild.className+=" "+y)}scheduler.xy.scale_height=c;
var A=this._trace_x;a.onclick=function(a){var b=B(a);b&&scheduler.callEvent("onXScaleClick",[b.x,A[b.x],a||event])};a.ondblclick=function(a){var b=B(a);b&&scheduler.callEvent("onXScaleDblClick",[b.x,A[b.x],a||event])}}function z(a,c,b){switch(a){case "hour":return c.getHours()!=b.getHours()||z("day",c,b);case "day":return!(c.getDate()==b.getDate()&&c.getMonth()==b.getMonth()&&c.getFullYear()==b.getFullYear());case "week":return!(scheduler.date.getISOWeek(c)==scheduler.date.getISOWeek(b)&&c.getFullYear()==
b.getFullYear());case "month":return!(c.getMonth()==b.getMonth()&&c.getFullYear()==b.getFullYear());case "year":return c.getFullYear()!=b.getFullYear();default:return!1}}function I(a){if(a){scheduler.set_sizes();C();var c=scheduler._min_date;H.call(this,scheduler._els.dhx_cal_header[0]);G.call(this,scheduler._els.dhx_cal_data[0]);scheduler._min_date=c;scheduler._els.dhx_cal_date[0].innerHTML=scheduler.templates[this.name+"_date"](scheduler._min_date,scheduler._max_date)}}function D(){if(scheduler._tooltip)scheduler._tooltip.style.display=
"none",scheduler._tooltip.date=""}function J(a,c,b){if(a.render=="cell"){var e=c.x+"_"+c.y,f=a._matrix[c.y][c.x];if(!f)return D();f.sort(function(a,b){return a.start_date>b.start_date?1:-1});if(scheduler._tooltip){if(scheduler._tooltip.date==e)return;scheduler._tooltip.innerHTML=""}else{var g=scheduler._tooltip=document.createElement("DIV");g.className="dhx_tooltip";document.body.appendChild(g);g.onclick=scheduler._click.dhx_cal_data}for(var i="",d=0;d<f.length;d++){var j=f[d].color?"background-color:"+
f[d].color+";":"",k=f[d].textColor?"color:"+f[d].textColor+";":"";i+="<div class='dhx_tooltip_line' event_id='"+f[d].id+"' style='"+j+""+k+"'>";i+="<div class='dhx_tooltip_date'>"+(f[d]._timed?scheduler.templates.event_date(f[d].start_date):"")+"</div>";i+="<div class='dhx_event_icon icon_details'>&nbsp;</div>";i+=scheduler.templates[a.name+"_tooltip"](f[d].start_date,f[d].end_date,f[d])+"</div>"}scheduler._tooltip.style.display="";scheduler._tooltip.style.top="0px";scheduler._tooltip.style.left=
document.body.offsetWidth-b.left-scheduler._tooltip.offsetWidth<0?b.left-scheduler._tooltip.offsetWidth+"px":b.left+c.src.offsetWidth+"px";scheduler._tooltip.date=e;scheduler._tooltip.innerHTML=i;scheduler._tooltip.style.top=document.body.offsetHeight-b.top-scheduler._tooltip.offsetHeight<0?b.top-scheduler._tooltip.offsetHeight+c.src.offsetHeight+"px":b.top+"px"}}function C(){dhtmlxEvent(scheduler._els.dhx_cal_data[0],"mouseover",function(a){var c=scheduler.matrix[scheduler._mode];if(c&&c.render==
"cell"){if(c){var b=scheduler._locate_cell_timeline(a),a=a||event,e=a.target||a.srcElement;if(b)return J(c,b,getOffset(b.src))}D()}});C=function(){}}function K(a){for(var c=a.parentNode.childNodes,b=0;b<c.length;b++)if(c[b]==a)return b;return-1}function B(a){for(var a=a||event,c=a.target?a.target:a.srcElement;c&&c.tagName!="DIV";)c=c.parentNode;if(c&&c.tagName=="DIV"){var b=c.className.split(" ")[0];if(b=="dhx_scale_bar")return{x:K(c),y:-1,src:c,scale:!0}}}scheduler.matrix={};scheduler._merge=function(a,
c){for(var b in c)typeof a[b]=="undefined"&&(a[b]=c[b])};scheduler.createTimelineView=function(a){scheduler._merge(a,{section_autoheight:!0,name:"matrix",x:"time",y:"time",x_step:1,x_unit:"hour",y_unit:"day",y_step:1,x_start:0,x_size:24,y_start:0,y_size:7,render:"cell",dx:200,dy:50,event_dy:scheduler.xy.bar_height-5,event_min_dy:scheduler.xy.bar_height-5,resize_events:!0,fit_events:!0,second_scale:!1,_logic:function(a,b,c){var d={};scheduler.checkEvent("onBeforeViewRender")&&(d=scheduler.callEvent("onBeforeViewRender",
[a,b,c]));return d}});scheduler.checkEvent("onTimelineCreated")&&scheduler.callEvent("onTimelineCreated",[a]);var c=scheduler.render_data;scheduler.render_data=function(b,g){if(this._mode==a.name)if(g)for(var i=0;i<b.length;i++)this.clear_event(b[i]),this.render_timeline_event.call(this.matrix[this._mode],b[i],!0);else scheduler.renderMatrix.call(a,!0,!0);else return c.apply(this,arguments)};scheduler.matrix[a.name]=a;scheduler.templates[a.name+"_cell_value"]=function(a){return a?a.length:""};scheduler.templates[a.name+
"_cell_class"]=function(){return""};scheduler.templates[a.name+"_scalex_class"]=function(){return""};scheduler.templates[a.name+"_second_scalex_class"]=function(){return""};scheduler.templates[a.name+"_scaley_class"]=function(){return""};scheduler.templates[a.name+"_scale_label"]=function(a,b){return b};scheduler.templates[a.name+"_tooltip"]=function(a,b,c){return c.text};scheduler.templates[a.name+"_date"]=function(a,b){return a.getDay()==b.getDay()&&b-a<864E5?scheduler.templates.day_date(a):scheduler.templates.week_date(a,
b)};scheduler.templates[a.name+"_scale_date"]=scheduler.date.date_to_str(a.x_date||scheduler.config.hour_date);scheduler.templates[a.name+"_second_scale_date"]=scheduler.date.date_to_str(a.second_scale&&a.second_scale.x_date?a.second_scale.x_date:scheduler.config.hour_date);scheduler.date["add_"+a.name]=function(b,c){return scheduler.date.add(b,(a.x_length||a.x_size)*c*a.x_step,a.x_unit)};scheduler.date[a.name+"_start"]=function(b){var c=scheduler.date[a.x_unit+"_start"]||scheduler.date.day_start,
e=c.call(scheduler.date,b);return e=scheduler.date.add(e,a.x_step*a.x_start,a.x_unit)};scheduler.attachEvent("onSchedulerResize",function(){return this._mode==a.name?(scheduler.renderMatrix.call(a,!0,!0),!1):!0});scheduler.attachEvent("onOptionsLoad",function(){a.order={};scheduler.callEvent("onOptionsLoadStart",[]);for(var b=0;b<a.y_unit.length;b++)a.order[a.y_unit[b].key]=b;scheduler.callEvent("onOptionsLoadFinal",[]);scheduler._date&&a.name==scheduler._mode&&scheduler.setCurrentView(scheduler._date,
scheduler._mode)});scheduler.callEvent("onOptionsLoad",[a]);scheduler[a.name+"_view"]=function(){scheduler.renderMatrix.apply(a,arguments)};var b=new Date,e=scheduler.date.add(b,a.x_step,a.x_unit).valueOf()-b.valueOf();scheduler["mouse_"+a.name]=function(b){var c=this._drag_event;if(this._drag_id)c=this.getEvent(this._drag_id),this._drag_event._dhx_changed=!0;b.x-=a.dx;for(var e=0,d=0,j=0;d<=this._cols.length-1;d++){var k=this._cols[d];e+=k;if(e>b.x){var h=(b.x-(e-k))/k,h=h<0?0:h;break}}for(e=0;j<
this._colsS.heights.length;j++)if(e+=this._colsS.heights[j],e>b.y)break;b.fields={};a.y_unit[j]||(j=a.y_unit.length-1);if(j>=0&&a.y_unit[j]&&(b.section=b.fields[a.y_property]=a.y_unit[j].key,c))c[a.y_property]=b.section;b.x=0;var l;if(d>=a._trace_x.length)l=scheduler.date.add(a._trace_x[a._trace_x.length-1],a.x_step,a.x_unit);else{var m=a._trace_x[d+1]?a._trace_x[d+1]:scheduler.date.add(a._trace_x[a._trace_x.length-1],a.x_step,a.x_unit),n=Math.ceil(h*(m-a._trace_x[d]));l=new Date(+a._trace_x[d]+n)}if(this._drag_mode==
"move"&&this._drag_id&&this._drag_event){var c=this.getEvent(this._drag_id),o=this._drag_event;if(!o._move_delta)o._move_delta=(c.start_date-l)/6E4;l=scheduler.date.add(l,o._move_delta,"minute")}if(this._drag_mode=="resize"&&c)b.resize_from_start=!!(Math.abs(c.start_date-l)<Math.abs(c.end_date-l));b.y=Math.round((l-this._min_date)/(6E4*this.config.time_step));b.custom=!0;b.shift=this.config.time_step;return b}};scheduler.render_timeline_event=function(a,c){var b=a[this.y_property],e=a._sorder,f=t(a,
!1,this._step),g=t(a,!0,this._step),i=this.event_dy;this.event_dy=="full"&&(i=this.section_autoheight?this._section_height[b]-6:this.dy-3);this.resize_events&&(i=Math.max(Math.floor(i/a._count),this.event_min_dy));var d=i-2;!a._inner&&this.event_dy=="full"&&(d=(d+2)*(a._count-e)-2);var j=2+e*i+(e?e*2:0);scheduler.config.cascade_event_display&&(j=2+e*scheduler.config.cascade_event_margin+(e?e*2:0));var k=i+j+2;if(!this._events_height[b]||this._events_height[b]<k)this._events_height[b]=k;var h=scheduler.templates.event_class(a.start_date,
a.end_date,a),h="dhx_cal_event_line "+(h||""),l=a.color?"background:"+a.color+";":"",m=a.textColor?"color:"+a.textColor+";":"",n=scheduler.templates.event_bar_text(a.start_date,a.end_date,a),o='<div event_id="'+a.id+'" class="'+h+'" style="'+l+""+m+"position:absolute; top:"+j+"px; height: "+d+"px; left:"+f+"px; width:"+Math.max(0,g-f)+"px;"+(a._text_style||"")+'">';if(scheduler.config.drag_resize){var p="dhx_event_resize";o+="<div class='"+p+" "+p+"_start' style='height: "+d+"px;'></div><div class='"+
p+" "+p+"_end' style='height: "+d+"px;'></div>"}o+=n+"</div>";if(c){var r=document.createElement("DIV");r.innerHTML=o;var u=this.order[b],s=scheduler._els.dhx_cal_data[0].firstChild.rows[u].cells[1].firstChild;scheduler._rendered.push(r.firstChild);s.appendChild(r.firstChild)}else return o};scheduler.renderMatrix=function(a,c){if(!c)scheduler._els.dhx_cal_data[0].scrollTop=0;scheduler._min_date=scheduler.date[this.name+"_start"](scheduler._date);scheduler._max_date=scheduler.date.add(scheduler._min_date,
this.x_size*this.x_step,this.x_unit);scheduler._table_view=!0;if(this.second_scale){if(a&&!this._header_resized)this._header_resized=scheduler.xy.scale_height,scheduler.xy.scale_height*=2,scheduler._els.dhx_cal_header[0].className+=" dhx_second_cal_header";if(!a&&this._header_resized){scheduler.xy.scale_height/=2;this._header_resized=!1;var b=scheduler._els.dhx_cal_header[0];b.className=b.className.replace(/ dhx_second_cal_header/gi,"")}}I.call(this,a)};scheduler._locate_cell_timeline=function(a){for(var a=
a||event,c=a.target?a.target:a.srcElement,b={},e=scheduler.matrix[scheduler._mode],f=scheduler.getActionData(a),g=0;g<e._trace_x.length-1;g++)if(+f.date<=e._trace_x[g+1])break;b.x=g;b.y=e.order[f.section];var i=scheduler._isRender("cell")?1:0;b.src=e._scales[f.section].getElementsByTagName("td")[g+i];if(c.className.split(" ")[0]=="dhx_matrix_scell")b.x=-1,b.src=c,b.scale=!0;return b};var L=scheduler._click.dhx_cal_data;scheduler._click.dhx_marked_timespan=scheduler._click.dhx_cal_data=function(a){var c=
L.apply(this,arguments),b=scheduler.matrix[scheduler._mode];if(b){var e=scheduler._locate_cell_timeline(a);e&&(e.scale?scheduler.callEvent("onYScaleClick",[e.y,b.y_unit[e.y],a||event]):scheduler.callEvent("onCellClick",[e.x,e.y,b._trace_x[e.x],(b._matrix[e.y]||{})[e.x]||[],a||event]))}return c};scheduler.dblclick_dhx_marked_timespan=scheduler.dblclick_dhx_matrix_cell=function(a){var c=scheduler.matrix[scheduler._mode];if(c){var b=scheduler._locate_cell_timeline(a);b&&(b.scale?scheduler.callEvent("onYScaleDblClick",
[b.y,c.y_unit[b.y],a||event]):scheduler.callEvent("onCellDblClick",[b.x,b.y,c._trace_x[b.x],(c._matrix[b.y]||{})[b.x]||[],a||event]))}};scheduler.dblclick_dhx_matrix_scell=function(a){return scheduler.dblclick_dhx_matrix_cell(a)};scheduler._isRender=function(a){return scheduler.matrix[scheduler._mode]&&scheduler.matrix[scheduler._mode].render==a};scheduler.attachEvent("onCellDblClick",function(a,c,b,e,f){if(!(this.config.readonly||f.type=="dblclick"&&!this.config.dblclick_create)){var g=scheduler.matrix[scheduler._mode],
i={};i.start_date=g._trace_x[a];i.end_date=g._trace_x[a+1]?g._trace_x[a+1]:scheduler.date.add(g._trace_x[a],g.x_step,g.x_unit);i[scheduler.matrix[scheduler._mode].y_property]=g.y_unit[c].key;scheduler.addEventNow(i,null,f)}});scheduler.attachEvent("onBeforeDrag",function(){return!scheduler._isRender("cell")});scheduler.attachEvent("onEventChanged",function(a,c){c._timed=this.is_one_day_event(c)});var M=scheduler._render_marked_timespan;scheduler._render_marked_timespan=function(a,c,b){if(!scheduler.config.display_marked_timespans)return[];
if(scheduler.matrix&&scheduler.matrix[scheduler._mode]){if(!scheduler._isRender("cell")){var e=scheduler.matrix[scheduler._mode],f=[],g=[],i=[];if(b)i=[c],g=[b];else{var d=e.order,j;for(j in d)d.hasOwnProperty(j)&&(g.push(j),i.push(e._scales[j]))}var k=scheduler._min_date,h=scheduler._max_date,l=[];if(a.days>6){var m=new Date(a.days);scheduler.date.date_part(new Date(k))<=+m&&+h>=+m&&l.push(m)}else l.push.apply(l,scheduler._get_dates_by_index(a.days));for(var n=a.zones,o=scheduler._get_css_classes_by_config(a),
p=0;p<g.length;p++)for(var c=i[p],b=g[p],r=0;r<l.length;r++)for(var u=l[r],s=0;s<n.length;s+=2){var v=n[s],z=n[s+1],x=new Date(+u+v*6E4),w=new Date(+u+z*6E4);if(scheduler._min_date<w&&scheduler._max_date>x){var q=scheduler._get_block_by_config(a);q.className=o;var y=t({start_date:x},!1,e._step)-1,A=t({start_date:w},!1,e._step)-1,B=A-y-1,C=e._section_height[b]-1;q.style.cssText="height: "+C+"px; left: "+y+"px; width: "+B+"px; top: 0;";c.insertBefore(q,c.firstChild);f.push(q)}}return f}}else return M.apply(scheduler,
[a,c,b])};var N=scheduler._append_mark_now;scheduler._append_mark_now=function(a){if(scheduler.matrix&&scheduler.matrix[scheduler._mode]){var c=new Date,b=scheduler._get_zone_minutes(c),e={days:+scheduler.date.date_part(c),zones:[b,b+1],css:"dhx_matrix_now_time",type:"dhx_now_time"};return scheduler._render_marked_timespan(e)}else return N.apply(scheduler,[a])};scheduler.attachEvent("onViewChange",function(a,c){scheduler.matrix&&scheduler.matrix[c]&&scheduler.markNow&&scheduler.markNow()});scheduler.attachEvent("onScaleAdd",
function(a,c){var b=scheduler._marked_timespans;if(b&&scheduler.matrix&&scheduler.matrix[scheduler._mode])for(var e=scheduler._mode,f=scheduler._min_date,g=scheduler._max_date,i=b.global,d=scheduler.date.date_part(new Date(f));d<g;d=scheduler.date.add(d,1,"day")){var j=+d,k=d.getDay(),h=[],l=i[j]||i[k];h.push.apply(h,scheduler._get_configs_to_render(l));if(b[e]&&b[e][c]){var m=scheduler._get_types_to_render(b[e][c][k],b[e][c][j]);h.push.apply(h,scheduler._get_configs_to_render(m))}for(var n=0;n<h.length;n++){var o=
h[n],p=o.days;p<7?(p=j,scheduler._render_marked_timespan(o,a,c),p=k):scheduler._render_marked_timespan(o,a,c)}}})})();

View File

@ -1,11 +1,12 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
window.dhtmlXTooltip={};dhtmlXTooltip.config={className:"dhtmlXTooltip tooltip",timeout_to_display:50,delta_x:15,delta_y:-20};dhtmlXTooltip.tooltip=document.createElement("div");dhtmlXTooltip.tooltip.className=dhtmlXTooltip.config.className;
dhtmlXTooltip.show=function(b,d){var c=dhtmlXTooltip,f=this.tooltip,a=f.style;c.tooltip.className=c.config.className;var e=this.position(b),k=b.target||b.srcElement;if(!this.isTooltip(k)){var g=0,l=0,h=scheduler._obj;if(h.offsetParent){do g+=h.offsetLeft,l+=h.offsetTop;while(h=h.offsetParent)}var i=e.x+(c.config.delta_x||0)-g,j=e.y-(c.config.delta_y||0)-l;a.visibility="hidden";a.removeAttribute?(a.removeAttribute("right"),a.removeAttribute("bottom")):(a.removeProperty("right"),a.removeProperty("bottom"));
a.left="0";a.top="0";this.tooltip.innerHTML=d;scheduler._obj.appendChild(this.tooltip);var m=this.tooltip.offsetWidth,n=this.tooltip.offsetHeight;scheduler._obj.offsetWidth-i-(scheduler.xy.margin_left||0)-m<0?(a.removeAttribute?a.removeAttribute("left"):a.removeProperty("left"),a.right=scheduler._obj.offsetWidth-i+2*(c.config.delta_x||0)+"px"):a.left=i<0?e.x+Math.abs(c.config.delta_x||0)+"px":i+"px";scheduler._obj.offsetHeight-j-(scheduler.xy.margin_top||0)-n<0?(a.removeAttribute?a.removeAttribute("top"):
a.removeProperty("top"),a.bottom=scheduler._obj.offsetHeight-j-2*(c.config.delta_y||0)+"px"):a.top=j<0?e.y+Math.abs(c.config.delta_y||0)+"px":j+"px";a.visibility="visible"}};dhtmlXTooltip.hide=function(){this.tooltip.parentNode&&this.tooltip.parentNode.removeChild(this.tooltip)};dhtmlXTooltip.delay=function(b,d,c,f){this.tooltip._timeout_id&&window.clearTimeout(this.tooltip._timeout_id);this.tooltip._timeout_id=setTimeout(function(){var a=b.apply(d,c);b=d=c=null;return a},f||this.config.timeout_to_display)};
dhtmlXTooltip.isTooltip=function(b){for(var d=!1;b&&!d;)d=b.className==this.tooltip.className,b=b.parentNode;return d};dhtmlXTooltip.position=function(b){b=b||window.event;if(b.pageX||b.pageY)return{x:b.pageX,y:b.pageY};var d=dhtmlx._isIE&&document.compatMode!="BackCompat"?document.documentElement:document.body;return{x:b.clientX+d.scrollLeft-d.clientLeft,y:b.clientY+d.scrollTop-d.clientTop}};
scheduler.attachEvent("onMouseMove",function(b,d){var c=window.event||d,f=c.target||c.srcElement,a=dhtmlXTooltip;if(b||a.isTooltip(f)){var e=scheduler.getEvent(b)||scheduler.getEvent(a.tooltip.event_id);if(e){a.tooltip.event_id=e.id;var k=scheduler.templates.tooltip_text(e.start_date,e.end_date,e),g=void 0;_isIE&&(g=document.createEventObject(c));a.delay(a.show,a,[g||c,k])}}else a.delay(a.hide,a,[])});scheduler.attachEvent("onBeforeDrag",function(){dhtmlXTooltip.hide();return!0});
scheduler.templates.tooltip_date_format=scheduler.date.date_to_str("%Y-%m-%d %H:%i");scheduler.templates.tooltip_text=function(b,d,c){return"<b>Event:</b> "+c.text+"<br/><b>Start date:</b> "+scheduler.templates.tooltip_date_format(b)+"<br/><b>End date:</b> "+scheduler.templates.tooltip_date_format(d)};
dhtmlXTooltip.show=function(b,d){var c=dhtmlXTooltip,f=this.tooltip,a=f.style;c.tooltip.className=c.config.className;var e=this.position(b),g=b.target||b.srcElement;if(!this.isTooltip(g)){var h=0,l=0,i=scheduler._obj;if(i.offsetParent){do h+=i.offsetLeft,l+=i.offsetTop;while(i=i.offsetParent)}var j=e.x+(c.config.delta_x||0)-h,k=e.y-(c.config.delta_y||0)-l;a.visibility="hidden";a.removeAttribute?(a.removeAttribute("right"),a.removeAttribute("bottom")):(a.removeProperty("right"),a.removeProperty("bottom"));
a.left="0";a.top="0";this.tooltip.innerHTML=d;scheduler._obj.appendChild(this.tooltip);var n=this.tooltip.offsetWidth,o=this.tooltip.offsetHeight,m=scheduler._obj.parentNode.scrollLeft||0,p=Math.min(scheduler._obj.offsetWidth,scheduler._obj.parentNode.offsetWidth);p-j-(scheduler.xy.margin_left||0)-n<0?(a.removeAttribute?a.removeAttribute("left"):a.removeProperty("left"),a.right=scheduler._obj.offsetWidth-m-j+2*(c.config.delta_x||0)+"px"):a.left=j<0?e.x+Math.abs(c.config.delta_x||0)+"px":j+m+"px";
scheduler._obj.offsetHeight-k-(scheduler.xy.margin_top||0)-o<0?(a.removeAttribute?a.removeAttribute("top"):a.removeProperty("top"),a.bottom=scheduler._obj.offsetHeight-k-2*(c.config.delta_y||0)+"px"):a.top=k<0?e.y+Math.abs(c.config.delta_y||0)+"px":k+"px";a.visibility="visible"}};dhtmlXTooltip.hide=function(){this.tooltip.parentNode&&this.tooltip.parentNode.removeChild(this.tooltip)};
dhtmlXTooltip.delay=function(b,d,c,f){this.tooltip._timeout_id&&window.clearTimeout(this.tooltip._timeout_id);this.tooltip._timeout_id=setTimeout(function(){var a=b.apply(d,c);b=d=c=null;return a},f||this.config.timeout_to_display)};dhtmlXTooltip.isTooltip=function(b){for(var d=!1;b&&!d;)d=b.className==this.tooltip.className,b=b.parentNode;return d};
dhtmlXTooltip.position=function(b){b=b||window.event;if(b.pageX||b.pageY)return{x:b.pageX,y:b.pageY};var d=window._isIE&&document.compatMode!="BackCompat"?document.documentElement:document.body;return{x:b.clientX+d.scrollLeft-d.clientLeft,y:b.clientY+d.scrollTop-d.clientTop}};
scheduler.attachEvent("onMouseMove",function(b,d){var c=window.event||d,f=c.target||c.srcElement,a=dhtmlXTooltip;if(b||a.isTooltip(f)){var e=scheduler.getEvent(b)||scheduler.getEvent(a.tooltip.event_id);if(e){a.tooltip.event_id=e.id;var g=scheduler.templates.tooltip_text(e.start_date,e.end_date,e);if(!g)return a.hide();var h=void 0;_isIE&&(h=document.createEventObject(c));scheduler.callEvent("onBeforeTooltip",[b,e])&&g&&a.delay(a.show,a,[h||c,g])}}else a.delay(a.hide,a,[])});
scheduler.attachEvent("onBeforeDrag",function(){dhtmlXTooltip.hide();return!0});scheduler.attachEvent("onEventDeleted",function(){dhtmlXTooltip.hide();return!0});scheduler.templates.tooltip_date_format=scheduler.date.date_to_str("%Y-%m-%d %H:%i");scheduler.templates.tooltip_text=function(b,d,c){return"<b>Event:</b> "+c.text+"<br/><b>Start date:</b> "+scheduler.templates.tooltip_date_format(b)+"<br/><b>End date:</b> "+scheduler.templates.tooltip_date_format(d)};

View File

@ -1,5 +0,0 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
*/
.dhx_cal_prev_button,.dhx_cal_next_button,.dhx_cal_today_button,.dhx_cal_add_button{top:6px!important;left:10px;border:1px solid #575D65;border-top:1px solid #4E5052;color:#FFF;text-shadow:0 -1px 0 #65696E;background-image:-webkit-gradient(linear,left top,left bottom,from(#B2B6BC),to(#6B737E));background-color:#989B9F;background-position:0 1px;background-repeat:repeat-x;-webkit-border-radius:5px;padding:3px;text-align:center;text-decoration:none;}.dhx_cal_today_button{left:55px;}.dhx_cal_next_button{left:146px;}.dhx_cal_add_button{right:9px;left:auto;width:20px;font-size:20px;padding:1px 2px 2px 2px;}.dhx_cal_navline .dhx_cal_date{top:7px;left:160px;right:350px;padding-top:4px;width:auto;text-align:center;color:#4F5459;}.dhx_cal_navline{background:-webkit-gradient(linear,0% 0,0% 100%,color-stop(0,#F4F5F8),color-stop(0.3,#F1F2F4),color-stop(0.7,#C4C7D0),color-stop(1,#A6AAB7));border-bottom:1px solid #797F90;height:40px!important;font-family:Helvetica;font-weight:bold;font-size:13px;}.dhx_cal_tab{top:6px!important;color:#4F5459;text-align:center;padding:5px 10px;width:80px;background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#F7F7F7),to(#B9BDC7));background-color:#CFD0D1;background-position:0 1px;background-repeat:repeat-x;text-decoration:none;border:1px solid #95989F;border-top:1px solid #686A6A;height:16px;}.dhx_cal_tab.active{background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#B0B2B6),to(#666D74));background-color:#949799;background-position:0 1px;background-repeat:repeat-x;border:1px solid #4C4D4F;border-top:1px solid #52585C;color:#F8F8F8;text-shadow:0 -1px 0 #5E6063;text-decoration:none;height:16px;padding:5px 10px;z-index:100;}.dhx_cal_light{-webkit-transition:-webkit-transform;-webkit-transform-style:preserve-3d;}.dhx_cal_cover{opacity:.5;}.dhx_cal_ltext{padding-top:0;padding-bottom:0;}.dhx_cal_ltext textarea{-webkit-background-size:0;-webkit-border-radius:0;height:94%;}.dhx_mini_calendar .dhx_month_head{height:35px;line-height:35px;text-align:center;padding-right:0;padding-left:0;}.dhx_mini_calendar .dhx_year_month{height:35px;line-height:30px;background:-webkit-gradient(linear,0% 0,0% 100%,from(#F4F5F8),to(#8A8E9A));font-family:Helvetica;font-weight:bold;font-size:13px;}.dhx_mini_calendar .dhx_year_month .dhx_cal_prev_button,.dhx_mini_calendar .dhx_year_month .dhx_cal_next_button{line-height:normal;}

View File

@ -1,26 +0,0 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
*/
TouchScroll=function(a,b,c,e){this.debug=!!b;this.compat=!!e;this.rough=!!c;this.axisX=this.axisY=!0;typeof a!="object"&&(a=document.getElementById(a));this._init();a.addEventListener("touchstart",this,!1);a.addEventListener("webkitTransitionEnd",this,!1);this.debug&&a.addEventListener("mousedown",this,!1);this.node=a;for(var d=0;d<a.childNodes.length;d++)if(a.childNodes[d].nodeType==1){this.area=a.childNodes[d];break}if(window.getComputedStyle(this.node).position=="static")this.node.style.position=
"relative";this.area.style.cssText+="-webkit-transition: -webkit-transform; -webkit-user-select:none; -webkit-transform-style:preserve-3d;";this.scrolls={}};
TouchScroll.prototype={refresh:function(){this.node.style.webkitTransformStyle="flat";this.node.style.webkitTransformStyle="preserve-3d"},scrollTo:function(a,b,c){this.set_matrix({e:a,f:b},c||0)},onscroll:function(){},handleEvent:function(a){return this["ev_"+a.type](a)},get_matrix:function(a){return new WebKitCSSMatrix(window.getComputedStyle(a||this.area).webkitTransform)},set_matrix:function(a,b,c){(c||this.area).style.webkitTransform="translate("+Math.round(a.e)+"px,"+Math.round(a.f)+"px)";(c||
this.area).style.webkitTransitionDuration=b},ev_touchstart:function(a){this.ev_mousedown(a.touches[0]);a.preventDefault();return!1},ev_mousedown:function(a){var b=a;this.x=b.pageX;this.y=b.pageY;this.dx=this.node.offsetWidth;this.dy=this.node.offsetHeight;this.mx=this.area.scrollWidth;this.my=this.area.scrollHeight;this.target=b.target;if(!this.rough){var c=this.get_matrix();this.target_x=c.e;this.target_y=c.f;if(!this.scroll&&this.compat)c.e=this.node.scrollLeft*-1,c.f=this.node.scrollTop*-1,this.node.scrollTop=
this.node.scrollLeft=0;this.set_matrix(c,0);this._correct_scroll(this.target_x,this.target_y)}this.scroll_x=this.scroll_y=this.scroll=!1;this._init_events()},ev_touchend:function(){return this.ev_mouseup()},ev_mouseup:function(){this._deinit_events();if(!this.scroll){this._remove_scroll();var a=document.createEvent("MouseEvent");a.initMouseEvent("click",!0,!0);this.target.dispatchEvent(a)}this.target=null},ev_webkitTransitionEnd:function(){if(!this.target&&this.scroll){this._remove_scroll();var a=
this.get_matrix();this.node.firstChild._scrollTop=-1*a.f;if(this.compat&&(a.e||a.f)){var b=a.f,c=a.e;a.e=a.f=0;this.set_matrix(a,0);this.node.scrollTop=-1*b;this.node.scrollLeft=-1*c}this.scroll=!1}},ev_touchmove:function(a){return this.ev_mousemove(a.touches[0])},ev_mousemove:function(a){if(this.target){var b=a,c=(b.pageX-this.x)*(this.axisX?5:0),e=(b.pageY-this.y)*(this.axisY?5:0);if(!(Math.abs(c)<10&&Math.abs(e)<10)){if(Math.abs(c)>50)this.scroll_x=!0;if(Math.abs(e)>50)this.scroll_y=!0;if(this.scroll_x||
this.scroll_y){this.x=b.pageX;this.y=b.pageY;this.scroll=!0;var d=this.get_matrix();c+=this.target_x-d.e;e+=this.target_y-d.f;var f="2000ms",g="500ms";this.target_x=c+d.e;this.target_y=e+d.f;if(this.target_x>0)this.target_x=0,f=g;if(this.target_y>0)this.target_y=0,f=g;if(this.mx-this.dx+this.target_x<0)this.target_x=-this.mx+this.dx,f=g;if(this.my-this.dy+this.target_y<0)this.target_y=-this.my+this.dy,f=g;this.set_matrix({e:this.target_x,f:this.target_y},f);this._add_scroll(d.e,d.f);this._correct_scroll(this.target_x,
this.target_y,f);this.onscroll(this.target_x,this.target_y)}return!1}}},_correct_scroll:function(a,b,c){if(this.scrolls.x){var e=this.get_matrix(this.scrolls.x),d=this.dx*a/this.mx;this.set_matrix({e:-1*d,f:0},c,this.scrolls.x)}if(this.scrolls.y){var e=this.get_matrix(this.scrolls.y),f=this.dy*b/this.my;this.set_matrix({e:0,f:-1*f},c,this.scrolls.y)}},_remove_scroll:function(){this.scrolls.x&&this.scrolls.x.parentNode.removeChild(this.scrolls.x);this.scrolls.y&&this.scrolls.y.parentNode.removeChild(this.scrolls.y);
this.scrolls={}},_add_scroll:function(){if(!this.scrolls.ready){var a;if(this.my>5&&this.axisY){var b=this.dy*this.dy/this.my-1;this.scrolls.y=a=document.createElement("DIV");a.className="dhx_scroll_y";a.style.height=b+"px";this.node.appendChild(a)}if(this.mx>5&&this.axisX)b=this.dx*this.dx/this.mx,this.scrolls.x=a=document.createElement("DIV"),a.className="dhx_scroll_x",a.style.width=b+"px",this.node.appendChild(a);var c=this.get_matrix();this._correct_scroll(c.e,c.f,0);this.scrolls.ready=!0}},_init_events:function(){document.addEventListener("touchmove",
this,!1);document.addEventListener("touchend",this,!1);this.debug&&(document.addEventListener("mousemove",this,!1),document.addEventListener("mouseup",this,!1))},_deinit_events:function(){document.removeEventListener("touchmove",this,!1);document.removeEventListener("touchend",this,!1);this.debug&&(document.removeEventListener("mousemove",this,!1),document.removeEventListener("mouseup",this,!1))},_init:function(){document.styleSheets[0].insertRule(".dhx_scroll_x { width:50px;height:4px;background:rgba(0, 0, 0, 0.4);position:absolute; left:0px; bottom:3px; border:1px solid transparent; -webkit-border-radius:4px;-webkit-transition: -webkit-transform;}",
0);document.styleSheets[0].insertRule(".dhx_scroll_y { width:4px;height:50px;background:rgba(0, 0, 0, 0.4);position:absolute; top:0px; right:3px; border:1px solid transparent; -webkit-border-radius:4px;-webkit-transition: -webkit-transform;}",0);this._init=function(){}}};
scheduler._ipad_before_init=function(){scheduler._ipad_before_init=function(){};scheduler.xy.scroll_width=0;for(var a=scheduler._els.dhx_cal_tab,b=42,c=a.length-1;c>=0;c--)a[c].style.cssText+="top:4px;",a[c].style.left="auto",a[c].style.right=b+"px",c==0&&(a[c].style.cssText+=";-webkit-border-top-left-radius: 5px; -webkit-border-bottom-left-radius: 5px;"),c==a.length-1&&(a[c].style.cssText+=";-webkit-border-top-right-radius: 5px; -webkit-border-bottom-right-radius: 5px;"),b+=100;scheduler._els.dhx_cal_prev_button[0].innerHTML=
"&lt;";scheduler._els.dhx_cal_next_button[0].innerHTML="&gt;";var e=document.createElement("div");e.className="dhx_cal_add_button";e.innerHTML="+ ";e.onclick=function(){var a=new Date;a>scheduler._min_date&&a<scheduler._max_date?scheduler.addEventNow():scheduler.addEventNow(scheduler._min_date.valueOf())};scheduler._els.dhx_cal_navline[0].appendChild(e);this._obj.onmousedown=this._obj.onmouseup=this._obj.onmousemove=function(){};var d=null,f=[];this._obj.ontouchmove=function(a){if(d){var b=Math.abs(a.touches[0].pageX-
f[0]),c=Math.abs(a.touches[0].pageY-f[1]);if(b>50||c>50)d=window.clearTimeout(d)}scheduler.config.touch_actions&&scheduler._on_mouse_move(a.touches[0])};this._obj.ontouchstart=function(a){scheduler._lightbox_id||(d=window.setTimeout(function(){scheduler._on_dbl_click(a.touches[0],a.target.className?a.target:a.target.parentNode)},400),f=[a.touches[0].pageX,a.touches[0].pageY],scheduler.config.touch_actions&&scheduler._on_mouse_down(a.touches[0]))};this._obj.ontouchend=function(a){d&&(d=window.clearTimeout(d));
scheduler.config.touch_actions&&scheduler._on_mouse_up(a.touches[0])}};
scheduler._ipad_init=function(){var a=document.createElement("DIV"),b=scheduler._els.dhx_cal_data[0];a.appendChild(b);a.style.cssText="overflow:hidden; width:100%; overflow:hidden;position:relative;";this._obj.appendChild(a);b.style.overflowY="hidden";var c=new TouchScroll(a);c.axisX=!1;scheduler._ipad_init=function(){b.parentNode.style.height=b.style.height;b.parentNode.style.top=b.style.top;b.style.height=b.scrollHeight+"px";b.style.top="0px";Math.abs(b.parentNode.offsetHeight-b.offsetHeight)<5?
(c.axisY=!1,c.scrollTo(0,0,0)):c.axisY=!0;c.refresh()};scheduler.attachEvent("onSchedulerResize",function(){setTimeout(function(){scheduler._ipad_init()});return!0});scheduler._ipad_init()};scheduler.attachEvent("onViewChange",function(){scheduler._ipad_init()});scheduler.attachEvent("onBeforeViewChange",function(){scheduler._ipad_before_init();return!0});
scheduler.showCover=function(a){this.show_cover();if(a){a.style.display="block";var b=getOffset(this._obj);a.style.top=a.offsetHeight*-1+"px";a.style.left=Math.round(b.left+(this._obj.offsetWidth-a.offsetWidth)/2)+"px"}var c=this._get_lightbox(),e=c.addEventListener("webkitTransitionEnd",function(){c.style.top="41px";c.style.webkitTransform="";c.style.webkitTransition="";c.removeEventListener(e)},!1);c.style.webkitTransform="translate(0px,"+(a.offsetHeight+41)+"px)";c.style.webkitTransitionDuration=
"500ms"};scheduler.hideCover=function(a){if(a){var b=a.addEventListener("webkitTransitionEnd",function(){a.style.top=(a.offsetHeight+41)*-1+"px";a.style.webkitTransform="";a.style.webkitTransition="";a.removeEventListener(b)},!1);a.style.webkitTransform="translate(0px,"+(a.offsetHeight+41)*-1+"px)";a.style.webkitTransitionDuration="500ms"}this.hide_cover()};scheduler.config.lightbox.sections[0].height=100;
if(scheduler.form_blocks.calendar_time)scheduler.config.lightbox.sections[1].type="calendar_time",scheduler._mini_cal_arrows=["&lt;","&gt;"];scheduler.xy.menu_width=0;scheduler.attachEvent("onClick",function(){return!1});scheduler.locale.labels.new_event="";
scheduler._mouse_coords=function(a){var b,c=document.body,e=document.documentElement;b=a.pageX||a.pageY?{x:a.pageX,y:a.pageY}:{x:a.clientX+(c.scrollLeft||e.scrollLeft||0)-c.clientLeft,y:a.clientY+(c.scrollTop||e.scrollTop||0)-c.clientTop};b.x-=getAbsoluteLeft(this._obj)+(this._table_view?0:this.xy.scale_width);var d=b.y-=getAbsoluteTop(this._obj)+this.xy.nav_height+this._dy_shift+this.xy.scale_height-(this._els.dhx_cal_data[0]._scrollTop||0);if(this._table_view){for(var f=0,f=1;f<this._colsS.heights.length;f++)if(this._colsS.heights[f]>
b.y)break;b.y=(Math.max(0,Math.ceil(b.x/this._cols[0])-1)+Math.max(0,f-1)*7)*1440/this.config.time_step;b.x=0}else b.x=Math.max(0,Math.ceil(b.x/this._cols[0])-1),b.y=Math.max(0,Math.ceil(b.y*60/(this.config.time_step*this.config.hour_size_px))-1)+this.config.first_hour*(60/this.config.time_step);return b};

View File

@ -1,19 +1,19 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
scheduler.attachEvent("onTimelineCreated",function(a){if(a.render=="tree")a.y_unit_original=a.y_unit,a.y_unit=scheduler._getArrayToDisplay(a.y_unit_original),scheduler.attachEvent("onOptionsLoadStart",function(){a.y_unit=scheduler._getArrayToDisplay(a.y_unit_original)}),scheduler.form_blocks[a.name]={render:function(b){var c="<div class='dhx_section_timeline' style='overflow: hidden; height: "+b.height+"px'></div>";return c},set_value:function(b,c,g,e){var d=scheduler._getArrayForSelect(scheduler.matrix[e.type].y_unit_original,
e.type);b.innerHTML="";var a=document.createElement("select");b.appendChild(a);for(var i=b.getElementsByTagName("select")[0],j=0;j<d.length;j++){var h=document.createElement("option");h.value=d[j].key;if(h.value==g[scheduler.matrix[e.type].y_property])h.selected=!0;h.innerHTML=d[j].label;i.appendChild(h)}},get_value:function(b){return b.firstChild.value},focus:function(){}}});
scheduler.attachEvent("onBeforeViewRender",function(a,b,c){var g={};if(a=="tree"){var e,d,f,i,j,h;b.children?(e=c.folder_dy||c.dy,c.folder_dy&&!c.section_autoheight&&(f="height:"+c.folder_dy+"px;"),d="dhx_row_folder",i="dhx_matrix_scell folder",j="<div class='dhx_scell_expand'>"+(b.open?"-":"+")+"</div>",h=c.folder_events_available?"dhx_data_table folder_events":"dhx_data_table folder"):(e=c.dy,d="dhx_row_item",i="dhx_matrix_scell item",j="",h="dhx_data_table");td_content="<div class='dhx_scell_level"+
b.level+"'>"+j+"<div class='dhx_scell_name'>"+(scheduler.templates[c.name+"_scale_label"](b.key,b.label,b)||b.label)+"</div></div>";g={height:e,style_height:f,tr_className:d,td_className:i,td_content:td_content,table_className:h}}return g});var section_id_before;
scheduler.attachEvent("onBeforeEventChanged",function(a,b,c){if(scheduler._isRender("tree")){var g=scheduler.getSection(a[scheduler.matrix[scheduler._mode].y_property]);if(typeof g.children!="undefined"&&!scheduler.matrix[scheduler._mode].folder_events_available)return c||(a[scheduler.matrix[scheduler._mode].y_property]=section_id_before),!1}return!0});
scheduler.attachEvent("onBeforeDrag",function(a,b,c){var g=scheduler._locate_cell_timeline(c);if(g){var e=scheduler.matrix[scheduler._mode].y_unit[g.y].key;if(typeof scheduler.matrix[scheduler._mode].y_unit[g.y].children!="undefined"&&!scheduler.matrix[scheduler._mode].folder_events_available)return!1}scheduler._isRender("tree")&&(ev=scheduler.getEvent(a),section_id_before=e||ev[scheduler.matrix[scheduler._mode].y_property]);return!0});
scheduler._getArrayToDisplay=function(a){var b=[],c=function(a,e){for(var d=e||0,f=0;f<a.length;f++){a[f].level=d;if(typeof a[f].children!="undefined"&&typeof a[f].key=="undefined")a[f].key=scheduler.uid();b.push(a[f]);a[f].open&&a[f].children&&c(a[f].children,d+1)}};c(a);return b};
scheduler._getArrayForSelect=function(a,b){var c=[],g=function(a){for(var d=0;d<a.length;d++)scheduler.matrix[b].folder_events_available?c.push(a[d]):typeof a[d].children=="undefined"&&c.push(a[d]),a[d].children&&g(a[d].children,b)};g(a);return c};
scheduler._toggleFolderDisplay=function(a,b,c){var g,e=function(a,b,c,j){for(var h=0;h<b.length;h++){if((b[h].key==a||j)&&b[h].children)if(b[h].open=typeof c!="undefined"?c:!b[h].open,g=!0,!j&&g)break;b[h].children&&e(a,b[h].children,c,j)}};e(a,scheduler.matrix[scheduler._mode].y_unit_original,b,c);scheduler.matrix[scheduler._mode].y_unit=scheduler._getArrayToDisplay(scheduler.matrix[scheduler._mode].y_unit_original);scheduler.callEvent("onOptionsLoad",[])};
scheduler.attachEvent("onTimelineCreated",function(a){if(a.render=="tree")a.y_unit_original=a.y_unit,a.y_unit=scheduler._getArrayToDisplay(a.y_unit_original),scheduler.attachEvent("onOptionsLoadStart",function(){a.y_unit=scheduler._getArrayToDisplay(a.y_unit_original)}),scheduler.form_blocks[a.name]={render:function(b){var c="<div class='dhx_section_timeline' style='overflow: hidden; height: "+b.height+"px'></div>";return c},set_value:function(b,c,e,f){var d=scheduler._getArrayForSelect(scheduler.matrix[f.type].y_unit_original,
f.type);b.innerHTML="";var a=document.createElement("select");b.appendChild(a);for(var h=b.getElementsByTagName("select")[0],i=0;i<d.length;i++){var g=document.createElement("option");g.value=d[i].key;if(g.value==e[scheduler.matrix[f.type].y_property])g.selected=!0;g.innerHTML=d[i].label;h.appendChild(g)}},get_value:function(b){return b.firstChild.value},focus:function(){}}});
scheduler.attachEvent("onBeforeViewRender",function(a,b,c){var e={};if(a=="tree"){var f,d,j,h,i,g;b.children?(f=c.folder_dy||c.dy,c.folder_dy&&!c.section_autoheight&&(j="height:"+c.folder_dy+"px;"),d="dhx_row_folder",h="dhx_matrix_scell folder",i="<div class='dhx_scell_expand'>"+(b.open?"-":"+")+"</div>",g=c.folder_events_available?"dhx_data_table folder_events":"dhx_data_table folder"):(f=c.dy,d="dhx_row_item",h="dhx_matrix_scell item",i="",g="dhx_data_table");td_content="<div class='dhx_scell_level"+
b.level+"'>"+i+"<div class='dhx_scell_name'>"+(scheduler.templates[c.name+"_scale_label"](b.key,b.label,b)||b.label)+"</div></div>";e={height:f,style_height:j,tr_className:d,td_className:h,td_content:td_content,table_className:g}}return e});var section_id_before;
scheduler.attachEvent("onBeforeEventChanged",function(a,b,c){if(scheduler._isRender("tree")){var e=scheduler.getSection(a[scheduler.matrix[scheduler._mode].y_property]);if(e&&typeof e.children!="undefined"&&!scheduler.matrix[scheduler._mode].folder_events_available)return c||(a[scheduler.matrix[scheduler._mode].y_property]=section_id_before),!1}return!0});
scheduler.attachEvent("onBeforeDrag",function(a,b,c){if(scheduler._isRender("tree")){var e=scheduler._locate_cell_timeline(c);if(e){var f=scheduler.matrix[scheduler._mode].y_unit[e.y].key;if(typeof scheduler.matrix[scheduler._mode].y_unit[e.y].children!="undefined"&&!scheduler.matrix[scheduler._mode].folder_events_available)return!1}var d=scheduler.getEvent(a);section_id_before=f||d[scheduler.matrix[scheduler._mode].y_property]}return!0});
scheduler._getArrayToDisplay=function(a){var b=[],c=function(e,f){for(var d=f||0,a=0;a<e.length;a++){e[a].level=d;if(typeof e[a].children!="undefined"&&typeof e[a].key=="undefined")e[a].key=scheduler.uid();b.push(e[a]);e[a].open&&e[a].children&&c(e[a].children,d+1)}};c(a);return b};
scheduler._getArrayForSelect=function(a,b){var c=[],e=function(a){for(var d=0;d<a.length;d++)scheduler.matrix[b].folder_events_available?c.push(a[d]):typeof a[d].children=="undefined"&&c.push(a[d]),a[d].children&&e(a[d].children,b)};e(a);return c};
scheduler._toggleFolderDisplay=function(a,b,c){var e,f=function(a,b,c,i){for(var g=0;g<b.length;g++){if((b[g].key==a||i)&&b[g].children)if(b[g].open=typeof c!="undefined"?c:!b[g].open,e=!0,!i&&e)break;b[g].children&&f(a,b[g].children,c,i)}};f(a,scheduler.matrix[scheduler._mode].y_unit_original,b,c);scheduler.matrix[scheduler._mode].y_unit=scheduler._getArrayToDisplay(scheduler.matrix[scheduler._mode].y_unit_original);scheduler.callEvent("onOptionsLoad",[])};
scheduler.attachEvent("onCellClick",function(a,b){scheduler._isRender("tree")&&(scheduler.matrix[scheduler._mode].folder_events_available||typeof scheduler.matrix[scheduler._mode].y_unit[b].children!="undefined"&&scheduler._toggleFolderDisplay(scheduler.matrix[scheduler._mode].y_unit[b].key))});scheduler.attachEvent("onYScaleClick",function(a,b){scheduler._isRender("tree")&&typeof b.children!="undefined"&&scheduler._toggleFolderDisplay(b.key)});
scheduler.getSection=function(a){if(scheduler._isRender("tree")){var b,c=function(a,e){for(var d=0;d<e.length;d++)e[d].key==a&&(b=e[d]),e[d].children&&c(a,e[d].children)};c(a,scheduler.matrix[scheduler._mode].y_unit_original);return b||null}};
scheduler.deleteSection=function(a){if(scheduler._isRender("tree")){var b=!1,c=function(a,e){for(var d=0;d<e.length;d++){e[d].key==a&&(e.splice(d,1),b=!0);if(b)break;e[d].children&&c(a,e[d].children)}};c(a,scheduler.matrix[scheduler._mode].y_unit_original);scheduler.matrix[scheduler._mode].y_unit=scheduler._getArrayToDisplay(scheduler.matrix[scheduler._mode].y_unit_original);scheduler.callEvent("onOptionsLoad",[]);return b}};
scheduler.getSection=function(a){if(scheduler._isRender("tree")){var b,c=function(a,f){for(var d=0;d<f.length;d++)f[d].key==a&&(b=f[d]),f[d].children&&c(a,f[d].children)};c(a,scheduler.matrix[scheduler._mode].y_unit_original);return b||null}};
scheduler.deleteSection=function(a){if(scheduler._isRender("tree")){var b=!1,c=function(a,f){for(var d=0;d<f.length;d++){f[d].key==a&&(f.splice(d,1),b=!0);if(b)break;f[d].children&&c(a,f[d].children)}};c(a,scheduler.matrix[scheduler._mode].y_unit_original);scheduler.matrix[scheduler._mode].y_unit=scheduler._getArrayToDisplay(scheduler.matrix[scheduler._mode].y_unit_original);scheduler.callEvent("onOptionsLoad",[]);return b}};
scheduler.deleteAllSections=function(){if(scheduler._isRender("tree"))scheduler.matrix[scheduler._mode].y_unit_original=[],scheduler.matrix[scheduler._mode].y_unit=scheduler._getArrayToDisplay(scheduler.matrix[scheduler._mode].y_unit_original),scheduler.callEvent("onOptionsLoad",[])};
scheduler.addSection=function(a,b){if(scheduler._isRender("tree")){var c=!1,g=function(a,d,f){if(b)for(var i=0;i<f.length;i++){f[i].key==d&&typeof f[i].children!="undefined"&&(f[i].children.push(a),c=!0);if(c)break;f[i].children&&g(a,d,f[i].children)}else f.push(a),c=!0};g(a,b,scheduler.matrix[scheduler._mode].y_unit_original);scheduler.matrix[scheduler._mode].y_unit=scheduler._getArrayToDisplay(scheduler.matrix[scheduler._mode].y_unit_original);scheduler.callEvent("onOptionsLoad",[]);return c}};
scheduler.addSection=function(a,b){if(scheduler._isRender("tree")){var c=!1,e=function(a,d,j){if(b)for(var h=0;h<j.length;h++){j[h].key==d&&typeof j[h].children!="undefined"&&(j[h].children.push(a),c=!0);if(c)break;j[h].children&&e(a,d,j[h].children)}else j.push(a),c=!0};e(a,b,scheduler.matrix[scheduler._mode].y_unit_original);scheduler.matrix[scheduler._mode].y_unit=scheduler._getArrayToDisplay(scheduler.matrix[scheduler._mode].y_unit_original);scheduler.callEvent("onOptionsLoad",[]);return c}};
scheduler.openAllSections=function(){scheduler._isRender("tree")&&scheduler._toggleFolderDisplay(1,!0,!0)};scheduler.closeAllSections=function(){scheduler._isRender("tree")&&scheduler._toggleFolderDisplay(1,!1,!0)};scheduler.openSection=function(a){scheduler._isRender("tree")&&scheduler._toggleFolderDisplay(a,!0)};scheduler.closeSection=function(a){scheduler._isRender("tree")&&scheduler._toggleFolderDisplay(a,!1)};

View File

@ -1,16 +1,16 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
scheduler._props={};
scheduler.createUnitsView=function(a,f,j,g,k,l){if(typeof a=="object")j=a.list,f=a.property,g=a.size||0,k=a.step||1,l=a.skip_incorrect,a=a.name;scheduler._props[a]={map_to:f,options:j,step:k,position:0};if(g>scheduler._props[a].options.length)scheduler._props[a]._original_size=g,g=0;scheduler._props[a].size=g;scheduler._props[a].skip_incorrect=l||!1;scheduler.date[a+"_start"]=scheduler.date.day_start;scheduler.templates[a+"_date"]=function(a){return scheduler.templates.day_date(a)};scheduler.templates[a+
"_scale_date"]=function(c){var h=scheduler._props[a].options;if(!h.length)return"";var f=(scheduler._props[a].position||0)+Math.floor((scheduler._correct_shift(c.valueOf(),1)-scheduler._min_date.valueOf())/864E5);return h[f].css?"<span class='"+h[f].css+"'>"+h[f].label+"</span>":h[f].label};scheduler.date["add_"+a]=function(a,f){return scheduler.date.add(a,f,"day")};scheduler.date["get_"+a+"_end"]=function(c){return scheduler.date.add(c,scheduler._props[a].size||scheduler._props[a].options.length,
"day")};scheduler.attachEvent("onOptionsLoad",function(){for(var c=scheduler._props[a],f=c.order={},g=c.options,i=0;i<g.length;i++)f[g[i].key]=i;if(c._original_size&&c.size==0)c.size=c._original_size,delete c.original_size;c.size>g.length?(c._original_size=c.size,c.size=0):c.size=c._original_size||c.size;scheduler._date&&scheduler._mode==a&&scheduler.setCurrentView(scheduler._date,scheduler._mode)});scheduler.callEvent("onOptionsLoad",[])};
scheduler.scrollUnit=function(a){var f=scheduler._props[this._mode];if(f)f.position=Math.min(Math.max(0,f.position+a),f.options.length-f.size),this.update_view()};
(function(){var a=function(b){var d=scheduler._props[scheduler._mode];if(d&&d.order&&d.skip_incorrect){for(var a=[],e=0;e<b.length;e++)typeof d.order[b[e][d.map_to]]!="undefined"&&a.push(b[e]);b.splice(0,b.length);b.push.apply(b,a)}return b},f=scheduler._pre_render_events_table;scheduler._pre_render_events_table=function(b,d){b=a(b);return f.apply(this,[b,d])};var j=scheduler._pre_render_events_line;scheduler._pre_render_events_line=function(b,d){b=a(b);return j.apply(this,[b,d])};var g=function(b,
scheduler.createUnitsView=function(a,g,j,f,k,l){if(typeof a=="object")j=a.list,g=a.property,f=a.size||0,k=a.step||1,l=a.skip_incorrect,a=a.name;scheduler._props[a]={map_to:g,options:j,step:k,position:0};if(f>scheduler._props[a].options.length)scheduler._props[a]._original_size=f,f=0;scheduler._props[a].size=f;scheduler._props[a].skip_incorrect=l||!1;scheduler.date[a+"_start"]=scheduler.date.day_start;scheduler.templates[a+"_date"]=function(a){return scheduler.templates.day_date(a)};scheduler.templates[a+
"_scale_date"]=function(c){var h=scheduler._props[a].options;if(!h.length)return"";var g=(scheduler._props[a].position||0)+Math.floor((scheduler._correct_shift(c.valueOf(),1)-scheduler._min_date.valueOf())/864E5);return h[g].css?"<span class='"+h[g].css+"'>"+h[g].label+"</span>":h[g].label};scheduler.date["add_"+a]=function(a,g){return scheduler.date.add(a,g,"day")};scheduler.date["get_"+a+"_end"]=function(c){return scheduler.date.add(c,scheduler._props[a].size||scheduler._props[a].options.length,
"day")};scheduler.attachEvent("onOptionsLoad",function(){for(var c=scheduler._props[a],g=c.order={},f=c.options,i=0;i<f.length;i++)g[f[i].key]=i;if(c._original_size&&c.size==0)c.size=c._original_size,delete c.original_size;c.size>f.length?(c._original_size=c.size,c.size=0):c.size=c._original_size||c.size;scheduler._date&&scheduler._mode==a&&scheduler.setCurrentView(scheduler._date,scheduler._mode)});scheduler.callEvent("onOptionsLoad",[])};
scheduler.scrollUnit=function(a){var g=scheduler._props[this._mode];if(g)g.position=Math.min(Math.max(0,g.position+a),g.options.length-g.size),this.update_view()};
(function(){var a=function(b){var d=scheduler._props[scheduler._mode];if(d&&d.order&&d.skip_incorrect){for(var a=[],e=0;e<b.length;e++)typeof d.order[b[e][d.map_to]]!="undefined"&&a.push(b[e]);b.splice(0,b.length);b.push.apply(b,a)}return b},g=scheduler._pre_render_events_table;scheduler._pre_render_events_table=function(b,d){b=a(b);return g.apply(this,[b,d])};var j=scheduler._pre_render_events_line;scheduler._pre_render_events_line=function(b,d){b=a(b);return j.apply(this,[b,d])};var f=function(b,
d){if(b&&typeof b.order[d[b.map_to]]=="undefined"){var a=scheduler,e=864E5,c=Math.floor((d.end_date-a._min_date)/e);d[b.map_to]=b.options[Math.min(c+b.position,b.options.length-1)].key;return!0}},k=scheduler._reset_scale,l=scheduler.is_visible_events;scheduler.is_visible_events=function(b){var d=l.apply(this,arguments);if(d){var a=scheduler._props[this._mode];if(a&&a.size){var e=a.order[b[a.map_to]];if(e<a.position||e>=a.size+a.position)return!1}}return d};scheduler._reset_scale=function(){var b=
scheduler._props[this._mode],a=k.apply(this,arguments);if(b){this._max_date=this.date.add(this._min_date,1,"day");for(var c=this._els.dhx_cal_data[0].childNodes,e=0;e<c.length;e++)c[e].className=c[e].className.replace("_now","");if(b.size&&b.size<b.options.length){var f=this._els.dhx_cal_header[0],g=document.createElement("DIV");if(b.position)g.className="dhx_cal_prev_button",g.style.cssText="left:1px;top:2px;position:absolute;",g.innerHTML="&nbsp;",f.firstChild.appendChild(g),g.onclick=function(){scheduler.scrollUnit(b.step*
-1)};if(b.position+b.size<b.options.length)g=document.createElement("DIV"),g.className="dhx_cal_next_button",g.style.cssText="left:auto; right:0px;top:2px;position:absolute;",g.innerHTML="&nbsp;",f.lastChild.appendChild(g),g.onclick=function(){scheduler.scrollUnit(b.step)}}}return a};var c=scheduler._get_event_sday;scheduler._get_event_sday=function(b){var a=scheduler._props[this._mode];return a?(g(a,b),a.order[b[a.map_to]]-a.position):c.call(this,b)};var h=scheduler.locate_holder_day;scheduler.locate_holder_day=
function(a,d,c){var e=scheduler._props[this._mode];return e?(g(e,c),e.order[c[e.map_to]]*1+(d?1:0)-e.position):h.apply(this,arguments)};var m=scheduler._mouse_coords;scheduler._mouse_coords=function(){var a=scheduler._props[this._mode],d=m.apply(this,arguments);if(a){if(!this._drag_event)this._drag_event={};var c=this._drag_event;if(this._drag_id&&this._drag_mode)c=this.getEvent(this._drag_id),this._drag_event._dhx_changed=!0;var e=Math.min(d.x+a.position,a.options.length-1);c[a.map_to]=a.options[e].key;
d.x=0;d.custom=!0}return d};var i=scheduler._time_order;scheduler._time_order=function(a){var d=scheduler._props[this._mode];d?a.sort(function(a,b){return d.order[a[d.map_to]]>d.order[b[d.map_to]]?1:-1}):i.apply(this,arguments)};scheduler.attachEvent("onEventAdded",function(a,d){if(this._loading)return!0;for(var c in scheduler._props){var e=scheduler._props[c];if(typeof d[e.map_to]=="undefined")d[e.map_to]=e.options[0].key}return!0});scheduler.attachEvent("onEventCreated",function(a,c){var f=scheduler._props[this._mode];
if(f){var e=this.getEvent(a);this._mouse_coords(c);g(f,e);this.event_updated(e)}return!0})})();
scheduler._props[this._mode],a=k.apply(this,arguments);if(b){this._max_date=this.date.add(this._min_date,1,"day");for(var c=this._els.dhx_cal_data[0].childNodes,e=0;e<c.length;e++)c[e].className=c[e].className.replace("_now","");if(b.size&&b.size<b.options.length){var g=this._els.dhx_cal_header[0],f=document.createElement("DIV");if(b.position)f.className="dhx_cal_prev_button",f.style.cssText="left:1px;top:2px;position:absolute;",f.innerHTML="&nbsp;",g.firstChild.appendChild(f),f.onclick=function(){scheduler.scrollUnit(b.step*
-1)};if(b.position+b.size<b.options.length)f=document.createElement("DIV"),f.className="dhx_cal_next_button",f.style.cssText="left:auto; right:0px;top:2px;position:absolute;",f.innerHTML="&nbsp;",g.lastChild.appendChild(f),f.onclick=function(){scheduler.scrollUnit(b.step)}}}return a};var c=scheduler._get_event_sday;scheduler._get_event_sday=function(b){var a=scheduler._props[this._mode];return a?(f(a,b),a.order[b[a.map_to]]-a.position):c.call(this,b)};var h=scheduler.locate_holder_day;scheduler.locate_holder_day=
function(a,d,c){var e=scheduler._props[this._mode];return e&&c?(f(e,c),e.order[c[e.map_to]]*1+(d?1:0)-e.position):h.apply(this,arguments)};var m=scheduler._mouse_coords;scheduler._mouse_coords=function(){var a=scheduler._props[this._mode],d=m.apply(this,arguments);if(a){if(!this._drag_event)this._drag_event={};var c=this._drag_event;if(this._drag_id&&this._drag_mode)c=this.getEvent(this._drag_id),this._drag_event._dhx_changed=!0;var e=Math.min(d.x+a.position,a.options.length-1),f=a.map_to;d.section=
c[f]=a.options[e].key;d.x=0}return d};var i=scheduler._time_order;scheduler._time_order=function(a){var d=scheduler._props[this._mode];d?a.sort(function(a,b){return d.order[a[d.map_to]]>d.order[b[d.map_to]]?1:-1}):i.apply(this,arguments)};scheduler.attachEvent("onEventAdded",function(a,d){if(this._loading)return!0;for(var c in scheduler._props){var e=scheduler._props[c];if(typeof d[e.map_to]=="undefined")d[e.map_to]=e.options[0].key}return!0});scheduler.attachEvent("onEventCreated",function(a,c){var g=
scheduler._props[this._mode];if(g&&c){var e=this.getEvent(a);this._mouse_coords(c);f(g,e);this.event_updated(e)}return!0})})();

View File

@ -1,6 +1,6 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
scheduler.attachEvent("onTemplatesReady",function(){var d=!0,e=scheduler.date.str_to_date("%Y-%m-%d"),h=scheduler.date.date_to_str("%Y-%m-%d");scheduler.attachEvent("onBeforeViewChange",function(i,j,f,k){if(d){d=!1;for(var a={},g=(document.location.hash||"").replace("#","").split(","),b=0;b<g.length;b++){var c=g[b].split("=");c.length==2&&(a[c[0]]=c[1])}if(a.date||a.mode){try{this.setCurrentView(a.date?e(a.date):null,a.mode||null)}catch(m){this.setCurrentView(a.date?e(a.date):null,f)}return!1}}var l=
"#date="+h(k||j)+",mode="+(f||i);document.location.hash=l;return!0})});

View File

@ -1,18 +1,19 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
scheduler._wa={};scheduler.xy.week_agenda_scale_height=20;scheduler.templates.week_agenda_event_text=function(c,e,f){return scheduler.templates.event_date(c)+" "+f.text};scheduler.date.week_agenda_start=scheduler.date.week_start;scheduler.date.week_agenda_end=function(c){return scheduler.date.add(c,7,"day")};scheduler.date.add_week_agenda=function(c,e){return scheduler.date.add(c,e*7,"day")};
scheduler.attachEvent("onSchedulerReady",function(){var c=scheduler.templates;if(!c.week_agenda_date)c.week_agenda_date=c.week_date});(function(){var c=scheduler.date.date_to_str("%l, %F %d");scheduler.templates.week_agenda_scale_date=function(e){return c(e)}})();
scheduler.attachEvent("onTemplatesReady",function(){scheduler.attachEvent("onSchedulerResize",function(){return this._mode=="week_agenda"?(this.week_agenda_view(!0),!1):!0});var c=scheduler.render_data;scheduler.render_data=function(b){if(this._mode=="week_agenda")f();else return c.apply(this,arguments)};var e=function(){scheduler._cols=[];var b=parseInt(scheduler._els.dhx_cal_data[0].style.width);scheduler._cols.push(Math.floor(b/2));scheduler._cols.push(b-scheduler._cols[0]-1);scheduler._colsS=
{0:[],1:[]};for(var a=parseInt(scheduler._els.dhx_cal_data[0].style.height),m=0;m<3;m++)scheduler._colsS[0].push(Math.floor(a/(3-scheduler._colsS[0].length))),a-=scheduler._colsS[0][m];scheduler._colsS[1].push(scheduler._colsS[0][0]);scheduler._colsS[1].push(scheduler._colsS[0][1]);a=scheduler._colsS[0][scheduler._colsS[0].length-1];scheduler._colsS[1].push(Math.floor(a/2));scheduler._colsS[1].push(a-scheduler._colsS[1][scheduler._colsS[1].length-1])},f=function(){for(var b=scheduler._els.dhx_cal_data[0].innerHTML=
"",a=0;a<2;a++){var m=scheduler._cols[a],c="dhx_wa_column";a==1&&(c+=" dhx_wa_column_last");b+="<div class='"+c+"' style='width: "+m+"px;'>";for(var h=0;h<scheduler._colsS[a].length;h++){var k=scheduler.xy.week_agenda_scale_height-2,e=scheduler._colsS[a][h]-k-2;b+="<div class='dhx_wa_day_cont'><div style='height:"+k+"px; line-height:"+k+"px;' class='dhx_wa_scale_bar'></div><div style='height:"+e+"px;' class='dhx_wa_day_data'></div></div>"}b+="</div>"}scheduler._els.dhx_cal_date[0].innerHTML=scheduler.templates[scheduler._mode+
"_date"](scheduler._min_date,scheduler._max_date,scheduler._mode);scheduler._els.dhx_cal_data[0].innerHTML=b;for(var i=scheduler._els.dhx_cal_data[0].getElementsByTagName("div"),l=[],a=0;a<i.length;a++)i[a].className=="dhx_wa_day_cont"&&l.push(i[a]);scheduler._wa._selected_divs=[];for(var f=scheduler.get_visible_events(),j=scheduler.date.week_start(scheduler._date),n=scheduler.date.add(j,1,"day"),a=0;a<7;a++){l[a]._date=j;var s=l[a].childNodes[0],t=l[a].childNodes[1];s.innerHTML=scheduler.templates.week_agenda_scale_date(j);
for(var o=[],q=0;q<f.length;q++){var r=f[q];r.start_date<n&&r.end_date>j&&o.push(r)}o.sort(function(a,b){return a.start_date.valueOf()==b.start_date.valueOf()?a.id>b.id?1:-1:a.start_date>b.start_date?1:-1});for(h=0;h<o.length;h++){var d=o[h],g=document.createElement("div");scheduler._rendered.push(g);g.className="dhx_wa_ev_body";if(d._text_style)g.style.cssText=d._text_style;if(d.color)g.style.backgroundColor=d.color;if(d.textColor)g.style.color=d.textColor;scheduler._select_id&&d.id==scheduler._select_id&&
(g.className+=" dhx_cal_event_selected",scheduler._wa._selected_divs.push(g));var p="";d._timed||(p="middle",d.start_date.valueOf()>=j.valueOf()&&d.start_date.valueOf()<=n.valueOf()&&(p="start"),d.end_date.valueOf()>=j.valueOf()&&d.end_date.valueOf()<=n.valueOf()&&(p="end"));g.innerHTML=scheduler.templates.week_agenda_event_text(d.start_date,d.end_date,d,j,p);g.setAttribute("event_id",d.id);t.appendChild(g)}j=scheduler.date.add(j,1,"day");n=scheduler.date.add(n,1,"day")}};scheduler.week_agenda_view=
function(b){scheduler._min_date=scheduler.date.week_start(scheduler._date);scheduler._max_date=scheduler.date.add(scheduler._min_date,1,"week");scheduler.set_sizes();if(b)scheduler._table_view=!0,scheduler._wa._prev_data_border=scheduler._els.dhx_cal_data[0].style.borderTop,scheduler._els.dhx_cal_data[0].style.borderTop=0,scheduler._els.dhx_cal_data[0].style.overflowY="hidden",scheduler._els.dhx_cal_date[0].innerHTML="",scheduler._els.dhx_cal_data[0].style.top=parseInt(scheduler._els.dhx_cal_data[0].style.top)-
scheduler.xy.bar_height-1+"px",scheduler._els.dhx_cal_data[0].style.height=parseInt(scheduler._els.dhx_cal_data[0].style.height)+scheduler.xy.bar_height+1+"px",scheduler._els.dhx_cal_header[0].style.display="none",e(),f();else{scheduler._table_view=!1;if(scheduler._wa._prev_data_border)scheduler._els.dhx_cal_data[0].style.borderTop=scheduler._wa._prev_data_border;scheduler._els.dhx_cal_data[0].style.overflowY="auto";scheduler._els.dhx_cal_data[0].style.top=parseInt(scheduler._els.dhx_cal_data[0].style.top)+
scheduler.xy.bar_height+"px";scheduler._els.dhx_cal_data[0].style.height=parseInt(scheduler._els.dhx_cal_data[0].style.height)-scheduler.xy.bar_height+"px";scheduler._els.dhx_cal_header[0].style.display="block"}};scheduler.mouse_week_agenda=function(b){for(var a=b.ev,c=a.srcElement||a.target;c.parentNode;){if(c._date)var e=c._date;c=c.parentNode}if(!e)return b;b.x=0;var h=e.valueOf()-scheduler._min_date.valueOf();b.y=Math.ceil(h/6E4/this.config.time_step);if(this._drag_mode=="move"){this._drag_event._dhx_changed=
!0;this._select_id=this._drag_id;for(var k=0;k<scheduler._rendered.length;k++)if(scheduler._drag_id==this._rendered[k].getAttribute("event_id"))var f=this._rendered[k];if(!scheduler._wa._dnd){var i=f.cloneNode(!0);this._wa._dnd=i;i.className=f.className;i.id="dhx_wa_dnd";i.className+=" dhx_wa_dnd";document.body.appendChild(i)}var l=document.getElementById("dhx_wa_dnd");l.style.top=(a.pageY||a.clientY)+20+"px";l.style.left=(a.pageX||a.clientX)+20+"px"}return b};scheduler.attachEvent("onBeforeEventChanged",
function(){if(this._mode=="week_agenda"&&this._drag_mode=="move"){var b=document.getElementById("dhx_wa_dnd");b.parentNode.removeChild(b);scheduler._wa._dnd=!1}return!0});scheduler.attachEvent("onEventSave",function(b,a,c){if(c)this._select_id=b;return!0});scheduler._wa._selected_divs=[];scheduler.attachEvent("onClick",function(b){if(this._mode=="week_agenda"){if(scheduler._wa._selected_divs)for(var a=0;a<this._wa._selected_divs.length;a++){var c=this._wa._selected_divs[a];c.className=c.className.replace(/ dhx_cal_event_selected/,
"")}this.for_rendered(b,function(a){a.className+=" dhx_cal_event_selected";scheduler._wa._selected_divs.push(a)});this._select_id=b;return!1}return!0})});
scheduler._wa={};scheduler.xy.week_agenda_scale_height=20;scheduler.templates.week_agenda_event_text=function(c,g,h){return scheduler.templates.event_date(c)+" "+h.text};scheduler.date.week_agenda_start=scheduler.date.week_start;scheduler.date.week_agenda_end=function(c){return scheduler.date.add(c,7,"day")};scheduler.date.add_week_agenda=function(c,g){return scheduler.date.add(c,g*7,"day")};
scheduler.attachEvent("onSchedulerReady",function(){var c=scheduler.templates;if(!c.week_agenda_date)c.week_agenda_date=c.week_date});(function(){var c=scheduler.date.date_to_str("%l, %F %d");scheduler.templates.week_agenda_scale_date=function(g){return c(g)}})();
scheduler.attachEvent("onTemplatesReady",function(){scheduler.attachEvent("onSchedulerResize",function(){return this._mode=="week_agenda"?(this.week_agenda_view(!0),!1):!0});var c=scheduler.render_data;scheduler.render_data=function(b){if(this._mode=="week_agenda")scheduler.week_agenda_view(!0);else return c.apply(this,arguments)};var g=function(){scheduler._cols=[];var b=parseInt(scheduler._els.dhx_cal_data[0].style.width);scheduler._cols.push(Math.floor(b/2));scheduler._cols.push(b-scheduler._cols[0]-
1);scheduler._colsS={0:[],1:[]};for(var a=parseInt(scheduler._els.dhx_cal_data[0].style.height),m=0;m<3;m++)scheduler._colsS[0].push(Math.floor(a/(3-scheduler._colsS[0].length))),a-=scheduler._colsS[0][m];scheduler._colsS[1].push(scheduler._colsS[0][0]);scheduler._colsS[1].push(scheduler._colsS[0][1]);a=scheduler._colsS[0][scheduler._colsS[0].length-1];scheduler._colsS[1].push(Math.floor(a/2));scheduler._colsS[1].push(a-scheduler._colsS[1][scheduler._colsS[1].length-1])},h=function(){g();scheduler._els.dhx_cal_data[0].innerHTML=
"";scheduler._rendered=[];for(var b="",a=0;a<2;a++){var m=scheduler._cols[a],c="dhx_wa_column";a==1&&(c+=" dhx_wa_column_last");b+="<div class='"+c+"' style='width: "+m+"px;'>";for(var e=0;e<scheduler._colsS[a].length;e++){var j=scheduler.xy.week_agenda_scale_height-2,u=scheduler._colsS[a][e]-j-2,k=Math.min(6,e*2+a);b+="<div class='dhx_wa_day_cont'><div style='height:"+j+"px; line-height:"+j+"px;' class='dhx_wa_scale_bar'></div><div style='height:"+u+"px;' class='dhx_wa_day_data' day='"+k+"'></div></div>"}b+=
"</div>"}scheduler._els.dhx_cal_date[0].innerHTML=scheduler.templates[scheduler._mode+"_date"](scheduler._min_date,scheduler._max_date,scheduler._mode);scheduler._els.dhx_cal_data[0].innerHTML=b;for(var l=scheduler._els.dhx_cal_data[0].getElementsByTagName("div"),o=[],a=0;a<l.length;a++)l[a].className=="dhx_wa_day_cont"&&o.push(l[a]);scheduler._wa._selected_divs=[];for(var h=scheduler.get_visible_events(),i=scheduler.date.week_start(scheduler._date),n=scheduler.date.add(i,1,"day"),a=0;a<7;a++){o[a]._date=
i;var v=o[a].childNodes[0],w=o[a].childNodes[1];v.innerHTML=scheduler.templates.week_agenda_scale_date(i);for(var p=[],r=0;r<h.length;r++){var s=h[r];s.start_date<n&&s.end_date>i&&p.push(s)}p.sort(function(a,b){return a.start_date.valueOf()==b.start_date.valueOf()?a.id>b.id?1:-1:a.start_date>b.start_date?1:-1});for(e=0;e<p.length;e++){var d=p[e],f=document.createElement("div");scheduler._rendered.push(f);var t=scheduler.templates.event_class(d.start_date,d.end_date,d);f.className="dhx_wa_ev_body"+
(t?" "+t:"");if(d._text_style)f.style.cssText=d._text_style;if(d.color)f.style.background=d.color;if(d.textColor)f.style.color=d.textColor;if(scheduler._select_id&&d.id==scheduler._select_id&&(scheduler.config.week_agenda_select||scheduler.config.week_agenda_select===void 0))f.className+=" dhx_cal_event_selected",scheduler._wa._selected_divs.push(f);var q="";d._timed||(q="middle",d.start_date.valueOf()>=i.valueOf()&&d.start_date.valueOf()<=n.valueOf()&&(q="start"),d.end_date.valueOf()>=i.valueOf()&&
d.end_date.valueOf()<=n.valueOf()&&(q="end"));f.innerHTML=scheduler.templates.week_agenda_event_text(d.start_date,d.end_date,d,i,q);f.setAttribute("event_id",d.id);w.appendChild(f)}i=scheduler.date.add(i,1,"day");n=scheduler.date.add(n,1,"day")}};scheduler.week_agenda_view=function(b){scheduler._min_date=scheduler.date.week_start(scheduler._date);scheduler._max_date=scheduler.date.add(scheduler._min_date,1,"week");scheduler.set_sizes();if(b)scheduler._table_view=scheduler._allow_dnd=!0,scheduler._wa._prev_data_border=
scheduler._els.dhx_cal_data[0].style.borderTop,scheduler._els.dhx_cal_data[0].style.borderTop=0,scheduler._els.dhx_cal_data[0].style.overflowY="hidden",scheduler._els.dhx_cal_date[0].innerHTML="",scheduler._els.dhx_cal_data[0].style.top=parseInt(scheduler._els.dhx_cal_data[0].style.top)-scheduler.xy.bar_height-1+"px",scheduler._els.dhx_cal_data[0].style.height=parseInt(scheduler._els.dhx_cal_data[0].style.height)+scheduler.xy.bar_height+1+"px",scheduler._els.dhx_cal_header[0].style.display="none",
h();else{scheduler._table_view=scheduler._allow_dnd=!1;if(scheduler._wa._prev_data_border)scheduler._els.dhx_cal_data[0].style.borderTop=scheduler._wa._prev_data_border;scheduler._els.dhx_cal_data[0].style.overflowY="auto";scheduler._els.dhx_cal_data[0].style.top=parseInt(scheduler._els.dhx_cal_data[0].style.top)+scheduler.xy.bar_height+"px";scheduler._els.dhx_cal_data[0].style.height=parseInt(scheduler._els.dhx_cal_data[0].style.height)-scheduler.xy.bar_height+"px";scheduler._els.dhx_cal_header[0].style.display=
"block"}};scheduler.mouse_week_agenda=function(b){for(var a=b.ev,c=a.srcElement||a.target;c.parentNode;){if(c._date)var g=c._date;c=c.parentNode}if(!g)return b;b.x=0;var e=g.valueOf()-scheduler._min_date.valueOf();b.y=Math.ceil(e/6E4/this.config.time_step);if(this._drag_mode=="move"){this._drag_event._dhx_changed=!0;this._select_id=this._drag_id;for(var j=0;j<scheduler._rendered.length;j++)if(scheduler._drag_id==this._rendered[j].getAttribute("event_id"))var h=this._rendered[j];if(!scheduler._wa._dnd){var k=
h.cloneNode(!0);this._wa._dnd=k;k.className=h.className;k.id="dhx_wa_dnd";k.className+=" dhx_wa_dnd";document.body.appendChild(k)}var l=document.getElementById("dhx_wa_dnd");l.style.top=(a.pageY||a.clientY)+20+"px";l.style.left=(a.pageX||a.clientX)+20+"px"}return b};scheduler.attachEvent("onBeforeEventChanged",function(){if(this._mode=="week_agenda"&&this._drag_mode=="move"){var b=document.getElementById("dhx_wa_dnd");b.parentNode.removeChild(b);scheduler._wa._dnd=!1}return!0});scheduler.attachEvent("onEventSave",
function(b,a,c){if(c&&this._mode=="week_agenda")this._select_id=b;return!0});scheduler._wa._selected_divs=[];scheduler.attachEvent("onClick",function(b){if(this._mode=="week_agenda"&&(scheduler.config.week_agenda_select||scheduler.config.week_agenda_select===void 0)){if(scheduler._wa._selected_divs)for(var a=0;a<this._wa._selected_divs.length;a++){var c=this._wa._selected_divs[a];c.className=c.className.replace(/ dhx_cal_event_selected/,"")}this.for_rendered(b,function(a){a.className+=" dhx_cal_event_selected";
scheduler._wa._selected_divs.push(a)});scheduler.select(b);return!1}return!0})});

View File

@ -1,17 +1,17 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
scheduler.config.year_x=4;scheduler.config.year_y=3;scheduler.config.year_mode_name="year";scheduler.xy.year_top=0;scheduler.templates.year_date=function(c){return scheduler.date.date_to_str(scheduler.locale.labels.year_tab+" %Y")(c)};scheduler.templates.year_month=scheduler.date.date_to_str("%F");scheduler.templates.year_scale_date=scheduler.date.date_to_str("%D");scheduler.templates.year_tooltip=function(c,o,p){return p.text};
(function(){var c=function(){return scheduler._mode==scheduler.config.year_mode_name};scheduler.dblclick_dhx_month_head=function(a){if(c()){var b=a.target||a.srcElement;if(b.parentNode.className.indexOf("dhx_before")!=-1||b.parentNode.className.indexOf("dhx_after")!=-1)return!1;var d=this.templates.xml_date(b.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.getAttribute("date"));d.setDate(parseInt(b.innerHTML,10));var u=this.date.add(d,1,"day");!this.config.readonly&&this.config.dblclick_create&&
this.addEventNow(d.valueOf(),u.valueOf(),a)}};var o=scheduler.changeEventId;scheduler.changeEventId=function(){o.apply(this,arguments);c()&&this.year_view(!0)};var p=scheduler.render_data,v=scheduler.date.date_to_str("%Y/%m/%d"),w=scheduler.date.str_to_date("%Y/%m/%d");scheduler.render_data=function(a){if(!c())return p.apply(this,arguments);for(var b=0;b<a.length;b++)this._year_render_event(a[b])};var x=scheduler.clear_view;scheduler.clear_view=function(){if(!c())return x.apply(this,arguments);for(var a=
0;a<j.length;a++)j[a].className="dhx_month_head",j[a].setAttribute("date","");j=[]};scheduler.hideToolTip=function(){if(this._tooltip)this._tooltip.style.display="none",this._tooltip.date=new Date(9999,1,1)};scheduler.showToolTip=function(a,b,d,c){if(this._tooltip){if(this._tooltip.date.valueOf()==a.valueOf())return;this._tooltip.innerHTML=""}else{var k=this._tooltip=document.createElement("DIV");k.className="dhx_tooltip";document.body.appendChild(k);k.onclick=scheduler._click.dhx_cal_data}for(var h=
this.getEvents(a,this.date.add(a,1,"day")),l="",f=0;f<h.length;f++){var m=h[f],e=m.color?"background-color:"+m.color+";":"",g=m.textColor?"color:"+m.textColor+";":"";l+="<div class='dhx_tooltip_line' style='"+e+""+g+"' event_id='"+h[f].id+"'>";l+="<div class='dhx_tooltip_date' style='"+e+""+g+"'>"+(h[f]._timed?this.templates.event_date(h[f].start_date):"")+"</div>";l+="<div class='dhx_event_icon icon_details'>&nbsp;</div>";l+=this.templates.year_tooltip(h[f].start_date,h[f].end_date,h[f])+"</div>"}this._tooltip.style.display=
"";this._tooltip.style.top="0px";this._tooltip.style.left=document.body.offsetWidth-b.left-this._tooltip.offsetWidth<0?b.left-this._tooltip.offsetWidth+"px":b.left+c.offsetWidth+"px";this._tooltip.date=a;this._tooltip.innerHTML=l;this._tooltip.style.top=document.body.offsetHeight-b.top-this._tooltip.offsetHeight<0?b.top-this._tooltip.offsetHeight+c.offsetHeight+"px":b.top+"px"};scheduler._init_year_tooltip=function(){dhtmlxEvent(scheduler._els.dhx_cal_data[0],"mouseover",function(a){if(c()){var a=
a||event,b=a.target||a.srcElement;if(b.tagName.toLowerCase()=="a")b=b.parentNode;(b.className||"").indexOf("dhx_year_event")!=-1?scheduler.showToolTip(w(b.getAttribute("date")),getOffset(b),a,b):scheduler.hideToolTip()}});this._init_year_tooltip=function(){}};scheduler.attachEvent("onSchedulerResize",function(){return c()?(this.year_view(!0),!1):!0});scheduler._get_year_cell=function(a){var b=a.getMonth()+12*(a.getFullYear()-this._min_date.getFullYear())-this.week_starts._month,d=this._els.dhx_cal_data[0].childNodes[b],
a=this.week_starts[b]+a.getDate()-1;return d.childNodes[2].firstChild.rows[Math.floor(a/7)].cells[a%7].firstChild};var j=[];scheduler._mark_year_date=function(a,b){var d=this._get_year_cell(a);d.className="dhx_month_head dhx_year_event "+this.templates.event_class(b.start_date,b.end_date,b);d.setAttribute("date",v(a));j.push(d)};scheduler._unmark_year_date=function(a){this._get_year_cell(a).className="dhx_month_head"};scheduler._year_render_event=function(a){for(var b=a.start_date,b=b.valueOf()<this._min_date.valueOf()?
this._min_date:this.date.date_part(new Date(b));b<a.end_date;)if(this._mark_year_date(b,a),b=this.date.add(b,1,"day"),b.valueOf()>=this._max_date.valueOf())break};scheduler.year_view=function(a){if(a){var b=scheduler.xy.scale_height;scheduler.xy.scale_height=-1}scheduler._els.dhx_cal_header[0].style.display=a?"none":"";scheduler.set_sizes();if(a)scheduler.xy.scale_height=b;scheduler._table_view=a;if(!this._load_mode||!this._load())a?(scheduler._init_year_tooltip(),scheduler._reset_year_scale(),scheduler.render_view_data()):
scheduler.hideToolTip()};scheduler._reset_year_scale=function(){this._cols=[];this._colsS={};var a=[],b=this._els.dhx_cal_data[0],d=this.config;b.scrollTop=0;b.innerHTML="";var c=Math.floor(parseInt(b.style.width)/d.year_x),k=Math.floor((parseInt(b.style.height)-scheduler.xy.year_top)/d.year_y);k<190&&(k=190,c=Math.floor((parseInt(b.style.width)-scheduler.xy.scroll_width)/d.year_x));for(var h=c-11,l=0,f=document.createElement("div"),m=this.date.week_start(new Date),e=0;e<7;e++)this._cols[e]=Math.floor(h/
(7-e)),this._render_x_header(e,l,m,f),m=this.date.add(m,1,"day"),h-=this._cols[e],l+=this._cols[e];f.lastChild.className+=" dhx_scale_bar_last";for(var g=this.date[this._mode+"_start"](this.date.copy(this._date)),j=g,e=0;e<d.year_y;e++)for(var r=0;r<d.year_x;r++){var i=document.createElement("DIV");i.style.cssText="position:absolute;";i.setAttribute("date",this.templates.xml_format(g));i.innerHTML="<div class='dhx_year_month'></div><div class='dhx_year_week'>"+f.innerHTML+"</div><div class='dhx_year_body'></div>";
i.childNodes[0].innerHTML=this.templates.year_month(g);for(var p=this.date.week_start(g),t=this._reset_month_scale(i.childNodes[2],g,p),n=i.childNodes[2].firstChild.rows,q=n.length;q<6;q++){n[0].parentNode.appendChild(n[0].cloneNode(!0));for(var s=0;s<n[q].childNodes.length;s++)n[q].childNodes[s].className="dhx_after",n[q].childNodes[s].firstChild.innerHTML=scheduler.templates.month_day(t),t=scheduler.date.add(t,1,"day")}b.appendChild(i);i.childNodes[1].style.height=i.childNodes[1].childNodes[0].offsetHeight+
"px";var o=Math.round((k-190)/2);i.style.marginTop=o+"px";this.set_xy(i,c-10,k-o-10,c*r+5,k*e+5+scheduler.xy.year_top);a[e*d.year_x+r]=(g.getDay()-(this.config.start_on_monday?1:0)+7)%7;g=this.date.add(g,1,"month")}this._els.dhx_cal_date[0].innerHTML=this.templates[this._mode+"_date"](j,g,this._mode);this.week_starts=a;a._month=j.getMonth();this._min_date=j;this._max_date=g}})();
scheduler.config.year_x=4;scheduler.config.year_y=3;scheduler.config.year_mode_name="year";scheduler.xy.year_top=0;scheduler.templates.year_date=function(c){return scheduler.date.date_to_str(scheduler.locale.labels.year_tab+" %Y")(c)};scheduler.templates.year_month=scheduler.date.date_to_str("%F");scheduler.templates.year_scale_date=scheduler.date.date_to_str("%D");scheduler.templates.year_tooltip=function(c,q,n){return n.text};
(function(){var c=function(){return scheduler._mode==scheduler.config.year_mode_name};scheduler.dblclick_dhx_month_head=function(b){if(c()){var a=b.target||b.srcElement;if(a.parentNode.className.indexOf("dhx_before")!=-1||a.parentNode.className.indexOf("dhx_after")!=-1)return!1;var j=this.templates.xml_date(a.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.getAttribute("date"));j.setDate(parseInt(a.innerHTML,10));var k=this.date.add(j,1,"day");!this.config.readonly&&this.config.dblclick_create&&
this.addEventNow(j.valueOf(),k.valueOf(),b)}};var q=scheduler.changeEventId;scheduler.changeEventId=function(){q.apply(this,arguments);c()&&this.year_view(!0)};var n=scheduler.render_data,v=scheduler.date.date_to_str("%Y/%m/%d"),w=scheduler.date.str_to_date("%Y/%m/%d");scheduler.render_data=function(b){if(!c())return n.apply(this,arguments);for(var a=0;a<b.length;a++)this._year_render_event(b[a])};var x=scheduler.clear_view;scheduler.clear_view=function(){if(!c())return x.apply(this,arguments);for(var b in l)if(l.hasOwnProperty(b)){var a=
l[b];a.className="dhx_month_head";a.setAttribute("date","")}l={}};scheduler.hideToolTip=function(){if(this._tooltip)this._tooltip.style.display="none",this._tooltip.date=new Date(9999,1,1)};scheduler.showToolTip=function(b,a,j,k){if(this._tooltip){if(this._tooltip.date.valueOf()==b.valueOf())return;this._tooltip.innerHTML=""}else{var g=this._tooltip=document.createElement("DIV");g.className="dhx_tooltip";document.body.appendChild(g);g.onclick=scheduler._click.dhx_cal_data}for(var h=this.getEvents(b,
this.date.add(b,1,"day")),c="",e=0;e<h.length;e++){var m=h[e],d=m.color?"background:"+m.color+";":"",f=m.textColor?"color:"+m.textColor+";":"";c+="<div class='dhx_tooltip_line' style='"+d+""+f+"' event_id='"+h[e].id+"'>";c+="<div class='dhx_tooltip_date' style='"+d+""+f+"'>"+(h[e]._timed?this.templates.event_date(h[e].start_date):"")+"</div>";c+="<div class='dhx_event_icon icon_details'>&nbsp;</div>";c+=this.templates.year_tooltip(h[e].start_date,h[e].end_date,h[e])+"</div>"}this._tooltip.style.display=
"";this._tooltip.style.top="0px";this._tooltip.style.left=document.body.offsetWidth-a.left-this._tooltip.offsetWidth<0?a.left-this._tooltip.offsetWidth+"px":a.left+k.offsetWidth+"px";this._tooltip.date=b;this._tooltip.innerHTML=c;this._tooltip.style.top=document.body.offsetHeight-a.top-this._tooltip.offsetHeight<0?a.top-this._tooltip.offsetHeight+k.offsetHeight+"px":a.top+"px"};scheduler._init_year_tooltip=function(){dhtmlxEvent(scheduler._els.dhx_cal_data[0],"mouseover",function(b){if(c()){var b=
b||event,a=b.target||b.srcElement;if(a.tagName.toLowerCase()=="a")a=a.parentNode;(a.className||"").indexOf("dhx_year_event")!=-1?scheduler.showToolTip(w(a.getAttribute("date")),getOffset(a),b,a):scheduler.hideToolTip()}});this._init_year_tooltip=function(){}};scheduler.attachEvent("onSchedulerResize",function(){return c()?(this.year_view(!0),!1):!0});scheduler._get_year_cell=function(b){var a=b.getMonth()+12*(b.getFullYear()-this._min_date.getFullYear())-this.week_starts._month,j=this._els.dhx_cal_data[0].childNodes[a],
b=this.week_starts[a]+b.getDate()-1;return j.childNodes[2].firstChild.rows[Math.floor(b/7)].cells[b%7].firstChild};var l={};scheduler._mark_year_date=function(b,a){var j=v(b),c=this._get_year_cell(b),g=this.templates.event_class(a.start_date,a.end_date,a);if(!l[j])c.className="dhx_month_head dhx_year_event",c.setAttribute("date",j),l[j]=c;c.className+=g?" "+g:""};scheduler._unmark_year_date=function(b){this._get_year_cell(b).className="dhx_month_head"};scheduler._year_render_event=function(b){for(var a=
b.start_date,a=a.valueOf()<this._min_date.valueOf()?this._min_date:this.date.date_part(new Date(a));a<b.end_date;)if(this._mark_year_date(a,b),a=this.date.add(a,1,"day"),a.valueOf()>=this._max_date.valueOf())break};scheduler.year_view=function(b){if(b){var a=scheduler.xy.scale_height;scheduler.xy.scale_height=-1}scheduler._els.dhx_cal_header[0].style.display=b?"none":"";scheduler.set_sizes();if(b)scheduler.xy.scale_height=a;scheduler._table_view=b;if(!this._load_mode||!this._load())if(b){scheduler._init_year_tooltip();
scheduler._reset_year_scale();if(scheduler._load_mode&&scheduler._load())return scheduler._render_wait=!0;scheduler.render_view_data()}else scheduler.hideToolTip()};scheduler._reset_year_scale=function(){this._cols=[];this._colsS={};var b=[],a=this._els.dhx_cal_data[0],c=this.config;a.scrollTop=0;a.innerHTML="";var k=Math.floor(parseInt(a.style.width)/c.year_x),g=Math.floor((parseInt(a.style.height)-scheduler.xy.year_top)/c.year_y);g<190&&(g=190,k=Math.floor((parseInt(a.style.width)-scheduler.xy.scroll_width)/
c.year_x));for(var h=k-11,l=0,e=document.createElement("div"),m=this.date.week_start(new Date),d=0;d<7;d++)this._cols[d]=Math.floor(h/(7-d)),this._render_x_header(d,l,m,e),m=this.date.add(m,1,"day"),h-=this._cols[d],l+=this._cols[d];e.lastChild.className+=" dhx_scale_bar_last";for(var f=this.date[this._mode+"_start"](this.date.copy(this._date)),n=f,d=0;d<c.year_y;d++)for(var r=0;r<c.year_x;r++){var i=document.createElement("DIV");i.style.cssText="position:absolute;";i.setAttribute("date",this.templates.xml_format(f));
i.innerHTML="<div class='dhx_year_month'></div><div class='dhx_year_week'>"+e.innerHTML+"</div><div class='dhx_year_body'></div>";i.childNodes[0].innerHTML=this.templates.year_month(f);for(var q=this.date.week_start(f),t=this._reset_month_scale(i.childNodes[2],f,q),o=i.childNodes[2].firstChild.rows,p=o.length;p<6;p++){o[0].parentNode.appendChild(o[0].cloneNode(!0));for(var s=0;s<o[p].childNodes.length;s++)o[p].childNodes[s].className="dhx_after",o[p].childNodes[s].firstChild.innerHTML=scheduler.templates.month_day(t),
t=scheduler.date.add(t,1,"day")}a.appendChild(i);i.childNodes[1].style.height=i.childNodes[1].childNodes[0].offsetHeight+"px";var u=Math.round((g-190)/2);i.style.marginTop=u+"px";this.set_xy(i,k-10,g-u-10,k*r+5,g*d+5+scheduler.xy.year_top);b[d*c.year_x+r]=(f.getDay()-(this.config.start_on_monday?1:0)+7)%7;f=this.date.add(f,1,"month")}this._els.dhx_cal_date[0].innerHTML=this.templates[this._mode+"_date"](n,f,this._mode);this.week_starts=b;b._month=n.getMonth();this._min_date=n;this._max_date=f}})();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 388 B

After

Width:  |  Height:  |  Size: 388 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1018 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 588 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 761 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 616 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 622 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 B

View File

@ -1,4 +1,4 @@
dhtmlxScheduler v.3.0 build 110727
dhtmlxScheduler v.3.5 build 120823
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in non-GPL project. Please contact sales@dhtmlx.com for details

View File

@ -1,161 +0,0 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
*/
scheduler.date={
init:function(){
var s = scheduler.locale.date.month_short;
var t = scheduler.locale.date.month_short_hash = {};
for (var i = 0; i < s.length; i++)
t[s[i]]=i;
var s = scheduler.locale.date.month_full;
var t = scheduler.locale.date.month_full_hash = {};
for (var i = 0; i < s.length; i++)
t[s[i]]=i;
},
date_part:function(date){
date.setHours(0);
date.setMinutes(0);
date.setSeconds(0);
date.setMilliseconds(0);
return date;
},
time_part:function(date){
return (date.valueOf()/1000 - date.getTimezoneOffset()*60)%86400;
},
week_start:function(date){
var shift=date.getDay();
if (scheduler.config.start_on_monday){
if (shift===0) shift=6;
else shift--;
}
return this.date_part(this.add(date,-1*shift,"day"));
},
month_start:function(date){
date.setDate(1);
return this.date_part(date);
},
year_start:function(date){
date.setMonth(0);
return this.month_start(date);
},
day_start:function(date){
return this.date_part(date);
},
add:function(date,inc,mode){
var ndate=new Date(date.valueOf());
switch(mode){
case "day":
ndate.setDate(ndate.getDate()+inc);
if(date.getDate()==ndate.getDate() && !!inc) {
do {
ndate.setTime(ndate.getTime()+60*60*1000);
} while (date.getDate() == ndate.getDate())
}
break;
case "week": ndate.setDate(ndate.getDate()+7*inc); break;
case "month": ndate.setMonth(ndate.getMonth()+inc); break;
case "year": ndate.setYear(ndate.getFullYear()+inc); break;
case "hour": ndate.setHours(ndate.getHours()+inc); break;
case "minute": ndate.setMinutes(ndate.getMinutes()+inc); break;
default:
return scheduler.date["add_"+mode](date,inc,mode);
}
return ndate;
},
to_fixed:function(num){
if (num<10) return "0"+num;
return num;
},
copy:function(date){
return new Date(date.valueOf());
},
date_to_str:function(format,utc){
format=format.replace(/%[a-zA-Z]/g,function(a){
switch(a){
case "%d": return "\"+scheduler.date.to_fixed(date.getDate())+\"";
case "%m": return "\"+scheduler.date.to_fixed((date.getMonth()+1))+\"";
case "%j": return "\"+date.getDate()+\"";
case "%n": return "\"+(date.getMonth()+1)+\"";
case "%y": return "\"+scheduler.date.to_fixed(date.getFullYear()%100)+\"";
case "%Y": return "\"+date.getFullYear()+\"";
case "%D": return "\"+scheduler.locale.date.day_short[date.getDay()]+\"";
case "%l": return "\"+scheduler.locale.date.day_full[date.getDay()]+\"";
case "%M": return "\"+scheduler.locale.date.month_short[date.getMonth()]+\"";
case "%F": return "\"+scheduler.locale.date.month_full[date.getMonth()]+\"";
case "%h": return "\"+scheduler.date.to_fixed((date.getHours()+11)%12+1)+\"";
case "%g": return "\"+((date.getHours()+11)%12+1)+\"";
case "%G": return "\"+date.getHours()+\"";
case "%H": return "\"+scheduler.date.to_fixed(date.getHours())+\"";
case "%i": return "\"+scheduler.date.to_fixed(date.getMinutes())+\"";
case "%a": return "\"+(date.getHours()>11?\"pm\":\"am\")+\"";
case "%A": return "\"+(date.getHours()>11?\"PM\":\"AM\")+\"";
case "%s": return "\"+scheduler.date.to_fixed(date.getSeconds())+\"";
case "%W": return "\"+scheduler.date.to_fixed(scheduler.date.getISOWeek(date))+\"";
default: return a;
}
});
if (utc) format=format.replace(/date\.get/g,"date.getUTC");
return new Function("date","return \""+format+"\";");
},
str_to_date:function(format,utc){
var splt="var temp=date.split(/[^0-9a-zA-Z]+/g);";
var mask=format.match(/%[a-zA-Z]/g);
for (var i=0; i<mask.length; i++){
switch(mask[i]){
case "%j":
case "%d": splt+="set[2]=temp["+i+"]||1;";
break;
case "%n":
case "%m": splt+="set[1]=(temp["+i+"]||1)-1;";
break;
case "%y": splt+="set[0]=temp["+i+"]*1+(temp["+i+"]>50?1900:2000);";
break;
case "%g":
case "%G":
case "%h":
case "%H":
splt+="set[3]=temp["+i+"]||0;";
break;
case "%i":
splt+="set[4]=temp["+i+"]||0;";
break;
case "%Y": splt+="set[0]=temp["+i+"]||0;";
break;
case "%a":
case "%A": splt+="set[3]=set[3]%12+((temp["+i+"]||'').toLowerCase()=='am'?0:12);";
break;
case "%s": splt+="set[5]=temp["+i+"]||0;";
break;
case "%M": splt+="set[1]=scheduler.locale.date.month_short_hash[temp["+i+"]]||0;";
break;
case "%F": splt+="set[1]=scheduler.locale.date.month_full_hash[temp["+i+"]]||0;";
break;
default:
break;
}
}
var code ="set[0],set[1],set[2],set[3],set[4],set[5]";
if (utc) code =" Date.UTC("+code+")";
return new Function("date","var set=[0,0,1,0,0,0]; "+splt+" return new Date("+code+");");
},
getISOWeek: function(ndate) {
if(!ndate) return false;
var nday = ndate.getDay();
if (nday === 0) {
nday = 7;
}
var first_thursday = new Date(ndate.valueOf());
first_thursday.setDate(ndate.getDate() + (4 - nday));
var year_number = first_thursday.getFullYear(); // year of the first Thursday
var ordinal_date = Math.round( (first_thursday.getTime() - new Date(year_number, 0, 1).getTime()) / 86400000); //ordinal date of the first Thursday - 1 (so not really ordinal date)
var week_number = 1 + Math.floor( ordinal_date / 7);
return week_number;
},
getUTCISOWeek: function(ndate){
return this.getISOWeek(ndate);
}
};

View File

@ -1,110 +0,0 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
*/
.dhx_cal_ltext{
text-align:left;
}
.dhx_agenda_line {
overflow:hidden;
white-space:nowrap;
}
.dhx_cal_light select{
width:auto;
}
.dhx_custom_button {
width:120px !important;
}
.dhx_cal_ltext{
text-align:left;
}
.dhx_form_repeat{
text-align:left;
width:100%;
}
.dhx_cal_lsection {
text-align:left;
}
.dhx_month_head{
font-size:8pt;
}
.dhx_expand_icon {
position:absolute; top:0px; right:2px;
background-image:url(./imgs/colapce-expand-icon.gif);
width:18px; height:18px;
cursor:pointer;
background-position:0px 18px;
z-index:16;
}
div.dhx_cal_container table tr td {
border-width:0 !important;
padding:0 !important;
}
.dhx_cal_container table {
border-collapse:separate !important;
margin:0 0 !important;
}
.dhx_cal_container{
z-index:999;
}
div.dhx_cal_event_clear, div.dhx_cal_event{
line-height:100%;
}
.dhx_cal_ltext textarea {
-moz-box-shadow:none;
border-width:0;
padding:0;
background:transparent none repeat scroll 0 0;
-webkit-box-shadow:none;
}
.dhx_cal_light{
text-align:left;
}
.dhx_cal_light div, .dhx_cal_container div{
line-height:normal;
}
.dhx_cal_light .dhx_form_repeat div,.dhx_cal_light .dhx_form_repeat{
line-height:24px;
}
/* anti-joomla */
div.dhx_cal_navline div, .dhx_scale_bar, .dhx_scale_hour, .dhx_title{
text-align:center !important;
}
#whitebox div .dhx_month_head {
text-align:right;
}
#whitebox div .dhx_cal_event_line, #whitebox div .dhx_body{
text-align:left;
}
div.dhx_cal_container, div.dhx_cal_lsection{
line-height:1em;
}
div.dhx_cal_container, div.dhx_cal_lsection{
line-height:normal;
}
.dhx_cal_header .dhx_agenda_line div, .dhx_year_month{
text-align:center !important;
}
.dhx_tooltip{
text-align:left;
}
.dhx_cal_data table{
border-width:0px !important;
}
.dhx_cal_data table tr td{
border-top-width:0px !important;
}

View File

@ -1,117 +0,0 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
*/
/*
%e Day of the month without leading zeros (01..31)
%d Day of the month, 2 digits with leading zeros (01..31)
%j Day of the year, 3 digits with leading zeros (001..366)
%a A textual representation of a day, two letters
%W A full textual representation of the day of the week
%c Numeric representation of a month, without leading zeros (0..12)
%m Numeric representation of a month, with leading zeros (00..12)
%b A short textual representation of a month, three letters (Jan..Dec)
%M A full textual representation of a month, such as January or March (January..December)
%y A two digit representation of a year (93..03)
%Y A full numeric representation of a year, 4 digits (1993..03)
*/
scheduler.config={
default_date: "%j %M %Y",
month_date: "%F %Y",
load_date: "%Y-%m-%d",
week_date: "%l",
day_date: "%D, %F %j",
hour_date: "%H:%i",
month_day : "%d",
xml_date:"%m/%d/%Y %H:%i",
api_date:"%d-%m-%Y %H:%i",
hour_size_px:42,
time_step:5,
start_on_monday:1,
first_hour:0,
last_hour:24,
readonly:false,
drag_resize:1,
drag_move:1,
drag_create:1,
dblclick_create:1,
edit_on_create:1,
details_on_create:0,
click_form_details:0,
cascade_event_display: false,
cascade_event_count:4,
cascade_event_margin: 30,
drag_lightbox:true,
preserve_scroll:true,
server_utc:false,
positive_closing:false,
icons_edit:["icon_save","icon_cancel"],
icons_select:["icon_details","icon_edit","icon_delete"],
buttons_left:["dhx_save_btn","dhx_cancel_btn"],
buttons_right:["dhx_delete_btn"],
lightbox:{
sections:[ {name:"description", height:200, map_to:"text", type:"textarea" , focus:true},
{name:"time", height:72, type:"time", map_to:"auto"} ]
},
repeat_date_of_end: "01.01.2010"
};
scheduler.templates={};
scheduler.init_templates=function(){
var d=scheduler.date.date_to_str;
var c=scheduler.config;
var f = function(a,b){
for (var c in b)
if (!a[c]) a[c]=b[c];
};
f(scheduler.templates,{
day_date:d(c.default_date),
month_date:d(c.month_date),
week_date:function(d1,d2){
return scheduler.templates.day_date(d1)+" &ndash; "+scheduler.templates.day_date(scheduler.date.add(d2,-1,"day"));
},
day_scale_date:d(c.default_date),
month_scale_date:d(c.week_date),
week_scale_date:d(c.day_date),
hour_scale:d(c.hour_date),
time_picker:d(c.hour_date),
event_date:d(c.hour_date),
month_day:d(c.month_day),
xml_date:scheduler.date.str_to_date(c.xml_date,c.server_utc),
load_format:d(c.load_date,c.server_utc),
xml_format:d(c.xml_date,c.server_utc),
api_date:scheduler.date.str_to_date(c.api_date),
event_header:function(start,end,ev){
return scheduler.templates.event_date(start)+" - "+scheduler.templates.event_date(end);
},
event_text:function(start,end,ev){
return ev.text;
},
event_class:function(start,end,ev){
return "";
},
month_date_class:function(d){
return "";
},
week_date_class:function(d){
return "";
},
event_bar_date:function(start,end,ev){
return scheduler.templates.event_date(start)+" ";
},
event_bar_text:function(start,end,ev){
return ev.text;
}
});
this.callEvent("onTemplatesReady",[]);
};

View File

@ -1,139 +0,0 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
*/
/*
dhx_sort[index]=direction
dhx_filter[index]=mask
*/
if (window.dhtmlXGridObject){
dhtmlXGridObject.prototype._init_point_connector=dhtmlXGridObject.prototype._init_point;
dhtmlXGridObject.prototype._init_point=function(){
var clear_url=function(url){
url=url.replace(/(\?|\&)connector[^\f]*/g,"");
return url+(url.indexOf("?")!=-1?"&":"?")+"connector=true"+(this.hdr.rows.length > 0 ? "&dhx_no_header=1":"");
};
var combine_urls=function(url){
return clear_url.call(this,url)+(this._connector_sorting||"")+(this._connector_filter||"");
};
var sorting_url=function(url,ind,dir){
this._connector_sorting="&dhx_sort["+ind+"]="+dir;
return combine_urls.call(this,url);
};
var filtering_url=function(url,inds,vals){
for (var i=0; i<inds.length; i++)
inds[i]="dhx_filter["+inds[i]+"]="+encodeURIComponent(vals[i]);
this._connector_filter="&"+inds.join("&");
return combine_urls.call(this,url);
};
this.attachEvent("onCollectValues",function(ind){
if (this._con_f_used[ind]){
if (typeof(this._con_f_used[ind]) == "object")
return this._con_f_used[ind];
else
return false;
}
return true;
});
this.attachEvent("onDynXLS",function(){
this.xmlFileUrl=combine_urls.call(this,this.xmlFileUrl);
return true;
});
this.attachEvent("onBeforeSorting",function(ind,type,dir){
if (type=="connector"){
var self=this;
this.clearAndLoad(sorting_url.call(this,this.xmlFileUrl,ind,dir),function(){
self.setSortImgState(true,ind,dir);
});
return false;
}
return true;
});
this.attachEvent("onFilterStart",function(a,b){
if (this._con_f_used.length){
this.clearAndLoad(filtering_url.call(this,this.xmlFileUrl,a,b));
return false;
}
return true;
});
this.attachEvent("onXLE",function(a,b,c,xml){
if (!xml) return;
});
if (this._init_point_connector) this._init_point_connector();
};
dhtmlXGridObject.prototype._con_f_used=[];
dhtmlXGridObject.prototype._in_header_connector_text_filter=function(t,i){
if (!this._con_f_used[i])
this._con_f_used[i]=1;
return this._in_header_text_filter(t,i);
};
dhtmlXGridObject.prototype._in_header_connector_select_filter=function(t,i){
if (!this._con_f_used[i])
this._con_f_used[i]=2;
return this._in_header_select_filter(t,i);
};
dhtmlXGridObject.prototype.load_connector=dhtmlXGridObject.prototype.load;
dhtmlXGridObject.prototype.load=function(url, call, type){
if (!this._colls_loaded && this.cellType){
var ar=[];
for (var i=0; i < this.cellType.length; i++)
if (this.cellType[i].indexOf("co")==0 || this._con_f_used[i]==2) ar.push(i);
if (ar.length)
arguments[0]+=(arguments[0].indexOf("?")!=-1?"&":"?")+"connector=true&dhx_colls="+ar.join(",");
}
return this.load_connector.apply(this,arguments);
};
dhtmlXGridObject.prototype._parseHead_connector=dhtmlXGridObject.prototype._parseHead;
dhtmlXGridObject.prototype._parseHead=function(url, call, type){
this._parseHead_connector.apply(this,arguments);
if (!this._colls_loaded){
var cols = this.xmlLoader.doXPath("./coll_options", arguments[0]);
for (var i=0; i < cols.length; i++){
var f = cols[i].getAttribute("for");
var v = [];
var combo=null;
if (this.cellType[f] == "combo")
combo = this.getColumnCombo(f);
if (this.cellType[f].indexOf("co")==0)
combo=this.getCombo(f);
var os = this.xmlLoader.doXPath("./item",cols[i]);
for (var j=0; j<os.length; j++){
var val=os[j].getAttribute("value");
if (combo){
var lab=os[j].getAttribute("label")||val;
if (combo.addOption)
combo.addOption([[val, lab]]);
else
combo.put(val,lab);
v[v.length]=lab;
} else
v[v.length]=val;
}
if (this._con_f_used[f*1])
this._con_f_used[f*1]=v;
}
this._colls_loaded=true;
}
};
}
if (window.dataProcessor){
dataProcessor.prototype.init_original=dataProcessor.prototype.init;
dataProcessor.prototype.init=function(obj){
this.init_original(obj);
obj._dataprocessor=this;
this.setTransactionMode("POST",true);
this.serverProcessor+=(this.serverProcessor.indexOf("?")!=-1?"&":"?")+"editing=true";
};
}
dhtmlxError.catchError("LoadXML",function(a,b,c){
if (c[0].status != 0) {
alert(c[0].responseText);
}
});

View File

@ -1,82 +0,0 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
*/
scheduler._dp_init=function(dp){
dp._methods=["setEventTextStyle","","changeEventId","deleteEvent"];
this.attachEvent("onEventAdded",function(id){
if (!this._loading && this.validId(id))
dp.setUpdated(id,true,"inserted");
});
this.attachEvent("onConfirmedBeforeEventDelete", function(id){
if (!this.validId(id)) return;
var z=dp.getState(id);
if (z=="inserted" || this._new_event) { dp.setUpdated(id,false); return true; }
if (z=="deleted") return false;
if (z=="true_deleted") return true;
dp.setUpdated(id,true,"deleted");
return false;
});
this.attachEvent("onEventChanged",function(id){
if (!this._loading && this.validId(id))
dp.setUpdated(id,true,"updated");
});
dp._getRowData=function(id,pref){
var ev=this.obj.getEvent(id);
var data = {};
for (var a in ev){
if (a.indexOf("_")==0) continue;
if (ev[a] && ev[a].getUTCFullYear) //not very good, but will work
data[a] = this.obj.templates.xml_format(ev[a]);
else
data[a] = ev[a];
}
return data;
};
dp._clearUpdateFlag=function(){};
dp.attachEvent("insertCallback", scheduler._update_callback);
dp.attachEvent("updateCallback", scheduler._update_callback);
dp.attachEvent("deleteCallback", function(upd, id) {
this.obj.setUserData(id, this.action_param, "true_deleted");
this.obj.deleteEvent(id);
});
};
scheduler.setUserData=function(id,name,value){
if (id)
this.getEvent(id)[name]=value;
else
this._userdata[name]=value;
};
scheduler.getUserData=function(id,name){
return id?this.getEvent(id)[name]:this._userdata[name];
};
scheduler.setEventTextStyle=function(id,style){
this.for_rendered(id,function(r){
r.style.cssText+=";"+style;
});
var ev = this.getEvent(id);
ev["_text_style"]=style;
this.event_updated(ev);
};
scheduler.validId=function(id){
return true;
};
scheduler._update_callback = function(upd,id){
var data = scheduler.xmlNodeToJSON(upd.firstChild);
data.text = data.text||data._tagvalue;
data.start_date = scheduler.templates.xml_date(data.start_date);
data.end_date = scheduler.templates.xml_date(data.end_date);
scheduler.addEvent(data);
};

View File

@ -1,200 +0,0 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
*/
dhx.protoUI({
name:"dayevents",
defaults:{
hourFormat:"%H",
hourClock:12,
firstHour:0,
lastHour:24,
timeScaleWidth:45,
timeScaleHeight: 30,
scroll:true,
scaleBorder:1,
eventOffset:5,
width:"auto",
date: new Date()
},
$init:function(config){
this.name = "DayEvents";
this._dataobj.style.position = "relative";
this.data.provideApi(this,true);
this.data.attachEvent("onStoreUpdated",dhx.bind(this.render,this));
this.attachEvent("onBeforeRender", function(){
this._renderScale();
this.type.color = this.config.color;
this.type.textColor = this.config.textColor;
this._renderobj = this._dataobj.firstChild;
this._prepareEvents();
if(window.scheduler)
this.type.template = scheduler.templates.day_event;
});
if(window.scheduler){
config.hourFormat = scheduler.config.scale_hour;
config.timeScaleWidth = scheduler.xy.scale_width;
config.timeScaleHeight = scheduler.xy.scale_height*2;
}
},
_renderScale:function(){
var html = "<div></div>";
for(var h = this.config.firstHour; h<this.config.lastHour; h++){
html += this.hourScaleItem(h);
}
this._dataobj.innerHTML = html;
},
_id:"dhx_l_id",
on_click:{
},
hourScaleItem: function(hour){
var isAM = (scheduler.config.hour_date.toLowerCase().indexOf("a")!=-1);
var top = '00';
var bottom = '30';
if(isAM){
if(hour===0)
top = 'AM';
if(hour==12)
top = 'PM';
hour = (hour+11)%12+1;
}
if(this.config.hourFormat.indexOf("H")!=-1)
hour = dhx.math.toFixed(hour);
var html = "";
var timeScaleWidth = this.config.timeScaleWidth;
var hourHeight = this.config.timeScaleHeight;
var sectionWidth = Math.floor(this.config.timeScaleWidth/2);
var heightTop = Math.floor(hourHeight/2);
var heightBottom = heightTop-this.config.scaleBorder;
var eventZoneWidth = this._content_width-this.config.scaleBorder-this.config.timeScaleWidth;
html += "<div style='width: 100%; height:"+hourHeight+"px;' class='dhx_dayevents_scale_item'>";
html += "<div class='dhx_dayevents_scale_hour' style='width:"+sectionWidth+"px; height:"+hourHeight+"px;line-height:"+hourHeight+"px;'>"+hour+"</div>";
html += "<div class='dhx_dayevents_scale_minute' style='width:"+sectionWidth+"px'>";
html += "<div class='dhx_dayevents_scale_top' style='width:"+sectionWidth+"px;line-height:"+heightTop+"px'>"+top+"</div>";
html += "<div class='dhx_dayevents_scale_bottom' style='width:"+sectionWidth+"px;line-height:"+heightBottom+"px'>"+bottom+"</div>";
html += "</div>";
html += "<div class='dhx_dayevents_scale_event' style='width:"+eventZoneWidth+"px'>";
html += "<div class='dhx_dayevents_scale_top' style='height:"+heightTop+"px;width:"+eventZoneWidth+"px'></div>";
html += "<div class='dhx_dayevents_scale_bottom' style='width: "+eventZoneWidth+"px;height:"+heightBottom+"px; '></div>";
html += "</div>";
html += "</div>";
return html;
},
type:{
templateStart:dhx.Template("<div dhx_l_id='#id#' class='dhx_dayevents_event_item {common.templateCss()}' style='left:#$left#px;top:#$top#px;width:#$width#px;height:#$height#px;padding:{common.padding}px;overflow:hidden; background-color:{common.templateColor()} ;color:{common.templateTextColor()};'>"),
template:scheduler.templates.day_event,
templateEnd:dhx.Template("</div>"),
templateCss:dhx.Template(""),
templateColor:dhx.Template("#color#"),
templateTextColor:dhx.Template("#textColor#"),
padding:2
},
_prepareEvents:function(){
var evs = this.data.getRange();
var stack = [];
var ev,i,j,k,_is_sorder,_max_sorder,_sorder_set;
for(i=0; i< evs.length;i++){
ev=evs[i];
ev.$inner=false;
while (stack.length && stack[stack.length-1].end_date.valueOf()<=ev.start_date.valueOf()){
stack.splice(stack.length-1,1);
}
_sorder_set = false;
for(j=0;j< stack.length;j++){
if(stack[j].end_date.valueOf()<=ev.start_date.valueOf()){
_sorder_set = true;
ev.$sorder=stack[j].$sorder;
stack.splice(j,1);
ev.$inner=true;
break;
}
}
if (stack.length) stack[stack.length-1].$inner=true;
if(!_sorder_set){
if(stack.length){
if(stack.length<=stack[stack.length-1].$sorder){
if(!stack[stack.length-1].$sorder)
ev.$sorder = 0;
else
for(j=0;j<stack.length;j++){
_is_sorder = false;
for(k=0;k<stack.length;k++){
if(stack[k].$sorder==j){
_is_sorder = true;
break;
}
}
if(!_is_sorder){
ev.$sorder = j;
break;
}
}
ev.$inner = true;
}
else{
var _max_sorder = stack[0].$sorder;
for(j =1;j < stack.length; j++)
if(stack[j].$sorder>_max_sorder)
_max_sorder = stack[j].$sorder;
ev.$sorder = _max_sorder+1;
ev.$inner = false;
}
}
else
ev.$sorder = 0;
}
stack.push(ev);
if (stack.length>(stack.max_count||0)) stack.max_count=stack.length;
}
for (var i=0; i < evs.length; i++){
evs[i].$count=stack.max_count;
this._setPosition(evs[i]);
}
},
_setPosition:function(ev){
var date = this.config.date.getValue?this.config.date.getValue():this.config.date;
var start = dhx.Date.copy(ev.start_date);
var end = dhx.Date.copy(ev.end_date);
var sh = start.getHours();
var eh = end.getHours();
if(dhx.Date.datePart(start).valueOf()>dhx.Date.datePart(end).valueOf()){
end = start;
}
if(dhx.Date.datePart(start).valueOf()<dhx.Date.datePart(date).valueOf()){
start = dhx.Date.datePart(date);
}
if(dhx.Date.datePart(end).valueOf()>dhx.Date.datePart(date).valueOf()){
end = dhx.Date.datePart(date);
end.setMinutes(0);
end.setHours(this.config.lastHour);
}
if (sh < this.config.firstHour || eh >= this.config.lastHour){
if (sh < this.config.firstHour){
end.setHours(this.config.firstHour);
ev.start_date.setMinutes(0);
}
if (eh >= this.config.lastHour){
end.setMinutes(0);
end.setHours(this.config.lastHour);
}
}
var temp_width = Math.floor((this._content_width-this.config.timeScaleWidth-this.config.eventOffset-8)/ev.$count);
ev.$left=ev.$sorder*(temp_width)+this.config.timeScaleWidth+this.config.eventOffset;
if (!ev.$inner) temp_width=temp_width*(ev.$count-ev.$sorder);
ev.$width = temp_width-this.config.eventOffset-this.type.padding*2;
var sm = start.getHours()*60+start.getMinutes();
var em = (end.getHours()*60+end.getMinutes())||(this.config.lastHour*60);
ev.$top = Math.round((sm-this.config.firstHour/60)*(this.config.timeScaleHeight+1)/60); //42px/hour
ev.$height = Math.max(10,(em-sm)*(this.config.timeScaleHeight+1)/60-2)-this.type.padding*2;
}
}, dhx.MouseEvents, dhx.SelectionModel, dhx.Scrollable, dhx.RenderStack, dhx.DataLoader, dhx.ui.view, dhx.EventSystem, dhx.Settings);

View File

@ -1,914 +0,0 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
*/
dhtmlx=function(obj){
for (var a in obj) dhtmlx[a]=obj[a];
return dhtmlx; //simple singleton
};
dhtmlx.extend_api=function(name,map,ext){
var t = window[name];
if (!t) return; //component not defined
window[name]=function(obj){
if (obj && typeof obj == "object" && !obj.tagName && !(obj instanceof Array)){
var that = t.apply(this,(map._init?map._init(obj):arguments));
//global settings
for (var a in dhtmlx)
if (map[a]) this[map[a]](dhtmlx[a]);
//local settings
for (var a in obj){
if (map[a]) this[map[a]](obj[a]);
else if (a.indexOf("on")==0){
this.attachEvent(a,obj[a]);
}
}
} else
var that = t.apply(this,arguments);
if (map._patch) map._patch(this);
return that||this;
};
window[name].prototype=t.prototype;
if (ext)
dhtmlXHeir(window[name].prototype,ext);
};
dhtmlxAjax={
get:function(url,callback){
var t=new dtmlXMLLoaderObject(true);
t.async=(arguments.length<3);
t.waitCall=callback;
t.loadXML(url)
return t;
},
post:function(url,post,callback){
var t=new dtmlXMLLoaderObject(true);
t.async=(arguments.length<4);
t.waitCall=callback;
t.loadXML(url,true,post)
return t;
},
getSync:function(url){
return this.get(url,null,true)
},
postSync:function(url,post){
return this.post(url,post,null,true);
}
}
/**
* @desc: xmlLoader object
* @type: private
* @param: funcObject - xml parser function
* @param: object - jsControl object
* @param: async - sync/async mode (async by default)
* @param: rSeed - enable/disable random seed ( prevent IE caching)
* @topic: 0
*/
function dtmlXMLLoaderObject(funcObject, dhtmlObject, async, rSeed){
this.xmlDoc="";
if (typeof (async) != "undefined")
this.async=async;
else
this.async=true;
this.onloadAction=funcObject||null;
this.mainObject=dhtmlObject||null;
this.waitCall=null;
this.rSeed=rSeed||false;
return this;
};
/**
* @desc: xml loading handler
* @type: private
* @param: dtmlObject - xmlLoader object
* @topic: 0
*/
dtmlXMLLoaderObject.prototype.waitLoadFunction=function(dhtmlObject){
var once = true;
this.check=function (){
if ((dhtmlObject)&&(dhtmlObject.onloadAction != null)){
if ((!dhtmlObject.xmlDoc.readyState)||(dhtmlObject.xmlDoc.readyState == 4)){
if (!once)
return;
once=false; //IE 5 fix
if (typeof dhtmlObject.onloadAction == "function")
dhtmlObject.onloadAction(dhtmlObject.mainObject, null, null, null, dhtmlObject);
if (dhtmlObject.waitCall){
dhtmlObject.waitCall.call(this,dhtmlObject);
dhtmlObject.waitCall=null;
}
}
}
};
return this.check;
};
/**
* @desc: return XML top node
* @param: tagName - top XML node tag name (not used in IE, required for Safari and Mozilla)
* @type: private
* @returns: top XML node
* @topic: 0
*/
dtmlXMLLoaderObject.prototype.getXMLTopNode=function(tagName, oldObj){
if (this.xmlDoc.responseXML){
var temp = this.xmlDoc.responseXML.getElementsByTagName(tagName);
if(temp.length==0 && tagName.indexOf(":")!=-1)
var temp = this.xmlDoc.responseXML.getElementsByTagName((tagName.split(":"))[1]);
var z = temp[0];
} else
var z = this.xmlDoc.documentElement;
if (z){
this._retry=false;
return z;
}
if ((_isIE)&&(!this._retry)){
//fall back to MS.XMLDOM
var xmlString = this.xmlDoc.responseText;
var oldObj = this.xmlDoc;
this._retry=true;
this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
this.xmlDoc.async=false;
this.xmlDoc["loadXM"+"L"](xmlString);
return this.getXMLTopNode(tagName, oldObj);
}
dhtmlxError.throwError("LoadXML", "Incorrect XML", [
(oldObj||this.xmlDoc),
this.mainObject
]);
return document.createElement("DIV");
};
/**
* @desc: load XML from string
* @type: private
* @param: xmlString - xml string
* @topic: 0
*/
dtmlXMLLoaderObject.prototype.loadXMLString=function(xmlString){
{
try{
var parser = new DOMParser();
this.xmlDoc=parser.parseFromString(xmlString, "text/xml");
}
catch (e){
this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
this.xmlDoc.async=this.async;
this.xmlDoc["loadXM"+"L"](xmlString);
}
}
this.onloadAction(this.mainObject, null, null, null, this);
if (this.waitCall){
this.waitCall();
this.waitCall=null;
}
}
/**
* @desc: load XML
* @type: private
* @param: filePath - xml file path
* @param: postMode - send POST request
* @param: postVars - list of vars for post request
* @topic: 0
*/
dtmlXMLLoaderObject.prototype.loadXML=function(filePath, postMode, postVars, rpc){
if (this.rSeed)
filePath+=((filePath.indexOf("?") != -1) ? "&" : "?")+"a_dhx_rSeed="+(new Date()).valueOf();
this.filePath=filePath;
if ((!_isIE)&&(window.XMLHttpRequest))
this.xmlDoc=new XMLHttpRequest();
else {
this.xmlDoc=new ActiveXObject("Microsoft.XMLHTTP");
}
if (this.async)
this.xmlDoc.onreadystatechange=new this.waitLoadFunction(this);
this.xmlDoc.open(postMode ? "POST" : "GET", filePath, this.async);
if (rpc){
this.xmlDoc.setRequestHeader("User-Agent", "dhtmlxRPC v0.1 ("+navigator.userAgent+")");
this.xmlDoc.setRequestHeader("Content-type", "text/xml");
}
else if (postMode)
this.xmlDoc.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
this.xmlDoc.setRequestHeader("X-Requested-With","XMLHttpRequest");
this.xmlDoc.send(null||postVars);
if (!this.async)
(new this.waitLoadFunction(this))();
};
/**
* @desc: destructor, cleans used memory
* @type: private
* @topic: 0
*/
dtmlXMLLoaderObject.prototype.destructor=function(){
this.onloadAction=null;
this.mainObject=null;
this.xmlDoc=null;
return null;
}
dtmlXMLLoaderObject.prototype.xmlNodeToJSON = function(node){
var t={};
for (var i=0; i<node.attributes.length; i++)
t[node.attributes[i].name]=node.attributes[i].value;
t["_tagvalue"]=node.firstChild?node.firstChild.nodeValue:"";
for (var i=0; i<node.childNodes.length; i++){
var name=node.childNodes[i].tagName;
if (name){
if (!t[name]) t[name]=[];
t[name].push(this.xmlNodeToJSON(node.childNodes[i]));
}
}
return t;
}
/**
* @desc: Call wrapper
* @type: private
* @param: funcObject - action handler
* @param: dhtmlObject - user data
* @returns: function handler
* @topic: 0
*/
function callerFunction(funcObject, dhtmlObject){
this.handler=function(e){
if (!e)
e=window.event;
funcObject(e, dhtmlObject);
return true;
};
return this.handler;
};
/**
* @desc: Calculate absolute position of html object
* @type: private
* @param: htmlObject - html object
* @topic: 0
*/
function getAbsoluteLeft(htmlObject){
return getOffset(htmlObject).left;
}
/**
* @desc: Calculate absolute position of html object
* @type: private
* @param: htmlObject - html object
* @topic: 0
*/
function getAbsoluteTop(htmlObject){
return getOffset(htmlObject).top;
}
function getOffsetSum(elem) {
var top=0, left=0;
while(elem) {
top = top + parseInt(elem.offsetTop);
left = left + parseInt(elem.offsetLeft);
elem = elem.offsetParent;
}
return {top: top, left: left};
}
function getOffsetRect(elem) {
var box = elem.getBoundingClientRect();
var body = document.body;
var docElem = document.documentElement;
var scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;
var scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;
var clientTop = docElem.clientTop || body.clientTop || 0;
var clientLeft = docElem.clientLeft || body.clientLeft || 0;
var top = box.top + scrollTop - clientTop;
var left = box.left + scrollLeft - clientLeft;
return { top: Math.round(top), left: Math.round(left) };
}
function getOffset(elem) {
if (elem.getBoundingClientRect && !_isChrome) {
return getOffsetRect(elem);
} else {
return getOffsetSum(elem);
}
}
/**
* @desc: Convert string to it boolean representation
* @type: private
* @param: inputString - string for covertion
* @topic: 0
*/
function convertStringToBoolean(inputString){
if (typeof (inputString) == "string")
inputString=inputString.toLowerCase();
switch (inputString){
case "1":
case "true":
case "yes":
case "y":
case 1:
case true:
return true;
break;
default: return false;
}
}
/**
* @desc: find out what symbol to use as url param delimiters in further params
* @type: private
* @param: str - current url string
* @topic: 0
*/
function getUrlSymbol(str){
if (str.indexOf("?") != -1)
return "&"
else
return "?"
}
function dhtmlDragAndDropObject(){
if (window.dhtmlDragAndDrop)
return window.dhtmlDragAndDrop;
this.lastLanding=0;
this.dragNode=0;
this.dragStartNode=0;
this.dragStartObject=0;
this.tempDOMU=null;
this.tempDOMM=null;
this.waitDrag=0;
window.dhtmlDragAndDrop=this;
return this;
};
dhtmlDragAndDropObject.prototype.removeDraggableItem=function(htmlNode){
htmlNode.onmousedown=null;
htmlNode.dragStarter=null;
htmlNode.dragLanding=null;
}
dhtmlDragAndDropObject.prototype.addDraggableItem=function(htmlNode, dhtmlObject){
htmlNode.onmousedown=this.preCreateDragCopy;
htmlNode.dragStarter=dhtmlObject;
this.addDragLanding(htmlNode, dhtmlObject);
}
dhtmlDragAndDropObject.prototype.addDragLanding=function(htmlNode, dhtmlObject){
htmlNode.dragLanding=dhtmlObject;
}
dhtmlDragAndDropObject.prototype.preCreateDragCopy=function(e){
if ((e||event) && (e||event).button == 2)
return;
if (window.dhtmlDragAndDrop.waitDrag){
window.dhtmlDragAndDrop.waitDrag=0;
document.body.onmouseup=window.dhtmlDragAndDrop.tempDOMU;
document.body.onmousemove=window.dhtmlDragAndDrop.tempDOMM;
return false;
}
window.dhtmlDragAndDrop.waitDrag=1;
window.dhtmlDragAndDrop.tempDOMU=document.body.onmouseup;
window.dhtmlDragAndDrop.tempDOMM=document.body.onmousemove;
window.dhtmlDragAndDrop.dragStartNode=this;
window.dhtmlDragAndDrop.dragStartObject=this.dragStarter;
document.body.onmouseup=window.dhtmlDragAndDrop.preCreateDragCopy;
document.body.onmousemove=window.dhtmlDragAndDrop.callDrag;
window.dhtmlDragAndDrop.downtime = new Date().valueOf();
if ((e)&&(e.preventDefault)){
e.preventDefault();
return false;
}
return false;
};
dhtmlDragAndDropObject.prototype.callDrag=function(e){
if (!e)
e=window.event;
dragger=window.dhtmlDragAndDrop;
if ((new Date()).valueOf()-dragger.downtime<100) return;
if ((e.button == 0)&&(_isIE))
return dragger.stopDrag();
if (!dragger.dragNode&&dragger.waitDrag){
dragger.dragNode=dragger.dragStartObject._createDragNode(dragger.dragStartNode, e);
if (!dragger.dragNode)
return dragger.stopDrag();
dragger.dragNode.onselectstart=function(){return false;}
dragger.gldragNode=dragger.dragNode;
document.body.appendChild(dragger.dragNode);
document.body.onmouseup=dragger.stopDrag;
dragger.waitDrag=0;
dragger.dragNode.pWindow=window;
dragger.initFrameRoute();
}
if (dragger.dragNode.parentNode != window.document.body){
var grd = dragger.gldragNode;
if (dragger.gldragNode.old)
grd=dragger.gldragNode.old;
//if (!document.all) dragger.calculateFramePosition();
grd.parentNode.removeChild(grd);
var oldBody = dragger.dragNode.pWindow;
// var oldp=dragger.dragNode.parentObject;
if (_isIE){
var div = document.createElement("Div");
div.innerHTML=dragger.dragNode.outerHTML;
dragger.dragNode=div.childNodes[0];
} else
dragger.dragNode=dragger.dragNode.cloneNode(true);
dragger.dragNode.pWindow=window;
// dragger.dragNode.parentObject=oldp;
dragger.gldragNode.old=dragger.dragNode;
document.body.appendChild(dragger.dragNode);
oldBody.dhtmlDragAndDrop.dragNode=dragger.dragNode;
}
dragger.dragNode.style.left=e.clientX+15+(dragger.fx
? dragger.fx*(-1)
: 0)
+(document.body.scrollLeft||document.documentElement.scrollLeft)+"px";
dragger.dragNode.style.top=e.clientY+3+(dragger.fy
? dragger.fy*(-1)
: 0)
+(document.body.scrollTop||document.documentElement.scrollTop)+"px";
if (!e.srcElement)
var z = e.target;
else
z=e.srcElement;
dragger.checkLanding(z, e);
}
dhtmlDragAndDropObject.prototype.calculateFramePosition=function(n){
//this.fx = 0, this.fy = 0;
if (window.name){
var el = parent.frames[window.name].frameElement.offsetParent;
var fx = 0;
var fy = 0;
while (el){
fx+=el.offsetLeft;
fy+=el.offsetTop;
el=el.offsetParent;
}
if ((parent.dhtmlDragAndDrop)){
var ls = parent.dhtmlDragAndDrop.calculateFramePosition(1);
fx+=ls.split('_')[0]*1;
fy+=ls.split('_')[1]*1;
}
if (n)
return fx+"_"+fy;
else
this.fx=fx;
this.fy=fy;
}
return "0_0";
}
dhtmlDragAndDropObject.prototype.checkLanding=function(htmlObject, e){
if ((htmlObject)&&(htmlObject.dragLanding)){
if (this.lastLanding)
this.lastLanding.dragLanding._dragOut(this.lastLanding);
this.lastLanding=htmlObject;
this.lastLanding=this.lastLanding.dragLanding._dragIn(this.lastLanding, this.dragStartNode, e.clientX,
e.clientY, e);
this.lastLanding_scr=(_isIE ? e.srcElement : e.target);
} else {
if ((htmlObject)&&(htmlObject.tagName != "BODY"))
this.checkLanding(htmlObject.parentNode, e);
else {
if (this.lastLanding)
this.lastLanding.dragLanding._dragOut(this.lastLanding, e.clientX, e.clientY, e);
this.lastLanding=0;
if (this._onNotFound)
this._onNotFound();
}
}
}
dhtmlDragAndDropObject.prototype.stopDrag=function(e, mode){
dragger=window.dhtmlDragAndDrop;
if (!mode){
dragger.stopFrameRoute();
var temp = dragger.lastLanding;
dragger.lastLanding=null;
if (temp)
temp.dragLanding._drag(dragger.dragStartNode, dragger.dragStartObject, temp, (_isIE
? event.srcElement
: e.target));
}
dragger.lastLanding=null;
if ((dragger.dragNode)&&(dragger.dragNode.parentNode == document.body))
dragger.dragNode.parentNode.removeChild(dragger.dragNode);
dragger.dragNode=0;
dragger.gldragNode=0;
dragger.fx=0;
dragger.fy=0;
dragger.dragStartNode=0;
dragger.dragStartObject=0;
document.body.onmouseup=dragger.tempDOMU;
document.body.onmousemove=dragger.tempDOMM;
dragger.tempDOMU=null;
dragger.tempDOMM=null;
dragger.waitDrag=0;
}
dhtmlDragAndDropObject.prototype.stopFrameRoute=function(win){
if (win)
window.dhtmlDragAndDrop.stopDrag(1, 1);
for (var i = 0; i < window.frames.length; i++){
try{
if ((window.frames[i] != win)&&(window.frames[i].dhtmlDragAndDrop))
window.frames[i].dhtmlDragAndDrop.stopFrameRoute(window);
} catch(e){}
}
try{
if ((parent.dhtmlDragAndDrop)&&(parent != window)&&(parent != win))
parent.dhtmlDragAndDrop.stopFrameRoute(window);
} catch(e){}
}
dhtmlDragAndDropObject.prototype.initFrameRoute=function(win, mode){
if (win){
window.dhtmlDragAndDrop.preCreateDragCopy({});
window.dhtmlDragAndDrop.dragStartNode=win.dhtmlDragAndDrop.dragStartNode;
window.dhtmlDragAndDrop.dragStartObject=win.dhtmlDragAndDrop.dragStartObject;
window.dhtmlDragAndDrop.dragNode=win.dhtmlDragAndDrop.dragNode;
window.dhtmlDragAndDrop.gldragNode=win.dhtmlDragAndDrop.dragNode;
window.document.body.onmouseup=window.dhtmlDragAndDrop.stopDrag;
window.waitDrag=0;
if (((!_isIE)&&(mode))&&((!_isFF)||(_FFrv < 1.8)))
window.dhtmlDragAndDrop.calculateFramePosition();
}
try{
if ((parent.dhtmlDragAndDrop)&&(parent != window)&&(parent != win))
parent.dhtmlDragAndDrop.initFrameRoute(window);
}catch(e){}
for (var i = 0; i < window.frames.length; i++){
try{
if ((window.frames[i] != win)&&(window.frames[i].dhtmlDragAndDrop))
window.frames[i].dhtmlDragAndDrop.initFrameRoute(window, ((!win||mode) ? 1 : 0));
} catch(e){}
}
}
_isFF = false;
_isIE = false;
_isOpera = false;
_isKHTML = false;
_isMacOS = false;
_isChrome = false;
_KHTMLrv = false;
_OperaRv = false;
_FFrv = false;
if (navigator.userAgent.indexOf('Macintosh') != -1)
_isMacOS=true;
if (navigator.userAgent.toLowerCase().indexOf('chrome')>-1)
_isChrome=true;
if ((navigator.userAgent.indexOf('Safari') != -1)||(navigator.userAgent.indexOf('Konqueror') != -1)){
var _KHTMLrv = parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf('Safari')+7, 5));
if (_KHTMLrv > 525){ //mimic FF behavior for Safari 3.1+
_isFF=true;
var _FFrv = 1.9;
} else
_isKHTML=true;
} else if (navigator.userAgent.indexOf('Opera') != -1){
_isOpera=true;
_OperaRv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf('Opera')+6, 3));
}
else if (navigator.appName.indexOf("Microsoft") != -1){
_isIE=true;
if (navigator.appVersion.indexOf("MSIE 8.0")!= -1 && document.compatMode != "BackCompat") _isIE=8;
} else {
_isFF=true;
var _FFrv = parseFloat(navigator.userAgent.split("rv:")[1])
}
//multibrowser Xpath processor
dtmlXMLLoaderObject.prototype.doXPath=function(xpathExp, docObj, namespace, result_type){
if (_isKHTML || (!_isIE && !window.XPathResult))
return this.doXPathOpera(xpathExp, docObj);
if (_isIE){ //IE
if (!docObj)
if (!this.xmlDoc.nodeName)
docObj=this.xmlDoc.responseXML
else
docObj=this.xmlDoc;
if (!docObj)
dhtmlxError.throwError("LoadXML", "Incorrect XML", [
(docObj||this.xmlDoc),
this.mainObject
]);
if (namespace != null)
docObj.setProperty("SelectionNamespaces", "xmlns:xsl='"+namespace+"'"); //
if (result_type == 'single'){
return docObj.selectSingleNode(xpathExp);
}
else {
return docObj.selectNodes(xpathExp)||new Array(0);
}
} else { //Mozilla
var nodeObj = docObj;
if (!docObj){
if (!this.xmlDoc.nodeName){
docObj=this.xmlDoc.responseXML
}
else {
docObj=this.xmlDoc;
}
}
if (!docObj)
dhtmlxError.throwError("LoadXML", "Incorrect XML", [
(docObj||this.xmlDoc),
this.mainObject
]);
if (docObj.nodeName.indexOf("document") != -1){
nodeObj=docObj;
}
else {
nodeObj=docObj;
docObj=docObj.ownerDocument;
}
var retType = XPathResult.ANY_TYPE;
if (result_type == 'single')
retType=XPathResult.FIRST_ORDERED_NODE_TYPE
var rowsCol = new Array();
var col = docObj.evaluate(xpathExp, nodeObj, function(pref){
return namespace
}, retType, null);
if (retType == XPathResult.FIRST_ORDERED_NODE_TYPE){
return col.singleNodeValue;
}
var thisColMemb = col.iterateNext();
while (thisColMemb){
rowsCol[rowsCol.length]=thisColMemb;
thisColMemb=col.iterateNext();
}
return rowsCol;
}
}
function _dhtmlxError(type, name, params){
if (!this.catches)
this.catches=new Array();
return this;
}
_dhtmlxError.prototype.catchError=function(type, func_name){
this.catches[type]=func_name;
}
_dhtmlxError.prototype.throwError=function(type, name, params){
if (this.catches[type])
return this.catches[type](type, name, params);
if (this.catches["ALL"])
return this.catches["ALL"](type, name, params);
alert("Error type: "+arguments[0]+"\nDescription: "+arguments[1]);
return null;
}
window.dhtmlxError=new _dhtmlxError();
//opera fake, while 9.0 not released
//multibrowser Xpath processor
dtmlXMLLoaderObject.prototype.doXPathOpera=function(xpathExp, docObj){
//this is fake for Opera
var z = xpathExp.replace(/[\/]+/gi, "/").split('/');
var obj = null;
var i = 1;
if (!z.length)
return [];
if (z[0] == ".")
obj=[docObj]; else if (z[0] == ""){
obj=(this.xmlDoc.responseXML||this.xmlDoc).getElementsByTagName(z[i].replace(/\[[^\]]*\]/g, ""));
i++;
} else
return [];
for (i; i < z.length; i++)obj=this._getAllNamedChilds(obj, z[i]);
if (z[i-1].indexOf("[") != -1)
obj=this._filterXPath(obj, z[i-1]);
return obj;
}
dtmlXMLLoaderObject.prototype._filterXPath=function(a, b){
var c = new Array();
var b = b.replace(/[^\[]*\[\@/g, "").replace(/[\[\]\@]*/g, "");
for (var i = 0; i < a.length; i++)
if (a[i].getAttribute(b))
c[c.length]=a[i];
return c;
}
dtmlXMLLoaderObject.prototype._getAllNamedChilds=function(a, b){
var c = new Array();
if (_isKHTML)
b=b.toUpperCase();
for (var i = 0; i < a.length; i++)for (var j = 0; j < a[i].childNodes.length; j++){
if (_isKHTML){
if (a[i].childNodes[j].tagName&&a[i].childNodes[j].tagName.toUpperCase() == b)
c[c.length]=a[i].childNodes[j];
}
else if (a[i].childNodes[j].tagName == b)
c[c.length]=a[i].childNodes[j];
}
return c;
}
function dhtmlXHeir(a, b){
for (var c in b)
if (typeof (b[c]) == "function")
a[c]=b[c];
return a;
}
function dhtmlxEvent(el, event, handler){
if (el.addEventListener)
el.addEventListener(event, handler, false);
else if (el.attachEvent)
el.attachEvent("on"+event, handler);
}
//============= XSL Extension ===================================
dtmlXMLLoaderObject.prototype.xslDoc=null;
dtmlXMLLoaderObject.prototype.setXSLParamValue=function(paramName, paramValue, xslDoc){
if (!xslDoc)
xslDoc=this.xslDoc
if (xslDoc.responseXML)
xslDoc=xslDoc.responseXML;
var item =
this.doXPath("/xsl:stylesheet/xsl:variable[@name='"+paramName+"']", xslDoc,
"http:/\/www.w3.org/1999/XSL/Transform", "single");
if (item != null)
item.firstChild.nodeValue=paramValue
}
dtmlXMLLoaderObject.prototype.doXSLTransToObject=function(xslDoc, xmlDoc){
if (!xslDoc)
xslDoc=this.xslDoc;
if (xslDoc.responseXML)
xslDoc=xslDoc.responseXML
if (!xmlDoc)
xmlDoc=this.xmlDoc;
if (xmlDoc.responseXML)
xmlDoc=xmlDoc.responseXML
//MOzilla
if (!_isIE){
if (!this.XSLProcessor){
this.XSLProcessor=new XSLTProcessor();
this.XSLProcessor.importStylesheet(xslDoc);
}
var result = this.XSLProcessor.transformToDocument(xmlDoc);
} else {
var result = new ActiveXObject("Msxml2.DOMDocument.3.0");
try{
xmlDoc.transformNodeToObject(xslDoc, result);
}catch(e){
result = xmlDoc.transformNode(xslDoc);
}
}
return result;
}
dtmlXMLLoaderObject.prototype.doXSLTransToString=function(xslDoc, xmlDoc){
var res = this.doXSLTransToObject(xslDoc, xmlDoc);
if(typeof(res)=="string")
return res;
return this.doSerialization(res);
}
dtmlXMLLoaderObject.prototype.doSerialization=function(xmlDoc){
if (!xmlDoc)
xmlDoc=this.xmlDoc;
if (xmlDoc.responseXML)
xmlDoc=xmlDoc.responseXML
if (!_isIE){
var xmlSerializer = new XMLSerializer();
return xmlSerializer.serializeToString(xmlDoc);
} else
return xmlDoc.xml;
}
/**
* @desc:
* @type: private
*/
dhtmlxEventable=function(obj){
obj.dhx_SeverCatcherPath="";
obj.attachEvent=function(name, catcher, callObj){
name='ev_'+name.toLowerCase();
if (!this[name])
this[name]=new this.eventCatcher(callObj||this);
return(name+':'+this[name].addEvent(catcher)); //return ID (event name & event ID)
}
obj.callEvent=function(name, arg0){
name='ev_'+name.toLowerCase();
if (this[name])
return this[name].apply(this, arg0);
return true;
}
obj.checkEvent=function(name){
return (!!this['ev_'+name.toLowerCase()])
}
obj.eventCatcher=function(obj){
var dhx_catch = [];
var z = function(){
var res = true;
for (var i = 0; i < dhx_catch.length; i++){
if (dhx_catch[i] != null){
var zr = dhx_catch[i].apply(obj, arguments);
res=res&&zr;
}
}
return res;
}
z.addEvent=function(ev){
if (typeof (ev) != "function")
ev=eval(ev);
if (ev)
return dhx_catch.push(ev)-1;
return false;
}
z.removeEvent=function(id){
dhx_catch[id]=null;
}
return z;
}
obj.detachEvent=function(id){
if (id != false){
var list = id.split(':'); //get EventName and ID
this[list[0]].removeEvent(list[1]); //remove event
}
}
obj.detachAllEvents = function(){
for (var name in this){
if (name.indexOf("ev_")==0)
delete this[name];
}
}
}

View File

@ -1,587 +0,0 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
*/
/**
* @desc: constructor, data processor object
* @param: serverProcessorURL - url used for update
* @type: public
*/
function dataProcessor(serverProcessorURL){
this.serverProcessor = serverProcessorURL;
this.action_param="!nativeeditor_status";
this.object = null;
this.updatedRows = []; //ids of updated rows
this.autoUpdate = true;
this.updateMode = "cell";
this._tMode="GET";
this.post_delim = "_";
this._waitMode=0;
this._in_progress={};//?
this._invalid={};
this.mandatoryFields=[];
this.messages=[];
this.styles={
updated:"font-weight:bold;",
inserted:"font-weight:bold;",
deleted:"text-decoration : line-through;",
invalid:"background-color:FFE0E0;",
invalid_cell:"border-bottom:2px solid red;",
error:"color:red;",
clear:"font-weight:normal;text-decoration:none;"
};
this.enableUTFencoding(true);
dhtmlxEventable(this);
return this;
}
dataProcessor.prototype={
/**
* @desc: select GET or POST transaction model
* @param: mode - GET/POST
* @param: total - true/false - send records row by row or all at once (for grid only)
* @type: public
*/
setTransactionMode:function(mode,total){
this._tMode=mode;
this._tSend=total;
},
escape:function(data){
if (this._utf)
return encodeURIComponent(data);
else
return escape(data);
},
/**
* @desc: allows to set escaping mode
* @param: true - utf based escaping, simple - use current page encoding
* @type: public
*/
enableUTFencoding:function(mode){
this._utf=convertStringToBoolean(mode);
},
/**
* @desc: allows to define, which column may trigger update
* @param: val - array or list of true/false values
* @type: public
*/
setDataColumns:function(val){
this._columns=(typeof val == "string")?val.split(","):val;
},
/**
* @desc: get state of updating
* @returns: true - all in sync with server, false - some items not updated yet.
* @type: public
*/
getSyncState:function(){
return !this.updatedRows.length;
},
/**
* @desc: enable/disable named field for data syncing, will use column ids for grid
* @param: mode - true/false
* @type: public
*/
enableDataNames:function(mode){
this._endnm=convertStringToBoolean(mode);
},
/**
* @desc: enable/disable mode , when only changed fields and row id send to the server side, instead of all fields in default mode
* @param: mode - true/false
* @type: public
*/
enablePartialDataSend:function(mode){
this._changed=convertStringToBoolean(mode);
},
/**
* @desc: set if rows should be send to server automaticaly
* @param: mode - "row" - based on row selection changed, "cell" - based on cell editing finished, "off" - manual data sending
* @type: public
*/
setUpdateMode:function(mode,dnd){
this.autoUpdate = (mode=="cell");
this.updateMode = mode;
this.dnd=dnd;
},
ignore:function(code,master){
this._silent_mode=true;
code.call(master||window);
this._silent_mode=false;
},
/**
* @desc: mark row as updated/normal. check mandatory fields,initiate autoupdate (if turned on)
* @param: rowId - id of row to set update-status for
* @param: state - true for "updated", false for "not updated"
* @param: mode - update mode name
* @type: public
*/
setUpdated:function(rowId,state,mode){
if (this._silent_mode) return;
var ind=this.findRow(rowId);
mode=mode||"updated";
var existing = this.obj.getUserData(rowId,this.action_param);
if (existing && mode == "updated") mode=existing;
if (state){
this.set_invalid(rowId,false); //clear previous error flag
this.updatedRows[ind]=rowId;
this.obj.setUserData(rowId,this.action_param,mode);
if (this._in_progress[rowId])
this._in_progress[rowId]="wait";
} else{
if (!this.is_invalid(rowId)){
this.updatedRows.splice(ind,1);
this.obj.setUserData(rowId,this.action_param,"");
}
}
//clear changed flag
if (!state)
this._clearUpdateFlag(rowId);
this.markRow(rowId,state,mode);
if (state && this.autoUpdate) this.sendData(rowId);
},
_clearUpdateFlag:function(id){},
markRow:function(id,state,mode){
var str="";
var invalid=this.is_invalid(id);
if (invalid){
str=this.styles[invalid];
state=true;
}
if (this.callEvent("onRowMark",[id,state,mode,invalid])){
//default logic
str=this.styles[state?mode:"clear"]+str;
this.obj[this._methods[0]](id,str);
if (invalid && invalid.details){
str+=this.styles[invalid+"_cell"];
for (var i=0; i < invalid.details.length; i++)
if (invalid.details[i])
this.obj[this._methods[1]](id,i,str);
}
}
},
getState:function(id){
return this.obj.getUserData(id,this.action_param);
},
is_invalid:function(id){
return this._invalid[id];
},
set_invalid:function(id,mode,details){
if (details) mode={value:mode, details:details, toString:function(){ return this.value.toString(); }};
this._invalid[id]=mode;
},
/**
* @desc: check mandatory fields and varify values of cells, initiate update (if specified)
* @param: rowId - id of row to set update-status for
* @type: public
*/
checkBeforeUpdate:function(rowId){
return true;
},
/**
* @desc: send row(s) values to server
* @param: rowId - id of row which data to send. If not specified, then all "updated" rows will be send
* @type: public
*/
sendData:function(rowId){
if (this._waitMode && (this.obj.mytype=="tree" || this.obj._h2)) return;
if (this.obj.editStop) this.obj.editStop();
if(typeof rowId == "undefined" || this._tSend) return this.sendAllData();
if (this._in_progress[rowId]) return false;
this.messages=[];
if (!this.checkBeforeUpdate(rowId) && this.callEvent("onValidatationError",[rowId,this.messages])) return false;
this._beforeSendData(this._getRowData(rowId),rowId);
},
_beforeSendData:function(data,rowId){
if (!this.callEvent("onBeforeUpdate",[rowId,this.getState(rowId),data])) return false;
this._sendData(data,rowId);
},
serialize:function(data, id){
if (typeof data == "string")
return data;
if (typeof id != "undefined")
return this.serialize_one(data,"");
else{
var stack = [];
var keys = [];
for (var key in data)
if (data.hasOwnProperty(key)){
stack.push(this.serialize_one(data[key],key+this.post_delim));
keys.push(key);
}
stack.push("ids="+this.escape(keys.join(",")));
return stack.join("&");
}
},
serialize_one:function(data, pref){
if (typeof data == "string")
return data;
var stack = [];
for (var key in data)
if (data.hasOwnProperty(key))
stack.push(this.escape((pref||"")+key)+"="+this.escape(data[key]));
return stack.join("&");
},
_sendData:function(a1,rowId){
if (!a1) return; //nothing to send
if (!this.callEvent("onBeforeDataSending",rowId?[rowId,this.getState(rowId),a1]:[null, null, a1])) return false;
if (rowId)
this._in_progress[rowId]=(new Date()).valueOf();
var a2=new dtmlXMLLoaderObject(this.afterUpdate,this,true);
var a3 = this.serverProcessor+(this._user?(getUrlSymbol(this.serverProcessor)+["dhx_user="+this._user,"dhx_version="+this.obj.getUserData(0,"version")].join("&")):"");
if (this._tMode!="POST")
a2.loadXML(a3+((a3.indexOf("?")!=-1)?"&":"?")+this.serialize(a1,rowId));
else
a2.loadXML(a3,true,this.serialize(a1,rowId));
this._waitMode++;
},
sendAllData:function(){
if (!this.updatedRows.length) return;
this.messages=[]; var valid=true;
for (var i=0; i<this.updatedRows.length; i++)
valid&=this.checkBeforeUpdate(this.updatedRows[i]);
if (!valid && !this.callEvent("onValidatationError",["",this.messages])) return false;
if (this._tSend)
this._sendData(this._getAllData());
else
for (var i=0; i<this.updatedRows.length; i++)
if (!this._in_progress[this.updatedRows[i]]){
if (this.is_invalid(this.updatedRows[i])) continue;
this._beforeSendData(this._getRowData(this.updatedRows[i]),this.updatedRows[i]);
if (this._waitMode && (this.obj.mytype=="tree" || this.obj._h2)) return; //block send all for tree
}
},
_getAllData:function(rowId){
var out={};
var has_one = false;
for(var i=0;i<this.updatedRows.length;i++){
var id=this.updatedRows[i];
if (this._in_progress[id] || this.is_invalid(id)) continue;
if (!this.callEvent("onBeforeUpdate",[id,this.getState(id)])) continue;
out[id]=this._getRowData(id,id+this.post_delim);
has_one = true;
this._in_progress[id]=(new Date()).valueOf();
}
return has_one?out:null;
},
/**
* @desc: specify column which value should be varified before sending to server
* @param: ind - column index (0 based)
* @param: verifFunction - function (object) which should verify cell value (if not specified, then value will be compared to empty string). Two arguments will be passed into it: value and column name
* @type: public
*/
setVerificator:function(ind,verifFunction){
this.mandatoryFields[ind] = verifFunction||(function(value){return (value!="");});
},
/**
* @desc: remove column from list of those which should be verified
* @param: ind - column Index (0 based)
* @type: public
*/
clearVerificator:function(ind){
this.mandatoryFields[ind] = false;
},
findRow:function(pattern){
var i=0;
for(i=0;i<this.updatedRows.length;i++)
if(pattern==this.updatedRows[i]) break;
return i;
},
/**
* @desc: define custom actions
* @param: name - name of action, same as value of action attribute
* @param: handler - custom function, which receives a XMl response content for action
* @type: private
*/
defineAction:function(name,handler){
if (!this._uActions) this._uActions=[];
this._uActions[name]=handler;
},
/**
* @desc: used in combination with setOnBeforeUpdateHandler to create custom client-server transport system
* @param: sid - id of item before update
* @param: tid - id of item after up0ate
* @param: action - action name
* @type: public
* @topic: 0
*/
afterUpdateCallback:function(sid, tid, action, btag) {
var marker = sid;
var correct=(action!="error" && action!="invalid");
if (!correct) this.set_invalid(sid,action);
if ((this._uActions)&&(this._uActions[action])&&(!this._uActions[action](btag)))
return (delete this._in_progress[marker]);
if (this._in_progress[marker]!="wait")
this.setUpdated(sid, false);
var soid = sid;
switch (action) {
case "update":
case "updated":
case "inserted":
case "insert":
if (tid != sid) {
this.obj[this._methods[2]](sid, tid);
sid = tid;
}
break;
case "delete":
case "deleted":
this.obj.setUserData(sid, this.action_param, "true_deleted");
this.obj[this._methods[3]](sid);
delete this._in_progress[marker];
return this.callEvent("onAfterUpdate", [sid, action, tid, btag]);
break;
}
if (this._in_progress[marker]!="wait"){
if (correct) this.obj.setUserData(sid, this.action_param,'');
delete this._in_progress[marker];
} else {
delete this._in_progress[marker];
this.setUpdated(tid,true,this.obj.getUserData(sid,this.action_param));
}
this.callEvent("onAfterUpdate", [sid, action, tid, btag]);
},
/**
* @desc: response from server
* @param: xml - XMLLoader object with response XML
* @type: private
*/
afterUpdate:function(that,b,c,d,xml){
xml.getXMLTopNode("data"); //fix incorrect content type in IE
if (!xml.xmlDoc.responseXML) return;
var atag=xml.doXPath("//data/action");
for (var i=0; i<atag.length; i++){
var btag=atag[i];
var action = btag.getAttribute("type");
var sid = btag.getAttribute("sid");
var tid = btag.getAttribute("tid");
that.afterUpdateCallback(sid,tid,action,btag);
}
that.finalizeUpdate();
},
finalizeUpdate:function(){
if (this._waitMode) this._waitMode--;
if ((this.obj.mytype=="tree" || this.obj._h2) && this.updatedRows.length)
this.sendData();
this.callEvent("onAfterUpdateFinish",[]);
if (!this.updatedRows.length)
this.callEvent("onFullSync",[]);
},
/**
* @desc: initializes data-processor
* @param: anObj - dhtmlxGrid object to attach this data-processor to
* @type: public
*/
init:function(anObj){
this.obj = anObj;
if (this.obj._dp_init)
this.obj._dp_init(this);
},
setOnAfterUpdate:function(ev){
this.attachEvent("onAfterUpdate",ev);
},
enableDebug:function(mode){
},
setOnBeforeUpdateHandler:function(func){
this.attachEvent("onBeforeDataSending",func);
},
/*! starts autoupdate mode
@param interval
time interval for sending update requests
*/
setAutoUpdate: function(interval, user) {
interval = interval || 2000;
this._user = user || (new Date()).valueOf();
this._need_update = false;
this._loader = null;
this._update_busy = false;
this.attachEvent("onAfterUpdate",function(sid,action,tid,xml_node){
this.afterAutoUpdate(sid, action, tid, xml_node);
});
this.attachEvent("onFullSync",function(){
this.fullSync();
});
var self = this;
window.setInterval(function(){
self.loadUpdate();
}, interval);
},
/*! process updating request answer
if status == collision version is depricated
set flag for autoupdating immidiatly
*/
afterAutoUpdate: function(sid, action, tid, xml_node) {
if (action == 'collision') {
this._need_update = true;
return false;
} else {
return true;
}
},
/*! callback function for onFillSync event
call update function if it's need
*/
fullSync: function() {
if (this._need_update == true) {
this._need_update = false;
this.loadUpdate();
}
return true;
},
/*! sends query to the server and call callback function
*/
getUpdates: function(url,callback){
if (this._update_busy)
return false;
else
this._update_busy = true;
this._loader = this._loader || new dtmlXMLLoaderObject(true);
this._loader.async=true;
this._loader.waitCall=callback;
this._loader.loadXML(url);
},
/*! returns xml node value
@param node
xml node
*/
_v: function(node) {
if (node.firstChild) return node.firstChild.nodeValue;
return "";
},
/*! returns values array of xml nodes array
@param arr
array of xml nodes
*/
_a: function(arr) {
var res = [];
for (var i=0; i < arr.length; i++) {
res[i]=this._v(arr[i]);
};
return res;
},
/*! loads updates and processes them
*/
loadUpdate: function(){
var self = this;
var version = this.obj.getUserData(0,"version");
var url = this.serverProcessor+getUrlSymbol(this.serverProcessor)+["dhx_user="+this._user,"dhx_version="+version].join("&");
url = url.replace("editing=true&","");
this.getUpdates(url, function(){
var vers = self._loader.doXPath("//userdata");
self.obj.setUserData(0,"version",self._v(vers[0]));
var upds = self._loader.doXPath("//update");
if (upds.length){
self._silent_mode = true;
for (var i=0; i<upds.length; i++) {
var status = upds[i].getAttribute('status');
var id = upds[i].getAttribute('id');
var parent = upds[i].getAttribute('parent');
switch (status) {
case 'inserted':
self.callEvent("insertCallback",[upds[i], id, parent]);
break;
case 'updated':
self.callEvent("updateCallback",[upds[i], id, parent]);
break;
case 'deleted':
self.callEvent("deleteCallback",[upds[i], id, parent]);
break;
}
}
self._silent_mode = false;
}
self._update_busy = false;
self = null;
});
}
};
//(c)dhtmlx ltd. www.dhtmlx.com

View File

@ -1,168 +0,0 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
*/
dataProcessor.prototype._o_init = dataProcessor.prototype.init;
dataProcessor.prototype.init=function(obj){
this._console=this._console||this._createConsole();
this.attachEvent("onValidatationError",function(rowId){
this._log("Validation error for ID="+(rowId||"[multiple]"));
return true;
});
return this._o_init(obj);
}
dataProcessor.prototype._createConsole=function(){
var c=document.createElement("DIV");
c.style.cssText='width:450px; height:420px; overflow:auto; position:absolute; z-index:99999; background-color:white; top:0px; right:0px; border:1px dashed black; font-family:Tahoma; Font-size:10pt;';
c.innerHTML="<div style='width:100%; background-color:gray; font-weight:bold; color:white;'><span style='cursor:pointer;float:right;' onclick='this.parentNode.parentNode.style.display=\"none\"'><sup>[close]&nbsp;</sup></span><span style='cursor:pointer;float:right;' onclick='this.parentNode.parentNode.childNodes[2].innerHTML=\"\"'><sup>[clear]&nbsp;</sup></span>&nbsp;DataProcessor</div><div style='width:100%; height:200px; overflow-Y:scroll;'>&nbsp;Current state</div><div style='width:100%; height:200px; overflow-Y:scroll;'>&nbsp;Log:</div>";
if (document.body) document.body.insertBefore(c,document.body.firstChild);
else dhtmlxEvent(window,"load",function(){
document.body.insertBefore(c,document.body.firstChild);
})
dhtmlxEvent(window,"dblclick",function(){
c.style.display='';
})
return c;
}
dataProcessor.prototype._error=function(data){
this._log("<span style='color:red'>"+data+"</span>");
}
dataProcessor.prototype._log=function(data){
var div=document.createElement("DIV");
div.innerHTML = data;
var parent=this._console.childNodes[2];
parent.appendChild(div);
parent.scrollTop=parent.scrollHeight;
if (window.console && window.console.log)
window.console.log("DataProcessor :: "+data.replace("&nbsp;"," ").replace("<b>","").replace("</b>",""));
}
dataProcessor.prototype._updateStat=function(data){
var data=["&nbsp;Current state"];
for(var i=0;i<this.updatedRows.length;i++)
data.push("&nbsp;ID:"+this.updatedRows[i]+" Status: "+(this.obj.getUserData(this.updatedRows[i],"!nativeeditor_status")||"updated")+", "+(this.is_invalid(this.updatedRows[i])||"valid"))
this._console.childNodes[1].innerHTML=data.join("<br/>")+"<hr/>Current mode: "+this.updateMode;
}
dataProcessor.prototype.xml_analize=function(xml){
if (_isFF){
if (!xml.xmlDoc.responseXML)
this._error("Not an XML, probably incorrect content type specified ( must be text/xml ), or some text output was started before XML data");
else if (xml.xmlDoc.responseXML.firstChild.tagName=="parsererror")
this._error(xml.xmlDoc.responseXML.firstChild.textContent);
else return true;
} else if (_isIE){
if (xml.xmlDoc.responseXML.parseError.errorCode)
this._error("XML error : "+xml.xmlDoc.responseXML.parseError.reason);
else if (!xml.xmlDoc.responseXML.documentElement)
this._error("Not an XML, probably incorrect content type specified ( must be text/xml ), or some text output was started before XML data");
else return true;
}
return false;
}
dataProcessor.wrap=function(name,before,after){
var d=dataProcessor.prototype;
if (!d._wrap) d._wrap={};
d._wrap[name]=d[name];
d[name]=function(){
if (before) before.apply(this,arguments);
var res=d._wrap[name].apply(this,arguments);
if (after) after.apply(this,[arguments,res]);
return res;
}
};
dataProcessor.wrap("setUpdated",function(rowId,state,mode){
this._log("&nbsp;row <b>"+rowId+"</b> "+(state?"marked":"unmarked")+" ["+(mode||"updated")+","+(this.is_invalid(rowId)||"valid")+"]");
},function(){
this._updateStat();
});
dataProcessor.wrap("sendData",function(rowId){
if (rowId){
this._log("&nbsp;Initiating data sending for <b>"+rowId+"</b>");
if (this.obj.mytype=="tree"){
if (!this.obj._idpull[rowId])
this._log("&nbsp;Error! item with such ID not exists <b>"+rowId+"</b>");
} else {
if (this.rowsAr && !this.obj.rowsAr[rowId])
this._log("&nbsp;Error! row with such ID not exists <b>"+rowId+"</b>");
}
}
},function(){
});
dataProcessor.wrap("sendAllData",function(){
this._log("&nbsp;Initiating data sending for <b>all</b> rows ");
},function(){
});
dataProcessor.logSingle=function(data,id){
var tdata = {};
if (id)
tdata[id] = data;
else
tdata = data;
var url = [];
for (var key in tdata) {
url.push("<fieldset><legend>"+key+"</legend>");
var suburl = [];
for (var ikey in tdata[key])
suburl.push(ikey+" = "+tdata[key][ikey]);
url.push(suburl.join("<br>"));
url.push("</fieldset>");
}
return url.join("");
}
dataProcessor.wrap("_sendData",function(data,rowId){
if (rowId)
this._log("&nbsp;Sending in one-by-one mode, current ID = "+rowId);
else
this._log("&nbsp;Sending all data at once");
this._log("&nbsp;Server url: "+this.serverProcessor+" <a onclick='this.parentNode.nextSibling.firstChild.style.display=\"block\"' href='#'>parameters</a>");
var url = [];
this._log("<blockquote style='display:none;'>"+dataProcessor.logSingle(data,rowId)+"<blockquote>");
},function(){
});
dataProcessor.wrap("afterUpdate",function(that,b,c,d,xml){
that._log("&nbsp;Server response received <a onclick='this.nextSibling.style.display=\"block\"' href='#'>details</a><blockquote style='display:none'><code>"+(xml.xmlDoc.responseText||"").replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")+"</code></blockquote>");
if (!that.xml_analize(xml)) return;
var atag=xml.doXPath("//data/action");
if (!atag){
that._log("&nbsp;No actions found");
var atag=xml.getXMLTopNode("data");
if (!atag) that._log("&nbsp;XML not valid");
else that._log("&nbsp;Incorrect content type - need to be text/xml");
}
},function(){
});
dataProcessor.wrap("afterUpdateCallback",function(sid,tid,action){
if (this.obj.mytype=="tree"){
if (!this.obj._idpull[sid]) this._log("Incorrect SID, item with such ID not exists in grid");
} else {
if (this.obj.rowsAr && !this.obj.rowsAr[sid]) this._log("Incorrect SID, row with such ID not exists in grid");
}
this._log("&nbsp;Action: "+action+" SID:"+sid+" TID:"+tid);
},function(){
});

View File

@ -1,57 +0,0 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
*/
if(dataProcessor) {
dataProcessor.prototype.enableJSONP = function(mode) {
if(mode) {
this._jsonp_attach_id = this.attachEvent("onBeforeDataSending", function(rowId,rowIdState,a1){
if (rowId)
this._in_progress[rowId]=(new Date()).valueOf();
var url = this.serverProcessor+(this._user?(getUrlSymbol(this.serverProcessor)+["dhx_user="+this._user,"dhx_version="+this.obj.getUserData(0,"version")].join("&")):"");
url += ((url.indexOf("?")!=-1)?"&":"?")+this.serialize(a1,rowId);
this._jsonp(url, [], function(data){
var xml = new dtmlXMLLoaderObject(this.afterUpdate,this,true);
xml.loadXMLString(data);
this.afterUpdate(this, null, null, null, xml);
}, this);
this._waitMode++;
return false;
});
}
else {
if(this._jsonp_attach_id)
this.detachEvent(this._jsonp_attach_id);
}
};
dataProcessor.prototype._jsonp = function(url, params, callback, master){
var global_obj = "dataProcessor";
var id = "dp_jsonp_"+new Date().valueOf();
var script = document.createElement('script');
script.id = id;
script.type = 'text/javascript';
var head = document.getElementsByTagName("head")[0];
if (!params)
params = {};
params.jsonp = global_obj+"."+id; // would be called as dataProcessor.dp_jsonp_1938948394
dataProcessor[id]=function(){
callback.apply(master||window, arguments);
script.parentNode.removeChild(script);
callback = head = master = script = null;
delete dataProcessor[id];
};
var vals = [];
for (var key in params) vals.push(key+"="+encodeURIComponent(params[key]));
url += (url.indexOf("?") == -1 ? "?" : "&")+vals.join("&");
script.src = url ;
head.appendChild(script);
};
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,647 +0,0 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
*/
scheduler.uid=function(){
if (!this._seed) this._seed=(new Date).valueOf();
return this._seed++;
};
scheduler._events={};
scheduler.clearAll=function(){
this._events={};
this._loaded={};
this.clear_view();
};
scheduler.addEvent=function(start_date,end_date,text,id,extra_data){
if(!arguments.length)
return this.addEventNow();
var ev=start_date;
if (arguments.length!=1){
ev=extra_data||{};
ev.start_date=start_date;
ev.end_date=end_date;
ev.text=text;
ev.id=id;
}
ev.id = ev.id||scheduler.uid();
ev.text = ev.text||"";
if (typeof ev.start_date == "string") ev.start_date=this.templates.api_date(ev.start_date);
if (typeof ev.end_date == "string") ev.end_date=this.templates.api_date(ev.end_date);
var d = (this.config.event_duration||this.config.time_step)*60000;
if(ev.start_date.valueOf() == ev.end_date.valueOf())
ev.end_date.setTime(ev.end_date.valueOf()+d);
ev._timed=this.is_one_day_event(ev);
var is_new=!this._events[ev.id];
this._events[ev.id]=ev;
this.event_updated(ev);
if (!this._loading)
this.callEvent(is_new?"onEventAdded":"onEventChanged",[ev.id,ev]);
};
scheduler.deleteEvent=function(id,silent){
var ev=this._events[id];
if (!silent && (!this.callEvent("onBeforeEventDelete",[id,ev]) || !this.callEvent("onConfirmedBeforeEventDelete", [id,ev])))
return;
if (ev){
delete this._events[id];
this.unselect(id);
this.event_updated(ev);
}
this.callEvent("onEventDeleted", [id]);
};
scheduler.getEvent=function(id){
return this._events[id];
};
scheduler.setEvent=function(id,hash){
this._events[id]=hash;
};
scheduler.for_rendered=function(id,method){
for (var i=this._rendered.length-1; i>=0; i--)
if (this._rendered[i].getAttribute("event_id")==id)
method(this._rendered[i],i);
};
scheduler.changeEventId=function(id,new_id){
if (id == new_id) return;
var ev=this._events[id];
if (ev){
ev.id=new_id;
this._events[new_id]=ev;
delete this._events[id];
}
this.for_rendered(id,function(r){
r.setAttribute("event_id",new_id);
});
if (this._select_id==id) this._select_id=new_id;
if (this._edit_id==id) this._edit_id=new_id;
//if (this._drag_id==id) this._drag_id=new_id;
this.callEvent("onEventIdChange",[id,new_id]);
};
(function(){
var attrs=["text","Text","start_date","StartDate","end_date","EndDate"];
var create_getter=function(name){
return function(id){ return (scheduler.getEvent(id))[name]; };
};
var create_setter=function(name){
return function(id,value){
var ev=scheduler.getEvent(id); ev[name]=value;
ev._changed=true;
ev._timed=this.is_one_day_event(ev);
scheduler.event_updated(ev,true);
};
};
for (var i=0; i<attrs.length; i+=2){
scheduler["getEvent"+attrs[i+1]]=create_getter(attrs[i]);
scheduler["setEvent"+attrs[i+1]]=create_setter(attrs[i]);
}
})();
scheduler.event_updated=function(ev,force){
if (this.is_visible_events(ev))
this.render_view_data();
else this.clear_event(ev.id);
};
scheduler.is_visible_events=function(ev){
return (ev.start_date<this._max_date && this._min_date<ev.end_date);
};
scheduler.is_one_day_event=function(ev){
var delta = ev.end_date.getDate()-ev.start_date.getDate();
if (!delta)
return ev.start_date.getMonth()==ev.end_date.getMonth() && ev.start_date.getFullYear()==ev.end_date.getFullYear();
else {
if (delta < 0) delta = Math.ceil((ev.end_date.valueOf()-ev.start_date.valueOf())/(24*60*60*1000));
return (delta == 1 && !ev.end_date.getHours() && !ev.end_date.getMinutes() && (ev.start_date.getHours() || ev.start_date.getMinutes() ));
}
};
scheduler.get_visible_events=function(){
//not the best strategy for sure
var stack=[];
var filter = this["filter_"+this._mode];
for( var id in this._events)
if (this.is_visible_events(this._events[id]))
if (this._table_view || this.config.multi_day || this._events[id]._timed)
if (!filter || filter(id,this._events[id]))
stack.push(this._events[id]);
return stack;
};
scheduler.render_view_data=function(evs, hold){
if(!evs){
if (this._not_render) {
this._render_wait=true;
return;
}
this._render_wait=false;
this.clear_view();
evs=this.get_visible_events();
}
if (this.config.multi_day && !this._table_view){
var tvs = [];
var tvd = [];
for (var i=0; i < evs.length; i++){
if (evs[i]._timed)
tvs.push(evs[i]);
else
tvd.push(evs[i]);
}
// multiday events
this._rendered_location = this._els['dhx_multi_day'][0];
this._table_view=true;
this.render_data(tvd, hold);
this._table_view=false;
// normal events
this._rendered_location = this._els['dhx_cal_data'][0];
this._table_view=false;
this.render_data(tvs, hold);
} else {
this._rendered_location = this._els['dhx_cal_data'][0];
this.render_data(evs, hold);
}
};
scheduler.render_data=function(evs,hold){
evs=this._pre_render_events(evs,hold);
for (var i=0; i<evs.length; i++)
if (this._table_view)
this.render_event_bar(evs[i]);
else
this.render_event(evs[i]);
};
scheduler._pre_render_events=function(evs,hold){
var hb = this.xy.bar_height;
var h_old = this._colsS.heights;
var h=this._colsS.heights=[0,0,0,0,0,0,0];
var data = this._els["dhx_cal_data"][0];
if (!this._table_view) evs=this._pre_render_events_line(evs,hold); //ignore long events for now
else evs=this._pre_render_events_table(evs,hold);
if (this._table_view){
if (hold)
this._colsS.heights = h_old;
else {
var evl = data.firstChild;
if (evl.rows){
for (var i=0; i<evl.rows.length; i++){
h[i]++;
if ((h[i])*hb > this._colsS.height-22){ // 22 - height of cell's header
//we have overflow, update heights
var cells = evl.rows[i].cells;
for (var j=0; j < cells.length; j++) {
cells[j].childNodes[1].style.height = h[i]*hb+"px";
}
h[i]=(h[i-1]||0)+cells[0].offsetHeight;
}
h[i]=(h[i-1]||0)+evl.rows[i].cells[0].offsetHeight;
}
h.unshift(0);
if (evl.parentNode.offsetHeight<evl.parentNode.scrollHeight && !evl._h_fix){
//we have v-scroll, decrease last day cell
for (var i=0; i<evl.rows.length; i++){
var cell = evl.rows[i].cells[6].childNodes[0];
var w = cell.offsetWidth-scheduler.xy.scroll_width+"px";
cell.style.width = w;
cell.nextSibling.style.width = w;
}
evl._h_fix=true;
}
} else{
if (!evs.length && this._els["dhx_multi_day"][0].style.visibility == "visible")
h[0]=-1;
if (evs.length || h[0]==-1){
//shift days to have space for multiday events
var childs = evl.parentNode.childNodes;
var dh = ((h[0]+1)*hb+1)+"px"; // +1 so multiday events would have 2px from top and 2px from bottom by default
data.style.top = (this._els["dhx_cal_navline"][0].offsetHeight + this._els["dhx_cal_header"][0].offsetHeight + parseInt(dh)) + 'px';
data.style.height = (this._obj.offsetHeight - parseInt(data.style.top) - (this.xy.margin_top||0)) + 'px';
var last = this._els["dhx_multi_day"][0];
last.style.height=dh;
last.style.visibility=(h[0]==-1?"hidden":"visible");
last=this._els["dhx_multi_day"][1];
last.style.height=dh;
last.style.visibility=(h[0]==-1?"hidden":"visible");
last.className=h[0]?"dhx_multi_day_icon":"dhx_multi_day_icon_small";
this._dy_shift=(h[0]+1)*hb;
h[0] = 0;
}
}
}
}
return evs;
};
scheduler._get_event_sday=function(ev){
return Math.floor((ev.start_date.valueOf()-this._min_date.valueOf())/(24*60*60*1000));
};
scheduler._pre_render_events_line=function(evs,hold){
evs.sort(function(a,b){
if(a.start_date.valueOf()==b.start_date.valueOf())
return a.id>b.id?1:-1;
return a.start_date>b.start_date?1:-1;
});
var days=[]; //events by weeks
var evs_originals = [];
for (var i=0; i < evs.length; i++) {
var ev=evs[i];
//check scale overflow
var sh = ev.start_date.getHours();
var eh = ev.end_date.getHours();
ev._sday=this._get_event_sday(ev);
if (!days[ev._sday]) days[ev._sday]=[];
if (!hold){
ev._inner=false;
var stack=days[ev._sday];
while (stack.length && stack[stack.length-1].end_date<=ev.start_date)
stack.splice(stack.length-1,1);
var sorderSet = false;
for(var j=0; j<stack.length; j++){
if(stack[j].end_date.valueOf()<ev.start_date.valueOf()){
sorderSet = true;
ev._sorder=stack[j]._sorder;
stack.splice(j,1);
ev._inner=true;
break;
}
}
if (stack.length)
stack[stack.length-1]._inner=true;
if (!sorderSet) {
if (stack.length) {
if (stack.length <= stack[stack.length - 1]._sorder) {
if (!stack[stack.length - 1]._sorder)
ev._sorder = 0;
else
for (j = 0; j < stack.length; j++) {
var _is_sorder = false;
for (k = 0; k < stack.length; k++) {
if (stack[k]._sorder == j) {
_is_sorder = true;
break;
}
}
if (!_is_sorder) {
ev._sorder = j;
break;
}
}
ev._inner = true;
}
else {
var _max_sorder = stack[0]._sorder;
for (j = 1; j < stack.length; j++)
if (stack[j]._sorder > _max_sorder)
_max_sorder = stack[j]._sorder;
ev._sorder = _max_sorder + 1;
ev._inner = false;
}
}
else
ev._sorder = 0;
}
stack.push(ev);
if (stack.length>(stack.max_count||0)) {
stack.max_count=stack.length;
ev._count=stack.length;
}
else {
ev._count=(ev._count)?ev._count:1;
}
}
if (sh < this.config.first_hour || eh >= this.config.last_hour){
evs_originals.push(ev);
evs[i]=ev=this._copy_event(ev);
if (sh < this.config.first_hour){
ev.start_date.setHours(this.config.first_hour);
ev.start_date.setMinutes(0);
}
if (eh >= this.config.last_hour){
ev.end_date.setMinutes(0);
ev.end_date.setHours(this.config.last_hour);
}
if (ev.start_date>ev.end_date || sh==this.config.last_hour) {
evs.splice(i,1); i--; continue;
}
}
}
if (!hold){
for (var i=0; i < evs.length; i++) {
evs[i]._count = days[evs[i]._sday].max_count;
}
for (var i=0; i < evs_originals.length; i++)
evs_originals[i]._count=days[evs_originals[i]._sday].max_count;
}
return evs;
};
scheduler._time_order=function(evs){
evs.sort(function(a,b){
if (a.start_date.valueOf()==b.start_date.valueOf()){
if (a._timed && !b._timed) return 1;
if (!a._timed && b._timed) return -1;
return a.id>b.id?1:-1;
}
return a.start_date>b.start_date?1:-1;
});
};
scheduler._pre_render_events_table=function(evs,hold){ // max - max height of week slot
this._time_order(evs);
var out=[];
var weeks=[[],[],[],[],[],[],[]]; //events by weeks
var max = this._colsS.heights;
var start_date;
var cols = this._cols.length;
for (var i=0; i < evs.length; i++) {
var ev=evs[i];
var sd = (start_date||ev.start_date);
var ed = ev.end_date;
//trim events which are crossing through current view
if (sd<this._min_date) sd=this._min_date;
if (ed>this._max_date) ed=this._max_date;
var locate_s = this.locate_holder_day(sd,false,ev);
ev._sday=locate_s%cols;
var locate_e = this.locate_holder_day(ed,true,ev)||cols;
ev._eday=(locate_e%cols)||cols; //cols used to fill full week, when event end on monday
ev._length=locate_e-locate_s;
//3600000 - compensate 1 hour during winter|summer time shift
ev._sweek=Math.floor((this._correct_shift(sd.valueOf(),1)-this._min_date.valueOf())/(60*60*1000*24*cols));
//current slot
var stack=weeks[ev._sweek];
//check order position
var stack_line;
for (stack_line=0; stack_line<stack.length; stack_line++)
if (stack[stack_line]._eday<=ev._sday)
break;
if(!ev._sorder || !hold ) {
ev._sorder=stack_line;
}
if (ev._sday+ev._length<=cols){
start_date=null;
out.push(ev);
stack[stack_line]=ev;
//get max height of slot
max[ev._sweek]=stack.length-1;
} else{ // split long event in chunks
var copy=this._copy_event(ev);
copy._length=cols-ev._sday;
copy._eday=cols; copy._sday=ev._sday;
copy._sweek=ev._sweek; copy._sorder=ev._sorder;
copy.end_date=this.date.add(sd,copy._length,"day");
out.push(copy);
stack[stack_line]=copy;
start_date=copy.end_date;
//get max height of slot
max[ev._sweek]=stack.length-1;
i--; continue; //repeat same step
}
}
return out;
};
scheduler._copy_dummy=function(){
this.start_date=new Date(this.start_date);
this.end_date=new Date(this.end_date);
};
scheduler._copy_event=function(ev){
this._copy_dummy.prototype = ev;
return new this._copy_dummy();
//return {start_date:ev.start_date, end_date:ev.end_date, text:ev.text, id:ev.id}
};
scheduler._rendered=[];
scheduler.clear_view=function(){
for (var i=0; i<this._rendered.length; i++){
var obj=this._rendered[i];
if (obj.parentNode) obj.parentNode.removeChild(obj);
}
this._rendered=[];
};
scheduler.updateEvent=function(id){
var ev=this.getEvent(id);
this.clear_event(id);
if (ev && this.is_visible_events(ev))
this.render_view_data([ev], true);
};
scheduler.clear_event=function(id){
this.for_rendered(id,function(node,i){
if (node.parentNode)
node.parentNode.removeChild(node);
scheduler._rendered.splice(i,1);
});
};
scheduler.render_event=function(ev){
var menu = scheduler.xy.menu_width;
if (ev._sday<0) return; //can occur in case of recurring event during time shift
var parent=scheduler.locate_holder(ev._sday);
if (!parent) return; //attempt to render non-visible event
var sm = ev.start_date.getHours()*60+ev.start_date.getMinutes();
var em = (ev.end_date.getHours()*60+ev.end_date.getMinutes())||(scheduler.config.last_hour*60);
var top = (Math.round((sm*60*1000-this.config.first_hour*60*60*1000)*this.config.hour_size_px/(60*60*1000)))%(this.config.hour_size_px*24)+1; //42px/hour
var height = Math.max(scheduler.xy.min_event_height,(em-sm)*this.config.hour_size_px/60)+1; //42px/hour
//var height = Math.max(25,Math.round((ev.end_date.valueOf()-ev.start_date.valueOf())*(this.config.hour_size_px+(this._quirks?1:0))/(60*60*1000))); //42px/hour
var width=Math.floor((parent.clientWidth-menu)/ev._count);
var left=ev._sorder*width+1;
if (!ev._inner) width=width*(ev._count-ev._sorder);
if(this.config.cascade_event_display) {
var limit = this.config.cascade_event_count;
var margin = this.config.cascade_event_margin;
left = ev._sorder%limit*margin;
var right = (ev._inner)?(ev._count-ev._sorder-1)%limit*margin/2:0;
width=Math.floor(parent.clientWidth-menu-left-right);
}
var d=this._render_v_bar(ev.id,menu+left,top,width,height,ev._text_style,scheduler.templates.event_header(ev.start_date,ev.end_date,ev),scheduler.templates.event_text(ev.start_date,ev.end_date,ev));
this._rendered.push(d);
parent.appendChild(d);
left=left+parseInt(parent.style.left,10)+menu;
if (this._edit_id==ev.id){
d.style.zIndex = 1; //fix overlapping issue
width=Math.max(width-4,scheduler.xy.editor_width);
d=document.createElement("DIV");
d.setAttribute("event_id",ev.id);
this.set_xy(d,width,height-20,left,top+14);
d.className="dhx_cal_editor";
var d2=document.createElement("DIV");
this.set_xy(d2,width-6,height-26);
d2.style.cssText+=";margin:2px 2px 2px 2px;overflow:hidden;";
d.appendChild(d2);
this._els["dhx_cal_data"][0].appendChild(d);
this._rendered.push(d);
d2.innerHTML="<textarea class='dhx_cal_editor'>"+ev.text+"</textarea>";
if (this._quirks7) d2.firstChild.style.height=height-12+"px"; //IEFIX
this._editor=d2.firstChild;
this._editor.onkeypress=function(e){
if ((e||event).shiftKey) return true;
var code=(e||event).keyCode;
if (code==scheduler.keys.edit_save) scheduler.editStop(true);
if (code==scheduler.keys.edit_cancel) scheduler.editStop(false);
};
this._editor.onselectstart=function(e){ return (e||event).cancelBubble=true; };
d2.firstChild.focus();
//IE and opera can add x-scroll during focusing
this._els["dhx_cal_data"][0].scrollLeft=0;
d2.firstChild.select();
}
if (this._select_id==ev.id){
if(this.config.cascade_event_display && this._drag_mode)
d.style.zIndex = 1; //fix overlapping issue for cascade view in case of dnd of selected event
var icons=this.config["icons_"+((this._edit_id==ev.id)?"edit":"select")];
var icons_str="";
var bg_color = (ev.color?("background-color:"+ev.color+";"):"");
var color = (ev.textColor?("color:"+ev.textColor+";"):"");
for (var i=0; i<icons.length; i++)
icons_str+="<div class='dhx_menu_icon "+icons[i]+"' style='"+bg_color+""+color+"' title='"+this.locale.labels[icons[i]]+"'></div>";
var obj = this._render_v_bar(ev.id,left-menu+1,top,menu,icons.length*20+26,"","<div style='"+bg_color+""+color+"' class='dhx_menu_head'></div>",icons_str,true);
obj.style.left=left-menu+1;
this._els["dhx_cal_data"][0].appendChild(obj);
this._rendered.push(obj);
}
};
scheduler._render_v_bar=function(id,x,y,w,h,style,contentA,contentB,bottom){
var d=document.createElement("DIV");
var ev = this.getEvent(id);
var cs = "dhx_cal_event";
var cse = scheduler.templates.event_class(ev.start_date,ev.end_date,ev);
if (cse) cs=cs+" "+cse;
var bg_color = (ev.color?("background-color:"+ev.color+";"):"");
var color = (ev.textColor?("color:"+ev.textColor+";"):"");
var html='<div event_id="'+id+'" class="'+cs+'" style="position:absolute; top:'+y+'px; left:'+x+'px; width:'+(w-4)+'px; height:'+h+'px;'+(style||"")+'">';
html+='<div class="dhx_header" style=" width:'+(w-6)+'px;'+bg_color+'" >&nbsp;</div>';
html+='<div class="dhx_title" style="'+bg_color+''+color+'">'+contentA+'</div>';
html+='<div class="dhx_body" style=" width:'+(w-(this._quirks?4:14))+'px; height:'+(h-(this._quirks?20:30))+'px;'+bg_color+''+color+'">'+contentB+'</div>';
html+='<div class="dhx_footer" style=" width:'+(w-8)+'px;'+(bottom?' margin-top:-1px;':'')+''+bg_color+''+color+'" ></div></div>';
d.innerHTML=html;
return d.firstChild;
};
scheduler.locate_holder=function(day){
if (this._mode=="day") return this._els["dhx_cal_data"][0].firstChild; //dirty
return this._els["dhx_cal_data"][0].childNodes[day];
};
scheduler.locate_holder_day=function(date,past){
var day = Math.floor((this._correct_shift(date,1)-this._min_date)/(60*60*24*1000));
//when locating end data of event , we need to use next day if time part was defined
if (past && this.date.time_part(date)) day++;
return day;
};
scheduler.render_event_bar=function(ev){
var parent=this._rendered_location;
var x=this._colsS[ev._sday];
var x2=this._colsS[ev._eday];
if (x2==x) x2=this._colsS[ev._eday+1];
var hb = this.xy.bar_height;
var y=this._colsS.heights[ev._sweek]+(this._colsS.height?(this.xy.month_scale_height+2):2)+(ev._sorder*hb);
var d=document.createElement("DIV");
var cs = ev._timed?"dhx_cal_event_clear":"dhx_cal_event_line";
var cse = scheduler.templates.event_class(ev.start_date,ev.end_date,ev);
if (cse) cs=cs+" "+cse;
var bg_color = (ev.color?("background-color:"+ev.color+";"):"");
var color = (ev.textColor?("color:"+ev.textColor+";"):"");
var html='<div event_id="'+ev.id+'" class="'+cs+'" style="position:absolute; top:'+y+'px; left:'+x+'px; width:'+(x2-x-15)+'px;'+color+''+bg_color+''+(ev._text_style||"")+'">';
if (ev._timed)
html+=scheduler.templates.event_bar_date(ev.start_date,ev.end_date,ev);
html+=scheduler.templates.event_bar_text(ev.start_date,ev.end_date,ev)+'</div>';
html+='</div>';
d.innerHTML=html;
this._rendered.push(d.firstChild);
parent.appendChild(d.firstChild);
};
scheduler._locate_event=function(node){
var id=null;
while (node && !id && node.getAttribute){
id=node.getAttribute("event_id");
node=node.parentNode;
}
return id;
};
scheduler.edit=function(id){
if (this._edit_id==id) return;
this.editStop(false,id);
this._edit_id=id;
this.updateEvent(id);
};
scheduler.editStop=function(mode,id){
if (id && this._edit_id==id) return;
var ev=this.getEvent(this._edit_id);
if (ev){
if (mode) ev.text=this._editor.value;
this._edit_id=null;
this._editor=null;
this.updateEvent(ev.id);
this._edit_stop_event(ev,mode);
}
};
scheduler._edit_stop_event=function(ev,mode){
if (this._new_event){
if (!mode) this.deleteEvent(ev.id,true);
else this.callEvent("onEventAdded",[ev.id,ev]);
this._new_event=null;
} else
if (mode) this.callEvent("onEventChanged",[ev.id,ev]);
};
scheduler.getEvents = function(from,to){
var result = [];
for (var a in this._events){
var ev = this._events[a];
if (ev && ev.start_date<to && ev.end_date>from)
result.push(ev);
}
return result;
};

View File

@ -1,386 +0,0 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
*/
.dhx_scale_bar_header {
position: absolute;
border-bottom: 1px dotted #8894A3;
width: 100%;
}
.dhx_expand_icon {
position:absolute; top:0px; right:0px;
background-image:url(./imgs/colapce-expand-icon.gif);
width:18px; height:18px;
cursor:pointer;
background-position:0px 18px;
z-index:16;
}
.dhx_agenda_area{
width:100%;
height:100%;
overflow-y:auto;
background-image:url(./imgs/databg.png);
}
.dhx_agenda_line{
height:21px;
clear:both;
overflow:hidden;
}
.dhx_agenda_line div{
float:left;
width:188px;
border-right:1px dotted #8894A3;
text-align:center;
line-height:21px;
overflow:hidden;
}
.dhx_agenda_area .dhx_agenda_line div{
border-right:0px dotted #8894A3;
}
.dhx_v_border{
position:absolute; left:186px; top:0px;
border-right:1px dotted #8894A3;
width:1px;
height:100%;
}
.dhx_agenda_line .dhx_event_icon{
width:20px;
border-width:0px;
background:url(./imgs/icon.png) no-repeat;
background-position: 5px 4px;
cursor:pointer;
}
.dhx_agenda_line span{
padding-left:5px;
line-height:21px;
}
.dhx_year_body{
border-left:1px dotted #586A7E;
}
.dhx_year_week{
position:relative;
}
.dhx_scale_bar_last{
border-right:1px dotted #586A7E;
}
.dhx_year_month{
height:18px;
padding-top:3px;
border:1px dotted #586A7E;
text-align:center;
vertical-align:middle;
}
.dhx_year_body .dhx_before .dhx_month_head, .dhx_year_body .dhx_after .dhx_month_head, .dhx_year_body .dhx_before .dhx_month_head a, .dhx_year_body .dhx_after .dhx_month_head a{
color:#E2E3E6 !important;
}
.dhx_year_body .dhx_month_body{
height:0px;
overflow:hidden;
}
.dhx_month_head.dhx_year_event{
background-color:#FFE763;
}
.dhx_year_body .dhx_before .dhx_month_head, .dhx_year_body .dhx_after .dhx_month_head{
cursor: default;
}
.dhx_tooltip{
border:1px solid #BBBBBB;
background-image:url(./imgs/databg.png);
position:absolute;
z-index:9998;
width:300px;
height:auto;
font-family:Tahoma;
font-size:8pt;
overflow:hidden;
}
.dhx_tooltip_line{
line-height:20px;
height:20px;
overflow:hidden;
}
.dhx_tooltip_line .dhx_event_icon{
width:20px; height:20px;
padding-right:10px;
float:left;
border-width:0px;
position:relative;
background:url(./imgs/icon.png) no-repeat;
background-position: 5px 4px;
cursor:pointer;
}
.dhx_tooltip_date{
float:left;
width:auto;
padding-left:5px;
text-align:center;
}
.dhx_text_disabled{
color:#887A2E;
font-family:Tahoma;
font-size:8pt;
}
.dhx_mini_calendar{
-moz-box-shadow:5px 5px 5px #888; /*Doesn't work in IE*/
-khtml-box-shadow: 5px 5px 5px #888;
}
.dhx_mini_calendar .dhx_month_head{
cursor:pointer;
}
.dhx_mini_calendar .dhx_calendar_click{
background-color: #C2D5FC;
}
.dhx_cal_navline div.dhx_minical_icon{
width:18px;
height:18px;
left:190px;
top:1px;
cursor:pointer;
background-image:url(./imgs/calendar.gif);
}
.dhx_matrix_scell {
height: 100%;
}
.dhx_matrix_cell, .dhx_matrix_scell{
overflow:hidden;
text-align:center;
vertical-align:middle;
border-bottom:1px dotted #8894A3;
border-right:1px dotted #8894A3;
}
.dhx_matrix_cell{
background-color:white;
}
.dhx_matrix_line{
overflow: hidden;
}
.dhx_matrix_cell div, .dhx_matrix_scell div{
overflow:hidden;
text-align:center;
height:auto;
}
.dhx_cal_lsection .dhx_readonly{
font-size:9pt;
font-size:8pt;
padding:2px;
color:#887A2E;
}
/* Tree view */
.dhx_matrix_scell.folder, .dhx_data_table.folder .dhx_matrix_cell{
background-color: #969394;
cursor: pointer;
}
.dhx_matrix_scell .dhx_scell_level0{
padding-left: 5px;
}
.dhx_matrix_scell .dhx_scell_level1{
padding-left: 20px;
}
.dhx_matrix_scell .dhx_scell_level2{
padding-left: 35px;
}
.dhx_matrix_scell .dhx_scell_level3{
padding-left: 50px;
}
.dhx_matrix_scell .dhx_scell_level4{
padding-left: 65px;
}
.dhx_matrix_scell.folder{
font-weight: bold;
text-align: left;
}
.dhx_matrix_scell.folder .dhx_scell_expand{
float: left;
width: 10px;
padding-right:3px;
}
.dhx_matrix_scell.folder .dhx_scell_name{
float: left;
width: auto;
}
.dhx_matrix_scell.item .dhx_scell_name{
padding-left:15px;
text-align: left;
}
.dhx_data_table.folder .dhx_matrix_cell{
border-right: 0;
}
.dhx_section_timeline {
overflow: hidden;
padding: 4px 0 2px 10px;
}
.dhx_section_timeline select{
width: 552px;
}
/* Tree view end*/
/* Map view */
.dhx_map_area{
width:100%;
height:100%;
overflow-y: auto;
overflow-x: hidden;
background-image:url(./imgs/databg.png);
}
.dhx_map_line .dhx_event_icon{
width:20px;
border-width:0px;
background:url(./imgs/icon.png) no-repeat;
background-position: 5px 4px;
cursor:pointer;
}
.dhx_map_line{
height:21px;
clear:both;
overflow:hidden;
}
.dhx_map {
position:absolute;
}
.dhx_map_line div{
float:left;
border-right:1px dotted #8894A3;
text-align:center;
line-height:21px;
overflow:hidden;
}
.dhx_map_line .headline_description{
float:left;
border-right:1px dotted #8894A3;
text-align:center;
line-height:21px;
overflow:hidden;
}
.dhx_map_line .dhx_map_description{
float:left;
border-right: 0 dotted #8894A3;
text-align:center;
line-height:21px;
overflow:hidden;
}
.dhx_map_line .line_description{
float:left;
border-right:1px dotted #8894A3;
text-align:left;
padding-left:5px;
line-height:21px;
overflow:hidden;
}
.dhx_map_line.highlight{
background-color: #C4C5CC;
}
.dhx_map_area .dhx_map_line div{
border-right:0px dotted #8894A3;
}
/* Map view end */
/* dhtmlXTooltip start */
.dhtmlXTooltip.tooltip{
-moz-box-shadow:3px 3px 3px #888888;
-webkit-box-shadow:3px 3px 3px #888888;
-o-box-shadow:3px 3px 3px #888888;
box-shadow:3px 3px 3px #888888;
filter:
progid:DXImageTransform.Microsoft.Shadow(color='#888888', Direction=135, Strength=5)
;
background-color:white;
border-left:1px dotted #887A2E;
border-top:1px dotted #887A2E;
color:#887A2E;
cursor:default;
padding:10px;
position:absolute;
z-index:500;
}
/* dhtmlXTooltip end */
/* Lightbox checkbox section */
.dhx_cal_checkbox label {
padding-left: 5px;
}
/* Lightbox checkbox section end */
/* Lightbox radiobuttons section */
.dhx_cal_light .radio {
padding: 2px 0px 2px 10px;
}
.dhx_cal_light .radio input, .dhx_cal_light .radio label{
line-height: 15px;
}
.dhx_cal_light .radio input {
vertical-align: middle;
margin: 0px;
padding: 0px;
}
.dhx_cal_light .radio label {
vertical-align: middle;
padding-right: 10px;
}
/* Lightbox radiobuttons section end */
/* Lightbox dhtmlx combo section */
.dhx_cal_light .combo {
padding: 4px;
}
/* Lightbox dhtmlx combo section end */
/* Agenda week start */
.dhx_wa_column {
float: left;
}
.dhx_wa_column_last .dhx_wa_day_cont{
border-left: 1px dotted #8894A3;
}
.dhx_wa_scale_bar {
font-family: Tahoma;
padding-left: 10px;
font-size: 11px;
border-top: 1px dotted #8894A3;
border-bottom: 1px dotted #8894A3;
}
.dhx_wa_day_data {
background-color: #FCFEFC;
overflow-y: auto;
}
.dhx_wa_ev_body {
border-bottom: 1px dotted #778899;
font-size: 12px;
padding: 5px 0 5px 7px;
}
.dhx_wa_dnd {
font-family: Tahoma;
position: absolute;
padding-right: 7px;
color: #887AE2 !important;
background-color: #FFE763 !important;
border: 1px solid #B7A543;
}
.dhx_cal_event_selected{
background-color: #9cc1db;
color: white;
}
/* Agenda week end */
/* timeline second scale start */
.dhx_second_scale_bar {
border-bottom: 1px dotted #586A7E;
padding-top: 2px;
}
/* timeline second scale end */

View File

@ -0,0 +1,28 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
scheduler.config.active_link_view = "day";
scheduler.attachEvent("onTemplatesReady", function() {
var s_d = scheduler.date.str_to_date(scheduler.config.api_date);
var d_s = scheduler.date.date_to_str(scheduler.config.api_date);
var month_x = scheduler.templates.month_day;
scheduler.templates.month_day = function(date) {
return "<a jump_to='" + d_s(date) + "' href='#'>" + month_x(date) + "</a>";
};
var week_x = scheduler.templates.week_scale_date;
scheduler.templates.week_scale_date = function(date) {
return "<a jump_to='" + d_s(date) + "' href='#'>" + week_x(date) + "</a>";
};
dhtmlxEvent(this._obj, "click", function(e) {
var start = e.target || event.srcElement;
var to = start.getAttribute("jump_to");
if (to) {
scheduler.setCurrentView(s_d(to), scheduler.config.active_link_view);
if (e && e.preventDefault)
e.preventDefault();
return false;
}
})
});

View File

@ -1,15 +1,11 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
scheduler.date.add_agenda = function(date){
return (new Date(date.valueOf()));
return scheduler.date.add(date, 1, "year");
};
scheduler.dblclick_dhx_agenda_area=function(){
if (!this.config.readonly && this.config.dblclick_create)
this.addEventNow();
};
scheduler.templates.agenda_time = function(start,end,ev){
if (ev._timed)
return this.day_date(ev.start_date, ev.end_date, ev)+" "+this.event_date(start);
@ -19,41 +15,46 @@ scheduler.templates.agenda_time = function(start,end,ev){
scheduler.templates.agenda_text = function(start,end,event){
return event.text;
};
scheduler.date.agenda_start=function(d){ return d; };
scheduler.attachEvent("onTemplatesReady",function(){
scheduler.templates.agenda_date = function(){ return ""; };
scheduler.date.agenda_start=function(){ return scheduler.date.date_part(new Date()); };
scheduler.attachEvent("onTemplatesReady",function() {
var old_dblclick_dhx_cal_data = scheduler.dblclick_dhx_cal_data;
scheduler.dblclick_dhx_cal_data = function() {
if (this._mode == "agenda") {
if (!this.config.readonly && this.config.dblclick_create)
this.addEventNow();
} else {
if (old_dblclick_dhx_cal_data)
return old_dblclick_dhx_cal_data.apply(this, arguments);
}
};
scheduler.attachEvent("onSchedulerResize",function(){
if (this._mode == "agenda"){
this.agenda_view(true);
return false;
}
return true;
if (this._mode == "agenda"){
this.agenda_view(true);
return false;
}
return true;
});
var old = scheduler.render_data;
scheduler.render_data=function(evs){
if (this._mode == "agenda")
fill_agenda_tab();
else
return old.apply(this,arguments);
}
fill_agenda_tab();
else
return old.apply(this,arguments);
};
var old_render_view_data = scheduler.render_view_data;
scheduler.render_view_data=function(){
scheduler.render_view_data = function(){
if(this._mode == "agenda") {
scheduler._agendaScrollTop = scheduler._els["dhx_cal_data"][0].childNodes[0].scrollTop;
scheduler._els["dhx_cal_data"][0].childNodes[0].scrollTop = 0;
scheduler._els["dhx_cal_data"][0].style.overflowY = 'hidden';
}
else {
scheduler._els["dhx_cal_data"][0].style.overflowY = 'auto';
}
return old_render_view_data.apply(this,arguments);
}
};
function set_full_view(mode){
@ -77,9 +78,10 @@ scheduler.attachEvent("onTemplatesReady",function(){
var html="<div class='dhx_agenda_area'>";
for (var i=0; i<events.length; i++){
var ev = events[i];
var bg_color = (ev.color?("background-color:"+ev.color+";"):"");
var color = (ev.textColor?("color:"+ev.textColor+";"):"");
html+="<div class='dhx_agenda_line' event_id='"+ev.id+"' style='"+color+""+bg_color+""+(ev._text_style||"")+"'><div>"+scheduler.templates.agenda_time(ev.start_date, ev.end_date,ev)+"</div>";
var bg_color = (ev.color?("background:"+ev.color+";"):"");
var color = (ev.textColor?("color:"+ev.textColor+";"):"");
var ev_class = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);
html+="<div class='dhx_agenda_line"+(ev_class?' '+ev_class:'')+"' event_id='"+ev.id+"' style='"+color+""+bg_color+""+(ev._text_style||"")+"'><div class='dhx_agenda_event_time'>"+scheduler.templates.agenda_time(ev.start_date, ev.end_date,ev)+"</div>";
html+="<div class='dhx_event_icon icon_details'>&nbsp</div>";
html+="<span>"+scheduler.templates.agenda_text(ev.start_date, ev.end_date, ev)+"</span></div>";
}
@ -88,9 +90,14 @@ scheduler.attachEvent("onTemplatesReady",function(){
//render html
scheduler._els["dhx_cal_data"][0].innerHTML = html;
scheduler._els["dhx_cal_data"][0].childNodes[0].scrollTop = scheduler._agendaScrollTop||0;
// setting up dhx_v_border size
var agenda_area = scheduler._els["dhx_cal_data"][0].childNodes[0];
var v_border = agenda_area.childNodes[agenda_area.childNodes.length-1];
v_border.style.height = (agenda_area.offsetHeight < scheduler._els["dhx_cal_data"][0].offsetHeight) ? "100%" : (agenda_area.offsetHeight+"px");
var t=scheduler._els["dhx_cal_data"][0].firstChild.childNodes;
scheduler._els["dhx_cal_date"][0].innerHTML="";
scheduler._els["dhx_cal_date"][0].innerHTML=scheduler.templates.agenda_date(scheduler._min_date, scheduler._max_date, scheduler._mode);
scheduler._rendered=[];
for (var i=0; i < t.length-1; i++)
@ -99,8 +106,8 @@ scheduler.attachEvent("onTemplatesReady",function(){
}
scheduler.agenda_view=function(mode){
scheduler._min_date = scheduler.config.agenda_start||(new Date());
scheduler._max_date = scheduler.config.agenda_end||(new Date(9999,1,1));
scheduler._min_date = scheduler.config.agenda_start||scheduler.date.agenda_start(scheduler._date);
scheduler._max_date = scheduler.config.agenda_end||scheduler.date.add_agenda(scheduler._min_date, 1);
scheduler._table_view = true;
set_full_view(mode);
if (mode){
@ -110,4 +117,4 @@ scheduler.attachEvent("onTemplatesReady",function(){
//agenda tab de-activated
}
}
})
});

View File

@ -0,0 +1,133 @@
/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
(function(){
scheduler.config.all_timed = "short";
scheduler.config.update_render = true;
var is_event_short = function (ev) {
return !((ev.end_date - ev.start_date)/(1000*60*60) >= 24);
};
var old_prerender_events_line = scheduler._pre_render_events_line;
scheduler._pre_render_events_line = function(evs, hold){
if (!this.config.all_timed)
return old_prerender_events_line.call(this, evs, hold);
for (var i=0; i < evs.length; i++) {
var ev=evs[i];
if (!ev._timed) {
if (this.config.all_timed == "short") {
if (!is_event_short(ev)) {
evs.splice(i--,1);
continue;
}
}
var ce = this._lame_copy({}, ev); // current event (event for one specific day) is copy of original with modified dates
ce.start_date = new Date(ce.start_date); // as lame copy doesn't copy date objects
var next_day = scheduler.date.add(ev.start_date, 1, "day");
next_day = scheduler.date.date_part(next_day);
if (ev.end_date < next_day) {
ce.end_date = new Date(ev.end_date);
}
else {
ce.end_date = next_day;
if (this.config.last_hour != 24) { // if specific last_hour was set (e.g. 20)
ce.end_date = scheduler.date.date_part(new Date(ce.start_date));
ce.end_date.setHours(this.config.last_hour);
}
}
var event_changed = false;
if (ce.start_date < this._max_date && ce.end_date > this._min_date && ce.start_date < ce.end_date) {
evs[i] = ce; // adding another event in collection
event_changed = true;
}
if (ce.start_date > ce.end_date) {
evs.splice(i--,1);
}
var re = this._lame_copy({}, ev); // remaining event, copy of original with modified start_date (making range more narrow)
re.end_date = new Date(re.end_date);
if (re.start_date < this._min_date)
re.start_date = new Date(this._min_date);
else
re.start_date = this.date.add(ev.start_date, 1, "day");
re.start_date.setHours(this.config.first_hour);
re.start_date.setMinutes(0); // as we are starting only with whole hours
if (re.start_date < this._max_date && re.start_date < re.end_date) {
if (event_changed)
evs.splice(i+1,0,re);
else {
evs[i--] = re;
continue;
}
}
}
}
// in case of all_timed pre_render is not applied to the original event
// so we need to force redraw in case of dnd
var redraw = (this._drag_mode == 'move')?false:hold;
return old_prerender_events_line.call(this, evs, redraw);
};
var old_get_visible_events = scheduler.get_visible_events;
scheduler.get_visible_events = function(only_timed){
if (!this.config.all_timed)
return old_get_visible_events.call(this, only_timed);
return old_get_visible_events.call(this, false); // only timed = false
};
scheduler.attachEvent("onBeforeViewChange", function (old_mode, old_date, mode, date) {
scheduler._allow_dnd = (mode == "day" || mode == "week");
return true;
});
scheduler.render_view_data=function(evs, hold){
if(!evs){
if (this._not_render) {
this._render_wait=true;
return;
}
this._render_wait=false;
this.clear_view();
evs=this.get_visible_events( !(this._table_view || this.config.multi_day) );
}
if (this.config.multi_day && !this._table_view){
var tvs = [];
var tvd = [];
for (var i=0; i < evs.length; i++){
if (evs[i]._timed || this.config.all_timed === true || (this.config.all_timed == "short" && is_event_short(evs[i])) )
tvs.push(evs[i]);
else
tvd.push(evs[i]);
}
// normal events
this._rendered_location = this._els['dhx_cal_data'][0];
this._table_view=false;
this.render_data(tvs, hold);
// multiday events
this._rendered_location = this._els['dhx_multi_day'][0];
this._table_view = true;
this.render_data(tvd, hold);
this._table_view=false;
} else {
this._rendered_location = this._els['dhx_cal_data'][0];
this.render_data(evs, hold);
}
};
})();

Some files were not shown because too many files have changed in this diff Show More