[DE] Delete last role
This commit is contained in:
parent
271b467e64
commit
ed0a9d7f4c
|
@ -250,23 +250,15 @@ define([ 'text!documenteditor/main/app/template/RolesManagerDlg.template',
|
||||||
|
|
||||||
if (!rec) return;
|
if (!rec) return;
|
||||||
|
|
||||||
if (store.length===1 && rec.get('fields')>0) {
|
|
||||||
Common.UI.warning({
|
|
||||||
msg: me.warnCantDelete,
|
|
||||||
buttons: ['ok']
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var callback = function(toRole) {
|
var callback = function(toRole) {
|
||||||
me.lastSelectedRole = store.indexOf(rec);
|
me.lastSelectedRole = store.indexOf(rec);
|
||||||
me.oformManager.asc_removeRole(rec.get('name'), toRole); // remove role and move it's fields
|
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;
|
me._isWarningVisible = true;
|
||||||
Common.UI.warning({
|
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'],
|
buttons: ['ok', 'cancel'],
|
||||||
callback: function(btn) {
|
callback: function(btn) {
|
||||||
if (btn == 'ok') {
|
if (btn == 'ok') {
|
||||||
|
@ -366,7 +358,8 @@ define([ 'text!documenteditor/main/app/template/RolesManagerDlg.template',
|
||||||
textUp: 'Move role up',
|
textUp: 'Move role up',
|
||||||
textDown: 'Move role down',
|
textDown: 'Move role down',
|
||||||
textDescription: 'Add roles and set the order in which the fillers receive and sign the document',
|
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}?<br>Once deleted, the default role will be created.'
|
||||||
|
|
||||||
}, DE.Views.RolesManagerDlg || {}));
|
}, DE.Views.RolesManagerDlg || {}));
|
||||||
});
|
});
|
|
@ -2698,6 +2698,7 @@
|
||||||
"DE.Views.RolesManagerDlg.txtTitle": "Manage Roles",
|
"DE.Views.RolesManagerDlg.txtTitle": "Manage Roles",
|
||||||
"DE.Views.RolesManagerDlg.warnCantDelete": "You cannot delete this role because it has associated fields.",
|
"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.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}?<br>Once deleted, the default role will be created.",
|
||||||
"DE.Views.SaveFormDlg.saveButtonText": "Save",
|
"DE.Views.SaveFormDlg.saveButtonText": "Save",
|
||||||
"DE.Views.SaveFormDlg.textAnyone": "Anyone",
|
"DE.Views.SaveFormDlg.textAnyone": "Anyone",
|
||||||
"DE.Views.SaveFormDlg.textDescription": "When saving to the oform, only roles with fields are added to the filling list",
|
"DE.Views.SaveFormDlg.textDescription": "When saving to the oform, only roles with fields are added to the filling list",
|
||||||
|
|
Loading…
Reference in a new issue