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?????
64 if(act.type == 'setdata'){
65 if (act.data._fetch) {
66 _this.dialog.el.mask("Loading");
67 _this.form.doAction('load', {
68 url: baseURL + '/Roo/Companies.html',
77 _this.form.setValues(data);
80 if (act.data.isOwner || !Pman.Login.isOwner()) {
81 _this.dialog.setTitle("Your Company Details");
82 if (_this.form.findField('comptype')) {
83 _this.form.findField('comptype').disable();
86 _this.dialog.setTitle(data.id ? "Edit Company" : "Add Company");
87 if (_this.form.findField('comptype')) {
88 _this.form.findField('comptype').enable();
93 if (act.type == 'load') {
94 _this.data = act.result.data;
95 var meth = _this.data.isOwner || !Pman.Login.isOwner() ? 'disable' : 'enable';
98 if (_this.form.findField('comptype')) {
99 _this.form.findField('comptype')[meth]();
107 if (act.type == 'submit') { // only submitted here if we are
110 if (_this.callback) {
111 _this.callback.call(this, act.result.data);
117 rendered : function (form)
124 url : baseURL + '/Roo/Person.php',
135 fieldLabel : 'Company ID (for filing Ref.)',
144 displayField : 'desc',
146 emptyText : "Select Type",
148 hiddenName : 'comptype',
150 name : 'comptype_name',
151 qtip : "Select Company type",
152 selectOnFocus : true,
153 triggerAction : 'all',
158 xtype: 'SimpleStore',
160 data : '[ \'CONSULTANT\', "Consultant" ],[ \'CLIENT\' , "Client" ],[ \'CONTRACTOR\' , "Contractor" ]',
161 fields : '[\'val\', \'desc\']'
168 fieldLabel : 'Company Name',
170 qtip : "Enter Company Name",
177 fieldLabel : 'Phone',
179 qtip : "Enter Phone Number",
188 qtip : "Enter Fax Number",
195 fieldLabel : 'Email',
197 qtip : "Enter Email Address",
204 fieldLabel : 'Address',
206 qtip : "Enter Address",
213 fieldLabel : 'Remarks',
216 qtip : "Enter remarks",
230 fieldLabel : 'Background Colour',
231 name : 'background_color'
234 xtype: 'DisplayField',
236 fieldLabel : 'Logo Image',
238 icon : 'rootURL + \'images/default/dd/drop-add.gif\'',
240 style : 'border: 1px solid #ccc;',
242 valueRenderer : function(v) {
243 //var vp = v ? v : 'Companies:' + _this.data.id + ':-LOGO';
245 return "No Image Available" + '<BR/>';
247 return String.format('<img src="{0}" width="150">',
248 baseURL + '/Images/Thumb/150x150/' + v + '/logo.jpg'
256 click : function (_self, e)
258 var _t = _this.form.findField('logo_id');
260 Pman.Dialog.Image.show({
262 ontable : 'Companies',
266 _t.setValue(data.id);
292 xtype: 'LayoutRegion',
294 alwaysShowTabs : false,