var result = element.dialog.apply(element, _.rest(_.toArray(arguments)));
result.dialog("widget").addClass("openerp");
return result;
-}
+};
instance.web.Dialog = instance.web.Widget.extend({
dialog_title: "",
}
},
on_managed_error: function(error) {
- instance.web.dialog($('<div>' + QWeb.render('CrashManager.warning', {error: error}) + '</div>'), {
+ instance.web.dialog($('<div>' + QWeb.render('CrashManager.warning', {error: error}) + '</div>'), {
title: "OpenERP " + _.str.capitalize(error.type),
buttons: [
{text: _t("Ok"), click: function() { $(this).dialog("close"); }}
// Call the send method from server to send mail with details
new instance.web.DataSet(self, 'publisher_warranty.contract').call_and_eval('send', [error.data,explanation,remark,issuename]).then(function(result){
if (result === false) {
- alert('There was a communication error.')
+ alert('There was a communication error.');
} else {
$this.dialog('close');
}
start: function() {
var self = this;
var fetch_db = this.rpc("/web/database/get_list", {}).pipe(
- function(result) {
- self.db_list = result.db_list;
+ function(result) {
+ self.db_list = result.db_list;
},
- function (_, ev) {
+ function (_, ev) {
ev.preventDefault();
- self.db_list = null;
+ self.db_list = null;
});
var fetch_langs = this.rpc("/web/session/get_lang_list", {}).then(function(result) {
self.lang_list = result.lang_list;
self.$element.html(QWeb.render("DatabaseManager", { widget : self }));
self.$element.find(".oe_database_manager_menu").tabs();
self.$element.find("form[name=create_db_form]").validate({ submitHandler: self.do_create });
- self.$element.find("form[name=drop_db_form]").validate({ submitHandler: self.do_drop });
- self.$element.find("form[name=backup_db_form]").validate({ submitHandler: self.do_backup });
- self.$element.find("form[name=restore_db_form]").validate({ submitHandler: self.do_restore });
+ self.$element.find("form[name=drop_db_form]").validate({ submitHandler: self.do_drop });
+ self.$element.find("form[name=backup_db_form]").validate({ submitHandler: self.do_backup });
+ self.$element.find("form[name=restore_db_form]").validate({ submitHandler: self.do_restore });
self.$element.find("form[name=change_pwd_form]").validate({
messages: {
old_pwd: "Please enter your previous password",
},
submitHandler: self.do_change_password
});
- self.$element.find("#back_to_login").click(self.do_exit);
+ self.$element.find("#back_to_login").click(self.do_exit);
},
destroy: function () {
this.$element.find('#db-create, #db-drop, #db-backup, #db-restore, #db-change-password, #back-to-login').unbind('click').end().empty();
self.display_error({
title: 'Access Denied',
error: 'Incorrect super-administrator password'
- })
+ });
} else {
self.display_error({
title: 'Restore Database',
error: 'Could not restore the database'
- })
+ });
}
},
complete: function() {
if (this.has_local_storage && this.remember_credentials) {
this.selected_db = localStorage.getItem('last_db_login_success');
this.selected_login = localStorage.getItem('last_login_login_success');
- if (jQuery.deparam(jQuery.param.querystring()).debug != undefined) {
+ if (jQuery.deparam(jQuery.param.querystring()).debug !== undefined) {
this.selected_password = localStorage.getItem('last_password_login_success');
}
}
self.$element.find('.oe_login_bottom').show();
self.$element.find('.oe_login_pane').show();
self.load_db_list();
- })
+ });
});
self.load_db_list();
},
});
},
set_db_list: function (list) {
- this.$element.find("[name=db]").replaceWith(instance.web.qweb.render('Login.dblist', { db_list: list, selected_db: this.selected_db}))
+ this.$element.find("[name=db]").replaceWith(instance.web.qweb.render('Login.dblist', { db_list: list, selected_db: this.selected_db}));
},
on_submit: function(ev) {
if(ev) {
if(self.remember_credentials) {
localStorage.setItem('last_db_login_success', db);
localStorage.setItem('last_login_login_success', login);
- if (jQuery.deparam(jQuery.param.querystring()).debug != undefined) {
+ if (jQuery.deparam(jQuery.param.querystring()).debug !== undefined) {
localStorage.setItem('last_password_login_success', password);
}
} else {
* @param {Number} id the action_id to match
*/
open_action: function (id) {
- var menu_id, $menu = this.$element.add(this.$secondary_menus).find('a[data-action-id=' + id + ']');
- if (menu_id = $menu.data('menu')) {
+ var $menu = this.$element.add(this.$secondary_menus).find('a[data-action-id=' + id + ']');
+ var menu_id = $menu.data('menu');
+ if (menu_id) {
this.open_menu(menu_id);
}
},
action_id = $items.data('action-id');
id = $items.data('menu');
}
- }
+ }
}
this.open_menu(id);
this.current_menu = id;
});
this.$element.on('click', '.oe_dropdown_options li a[data-menu]', function() {
var f = self['on_menu_' + $(this).data('menu')];
- f && f($(this));
+ if (f) {
+ f($(this));
+ }
self.$element.find('.oe_dropdown_options').hide();
return false;
});
start: function() {
var self = this;
this.$element.addClass("openerp openerp-web-client-container");
- if (jQuery.param != undefined && jQuery.deparam(jQuery.param.querystring()).kitten != undefined) {
+ if (jQuery.param !== undefined && jQuery.deparam(jQuery.param.querystring()).kitten !== undefined) {
this.$element.addClass("kitten-mode-activated");
this.$element.delegate('img.oe-record-edit-link-img', 'hover', function(e) {
self.$element.toggleClass('clark-gable');
message: message,
data: {debug: file + ':' + line}
});
- }
+ };
}
this.notification = new instance.web.Notification(this);
this.notification.appendTo(this.$element);
},
do_action: function(action) {
var self = this;
- // TODO replace by client action menuclick
+ // TODO replace by client action menuclick
if(action.menu_id) {
this.do_reload().then(function () {
self.menu.menu_click(action.menu_id);
template: 'EmptyComponent',
init: function(parent, action_id, options) {
this._super(parent);
- // TODO take the xmlid of a action instead of its id
+ // TODO take the xmlid of a action instead of its id
this.action_id = action_id;
this.options = options || {};
this.am = new instance.web.ActionManager(this);
});
});
-}
+};
};