Ext.define("MyApp.Application",{name:"MyApp",extend:Ext.app.Application,views:[],controllers:[],stores:[]});Ext.define("MyApp.controller.Main",{extend:Ext.app.Controller});Ext.define("MyApp.controller.Settings",{extend:Ext.app.Controller,refs:[{ref:"defaultsForm",selector:"#defaultsForm"},{ref:"saveBtn",selector:"#saveBtn"},{ref:"defaultsBtn",selector:"#defaultsBtn"}],onLaunch:function(){this.load()},init:function(a){this.control({"#defaultsForm":{dirtychange:function(b,c){if(c){this.getSaveBtn().enable()}else{this.getSaveBtn().disable()}}},"#saveBtn":{click:this.save},"#defaultsBtn":{click:this.setDefaults}})},load:function(){Ext.Ajax.request({url:"../../service/settings_project_defaults.php",method:"GET",params:Ext.Object.fromQueryString(document.location.search),success:function(a,b){var c=Ext.JSON.decode(a.responseText).result;this.defaults=c.defaults;if(Ext.isEmpty(c.settings)){this.setDefaults(this.getDefaultsBtn())}else{this.getDefaultsForm().getForm().setValues(c.settings)}this.getDefaultsBtn().enable()},failure:function(a,b){var c=a.responseText;Ext.Error.raise({msg:"Ajax Get settings has failed",option:c,object:b})},scope:this})},save:function(a){a.blur();a.disable();Ext.Ajax.request({url:"../../service/settings_project_defaults.php",method:"POST",params:Ext.Object.fromQueryString(document.location.search),jsonData:this.getDefaultsForm().getForm().getValues(),success:function(b,c){this.load()},failure:function(b,c){var d=b.responseText;Ext.Error.raise({msg:"Ajax Get settings has failed",option:d,object:c});this.load()},scope:this})},setDefaults:function(a){a.blur();this.getDefaultsForm().getForm().trackResetOnLoad=false;this.getDefaultsForm().getForm().setValues(this.defaults);this.getDefaultsForm().getForm().trackResetOnLoad=true}});Ext.define("MyApp.model.SelectionOption",{extend:Ext.data.Model,fields:[{name:"value"},{name:"text"}]});Ext.define("MyApp.store.SelectionOptions",{extend:Ext.data.Store,constructor:function(a){var b=this;a=a||{};b.callParent([Ext.apply({model:"MyApp.model.SelectionOption",storeId:"SelectionOptions",data:[{value:"0",text:CCS.Translator.getText("None")},{value:"1",text:CCS.Translator.getText("Optional")},{value:"2",text:CCS.Translator.getText("Mandatory")}]},a)])}});Ext.define("MyApp.view.Main",{extend:Ext.container.Container,xtype:"app-main",layout:{type:"border"},items:[{region:"west",xtype:"panel",title:"west",width:150},{region:"center",xtype:"tabpanel",items:[{title:"Center Tab 1"}]}]});Ext.define("MyApp.view.MyPanel",{extend:Ext.panel.Panel,border:false,itemId:"WindowResponsibles",margin:"0 0 5 0",padding:"0 5 0 5",layout:"fit",bodyBorder:false,frameHeader:false,header:false,icon:"../gfx/user.gif",title:"Manage responsibles",initComponent:function(){var a=this;Ext.applyIf(a,{items:[{xtype:"fieldset",margin:"0 0 5 0",padding:"3 10 10 10",title:"Project defaults",layout:{type:"vbox",align:"stretch"},items:[{xtype:"form",flex:1,border:false,itemId:"defaultsForm",layout:"auto",bodyBorder:false,bodyPadding:10,header:false,title:"My Form",trackResetOnLoad:true,items:[{xtype:"combobox",fieldLabel:"Description",labelSeparator:" ",labelWidth:120,name:"description",value:"0",allowBlank:false,allowOnlyWhitespace:false,forceSelection:true,queryMode:"local",store:"SelectionOptions",valueField:"value"},{xtype:"combobox",fieldLabel:"Ext issue no",labelSeparator:" ",labelWidth:120,name:"extissueno",value:"0",allowBlank:false,allowOnlyWhitespace:false,forceSelection:true,queryMode:"local",store:"SelectionOptions",valueField:"value"},{xtype:"combobox",fieldLabel:"Test case",labelSeparator:" ",labelWidth:120,name:"testcase",value:"0",allowBlank:false,allowOnlyWhitespace:false,forceSelection:true,queryMode:"local",store:"SelectionOptions",valueField:"value"},{xtype:"checkboxfield",fieldLabel:"One-Click corrections",labelSeparator:" ",labelWidth:120,name:"fast",inputValue:"X",uncheckedValue:" "}]},{xtype:"tbspacer",height:10},{xtype:"container",layout:{type:"hbox",align:"stretch"},items:[{xtype:"button",disabled:true,itemId:"saveBtn",padding:5,icon:"../gfx/save.png",scale:"medium",text:"Save",tooltip:"Save"},{xtype:"tbspacer",flex:1,width:10},{xtype:"button",disabled:true,itemId:"defaultsBtn",padding:5,icon:"../gfx/fav_yes.png",scale:"medium",text:"Default settings",tooltip:"Load standard settings"}]}]}]});a.callParent(arguments)}});Ext.define("MyApp.view.Viewport",{extend:Ext.container.Viewport,layout:{type:"fit"},items:[{xtype:"app-main"}]});