diff options
| author | Arnaud Pineux <api@openerp.com> | 2012-11-16 09:50:42 +0100 |
|---|---|---|
| committer | Arnaud Pineux <api@openerp.com> | 2012-11-16 09:50:42 +0100 |
| commit | dc3f98308d1fb9bca54dcc2d0dd0e4d7f66ca5aa (patch) | |
| tree | 082c6c0cca740c774b6b24dc040222e4ec39e948 /addons/web_linkedin/static/src | |
| parent | 74a18de6cb6e4731cc75a53f1f3d06849dbadad7 (diff) | |
| parent | 3c8626efbbe8b4d60154d0b9660cc9c0c0373e0b (diff) | |
[FIX] audittrail
lp bug: https://launchpad.net/bugs/1055813 fixed
bzr revid: api@openerp.com-20121116085042-v8q78tof9jyuec07
Diffstat (limited to 'addons/web_linkedin/static/src')
| -rw-r--r-- | addons/web_linkedin/static/src/js/linkedin.js | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/addons/web_linkedin/static/src/js/linkedin.js b/addons/web_linkedin/static/src/js/linkedin.js index 863e51e913f..d6237e48d51 100644 --- a/addons/web_linkedin/static/src/js/linkedin.js +++ b/addons/web_linkedin/static/src/js/linkedin.js @@ -14,13 +14,13 @@ openerp.web_linkedin = function(instance) { }, test_linkedin: function() { var self = this; - return this.test_api_key().pipe(function() { + return this.test_api_key().then(function() { if (self.linkedin_added) return self.linkedin_def.promise(); var tag = document.createElement('script'); tag.type = 'text/javascript'; tag.src = "http://platform.linkedin.com/in.js"; - tag.innerHTML = 'api_key : ' + self.api_key + '\nauthorize : true'; + tag.innerHTML = 'api_key : ' + self.api_key + '\nauthorize : true\nscope: r_network r_contactinfo'; document.getElementsByTagName('head')[0].appendChild(tag); self.linkedin_added = true; $(tag).load(function() { @@ -37,7 +37,7 @@ openerp.web_linkedin = function(instance) { if (this.api_key) { return $.when(); } - return new instance.web.Model("ir.config_parameter").call("get_param", ["web.linkedin.apikey"]).pipe(function(a) { + return new instance.web.Model("ir.config_parameter").call("get_param", ["web.linkedin.apikey"]).then(function(a) { if (!!a) { self.api_key = a; return true; @@ -69,13 +69,13 @@ openerp.web_linkedin = function(instance) { }, search_linkedin: function() { var self = this; - this.display_dm.add(instance.web_linkedin.tester.test_linkedin()).then(function() { + this.display_dm.add(instance.web_linkedin.tester.test_linkedin()).done(function() { var pop = new instance.web_linkedin.LinkedinPopup(self, self.get("value")); pop.open(); pop.on("selected", this, function(entity) { self.selected_entity(entity); }); - }, _.bind(this.linkedin_disabled, this)); + }).fail(_.bind(this.linkedin_disabled, this)); }, linkedin_disabled: function() { instance.web.dialog($(QWeb.render("LinkedIn.DisabledWarning")), { @@ -87,7 +87,7 @@ openerp.web_linkedin = function(instance) { }, selected_entity: function(entity) { var self = this; - this.create_on_change(entity).then(function(to_change) { + this.create_on_change(entity).done(function(to_change) { self.view.set_values(to_change); }); }, @@ -101,13 +101,13 @@ openerp.web_linkedin = function(instance) { to_change.image = false; if (entity.logoUrl) { defs.push(self.rpc('/web_linkedin/binary/url2binary', - {'url': entity.logoUrl}).pipe(function(data){ + {'url': entity.logoUrl}).then(function(data){ to_change.image = data; })); } to_change.website = entity.websiteUrl; to_change.phone = false; - _.each(entity.locations.values || [], function(el) { + _.each((entity.locations || {}).values || [], function(el) { to_change.phone = el.contactInfo.phone1; }); var children_def = $.Deferred(); @@ -120,7 +120,7 @@ openerp.web_linkedin = function(instance) { }).error(function() { children_def.reject(); }); - defs.push(children_def.pipe(function(result) { + defs.push(children_def.then(function(result) { result = _.reject(result.people.values || [], function(el) { return ! el.formattedName; }); @@ -128,7 +128,7 @@ openerp.web_linkedin = function(instance) { el.__type = "people"; return self.create_on_change(el); }); - return $.when.apply($, defs).pipe(function() { + return $.when.apply($, defs).then(function() { var p_to_change = _.toArray(arguments); to_change.child_ids = p_to_change; }); @@ -144,7 +144,7 @@ openerp.web_linkedin = function(instance) { to_change.image = false; if (entity.pictureUrl) { defs.push(self.rpc('/web_linkedin/binary/url2binary', - {'url': entity.pictureUrl}).pipe(function(data){ + {'url': entity.pictureUrl}).then(function(data){ to_change.image = data; })); } @@ -163,7 +163,7 @@ openerp.web_linkedin = function(instance) { to_change.linkedinUrl = entity.publicProfileUrl; */ } - return $.when.apply($, defs).pipe(function() { + return $.when.apply($, defs).then(function() { return to_change; }); }, @@ -186,7 +186,7 @@ openerp.web_linkedin = function(instance) { this._super(); var self = this; this.on("authentified", this, this.authentified); - instance.web_linkedin.tester.test_authentication().then(function() { + instance.web_linkedin.tester.test_authentication().done(function() { self.trigger("authentified"); }); }, @@ -200,7 +200,7 @@ openerp.web_linkedin = function(instance) { encodeURI(this.text), this.limit)).result(function (result) { cdef.resolve(result); }); - var def = cdef.pipe(function(companies) { + var def = cdef.then(function(companies) { var lst = companies.companies.values || []; lst = _.first(lst, self.limit); lst = _.map(lst, function(el) { @@ -214,7 +214,7 @@ openerp.web_linkedin = function(instance) { params({"keywords": this.text, "count": this.limit}).result(function(result) { pdef.resolve(result); }); - var def2 = pdef.pipe(function(people) { + var def2 = pdef.then(function(people) { var plst = people.people.values || []; plst = _.first(plst, self.limit); plst = _.map(plst, function(el) { |
