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

fix openDocument.js

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