//>>built
require({cache:{"url:mill/jssupport/layout/layoutContent/reportToModeratorForm.html":"\x3cdiv\x3e\x3cdiv data-dojo-type\x3d\"office.form.TextField\" data-dojo-props\x3d\"text: 'Office.FullName;:', required: true, name: 'fullname'\"\x3e\x3c/div\x3e\x3cdiv data-dojo-type\x3d\"office.form.TextField\" data-dojo-props\x3d\"text: 'Office.Email;:', required: true, lowercase: true, name: 'email'\" data-dojo-attach-point\x3d\"emailField\"\x3e\x3c/div\x3e\x3cdiv data-dojo-type\x3d\"office.form.TextField\" data-dojo-props\x3d\"text: 'Office.EmailConfirm;:', required: true, lowercase: true, invalidMessage: 'Office.InvalidEmailConfirm', name: 'emailConfirm'\"\x3e\x3c/div\x3e\x3cdiv data-dojo-type\x3d\"office.form.TextField\" data-dojo-props\x3d\"text: 'Office.ContactPhone;:', name: 'phone'\"\x3e\x3c/div\x3e\x3cdiv data-dojo-type\x3d\"office.form.TextField\" data-dojo-props\x3d\"text: 'Office.MessageSubject;:', name: 'subject', maxLength: 128\"\x3e\x3c/div\x3e\x3cdiv data-dojo-type\x3d\"office.form.TextAreaField\" data-dojo-props\x3d\"text: 'Office.MessageBody;:', required: true, name: 'body'\"\x3e\x3c/div\x3e\x3cdiv data-dojo-type\x3d\"office.form.FileAttachmentField\" data-dojo-props\x3d\"text: 'Office.AttachFile;:', accept: 'image/bmp,image/jpeg,image/png,image/tiff,application/pdf', name: 'datafile'\"\x3e\x3c/div\x3e\x3c/div\x3e"}});
define("mill/jssupport/layout/layoutContent/ReportToModeratorForm","dojo/_base/declare dojo/_base/lang dojo/text!mill/jssupport/layout/layoutContent/reportToModeratorForm.html mill/jssupport/form/_FormContent mill/jssupport/form/FilteringSelectField mill/jssupport/Announcement mill/jssupport/base mill/mill".split(" "),function(u,l,v,w,m,x,b,g){return g.registerAlias("office.ReportToModeratorForm",u("mill.jssupport.layout.layoutContent.ReportToModeratorForm",w,{content:v,formTitle:"Office.ReportToModerator",
submitApplicationLabel:"Office.SendAMessage",hideSubmitTextColumn:"false",messageCampusWidget:null,messageCategoryWidget:null,startup:function(){this.inherited(arguments);var a=this.formWidgets;a.hasOwnProperty("email")&&a.hasOwnProperty("emailConfirm")&&(a.email.widget.set("validator",l.hitch(this,this.emailValidator)),a.emailConfirm.widget.set("validator",l.hitch(this,this.emailConfirmValidator)));if(window.app&&"acMagAbiturient"===window.app.accessCategory){if(a=this.getField("subject")){a.set("required",
!0);this.addChild(x({text:"MagAbitur.ModeratorMessageAnnouncement",icon:"info",color:"blue",readOnly:!0}),"first");var d=new m({text:"MagAbitur.ModeratorMessageCampus;:",name:"campus",required:!0}),c=d.controlNode;this.messageCampusWidget=c;c.set("searchAttrObject",{RU:"Description",EN:"EngDescription"});c.set("store",b.domainStore("TRegDepartment","TRegDepartment with AdmModeratorPosition required domain",null,["Description","EngDescription"],null,null,null,null,window.app.anonymousHandler));c.set("onChange",
function(h){var k=this.getFormWidget("questioncategory");k&&(k.set("value",""),k.set("disabled",!h))}.bind(this));d.placeAt(a,"before");this.registerWidget(c);d=new m({text:"MagAbitur.ModeratorMessageCategory;:",name:"questioncategory",required:!0});this.messageCategoryWidget=c=d.controlNode;c.set("searchAttrObject",{RU:"Description",EN:"EngDescription"});c.set("store",b.domainStore("TAbitMessageCategory","Magister abiturient message category (required)",[{domain:"TObject domain",name:"ARegDepartment",
value:function(){return this.getWidgetAttr("campus","value")}.bind(this)}],["Description","EngDescription"],null,null,null,null,window.app.anonymousHandler));d.placeAt(a,"before");this.registerWidget(c);c.set("disabled",!0)}}else if("acForeignAbiturient"===b.accessCategory||"acForeignMagAbiturient"===b.accessCategory){if(a=this.getField("phone"))d=new m({text:"ForeignAbit.ModeratorMessageCategory;:",name:"questioncategory",required:!0}),this.messageCategoryWidget=d.controlNode,this.registerWidget(this.messageCategoryWidget),
this.messageCategoryWidget.set("searchAttrObject",{RU:"Description",EN:"EngDescription"}),this.messageCategoryWidget.set("store",b.domainStore("TFAMessageCategory","acForeignAbiturient"===b.accessCategory?"TFAMessageCategory ForBachAbiturient required domain":"TFAMessageCategory ForMagAbiturient required domain",null,["Description","EngDescription"],null,null,null,null,b.anonymousHandler)),d.placeAt(a,"after");(a=this.getField("subject"))&&a.set("required",!0)}else if("acSchoolOlymp"===b.accessCategory||
"acStudOlymp"===b.accessCategory){var n=this.getField("phone"),p=this.getField("subject");a=[{part:0,name:"ID"},{part:0,name:"Theme"},{part:1,name:"IsActual",value:"1"}];"acSchoolOlymp"===b.accessCategory?a.push({part:1,name:"ForSchoolOlymp",value:"1"}):"acStudOlymp"===b.accessCategory&&a.push({part:1,name:"ForStudOlymp",value:"1"});g.queryCursorJson({handler:window.anonymousHandler,headers:{"Disable-Basic-Auth":"yes"},sync:!1,className:"TOlympMessageCategory",query:a,load:function(h){h=window.app.createStore({data:h.data.sort(function(f,
e){var q=g.fieldValue(f,"Theme").toUpperCase(),r=g.fieldValue(e,"Theme").toUpperCase();return q<r?-1:q>r?1:0}).map(function(f,e){f.Position=e;return f}).concat([{ID:0,Position:h.data.length,Theme:"\u0414\u0440\u0443\u0433\u043e\u0435"}])});if(n){var k=new m({text:"acSchoolOlymp"===b.accessCategory?"SchlOlymp.ModeratorMessageCategory;:":"StudOlymp.ModeratorMessageCategory;:",name:"questioncategory",required:!0}),t=function(f){if(p&&f){var e=f.get("item");e=!e||0!==e.ID;p.set("disabled",e);p.set("required",
!e);p.controlNode.set("value","");return t.bind(null,f)}};this.messageCategoryWidget=k.controlNode;this.messageCategoryWidget.set("onChange",t.call(null,this.messageCategoryWidget));this.messageCategoryWidget.set("searchAttrObject","Theme");this.messageCategoryWidget.set("fetchProperties",{sort:[{attribute:"Position",descending:!1}]});this.messageCategoryWidget.set("store",h);this.registerWidget(this.messageCategoryWidget);k.placeAt(n,"after")}}.bind(this)})}},postForm:function(){this.inherited(arguments);
var a={};this.inspectFormWidgets(function(c,n){this._isAttachment(n)||(a[c]=this.formWidgetValue(c))},null,null);var d="";this.messageCategoryWidget&&(d=window.app&&"acMagAbiturient"===window.app.accessCategory?this.messageCategoryWidget.get("value"):"acSchoolOlymp"===b.accessCategory||"acStudOlymp"===b.accessCategory?this.messageCategoryWidget.validate()&&"0"!==String(g.fieldValue(this.messageCategoryWidget.get("item"),"ID"))?this.messageCategoryWidget.get("displayedValue"):this.getFormWidget("subject").get("value"):
this.messageCategoryWidget.validate()?this.messageCategoryWidget.get("displayedValue"):"");this.postRequest({url:g.getRequestUrl(b.registerHandler||(window.app?window.app.registerHandler:""),"ModeratorMessage.xml"),data:l.mixin(a,{refertext:g.getReferText(),accesscategory:b.accessCategory||(window.app?window.app.accessCategory:""),communicationlanguage:b.locale.toUpperCase(),questioncategory:d,regdepartment:this.messageCampusWidget?this.messageCampusWidget.get("value"):""})}).then(l.hitch(this,function(){this.createSuccessMessage("Office.ReportToModeratorRequestSuccess",
function(){this.toggleFormView()}.bind(this),null,null,!1);this.toggleFormView();this.resetForm()}))}}))});