//>>built
require({cache:{"url:mill/jssupport/layout/layoutContent/remoteUserPane.html":'\x3cdiv\x3e\x3cdiv data-dojo-attach-point\x3d"loadingNode" class\x3d"loading"\x3e\x3cspan\x3e.\x3c/span\x3e\x3cspan\x3e.\x3c/span\x3e\x3cspan\x3e.\x3c/span\x3e\x3c/div\x3e\x3cdiv data-dojo-attach-point\x3d"remoteUserPaneContentCover" class\x3d"officeRemoteUserPaneContentCover"\x3e\x3cdiv data-dojo-attach-point\x3d"remoteUserPhoto" data-dojo-attach-event\x3d"onClick: changePhoto" class\x3d"officeRemoteUserPhoto"\x3e\x3c/div\x3e\x3cdiv class\x3d"officeRemoteUserInfo"\x3e\x3cdiv data-dojo-attach-point\x3d"regNumberNode"\x3e\x3c/div\x3e\x3cdiv data-dojo-attach-point\x3d"loginNameNode" class\x3d"bold"\x3e\x3c/div\x3e\x3cdiv data-dojo-attach-point\x3d"fullNameNode"\x3e\x3c/div\x3e\x3cdiv data-dojo-attach-point\x3d"birthDateNode"\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d"officeRemoteUserActions"\x3e\x3cspan data-dojo-attach-point\x3d"pencilAction" data-dojo-attach-event\x3d"onclick: action" class\x3d"icon-set-pencil2"\x3e\x3c/span\x3e\x3cspan data-dojo-attach-point\x3d"logoutAction" data-dojo-attach-event\x3d"onclick: action" class\x3d"icon-set-exit"\x3e\x3c/span\x3e\x3cspan data-dojo-attach-point\x3d"logoutTextNode"\x3e\x3c/span\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e'}});
define("mill/jssupport/layout/layoutContent/RemoteUserPane","dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/query dojo/topic dojo/aspect dojo/window dojo/dom-construct dojo/dom-style dojo/dom-class dojo/dom-geometry dojo/router dijit/registry dijit/_WidgetBase dijit/_TemplatedMixin dojo/text!mill/jssupport/layout/layoutContent/remoteUserPane.html mill/jssupport/_TranslationMixin mill/jssupport/base mill/jssupport/session mill/mill".split(" "),function(q,f,r,t,u,v,k,n,g,l,p,m,w,x,y,z,A,c,
h,d){return mill.registerAlias("office.RemoteUserPane",q("mill.jssupport.layout.layoutContent.RemoteUserPane",[x,y,A],{baseClass:"officeRemoteUserPane",templateString:z,data:null,pencilTitle:null,logoutTitle:null,layoutContainerWidget:null,_regNumber:"",_loginName:"",_fullName:"",_birthDate:"",translatableAttributes:{pencilTitle:"Office.PersonalData",logoutTitle:"Office.SignOut"},attributeMap:{pencilTitle:{node:"pencilAction",type:"attribute",attribute:"title"},logoutTitle:{node:"logoutAction",type:"attribute",
attribute:"title"},_regNumber:{node:"regNumberNode",type:"innerHTML"},_loginName:{node:"loginNameNode",type:"innerHTML"},_fullName:{node:"fullNameNode",type:"innerHTML"},_birthDate:{node:"birthDateNode",type:"innerHTML"}},_getLayoutContainerWidgetAttr:function(){if(this.layoutContainerWidget)return this.layoutContainerWidget;for(var a=this;!a.isInstanceOf(office.layout.LayoutContainer)&&a.getParent();)a=a.getParent();a.isInstanceOf(office.layout.LayoutContainer)&&(this.layoutContainerWidget=a);return this.layoutContainerWidget},
_setDataAttr:function(a){this.data=a;("acSchoolOlymp"===c.accessCategory||"acStudOlymp"===c.accessCategory)&&(a=mill.fieldValue(c.presets,"RegNumber"))&&this.set("_regNumber",c.getLocalization("Office.RemoteUserPaneRegNumber")+":\x26#160;"+a);this.set("_loginName",(mill.session||c.session).userName);this.set("_birthDate",this.data.BirthDate);this.data.Photo&&g.set(this.remoteUserPhoto,{width:"75px",backgroundImage:'url("'+this.data.Photo+'")'});this.translate();if(!window.hasOwnProperty("app")||!window.app.hasOwnProperty("authHandlers"))if("acMagCommissionMember"===
c.accessCategory||"acForeignStudent"===h.getRemoteUserAccessCategory()||"acForeignPrepStudent"===h.getRemoteUserAccessCategory())g.set(this.pencilAction,{display:"none"}),"acForeignStudent"===h.getRemoteUserAccessCategory()&&new office.TranslatableNode({text:"Office.SignOut",display:"inline",onClick:c.logout},this.logoutTextNode);n.destroy(this.loadingNode);g.set(this.remoteUserPaneContentCover,{display:"table"})},startup:function(){this.inherited(arguments);if(window.hasOwnProperty("app")&&window.app.hasOwnProperty("authHandlers"))l.remove(this.pencilAction,
"icon-set-pencil2");else if("acForeignAbiturient"===c.accessCategory||"acForeignMagAbiturient"===c.accessCategory||"acForeignStudent"===window.app.accessCategory)l.remove(this.pencilAction,"icon-set-pencil2"),"acForeignStudent"!==window.app.accessCategory&&new office.TranslatableNode({text:"Office.PersonalData",display:"inline",onClick:this.action.bind(this)},n.create("span",null,this.pencilAction));this.own(u.subscribe("vuz.onLoad",f.hitch(this,this.loadData)));v.after(k,"scrollIntoView",f.hitch(this,
function(a){try{var b=p.position(a).y,e=k.getBox();70>=b&&this.get("layoutContainerWidget")?this.get("layoutContainerWidget").contentPane.domNode.scrollBy(0,b-72):50>e.h-p.position(a).h-b&&this.get("layoutContainerWidget").contentPane.domNode.scrollBy(0,50)}catch(B){}}),!0)},translate:function(){this.inherited(arguments);this.data&&this.set("_fullName",this.data[("en"===c.locale.toLowerCase()?"Eng":"")+"FullName"]||this.data.FullName)},action:function(a){a.target&&(l.contains(a.target,"icon-set-exit")?
c.logout():m.go("personaldata"))},loadData:function(){var a=[{part:0,name:"ID"},{part:0,name:"FullName"},{part:0,name:"EngFullName"},{part:0,name:"Photo"},{part:1,name:"ID",value:h.getRemoteUserPersonID()}];"acMagCommissionMember"!==c.accessCategory&&a.push({part:0,name:"BirthDate"});d.queryCursor({handler:c.mainHandler,className:"acMagCommissionMember"===c.accessCategory?"TPerson":"TCommonStudent",headers:{"Disable-Basic-Auth":"yes"},query:a}).then(f.hitch(this,function(b){if(b=b.childNodes[0].childNodes[0]){var e=
d.fieldValue(b,"Photo")?"/"+c.mainHandler+"/getblob.jpg?query\x3d"+d._itemsToQuery({className:"TCommonStudent",propName:"Photo",ID:d.fieldValue(b,"ID")}).split('"').join("'"):null;this.set("data",{FullName:d.fieldValue(b,"FullName"),EngFullName:d.fieldValue(b,"EngFullName").replace(/^\s\s*/,"").replace(/\s\s*$/,""),BirthDate:d.fieldValue(b,"BirthDate"),Photo:e});this.isAdmissionAbiturient()&&g.set(this.remoteUserPhoto,{cursor:"pointer"})}}),f.hitch(this,function(b){this.loadingNode.innerHTML=b.message}))},
isAdmissionAbiturient:function(){return/^ac(Bach|Mag)Abiturient$/.test(c.accessCategory)},changePhoto:function(){if(this.isAdmissionAbiturient()){var a=t(".officeFormContent");r.forEach(a,function(b){var e=w.byNode(b);e&&e.isInstanceOf(office.BachAbit.BachPhotoInfoForm)&&(b=0,"startup"!==m._currentPath&&(m.go("startup"),b=500),setTimeout(function(){k.scrollIntoView(e.domNode)},b))})}}}))});