Browse Source

Initial commit

master
7u83 2 years ago
parent
commit
0d9f12f159
  1. 19
      __init__.py
  2. 42
      __openerp__.py
  3. 9
      doc/index.rst
  4. BIN
      static/description/Web_year_cal_1.png
  5. BIN
      static/description/icon.png
  6. 19
      static/description/index.html
  7. BIN
      static/description/main_screenshot.png
  8. 6984
      static/src/js/fullcalendar.js
  9. 39
      static/src/js/web_calendar_year.js
  10. 11
      views/web_calendar_year.xml

19
__init__.py

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Onestein (<http://www.onestein.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

42
__openerp__.py

@ -0,0 +1,42 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Onestein (<http://www.onestein.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': "Web Calendar Year",
'images': ['static/description/main_screenshot.png'],
'summary': """Year view on Odoo calendar""",
'description': """
Year calendar view
==================
Extends the default calendar widget with a year view.
""",
'author': "Onestein",
'website': "http://www.onestein.eu",
'category': 'Extra Tools',
'version': '1.0',
'depends': ['web_calendar'],
'data': [
'views/web_calendar_year.xml',
],
'demo': [],
'installable': True,
'auto_install': False,
'application': False,
}

9
doc/index.rst

@ -0,0 +1,9 @@
This module adds a year view to all Odoo calendar views for all users.
No configuration is needed.
|
**Contact us:**
When you have any remark about this module, please let us know on http://www.onestein.eu/feedback

BIN
static/description/Web_year_cal_1.png

After

Width: 1422  |  Height: 633  |  Size: 32 KiB

BIN
static/description/icon.png

After

Width: 256  |  Height: 256  |  Size: 4.8 KiB

19
static/description/index.html

@ -0,0 +1,19 @@
<section class="oe_container">
<div class="oe_row">
<h2 class="oe_slogan">Year calendar</h2>
<h3 class="oe_slogan">Overview throughout the year</h3>
<div class="oe_span12">
<p class='oe_mt32'>
For several planning tasks the month scope is too short. The year overview will give you optimal insight for planning purposes.
This is especially useful for leave requests, appraisal planning and project task planning.
</p>
</div>
<div class="oe_span12">
<div class="oe_demo oe_picture oe_screenshot">
<img src="Web_year_cal_1.png" alt="Year calendar">
</div>
</div>
</div>
</section>

BIN
static/description/main_screenshot.png

After

Width: 1357  |  Height: 684  |  Size: 142 KiB

6984
static/src/js/fullcalendar.js
File diff suppressed because it is too large
View File

39
static/src/js/web_calendar_year.js

@ -0,0 +1,39 @@
openerp.web_calendar_year = function(instance) {
instance.web_calendar.CalendarView = instance.web_calendar.CalendarView.extend({
get_fc_init_options: function() {
var options = this._super();
options.buttonText.year = instance.web._t("Year");
options.header.right = "year,month,agendaWeek,agendaDay";
options.eventAfterAllRender = function() {
console.log("eventAfterAllRender");
var tableBody = $('.oe_view_manager_body');
tableBody.find('.fake-thead').remove();
tableBody.scroll();
}
return options;
},
init_calendar: function() {
console.log("Init calendar");
$('.oe_view_manager_body').scroll(function(e, handler) {
if($(this).scrollTop() > 43) {
var theads = $(this).find('.fake-thead');
if(theads.length == 0) {
var original = $(this).find(".fc-skeleton");
var headClone = original.clone();
headClone.find("tbody").remove();
headClone.css({ 'position': 'absolute', 'left': 0, 'top': $(this).scrollTop(), 'margin-left': '5px', 'z-index': 10, 'width': (original.css("width") == "100%") ? original.width() + 'px' : original.css("width") });
headClone.find("th").css({'text-align': 'center'});
headClone.addClass('fake-thead');
$(this).append(headClone);
} else {
theads.css({ 'top': $(this).scrollTop() });
}
} else {
$(this).find('.fake-thead').remove();
}
});
return this._super.apply(this, arguments);
}
});
};

11
views/web_calendar_year.xml

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="assets_backend" name="web_calendar_year assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/web_calendar_year/static/src/js/fullcalendar.js"></script>
<script type="text/javascript" src="/web_calendar_year/static/src/js/web_calendar_year.js"></script>
</xpath>
</template>
</data>
</openerp>
Loading…
Cancel
Save