diff --git a/addons/im_livechat/__init__.py b/addons/im_livechat/__init__.py new file mode 100644 index 00000000000..2825a75179c --- /dev/null +++ b/addons/im_livechat/__init__.py @@ -0,0 +1,2 @@ + +import im_livechat diff --git a/addons/live_support/__openerp__.py b/addons/im_livechat/__openerp__.py similarity index 77% rename from addons/live_support/__openerp__.py rename to addons/im_livechat/__openerp__.py index 19349e30fa3..8b9ea3924d5 100644 --- a/addons/live_support/__openerp__.py +++ b/addons/im_livechat/__openerp__.py @@ -15,14 +15,14 @@ chat operators. """, 'data': [ - "security/live_support_security.xml", + "security/im_livechat_security.xml", "security/ir.model.access.csv", - "live_support_view.xml", + "im_livechat_view.xml", ], 'demo': [ - "live_support_demo.xml", + "im_livechat_demo.xml", ], - 'depends' : ["web_im", "mail", "portal_anonymous"], + 'depends' : ["im", "mail", "portal_anonymous"], 'installable': True, 'auto_install': False, 'application': True, diff --git a/addons/live_support/live_support.py b/addons/im_livechat/im_livechat.py similarity index 90% rename from addons/live_support/live_support.py rename to addons/im_livechat/im_livechat.py index 652d40d1d65..73b7f97c158 100644 --- a/addons/live_support/live_support.py +++ b/addons/im_livechat/im_livechat.py @@ -20,7 +20,7 @@ ############################################################################## import openerp -import openerp.addons.web_im.im as im +import openerp.addons.im.im as im import json import random import jinja2 @@ -28,13 +28,13 @@ from openerp.osv import osv, fields from openerp import tools env = jinja2.Environment( - loader=jinja2.PackageLoader('openerp.addons.live_support', "."), + loader=jinja2.PackageLoader('openerp.addons.im_livechat', "."), autoescape=False ) env.filters["json"] = json.dumps class ImportController(openerp.addons.web.http.Controller): - _cp_path = '/live_support' + _cp_path = '/im_livechat' @openerp.addons.web.http.httprequest def loader(self, req, **kwargs): @@ -46,7 +46,7 @@ class ImportController(openerp.addons.web.http.Controller): req.session._uid = None req.session._login = "anonymous" req.session._password = "anonymous" - info = req.session.model('live_support.channel').get_info_for_chat_src(channel) + info = req.session.model('im_livechat.channel').get_info_for_chat_src(channel) info["db"] = db info["channel"] = channel info["userName"] = user_name @@ -62,8 +62,8 @@ class ImportController(openerp.addons.web.http.Controller): req.session._uid = None req.session._login = "anonymous" req.session._password = "anonymous" - script = req.session.model('live_support.channel').read(channel, ["script"])["script"] - info = req.session.model('live_support.channel').get_info_for_chat_src(channel) + script = req.session.model('im_livechat.channel').read(channel, ["script"])["script"] + info = req.session.model('im_livechat.channel').get_info_for_chat_src(channel) info["script"] = script return req.make_response(env.get_template("web_page.html").render(info), headers=[('Content-Type', "text/html")]) @@ -74,13 +74,13 @@ class ImportController(openerp.addons.web.http.Controller): req.session._uid = None req.session._login = "anonymous" req.session._password = "anonymous" - return req.session.model('live_support.channel').get_available_user(channel) > 0 + return req.session.model('im_livechat.channel').get_available_user(channel) > 0 -class live_support_channel(osv.osv): - _name = 'live_support.channel' +class im_livechat_channel(osv.osv): + _name = 'im_livechat.channel' def _get_default_image(self, cr, uid, context=None): - image_path = openerp.modules.get_module_resource('live_support', 'static/src/img', 'default.png') + image_path = openerp.modules.get_module_resource('im_livechat', 'static/src/img', 'default.png') return tools.image_resize_image_big(open(image_path, 'rb').read().encode('base64')) def _get_image(self, cr, uid, ids, name, args, context=None): result = dict.fromkeys(ids, False) @@ -114,12 +114,12 @@ class live_support_channel(osv.osv): res = {} for record in self.browse(cr, uid, ids, context=context): res[record.id] = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url') + \ - "/live_support/web_page?p=" + json.dumps({"db":cr.dbname, "channel":record.id}) + "/im_livechat/web_page?p=" + json.dumps({"db":cr.dbname, "channel":record.id}) return res _columns = { 'name': fields.char(string="Channel Name", size=200, required=True), - 'user_ids': fields.many2many('res.users', 'live_support_channel_im_user', 'channel_id', 'user_id', string="Users"), + 'user_ids': fields.many2many('res.users', 'im_livechat_channel_im_user', 'channel_id', 'user_id', string="Users"), 'are_you_inside': fields.function(_are_you_inside, type='boolean', string='Are you inside the matrix?', store=False), 'script': fields.function(_script, type='text', string='Script', store=False), 'web_page': fields.function(_web_page, type='url', string='Web Page', store=False, size="200"), @@ -132,7 +132,7 @@ class live_support_channel(osv.osv): 'image_medium': fields.function(_get_image, fnct_inv=_set_image, string="Medium-sized photo", type="binary", multi="_get_image", store={ - 'live_support.channel': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10), + 'im_livechat.channel': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10), }, help="Medium-sized photo of the group. It is automatically "\ "resized as a 128x128px image, with aspect ratio preserved. "\ @@ -140,7 +140,7 @@ class live_support_channel(osv.osv): 'image_small': fields.function(_get_image, fnct_inv=_set_image, string="Small-sized photo", type="binary", multi="_get_image", store={ - 'live_support.channel': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10), + 'im_livechat.channel': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10), }, help="Small-sized photo of the group. It is automatically "\ "resized as a 64x64px image, with aspect ratio preserved. "\ diff --git a/addons/live_support/live_support_demo.xml b/addons/im_livechat/im_livechat_demo.xml similarity index 70% rename from addons/live_support/live_support_demo.xml rename to addons/im_livechat/im_livechat_demo.xml index 2e4b87286c9..f199179fb50 100644 --- a/addons/live_support/live_support_demo.xml +++ b/addons/im_livechat/im_livechat_demo.xml @@ -2,12 +2,12 @@ - + YourWebsite.com Hello, how may I help you? - + diff --git a/addons/live_support/live_support_view.xml b/addons/im_livechat/im_livechat_view.xml similarity index 91% rename from addons/live_support/live_support_view.xml rename to addons/im_livechat/im_livechat_view.xml index 48242764fd9..f684fd561fc 100644 --- a/addons/live_support/live_support_view.xml +++ b/addons/im_livechat/im_livechat_view.xml @@ -1,11 +1,11 @@ - + Live Chat Channels - live_support.channel + im_livechat.channel kanban,form

@@ -20,12 +20,12 @@

- + support_channel.kanban - live_support.channel + im_livechat.channel @@ -35,7 +35,7 @@
- +

@@ -58,7 +58,7 @@ support_channel.form - live_support.channel + im_livechat.channel
@@ -126,7 +126,7 @@ list ["|", ('to_id.user', '=', None), ('from_id.user', '=', None)] - + im.message.tree diff --git a/addons/im_livechat/include.html b/addons/im_livechat/include.html new file mode 100644 index 00000000000..55de6212361 --- /dev/null +++ b/addons/im_livechat/include.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/addons/live_support/loader.js b/addons/im_livechat/loader.js similarity index 84% rename from addons/live_support/loader.js rename to addons/im_livechat/loader.js index 44b34e9f80a..669591b410f 100644 --- a/addons/live_support/loader.js +++ b/addons/im_livechat/loader.js @@ -1,7 +1,7 @@ require.config({ context: "oelivesupport", - baseUrl: {{url | json}} + "/live_support/static/ext/static/js", + baseUrl: {{url | json}} + "/im_livechat/static/ext/static/js", shim: { underscore: { init: function() { @@ -18,7 +18,7 @@ require.config({ buttonText: {{buttonText | json}}, inputPlaceholder: {{inputPlaceholder | json}}, defaultMessage: {{(defaultMessage or None) | json}}, - auto: window.oe_live_support_auto || false, + auto: window.oe_im_livechat_auto || false, userName: {{userName | json}} || undefined, }); }); diff --git a/addons/live_support/security/live_support_security.xml b/addons/im_livechat/security/im_livechat_security.xml similarity index 62% rename from addons/live_support/security/live_support_security.xml rename to addons/im_livechat/security/im_livechat_security.xml index 7e5bc895010..5ad020a8a78 100644 --- a/addons/live_support/security/live_support_security.xml +++ b/addons/im_livechat/security/im_livechat_security.xml @@ -2,29 +2,29 @@ - + Live Support - + User - + The user will be able to join support channels. - + Manager The user will be able to delete support channels. - - + + Live Support Managers can read messages from live support - - + + ["|", ('to_id.user', '=', None), ('from_id.user', '=', None)] diff --git a/addons/im_livechat/security/ir.model.access.csv b/addons/im_livechat/security/ir.model.access.csv new file mode 100644 index 00000000000..6e17c1a127f --- /dev/null +++ b/addons/im_livechat/security/ir.model.access.csv @@ -0,0 +1,6 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_ls_chann1,im_livechat.channel,model_im_livechat_channel,,1,0,0,0 +access_ls_chann2,im_livechat.channel,model_im_livechat_channel,group_im_livechat,1,1,1,0 +access_ls_chann3,im_livechat.channel,model_im_livechat_channel,group_im_livechat_manager,1,1,1,1 +access_ls_message,im_livechat.im.message,im.model_im_message,portal.group_anonymous,0,0,0,0 +access_im_user,im_livechat.im.user,im.model_im_user,portal.group_anonymous,1,0,0,0 \ No newline at end of file diff --git a/addons/live_support/static/ext/Makefile b/addons/im_livechat/static/ext/Makefile similarity index 100% rename from addons/live_support/static/ext/Makefile rename to addons/im_livechat/static/ext/Makefile diff --git a/addons/live_support/static/ext/static/audio/Ting.mp3 b/addons/im_livechat/static/ext/static/audio/Ting.mp3 similarity index 100% rename from addons/live_support/static/ext/static/audio/Ting.mp3 rename to addons/im_livechat/static/ext/static/audio/Ting.mp3 diff --git a/addons/live_support/static/ext/static/audio/Ting.ogg b/addons/im_livechat/static/ext/static/audio/Ting.ogg similarity index 100% rename from addons/live_support/static/ext/static/audio/Ting.ogg rename to addons/im_livechat/static/ext/static/audio/Ting.ogg diff --git a/addons/live_support/static/ext/static/css/livesupport.css b/addons/im_livechat/static/ext/static/css/livesupport.css similarity index 100% rename from addons/live_support/static/ext/static/css/livesupport.css rename to addons/im_livechat/static/ext/static/css/livesupport.css diff --git a/addons/live_support/static/ext/static/img/avatar/avatar.jpeg b/addons/im_livechat/static/ext/static/img/avatar/avatar.jpeg similarity index 100% rename from addons/live_support/static/ext/static/img/avatar/avatar.jpeg rename to addons/im_livechat/static/ext/static/img/avatar/avatar.jpeg diff --git a/addons/live_support/static/ext/static/img/button-gloss.png b/addons/im_livechat/static/ext/static/img/button-gloss.png similarity index 100% rename from addons/live_support/static/ext/static/img/button-gloss.png rename to addons/im_livechat/static/ext/static/img/button-gloss.png diff --git a/addons/live_support/static/ext/static/img/glyphicons-halflings-white.png b/addons/im_livechat/static/ext/static/img/glyphicons-halflings-white.png similarity index 100% rename from addons/live_support/static/ext/static/img/glyphicons-halflings-white.png rename to addons/im_livechat/static/ext/static/img/glyphicons-halflings-white.png diff --git a/addons/live_support/static/ext/static/img/glyphicons-halflings.png b/addons/im_livechat/static/ext/static/img/glyphicons-halflings.png similarity index 100% rename from addons/live_support/static/ext/static/img/glyphicons-halflings.png rename to addons/im_livechat/static/ext/static/img/glyphicons-halflings.png diff --git a/addons/live_support/static/ext/static/img/green.png b/addons/im_livechat/static/ext/static/img/green.png similarity index 100% rename from addons/live_support/static/ext/static/img/green.png rename to addons/im_livechat/static/ext/static/img/green.png diff --git a/addons/live_support/static/ext/static/img/logo.png b/addons/im_livechat/static/ext/static/img/logo.png similarity index 100% rename from addons/live_support/static/ext/static/img/logo.png rename to addons/im_livechat/static/ext/static/img/logo.png diff --git a/addons/live_support/static/ext/static/img/wood.png b/addons/im_livechat/static/ext/static/img/wood.png similarity index 100% rename from addons/live_support/static/ext/static/img/wood.png rename to addons/im_livechat/static/ext/static/img/wood.png diff --git a/addons/live_support/static/ext/static/js/jquery.achtung.css b/addons/im_livechat/static/ext/static/js/jquery.achtung.css similarity index 100% rename from addons/live_support/static/ext/static/js/jquery.achtung.css rename to addons/im_livechat/static/ext/static/js/jquery.achtung.css diff --git a/addons/live_support/static/ext/static/js/jquery.achtung.js b/addons/im_livechat/static/ext/static/js/jquery.achtung.js similarity index 100% rename from addons/live_support/static/ext/static/js/jquery.achtung.js rename to addons/im_livechat/static/ext/static/js/jquery.achtung.js diff --git a/addons/live_support/static/ext/static/js/jquery.js b/addons/im_livechat/static/ext/static/js/jquery.js similarity index 100% rename from addons/live_support/static/ext/static/js/jquery.js rename to addons/im_livechat/static/ext/static/js/jquery.js diff --git a/addons/live_support/static/ext/static/js/livesupport.js b/addons/im_livechat/static/ext/static/js/livesupport.js similarity index 98% rename from addons/live_support/static/ext/static/js/livesupport.js rename to addons/im_livechat/static/ext/static/js/livesupport.js index 185e769de28..0b9e52d2c07 100644 --- a/addons/live_support/static/ext/static/js/livesupport.js +++ b/addons/im_livechat/static/ext/static/js/livesupport.js @@ -37,7 +37,7 @@ define(["nova", "underscore", "oeclient", "require", "jquery", $.when.apply($, defs).then(function() { console.log("starting live support customer app"); connection = new oeclient.Connection(new oeclient.JsonpRPCConnector(server_url), db, login, password); - connection.connector.call("/live_support/available", {db: db, channel: channel}).then(function(activated) { + connection.connector.call("/im_livechat/available", {db: db, channel: channel}).then(function(activated) { if (! activated & ! options.auto) return; var button = new livesupport.ChatButton(null, channel, options); @@ -99,7 +99,7 @@ define(["nova", "underscore", "oeclient", "require", "jquery", var self = this; if (this.manager.conversations.length > 0) return; - connection.getModel("live_support.channel").call("get_available_user", [this.channel]).then(function(user_id) { + connection.getModel("im_livechat.channel").call("get_available_user", [this.channel]).then(function(user_id) { if (! user_id) { notification("None of our collaborators seems to be available, please try again later."); return; diff --git a/addons/live_support/static/ext/static/js/livesupport_templates.html b/addons/im_livechat/static/ext/static/js/livesupport_templates.html similarity index 100% rename from addons/live_support/static/ext/static/js/livesupport_templates.html rename to addons/im_livechat/static/ext/static/js/livesupport_templates.html diff --git a/addons/live_support/static/ext/static/js/livesupport_templates.js b/addons/im_livechat/static/ext/static/js/livesupport_templates.js similarity index 100% rename from addons/live_support/static/ext/static/js/livesupport_templates.js rename to addons/im_livechat/static/ext/static/js/livesupport_templates.js diff --git a/addons/live_support/static/ext/static/js/nova.js b/addons/im_livechat/static/ext/static/js/nova.js similarity index 100% rename from addons/live_support/static/ext/static/js/nova.js rename to addons/im_livechat/static/ext/static/js/nova.js diff --git a/addons/live_support/static/ext/static/js/oeclient.js b/addons/im_livechat/static/ext/static/js/oeclient.js similarity index 100% rename from addons/live_support/static/ext/static/js/oeclient.js rename to addons/im_livechat/static/ext/static/js/oeclient.js diff --git a/addons/live_support/static/ext/static/js/require.js b/addons/im_livechat/static/ext/static/js/require.js similarity index 100% rename from addons/live_support/static/ext/static/js/require.js rename to addons/im_livechat/static/ext/static/js/require.js diff --git a/addons/live_support/static/ext/static/js/to_jsonp.py b/addons/im_livechat/static/ext/static/js/to_jsonp.py similarity index 100% rename from addons/live_support/static/ext/static/js/to_jsonp.py rename to addons/im_livechat/static/ext/static/js/to_jsonp.py diff --git a/addons/live_support/static/ext/static/js/underscore.js b/addons/im_livechat/static/ext/static/js/underscore.js similarity index 100% rename from addons/live_support/static/ext/static/js/underscore.js rename to addons/im_livechat/static/ext/static/js/underscore.js diff --git a/addons/im_livechat/static/ext/test.html b/addons/im_livechat/static/ext/test.html new file mode 100644 index 00000000000..c6047ded77d --- /dev/null +++ b/addons/im_livechat/static/ext/test.html @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/addons/live_support/static/src/img/default.png b/addons/im_livechat/static/src/img/default.png similarity index 100% rename from addons/live_support/static/src/img/default.png rename to addons/im_livechat/static/src/img/default.png diff --git a/addons/live_support/static/src/img/icon.png b/addons/im_livechat/static/src/img/icon.png similarity index 100% rename from addons/live_support/static/src/img/icon.png rename to addons/im_livechat/static/src/img/icon.png diff --git a/addons/live_support/web_page.html b/addons/im_livechat/web_page.html similarity index 97% rename from addons/live_support/web_page.html rename to addons/im_livechat/web_page.html index a06b25ba051..2e1ea609126 100644 --- a/addons/live_support/web_page.html +++ b/addons/im_livechat/web_page.html @@ -2,7 +2,7 @@ {{script}}