Commit 4fe64316 authored by Samir Sadyhov's avatar Samir Sadyhov 🤔

fix openDocument.js

parent ca2c84df
......@@ -975,8 +975,9 @@ class Document {
}, false);
}
if(AS.OPTIONS.currentUser.userid == user.id) {
switch (parent_process) {
if(parent_process !== 'registration') {
if(AS.OPTIONS.currentUser.userid == user.id) {
switch (parent_process) {
case 'null':
case 'assignment-single': //Завершить
createButton(this._doc, i18n.tr("Завершить"), 'arm_action_button3', () => {
......@@ -990,7 +991,7 @@ class Document {
finishWork(this._doc);
}
}, true);
break;
break;
case 'approval-single': //Утвердить
createButton(this._doc, i18n.tr("Утвердить"), 'arm_action_button7', () => {
_WORK.finishProcess(workInfo, this._doc);
......@@ -1007,26 +1008,28 @@ class Document {
}, false);
break;
case 'resolution-action-single': console.log('Резолюция? хммм....'); break; // Резолюция
}
} else if(AS.OPTIONS.currentUser.userid == author.id) {
if(completionForm && completionForm.hasOwnProperty('is_result_free') && !completionForm.is_result_free) {
createButton(this._doc, i18n.tr("Завершить"), 'arm_action_button3', () => {
_WORK.acceptWork(this._doc);
}, true);
} else {
createButton(this._doc, i18n.tr("Завершить"), 'arm_action_button3', () => {
const {dataUUID, mainDataUUID} = this._doc;
if(dataUUID && dataUUID != mainDataUUID) {
this._doc.formPlayer.showFormData(null, null, mainDataUUID);
setTimeout(() => {
}
} else if(AS.OPTIONS.currentUser.userid == author.id) {
if(completionForm && completionForm.hasOwnProperty('is_result_free') && !completionForm.is_result_free) {
createButton(this._doc, i18n.tr("Завершить"), 'arm_action_button3', () => {
_WORK.acceptWork(this._doc);
}, true);
} else {
createButton(this._doc, i18n.tr("Завершить"), 'arm_action_button3', () => {
const {dataUUID, mainDataUUID} = this._doc;
if(dataUUID && dataUUID != mainDataUUID) {
this._doc.formPlayer.showFormData(null, null, mainDataUUID);
setTimeout(() => {
finishWork(this._doc);
}, 500);
} else {
finishWork(this._doc);
}, 500);
} else {
finishWork(this._doc);
}
}, true);
}
}, true);
}
}
}
}
resizePanels(this._doc);
......
Markdown is supported
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