X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Pman.Dialog.CoreCompanies.js;h=e44744a9efd4f9171c7ff785a46617cc789b3eba;hb=c09df6ba25e12f8223b4c58989986b2e9efedecb;hp=c688f4060df129553a395baae095aa7f486ec8ee;hpb=1fbaeff2f28c33a88ef08aac59795d2cc7546c49;p=Pman.Core diff --git a/Pman.Dialog.CoreCompanies.js b/Pman.Dialog.CoreCompanies.js index c688f406..e44744a9 100644 --- a/Pman.Dialog.CoreCompanies.js +++ b/Pman.Dialog.CoreCompanies.js @@ -2,366 +2,453 @@ // Auto generated file - created by app.Builder.js- do not edit directly (at present!) +Roo.namespace('Pman.Dialog'); + Pman.Dialog.CoreCompanies = { - dialog : false, - callback: false, + _strings : { + 'ce8ae9da5b7cd6c3df2929543a9af92d' :"Email", + '231bc72756b5e6de492aaaa1577f61b1' :"Remarks", + 'b33457e7e1cd5dbf1db34a0c60fcb75f' :"Company ID (for filing Ref.)", + '023a5dfa857c4aa0156e6685231a1dbd' :"Select Type", + '8535bcc0f05358a583bb432bbadf7e0d' :"Select type", + '733640ec0c9367df1b4d85eb286ed9ae' :"Enter code", + '8c04eb09879a05470fae436ba76e3bb9' :"Enter Url", + '4ef6052d74436756f08e95fd63949653' :"Enter Company Name", + 'c54b90756cfbeff9217293b567cb2eb0' :"Enter remarks", + '1243daf593fa297e07ab03bf06d925af' :"Searching...", + 'bcc254b55c4a1babdf1dcb82c207506b' :"Phone", + 'cf3a5d25d39613ad5bbc2f5eb0f9b675' :"Enter Fax Number", + '9f86c00615b1a210935ac28ff8ebbb22' :"Enter Email Address", + 'e7b47c58815acf1d3afa59a84b5db7fb' :"Company Name", + 'ea4788705e6873b424c65e91c2846b19' :"Cancel", + '32c4e9483403d60115b21519178e5384' :"Enter Address", + 'b9c49611cfda3259a2b837b39489e650' :"Add Image", + '72b9d3d2e231f1de7a2bd70737f644aa' :"Add / Edit Organization", + 'a1fa27779242b4902f7ae3bdd5c6d508' :"Type", + '02a3a357710cc2a5dfdfb74ed012fb59' :"Url", + 'dd7bf230fde8d4836917806aff6a6b27' :"Address", + 'c9cc8cce247e49bae79f15173ce97354' :"Save", + 'bc3a4c40d007b8d610a16312970e5cb3' :"Enter Phone Number", + '9810aa2b9f44401be4bf73188ef2b67d' :"Fax", + '35cb9e66ff801a819684ee0fbeabaeeb' :"Background Colour", + 'bc87ef2144ae15ef4f78211e73948051' :"Logo Image" + }, + _named_strings : { + 'name_qtip' : '4ef6052d74436756f08e95fd63949653' /* Enter Company Name */ , + 'tel_fieldLabel' : 'bcc254b55c4a1babdf1dcb82c207506b' /* Phone */ , + 'address_qtip' : '32c4e9483403d60115b21519178e5384' /* Enter Address */ , + 'background_color_fieldLabel' : '35cb9e66ff801a819684ee0fbeabaeeb' /* Background Colour */ , + 'comptype_id_display_name_emptyText' : '023a5dfa857c4aa0156e6685231a1dbd' /* Select Type */ , + 'comptype_id_display_name_fieldLabel' : 'a1fa27779242b4902f7ae3bdd5c6d508' /* Type */ , + 'comptype_id_display_name_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ , + 'code_fieldLabel' : 'b33457e7e1cd5dbf1db34a0c60fcb75f' /* Company ID (for filing Ref.) */ , + 'fax_fieldLabel' : '9810aa2b9f44401be4bf73188ef2b67d' /* Fax */ , + 'name_fieldLabel' : 'e7b47c58815acf1d3afa59a84b5db7fb' /* Company Name */ , + 'fax_qtip' : 'cf3a5d25d39613ad5bbc2f5eb0f9b675' /* Enter Fax Number */ , + 'url_qtip' : '8c04eb09879a05470fae436ba76e3bb9' /* Enter Url */ , + 'remarks_fieldLabel' : '231bc72756b5e6de492aaaa1577f61b1' /* Remarks */ , + 'code_qtip' : '733640ec0c9367df1b4d85eb286ed9ae' /* Enter code */ , + 'tel_qtip' : 'bc3a4c40d007b8d610a16312970e5cb3' /* Enter Phone Number */ , + 'email_qtip' : '9f86c00615b1a210935ac28ff8ebbb22' /* Enter Email Address */ , + 'url_fieldLabel' : '02a3a357710cc2a5dfdfb74ed012fb59' /* Url */ , + 'remarks_qtip' : 'c54b90756cfbeff9217293b567cb2eb0' /* Enter remarks */ , + 'comptype_id_display_name_qtip' : '8535bcc0f05358a583bb432bbadf7e0d' /* Select type */ , + 'email_fieldLabel' : 'ce8ae9da5b7cd6c3df2929543a9af92d' /* Email */ , + 'address_fieldLabel' : 'dd7bf230fde8d4836917806aff6a6b27' /* Address */ , + 'logo_id_fieldLabel' : 'bc87ef2144ae15ef4f78211e73948051' /* Logo Image */ + }, - show : function(data, cb) - { - if (!this.dialog) { - this.create(); - } + dialog : false, + callback: false, - this.callback = cb; - this.data = data; - this.dialog.show(this.data._el); - if (this.form) { - this.form.reset(); - this.form.setValues(data); - this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data }); - } + show : function(data, cb) + { + if (!this.dialog) { + this.create(); + } - }, + this.callback = cb; + this.data = data; + this.dialog.show(this.data._el); + if (this.form) { + this.form.reset(); + this.form.setValues(data); + this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data }); + } - create : function() - { - var _this = this; - this.dialog = Roo.factory({ - xtype: 'LayoutDialog', - xns: Roo, - autoCreate : 'true', - closable : false, - collapsible : false, - draggable : false, - height : 400, - modal : true, - shadow : 'true', - title : "Edit Companies", - width : 750, - items : [ - { - xtype: 'ContentPanel', - xns: Roo, - autoCreate : 'true', - fitToFrame : true, - region : 'center', - items : [ - { - xtype: 'Form', - xns: Roo.form, - listeners : { - actionfailed : function(f, act) { - _this.dialog.el.unmask(); - // error msg??? - Pman.standardActionFailed(f,act); - - }, - actioncomplete : function(f, act) { - _this.dialog.el.unmask(); - //console.log('load completed'); - // error messages????? - if(act.type == 'setdata'){ - this.load({ method: 'GET', params: { '_id' : _this.data.id }}); - return; - } - - if (act.type == 'load') { - _this.data = act.result.data; - var meth = _this.data.isOwner || !Pman.Login.isOwner() ? 'disable' : 'enable'; - - - if (_this.form.findField('comptype')) { - _this.form.findField('comptype')[meth](); - } - - // _this.loaded(); - return; - } - - - if (act.type == 'submit') { // only submitted here if we are - _this.dialog.hide(); - - if (_this.callback) { - _this.callback.call(this, act.result.data); - } - return; - } - // unmask?? - }, - rendered : function (form) - { - _this.form = form; - } - }, - fileUpload : true, - labelWidth : 160, - url : baseURL + '/Roo/Companies.php', - items : [ - { - xtype: 'Column', - xns: Roo.form, - width : 500, - items : [ - { - xtype: 'TextField', - xns: Roo.form, - allowBlank : false, - fieldLabel : 'Company ID (for filing Ref.)', - name : 'code', - qtip : "Enter code", - width : 100 - }, - { - xtype: 'ComboBox', - xns: Roo.form, - allowBlank : false, - displayField : 'desc', - editable : false, - emptyText : "Select Type", - fieldLabel : 'Type', - hiddenName : 'comptype', - listWidth : 250, - name : 'comptype_name', - qtip : "Select Company type", - selectOnFocus : true, - triggerAction : 'all', - typeAhead : false, - valueField : 'val', - width : 200, - store : { - xtype: 'SimpleStore', - xns: Roo.data, - data : '[ \'CONSULTANT\', "Consultant" ],[ \'CLIENT\' , "Client" ],[ \'CONTRACTOR\' , "Contractor" ]', - fields : '[\'val\', \'desc\']' - } - }, - { - xtype: 'ComboBox', - xns: Roo.form, - listeners : { - render : function (_self) - { - _this.etypeCombo = _self; - }, - select : function (combo, record, index) - { - _this.grid.footer.onClick('first'); - } - }, - alwaysQuery : true, - displayField : 'name', - editable : 'false', - emptyText : "Select Type", - fieldLabel : 'Type', - forceSelection : true, - listWidth : 250, - loadingText : "Searching...", - minChars : 2, - name : 'comptype_name', - pageSize : 20, - qtip : "Select type", - queryParam : 'query[name]', - selectOnFocus : true, - tpl : '
', - triggerAction : 'all', - typeAhead : false, - valueField : 'val', - width : 200, - store : { - xtype: 'Store', - xns: Roo.data, - listeners : { - beforeload : function (_self, o){ - o.params = o.params || {}; - // set more here - o.params['query[empty_etype]'] = 1; - } - }, - remoteSort : true, - sortInfo : { direction : 'ASC', field: 'id' }, - proxy : { - xtype: 'HttpProxy', - xns: Roo.data, - method : 'GET', - url : baseURL + '/Roo/core_enum.php' - }, - reader : { - xtype: 'JsonReader', - xns: Roo.data, - id : 'id', - root : 'data', - totalProperty : 'total', - fields : [{"name":"id","type":"int"},{"name":"etype","type":"string"}] - } - } - }, - { - xtype: 'TextField', - xns: Roo.form, - allowBlank : true, - fieldLabel : 'Company Name', - name : 'name', - qtip : "Enter Company Name", - width : 300 - }, - { - xtype: 'TextField', - xns: Roo.form, - allowBlank : true, - fieldLabel : 'Phone', - name : 'tel', - qtip : "Enter Phone Number", - width : 300 - }, - { - xtype: 'TextField', - xns: Roo.form, - allowBlank : true, - fieldLabel : 'Fax', - name : 'fax', - qtip : "Enter Fax Number", - width : 300 - }, - { - xtype: 'TextField', - xns: Roo.form, - allowBlank : true, - fieldLabel : 'Email', - name : 'email', - qtip : "Enter Email Address", - width : 300 - }, - { - xtype: 'TextField', - xns: Roo.form, - allowBlank : true, - fieldLabel : 'Address', - name : 'address', - qtip : "Enter Address", - width : 300 - }, - { - xtype: 'TextArea', - xns: Roo.form, - allowBlank : true, - fieldLabel : 'Remarks', - height : 40, - name : 'remarks', - qtip : "Enter remarks", - width : 300 - } - ] - }, - { - xtype: 'Column', - xns: Roo.form, - labelAlign : 'top', - width : 200, - items : [ - { - xtype: 'TextField', - xns: Roo.form, - fieldLabel : 'Background Colour', - name : 'background_color' - }, - { - xtype: 'DisplayField', - xns: Roo.form, - fieldLabel : 'Logo Image', - height : 170, - icon : 'rootURL + \'images/default/dd/drop-add.gif\'', - name : 'logo_id', - style : 'border: 1px solid #ccc;', - width : 170, - valueRenderer : function(v) { - //var vp = v ? v : 'Companies:' + _this.data.id + ':-LOGO'; - if (!v) { - return "No Image Available" + '