|
36 |
"dojo/dom-class", |
36 |
"dojo/dom-class", |
37 |
"dojo/topic", |
37 |
"dojo/topic", |
38 |
"dojo/Deferred", |
38 |
"dojo/Deferred", |
|
|
39 |
"dijit/registry", |
39 |
"dojox/string/sprintf", |
40 |
"dojox/string/sprintf", |
40 |
"umc/app", |
41 |
"umc/app", |
41 |
"umc/tools", |
42 |
"umc/tools", |
|
48 |
"umc/modules/updater/Page", |
49 |
"umc/modules/updater/Page", |
49 |
"umc/modules/updater/Form", |
50 |
"umc/modules/updater/Form", |
50 |
"umc/i18n!umc/modules/updater" |
51 |
"umc/i18n!umc/modules/updater" |
51 |
], function(declare, lang, array, all, domClass, topic, Deferred, sprintf, UMCApplication, tools, store, server, TitlePane, Text, HiddenInput, ComboBox, Page, Form, _) { |
52 |
], function(declare, lang, array, all, domClass, topic, Deferred, dijitRegistry, sprintf, UMCApplication, tools, store, server, TitlePane, Text, HiddenInput, ComboBox, Page, Form, _) { |
|
|
53 |
var _getParentWidget = function(widget) { |
54 |
try { |
55 |
return dijitRegistry.getEnclosingWidget(widget.domNode.parentNode); |
56 |
} catch(e) { |
57 |
// could not access _widget.domNode.parentNode |
58 |
return null; |
59 |
} |
60 |
}; |
61 |
|
52 |
return declare("umc.modules.updater.UpdatesPage", Page, { |
62 |
return declare("umc.modules.updater.UpdatesPage", Page, { |
53 |
|
63 |
|
54 |
_update_prohibited: false, |
64 |
_update_prohibited: false, |
|
66 |
}); |
76 |
}); |
67 |
}, |
77 |
}, |
68 |
|
78 |
|
|
|
79 |
_getEnclosingTitlePane: function(widgetName) { |
80 |
var _widget = this._form.getWidget(widgetName) || this._form.getButton(widgetName); |
81 |
while (_widget != null) { |
82 |
if (_widget.isInstanceOf(TitlePane)) { |
83 |
// we successfully found the enclosing TitlePane of the given widget |
84 |
return _widget; |
85 |
} |
86 |
if (_widget.isInstanceOf(Form)) { |
87 |
// do not search beyond the form widget |
88 |
return null; |
89 |
} |
90 |
_widget = _getParentWidget(_widget); |
91 |
} |
92 |
}, |
93 |
|
69 |
buildRendering: function() { |
94 |
buildRendering: function() { |
70 |
|
95 |
|
71 |
this.inherited(arguments); |
96 |
this.inherited(arguments); |
|
74 |
type: HiddenInput, |
99 |
type: HiddenInput, |
75 |
name: 'reboot_required' |
100 |
name: 'reboot_required' |
76 |
}, { |
101 |
}, { |
|
|
102 |
type: 'Text', |
103 |
name: 'version_out_of_maintenance_text', |
104 |
'class': 'umcUpdaterWarningText', |
105 |
visible: false, |
106 |
label: '', |
107 |
content: '', // will be set below as soon as the UCS version is known |
108 |
}, { |
77 |
type: Text, |
109 |
type: Text, |
78 |
name: 'reboot_text', |
110 |
name: 'reboot_text', |
79 |
label: ' ', |
111 |
label: ' ', |
|
335 |
size: 'One' |
367 |
size: 'One' |
336 |
}]; |
368 |
}]; |
337 |
|
369 |
|
338 |
var layout = [{ |
370 |
var layout = [ |
|
|
371 |
'version_out_of_maintenance_text', |
372 |
{ |
339 |
label: _("Reboot required"), |
373 |
label: _("Reboot required"), |
340 |
layout: [ |
374 |
layout: [ |
341 |
['reboot_text', 'reboot'] |
375 |
['reboot_text', 'reboot'] |
|
376 |
// fetch all known/initial titlepanes and save them with their name |
410 |
// fetch all known/initial titlepanes and save them with their name |
377 |
// so they can be used later on |
411 |
// so they can be used later on |
378 |
this._titlepanes = { |
412 |
this._titlepanes = { |
379 |
reboot: this._form._container.getChildren()[0], |
413 |
reboot: this._getEnclosingTitlePane('reboot'), |
380 |
easymode: this._form._container.getChildren()[1], |
414 |
easymode: this._getEnclosingTitlePane('easy_upgrade'), |
381 |
release: this._form._container.getChildren()[2], |
415 |
release: this._getEnclosingTitlePane('run_release_update'), |
382 |
packages: this._form._container.getChildren()[3] |
416 |
packages: this._getEnclosingTitlePane('run_packages_update') |
383 |
}; |
417 |
}; |
384 |
|
418 |
|
385 |
// Before we attach the form to our page, just switch off all title panes. |
419 |
// Before we attach the form to our page, just switch off all title panes. |
|
433 |
|
467 |
|
434 |
this._show_reboot_pane(tools.isTrue(values.reboot_required)); |
468 |
this._show_reboot_pane(tools.isTrue(values.reboot_required)); |
435 |
|
469 |
|
|
|
470 |
// load maintenance information and show message if out of maintenance |
471 |
tools.umcpCommand('updater/maintenance_information').then(lang.hitch(this, function(data) { |
472 |
var info = data.result; |
473 |
var msg = ''; |
474 |
if (info.maintained === 'extended') { |
475 |
// TODO add behaviour for extended |
476 |
} else if (info.maintained === 'false') { |
477 |
if (info.baseDN === 'Free for personal use edition' || info.baseDN === 'UCS Core Edition') { |
478 |
msg = lang.replace("Achtung: Sie verwenden aktuell UCS {0} Core Edition. Diese Version ist veraltet und es werden keine Sicherheitsupdates mehr dafür veröffentlicht. Bitte aktualisieren Sie dieses System auf eine neuere UCS Version! Enterprise Subscriptionen bieten für einige Versionen längere Aktualisierungszeiträume. Informationen zu Enterprise Subscriptionen finden Sie auf der <a target='_blank' href='https://www.univention.de/produkte/preise/'>Univention Webseite</a>.", []); |
479 |
} else if (info.support == 0 && info.premiumSupport == 0) { |
480 |
msg = ''; |
481 |
} else if (info.support == 1 && info.premiumSupport == 0) { |
482 |
msg = ''; |
483 |
} else if (info.support == 0 && info.premiumSupport == 1) { |
484 |
msg = ''; |
485 |
} |
486 |
} |
487 |
|
488 |
if (msg) { |
489 |
var outOfMaintenanceWidget = this._form.getWidget('version_out_of_maintenance_text'); |
490 |
outOfMaintenanceWidget.set('content', msg); |
491 |
outOfMaintenanceWidget.set('visible', true); |
492 |
} |
493 |
})); |
494 |
|
495 |
|
436 |
} catch(error) { |
496 |
} catch(error) { |
437 |
console.error("onLoaded: " + error.message); |
497 |
console.error("onLoaded: " + error.message); |
438 |
} |
498 |
} |
|
590 |
|
650 |
|
591 |
}, |
651 |
}, |
592 |
|
652 |
|
|
|
653 |
postCreate: function() { |
654 |
// maintenance status |
655 |
// tools.umcpCommand('updater/maintenance_information').then(function(data) { |
656 |
// var info = data.result; |
657 |
// if (info.maintained === 'extended') { |
658 |
// TODO add behaviour for extended with ucr variable |
659 |
// return; |
660 |
// } else if (info.maintained === 'false') { |
661 |
// if (info.baseDN === 'Free for personal use edition' || info.baseDN === 'UCS Core Edition') { |
662 |
// var msg = lang.replace("Achtung: Sie verwenden aktuell UCS {0} Core Edition. Diese Version ist veraltet und es werden keine Sicherheitsupdates mehr dafür veröffentlicht. Bitte aktualisieren Sie dieses System auf eine neuere UCS Version! Enterprise Subscriptionen bieten für einige Versionen längere Aktualisierungszeiträume. Informationen zu Enterprise Subscriptionen finden Sie auf der <a target='_blank' href='https://www.univention.de/produkte/preise/'>Univention Webseite</a>."); |
663 |
// } |
664 |
// } |
665 |
// }); |
666 |
}, |
667 |
|
593 |
// First page refresh doesn't work properly when invoked in 'buildRendering()' so |
668 |
// First page refresh doesn't work properly when invoked in 'buildRendering()' so |
594 |
// we defer it until the UI is being shown |
669 |
// we defer it until the UI is being shown |
595 |
startup: function() { |
670 |
startup: function() { |