Ext.ns("feyaSoft.openSource.myCalendar");feyaSoft.openSource.myCalendar.CreateEditForum=function(config){this.myOwner=config.myOwner;this.type=config.type;this.parentId=config.parentId;this.subject=new Ext.form.TextField({fieldLabel:"Subject",allowBlank:false,name:"subject",anchor:"98%"});this.desc=new Ext.form.HtmlEditor({hideLabel:true,name:"description",anchor:"98%"});this.filepath=new Ext.form.FileUploadField({emptyText:"Select a File",fieldLabel:"Attach File",name:"filepath",anchor:"98%",buttonCfg:{text:" ",iconCls:"upload-icon"}});this.formPanel=new Ext.form.FormPanel({baseCls:"x-plain",labelWidth:75,fileUpload:true,url:"openSourceForum/createUpdate",items:[this.subject,this.filepath,this.desc]});var title="Post New Topic";var selectedId=null;if(config.record!=null){title="Edit Topic";this.subject.setValue(config.record.data.subject);this.desc.setValue(config.record.data.description);selectedId=config.record.data.id}this.replySub=null;if(config.replySub){title="Reply Message - "+config.replySub;this.subject.setValue("RE: "+config.replySub)}if(config.quote){this.desc.setValue(config.quote)}feyaSoft.openSource.myCalendar.CreateEditForum.superclass.constructor.call(this,{title:title,width:800,height:450,minWidth:350,minHeight:300,layout:"fit",plain:true,modal:true,bodyStyle:"padding:5px;",buttonAlign:"center",items:[this.formPanel],resizable:false,buttons:[{text:"Save",handler:function(){if(this.formPanel.form.isValid()){this.desc.setValue(this.desc.getValue().trim());this.formPanel.form.submit({waitMsg:"In processing",params:{id:selectedId,parentId:this.parentId,type:this.type},failure:function(form,action){Ext.MessageBox.alert("Error Message",action.result.errorInfo)},success:function(form,action){var jsonData=action.result;if(jsonData.success){Ext.Message.msgStay("Confirm",jsonData.info,2000);this.myOwner.reload();this.close()}else{Ext.MessageBox.alert("Error",action.result.errorInfo)}},scope:this})}else{Ext.MessageBox.alert("Errors","Please fix the errors noted.")}},scope:this},{text:"Cancel",handler:function(){this.close()},scope:this}]});this.show()};Ext.extend(feyaSoft.openSource.myCalendar.CreateEditForum,Ext.Window,{});