From 060aca31438b26e831afad97bf50b153f5409b2b Mon Sep 17 00:00:00 2001 From: Enric Tobella Date: Tue, 8 Oct 2019 18:06:58 +0200 Subject: [PATCH] [ADD] web_view_calendar_column --- web_view_calendar_column/README.rst | 88 ++++ web_view_calendar_column/__init__.py | 0 web_view_calendar_column/__manifest__.py | 18 + .../readme/CONTRIBUTORS.rst | 1 + .../readme/DESCRIPTION.rst | 4 + web_view_calendar_column/readme/USAGE.rst | 8 + .../static/description/icon.png | Bin 0 -> 9455 bytes .../static/description/index.html | 432 ++++++++++++++++++ .../static/lib/scheduler.min.css | 5 + .../static/lib/scheduler.min.js | 9 + .../static/src/js/calendar_controller.js | 19 + .../static/src/js/calendar_model.js | 57 +++ .../static/src/js/calendar_renderer.js | 92 ++++ .../static/src/js/calendar_view.js | 28 ++ web_view_calendar_column/views/assets.xml | 14 + 15 files changed, 775 insertions(+) create mode 100644 web_view_calendar_column/README.rst create mode 100644 web_view_calendar_column/__init__.py create mode 100644 web_view_calendar_column/__manifest__.py create mode 100644 web_view_calendar_column/readme/CONTRIBUTORS.rst create mode 100644 web_view_calendar_column/readme/DESCRIPTION.rst create mode 100644 web_view_calendar_column/readme/USAGE.rst create mode 100644 web_view_calendar_column/static/description/icon.png create mode 100644 web_view_calendar_column/static/description/index.html create mode 100644 web_view_calendar_column/static/lib/scheduler.min.css create mode 100644 web_view_calendar_column/static/lib/scheduler.min.js create mode 100644 web_view_calendar_column/static/src/js/calendar_controller.js create mode 100644 web_view_calendar_column/static/src/js/calendar_model.js create mode 100644 web_view_calendar_column/static/src/js/calendar_renderer.js create mode 100644 web_view_calendar_column/static/src/js/calendar_view.js create mode 100644 web_view_calendar_column/views/assets.xml diff --git a/web_view_calendar_column/README.rst b/web_view_calendar_column/README.rst new file mode 100644 index 000000000..1c25ca2cb --- /dev/null +++ b/web_view_calendar_column/README.rst @@ -0,0 +1,88 @@ +======================== +Web View Calendar Column +======================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github + :target: https://github.com/OCA/web/tree/11.0/web_view_calendar_column + :alt: OCA/web +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/web-11-0/web-11-0-web_view_calendar_column + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/162/11.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows to configure multiple columns on calendar daily views. + +This module only changes the daily view, weekly view and monthly view will +not change. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +In order to define columns, we must access the action of the menu and edit the +context. +We should add the item column with the name of the field to use. + +If we want to define a set of options, we can use `force_columns` on the +context. +With the force column, we will define a dictionary with the field value as key +and column name as value. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Creu Blanca + +Contributors +~~~~~~~~~~~~ + +* Enric Tobella + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/web `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/web_view_calendar_column/__init__.py b/web_view_calendar_column/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/web_view_calendar_column/__manifest__.py b/web_view_calendar_column/__manifest__.py new file mode 100644 index 000000000..0d6eff0af --- /dev/null +++ b/web_view_calendar_column/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2019 Creu Blanca +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + 'name': 'Web View Calendar Column', + 'summary': """ + Allow to define columns on calendars""", + 'version': '11.0.1.0.0', + 'license': 'AGPL-3', + 'author': 'Creu Blanca,Odoo Community Association (OCA)', + 'website': 'https://github.com/OCA/web', + 'depends': [ + 'web', + ], + 'data': [ + 'views/assets.xml', + ], +} diff --git a/web_view_calendar_column/readme/CONTRIBUTORS.rst b/web_view_calendar_column/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..93ec993e0 --- /dev/null +++ b/web_view_calendar_column/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Enric Tobella diff --git a/web_view_calendar_column/readme/DESCRIPTION.rst b/web_view_calendar_column/readme/DESCRIPTION.rst new file mode 100644 index 000000000..4d089eb61 --- /dev/null +++ b/web_view_calendar_column/readme/DESCRIPTION.rst @@ -0,0 +1,4 @@ +This module allows to configure multiple columns on calendar daily views. + +This module only changes the daily view, weekly view and monthly view will +not change. diff --git a/web_view_calendar_column/readme/USAGE.rst b/web_view_calendar_column/readme/USAGE.rst new file mode 100644 index 000000000..536f26801 --- /dev/null +++ b/web_view_calendar_column/readme/USAGE.rst @@ -0,0 +1,8 @@ +In order to define columns, we must access the action of the menu and edit the +context. +We should add the item column with the name of the field to use. + +If we want to define a set of options, we can use `force_columns` on the +context. +With the force column, we will define a dictionary with the field value as key +and column name as value. diff --git a/web_view_calendar_column/static/description/icon.png b/web_view_calendar_column/static/description/icon.png new file mode 100644 index 0000000000000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Pp4f2YFQrQtot5mn3wu_qprZ=>Ig-$ zbW26Ws~IgY>}^5w`vTB(G`PTZaDiGBo5o(tp)qli|NeV( z@H_=R8V39rt5J5YB2Ky?4eJJ#b`_iBe2ot~6%7mLt5t8Vwi^Jy7|jWXqa3amOIoRb zOr}WVFP--DsS`1WpN%~)t3R!arKF^Q$e12KEqU36AWwnCBICpH4XCsfnyrHr>$I$4 z!DpKX$OKLWarN7nv@!uIA+~RNO)l$$w}p(;b>mx8pwYvu;dD_unryX_NhT8*Tj>BTrTTL&!?O+%Rv;b?B??gSzdp?6Uug9{ zd@V08Z$BdI?fpoCS$)t4mg4rT8Q_I}h`0d-vYZ^|dOB*Q^S|xqTV*vIg?@fVFSmMpaw0qtTRbx} z({Pg?#{2`sc9)M5N$*N|4;^t$+QP?#mov zGVC@I*lBVrOU-%2y!7%)fAKjpEFsgQc4{amtiHb95KQEwvf<(3T<9-Zm$xIew#P22 zc2Ix|App^>v6(3L_MCU0d3W##AB0M~3D00EWoKZqsJYT(#@w$Y_H7G22M~ApVFTRHMI_3be)Lkn#0F*V8Pq zc}`Cjy$bE;FJ6H7p=0y#R>`}-m4(0F>%@P|?7fx{=R^uFdISRnZ2W_xQhD{YuR3t< z{6yxu=4~JkeA;|(J6_nv#>Nvs&FuLA&PW^he@t(UwFFE8)|a!R{`E`K`i^ZnyE4$k z;(749Ix|oi$c3QbEJ3b~D_kQsPz~fIUKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{} zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N Xviia!U7SGha1wx#SCgwmn*{w2TRX*I literal 0 HcmV?d00001 diff --git a/web_view_calendar_column/static/description/index.html b/web_view_calendar_column/static/description/index.html new file mode 100644 index 000000000..b16ac6af0 --- /dev/null +++ b/web_view_calendar_column/static/description/index.html @@ -0,0 +1,432 @@ + + + + + + +Web View Calendar Column + + + +
+

Web View Calendar Column

+ + +

Beta License: AGPL-3 OCA/web Translate me on Weblate Try me on Runbot

+

This module allows to configure multiple columns on calendar daily views.

+

This module only changes the daily view, weekly view and monthly view will +not change.

+

Table of contents

+ +
+

Usage

+

In order to define columns, we must access the action of the menu and edit the +context. +We should add the item column with the name of the field to use.

+

If we want to define a set of options, we can use force_columns on the +context. +With the force column, we will define a dictionary with the field value as key +and column name as value.

+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Creu Blanca
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/web project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/web_view_calendar_column/static/lib/scheduler.min.css b/web_view_calendar_column/static/lib/scheduler.min.css new file mode 100644 index 000000000..88e5c3c0b --- /dev/null +++ b/web_view_calendar_column/static/lib/scheduler.min.css @@ -0,0 +1,5 @@ +/*! + * FullCalendar Scheduler v1.4.0 + * Docs & License: http://fullcalendar.io/scheduler/ + * (c) 2016 Adam Shaw + */.fc-resource-area .fc-cell-content,.fc-timeline .fc-cell-text{padding-left:4px;padding-right:4px}.fc-resource-area th>div,.fc-scroller-canvas,.fc-scroller-canvas>.fc-content,.fc-scroller-clip{position:relative}.fc-scroller-clip,.fc-timeline .fc-cell-content,tr.fc-collapsed>td,tr.fc-transitioning>td{overflow:hidden}.fc-no-scrollbars{background:rgba(255,255,255,0)}.fc-timeline .fc-body .fc-divider.ui-widget-header,.fc-timeline .fc-body .ui-widget-content{background-image:none}.fc-no-scrollbars::-webkit-scrollbar{width:0;height:0}.fc-scroller-canvas{box-sizing:border-box;min-height:100%}.fc-scroller-canvas>.fc-bg{z-index:1}.fc-scroller-canvas>.fc-content{z-index:2;border-style:solid;border-width:0}.ui-widget .fc-scroller-canvas>.fc-content{border-color:transparent}.fc-scroller-canvas.fc-gutter-left>.fc-content{border-left-width:1px;margin-left:-1px}.fc-scroller-canvas.fc-gutter-right>.fc-content{border-right-width:1px;margin-right:-1px}.fc-scroller-canvas.fc-gutter-top>.fc-content{border-top-width:1px;margin-top:-1px}.fc-scroller-canvas.fc-gutter-bottom>.fc-content{border-bottom-width:1px;margin-bottom:-1px}.fc-rtl .fc-timeline{direction:rtl}.fc-timeline .fc-divider{width:3px;border-style:double}.fc-timeline .fc-head>tr>.fc-divider{border-bottom:0}.fc-timeline .fc-body>tr>.fc-divider{border-top:0}.fc-scrolled .fc-head .fc-scroller{z-index:2}.fc-timeline.fc-scrolled .fc-head .fc-scroller{box-shadow:0 3px 4px rgba(0,0,0,.075)}.fc-timeline .fc-body .fc-scroller{z-index:1}.fc-timeline .fc-scroller-canvas>div>div>table,.fc-timeline .fc-scroller-canvas>div>table{border-style:hidden}.fc-timeline td,.fc-timeline th{white-space:nowrap}.fc-timeline .fc-col-resizer{cursor:col-resize}.fc-timeline th{vertical-align:middle}.fc-timeline .fc-head .fc-cell-content{padding-top:3px;padding-bottom:3px}.fc-resource-area{width:30%}.fc-resource-area col{width:40%;min-width:70px}.fc-resource-area col.fc-main-col{width:60%}.fc-flat .fc-expander-space{display:none}.fc-ltr .fc-resource-area tr>*{text-align:left}.fc-rtl .fc-resource-area tr>*{text-align:right}.fc-resource-area .fc-super th{text-align:center}.fc-resource-area th .fc-cell-content{position:relative;z-index:1}.fc-resource-area th .fc-col-resizer,.fc-time-area .fc-bgevent,.fc-time-area .fc-highlight,.fc-time-area .fc-slats{position:absolute;top:0;bottom:0}.fc-resource-area th .fc-col-resizer{z-index:2;width:5px}.fc-ltr .fc-resource-area th .fc-col-resizer{right:-3px}.fc-rtl .fc-resource-area th .fc-col-resizer{left:-3px}tr.fc-transitioning>td>div{transition:margin-top .2s}tr.fc-collapsed>td>div{margin-top:-10px}.fc-body .fc-resource-area .fc-cell-content{padding-top:8px;padding-bottom:8px}.fc-no-overlap .fc-body .fc-resource-area .fc-cell-content{padding-top:5px;padding-bottom:5px}.fc-resource-area .fc-icon{width:1em;font-size:.9em;vertical-align:middle;margin-top:-1%}.fc-resource-area .fc-expander{cursor:pointer;color:#666}.fc-time-area col{min-width:2.2em}.fc-ltr .fc-time-area .fc-chrono th{text-align:left}.fc-rtl .fc-time-area .fc-chrono th{text-align:right}.fc-time-area .fc-slats{z-index:1;left:0;right:0}.fc-time-area .fc-slats table{height:100%}.fc-time-area .fc-slats .fc-minor{border-style:dotted}.fc-time-area .fc-slats td{border-width:0 1px}.fc-ltr .fc-time-area .fc-slats td{border-right-width:0}.fc-rtl .fc-time-area .fc-slats td{border-left-width:0}.fc-time-area .fc-bgevent-container,.fc-time-area .fc-highlight-container{position:absolute;z-index:2;top:0;bottom:0;width:0}.fc-ltr .fc-time-area .fc-bgevent-container,.fc-ltr .fc-time-area .fc-helper-container,.fc-ltr .fc-time-area .fc-highlight-container{left:0}.fc-rtl .fc-time-area .fc-bgevent-container,.fc-rtl .fc-time-area .fc-helper-container,.fc-rtl .fc-time-area .fc-highlight-container{right:0}.fc-time-area .fc-rows{position:relative;z-index:3}.fc-time-area .fc-rows .ui-widget-content{background:0 0}.fc-time-area .fc-rows td>div{position:relative}.fc-time-area .fc-rows .fc-bgevent-container,.fc-time-area .fc-rows .fc-highlight-container{z-index:1}.fc-time-area .fc-event-container{position:relative;z-index:2;width:0}.fc-time-area .fc-helper-container{position:absolute;z-index:3;top:0}.fc-time-area .fc-event-container{padding-bottom:8px;top:-1px}.fc-time-area tr:first-child .fc-event-container{top:0}.fc-no-overlap .fc-time-area .fc-event-container{padding-bottom:0;top:0}.fc-timeline .fc-now-indicator{z-index:3;top:0}.fc-time-area .fc-now-indicator-arrow{margin:0 -6px;border-width:6px 5px 0;border-left-color:transparent;border-right-color:transparent}.fc-time-area .fc-now-indicator-line{margin:0 -1px;bottom:0;border-left-width:1px}.fc-timeline-event{position:absolute;border-radius:0;padding:2px 0;margin-bottom:1px}.fc-no-overlap .fc-timeline-event{padding:5px 0;margin-bottom:0}.fc-ltr .fc-timeline-event{margin-right:1px}.fc-rtl .fc-timeline-event{margin-left:1px}.fc-timeline-event .fc-content{padding:0 1px;white-space:nowrap;overflow:hidden}.fc-timeline-event .fc-time{font-weight:700;padding:0 1px}.fc-rtl .fc-timeline-event .fc-time{display:inline-block}.fc-timeline-event .fc-title{padding:0 1px}.fc-timeline-event.fc-selected .fc-bg{display:none}.fc-ltr .fc-timeline-event .fc-title{padding-left:10px;margin-left:-8px}.fc-rtl .fc-timeline-event .fc-title{padding-right:10px;margin-right:-8px}.fc-ltr .fc-timeline-event.fc-not-start .fc-title{margin-left:-2px}.fc-rtl .fc-timeline-event.fc-not-start .fc-title{margin-right:-2px}.fc-body .fc-time-area .fc-following,.fc-timeline-event.fc-not-start .fc-title{position:relative}.fc-body .fc-time-area .fc-following:before,.fc-timeline-event.fc-not-start .fc-title:before{content:"";position:absolute;top:50%;margin-top:-5px;border:5px solid #000;border-top-color:transparent;border-bottom-color:transparent;opacity:.5}.fc-ltr .fc-body .fc-time-area .fc-following:before,.fc-ltr .fc-timeline-event.fc-not-start .fc-title:before{border-left:0;left:2px}.fc-rtl .fc-body .fc-time-area .fc-following:before,.fc-rtl .fc-timeline-event.fc-not-start .fc-title:before{border-right:0;right:2px}.fc-license-message{position:absolute;z-index:99999;bottom:1px;left:1px;background:#eee;border-color:#ddd;border-style:solid;border-width:1px 1px 0 0;padding:2px 4px;font-size:12px;border-top-right-radius:3px} \ No newline at end of file diff --git a/web_view_calendar_column/static/lib/scheduler.min.js b/web_view_calendar_column/static/lib/scheduler.min.js new file mode 100644 index 000000000..829f51973 --- /dev/null +++ b/web_view_calendar_column/static/lib/scheduler.min.js @@ -0,0 +1,9 @@ +/*! +FullCalendar Scheduler v1.4.0 +Docs & License: http://fullcalendar.io/scheduler/ +(c) 2016 Adam Shaw + */ +!function(t){"function"==typeof define&&define.amd?define(["jquery","moment","fullcalendar"],t):"object"==typeof exports?module.exports=t(require("jquery"),require("moment"),require("fullcalendar")):t(jQuery,moment)}(function(t,e){var r,o,s,i,n,l,u,h,a,c,p,d,f,g,y,v,w,m,S,R,b,C,E,H,T,_,I,D,x,B,F,G,M,W,L,z,k,V,P,A,O,q,N,j,Y,U,X,$,K,Q,J,Z,tt,et,rt,ot,st,it,nt,lt,ut,ht,at,ct,pt,dt,ft,gt,yt,vt,wt,mt,St,Rt,bt,Ct,Et,Ht,Tt,_t,It,Dt,xt,Bt,Ft,Gt,Mt,Wt,Lt,zt,kt,Vt,Pt,At,Ot=function(t,e){function r(){this.constructor=t}for(var o in e)qt.call(e,o)&&(t[o]=e[o]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},qt={}.hasOwnProperty,Nt=[].indexOf||function(t){for(var e=0,r=this.length;e td").filter(function(t,e){return e.rowSpan<=1})},Lt=function(e,r,o){return e&&e.then&&"resolved"!==e.state()?"rejected"===e.state()?(o&&o(),t.Deferred().reject().promise()):e.then(r,o):r?t.when(r()):t.when()},c=function(e){function r(){r.__super__.constructor.apply(this,arguments),this.requestMovingEnd=ot(this.reportMovingEnd,500)}var o,s;return Ot(r,e),r.mixin(a),r.mixin(v),r.prototype.canvas=null,r.prototype.isScrolling=!1,r.prototype.isTouching=!1,r.prototype.isMoving=!1,r.prototype.isTouchScrollEnabled=!0,r.prototype.preventTouchScrollHandler=null,r.prototype.render=function(){return r.__super__.render.apply(this,arguments),this.canvas&&(this.canvas.render(),this.canvas.el.appendTo(this.scrollEl)),this.bindHandlers()},r.prototype.destroy=function(){return r.__super__.destroy.apply(this,arguments),this.unbindHandlers()},r.prototype.disableTouchScroll=function(){return this.isTouchScrollEnabled=!1,this.bindPreventTouchScroll()},r.prototype.enableTouchScroll=function(){if(this.isTouchScrollEnabled=!0,!this.isTouching)return this.unbindPreventTouchScroll()},r.prototype.bindPreventTouchScroll=function(){if(!this.preventTouchScrollHandler)return this.scrollEl.on("touchmove",this.preventTouchScrollHandler=d.preventDefault)},r.prototype.unbindPreventTouchScroll=function(){if(this.preventTouchScrollHandler)return this.scrollEl.off("touchmove",this.preventTouchScrollHandler),this.preventTouchScrollHandler=null},r.prototype.bindHandlers=function(){return this.listenTo(this.scrollEl,{scroll:this.reportScroll,touchstart:this.reportTouchStart,touchend:this.reportTouchEnd})},r.prototype.unbindHandlers=function(){return this.stopListeningTo(this.scrollEl)},r.prototype.reportScroll=function(){return this.isScrolling||this.reportScrollStart(),this.trigger("scroll"),this.isMoving=!0,this.requestMovingEnd()},r.prototype.reportScrollStart=function(){if(!this.isScrolling)return this.isScrolling=!0,this.trigger("scrollStart",this.isTouching)},r.prototype.requestMovingEnd=null,r.prototype.reportMovingEnd=function(){if(this.isMoving=!1,!this.isTouching)return this.reportScrollEnd()},r.prototype.reportScrollEnd=function(){if(this.isScrolling)return this.trigger("scrollEnd"),this.isScrolling=!1},r.prototype.reportTouchStart=function(){return this.isTouching=!0},r.prototype.reportTouchEnd=function(){if(this.isTouching&&(this.isTouching=!1,this.isTouchScrollEnabled&&this.unbindPreventTouchScroll(),!this.isMoving))return this.reportScrollEnd()},r.prototype.getScrollLeft=function(){var t,e,r;if(t=this.scrollEl.css("direction"),e=this.scrollEl[0],r=e.scrollLeft,"rtl"===t)switch(s){case"positive":r=r+e.clientWidth-e.scrollWidth;break;case"reverse":r=-r}return r},r.prototype.setScrollLeft=function(t){var e,r;if(e=this.scrollEl.css("direction"),r=this.scrollEl[0],"rtl"===e)switch(s){case"positive":t=t-r.clientWidth+r.scrollWidth;break;case"reverse":t=-t}return r.scrollLeft=t},r.prototype.getScrollFromLeft=function(){var t,e,r;if(t=this.scrollEl.css("direction"),e=this.scrollEl[0],r=e.scrollLeft,"rtl"===t)switch(s){case"negative":r=r-e.clientWidth+e.scrollWidth;break;case"reverse":r=-r-e.clientWidth+e.scrollWidth}return r},r.prototype.getNativeScrollLeft=function(){return this.scrollEl[0].scrollLeft},r.prototype.setNativeScrollLeft=function(t){return this.scrollEl[0].scrollLeft=t},s=null,o=function(){var e,r,o;return e=t('
A
').appendTo("body"),r=e[0],o=r.scrollLeft>0?"positive":(r.scrollLeft=1,e.scrollLeft>0?"reverse":"negative"),e.remove(),o},t(function(){return s=o()}),r}(d.Scroller),n=function(e){function r(){r.__super__.constructor.apply(this,arguments),"clipped-scroll"===this.overflowX&&(this.overflowX="scroll",this.isHScrollbarsClipped=!0),"clipped-scroll"===this.overflowY&&(this.overflowY="scroll",this.isVScrollbarsClipped=!0)}return Ot(r,e),r.prototype.isHScrollbarsClipped=!1,r.prototype.isVScrollbarsClipped=!1,r.prototype.renderEl=function(){var e;return e=r.__super__.renderEl.apply(this,arguments),t('
').append(e)},r.prototype.updateSize=function(){var t,e,r;return e=this.scrollEl,r=ft(e),t={marginLeft:0,marginRight:0,marginTop:0,marginBottom:0},this.isHScrollbarsClipped&&(t.marginTop=-r.top,t.marginBottom=-r.bottom),this.isVScrollbarsClipped&&(t.marginLeft=-r.left,t.marginRight=-r.right),e.css(t),e.toggleClass("fc-no-scrollbars",(this.isHScrollbarsClipped||"hidden"===this.overflowX)&&(this.isVScrollbarsClipped||"hidden"===this.overflowY)&&!(r.top||r.bottom||r.left||r.right))},r.prototype.getScrollbarWidths=function(){var t;return t=ft(this.scrollEl),this.isHScrollbarsClipped&&(t.top=0,t.bottom=0),this.isVScrollbarsClipped&&(t.left=0,t.right=0),t},r}(c),O=function(){function e(){this.gutters={}}return e.prototype.el=null,e.prototype.contentEl=null,e.prototype.bgEl=null,e.prototype.gutters=null,e.prototype.width=null,e.prototype.minWidth=null,e.prototype.render=function(){return this.el=t('
'),this.contentEl=this.el.find(".fc-content"),this.bgEl=this.el.find(".fc-bg")},e.prototype.setGutters=function(e){return e?t.extend(this.gutters,e):this.gutters={},this.updateSize()},e.prototype.setWidth=function(t){return this.width=t,this.updateSize()},e.prototype.setMinWidth=function(t){return this.minWidth=t,this.updateSize()},e.prototype.clearWidth=function(){return this.width=null,this.minWidth=null,this.updateSize()},e.prototype.updateSize=function(){var t;return t=this.gutters,this.el.toggleClass("fc-gutter-left",Boolean(t.left)).toggleClass("fc-gutter-right",Boolean(t.right)).toggleClass("fc-gutter-top",Boolean(t.top)).toggleClass("fc-gutter-bottom",Boolean(t.bottom)).css({paddingLeft:t.left||"",paddingRight:t.right||"",paddingTop:t.top||"",paddingBottom:t.bottom||"",width:null!=this.width?this.width+(t.left||0)+(t.right||0):"",minWidth:null!=this.minWidth?this.minWidth+(t.left||0)+(t.right||0):""}),this.bgEl.css({left:t.left||"",right:t.right||"",top:t.top||"",bottom:t.bottom||""})},e}(),A=function(){function t(t,e){var r,o,s,i;for(this.axis=t,this.scrollers=e,s=this.scrollers,r=0,o=s.length;r=i&&(r="center"===this.el.css("text-align"),o=!0),e.isVFollowing&&pt(t)-pt(n)>=i&&(s=!0),this.isHFollowing=o,this.isVFollowing=s,this.isCentered=r},t.prototype.updatePosition=function(){return this.computePosition(),this.assignPosition()},t.prototype.resetPosition=function(){return this.el.css({top:"",left:""})},t.prototype.computePosition=function(){var t,e,r,o,s,i,n,l;return n=this.follower.viewportRect,r=this.parentRect,t=this.containerRect,l=wt(n,r),o=null,e=!1,l&&(o=et(this.naturalRect),i=wt(o,r),(this.isCentered&&!zt(n,r)||i&&!zt(n,i))&&(e=!0,this.isHFollowing&&(this.isCentered?(s=dt(o),o.left=(l.left+l.right)/2-s/2,o.right=o.left+s):gt(o,n)||(e=!1),gt(o,t)&&(e=!1)),this.isVFollowing&&(At(o,n)||(e=!1),At(o,t)&&(e=!1)),zt(n,o)||(e=!1))),this.rect=o,this.doAbsolute=e},t.prototype.assignPosition=function(){var t,e;if(this.isEnabled)return this.rect?this.doAbsolute&&!this.follower.isForcedRelative?(this.absolutize(),this.absoluteEl.css({top:this.rect.top-this.follower.viewportRect.top+this.follower.scrollbarWidths.top,left:this.rect.left-this.follower.viewportRect.left+this.follower.scrollbarWidths.left,width:this.isBlock?this.naturalWidth:""})):(e=this.rect.top-this.naturalRect.top,t=this.rect.left-this.naturalRect.left,this.unabsolutize(),this.el.toggleClass("fc-following",Boolean(e||t)).css({top:e,left:t})):this.unabsolutize()},t.prototype.absolutize=function(){if(!this.isAbsolute)return this.absoluteEl||(this.absoluteEl=this.buildAbsoluteEl()),this.absoluteEl.appendTo(this.follower.scroller.el),this.el.css("visibility","hidden"),this.isAbsolute=!0},t.prototype.unabsolutize=function(){if(this.isAbsolute)return this.absoluteEl.detach(),this.el.css("visibility",""),this.isAbsolute=!1},t.prototype.buildAbsoluteEl=function(){return this.el.clone().addClass("fc-following").css({position:"absolute","z-index":1e3,"font-weight":this.el.css("font-weight"),"font-size":this.el.css("font-size"),"font-family":this.el.css("font-family"),color:this.el.css("color"),"padding-top":this.el.css("padding-top"),"padding-bottom":this.el.css("padding-bottom"),"padding-left":this.el.css("padding-left"),"padding-right":this.el.css("padding-right"),"pointer-events":"none"})},t}(),et=function(t){return{left:t.left,right:t.right,top:t.top,bottom:t.bottom}},dt=function(t){return t.right-t.left},pt=function(t){return t.bottom-t.top},zt=function(t,e){return kt(t,e)&&Vt(t,e)},kt=function(t,e){return e.left>=t.left&&e.right<=t.right},Vt=function(t,e){return e.top>=t.top&&e.bottom<=t.bottom},gt=function(t,e){return t.lefte.right&&(t.left=e.right-dt(t),t.right=e.right,!0)},At=function(t,e){return t.tope.bottom&&(t.top=e.bottom-pt(t),t.bottom=e.bottom,!0)},bt=function(t,e){return{left:Math.min(t.left,e.left),right:Math.max(t.right,e.right),top:Math.min(t.top,e.top),bottom:Math.max(t.bottom,e.bottom)}},s=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Ot(r,e),r.prototype.resourceManager=null,r.prototype.initialize=function(){return this.resourceManager=new D(this)},r.prototype.instantiateView=function(t){var e,r;return e=this.getViewSpec(t),r=e["class"],this.options.resources&&e.options.resources!==!1&&(e.queryResourceClass?r=e.queryResourceClass(e)||r:e.resourceClass&&(r=e.resourceClass)),new r(this,t,e.options,e.duration)},r.prototype.getResources=function(){return Array.prototype.slice.call(this.resourceManager.topLevelResources)},r.prototype.addResource=function(t,e){var r;null==e&&(e=!1),r=this.resourceManager.addResource(t),e&&this.view.scrollToResource&&r.done(function(t){return function(e){return t.view.scrollToResource(e)}}(this))},r.prototype.removeResource=function(t){return this.resourceManager.removeResource(t)},r.prototype.refetchResources=function(){this.resourceManager.fetchResources()},r.prototype.rerenderResources=function(){this.resourceManager.resetResources()},r.prototype.isSpanAllowed=function(t,e){var o,s;return!("object"==typeof e&&(o=this.getEventResourceIds(e),o.length&&!(t.resourceId&&(s=t.resourceId,Nt.call(o,s)>=0))))&&r.__super__.isSpanAllowed.apply(this,arguments)},r.prototype.getPeerEvents=function(t,e){var o,s,i,n,l,u,h,a,c,p,d,f,g,y;for(f=r.__super__.getPeerEvents.apply(this,arguments),p=t.resourceId?[t.resourceId]:e?this.getEventResourceIds(e):[],o=[],i=0,u=f.length;i1?this.datesAboveResources?this.renderHeadDateAndResourceHtml():this.renderHeadResourceAndDateHtml():this.renderHeadResourceHtml():d.DayTableMixin.renderHeadTrHtml.call(this)},renderHeadResourceHtml:function(){var t,e,r,o,s;for(s=[],r=this.flattenedResources,t=0,e=r.length;t1?' colspan="'+r+'"':"")+">"+yt(this.view.getResourceText(t))+""},renderHeadResourceDateCellHtml:function(t,e,r){return this.renderHeadDateCellHtml(t,r,'data-resource-id="'+e.id+'"')},processHeadResourceEls:function(e){return e.find(".fc-resource-cell").each(function(e){return function(r,o){var s;return s=e.datesAboveResources?e.getColResource(r):e.flattenedResources[e.isRTL?e.flattenedResources.length-1-r:r],e.view.trigger("resourceRender",s,s,t(o),t())}}(this))},renderBgCellsHtml:function(t){var e,r,o,s,i,n;if(this.resourceCnt){for(o=[],e=s=0,i=this.colCnt;s"+t.join("")+this[e]()+""):""+this[e]()+t.join("")+""},computePerResourceBusinessHourSegs:function(t){var e,r,o,s,i,n,l,u,h,a,c,p,d,f,g;if(this.flattenedResources){for(r=!1,p=this.flattenedResources,n=0,h=p.length;n '},e.prototype.renderTimeGridSkeleton=function(){return this.timeGrid.setElement(this.el.find("tbody .fc-time-area")),this.timeGrid.headEl=this.el.find("thead .fc-time-area"),this.timeGrid.renderSkeleton(),this.isScrolled=!1,this.timeGrid.bodyScroller.on("scroll",Mt(this,"handleBodyScroll"))},e.prototype.handleBodyScroll=function(t,e){if(t){if(!this.isScrolled)return this.isScrolled=!0,this.el.addClass("fc-scrolled")}else if(this.isScrolled)return this.isScrolled=!1,this.el.removeClass("fc-scrolled")},e.prototype.unrenderSkeleton=function(){return this.timeGrid.removeElement(),this.handleBodyScroll(0),e.__super__.unrenderSkeleton.apply(this,arguments)},e.prototype.renderDates=function(){return this.timeGrid.renderDates()},e.prototype.unrenderDates=function(){return this.timeGrid.unrenderDates()},e.prototype.renderBusinessHours=function(){return this.timeGrid.renderBusinessHours()},e.prototype.unrenderBusinessHours=function(){return this.timeGrid.unrenderBusinessHours()},e.prototype.getNowIndicatorUnit=function(){return this.timeGrid.getNowIndicatorUnit()},e.prototype.renderNowIndicator=function(t){return this.timeGrid.renderNowIndicator(t)},e.prototype.unrenderNowIndicator=function(){return this.timeGrid.unrenderNowIndicator()},e.prototype.prepareHits=function(){return this.timeGrid.prepareHits()},e.prototype.releaseHits=function(){return this.timeGrid.releaseHits()},e.prototype.queryHit=function(t,e){return this.timeGrid.queryHit(t,e)},e.prototype.getHitSpan=function(t){return this.timeGrid.getHitSpan(t)},e.prototype.getHitEl=function(t){return this.timeGrid.getHitEl(t)},e.prototype.updateWidth=function(){return this.timeGrid.updateWidth()},e.prototype.setHeight=function(t,e){var r;return r=e?"auto":t-this.timeGrid.headHeight()-this.queryMiscHeight(),this.timeGrid.bodyScroller.setHeight(r)},e.prototype.queryMiscHeight=function(){return this.el.outerHeight()-this.timeGrid.headScroller.el.outerHeight()-this.timeGrid.bodyScroller.el.outerHeight()},e.prototype.computeInitialScroll=function(t){return this.timeGrid.computeInitialScroll(t)},e.prototype.queryScroll=function(){return this.timeGrid.queryScroll()},e.prototype.setScroll=function(t){return this.timeGrid.setScroll(t)},e.prototype.renderEvents=function(t){return this.timeGrid.renderEvents(t),this.updateWidth()},e.prototype.unrenderEvents=function(){return this.timeGrid.unrenderEvents(),this.updateWidth()},e.prototype.renderDrag=function(t,e){return this.timeGrid.renderDrag(t,e)},e.prototype.unrenderDrag=function(){return this.timeGrid.unrenderDrag()},e.prototype.getEventSegs=function(){return this.timeGrid.getEventSegs()},e.prototype.renderSelection=function(t){return this.timeGrid.renderSelection(t)},e.prototype.unrenderSelection=function(){return this.timeGrid.unrenderSelection()},e}(X),rt=d.cssToStr,N=function(r){function o(){var t;o.__super__.constructor.apply(this,arguments),this.initScaleProps(),this.minTime=e.duration(this.opt("minTime")||"00:00"),this.maxTime=e.duration(this.opt("maxTime")||"24:00"),this.timeWindowMs=this.maxTime-this.minTime,this.snapDuration=(t=this.opt("snapDuration"))?e.duration(t):this.slotDuration,this.minResizeDuration=this.snapDuration,this.snapsPerSlot=it(this.slotDuration,this.snapDuration),this.slotWidth=this.opt("slotWidth")}return Ot(o,r),o.prototype.slotDates=null,o.prototype.slotCnt=null,o.prototype.snapCnt=null,o.prototype.snapsPerSlot=null,o.prototype.snapDiffToIndex=null,o.prototype.snapIndexToDiff=null,o.prototype.headEl=null,o.prototype.slatContainerEl=null,o.prototype.slatEls=null,o.prototype.containerCoordCache=null,o.prototype.slatCoordCache=null,o.prototype.slatInnerCoordCache=null,o.prototype.headScroller=null,o.prototype.bodyScroller=null,o.prototype.joiner=null,o.prototype.follower=null,o.prototype.eventTitleFollower=null,o.prototype.minTime=null,o.prototype.maxTime=null,o.prototype.timeWindowMs=null,o.prototype.slotDuration=null,o.prototype.snapDuration=null,o.prototype.duration=null,o.prototype.labelInterval=null,o.prototype.headerFormats=null,o.prototype.isTimeScale=null,o.prototype.largeUnit=null,o.prototype.emphasizeWeeks=!1,o.prototype.titleFollower=null,o.prototype.segContainerEl=null,o.prototype.segContainerHeight=null,o.prototype.bgSegContainerEl=null,o.prototype.helperEls=null,o.prototype.innerEl=null,o.prototype.opt=function(t){return this.view.opt(t)},o.prototype.isValidDate=function(t){var e;return!this.view.isHiddenDay(t)&&(!this.isTimeScale||(e=t.time()-this.minTime,e=(e%864e5+864e5)%864e5,e').appendTo(this.bodyScroller.canvas.bgEl),this.segContainerEl=t('
').appendTo(this.bodyScroller.canvas.contentEl),this.bgSegContainerEl=this.bodyScroller.canvas.bgEl,this.containerCoordCache=new l({els:this.bodyScroller.canvas.el,isHorizontal:!0,isVertical:!0}),this.joiner=new A("horizontal",[this.headScroller,this.bodyScroller]),this.follower=new V(this.headScroller,this.view.calendar.isTouch),this.eventTitleFollower=new V(this.bodyScroller,this.view.calendar.isTouch),this.eventTitleFollower.minTravel=50,this.isRTL?this.eventTitleFollower.containOnNaturalRight=!0:this.eventTitleFollower.containOnNaturalLeft=!0,o.__super__.renderSkeleton.apply(this,arguments)},o.prototype.headColEls=null,o.prototype.slatColEls=null,o.prototype.renderDates=function(){var t,e,r,o,s;for(this.headScroller.canvas.contentEl.html(this.renderHeadHtml()),this.headColEls=this.headScroller.canvas.contentEl.find("col"),this.slatContainerEl.html(this.renderSlatHtml()),this.slatColEls=this.slatContainerEl.find("col"),this.slatEls=this.slatContainerEl.find("td"),this.slatCoordCache=new l({els:this.slatEls,isHorizontal:!0}),this.slatInnerCoordCache=new l({els:this.slatEls.find("> div"),isHorizontal:!0,offsetParent:this.bodyScroller.canvas.el}),s=this.slotDates,e=r=0,o=s.length;r1&&xthis.slotDuration,n="",n+="",f=0,m=M.length;f";for(n+="",n+="",l=E=0,S=e.length;E",H=0,R=B.length;H1?' colspan="'+t.colspan+'"':"")+'>
'+yt(t.text)+"
";n+=""}for(n+="
",F="",F+="",_=0,b=G.length;_";for(F+="",F+="",l=D=0,C=G.length;D
'},o.prototype.businessHourSegs=null,o.prototype.renderBusinessHours=function(){var t;if(!this.largeUnit)return t=this.businessHourSegs=this.buildBusinessHourSegs(!this.isTimeScale),this.renderFill("businessHours",t,"bgevent")},o.prototype.unrenderBusinessHours=function(){return this.unrenderFill("businessHours")},o.prototype.nowIndicatorEls=null,o.prototype.getNowIndicatorUnit=function(){if(this.isTimeScale)return J(this.slotDuration)},o.prototype.renderNowIndicator=function(e){var r,o,s;return s=[],e=this.normalizeGridDate(e),e>=this.start&&e
").css(o).appendTo(this.headScroller.canvas.el)[0]),s.push(t("
").css(o).appendTo(this.bodyScroller.canvas.el)[0])),this.nowIndicatorEls=t(s)},o.prototype.unrenderNowIndicator=function(){if(this.nowIndicatorEls)return this.nowIndicatorEls.remove(),this.nowIndicatorEls=null},o.prototype.explicitSlotWidth=null,o.prototype.defaultSlotWidth=null,o.prototype.updateWidth=function(){var t,e,r,o,s;if(s=Math.round(this.slotWidth||(this.slotWidth=this.computeSlotWidth())),r=s*this.slotDates.length,e="",o=s,t=this.bodyScroller.getClientWidth(),t>r&&(e=t,r="",o=Math.floor(t/this.slotDates.length)),this.headScroller.canvas.setWidth(r),this.headScroller.canvas.setMinWidth(e),this.bodyScroller.canvas.setWidth(r),this.bodyScroller.canvas.setMinWidth(e),this.headColEls.slice(0,-1).add(this.slatColEls.slice(0,-1)).width(o),this.headScroller.updateSize(),this.bodyScroller.updateSize(),this.joiner.update(),this.buildCoords(),this.updateSegPositions(),this.view.updateNowIndicator(),this.follower&&this.follower.update(),this.eventTitleFollower)return this.eventTitleFollower.update()},o.prototype.computeSlotWidth=function(){var e,r,o,s,i,n;return o=0,r=this.headEl.find("tr:last-child th span"),r.each(function(e,r){var s;return s=t(r).outerWidth(),o=Math.max(o,s)}),e=o+1,n=it(this.labelInterval,this.slotDuration),i=Math.ceil(e/n),s=this.headColEls.eq(0).css("min-width"),s&&(s=parseInt(s,10),s&&(i=Math.max(i,s))),i},o.prototype.buildCoords=function(){return this.containerCoordCache.build(),this.slatCoordCache.build(),this.slatInnerCoordCache.build()},o.prototype.computeDateSnapCoverage=function(t){var e,r,o;return r=nt(this.start,t,this.snapDuration),r<0?0:r>=this.snapDiffToIndex.length?this.snapCnt:(o=Math.floor(r),e=this.snapDiffToIndex[o],St(e)?e+=r-o:e=Math.ceil(e),e)},o.prototype.dateToCoord=function(t){var e,r,o,s,i;return i=this.computeDateSnapCoverage(t),o=i/this.snapsPerSlot,s=Math.floor(o),s=Math.min(s,this.slotCnt-1),r=o-s,e=this.slatInnerCoordCache,this.isRTL?e.getRightPosition(s)-e.getWidth(s)*r-this.containerCoordCache.getWidth(0):e.getLeftPosition(s)+e.getWidth(s)*r},o.prototype.rangeToCoords=function(t){return this.isRTL?{right:this.dateToCoord(t.start),left:this.dateToCoord(t.end)}:{left:this.dateToCoord(t.start),right:this.dateToCoord(t.end)}},o.prototype.headHeight=function(){var t;return t=this.headScroller.canvas.contentEl.find("table"),t.height.apply(t,arguments)},o.prototype.updateSegPositions=function(){var t,e,r,o,s;for(s=(this.segs||[]).concat(this.businessHourSegs||[]),e=0,r=s.length;e
'+(l?''+yt(l)+"":"")+''+(o.title?yt(o.title):" ")+'
'+(n?'
':"")+(i?'
':"")+""},o.prototype.updateSegFollowers=function(t){var e,r,o,s,i;if(this.eventTitleFollower){for(s=[],e=0,r=t.length;e').appendTo(o.innerEl),n.push(i[0]),f=0,d=S.length;f').appendTo(r.bgSegContainerEl),l=0,u=o.length;le.left},R=18,m=6,w=200,S=1e3,u={months:1},k=[{years:1},{months:1},{days:1},{hours:1},{minutes:30},{minutes:15},{minutes:10},{minutes:5},{minutes:1},{seconds:30},{seconds:15},{seconds:10},{seconds:5},{seconds:1},{milliseconds:500},{milliseconds:100},{milliseconds:10},{milliseconds:1}],N.prototype.initScaleProps=function(){var e,r,o;return this.labelInterval=this.queryDurationOption("slotLabelInterval"),this.slotDuration=this.queryDurationOption("slotDuration"),this.ensureGridDuration(),this.validateLabelAndSlot(),this.ensureLabelInterval(),this.ensureSlotDuration(),e=this.opt("slotLabelFormat"),o=t.type(e),this.headerFormats="array"===o?e:"string"===o?[e]:this.computeHeaderFormats(),this.isTimeScale=lt(this.slotDuration),this.largeUnit=this.isTimeScale?void 0:(r=J(this.slotDuration),/year|month|week/.test(r)?r:void 0),this.emphasizeWeeks=1===this.slotDuration.as("days")&&this.duration.as("weeks")>=2&&!this.opt("businessHours")},N.prototype.queryDurationOption=function(t){var r,o;if(o=this.opt(t),null!=o&&(r=e.duration(o),+r))return r},N.prototype.validateLabelAndSlot=function(){var t,e,r;if(this.labelInterval&&(t=it(this.duration,this.labelInterval),t>S&&(d.warn("slotLabelInterval results in too many cells"),this.labelInterval=null)),this.slotDuration&&(e=it(this.duration,this.slotDuration),e>S&&(d.warn("slotDuration results in too many cells"),this.slotDuration=null)),this.labelInterval&&this.slotDuration&&(r=it(this.labelInterval,this.slotDuration),!St(r)||r<1))return d.warn("slotLabelInterval must be a multiple of slotDuration"),this.slotDuration=null},N.prototype.ensureGridDuration=function(){var t,r,o,s,i;if(t=this.duration,!t){if(t=this.view.intervalDuration,!t)if(this.labelInterval||this.slotDuration)for(i=this.ensureLabelInterval(),o=k.length-1;o>=0&&(r=k[o],t=e.duration(r),s=it(t,i),!(s>=R));o+=-1);else t=e.duration(u);this.duration=t}return t},N.prototype.ensureLabelInterval=function(){var t,r,o,s,i,n,l,u,h;if(i=this.labelInterval,!i){if(this.duration||this.slotDuration||this.ensureGridDuration(),this.slotDuration){for(r=0,n=k.length;r=R));o++);this.labelInterval=i}return i},N.prototype.ensureSlotDuration=function(){var t,r,o,s,i,n,l,u;if(n=this.slotDuration,!n){for(o=this.ensureLabelInterval(),r=0,s=k.length;r1&&l<=m){n=u;break}n&&this.duration&&(i=it(this.duration,n),i>w&&(n=null)),n||(n=o),this.slotDuration=n}return n},N.prototype.computeHeaderFormats=function(){var t,e,r,o,s,i,n,l;switch(n=this.view,o=this.duration,s=this.labelInterval,i=J(s),l=this.opt("weekNumbers"),t=e=r=null,"week"!==i||l||(i="day"),i){case"year":t="YYYY";break;case"month":o.asYears()>1&&(t="YYYY"),e="MMM";break;case"week":o.asYears()>1&&(t="YYYY"),e=this.opt("shortWeekFormat");break;case"day":o.asYears()>1?t=this.opt("monthYearFormat"):o.asMonths()>1&&(t="MMMM"),l&&(e=this.opt("weekFormat")),r="dd D";break;case"hour":l&&(t=this.opt("weekFormat")),o.asDays()>1&&(e=this.opt("dayOfMonthFormat")),r=this.opt("smallTimeFormat");break;case"minute":s.asMinutes()/60>=m?(t=this.opt("hourFormat"),e="[:]mm"):t=this.opt("mediumTimeFormat");break;case"second":s.asSeconds()/60>=m?(t="LT",e="[:]ss"):t="LTS";break;case"millisecond":t="LTS",e="[.]SSS"}return[].concat(t||[],e||[],r||[])},d.views.timeline={"class":j,defaults:{eventResizableFromStart:!0}},d.views.timelineDay={type:"timeline",duration:{days:1}},d.views.timelineWeek={type:"timeline",duration:{weeks:1}},d.views.timelineMonth={type:"timeline",duration:{months:1}},d.views.timelineYear={type:"timeline",duration:{years:1}},M=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Ot(r,e),r.mixin(W),r.prototype.resourceGrid=null,r.prototype.tbodyHash=null,r.prototype.joiner=null,r.prototype.dividerEls=null,r.prototype.superHeaderText=null,r.prototype.isVGrouping=null,r.prototype.isHGrouping=null,r.prototype.groupSpecs=null,r.prototype.colSpecs=null,r.prototype.orderSpecs=null,r.prototype.rowHierarchy=null,r.prototype.resourceRowHash=null,r.prototype.nestingCnt=0,r.prototype.isNesting=null,r.prototype.dividerWidth=null,r.prototype.initialize=function(){return r.__super__.initialize.apply(this,arguments),this.processResourceOptions(),this.resourceGrid=new q(this),this.rowHierarchy=new z(this),this.resourceRowHash={}},r.prototype.instantiateGrid=function(){return new G(this)},r.prototype.processResourceOptions=function(){var t,e,r,o,s,i,n,l,u,h,a,c,p,d,f,g,y,v,w,m,S,R;for(t=this.opt("resourceColumns")||[],f=this.opt("resourceLabelText"),o="Resources",R=null,t.length?R=f:t.push({labelText:f||o,text:this.getResourceTextFunc()}),m=[],s=[],n=[],a=!1,h=!1,c=0,g=t.length;c
'; +},r.prototype.renderResourceGridSkeleton=function(){return this.resourceGrid.el=this.el.find("tbody .fc-resource-area"),this.resourceGrid.headEl=this.el.find("thead .fc-resource-area"),this.resourceGrid.renderSkeleton()},r.prototype.initDividerMoving=function(){var t;return this.dividerEls=this.el.find(".fc-divider"),this.dividerWidth=null!=(t=this.opt("resourceAreaWidth"))?t:this.resourceGrid.tableWidth,null!=this.dividerWidth&&this.positionDivider(this.dividerWidth),this.dividerEls.on("mousedown",function(t){return function(e){return t.dividerMousedown(e)}}(this))},r.prototype.dividerMousedown=function(t){var e,r,o,s,i;return r=this.opt("isRTL"),s=30,o=this.el.width()-30,i=this.getNaturalDividerWidth(),e=new h({dragStart:function(t){return function(){return t.dividerEls.addClass("fc-active")}}(this),drag:function(t){return function(e,n){var l;return l=r?i-e:i+e,l=Math.max(l,s),l=Math.min(l,o),t.dividerWidth=l,t.positionDivider(l),t.updateWidth()}}(this),dragEnd:function(t){return function(){return t.dividerEls.removeClass("fc-active")}}(this)}),e.startInteraction(t)},r.prototype.getNaturalDividerWidth=function(){return this.el.find(".fc-resource-area").width()},r.prototype.positionDivider=function(t){return this.el.find(".fc-resource-area").width(t)},r.prototype.renderEvents=function(t){return this.timeGrid.renderEvents(t),this.syncRowHeights(),this.updateWidth()},r.prototype.unrenderEvents=function(){return this.timeGrid.unrenderEvents(),this.syncRowHeights(),this.updateWidth()},r.prototype.updateWidth=function(){if(r.__super__.updateWidth.apply(this,arguments),this.resourceGrid.updateWidth(),this.joiner.update(),this.cellFollower)return this.cellFollower.update()},r.prototype.updateHeight=function(t){if(r.__super__.updateHeight.apply(this,arguments),t)return this.syncRowHeights()},r.prototype.setHeight=function(t,e){var r,o;return o=this.syncHeadHeights(),r=e?"auto":t-o-this.queryMiscHeight(),this.timeGrid.bodyScroller.setHeight(r),this.resourceGrid.bodyScroller.setHeight(r)},r.prototype.queryMiscHeight=function(){return this.el.outerHeight()-Math.max(this.resourceGrid.headScroller.el.outerHeight(),this.timeGrid.headScroller.el.outerHeight())-Math.max(this.resourceGrid.bodyScroller.el.outerHeight(),this.timeGrid.bodyScroller.el.outerHeight())},r.prototype.syncHeadHeights=function(){var t;return this.resourceGrid.headHeight("auto"),this.timeGrid.headHeight("auto"),t=Math.max(this.resourceGrid.headHeight(),this.timeGrid.headHeight()),this.resourceGrid.headHeight(t),this.timeGrid.headHeight(t),t},r.prototype.scrollToResource=function(t){return this.timeGrid.scrollToResource(t)},r.prototype.setResources=function(t){var e,r,o;for(this.batchRows(),e=0,r=t.length;e0)return o;return null},r.prototype.compareResources=function(t,e){return Q(t,e,this.orderSpecs)},r.prototype.ensureResourceGroup=function(t,e,r){var o,s,i,n,l,u,h,a,c,p,d;if(i=(t.resource||{})[r.field],s=null,r.order)for(c=e.children,n=l=0,h=c.length;l0)break}else for(p=e.children,n=u=0,a=p.length;u1))return this.syncRowHeights(t,!0)},r.prototype.getVisibleRows=function(){var t,e,r,o,s;for(r=this.rowHierarchy.getRows(),o=[],t=0,e=r.length;t
').appendTo(this.bodyScroller.canvas.contentEl),this.tbodyEl=e.find("tbody")},r.prototype.renderFgSegs=function(t){var e,r,o,s,i,n,l;for(t=this.renderFgSegEls(t),n=this.view.pairSegsWithRows(t),l=[],o=0,s=n.length;ol)){u.resourceId=n.resource.id,u.bottom=e-l;break}return u},r.prototype.setScroll=function(t){var e,o,s,i;return t.resourceId&&(i=this.view.getResourceRow(t.resourceId),i&&(e=i.getTr("event"),e&&(s=this.bodyScroller.canvas.el.offset().top,o=e.offset().top+e.outerHeight(),t.top=o-t.bottom-s))),r.__super__.setScroll.call(this,t)},r.prototype.scrollToResource=function(t){var e,r,o,s;if(o=this.view.getResourceRow(t.id),o&&(e=o.getTr("event")))return r=this.bodyScroller.canvas.el.offset().top,s=e.offset().top-r,this.bodyScroller.scrollEl.scrollTop(s)},r}(N),r=30,q=function(){function e(t){var e;this.view=t,this.isRTL=this.view.opt("isRTL"),this.givenColWidths=this.colWidths=function(){var t,r,o,s;for(o=this.view.colSpecs,s=[],t=0,r=o.length;t"+this.colGroupHtml+""),this.tbodyEl=this.bodyScroller.canvas.contentEl.find("tbody"),this.el.append(this.bodyScroller.el),this.joiner=new A("horizontal",[this.headScroller,this.bodyScroller]),this.headTable=this.headEl.find("table"),this.headColEls=this.headEl.find("col"),this.headCellEls=this.headScroller.canvas.contentEl.find("tr:last-child th"),this.bodyColEls=this.el.find("col"),this.bodyTable=this.el.find("table"),this.colMinWidths=this.computeColMinWidths(),this.applyColWidths(),this.initColResizing()},e.prototype.renderHeadHtml=function(){var t,e,r,o,s,i,n,l,u,h,a;for(e=this.view.colSpecs,r="",t="",n=0,u=e.length;n':"";for(t+="",this.colGroupHtml=t,r+=t,r+="",this.view.superHeaderText&&(r+='"),r+="",i=!0,o=l=0,h=e.length;l
'+(a.isMain?'':"")+''+yt(a.labelText||"")+"
"+(s?"":'
')+"
";return r+="
",r+="
'+yt(this.view.superHeaderText)+"
"},e.prototype.givenColWidths=null,e.prototype.colWidths=null,e.prototype.colMinWidths=null,e.prototype.tableWidth=null,e.prototype.tableMinWidth=null,e.prototype.initColResizing=function(){return this.headEl.find("th .fc-col-resizer").each(function(e){return function(r,o){return o=t(o),o.on("mousedown",function(t){return e.colResizeMousedown(r,t,o)})}}(this))},e.prototype.colResizeMousedown=function(t,e,o){var s,i,n,l;return s=this.colWidths=this.queryColWidths(),s.pop(),s.push(null),l=s[t],n=Math.min(this.colMinWidths[t],r),i=new h({dragStart:function(t){return function(){return o.addClass("fc-active")}}(this),drag:function(e){return function(r,o){var i;return i=l+(e.isRTL?-r:r),i=Math.max(i,n),s[t]=i,e.applyColWidths()}}(this),dragEnd:function(t){return function(){return o.removeClass("fc-active")}}(this)}),i.startInteraction(e)},e.prototype.applyColWidths=function(){var t,e,r,o,s,i,n,l,u,h,a,c,p,d,f,g,y;for(r=this.colMinWidths,s=this.colWidths,t=!0,e=!1,y=0,h=0,p=s.length;h0?r[e-1]:null,e"),this.trHash[l]=i,n.push(i[0]),o="render"+K(l)+"Content",this[o]&&this[o](i),e?e.trHash[l].after(i):s.prepend(i)}return this.trs=t(n).on("click",".fc-expander",Mt(this,"toggleExpanded")),this.isRendered=!0},e.prototype.unrender=function(){var e,r,o,s;if(this.isRendered){e=this.trHash;for(o in e)r=e[o],s="unrender"+K(o)+"Content",this[s]&&this[s](r);return this.trHash={},this.trs.remove(),this.trs=t(),this.isRendered=!1,this.isShown=!1,this.hidden()}},e.prototype.recursivelyUnrender=function(){var t,e,r,o,s;for(this.unrender(),o=this.children,s=[],e=0,r=o.length;e div:not(.fc-cell-content):first"),e=Math.max(o.height(),e)}}(this)),e},e.prototype.setTrInnerHeight=function(e){return t.each(this.trHash,function(t){return function(t,r){return ct(r).find("> div:not(.fc-cell-content):first").height(e)}}(this))},e.prototype.shown=function(){if(this.hasOwnRow)return this.rowShown(this)},e.prototype.hidden=function(){if(this.hasOwnRow)return this.rowHidden(this)},e.prototype.rowShown=function(t){return(this.parent||this.view).rowShown(t)},e.prototype.rowHidden=function(t){return(this.parent||this.view).rowHidden(t)},e.prototype.added=function(){if(this.hasOwnRow)return this.rowAdded(this)},e.prototype.removed=function(){if(this.hasOwnRow)return this.rowRemoved(this)},e.prototype.rowAdded=function(t){return(this.parent||this.view).rowAdded(t)},e.prototype.rowRemoved=function(t){return(this.parent||this.view).rowRemoved(t)},e}(),L=function(e){function r(t,e,o){this.groupSpec=e,this.groupValue=o,r.__super__.constructor.apply(this,arguments)}return Ot(r,e),r.prototype.groupSpec=null,r.prototype.groupValue=null,r.prototype.rowRemoved=function(t){if(r.__super__.rowRemoved.apply(this,arguments),t!==this&&!this.children.length)return this.remove()},r.prototype.renderGroupContentEl=function(){var e,r;return e=t('
').append(this.renderGroupTextEl()),r=this.groupSpec.render,"function"==typeof r&&(e=r(e,this.groupValue)||e),e},r.prototype.renderGroupTextEl=function(){var e,r;return r=this.groupValue||"",e=this.groupSpec.text,"function"==typeof e&&(r=e(r)||r),t('').text(r)},r}(z),g=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Ot(r,e),r.prototype.hasOwnRow=!0,r.prototype.renderSpreadsheetContent=function(e){var r;return r=this.renderGroupContentEl(),r.prepend(''),t('').attr("colspan",this.view.colSpecs.length).append(t("
").append(r)).appendTo(e)},r.prototype.renderEventContent=function(t){return t.append('
')},r}(L),U=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Ot(r,e),r.prototype.rowspan=0,r.prototype.leadingTr=null,r.prototype.groupTd=null,r.prototype.rowShown=function(t){return this.rowspan+=1,this.renderRowspan(),r.__super__.rowShown.apply(this,arguments)},r.prototype.rowHidden=function(t){return this.rowspan-=1,this.renderRowspan(),r.__super__.rowHidden.apply(this,arguments)},r.prototype.renderRowspan=function(){var e;return this.rowspan?(this.groupTd||(this.groupTd=t('').append(this.renderGroupContentEl())),this.groupTd.attr("rowspan",this.rowspan),e=this.getLeadingRow().getTr("spreadsheet"),e!==this.leadingTr?(e&&e.prepend(this.groupTd),this.leadingTr=e):void 0):(this.groupTd&&(this.groupTd.remove(),this.groupTd=null),this.leadingTr=null)},r}(L),p=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return Ot(e,t),e.prototype.hasOwnRow=!0,e.prototype.segContainerEl=null,e.prototype.segContainerHeight=null,e.prototype.innerEl=null,e.prototype.bgSegContainerEl=null,e.prototype.isSegsRendered=!1,e.prototype.isBusinessHourSegsRendered=!1,e.prototype.businessHourSegs=null,e.prototype.bgSegs=null,e.prototype.fgSegs=null,e.prototype.renderEventContent=function(t){return t.html('
'),this.segContainerEl=t.find(".fc-event-container"),this.innerEl=this.bgSegContainerEl=t.find("td > div"),this.ensureSegsRendered()},e.prototype.ensureSegsRendered=function(){if(!this.isSegsRendered)return this.ensureBusinessHourSegsRendered(),this.bgSegs&&this.view.timeGrid.renderFillInContainer("bgEvent",this,this.bgSegs),this.fgSegs&&this.view.timeGrid.renderFgSegsInContainers([[this,this.fgSegs]]),this.isSegsRendered=!0},e.prototype.ensureBusinessHourSegsRendered=function(){if(this.businessHourSegs&&!this.isBusinessHourSegsRendered)return this.view.timeGrid.renderFillInContainer("businessHours",this,this.businessHourSegs,"bgevent"),this.isBusinessHourSegsRendered=!0},e.prototype.unrenderEventContent=function(){return this.clearBusinessHourSegs(),this.bgSegs=null,this.fgSegs=null,this.isSegsRendered=!1},e.prototype.clearBusinessHourSegs=function(){var t,e,r,o;if(this.businessHourSegs){for(r=this.businessHourSegs,t=0,e=r.length;t0?this.enableExpanding():this.disableExpanding(),this.view.trigger("resourceRender",this.resource,this.resource,this.getTr("spreadsheet").find("> td"),this.getTr("event").find("> td"))},r.prototype.renderEventContent=function(t){return r.__super__.renderEventContent.apply(this,arguments),t.attr("data-resource-id",this.resource.id)},r.prototype.renderSpreadsheetContent=function(e){var r,o,s,i,n,l,u,h,a;for(u=this.resource,l=this.view.colSpecs,i=0,n=l.length;i'+(r.isMain?this.renderGutterHtml():"")+''+(a?yt(a):" ")+"
"),"function"==typeof r.render&&(o=r.render(u,o,s)||o),h=t('').append(o),r.isMain&&h.wrapInner("
"),e.append(h));return e.attr("data-resource-id",u.id)},r.prototype.renderGutterHtml=function(){var t,e,r,o;for(t="",e=r=0,o=this.depth;r';return t+=''},r}(p),d.views.timeline.resourceClass=M,E=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return Ot(e,t),e.mixin(W),e.prototype.timeGridClass=F,e.prototype.dayGridClass=T,e.prototype.renderHead=function(){return e.__super__.renderHead.apply(this,arguments),this.timeGrid.processHeadResourceEls(this.headContainerEl)},e.prototype.setResources=function(t){return this.timeGrid.setResources(t),this.dayGrid&&this.dayGrid.setResources(t),this.clearView(),this.displayView()},e.prototype.unsetResources=function(t){if(this.clearEvents(),this.timeGrid.unsetResources(),this.dayGrid&&this.dayGrid.unsetResources(),!t)return this.clearView(),this.displayView()},e}(d.AgendaView),d.views.agenda.queryResourceClass=function(t){var e;if(null!=(e=t.options.groupByResource||t.options.groupByDateAndResource)?e:1===t.duration.as("days"))return E},H=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return Ot(e,t),e.mixin(W),e.prototype.dayGridClass=T,e.prototype.renderHead=function(){return e.__super__.renderHead.apply(this,arguments),this.dayGrid.processHeadResourceEls(this.headContainerEl)},e.prototype.setResources=function(t){return this.dayGrid.setResources(t),this.clearView(),this.displayView()},e.prototype.unsetResources=function(t){if(this.clearEvents(),this.dayGrid.unsetResources(),!t)return this.clearView(),this.displayView()},e}(d.BasicView),x=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return Ot(e,t),e.mixin(W),e.prototype.dayGridClass=T,e.prototype.renderHead=function(){return e.__super__.renderHead.apply(this,arguments),this.dayGrid.processHeadResourceEls(this.headContainerEl)},e.prototype.setResources=function(t){return this.dayGrid.setResources(t),this.clearView(),this.displayView()},e.prototype.unsetResources=function(){return this.clearEvents(),this.dayGrid.unsetResources(),this.clearView(),this.displayView()},e}(d.MonthView),d.views.basic.queryResourceClass=function(t){var e;if(null!=(e=t.options.groupByResource||t.options.groupByDateAndResource)?e:1===t.duration.as("days"))return H},d.views.month.queryResourceClass=function(t){if(t.options.groupByResource||t.options.groupByDateAndResource)return x; +},C="2016-09-04",Y={years:1,weeks:1},y="http://fullcalendar.io/scheduler/license/",b=["GPL-My-Project-Is-Open-Source","CC-Attribution-NonCommercial-NoDerivatives"],Gt=function(t,e){if(!mt(window.location.href)&&!Rt(t)&&!st(e))return Wt('Please use a valid license key. More Info',e)},Rt=function(r){var o,s,i,n;return t.inArray(r,b)!==-1||(s=(r||"").match(/^(\d+)\-fcs\-(\d+)$/),!!(s&&10===s[1].length&&(i=e.utc(1e3*parseInt(s[2])),n=e.utc(d.mockSchedulerReleaseDate||C),n.isValid()&&(o=n.clone().subtract(Y),i.isAfter(o)))))},mt=function(t){return Boolean(t.match(/\w+\:\/\/fullcalendar\.io\/|\/demos\/[\w-]+\.html$/))},Wt=function(e,r){return r.append(t('
').html(e))},void(st=function(t){return t.find(".fc-license-message").length>=1}))}); \ No newline at end of file diff --git a/web_view_calendar_column/static/src/js/calendar_controller.js b/web_view_calendar_column/static/src/js/calendar_controller.js new file mode 100644 index 000000000..4d60c1573 --- /dev/null +++ b/web_view_calendar_column/static/src/js/calendar_controller.js @@ -0,0 +1,19 @@ +odoo.define('web_view_calendar_column.CalendarController', function (require) { + "use strict"; + + var CalendarController = require('web.CalendarController'); + + CalendarController.include({ + _onOpenCreate: function (event) { + if (event.data.resource && event.data.resource.id) { + var value = event.data.resource.id; + if (this.model.fields[this.model.fieldColumn].type === 'many2one') + value = parseInt(value); + this.context['default_'+ this.model.fieldColumn] = value; + } + else + this.context['default_'+ this.model.fieldColumn] = false; + return this._super.apply(this, arguments); + }, + }); +}); diff --git a/web_view_calendar_column/static/src/js/calendar_model.js b/web_view_calendar_column/static/src/js/calendar_model.js new file mode 100644 index 000000000..fca22ed12 --- /dev/null +++ b/web_view_calendar_column/static/src/js/calendar_model.js @@ -0,0 +1,57 @@ +odoo.define('web_view_calendar_column.CalendarModel', function (require) { + "use strict"; + + var CalendarModel = require('web.CalendarModel'); + var session = require('web.session'); + var core = require('web.core'); + var qweb = core.qweb; + var _t = core._t; + + CalendarModel.include({ + load: function (params) { + this.fieldColumn = params.fieldColumn; + this.forceColumns = params.forceColumns; + return this._super.apply(this, arguments); + }, + _loadCalendar: function () { + var self = this; + return this._super.apply(this, arguments).then(function () { + self._compute_columns(self.data, self.data.data); + }); + }, + _compute_columns: function (element, events) { + if (this.fieldColumn && this.forceColumns) { + this.data.columns = this.forceColumns; + } + else if (this.fieldColumn) { + var fieldName = this.fieldColumn; + var columns = {} + var elements = events; + _.each(events, function (event) { + var value = event.record[fieldName]; + var key = _.isArray(value) ? value[0] : value; + columns[key] = _.isArray(value) ? value[1] : value; + }); + this.data.columns = columns; + } + }, + _recordToCalendarEvent: function (evt) { + var result = this._super.apply(this, arguments); + var value = evt[this.fieldColumn]; + result.resourceId = _.isArray(value) ? value[0] : value; + return result; + }, + _getFullCalendarOptions: function () { + var result = this._super.apply(this, arguments); + if (this.fieldColumn) + result.resources = []; + return result; + }, + calendarEventToRecord: function (event) { + var result = this._super.apply(this, arguments); + if (event.resourceId) + result[this.fieldColumn] = event.resourceId; + return result; + }, + }); +}); diff --git a/web_view_calendar_column/static/src/js/calendar_renderer.js b/web_view_calendar_column/static/src/js/calendar_renderer.js new file mode 100644 index 000000000..a2aa28a3f --- /dev/null +++ b/web_view_calendar_column/static/src/js/calendar_renderer.js @@ -0,0 +1,92 @@ +odoo.define('web_view_calendar_column.CalendarRenderer', function (require) { + "use strict"; + + var CalendarRenderer = require('web.CalendarRenderer'); + var core = require('web.core'); + var qweb = core.qweb; + var _t = core._t; + CalendarRenderer.include({ + _initCalendar: function () { + var self = this; + + this.$calendar = this.$(".o_calendar_widget"); + + // This seems like a workaround but apparently passing the locale + // in the options is not enough. We should initialize it beforehand + var locale = moment.locale(); + $.fullCalendar.locale(locale); + + //Documentation here : http://arshaw.com/fullcalendar/docs/ + var fc_options = $.extend({}, this.state.fc_options, { + eventDrop: function (event) { + self.trigger_up('dropRecord', event); + }, + eventResize: function (event) { + self.trigger_up('updateRecord', event); + }, + eventClick: function (event) { + self.trigger_up('openEvent', event); + self.$calendar.fullCalendar('unselect'); + }, + select: function (target_date, end_date, event, _js_event, resource) { + var data = {'start': target_date, 'end': end_date, 'resource': resource}; + if (self.state.context.default_name) { + data.title = self.state.context.default_name; + } + self.trigger_up('openCreate', data); + self.$calendar.fullCalendar('unselect'); + }, + eventRender: function (event, element) { + var $render = $(self._eventRender(event)); + event.title = $render.find('.o_field_type_char:first').text(); + element.find('.fc-content').html($render.html()); + element.addClass($render.attr('class')); + var display_hour = ''; + if (!event.allDay) { + var start = event.r_start || event.start; + var end = event.r_end || event.end; + var timeFormat = _t.database.parameters.time_format.search("%H") != -1 ? 'HH:mm': 'h:mma'; + display_hour = start.format(timeFormat) + ' - ' + end.format(timeFormat); + if (display_hour === '00:00 - 00:00') { + display_hour = _t('All day'); + } + } + element.find('.fc-content .fc-time').text(display_hour); + }, + // Dirty hack to ensure a correct first render + eventAfterAllRender: function () { + $(window).trigger('resize'); + }, + viewRender: function (view) { + // compute mode from view.name which is either 'month', 'agendaWeek' or 'agendaDay' + var mode = view.name === 'month' ? 'month' : (view.name === 'agendaWeek' ? 'week' : 'day'); + // compute title: in week mode, display the week number + var title = mode === 'week' ? view.intervalStart.week() : view.title; + self.trigger_up('viewUpdated', { + mode: mode, + title: title, + }); + }, + //eventResourceEditable: true, // except for between resources + height: 'parent', + unselectAuto: false, + locale: locale, // reset locale when fullcalendar has already been instanciated before now + }); + + this.$calendar.fullCalendar(fc_options); + }, + _renderEvents: function () { + var self = this; + this.$calendar.fullCalendar('removeEvents'); + if (this.state.columns) + _.each(Object.entries(this.state.columns), function (column) { + self.$calendar.fullCalendar('addResource', { + id: column[0], + title: column[1] + }); + }); + this.$calendar.fullCalendar( + 'addEventSource', this.state.data); + }, + }); +}); diff --git a/web_view_calendar_column/static/src/js/calendar_view.js b/web_view_calendar_column/static/src/js/calendar_view.js new file mode 100644 index 000000000..2a4236454 --- /dev/null +++ b/web_view_calendar_column/static/src/js/calendar_view.js @@ -0,0 +1,28 @@ +odoo.define('web_view_calendar_column.CalendarView', function (require) { + "use strict"; + + var CalendarView = require('web.CalendarView'); + + CalendarView.include({ + jsLibs: [ + '/web/static/lib/fullcalendar/js/fullcalendar.js', + '/web_view_calendar_column/static/lib/scheduler.min.js' + ], + cssLibs: [ + '/web/static/lib/fullcalendar/css/fullcalendar.css', + '/web_view_calendar_column/static/lib/scheduler.min.css' + ], + init: function (viewInfo, params) { + this._super.apply(this, arguments); + var arch = viewInfo.arch; + var fieldNames = this.loadParams.fieldNames; + if (params.context.column) { + var fieldName = params.context.column; + fieldNames.push(fieldName); + } + this.loadParams.fieldColumn = params.context.column; + this.loadParams.fieldNames = _.uniq(fieldNames); + this.loadParams.forceColumns = params.context.force_columns; + }, + }); +}); diff --git a/web_view_calendar_column/views/assets.xml b/web_view_calendar_column/views/assets.xml new file mode 100644 index 000000000..3a5e39b19 --- /dev/null +++ b/web_view_calendar_column/views/assets.xml @@ -0,0 +1,14 @@ + + + + +