From 71503bc1cec6505f155722d02f4c194ec46697a9 Mon Sep 17 00:00:00 2001
From: "Vidhin Mehta (OpenERP)"
Date: Fri, 7 Mar 2014 14:22:48 +0530
Subject: [PATCH] [IMP]Improvement in event.
bzr revid: vme@tinyerp.com-20140307085248-ohtrossx8hbdbi72
---
addons/website_event_track/__openerp__.py | 3 +-
.../website_event_track/controllers/event.py | 58 +++-
.../website_event_track/data/event_demo.xml | 106 -------
.../data/website_event_track_demo.xml | 273 ++++++++++++++++++
.../static/src/js/website_event_track.js | 13 +
.../views/website_event.xml | 118 +++-----
6 files changed, 389 insertions(+), 182 deletions(-)
create mode 100644 addons/website_event_track/data/website_event_track_demo.xml
create mode 100644 addons/website_event_track/static/src/js/website_event_track.js
diff --git a/addons/website_event_track/__openerp__.py b/addons/website_event_track/__openerp__.py
index 338477eeb8e..418e049cec9 100644
--- a/addons/website_event_track/__openerp__.py
+++ b/addons/website_event_track/__openerp__.py
@@ -28,7 +28,8 @@ Adds support for:
],
'qweb': ['static/src/xml/*.xml'],
'demo': [
- 'data/event_demo.xml'
+ 'data/event_demo.xml',
+ 'data/website_event_track_demo.xml'
],
'installable': True,
}
diff --git a/addons/website_event_track/controllers/event.py b/addons/website_event_track/controllers/event.py
index d4b7177814d..a62acbf58db 100644
--- a/addons/website_event_track/controllers/event.py
+++ b/addons/website_event_track/controllers/event.py
@@ -23,7 +23,9 @@ import openerp
from openerp.addons.web import http
from openerp.addons.web.http import request
from openerp.addons.website.controllers.main import Website as controllers
-
+import datetime
+import dateutil.parser as dparser
+from collections import OrderedDict
import re
import werkzeug.utils
@@ -40,9 +42,63 @@ class website_event(http.Controller):
# TODO: not implemented
@http.route(['/event//agenda/'], type='http', auth="public", website=True, multilang=True)
def event_agenda(self, event, tag=None, **post):
+
+ request.cr.execute('''
+ Select id, location_id, groupby_datetime, duration, name, date from (
+ Select id, location_id, to_char(date_trunc('hour',date),'mm-dd-yy hh AM') as
+ groupby_datetime, duration, name, event_id, date, count(*) as tot from event_track
+ group by event_id, duration, id, location_id, date, date_trunc('hour',date)
+ order by date, date_trunc('hour',date)
+ )
+ event_query where event_query.event_id = %s
+ group by event_query.location_id, event_query.id,
+ event_query.groupby_datetime, event_query.duration,event_query.name, event_query.date;
+ ''',(event.id,))
+
+ fetch_tracks = request.cr.fetchall()
+ unsort_tracks = {}
+ room_list = []
+ new_schedule = OrderedDict()
+ location_object = request.registry.get('event.track.location')
+
+ for track in fetch_tracks:
+ room_list.append(track[1])
+ if not unsort_tracks.has_key(track[2][:8]):
+ unsort_tracks[track[2][:8]] = {}
+ if not unsort_tracks[track[2][:8]].has_key(track[5]):
+ unsort_tracks[track[2][:8]][track[5]] = []
+ end_time = datetime.datetime.strptime(track[5], '%Y-%m-%d %H:%M:%S') + datetime.timedelta(minutes = int(track[3]))
+ new_schedule[track[0]] = {'time': track[5],'end_time': end_time}
+ unsort_tracks[track[2][:8]][track[5]].append({
+ 'id': track[0],
+ 'title': track[4],
+ 'time': track[5],
+ 'location_id': track[1],
+ 'duration':track[3],
+ 'location_id': track[1],
+ 'end_time': end_time
+ })
+ print "new schecule",new_schedule
+ #Get All Locations
+ room_list = list(set(room_list))
+ room_list.sort()
+ rooms = []
+ for room in room_list:
+ if room:rooms.append([room, location_object.browse(request.cr, openerp.SUPERUSER_ID, room).name])
+
+ sort_track = {}
+
+ for track in unsort_tracks.keys():
+ sorted_key = sorted(unsort_tracks[track].keys() ,key=lambda x: (dparser.parse(x)).strftime('%a, %d %b %Y %H:%M:%S'))
+ sort_track[track] = OrderedDict()
+ for tra in sorted_key:
+ sort_track[track][tra] = sorted(unsort_tracks[track][tra], key=lambda x: x['location_id'])
+
values = {
'event': event,
'main_object': event,
+ 'room_list': rooms,
+ 'days': sort_track,
}
return request.website.render("website_event_track.agenda", values)
diff --git a/addons/website_event_track/data/event_demo.xml b/addons/website_event_track/data/event_demo.xml
index 5bdd302649b..784d962e471 100644
--- a/addons/website_event_track/data/event_demo.xml
+++ b/addons/website_event_track/data/event_demo.xml
@@ -24,20 +24,6 @@
Round Table
-
-
- Room 1
-
-
- Room 2
-
-
- Room 3
-
-
- Room 4
-
-
@@ -83,68 +69,6 @@
-
-
- A Better Future With OpenERP eCommerce
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Apart from being an enterprise management software, OpenERP is
- used nowadays for a great variety of enterprise frontends.
-
- The talk illustrates the impact of OpenERP in areas such as the
- company website, online events management, eCommerce, online
- recruitments, social media marketing, etc.
-
-
-
-
-
-
-
-
-
- How To Drive Sales With OpenERP CRM
-
-
-
- 1
-
-
-
-
-
-
-
-
-
-
-
- Apart from being an enterprise management software, OpenERP is
- used nowadays for a great variety of enterprise frontends.
-
- The talk illustrates the impact of OpenERP in areas such as the
- company website, online events management, eCommerce, online
- recruitments, social media marketing, etc.
-
-
-
-
-
-
-
-
http://facebook.com/openerp
@@ -160,35 +84,5 @@
-
-
- Social Marketing As a Source of Leads
-
-
-
- 0
-
-
-
-
-
-
-
-
-
-
- Apart from being an enterprise management software, OpenERP is
- used nowadays for a great variety of enterprise frontends.
-
- The talk illustrates the impact of OpenERP in areas such as the
- company website, online events management, eCommerce, online
- recruitments, social media marketing, etc.
-
-
-
-
-
-
-
diff --git a/addons/website_event_track/data/website_event_track_demo.xml b/addons/website_event_track/data/website_event_track_demo.xml
new file mode 100644
index 00000000000..88f585dbc60
--- /dev/null
+++ b/addons/website_event_track/data/website_event_track_demo.xml
@@ -0,0 +1,273 @@
+
+
+
+
+ Le Foyer du lac
+
+
+ Theatre
+
+
+ Lauzelle
+
+
+ Foyer Royal
+
+
+ Biereau
+
+
+ Bruyère
+
+
+ How to develop a website module.
+
+
+
+
+
+
+
+
+ How to integrate hardware materials with the OpenERP point of sale.
+
+
+
+
+
+
+
+ How to develop real time apps, the live chat module explained.
+
+
+
+
+
+
+
+ How to develop automated tests in the OpenERP web client.
+
+
+
+
+
+
+
+ The new way to promote your modules in the Apps platform and OpenERP website.
+
+
+
+
+
+
+
+ Detailed roadmap of accounting new modules and improvements for version 8.
+
+
+
+
+
+
+
+ A technical explanation of OpenERP as a CMS and a eCommerce platform for version 8.
+
+
+
+
+
+
+
+ Discover OpenERP CRM: How to optimize your sales, from leads to sales orders.
+
+
+
+
+
+ 2
+
+
+ How to use OpenERP for your HR process: recruitment, leaves management, appraisals, expenses, etc.
+
+
+
+
+
+
+ 2
+
+
+ Raising qualitive insights with the survey app
+
+
+
+
+
+ 5
+
+
+ Discover OpenERP Point-of-Sale: Your shop ready to use in 30 minutes.
+
+
+
+
+
+
+
+ Manage your events with OpenERP, the new training modules.
+
+
+
+
+
+
+
+ Advanced reporting with Google Spreadsheets integration.
+
+
+
+
+
+
+
+ New Paypal modules (portal, handling, installments).
+
+
+
+
+
+
+
+ OpenERP Mobile for Notes, Meetings and Messages.
+
+
+
+
+
+
+
+ OpenERP as your Enterprise Social Network.
+
+
+
+
+
+
+
+ The Art of Making an OpenERP Demo.
+
+
+
+
+
+
+
+ How to build your marketing strategy for the purpose of generating leads with OpenERP.
+
+
+
+
+
+ 5
+
+
+ Advanced lead management with OpenERP: tips and tricks from the fields
+
+
+
+
+
+ 5
+
+
+ New Certification Program (valid from Oct. 2013).
+
+
+
+
+
+
+
+ Recruiting high skilled talents with OpenERP HR apps
+
+
+
+
+
+ 7
+
+
+ Manage your KPIs (recomended to openERP partners).
+
+
+
+
+
+
+
+ Key Success factors selling OpenERP.
+
+
+
+
+
+
+
+ Merge proposals review, code sprint (entire day).
+
+
+
+
+
+
+
+ Merge proposals review, code sprint (entire afternoon)
+
+
+
+
+
+
+
+ Registration & Coffee - Main entrance + Partners' Village
+
+
+
+
+
+
+ OpenERP in 2014
+
+
+
+
+
+
+ OpenERP Status & Strategy 2014
+
+
+
+
+
+
+ The new marketing strategy.
+
+
+
+
+
+
+ Morning break
+
+
+
+
+
+
+ Lunch
+
+
+
+
+
+
+
diff --git a/addons/website_event_track/static/src/js/website_event_track.js b/addons/website_event_track/static/src/js/website_event_track.js
new file mode 100644
index 00000000000..6d9179b008f
--- /dev/null
+++ b/addons/website_event_track/static/src/js/website_event_track.js
@@ -0,0 +1,13 @@
+$(document).ready(function() {
+ var search_object = {};
+ $.each($("td#seach_enable"), function(key, element){
+ var value_td = ($(element).text()).trim();
+ if(value_td)search_object[key] = [value_td.toLowerCase(), element, value_td];
+ });
+ $("#start_search").bind('keyup',function(e){
+ var change_text = ($(this).val()).toLowerCase();
+ $.each(search_object, function(key, value){
+ $(value[1]).text((value[0].indexOf(change_text) < 0)?"":value[2]);
+ });
+ });
+});
diff --git a/addons/website_event_track/views/website_event.xml b/addons/website_event_track/views/website_event.xml
index b9db5aaa2f0..d82f5b585f5 100644
--- a/addons/website_event_track/views/website_event.xml
+++ b/addons/website_event_track/views/website_event.xml
@@ -42,6 +42,10 @@
+
+
+
+
@@ -51,74 +55,46 @@
You can click on cells to highlight your interests.
-
-
-
- |
- Room 1 |
- Room 2 |
- Room 3 |
- Room 5 |
- Room 6 |
-
-
- 09:00 10:00 |
-
- Plenary Session
- Room 5
- |
-
-
- 10:00 10:30 |
- fkdsj kl jkl sdfjksdfj kl |
- Learning Python |
- |
- Learning Pytdon |
- Boost your Sales Witd OpenERP CRM |
-
-
- 10:30 11:00 |
- |
- Boost your Sales Witd OpenERP CRM |
- Learning Pytdon |
- fkdsj kl jkl sdfjksdfj kl |
-
-
- 11:00 12:00 |
- Learning Pytdon |
- Boost your Sales Witd OpenERP CRM |
- Learning Pytdon |
- this is a test |
-
-
- |
-
-
- 14:00 15:00 |
- Boost your Sales Witd OpenERP CRM |
- Learning Pytdon |
- |
- fkdsj kl jkl sdfjksdfj kl |
- fkdsj kl jkl sdfjksdfj kl |
-
- 10:00 10:30 |
- fkdsj kl jkl sdfjksdfj kl |
- Learning Python |
- |
- Learning Pytdon |
- Boost your Sales Witd OpenERP CRM |
-
-
- 10:30 11:00 |
- |
- Boost your Sales Witd OpenERP CRM |
- Learning Pytdon |
- fkdsj kl jkl sdfjksdfj kl |
-
-
+
+
+
+
+
+ |
+
+ |
+
+
+
+
+
+
+ |
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
@@ -194,12 +170,6 @@