summaryrefslogtreecommitdiff
path: root/addons/calendar/static
diff options
context:
space:
mode:
authorJérome Maes <jem@openerp.com>2016-06-17 16:26:09 +0200
committerJérome Maes <jem@openerp.com>2016-06-20 16:19:32 +0200
commitcfb8e8700a501c47a5b3c1b7c8a0e9e58e417f58 (patch)
tree510083656fd7e50212abe7085e1654997683827e /addons/calendar/static
parent3cb64f517a54c56763f1fed16fc7234194167009 (diff)
[FIX] calendar: view meeting detail when not logged
Since the new QWeb engine, `groups` directives on template rendered in a route with auth=none is simply ignored, since all is done as SUPERUSER_ID, it was impossible to instanciate the webclient to check if the session is valid and to display meeting info or redirect to event form view. It seems that we don't want to fix this because routes auth=none are rare, and special. So it is not considered as a bug. The fix for calendar is, however, to do redirection or template rendering server side.
Diffstat (limited to 'addons/calendar/static')
-rw-r--r--addons/calendar/static/src/js/base_calendar.js15
-rw-r--r--addons/calendar/static/src/xml/base_calendar.xml36
2 files changed, 1 insertions, 50 deletions
diff --git a/addons/calendar/static/src/js/base_calendar.js b/addons/calendar/static/src/js/base_calendar.js
index 954371654d4..b3f5c5df8af 100644
--- a/addons/calendar/static/src/js/base_calendar.js
+++ b/addons/calendar/static/src/js/base_calendar.js
@@ -221,7 +221,7 @@ WebClient.include({
show_application: function() {
return this._super.apply(this, arguments).then(this.check_notifications.bind(this));
},
- //Override addons/web/static/src/js/chrome.js
+ //Override addons/web/static/src/js/chrome.js
// FIXME: on_logout is no longer used
on_logout: function() {
this._super();
@@ -243,20 +243,7 @@ var Many2ManyAttendee = FieldMany2ManyTags.extend({
},
});
-function showCalendarInvitation(db, action, id, view, attendee_data) {
- session.session_bind(session.origin).then(function () {
- if (session.session_is_valid(db) && session.username !== "anonymous") {
- window.location.href = _.str.sprintf('/web?db=%s#id=%s&view_type=form&model=calendar.event', db, id);
- } else {
- $("body").prepend(QWeb.render('CalendarInvitation', {attendee_data: JSON.parse(attendee_data)}));
- }
- });
-}
-
core.form_widget_registry.add('many2manyattendee', Many2ManyAttendee);
-return {
- showCalendarInvitation: showCalendarInvitation,
-};
});
diff --git a/addons/calendar/static/src/xml/base_calendar.xml b/addons/calendar/static/src/xml/base_calendar.xml
index 0cd9022fdec..1aa2bcb8b2f 100644
--- a/addons/calendar/static/src/xml/base_calendar.xml
+++ b/addons/calendar/static/src/xml/base_calendar.xml
@@ -28,40 +28,4 @@
</t>
</t>
- <div t-name="CalendarInvitation" class="o_calendar_invitation_page">
- <div class="pull-right">
- <t t-esc="attendee_data['current_attendee'].cn"/> (<t t-esc="attendee_data['current_attendee'].email"/>)
- <div t-if="attendee_data['current_attendee'].state !== 'needsAction'" t-attf-class="o_#{attendee_data['current_attendee'].state}">
- <t t-if="attendee_data['current_attendee'].state === 'accepted'">Yes I'm going.</t>
- <t t-if="attendee_data['current_attendee'].state === 'declined'">No I'm not going.</t>
- </div>
- </div>
- <div class="pull-left o_logo">
- <img class="img img-responsive" src='/web/binary/company_logo'/>
- </div>
- <div class="o_event_title">
- <h2>Calendar Invitation</h2>
- <h3><t t-esc="attendee_data['meeting'].event"/></h3>
- </div>
- <table class="o_event_table table table-striped">
- <tr>
- <th>When</th>
- <td><t t-esc="attendee_data['meeting'].when"/></td>
- </tr>
- <tr>
- <th>Where</th>
- <td><t t-esc="attendee_data['meeting'].where or '-'"/></td>
- </tr>
- <tr>
- <th>Who</th>
- <td>
- <ul>
- <li t-foreach="attendee_data['attendee']" t-as="attendee" t-attf-class="o_#{attendee.status}">
- <t t-esc="attendee.name"/>
- </li>
- </ul>
- </td>
- </tr>
- </table>
- </div>
</template>