(function(){page.using={types:["SearchOptionProvider","DispatchingDashboard"]};page.onLoad=function(){var o={parent:page,infoAreaId:page.url.get("infoAreaId",u8.Crm.Widgets.DispatchingDashboard.defaults.infoAreaId),refreshListAfterDrop:page.url.getBoolean("refreshListAfterDrop",false),resourceView:{header:{showNewButton:this.url.getBoolean("showNewButton",true)},model:{appointmentDefaultValues:{},defaultValuesModel:{expandName:"MADispatchingDashboardDefaults",mode:"New",uid:{infoAreaId:"MA"}},settingsName:"dispatchingDashboard",ticketRelatedReps:page.url.getBoolean("ticketRelatedReps",false),includeRepSet:page.url.getBoolean("combineSkillsAndGroup",false),rangeDependsOnAvailableWidth:true},settingsRecordUid:page.url.getUid("settingsRecord")||page.url.getUid()||page.url.getUid("saved"),sidebarOptions:{showDatePicker:true,showRepPicker:true,showTicketRelated:true},isDefault:false}};a(o);e(o);i(o);t(o);r(o);var s=$("#dispatchingDashboard").uniqueId("dispatchingDashboard",true);if(u8.device.ios){s.css({position:"fixed",overflowY:"auto",webkitOverflowScrolling:"touch"})}u8.widget("DispatchingDashboard",s,o)};function e(e){var i=u8.services.searchOptionProvider.buildFromPage(page,{showRelatedView:false});var t=i.link;if(t&&t.infoAreaId===e.infoAreaId&&(t.linkId===-1||t.linkId===null)){i.form.searchContext={sourceUid:t,items:[null,"FI","PE",t]};e.singleResultLink=t;e.nonSingleResultLinkPageSize=i.form.pageSize;i.form.additionalPageSizes=[i.form.pageSize];i.form.pageSize=1;if(i.form.useAutoSearch){i.collapseSearchForm=true}delete i.link;delete i.usePageHeader;delete i.headerSelector}e.search=i}function i(e){var i=page.url.get(["defaultFieldValuesForMA","MADefaultValues"],"").split(";");for(var t=0;t<i.length;t++){var r=i[t];var a=r.indexOf(":");if(a>0){var o=r.substring(0,a);var s=r.substring(a+1);if(s&&s.startsWith('"')&&s.endsWith('"')){s=s.substring(1,s.length-1)}if(s&&s.startsWith("#")){s=s.substring(1)}e.resourceView.model.appointmentDefaultValues[o]=s}}}function t(e){e.resourceView.model.forceCurrentRep=page.url.getBoolean("forceCurrentRep",false);e.resourceView.sidebarOptions.repGroupOptions=new u8.Base.Options(page.url.get("repGroupingOptions"));var i=page.url.getInt("scale",-1);if(i>0){e.resourceView.model.scale=i}}function r(e){e.copyFields={};var i=page.url.get("copyFields","").split(";");i.each(function(i){var t=i.indexOf(":");if(t===-1){return}var r=i.substring(0,t).trim();var a=i.substring(t+1).trim();e.copyFields[r]=a})}function a(e){$.extend(e,{sourceDueDateFieldId:page.url.get("sourceDueDateFieldId"),sourceDueTimeFieldId:page.url.get("sourceDueTimeFieldId"),sourceDurationFieldId:page.url.get("sourceDurationFieldId"),sourceDurationUnitFieldId:page.url.get("sourceDurationUnitFieldId"),targetTicketLinkId:page.url.getInt("targetTicketLinkId",undefined),sourceRootTicketLinkId:page.url.getInt("sourceRootTicketLinkId",undefined)})}})();