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 : "Add / Edit Organization",
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 this.load({ method: 'GET', params: { '_id' : _this.data.id }});
69 if (act.type == 'load') {
70 _this.data = act.result.data;
71 var meth = _this.data.comptype == 'OWNER' ? 'disable' : 'enable';
74 if (_this.form.findField('comptype')) {
75 _this.form.findField('comptype')[meth]();
83 if (act.type == 'submit') { // only submitted here if we are
87 _this.callback.call(this, act.result.data);
93 rendered : function (form)
100 url : baseURL + '/Roo/Companies.php',
111 fieldLabel : 'Company ID (for filing Ref.)',
120 render : function (_self)
122 _this.etypeCombo = _self;
126 displayField : 'display_name',
127 emptyText : "Select Type",
129 forceSelection : true,
130 hiddenName : 'comptype',
132 loadingText : "Searching...",
134 name : 'comptype_display_name',
136 qtip : "Select type",
137 queryParam : 'query[name]',
138 selectOnFocus : true,
139 tpl : '<div class="x-grid-cell-text x-btn button"><b>{name}</b> : {display_name}</div>',
140 triggerAction : 'all',
148 beforeload : function (_self, o){
149 o.params = o.params || {};
151 //o.params['query[empty_etype]'] = 1;
152 o.params.etype = 'COMPTYPE';
156 sortInfo : { direction : 'ASC', field: 'id' },
161 url : baseURL + '/Roo/core_enum.php'
168 totalProperty : 'total',
169 fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}]
177 fieldLabel : 'Company Name',
179 qtip : "Enter Company Name",
186 fieldLabel : 'Phone',
188 qtip : "Enter Phone Number",
197 qtip : "Enter Fax Number",
204 fieldLabel : 'Email',
206 qtip : "Enter Email Address",
222 fieldLabel : 'Address',
224 qtip : "Enter Address",
231 fieldLabel : 'Remarks',
234 qtip : "Enter remarks",
248 fieldLabel : 'Background Colour',
249 name : 'background_color'
252 xtype: 'DisplayField',
254 fieldLabel : 'Logo Image',
256 icon : 'rootURL + \'images/default/dd/drop-add.gif\'',
258 style : 'border: 1px solid #ccc;',
260 valueRenderer : function(v) {
261 //var vp = v ? v : 'Companies:' + _this.data.id + ':-LOGO';
263 return "No Image Available" + '<BR/>';
265 return String.format('<img src="{0}" width="150">',
266 baseURL + '/Images/Thumb/150x150/' + v + '/logo.jpg'
274 click : function (_self, e)
276 var _t = _this.form.findField('logo_id');
278 Pman.Dialog.Image.show({
280 ontable : 'Companies',
284 _t.setValue(data.id);
305 xtype: 'LayoutRegion',
307 alwaysShowTabs : false,
318 click : function (_self, e)
329 click : function (_self, e)
334 _this.dialog.el.mask("Saving");
335 _this.form.doAction("submit");