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',
34 beforeshow : function (_self)
36 if (data.isOwner || !Pman.Login.isOwner()) {
37 this.dialog.setTitle("Your Company Details");
38 if (this.form.findField('comptype')) {
39 this.form.findField('comptype').disable();
46 this.dialog.setTitle(data.id ? "Edit Company" : "Add Company");
47 if (this.form.findField('comptype')) {
48 this.form.findField('comptype').enable();
60 title : "Edit Companies",
64 xtype: 'ContentPanel',
74 actionfailed : function(f, act) {
75 _this.dialog.el.unmask();
77 Pman.standardActionFailed(f,act);
80 actioncomplete : function(f, act) {
81 _this.dialog.el.unmask();
82 //console.log('load completed');
83 // error messages?????
86 if (act.type == 'load') {
88 _this.data = act.result.data;
89 var meth = _this.data.isOwner || !Pman.Login.isOwner() ? 'disable' : 'enable';
92 if (_this.form.findField('comptype')) {
93 _this.form.findField('comptype')[meth]();
101 if (act.type == 'submit') { // only submitted here if we are
104 if (_this.callback) {
105 _this.callback.call(this, act.result.data);
111 rendered : function (form)
128 fieldLabel : 'Company ID (for filing Ref.)',
137 displayField : 'desc',
139 emptyText : "Select Type",
141 hiddenName : 'comptype',
143 name : 'comptype_name',
144 qtip : "Select Company type",
145 selectOnFocus : true,
146 triggerAction : 'all',
151 xtype: 'SimpleStore',
153 data : '[ \'CONSULTANT\', "Consultant" ],[ \'CLIENT\' , "Client" ],[ \'CONTRACTOR\' , "Contractor" ]',
154 fields : '[\'val\', \'desc\']'
161 fieldLabel : 'Company Name',
163 qtip : "Enter Company Name",
170 fieldLabel : 'Phone',
172 qtip : "Enter Phone Number",
181 qtip : "Enter Fax Number",
188 fieldLabel : 'Email',
190 qtip : "Enter Email Address",
197 fieldLabel : 'Address',
199 qtip : "Enter Address",
206 fieldLabel : 'Remarks',
209 qtip : "Enter remarks",
223 fieldLabel : 'Background Colour',
224 name : 'background_color'
227 xtype: 'DisplayField',
229 fieldLabel : 'Logo Image',
231 icon : 'rootURL + \'images/default/dd/drop-add.gif\'',
233 style : 'border: 1px solid #ccc;',
235 valueRenderer : function(v) {
236 //var vp = v ? v : 'Companies:' + _this.data.id + ':-LOGO';
238 return "No Image Available" + '<BR/>';
240 return String.format('<img src="{0}" width="150">',
241 baseURL + '/Images/Thumb/150x150/' + v + '/logo.jpg'
249 click : function (_self, e)
251 var _t = _this.form.findField('logo_id');
253 Pman.Dialog.Image.show({
255 ontable : 'Companies',
259 _t.setValue(data.id);
285 xtype: 'LayoutRegion',
287 alwaysShowTabs : false,