summaryrefslogtreecommitdiff
path: root/addons/google_calendar/static/src
diff options
context:
space:
mode:
authorAtul Patel (OpenERP) <atp@tinyerp.com>2014-02-18 11:26:18 +0530
committerAtul Patel (OpenERP) <atp@tinyerp.com>2014-02-18 11:26:18 +0530
commit33b99c8a0737e08e6a243e41bb455d3ab7e6c851 (patch)
treea1db52bfbeecf0c6fd9096604b7ec4540bb04197 /addons/google_calendar/static/src
parentcaa3510ea434e10c32dcbc134f9c74b2b9f18b2a (diff)
parentaa0eac1257b97c1be693e8a804fec6ecbf2bb22f (diff)
[MERGE]: Merged with addons
bzr revid: atp@tinyerp.com-20140218055618-r36w29vat7zig9ar
Diffstat (limited to 'addons/google_calendar/static/src')
-rwxr-xr-xaddons/google_calendar/static/src/css/Makefile4
-rw-r--r--addons/google_calendar/static/src/css/google_calendar.css10
-rw-r--r--addons/google_calendar/static/src/css/google_calendar.sass6
-rw-r--r--addons/google_calendar/static/src/img/calendar_32.pngbin0 -> 1390 bytes
-rw-r--r--addons/google_calendar/static/src/img/setup_01.pngbin0 -> 29144 bytes
-rw-r--r--addons/google_calendar/static/src/img/setup_02.pngbin0 -> 25420 bytes
-rw-r--r--addons/google_calendar/static/src/img/setup_03.pngbin0 -> 23827 bytes
-rw-r--r--addons/google_calendar/static/src/img/setup_04.pngbin0 -> 13960 bytes
-rw-r--r--addons/google_calendar/static/src/img/setup_05.pngbin0 -> 9597 bytes
-rw-r--r--addons/google_calendar/static/src/img/setup_06.pngbin0 -> 36793 bytes
-rw-r--r--addons/google_calendar/static/src/img/setup_07.pngbin0 -> 43094 bytes
-rw-r--r--addons/google_calendar/static/src/img/setup_08.pngbin0 -> 46112 bytes
-rw-r--r--addons/google_calendar/static/src/img/setup_09.pngbin0 -> 12511 bytes
-rw-r--r--addons/google_calendar/static/src/js/calendar_sync.js59
-rw-r--r--addons/google_calendar/static/src/xml/web_calendar.xml14
15 files changed, 93 insertions, 0 deletions
diff --git a/addons/google_calendar/static/src/css/Makefile b/addons/google_calendar/static/src/css/Makefile
new file mode 100755
index 00000000000..2071c694b4c
--- /dev/null
+++ b/addons/google_calendar/static/src/css/Makefile
@@ -0,0 +1,4 @@
+google_calendar.css: google_calendar.sass
+ sass --trace -t expanded google_calendar.sass google_calendar.css
+
+ \ No newline at end of file
diff --git a/addons/google_calendar/static/src/css/google_calendar.css b/addons/google_calendar/static/src/css/google_calendar.css
new file mode 100644
index 00000000000..06203243737
--- /dev/null
+++ b/addons/google_calendar/static/src/css/google_calendar.css
@@ -0,0 +1,10 @@
+@charset "utf-8";
+.openerp .oe_cal_sync_button {
+ margin: 20 0 20 0;
+}
+
+img.calendar_img_tuto {
+ margin-left : 50px;
+ margin-bottom : 10px;
+ border: 2px solid grey;
+}
diff --git a/addons/google_calendar/static/src/css/google_calendar.sass b/addons/google_calendar/static/src/css/google_calendar.sass
new file mode 100644
index 00000000000..8a07766e740
--- /dev/null
+++ b/addons/google_calendar/static/src/css/google_calendar.sass
@@ -0,0 +1,6 @@
+@charset "utf-8"
+
+.openerp
+ .oe_cal_sync_button
+ margin: 20 0 20 0
+ text-align:center \ No newline at end of file
diff --git a/addons/google_calendar/static/src/img/calendar_32.png b/addons/google_calendar/static/src/img/calendar_32.png
new file mode 100644
index 00000000000..40dd085f4eb
--- /dev/null
+++ b/addons/google_calendar/static/src/img/calendar_32.png
Binary files differ
diff --git a/addons/google_calendar/static/src/img/setup_01.png b/addons/google_calendar/static/src/img/setup_01.png
new file mode 100644
index 00000000000..0684df35e73
--- /dev/null
+++ b/addons/google_calendar/static/src/img/setup_01.png
Binary files differ
diff --git a/addons/google_calendar/static/src/img/setup_02.png b/addons/google_calendar/static/src/img/setup_02.png
new file mode 100644
index 00000000000..0aeeaa44a37
--- /dev/null
+++ b/addons/google_calendar/static/src/img/setup_02.png
Binary files differ
diff --git a/addons/google_calendar/static/src/img/setup_03.png b/addons/google_calendar/static/src/img/setup_03.png
new file mode 100644
index 00000000000..ad2fb61d3e9
--- /dev/null
+++ b/addons/google_calendar/static/src/img/setup_03.png
Binary files differ
diff --git a/addons/google_calendar/static/src/img/setup_04.png b/addons/google_calendar/static/src/img/setup_04.png
new file mode 100644
index 00000000000..61341c4b7d3
--- /dev/null
+++ b/addons/google_calendar/static/src/img/setup_04.png
Binary files differ
diff --git a/addons/google_calendar/static/src/img/setup_05.png b/addons/google_calendar/static/src/img/setup_05.png
new file mode 100644
index 00000000000..0401703b547
--- /dev/null
+++ b/addons/google_calendar/static/src/img/setup_05.png
Binary files differ
diff --git a/addons/google_calendar/static/src/img/setup_06.png b/addons/google_calendar/static/src/img/setup_06.png
new file mode 100644
index 00000000000..c8aa076da6d
--- /dev/null
+++ b/addons/google_calendar/static/src/img/setup_06.png
Binary files differ
diff --git a/addons/google_calendar/static/src/img/setup_07.png b/addons/google_calendar/static/src/img/setup_07.png
new file mode 100644
index 00000000000..cd1b10edd02
--- /dev/null
+++ b/addons/google_calendar/static/src/img/setup_07.png
Binary files differ
diff --git a/addons/google_calendar/static/src/img/setup_08.png b/addons/google_calendar/static/src/img/setup_08.png
new file mode 100644
index 00000000000..c66cdbb2d9c
--- /dev/null
+++ b/addons/google_calendar/static/src/img/setup_08.png
Binary files differ
diff --git a/addons/google_calendar/static/src/img/setup_09.png b/addons/google_calendar/static/src/img/setup_09.png
new file mode 100644
index 00000000000..e537775fc1c
--- /dev/null
+++ b/addons/google_calendar/static/src/img/setup_09.png
Binary files differ
diff --git a/addons/google_calendar/static/src/js/calendar_sync.js b/addons/google_calendar/static/src/js/calendar_sync.js
new file mode 100644
index 00000000000..fdc4aeffb77
--- /dev/null
+++ b/addons/google_calendar/static/src/js/calendar_sync.js
@@ -0,0 +1,59 @@
+openerp.google_calendar = function(instance) {
+ var _t = instance.web._t,
+ _lt = instance.web._lt;
+ var QWeb = instance.web.qweb;
+
+ instance.web_calendar.CalendarView.include({
+ view_loading: function(r) {
+ var self = this;
+ this.$el.on('click', 'div.oe_cal_sync_button', function() {
+ self.sync_calendar(r);
+ });
+ return this._super(r);
+ },
+ sync_calendar: function(res,button) {
+ var self = this;
+ var context = instance.web.pyeval.eval('context');
+ //$('div.oe_cal_sync_button').hide();
+ $('div.oe_cal_sync_button').prop('disabled',true);
+
+ self.rpc('/google_calendar/sync_data', {
+ arch: res.arch,
+ fields: res.fields,
+ model:res.model,
+ fromurl: window.location.href,
+ local_context:context
+ }).done(function(o) {
+ if (o.status == "need_auth") {
+ alert(_t("You will be redirected on gmail to authorize your OpenErp to access your calendar !"));
+ instance.web.redirect(o.url);
+ }
+ else if (o.status == "need_config_from_admin") {
+
+ if (!_.isUndefined(o.action) && parseInt(o.action)) {
+ if (confirm(_t("An admin need to configure Google Synchronization before to use it, do you want to configure it now ? !"))) {
+ self.do_action(o.action);
+ }
+ }
+ else {
+ alert(_t("An admin need to configure Google Synchronization before to use it !"));
+ }
+ }
+ else if (o.status == "need_refresh"){
+ self.$calendar.fullCalendar('refetchEvents');
+ }
+
+ }).always(function(o) { $('div.oe_cal_sync_button').prop('disabled',false); });
+ }
+ });
+
+ instance.web_calendar.CalendarView.include({
+ extraSideBar: function() {
+ this._super();
+ if (this.dataset.model == "calendar.event") {
+ this.$el.find('.oe_calendar_filter').prepend(QWeb.render('GoogleCalendar.buttonSynchro'));
+ }
+ }
+ });
+
+};
diff --git a/addons/google_calendar/static/src/xml/web_calendar.xml b/addons/google_calendar/static/src/xml/web_calendar.xml
new file mode 100644
index 00000000000..b9a15c17fdc
--- /dev/null
+++ b/addons/google_calendar/static/src/xml/web_calendar.xml
@@ -0,0 +1,14 @@
+<template>
+ <t t-name="GoogleCalendar.buttonSynchro">
+ <div id="sync" class="oe_cal_sync_button cal_tab " >
+ <center>
+ <br/>
+ <button class="oe_button">
+ <span>
+ <img src="/google_calendar/static/src/img/calendar_32.png"/> Sync with <b>Google</b>
+ </span>
+ </button>
+ </center>
+ </div>
+ </t>
+</template> \ No newline at end of file