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.BAdminCompany= function() {}
8 Roo.apply(Pman.Dialog.BAdminCompany.prototype, {
11 '1c76cbfe21c6f44c1d1e59d54f3e4420' :"Company",
12 'ce8ae9da5b7cd6c3df2929543a9af92d' :"Email",
13 '231bc72756b5e6de492aaaa1577f61b1' :"Remarks",
14 '1243daf593fa297e07ab03bf06d925af' :"Searching...",
15 'bcc254b55c4a1babdf1dcb82c207506b' :"Phone",
16 'ea4788705e6873b424c65e91c2846b19' :"Cancel",
17 '30a47f1901469a01975f8d24bbb9f701' :"Modify Company",
18 'a1fa27779242b4902f7ae3bdd5c6d508' :"Type",
19 'dd7bf230fde8d4836917806aff6a6b27' :"Address",
20 'c9cc8cce247e49bae79f15173ce97354' :"Save",
21 '9810aa2b9f44401be4bf73188ef2b67d' :"Fax",
22 'e6b391a8d2c4d45902a23a8b6585703d' :"URL"
25 'tel_fieldLabel' : 'bcc254b55c4a1babdf1dcb82c207506b' /* Phone */ ,
26 'comptype_display_name_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
27 'fax_fieldLabel' : '9810aa2b9f44401be4bf73188ef2b67d' /* Fax */ ,
28 'name_fieldLabel' : '1c76cbfe21c6f44c1d1e59d54f3e4420' /* Company */ ,
29 'remarks_fieldLabel' : '231bc72756b5e6de492aaaa1577f61b1' /* Remarks */ ,
30 'url_fieldLabel' : 'e6b391a8d2c4d45902a23a8b6585703d' /* URL */ ,
31 'email_fieldLabel' : 'ce8ae9da5b7cd6c3df2929543a9af92d' /* Email */ ,
32 'address_fieldLabel' : 'dd7bf230fde8d4836917806aff6a6b27' /* Address */ ,
33 'comptype_display_name_fieldLabel' : 'a1fa27779242b4902f7ae3bdd5c6d508' /* Type */
39 show : function(data, cb)
47 this.dialog.show(this.data._el);
50 this.form.setValues(data);
51 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
59 this.dialog = Roo.factory({
61 cls : 'enable-overflow',
63 title : _this._strings['30a47f1901469a01975f8d24bbb9f701'] /* Modify Company */,
65 render : function (_self)
71 '|xns' : 'Roo.bootstrap',
75 html : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
78 click : function (_self, e)
84 '|xns' : 'Roo.bootstrap'
88 html : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
91 click : function (_self, e)
93 if(!_this.form.isValid()){
94 Roo.bootstrap.MessageBox.alert('Error', 'Please Correct all the errors in red');
98 var myID = _this.form.findField('id').getValue();
99 var myName = _this.form.findField('name').getValue();
101 console.log(myID + ' ' + myName);
104 url : baseURL + '/Roo/Core_company.php',
107 id : _this.form.findField('id').getValue() * 1,
108 name : _this.form.findField('name').getValue(),
111 success : function(res) {
114 _this.form.doAction("submit");
116 failure : function(res) {
117 _this.form.doAction("submit");
124 render : function (_self)
130 '|xns' : 'Roo.bootstrap'
136 style : 'width: 100%;',
138 '|xns' : 'Roo.bootstrap',
143 '|xns' : 'Roo.bootstrap',
149 '|xns' : 'Roo.bootstrap',
153 url : baseURL + '/Roo/Core_company.php',
155 actioncomplete : function (_self, action)
157 if(action.type == 'setdata'){
160 if(_this.data.id * 1 > 0) {
161 this.doAction('load',{ method: 'GET', params: { '_id' : _this.data.id }});
162 _this.modal.setTitle('Modify Company');
163 _this.onid.setValue(_this.data.id);
165 if(_this.data.logo_id * 1 > 0) {
166 _this.logo.el.dom.src = String.format('{0}/Images/Thumb/300/{1}/', baseURL, _this.data.logo_id);
169 _this.modal.setTitle('Add Company');
170 _this.onid.setValue('');
171 _this.logo.el.dom.src = '';
173 //_this.type.store.load({});
175 _this.ontable.setValue('core_company');
177 _this.imgtype.setValue('LOGO');
182 if (action.type == 'load') {
183 _this.data = action.result.data;
184 var meth = _this.data.comptype == 'OWNER' ? 'disable' : 'enable';
187 if (_this.form.findField('comptype')) {
188 _this.form.findField('comptype')[meth]();
196 if (action.type == 'submit') { // only submitted here if we are
197 //_this.dialog.hide();
198 if (!_this.img_upload_form.findField('imageUpload')) {
201 if (_this.img_upload_form.findField('imageUpload').getValue() !='') {
202 if(action.result.data.id *1 <= 0) {
205 _this.onid.setValue(action.result.data.id);
206 _this.img_upload_form.doAction("submit");
210 if (_this.callback) {
211 _this.callback.call(this, action.result.data);
217 actionfailed : function (_self, action)
219 //Pman.standardActionFailed(_self,action);
225 Roo.bootstrap.MessageBox.alert(action.result.errorMsg);
228 render : function (_self)
234 '|xns' : 'Roo.bootstrap',
239 '|xns' : 'Roo.bootstrap',
245 '|xns' : 'Roo.bootstrap',
251 displayField : 'display_name',
253 fieldLabel : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'] /* Type */,
254 hiddenName : 'comptype',
257 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
259 name : 'comptype_display_name',
260 queryParam : 'query[name]',
261 selectOnFocus : true,
262 triggerAction : 'all',
266 render : function (_self)
269 _self.store.load({});
273 '|xns' : 'Roo.bootstrap',
277 sortInfo : '{ direction : \'ASC\', field: \'id\' }',
279 beforeload : function (_self, options)
281 options.params = options.params || {};
283 //o.params['query[empty_etype]'] = 1;
284 options.params.etype = 'COMPTYPE';
292 url : baseURL + '/Roo/core_enum.php',
297 xtype : 'JsonReader',
300 totalProperty : 'total',
313 '|xns' : 'Roo.bootstrap',
319 '|xns' : 'Roo.bootstrap',
323 fieldLabel : _this._strings['1c76cbfe21c6f44c1d1e59d54f3e4420'] /* Company */,
327 render : function (_self)
329 _this.company = _self;
333 '|xns' : 'Roo.bootstrap'
342 '|xns' : 'Roo.bootstrap',
348 '|xns' : 'Roo.bootstrap',
352 fieldLabel : _this._strings['bcc254b55c4a1babdf1dcb82c207506b'] /* Phone */,
356 render : function (_self)
362 '|xns' : 'Roo.bootstrap'
371 '|xns' : 'Roo.bootstrap',
377 '|xns' : 'Roo.bootstrap',
381 fieldLabel : _this._strings['9810aa2b9f44401be4bf73188ef2b67d'] /* Fax */,
385 render : function (_self)
391 '|xns' : 'Roo.bootstrap'
400 '|xns' : 'Roo.bootstrap',
406 '|xns' : 'Roo.bootstrap',
410 fieldLabel : _this._strings['ce8ae9da5b7cd6c3df2929543a9af92d'] /* Email */,
414 render : function (_self)
420 '|xns' : 'Roo.bootstrap'
429 '|xns' : 'Roo.bootstrap',
435 '|xns' : 'Roo.bootstrap',
439 fieldLabel : _this._strings['e6b391a8d2c4d45902a23a8b6585703d'] /* URL */,
443 render : function (_self)
449 '|xns' : 'Roo.bootstrap'
458 '|xns' : 'Roo.bootstrap',
464 '|xns' : 'Roo.bootstrap',
468 fieldLabel : _this._strings['dd7bf230fde8d4836917806aff6a6b27'] /* Address */,
472 render : function (_self)
474 _this.address = _self;
478 '|xns' : 'Roo.bootstrap'
487 '|xns' : 'Roo.bootstrap',
493 '|xns' : 'Roo.bootstrap',
497 fieldLabel : _this._strings['231bc72756b5e6de492aaaa1577f61b1'] /* Remarks */,
501 render : function (_self)
503 _this.remarks = _self;
507 '|xns' : 'Roo.bootstrap'
515 inputType : 'hidden',
518 render : function (_self)
520 _this.companyID = _self;
524 '|xns' : 'Roo.bootstrap'
538 Roo.apply(Pman.Dialog.BAdminCompany, Pman.Dialog.BAdminCompany.prototype);