Commit 66ed0dd9 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Merge branch 'feature_4144' into 'master'

Changing buttons for the dirty Events depending on status

Seems to work with the full lock, the other one still only displays it on advisory. Still, better than before.

See merge request !18
parents 1ee9be48 7da56956
......@@ -172,23 +172,31 @@ var QfqNS = QfqNS || {};
n.QfqForm.prototype.dirtyRenewalDenied = function (obj) {
var that = this;
var messageButtons = [{
label: "Reload",
eventName: 'reload'
}];
if (obj.data.status == "conflict_allow_force") {
messageButtons.push({
label: "Ignore",
eventName: 'ignore'
});
}
var alert = new n.Alert(
{
type: "error",
message: obj.data.message,
modal: true,
buttons: [
{
label: "Reload",
eventName: 'reload'
}
]
buttons: messageButtons
}
);
alert.on('alert.reload', function () {
that.eventEmitter.emitEvent('qfqform.close-intentional', n.EventEmitter.makePayload(that, null));
window.location.reload(true);
});
alert.on('alert.ignore', function() {
console.log("Ignored Recordlock");
});
alert.show();
};
......@@ -216,19 +224,17 @@ var QfqNS = QfqNS || {};
n.QfqForm.prototype.dirtyNotifyDenied = function (obj) {
var messageType;
var isModal = false;
var messageButtons = [];
var isModal = true;
var messageButtons = [{
label: "Reload",
eventName: 'reload'
}];
var message;
var that = this;
switch (obj.data.status) {
case "conflict":
messageType = "error";
isModal = true;
messageButtons.push({
label: "Reload",
eventName: 'reload'
});
this.setButtonEnabled(this.getSaveButton(), false);
this.getSaveButton().removeClass(this.getSaveButtonAttentionClass());
this.setButtonEnabled(this.getDeleteButton(), false);
......@@ -237,6 +243,10 @@ var QfqNS = QfqNS || {};
break;
case "conflict_allow_force":
messageType = "warning";
messageButtons.push({
label: "Ignore",
eventName: 'ignore'
});
break;
case "error":
messageType = "error";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment