summaryrefslogtreecommitdiff
path: root/addons/base/static/src/js/chrome.js
diff options
context:
space:
mode:
authornoz (OpenERP) <noz@tinyerp.com>2011-07-13 14:52:42 +0530
committernoz (OpenERP) <noz@tinyerp.com>2011-07-13 14:52:42 +0530
commit59bb0fd4e637cd4100e53d24df184ad5c53ed86b (patch)
tree39467a62958231c0aa467cd324893911b8f102df /addons/base/static/src/js/chrome.js
parent673762cbee421c6a65a08c8bfb06d9aca57d405e (diff)
[FIX] Better error popup messages.
bzr revid: noz@tinyerp.com-20110713092242-0q5ii7haqfhldgtl
Diffstat (limited to 'addons/base/static/src/js/chrome.js')
-rw-r--r--addons/base/static/src/js/chrome.js95
1 files changed, 73 insertions, 22 deletions
diff --git a/addons/base/static/src/js/chrome.js b/addons/base/static/src/js/chrome.js
index db831387823..47e3de67677 100644
--- a/addons/base/static/src/js/chrome.js
+++ b/addons/base/static/src/js/chrome.js
@@ -974,18 +974,29 @@ openerp.base.Database = openerp.base.Controller.extend({
demo_data = 'False';
self.rpc("/base/session/db_operation", {
- 'flag': 'create',
- 'super_admin_pwd': super_admin_pwd,
- 'db': db,
- 'demo_data': demo_data,
- 'db_lang': db_lang,
- 'admin_pwd': admin_pwd,
- 'confirm_pwd': confirm_pwd
- },
- function(result) {
- if (result && !result.error) {
-
- }
+ 'flag': 'create',
+ 'super_admin_pwd': super_admin_pwd,
+ 'db': db,
+ 'demo_data': demo_data,
+ 'db_lang': db_lang,
+ 'admin_pwd': admin_pwd,
+ 'confirm_pwd': confirm_pwd
+ },
+ function(result) {
+ if (result && !result.error) {
+
+ } else if(result.error) {
+ var db_error_dialog = _.uniqueId("db_error_dialog");
+ $('<div>', {id: db_error_dialog}).dialog({
+ modal: true,
+ title: "Create Database",
+ buttons: {
+ Ok: function() {
+ $(this).dialog("close");
+ }
+ }
+ }).html("<center style='padding-top: 15px; font-size: 15px'>" + result.error + "</center>");
+ }
});
});
},
@@ -1005,12 +1016,23 @@ openerp.base.Database = openerp.base.Controller.extend({
if (confirm("Do you really want to delete the database: " + db + " ?")) {
self.rpc("/base/session/db_operation", {'flag': 'drop', 'db': db, 'password': password},
- function(result) {
- if (result && !result.error) {
- self.$option_id.find("select[name=drop_db] :selected").remove();
- self.notification.notify("Dropping database", "The database '" + db + "' has been dropped");
- }
- });
+ function(result) {
+ if (result && ! result.error) {
+ self.$option_id.find("select[name=drop_db] :selected").remove();
+ self.notification.notify("Dropping database", "The database '" + db + "' has been dropped");
+ } else if(result.error) {
+ var db_error_dialog = _.uniqueId("db_error_dialog");
+ $('<div>', {id: db_error_dialog}).dialog({
+ modal: true,
+ title: "Drop Database",
+ buttons: {
+ Ok: function() {
+ $(this).dialog("close");
+ }
+ }
+ }).html("<center style='padding-top: 15px; font-size: 15px'>" + result.error + "</center>");
+ }
+ });
}
});
},
@@ -1032,8 +1054,17 @@ openerp.base.Database = openerp.base.Controller.extend({
function(result) {
if (result && !result.error) {
self.notification.notify("Backup Database", "Backup has been created for the database: '" + db + "'");
- } else if (result.error) {
- self.notification.notify("Backup Database", result.error);
+ } else if(result.error) {
+ var db_error_dialog = _.uniqueId("db_error_dialog");
+ $('<div>', {id: db_error_dialog}).dialog({
+ modal: true,
+ title: "Backup Database",
+ buttons: {
+ Ok: function() {
+ $(this).dialog("close");
+ }
+ }
+ }).html("<center style='padding-top: 15px; font-size: 15px'>" + result.error + "</center>");
}
});
});
@@ -1057,8 +1088,17 @@ openerp.base.Database = openerp.base.Controller.extend({
function(result) {
if (result && !result.error) {
self.notification.notify("Restore Database", "You restored your database as: '" + new_db + "'");
- } else if (result.error) {
- self.notification.notify("Restore Database", result.error);
+ } else if(result.error) {
+ var db_error_dialog = _.uniqueId("db_error_dialog");
+ $('<div>', {id: db_error_dialog}).dialog({
+ modal: true,
+ title: "Restore Database",
+ buttons: {
+ Ok: function() {
+ $(this).dialog("close");
+ }
+ }
+ }).html("<center style='padding-top: 15px; font-size: 15px'>" + result.error + "</center>");
}
});
});
@@ -1103,6 +1143,17 @@ openerp.base.Database = openerp.base.Controller.extend({
function(result) {
if (result && !result.error) {
self.notification.notify("Changed Password", "Password has been changed successfully");
+ } else if(result.error) {
+ var db_error_dialog = _.uniqueId("db_error_dialog");
+ $('<div>', {id: db_error_dialog}).dialog({
+ modal: true,
+ title: "Change Password",
+ buttons: {
+ Ok: function() {
+ $(this).dialog("close");
+ }
+ }
+ }).html("<center style='padding-top: 15px; font-size: 15px'>" + result.error + "</center>");
}
});
});