4478 |
05 May 17 |
nicklas |
var RefDate = function() |
4478 |
05 May 17 |
nicklas |
2 |
{ |
4478 |
05 May 17 |
nicklas |
var rf = {}; |
4478 |
05 May 17 |
nicklas |
var debug = 0; |
4478 |
05 May 17 |
nicklas |
5 |
|
4478 |
05 May 17 |
nicklas |
6 |
|
4478 |
05 May 17 |
nicklas |
rf.initPage = function() |
4478 |
05 May 17 |
nicklas |
8 |
{ |
4478 |
05 May 17 |
nicklas |
// Navigation |
4478 |
05 May 17 |
nicklas |
Buttons.addClickHandler('gocancel', Wizard.cancelWizard); |
4478 |
05 May 17 |
nicklas |
Buttons.addClickHandler('gorestart', Wizard.restartWizard); |
4478 |
05 May 17 |
nicklas |
Buttons.addClickHandler('goupdate', Wizard.goRegister); |
4478 |
05 May 17 |
nicklas |
13 |
|
4478 |
05 May 17 |
nicklas |
// Final registration |
4478 |
05 May 17 |
nicklas |
Events.addEventHandler('wizard', 'wizard-submit', rf.submit); |
4478 |
05 May 17 |
nicklas |
16 |
|
4478 |
05 May 17 |
nicklas |
Doc.show('step-1'); |
4478 |
05 May 17 |
nicklas |
Doc.show('goupdate'); |
4478 |
05 May 17 |
nicklas |
19 |
} |
4478 |
05 May 17 |
nicklas |
20 |
|
4478 |
05 May 17 |
nicklas |
21 |
|
4478 |
05 May 17 |
nicklas |
rf.submit = function() |
4478 |
05 May 17 |
nicklas |
23 |
{ |
4478 |
05 May 17 |
nicklas |
// Get permission information |
4478 |
05 May 17 |
nicklas |
var url = '../ReferenceDate.servlet?ID='+App.getSessionId(); |
4478 |
05 May 17 |
nicklas |
url += '&cmd=UpdateAllReferenceDateAnnotations'; |
4478 |
05 May 17 |
nicklas |
27 |
|
6098 |
11 Jan 21 |
nicklas |
Wizard.showLoadingAnimation('Updating ReferenceDate and LinkedCase annotations...', 'ref-date-progress'); |
4478 |
05 May 17 |
nicklas |
Wizard.asyncJsonRequest(url, rf.refDateDone, 'POST'); |
4478 |
05 May 17 |
nicklas |
30 |
} |
4478 |
05 May 17 |
nicklas |
31 |
|
4478 |
05 May 17 |
nicklas |
rf.refDateDone = function(response) |
4478 |
05 May 17 |
nicklas |
33 |
{ |
4478 |
05 May 17 |
nicklas |
for (var c = 0; c < response.counters.length; c++) |
4478 |
05 May 17 |
nicklas |
35 |
{ |
4478 |
05 May 17 |
nicklas |
var counter = response.counters[c]; |
4478 |
05 May 17 |
nicklas |
var name = counter.name || 'novalue'; |
4478 |
05 May 17 |
nicklas |
Doc.element(name + '-before').innerHTML = counter.before; |
4478 |
05 May 17 |
nicklas |
Doc.element(name + '-after').innerHTML = counter.after; |
4478 |
05 May 17 |
nicklas |
40 |
} |
4478 |
05 May 17 |
nicklas |
41 |
|
6098 |
11 Jan 21 |
nicklas |
Wizard.showFinalMessage(response.messages); |
4478 |
05 May 17 |
nicklas |
43 |
|
4478 |
05 May 17 |
nicklas |
Doc.show('update-results'); |
4478 |
05 May 17 |
nicklas |
Doc.show('gorestart'); |
4478 |
05 May 17 |
nicklas |
46 |
} |
4478 |
05 May 17 |
nicklas |
47 |
|
4478 |
05 May 17 |
nicklas |
return rf; |
4478 |
05 May 17 |
nicklas |
49 |
}(); |
4478 |
05 May 17 |
nicklas |
50 |
|
4478 |
05 May 17 |
nicklas |
Doc.onLoad(RefDate.initPage); |
4478 |
05 May 17 |
nicklas |
52 |
|