﻿_builtInTemplate_b84c3e97=['<div id="control"></div>','<div id="control"></div>','<div>     <div id="left" style="float:left;"></div>    <div id="right" style="float:right;"></div>    <div style="clear:both;"></div></div>','<div id="container">    <div id="top"></div>    <div id="left" style="float:left;"></div>    <div id="right" style="float:right;"></div>    <div style="clear:both;"></div></div><div id="container-top"></div><div id="container-bottom"></div>','<div id="container">    <div id="top"></div>    <div id="left" style="float:left;"></div>    <div id="right" style="float:right;"></div>    <div style="clear:both;"></div></div><div id="container-top"></div><div id="container-bottom"></div>','<div id="container">    <div id="top"></div>    <div id="left" style="float:left;"></div>    <div id="right" style="float:right;"></div>    <div style="clear:both;"></div></div><div id="container-top"></div><div id="container-bottom"></div>','<div id="container">    <div id="top"></div>    <div id="left" style="float:left;"></div>    <div id="right" style="float:right;"></div>    <div style="clear:both;"></div></div><div id="container-top"></div><div id="container-bottom"></div>','<div id="page-title"></div><div id="basic-query-builder"></div><div id="advanced-query-builder"></div><div id="search-button"></div><div id="export-button"></div><div id="organization-grid"></div>','<div class="report">    <div class="report-title">SupplyPoint&reg; Statistics Information</div>    <div>        <table width="100%" class="report-table">            <tbody><tr><td colspan="2">&nbsp;</td></tr><tr>                <td><span style="font-weight:bold;">Number of Companies</span></td><td><a href="#ReportQueryBuilder/resulttype/companies">{numberOfCompanies}</a></td>            </tr><tr>                <td><span>Number of Machine Shops</span></td><td><a href="#ReportQueryBuilder/resulttype/machineshops">{numberOfMachineShops}</a></td>            </tr><tr>                <td><span>Number of Validated Shops</span></td><td>{numberOfValidatedShops}</td>            </tr><tr><td colspan="2">&nbsp;</td></tr><tr>                <td colspan="2"><span style="font-weight:bold;">Machines</span></td>            </tr><tr>                <td><span>Mill Machines</span></td><td><a href="#ReportQueryBuilder/resulttype/M">{millsMachines}</a></td>            </tr><tr>                <td><span>Turn Machines</span></td><td><a href="#ReportQueryBuilder/resulttype/T">{turnMachines}</a></td>            </tr><tr>                <td><span>Combo Machines (Mill/Turn)</span></td><td><a href="#ReportQueryBuilder/resulttype/C">{comboMachines}</a></td>            </tr><tr>                <td><span>EDM Machines</span></td><td><a href="#ReportQueryBuilder/resulttype/E">{edmMachines}</a></td>            </tr><tr>                <td><span style="font-weight:bold;">Total Number of Machines</span></td><td>{totalNumberOfMachines}</td>            </tr><tr><td colspan="2">&nbsp;</td></tr><tr>                <td><span>User Logins Today</span></td><td>{usersLoginToday}</td>            </tr><tr>                <td><span>Today\'s New Registrations</span></td><td>{todaysNewRegistrations}</td>            </tr><tr><td colspan="2">&nbsp;</td></tr><tr><td colspan="2">&nbsp;</td>            </tr></tbody>        </table>    </div></div>','<div class="report">    <div class="report-title">        SupplyPoint&reg; Profile Report</div>    <div id="companyprofilecontainer">    </div>    <table cellpadding="0" cellspacing="0"><tr><td style="width:700px"></td><td ><div id="returnButton"></div></td></tr></table>    <table width="100%" class="report-table">        <tbody>            <tr>                <td style="width:50%">                    <span>SupplyPoint ID:</span>                </td>                <td>                    {sequenceId}                </td>            </tr>            <tr>                <td>                    <span>Company Name:</span>                </td>                <td>                    {organizationName}                </td>            </tr>            <tr>                <td>                    <span>Address:</span>                </td>                <td>                    {address}                </td>            </tr>            <tr>                <td>                    <span>Year Established:</span>                </td>                <td>                    {yearStablished}                </td>            </tr>            <tr>                <td>                    <span>WebSite:</span>                </td>                <td>                    {webSite}                </td>            </tr>            <tr>                <td colspan="2">                    &nbsp;                </td>            </tr>            <tr>                <td>                    <span>Primary Contact:</span>                </td>                <td>                    {contactName}                </td>            </tr>            <tr>                <td>                    <span>Contact Phone:</span>                </td>                <td>                    {contactPhone}                </td>            </tr>            <tr>                <td>                    <span>Contact Email:</span>                </td>                <td>                    {contactEamil}                </td>            </tr>            <tr>                <td colspan="2">                    &nbsp;                </td>            </tr>            <tr>                <td>                    <span>NAICS Code:</span>                </td>                <td>                    {naicCode}                </td>            </tr>            <tr>                <td>                    <span>Total Personnel:</span>                </td>                <td>                    {productionArea}                </td>            </tr>            <tr>                <td>                    <span>Total Square Footage:</span>                </td>                <td>                    {productionPersonnel}                </td>            </tr>            <tr>                <td>                    <span>Shifts:</span>                </td>                <td>                    {numberOfShift}                </td>            </tr>            <tr>                <td colspan="2">                    &nbsp;                </td>            </tr>            <tr>                <td>                    <span>CAD Platform</span>                </td>                <td>                    {cadTitle}                </td>            </tr>            <tr>                <td>                    <span>CAM Platform</span>                </td>                <td>                    {camTitle}                </td>            </tr>            <tr>                <td>                    <span>Engineering Personnel:</span>                </td>                <td>                    {engineeringPersonnel}                </td>            </tr>            <tr>                <td colspan="2">                    &nbsp;                </td>            </tr>            <tr>                <td>                    <span>Inspection System</span>                </td>                <td>                    0                </td>            </tr>            <tr>                <td colspan="2">                    &nbsp;                </td>            </tr>            <tr>                <td>                    <span>Cage Code</span>                </td>                <td>                    {cageCode}                </td>            </tr>            <tr>                <td>                    <span>Veteran Owned</span>                </td>                <td>                    {veteranOwned}                </td>            </tr>            <tr>                <td>                    <span>Disabled Veteran</span>                </td>                <td>                    {disabledVeteran}                </td>            </tr>            <tr>                <td>                    <span>Woman Owned</span>                </td>                <td>                    {womanOwned}                </td>            </tr>            <tr>                <td>                    <span>SBA8a</span>                </td>                <td>                    {sBA8a}                </td>            </tr>            <tr>                <td>                    <span>Hub Zone</span>                </td>                <td>                    {hubZone}                </td>            </tr>            <tr>                <td colspan="2">                    &nbsp;                </td>            </tr>            <tr>                <td>                    <span>Business Operation Description</span>                </td>                <td>                    {businessDescription}                </td>            </tr>            <tr>                <td>                    <span>Product Description</span>                </td>                <td>                    {productDescription}                </td>            </tr>            <tr>                <td colspan="2">                    &nbsp;                </td>            </tr>            <tr>                <td>                    <span>Validated By</span>                </td>                <td>                    0                </td>            </tr>            <tr>                <td>                    <span>Validated Date</span>                </td>                <td>                    0                </td>            </tr>            <tr>                <td>                    <span>More Information</span>                </td>                <td>                    {moreInfo}                </td>            </tr>        </tbody>    </table></div>','<div class="report">    <div class="report-title">SupplyPoint&reg; Profile Report CNC Capability</div>   <div><table cellpadding="0" cellspacing="0"><tr><td><div id="companyInfo" style="width:700px"></div></td><td><div id="returnButton" style=" float:none"></div></td></tr></table></div>    <div class="section-title">Mill Machine</div>    <div id="millMachineContainer"></div>    <div class="section-title">Turn Machine</div>    <div id="turnMachineContainer"></div>    <div class="section-title">Mill/Turn Machine</div>    <div id="comboMachineContainer"></div>        <div class="section-title">EDM Machine</div>    <div id="edmMachineContainer"></div>   </div>',""];
WebLight.namespace("SP.object");SP.object.Facility=WebLight.data.Record.create([{name:"facilityId",type:"string"},{name:"organizationId",type:"string"},{name:"addressId",type:"string"},{name:"address1",type:"string"},{name:"address2",type:"string"},{name:"address3",type:"string"},{name:"city",type:"string"},{name:"state",type:"string"},{name:"zipCode",type:"string"},{name:"county",type:"string"},{name:"manufacturer",type:"auto"},{name:"productDescription",type:"string"},{name:"productionPersonnel",type:"int"},{name:"engineeringPersonnel",type:"int"},{name:"numberOfShift",type:"int"},{name:"productionArea",type:"int"},{name:"prototypingLowVolume",type:"auto"},{name:"prototypingHighVolume",type:"auto"},{name:"manual",type:"auto"},{name:"cmm",type:"auto"},{name:"other",type:"auto"},{name:"cmmInspectionName",type:"string"},{name:"isReadOnly",type:"auto"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.FacilityStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};Ext.apply(a,{otype:"Facility",autoLoad:false,recordType:SP.object.Facility});
SP.object.FacilityStore.superclass.constructor.call(this,a);}});SP.object.PostCode=WebLight.data.Record.create([{name:"postCodeId",type:"string"},{name:"machineMakeId",type:"string"},{name:"machineModelId",type:"string"},{name:"controllerMakeId",type:"string"},{name:"controllerModelId",type:"string"},{name:"description",type:"string"},{name:"machineMakeTitle",type:"string"},{name:"machineModelTitle",type:"string"},{name:"controllerMakeTitle",type:"string"},{name:"controllerModelTitle",type:"string"},{name:"machineType",type:"string"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.PostCodeStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};Ext.apply(a,{otype:"PostCode",autoLoad:false,recordType:SP.object.PostCode});
SP.object.PostCodeStore.superclass.constructor.call(this,a);}});SP.object.MachineModel=WebLight.data.Record.create([{name:"machineModelId",type:"string"},{name:"title",type:"string"},{name:"machineMakeId",type:"string"},{name:"friendlyId",type:"string"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.MachineModelStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};
Ext.apply(a,{otype:"MachineModel",autoLoad:false,recordType:SP.object.MachineModel});SP.object.MachineModelStore.superclass.constructor.call(this,a);
}});SP.object.CncMachine=WebLight.data.Record.create([{name:"machineId",type:"string"},{name:"sequenceId",type:"int"},{name:"facilityId",type:"string"},{name:"machineMakeId",type:"string"},{name:"machineModelId",type:"string"},{name:"controllerMakeId",type:"string"},{name:"controllerModelId",type:"string"},{name:"machineMakeTitle",type:"string"},{name:"machineModelTitle",type:"string"},{name:"controllerMakeTitle",type:"string"},{name:"controllerModelTitle",type:"string"},{name:"machineMakeFriendlyTitle",type:"string"},{name:"machineModelFriendlyTitle",type:"string"},{name:"controllerMakeFriendlyTitle",type:"string"},{name:"controllerModelFriendlyTitle",type:"string"},{name:"progProtocol",type:"int"},{name:"specialFeatures",type:"string"},{name:"machineQuantity",type:"int"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.CncMachineStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};Ext.apply(a,{otype:"CncMachine",autoLoad:false,recordType:SP.object.CncMachine});
SP.object.CncMachineStore.superclass.constructor.call(this,a);}});SP.object.CncTurning=WebLight.data.Record.create([{name:"typeOfMachine",type:"int"},{name:"liveTooling",type:"auto"},{name:"noOfAxes",type:"int"},{name:"lowerTurret",type:"auto"},{name:"subSpindle",type:"auto"},{name:"barFeeder",type:"auto"},{name:"maxTurnLength",type:"int"},{name:"maxRPM",type:"int"},{name:"maxChuckSize",type:"int"},{name:"machineId",type:"string"},{name:"sequenceId",type:"int"},{name:"facilityId",type:"string"},{name:"machineMakeId",type:"string"},{name:"machineModelId",type:"string"},{name:"controllerMakeId",type:"string"},{name:"controllerModelId",type:"string"},{name:"machineMakeTitle",type:"string"},{name:"machineModelTitle",type:"string"},{name:"controllerMakeTitle",type:"string"},{name:"controllerModelTitle",type:"string"},{name:"machineMakeFriendlyTitle",type:"string"},{name:"machineModelFriendlyTitle",type:"string"},{name:"controllerMakeFriendlyTitle",type:"string"},{name:"controllerModelFriendlyTitle",type:"string"},{name:"progProtocol",type:"int"},{name:"specialFeatures",type:"string"},{name:"machineQuantity",type:"int"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.CncTurningStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};Ext.apply(a,{otype:"CncTurning",autoLoad:false,recordType:SP.object.CncTurning});
SP.object.CncTurningStore.superclass.constructor.call(this,a);}});SP.object.CncCombo=WebLight.data.Record.create([{name:"typeOfMachine",type:"int"},{name:"liveTooling",type:"auto"},{name:"noOfAxes",type:"int"},{name:"lowerTurret",type:"auto"},{name:"subSpindle",type:"auto"},{name:"barFeeder",type:"auto"},{name:"maxTurnLength",type:"int"},{name:"maxRPM",type:"int"},{name:"maxChuckSize",type:"int"},{name:"machineId",type:"string"},{name:"sequenceId",type:"int"},{name:"facilityId",type:"string"},{name:"machineMakeId",type:"string"},{name:"machineModelId",type:"string"},{name:"controllerMakeId",type:"string"},{name:"controllerModelId",type:"string"},{name:"machineMakeTitle",type:"string"},{name:"machineModelTitle",type:"string"},{name:"controllerMakeTitle",type:"string"},{name:"controllerModelTitle",type:"string"},{name:"machineMakeFriendlyTitle",type:"string"},{name:"machineModelFriendlyTitle",type:"string"},{name:"controllerMakeFriendlyTitle",type:"string"},{name:"controllerModelFriendlyTitle",type:"string"},{name:"progProtocol",type:"int"},{name:"specialFeatures",type:"string"},{name:"machineQuantity",type:"int"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.CncComboStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};Ext.apply(a,{otype:"CncCombo",autoLoad:false,recordType:SP.object.CncCombo});
SP.object.CncComboStore.superclass.constructor.call(this,a);}});SP.object.NewSearchReportExt=WebLight.data.Record.create([{name:"state",type:"string"},{name:"noMeasure",type:"auto"},{name:"companyCount",type:"int"},{name:"machineCount",type:"int"},{name:"organizations",type:"auto"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.NewSearchReportExt.search=function(a,f,c,d,b){var e=Ext.encode({machineType:a,startDate:f,endDate:c,axes:d});
return WebLight.post(WebLight.getMethodUrl("NewSearchReportExt","search"),e,function(g){if(!g){g={result:{},status:500};
}if(g.status==401){WebLight.PageMgr.fireEvent("accessDenied");}if(b){b(g.result,g.status);}});};SP.object.NewSearchReportExtStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};
Ext.apply(a,{otype:"NewSearchReportExt",autoLoad:false,recordType:SP.object.NewSearchReportExt});SP.object.NewSearchReportExtStore.superclass.constructor.call(this,a);
}});SP.object.OrgSystem=WebLight.data.Record.create([{name:"id",type:"int"},{name:"systemId",type:"int"},{name:"title",type:"string"},{name:"facilityId",type:"string"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.OrgSystemStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};Ext.apply(a,{otype:"OrgSystem",autoLoad:false,recordType:SP.object.OrgSystem});
SP.object.OrgSystemStore.superclass.constructor.call(this,a);}});SP.object.CadApply=WebLight.data.Record.create([{name:"id",type:"int"},{name:"systemId",type:"int"},{name:"title",type:"string"},{name:"facilityId",type:"string"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.CadApplyStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};Ext.apply(a,{otype:"CadApply",autoLoad:false,recordType:SP.object.CadApply});
SP.object.CadApplyStore.superclass.constructor.call(this,a);}});SP.object.CSystem=WebLight.data.Record.create([{name:"systemId",type:"int"},{name:"title",type:"string"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.CSystemStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};Ext.apply(a,{otype:"CSystem",autoLoad:false,recordType:SP.object.CSystem,idProperty:"systemId"});
SP.object.CSystemStore.superclass.constructor.call(this,a);}});SP.object.CncMilling=WebLight.data.Record.create([{name:"typeOfMachine",type:"int"},{name:"noOfAxes",type:"int"},{name:"indexer",type:"auto"},{name:"palletChanger",type:"auto"},{name:"thruCoolant",type:"auto"},{name:"maxRPM",type:"int"},{name:"machineId",type:"string"},{name:"sequenceId",type:"int"},{name:"facilityId",type:"string"},{name:"machineMakeId",type:"string"},{name:"machineModelId",type:"string"},{name:"controllerMakeId",type:"string"},{name:"controllerModelId",type:"string"},{name:"machineMakeTitle",type:"string"},{name:"machineModelTitle",type:"string"},{name:"controllerMakeTitle",type:"string"},{name:"controllerModelTitle",type:"string"},{name:"machineMakeFriendlyTitle",type:"string"},{name:"machineModelFriendlyTitle",type:"string"},{name:"controllerMakeFriendlyTitle",type:"string"},{name:"controllerModelFriendlyTitle",type:"string"},{name:"progProtocol",type:"int"},{name:"specialFeatures",type:"string"},{name:"machineQuantity",type:"int"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.CncMillingStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};Ext.apply(a,{otype:"CncMilling",autoLoad:false,recordType:SP.object.CncMilling});
SP.object.CncMillingStore.superclass.constructor.call(this,a);}});SP.object.User=WebLight.data.Record.create([{name:"email",type:"string"},{name:"password",type:"string"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.User.signIn=function(c,a,d){var b=Ext.encode({email:c,password:a});return WebLight.post(WebLight.getMethodUrl("User","signIn"),b,function(e){if(!e){e={result:{},status:500};
}if(e.status==401){WebLight.PageMgr.fireEvent("accessDenied");}if(d){d(e.result,e.status);}});};SP.object.User.signOut=function(b){var a=Ext.encode({});
return WebLight.post(WebLight.getMethodUrl("User","signOut"),a,function(c){if(!c){c={result:{},status:500};
}if(c.status==401){WebLight.PageMgr.fireEvent("accessDenied");}if(b){b(c.result,c.status);}});};SP.object.User.changePassword=function(a,c,d){var b=Ext.encode({oldPassword:a,newPassword:c});
return WebLight.post(WebLight.getMethodUrl("User","changePassword"),b,function(e){if(!e){e={result:{},status:500};
}if(e.status==401){WebLight.PageMgr.fireEvent("accessDenied");}if(d){d(e.result,e.status);}});};SP.object.UserStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};
Ext.apply(a,{otype:"User",autoLoad:false,recordType:SP.object.User});SP.object.UserStore.superclass.constructor.call(this,a);
}});SP.object.OtherUser=WebLight.data.Record.create([{name:"otherUserId",type:"string"},{name:"firstName",type:"string"},{name:"middleName",type:"string"},{name:"lastName",type:"string"},{name:"accessType",type:"string"},{name:"email",type:"string"},{name:"password",type:"string"},{name:"passwordConfirm",type:"string"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.OtherUserStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};Ext.apply(a,{otype:"OtherUser",autoLoad:false,recordType:SP.object.OtherUser});
SP.object.OtherUserStore.superclass.constructor.call(this,a);}});SP.object.CncEDM=WebLight.data.Record.create([{name:"ramWire",type:"auto"},{name:"travelX",type:"int"},{name:"travelY",type:"int"},{name:"travelZ",type:"int"},{name:"sqInXHour",type:"int"},{name:"toolChanger",type:"auto"},{name:"maxCapacity",type:"int"},{name:"machineId",type:"string"},{name:"sequenceId",type:"int"},{name:"facilityId",type:"string"},{name:"machineMakeId",type:"string"},{name:"machineModelId",type:"string"},{name:"controllerMakeId",type:"string"},{name:"controllerModelId",type:"string"},{name:"machineMakeTitle",type:"string"},{name:"machineModelTitle",type:"string"},{name:"controllerMakeTitle",type:"string"},{name:"controllerModelTitle",type:"string"},{name:"machineMakeFriendlyTitle",type:"string"},{name:"machineModelFriendlyTitle",type:"string"},{name:"controllerMakeFriendlyTitle",type:"string"},{name:"controllerModelFriendlyTitle",type:"string"},{name:"progProtocol",type:"int"},{name:"specialFeatures",type:"string"},{name:"machineQuantity",type:"int"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.CncEDMStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};Ext.apply(a,{otype:"CncEDM",autoLoad:false,recordType:SP.object.CncEDM});
SP.object.CncEDMStore.superclass.constructor.call(this,a);}});SP.object.Mep=WebLight.data.Record.create([{name:"mepId",type:"string"},{name:"title",type:"string"},{name:"phone",type:"string"},{name:"friendlyId",type:"int"},{name:"address1",type:"string"},{name:"address2",type:"string"},{name:"address3",type:"string"},{name:"city",type:"string"},{name:"state",type:"string"},{name:"zipCode",type:"string"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.MepStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};Ext.apply(a,{otype:"Mep",autoLoad:false,recordType:SP.object.Mep});
SP.object.MepStore.superclass.constructor.call(this,a);}});SP.object.MachineMake=WebLight.data.Record.create([{name:"machineMakeId",type:"string"},{name:"title",type:"string"},{name:"machineType",type:"string"},{name:"friendlyId",type:"string"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.MachineMakeStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};Ext.apply(a,{otype:"MachineMake",autoLoad:false,recordType:SP.object.MachineMake});
SP.object.MachineMakeStore.superclass.constructor.call(this,a);}});SP.object.ControllerMake=WebLight.data.Record.create([{name:"controllerMakeId",type:"string"},{name:"title",type:"string"},{name:"machineType",type:"string"},{name:"friendlyId",type:"string"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.ControllerMakeStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};
Ext.apply(a,{otype:"ControllerMake",autoLoad:false,recordType:SP.object.ControllerMake});SP.object.ControllerMakeStore.superclass.constructor.call(this,a);
}});SP.object.ContactMessage=WebLight.data.Record.create([{name:"feedbackId",type:"string"},{name:"categoryId",type:"int"},{name:"categoryName",type:"string"},{name:"contactName",type:"string"},{name:"phone",type:"string"},{name:"email",type:"string"},{name:"company",type:"string"},{name:"subject",type:"string"},{name:"body",type:"string"},{name:"notes",type:"string"},{name:"date",type:"date"},{name:"time",type:"date"},{name:"issueResolved",type:"auto"},{name:"resolvedDate",type:"date"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.ContactMessage.prototype.save=function(b){var a=Ext.encode(this.data);return WebLight.post(WebLight.getMethodUrl("ContactMessage","save"),a,function(c){if(!c){c={result:{},status:500};
}if(c.status==401){WebLight.PageMgr.fireEvent("accessDenied");}if(b){b(c.result,c.status);}});};SP.object.ContactMessageStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};
Ext.apply(a,{otype:"ContactMessage",autoLoad:false,recordType:SP.object.ContactMessage});SP.object.ContactMessageStore.superclass.constructor.call(this,a);
}});SP.object.CamApply=WebLight.data.Record.create([{name:"id",type:"int"},{name:"systemId",type:"int"},{name:"title",type:"string"},{name:"facilityId",type:"string"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.CamApplyStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};Ext.apply(a,{otype:"CamApply",autoLoad:false,recordType:SP.object.CamApply});
SP.object.CamApplyStore.superclass.constructor.call(this,a);}});SP.object.Cad=WebLight.data.Record.create([{name:"systemId",type:"int"},{name:"title",type:"string"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.CadStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};Ext.apply(a,{otype:"Cad",autoLoad:false,recordType:SP.object.Cad,idProperty:"systemId"});
SP.object.CadStore.superclass.constructor.call(this,a);}});SP.object.Statistics=WebLight.data.Record.create([{name:"numberOfCompanies",type:"int"},{name:"numberOfMachineShops",type:"int"},{name:"numberOfValidatedShops",type:"int"},{name:"millsMachines",type:"int"},{name:"turnMachines",type:"int"},{name:"comboMachines",type:"int"},{name:"edmMachines",type:"int"},{name:"totalNumberOfMachines",type:"int"},{name:"usersLoginToday",type:"int"},{name:"todaysNewRegistrations",type:"int"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.Statistics.prototype.getStatistics=function(b){var a=Ext.encode(this.data);return WebLight.post(WebLight.getMethodUrl("Statistics","getStatistics"),a,function(c){if(!c){c={result:{},status:500};
}if(c.status==401){WebLight.PageMgr.fireEvent("accessDenied");}if(b){b(c.result,c.status);}});};SP.object.StatisticsStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};
Ext.apply(a,{otype:"Statistics",autoLoad:false,recordType:SP.object.Statistics});SP.object.StatisticsStore.superclass.constructor.call(this,a);
}});SP.object.CompanyStatistic=WebLight.data.Record.create([{name:"state",type:"string"},{name:"companyCount",type:"int"},{name:"machineCount",type:"int"},{name:"organizations",type:"auto"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.CompanyStatistic.search=function(a,c){var b=Ext.encode({companyType:a});return WebLight.post(WebLight.getMethodUrl("CompanyStatistic","search"),b,function(d){if(!d){d={result:{},status:500};
}if(d.status==401){WebLight.PageMgr.fireEvent("accessDenied");}if(c){c(d.result,d.status);}});};SP.object.CompanyStatisticStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};
Ext.apply(a,{otype:"CompanyStatistic",autoLoad:false,recordType:SP.object.CompanyStatistic});SP.object.CompanyStatisticStore.superclass.constructor.call(this,a);
}});SP.object.NaicCode=WebLight.data.Record.create([{name:"naicId",type:"int"},{name:"title",type:"string"},{name:"code",type:"string"},{name:"codeAndTitle",type:"string"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.NaicCodeStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};Ext.apply(a,{otype:"NaicCode",autoLoad:false,recordType:SP.object.NaicCode});
SP.object.NaicCodeStore.superclass.constructor.call(this,a);}});SP.object.ControllerModel=WebLight.data.Record.create([{name:"controllerModelId",type:"string"},{name:"title",type:"string"},{name:"controllerMakeId",type:"string"},{name:"friendlyId",type:"string"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.ControllerModelStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};
Ext.apply(a,{otype:"ControllerModel",autoLoad:false,recordType:SP.object.ControllerModel});SP.object.ControllerModelStore.superclass.constructor.call(this,a);
}});SP.object.MepUser=WebLight.data.Record.create([{name:"mepUserId",type:"string"},{name:"phone",type:"string"},{name:"email",type:"string"},{name:"mepTitle",type:"string"},{name:"mepId",type:"string"},{name:"address1",type:"string"},{name:"address2",type:"string"},{name:"address3",type:"string"},{name:"city",type:"string"},{name:"state",type:"string"},{name:"zipCode",type:"string"},{name:"accessTypeId",type:"int"},{name:"accessType",type:"string"},{name:"password",type:"string"},{name:"firstName",type:"string"},{name:"middleName",type:"string"},{name:"lastName",type:"string"},{name:"hasAddress",type:"auto"},{name:"fullName",type:"string"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.MepUserStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};Ext.apply(a,{otype:"MepUser",autoLoad:false,recordType:SP.object.MepUser});
SP.object.MepUserStore.superclass.constructor.call(this,a);}});SP.object.MepUserAssigned=WebLight.data.Record.create([{name:"mepUserId",type:"string"},{name:"phone",type:"string"},{name:"email",type:"string"},{name:"mepTitle",type:"string"},{name:"mepId",type:"string"},{name:"address1",type:"string"},{name:"address2",type:"string"},{name:"address3",type:"string"},{name:"city",type:"string"},{name:"state",type:"string"},{name:"zipCode",type:"string"},{name:"accessTypeId",type:"int"},{name:"accessType",type:"string"},{name:"password",type:"string"},{name:"firstName",type:"string"},{name:"middleName",type:"string"},{name:"lastName",type:"string"},{name:"hasAddress",type:"auto"},{name:"fullName",type:"string"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.MepUserAssignedStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};
Ext.apply(a,{otype:"MepUserAssigned",autoLoad:false,recordType:SP.object.MepUserAssigned});SP.object.MepUserAssignedStore.superclass.constructor.call(this,a);
}});SP.object.MachineByDateRangerReport=WebLight.data.Record.create([{name:"companyId",type:"int"},{name:"organizationName",type:"string"},{name:"machineMakeId",type:"string"},{name:"machineModelId",type:"string"},{name:"controllerMakeId",type:"string"},{name:"controllerModelId",type:"string"},{name:"mepId",type:"string"},{name:"mepUserId",type:"string"},{name:"machineMake",type:"string"},{name:"machineModel",type:"string"},{name:"controllerMake",type:"string"},{name:"controllerModel",type:"string"},{name:"sequenceId",type:"int"},{name:"companyName",type:"string"},{name:"mepTitle",type:"string"},{name:"mepUserTitle",type:"string"},{name:"dateEntered",type:"date"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.MachineByDateRangerReportStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};
Ext.apply(a,{otype:"MachineByDateRangerReport",autoLoad:false,recordType:SP.object.MachineByDateRangerReport});
SP.object.MachineByDateRangerReportStore.superclass.constructor.call(this,a);}});SP.object.MachineByStateReport=WebLight.data.Record.create([{name:"state",type:"string"},{name:"millMachineCount",type:"int"},{name:"turnMachineCount",type:"int"},{name:"comboMachineCount",type:"int"},{name:"edmMachineCount",type:"int"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.MachineByStateReportStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};
Ext.apply(a,{otype:"MachineByStateReport",autoLoad:false,recordType:SP.object.MachineByStateReport});
SP.object.MachineByStateReportStore.superclass.constructor.call(this,a);}});SP.object.Contact=WebLight.data.Record.create([{name:"organizationId",type:"string"},{name:"contactId",type:"string"},{name:"firstName",type:"string"},{name:"middleName",type:"string"},{name:"lastName",type:"string"},{name:"position",type:"string"},{name:"phone",type:"string"},{name:"email",type:"string"},{name:"loginemail",type:"string"},{name:"password",type:"string"},{name:"passwordConfirm",type:"string"},{name:"isAllowLogin",type:"auto"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.ContactStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};Ext.apply(a,{otype:"Contact",autoLoad:false,recordType:SP.object.Contact});
SP.object.ContactStore.superclass.constructor.call(this,a);}});SP.object.Organization3=WebLight.data.Record.create([{name:"organizationId",type:"string"},{name:"sequenceId",type:"int"},{name:"organizationName",type:"string"},{name:"address",type:"string"},{name:"yearStablished",type:"int"},{name:"webSite",type:"string"},{name:"naicCode",type:"string"},{name:"productionArea",type:"int"},{name:"productionPersonnel",type:"int"},{name:"numberOfShift",type:"int"},{name:"cadTitle",type:"string"},{name:"camTitle",type:"string"},{name:"engineeringPersonnel",type:"int"},{name:"cageCode",type:"string"},{name:"veteranOwned",type:"auto"},{name:"disabledVeteran",type:"auto"},{name:"womanOwned",type:"auto"},{name:"sBA8a",type:"auto"},{name:"hubZone",type:"auto"},{name:"businessDescription",type:"string"},{name:"productDescription",type:"string"},{name:"moreInfo",type:"string"},{name:"contactName",type:"string"},{name:"contactPhone",type:"string"},{name:"contactEamil",type:"string"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.Organization3Store=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};
Ext.apply(a,{otype:"Organization3",autoLoad:false,recordType:SP.object.Organization3});SP.object.Organization3Store.superclass.constructor.call(this,a);
}});SP.object.EmailLog=WebLight.data.Record.create([{name:"organizationName",type:"string"},{name:"fromEmail",type:"string"},{name:"organizationId",type:"string"},{name:"contactId",type:"string"},{name:"firstName",type:"string"},{name:"middleName",type:"string"},{name:"lastName",type:"string"},{name:"position",type:"string"},{name:"phone",type:"string"},{name:"email",type:"string"},{name:"loginemail",type:"string"},{name:"password",type:"string"},{name:"passwordConfirm",type:"string"},{name:"isAllowLogin",type:"auto"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.EmailLog.sendEmail=function(b,g,a,d,f,c){var e=Ext.encode({fromEmail:b,toEmail:g,contactId:a,message:d,subject:f});
return WebLight.post(WebLight.getMethodUrl("EmailLog","sendEmail"),e,function(h){if(!h){h={result:{},status:500};
}if(h.status==401){WebLight.PageMgr.fireEvent("accessDenied");}if(c){c(h.result,h.status);}});};SP.object.EmailLog.sendLoginEmail=function(a,c){var b=Ext.encode({contactRefId:a});
return WebLight.post(WebLight.getMethodUrl("EmailLog","sendLoginEmail"),b,function(d){if(!d){d={result:{},status:500};
}if(d.status==401){WebLight.PageMgr.fireEvent("accessDenied");}if(c){c(d.result,d.status);}});};SP.object.EmailLogStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};
Ext.apply(a,{otype:"EmailLog",autoLoad:false,recordType:SP.object.EmailLog});SP.object.EmailLogStore.superclass.constructor.call(this,a);
}});SP.object.Organization2=WebLight.data.Record.create([{name:"organizationId",type:"string"},{name:"organizationName",type:"string"},{name:"state",type:"string"},{name:"phone",type:"string"},{name:"enterDate",type:"date"},{name:"machineCount",type:"int"},{name:"matchedMachineCount",type:"int"},{name:"sequenceId",type:"int"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.Organization2Store=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};
Ext.apply(a,{otype:"Organization2",autoLoad:false,recordType:SP.object.Organization2});SP.object.Organization2Store.superclass.constructor.call(this,a);
}});SP.object.Organization=WebLight.data.Record.create([{name:"organizationId",type:"string"},{name:"organizationName",type:"string"},{name:"yearStablished",type:"int"},{name:"webSite",type:"string"},{name:"phone",type:"string"},{name:"moreInfo",type:"string"},{name:"cageCode",type:"string"},{name:"userName",type:"string"},{name:"mepName",type:"string"},{name:"state",type:"string"},{name:"companyId",type:"int"},{name:"mepId",type:"string"},{name:"mepUserId",type:"string"},{name:"isoCode",type:"string"},{name:"otherCertification",type:"string"},{name:"aeroCode",type:"string"},{name:"smallBusiness",type:"auto"},{name:"samllDisadvantage",type:"auto"},{name:"veteranOwned",type:"auto"},{name:"disabledVeteran",type:"auto"},{name:"indianOwned",type:"auto"},{name:"womanOwned",type:"auto"},{name:"sBA8a",type:"auto"},{name:"hubZone",type:"auto"},{name:"outsourceWork",type:"auto"},{name:"incorporateCnc",type:"auto"},{name:"businessDescription",type:"string"},{name:"searchStartDate",type:"date"},{name:"searchEndDate",type:"date"},{name:"validatedBy",type:"string"},{name:"validatedDate",type:"date"},{name:"isReadOnly",type:"auto"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.Organization.register=function(f,c,a,e,b,g){var d=Ext.encode({companyName:f,firstName:c,lastName:a,email:e,password:b});
return WebLight.post(WebLight.getMethodUrl("Organization","register"),d,function(h){if(!h){h={result:{},status:500};
}if(h.status==401){WebLight.PageMgr.fireEvent("accessDenied");}if(g){g(h.result,h.status);}});};SP.object.Organization.deleteOrganizations=function(a,c){var b=Ext.encode({organizationIDs:a});
return WebLight.post(WebLight.getMethodUrl("Organization","deleteOrganizations"),b,function(d){if(!d){d={result:{},status:500};
}if(d.status==401){WebLight.PageMgr.fireEvent("accessDenied");}if(c){c(d.result,d.status);}});};SP.object.OrganizationStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};
Ext.apply(a,{otype:"Organization",autoLoad:false,recordType:SP.object.Organization});SP.object.OrganizationStore.superclass.constructor.call(this,a);
}});SP.object.Cam=WebLight.data.Record.create([{name:"systemId",type:"int"},{name:"title",type:"string"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.CamStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};Ext.apply(a,{otype:"Cam",autoLoad:false,recordType:SP.object.Cam,idProperty:"systemId"});
SP.object.CamStore.superclass.constructor.call(this,a);}});SP.object.MepExt=WebLight.data.Record.create([{name:"mepId",type:"string"},{name:"title",type:"string"},{name:"mepusers",type:"auto"},{name:"mepUserCount",type:"int"},{name:"noMeasure",type:"auto"}]);
SP.object.MepExt.search=function(d,e,a,c){var b=Ext.encode({mepRefId:d,startDate:e,endDate:a});return WebLight.post(WebLight.getMethodUrl("MepExt","search"),b,function(f){if(!f){f={result:{},status:500};
}if(f.status==401){WebLight.PageMgr.fireEvent("accessDenied");}if(c){c(f.result,f.status);}});};SP.object.MepExtStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};
Ext.apply(a,{otype:"MepExt",autoLoad:false,recordType:SP.object.MepExt});SP.object.MepExtStore.superclass.constructor.call(this,a);
}});SP.object.MepUserExt=WebLight.data.Record.create([{name:"mepUserId",type:"string"},{name:"name",type:"string"},{name:"organizations",type:"auto"},{name:"organizationCount",type:"int"},{name:"noOrganization",type:"auto"}]);
SP.object.MepUserExtStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};Ext.apply(a,{otype:"MepUserExt",autoLoad:false,recordType:SP.object.MepUserExt});
SP.object.MepUserExtStore.superclass.constructor.call(this,a);}});SP.object.OrganizationExt=WebLight.data.Record.create([{name:"name",type:"string"},{name:"address",type:"string"},{name:"address1",type:"string"},{name:"city",type:"string"},{name:"state",type:"string"},{name:"zipCode",type:"string"},{name:"machines",type:"auto"},{name:"machineCount",type:"int"},{name:"noMeasure",type:"auto"}]);
SP.object.OrganizationExtStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};
Ext.apply(a,{otype:"OrganizationExt",autoLoad:false,recordType:SP.object.OrganizationExt});SP.object.OrganizationExtStore.superclass.constructor.call(this,a);
}});SP.object.MachineExt=WebLight.data.Record.create([{name:"name",type:"string"},{name:"date",type:"date"},{name:"machineMakeTitle",type:"string"},{name:"machineModelTitle",type:"string"},{name:"controllerMakeTitle",type:"string"},{name:"controllerModelTitle",type:"string"}]);
SP.object.MachineExtStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};Ext.apply(a,{otype:"MachineExt",autoLoad:false,recordType:SP.object.MachineExt});
SP.object.MachineExtStore.superclass.constructor.call(this,a);}});SP.object.NaicAssign=WebLight.data.Record.create([{name:"organizationId",type:"string"},{name:"naicId",type:"int"},{name:"title",type:"string"},{name:"code",type:"string"},{name:"naicAssignId",type:"int"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.NaicAssignStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};Ext.apply(a,{otype:"NaicAssign",autoLoad:false,recordType:SP.object.NaicAssign});
SP.object.NaicAssignStore.superclass.constructor.call(this,a);}});SP.object.EmailSetUp=WebLight.data.Record.create([{name:"otherEmail",type:"string"},{name:"contactEmail",type:"string"},{name:"massEmail",type:"string"},{name:"_sysTime",type:"auto"},{name:"_sysStatus",type:"int"}]);
SP.object.EmailSetUpStore=WebLight.extend(WebLight.data.JsonStore,{constructor:function(a){a=a||{};Ext.apply(a,{otype:"EmailSetUp",autoLoad:false,recordType:SP.object.EmailSetUp});
SP.object.EmailSetUpStore.superclass.constructor.call(this,a);}});WebLight.namespace("SP","Sp");SP.context={username:"",fullname:"",userId:"",organizationId:"",isAuthenticated:false,isSuperUser:false,isMepAdministrator:false,isMepUser:false,isContact:false};
$(function(){if($("#login-field").length){if(SP.context.isAuthenticated){var a=$("#sidebar .main-nav");
var c=String.format('<li><a href="{0}" class="white bold font12pt"><span>{1}</span></a></li>');if(SP.context.isContact){a.append(String.format(c,"Summary.aspx","Summary"));
}else{a.append(String.format(c,"BackOffice.aspx","Back Office"));}Ext.create({xtype:"box",cls:"white padding-tb10 bold center",html:String.format("Welcome {0} !",SP.context.fullname)}).render("login-field");
var b=new Ext.Button({renderTo:"login-field",width:100,text:"Log Out",ctCls:"ux-button-1 button-center",margins:"0 0 0 15px",handler:function(){SP.object.User.signOut(function(){window.location="/";
},function(){window.location="/";});}});}else{(new SP.controls.LoginForm()).render("login-field");}}});
Ext.override(Ext.form.Field,{hideItem:function(){var a=this.el.findParent("div.x-form-item",3,true);a.setStyle({display:"none"});
this.hide();},showItem:function(){var a=this.el.findParent("div.x-form-item",3,true);if(a){a.setStyle({display:""});
}this.show();},setFieldLabel:function(c){var b=this.el.findParent("div.x-form-item",3,true);var a=b.first("label.x-form-item-label");
a.update(c);}});WebLight.namespace("SP","SP.nav");SP.nav.PrimaryNavbarItem=Ext.extend(Ext.Button,{url:null,initComponent:function(){SP.nav.PrimaryNavbarItem.superclass.initComponent.call(this);
if(!this.handler&&this.url){this.setHandler(function(){WebLight.Router.route(this.url);},this);}}});SP.nav.PrimaryNavbar=Ext.extend(Ext.Toolbar,{initComponent:function(){var a=[];
a.push(new SP.nav.PrimaryNavbarItem({text:"Value List Management",pattern:"valuelistmanagement",url:"/valuelistmanagement",hidden:!SP.context.isSuperUser,menu:new Ext.menu.Menu({style:{overflow:"visible"},items:[{text:"Machine Make/Machine Model",handler:function(){WebLight.Router.route("/valuelistmanagement/machinemakeandmodel");
}},{text:"Controller Make/Controller Model",handler:function(){WebLight.Router.route("/valuelistmanagement/controllermakeandmodel");
}},{text:"Contact Messages",handler:function(){WebLight.Router.route("/valuelistmanagement/contactmessages");
}},{text:"CAD",handler:function(){WebLight.Router.route("/valuelistmanagement/cad");}},{text:"CAM",handler:function(){WebLight.Router.route("/valuelistmanagement/cam");
}},{text:"NAICS Codes",handler:function(){WebLight.Router.route("/valuelistmanagement/naicscodes");}},{text:"PostCode",handler:function(){WebLight.Router.route("/valuelistmanagement/postcode");
}}]})}));a.push(new SP.nav.PrimaryNavbarItem({text:"Report & Query Builder",pattern:"reportquerybuilder",url:"/reportquerybuilder",menu:new Ext.menu.Menu({style:{overflow:"visible"},items:[{text:"Query Builder",handler:function(){WebLight.Router.route("/ReportQueryBuilder/querybuilder");
}},{text:"New Machines Added",hidden:SP.context.isMepUser,handler:function(){WebLight.Router.route("/ReportQueryBuilder/newmachinesadded");
}},{text:"Statistics Information",hidden:SP.context.isMepUser,handler:function(){WebLight.Router.route("/ReportQueryBuilder/statisticsinformation");
}},{text:"Machines By State",hidden:SP.context.isMepUser,handler:function(){WebLight.Router.route("/ReportQueryBuilder/machinebystate");
}},{text:"Machine Type Search",hidden:SP.context.isMepUser,handler:function(){WebLight.Router.route("/ReportQueryBuilder/machinetypesearch");
}},{text:"New Makes/Models Entered",hidden:SP.context.isMepUser,handler:function(){WebLight.Router.route("/ReportQueryBuilder/newmakesmodelsentered");
}}]})}));a.push(new SP.nav.PrimaryNavbarItem({text:"Manage Permissions",pattern:"managepermission",url:"/managepermission",menu:new Ext.menu.Menu({style:{overflow:"visible"},items:[{text:"MEP Centers",hidden:!SP.context.isSuperUser,handler:function(){WebLight.Router.route("/ManagePermission/mepcenters");
}},{text:"Super Users",hidden:!SP.context.isSuperUser,handler:function(){WebLight.Router.route("/ManagePermission/otherusers");
}},{text:"Change Your Password",handler:function(){WebLight.Router.route("/ManagePermission/changeyourpassword");
}},{text:"MEP Managers & Users",hidden:!SP.context.isSuperUser,handler:function(){WebLight.Router.route("/ManagePermission/mepmanagersusers");
}},{text:"E-Mail Notification",hidden:!SP.context.isSuperUser,handler:function(){WebLight.Router.route("/ManagePermission/emailnotification");
}},{text:"Network E-mail Notification",hidden:!SP.context.isSuperUser,handler:function(){WebLight.Router.route("/ManagePermission/networkemailnotification");
}}]})}));a.push(new SP.nav.PrimaryNavbarItem({text:"Organizations",pattern:"organizations",url:"/Organizations/organizations"}));
a.push("->");a.push(new Ext.Button({text:"Logout",iconCls:"icon-16x16-logout",region:"right",handler:function(){SP.object.User.signOut(function(){window.location="/";
},function(){window.location="/";});}}));this.items=a;SP.nav.PrimaryNavbar.superclass.initComponent.call(this);
var b=function(c){Ext.each(a,function(e){if(e.pattern){var d=new RegExp(e.pattern,"gi");d.test(c)?e.addClass("x-btn-active"):e.removeClass("x-btn-active");
}});};WebLight.PageMgr.on("load",function(d,c){b(d);});WebLight.PageMgr.on("resume",function(d,c){b(d);
});}});WebLight.Router.mapRoute("^valuelistmanagement/machinemakeandmodel$",{xtype:"machinemakeandmodel"});
WebLight.Router.mapRoute("^valuelistmanagement/cad$",{xtype:"cad"});WebLight.Router.mapRoute("^valuelistmanagement/cam$",{xtype:"cam"});
WebLight.Router.mapRoute("^valuelistmanagement/contactmessages$",{xtype:"contactmessages"});WebLight.Router.mapRoute("^valuelistmanagement/controllermakeandmodel$",{xtype:"controllermakeandmodel"});
WebLight.Router.mapRoute("^valuelistmanagement/naicscodes$",{xtype:"naicscodes"});WebLight.Router.mapRoute("^valuelistmanagement/newmachinesentered$",{xtype:"newmachinesentered"});
WebLight.Router.mapRoute("^valuelistmanagement/postcode$",{xtype:"postcode"});WebLight.Router.mapRoute("^ManagePermission/assignorganizationtomepuser$",{xtype:"assignorganizationstomepuser"});
WebLight.Router.mapRoute("^ManagePermission/changeyourpassword$",{xtype:"changeyourpassword"});WebLight.Router.mapRoute("^ManagePermission/emailnotification$",{xtype:"emailnotification"});
WebLight.Router.mapRoute("^ManagePermission/mepcenters$",{xtype:"mepcenters"});WebLight.Router.mapRoute("^ManagePermission/mepdefaultmanager$",{xtype:"mepdefaultmanager"});
WebLight.Router.mapRoute("^ManagePermission/mepmanagersusers$",{xtype:"mepmanagersusers"});WebLight.Router.mapRoute("^ManagePermission/networkemailnotification$",{xtype:"networkemailnotification"});
WebLight.Router.mapRoute("^ManagePermission/organizationtwo$",{xtype:"organizationstwo"});WebLight.Router.mapRoute("^ManagePermission/otherusers$",{xtype:"otherusers"});
WebLight.Router.mapRoute("^Organizations/organizations$",{xtype:"organizations"});WebLight.Router.mapRoute("^Organizations/([0-9a-zA-Z-]{36})$",{xtype:"organizationview",organizationId:"{0}"});
WebLight.Router.mapRoute("^Organizations/profile/([0-9a-zA-Z-]{36})$",{xtype:"companyprofile",organizationId:"{0}"});
WebLight.Router.mapRoute("^Organizations/cnccapability/([0-9a-zA-Z-]{36})$",{xtype:"cnccapability",organizationId:"{0}"});
WebLight.Router.mapRoute("^Organizations/create$",{xtype:"organizationview"});WebLight.Router.mapRoute("^Organizations/facility/([0-9a-zA-Z-]{36})/([0-9a-zA-Z-]{36})$",{xtype:"facilityeditor",facilityId:"{0}",organizationId:"{1}"});
WebLight.Router.mapRoute("^ReportQueryBuilder/advancedsearch$",{xtype:"advancedsearch"});WebLight.Router.mapRoute("^ReportQueryBuilder/attachmentfiles$",{xtype:"attachmentfiles"});
WebLight.Router.mapRoute("^ReportQueryBuilder/machinebystate$",{xtype:"machinebystate"});WebLight.Router.mapRoute("^ReportQueryBuilder/newmachinesadded$",{xtype:"newmachinesadded"});
WebLight.Router.mapRoute("^ReportQueryBuilder/newmakesmodelsentered$",{xtype:"newmakesmodelsentered"});
WebLight.Router.mapRoute("^ReportQueryBuilder/newregistration$",{xtype:"newregistration"});WebLight.Router.mapRoute("^ReportQueryBuilder/querybuilder$",{xtype:"querybuilder"});
WebLight.Router.mapRoute("^ReportQueryBuilder/statisticsinformation$",{xtype:"statisticsinformation"});
WebLight.Router.mapRoute("^ReportQueryBuilder/machinetypesearch$",{xtype:"machinetypesearch"});WebLight.Router.mapRoute("^ReportQueryBuilder/resulttype/([0-9a-zA-Z-]+)$",{xtype:"resulttype",type:"{0}"});
WebLight.namespace("SP.form");Ext.override(Ext.form.DisplayField,{getValue:function(){return this.value;
},setValue:function(a){this.value=a;this.setRawValue(this.formatValue(a));return this;},formatValue:function(a){if(this.dateFormat&&Ext.isDate(a)){return a.dateFormat(this.dateFormat);
}if(this.numberFormat&&typeof a=="number"){return Ext.util.Format.number(a,this.numberFormat);}return a;
}});SP.form.DropdownList=Ext.extend(Ext.form.ComboBox,{mode:"local",forceSelection:true,triggerAction:"all",selectOnFocus:true,editable:true,allowBlank:false,layzeInit:false,blankText:"required",typeAhead:true,initComponent:function(){var a=this;
if(!this.displayField||this.displayField==""){this.displayField="value";}if(!this.valueField||this.valueField==""){this.valueField="key";
}if(this.store){this.store.on("load",function(b,c){this.clearValue();Ext.each(c,function(d,e){if(d.get(a.valueField)==a.innerValue){a.setValue(a.innerValue);
}});},this);}SP.form.DropdownList.superclass.initComponent.call(this);},setValue:function(b){var a=this.value;
this.innerValue=b;SP.form.DropdownList.superclass.setValue.call(this,b);if(a!=b){this.fireEvent("valuechange",b,this.getRawValue());
}return this;},filterFieldName:null,linkTo:function(a,c,b){a.on("valuechange",function(d){this.clearValue();
if(!d||d==""){this.store.removeAll();return;}var f={field:c||a.valueField,data:{type:b||"string",value:d}};
if(!this.store.baseParams){this.store.baseParams={};}if(!this.store.baseParams.filters){this.store.baseParams.filters=[];
}var e=false;Ext.each(this.store.baseParams.filters,function(g){if(g.field.toLowerCase()==f.field.toLowerCase()){g.data.value=d;
e=true;}});if(!e){this.store.baseParams.filters.push(f);}this.store.load();},this);}});WebLight.namespace("Sp.data");
Sp.data.State=[["AK","Alaska"],["AL","Alabama"],["AR","Arkansas"],["AZ","Arizona"],["CA","California"],["CO","Colorado"],["CT","Connecticut"],["DC","District of Columbia"],["DE","Delaware"],["FL","Florida"],["GA","Georgia"],["HI","Hawaii"],["IA","Iowa"],["ID","Idaho"],["IL","Illinois"],["IN","Indiana"],["KS","Kansas"],["KY","Kentucky"],["LA","Louisiana"],["MA","Massachusetts"],["MD","Maryland"],["ME","Maine"],["MI","Michigan"],["MN","Minnesota"],["MO","Missouri"],["MS","Mississippi"],["MT","Montana"],["NC","North Carolina"],["ND","North Dakota"],["NE","Nebraska"],["NH","New Hampshire"],["NJ","New Jersey"],["NM","New Mexico"],["NV","Nevada"],["NY","New York"],["OH","Ohio"],["OK","Oklahoma"],["OR","Oregon"],["PA","Pennsylvania"],["PR","Puerto Rico"],["RI","Rhode Island"],["SC","South Carolina"],["SD","South Dakota"],["TN","Tennessee"],["TX","Texas"],["UT","Utah"],["VA","Virginia"],["VI","Virgin Islands"],["VT","Vermont"],["WA","Washington"],["WV","West Virginia"],["WI","Wisconsin"],["WY","Wyoming"]];
Sp.data.DefaultEmailSubject="SupplyPoint&reg Database and Sales opportunities";Sp.data.DefaultEmailMessage="Dear Sir/Dear Madam:SupplyPoint&reg The Center for Supply Chain Integration and Risk Management has recently gone through a modernization of our database. We are asking for your help in order to assure the most comprehensive data on your individual CNC capabilities and current capacity.  SupplyPoint&reg utilizes your specific machine and controller configurations to maximize your sales opportunities in the government and OEM supply chain.\r\n\r\nWe are requesting that you take 15 to 20 minutes to update your current profile records. \r\n\r\nThere are 2 options to update your records:\r\n\r\nOption 1. Go to www.supplypoint.com and log in. You will be directed to a summary page that will allow you to edit you current profile and add or change CNC machines. \r\n\r\nImportant, Please note that <u>your old user name and password will not work with our newly redesigned database. To access your data, please enter the email address this message was sent to 'a1plus@gis.net' as the 'username', then enter the password 'cowboy' to access your records. Once you have accessed your records, you should change your password to ensure data security. \r\n\r\nOption 2.  Click this link www.Supplypoint.com/Supplypoint_CNC_Profile.xls to download and print the 2 pages form that you can complete and return by faxing to 321-373-9053.\r\n\r\nPlease complete your update using one of the above methods by May 27, 2008. \r\n\r\nIn the event that you are interested in bidding on government requirements and are not registered in the Central Contractor Registration (CCR) database you can do so by visiting www.ccr.gov.  If you require CCR registration assistance, please let us know by return e mail and a Procurement Administrator will contact you. \r\n\r\nShould you have any questions concerning the above, please send an e mail to contact@supplypoint.com or call 1-866-872-6233. \r\n\r\nSincerely, \r\n\r\nSupplyPoint&reg The Center for Supply Chain Integration and Risk Management";
Sp.data.BuiltInStores=(function(){var r=new Ext.data.ArrayStore({data:[["M","CNC Mill Machine"],["T","CNC Turn Machine"],["C","CNC Mill/Turn Machine"],["E","CNC EDM Machine"]],fields:["machineTypeId","machineTypeName"]});
var o=new Ext.data.ArrayStore({data:Sp.data.State,fields:["state","name"]});var n=new Ext.data.ArrayStore({data:[["MEP Administrator(R/W/D)",5],["MEP User(R/W)",6]],fields:["accessTypeName","accessTypeId"]});
var s=new Ext.data.ArrayStore({data:[[" Super User",1],["Administrator(R/W/D)",2],["Administrator(R/W)",3],["Technician(R )",4]],fields:["accessTypeName","accessTypeId"]});
var f=new Ext.data.ArrayStore({data:[["General Question",0],["SupplyPoint Question",1],["Technical Question",2],["Registration Question",3],["Web Site Question",4],["Other Question",5]],fields:["categoryName","categoryId"]});
var j=new Ext.data.ArrayStore({data:[[1,"Conversational"],[2,"EIA (G-Code)"]],fields:["id","name"]});
var h=new Ext.data.ArrayStore({data:[[1,"Vertical"],[2,"Horizontal"]],fields:["id","name"]});var g=new Ext.data.ArrayStore({data:[[true,"Yes"],[false,"No"],[null,"Don't Know"]],fields:["id","name"]});
var p=new Ext.data.ArrayStore({data:[[true,"Ram"],[false,"Write"],[null,"Don't Know"]],fields:["id","name"]});
var e=new Ext.data.ArrayStore({data:[["True","Ram"],["False","Write"],["","Uncheck"]],fields:["id","name"]});
var a=new Ext.data.ArrayStore({data:[["True","Yes"],["False","No"]],fields:["id","name"]});var c=function(t,u){var w=[];
for(var v=t;v<=u;v++){w.push([v]);}return new Ext.data.ArrayStore({data:w,fields:["id"]});};var m=new Ext.data.ArrayStore({data:[[10],[20],[30],[40],[50],[60],[70],[80],[90],[100]],fields:["id"]});
var q=new Ext.data.ArrayStore({data:[[1],[5],[10],[25],[50],[75],[100],[150],[200],[300]],fields:["id"]});
var d=new Ext.data.ArrayStore({data:[[5000,"5K"],[10000,"10K"],[20000,"20K"],[40000,"40K"],[80000,"80K"],[100000,"100K"],[150000,"150K"],[200000,"200K"],[250000,"250K"],[300000,"300K"],[400000,"400K"],[500000,"500K"],[750000,"750K"],[900000,"900K"]],fields:["id","name"]});
var l=new Ext.data.ArrayStore({data:[["1","Other"],["2","Coordinate Measuring Machine(CMM)"],["3","Manul(Calipers etc.)"]],fields:["id","name"]});
var b=new Ext.data.ArrayStore({data:[[19,"CMM"],[20,"Manual"],[18,"Other"]],fields:["inspectionSystemId","title"]});
var k=new Ext.data.ArrayStore({data:[[20],[50],[100],[200]],fields:["id"]});return{machineTypeStore:r,stateStore:o,accessStore:n,categoryStore:f,otherUserAccessStore:s,programmingProtocolStore:j,typeOfMachineStore:h,noOfAxesStore:c(2,24),radioGroupStore:g,noOfAxesStore:c(2,24),maxTurnLengthStore:c(3,130),maxChuckSizeStore:c(1,36),maxLoadCapacityStore:m,squareInchesHourStore:c(1,20),axisTravelStore:c(3,20),ramWriteStore:p,numberofShiftsStore:c(1,6),productionPersonnelStore:q,productionAreaStore:d,radioGroup2Store:a,typeRadioGroupStore:e,cmmInspectionStore:l,inspectionSystemStore:b,pagesizeStore:k};
})();WebLight.namespace("SP","SP.controls");SP.controls.FacilityForm=WebLight.extend(WebLight.Control,{html:_builtInTemplate_b84c3e97[0],facilityId:"",_facilityStore:null,_facilityEditForm:null,_facilityViewForm:null,_editButton:null,isReadOnly:false,createFacilityEditForm:function(){var g=this;
var f=new Ext.Button({text:"Save",scope:this,handler:function(){if(g._facilityEditForm.getForm().isValid()){if(g._facilityEditForm.getFieldByName("manufacture").getValue()!=null){if(g._facilityEditForm.getFieldByName("manufacture").getValue().inputValue=="1"){g._facilityStore.getAt(0).set("manufacturer",true);
}else{g._facilityStore.getAt(0).set("manufacturer",false);}}else{g._facilityStore.getAt(0).set("manufacturer",null);
}if(g._facilityEditForm.getFieldByName("prototypingLowVolumer").getValue()!=null){if(g._facilityEditForm.getFieldByName("prototypingLowVolumer").getValue().inputValue=="1"){g._facilityStore.getAt(0).set("prototypingLowVolume",true);
}else{g._facilityStore.getAt(0).set("prototypingLowVolume",false);}}else{g._facilityStore.getAt(0).set("prototypingLowVolume",null);
}if(g._facilityEditForm.getFieldByName("prototypingHighVolumer").getValue()!=null){if(g._facilityEditForm.getFieldByName("prototypingHighVolumer").getValue().inputValue=="1"){g._facilityStore.getAt(0).set("prototypingHighVolume",true);
}else{g._facilityStore.getAt(0).set("prototypingHighVolume",false);}}else{g._facilityStore.getAt(0).set("prototypingHighVolume",null);
}g._facilityStore.submitChanges(function(j){g._facilityEditForm.hide();g._facilityViewForm.show();g._facilityStore.reload();
},function(k,j){alert(j);});}}});var b=new Ext.Button({text:"Cancel",scope:this,handler:function(){g._facilityEditForm.hide();
g._facilityViewForm.show();g._facilityEditForm.reset();}});var d=new SP.form.DropdownList({valueField:"state",displayField:"state",fieldLabel:"State",name:"state",width:60,store:Sp.data.BuiltInStores.stateStore});
var c=new SP.form.DropdownList({valueField:"id",displayField:"id",fieldLabel:"Number of Shifts",name:"numberOfShift",width:100,store:Sp.data.BuiltInStores.numberofShiftsStore});
var h=new SP.form.DropdownList({valueField:"id",displayField:"id",fieldLabel:"Production Personnel",name:"productionPersonnel",width:100,store:Sp.data.BuiltInStores.productionPersonnelStore});
var e=new SP.form.DropdownList({valueField:"id",displayField:"name",fieldLabel:"Production Area",name:"productionArea",width:100,store:Sp.data.BuiltInStores.productionAreaStore});
var a=new SP.form.DropdownList({valueField:"id",displayField:"name",fieldLabel:"Inspection System(s)",name:"cmmInspectionId",width:240,store:Sp.data.BuiltInStores.cmmInspectionStore});
a.on("valuechange",function(j,k){if($.trim(k)=="Other"){g._facilityEditForm.getFieldByName("cmmInspectionName").showItem();
g._facilityEditForm.getFieldByName("cmmInspectionName").setValue("");}else{g._facilityEditForm.getFieldByName("cmmInspectionName").hideItem();
}});this._facilityEditForm=new WebLight.form.FormPanel({border:false,labelWidth:150,frame:true,hidden:true,defaults:{allowBlank:false,msgTarget:"under"},labelAlign:"right",cls:"ux-form-1",items:[{layout:"form",xtype:"box",width:630,html:'<h2 class="ux-box-1">Facility Basic Information</h2>'},{xtype:"textfield",width:600,fieldLabel:"Address1",name:"address1",maxLength:64},{xtype:"textfield",width:600,fieldLabel:"Address2",name:"address2",allowBlank:true,maxLength:64},{xtype:"textfield",width:600,fieldLabel:"Address3",name:"address3",allowBlank:true,maxLength:64},{layout:"column",defaults:{layout:"form"},items:[{items:[{allowBlank:false,xtype:"textfield",fieldLabel:"City",name:"city",width:80}]},{labelWidth:50,items:[d]},{labelWidth:80,items:[{allowBlank:false,xtype:"textfield",fieldLabel:"Zip Code",name:"zipCode",width:80,maxLength:10}]},{labelWidth:60,items:[{xtype:"textfield",fieldLabel:"County",name:"county",width:100}]}]},{layout:"column",items:[{layout:"form",items:[{xtype:"box",html:'<span class="x-form-item-label">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Do you manufacture at this facility?</span>'}]},{layout:"form",columnWidth:0.2,items:[new Ext.form.RadioGroup({hideLabel:true,style:"margin:0 0 0 20px",name:"manufacture",anchor:"90%",items:[{name:"manufacturer",id:"yes",inputValue:"1",width:70,boxLabel:"Yes"},{name:"manufacturer",inputValue:"0",id:"no",width:70,boxLabel:"No"}]})]}]},{layout:"form",xtype:"box",width:630,html:'<h2 class="ux-box-1"> Inspection System(s)</h2>'},{layout:"column",items:[{layout:"form",columnWidth:0.25,items:[{xtype:"checkbox",name:"manual",fieldLabel:"Manual"}]},{layout:"form",columnWidth:0.1,labelWidth:40,items:[{xtype:"checkbox",name:"cmm",fieldLabel:"CMM"}]},{layout:"form",labelWidth:50,items:[new Ext.form.Checkbox({name:"other",fieldLabel:"Other",handler:function(){if(this.getValue()){g._facilityEditForm.getFieldByName("cmmInspectionName").setValue("");
g._facilityEditForm.getFieldByName("cmmInspectionName").showItem();g._facilityEditForm.getFieldByName("cmmInspectionName").allowBlank=false;
}else{g._facilityEditForm.getFieldByName("cmmInspectionName").hideItem();g._facilityEditForm.getFieldByName("cmmInspectionName").allowBlank=true;
}}})]},{layout:"form",labelWidth:90,items:[{xtype:"textfield",width:200,name:"cmmInspectionName",fieldLabel:"Insp. System "}]}]},{layout:"form",xtype:"box",width:630,html:'<h2 class="ux-box-1">Production/Capacity </h2>'},{layout:"column",items:[{layout:"form",columnWidth:0.5,items:[{layout:"form",labelWidth:150,items:[c]},{layout:"form",labelWidth:150,items:[h]}]},{layout:"form",columnWidth:0.5,items:[{layout:"form",labelWidth:150,items:[e]},{layout:"form",labelWidth:150,items:[{xtype:"numberfield",name:"engineeringPersonnel",width:100,fieldLabel:"Engineering Personnel",maxValue:65500}]}]}]},{xtype:"textarea",width:630,height:80,fieldLabel:"Product Description",name:"productDescription",allowBlank:true,maxLength:256},{layout:"column",items:[{layout:"form",items:[{xtype:"box",html:'<span class="x-form-item-label"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Prototyping/Low Volume:</span>'}]},{layout:"form",columnWidth:0.2,items:[new Ext.form.RadioGroup({hideLabel:true,style:"margin:0 0 0 20px",name:"prototypingLowVolumer",anchor:"90%",items:[{name:"prototypingLowVolume",id:"yes1",inputValue:"1",width:70,boxLabel:"Yes"},{name:"prototypingLowVolume",inputValue:"0",id:"no1",width:70,boxLabel:"No"}]})]}]},{layout:"column",items:[{layout:"form",items:[{xtype:"box",html:'<span class="x-form-item-label"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;High Volume:</span>'}]},{layout:"form",columnWidth:0.2,items:[new Ext.form.RadioGroup({hideLabel:true,style:"margin:0 0 0 20px",name:"prototypingHighVolumer",anchor:"90%",items:[{name:"prototypingHighVolume",id:"yes2",inputValue:"1",width:70,boxLabel:"Yes"},{name:"prototypingHighVolume",inputValue:"0",id:"no2",width:70,boxLabel:"No"}]})]}]}],buttons:[f,b]});
g._facilityEditForm.on("beforeshow",function(){if(g._facilityStore.getAt(0).get("other")==true){g._facilityEditForm.getFieldByName("cmmInspectionName").showItem();
g._facilityEditForm.getFieldByName("cmmInspectionName").allowBlank=false;}else{g._facilityEditForm.getFieldByName("cmmInspectionName").hideItem();
g._facilityEditForm.getFieldByName("cmmInspectionName").allowBlank=true;}});},createFacilityViewForm:function(){var a=this;
a._editButton=new Ext.Button({text:"Edit",scope:this,hidden:true,handler:function(){a._facilityViewForm.hide();
a._facilityEditForm.show();}});var b=new SP.form.DropdownList({valueField:"state",displayField:"state",fieldLabel:"State",name:"state",width:60,store:Sp.data.BuiltInStores.stateStore});
this._facilityViewForm=new WebLight.form.FormPanel({border:false,labelWidth:150,frame:true,defaults:{msgTarget:"under"},labelAlign:"right",cls:"ux-form-1",items:[{layout:"form",xtype:"box",width:630,html:'<h2 class="ux-box-1">Facility Basic Information</h2>'},{xtype:"displayfield",width:600,fieldLabel:"Address1",name:"address1"},{xtype:"displayfield",width:600,fieldLabel:"Address2",name:"address2"},{xtype:"displayfield",width:600,fieldLabel:"Address3",name:"address3"},{layout:"column",defaults:{layout:"form"},items:[{items:[{xtype:"displayfield",fieldLabel:"City",name:"city",width:100}]},{labelWidth:40,items:[{xtype:"displayfield",fieldLabel:"State",name:"state",width:100}]},{labelWidth:70,items:[{xtype:"displayfield",fieldLabel:"Zip Code",name:"zipCode",width:100,maxLength:10}]},{labelWidth:50,items:[{xtype:"displayfield",fieldLabel:"County",name:"county",width:100}]}]},{layout:"column",items:[{layout:"form",items:[{xtype:"box",html:'<span class="x-form-item-label">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Do you manufacture at this facility?</span>'}]},{layout:"form",columnWidth:0.2,items:[new Ext.form.RadioGroup({hideLabel:true,style:"margin:0 0 0 20px",name:"manufactureView",anchor:"90%",items:[{name:"manufacturer",id:"manufacturerViewYes",inputValue:"1",disabled:true,width:70,boxLabel:"Yes"},{name:"manufacturer",inputValue:"0",disabled:true,id:"manufacturerViewNo",width:70,boxLabel:"No"}]})]}]},{layout:"form",xtype:"box",width:630,html:'<h2 class="ux-box-1"> Inspection System(s) </h2>'},{layout:"column",items:[{layout:"form",columnWidth:0.25,items:[{xtype:"checkbox",name:"manual",fieldLabel:"Manual",disabled:true}]},{layout:"form",columnWidth:0.1,labelWidth:40,items:[{xtype:"checkbox",name:"cmm",fieldLabel:"CMM",disabled:true}]},{layout:"form",labelWidth:50,items:[{xtype:"checkbox",name:"other",fieldLabel:"Other",disabled:true}]},{layout:"form",labelWidth:40,items:[{xtype:"displayfield",width:100,name:"cmmInspectionName"}]}]},{layout:"form",xtype:"box",width:630,html:'<h2 class="ux-box-1">Production/Capacity </h2>'},{layout:"column",items:[{layout:"form",columnWidth:0.5,items:[{layout:"form",labelWidth:150,items:[{xtype:"displayfield",name:"numberOfShift",width:200,fieldLabel:"Number Of Shifts"}]},{layout:"form",labelWidth:150,items:[{xtype:"displayfield",name:"productionPersonnel",width:200,fieldLabel:"Production Personnel"}]}]},{layout:"form",columnWidth:0.5,items:[{layout:"form",labelWidth:150,items:[{xtype:"displayfield",name:"productionArea",width:200,fieldLabel:"Production Area"}]},{layout:"form",labelWidth:150,items:[{xtype:"displayfield",name:"engineeringPersonnel",width:200,fieldLabel:"Engineering Personnel"}]}]}]},{xtype:"displayfield",width:630,height:80,cls:"ux-displayfield",fieldLabel:"Product Description",name:"productDescription"},{layout:"column",items:[{layout:"form",items:[{xtype:"box",html:'<span class="x-form-item-label">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Prototyping/Low Volume:</span>'}]},{layout:"form",columnWidth:0.2,items:[new Ext.form.RadioGroup({hideLabel:true,style:"margin:0 0 0 20px",name:"prototypingLowVolumerView",anchor:"90%",items:[{name:"prototypingLowVolume",id:"yes3",inputValue:"1",width:70,disabled:true,boxLabel:"Yes"},{name:"prototypingLowVolume",inputValue:"0",id:"no3",width:70,disabled:true,boxLabel:"No"}]})]}]},{layout:"column",items:[{layout:"form",items:[{xtype:"box",html:'<span class="x-form-item-label"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;High Volume:</span>'}]},{layout:"form",columnWidth:0.2,items:[new Ext.form.RadioGroup({hideLabel:true,style:"margin:0 0 0 20px",name:"prototypingHighVolumerView",anchor:"90%",items:[{name:"prototypingHighVolume",id:"yes4",disabled:true,inputValue:"1",width:70,boxLabel:"Yes"},{name:"prototypingHighVolume",inputValue:"0",id:"no4",disabled:true,width:70,boxLabel:"No"}]})]}]}],buttons:[a._editButton]});
},createChildControls:function(){this._facilityStore=new SP.object.FacilityStore();SP.controls.FacilityForm.superclass.createChildControls.call(this);
this.createFacilityViewForm();this._facilityViewForm.bindStore(this._facilityStore);this.createFacilityEditForm();
this._facilityEditForm.bindStore(this._facilityStore);this.addChildControl(this._facilityEditForm,"control");
this.addChildControl(this._facilityViewForm,"control");},dataBind:function(){var a=this;this._facilityStore.queryable.where("facilityId=@0",this.facilityId).load();
this._facilityStore.on("load",function(){a.isReadOnly=this.getAt(0).get("isReadOnly");a.fireEvent("SetOtherMode",a.isReadOnly);
a._editButton.setVisible(!a.isReadOnly);if(this.getAt(0).get("manufacturer")){a._facilityViewForm.getFieldByName("manufactureView").onSetValue("manufacturerViewYes",true);
a._facilityEditForm.getFieldByName("manufacture").onSetValue("yes",true);}else{a._facilityViewForm.getFieldByName("manufactureView").onSetValue("manufacturerViewNo",true);
a._facilityEditForm.getFieldByName("manufacture").onSetValue("no",true);}if(this.getAt(0).get("prototypingLowVolume")){a._facilityViewForm.getFieldByName("prototypingLowVolumerView").onSetValue("yes3",true);
a._facilityEditForm.getFieldByName("prototypingLowVolumer").onSetValue("yes1",true);}else{a._facilityViewForm.getFieldByName("prototypingLowVolumerView").onSetValue("no3",true);
a._facilityEditForm.getFieldByName("prototypingLowVolumer").onSetValue("no1",true);}if(this.getAt(0).get("prototypingHighVolume")){a._facilityViewForm.getFieldByName("prototypingHighVolumerView").onSetValue("yes4",true);
a._facilityEditForm.getFieldByName("prototypingHighVolumer").onSetValue("yes2",true);}else{a._facilityViewForm.getFieldByName("prototypingHighVolumerView").onSetValue("no4",true);
a._facilityEditForm.getFieldByName("prototypingHighVolumer").onSetValue("no2",true);}});SP.controls.FacilityForm.superclass.dataBind.call(this);
}});WebLight.namespace("SP","SP.controls");SP.controls.CncMillingGrid=WebLight.extend(WebLight.Control,{html:_builtInTemplate_b84c3e97[1],facilityId:"",_cncMillingGrid:null,_cncMillingStore:null,_newButton:null,createCncMillingGrid:function(){var a=this;
a._newButton=new Ext.Button({text:"Add New Mill Machine",iconCls:"icon-16x16-add",hidden:true,handler:function(){new SP.controls.CncMillingEditor({facilityId:a.facilityId,title:"New Mill Machine",listeners:{success:function(){a._cncMillingStore.queryable.where("facilityId=@0",a.facilityId).load();
}}});}});this._cncMillingGrid=new WebLight.grid.GridPanel({autoHeight:true,enableHdMenu:false,cm:new Ext.grid.ColumnModel({defaults:{width:85},columns:[new Ext.grid.RowNumberer({width:28,header:"No<br />&nbsp;"}),{header:"Mach #<br />&nbsp;",width:45,dataIndex:"sequenceId"},{header:"Machine Make<br />&nbsp;",dataIndex:"machineMakeFriendlyTitle",width:104},{header:"Machine Model<br />&nbsp;",dataIndex:"machineModelFriendlyTitle",width:104},{header:"Controller Make<br />&nbsp;",dataIndex:"controllerMakeFriendlyTitle",width:104},{header:"Controller Model<br />&nbsp;",dataIndex:"controllerModelFriendlyTitle",width:104},{header:"Type<br />&nbsp;",width:40,dataIndex:"typeOfMachine"},{header:"# Of <br />Axes",width:40,dataIndex:"noOfAxes"},{header:"Indexer<br />&nbsp;",width:50,dataIndex:"indexer",renderer:function(b){if(b!=null){return b?"Y":"N";
}}},{header:"Pallet<br />Changer",width:55,dataIndex:"palletChanger",renderer:function(b){if(b!=null){return b?"Y":"N";
}}},{header:"Thru <br />Coolant",width:50,dataIndex:"thruCoolant",renderer:function(b){if(b!=null){return b?"Y":"N";
}}},{header:"Max <br />&nbsp;RPM",width:50,dataIndex:"maxRPM"},{header:"Action<br />&nbsp;",xtype:"templatecolumn",width:70,align:"center",hidden:true,tpl:new Ext.XTemplate('<a href="javascript:void(0)" xcmd="edit">Edit</a>                            &nbsp;<a href="javascript:void(0)" xcmd="delete">Delete</a>')}]}),tbar:[a._newButton]});
this._cncMillingGrid.on("xcellclick",function(f,c,d,e,b){switch(c){case"edit":new SP.controls.CncMillingEditor({machineId:d.get("machineId"),title:"Edit Cnc Milling",listeners:{success:function(){a._cncMillingStore.queryable.where("facilityId=@0",a.facilityId).load();
}}});break;case"delete":Ext.MessageBox.confirm("Confirm","Are you sure want to delete this record?",function(g){if(g=="yes"){a._cncMillingStore.remove(d);
a._cncMillingStore.submitChanges(function(){});}});break;}});},createChildControls:function(){this._cncMillingStore=new SP.object.CncMillingStore();
this.createCncMillingGrid();this._cncMillingGrid.bindStore(this._cncMillingStore);SP.controls.CncMillingGrid.superclass.createChildControls.call(this);
this.addChildControl(this._cncMillingGrid,"control");},dataBind:function(){this._cncMillingStore.queryable.where("facilityId=@0",this.facilityId).load();
SP.controls.CncMillingGrid.superclass.dataBind.call(this);},SetMode:function(b){var a=this;a._cncMillingGrid.tbar.setVisible(!b);
a._newButton.setVisible(!b);a._cncMillingGrid.getColumnModel().setHidden(12,b);}});WebLight.namespace("SP","SP.controls");
SP.controls.CncEDMGrid=WebLight.extend(WebLight.Control,{html:_builtInTemplate_b84c3e97[0],facilityId:"",_edmStore:null,_edmGrid:null,_edmWin:null,_newEdmButton:null,createEdmGrid:function(){var a=this;
this._newEdmButton=Ext.create({text:"Add New EDM Machine",iconCls:"icon-16x16-add",xtype:"button",hidden:true,handler:function(){new SP.controls.CncEdmEditor({facilityId:a.facilityId,title:"New EDM Machine",listeners:{success:function(){a._edmStore.queryable.where("facilityId=@0",a.facilityId).load();
}}});}});this._edmGrid=new WebLight.grid.GridPanel({striptRows:true,style:"margin-top:20px",autoHeight:true,enableHdMenu:false,tbar:[a._newEdmButton],selModel:new Ext.grid.RowSelectionModel({singleSelect:true}),cm:new Ext.grid.ColumnModel({defaults:{sortable:true,width:60},columns:[new Ext.grid.RowNumberer({header:"No<br />&nbsp;",width:28}),{header:"Mach #<br />&nbsp;",width:45,dataIndex:"sequenceId"},{dataIndex:"machineMakeFriendlyTitle",header:"Machine Make<br/>&nbsp;",width:109},{dataIndex:"machineModelFriendlyTitle",header:"Machine Model<br/>&nbsp;",width:109},{dataIndex:"controllerMakeFriendlyTitle",header:"Controller Make<br/>&nbsp;",width:109},{dataIndex:"controllerModelFriendlyTitle",header:"Controller Model<br/>&nbsp;",width:109},{dataIndex:"ramWire",header:"Ram<br />&nbsp;/Write",width:43,renderer:function(b){if(b!=null){return b?"Ram":"Wire";
}}},{dataIndex:"travelX",header:"Trvl <br/>&nbsp;X",width:30},{dataIndex:"travelY",header:"Trvl <br/>&nbsp;Y",width:30},{dataIndex:"travelZ",header:"Trvl <br/>&nbsp;Z",width:30},{dataIndex:"sqInXHour",header:"SqIn<br/>&nbsp;/Hou",width:35},{dataIndex:"toolChanger",header:"&nbsp;&nbsp;Tool<br/>Changer",width:55,renderer:function(b){if(b!=null){return b?"Y":"N";
}}},{dataIndex:"maxCapacity",header:"Max <br />&nbsp;Cap.",width:40},{header:"Action<br/>&nbsp;",align:"center",xtype:"templatecolumn",sortable:false,width:70,hidden:true,tpl:new Ext.XTemplate('<a href="javascript:void(0);" xcmd="edit">Edit</a> &nbsp;                                 <a href="javascript:void(0);" xcmd="delete">Delete</a>')}]})});
this._edmGrid.on("xcellclick",function(f,c,d,e,b){switch(c){case"edit":new SP.controls.CncEdmEditor({machineId:d.get("machineId"),title:"Edit Cnc EDM",listeners:{success:function(){a._edmStore.queryable.where("facilityId=@0",a.facilityId).load();
}}});break;case"delete":Ext.Msg.confirm("Confirm","Are you sure want to delete this record？",function(g){if(g=="yes"){f.store.remove(d);
f.store.submitChanges(function(){f.store.reload();},function(){alert("Failed");});}});break;}},this);
this._edmGrid.bindStore(this._edmStore);},createChildControls:function(){this._edmStore=new SP.object.CncEDMStore();
this.createEdmGrid();this.addChildControl(this._edmGrid,"control");SP.controls.CncEDMGrid.superclass.createChildControls.call(this);
},dataBind:function(){this._edmStore.queryable.where("facilityId=@0",this.facilityId).load();SP.controls.CncEDMGrid.superclass.dataBind.call(this);
},SetMode:function(b){var a=this;a._edmGrid.tbar.setVisible(!b);a._newEdmButton.setVisible(!b);a._edmGrid.getColumnModel().setHidden(13,b);
}});WebLight.namespace("SP","SP.controls");SP.controls.CncComboGrid=WebLight.extend(WebLight.Control,{html:_builtInTemplate_b84c3e97[0],facilityId:"",_comboStore:null,_comboGrid:null,_comboWin:null,_newComboButton:null,createComboGrid:function(){var a=this;
this._newComboButton=Ext.create({text:"Add New Mill/Turn Machine",iconCls:"icon-16x16-add",xtype:"button",enableHdMenu:false,hidden:true,handler:function(){new SP.controls.CncComboEditor({facilityId:a.facilityId,title:"New Mill/Turn Machine",listeners:{success:function(){a._comboStore.queryable.where("facilityId=@0",a.facilityId).load();
}}});}});this._comboGrid=new WebLight.grid.GridPanel({striptRows:true,style:"margin-top:20px",autoHeight:true,tbar:[a._newComboButton],enableHdMenu:false,selModel:new Ext.grid.RowSelectionModel({singleSelect:true}),cm:new Ext.grid.ColumnModel({defaults:{sortable:true,width:60},columns:[new Ext.grid.RowNumberer({header:"No<br />&nbsp;",width:28}),{header:"Mach #<br />&nbsp;",width:45,dataIndex:"sequenceId"},{dataIndex:"machineMakeFriendlyTitle",header:"Machine<br/>&nbsp;Make",width:81},{dataIndex:"machineModelFriendlyTitle",header:"Machine<br/>&nbsp;Model",width:81},{dataIndex:"controllerMakeFriendlyTitle",header:"Controller<br/>&nbsp;Make",width:81},{dataIndex:"controllerModelFriendlyTitle",header:"Controller<br/>&nbsp;Model",width:81},{dataIndex:"liveTooling",header:"Live<br/>Tooling",width:45,renderer:function(b){if(b!=null){return b?"Y":"N";
}}},{dataIndex:"lowerTurret",header:"Lower<br/>Turret",width:45,renderer:function(b){if(b!=null){return b?"Y":"N";
}}},{dataIndex:"noOfAxes",header:"# Of<br/> &nbsp;Axes",width:40},{dataIndex:"subSpindle",header:"Sub<br/>Spindle",width:46,renderer:function(b){if(b!=null){return b?"Y":"N";
}}},{dataIndex:"barFeeder",header:"Bar<br/>Feeder",width:45,renderer:function(b){if(b!=null){return b?"Y":"N";
}}},{dataIndex:"maxTurnLength",header:"Max Turn<br/>&nbsp;Length",width:55},{dataIndex:"maxRPM",header:"Max<br/>RPM",width:35},{dataIndex:"maxChuckSize",header:"Max Chuck<br/>Size",width:65},{header:"Action<br />&nbsp;",align:"center",xtype:"templatecolumn",sortable:false,width:70,hidden:true,tpl:new Ext.XTemplate('<a href="javascript:void(0);" xcmd="edit">Edit</a> &nbsp;                                 <a href="javascript:void(0);" xcmd="delete">Delete</a>')}]})});
this._comboGrid.on("xcellclick",function(f,c,d,e,b){switch(c){case"edit":new SP.controls.CncComboEditor({machineId:d.get("machineId"),title:"Edit Cnc Combo",listeners:{success:function(){a._comboStore.queryable.where("facilityId=@0",a.facilityId).load();
}}});break;case"delete":Ext.Msg.confirm("Confirm","Are you sure want to delete this record？",function(g){if(g=="yes"){f.store.remove(d);
f.store.submitChanges(function(){f.store.reload();},function(){alert("Failed");});}});break;}},this);
this._comboGrid.bindStore(this._comboStore);},createChildControls:function(){this._comboStore=new SP.object.CncComboStore();
this.createComboGrid();this.addChildControl(this._comboGrid,"control");SP.controls.CncComboGrid.superclass.createChildControls.call(this);
},dataBind:function(){this._comboStore.queryable.where("facilityId=@0",this.facilityId).load();SP.controls.CncComboGrid.superclass.dataBind.call(this);
},SetMode:function(b){var a=this;a._comboGrid.tbar.setVisible(!b);a._newComboButton.setVisible(!b);a._comboGrid.getColumnModel().setHidden(14,b);
}});WebLight.namespace("SP","SP.controls");SP.controls.CncTurningGrid=WebLight.extend(WebLight.Control,{html:_builtInTemplate_b84c3e97[1],facilityId:"",_cncTurningStore:null,_cncTurningGrid:null,_newButton:null,createCncTurningGrid:function(){var a=this;
a._newButton=new Ext.Button({text:"Add New Turn Machine",iconCls:"icon-16x16-add",hidden:true,handler:function(){new SP.controls.CncTurningEditor({facilityId:a.facilityId,title:"New Turn Machine",listeners:{success:function(){a._cncTurningStore.queryable.where("facilityId=@0",a.facilityId).load();
}}});}});this._cncTurningGrid=new WebLight.grid.GridPanel({autoHeight:true,enableHdMenu:false,cm:new Ext.grid.ColumnModel({defaults:{width:60},columns:[new Ext.grid.RowNumberer({width:28,header:"No<br />&nbsp;"}),{header:"Mach #<br />&nbsp;",width:45,dataIndex:"sequenceId"},{header:"Machine <br />&nbsp;Make",dataIndex:"machineMakeFriendlyTitle",width:73},{header:"Machine<br />&nbsp;Model",dataIndex:"machineModelFriendlyTitle",width:73},{header:"Controller <br />&nbsp;Make",dataIndex:"controllerMakeFriendlyTitle",width:73},{header:"Controller <br />&nbsp;Model",dataIndex:"controllerModelFriendlyTitle",width:73},{header:"Type<br />&nbsp;",width:35,dataIndex:"typeOfMachine"},{header:"Live <br />Tooling",width:45,dataIndex:"liveTooling",renderer:function(b){if(b!=null){return b?"Y":"N";
}}},{header:"Lower <br />Turret",width:40,dataIndex:"lowerTurret",width:45,renderer:function(b){if(b!=null){return b?"Y":"N";
}}},{header:"# Of <br />Axes",width:40,dataIndex:"noOfAxes"},{header:"Sub <br />Spindle",width:45,dataIndex:"subSpindle",renderer:function(b){if(b!=null){return b?"Y":"N";
}}},{header:"Bar <br />Feeder",width:45,dataIndex:"barFeeder",renderer:function(b){if(b!=null){return b?"Y":"N";
}}},{header:"Max Turn <br />Length",dataIndex:"maxTurnLength",width:55},{header:"Max <br />RPM",width:35,dataIndex:"maxRPM"},{header:"Max Chuck <br />Size",dataIndex:"maxChuckSize",width:64},{header:"Action<br />&nbsp;",xtype:"templatecolumn",width:70,align:"center",hidden:true,tpl:new Ext.XTemplate('<a href="javascript:void(0)" xcmd="edit">Edit</a>                            &nbsp;<a href="javascript:void(0)" xcmd="delete">Delete</a>')}]}),tbar:[a._newButton]});
this._cncTurningGrid.on("xcellclick",function(f,c,d,e,b){switch(c){case"edit":new SP.controls.CncTurningEditor({machineId:d.get("machineId"),title:"Edit Cnc Turning",listeners:{success:function(){a._cncTurningStore.queryable.where("facilityId=@0",a.facilityId).load();
}}});break;case"delete":Ext.MessageBox.confirm("Confirm","Are you sure want to delete this record?",function(g){if(g=="yes"){a._cncTurningStore.remove(d);
a._cncTurningStore.submitChanges(function(){});}});break;}});},createChildControls:function(){this._cncTurningStore=new SP.object.CncTurningStore();
this.createCncTurningGrid();this._cncTurningGrid.bindStore(this._cncTurningStore);SP.controls.CncTurningGrid.superclass.createChildControls.call(this);
this.addChildControl(this._cncTurningGrid,"control");},dataBind:function(){this._cncTurningStore.queryable.where("facilityId=@0",this.facilityId).load();
SP.controls.CncTurningGrid.superclass.dataBind.call(this);},SetMode:function(b){var a=this;a._cncTurningGrid.tbar.setVisible(!b);
a._newButton.setVisible(!b);a._cncTurningGrid.getColumnModel().setHidden(15,b);}});WebLight.namespace("SP","SP.controls");
SP.controls.CncMillingEditor=WebLight.extend(Ext.Window,{modal:true,border:false,autoHeight:true,width:600,machineId:"",facilityId:"",_cncMillingStore:null,_millingForm:null,createMillingForm:function(){var d=this;
var t=new SP.object.MachineMakeStore();t.queryable.where("machineType=@0","M").orderBy("title").load();
var q=new SP.form.DropdownList({store:t,displayField:"title",valueField:"machineMakeId",name:"machineMakeId"});
var r=new SP.object.MachineModelStore();r.queryable.orderBy("title");var p=new SP.form.DropdownList({store:r,displayField:"title",valueField:"machineModelId",name:"machineModelId"});
p.linkTo(q);var l=new SP.object.ControllerMakeStore();l.queryable.where("machineType=@0","M").orderBy("title").load();
var u=new SP.form.DropdownList({store:l,displayField:"title",valueField:"controllerMakeId",name:"controllerMakeId"});
var h=new SP.object.ControllerModelStore();h.queryable.orderBy("title");var k=new SP.form.DropdownList({store:h,displayField:"title",valueField:"controllerModelId",name:"controllerModelId"});
k.linkTo(u);var g=Ext.create({xtype:"textfield",name:"machineMakeTitle",hidden:true,allowBlank:true});
var j=Ext.create({xtype:"textfield",name:"machineModelTitle",hidden:true,allowBlank:true});var c=Ext.create({xtype:"textfield",name:"controllerMakeTitle",hidden:true,allowBlank:true});
var m=Ext.create({xtype:"textfield",name:"controllerModelTitle",hidden:true,allowBlank:true});var n=Ext.create({xtype:"compositefield",fieldLabel:"Make",items:[q,g]});
var e=Ext.create({xtype:"compositefield",fieldLabel:"Model",items:[p,j]});var s=Ext.create({xtype:"compositefield",fieldLabel:"Controller Make",items:[u,c]});
var b=Ext.create({xtype:"compositefield",fieldLabel:"Controller Model",items:[k,m]});var f=[q,p,u,k];
var a=[g,j,c,m];var o=[n,e,s,b];Ext.each(f,function(v,w){v.on("valuechange",function(x,y){if($.trim(y)=="Other"){a[w].show();
a[w].allowBlank=false;}else{a[w].hide();a[w].allowBlank=true;a[w].setValue("");}o[w].doLayout();});});
this._millingForm=new WebLight.form.FormPanel({header:false,border:false,frame:true,cls:"ux-form-1",labelWidth:150,items:o.concat([{layout:"column",defaults:{layout:"form",columnWidth:0.5},items:[{items:[new SP.form.DropdownList({store:Sp.data.BuiltInStores.programmingProtocolStore,fieldLabel:"Programming Protocol",displayField:"name",name:"progProtocol",valueField:"id",anchor:"95%",allowBlank:false})]},{items:[new SP.form.DropdownList({store:Sp.data.BuiltInStores.typeOfMachineStore,fieldLabel:"Type of Machine",displayField:"name",name:"typeOfMachine",valueField:"id",anchor:"95%",allowBlank:true})]}]},{layout:"column",defaults:{layout:"form",columnWidth:0.5},items:[{items:[new SP.form.DropdownList({store:Sp.data.BuiltInStores.noOfAxesStore,fieldLabel:"Number of Axes",displayField:"id",name:"noOfAxes",valueField:"id",anchor:"95%",allowBlank:true})]},{items:[{xtype:"numberfield",name:"maxRPM",fieldLabel:"Max RPM",anchor:"95%",allowBlank:true}]}]},new SP.form.DropdownList({name:"indexer",fieldLabel:"Indexer",store:Sp.data.BuiltInStores.radioGroupStore,displayField:"name",valueField:"id",allowBlank:true}),new SP.form.DropdownList({name:"palletChanger",fieldLabel:"Pallet Changer",store:Sp.data.BuiltInStores.radioGroupStore,displayField:"name",valueField:"id",allowBlank:true}),new SP.form.DropdownList({name:"thruCoolant",fieldLabel:"Thru Coolant",store:Sp.data.BuiltInStores.radioGroupStore,displayField:"name",valueField:"id",allowBlank:true}),{xtype:"textarea",name:"specialFeatures",fieldLabel:"Other Special Features",anchor:"95%",allowBlank:true},{xtype:"spinnerfield",name:"machineQuantity",fieldLabel:"Quantity",minValue:1,value:1}]),buttons:[{text:"Save",handler:function(){if(d._millingForm.getForm().isValid()){if(!d.machineId){d._cncMillingStore.getAt(0).set("facilityId",d.facilityId);
}d._cncMillingStore.submitChanges(function(){d.fireEvent("success");d.destroy();},function(w,v){alert(v);
});}}},{text:"Cancel",handler:function(){d.destroy();}}]});},setRadioGroup:function(c,a,b){switch(b){case true:c.onSetValue(String.format("{0}-rd1",a),true);
break;case false:c.onSetValue(String.format("{0}-rd2",a),true);break;default:c.onSetValue(String.format("{0}-rd3",a),true);
break;}},initComponent:function(){var a=this;this._cncMillingStore=new SP.object.CncMillingStore();this.createMillingForm();
this._millingForm.bindStore(this._cncMillingStore);this.items=[this._millingForm];SP.controls.CncMillingEditor.superclass.initComponent.call(this);
this.show();if(this.machineId){this._cncMillingStore.queryable.where("machineId=@0",this.machineId).load();
a._millingForm.getFieldByName("machineQuantity").hideItem();}else{a._millingForm.getFieldByName("machineQuantity").showItem();
}}});WebLight.namespace("SP","SP.controls");SP.controls.CncTurningEditor=WebLight.extend(Ext.Window,{modal:true,border:false,autoHeight:true,width:600,machineId:"",facilityId:"",_cncTurningStore:null,_cncTurningForm:null,createCncTurningForm:function(){var d=this;
var t=new SP.object.MachineMakeStore();t.queryable.where("machineType=@0","T").orderBy("title").load();
var q=new SP.form.DropdownList({store:t,displayField:"title",valueField:"machineMakeId",name:"machineMakeId"});
var r=new SP.object.MachineModelStore();r.queryable.orderBy("title");var p=new SP.form.DropdownList({store:r,displayField:"title",valueField:"machineModelId",name:"machineModelId"});
p.linkTo(q);var l=new SP.object.ControllerMakeStore();l.queryable.where("machineType=@0","T").orderBy("title").load();
var u=new SP.form.DropdownList({store:l,displayField:"title",valueField:"controllerMakeId",name:"controllerMakeId"});
var h=new SP.object.ControllerModelStore();h.queryable.orderBy("title");var k=new SP.form.DropdownList({store:h,displayField:"title",valueField:"controllerModelId",name:"controllerModelId"});
k.linkTo(u);var g=Ext.create({xtype:"textfield",name:"machineMakeTitle",hidden:true,allowBlank:true});
var j=Ext.create({xtype:"textfield",name:"machineModelTitle",hidden:true,allowBlank:true});var c=Ext.create({xtype:"textfield",name:"controllerMakeTitle",hidden:true,allowBlank:true});
var m=Ext.create({xtype:"textfield",name:"controllerModelTitle",hidden:true,allowBlank:true});var n=Ext.create({xtype:"compositefield",fieldLabel:"Make",items:[q,g]});
var e=Ext.create({xtype:"compositefield",fieldLabel:"Model",items:[p,j]});var s=Ext.create({xtype:"compositefield",fieldLabel:"Controller Make",items:[u,c]});
var b=Ext.create({xtype:"compositefield",fieldLabel:"Controller Model",items:[k,m]});var f=[q,p,u,k];
var a=[g,j,c,m];var o=[n,e,s,b];Ext.each(f,function(v,w){v.on("valuechange",function(x,y){if($.trim(y)=="Other"){a[w].show();
}else{a[w].hide();a[w].setValue("");}o[w].doLayout();});});this._cncTurningForm=new WebLight.form.FormPanel({header:false,border:false,frame:true,cls:"ux-form-1",labelWidth:150,items:o.concat([{layout:"column",defaults:{layout:"form",columnWidth:0.5},items:[{items:[new SP.form.DropdownList({store:Sp.data.BuiltInStores.programmingProtocolStore,fieldLabel:"Programming Protocol",displayField:"name",name:"progProtocol",valueField:"id",anchor:"95%",allowBlank:false})]},{items:[new SP.form.DropdownList({store:Sp.data.BuiltInStores.typeOfMachineStore,fieldLabel:"Type of Machine",displayField:"name",name:"typeOfMachine",valueField:"id",anchor:"95%",allowBlank:true})]}]},{layout:"column",defaults:{layout:"form",columnWidth:0.5},items:[{items:[new SP.form.DropdownList({store:Sp.data.BuiltInStores.noOfAxesStore,fieldLabel:"Number of Axes",displayField:"id",name:"noOfAxes",valueField:"id",anchor:"95%",allowBlank:true})]},{items:[{xtype:"numberfield",name:"maxRPM",fieldLabel:"Max RPM",anchor:"95%",allowBlank:true}]}]},new SP.form.DropdownList({name:"liveTooling",fieldLabel:"Live Tooling",store:Sp.data.BuiltInStores.radioGroupStore,displayField:"name",valueField:"id",allowBlank:true}),new SP.form.DropdownList({name:"lowerTurret",fieldLabel:"Lower Turret",store:Sp.data.BuiltInStores.radioGroupStore,displayField:"name",valueField:"id",allowBlank:true}),new SP.form.DropdownList({name:"subSpindle",fieldLabel:"Sub Spindle",store:Sp.data.BuiltInStores.radioGroupStore,displayField:"name",valueField:"id",allowBlank:true}),new SP.form.DropdownList({name:"barFeeder",fieldLabel:"Bar Feeder",store:Sp.data.BuiltInStores.radioGroupStore,displayField:"name",valueField:"id",allowBlank:true}),{layout:"column",defaults:{layout:"form",columnWidth:0.5},items:[{items:[new SP.form.DropdownList({store:Sp.data.BuiltInStores.maxTurnLengthStore,fieldLabel:"Max Turn Length",displayField:"id",name:"maxTurnLength",valueField:"id",anchor:"95%",allowBlank:true})]},{items:[new SP.form.DropdownList({store:Sp.data.BuiltInStores.maxChuckSizeStore,fieldLabel:"Max Chuck Size",displayField:"id",name:"maxChuckSize",valueField:"id",anchor:"95%",allowBlank:true})]}]},{xtype:"textarea",name:"specialFeatures",fieldLabel:"Other Special Features",anchor:"95%",allowBlank:true},{xtype:"spinnerfield",name:"machineQuantity",fieldLabel:"Quantity",minValue:1,value:1}]),buttons:[{text:"Save",handler:function(){if(d._cncTurningForm.getForm().isValid()){if(!d.machineId){d._cncTurningStore.getAt(0).set("facilityId",d.facilityId);
}d._cncTurningStore.submitChanges(function(){d.fireEvent("success");d.destroy();},function(w,v){alert(v);
});}}},{text:"Cancel",handler:function(){d.destroy();}}]});},setRadioGroup:function(c,a,b){switch(b){case true:c.onSetValue(String.format("{0}-rd1",a),true);
break;case false:c.onSetValue(String.format("{0}-rd2",a),true);break;default:c.onSetValue(String.format("{0}-rd3",a),true);
break;}},initComponent:function(){var a=this;this._cncTurningStore=new SP.object.CncTurningStore();this.createCncTurningForm();
this._cncTurningForm.bindStore(this._cncTurningStore);this.items=[this._cncTurningForm];SP.controls.CncTurningEditor.superclass.initComponent.call(this);
this.show();if(this.machineId){this._cncTurningStore.queryable.where("machineId=@0",this.machineId).load();
a._cncTurningForm.getFieldByName("machineQuantity").hideItem();}else{a._cncTurningForm.getFieldByName("machineQuantity").showItem();
}}});WebLight.namespace("SP","SP.controls");SP.controls.CncComboEditor=WebLight.extend(Ext.Window,{modal:true,border:false,autoHeight:true,width:600,machineId:"",facilityId:"",_comboStore:null,_comboForm:null,createComboForm:function(){var d=this;
var t=new SP.object.MachineMakeStore();t.queryable.where("machineType=@0","C").orderBy("title").load();
var q=new SP.form.DropdownList({store:t,displayField:"title",valueField:"machineMakeId",name:"machineMakeId"});
var r=new SP.object.MachineModelStore();r.queryable.orderBy("title");var p=new SP.form.DropdownList({store:r,displayField:"title",valueField:"machineModelId",name:"machineModelId"});
p.linkTo(q);var l=new SP.object.ControllerMakeStore();l.queryable.where("machineType=@0","C").orderBy("title").load();
var u=new SP.form.DropdownList({store:l,displayField:"title",valueField:"controllerMakeId",name:"controllerMakeId"});
var h=new SP.object.ControllerModelStore();h.queryable.orderBy("title");var k=new SP.form.DropdownList({store:h,displayField:"title",valueField:"controllerModelId",name:"controllerModelId"});
k.linkTo(u);var g=Ext.create({xtype:"textfield",name:"machineMakeTitle",hidden:true,allowBlank:true});
var j=Ext.create({xtype:"textfield",name:"machineModelTitle",hidden:true,allowBlank:true});var c=Ext.create({xtype:"textfield",name:"controllerMakeTitle",hidden:true,allowBlank:true});
var m=Ext.create({xtype:"textfield",name:"controllerModelTitle",hidden:true,allowBlank:true});var n=Ext.create({xtype:"compositefield",fieldLabel:"Make",items:[q,g]});
var e=Ext.create({xtype:"compositefield",fieldLabel:"Model",items:[p,j]});var s=Ext.create({xtype:"compositefield",fieldLabel:"Controller Make",items:[u,c]});
var b=Ext.create({xtype:"compositefield",fieldLabel:"Controller Model",items:[k,m]});var f=[q,p,u,k];
var a=[g,j,c,m];var o=[n,e,s,b];Ext.each(f,function(v,w){v.on("valuechange",function(x,y){if($.trim(y)=="Other"){a[w].show();
}else{a[w].hide();a[w].setValue("");}o[w].doLayout();});});this._comboForm=new WebLight.form.FormPanel({header:false,border:false,frame:true,cls:"ux-form-1",labelWidth:150,items:o.concat([{layout:"column",defaults:{layout:"form",columnWidth:0.5},items:[{items:[new SP.form.DropdownList({store:Sp.data.BuiltInStores.programmingProtocolStore,fieldLabel:"Programming Protocol",displayField:"name",name:"progProtocol",valueField:"id",anchor:"95%",allowBlank:false})]},{items:[new SP.form.DropdownList({store:Sp.data.BuiltInStores.typeOfMachineStore,fieldLabel:"Type of Machine",displayField:"name",name:"typeOfMachine",valueField:"id",anchor:"95%",allowBlank:true})]}]},{layout:"column",defaults:{layout:"form",columnWidth:0.5},items:[{items:[new SP.form.DropdownList({store:Sp.data.BuiltInStores.noOfAxesStore,fieldLabel:"Number of Axes",displayField:"id",name:"noOfAxes",valueField:"id",anchor:"95%",allowBlank:true})]},{items:[{xtype:"numberfield",name:"maxRPM",fieldLabel:"Max RPM",anchor:"95%",allowBlank:true}]}]},new SP.form.DropdownList({name:"liveTooling",fieldLabel:"Live Tooling",store:Sp.data.BuiltInStores.radioGroupStore,displayField:"name",valueField:"id",allowBlank:true}),new SP.form.DropdownList({name:"lowerTurret",fieldLabel:"Lower Turret",store:Sp.data.BuiltInStores.radioGroupStore,displayField:"name",valueField:"id",allowBlank:true}),new SP.form.DropdownList({name:"subSpindle",fieldLabel:"Sub Spindle",store:Sp.data.BuiltInStores.radioGroupStore,displayField:"name",valueField:"id",allowBlank:true}),new SP.form.DropdownList({name:"barFeeder",fieldLabel:"Bar Feeder",store:Sp.data.BuiltInStores.radioGroupStore,displayField:"name",valueField:"id",allowBlank:true}),{layout:"column",defaults:{layout:"form",columnWidth:0.5},items:[{items:[new SP.form.DropdownList({store:Sp.data.BuiltInStores.maxTurnLengthStore,fieldLabel:"Max Turn Length",displayField:"id",name:"maxTurnLength",valueField:"id",anchor:"95%",allowBlank:true})]},{items:[new SP.form.DropdownList({store:Sp.data.BuiltInStores.maxChuckSizeStore,fieldLabel:"Max Chuck Size",displayField:"id",name:"maxChuckSize",valueField:"id",anchor:"95%",allowBlank:true})]}]},{xtype:"textarea",name:"specialFeatures",fieldLabel:"Other Special Features",anchor:"95%",allowBlank:true},{xtype:"spinnerfield",name:"machineQuantity",fieldLabel:"Quantity",minValue:1,value:1}])});
this._comboForm.bindStore(this._comboStore);},initComponent:function(){var a=this;a._comboStore=new SP.object.CncComboStore();
this.createComboForm();this.items=[this._comboForm];this.buttons=[{text:"Save",handler:function(){if(a._comboForm.getForm().isValid()){if(!a.machineId){a._comboStore.getAt(0).set("facilityId",a.facilityId);
}a._comboStore.submitChanges(function(){a.fireEvent("success");a.destroy();},function(c,b){alert(b);});
}}},{text:"Cancel",handler:function(){a.destroy();}}];SP.controls.CncComboEditor.superclass.initComponent.call(this);
this.show();if(a.machineId!=""){a._comboStore.queryable.where("machineId=@0",a.machineId).load();a._comboForm.getFieldByName("machineQuantity").hideItem();
}else{a._comboForm.getFieldByName("machineQuantity").showItem();}}});WebLight.namespace("SP","SP.controls");
SP.controls.CncEdmEditor=WebLight.extend(Ext.Window,{modal:true,border:false,autoHeight:true,width:600,machineId:"",facilityId:"",_edmForm:null,_edmStore:null,createEdmForm:function(){var d=this;
var t=new SP.object.MachineMakeStore();t.queryable.where("machineType=@0","E").orderBy("title").load();
var q=new SP.form.DropdownList({store:t,displayField:"title",valueField:"machineMakeId",name:"machineMakeId"});
var r=new SP.object.MachineModelStore();r.queryable.orderBy("title");var p=new SP.form.DropdownList({store:r,displayField:"title",valueField:"machineModelId",name:"machineModelId"});
p.linkTo(q);var l=new SP.object.ControllerMakeStore();l.queryable.where("machineType=@0","E").orderBy("title").load();
var u=new SP.form.DropdownList({store:l,displayField:"title",valueField:"controllerMakeId",name:"controllerMakeId"});
var h=new SP.object.ControllerModelStore();h.queryable.orderBy("title");var k=new SP.form.DropdownList({store:h,displayField:"title",valueField:"controllerModelId",name:"controllerModelId"});
k.linkTo(u);var g=Ext.create({xtype:"textfield",name:"machineMakeTitle",hidden:true,allowBlank:true});
var j=Ext.create({xtype:"textfield",name:"machineModelTitle",hidden:true,allowBlank:true});var c=Ext.create({xtype:"textfield",name:"controllerMakeTitle",hidden:true,allowBlank:true});
var m=Ext.create({xtype:"textfield",name:"controllerModelTitle",hidden:true,allowBlank:true});var n=Ext.create({xtype:"compositefield",fieldLabel:"Make",items:[q,g]});
var e=Ext.create({xtype:"compositefield",fieldLabel:"Model",items:[p,j]});var s=Ext.create({xtype:"compositefield",fieldLabel:"Controller Make",items:[u,c]});
var b=Ext.create({xtype:"compositefield",fieldLabel:"Controller Model",items:[k,m]});var f=[q,p,u,k];
var a=[g,j,c,m];var o=[n,e,s,b];Ext.each(f,function(v,w){v.on("valuechange",function(x,y){if($.trim(y)=="Other"){a[w].show();
}else{a[w].hide();a[w].setValue("");}o[w].doLayout();});});this._edmForm=new WebLight.form.FormPanel({header:false,border:false,frame:true,cls:"ux-form-1",labelWidth:150,allowBlank:true,items:o.concat([{layout:"column",defaults:{layout:"form",columnWidth:0.5},items:[{items:[new SP.form.DropdownList({store:Sp.data.BuiltInStores.programmingProtocolStore,fieldLabel:"Programming Protocol",displayField:"name",name:"progProtocol",valueField:"id",anchor:"95%",allowBlank:false})]}]},new SP.form.DropdownList({name:"toolChanger",fieldLabel:"Tool Changer",store:Sp.data.BuiltInStores.radioGroupStore,displayField:"name",valueField:"id",allowBlank:true}),new SP.form.DropdownList({name:"ramWire",fieldLabel:"Type",store:Sp.data.BuiltInStores.ramWriteStore,displayField:"name",valueField:"id",allowBlank:true}),{layout:"column",defaults:{layout:"form",columnWidth:0.33,labelWidth:100},items:[{items:[new SP.form.DropdownList({store:Sp.data.BuiltInStores.axisTravelStore,fieldLabel:"X Axis Travel",displayField:"id",name:"travelX",valueField:"id",anchor:"95%",allowBlank:true})]},{items:[new SP.form.DropdownList({store:Sp.data.BuiltInStores.axisTravelStore,fieldLabel:"Y Axis Travel",displayField:"id",name:"travelY",valueField:"id",anchor:"95%",allowBlank:true})]},{items:[new SP.form.DropdownList({store:Sp.data.BuiltInStores.axisTravelStore,fieldLabel:"Z Axis Travel",displayField:"id",name:"travelZ",valueField:"id",anchor:"95%",allowBlank:true})]}]},{layout:"column",defaults:{layout:"form",columnWidth:0.5},items:[{items:[new SP.form.DropdownList({store:Sp.data.BuiltInStores.maxLoadCapacityStore,fieldLabel:"Max Load Capacity",displayField:"id",name:"maxCapacity",valueField:"id",anchor:"95%",allowBlank:true})]},{items:[new SP.form.DropdownList({store:Sp.data.BuiltInStores.squareInchesHourStore,fieldLabel:"Square Inches/Hour",displayField:"id",name:"sqInXHour",valueField:"id",anchor:"95%",allowBlank:true})]}]},{xtype:"textarea",name:"specialFeatures",fieldLabel:"Other Special Features",anchor:"95%",allowBlank:true},{xtype:"spinnerfield",name:"machineQuantity",fieldLabel:"Quantity",minValue:1,value:1}])});
this._edmForm.bindStore(this._edmStore);},initComponent:function(){var a=this;this._edmStore=new SP.object.CncEDMStore();
this.createEdmForm();this.items=[this._edmForm];this.buttons=[{text:"Save",handler:function(){if(a._edmForm.getForm().isValid()){if(!a.machineId){a._edmStore.getAt(0).set("facilityId",a.facilityId);
}a._edmStore.submitChanges(function(){a.fireEvent("success");a.destroy();},function(c,b){alert(b);});
}}},{text:"Cancel",handler:function(){a.destroy();}}];SP.controls.CncEdmEditor.superclass.initComponent.call(this);
this.show();if(this.machineId){this._edmStore.queryable.where("machineId=@0",this.machineId).load();a._edmForm.getFieldByName("machineQuantity").hideItem();
}else{a._edmForm.getFieldByName("machineQuantity").showItem();}}});WebLight.namespace("SP","SP.controls");
SP.controls.CncOrgSystemGrid=WebLight.extend(WebLight.Control,{html:_builtInTemplate_b84c3e97[2],facilityId:"",_cadStore:null,_cadGrid:null,_addCadButton:null,_cadTextBox:null,_newCadDropdown:null,_camStore:null,_camGrid:null,_addCamButton:null,_camTextBox:null,_newCamDropdown:null,createCadGrid:function(){var a=this;
var c=new SP.object.CadStore();var a=this;this._newCadDropdown=new SP.form.DropdownList({valueField:"systemId",displayField:"title",fieldLabel:"CAD",name:"systemId",width:100,store:c,hidden:true});
this._newCadDropdown.on("valuechange",function(d,e){if($.trim(e)=="Other"){a._cadTextBox.show();}else{a._cadTextBox.hide();
a._cadTextBox.setValue("");}});c.queryable.where('title!=" None"').orderBy("title").load();this._cadTextBox=new Ext.create({xtype:"textfield",width:100,hidden:true});
this._addCadButton=Ext.create({text:"Add",iconCls:"icon-16x16-add",xtype:"button",hidden:true,handler:function(){if(a._newCadDropdown.getValue()){var d=a._cadStore.newRecord({});
d.set("facilityId",a.facilityId);d.set("systemId",a._newCadDropdown.getValue());if(a._cadTextBox.getValue()!=""){d.set("title",a._cadTextBox.getValue());
}a._cadStore.add(d);a._cadGrid.getSelectionModel().selectLastRow(false);a._cadStore.submitChanges(function(e){a._cadStore.reload();
},function(f,e){alert(e);a._cadStore.reload();});}}});var b=function(d){if($.trim(d)=="None"){return"";
}else{return'<a href="javascript:void(0);" xcmd="delete">Delete</a>';}};this._cadGrid=new WebLight.grid.GridPanel({striptRows:true,pageSize:10,autoHeight:true,width:420,tbar:[{text:"CAD System:"},a._newCadDropdown,a._cadTextBox,a._addCadButton],selModel:new Ext.grid.RowSelectionModel({singleSelect:true}),cm:new Ext.grid.ColumnModel({defaults:{sortable:true},columns:[{dataIndex:"title",header:"Description",width:350},{header:"Action",align:"center",dataIndex:"title",sortable:false,renderer:b,width:50,hidden:true,}]})});
this._cadGrid.on("xcellclick",function(j,e,f,h,d){switch(e){case"delete":Ext.Msg.confirm("Confirm","Are you sure want to delete this record？",function(g){if(g=="yes"){j.store.remove(f);
j.store.submitChanges(function(){j.store.reload();},function(){alert("Failed");});}});break;}},this);
this._cadGrid.bindStore(this._cadStore);},createCamGrid:function(){var a=this;var c=new SP.object.CamStore();
var a=this;this._newCamDropdown=new SP.form.DropdownList({valueField:"systemId",displayField:"title",fieldLabel:"CAM",name:"systemId",width:100,forceSelection:true,store:c,hidden:true});
c.queryable.where('title!=" None"').orderBy("title").load();this._newCamDropdown.on("valuechange",function(d,e){if($.trim(e)=="Other"){a._camTextBox.show();
}else{a._camTextBox.hide();a._camTextBox.setValue("");}});this._camTextBox=new Ext.create({xtype:"textfield",width:100,hidden:true});
this._addCamButton=Ext.create({text:"Add",iconCls:"icon-16x16-add",xtype:"button",hidden:true,handler:function(){if(a._newCamDropdown.getValue()){var d=a._camStore.newRecord({});
d.set("facilityId",a.facilityId);d.set("systemId",a._newCamDropdown.getValue());if(a._camTextBox.getValue()!=""){d.set("title",a._camTextBox.getValue());
}a._camStore.add(d);a._camGrid.getSelectionModel().selectLastRow(false);a._camStore.submitChanges(function(e){a._camStore.reload();
},function(f,e){alert(e);a._camStore.reload();});}}});var b=function(d){if($.trim(d)=="None"){return"";
}else{return'<a href="javascript:void(0);" xcmd="delete">Delete</a>';}};this._camGrid=new WebLight.grid.GridPanel({striptRows:true,pageSize:10,autoHeight:true,width:420,tbar:[{text:"CAM System:"},a._newCamDropdown,a._camTextBox,a._addCamButton],selModel:new Ext.grid.RowSelectionModel({singleSelect:true}),cm:new Ext.grid.ColumnModel({defaults:{sortable:true},columns:[{dataIndex:"title",header:"Description",width:350},{header:"Action",align:"center",dataIndex:"title",sortable:false,renderer:b,width:50,hidden:true}]})});
this._camGrid.on("xcellclick",function(j,e,f,h,d){switch(e){case"delete":Ext.Msg.confirm("Confirm","Are you sure want to delete this record？",function(g){if(g=="yes"){j.store.remove(f);
j.store.submitChanges(function(){j.store.reload();},function(){alert("Failed");});}});break;}},this);
this._camGrid.bindStore(this._camStore);},createChildControls:function(){this._cadStore=new SP.object.CadApplyStore();
this._camStore=new SP.object.CamApplyStore();this.createCadGrid();this.createCamGrid();this.addChildControl(this._cadGrid,"left");
this.addChildControl(this._camGrid,"right");SP.controls.CncOrgSystemGrid.superclass.createChildControls.call(this);
},dataBind:function(){this._cadStore.queryable.where("facilityId=@0",this.facilityId).load();this._camStore.queryable.where("facilityId=@0",this.facilityId).load();
SP.controls.CncOrgSystemGrid.superclass.dataBind.call(this);},SetMode:function(b){var a=this;a._cadGrid.tbar.setVisible(!b);
a._camGrid.tbar.setVisible(!b);a._newCadDropdown.setVisible(!b);a._newCamDropdown.setVisible(!b);a._addCadButton.setVisible(!b);
a._addCamButton.setVisible(!b);a._camGrid.getColumnModel().setHidden(1,b);a._cadGrid.getColumnModel().setHidden(1,b);
a.doLayout();}});WebLight.namespace("SP","SP.controls");SP.controls.ButtonBar=Ext.extend(Ext.Toolbar,{initComponent:function(){var b=this;
var a=[];var c=["ALL","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];
for(var d=0;d<c.length;d++){a.push(new Ext.Button({text:c[d],handler:function(){for(var e=0;e<b.items.length;
e++){if(b.items.items[e]!=this){b.items.items[e].removeClass("ux-queryButton-click");}else{b.items.items[e].addClass("ux-queryButton-click");
}}b.fireEvent("ButtonQuery",this.text);}}));}this.items=a;SP.controls.ButtonBar.superclass.initComponent.call(this);
},selectAll:function(){for(var a=0;a<this.items.length;a++){this.items.items[a].removeClass("ux-queryButton-click");
}this.items.items[0].addClass("ux-queryButton-click");},removeALL:function(){for(var a=0;a<this.items.length;
a++){this.items.items[a].removeClass("ux-queryButton-click");}}});WebLight.namespace("SP","SP.page");
SP.page.CadPage=WebLight.extend(WebLight.Page,{title:"CAD",html:_builtInTemplate_b84c3e97[3],_cadStore:null,_cadGrid:null,_cadWin:null,_newCadButton:null,createCadListGrid:function(){this._cadStore=new SP.object.CadStore();
var a=this;var b=function(c){if($.trim(c)=="Other"||$.trim(c)=="None"){return"";}else{return'<a href="javascript:void(0);" xcmd="edit">Edit</a> &nbsp;                        <a href="javascript:void(0);" xcmd="delete">Delete</a>';
}};this._newCadButton=Ext.create({text:"Add New CAD Software",iconCls:"icon-16x16-add",xtype:"button",handler:function(){var c=a._cadStore.newRecord({title:""});
a._cadStore.add(c);a._cadGrid.getSelectionModel().selectLastRow(false);a._cadWin.setTitle("Add CAD Software");
a._cadWin.show();}});this._cadGrid=new WebLight.grid.GridPanel({striptRows:true,pageSize:20,height:550,style:"margin-top:20px",tbar:[a._newCadButton],selModel:new Ext.grid.RowSelectionModel({singleSelect:true}),cm:new Ext.grid.ColumnModel({defaults:{sortable:true},columns:[{dataIndex:"title",header:"CAD Software",width:700},{header:"Action",align:"center",renderer:b,sortable:false,dataIndex:"title"}]})});
this._cadGrid.on("xcellclick",function(h,d,e,f,c){switch(d){case"edit":a._cadWin.setTitle("Edit CAD Software");
a._cadWin.show();break;case"delete":Ext.Msg.confirm("Confirm","Are you sure want to delete this record？",function(g){if(g=="yes"){h.store.remove(e);
h.store.submitChanges(function(){h.store.reload();},function(){alert("Failed");});}});break;}},this);
this._cadGrid.bindStore(this._cadStore);},createCadWin:function(){var b=this;var c=new Ext.Button({text:"Save",scope:this,handler:function(){if(a.getForm().isValid()){b._cadWin.hide();
b._cadStore.submitChanges(function(e){b._cadStore.reload();},function(f,e){b._cadWin.show();alert(e);
});}}});var d=new Ext.Button({text:"Cancel",scope:this,handler:function(){a.reset();b._cadWin.hide();
}});var a=new WebLight.form.FormPanel({border:false,farme:true,labelWidth:120,frame:true,cls:"ux-form-1",defaults:{allowBlank:false,msgTarget:"under"},items:[{xtype:"textfield",width:250,fieldLabel:"CAD Software",name:"title"}],buttons:[c,d]});
a.bindStore(this._cadStore);this._cadWin=new Ext.Window({title:"Add CAD Software",width:410,items:[a],modal:true,border:false,closeAction:"hide",closable:false});
},createChildControls:function(){this.createCadListGrid();this.createCadWin();this.addChildControl(Ext.create({xtype:"box",html:'<h2 id="sp-box-h1">CAD</h2>'}),"container");
this.addChildControl(this._cadGrid,"container");SP.page.CadPage.superclass.createChildControls.call(this);
},dataBind:function(){this._cadStore.load();SP.page.CadPage.superclass.createChildControls.call(this);
}});WebLight.PageMgr.registerType("cad",SP.page.CadPage);WebLight.namespace("SP","SP.page");SP.page.CamPage=WebLight.extend(WebLight.Page,{title:"CAM",html:_builtInTemplate_b84c3e97[3],_camGrid:null,_camStore:null,_camWin:null,_newCamButton:null,createCamGrid:function(){var a=this;
this._camStore=new SP.object.CamStore();var b=function(c){if($.trim(c)=="Other"||$.trim(c)=="None"){return"";
}else{return'<a href="javascript:void(0);" xcmd="edit">Edit</a> &nbsp;                        <a href="javascript:void(0);" xcmd="delete">Delete</a>';
}};this._newCamButton=Ext.create({text:"Add New CAM Software",iconCls:"icon-16x16-add",xtype:"button",handler:function(){var c=a._camStore.newRecord({title:""});
a._camStore.add(c);a._camGrid.getSelectionModel().selectLastRow(false);a._camWin.setTitle("Add CAM Software");
a._camWin.show();}});this._camGrid=new WebLight.grid.GridPanel({striptRows:true,pageSize:20,height:550,style:"margin-top:20px",tbar:[a._newCamButton],selModel:new Ext.grid.RowSelectionModel({singleSelect:true}),cm:new Ext.grid.ColumnModel({defaults:{sortable:true},columns:[{dataIndex:"title",header:"CAM Software",width:700},{header:"Action",align:"center",dataIndex:"title",renderer:b,sortable:false}]})});
this._camGrid.on("xcellclick",function(h,d,e,f,c){switch(d){case"edit":a._camWin.setTitle("Edit CAM Software");
a._camWin.show();break;case"delete":Ext.Msg.confirm("Confirm","Are you sure want to delete this record？",function(g){if(g=="yes"){h.store.remove(e);
h.store.submitChanges(function(){h.store.reload();},function(){alert("Failed");});}});break;}},this);
this._camGrid.bindStore(this._camStore);},createCamWin:function(){var a=this;var b=new Ext.Button({text:"Save",scope:this,handler:function(){if(d.getForm().isValid()){a._camWin.hide();
a._camStore.submitChanges(function(e){a._camStore.reload();},function(f,e){a._camWin.show();alert(e);
});}}});var c=new Ext.Button({text:"Cancel",scope:this,handler:function(){d.reset();a._camWin.hide();
}});var d=new WebLight.form.FormPanel({border:false,farme:true,labelWidth:120,frame:true,cls:"ux-form-1",defaults:{allowBlank:false,msgTarget:"under"},items:[{xtype:"textfield",width:250,fieldLabel:"CAM Software",name:"title"}],buttons:[b,c]});
d.bindStore(this._camStore);this._camWin=new Ext.Window({title:"Add CAM Software",width:410,items:[d],modal:true,border:false,closeAction:"hide",closable:false});
},createChildControls:function(){this.createCamGrid();this.createCamWin();this.addChildControl(Ext.create({xtype:"box",html:'<h2 id="sp-box-h1">CAM</h2>'}),"container");
this.addChildControl(this._camGrid,"container");SP.page.CamPage.superclass.createChildControls.call(this);
},dataBind:function(){this._camStore.load();SP.page.CamPage.superclass.dataBind.call(this);}});WebLight.PageMgr.registerType("cam",SP.page.CamPage);
WebLight.namespace("SP","SP.page");SP.page.ContactMessagesPage=WebLight.extend(WebLight.Page,{title:"Contact Messages",html:_builtInTemplate_b84c3e97[3],_contactMessageWin:null,_contactMessageStore:null,_contactMessageGrid:null,_resolvedDateCofing:null,createContactMessageGrid:function(){var a=this;
var b=new Sm.grid.RowExpander({tpl:new Ext.XTemplate('<tpl for=".">','<div style="margin:3px;padding:5px;">','<strong style="display:block;padding:1px;margin-bottom:5px;">','<em style="border-bottom:1px solid #999;font-weight:bold;">{values.subject}:</em>',"</strong>{[this.renderString(values.body)]}<br/>",'<span style="color:#8A6666">{[this.renderString(values.notes)]}</span>',"</div>","</tpl>",{renderString:function(c){var d=c.toString().replace(/\n/g,"<br />");
return Ext.util.Format.htmlDecode(d);}})});this._contactMessageGrid=new WebLight.grid.GridPanel({striptRows:true,pageSize:20,style:"margin-top:20px",height:550,plugins:[b],selModel:new Ext.grid.RowSelectionModel({singleSelect:true}),cm:new Ext.grid.ColumnModel({defaults:{sortable:true},columns:[b,{dataIndex:"date",header:"Sent Date",width:100,renderer:Ext.util.Format.dateRenderer("Y/m/d h:i")},{dataIndex:"contactName",header:"Sender Name",width:90},{dataIndex:"phone",header:"Phone",width:100},{dataIndex:"email",header:"Email",width:180},{dataIndex:"categoryId",header:"Subject",width:140,renderer:function(d,c,e){return e.get("categoryName");
}},{dataIndex:"resolvedDate",header:"Status",width:100,renderer:function(d,c,e){if(e.get("issueResolved")==true){return String.format("Resolved {0}",Ext.util.Format.date(d,"m/d/y"));
}return"Pending";}},{header:"Action",align:"center",xtype:"templatecolumn",sortable:false,tpl:new Ext.XTemplate('<a href="javascript:void(0);" xcmd="edit">View</a> &nbsp;                             <a href="javascript:void(0);" xcmd="delete">Delete</a>')}]})});
this._contactMessageGrid.on("xcellclick",function(h,d,e,f,c){switch(d){case"edit":a._contactMessageWin.setTitle("Edit Contact");
a._contactMessageWin.show();break;case"delete":Ext.Msg.confirm("Confirm","Are you sure want to delete this record？",function(g){if(g=="yes"){h.store.remove(e);
h.store.submitChanges(function(){h.store.reload();},function(){alert("Failed");});}});break;}},this);
this._contactMessageGrid.bindStore(this._contactMessageStore);},createContactEditWin:function(){var a=this;
var d=new Ext.Button({text:"Save",scope:this,handler:function(){if(b.getForm().isValid()){a._contactMessageWin.hide();
a._contactMessageStore.submitChanges(function(f){a._contactMessageStore.reload();b.getForm().reset();
},function(g,f){a._contactMessageWin.show();alert(f);});}}});var e=new Ext.Button({text:"Cancel",scope:this,handler:function(){b.reset();
a._contactMessageWin.hide();}});var c=new SP.form.DropdownList({valueField:"categoryId",displayField:"categoryName",fieldLabel:"Subject",name:"categoryId",width:150,store:Sp.data.BuiltInStores.categoryStore});
this._resolvedDateCofing=new Ext.create({xtype:"datefield",fieldLabel:"Resolved Date",name:"resolvedDate",width:200});
var b=new WebLight.form.FormPanel({border:false,labelWidth:110,frame:true,defaults:{allowBlank:false,msgTarget:"under"},labelAlign:"right",cls:"ux-form-1",items:[{layout:"column",items:[{columnWidth:0.5,layout:"form",items:[{allowBlank:false,xtype:"datefield",fieldLabel:"Sent Date",name:"date",width:200}]},{columnWidth:0.5,layout:"form",items:[{allowBlank:false,xtype:"timefield",fieldLabel:"Sent Time",name:"time",width:200}]}]},{layout:"column",msgTarget:"under",items:[{columnWidth:0.5,layout:"form",items:[{allowBlank:false,xtype:"textfield",fieldLabel:"Sender Name",name:"contactName",width:200,maxLength:256}]},{columnWidth:0.5,layout:"form",items:[{allowBlank:true,xtype:"textfield",fieldLabel:"Title",name:"subject",width:200,maxLength:512}]}]},c,{layout:"column",items:[{columnWidth:0.5,layout:"form",items:[{allowBlank:false,xtype:"checkbox",fieldLabel:"Issue Resolved",name:"issueResolved",width:200,handler:function(f,g){if(g){a._resolvedDateCofing.show();
a._resolvedDateCofing.enable();}else{a._resolvedDateCofing.show();a._resolvedDateCofing.disable();a._resolvedDateCofing.reset();
}}}]},{columnWidth:0.5,layout:"form",items:[a._resolvedDateCofing]}]},{xtype:"textarea",width:550,height:100,fieldLabel:"Message",name:"body",maxLength:2048},{xtype:"textarea",width:550,height:100,fieldLabel:"Notes",name:"notes",allowBlank:true,maxLength:2048}],buttons:[d,e]});
b.bindStore(a._contactMessageStore);a._contactMessageWin=new Ext.Window({title:"ContactMessage",width:700,items:[b],modal:true,border:false,closeAction:"hide",closable:false});
},createChildControls:function(){this._contactMessageStore=new SP.object.ContactMessageStore();this.createContactMessageGrid();
this.createContactEditWin();this.addChildControl(Ext.create({xtype:"box",html:'<h2 id="sp-box-h1">Contact Messages</h2>'}),"container");
this.addChildControl(this._contactMessageGrid,"container");SP.page.ContactMessagesPage.superclass.createChildControls.call(this);
},dataBind:function(){this._contactMessageStore.queryable.orderBy("date DESC").load();}});WebLight.PageMgr.registerType("contactmessages",SP.page.ContactMessagesPage);
WebLight.namespace("SP","SP.page");SP.page.ControllerMakeAndModelPage=WebLight.extend(WebLight.Page,{title:"Controller Make/Controller Model",html:_builtInTemplate_b84c3e97[3],_controllerTypeStore:null,_controllerMakeStore:null,_controllerModelStore:null,_controllerMakeGrid:null,_controllerModelGrid:null,_controllerMakeButton:null,_controllerModelButton:null,_controllerTypeComboBox:null,_controllerTypeForm:null,_controllerMakeWin:null,_controllerModelWin:null,_buttonQueryBar:null,createControllerTypyeForm:function(){var a=this;
this._controllerTypeStore=Sp.data.BuiltInStores.machineTypeStore;this._controllerTypeComboBox=new SP.form.DropdownList({valueField:"machineTypeId",displayField:"machineTypeName",fieldLabel:"Controller Type",value:"M",width:200,store:this._controllerTypeStore,listeners:{valuechange:function(b){a._controllerMakeStore.queryable.where("machineType=@0",b).orderBy("title").load();
a._buttonQueryBar.selectAll();}}});this._controllerTypeForm=new WebLight.form.FormPanel({bodyStyle:"margin-top:20px",border:false,labelWidth:100,items:[this._controllerTypeComboBox]});
},createControllerMakeGrid:function(){var a=this;this._controllerMakeStore=new SP.object.ControllerMakeStore();
var b=function(c){if($.trim(c)=="Other"||$.trim(c)=="None"){return"";}else{return'<a href="javascript:void(0);" xcmd="edit">Edit</a> &nbsp;                        <a href="javascript:void(0);" xcmd="delete">Delete</a>';
}};this._controllerMakeButton=Ext.create({xtype:"button",text:"Add New Controller Make",id:"newControllerMake",iconCls:"icon-16x16-add",handler:function(){var c=a._controllerMakeStore.newRecord({machineType:a._controllerTypeComboBox.getValue(),title:""});
a._controllerMakeStore.add([c]);a._controllerMakeGrid.getSelectionModel().selectLastRow(false);a._controllerMakeWin.setTitle("Add Controller Make");
a._controllerMakeWin.show();}});this._controllerMakeGrid=new WebLight.grid.GridPanel({title:"Controller Make",style:"margin-top:5px;",scriptRows:true,pageSize:20,height:550,width:420,tbar:[a._controllerMakeButton],selModel:new Ext.grid.RowSelectionModel({singleSelect:true}),cm:new Ext.grid.ColumnModel({defaults:{sortable:true},columns:[{dataIndex:"friendlyId",header:"Make Code",width:100},{header:"Controller Make",dataIndex:"title",width:200},{header:"Action",align:"center",dataIndex:"title",renderer:b,sortable:false}]})});
this._controllerMakeGrid.on("xcellclick",function(h,d,e,f,c){switch(d){case"edit":a._controllerMakeWin.setTitle("Edit Controller Make");
a._controllerMakeWin.show();break;case"delete":Ext.Msg.confirm("Confirm","Are you sure want to delete this record？",function(g){if(g=="yes"){h.store.remove(e);
h.store.submitChanges(function(){h.store.reload();},function(){alert("Failed");});}});break;}},this);
this._controllerMakeGrid.getSelectionModel().on("selectionchange",function(c){if(c.getSelected()&&c.getSelected().get("controllerMakeId")){a._controllerModelButton.enable();
a._controllerModelStore.queryable.where("controllerMakeId=@0",c.getSelected().get("controllerMakeId")).orderBy("title").load();
a._controllerModelGrid.setTitle("Controller Model : "+c.getSelected().get("title"));}else{a._controllerModelButton.disable();
a._controllerModelStore.removeAll();a._controllerModelGrid.setTitle("Controller Model");}});},createControllerModelGrid:function(){var a=this;
this._controllerModelStore=new SP.object.ControllerModelStore();var b=function(c){if($.trim(c)=="Other"||$.trim(c)=="None"){return"";
}else{return'<a href="javascript:void(0);" xcmd="edit">Edit</a> &nbsp;                        <a href="javascript:void(0);" xcmd="delete">Delete</a>';
}};this._controllerModelButton=Ext.create({text:"Add New Controller Model",disabled:true,iconCls:"icon-16x16-add",id:"newControllerModel",xtype:"button",handler:function(){var c=a._controllerModelStore.newRecord({controllerMakeId:a._controllerMakeGrid.getSelectionModel().getSelected().get("controllerMakeId"),title:""});
a._controllerModelStore.add([c]);a._controllerModelGrid.getSelectionModel().selectLastRow(false);a._controllerModelWin.setTitle("Add Controller Model");
a._controllerModelWin.show();}});this._controllerModelGrid=new WebLight.grid.GridPanel({title:"Controller Model",scriptRows:true,pageSize:20,height:550,width:420,style:"margin-top:5px;",tbar:[this._controllerModelButton],selModel:new Ext.grid.RowSelectionModel({singleSelect:true}),cm:new Ext.grid.ColumnModel({defaults:{sortable:true},columns:[{dataIndex:"friendlyId",header:"Model Code",width:100},{dataIndex:"title",header:"Controller Model",width:200},{header:"Action",align:"center",dataIndex:"title",renderer:b,sortable:false}]})});
this._controllerModelGrid.on("xcellclick",function(h,d,e,f,c){switch(d){case"edit":a._controllerModelWin.setTitle("Edit Controller Model");
a._controllerModelWin.show();break;case"delete":Ext.Msg.confirm("Confirm","Are you sure want to delete this record？",function(g){if(g=="yes"){h.store.remove(e);
h.store.submitChanges(function(){h.store.reload();},function(){alert("Failed");});}});break;}},this);
},createControllerMakeWin:function(){var a=this;var b=new Ext.Button({text:"Save",handler:function(){if(d.getForm().isValid()){a._controllerMakeWin.hide();
a._controllerMakeStore.submitChanges(function(e){a._controllerMakeStore.reload();},function(f,e){a._controllerMakeWin.show();
alert(e);});}}});var c=new Ext.Button({text:"Cancel",scope:this,handler:function(){d.reset();a._controllerMakeWin.hide();
}});var d=new WebLight.form.FormPanel({border:false,labelWidth:130,frame:true,cls:"ux-form-1",defaults:{allowBlank:false,msgTarget:"under"},items:[{xtype:"textfield",name:"title",width:250,fieldLabel:"Controller Model"}],buttons:[b,c]});
d.bindStore(a._controllerMakeStore);this._controllerMakeWin=new Ext.Window({header:true,title:"Add Controller Make",border:false,width:410,items:[d],modal:true,closeAction:"hide",closable:false});
},createControllerModelWin:function(){var a=this;var b=new Ext.Button({text:"Save",handler:function(){if(d.getForm().isValid()){a._controllerModelWin.hide();
a._controllerModelStore.submitChanges(function(e){a._controllerModelStore.reload();},function(f,e){a._controllerModelWin.show();
alert(e);});}}});var c=new Ext.Button({text:"Cancel",scope:this,handler:function(){d.reset();a._controllerModelWin.hide();
}});var d=new WebLight.form.FormPanel({border:false,labelWidth:130,frame:true,defaults:{allowBlank:false,msgTarget:"under"},cls:"ux-form-1",items:[{xtype:"textfield",name:"title",width:250,fieldLabel:"Controller Model"}],buttons:[b,c]});
d.bindStore(a._controllerModelStore);a._controllerModelWin=new Ext.Window({header:true,title:"Add Controller Model",border:false,width:410,items:[d],modal:true,closeAction:"hide",closable:false});
},createChildControls:function(){var a=this;this.createControllerTypyeForm();this.createControllerMakeGrid();
this.createControllerModelGrid();this.createControllerMakeWin();this.createControllerModelWin();this._controllerMakeGrid.bindStore(this._controllerMakeStore);
this._controllerModelGrid.bindStore(this._controllerModelStore);this._buttonQueryBar=new SP.controls.ButtonBar({width:530,border:true,listeners:{ButtonQuery:function(b){if(b=="ALL"){a._controllerMakeStore.queryable.where("machineType=@0",a._controllerTypeComboBox.getValue()).orderBy("title").load();
a._controllerModelStore.queryable.where("controllerMakeId=00000000-0000-0000-0000-000000000000").load();
}else{a._controllerMakeStore.queryable.where("machineType=@0 && title^=@1",a._controllerTypeComboBox.getValue(),b).orderBy("title").load();
a._controllerModelStore.queryable.where("controllerMakeId=00000000-0000-0000-0000-000000000000").load();
}}}});this.addChildControl(Ext.create({xtype:"box",html:'<h1 id="sp-box-h1">Controller Make and Controller Model</h1>'}),"top");
this.addChildControl(this._controllerTypeForm,"top");this.addChildControl(this._buttonQueryBar,"top");
this.addChildControl(this._controllerMakeGrid,"left");this.addChildControl(this._controllerModelGrid,"right");
SP.page.ControllerMakeAndModelPage.superclass.createChildControls.call(this);},dataBind:function(){this._controllerMakeStore.queryable.where("machineType=@0",this._controllerTypeComboBox.value).orderBy("title").load();
this._controllerModelStore.queryable.where("controllerMakeId=00000000-0000-0000-0000-000000000000").load();
this._buttonQueryBar.selectAll();SP.page.ControllerMakeAndModelPage.superclass.dataBind.call(this);}});
WebLight.PageMgr.registerType("controllermakeandmodel",SP.page.ControllerMakeAndModelPage);WebLight.namespace("SP","SP.page");
SP.page.MachineMakeAndModelPage=WebLight.extend(WebLight.Page,{title:"Machine Make/Machine Model",html:_builtInTemplate_b84c3e97[3],_machineTypeStore:null,_machineMakeStore:null,_machineModelStore:null,_machineMakeGrid:null,_machineModelGrid:null,_newMachineMakeButton:null,_newMachineModelButton:null,_machineTypeComboBox:null,_machineTypeForm:null,_machineMakeWin:null,_machineModelWin:null,_buttonQueryBar:null,createMachineTypeForm:function(){var a=this;
this._machineTypeStore=Sp.data.BuiltInStores.machineTypeStore;this._machineTypeComboBox=new SP.form.DropdownList({fieldLabel:"Machine Type",store:this._machineTypeStore,displayField:"machineTypeName",valueField:"machineTypeId",value:"M",width:200,listeners:{valuechange:function(b){a._machineMakeStore.queryable.where("machineType=@0",b).orderBy("title").load();
a._buttonQueryBar.selectAll();}}});this._machineTypeForm=new WebLight.form.FormPanel({bodyStyle:"margin-top:20px",border:false,labelWidth:80,items:[this._machineTypeComboBox]});
},createMachineMakeWin:function(){var a=this;var b=null;var c=new Ext.Button({text:"Save",scope:this,handler:function(){if(b.getForm().isValid()){a._machineMakeWin.hide();
a._machineMakeStore.submitChanges(function(e){a._machineMakeStore.reload();},function(f,e){a._machineMakeWin.show();
alert(e);});}}});var d=new Ext.Button({text:"Cancel",scope:this,handler:function(){b.reset();a._machineMakeWin.hide();
}});b=new WebLight.form.FormPanel({frame:true,border:false,labelWidth:130,cls:"ux-form-1",defaults:{allowBlank:false,msgTarget:"under"},items:[{xtype:"textfield",layout:"form",fieldLabel:"Machine Make",name:"title",width:250}],buttons:[c,d]});
b.bindStore(this._machineMakeStore);this._machineMakeWin=new Ext.Window({header:true,title:"Machine Make Editor",border:false,width:410,items:[b],modal:true,closeAction:"hide",closable:false});
},createMachineModelWin:function(){var a=this;var c=new Ext.Button({text:"Save",scope:this,handler:function(){if(b.getForm().isValid()){a._machineModelWin.hide();
a._machineModelStore.submitChanges(function(e){a._machineModelStore.reload();},function(f,e){a._machineModelWin.show();
alert(e);});}}});var d=new Ext.Button({text:"Cancel",scope:this,handler:function(){b.reset();a._machineModelWin.hide();
}});var b=new WebLight.form.FormPanel({frame:true,border:false,labelWidth:130,cls:"ux-form-1",defaults:{allowBlank:false,msgTarget:"under"},items:[{xtype:"textfield",layout:"form",fieldLabel:"Machine Model",name:"title",width:250}],buttons:[c,d]});
b.bindStore(a._machineModelStore);a._machineModelWin=new Ext.Window({header:true,title:"Machine Model Editor",closeAction:"hide",border:false,width:410,items:[b],modal:true,closable:false});
},createMachineMakeGrid:function(){var a=this;var b=function(c){if($.trim(c)=="Other"||$.trim(c)=="None"){return"";
}else{return'<a href="javascript:void(0);" xcmd="edit">Edit</a> &nbsp;                        <a href="javascript:void(0);" xcmd="delete">Delete</a>';
}};this._newMachineMakeButton=Ext.create({text:"Add New Machine Make",iconCls:"icon-16x16-add",xtype:"button",handler:function(){a._machineMakeWin.setTitle("Add New Machine Make");
var c=a._machineMakeStore.newRecord({machineType:a._machineTypeComboBox.getValue(),title:""});a._machineMakeStore.add([c]);
a._machineMakeGrid.getSelectionModel().selectLastRow(false);a._machineMakeWin.show();}});this._machineMakeGrid=new WebLight.grid.GridPanel({style:"margin-bottom:10px;margin-top:5px;",tbar:[this._newMachineMakeButton],title:"Machine Make",stripeRows:true,pageSize:20,height:550,width:420,selModel:new Ext.grid.RowSelectionModel({singleSelect:true}),cm:new Ext.grid.ColumnModel({defaults:{sortable:true},columns:[{dataIndex:"friendlyId",header:"Make Code",width:100},{dataIndex:"title",header:"Machine Make",width:200},{header:"Action",align:"center",dataIndex:"title",renderer:b,sortable:false}]})});
this._machineMakeGrid.getSelectionModel().on("selectionchange",function(c){if(c.getSelected()&&c.getSelected().get("machineMakeId")){a._newMachineModelButton.enable();
a._machineModelStore.queryable.where("machineMakeId=@0",c.getSelected().get("machineMakeId")).orderBy("title").load();
a._machineModelGrid.setTitle(String.format("Machine Model : {0}",c.getSelected().get("title")));}else{a._newMachineModelButton.disable();
a._machineModelStore.removeAll();a._machineModelGrid.setTitle("Machine Model");}});this._machineMakeGrid.on("xcellclick",function(h,d,e,f,c){switch(d){case"edit":a._machineMakeWin.setTitle("Edit New Machine Make");
a._machineMakeWin.show();break;case"delete":Ext.Msg.confirm("Confirm","Are you sure want to delete this record？",function(g){if(g=="yes"){h.store.remove(e);
h.store.submitChanges(function(){h.store.reload();},function(){alert("Failed");});}});break;}},this);
},createMachineModelGrid:function(){var a=this;var b=function(c){if($.trim(c)=="Other"||$.trim(c)=="None"){return"";
}else{return'<a href="javascript:void(0);" xcmd="edit">Edit</a> &nbsp;                        <a href="javascript:void(0);" xcmd="delete">Delete</a>';
}};this._newMachineModelButton=Ext.create({xtype:"button",text:"Add New Machine Model",disabled:true,iconCls:"icon-16x16-add",handler:function(){a._machineModelWin.setTitle("Add New Machine Model");
var c=a._machineModelStore.newRecord({machineMakeId:a._machineMakeGrid.getSelectionModel().getSelected().get("machineMakeId"),title:""});
a._machineModelStore.add(c);a._machineModelGrid.getSelectionModel().selectLastRow(false);a._machineModelWin.show();
}});this._machineModelGrid=new WebLight.grid.GridPanel({tbar:[this._newMachineModelButton],title:"Machine Model",style:"margin-bottom:10px;margin-top:5px;",stripeRows:true,pageSize:20,height:550,width:420,selModel:new Ext.grid.RowSelectionModel({singleSelect:true}),cm:new Ext.grid.ColumnModel({defaults:{sortable:true},columns:[{dataIndex:"friendlyId",header:"Model Code",width:100},{dataIndex:"title",header:"Machine Model",width:200},{header:"Action",align:"center",dataIndex:"title",renderer:b,sortable:false}]})});
this._machineModelGrid.on("xcellclick",function(h,d,e,f,c){switch(d){case"edit":a._machineModelWin.setTitle("Edit Machine Model");
a._machineModelWin.show();break;case"delete":Ext.Msg.confirm("Confirm","Are you sure want to delete this record？",function(g){if(g=="yes"){h.store.remove(e);
h.store.submitChanges(function(){h.store.reload();},function(){alert("Failed");});}});break;}},this);
},createChildControls:function(){var a=this;this._machineModelStore=new SP.object.MachineModelStore();
this._machineMakeStore=new SP.object.MachineMakeStore();this.createMachineTypeForm();this.createMachineMakeGrid();
this.createMachineModelGrid();this.createMachineMakeWin();this.createMachineModelWin();this._machineMakeGrid.bindStore(this._machineMakeStore);
this._machineModelGrid.bindStore(this._machineModelStore);this._buttonQueryBar=new SP.controls.ButtonBar({width:530,border:true,listeners:{ButtonQuery:function(b){if(b=="ALL"){a._machineMakeStore.queryable.where("machineType=@0",a._machineTypeComboBox.getValue()).orderBy("title").load();
a._machineModelStore.queryable.where("machineMakeId=00000000-0000-0000-0000-000000000000");}else{a._machineMakeStore.queryable.where("machineType=@0 && title^=@1",a._machineTypeComboBox.getValue(),b).orderBy("title").load();
a._machineModelStore.queryable.where("machineMakeId=00000000-0000-0000-0000-000000000000");}}}});this.addChildControl(new Ext.create({xtype:"box",html:'<h1 id="sp-box-h1">Machine Make and Machine Model</h1>'}),"top");
this.addChildControl(this._machineTypeForm,"top");this.addChildControl(this._buttonQueryBar,"top");this.addChildControl(this._machineMakeGrid,"left");
this.addChildControl(this._machineModelGrid,"right");SP.page.MachineMakeAndModelPage.superclass.createChildControls.call(this);
},dataBind:function(){this._machineMakeStore.queryable.where("machineType=@0",this._machineTypeComboBox.getValue()).orderBy("title").load();
this._machineModelStore.queryable.where("machineMakeId=00000000-0000-0000-0000-000000000000");this._buttonQueryBar.selectAll();
SP.page.MachineMakeAndModelPage.superclass.dataBind.call(this);}});WebLight.PageMgr.registerType("machinemakeandmodel",SP.page.MachineMakeAndModelPage);
WebLight.namespace("SP","SP.page");SP.page.NaicscodesPage=WebLight.extend(WebLight.Page,{title:"NAICS Codes",html:_builtInTemplate_b84c3e97[3],_naicsCodesGrid:null,_naicsCodesStore:null,_naicsCodesWin:null,_newNaicsCodesButton:null,createNaicsCodesGrid:function(){var a=this;
this._naicsCodesStore=new SP.object.NaicCodeStore();this._newNaicsCodesButton=Ext.create({text:"Add New NAICS Codes",iconCls:"icon-16x16-add",xtype:"button",handler:function(){var b=a._naicsCodesStore.newRecord({code:"",title:""});
a._naicsCodesStore.add(b);a._naicsCodesGrid.getSelectionModel().selectLastRow(false);a._naicsCodesWin.setTitle("Add NAICS Codes");
a._naicsCodesWin.show();}});this._naicsCodesGrid=new WebLight.grid.GridPanel({striptRows:true,pageSize:20,height:550,style:"margin-top:20px",tbar:[a._newNaicsCodesButton],selModel:new Ext.grid.RowSelectionModel({singleSelect:true}),cm:new Ext.grid.ColumnModel({defaults:{sortable:true},columns:[{dataIndex:"code",header:"NAICS Codes",width:200},{dataIndex:"title",header:"Description",width:500,sortable:false},{header:"Action",align:"center",xtype:"templatecolumn",sortable:false,tpl:new Ext.XTemplate('<a href="javascript:void(0);" xcmd="edit">Edit</a> &nbsp;                         <a href="javascript:void(0);" xcmd="delete">Delete</a>')}]})});
this._naicsCodesGrid.on("xcellclick",function(f,c,d,e,b){switch(c){case"edit":a._naicsCodesWin.setTitle("Edit NAICS Codes");
a._naicsCodesWin.show();break;case"delete":Ext.Msg.confirm("Confirm","Are you sure want to delete this record？",function(g){if(g=="yes"){f.store.remove(d);
f.store.submitChanges(function(){f.store.reload();},function(){alert("Failed");});}});break;}},this);
this._naicsCodesGrid.bindStore(this._naicsCodesStore);},createNaicsCodesWin:function(){var a=this;var c=new Ext.Button({text:"Save",scope:this,handler:function(){if(b.getForm().isValid()){a._naicsCodesWin.hide();
a._naicsCodesStore.submitChanges(function(e){a._naicsCodesStore.reload();},function(f,e){a._naicsCodesWin.show();
alert(e);});}}});var d=new Ext.Button({text:"Cancel",scope:this,handler:function(){b.reset();a._naicsCodesWin.hide();
}});var b=new WebLight.form.FormPanel({border:false,labelWidth:120,frame:true,cls:"ux-form-1",defaults:{allowBlank:false,msgTarget:"under"},items:[{xtype:"textfield",width:250,fieldLabel:"NAICS Codes",name:"code",maxLength:64},{xtype:"textfield",width:250,fieldLabel:"NAICS Description",name:"title",maxLength:256}],buttons:[c,d]});
b.bindStore(this._naicsCodesStore);this._naicsCodesWin=new Ext.Window({title:"NAICS Codes",width:410,items:[b],modal:true,border:false,closeAction:"hide",closable:false});
},createChildControls:function(){this.createNaicsCodesGrid();this.createNaicsCodesWin();this.addChildControl(Ext.create({xtype:"box",html:'<h2 id="sp-box-h1">NAICS Codes</h2>'}),"container");
this.addChildControl(this._naicsCodesGrid,"container");SP.page.NaicscodesPage.superclass.createChildControls.call(this);
},dataBind:function(){this._naicsCodesStore.queryable.orderBy("code").load();SP.page.NaicscodesPage.superclass.dataBind.call(this);
}});WebLight.PageMgr.registerType("naicscodes",SP.page.NaicscodesPage);WebLight.namespace("SP","SP.page");
SP.page.NewMachinesEnteredPage=WebLight.extend(WebLight.Page,{title:"New Machines Entered",html:_builtInTemplate_b84c3e97[3],createChildControls:function(){this._contactStore=new SP.object.ContactStore();
this.addChildControl(Ext.create({xtype:"box",html:'<h2 id="sp-box-h1">New Machines Entered</h2>'}),"container");
SP.page.NewMachinesEnteredPage.superclass.createChildControls.call(this);},dataBind:function(){this._contactStore.load();
}});WebLight.PageMgr.registerType("newmachinesentered",SP.page.NewMachinesEnteredPage);WebLight.namespace("SP","SP.page");
SP.page.PostCodePage=WebLight.extend(WebLight.Page,{title:"Post Code",html:_builtInTemplate_b84c3e97[3],_postCodeStore:null,_postCodeGrid:null,_postCodeWin:null,_newPostCodeButton:null,_machineTypeDropdown:null,_machineMakeDropdown:null,_machineModelDropdown:null,_controllerMakeDropdown:null,_controllerModelDropdown:null,_machineMakeStore:null,_machineModelStore:null,_controllerMakeStore:null,_controllerModelStore:null,createPostCodeGrid:function(){var a=this;
this._newPostCodeButton=Ext.create({text:"Add New PostCode",iconCls:"icon-16x16-add",xtype:"button",handler:function(){var b=a._postCodeStore.newRecord({machineMakeId:"",machineModelId:"",controllerMakeId:"",controllerModelId:"",description:"",machineType:""});
a._postCodeStore.add(b);a._postCodeGrid.getSelectionModel().selectLastRow(false);a._postCodeWin.setTitle("Add PostCode");
a._postCodeWin.show();}});this._postCodeGrid=new WebLight.grid.GridPanel({striptRows:true,pageSize:20,height:550,style:"margin-top:20px",tbar:[a._newPostCodeButton],selModel:new Ext.grid.RowSelectionModel({singleSelect:true}),cm:new Ext.grid.ColumnModel({defaults:{sortable:true},columns:[{dataIndex:"machineMakeTitle",header:"Machine Make",width:100},{dataIndex:"machineModelTitle",header:"Machine Model",width:100},{dataIndex:"controllerMakeTitle",header:"Controller Make",width:100},{dataIndex:"controllerModelTitle",header:"Controller Model",width:100},{dataIndex:"description",header:"Description",width:200},{header:"Action",align:"center",sortable:false,xtype:"templatecolumn",tpl:new Ext.XTemplate('<a href="javascript:void(0);" xcmd="edit">Edit</a> &nbsp;                         <a href="javascript:void(0);" xcmd="delete">Delete</a>')}]})});
this._postCodeGrid.on("xcellclick",function(f,c,d,e,b){switch(c){case"edit":a._postCodeWin.setTitle("Edit PostCode");
a._postCodeWin.show();break;case"delete":Ext.Msg.confirm("Confirm","Are you sure want to delete this record？",function(g){if(g=="yes"){f.store.remove(d);
f.store.submitChanges(function(){f.store.reload();},function(){alert("Failed");});}});break;}},this);
this._postCodeGrid.bindStore(this._postCodeStore);},createPostCodeWin:function(){var a=this;var c=new Ext.Button({text:"Save",scope:this,handler:function(){if(b.getForm().isValid()){a._postCodeWin.hide();
a._postCodeStore.submitChanges(function(e){a._postCodeStore.reload();},function(f,e){a._postCodeWin.show();
alert(e);});}}});var d=new Ext.Button({text:"Cancel",scope:this,handler:function(){b.reset();a._postCodeWin.hide();
}});this._machineTypeDropdown=new SP.form.DropdownList({valueField:"machineTypeId",name:"machineType",displayField:"machineTypeName",fieldLabel:"Mahicne Type",width:200,store:Sp.data.BuiltInStores.machineTypeStore});
this._machineMakeDropdown=new SP.form.DropdownList({valueField:"machineMakeId",displayField:"title",fieldLabel:"Machine Make",name:"machineMakeId",width:150,store:this._machineMakeStore,allowBlank:false});
this._machineModelDropdown=new SP.form.DropdownList({valueField:"machineModelId",displayField:"title",fieldLabel:"Machine Model",name:"machineModelId",width:150,store:this._machineModelStore,allowBlank:false});
this._controllerMakeDropdown=new SP.form.DropdownList({valueField:"controllerMakeId",displayField:"title",fieldLabel:"Controller Make",name:"controllerMakeId",width:150,store:this._controllerMakeStore,allowBlank:false});
this._controllerModelDropdown=new SP.form.DropdownList({valueField:"controllerModelId",displayField:"title",fieldLabel:"Controller Model",name:"controllerModelId",width:150,store:this._controllerModelStore,allowBlank:false});
this._controllerMakeDropdown.linkTo(this._machineTypeDropdown,"machineType");this._machineMakeDropdown.linkTo(this._machineTypeDropdown,"machineType");
this._controllerModelDropdown.linkTo(this._controllerMakeDropdown);this._machineModelDropdown.linkTo(this._machineMakeDropdown);
var b=new WebLight.form.FormPanel({border:false,frame:true,labelWidth:120,cls:"ux-form-1",defaults:{allowBlank:false,msgTarget:"under"},items:[this._machineTypeDropdown,{layout:"column",items:[{layout:"form",columnWidth:0.5,items:[this._machineMakeDropdown]},{layout:"form",columnWidth:0.5,items:[this._machineModelDropdown]}]},{layout:"column",items:[{layout:"form",columnWidth:0.5,items:[this._controllerMakeDropdown]},{layout:"form",columnWidth:0.5,items:[this._controllerModelDropdown]}]},{xtype:"textarea",fieldLabel:"Description",name:"description",width:450,height:100,allowBlank:true,maxLength:250}],buttons:[c,d]});
b.bindStore(this._postCodeStore);this._postCodeWin=new Ext.Window({title:"Add New PostCode",width:610,items:[b],modal:true,border:false,closeAction:"hide",closable:false});
this._postCodeWin.on("beforeshow",function(){a._machineTypeDropdown.clearValue();a._machineTypeDropdown.setValue(b.getBoundRecord().get("machineType"));
});},createChildControls:function(){this.addChildControl(Ext.create({xtype:"box",html:'<h2 id="sp-box-h1">Post Code</h2>'}),"container");
this._postCodeStore=new SP.object.PostCodeStore();this._machineMakeStore=new SP.object.MachineMakeStore();
this._machineModelStore=new SP.object.MachineModelStore();this._controllerMakeStore=new SP.object.ControllerMakeStore();
this._controllerModelStore=new SP.object.ControllerModelStore();this.createPostCodeGrid();this.createPostCodeWin();
this.addChildControl(this._postCodeGrid,"container");SP.page.PostCodePage.superclass.createChildControls.call(this);
},dataBind:function(){this._postCodeStore.load();SP.page.PostCodePage.superclass.dataBind.call(this);
}});WebLight.PageMgr.registerType("postcode",SP.page.PostCodePage);WebLight.namespace("SP","SP.page");
SP.page.AssignOrganizationsToMepUserPage=WebLight.extend(WebLight.Page,{title:"Post Code",html:_builtInTemplate_b84c3e97[4],createChildControls:function(){this.addChildControl(Ext.create({xtype:"box",html:"<h2>Post Code</h2>"}),"container");
SP.page.AssignOrganizationsToMepUserPage.superclass.createChildControls.call(this);}});WebLight.PageMgr.registerType("assignorganizationstomepuser",SP.page.AssignOrganizationsToMepUserPage);
WebLight.namespace("SP","SP.page");SP.page.ChangeYourPasswordPage=WebLight.extend(WebLight.Page,{title:"Change Your Password",html:_builtInTemplate_b84c3e97[4],createPasswordForm:function(){var a=this;
var b=new Ext.Button({text:"Update",scope:this,id:"buttonUpdate",handler:function(){var d=a.passwordForm.getForm();
if(d.isValid()){var c=d.findField("oldPassword").getValue();var e=d.findField("newPassword").getValue();
var f=d.findField("newPasswordConfirm").getValue();if(e!=f){alert("Your new password entries did not match.");
return;}SP.object.User.changePassword(c,e,function(g){if(g){alert("You have successfully chosen a new Password.");
d.reset();}else{alert("Please specify the correct password.");}});}}});this.passwordForm=new WebLight.form.FormPanel({border:false,labelWidth:150,bodyStyle:"margin-top:20px;margin-left:100px",width:500,defaults:{allowBlank:false,msgTarget:"under"},labelAlign:"right",items:[{xtype:"textfield",width:240,fieldLabel:"Current Password",name:"oldPassword",id:"oldPassword",inputType:"password"},{xtype:"textfield",width:240,fieldLabel:"New Password",name:"newPassword",id:"newPassword",inputType:"password"},{xtype:"textfield",width:240,fieldLabel:"Confirm New Password",name:"newPasswordConfirm",id:"newPasswordConfirm",inputType:"password"}],buttons:[b]});
},createChildControls:function(){this.createPasswordForm();this.addChildControl(Ext.create({xtype:"box",html:'<h2 id="sp-box-h1">Change Your Password</h2>'}),"container");
this.addChildControl(this.passwordForm,"container");SP.page.ChangeYourPasswordPage.superclass.createChildControls.call(this);
}});WebLight.PageMgr.registerType("changeyourpassword",SP.page.ChangeYourPasswordPage);WebLight.namespace("SP","SP.page");
SP.page.EmailNotificationPage=WebLight.extend(WebLight.Page,{title:"Email Notification",html:_builtInTemplate_b84c3e97[4],_emailSetUpStore:null,_eMailForm:null,createeMailForm:function(){var a=this;
var b=new Ext.Button({text:"Update",scope:this,handler:function(){if(this._eMailForm.getForm().isValid()){a._emailSetUpStore.submitChanges(function(c){a._emailSetUpStore.reload();
},function(d,c){alert(c);});}}});this._eMailForm=new WebLight.form.FormPanel({frame:true,border:false,labelWidth:220,style:"margin-top:20px",cls:"ux-form-1",defaults:{msgTarget:"under"},labelAlign:"right",items:[{layout:"form",xtype:"box",html:'<h2 class="ux-box-1">Define the E-mail addresses to receive the Message Notifications</h2>'},{layout:"form",style:"margin-top:20px",items:[{xtype:"textfield",width:240,name:"otherEmail",fieldLabel:"Other Fields E-mail",vtype:"email"},{xtype:"textfield",width:240,name:"contactEmail",fieldLabel:"Contact E-mail",vtype:"email"},{xtype:"textfield",width:240,name:"massEmail",fieldLabel:"Mass E-mail Contact",vtype:"email"}]}],buttons:[b]});
this._eMailForm.bindStore(this._emailSetUpStore);},createChildControls:function(){this._emailSetUpStore=new SP.object.EmailSetUpStore();
this.createeMailForm();this.addChildControl(Ext.create({xtype:"box",html:'<h2 id="sp-box-h1">E-mail Notification</h2>'}),"container");
this.addChildControl(this._eMailForm,"container");SP.page.EmailNotificationPage.superclass.createChildControls.call(this);
},dataBind:function(){this._emailSetUpStore.load();SP.page.EmailNotificationPage.superclass.dataBind.call(this);
}});WebLight.PageMgr.registerType("emailnotification",SP.page.EmailNotificationPage);WebLight.namespace("SP","SP.page");
SP.page.MepCentersPage=WebLight.extend(WebLight.Page,{title:"MEP Centers",html:_builtInTemplate_b84c3e97[4],_mepGrid:null,_mepStore:null,_mepWin:null,_newMepButton:null,createMepGrid:function(){var a=this;
this._mepStore=new SP.object.MepStore();this._newMepButton=Ext.create({text:"Add New MEP",iconCls:"icon-16x16-add",xtype:"button",handler:function(){var b=a._mepStore.newRecord({title:"",phone:"",address1:"",city:"",state:"",zipCode:"",address2:"",address3:""});
a._mepStore.add(b);a._mepGrid.getSelectionModel().selectLastRow(false);a._mepWin.setTitle("Add MEP");
a._mepWin.show();}});this._mepGrid=new WebLight.grid.GridPanel({striptRows:true,pageSize:20,height:550,style:"margin-top:20px",tbar:[a._newMepButton],selModel:new Ext.grid.RowSelectionModel({singleSelect:true}),cm:new Ext.grid.ColumnModel({defaults:{sortable:true},columns:[{dataIndex:"friendlyId",header:"MEP ID",width:50},{dataIndex:"title",header:"MEP",width:180},{dataIndex:"phone",header:"Main Phone",width:100},{dataIndex:"address1",header:"Address",width:200},{dataIndex:"city",header:"City",width:100},{dataIndex:"state",header:"State",width:50},{dataIndex:"zipCode",header:"Zip Code",width:80},{header:"Action",align:"center",xtype:"templatecolumn",sortable:false,width:80,tpl:new Ext.XTemplate('<a href="javascript:void(0);" xcmd="edit">Edit</a> &nbsp;                         <a href="javascript:void(0);" xcmd="delete">Delete</a>')}]})});
this._mepGrid.on("xcellclick",function(f,c,d,e,b){switch(c){case"edit":a._mepWin.setTitle("Edit MEP");
a._mepWin.show();break;case"delete":Ext.Msg.confirm("Confirm","Are you sure want to delete this record？",function(g){if(g=="yes"){f.store.remove(d);
f.store.submitChanges(function(){f.store.reload();},function(){alert("Failed");});}});break;}},this);
this._mepGrid.bindStore(this._mepStore);},createMepWin:function(){var a=this;var c=new Ext.Button({text:"Save",scope:this,handler:function(){if(b.getForm().isValid()){a._mepWin.hide();
a._mepStore.submitChanges(function(f){a._mepStore.reload();},function(g,f){a._mepWin.show();alert(f);
});}}});var d=new Ext.Button({text:"Cancel",scope:this,handler:function(){b.reset();a._mepWin.hide();
}});var e=new SP.form.DropdownList({valueField:"state",displayField:"state",fieldLabel:"State",name:"state",width:60,store:Sp.data.BuiltInStores.stateStore});
var b=new WebLight.form.FormPanel({border:false,labelWidth:100,frame:true,cls:"ux-form-1",defaults:{allowBlank:false,msgTarget:"under"},labelAlign:"right",items:[{xtype:"textfield",width:343,fieldLabel:"MEP Name",name:"title",maxLength:256},{xtype:"textfield",width:343,fieldLabel:"Address1",name:"address1",maxLength:64},{xtype:"textfield",width:343,fieldLabel:"Address2",name:"address2",allowBlank:true,maxLength:64},{xtype:"textfield",width:343,fieldLabel:"Address3",name:"address3",allowBlank:true,maxLength:64},{layout:"column",items:[{columnWidth:0.43,defaults:{msgTarget:"under"},layout:"form",items:[{xtype:"textfield",fieldLabel:"City",name:"city",width:80,allowBlank:false,maxLength:64}]},{columnWidth:0.25,msgTarget:"under",layout:"form",labelWidth:40,items:[e]},{columnWidth:0.32,defaults:{msgTarget:"under"},msgTarget:"under",layout:"form",labelWidth:60,items:[{xtype:"textfield",fieldLabel:"Zip Code",name:"zipCode",width:60,allowBlank:false,maxLength:64}]}]},{xtype:"textfield",width:343,fieldLabel:"Main Phone",name:"phone",maxLength:36}],buttons:[c,d]});
b.bindStore(this._mepStore);this._mepWin=new Ext.Window({title:"MEP",width:500,items:[b],modal:true,border:false,closeAction:"hide",closable:false});
},createChildControls:function(){this.createMepGrid();this.createMepWin();this.addChildControl(Ext.create({xtype:"box",html:'<h2 id="sp-box-h1">MEP - Offices</h2>'}),"container");
this.addChildControl(this._mepGrid,"container");SP.page.MepCentersPage.superclass.createChildControls.call(this);
},dataBind:function(){this._mepStore.load();SP.page.MepCentersPage.superclass.dataBind.call(this);}});
WebLight.PageMgr.registerType("mepcenters",SP.page.MepCentersPage);WebLight.namespace("SP","SP.page");
SP.page.MepDefaultManagerPage=WebLight.extend(WebLight.Page,{title:"Mep Manager Default",html:_builtInTemplate_b84c3e97[4],createChildControls:function(){this.addChildControl(Ext.create({xtype:"box",html:"<h2>MEP - Project Managers & Users</h2>"}),"container");
SP.page.MepDefaultManagerPage.superclass.createChildControls.call(this);},dabaBind:function(){SP.page.PostCodePage.superclass.createChildControls.call(this);
}});WebLight.PageMgr.registerType("mepdefaultmanager",SP.page.MepDefaultManagerPage);WebLight.namespace("SP","SP.page");
SP.page.MepManagersUsersPage=WebLight.extend(WebLight.Page,{title:"MEP Managers and Users",html:_builtInTemplate_b84c3e97[4],_mepUserGrid:null,_mepUserStore:null,_mepUserWin:null,_newMepUserButton:null,createMepUserGrid:function(){var a=this;
this._newMepUserButton=Ext.create({text:"Add New MEP User",iconCls:"icon-16x16-add",xtype:"button",handler:function(){var c=a._mepUserStore.newRecord({middleName:"",firstName:"",lastName:"",mepId:"",phone:"",email:"",password:"",accessTypeId:null,address1:"",address2:"",address3:"",city:"",state:"",zipCode:"",hasAddress:true});
a._mepUserStore.add(c);a._mepUserGrid.getSelectionModel().selectLastRow(false);a._mepUserWin.setTitle("Add MEP User");
a._mepUserWin.show();}});var b=function(d,c,e){if($.trim(e.get("firstName"))=="[Not Assigned]"){return"";
}else{return'<a href="javascript:void(0);" xcmd="edit">Edit</a> &nbsp;                        <a href="javascript:void(0);" xcmd="delete">Delete</a>';
}};this._mepUserGrid=new WebLight.grid.GridPanel({striptRows:true,pageSize:20,height:550,style:"margin-top:20px",tbar:[a._newMepUserButton],selModel:new Ext.grid.RowSelectionModel({singleSelect:true}),cm:new Ext.grid.ColumnModel({defaults:{sortable:true},columns:[{dataIndex:"firstName",header:"Name",width:150,sortable:true,renderer:function(d,c,e){return String.format("{0} {1} {2}",e.get("firstName"),e.get("middleName")||"",e.get("lastName"));
}},{dataIndex:"phone",header:"Phone",width:100},{dataIndex:"email",header:"User Email",width:150},{dataIndex:"mepTitle",header:"MEP",width:100},{dataIndex:"accessTypeId",header:"User Type",width:170,renderer:function(e,c,g,h,f,d){switch(g.get("accessType")){case"SuperUser":return"Super User";
break;case"AdministratorRWD":return"Administrator (RWD)";break;case"AdministratorRW":return"Administrator (RW)";
case"MepAdministratorRWD":return"MEP Administrator (RWD)";break;case"MepUserRW":return"MEP User (RW)";
break;}}},{header:"Action",align:"center",sortable:false,renderer:b}]})});this._mepUserGrid.on("xcellclick",function(h,d,e,f,c){switch(d){case"edit":a._mepUserWin.setTitle("Edit MEP User");
a._mepUserWin.show();break;case"delete":Ext.Msg.confirm("Confirm","Are you sure want to delete this record？",function(g){if(g=="yes"){h.store.remove(e);
h.store.submitChanges(function(){h.store.reload();},function(){alert("Failed");});}});break;}},this);
this._mepUserGrid.bindStore(this._mepUserStore);},createMepUserWin:function(k){var e=this;var f=new Ext.Button({text:"Save",scope:this,handler:function(){var m=l.getForm();
if(m.isValid()){e._mepUserWin.hide();l.getBoundRecord().set("hasAddress",!b.collapsed);e._mepUserStore.submitChanges(function(n){e._mepUserStore.reload();
},function(o,n){e._mepUserWin.show();alert(n);});}}});var a=new Ext.Button({text:"Cancel",scope:this,handler:function(){l.reset();
e._mepUserWin.hide();}});var c=new SP.form.DropdownList({valueField:"state",displayField:"state",fieldLabel:"State",name:"state",width:60,allowBlank:true,store:Sp.data.BuiltInStores.stateStore});
var h=new SP.object.MepStore();var j=new SP.form.DropdownList({valueField:"mepId",displayField:"title",fieldLabel:"MEP Center",name:"mepId",width:140,store:h});
h.load();var g=new SP.form.DropdownList({valueField:"accessTypeId",displayField:"accessTypeName",fieldLabel:"Access Type",name:"accessTypeId",width:200,store:Sp.data.BuiltInStores.accessStore});
var b=Ext.create({xtype:"fieldset",checkboxToggle:true,checkboxName:"hasAddress",title:"Address",id:"addressFieldSet",autoHeight:true,collapsed:true,defaults:{msgTarget:"under"},items:[{xtype:"textfield",width:415,fieldLabel:"Address1",name:"address1",maxLength:64},{xtype:"textfield",width:415,fieldLabel:"Address2",name:"address2",maxLength:64},{xtype:"textfield",width:415,fieldLabel:"Address3",name:"address3",maxLength:64},{layout:"column",items:[{columnWidth:0.4,layout:"form",items:[{xtype:"textfield",fieldLabel:"City",name:"city",width:100,maxLength:64}]},{columnWidth:0.2,layout:"form",labelWidth:40,items:[c]},{columnWidth:0.4,layout:"form",labelWidth:70,items:[{xtype:"textfield",fieldLabel:"Zip Code",name:"zipCode",width:100,maxLength:10,maxLength:64}]}]}]});
b.on("beforecollapse",function(){l.getFieldByName("address1").allowBlank=true;l.getFieldByName("address2").allowBlank=true;
l.getFieldByName("address3").allowBlank=true;l.getFieldByName("city").allowBlank=true;l.getFieldByName("state").allowBlank=true;
l.getFieldByName("zipCode").allowBlank=true;e._mepUserWin.doLayout();});b.on("beforeexpand",function(){l.getFieldByName("address1").allowBlank=false;
l.getFieldByName("address2").allowBlank=true;l.getFieldByName("address3").allowBlank=true;l.getFieldByName("city").allowBlank=false;
l.getFieldByName("state").allowBlank=false;l.getFieldByName("zipCode").allowBlank=false;e._mepUserWin.doLayout();
});var d={layout:"column",id:"passwordColumn",items:[{columnWidth:0.45,layout:"form",items:[{xtype:"textfield",fieldLabel:"Password",id:"password",name:"password",width:120}]},{columnWidth:0.55,layout:"form",labelWidth:150,items:[{xtype:"textfield",id:"passwordConfirm",fieldLabel:"Password Confirm",name:"password",width:120}]}]};
var l=new WebLight.form.FormPanel({border:false,labelWidth:100,frame:true,cls:"ux-form-1",defaults:{allowBlank:false,msgTarget:"under"},labelAlign:"right",items:[{layout:"column",items:[{columnWidth:0.4,layout:"form",items:[{allowBlank:false,xtype:"textfield",fieldLabel:"First Name",name:"firstName",width:100}]},{columnWidth:0.2,layout:"form",labelWidth:40,items:[{xtype:"textfield",fieldLabel:"M.I",name:"middleName",width:60,maxLength:1}]},{columnWidth:0.4,layout:"form",labelWidth:90,items:[{allowBlank:false,xtype:"textfield",fieldLabel:"Last Name",name:"lastName",width:100}]}]},{layout:"column",items:[{columnWidth:0.5,layout:"form",items:[j]},{columnWidth:0.5,layout:"form",labelWidth:40,items:[{xtype:"textfield",fieldLabel:"Phone",name:"phone",width:200}]}]},{xtype:"textfield",width:425,fieldLabel:"Email",name:"email",vtype:"email"},{xtype:"textfield",width:425,fieldLabel:"Password",name:"password"},g,b],buttons:[f,a]});
l.bindStore(this._mepUserStore);this._mepUserWin=new Ext.Window({title:"MEP User",width:600,items:[l],modal:true,border:false,closeAction:"hide",closable:false});
this._mepUserWin.on("beforeshow",function(){if(e._mepUserGrid.getSelectionModel().getSelected().get("hasAddress")){b.expand(false);
}else{b.collapse(true);}e._mepUserWin.doLayout();});},createChildControls:function(){this._mepUserStore=new SP.object.MepUserStore();
this.createMepUserGrid();this.createMepUserWin();this.addChildControl(Ext.create({xtype:"box",html:'<h2 id="sp-box-h1">MEP Managers & Users</h2>'}),"container");
this.addChildControl(this._mepUserGrid,"container");SP.page.MepManagersUsersPage.superclass.createChildControls.call(this);
},dataBind:function(){this._mepUserStore.load();SP.page.MepManagersUsersPage.superclass.dataBind.call(this);
}});WebLight.PageMgr.registerType("mepmanagersusers",SP.page.MepManagersUsersPage);WebLight.namespace("SP","SP.page");
SP.page.NetworkEmailNotificationPage=WebLight.extend(WebLight.Page,{title:"Network Email Notification",html:_builtInTemplate_b84c3e97[4],_contactGrid:null,_emailWin:null,_contactStore:null,createContactGrid:function(){var a=this;
this._contactGrid=new WebLight.grid.GridPanel({striptRows:true,pageSize:20,height:550,style:"margin-top:20px",selModel:new Ext.grid.RowSelectionModel({singleSelect:true}),cm:new Ext.grid.ColumnModel({defaults:{sortable:true},columns:[{dataIndex:"email",header:"User Email",width:200},{dataIndex:"firstName",header:"First Name",width:100},{dataIndex:"lastName",header:"Last Name",width:100},{dataIndex:"organizationName",header:"Company Name",width:200},{dataIndex:"phone",header:"Phone",width:100},{header:"Action",align:"center",sortable:false,width:140,renderer:function(d,b,f,g,e,c){if(f.get("isAllowLogin")){return'<a href="javascript:void(0);" xcmd="send">Send Email</a>&nbsp;&nbsp;&nbsp;                                <a href="javascript:void(0);" xcmd="sendlogin">Send Login</a> ';
}else{return'<a href="javascript:void(0);" xcmd="send">Send Email</a>';}}}]})});this._contactGrid.on("xcellclick",function(f,c,d,e,b){switch(c){case"send":a._emailWin.show();
break;case"sendlogin":a._contactGrid.getEl().mask("Sending...");SP.object.EmailLog.sendLoginEmail(d.get("contactId"),function(g){if(g){alert("Message Sent Successfully");
}else{alert("Message Sent Losing");}a._contactGrid.getEl().unmask();});break;}},this);this._contactGrid.bindStore(this._contactStore);
},createEmailWin:function(){var b=this;var d=new Ext.Button({text:"Send",scope:this,handler:function(){if(c.getForm().isValid()){c.getEl().mask("Sending...");
SP.object.EmailLog.sendEmail(c.getFieldByName("fromEmail").getValue(),c.getBoundRecord().get("email"),c.getBoundRecord().get("contactId"),c.getFieldByName("message").getValue(),c.getFieldByName("subject").getValue(),function(f){if(f==true){alert("Message Sent Successfully");
b._emailWin.hide();c.getForm().reset();c.getEl().unmask();}else{alert("Message Sent Losing");c.getEl().unmask();
}},function(g,f){alert(f);});}}});var a=new Ext.Button({text:"Show Default E-Mail",scope:this,width:150,handler:function(){c.getFieldByName("subject").setValue(Sp.data.DefaultEmailSubject);
c.getFieldByName("message").setValue(Sp.data.DefaultEmailMessage);}});var e=new Ext.Button({text:"Cancel",scope:this,handler:function(){c.getForm().reset();
b._emailWin.hide();}});var c=new WebLight.form.FormPanel({border:false,farme:true,labelWidth:120,frame:true,cls:"ux-form-1",defaults:{allowBlank:false,msgTarget:"under"},labelAlign:"right",items:[{xtype:"textfield",width:350,fieldLabel:"From",name:"fromEmail",vtype:"email",maxLength:64},{xtype:"displayfield",width:350,fieldLabel:"To",name:"email"},{layout:"column",items:[{layout:"form",items:[{xtype:"displayfield",fieldLabel:"First Name",name:"firstName",maxLength:64}]},{layout:"form",items:[{xtype:"displayfield",fieldLabel:"Last Name",name:"lastName",maxLength:64}]}]},{xtype:"textfield",width:350,fieldLabel:"Subject",name:"subject",maxLength:256},{xtype:"textarea",width:450,fieldLabel:"Message",name:"message",height:400,maxLength:8000}],buttons:[a,d,e]});
c.bindStore(this._contactStore);this._emailWin=new Ext.Window({title:"Send Email",width:610,items:[c],modal:true,border:false,closeAction:"hide",closable:false});
},createChildControls:function(){this._contactStore=new SP.object.EmailLogStore();this.createContactGrid();
this.createEmailWin();this.addChildControl(Ext.create({xtype:"box",html:'<h2 id="sp-box-h1">Network E-mail Notification</h2>'}),"container");
this.addChildControl(this._contactGrid,"container");SP.page.NetworkEmailNotificationPage.superclass.createChildControls.call(this);
},dataBind:function(){this._contactStore.load();SP.page.NetworkEmailNotificationPage.superclass.createChildControls.call(this);
}});WebLight.PageMgr.registerType("networkemailnotification",SP.page.NetworkEmailNotificationPage);WebLight.namespace("SP","SP.page");
SP.page.OrganizationsTwoPage=WebLight.extend(WebLight.Page,{title:"OrganizationsTwo",html:_builtInTemplate_b84c3e97[4],createChildControls:function(){this.addChildControl(Ext.create({xtype:"box",html:"<h2>OrganizationsTwo</h2>"}),"container");
SP.page.OrganizationsTwoPage.superclass.createChildControls.call(this);}});WebLight.PageMgr.registerType("organizationstwo",SP.page.OrganizationsTwoPage);
WebLight.namespace("SP","SP.page");SP.page.OtherUsersPage=WebLight.extend(WebLight.Page,{title:"Super Users",html:_builtInTemplate_b84c3e97[4],_otherUserGrid:null,_otherUserStore:null,_otherUserWin:null,_newOtherUserButton:null,createOtherUserGrid:function(){var a=this;
this._newOtherUserButton=Ext.create({text:"Add New Super User",iconCls:"icon-16x16-add",xtype:"button",handler:function(){var b=a._otherUserStore.newRecord({firstName:"",middleName:"",lastName:"",accessTypeId:"",accessType:"",email:"",password:"",passwordConfirm:""});
a._otherUserStore.add(b);a._otherUserGrid.getSelectionModel().selectLastRow(false);a._otherUserWin.setTitle("Add Super User");
a._otherUserWin.show();}});this._otherUserGrid=new WebLight.grid.GridPanel({striptRows:true,pageSize:20,height:550,style:"margin-top:20px",tbar:[a._newOtherUserButton],selModel:new Ext.grid.RowSelectionModel({singleSelect:true}),cm:new Ext.grid.ColumnModel({defaults:{sortable:true},columns:[{dataIndex:"email",header:"User Email",width:200},{dataIndex:"firstName",header:"FirstName",width:200},{dataIndex:"lastName",header:"LastName",width:200},{header:"Action",align:"center",xtype:"templatecolumn",sortable:false,tpl:new Ext.XTemplate('<a href="javascript:void(0);" xcmd="edit">Edit</a> &nbsp;                         <a href="javascript:void(0);" xcmd="delete">Delete</a>')}]})});
this._otherUserGrid.on("xcellclick",function(f,c,d,e,b){switch(c){case"edit":a._otherUserWin.setTitle("Edit Super User");
a._otherUserWin.show();break;case"delete":Ext.Msg.confirm("Confirm","Are you sure want to delete this record？",function(g){if(g=="yes"){f.store.remove(d);
f.store.submitChanges(function(){f.store.reload();},function(){alert("Failed");});}});break;}},this);
this._otherUserGrid.bindStore(this._otherUserStore);},createOtherUserWin:function(c){var b=this;var e=new Ext.Button({text:"Save",scope:this,handler:function(){if(a.getFieldByName("password").getValue()!=a.getFieldByName("passwordConfirm").getValue()){alert("Your new password entries did not match.");
return;}if(a.getForm().isValid()){b._otherUserWin.hide();b._otherUserStore.submitChanges(function(g){b._otherUserStore.reload();
},function(h,g){b._otherUserWin.show();alert(g);});}}});var f=new Ext.Button({text:"Cancel",scope:this,handler:function(){a.reset();
b._otherUserWin.hide();}});var d=[{layout:"column",id:"passwordColumn",items:[{columnWidth:0.45,layout:"form",items:[{xtype:"textfield",fieldLabel:"Password",name:"password",width:140,inputType:"password",allowBlank:false}]},{columnWidth:0.55,layout:"form",labelWidth:150,items:[{xtype:"textfield",fieldLabel:"Password Confirm",name:"passwordConfirm",width:140,inputType:"password",allowBlank:false}]}]}];
var a=new WebLight.form.FormPanel({border:false,labelWidth:100,frame:true,cls:"ux-form-1",defaults:{allowBlank:false,msgTarget:"under"},labelAlign:"right",items:[{xtype:"textfield",width:445,fieldLabel:"Email",name:"email",vtype:"email",maxLength:64},d,{layout:"column",items:[{columnWidth:0.4,layout:"form",items:[{allowBlank:false,xtype:"textfield",fieldLabel:"First Name",name:"firstName",width:100,maxLength:64}]},{columnWidth:0.2,layout:"form",labelWidth:40,items:[{xtype:"textfield",fieldLabel:"M.I",name:"middleName",width:60,maxLength:1}]},{columnWidth:0.4,layout:"form",labelWidth:90,items:[{allowBlank:false,xtype:"textfield",fieldLabel:"Last Name",name:"lastName",width:110,maxLength:64}]}]}],buttons:[e,f]});
a.bindStore(this._otherUserStore);this._otherUserWin=new Ext.Window({title:"Super User",width:600,items:[a],modal:true,border:false,closeAction:"hide",closable:false});
},createChildControls:function(){this._otherUserStore=new SP.object.OtherUserStore();this.createOtherUserGrid();
this.createOtherUserWin();this.addChildControl(Ext.create({xtype:"box",html:'<h2 id="sp-box-h1">Supplypoint/Prism/Management Games Users</h2>'}),"container");
this.addChildControl(this._otherUserGrid,"container");SP.page.OtherUsersPage.superclass.createChildControls.call(this);
},dataBind:function(){this._otherUserStore.load();SP.page.OtherUsersPage.superclass.dataBind.call(this);
}});WebLight.PageMgr.registerType("otherusers",SP.page.OtherUsersPage);WebLight.namespace("SP","SP.page");
SP.page.OrganizationsPage=WebLight.extend(WebLight.Page,{title:"Organizations",html:_builtInTemplate_b84c3e97[5],_mepAssignStore:null,_mepUserAssignStore:null,_mepAssignWin:null,_organizationStore:null,_organizationGrid:null,_buttonQueryBar:null,_mepUserAssigedDropdown:null,_mepStore:null,_mepUserStore:null,_queryForm:null,createOrganizationsGrid:function(){var a=this;
var b=function(f){if(!f){return"[Not Assigned]";}return f;};var d=new Ext.grid.CheckboxSelectionModel();
var c=new SP.form.DropdownList({valueField:"id",displayField:"id",fieldLabel:"id",width:80,forceSelection:true,store:Sp.data.BuiltInStores.pagesizeStore,allowBlank:false,editable:true,value:20});
var e=new Ext.PagingToolbar({store:a._organizationStore,displayInfo:true,items:[">","-","Per Page: ",c]});
c.on("select",function(h,g){a._organizationGrid.pageSize=parseInt(g.get("id"),10);a._organizationStore.setBaseParam("limit",a._organizationGrid.pageSize);
var f=a._organizationGrid.pagingBar;f.pageSize=parseInt(g.get("id"),10);f.doLoad(f.cursor);},this);this._organizationGrid=new WebLight.grid.GridPanel({striptRows:true,pageSize:20,height:550,style:"margin-top:5px;",tbar:[{text:"Add New Company",iconCls:"icon-16x16-add",handler:function(){WebLight.Router.route("create");
}},{text:"Assign to MEP",iconCls:"icon-16x16-add",hidden:!SP.context.isSuperUser,handler:function(){if(a._organizationGrid.getSelectionModel().getSelections().length==0){alert("Please select company");
return;}a._mepAssignWin.show();}},{text:"Delete Selected Companies",iconCls:"icon-16x16-delete",handler:function(){if(a._organizationGrid.getSelectionModel().getSelections().length==0){alert("Please select the items");
return;}else{var g=a._organizationGrid.getSelectionModel().getSelections();var f=0;var h=[];Ext.each(g,function(j){if(j.get("mepUserId")!=SP.context.userId){f++;
}h.push(j.get("organizationId"));});if(f>0&&!SP.context.isSuperUser){alert("Among the companies that you want to delete, there are "+f+" companies can't be deleted, because you are not the MEP User, please fixt it first.");
}else{Ext.Msg.confirm("Confirm","Are you sure want to delete selected companies？",function(j){if(j=="yes"){SP.object.Organization.deleteOrganizations(h,function(k,l){if(k="true"){a._organizationStore.reload();
}else{alert("Failed");}});}});}}}}],cm:new Ext.grid.ColumnModel({defaults:{sortable:true},columns:[d,{dataIndex:"companyId",header:"Company ID",width:70},{dataIndex:"organizationName",header:"Company Name",width:160},{dataIndex:"phone",header:"Phone",width:100},{dataIndex:"mepName",header:"MEP Name",width:115},{dataIndex:"userName",header:"PM Name",width:120,renderer:b},{dataIndex:"state",header:"State",width:40},{header:"Action",align:"center",sortable:false,width:200,renderer:function(h,f,k,l,j,g){if((SP.context.isMepAdministrator||SP.context.isMepUser)&&k.get("mepUserId")!=SP.context.userId){return'<a href="javascript:void(0);" xcmd="profile">Profile</a> &nbsp;                                                    <a href="javascript:void(0);" xcmd="cnccapability">CNC Capability</a> &nbsp;                                                     <a href="javascript:void(0);" xcmd="view">View</a> ';
}else{return'<a href="javascript:void(0);" xcmd="profile">Profile</a> &nbsp;                                                    <a href="javascript:void(0);" xcmd="cnccapability">CNC Capability</a> &nbsp;                                                    <a href="javascript:void(0);" xcmd="view">View</a> &nbsp;                                                    <a href="javascript:void(0);" xcmd="delete">Delete</a>';
}}}]}),sm:d,bbar:["-","Per Page: ",c]});this._organizationGrid.on("xcellclick",function(l,h,j,k,f){switch(h){case"profile":WebLight.Router.route(String.format("profile/{0}",j.get("organizationId")));
break;case"cnccapability":WebLight.Router.route(String.format("cnccapability/{0}",j.get("organizationId")));
break;case"view":WebLight.Router.route(String.format("{0}",j.get("organizationId")));break;case"delete":Ext.Msg.confirm("Confirm","Are you sure want to delete this record？",function(g){if(g=="yes"){l.store.remove(j);
l.store.submitChanges(function(){l.store.reload();},function(){alert("Failed");});}});break;}},this);
this._organizationGrid.bindStore(this._organizationStore);},createMepWin:function(){var a=this;var c=new Ext.Button({text:"Save",scope:this,handler:function(){if(e.getForm().isValid()){a._mepAssignWin.hide();
var f=a._organizationGrid.getSelectionModel().getSelections();for(i=0;i<f.length;i++){f[i].set("mepUserId",a._mepUserAssigedDropdown.getValue());
}a._organizationStore.submitChanges(function(g){a._organizationStore.reload();e.reset();},function(h,g){a._mepAssignWin.show();
alert(g);});}}});var d=new Ext.Button({text:"Cancel",scope:this,handler:function(){e.reset();a._mepAssignWin.hide();
}});var b=new SP.form.DropdownList({valueField:"mepId",displayField:"title",fieldLabel:"MEP",name:"mepId",width:150,forceSelection:true,store:a._mepAssignStore,allowBlank:false,editable:true,listeners:{change:function(f,g,h){if(g==""){mepUserDropdown.clearValue();
a._mepUserStore.removeAll();}}}});this._mepUserAssigedDropdown=new SP.form.DropdownList({valueField:"mepUserId",displayField:"fullName",fieldLabel:"MEP User",name:"mepUserId",width:150,forceSelection:true,store:a._mepUserAssignStore,allowBlank:false,editable:true});
this._mepUserAssigedDropdown.linkTo(b);var e=new WebLight.form.FormPanel({border:false,farme:true,labelWidth:70,frame:true,cls:"ux-form-1",labelAlign:"right",defaults:{allowBlank:false,msgTarget:"under"},items:[{layout:"column",items:[{layout:"form",columnWidth:0.5,items:[b]},{layout:"form",columnWidth:0.5,items:[a._mepUserAssigedDropdown]}]}],buttons:[c,d]});
this._mepAssignWin=new Ext.Window({title:"Assign Organizations to Mep User",width:500,items:[e],modal:true,border:false,closeAction:"hide",closable:false});
},createQueryForm:function(){var f=this;var e=new Ext.Button({text:"Search",scope:this,handler:function(){var m=f._queryForm.getForm().getFieldValues();
var l=[];f._organizationStore.queryable.property("startDate",null);f._organizationStore.queryable.property("endDate",null);
for(var k in m){if(m[k]){if(k=="companyId"){l.push(String.format("{0}=={1}",k,m[k]));}else{if(k=="startDate"||k=="endDate"){f._organizationStore.queryable.property(k,Ext.util.Format.date(m[k],"Y-m-d"));
}else{if(k=="organizationName"){l.push(String.format("{0}^={1}",k,$.trim(m[k])));}else{l.push(String.format("{0}=={1}",k,$.trim(m[k])));
}}}}}if(l.length){f._organizationStore.queryable.where(l.join(" && ")).load();f._buttonQueryBar.selectAll();
}else{f._organizationStore.queryable.where().load();f._buttonQueryBar.selectAll();}}});var a=new Ext.Button({text:"Clear Search",scope:this,handler:function(){f._queryForm.reset();
f._organizationStore.queryable.where().property(null).load();f._buttonQueryBar.selectAll();}});var d=new Ext.Button({text:"Export to Excel",scope:this,handler:function(){f._organizationGrid.exportToExcel();
}});var b=new SP.form.DropdownList({valueField:"state",displayField:"state",fieldLabel:"State",name:"state",allowBlank:true,editable:true,width:50,store:Sp.data.BuiltInStores.stateStore});
this._mepStore=new SP.object.MepStore();var g=new SP.form.DropdownList({valueField:"mepId",displayField:"title",fieldLabel:"MEP Center",name:"mepId",width:170,hidden:!SP.context.isSuperUser,hideLabel:!SP.context.isSuperUser,allowBlank:true,store:this._mepStore,editable:true,listeners:{change:function(k,l,m){if(l==""){h.clearValue();
f._mepUserStore.removeAll();}}}});var j=new SP.object.MepUserStore();f._mepUserStore=j;var h=new SP.form.DropdownList({autoSelect:true,valueField:"mepUserId",displayField:"fullName",fieldLabel:"MEP User",name:"mepUserId",allowBlank:true,hidden:!SP.context.isSuperUser,hideLabel:!SP.context.isSuperUser,editable:true,width:100,store:j});
h.linkTo(g);var c=new SP.form.DropdownList({store:Sp.data.BuiltInStores.stateStore,editable:true,allowBlank:true,displayField:"state",valueField:"state",name:"state",fieldLabel:"State"});
f._queryForm=new WebLight.form.FormPanel({border:false,frame:false,labelWidth:80,labelAlign:"right",bodyStyle:"margin-top:20px",width:850,items:[{layout:"column",border:false,items:[{layout:"form",labelWidth:90,border:false,items:[{xtype:"numberfield",width:100,fieldLabel:"Company ID",name:"companyId"}]},{layout:"form",labelWidth:100,border:false,items:[{xtype:"textfield",width:100,fieldLabel:"Company Name",name:"organizationName"}]},{border:false,layout:"form",labelWidth:75,items:[g]},{border:false,layout:"form",labelWidth:60,items:[h]},{layout:"form",labelWidth:50,border:false,items:[b]},{border:false,layout:"form",labelWidth:75,items:[{xtype:"datefield",editable:false,name:"startDate",fieldLabel:"Start Date"}]},{border:false,layout:"form",labelWidth:60,items:[{xtype:"datefield",editable:false,name:"endDate",fieldLabel:"End Date"}]}]}],buttons:[d,e,a]});
},createQueryBar:function(){var a=this;this._buttonQueryBar=new SP.controls.ButtonBar({width:530,border:true,listeners:{ButtonQuery:function(d){var e=a._queryForm.getForm().getFieldValues();
var c=[];if(d!="ALL"){c.push(String.format("{0}^={1}","organizationName",d));}a._organizationStore.queryable.property("startDate",null);
a._organizationStore.queryable.property("endDate",null);for(var b in e){if(e[b]){if(b=="companyId"){c.push(String.format("{0}=={1}",b,e[b]));
}else{if(b=="startDate"||b=="endDate"){a._organizationStore.queryable.property(b,Ext.util.Format.date(e[b],"Y-m-d"));
}else{if(b=="organizationName"){c.push(String.format("{0}^={1}",b,$.trim(e[b])));}else{c.push(String.format("{0}=={1}",b,$.trim(e[b])));
}}}}}if(c.length){a._organizationStore.queryable.where(c.join(" && ")).load();}else{a._organizationStore.queryable.where("title^=@0",d).load();
}}}});},createChildControls:function(){var a=this;this._mepAssignStore=new SP.object.MepStore();this._mepUserAssignStore=new SP.object.MepUserAssignedStore();
this._organizationStore=new SP.object.OrganizationStore();this.createQueryBar();this.createMepWin();this.createOrganizationsGrid();
this.createQueryForm();this.addChildControl(Ext.create({xtype:"box",html:'<h2 id="sp-box-h1">Organizations</h2>'}),"container");
this.addChildControl(this._queryForm,"container");this.addChildControl(this._buttonQueryBar,"container");
this.addChildControl(this._organizationGrid,"container");SP.page.OrganizationsPage.superclass.createChildControls.call(this);
},dataBind:function(){var a=this;this._organizationStore.queryable.orderBy("organizationId");this._organizationStore.load();
this._mepAssignStore.load();this._mepStore.load();this._buttonQueryBar.selectAll();this._mepUserAssignStore.on("load",function(b){a._mepUserAssigedDropdown.setValue(b.getAt(0).get("mepUserId"));
});SP.page.OrganizationsPage.superclass.createChildControls.call(this);}});WebLight.PageMgr.registerType("organizations",SP.page.OrganizationsPage);
WebLight.namespace("SP","SP.page");SP.page.OrganizationViewPage=WebLight.extend(WebLight.Page,{title:"Company Summary",html:_builtInTemplate_b84c3e97[5],organizationId:"",isBackOffice:true,_organizationEditForm:null,_organizationViewForm:null,_organizationFormStore:null,_facilityWin:null,_facilityStore:null,_facilityGrid:null,_newFacilityButton:null,_contactWin:null,_contactStore:null,_contactGrid:null,_newCotnactButton:null,_IsoCodeConfig:null,_AeroCodeConfig:null,_OtherCodeCofing:null,_naicGrid:null,_newNaicDropdown:null,_newNaicAssignButton:null,_naicAssignStore:null,_mepStore:null,_mepUserStore:null,_editButton:null,createOrganizationEditForm:function(){var b=this;
var c=new Ext.Button({text:"Save",scope:this,handler:function(){if(b._organizationEditForm.getForm().isValid()){if(b._organizationEditForm.getFieldByName("incorporater").getValue()!=null){if(b._organizationEditForm.getFieldByName("incorporater").getValue().inputValue=="1"){b._organizationFormStore.getAt(0).set("incorporateCnc",true);
}else{if(b._organizationEditForm.getFieldByName("incorporater").getValue().inputValue=="0"){b._organizationFormStore.getAt(0).set("incorporateCnc",false);
}}}else{b._organizationFormStore.getAt(0).set("incorporateCnc",null);}b._organizationFormStore.submitChanges(function(f){b._organizationEditForm.hide();
b._organizationViewForm.show();if(!b.organizationId){b.organizationId=f.data[0].organizationId;WebLight.Router.route(String.format("{0}",b.organizationId));
b._organizationFormStore.queryable.where("organizationId=@0",f.data[0].organizationId).load();b._facilityStore.queryable.where("organizationId=@0",b.organizationId).load();
b._contactStore.queryable.where("organizationId=@0",b.organizationId).load();}else{b._organizationFormStore.reload();
}b._newFacilityButton.enable();b._newCotnactButton.enable();b._newNaicDropdown.enable();b._newNaicAssignButton.enable();
},function(g,f){alert(f);});}}});var d=new Ext.Button({text:"Cancel",scope:this,handler:function(){b._organizationEditForm.hide();
b._organizationViewForm.show();b._organizationEditForm.reset();if(b.organizationId){if(b._organizationFormStore.getAt(0).get("incorporateCnc")==true){b._organizationEditForm.getFieldByName("incorporater").onSetValue("yes",true);
}else{if(b._organizationFormStore.getAt(0).get("incorporateCnc"==false)){b._organizationEditForm.getFieldByName("incorporater").onSetValue("no",true);
}else{if(b._organizationFormStore.getAt(0).get("incorporateCnc"==null)){b._organizationEditForm.getFieldByName("incorporater").reset();
}}}}}});var e=new SP.form.DropdownList({valueField:"mepId",displayField:"title",fieldLabel:"MEP",name:"mepId",width:200,forceSelection:true,store:b._mepStore,allowBlank:true,hidden:!b.isBackOffice||!SP.context.isSuperUser,hideLabel:!b.isBackOffice||!SP.context.isSuperUser,editable:true,listeners:{change:function(f,g,h){if(g==""){a.clearValue();
b._mepUserStore.removeAll();}}}});var a=new SP.form.DropdownList({valueField:"mepUserId",displayField:"fullName",fieldLabel:"MEP User",name:"mepUserId",hidden:!b.isBackOffice||!SP.context.isSuperUser,width:200,forceSelection:true,store:b._mepUserStore,hideLabel:!b.isBackOffice||!SP.context.isSuperUser,allowBlank:true,editable:true});
a.linkTo(e);this._IsoCodeConfig=Ext.create({xtype:"textfield",name:"isoCode",width:200,fieldLabel:"Certification",maxLength:256});
this._AeroCodeConfig=Ext.create({xtype:"textfield",name:"aeroCode",width:200,fieldLabel:"Certification",maxLength:256});
this._OtherCodeCofing=Ext.create({xtype:"textfield",fieldLabel:"Other",name:"otherCertification",width:200,fieldLabel:"Certification",maxLength:256});
this._organizationEditForm=new WebLight.form.FormPanel({border:false,labelWidth:150,frame:true,hidden:true,style:"margin-top:20px",cls:"ux-form-1",defaults:{allowBlank:false,msgTarget:"under"},labelAlign:"right",items:[{layout:"form",xtype:"box",width:630,html:'<h2 class="ux-box-1">Company Basic Information</h2>'},{allowBlank:false,xtype:"displayfield",fieldLabel:"Company ID",name:"companyId",width:200},{layout:"column",items:[{columnWidth:0.5,layout:"form",items:[{allowBlank:false,xtype:"textfield",fieldLabel:"Company Name",name:"organizationName",width:200,maxLength:256},{allowBlank:true,xtype:"textfield",fieldLabel:"Company Phone",name:"phone",width:200,maxLength:20},e]},{columnWidth:0.5,layout:"form",items:[{allowBlank:true,xtype:"numberfield",fieldLabel:"Year Established",name:"yearStablished",width:200,maxValue:600000},{allowBlank:true,xtype:"textfield",fieldLabel:"Company Web Site",name:"webSite",width:200,maxLength:256},a]}]},{xtype:"textarea",width:630,height:80,fieldLabel:"More Info",name:"moreInfo",allowBlank:true,maxLength:2500},{layout:"column",items:[{layout:"form",columnWidth:0.5,items:[{allowBlank:true,xtype:"textfield",fieldLabel:"Validated By",name:"validatedBy",width:200,maxLength:128}]},{layout:"form",columnWidth:0.5,items:[{allowBlank:true,xtype:"datefield",fieldLabel:" Validation Date",name:"validatedDate",width:200}]}]},{layout:"form",xtype:"box",width:630,html:'<h2 class="ux-box-1">Experience/Classification</h2>'},{layout:"column",items:[{layout:"form",labelWidth:250,items:[{xtype:"box",html:'<span class="x-form-item-label">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Do you incorporate CNC machining as part of your manufacturing process?</span>'}]},{layout:"form",labelWidth:0,columnWidth:0.2,items:[new Ext.form.RadioGroup({name:"incorporater",anchor:"90%",hideLabel:true,style:"margin:0 0 0 20px",items:[new Ext.form.Radio({id:"yes",name:"incorporate",inputValue:"1",width:70,boxLabel:"Yes"}),new Ext.form.Radio({inputValue:"0",id:"no",name:"incorporate",width:70,boxLabel:"No"})]})]}]},{layout:"form",labelWidth:550,items:[{labelStyle:"margin:0 10px 0 0",xtype:"checkbox",name:"outsourceWork",fieldLabel:"If you need to outsource CNC machining work from time to time, please click here"}]},{layout:"form",items:[{allowBlank:true,xtype:"textfield",fieldLabel:"Cage Code",name:"cageCode",width:200,maxLength:32}]},{xtype:"textarea",width:630,height:80,fieldLabel:"Business core competency",name:"businessDescription",allowBlank:true,maxLength:2500},{layout:"column",items:[{columnWidth:0.33,layout:"form",items:[{xtype:"checkbox",name:"smallBusiness",fieldLabel:"Small Business"},{xtype:"checkbox",name:"samllDisadvantage",fieldLabel:"Small Disadvantaged"},{xtype:"checkbox",name:"sBA8a",fieldLabel:"SBA (8)a"}]},{columnWidth:0.33,layout:"form",items:[{xtype:"checkbox",name:"disabledVeteran",fieldLabel:"Disabled Veteran"},{xtype:"checkbox",name:"veteranOwned",fieldLabel:"Veteran-Owned"},{xtype:"checkbox",name:"indianOwned",fieldLabel:"Indian Owned"}]},{columnWidth:0.33,layout:"form",items:[{xtype:"checkbox",name:"womanOwned",fieldLabel:"Woman-Owned"},{xtype:"checkbox",name:"hubZone",fieldLabel:"HUBZone"}]}]},{layout:"form",xtype:"box",width:630,html:'<h2 class="ux-box-1">Certification(s)</h2>'},{layout:"form",items:[{layout:"column",items:[{layout:"form",columnWidth:0.3,labelWidth:170,items:[{xtype:"checkbox",width:50,fieldLabel:"ISO",name:"hasIsoCode",handler:function(f,g){if(g){b._IsoCodeConfig.showItem();
b._IsoCodeConfig.allowBlank=false;}else{b._IsoCodeConfig.hideItem();b._IsoCodeConfig.allowBlank=true;
b._IsoCodeConfig.setValue("");}}}]},{layout:"form",labelWidth:80,columnWidth:0.5,items:[b._IsoCodeConfig]}]}]},{layout:"form",items:[{layout:"column",items:[{layout:"form",columnWidth:0.3,labelWidth:170,items:[{xtype:"checkbox",width:50,fieldLabel:"Aerospace",name:"hasAeroCode",handler:function(f,g){if(g){b._AeroCodeConfig.showItem();
b._AeroCodeConfig.allowBlank=false;}else{b._AeroCodeConfig.hideItem();b._AeroCodeConfig.allowBlank=true;
b._AeroCodeConfig.setValue("");}}}]},{layout:"form",labelWidth:80,columnWidth:0.5,items:[b._AeroCodeConfig]}]}]},{layout:"form",items:[{layout:"column",items:[{layout:"form",columnWidth:0.3,labelWidth:170,items:[{xtype:"checkbox",width:50,fieldLabel:"Other",name:"hasOtherCode",handler:function(f,g){if(g){b._OtherCodeCofing.showItem();
b._OtherCodeCofing.allowBlank=false;}else{b._OtherCodeCofing.hideItem();b._OtherCodeCofing.setValue("");
b._OtherCodeCofing.allowBlank=true;}}}]},{layout:"form",columnWidth:0.5,labelWidth:80,items:[b._OtherCodeCofing]}]}]}],buttons:[c,d]});
this._organizationEditForm.on("beforeshow",function(){if(!b.organizationId){b._AeroCodeConfig.hideItem();
b._AeroCodeConfig.allowBlank=true;b._IsoCodeConfig.hideItem();b._IsoCodeConfig.allowBlank=true;b._OtherCodeCofing.hideItem();
b._OtherCodeCofing.allowBlank=true;}});},createOrganizationViewForm:function(){var a=this;if(!this.isBackOffice){this.organizationId=SP.context.organizationId;
}a._editButton=new Ext.Button({text:"Edit",scope:this,hidden:true,handler:function(){a._organizationViewForm.hide();
a._organizationEditForm.show();}});this._organizationViewForm=new WebLight.form.FormPanel({border:false,labelWidth:150,frame:true,style:"margin-top:20px",cls:"ux-form-1",defaults:{msgTarget:"under"},labelAlign:"right",items:[{layout:"form",xtype:"box",width:630,html:'<h2 class="ux-box-1">Company Basic Information</h2>'},{xtype:"displayfield",fieldLabel:"Company ID",name:"companyId",width:200},{layout:"column",items:[{columnWidth:0.5,layout:"form",items:[{xtype:"displayfield",fieldLabel:"Company Name",name:"organizationName",width:200},{xtype:"displayfield",fieldLabel:"Company Phone",name:"phone",width:200},{xtype:"displayfield",fieldLabel:"MEP",name:"mepName",width:200,hidden:!a.isBackOffice,hideLabel:!a.isBackOffice}]},{columnWidth:0.5,layout:"form",items:[{xtype:"displayfield",fieldLabel:"Year Established",name:"yearStablished",width:200},{xtype:"displayfield",fieldLabel:"Company Web Site",name:"webSite",width:200},{xtype:"displayfield",fieldLabel:"MEP User",name:"userName",width:200,hidden:!a.isBackOffice,hideLabel:!a.isBackOffice}]}]},{xtype:"displayfield",width:630,height:80,cls:"ux-displayfield",fieldLabel:"More Info",name:"moreInfo"},{layout:"column",items:[{layout:"form",columnWidth:0.5,items:[{xtype:"displayfield",fieldLabel:"Validated By",name:"validatedBy",width:200}]},{layout:"form",columnWidth:0.5,items:[{xtype:"displayfield",fieldLabel:"Validation Date",name:"validatedDate",width:200,dateFormat:"m/d/Y"}]}]},{layout:"form",xtype:"box",width:630,html:'<h2 class="ux-box-1">The classifications</h2>'},{layout:"column",items:[{layout:"column",columnWidth:0.5,items:[{layout:"form",labelWidth:100,items:[{xtype:"box",html:'<span class="x-form-item-label">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Incorporate CNC machining:</span>'}]},{layout:"form",labelWidth:0,columnWidth:0.3,items:[new Ext.form.RadioGroup({name:"incorporaterView",style:"margin:0 0 0 20px",anchor:"90%",hideLabel:true,items:[new Ext.form.Radio({id:"yes6",name:"incorporateView",inputValue:"1",disabled:true,boxLabel:"Yes"}),new Ext.form.Radio({inputValue:"0",id:"no6",disabled:true,name:"incorporateView",boxLabel:"No"})]})]}]},{layout:"form",labelWidth:150,columnWidth:0.5,items:[{xtype:"checkbox",name:"outsourceWork",fieldLabel:"Out Source Work",disabled:true}]}]},{xtype:"displayfield",fieldLabel:"Cage Code",name:"cageCode",width:200},{xtype:"displayfield",width:630,height:80,cls:"ux-displayfield",fieldLabel:"Business core competency",name:"businessDescription"},{layout:"column",items:[{columnWidth:0.33,layout:"form",items:[{xtype:"checkbox",name:"smallBusiness",fieldLabel:"Small Business",disabled:true},{xtype:"checkbox",name:"samllDisadvantage",fieldLabel:"Small Disadvantaged",disabled:true},{xtype:"checkbox",name:"sBA8a",fieldLabel:"SBA (8)a",disabled:true}]},{columnWidth:0.33,layout:"form",items:[{xtype:"checkbox",name:"disabledVeteran",fieldLabel:"Disabled Veteran",disabled:true},{xtype:"checkbox",name:"veteranOwned",fieldLabel:"Veteran-Owned",disabled:true},{xtype:"checkbox",name:"indianOwned",fieldLabel:"Indian Owned",disabled:true}]},{columnWidth:0.33,layout:"form",items:[{xtype:"checkbox",name:"womanOwned",fieldLabel:"Woman-Owned",disabled:true},{xtype:"checkbox",name:"hubZone",fieldLabel:"HUBZone",disabled:true}]}]},{layout:"form",xtype:"box",width:630,html:'<h2 class="ux-box-1">Certification(s)</h2>'},{layout:"form",labelWidth:170,items:[{xtype:"displayfield",fieldLabel:"ISO",name:"isoCode",width:200},{xtype:"displayfield",fieldLabel:"Aerospace",name:"aeroCode",width:200},{xtype:"displayfield",fieldLabel:"Other",name:"otherCertification",width:200}]}],buttons:[a._editButton]});
},createFacilityGrid:function(){var a=this;this._newFacilityButton=Ext.create({text:"Add New Facility",iconCls:"icon-16x16-add",xtype:"button",hidden:true,handler:function(){var b=a._facilityStore.newRecord({address1:"",address2:"",address3:"",city:"",zipCode:"",state:"",manufacturer:null,county:"",manufacturer:"",productDescription:"",productionPersonnel:"",manual:false,other:false,cmm:false,engineeringPersonnel:"",numberOfShift:"",productionArea:"",prototypingLowVolume:null,prototypingHighVolume:null,cmmInspectionName:""});
b.set("organizationId",a._organizationFormStore.getAt(0).get("organizationId"));a._facilityStore.add(b);
a._facilityGrid.getSelectionModel().selectLastRow(false);a._facilityWin.setTitle("Add New Facility");
a._facilityWin.show();}});this._facilityGrid=new WebLight.grid.GridPanel({striptRows:true,pageSize:20,style:"margin-top:20px",autoHeight:true,tbar:[a._newFacilityButton],selModel:new Ext.grid.RowSelectionModel({singleSelect:true}),cm:new Ext.grid.ColumnModel({defaults:{sortable:true},columns:[{dataIndex:"address1",header:"Address1",width:150},{dataIndex:"address2",header:"Address2",width:150},{dataIndex:"address3",header:"Address3",width:150},{dataIndex:"city",header:"City",width:80},{dataIndex:"state",header:"ST",width:60},{dataIndex:"zipCode",header:"ZipCode",width:80},{dataIndex:"county",header:"County",width:60},{header:"Action",align:"center",xtype:"templatecolumn",sortable:false,hidden:true,tpl:new Ext.XTemplate('<a href="javascript:void(0);" xcmd="edit">View</a> &nbsp;                             <a href="javascript:void(0);" xcmd="delete">Delete</a>')},{header:"Action",align:"center",xtype:"templatecolumn",sortable:false,hidden:true,tpl:new Ext.XTemplate('<a href="javascript:void(0);" xcmd="edit">View</a>')}]})});
this._facilityGrid.on("xcellclick",function(f,c,d,e,b){switch(c){case"edit":if(a.isBackOffice){WebLight.Router.route(String.format("facility/{0}/{1}",d.get("facilityId"),a._organizationFormStore.getAt(0).get("organizationId")));
}else{WebLight.Router.route(String.format("/summary/{0}",d.get("facilityId")));}break;case"delete":Ext.Msg.confirm("Confirm","Are you sure want to delete this record？",function(g){if(g=="yes"){f.store.remove(d);
f.store.submitChanges(function(){f.store.reload();},function(){alert("Failed");});}});break;}},this);
this._facilityGrid.bindStore(this._facilityStore);},createContactGrid:function(){var a=this;this._newCotnactButton=Ext.create({text:"Add New Contact",iconCls:"icon-16x16-add",xtype:"button",hidden:true,handler:function(){var b=a._contactStore.newRecord({middleName:"",firstName:"",phone:"",email:"",loginemail:"",password:"",passwordConfirm:"",isAllowLogin:null,lastName:"",position:""});
b.set("organizationId",a._organizationFormStore.getAt(0).get("organizationId"));a._contactStore.add(b);
a._contactGrid.getSelectionModel().selectLastRow(false);a._contactWin.setTitle("Add New Contact");a._contactWin.show();
}});this._contactGrid=new WebLight.grid.GridPanel({striptRows:true,pageSize:20,style:"margin-top:20px",autoHeight:true,tbar:[a._newCotnactButton],selModel:new Ext.grid.RowSelectionModel({singleSelect:true}),cm:new Ext.grid.ColumnModel({defaults:{sortable:true},columns:[{dataIndex:"firstName",header:"First Name",width:100},{dataIndex:"middleName",header:"Middle Name",width:100},{dataIndex:"lastName",header:"Last Name",width:100},{dataIndex:"position",header:"Position",width:100},{dataIndex:"phone",header:"Phone",width:130},{dataIndex:"email",header:"Email",width:130},{dataIndex:"isAllowLogin",header:"Allow Login",width:80},{header:"Action",align:"center",xtype:"templatecolumn",sortable:false,hidden:true,tpl:new Ext.XTemplate('<a href="javascript:void(0);" xcmd="edit">View</a> &nbsp;                             <a href="javascript:void(0);" xcmd="delete">Delete</a>')}]})});
this._contactGrid.on("xcellclick",function(f,c,d,e,b){switch(c){case"edit":a._contactWin.setTitle("Edit Contact");
a._contactWin.show();break;case"delete":Ext.Msg.confirm("Confirm","Are you sure want to delete this record？",function(g){if(g=="yes"){f.store.remove(d);
f.store.submitChanges(function(){f.store.reload();},function(){alert("Failed");});}});break;}},this);
this._contactGrid.bindStore(this._contactStore);},createFacilityForm:function(){var g=this;var f=new Ext.Button({text:"Save",scope:this,handler:function(){var j=a.getForm();
if(j.isValid()){g._facilityWin.hide();if(a.getFieldByName("manufacture").getValue().inputValue=="1"){g._facilityGrid.getSelectionModel().getSelected().set("manufacturer",true);
}else{g._facilityGrid.getSelectionModel().getSelected().set("manufacturer",false);}if(a.getFieldByName("prototypingLowVolumer").getValue().inputValue=="1"){g._facilityGrid.getSelectionModel().getSelected().set("prototypingLowVolume",true);
}else{g._facilityGrid.getSelectionModel().getSelected().set("prototypingLowVolume",false);}if(a.getFieldByName("prototypingHighVolumer").getValue().inputValue=="1"){g._facilityGrid.getSelectionModel().getSelected().set("prototypingHighVolume",true);
}else{g._facilityGrid.getSelectionModel().getSelected().set("prototypingHighVolume",false);}g._facilityStore.submitChanges(function(k){WebLight.Router.route(String.format("facility/{0}/{1}",k.data[0].facilityId,g._organizationFormStore.getAt(0).get("organizationId")));
},function(l,k){g._facilityWin.show();alert(k);});}}});var b=new Ext.Button({text:"Cancel",scope:this,handler:function(){a.reset();
g._facilityWin.hide();}});var d=new SP.form.DropdownList({valueField:"state",displayField:"state",fieldLabel:"State",name:"state",width:60,forceSelection:true,store:Sp.data.BuiltInStores.stateStore});
var c=new SP.form.DropdownList({valueField:"id",displayField:"id",fieldLabel:"Number of Shifts",name:"numberOfShift",width:100,forceSelection:true,allowBlank:true,store:Sp.data.BuiltInStores.numberofShiftsStore});
var h=new SP.form.DropdownList({valueField:"id",displayField:"id",fieldLabel:"Production Personnel",name:"productionPersonnel",width:100,allowBlank:true,forceSelection:true,store:Sp.data.BuiltInStores.productionPersonnelStore});
var e=new SP.form.DropdownList({valueField:"id",displayField:"name",fieldLabel:"Production Area",name:"productionArea",width:100,allowBlank:true,forceSelection:true,store:Sp.data.BuiltInStores.productionAreaStore});
var a=new WebLight.form.FormPanel({border:false,labelWidth:100,frame:true,defaults:{allowBlank:false,msgTarget:"under"},labelAlign:"right",cls:"ux-form-1",items:[{layout:"form",xtype:"box",width:630,html:'<h2 class="ux-box-1">Facility Basic Information:</h2>'},{xtype:"textfield",width:415,fieldLabel:"Address1",name:"address1",maxLength:64},{xtype:"textfield",width:415,fieldLabel:"Address2",name:"address2",allowBlank:true,maxLength:64},{xtype:"textfield",width:415,fieldLabel:"Address3",name:"address3",allowBlank:true,maxLength:64},{layout:"column",defaults:{layout:"form"},items:[{columnWidth:0.4,items:[{allowBlank:false,xtype:"textfield",fieldLabel:"City",name:"city",width:100,maxLength:64}]},{columnWidth:0.2,labelWidth:40,items:[d]},{columnWidth:0.4,labelWidth:70,items:[{allowBlank:false,xtype:"textfield",fieldLabel:"Zip Code",name:"zipCode",width:100,maxLength:10}]}]},{xtype:"textfield",fieldLabel:"County",name:"county",width:100,maxLength:32},{layout:"column",items:[{layout:"form",columnWidth:0.4,labelWidth:200,items:[{xtype:"box",html:'<span class="x-form-item-label">Do you manufacture at this facility?</span>'}]},{layout:"form",columnWidth:0.5,labelWidth:0,items:[new Ext.form.RadioGroup({name:"manufacture",anchor:"90%",items:[new Ext.form.Radio({name:"manufacturer",inputValue:"1",width:70,boxLabel:"Yes"}),new Ext.form.Radio({name:"manufacturer",inputValue:"0",checked:true,width:70,boxLabel:"No"})]})]}]},{layout:"form",xtype:"box",width:630,html:'<h2 class="ux-box-1"> Inspection System(s)</h2>'},{layout:"column",items:[{layout:"form",columnWidth:0.25,items:[{xtype:"checkbox",name:"manual",fieldLabel:"Manual"}]},{layout:"form",columnWidth:0.15,labelWidth:40,items:[{xtype:"checkbox",name:"cmm",fieldLabel:"CMM"}]},{layout:"form",columnWidth:0.15,labelWidth:40,items:[new Ext.form.Checkbox({name:"other",fieldLabel:"Other",handler:function(){if(g._facilityWin.hidden==true){return;
}if(this.getValue()){a.getFieldByName("cmmInspectionName").setValue("");a.getFieldByName("cmmInspectionName").showItem();
a.getFieldByName("cmmInspectionName").allowBlank=false;}else{a.getFieldByName("cmmInspectionName").hideItem();
a.getFieldByName("cmmInspectionName").allowBlank=true;}}})]},{layout:"form",labelWidth:90,items:[{xtype:"textfield",width:100,name:"cmmInspectionName",fieldLabel:"Insp. System ",maxLength:256}]}]},{layout:"form",xtype:"box",width:630,html:'<h2 class="ux-box-1">Production/Capacity :</h2>'},{layout:"column",items:[{layout:"form",columnWidth:0.5,items:[{layout:"form",labelWidth:150,items:[c]},{layout:"form",labelWidth:150,items:[h]}]},{layout:"form",columnWidth:0.5,items:[{layout:"form",labelWidth:150,items:[e]},{layout:"form",labelWidth:150,items:[{xtype:"numberfield",name:"engineeringPersonnel",width:100,fieldLabel:"Engineering Personnel",maxValue:65500}]}]}]},{xtype:"textarea",width:400,height:80,fieldLabel:"Description",name:"productDescription",allowBlank:true,maxLength:256},{layout:"column",items:[{layout:"form",columnWidth:0.4,labelWidth:200,items:[{xtype:"box",html:'<span class="x-form-item-label"> Low Volume:</span>'}]},{layout:"form",columnWidth:0.5,labelWidth:0,items:[new Ext.form.RadioGroup({name:"prototypingLowVolumer",anchor:"90%",items:[{name:"prototypingLowVolume",inputValue:"1",width:70,boxLabel:"Yes"},{name:"prototypingLowVolume",inputValue:"0",width:70,checked:true,boxLabel:"No"}]})]}]},{layout:"column",items:[{layout:"form",columnWidth:0.4,labelWidth:200,items:[{xtype:"box",html:'<span class="x-form-item-label"> High Volume:</span>'}]},{layout:"form",columnWidth:0.5,labelWidth:0,items:[new Ext.form.RadioGroup({name:"prototypingHighVolumer",anchor:"90%",items:[{name:"prototypingHighVolume",inputValue:"1",width:70,boxLabel:"Yes"},{name:"prototypingHighVolume",inputValue:"0",width:70,checked:true,boxLabel:"No"}]})]}]}],buttons:[f,b]});
a.bindStore(g._facilityStore);g._facilityWin=new Ext.Window({title:"Facility",width:600,items:[a],modal:true,border:false,closeAction:"hide",closable:false});
g._facilityWin.on("beforeshow",function(){a.getFieldByName("cmmInspectionName").hideItem();});},createContactForm:function(){var a=this;
var c=new Ext.Button({text:"Save",scope:this,handler:function(){var f=b.getForm();if(!e.collapsed){if(b.getFieldValue("password")!=b.getFieldValue("passwordConfirm")){alert("Your new password entries did not match.");
return;}}if(f.isValid()){a._contactWin.hide();b.getBoundRecord().set("isAllowLogin",!e.collapsed);a._contactStore.submitChanges(function(g){a._contactStore.reload();
},function(h,g){a._contactWin.show();alert(g);});}}});var d=new Ext.Button({text:"Cancel",scope:this,handler:function(){b.reset();
a._contactWin.hide();}});var e=Ext.create({xtype:"fieldset",checkboxToggle:true,checkboxName:"hasAddress",title:"Web Access",autoHeight:true,collapsed:true,labelWidth:150,items:[{xtype:"textfield",width:365,fieldLabel:"Login Email",name:"loginemail",vtype:"email",allowBlank:true,maxLength:64},{xtype:"textfield",width:365,fieldLabel:"Password",name:"password",inputType:"password",allowBlank:true},{xtype:"textfield",width:365,fieldLabel:"Password Confirm",name:"passwordConfirm",inputType:"password",allowBlank:true}]});
e.on("beforecollapse",function(){b.getFieldByName("loginemail").allowBlank=true;b.getFieldByName("password").allowBlank=true;
b.getFieldByName("passwordConfirm").allowBlank=true;b.getFieldByName("loginemail").vtype=null;});e.on("beforeexpand",function(){b.getFieldByName("loginemail").allowBlank=false;
b.getFieldByName("password").allowBlank=false;b.getFieldByName("passwordConfirm").allowBlank=false;b.getFieldByName("loginemail").vtype="email";
if(!b.getFieldValue("loginemail")){b.getFieldByName("loginemail").setValue(b.getFieldValue("email"));
}});var b=new WebLight.form.FormPanel({border:false,labelWidth:100,frame:true,cls:"ux-form-1",defaults:{allowBlank:false,msgTarget:"under"},labelAlign:"right",items:[{layout:"column",items:[{columnWidth:0.4,layout:"form",items:[{allowBlank:false,xtype:"textfield",fieldLabel:"First Name",name:"firstName",width:100,maxLength:64}]},{columnWidth:0.2,layout:"form",labelWidth:40,items:[{xtype:"textfield",fieldLabel:"M.I",name:"middleName",width:60,maxLength:1}]},{columnWidth:0.4,layout:"form",labelWidth:80,items:[{allowBlank:false,xtype:"textfield",fieldLabel:"Last Name",name:"lastName",width:100,maxLength:64}]}]},{xtype:"textfield",width:400,fieldLabel:"Position",name:"position",maxLength:256},{xtype:"textfield",width:400,fieldLabel:"Phone",name:"phone",maxLength:20},{xtype:"textfield",width:400,fieldLabel:"Email",name:"email",vtype:"email",maxLength:150},e],buttons:[c,d]});
b.bindStore(a._contactStore);a._contactWin=new Ext.Window({title:"Contact",width:600,items:[b],modal:true,border:false,closeAction:"hide",closable:false});
a._contactWin.on("beforeshow",function(){if(b.getBoundRecord().get("isAllowLogin")){e.expand(false);}else{e.collapse(false);
}});},createBackTitleForm:function(){return new Ext.form.FormPanel({border:false,farme:false,layout:"column",items:[{columnWidth:0.91,layout:"form",border:false,items:[{xtype:"box",html:'<h2 class="page-title">Company Information</h2>'}]},{columnWidth:0.09,layout:"form",border:false,items:[new Ext.Button({text:"Return",width:70,height:20,handler:function(){WebLight.Router.route("/Organizations/organizations");
}})]}]});},createNaicGrid:function(){var b=new SP.object.NaicCodeStore();var a=this;this._newNaicDropdown=new SP.form.DropdownList({valueField:"naicId",displayField:"codeAndTitle",fieldLabel:"Naics Code",name:"naicId",width:500,forceSelection:true,store:b,hidden:true});
b.load();this._newNaicAssignButton=Ext.create({text:"Add",iconCls:"icon-16x16-add",xtype:"button",hidden:true,handler:function(){if(a._newNaicDropdown.getValue()){var c=a._naicAssignStore.newRecord({});
c.set("organizationId",a._organizationFormStore.getAt(0).get("organizationId"));c.set("naicId",a._newNaicDropdown.getValue());
a._naicAssignStore.add(c);a._naicGrid.getSelectionModel().selectLastRow(false);a._naicAssignStore.submitChanges(function(d){a._naicAssignStore.reload();
},function(e,d){alert(d);a._naicAssignStore.reload();});}}});this._naicGrid=new WebLight.grid.GridPanel({striptRows:true,pageSize:20,style:"margin-top:20px",autoHeight:true,tbar:[a._newNaicDropdown,a._newNaicAssignButton],selModel:new Ext.grid.RowSelectionModel({singleSelect:true}),cm:new Ext.grid.ColumnModel({defaults:{sortable:true},columns:[{dataIndex:"code",header:"Code",width:150},{dataIndex:"title",header:"Description",width:500},{header:"Action",align:"center",xtype:"templatecolumn",sortable:false,hidden:true,tpl:new Ext.XTemplate('<a href="javascript:void(0);" xcmd="delete">Delete</a>')}]})});
this._naicGrid.on("xcellclick",function(h,d,e,f,c){switch(d){case"delete":Ext.Msg.confirm("Confirm","Are you sure want to delete this record？",function(g){if(g=="yes"){h.store.remove(e);
h.store.submitChanges(function(){h.store.reload();},function(){alert("Failed");});}});break;}},this);
this._naicGrid.bindStore(this._naicAssignStore);},createMainSiteTitleForm:function(){return new Ext.create({xtype:"box",html:'<table width="100%"><tbody><tr><td><h2 class="page-title">Summary</h2>            </td><td align="right" valign="middle"><a href="/">Back to home page</a></td></tr></tbody></table>'});
},createChildControls:function(){this._organizationFormStore=new SP.object.OrganizationStore();this._facilityStore=new SP.object.FacilityStore();
this._contactStore=new SP.object.ContactStore();this._naicAssignStore=new SP.object.NaicAssignStore();
this._mepUserStore=new SP.object.MepUserStore();this._mepStore=new SP.object.MepStore();if(this.isBackOffice){this.addChildControl(this.createBackTitleForm(),"container");
}else{this.addChildControl(this.createMainSiteTitleForm(),"container");}this.createOrganizationViewForm();
this.createOrganizationEditForm();this._organizationViewForm.bindStore(this._organizationFormStore);this._organizationEditForm.bindStore(this._organizationFormStore);
this.addChildControl(this._organizationViewForm,"container");this.addChildControl(this._organizationEditForm,"container");
if(!this.isBackOffice){this._organizationEditForm.show();this._organizationViewForm.hide();}this.createContactGrid();
this.createFacilityGrid();this.createFacilityForm();this.createContactForm();this.createNaicGrid();this.addChildControl(Ext.create({xtype:"box",html:'<h2 class="page-title">Contact Information</h2>'}),"container-top");
this.addChildControl(this._contactGrid,"container-top");this.addChildControl(Ext.create({xtype:"box",html:'<h2 class="page-title">Facility Information</h2>'}),"container-bottom");
this.addChildControl(this._facilityGrid,"container-bottom");this.addChildControl(Ext.create({xtype:"box",html:'<h2 class="page-title">NAICS Code</h2>'}),"container-bottom");
this.addChildControl(this._naicGrid,"container-bottom");SP.page.OrganizationViewPage.superclass.createChildControls.call(this);
},dataBind:function(){var a=this;if(this.organizationId){this._organizationFormStore.queryable.where("organizationId=@0",this.organizationId).load();
this._facilityStore.queryable.where("organizationId=@0",this.organizationId).load();this._contactStore.queryable.where("organizationId=@0",this.organizationId).load();
this._naicAssignStore.queryable.where("organizationId=@0",this.organizationId).load();}else{this._newFacilityButton.disable();
this._newCotnactButton.disable();this._newNaicDropdown.disable();this._newNaicAssignButton.disable();
this._organizationEditForm.show();this._organizationViewForm.hide();this._facilityStore.queryable.where("organizationId=00000000-0000-0000-0000-000000000000").load();
this._contactStore.queryable.where("organizationId=00000000-0000-0000-0000-000000000000").load();this._naicAssignStore.queryable.where("organizationId=00000000-0000-0000-0000-000000000000").load();
}this._organizationFormStore.on("load",function(){var b;if(a.isBackOffice){b=this.getAt(0).get("isReadOnly");
}else{b=false;}a._editButton.setVisible(!b);a._contactGrid.tbar.setVisible(!b);a._facilityGrid.tbar.setVisible(!b);
a._naicGrid.tbar.setVisible(!b);a._newCotnactButton.setVisible(!b);a._newFacilityButton.setVisible(!b);
a._newNaicAssignButton.setVisible(!b);a._newNaicDropdown.setVisible(!b);a._contactGrid.getColumnModel().setHidden(7,b);
a._facilityGrid.getColumnModel().setHidden(7,b);a._facilityGrid.getColumnModel().setHidden(8,!b);a._naicGrid.getColumnModel().setHidden(2,b);
if(this.getAt(0).get("aeroCode")!=null&&this.getAt(0).get("aeroCode")!=""){a._AeroCodeConfig.showItem();
a._AeroCodeConfig.allowBlank=false;a._organizationEditForm.getFieldByName("hasAeroCode").setValue(true);
}else{a._AeroCodeConfig.hideItem();a._AeroCodeConfig.allowBlank=true;a._organizationEditForm.getFieldByName("hasAeroCode").setValue(false);
}if(this.getAt(0).get("isoCode")!=null&&this.getAt(0).get("isoCode")!=""){a._IsoCodeConfig.showItem();
a._IsoCodeConfig.allowBlank=false;a._organizationEditForm.getFieldByName("hasIsoCode").setValue(true);
}else{a._IsoCodeConfig.hideItem();a._IsoCodeConfig.allowBlank=true;a._organizationEditForm.getFieldByName("hasIsoCode").setValue(false);
}if(this.getAt(0).get("otherCertification")!=null&&this.getAt(0).get("otherCertification")!=""){a._organizationEditForm.getFieldByName("hasOtherCode").setValue(true);
a._OtherCodeCofing.showItem();}else{a._OtherCodeCofing.hideItem();a._organizationEditForm.getFieldByName("hasOtherCode").setValue(false);
}if(a._organizationFormStore.getAt(0).get("mepUserId")){a._mepUserStore.queryable.where("mepId=@0",a._organizationFormStore.getAt(0).get("mepId")).load();
}if(this.getAt(0).get("incorporateCnc")==true){a._organizationEditForm.getFieldByName("incorporater").onSetValue("yes",true);
a._organizationViewForm.getFieldByName("incorporaterView").onSetValue("yes6",true);}else{if(this.getAt(0).get("incorporateCnc")==false){a._organizationEditForm.getFieldByName("incorporater").onSetValue("no",true);
a._organizationViewForm.getFieldByName("incorporaterView").onSetValue("no6",true);}else{if(this.getAt(0).get("incorporateCnc")==null){a._organizationEditForm.getFieldByName("incorporater").reset();
a._organizationViewForm.getFieldByName("incorporaterView").reset();}}}});a._mepStore.load();SP.page.OrganizationViewPage.superclass.dataBind.call(this);
},render:function(b){var a=this;SP.page.OrganizationViewPage.superclass.render.call(this,b);if(!this.isBackOffice){this._organizationEditForm.show();
this._organizationViewForm.hide();}}});WebLight.PageMgr.registerType("organizationview",SP.page.OrganizationViewPage);
WebLight.namespace("SP","SP.page");SP.page.FacilityEditorPage=WebLight.extend(WebLight.Page,{title:"Facility Details",html:_builtInTemplate_b84c3e97[5],facilityId:"",isBackOffice:true,organizationId:"",_facilityForm:null,_systemGrid:null,_millGrid:null,_turnGrid:null,_comboGrid:null,_edmGrid:null,createMainSiteTitleForm:function(){return new Ext.create({xtype:"box",html:'<table width="100%"><tbody><tr><td><h2 class="page-title">Facility Information</h2>            </td><td align="right" valign="middle" id="returnButton"></td></tr></tbody></table>'});
},createChildControls:function(){var a=this;SP.page.FacilityEditorPage.superclass.createChildControls.call(this);
this.addChildControl(this.createMainSiteTitleForm(),"container");a._facilityForm=new SP.controls.FacilityForm({facilityId:this.facilityId});
this.addChildControl(a._facilityForm,"container");this.addChildControl(Ext.create({xtype:"box",html:'<h2 class="page-title">Software</h2>'}),"container");
a._systemGrid=new SP.controls.CncOrgSystemGrid({facilityId:this.facilityId});this.addChildControl(a._systemGrid,"container");
this.addChildControl(Ext.create({xtype:"box",html:'<h2 class="page-title">CNC Machine Capabilities - Mill</h2>'}),"container");
a._millGrid=new SP.controls.CncMillingGrid({facilityId:this.facilityId});this.addChildControl(a._millGrid,"container");
this.addChildControl(Ext.create({xtype:"box",html:'<h2 class="page-title">CNC Machine Capabilities - Turn</h2>'}),"container");
a._turnGrid=new SP.controls.CncTurningGrid({facilityId:this.facilityId});this.addChildControl(a._turnGrid,"container");
this.addChildControl(Ext.create({xtype:"box",html:'<h2 class="page-title">CNC Machine Capabilities - Mill/Turn Combo</h2>'}),"container");
a._comboGrid=new SP.controls.CncComboGrid({facilityId:this.facilityId});this.addChildControl(a._comboGrid,"container");
this.addChildControl(Ext.create({xtype:"box",html:'<h2 class="page-title">CNC Machine Capabilities - EDM</h2>'}),"container");
a._edmGrid=new SP.controls.CncEDMGrid({facilityId:this.facilityId});this.addChildControl(a._edmGrid,"container");
},dataBind:function(){var a=this;a._facilityForm.on("SetOtherMode",function(b){if(!a.isBackOffice){b=false;
}a._comboGrid.SetMode(b);a._edmGrid.SetMode(b);a._millGrid.SetMode(b);a._systemGrid.SetMode(b);a._turnGrid.SetMode(b);
});SP.page.FacilityEditorPage.superclass.dataBind.call(this);},render:function(b){var a=this;SP.page.FacilityEditorPage.superclass.render.call(this,b);
var c=new Ext.Button({text:"Return",width:70,height:20,renderTo:"returnButton",handler:function(){if(a.isBackOffice){WebLight.Router.route(String.format("/Organizations/{0}",a.organizationId));
}else{WebLight.Router.route(String.format("/summary",this.facilityId));}}});}});WebLight.PageMgr.registerType("facilityeditor",SP.page.FacilityEditorPage);
WebLight.namespace("SP","SP.page");SP.page.AdvancedSearchPage=WebLight.extend(WebLight.Page,{title:"AttachmentFiles",html:_builtInTemplate_b84c3e97[6],createChildControls:function(){this.addChildControl(Ext.create({xtype:"box",html:"<h2>AttchmentFiles</h2>"}),"container");
SP.page.AdvancedSearchPage.superclass.createChildControls.call(this);}});WebLight.PageMgr.registerType("advancedsearch",SP.page.AdvancedSearchPage);
WebLight.namespace("SP","SP.page");SP.page.AttachmentFilesPage=WebLight.extend(WebLight.Page,{title:"AttachmentFiles",html:_builtInTemplate_b84c3e97[6],_attachmentGrid:null,createAttachmentGrid:function(){this._attachmentGrid=new WebLight.grid.GridPanel({autoHeight:true,enableHdMenu:false,viewConfig:{forceFit:true},style:{margin:"10px 0 0"},cm:new Ext.grid.ColumnModel({defaults:{sortable:false},columns:[{dataIndex:"",header:"Org.Id"},{dataIndex:"",header:"Organization Name"},{dataIndex:"",header:"Telephone"},{dataIndex:"",header:"State"},{dataIndex:"",header:"Nbr. Mach."},{dataIndex:"",header:"Entered Date"},{header:"Action",xtype:"templatecolumn",width:80,tpl:new Ext.XTemplate('<a href="javascript:void(0);">View</a>')}]}),store:new Ext.data.JsonStore({data:null,fields:[]})});
},createChildControls:function(){this.addChildControl(Ext.create({xtype:"box",html:'<h2 class="page-title">AttchmentFiles</h2>'}),"container");
this.createAttachmentGrid();SP.page.AttachmentFilesPage.superclass.createChildControls.call(this);this.addChildControl(this._attachmentGrid,"container");
}});WebLight.PageMgr.registerType("attachmentfiles",SP.page.AttachmentFilesPage);WebLight.namespace("SP","SP.page");
SP.page.MachineByStatePage=WebLight.extend(WebLight.Page,{title:"Machines By State",html:_builtInTemplate_b84c3e97[6],_machineByStateStore:null,_machineByStateGrid:null,createMachineByState:function(){var a=this;
this._machineByStateGrid=new WebLight.grid.GridPanel({tbar:[{text:"Export to Excel",iconCls:"icon-16x16-excel",handler:function(){a._machineByStateGrid.exportToExcel();
}}],striptRows:true,autoHeight:true,style:"margin-top:20px",selModel:new Ext.grid.RowSelectionModel({singleSelect:true}),cm:new Ext.grid.ColumnModel({defaults:{sortable:true},columns:[{dataIndex:"state",header:"State",width:80},{dataIndex:"millMachineCount",header:"Nbr. Mill Machines",width:120},{dataIndex:"turnMachineCount",header:"Nbr. Turn Machines",width:120},{dataIndex:"comboMachineCount",header:"Nbr. Combo Machines",width:120},{dataIndex:"edmMachineCount",header:"Nbr. Edm Machines",width:120},{header:"Total Number of Machines",width:160,renderer:function(c,b,d){return String.format("{0}",(d.get("millMachineCount")+d.get("turnMachineCount")+d.get("comboMachineCount")+d.get("edmMachineCount")));
}}]})});this._machineByStateGrid.bindStore(this._machineByStateStore);},createChildControls:function(){this._machineByStateStore=new SP.object.MachineByStateReportStore();
this.addChildControl(Ext.create({xtype:"box",html:'<h2 id="sp-box-h1">Machines By State</h2>'}),"container");
this.createMachineByState();this.addChildControl(this._machineByStateGrid,"container");SP.page.MachineByStatePage.superclass.createChildControls.call(this);
},dataBind:function(){this._machineByStateStore.load();SP.page.MachineByStatePage.superclass.dataBind.call(this);
}});WebLight.PageMgr.registerType("machinebystate",SP.page.MachineByStatePage);WebLight.namespace("SP","SP.page");
SP.page.NewMechinesAddedPage=WebLight.extend(WebLight.Page,{title:"New Machines Search",html:_builtInTemplate_b84c3e97[6],_mepStore:null,_mepResultStore:null,_filterForm:null,_searchResultGrid:null,createFilterForm:function(){var a=this;
var b=new SP.form.DropdownList({store:this._mepStore,allowBlank:true,editable:true,name:"mepId",fieldLabel:"Mep Center",displayField:"title",valueField:"mepId",hidden:!SP.context.isSuperUser,hideLabel:!SP.context.isSuperUser});
var c=new Ext.Button({text:"Search",width:70,style:"margin-left:40px;",handler:function(){this.getEl().mask("loading...");
var g=this._filterForm.getFieldValue("startDate");var f=this._filterForm.getFieldValue("endDate");if(g==""){g=null;
}if(f==""){f=null;}SP.object.MepExt.search(b.getValue(),g,f,function(h){a._mepResultStore.loadData({data:h});
a.getEl().unmask();});},scope:this});var d=new Ext.Button({text:"Clear Search",style:"margin-left:10px;",scope:this,handler:function(){a._filterForm.reset();
a._mepResultStore.removeAll();}});var e=new Ext.Button({text:"Export to Excel",style:"margin-left:10px;",scope:this,handler:function(){var g=this._filterForm.getFieldValue("startDate");
if(!g){g="";}else{g=g.format("Y-m-d");}var f=this._filterForm.getFieldValue("endDate");if(!f){f="";}else{f=f.format("Y-m-d");
}window.open(String.format("ExportToExcel.aspx?apiKey=newmachinesadded&mepRefId={0}&startDate={1}&endDate={2}",b.getValue(),g,f));
}});this._filterForm=new WebLight.form.FormPanel({border:false,header:false,frame:true,labelWidth:100,labelAlign:"right",items:[{layout:"column",defaults:{layout:"form"},items:[{items:[b]},{labelWidth:70,items:[{xtype:"datefield",editable:false,name:"startDate",fieldLabel:"Start Date"}]},{labelWidth:70,items:[{xtype:"datefield",editable:false,name:"endDate",fieldLabel:"End Date"}]}]}],buttons:[c,d,e]});
},getMepUserGrid:function(f,d){var a=this;var b=new Ext.data.JsonStore({fields:[{name:"mepUserId"},{name:"name"},{name:"organizations",type:"object"},{name:"organizationCount"},],data:f});
var c=new Sm.grid.RowExpander({tpl:'<div class="ux-row-expander-box"></div>',actAsTree:true,treeLeafProperty:"noMeasure",listeners:{expand:function(k,j,g,l){var h=j.get("organizations");
if(h){a.getOrganizationGrid(h,Ext.get(this.grid.getView().getRow(l)).child(".ux-row-expander-box"));}}}});
var e=new Ext.grid.GridPanel({autoHeight:true,enableHdMenu:false,viewConfig:{forceFit:true},store:b,cm:new Ext.grid.ColumnModel({defaults:{sortable:false},columns:[c,{dataIndex:"name",header:"MEP User"},{dataIndex:"organizationCount",header:"User Total Machines Added"}]}),plugins:[c]});
d&&e.render(d);return e;},getMachineGrid:function(f,d){var a=this;var b=new Ext.data.JsonStore({fields:[{name:"name"},{name:"date"},{name:"machineMakeTitle"},{name:"machineModelTitle"},{name:"controllerMakeTitle"},{name:"controllerModelTitle"}],data:f});
var c=new Sm.grid.RowExpander({alwaysAsLeaf:true,actAsTree:true});var e=new Ext.grid.GridPanel({autoHeight:true,enableHdMenu:false,viewConfig:{forceFit:true},store:b,cm:new Ext.grid.ColumnModel({defaults:{sortable:false},columns:[c,{dataIndex:"name",header:"Name",renderer:function(g){if(g=="T"){return"Turning";
}else{if(g=="E"){return"EDM";}else{if(g=="C"){return"Combo";}else{if(g=="M"){return"Milling";}}}}return g;
}},{dataIndex:"date",header:"Date",renderer:Ext.util.Format.dateRenderer("M d, Y")},{dataIndex:"machineMakeTitle",header:"Machine Make"},{dataIndex:"machineModelTitle",header:"Machine Model"},{dataIndex:"controllerMakeTitle",header:"Controller Make"},{dataIndex:"controllerModelTitle",header:"Controller Model"}]}),plugins:[c]});
d&&e.render(d);return e;},getOrganizationGrid:function(f,d){var a=this;var b=new Ext.data.JsonStore({fields:[{name:"name"},{name:"address"},{name:"address1"},{name:"city"},{name:"state"},{name:"zipCode"},{name:"machineCount"},{name:"machines",type:"object"}],data:f});
var c=new Sm.grid.RowExpander({tpl:'<div class="ux-row-expander-box"></div>',actAsTree:true,treeLeafProperty:"noMeasure",listeners:{expand:function(j,h,g,k){var l=h.get("machines");
if(l){a.getMachineGrid(l,Ext.get(this.grid.getView().getRow(k)).child(".ux-row-expander-box"));}}}});
var e=new Ext.grid.GridPanel({autoHeight:true,enableHdMenu:false,viewConfig:{forceFit:true},store:b,cm:new Ext.grid.ColumnModel({defaults:{sortable:false},columns:[c,{dataIndex:"name",header:"Name"},{dataIndex:"address",header:"Address"},{dataIndex:"address1",header:"Address1"},{dataIndex:"city",header:"City"},{dataIndex:"state",header:"State"},{dataIndex:"zipCode",header:"Zip Code"},{dataIndex:"machineCount",header:"Machine Count"}]}),plugins:[c]});
d&&e.render(d);return e;},createMepSearchResultGrid:function(){var a=this;var b=new Sm.grid.RowExpander({tpl:'<div class="ux-row-expander-box"></div>',actAsTree:true,treeLeafProperty:"noMeasure",listeners:{expand:function(f,e,c,g){var d=e.get("mepusers");
if(d){a.getMepUserGrid(d,Ext.get(this.grid.getView().getRow(g)).child(".ux-row-expander-box"));}}}});
this._searchResultGrid=new WebLight.grid.GridPanel({autoHeight:true,enableHdMenu:false,viewConfig:{forceFit:true},style:{margin:"10px 0 0"},store:this._mepResultStore,cm:new Ext.grid.ColumnModel({defaults:{sortable:false},columns:[b,{dataIndex:"title",header:"MEP"},{dataIndex:"mepUserCount",header:"MEP Total Machines Added"}]}),plugins:[b]});
},createChildControls:function(){var a=this;this._mepStore=new SP.object.MepStore();this.createFilterForm();
this._mepResultStore=new Ext.data.JsonStore({data:{data:[]},root:"data",idProperty:"mepId",fields:[{name:"name"},{name:"title"},{name:"mepusers",type:"object"},{name:"mepUserCount"},{name:"noMeasure"}]});
this.createMepSearchResultGrid();this.addChildControl(Ext.create({xtype:"box",html:'<h2 class="page-title">New Machines Added</h2>'}),"container");
this.addChildControl(this._filterForm,"container");this.addChildControl(this._searchResultGrid,"container");
SP.page.NewMechinesAddedPage.superclass.createChildControls.call(this);},dataBind:function(){if(SP.context.isSuperUser){this._mepStore.load();
}SP.page.NewMechinesAddedPage.superclass.dataBind.call(this);}});WebLight.PageMgr.registerType("newmachinesadded",SP.page.NewMechinesAddedPage);
WebLight.namespace("SP","SP.page");SP.page.NewMakesModelsEnteredPage=WebLight.extend(WebLight.Page,{title:"New Makes/Models Entered",html:_builtInTemplate_b84c3e97[6],_machineSearchStore:null,_filterForm:null,_searchResultGrid:null,_machineMakeStore:null,_machineModelStore:null,_controllerMakeStore:null,_controllerModelStore:null,_mepStore:null,_mepUserStore:null,createFilterForm:function(){var f=this;
var j=new Ext.Button({text:"Search",width:80,style:"margin-left:10px;",handler:function(){var o=f._filterForm.getForm().getFieldValues();
var n=[];f._machineSearchStore.queryable.property("startDate",null);f._machineSearchStore.queryable.property("endDate",null);
for(var m in o){if(o[m]){if(m=="companyId"){n.push(String.format("{0}=={1}",m,o[m]));}else{if(m=="startDate"||m=="endDate"){f._machineSearchStore.queryable.property(m,Ext.util.Format.date(o[m],"Y-m-d"));
}else{if(m=="organizationName"){n.push(String.format("{0}^={1}",m,$.trim(o[m])));}else{n.push(String.format("{0}=={1}",m,$.trim(o[m])));
}}}}}if(n.length){f._machineSearchStore.queryable.where(n.join(" && ")).load();}else{f._machineSearchStore.queryable.where().load();
}},scope:this});var a=new Ext.Button({text:"Clear Search",style:"margin-left:10px;",scope:this,handler:function(){f._filterForm.reset();
f._machineSearchStore.removeAll();}});var d=new Ext.Button({text:"Export to Excel",scope:this,handler:function(){f._searchResultGrid.exportToExcel();
}});var c=new SP.form.DropdownList({store:Sp.data.BuiltInStores.machineTypeStore,fieldLabel:"Machine Type",name:"machineTypeId",displayField:"machineTypeName",valueField:"machineTypeId",allowBlank:true,width:150});
c.on("change",function(m,n,o){if(!n){f._machineMakeStore.removeAll();f._machineModelStore.removeAll();
f._controllerMakeStore.removeAll();f._controllerModelStore.removeAll();l.clearValue();k.clearValue();
h.clearValue();e.clearValue();}});c.on("valuechange",function(m){f._machineMakeStore.removeAll();f._machineModelStore.removeAll();
f._controllerMakeStore.removeAll();f._controllerModelStore.removeAll();l.clearValue();k.clearValue();
h.clearValue();e.clearValue();if(m){f._machineMakeStore.queryable.where("machineType=@0",m).orderBy("title").load();
f._controllerMakeStore.queryable.where("machineType=@0",m).orderBy("title").load();}});var l=new SP.form.DropdownList({store:this._machineMakeStore,name:"machineMakeId",displayField:"title",valueField:"machineMakeId",fieldLabel:"Machine Make",anchor:"90%",allowBlank:true,width:120});
var k=new SP.form.DropdownList({store:this._machineModelStore,name:"machineModelId",displayField:"title",valueField:"machineModelId",fieldLabel:"Machine Model",anchor:"90%",allowBlank:true,width:120});
var h=new SP.form.DropdownList({store:this._controllerMakeStore,name:"controllerMakeId",displayField:"title",valueField:"controllerMakeId",fieldLabel:"Controller Make",anchor:"90%",allowBlank:true,width:120});
var e=new SP.form.DropdownList({store:this._controllerModelStore,name:"controllerModelId",displayField:"title",valueField:"controllerModelId",fieldLabel:"Controller Model",anchor:"90%",allowBlank:true,width:120});
l.on("valuechange",function(m){if(!m){f._machineModelStore.removeAll();}else{f._machineModelStore.queryable.where("machineMakeId=@0",m).orderBy("title").load();
}});l.on("change",function(m,n,o){if(!n){k.clearValue();f._machineModelStore.removeAll();}});h.on("valuechange",function(m){if(!m){f._machineModelStore.removeAll();
}else{f._controllerModelStore.queryable.where("controllerMakeId=@0",m).orderBy("title").load();}});h.on("change",function(m,n,o){if(!n){e.clearValue();
f._controllerModelStore.removeAll();}});var g=new SP.form.DropdownList({valueField:"mepId",displayField:"title",fieldLabel:"MEP Center",name:"mepId",width:100,hidden:!SP.context.isSuperUser,hideLabel:!SP.context.isSuperUser,allowBlank:true,store:this._mepStore,editable:true,listeners:{change:function(m,n,o){if(n==""){b.clearValue();
f._mepUserStore.removeAll();}}}});var b=new SP.form.DropdownList({autoSelect:true,valueField:"mepUserId",displayField:"fullName",fieldLabel:"MEP User",name:"mepUserId",allowBlank:true,hidden:!SP.context.isSuperUser,hideLabel:!SP.context.isSuperUser,editable:true,width:100,store:this._mepUserStore});
b.linkTo(g);this._filterForm=new WebLight.form.FormPanel({border:false,header:false,frame:true,labelWidth:100,labelAlign:"right",items:[{layout:"column",defaults:{layout:"form"},items:[{items:[{xtype:"numberfield",width:100,fieldLabel:"Company ID",name:"companyId"}]},{items:[{xtype:"textfield",width:100,fieldLabel:"Company Name",name:"organizationName"}]},{items:[c]}]},{layout:"column",defaults:{layout:"form"},items:[{items:[l]},{items:[k]},{items:[h]},{items:[e]}]},{layout:"column",defaults:{layout:"form"},items:[{items:[g]},{items:[b]},{items:[{xtype:"datefield",editable:false,name:"startDate",fieldLabel:"Start Date"}]},{items:[{xtype:"datefield",editable:false,name:"endDate",fieldLabel:"End Date"}]}]}],buttons:[d,j,a]});
},createSearchResultGrid:function(){var a=this;var b=function(c){if(!c){return"[Not Assigned]";}return c;
};this._searchResultGrid=new WebLight.grid.GridPanel({enableHdMenu:false,viewConfig:{forceFit:true},pageSize:20,height:550,style:{margin:"10px 0 0"},cm:new Ext.grid.ColumnModel({defaults:{sortable:false},columns:[{dataIndex:"sequenceId",header:"Company ID",width:80},{dataIndex:"companyName",header:"Company Name",width:130},{dataIndex:"machineMake",header:"Machine Make"},{dataIndex:"machineModel",header:"Machine Model"},{dataIndex:"controllerMake",header:"Controller Make"},{dataIndex:"controllerModel",header:"Controller Model"},{dataIndex:"mepTitle",header:"MEP",renderer:b,width:80},{dataIndex:"mepUserTitle",header:"MEP User",renderer:b},{dataIndex:"dateEntered",header:"Date Entered",renderer:Ext.util.Format.dateRenderer("Y/m/d h:i"),width:120}]})});
this._searchResultGrid.bindStore(this._machineSearchStore);},createChildControls:function(){var a=this;
this._machineSearchStore=new SP.object.MachineByDateRangerReportStore();this._machineMakeStore=new SP.object.MachineMakeStore();
this._machineModelStore=new SP.object.MachineModelStore();this._controllerMakeStore=new SP.object.ControllerMakeStore();
this._controllerModelStore=new SP.object.ControllerModelStore();this._mepStore=new SP.object.MepStore();
this._mepUserStore=new SP.object.MepUserStore();this.createFilterForm();this.createSearchResultGrid();
this.addChildControl(Ext.create({xtype:"box",html:'<h2 class="page-title">New Makes/Models Entered</h2>'}),"container");
this.addChildControl(this._filterForm,"container");this.addChildControl(this._searchResultGrid,"container");
SP.page.NewMakesModelsEnteredPage.superclass.createChildControls.call(this);},dataBind:function(){this._mepStore.load();
SP.page.NewMakesModelsEnteredPage.superclass.dataBind.call(this);}});WebLight.PageMgr.registerType("newmakesmodelsentered",SP.page.NewMakesModelsEnteredPage);
WebLight.namespace("SP","SP.page");SP.page.NewRegistrationPage=WebLight.extend(WebLight.Page,{title:"New Registration",html:_builtInTemplate_b84c3e97[6],_searchResultStore:null,_filterForm:null,_searchResultGrid:null,createFilterForm:function(){var a=this;
var c=new SP.form.DropdownList({store:Sp.data.BuiltInStores.stateStore,displayField:"state",valueField:"state",name:"state",fieldLabel:"State"});
var b=new Ext.Button({text:"Search",width:80,handler:function(){}});this._filterForm=new WebLight.form.FormPanel({border:false,header:false,frame:true,labelWidth:100,items:[{layout:"column",defaults:{layout:"form"},items:[{columnWidth:0.35,items:[c]},{columnWidth:0.27,items:[{xtype:"datefield",editable:false,name:"startDate",fieldLabel:"Start Date"}]},{columnWidth:0.27,items:[{xtype:"datefield",editable:false,name:"endDate",fieldLabel:"End Date"}]},{columnWidth:0.11,items:[b]}]}]});
},createSearchResultGrid:function(){var a=function(b){if(!b){return"(Not Assigned)";}return b;};this._searchResultGrid=new WebLight.grid.GridPanel({autoHeight:true,enableHdMenu:false,viewConfig:{forceFit:true},style:{margin:"10px 0 0"},cm:new Ext.grid.ColumnModel({defaults:{sortable:false},columns:[{dataIndex:"companyId",header:"Organization Id",width:100},{dataIndex:"organizationName",header:"Organization Name",width:200},{dataIndex:"phone",header:"Phone",width:100},{dataIndex:"userName",header:"PM Name",width:120,renderer:a},{dataIndex:"state",header:"State",width:80,sortable:false},{header:"Action",align:"center",xtype:"templatecolumn",sortable:false,width:200,tpl:new Ext.XTemplate('<a href="javascript:void(0);" xcmd="view">View</a> &nbsp;                             <a href="javascript:void(0);" xcmd="delete">Delete</a>')}]})});
},createChildControls:function(){this._searchResultStore=new SP.object.OrganizationStore();this.addChildControl(Ext.create({xtype:"box",html:'<h2 class="page-title">New Registration</h2>'}),"container");
this.createFilterForm();this.createSearchResultGrid();this._searchResultGrid.bindStore(this._searchResultStore);
SP.page.NewRegistrationPage.superclass.createChildControls.call(this);this.addChildControl(this._filterForm,"container");
this.addChildControl(this._searchResultGrid,"container");}});WebLight.PageMgr.registerType("newregistration",SP.page.NewRegistrationPage);
WebLight.namespace("SP","SP.page");SP.page.QueryBuilderPage=WebLight.extend(WebLight.Page,{title:"QueryBuilder",html:_builtInTemplate_b84c3e97[7],cacheable:true,_buttonQueryBar:null,basicQueryBuilderForm:null,advancedQueryBuilderForm:null,organizationGrid:null,_machineMakeStore:null,_machineModelStore:null,_controllerMakeStore:null,_controllerModelStore:null,_machineMakeCodeStore:null,_machineModelCodeStore:null,_controllerMakeCodeStore:null,_controllerModelCodeStore:null,_cadSoftwareStore:null,_camSoftwareStore:null,_naicsStore:null,_machineMakeCodeDropdown:null,_machineMakeDropdown:null,_machineModelCodeDropdown:null,_machineModelDropdown:null,_controllerMakeCodeDropdown:null,_controllerMakeDropdown:null,_controllerModelCodeDropdown:null,_controllerModelDropdown:null,_mepNameStore:null,_mepProjectManagerStore:null,generateComboBoxes:function(){var a=this;
this._machineMakeCodeDropdown=new SP.form.DropdownList({store:this._machineMakeCodeStore,name:"machineMakeId2",displayField:"friendlyId",valueField:"machineMakeId",width:81,allowBlank:true});
this._machineModelCodeDropdown=new SP.form.DropdownList({store:this._machineModelCodeStore,name:"machineModelId2",displayField:"friendlyId",valueField:"machineModelId",width:82,allowBlank:true});
this._controllerMakeCodeDropdown=new SP.form.DropdownList({store:this._controllerMakeCodeStore,name:"controllerMakeId2",displayField:"friendlyId",valueField:"controllerMakeId",width:81,allowBlank:true});
this._controllerModelCodeDropdown=new SP.form.DropdownList({store:this._controllerModelCodeStore,name:"controllerModelId2",displayField:"friendlyId",valueField:"controllerModelId",width:82,allowBlank:true});
this._machineMakeDropdown=new SP.form.DropdownList({store:this._machineMakeStore,name:"machineMakeId",displayField:"title",valueField:"machineMakeId",fieldLabel:"Machine Make",anchor:"90%",allowBlank:true});
this._machineModelDropdown=new SP.form.DropdownList({store:this._machineModelStore,name:"machineModelId",displayField:"title",valueField:"machineModelId",fieldLabel:"Machine Model",anchor:"90%",allowBlank:true});
this._controllerMakeDropdown=new SP.form.DropdownList({store:this._controllerMakeStore,name:"controllerMakeId",displayField:"title",valueField:"controllerMakeId",fieldLabel:"Controller Make",anchor:"90%",allowBlank:true});
this._controllerModelDropdown=new SP.form.DropdownList({store:this._controllerModelStore,name:"controllerModelId",displayField:"title",valueField:"controllerModelId",fieldLabel:"Controller Model",anchor:"90%",allowBlank:true});
this._machineMakeDropdown.on("valuechange",function(b){if(!b){a._machineModelStore.removeAll();}else{a._machineModelStore.queryable.where("machineMakeId=@0",b).orderBy("title").load();
}});this._machineMakeDropdown.on("change",function(d,e,f){if(!e){a._machineModelDropdown.clearValue();
a._machineModelStore.removeAll();}});this._machineMakeCodeDropdown.on("valuechange",function(b){if(!b){a._machineModelCodeStore.removeAll();
}else{a._machineModelCodeStore.queryable.where("machineMakeId=@0",b).orderBy("friendlyId").load();}});
this._machineMakeCodeDropdown.on("change",function(d,e,f){if(!e){a._machineModelCodeDropdown.clearValue();
a._machineModelCodeStore.removeAll();}});this._controllerMakeDropdown.on("valuechange",function(b){if(!b){a._machineModelStore.removeAll();
}else{a._controllerModelStore.queryable.where("controllerMakeId=@0",b).orderBy("title").load();}});this._controllerMakeDropdown.on("change",function(d,e,f){if(!e){a._controllerModelDropdown.clearValue();
a._machineModelStore.removeAll();}});this._controllerMakeCodeDropdown.on("valuechange",function(b){if(!b){a._controllerModelCodeStore.removeAll();
}else{a._controllerModelCodeStore.queryable.where("controllerMakeId=@0",b).orderBy("title").load();}});
this._controllerMakeCodeDropdown.on("change",function(d,e,f){if(!e){a._controllerModelCodeDropdown.clearValue();
a._controllerModelCodeStore.removeAll();}});},generateBasicQueryBuilderForm:function(){var a=this;var c=new SP.form.DropdownList({store:Sp.data.BuiltInStores.machineTypeStore,fieldLabel:"Machine Type",name:"machineTypeId",displayField:"machineTypeName",valueField:"machineTypeId",allowBlank:true});
c.on("change",function(e,f,g){if(!f){a._machineMakeStore.removeAll();a._machineModelStore.removeAll();
a._controllerMakeStore.removeAll();a._controllerModelStore.removeAll();a._machineMakeCodeStore.removeAll();
a._machineModelCodeStore.removeAll();a._controllerMakeCodeStore.removeAll();a._controllerModelCodeStore.removeAll();
a._machineMakeDropdown.clearValue();a._machineModelDropdown.clearValue();a._controllerMakeDropdown.clearValue();
a._controllerModelDropdown.clearValue();a._machineMakeCodeDropdown.clearValue();a._machineModelCodeDropdown.clearValue();
a._controllerMakeCodeDropdown.clearValue();a._controllerModelCodeDropdown.clearValue();}});c.on("valuechange",function(e){a._machineMakeStore.removeAll();
a._machineModelStore.removeAll();a._controllerMakeStore.removeAll();a._controllerModelStore.removeAll();
a._machineMakeCodeStore.removeAll();a._machineModelCodeStore.removeAll();a._controllerMakeCodeStore.removeAll();
a._controllerModelCodeStore.removeAll();a._machineMakeDropdown.clearValue();a._machineModelDropdown.clearValue();
a._controllerMakeDropdown.clearValue();a._controllerModelDropdown.clearValue();a._machineMakeCodeDropdown.clearValue();
a._machineModelCodeDropdown.clearValue();a._controllerMakeCodeDropdown.clearValue();a._controllerModelCodeDropdown.clearValue();
if(e){a._machineMakeStore.queryable.where("machineType=@0",e).orderBy("title").load();a._controllerMakeStore.queryable.where("machineType=@0",e).orderBy("title").load();
a._machineMakeCodeStore.queryable.where("machineType=@0",e).orderBy("friendlyId").load();a._controllerMakeCodeStore.queryable.where("machineType=@0",e).orderBy("friendlyId").load();
}if(e=="E"){b.store.loadData([[1,"Ram"],[2,"Write"]]);}else{b.store.loadData([[1,"Vertical"],[2,"Horizontal"]]);
}});var b=new SP.form.DropdownList({store:Sp.data.BuiltInStores.typeOfMachineStore,name:"typeOfMachine",fieldLabel:"Type Of Machine",displayField:"name",valueField:"id",anchor:"90%",allowBlank:true});
var d=[{layout:"column",border:false,defaults:{layout:"form",columnWidth:0.5,border:false},items:[{items:[{xtype:"textfield",fieldLabel:"Company ID",name:"supplyPointId",anchor:"90%"}]},{items:[{xtype:"textfield",fieldLabel:"Company Name",name:"organizationName",anchor:"90%"}]},{items:[{xtype:"textfield",fieldLabel:"Cage Code",name:"cageCode",anchor:"90%"}]},{items:[new SP.form.DropdownList({store:Sp.data.BuiltInStores.stateStore,name:"state",fieldLabel:"State",displayField:"state",valueField:"state",anchor:"90%",allowBlank:true})]},{items:[{xtype:"datefield",editable:true,fieldLabel:"Creation Date From",name:"creationDateFrom",anchor:"90%",editable:false}]},{items:[{xtype:"datefield",editable:true,fieldLabel:"End Date",name:"endDate",anchor:"90%",editable:false}]},{items:[{xtype:"compositefield",fieldLabel:"Production Personnel",width:220,items:[{xtype:"displayfield",value:"&gt;",width:10},{border:false,items:[new SP.form.DropdownList({store:Sp.data.BuiltInStores.productionPersonnelStore,name:"productionPersonnelGreatThan",displayField:"id",valueField:"id",anchor:"90%",allowBlank:true,width:110})]},{xtype:"displayfield",value:"&lt;",width:10},{border:false,items:[new SP.form.DropdownList({store:Sp.data.BuiltInStores.productionPersonnelStore,name:"productionPersonnelLessThan",displayField:"id",valueField:"id",anchor:"90%",allowBlank:true,width:110})]}]}]},{items:[{xtype:"compositefield",fieldLabel:"Production Area",items:[{xtype:"displayfield",value:"&gt;",width:10},{border:false,items:[new SP.form.DropdownList({store:Sp.data.BuiltInStores.productionAreaStore,name:"productionAreaGreatThan",displayField:"name",valueField:"id",anchor:"90%",allowBlank:true,width:110})]},{xtype:"displayfield",value:"&lt;",width:10},{border:false,items:[new SP.form.DropdownList({store:Sp.data.BuiltInStores.productionAreaStore,name:"productionAreaLessThan",displayField:"name",valueField:"id",anchor:"90%",allowBlank:true,width:110})]}]}]}]},{layout:"column",border:false,defaults:{layout:"form",border:false},items:[{columnWidth:0.4,items:[c]},{columnWidth:0.6,items:[{xtype:"compositefield",fieldLabel:"Post Code Id",items:[this._machineMakeCodeDropdown,this._machineModelCodeDropdown,this._controllerMakeCodeDropdown,this._controllerModelCodeDropdown]}]}]},{layout:"column",border:false,defaults:{layout:"form",columnWidth:0.5,border:false},items:[{items:[this._machineMakeDropdown]},{items:[this._machineModelDropdown]},{items:[this._controllerMakeDropdown]},{items:[this._controllerModelDropdown]},{items:[b]},{items:[{xtype:"compositefield",fieldLabel:"Number of Axes",items:[{xtype:"displayfield",value:"&gt;",width:10},new SP.form.DropdownList({store:Sp.data.BuiltInStores.noOfAxesStore,name:"noOfAxesGreatThan",displayField:"id",valueField:"id",width:106,allowBlank:true}),{xtype:"displayfield",value:"&lt;",width:10},new SP.form.DropdownList({store:Sp.data.BuiltInStores.noOfAxesStore,name:"noOfAxesLessThan",displayField:"id",valueField:"id",width:106,allowBlank:true})]}]}]}];
this.basicQueryBuilderForm=new WebLight.form.FormPanel({header:false,border:false,frame:false,labelWidth:120,defaults:{labelWidth:120},items:d});
},genarateAdvancedQueryBuilderForm:function(){var g=new SP.form.DropdownList({store:this._cadSoftwareStore,name:"cadId",displayField:"title",valueField:"systemId",fieldLabel:"CAD Software",anchor:"90%",allowBlank:true});
var f=new SP.form.DropdownList({store:this._camSoftwareStore,name:"camId",displayField:"title",valueField:"systemId",fieldLabel:"CAM Software",anchor:"90%",allowBlank:true});
var e=new SP.form.DropdownList({store:this._mepNameStore,name:"mepName",fieldLabel:"MEP Name",displayField:"title",valueField:"mepId",width:195,allowBlank:true});
var c=new SP.form.DropdownList({store:this._mepProjectManagerStore,name:"mepProjectManager",fieldLabel:"MEP Project Manager",displayField:"fullName",valueField:"mepUserId",width:195,allowBlank:true});
c.linkTo(e);var j=new SP.form.DropdownList({store:this._naicsStore,name:"naicId",displayField:"codeAndTitle",valueField:"naicId",fieldLabel:"NAICS",width:195,allowBlank:true});
var k=new SP.form.DropdownList({store:Sp.data.BuiltInStores.numberofShiftsStore,name:"noOfShiftsGreatThan",displayField:"id",valueField:"id",width:106,allowBlank:true});
var b=new SP.form.DropdownList({store:Sp.data.BuiltInStores.numberofShiftsStore,name:"noOfShiftsLessThan",displayField:"id",valueField:"id",width:106,allowBlank:true});
var h=new SP.form.DropdownList({store:Sp.data.BuiltInStores.maxTurnLengthStore,name:"maxTurnLengthGreatThan",displayField:"id",valueField:"id",width:80,allowBlank:true});
var a=new SP.form.DropdownList({store:Sp.data.BuiltInStores.maxTurnLengthStore,name:"maxTurnLengthLessThan",displayField:"id",valueField:"id",width:80,allowBlank:true});
var d=[{layout:"column",border:false,defaults:{layout:"form",border:false,labelWidth:60},items:[{columnWidth:0.33,items:[{xtype:"textfield",fieldLabel:"City",name:"City",anchor:"90%"}]},{columnWidth:0.33,items:[{xtype:"textfield",fieldLabel:"County",name:"County",anchor:"90%"}]},{columnWidth:0.33,items:[{xtype:"textfield",fieldLabel:"Zip Code",name:"ZipCode",anchor:"90%"}]}]},{layout:"column",border:false,defaults:{layout:"form",columnWidth:0.8,border:false},items:[{items:[{width:200,xtype:"compositefield",fieldLabel:"Total Number of Machines",items:[{xtype:"displayfield",value:"&gt;",width:10},{xtype:"numberfield",width:106,name:"TotalNumberOfMachinesGreatThan",minValue:0},{xtype:"displayfield",value:"&lt;",width:10},{xtype:"numberfield",width:106,name:"TotalNumberOfMachinesLessThan",minValue:0}]}]}]},{layout:"column",border:false,defaults:{layout:"form",columnWidth:0.5,border:false},items:[{items:[{xtype:"compositefield",fieldLabel:"Engineering Personnel",items:[{xtype:"displayfield",value:"&gt;",width:10},{xtype:"numberfield",width:106,name:"engineeringPersonnelGreatThan"},{xtype:"displayfield",value:"&lt;",width:10},{xtype:"numberfield",width:106,name:"engineeringPersonnelLessThan"}]}]},{items:[{xtype:"compositefield",fieldLabel:"Number of Shifts",items:[{xtype:"displayfield",value:"&gt;",width:10},k,{xtype:"displayfield",value:"&lt;",width:10},b]}]}]},{layout:"column",border:false,defaults:{layout:"form",columnWidth:0.5,border:false},items:[{items:[g]},{items:[f]}]},{xtype:"textarea",fieldLabel:"Business Description",anchor:"95%",height:25,name:"businessDescription"},{xtype:"textarea",fieldLabel:"Product Description",anchor:"95%",height:25,name:"productDescription"},{xtype:"textarea",fieldLabel:"More Info.",anchor:"95%",height:25,name:"moreInfo"},{layout:"column",border:false,defaults:{layout:"form",columnWidth:0.5,border:false},items:[{items:[{xtype:"fieldset",title:"Mills Machine",anchor:"90%",items:[new SP.form.DropdownList({store:Sp.data.BuiltInStores.radioGroup2Store,name:"indexer",displayField:"name",valueField:"id",fieldLabel:"Indexer",width:195,allowBlank:true}),new SP.form.DropdownList({store:Sp.data.BuiltInStores.radioGroup2Store,name:"palletChanger",displayField:"name",valueField:"id",fieldLabel:"Pallet Changer",width:195,allowBlank:true}),new SP.form.DropdownList({store:Sp.data.BuiltInStores.radioGroup2Store,name:"thruCoolant",displayField:"name",valueField:"id",fieldLabel:"Thru Coolant",width:195,allowBlank:true})]},{xtype:"fieldset",title:"Mills,Turn,Combo",anchor:"90%",items:[{xtype:"compositefield",fieldLabel:"Max RPM",items:[{xtype:"displayfield",value:"&gt;",width:10},{xtype:"numberfield",width:80,name:"maxRPMGreatThan"},{xtype:"displayfield",value:"&lt;",width:10},{xtype:"numberfield",width:80,name:"maxRPMLessThan"}]}]}]},{items:[{xtype:"fieldset",title:"Turn/Combo",anchor:"90%",items:[new SP.form.DropdownList({store:Sp.data.BuiltInStores.radioGroup2Store,name:"liveTooling",displayField:"name",valueField:"id",fieldLabel:"Live Tooling",width:195,allowBlank:true}),new SP.form.DropdownList({store:Sp.data.BuiltInStores.radioGroup2Store,name:"lowerTurret",displayField:"name",valueField:"id",fieldLabel:"Lower Turret",width:195,allowBlank:true}),new SP.form.DropdownList({store:Sp.data.BuiltInStores.radioGroup2Store,name:"subSpindle",displayField:"name",valueField:"id",fieldLabel:"Sub Spindle",width:195,allowBlank:true}),new SP.form.DropdownList({store:Sp.data.BuiltInStores.radioGroup2Store,name:"barFeeder",displayField:"name",valueField:"id",fieldLabel:"Bar Feeder",width:195,allowBlank:true}),{xtype:"compositefield",fieldLabel:"Max Turn Length",width:180,items:[{xtype:"displayfield",value:"&gt;",width:10},h,{xtype:"displayfield",value:"&lt;",width:10},a]},{xtype:"compositefield",fieldLabel:"Max Chuck Size",width:180,items:[{xtype:"displayfield",value:"&gt;",width:10},new SP.form.DropdownList({store:Sp.data.BuiltInStores.maxChuckSizeStore,name:"maxChuckSizeGreatThan",displayField:"id",valueField:"id",width:80,allowBlank:true}),{xtype:"displayfield",value:"&lt;",width:10},new SP.form.DropdownList({store:Sp.data.BuiltInStores.maxChuckSizeStore,name:"maxChuckSizeLessThan",displayField:"id",valueField:"id",width:80,allowBlank:true})]}]}]},{items:[{xtype:"fieldset",title:"EDM Machine",anchor:"90%",items:[{xtype:"compositefield",fieldLabel:"X Axis Travel",layout:"column",items:[{xtype:"displayfield",value:"&gt;",width:10},new SP.form.DropdownList({store:Sp.data.BuiltInStores.axisTravelStore,name:"xAxisTravelGreatThan",displayField:"id",valueField:"id",width:80,allowBlank:true}),{xtype:"displayfield",value:"&lt;",width:10},new SP.form.DropdownList({store:Sp.data.BuiltInStores.axisTravelStore,name:"xAxisTravelLessThan",displayField:"id",valueField:"id",width:80,allowBlank:true})]},{xtype:"compositefield",fieldLabel:"Y Axis Travel",items:[{xtype:"displayfield",value:"&gt;",width:10},new SP.form.DropdownList({store:Sp.data.BuiltInStores.axisTravelStore,name:"yAxisTravelGreatThan",displayField:"id",valueField:"id",width:80,allowBlank:true}),{xtype:"displayfield",value:"&lt;",width:10},new SP.form.DropdownList({store:Sp.data.BuiltInStores.axisTravelStore,name:"yAxisTravelLessThan",displayField:"id",valueField:"id",width:80,allowBlank:true})]},{xtype:"compositefield",fieldLabel:"Z Axis Travel",items:[{xtype:"displayfield",value:"&gt;",width:10},new SP.form.DropdownList({store:Sp.data.BuiltInStores.axisTravelStore,name:"zAxisTravelGreatThan",displayField:"id",valueField:"id",width:80,allowBlank:true}),{xtype:"displayfield",value:"&lt;",width:10},new SP.form.DropdownList({store:Sp.data.BuiltInStores.axisTravelStore,name:"zAxisTravelLessThan",displayField:"id",valueField:"id",width:80,allowBlank:true})]},{xtype:"compositefield",fieldLabel:"Square Inches/Hour",items:[{xtype:"displayfield",value:"&gt;",width:10},new SP.form.DropdownList({store:Sp.data.BuiltInStores.squareInchesHourStore,name:"squareInchesOrHourGreatThan",displayField:"id",valueField:"id",width:80,allowBlank:true}),{xtype:"displayfield",value:"&lt;",width:10},new SP.form.DropdownList({store:Sp.data.BuiltInStores.squareInchesHourStore,name:"squareInchesOrHourLessThan",displayField:"id",valueField:"id",width:80,allowBlank:true})]},new SP.form.DropdownList({store:Sp.data.BuiltInStores.radioGroup2Store,name:"toolChanger",displayField:"name",valueField:"id",fieldLabel:"Tool Changer",width:195,allowBlank:true}),{xtype:"compositefield",fieldLabel:"Max Load Capacity",items:[{xtype:"displayfield",value:"&gt;",width:10},new SP.form.DropdownList({store:Sp.data.BuiltInStores.maxLoadCapacityStore,name:"maxLoadCapacityGreatThan",displayField:"id",valueField:"id",width:80,allowBlank:true}),{xtype:"displayfield",value:"&lt;",width:10},new SP.form.DropdownList({store:Sp.data.BuiltInStores.maxLoadCapacityStore,name:"maxLoadCapacityLessThan",displayField:"id",valueField:"id",width:80,allowBlank:true})]}]}]},{items:[{xtype:"fieldset",title:"Organization",anchor:"90%",items:[e,c,j,new SP.form.DropdownList({store:Sp.data.BuiltInStores.inspectionSystemStore,name:"inspectionSystemId",displayField:"title",valueField:"inspectionSystemId",fieldLabel:"Inspection System",allowBlank:true,width:195}),new SP.form.DropdownList({store:Sp.data.BuiltInStores.radioGroup2Store,name:"isoCertification",displayField:"name",valueField:"id",fieldLabel:"ISO Certification",width:195,allowBlank:true}),new SP.form.DropdownList({store:Sp.data.BuiltInStores.radioGroup2Store,name:"aerospaceCertifications",displayField:"name",valueField:"id",fieldLabel:"Aerospace Certifications",width:195,allowBlank:true})]}]}]},{xtype:"checkboxgroup",vertical:false,hideLabel:true,labelWidth:0,columns:4,items:[{boxLabel:"Small Business",name:"sedStatusSmallBusiness"},{boxLabel:"Small Disadvantage",name:"sedStatusSmallDisadvantage"},{boxLabel:"SBA (8)a",name:"sedStatusSBA8a"},{boxLabel:"Service Disabled Veteran",name:"sedStatusDisabledVeteran"},{boxLabel:"Veteran-Owned",name:"sedStatusVeteranOwned"},{boxLabel:"Native American Owned",name:"sedStatusIndianOwned"},{boxLabel:"Woman-Owned",name:"sedStatusWomanOwned"},{boxLabel:"HUBZone",name:"sedStatusHubZone"}]}];
this.advancedQueryBuilderForm=new WebLight.form.FormPanel({header:false,border:false,hidden:true,frame:false,labelWidth:120,defaults:{labelWidth:120},items:d});
},createOrganizationGrid:function(){this.organizationGrid=new WebLight.grid.GridPanel({autoHeight:true,enableHdMenu:false,style:"margin-top:5px",pageSize:20,title:"Companies",header:false,cm:new Ext.grid.ColumnModel({defaults:{sortable:true},columns:[{dataIndex:"sequenceId",header:"Company ID"},{dataIndex:"organizationName",header:"Company Name",width:230},{dataIndex:"phone",header:"Telephone",width:100},{dataIndex:"state",header:"State",width:50},{dataIndex:"machineCount",header:"Nbr. Mach.",width:80},{dataIndex:"matchedMachineCount",header:"Matched Mach.",width:100},{dataIndex:"enterDate",header:"Entered Date",renderer:Ext.util.Format.dateRenderer("M d, Y"),width:120},{header:"Action",align:"center",xtype:"templatecolumn",sortable:false,width:60,tpl:new Ext.XTemplate('<a href="javascript:void(0);" xcmd="view">View</a>')}]})});
this.organizationGrid.on("xcellclick",function(e,b,c,d,a){switch(b){case"profile":WebLight.Router.route(String.format("profile/{0}",c.get("organizationId")));
break;case"cnccapability":WebLight.Router.route(String.format("cnccapability/{0}",c.get("organizationId")));
break;case"view":WebLight.Router.route(String.format("/Organizations/{0}",c.get("organizationId")));break;
case"delete":Ext.Msg.confirm("Confirm","Are you sure want to delete this record？",function(f){if(f=="yes"){e.store.remove(c);
e.store.submitChanges(function(){e.store.reload();},function(){alert("Failed");});}});break;}},this);
},createQueryBar:function(){var a=this;this._buttonQueryBar=new SP.controls.ButtonBar({width:530,border:false,style:"margin-top:10px;",listeners:{ButtonQuery:function(c){var d=a.basicQueryBuilderForm.getFieldValues();
var b=a.advancedQueryBuilderForm.getFieldValues();Ext.apply(d,b);if(c=="ALL"){a.organizationStore.queryable.where().property(d).orderBy("organizationName").load();
}else{a.organizationStore.queryable.where("organizationName^=@0",c).property(d).orderBy("organizationName").load();
}}}});},createChildControls:function(){var b=this;this.organizationStore=new SP.object.Organization2Store();
this._mepNameStore=new SP.object.MepStore();this._mepProjectManagerStore=new SP.object.MepUserStore();
this._machineMakeStore=new SP.object.MachineMakeStore();this._machineMakeStore.queryable.orderBy("title");
this._machineModelStore=new SP.object.MachineModelStore();this._machineModelStore.queryable.orderBy("title");
this._controllerMakeStore=new SP.object.ControllerMakeStore();this._controllerMakeStore.queryable.orderBy("title");
this._controllerModelStore=new SP.object.ControllerModelStore();this._controllerModelStore.queryable.orderBy("title");
this._machineMakeCodeStore=new SP.object.MachineMakeStore();this._machineMakeCodeStore.queryable.orderBy("friendlyId");
this._machineModelCodeStore=new SP.object.MachineModelStore();this._machineModelCodeStore.queryable.orderBy("friendlyId");
this._controllerMakeCodeStore=new SP.object.ControllerMakeStore();this._controllerMakeCodeStore.queryable.orderBy("friendlyId");
this._controllerModelCodeStore=new SP.object.ControllerModelStore();this._controllerModelCodeStore.queryable.orderBy("friendlyId");
this._cadSoftwareStore=new SP.object.CadStore();this._camSoftwareStore=new SP.object.CamStore();this._naicsStore=new SP.object.NaicCodeStore();
this.createQueryBar();this.generateComboBoxes();this.generateBasicQueryBuilderForm();this.genarateAdvancedQueryBuilderForm();
this.createOrganizationGrid();this.organizationGrid.bindStore(this.organizationStore);this.addChildControl(Ext.create({xtype:"box",html:'<h1 class="page-title">Query Builder</h1>'}),"page-title");
var c=new Ext.Button({text:"Search Now",handler:function(){var g=b.basicQueryBuilderForm.getFieldValues();
var f=b.advancedQueryBuilderForm.getFieldValues();Ext.apply(g,f);b.organizationStore.queryable.where().property(g).orderBy("organizationName").load();
b._buttonQueryBar.selectAll();}});var e=new Ext.Button({style:"margin:0 0 0 10px",text:"Clear Search",handler:function(){b.basicQueryBuilderForm.reset();
b.advancedQueryBuilderForm.reset();b.organizationStore.removeAll();b.organizationStore.clearFilter();
b.organizationStore.queryable.where("organizationId=00000000-0000-0000-0000-000000000000").load();b._buttonQueryBar.removeALL();
}});var d=new Ext.Button({style:"margin:0 0 0 10px",text:"Export to Excel",handler:function(){b.organizationGrid.exportToExcel();
}});var a=new Ext.form.Checkbox({boxLabel:"Advanced Query Builder",style:"margin:0 0 0 10px",listeners:{check:function(f,g){if(g){b.advancedQueryBuilderForm.show();
b.advancedQueryBuilderForm.doLayout();b.advancedQueryBuilderForm.doLayout();}else{b.advancedQueryBuilderForm.hide();
}}}});this.hideShowButton=a;this.addChildControl(this.basicQueryBuilderForm,"basic-query-builder");this.addChildControl(this.advancedQueryBuilderForm,"advanced-query-builder");
this.addChildControl(Ext.create({xtype:"panel",border:false,header:false,frame:false,layout:"column",style:"margin-top:10px",items:[c,e,d,a]}),"search-button");
this.addChildControl(this._buttonQueryBar,"organization-grid");this.addChildControl(this.organizationGrid,"organization-grid");
SP.page.QueryBuilderPage.superclass.createChildControls.call(this);},dataBind:function(){this._cadSoftwareStore.queryable.orderBy("title").load();
this._camSoftwareStore.queryable.orderBy("title").load();this._mepNameStore.load();this._naicsStore.load();
this.organizationStore.queryable.where("organizationId=00000000-0000-0000-0000-000000000000").load();
SP.page.QueryBuilderPage.superclass.dataBind.call(this);}});WebLight.PageMgr.registerType("querybuilder",SP.page.QueryBuilderPage);
WebLight.namespace("SP","SP.page");SP.page.StatisticsInformationPage=WebLight.extend(WebLight.Page,{title:"Statistics Information",html:_builtInTemplate_b84c3e97[6],_panel:null,createChildControls:function(){this.addChildControl(Ext.create({xtype:"box",html:'<h2 class="page-title">Statistics Information</h2>'}),"container");
SP.page.StatisticsInformationPage.superclass.createChildControls.call(this);this._panel=new Ext.Panel({header:false,border:false,frame:false});
this.addChildControl(this._panel,"container");},render:function(c){var b=this;SP.page.StatisticsInformationPage.superclass.render.call(this,c);
var a=new SP.object.Statistics();a.getStatistics(function(d){var e=new Ext.XTemplate(_builtInTemplate_b84c3e97[8]);
e.overwrite(b._panel.body,d);});}});WebLight.PageMgr.registerType("statisticsinformation",SP.page.StatisticsInformationPage);
WebLight.namespace("SP","SP.page");SP.page.ResultTypePage=WebLight.extend(WebLight.Page,{title:"Result Type",html:_builtInTemplate_b84c3e97[6],_stateResultStore:null,_searchResultGrid:null,getMachineGrid:function(f,d){var a=this;
var b=new Ext.data.JsonStore({fields:[{name:"name"},{name:"date"},{name:"machineMakeTitle"},{name:"machineModelTitle"},{name:"controllerMakeTitle"},{name:"controllerModelTitle"}],data:f});
var c=new Sm.grid.RowExpander({alwaysAsLeaf:true,actAsTree:true});var e=new Ext.grid.GridPanel({autoHeight:true,enableHdMenu:false,viewConfig:{forceFit:true},store:b,cm:new Ext.grid.ColumnModel({defaults:{sortable:false},columns:[c,{dataIndex:"name",header:"Name",renderer:function(g){if(g=="T"){return"Turning";
}else{if(g=="E"){return"EDM";}else{if(g=="C"){return"Combo";}else{if(g=="M"){return"Milling";}}}}return g;
}},{dataIndex:"date",header:"Date",renderer:Ext.util.Format.dateRenderer("M d, Y")},{dataIndex:"machineMakeTitle",header:"Machine Make"},{dataIndex:"machineModelTitle",header:"Machine Model"},{dataIndex:"controllerMakeTitle",header:"Controller Make"},{dataIndex:"controllerModelTitle",header:"Controller Model"}]}),plugins:[c]});
d&&e.render(d);return e;},getOrganizationGrid:function(f,d){var a=this;var b=new Ext.data.JsonStore({fields:[{name:"name"},{name:"address"},{name:"address1"},{name:"city"},{name:"state"},{name:"zipCode"},{name:"machineCount"},{name:"noMeasure"},{name:"machines",type:"object"}],data:f});
var c=new Sm.grid.RowExpander({tpl:'<div class="ux-row-expander-box"></div>',actAsTree:true,treeLeafProperty:"noMeasure",listeners:{expand:function(j,h,g,k){var l=h.get("machines");
if(l){a.getMachineGrid(l,Ext.get(this.grid.getView().getRow(k)).child(".ux-row-expander-box"));}}}});
var e=new Ext.grid.GridPanel({autoHeight:true,enableHdMenu:false,viewConfig:{forceFit:true},store:b,cm:new Ext.grid.ColumnModel({defaults:{sortable:false},columns:[c,{dataIndex:"name",header:"Name",width:200},{dataIndex:"address",header:"Address",width:150},{dataIndex:"city",header:"City",width:60},{dataIndex:"state",header:"State",width:40},{dataIndex:"zipCode",header:"Zip Code",width:40},{dataIndex:"machineCount",header:"Machine Count",width:80}]}),plugins:[c]});
d&&e.render(d);return e;},createMepSearchResultGrid:function(){var a=this;var b=new Sm.grid.RowExpander({tpl:'<div class="ux-row-expander-box"></div>',actAsTree:true,treeLeafProperty:"noMeasure",listeners:{expand:function(f,e,c,g){var d=e.get("organizations");
if(d){a.getOrganizationGrid(d,Ext.get(this.grid.getView().getRow(g)).child(".ux-row-expander-box"));}}}});
this._searchResultGrid=new WebLight.grid.GridPanel({tbar:[{text:"Export to Excel",iconCls:"icon-16x16-excel",handler:function(){window.open(String.format("ExportToExcel.aspx?apiKey=resulttype&type={0}",a.type));
}}],autoHeight:true,enableHdMenu:false,style:"margin-top:20px;",viewConfig:{forceFit:true},style:{margin:"10px 0 0"},store:this._stateResultStore,cm:new Ext.grid.ColumnModel({defaults:{sortable:false},columns:[b,{dataIndex:"state",header:"State"},{dataIndex:"companyCount",header:"Company Count"},{dataIndex:"machineCount",header:"Machine Count"}]}),plugins:[b]});
},createChildControls:function(){var a=this;this._stateResultStore=new SP.object.NewSearchReportExtStore();
this.createMepSearchResultGrid();var b;switch(a.type){case"companies":b="Results Type - Companies";break;
case"machineshops":b="Results Type - Machine Shops";break;case"T":b="Results Type - Turn";break;case"M":b="Results Type - Mill";
break;case"C":b="Results Type - Combo";break;case"E":b="Results Type - EDM";break;}this.addChildControl(Ext.create({xtype:"box",html:'<h2 class="page-title">'+b+"</h2>"}),"container");
this.addChildControl(this._searchResultGrid,"container");SP.page.ResultTypePage.superclass.createChildControls.call(this);
},dataBind:function(){var a=this;a._searchResultGrid.getEl().mask("loading...");switch(a.type){case"companies":case"machineshops":SP.object.CompanyStatistic.search(a.type,function(b){a._stateResultStore.loadData({data:b});
a._searchResultGrid.getEl().unmask();});break;case"T":case"M":case"C":case"E":SP.object.NewSearchReportExt.search(a.type,null,null,null,function(b){a._stateResultStore.loadData({data:b});
a._searchResultGrid.getEl().unmask();});break;}SP.page.ResultTypePage.superclass.dataBind.call(this);
}});WebLight.PageMgr.registerType("resulttype",SP.page.ResultTypePage);WebLight.namespace("SP","SP.page");
SP.page.MachineTypeSearchPage=WebLight.extend(WebLight.Page,{title:"Machine Type Search",html:_builtInTemplate_b84c3e97[6],_stateResultStore:null,_filterForm:null,_searchResultGrid:null,createFilterForm:function(){var a=this;
var b=new SP.form.DropdownList({store:Sp.data.BuiltInStores.machineTypeStore,fieldLabel:"Machine Type",displayField:"machineTypeName",valueField:"machineTypeId",width:180,allowBlank:true});
var f=new SP.form.DropdownList({store:Sp.data.BuiltInStores.noOfAxesStore,fieldLabel:"Number of Axes",displayField:"id",name:"noOfAxes",width:50,valueField:"id",allowBlank:true});
var c=new Ext.Button({text:"Search",width:70,style:"margin-left:40px;",handler:function(){var h;if(f.getValue()==""){h=null;
}else{h=f.getValue();}this.getEl().mask("loading...");var j=this._filterForm.getFieldValue("startDate");
var g=this._filterForm.getFieldValue("endDate");if(j==""){j=null;}if(g==""){g=null;}SP.object.NewSearchReportExt.search(b.getValue(),j,g,h,function(k){a._stateResultStore.loadData({data:k});
a.getEl().unmask();});},scope:this});var d=new Ext.Button({text:"Clear Search",style:"margin-left:10px;",scope:this,width:50,handler:function(){a._filterForm.reset();
a._stateResultStore.removeAll();}});var e=new Ext.Button({text:"Export to Excel",style:"margin-left:10px;",scope:this,handler:function(){var h=this._filterForm.getFieldValue("startDate");
if(!h){h="";}else{h=h.format("Y-m-d");}var g=this._filterForm.getFieldValue("endDate");if(!g){g="";}else{g=g.format("Y-m-d");
}window.open(String.format("ExportToExcel.aspx?apiKey=machinetypesearch&machineTypeId={0}&axes={1}&startDate={2}&endDate={3}",b.getValue(),f.getValue(),h,g));
}});this._filterForm=new WebLight.form.FormPanel({border:false,header:false,frame:true,labelWidth:100,labelAlign:"right",items:[{layout:"column",defaults:{layout:"form"},items:[{labelWidth:80,items:[b]},{items:[f]},{labelWidth:65,items:[{xtype:"datefield",width:92,editable:false,name:"startDate",fieldLabel:"Start Date"}]},{labelWidth:60,items:[{xtype:"datefield",width:92,editable:false,name:"endDate",fieldLabel:"End Date"}]}]}],buttons:[c,d,e]});
},getMachineGrid:function(f,d){var a=this;var b=new Ext.data.JsonStore({fields:[{name:"name"},{name:"date"},{name:"machineMakeTitle"},{name:"machineModelTitle"},{name:"controllerMakeTitle"},{name:"controllerModelTitle"}],data:f});
var c=new Sm.grid.RowExpander({alwaysAsLeaf:true,actAsTree:true});var e=new Ext.grid.GridPanel({autoHeight:true,enableHdMenu:false,viewConfig:{forceFit:true},store:b,cm:new Ext.grid.ColumnModel({defaults:{sortable:false},columns:[c,{dataIndex:"name",header:"Name",renderer:function(g){if(g=="T"){return"Turning";
}else{if(g=="E"){return"EDM";}else{if(g=="C"){return"Combo";}else{if(g=="M"){return"Milling";}}}}return g;
}},{dataIndex:"date",header:"Date",renderer:Ext.util.Format.dateRenderer("M d, Y")},{dataIndex:"machineMakeTitle",header:"Machine Make"},{dataIndex:"machineModelTitle",header:"Machine Model"},{dataIndex:"controllerMakeTitle",header:"Controller Make"},{dataIndex:"controllerModelTitle",header:"Controller Model"}]}),plugins:[c]});
d&&e.render(d);return e;},getOrganizationGrid:function(f,d){var a=this;var b=new Ext.data.JsonStore({fields:[{name:"name"},{name:"address"},{name:"address1"},{name:"city"},{name:"state"},{name:"zipCode"},{name:"machineCount"},{name:"machines",type:"object"}],data:f});
var c=new Sm.grid.RowExpander({tpl:'<div class="ux-row-expander-box"></div>',actAsTree:true,treeLeafProperty:"noMeasure",listeners:{expand:function(j,h,g,k){var l=h.get("machines");
if(l){a.getMachineGrid(l,Ext.get(this.grid.getView().getRow(k)).child(".ux-row-expander-box"));}}}});
var e=new Ext.grid.GridPanel({autoHeight:true,enableHdMenu:false,viewConfig:{forceFit:true},store:b,cm:new Ext.grid.ColumnModel({defaults:{sortable:false},columns:[c,{dataIndex:"name",header:"Name",width:200},{dataIndex:"address",header:"Address",width:150},{dataIndex:"city",header:"City",width:60},{dataIndex:"state",header:"State",width:40},{dataIndex:"zipCode",header:"Zip Code",width:40},{dataIndex:"machineCount",header:"Machine Count",width:80}]}),plugins:[c]});
d&&e.render(d);return e;},createMepSearchResultGrid:function(){var a=this;var b=new Sm.grid.RowExpander({tpl:'<div class="ux-row-expander-box"></div>',actAsTree:true,treeLeafProperty:"noMeasure",listeners:{expand:function(f,e,c,g){var d=e.get("organizations");
if(d){a.getOrganizationGrid(d,Ext.get(this.grid.getView().getRow(g)).child(".ux-row-expander-box"));}}}});
this._searchResultGrid=new WebLight.grid.GridPanel({autoHeight:true,enableHdMenu:false,viewConfig:{forceFit:true},style:{margin:"10px 0 0"},store:this._stateResultStore,cm:new Ext.grid.ColumnModel({defaults:{sortable:false},columns:[b,{dataIndex:"state",header:"State"},{dataIndex:"companyCount",header:"Company Count"},{dataIndex:"machineCount",header:"Machine Count"}]}),plugins:[b]});
},createChildControls:function(){var a=this;this.createFilterForm();this._stateResultStore=new SP.object.NewSearchReportExtStore();
this.createMepSearchResultGrid();this.addChildControl(Ext.create({xtype:"box",html:'<h2 class="page-title">Machine Type Search</h2>'}),"container");
this.addChildControl(this._filterForm,"container");this.addChildControl(this._searchResultGrid,"container");
SP.page.NewMechinesAddedPage.superclass.createChildControls.call(this);},dataBind:function(){SP.page.MachineTypeSearchPage.superclass.dataBind.call(this);
}});WebLight.PageMgr.registerType("machinetypesearch",SP.page.MachineTypeSearchPage);WebLight.namespace("SP","SP.page");
SP.page.CompanyProfilePage=WebLight.extend(WebLight.Page,{title:"Company Profile",html:_builtInTemplate_b84c3e97[5],_orgaiztionStore:null,_panel:null,createChildControls:function(){this._orgaiztionStore=new SP.object.Organization3Store();
SP.page.CompanyProfilePage.superclass.createChildControls.call(this);this._panel=new Ext.Panel({header:false,border:false,frame:false});
this.addChildControl(this._panel,"container");},dataBind:function(){this._orgaiztionStore.queryable.where("organizationId==@0",this.organizationId).load();
SP.page.CompanyProfilePage.superclass.dataBind.call(this);},render:function(b){var a=this;SP.page.CompanyProfilePage.superclass.render.call(this,b);
var c=new Ext.XTemplate(_builtInTemplate_b84c3e97[9]);a._orgaiztionStore.on("load",function(){c.overwrite(a._panel.body,a._orgaiztionStore.getAt(0).data);
var d=new Ext.Button({text:"Return",width:"80",hight:"40",style:"font-size:16px;margin-bottom:10px",handler:function(){WebLight.Router.route("/Organizations/organizations");
},renderTo:"returnButton"});});}});WebLight.PageMgr.registerType("companyprofile",SP.page.CompanyProfilePage);
WebLight.namespace("SP","SP.page");SP.page.CncCapabilityPage=WebLight.extend(WebLight.Page,{title:"CNC Capability",html:_builtInTemplate_b84c3e97[5],organizationId:"",_millingGrid:null,_turningGrid:null,_comboGrid:null,_edmGrid:null,_millingStore:null,_turningStore:null,_comboStore:null,_edmStore:null,_organizationStore:null,createMillingGrid:function(){this._millingGrid=new WebLight.grid.GridPanel({height:300,enableHdMenu:false,width:820,autoScroll:true,style:{margin:"10px 0 0"},cm:new Ext.grid.ColumnModel({defaults:{sortable:false},columns:[{dataIndex:"sequenceId",header:"Mach. #",width:70},{header:"Mach.<br/>Type",renderer:function(a){return"M";
},width:50},{dataIndex:"machineMakeFriendlyTitle",header:"Machine<br/>Make",width:150},{dataIndex:"machineModelFriendlyTitle",header:"Machine<br/>Model",width:150},{dataIndex:"controllerMakeFriendlyTitle",header:"Controller<br/>Make",width:150},{dataIndex:"controllerModelFriendlyTitle",header:"Controller<br/>Model",width:150},{dataIndex:"typeOfMachine",header:"Type<br/>&nbsp;",width:50,renderer:function(a){switch(a){case 1:return"Vert.";
case 2:return"Horiz.";}}},{dataIndex:"noOfAxes",header:"No Of <br/>Axes",width:50},{dataIndex:"indexer",header:"Indexer<br/>&nbsp;",width:50,renderer:function(a){if(a!=null){return a?"Y":"N";
}}},{dataIndex:"palletChanger",header:"Pallet<br/>Changer",width:55,renderer:function(a){if(a!=null){return a?"Y":"N";
}}},{dataIndex:"thruCoolant",header:"Thru<br/>Coolant",width:50,renderer:function(a){if(a!=null){return a?"Y":"N";
}}},{dataIndex:"maxRPM",header:"Max <br/>&nbsp;RPM",width:50}]})});},createTurningGrid:function(){this._turningGrid=new WebLight.grid.GridPanel({height:300,enableHdMenu:false,autoScroll:true,style:{margin:"10px 0 0"},cm:new Ext.grid.ColumnModel({defaults:{sortable:false},columns:[{dataIndex:"sequenceId",header:"Mach. #",width:70},{header:"Mach.<br /> Type",renderer:function(a){return"T";
},width:50},{dataIndex:"machineMakeFriendlyTitle",header:"Machine<br/>Make",width:150},{dataIndex:"machineModelFriendlyTitle",header:"Machine<br/>Model",width:150},{dataIndex:"controllerMakeFriendlyTitle",header:"Controller<br/>Make",width:150},{dataIndex:"controllerModelFriendlyTitle",header:"Controller<br/>Model",width:150},{dataIndex:"typeOfMachine",header:"Type<br/>&nbsp;",width:50,renderer:function(a){switch(a){case 1:return"Vert.";
case 2:return"Horiz.";}}},{header:"Live <br />Tooling",width:50,dataIndex:"liveTooling",renderer:function(a){if(a!=null){return a?"Y":"N";
}}},{header:"Lower <br />Turret",width:50,dataIndex:"lowerTurret",renderer:function(a){if(a!=null){return a?"Y":"N";
}}},{header:"# Of <br />Axes",width:40,dataIndex:"noOfAxes"},{header:"Sub <br />Spindle",width:50,dataIndex:"subSpindle",renderer:function(a){if(a!=null){return a?"Y":"N";
}}},{header:"Bar <br />Feeder",width:50,dataIndex:"barFeeder",renderer:function(a){if(a!=null){return a?"Y":"N";
}}},{header:"Max Turn <br />Length",dataIndex:"maxTurnLength",width:60},{header:"Max <br />RPM",width:35,dataIndex:"maxRPM"},{header:"Max Chuck <br />Size",dataIndex:"maxChuckSize",width:55}]})});
},createComboGrid:function(){this._comboGrid=new WebLight.grid.GridPanel({height:300,enableHdMenu:false,autoScroll:true,style:{margin:"10px 0 0"},cm:new Ext.grid.ColumnModel({defaults:{sortable:false},columns:[{dataIndex:"sequenceId",header:"Mach. #",width:70},{header:"Mach.<br /> Type",renderer:function(a){return"C";
},width:50},{dataIndex:"machineMakeFriendlyTitle",header:"Machine<br/>Make",width:150},{dataIndex:"machineModelFriendlyTitle",header:"Machine<br/>Model",width:150},{dataIndex:"controllerMakeFriendlyTitle",header:"Controller<br/>Make",width:150},{dataIndex:"controllerModelFriendlyTitle",header:"Controller<br/>Model",width:150},{header:"Live <br />Tooling",width:50,dataIndex:"liveTooling",renderer:function(a){if(a!=null){return a?"Y":"N";
}}},{header:"Lower <br />Turret",width:50,dataIndex:"lowerTurret",renderer:function(a){if(a!=null){return a?"Y":"N";
}}},{header:"# Of <br />Axes",width:40,dataIndex:"noOfAxes"},{header:"Sub <br />Spindle",width:50,dataIndex:"subSpindle",renderer:function(a){if(a!=null){return a?"Y":"N";
}}},{header:"Bar <br />Feeder",width:50,dataIndex:"barFeeder",renderer:function(a){if(a!=null){return a?"Y":"N";
}}},{header:"Max Turn <br />Length",dataIndex:"maxTurnLength",width:60},{header:"Max <br />RPM",width:35,dataIndex:"maxRPM"},{header:"Max Chuck <br />Size",dataIndex:"maxChuckSize",width:50}]})});
},createEDMGrid:function(){this._edmGrid=new WebLight.grid.GridPanel({height:300,enableHdMenu:false,autoScroll:true,style:{margin:"10px 0 0"},cm:new Ext.grid.ColumnModel({defaults:{sortable:false},columns:[{dataIndex:"sequenceId",header:"Mach. #",width:70},{header:"Mach.<br /> Type",renderer:function(a){return"E";
},width:50},{dataIndex:"machineMakeFriendlyTitle",header:"Machine<br/>Make",width:150},{dataIndex:"machineModelFriendlyTitle",header:"Machine<br/>Model",width:150},{dataIndex:"controllerMakeFriendlyTitle",header:"Controller<br/>Make",width:150},{dataIndex:"controllerModelFriendlyTitle",header:"Controller<br/>Model",width:150},{dataIndex:"ramWire",header:"Ram<br/> &nbsp;/Wire",width:50,renderer:function(a){if(a!=null){return a?"Y":"N";
}}},{dataIndex:"travelX",header:"Trvl X<br/>&nbsp;",width:50},{dataIndex:"travelY",header:"Trvl Y<br/>&nbsp;",width:50},{dataIndex:"travelZ",header:"Trvl Z<br/>&nbsp;",width:50},{dataIndex:"sqInXHour",header:"SqIn <br/> &nbsp;/ Hou",width:50},{dataIndex:"toolChanger",header:"Tool<br/>  Changer",width:55,renderer:function(a){if(a!=null){return a?"Y":"N";
}}},{dataIndex:"maxCapacity",header:"Max<br/> Cap.",width:50}]})});},createChildControls:function(){this._organizationStore=new SP.object.OrganizationStore();
this._millingStore=new SP.object.CncMillingStore();this._turningStore=new SP.object.CncTurningStore();
this._comboStore=new SP.object.CncComboStore();this._edmStore=new SP.object.CncEDMStore();this.createMillingGrid();
this.createTurningGrid();this.createComboGrid();this.createEDMGrid();this._millingGrid.bindStore(this._millingStore);
this._turningGrid.bindStore(this._turningStore);this._comboGrid.bindStore(this._comboStore);this._edmGrid.bindStore(this._edmStore);
this.addChildControl(Ext.create({xtype:"box",html:_builtInTemplate_b84c3e97[10]}),"container");SP.page.CncCapabilityPage.superclass.createChildControls.call(this);
},dataBind:function(){this._organizationStore.queryable.where("organizationId=@0",this.organizationId).load();
this._millingStore.queryable.property({organizationId:this.organizationId}).load();this._turningStore.queryable.property({organizationId:this.organizationId}).load();
this._comboStore.queryable.property({organizationId:this.organizationId}).load();this._edmStore.queryable.property({organizationId:this.organizationId}).load();
SP.page.CncCapabilityPage.superclass.dataBind.call(this);},render:function(a){SP.page.CncCapabilityPage.superclass.render.call(this,a);
this._organizationStore.on("load",function(c,d,f){var e=new Ext.Panel({header:false,border:false,frame:false,renderTo:"companyInfo"});
var g=new Ext.XTemplate('<table width="100%" class="ux-report-table">            <tbody><tr>                <td style="width:120px"><span style="font-weight:bold">SupplyPoint ID</span></td>                <td>{companyId}</td>            </tr><tr>                <td><span style="font-weight:bold">Company Name</span></td>                <td>{organizationName}</td>            </tr></tbody></table>');
if(d.length>0){g.overwrite(e.body,d[0].data);}});var b=new Ext.Button({text:"Return",width:"80",hight:"40",style:"font-size:16px",handler:function(){WebLight.Router.route("/Organizations/organizations");
},renderTo:"returnButton"});this._millingGrid.render("millMachineContainer");this._turningGrid.render("turnMachineContainer");
this._comboGrid.render("comboMachineContainer");this._edmGrid.render("edmMachineContainer");}});WebLight.PageMgr.registerType("cnccapability",SP.page.CncCapabilityPage);
/*
* Ext JS Library 3.0.0
* Copyright(c) 2006-2009 Ext JS, LLC
* licensing@extjs.com
* http://www.extjs.com/license
* 
* Modifications by Mykhail Stadnik <http://mikhailstadnik.com>:
*  - Nesting grids support added
*/
Ext.ns("Sm.grid");
Sm.grid.RowExpander=Ext.extend(Ext.util.Observable,{expandOnEnter:true,expandOnDblClick:true,header:"",width:20,sortable:false,fixed:true,menuDisabled:true,dataIndex:"",id:"expander",lazyRender:true,enableCaching:true,actAsTree:false,treeLeafProperty:"is_leaf",appendRowClass:true,alwaysAsLeaf:false,constructor:function(b){if(!b.id){b.id=Ext.id();
}Ext.apply(this,b);var a=".x-"+this.id+"-grid3-row-collapsed .x-grid3-row-expander { background-position:0 0; }.x-"+this.id+"-grid3-row-expanded .x-grid3-row-expander { background-position:-25px 0; }.x-"+this.id+"-grid3-row-collapsed .x-grid3-row-body { display:none !important; }.x-"+this.id+"-grid3-row-expanded .x-grid3-row-body { display:block !important; }.x-grid-expander-leaf .x-grid3-row-expander { background: none; }";
Ext.util.CSS.createStyleSheet(a,Ext.id());this.expanderClass="x-grid3-row-expander";this.rowExpandedClass="x-"+this.id+"-grid3-row-expanded";
this.rowCollapsedClass="x-"+this.id+"-grid3-row-collapsed";this.leafClass="x-grid-expander-leaf";this.addEvents({beforeexpand:true,expand:true,beforecollapse:true,collapse:true});
Sm.grid.RowExpander.superclass.constructor.call(this);if(this.tpl){if(typeof this.tpl=="string"){this.tpl=new Ext.Template(this.tpl);
}this.tpl.compile();}this.state={};this.bodyContent={};},getRowClass:function(b,f,c,d){c.cols=c.cols-1;
var a=this.bodyContent[b.id];if(!a&&!this.lazyRender){a=this.getBodyContent(b,f);}if(a){c.body=a;}var e=this.state[b.id]?this.rowExpandedClass:this.rowCollapsedClass;
if(this.alwaysAsLeaf||this.actAsTree&&b.get(this.treeLeafProperty)){e=this.leafClass;}return e;},init:function(a){this.grid=a;
var b=a.getView();b.getRowClass=this.getRowClass.createDelegate(this);b.enableRowBody=true;a.on("render",this.onRender,this);
a.on("destroy",this.onDestroy,this);b.on("beforerefresh",this.onBeforeRefresh,this);b.on("refresh",this.onRefresh,this);
},onRender:function(){var a=this.grid;var b=a.getView().mainBody;b&&b.on("mousedown",this.onMouseDown,this,{delegate:"."+this.expanderClass});
if(this.expandOnEnter){this.keyNav=new Ext.KeyNav(this.grid.getGridEl(),{enter:this.onEnter,scope:this});
}if(this.expandOnDblClick){a.on("rowdblclick",this.onRowDblClick,this);}if(this.actAsTree){a.getEl().swallowEvent(["mouseover","mouseout","mousedown","click","dblclick"]);
}},onBeforeRefresh:function(){var a=this.grid.getEl().select("."+this.rowExpandedClass);a.each(function(b){this.collapseRow(b.dom);
},this);},onRefresh:function(){var a=this.grid.getEl().select("."+this.rowExpandedClass);a.each(function(b){Ext.fly(b).replaceClass(this.rowExpandedClass,this.rowCollapsedClass);
},this);},onDestroy:function(){this.keyNav.disable();delete this.keyNav;var a=this.grid.getView().mainBody;
a&&a.un("mousedown",this.onMouseDown,this);},onRowDblClick:function(a,b,c){this.toggleRow(b);},onEnter:function(h){var j=this.grid;
var c=j.getSelectionModel();var b=c.getSelections();for(var f=0,a=b.length;f<a;f++){var d=j.getStore().indexOf(b[f]);
this.toggleRow(d);}},getBodyContent:function(b,c){if(!this.enableCaching){return this.tpl.apply(b.data);
}var a=this.bodyContent[b.id];if(!a){a=this.tpl.apply(b.data);this.bodyContent[b.id]=a;}return a;},onMouseDown:function(c,a){c.stopEvent();
var b=c.getTarget(".x-grid3-row");this.toggleRow(b);},renderer:function(b,c,a){c.cellAttr='rowspan="2"';
return'<div class="'+this.expanderClass+'">&#160;</div>';},beforeExpand:function(b,a,c){if(this.fireEvent("beforeexpand",this,b,a,c)!==false){if(this.tpl&&this.lazyRender){a.innerHTML=this.getBodyContent(b,c);
}return true;}else{return false;}},toggleRow:function(a){if(typeof a=="number"){a=this.grid.view.getRow(a);
}if(Ext.fly(a).hasClass(this.leafClass)){return;}this[Ext.fly(a).hasClass(this.rowCollapsedClass)?"expandRow":"collapseRow"](a);
},expandRow:function(c){if(typeof c=="number"){c=this.grid.view.getRow(c);}if(Ext.fly(c).hasClass(this.leafClass)){return;
}var b=this.grid.store.getAt(c.rowIndex);var a=Ext.DomQuery.selectNode("tr:nth(2) div.x-grid3-row-body",c);
if(this.beforeExpand(b,a,c.rowIndex)){this.state[b.id]=true;Ext.fly(c).replaceClass(this.rowCollapsedClass,this.rowExpandedClass);
this.fireEvent("expand",this,b,a,c.rowIndex);}},destroyNestedGrids:function(c){if(c){if(childGridEl=c.child(".x-grid-panel")){this.destroyNestedGrids(childGridEl);
}var a=Ext.getCmp(c.id);if(a&&(a!=this.grid)){if(a instanceof Ext.grid.EditorGridPanel){var g=a.getColumnModel();
for(var e=0,f=g.getColumnCount();e<f;e++){for(var b=0,d=a.getStore().getCount();b<d;b++){if(editor=g.getCellEditor(e,b)){editor.destroy();
}}}g.destroy();}a.destroy();}}},collapseRow:function(c){if(typeof c=="number"){c=this.grid.view.getRow(c);
}if(Ext.fly(c).hasClass(this.leafClass)){return;}var b=this.grid.store.getAt(c.rowIndex);var a=Ext.fly(c).child("tr:nth(1) div.x-grid3-row-body",true);
if(this.fireEvent("beforecollapse",this,b,a,c.rowIndex)!==false){this.destroyNestedGrids(Ext.get(c).child(".x-grid-panel"));
if(b){this.state[b.id]=false;}Ext.fly(c).replaceClass(this.rowExpandedClass,this.rowCollapsedClass);this.fireEvent("collapse",this,b,a,c.rowIndex);
}}});Ext.preg("rowexpander",Sm.grid.RowExpander);
/*
 * Ext JS Library 3.1.0
 * Copyright(c) 2006-2009 Ext JS, LLC
 * licensing@extjs.com
 * http://www.extjs.com/license
 */
Ext.ns("Ext.ux.form");
Ext.ux.form.SpinnerField=Ext.extend(Ext.form.NumberField,{actionMode:"wrap",deferHeight:true,autoSize:Ext.emptyFn,onBlur:Ext.emptyFn,adjustSize:Ext.BoxComponent.prototype.adjustSize,constructor:function(b){var c=Ext.copyTo({},b,"incrementValue,alternateIncrementValue,accelerate,defaultValue,triggerClass,splitterClass");
var a=this.spinner=new Ext.ux.Spinner(c);var d=b.plugins?(Ext.isArray(b.plugins)?b.plugins.push(a):[b.plugins,a]):a;
Ext.ux.form.SpinnerField.superclass.constructor.call(this,Ext.apply(b,{plugins:d}));},getResizeEl:function(){return this.wrap;
},getPositionEl:function(){return this.wrap;},alignErrorIcon:function(){if(this.wrap){this.errorIcon.alignTo(this.wrap,"tl-tr",[2,0]);
}},validateBlur:function(){return true;}});Ext.reg("spinnerfield",Ext.ux.form.SpinnerField);Ext.form.SpinnerField=Ext.ux.form.SpinnerField;
/*
 * Ext JS Library 3.1.0
 * Copyright(c) 2006-2009 Ext JS, LLC
 * licensing@extjs.com
 * http://www.extjs.com/license
 */
Ext.ux.Spinner=Ext.extend(Ext.util.Observable,{incrementValue:1,alternateIncrementValue:5,triggerClass:"x-form-spinner-trigger",splitterClass:"x-form-spinner-splitter",alternateKey:Ext.EventObject.shiftKey,defaultValue:0,accelerate:false,constructor:function(a){Ext.ux.Spinner.superclass.constructor.call(this,a);
Ext.apply(this,a);this.mimicing=false;},init:function(a){this.field=a;a.afterMethod("onRender",this.doRender,this);
a.afterMethod("onEnable",this.doEnable,this);a.afterMethod("onDisable",this.doDisable,this);a.afterMethod("afterRender",this.doAfterRender,this);
a.afterMethod("onResize",this.doResize,this);a.afterMethod("onFocus",this.doFocus,this);a.beforeMethod("onDestroy",this.doDestroy,this);
},doRender:function(c,d){var b=this.el=this.field.getEl();var a=this.field;if(!a.wrap){a.wrap=this.wrap=b.wrap({cls:"x-form-field-wrap"});
}else{this.wrap=a.wrap.addClass("x-form-field-wrap");}this.trigger=this.wrap.createChild({tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.triggerClass});
if(!a.width){this.wrap.setWidth(b.getWidth()+this.trigger.getWidth());}this.splitter=this.wrap.createChild({tag:"div",cls:this.splitterClass,style:"width:13px; height:2px;"});
this.splitter.setRight((Ext.isIE)?1:2).setTop(10).show();this.proxy=this.trigger.createProxy("",this.splitter,true);
this.proxy.addClass("x-form-spinner-proxy");this.proxy.setStyle("left","0px");this.proxy.setSize(14,1);
this.proxy.hide();this.dd=new Ext.dd.DDProxy(this.splitter.dom.id,"SpinnerDrag",{dragElId:this.proxy.id});
this.initTrigger();this.initSpinner();},doAfterRender:function(){var a;if(Ext.isIE&&this.el.getY()!=(a=this.trigger.getY())){this.el.position();
this.el.setY(a);}},doEnable:function(){if(this.wrap){this.wrap.removeClass(this.field.disabledClass);
}},doDisable:function(){if(this.wrap){this.wrap.addClass(this.field.disabledClass);this.el.removeClass(this.field.disabledClass);
}},doResize:function(a,b){if(typeof a=="number"){this.el.setWidth(a-this.trigger.getWidth());}this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth());
},doFocus:function(){if(!this.mimicing){this.wrap.addClass("x-trigger-wrap-focus");this.mimicing=true;
Ext.get(Ext.isIE?document.body:document).on("mousedown",this.mimicBlur,this,{delay:10});this.el.on("keydown",this.checkTab,this);
}},checkTab:function(a){if(a.getKey()==a.TAB){this.triggerBlur();}},mimicBlur:function(a){if(!this.wrap.contains(a.target)&&this.field.validateBlur(a)){this.triggerBlur();
}},triggerBlur:function(){this.mimicing=false;Ext.get(Ext.isIE?document.body:document).un("mousedown",this.mimicBlur,this);
this.el.un("keydown",this.checkTab,this);this.field.beforeBlur();this.wrap.removeClass("x-trigger-wrap-focus");
this.field.onBlur.call(this.field);},initTrigger:function(){this.trigger.addClassOnOver("x-form-trigger-over");
this.trigger.addClassOnClick("x-form-trigger-click");},initSpinner:function(){this.field.addEvents({spin:true,spinup:true,spindown:true});
this.keyNav=new Ext.KeyNav(this.el,{up:function(a){a.preventDefault();this.onSpinUp();},down:function(a){a.preventDefault();
this.onSpinDown();},pageUp:function(a){a.preventDefault();this.onSpinUpAlternate();},pageDown:function(a){a.preventDefault();
this.onSpinDownAlternate();},scope:this});this.repeater=new Ext.util.ClickRepeater(this.trigger,{accelerate:this.accelerate});
this.field.mon(this.repeater,"click",this.onTriggerClick,this,{preventDefault:true});this.field.mon(this.trigger,{mouseover:this.onMouseOver,mouseout:this.onMouseOut,mousemove:this.onMouseMove,mousedown:this.onMouseDown,mouseup:this.onMouseUp,scope:this,preventDefault:true});
this.field.mon(this.wrap,"mousewheel",this.handleMouseWheel,this);this.dd.setXConstraint(0,0,10);this.dd.setYConstraint(1500,1500,10);
this.dd.endDrag=this.endDrag.createDelegate(this);this.dd.startDrag=this.startDrag.createDelegate(this);
this.dd.onDrag=this.onDrag.createDelegate(this);},onMouseOver:function(){if(this.disabled){return;}var a=this.getMiddle();
this.tmpHoverClass=(Ext.EventObject.getPageY()<a)?"x-form-spinner-overup":"x-form-spinner-overdown";this.trigger.addClass(this.tmpHoverClass);
},onMouseOut:function(){this.trigger.removeClass(this.tmpHoverClass);},onMouseMove:function(){if(this.disabled){return;
}var a=this.getMiddle();if(((Ext.EventObject.getPageY()>a)&&this.tmpHoverClass=="x-form-spinner-overup")||((Ext.EventObject.getPageY()<a)&&this.tmpHoverClass=="x-form-spinner-overdown")){}},onMouseDown:function(){if(this.disabled){return;
}var a=this.getMiddle();this.tmpClickClass=(Ext.EventObject.getPageY()<a)?"x-form-spinner-clickup":"x-form-spinner-clickdown";
this.trigger.addClass(this.tmpClickClass);},onMouseUp:function(){this.trigger.removeClass(this.tmpClickClass);
},onTriggerClick:function(){if(this.disabled||this.el.dom.readOnly){return;}var a=this.getMiddle();var b=(Ext.EventObject.getPageY()<a)?"Up":"Down";
this["onSpin"+b]();},getMiddle:function(){var b=this.trigger.getTop();var c=this.trigger.getHeight();
var a=b+(c/2);return a;},isSpinnable:function(){if(this.disabled||this.el.dom.readOnly){Ext.EventObject.preventDefault();
return false;}return true;},handleMouseWheel:function(b){if(this.wrap.hasClass("x-trigger-wrap-focus")==false){return;
}var a=b.getWheelDelta();if(a>0){this.onSpinUp();b.stopEvent();}else{if(a<0){this.onSpinDown();b.stopEvent();
}}},startDrag:function(){this.proxy.show();this._previousY=Ext.fly(this.dd.getDragEl()).getTop();},endDrag:function(){this.proxy.hide();
},onDrag:function(){if(this.disabled){return;}var a=Ext.fly(this.dd.getDragEl()).getTop();var b="";if(this._previousY>a){b="Up";
}if(this._previousY<a){b="Down";}if(b!=""){this["onSpin"+b]();}this._previousY=a;},onSpinUp:function(){if(this.isSpinnable()==false){return;
}if(Ext.EventObject.shiftKey==true){this.onSpinUpAlternate();return;}else{this.spin(false,false);}this.field.fireEvent("spin",this);
this.field.fireEvent("spinup",this);},onSpinDown:function(){if(this.isSpinnable()==false){return;}if(Ext.EventObject.shiftKey==true){this.onSpinDownAlternate();
return;}else{this.spin(true,false);}this.field.fireEvent("spin",this);this.field.fireEvent("spindown",this);
},onSpinUpAlternate:function(){if(this.isSpinnable()==false){return;}this.spin(false,true);this.field.fireEvent("spin",this);
this.field.fireEvent("spinup",this);},onSpinDownAlternate:function(){if(this.isSpinnable()==false){return;
}this.spin(true,true);this.field.fireEvent("spin",this);this.field.fireEvent("spindown",this);},spin:function(a,c){var b=parseFloat(this.field.getValue());
var d=(c==true)?this.alternateIncrementValue:this.incrementValue;(a==true)?b-=d:b+=d;b=(isNaN(b))?this.defaultValue:b;
b=this.fixBoundries(b);this.field.setRawValue(b);},fixBoundries:function(a){var b=a;if(this.field.minValue!=undefined&&b<this.field.minValue){b=this.field.minValue;
}if(this.field.maxValue!=undefined&&b>this.field.maxValue){b=this.field.maxValue;}return this.fixPrecision(b);
},fixPrecision:function(a){var b=isNaN(a);if(!this.field.allowDecimals||this.field.decimalPrecision==-1||b||!a){return b?"":a;
}return parseFloat(parseFloat(a).toFixed(this.field.decimalPrecision));},doDestroy:function(){if(this.trigger){this.trigger.remove();
}if(this.wrap){this.wrap.remove();delete this.field.wrap;}if(this.splitter){this.splitter.remove();}if(this.dd){this.dd.unreg();
this.dd=null;}if(this.proxy){this.proxy.remove();}if(this.repeater){this.repeater.purgeListeners();}}});
Ext.form.Spinner=Ext.ux.Spinner;
