You are on page 1of 5

Ext.reg('srnote', stores.SRNotes = Ext.extend(stores.SRStore, { storeId : 'srnote', baseParams : { start : 0 }, rest : { api : { read : { url : ns.

scSoaUrl + 'common/getNotes', method : 'POST' } } }, fields : ['channel', { name : 'noteId', type : 'int' }, 'userId', { name : 'notes', type : 'int' }, { name : 'userFlag', type : 'boolean' }, { name : 'respId', type : 'int' }, { name : 'respAppId', type : 'int' }, { name : 'supportFlag', type : 'int' }, 'sourceCode', { name : 'sourceObjectId', type : 'int' }, { name : 'logHours', type : 'int' }, 'noteType', 'noteStatus', { name : 'noteDate', mapping : 'strNoteDate', type : 'date', dateFormat : 'c' }, { name : 'noteDetail', type : 'string'

}, { name : 'logMins', type : 'int' }, { name : 'userName', type : 'string' }] })); Ext.reg('srnotetype', stores.SRNoteType = Ext.extend(stores.SRStore, { storeId : 'srnotetype', baseParams : {}, rest : { api : { read : { url : ns.scSoaUrl + 'common/getNoteTypesList', method : 'POST' } } }, fields : [{ name : 'noteTypeId', type : 'int' }, 'actionType', 'noteType', 'typeName', 'showGroup', 'showProblem', 'showResolution', 'showCategory', 'showReason', 'showProblemCode', 'showResolutionCode', 'showNad', 'showPartnerComp', { name : 'createDate', type : 'date', dateFormat : 'c' }, { name : 'updateDate', type : 'date', dateFormat : 'c' }] })); Ext.reg('srnotemeta', stores.SRNoteMeta = Ext.extend(stores.SRStore, { storeId : 'srnotetemplate', baseParams : {}, rest : { api : { read : { url : ns.scSoaUrl + 'common/getNoteTypeMetaInfo',

method : 'POST' } } }, fields : [{ name : 'metaId', type : 'int' }, 'noteType', 'noteOption', 'note', 'nextActionDate', { name : 'createDate', type : 'date', dateFormat : 'c' }, { name : 'createDate', type : 'date', dateFormat : 'c' }] }));

if ((this.noteCreateWin.form.getForm && this.noteCreateWin.form.getForm() .isValid()) || values) { if (!values) { //collect the values from the form values = this.noteCreateWin.form.getForm() .getFieldValues() } if(this.noteMeta.actionType == 'TASK_STATUS'){

values = Ext.apply(values, { sourceNumber: this.serviceRequest.get('objectNumber'), source: this.serviceRequest.get('objectType'), taskOwnerId : App.taskOwnerId, taskGroupId : App.taskGroupId }); }else{ values = Ext.apply(values, { action: this.noteMeta.actionType, //if noteType default selected dataValue is incorrect because the store has not yet loaded the set it here noteType: values.noteType == 'SET Update' ? 'CS_SU' : values.noteType, Nad: (this.noteCreateWin.form.Nad && this.noteCreateWin.form.Nad.getValue()) ? new Date(App.convertDateToServerTime(this.noteCreateWin.form.Nad.getValue()) ) .dateFormat('d-m-Y H:i:s') .toUpperCase() : null, objectId: this.serviceRequest.get('objectId'), objectNumber: this.serviceRequest.get('objectNumber'), objectType: this.serviceRequest.get('objectType'), is_contact: contactName == null ? true : false, contactId: (contactName == null && this.isEmployee) ? "0" : srContactId, locale: ns.arguments.locale }); } //tidy up the data before submitting values = this.prepareData(values); Ext.Ajax.request({ url: ns.scSoaUrl + this.noteMeta.submitUrl, method: 'POST', params: values, callback: function (options, success, response) { scSoaUrl = /servicecenter/

this.noteCreationMetadata = {

log: { actionType: 'NOTES', btnText: locale.l_notesLog, winTitle: locale.l_notesLogTitle, submitButton: locale.l_submitButton, cancelButton: locale.l_cancelButton, processErrMsg: locale.l_processErrMsg, submitUrl: (this.isPartner || this.isCustomer) ? ns.scSoaUrl + 'common/addNote' : ns.scSoaUrl + 'servicerequest/updateServiceRequest', lookup: 'OPEN_STATUS' },

You might also like