1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Dialog.CoreCompanies = {
10 show : function(data, cb)
18 this.dialog.show(this.data._el);
21 this.form.setValues(data);
22 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
30 this.dialog = Roo.factory({
31 xtype: 'LayoutDialog',
40 title : "Edit Companies",
44 xtype: 'ContentPanel',
54 actionfailed : function(f, act) {
55 _this.dialog.el.unmask();
57 Pman.standardActionFailed(f,act);
60 actioncomplete : function(f, act) {
61 _this.dialog.el.unmask();
62 //console.log('load completed');
63 // error messages?????
66 if (act.type == 'load') {
68 _this.data = act.result.data;
69 var meth = _this.data.isOwner || !Pman.Login.isOwner() ? 'disable' : 'enable';
72 if (_this.form.findField('comptype')) {
73 _this.form.findField('comptype')[meth]();
81 if (act.type == 'submit') { // only submitted here if we are
85 _this.callback.call(this, act.result.data);
91 rendered : function (form)
108 fieldLabel : 'Company ID (for filing Ref.)',
117 displayField : 'desc',
119 emptyText : "Select Type",
121 hiddenName : 'comptype',
123 name : 'comptype_name',
124 qtip : "Select Company type",
125 selectOnFocus : true,
126 triggerAction : 'all',
131 xtype: 'SimpleStore',
133 data : '[ \'CONSULTANT\', "Consultant" ],[ \'CLIENT\' , "Client" ],[ \'CONTRACTOR\' , "Contractor" ]',
134 fields : '[\'val\', \'desc\']'
141 fieldLabel : 'Company Name',
143 qtip : "Enter Company Name",
150 fieldLabel : 'Phone',
152 qtip : "Enter Phone Number",
161 qtip : "Enter Fax Number",
168 fieldLabel : 'Email',
170 qtip : "Enter Email Address",
177 fieldLabel : 'Address',
179 qtip : "Enter Address",
186 fieldLabel : 'Remarks',
189 qtip : "Enter remarks",
203 fieldLabel : 'Background Colour',
204 name : 'background_color'
207 xtype: 'DisplayField',
209 fieldLabel : 'Logo Image',
211 icon : 'rootURL + \'images/default/dd/drop-add.gif\'',
212 style : 'border: 1px solid #ccc;',
214 valueRenderer : function(v) {
215 //var vp = v ? v : 'Companies:' + _this.data.id + ':-LOGO';
217 return "No Image Available" + '<BR/>';
219 return String.format('<img src="{0}" width="150">',
220 baseURL + '/Images/Thumb/150x150/' + v + '/logo.jpg'
228 click : function (_self, e)
232 Pman.Dialog.Image.show({
234 ontable : 'Companies',
238 _t.setValue(data.id);
264 xtype: 'LayoutRegion',
266 alwaysShowTabs : false,