7604 |
25 Feb 19 |
nicklas |
'use strict'; |
7604 |
25 Feb 19 |
nicklas |
2 |
|
7604 |
25 Feb 19 |
nicklas |
var RestartJob = function() |
7604 |
25 Feb 19 |
nicklas |
4 |
{ |
7604 |
25 Feb 19 |
nicklas |
var restart = {}; |
7604 |
25 Feb 19 |
nicklas |
6 |
|
7604 |
25 Feb 19 |
nicklas |
var parameterVersion; |
7604 |
25 Feb 19 |
nicklas |
var latestVersion; |
7604 |
25 Feb 19 |
nicklas |
var breakPoint; |
7604 |
25 Feb 19 |
nicklas |
10 |
|
7604 |
25 Feb 19 |
nicklas |
11 |
/** |
7604 |
25 Feb 19 |
nicklas |
Initialize the page. |
7604 |
25 Feb 19 |
nicklas |
13 |
*/ |
7604 |
25 Feb 19 |
nicklas |
restart.initPage = function() |
7604 |
25 Feb 19 |
nicklas |
15 |
{ |
7604 |
25 Feb 19 |
nicklas |
parameterVersion = window.opener.Data.int('page-data', 'job-parameter-version'); |
7604 |
25 Feb 19 |
nicklas |
latestVersion = window.opener.Data.int('page-data', 'latest-parameter-version'); |
7604 |
25 Feb 19 |
nicklas |
breakPoint = window.opener.Data.get('page-data', 'breakpoint'); |
7604 |
25 Feb 19 |
nicklas |
19 |
|
7604 |
25 Feb 19 |
nicklas |
Doc.element('latestVersion').innerHTML = latestVersion; |
7604 |
25 Feb 19 |
nicklas |
Doc.element('currentVersion').innerHTML = parameterVersion; |
7604 |
25 Feb 19 |
nicklas |
Doc.element('breakPoint').innerHTML = Strings.encodeTags(breakPoint); |
7604 |
25 Feb 19 |
nicklas |
23 |
|
7604 |
25 Feb 19 |
nicklas |
if (parameterVersion != latestVersion) Doc.show('parameterVersionSection'); |
7604 |
25 Feb 19 |
nicklas |
if (breakPoint) Doc.show('breakPointSection'); |
7604 |
25 Feb 19 |
nicklas |
26 |
|
7604 |
25 Feb 19 |
nicklas |
Buttons.addClickHandler('btnOk', restart.doRestart); |
7604 |
25 Feb 19 |
nicklas |
Buttons.addClickHandler('close', App.closeWindow); |
7604 |
25 Feb 19 |
nicklas |
29 |
} |
7604 |
25 Feb 19 |
nicklas |
30 |
|
7604 |
25 Feb 19 |
nicklas |
restart.doRestart = function(event) |
7604 |
25 Feb 19 |
nicklas |
32 |
{ |
7604 |
25 Feb 19 |
nicklas |
var frm = document.forms['options']; |
7604 |
25 Feb 19 |
nicklas |
var options = {}; |
7604 |
25 Feb 19 |
nicklas |
if (breakPoint) |
7604 |
25 Feb 19 |
nicklas |
36 |
{ |
7604 |
25 Feb 19 |
nicklas |
var checked = Forms.getCheckedRadio(frm.resumeFromBreakPoint); |
7604 |
25 Feb 19 |
nicklas |
if (!checked) |
7604 |
25 Feb 19 |
nicklas |
39 |
{ |
7604 |
25 Feb 19 |
nicklas |
Forms.showNotification('resumeFromBreakPoint', 'Please select an option!'); |
7604 |
25 Feb 19 |
nicklas |
return; |
7604 |
25 Feb 19 |
nicklas |
42 |
} |
7604 |
25 Feb 19 |
nicklas |
options.resumeFromBreakPoint = checked.value; |
7604 |
25 Feb 19 |
nicklas |
44 |
} |
7604 |
25 Feb 19 |
nicklas |
if (parameterVersion != latestVersion) |
7604 |
25 Feb 19 |
nicklas |
46 |
{ |
7604 |
25 Feb 19 |
nicklas |
var checked = Forms.getCheckedRadio(frm.useLatestParameters); |
7604 |
25 Feb 19 |
nicklas |
if (!checked) |
7604 |
25 Feb 19 |
nicklas |
49 |
{ |
7604 |
25 Feb 19 |
nicklas |
Forms.showNotification('useLatestParameters', 'Please select an option!'); |
7604 |
25 Feb 19 |
nicklas |
return; |
7604 |
25 Feb 19 |
nicklas |
52 |
} |
7604 |
25 Feb 19 |
nicklas |
options.useLatestConfiguration = checked.value; |
7604 |
25 Feb 19 |
nicklas |
54 |
} |
7604 |
25 Feb 19 |
nicklas |
55 |
|
7604 |
25 Feb 19 |
nicklas |
window.opener.Jobs.restartJob(event, options); |
7604 |
25 Feb 19 |
nicklas |
App.closeWindow(); |
7604 |
25 Feb 19 |
nicklas |
58 |
} |
7604 |
25 Feb 19 |
nicklas |
59 |
|
7604 |
25 Feb 19 |
nicklas |
return restart; |
7604 |
25 Feb 19 |
nicklas |
61 |
}(); |
7604 |
25 Feb 19 |
nicklas |
62 |
|
7604 |
25 Feb 19 |
nicklas |
Doc.onLoad(RestartJob.initPage); |