14 "alwaysShowTabs" : false,
19 "xtype" : "LayoutRegion"
27 "$ url" : "baseURL + '/Roo/core_company.php'",
37 "fieldLabel" : "Company ID (for filing Ref.)",
39 "qtip" : "Enter code",
45 "Boolean allowBlank" : false,
47 "displayField" : "display_name",
48 "emptyText" : "Select Type",
49 "fieldLabel" : "Type",
50 "forceSelection" : true,
51 "hiddenName" : "comptype_id",
54 "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
59 "$ url" : "baseURL + '/Roo/core_enum.php'",
66 "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]",
71 "totalProperty" : "total",
72 "xtype" : "JsonReader"
77 "function (_self, o){",
78 " o.params = o.params || {};",
80 " //o.params['query[empty_etype]'] = 1;",
81 " o.params.etype = 'COMPTYPE';",
95 " _this.etypeCombo = _self;",
99 "loadingText" : "Searching...",
101 "name" : "comptype_id_display_name",
103 "qtip" : "Select type",
104 "queryParam" : "query[name]",
105 "selectOnFocus" : true,
106 "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> : {display_name}</div>",
107 "triggerAction" : "all",
114 "$ xns" : "Roo.form",
115 "allowBlank" : false,
116 "fieldLabel" : "Company Name",
118 "qtip" : "Enter Company Name",
120 "xtype" : "TextField"
123 "$ xns" : "Roo.form",
125 "fieldLabel" : "Phone",
127 "qtip" : "Enter Phone Number",
129 "xtype" : "TextField"
132 "$ xns" : "Roo.form",
134 "fieldLabel" : "Fax",
136 "qtip" : "Enter Fax Number",
138 "xtype" : "TextField"
141 "$ xns" : "Roo.form",
143 "fieldLabel" : "Email",
145 "qtip" : "Enter Email Address",
147 "xtype" : "TextField"
150 "$ xns" : "Roo.form",
152 "fieldLabel" : "Url",
154 "qtip" : "Enter Url",
156 "xtype" : "TextField"
159 "$ xns" : "Roo.form",
161 "fieldLabel" : "Address",
163 "qtip" : "Enter Address",
168 "$ xns" : "Roo.form",
170 "fieldLabel" : "Remarks",
173 "qtip" : "Enter remarks",
182 "$ xns" : "Roo.form",
185 "$ xns" : "Roo.form",
186 "fieldLabel" : "Background Colour",
187 "name" : "background_color",
188 "xtype" : "ColorField"
191 "$ valueRenderer" : [
193 " //var vp = v ? v : 'Companies:' + _this.data.id + ':-LOGO';",
195 " return \"No Image Available\" + '<BR/>';",
197 " return String.format('<a target=\"_new\" href=\"{1}\"><img src=\"{0}\" width=\"150\"></a>', ",
198 " baseURL + '/Images/Thumb/150x150/' + v + '/logo.jpg',",
199 " baseURL + '/Images/'+v+'/logo.jpg' // fixme - put escaped company name..",
203 "$ xns" : "Roo.form",
204 "fieldLabel" : "Logo Image",
206 "icon" : "rootURL + 'images/default/dd/drop-add.gif'",
208 "style" : "border: 1px solid #ccc;",
210 "xtype" : "DisplayField"
216 "function (_self, e)",
218 " var _t = _this.form.findField('logo_id');",
220 " Pman.Dialog.Image.show({",
221 " onid :_this.data.id,",
222 " ontable : 'pressrelease_terminals',",
224 " }, function(data) {",
226 " _t.setValue(data.id);",
233 "text" : "Add Image",
237 "labelAlign" : "top",
242 "$ xns" : "Roo.form",
250 "function(f, act) {",
251 " _this.dialog.el.unmask();",
252 " //console.log('load completed'); ",
253 " // error messages?????",
254 " if(act.type == 'setdata'){",
255 " this.load({ method: 'GET', params: { '_id' : _this.data.id }});",
259 " if (act.type == 'load') {",
260 " _this.data = act.result.data;",
261 " var meth = _this.data.comptype == 'OWNER' ? 'disable' : 'enable';",
264 " if (_this.form.findField('comptype')) {",
265 " _this.form.findField('comptype')[meth]();",
268 " // _this.loaded();",
273 " if (act.type == 'submit') { // only submitted here if we are ",
274 " _this.dialog.hide();",
276 " if (_this.callback) {",
277 " _this.callback.call(this, act.result.data);",
285 "function(f, act) {",
286 " _this.dialog.el.unmask();",
288 " Pman.standardActionFailed(f,act);",
295 " _this.form = form;",
303 "xtype" : "ContentPanel"
307 "* prop" : "buttons[]",
310 "function (_self, e)",
312 " _this.dialog.hide();",
321 "* prop" : "buttons[]",
324 "function (_self, e)",
326 " if(!_this.form.isValid()){",
327 " Roo.MessageBox.alert('Error', 'Please Correct all the errors in red');",
331 " new Pman.Request({",
332 " url : baseURL + '/Roo/Core_company.php',",
335 " id : _this.form.findField('id').getValue() * 1,",
336 " name : _this.form.findField('name').getValue(),",
339 " success : function(res) {",
340 " _this.dialog.el.mask(\"Saving\");",
341 " _this.form.doAction(\"submit\");",
343 " failure : function(res) {",
344 " Roo.MessageBox.confirm(",
346 " \"The company name has been used. Save it anyway?\", ",
348 " if(res != 'yes') {",
352 " _this.dialog.el.mask(\"Saving\");",
353 " _this.form.doAction(\"submit\");",
370 "title" : "Add / Edit Organization",
372 "xtype" : "LayoutDialog"
376 "name" : "Pman.Dialog.CoreCompanies",
378 "address_fieldLabel" : "dd7bf230fde8d4836917806aff6a6b27",
379 "address_qtip" : "32c4e9483403d60115b21519178e5384",
380 "background_color_fieldLabel" : "35cb9e66ff801a819684ee0fbeabaeeb",
381 "code_fieldLabel" : "b33457e7e1cd5dbf1db34a0c60fcb75f",
382 "code_qtip" : "733640ec0c9367df1b4d85eb286ed9ae",
383 "comptype_id_display_name_emptyText" : "023a5dfa857c4aa0156e6685231a1dbd",
384 "comptype_id_display_name_fieldLabel" : "a1fa27779242b4902f7ae3bdd5c6d508",
385 "comptype_id_display_name_loadingText" : "1243daf593fa297e07ab03bf06d925af",
386 "comptype_id_display_name_qtip" : "8535bcc0f05358a583bb432bbadf7e0d",
387 "email_fieldLabel" : "ce8ae9da5b7cd6c3df2929543a9af92d",
388 "email_qtip" : "9f86c00615b1a210935ac28ff8ebbb22",
389 "fax_fieldLabel" : "9810aa2b9f44401be4bf73188ef2b67d",
390 "fax_qtip" : "cf3a5d25d39613ad5bbc2f5eb0f9b675",
391 "logo_id_fieldLabel" : "bc87ef2144ae15ef4f78211e73948051",
392 "name_fieldLabel" : "e7b47c58815acf1d3afa59a84b5db7fb",
393 "name_qtip" : "4ef6052d74436756f08e95fd63949653",
394 "remarks_fieldLabel" : "231bc72756b5e6de492aaaa1577f61b1",
395 "remarks_qtip" : "c54b90756cfbeff9217293b567cb2eb0",
396 "tel_fieldLabel" : "bcc254b55c4a1babdf1dcb82c207506b",
397 "tel_qtip" : "bc3a4c40d007b8d610a16312970e5cb3",
398 "url_fieldLabel" : "02a3a357710cc2a5dfdfb74ed012fb59",
399 "url_qtip" : "8c04eb09879a05470fae436ba76e3bb9"
402 "path" : "/home/leon/gitlive/web.MediaOutreach/Pman/Core/Pman.Dialog.CoreCompanies.bjs",
405 "023a5dfa857c4aa0156e6685231a1dbd" : "Select Type",
406 "02a3a357710cc2a5dfdfb74ed012fb59" : "Url",
407 "1243daf593fa297e07ab03bf06d925af" : "Searching...",
408 "231bc72756b5e6de492aaaa1577f61b1" : "Remarks",
409 "32c4e9483403d60115b21519178e5384" : "Enter Address",
410 "35cb9e66ff801a819684ee0fbeabaeeb" : "Background Colour",
411 "4ef6052d74436756f08e95fd63949653" : "Enter Company Name",
412 "72b9d3d2e231f1de7a2bd70737f644aa" : "Add / Edit Organization",
413 "733640ec0c9367df1b4d85eb286ed9ae" : "Enter code",
414 "8535bcc0f05358a583bb432bbadf7e0d" : "Select type",
415 "8c04eb09879a05470fae436ba76e3bb9" : "Enter Url",
416 "9810aa2b9f44401be4bf73188ef2b67d" : "Fax",
417 "9f86c00615b1a210935ac28ff8ebbb22" : "Enter Email Address",
418 "a1fa27779242b4902f7ae3bdd5c6d508" : "Type",
419 "b33457e7e1cd5dbf1db34a0c60fcb75f" : "Company ID (for filing Ref.)",
420 "b9c49611cfda3259a2b837b39489e650" : "Add Image",
421 "bc3a4c40d007b8d610a16312970e5cb3" : "Enter Phone Number",
422 "bc87ef2144ae15ef4f78211e73948051" : "Logo Image",
423 "bcc254b55c4a1babdf1dcb82c207506b" : "Phone",
424 "c54b90756cfbeff9217293b567cb2eb0" : "Enter remarks",
425 "c9cc8cce247e49bae79f15173ce97354" : "Save",
426 "ce8ae9da5b7cd6c3df2929543a9af92d" : "Email",
427 "cf3a5d25d39613ad5bbc2f5eb0f9b675" : "Enter Fax Number",
428 "dd7bf230fde8d4836917806aff6a6b27" : "Address",
429 "e7b47c58815acf1d3afa59a84b5db7fb" : "Company Name",
430 "ea4788705e6873b424c65e91c2846b19" : "Cancel"