1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Roo.namespace('Pman.Dialog');
7 Pman.Dialog.CoreCompanies = {
10 'ce8ae9da5b7cd6c3df2929543a9af92d' :"Email",
11 '231bc72756b5e6de492aaaa1577f61b1' :"Remarks",
12 'b33457e7e1cd5dbf1db34a0c60fcb75f' :"Company ID (for filing Ref.)",
13 '023a5dfa857c4aa0156e6685231a1dbd' :"Select Type",
14 '8535bcc0f05358a583bb432bbadf7e0d' :"Select type",
15 '733640ec0c9367df1b4d85eb286ed9ae' :"Enter code",
16 '8c04eb09879a05470fae436ba76e3bb9' :"Enter Url",
17 '4ef6052d74436756f08e95fd63949653' :"Enter Company Name",
18 'c54b90756cfbeff9217293b567cb2eb0' :"Enter remarks",
19 '1243daf593fa297e07ab03bf06d925af' :"Searching...",
20 'bcc254b55c4a1babdf1dcb82c207506b' :"Phone",
21 'cf3a5d25d39613ad5bbc2f5eb0f9b675' :"Enter Fax Number",
22 '9f86c00615b1a210935ac28ff8ebbb22' :"Enter Email Address",
23 'e7b47c58815acf1d3afa59a84b5db7fb' :"Company Name",
24 'ea4788705e6873b424c65e91c2846b19' :"Cancel",
25 '32c4e9483403d60115b21519178e5384' :"Enter Address",
26 'b9c49611cfda3259a2b837b39489e650' :"Add Image",
27 '72b9d3d2e231f1de7a2bd70737f644aa' :"Add / Edit Organization",
28 'a1fa27779242b4902f7ae3bdd5c6d508' :"Type",
29 '02a3a357710cc2a5dfdfb74ed012fb59' :"Url",
30 'dd7bf230fde8d4836917806aff6a6b27' :"Address",
31 'c9cc8cce247e49bae79f15173ce97354' :"Save",
32 'bc3a4c40d007b8d610a16312970e5cb3' :"Enter Phone Number",
33 '9810aa2b9f44401be4bf73188ef2b67d' :"Fax",
34 '35cb9e66ff801a819684ee0fbeabaeeb' :"Background Colour",
35 'bc87ef2144ae15ef4f78211e73948051' :"Logo Image"
41 show : function(data, cb)
49 this.dialog.show(this.data._el);
52 this.form.setValues(data);
53 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
61 this.dialog = Roo.factory({
62 xtype : 'LayoutDialog',
70 title : _this._strings['72b9d3d2e231f1de7a2bd70737f644aa'] /* Add / Edit Organization */,
75 xtype : 'LayoutRegion',
76 alwaysShowTabs : false,
87 text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
89 click : function (_self, e)
99 text : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
101 click : function (_self, e)
105 if(!_this.form.isValid()){
106 Roo.MessageBox.alert('Error', 'Please Correct all the errors in red');
111 _this.dialog.el.mask("Saving");
112 _this.form.doAction("submit");
122 xtype : 'ContentPanel',
133 url : baseURL + '/Roo/Companies.php',
135 actioncomplete : function(f, act) {
136 _this.dialog.el.unmask();
137 //console.log('load completed');
138 // error messages?????
139 if(act.type == 'setdata'){
140 this.load({ method: 'GET', params: { '_id' : _this.data.id }});
144 if (act.type == 'load') {
145 _this.data = act.result.data;
146 var meth = _this.data.comptype == 'OWNER' ? 'disable' : 'enable';
149 if (_this.form.findField('comptype')) {
150 _this.form.findField('comptype')[meth]();
158 if (act.type == 'submit') { // only submitted here if we are
161 if (_this.callback) {
162 _this.callback.call(this, act.result.data);
168 actionfailed : function(f, act) {
169 _this.dialog.el.unmask();
171 Pman.standardActionFailed(f,act);
174 rendered : function (form)
191 fieldLabel : _this._strings['b33457e7e1cd5dbf1db34a0c60fcb75f'] /* Company ID (for filing Ref.) */,
193 qtip : _this._strings['733640ec0c9367df1b4d85eb286ed9ae'] /* Enter code */,
202 displayField : 'display_name',
203 emptyText : _this._strings['023a5dfa857c4aa0156e6685231a1dbd'] /* Select Type */,
204 fieldLabel : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'] /* Type */,
205 forceSelection : true,
206 hiddenName : 'comptype',
208 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
210 name : 'comptype_display_name',
212 qtip : _this._strings['8535bcc0f05358a583bb432bbadf7e0d'] /* Select type */,
213 queryParam : 'query[name]',
214 selectOnFocus : true,
215 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> : {display_name}</div>',
216 triggerAction : 'all',
221 render : function (_self)
223 _this.etypeCombo = _self;
231 sortInfo : { direction : 'ASC', field: 'id' },
233 beforeload : function (_self, o){
234 o.params = o.params || {};
236 //o.params['query[empty_etype]'] = 1;
237 o.params.etype = 'COMPTYPE';
245 url : baseURL + '/Roo/core_enum.php',
250 xtype : 'JsonReader',
251 fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}],
254 totalProperty : 'total',
263 fieldLabel : _this._strings['e7b47c58815acf1d3afa59a84b5db7fb'] /* Company Name */,
265 qtip : _this._strings['4ef6052d74436756f08e95fd63949653'] /* Enter Company Name */,
273 fieldLabel : _this._strings['bcc254b55c4a1babdf1dcb82c207506b'] /* Phone */,
275 qtip : _this._strings['bc3a4c40d007b8d610a16312970e5cb3'] /* Enter Phone Number */,
283 fieldLabel : _this._strings['9810aa2b9f44401be4bf73188ef2b67d'] /* Fax */,
285 qtip : _this._strings['cf3a5d25d39613ad5bbc2f5eb0f9b675'] /* Enter Fax Number */,
293 fieldLabel : _this._strings['ce8ae9da5b7cd6c3df2929543a9af92d'] /* Email */,
295 qtip : _this._strings['9f86c00615b1a210935ac28ff8ebbb22'] /* Enter Email Address */,
303 fieldLabel : _this._strings['02a3a357710cc2a5dfdfb74ed012fb59'] /* Url */,
305 qtip : _this._strings['8c04eb09879a05470fae436ba76e3bb9'] /* Enter Url */,
313 fieldLabel : _this._strings['dd7bf230fde8d4836917806aff6a6b27'] /* Address */,
315 qtip : _this._strings['32c4e9483403d60115b21519178e5384'] /* Enter Address */,
323 fieldLabel : _this._strings['231bc72756b5e6de492aaaa1577f61b1'] /* Remarks */,
326 qtip : _this._strings['c54b90756cfbeff9217293b567cb2eb0'] /* Enter remarks */,
341 xtype : 'ColorField',
342 fieldLabel : _this._strings['35cb9e66ff801a819684ee0fbeabaeeb'] /* Background Colour */,
343 name : 'background_color',
348 xtype : 'DisplayField',
349 fieldLabel : _this._strings['bc87ef2144ae15ef4f78211e73948051'] /* Logo Image */,
351 icon : 'rootURL + \'images/default/dd/drop-add.gif\'',
353 style : 'border: 1px solid #ccc;',
354 valueRenderer : function(v) {
355 //var vp = v ? v : 'Companies:' + _this.data.id + ':-LOGO';
357 return "No Image Available" + '<BR/>';
359 return String.format('<a target="_new" href="{1}"><img src="{0}" width="150"></a>',
360 baseURL + '/Images/Thumb/150x150/' + v + '/logo.jpg',
361 baseURL + '/Images/'+v+'/logo.jpg' // fixme - put escaped company name..
370 text : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
372 click : function (_self, e)
374 var _t = _this.form.findField('logo_id');
376 Pman.Dialog.Image.show({
378 ontable : 'Companies',
382 _t.setValue(data.id);