diff --git a/apps/documenteditor/main/app/view/RolesManagerDlg.js b/apps/documenteditor/main/app/view/RolesManagerDlg.js
index cf17c20309..6d7f208659 100644
--- a/apps/documenteditor/main/app/view/RolesManagerDlg.js
+++ b/apps/documenteditor/main/app/view/RolesManagerDlg.js
@@ -250,23 +250,15 @@ define([ 'text!documenteditor/main/app/template/RolesManagerDlg.template',
if (!rec) return;
- if (store.length===1 && rec.get('fields')>0) {
- Common.UI.warning({
- msg: me.warnCantDelete,
- buttons: ['ok']
- });
- return;
- }
-
var callback = function(toRole) {
me.lastSelectedRole = store.indexOf(rec);
me.oformManager.asc_removeRole(rec.get('name'), toRole); // remove role and move it's fields
};
- if (rec.get('fields')<1) {
+ if (store.length===1 || rec.get('fields')<1) {
me._isWarningVisible = true;
Common.UI.warning({
- msg: Common.Utils.String.format(me.warnDelete, rec.get('name')),
+ msg: Common.Utils.String.format(store.length===1 ? me.textDeleteLast : me.warnDelete, rec.get('name')),
buttons: ['ok', 'cancel'],
callback: function(btn) {
if (btn == 'ok') {
@@ -366,7 +358,8 @@ define([ 'text!documenteditor/main/app/template/RolesManagerDlg.template',
textUp: 'Move role up',
textDown: 'Move role down',
textDescription: 'Add roles and set the order in which the fillers receive and sign the document',
- textAnyone: 'Anyone'
+ textAnyone: 'Anyone',
+ textDeleteLast: 'Are you sure you want to delete the role {0}?
Once deleted, the default role will be created.'
}, DE.Views.RolesManagerDlg || {}));
});
\ No newline at end of file
diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json
index 7d04b015bb..688d66a63a 100644
--- a/apps/documenteditor/main/locale/en.json
+++ b/apps/documenteditor/main/locale/en.json
@@ -2698,6 +2698,7 @@
"DE.Views.RolesManagerDlg.txtTitle": "Manage Roles",
"DE.Views.RolesManagerDlg.warnCantDelete": "You cannot delete this role because it has associated fields.",
"DE.Views.RolesManagerDlg.warnDelete": "Are you sure you want to delete the role {0}?",
+ "DE.Views.RolesManagerDlg.textDeleteLast": "Are you sure you want to delete the role {0}?
Once deleted, the default role will be created.",
"DE.Views.SaveFormDlg.saveButtonText": "Save",
"DE.Views.SaveFormDlg.textAnyone": "Anyone",
"DE.Views.SaveFormDlg.textDescription": "When saving to the oform, only roles with fields are added to the filling list",