(function(){var e;var t=null;page.commandBindings={"SystemTracking/SaveAdHocSystemLock":i,"SystemTracking/NewPlannedLock":a};function i(){var i=$u(".ExpandView")[0],a=i.model;i.notify({severity:300,text:"TXT_details_text_34",duration:0});var o=a.getFieldValue("Root",50)||0;var s=a.getFieldValue("Root",41)||null;var l=a.getFieldValue("Root",7)||null;var u=a.getFieldValue("Root",42)||null;u8.services.administration.lockSystem({dueInMinutes:o,repIds:s,lockType:l,text:u},function(i,o){var s=o.lockUid;if(!s){return}a.setUid(s);e=s;t=setTimeout(n,2e3)})}function n(){if(!e){if(t!==null){clearTimeout(t)}return}u8.services.administration.isSystemLocked(e,function(i,a){if(a.isLocked){var o=$u(".ExpandView")[0];if(o){o.notify({severity:300,text:"TXT_details_text_35"})}e=null;clearTimeout(t);t=null}else{t=setTimeout(n,5e3)}})}function a(){var e=u8.session.environment.stationNumber;var t={infoAreaId:"T4",defaultFields:"0,2",defaultValues:e+","+e,scripts:"crm/pages/systemlocks.js"};u8.services.navigation.navigateToPage("ExpandNew",t)}})();