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 'b999e07cf80ea5eca8e589cd8540a81e' :"Select Logo",
15 '1243daf593fa297e07ab03bf06d925af' :"Searching...",
16 'bcc254b55c4a1babdf1dcb82c207506b' :"Phone",
17 'ea4788705e6873b424c65e91c2846b19' :"Cancel",
18 '30a47f1901469a01975f8d24bbb9f701' :"Modify Company",
19 'a1fa27779242b4902f7ae3bdd5c6d508' :"Type",
20 'dd7bf230fde8d4836917806aff6a6b27' :"Address",
21 'c9cc8cce247e49bae79f15173ce97354' :"Save",
22 '9810aa2b9f44401be4bf73188ef2b67d' :"Fax",
23 'e6b391a8d2c4d45902a23a8b6585703d' :"URL"
29 show : function(data, cb)
37 this.dialog.show(this.data._el);
40 this.form.setValues(data);
41 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
49 this.dialog = Roo.factory({
52 title : _this._strings['30a47f1901469a01975f8d24bbb9f701'] /* Modify Company */,
54 render : function (_self)
60 '|xns' : 'Roo.bootstrap',
64 html : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
65 style : 'float: right; margin: 10px;',
68 click : function (_self, e)
74 '|xns' : 'Roo.bootstrap'
78 html : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
79 style : 'float: right; margin: 10px; width: 70px;',
82 click : function (_self, e)
84 if(!_this.form.isValid()){
85 Roo.bootstrap.MessageBox.alert('Error', 'Please Correct all the errors in red');
89 var myID = _this.form.findField('id').getValue();
90 var myName = _this.form.findField('name').getValue();
92 console.log(myID + ' ' + myName);
95 url : baseURL + '/Roo/Core_company.php',
98 id : _this.form.findField('id').getValue() * 1,
99 name : _this.form.findField('name').getValue(),
102 success : function(res) {
105 _this.form.method = 'POST';
106 _this.form.doAction("submit");
108 failure : function(res) {
109 _this.form.method = 'POST';
110 _this.form.doAction("submit");
117 render : function (_self)
123 '|xns' : 'Roo.bootstrap'
131 '|xns' : 'Roo.bootstrap',
137 '|xns' : 'Roo.bootstrap',
141 url : baseURL + '/Roo/Core_company.php',
143 actioncomplete : function (_self, action)
145 if(action.type == 'setdata'){
147 if(_this.data.id * 1 > 0) {
148 this.doAction('load',{ method: 'GET', params: { '_id' : _this.data.id }});
149 _this.modal.setTitle('Modify Company');
150 _this.onid.setValue(_this.data.id);
152 if(_this.data.logo_id * 1 > 0) {
153 _this.logo.el.dom.src = String.format('{0}/Images/Thumb/300/{1}/', baseURL, _this.data.logo_id);
156 _this.modal.setTitle('Add Company');
157 _this.onid.setValue('');
158 _this.logo.el.dom.src = '';
160 //_this.type.store.load({});
162 _this.ontable.setValue('core_company');
164 _this.imgtype.setValue('LOGO');
169 if (action.type == 'load') {
170 _this.data = action.result.data;
171 var meth = _this.data.comptype == 'OWNER' ? 'disable' : 'enable';
174 if (_this.form.findField('comptype')) {
175 _this.form.findField('comptype')[meth]();
183 if (action.type == 'submit') { // only submitted here if we are
186 if (_this.callback) {
187 _this.callback.call(this, action.result.data);
192 actionfailed : function (_self, action)
194 //Pman.standardActionFailed(_self,action);
196 Roo.bootstrap.MessageBox.alert(action.result.errorMsg);
199 render : function (_self)
205 '|xns' : 'Roo.bootstrap',
209 inputType : 'hidden',
212 render : function (_self)
214 _this.companyID = _self;
218 '|xns' : 'Roo.bootstrap'
224 displayField : 'display_name',
226 fieldLabel : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'] /* Type */,
227 hiddenName : 'comptype',
230 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
232 name : 'comptype_display_name',
233 queryParam : 'query[name]',
234 selectOnFocus : true,
235 triggerAction : 'all',
239 render : function (_self)
242 _self.store.load({});
246 '|xns' : 'Roo.bootstrap',
250 sortInfo : '{ direction : \'ASC\', field: \'id\' }',
252 beforeload : function (_self, options)
254 options.params = options.params || {};
256 //o.params['query[empty_etype]'] = 1;
257 options.params.etype = 'COMPTYPE';
265 url : baseURL + '/Roo/core_enum.php',
270 xtype : 'JsonReader',
273 totalProperty : 'total',
281 fieldLabel : _this._strings['1c76cbfe21c6f44c1d1e59d54f3e4420'] /* Company */,
285 render : function (_self)
287 _this.company = _self;
291 '|xns' : 'Roo.bootstrap'
295 fieldLabel : _this._strings['bcc254b55c4a1babdf1dcb82c207506b'] /* Phone */,
299 render : function (_self)
305 '|xns' : 'Roo.bootstrap'
309 fieldLabel : _this._strings['9810aa2b9f44401be4bf73188ef2b67d'] /* Fax */,
313 render : function (_self)
319 '|xns' : 'Roo.bootstrap'
323 fieldLabel : _this._strings['ce8ae9da5b7cd6c3df2929543a9af92d'] /* Email */,
327 render : function (_self)
333 '|xns' : 'Roo.bootstrap'
337 fieldLabel : _this._strings['e6b391a8d2c4d45902a23a8b6585703d'] /* URL */,
341 render : function (_self)
347 '|xns' : 'Roo.bootstrap'
351 fieldLabel : _this._strings['dd7bf230fde8d4836917806aff6a6b27'] /* Address */,
355 render : function (_self)
357 _this.address = _self;
361 '|xns' : 'Roo.bootstrap'
365 fieldLabel : _this._strings['231bc72756b5e6de492aaaa1577f61b1'] /* Remarks */,
369 render : function (_self)
371 _this.remarks = _self;
375 '|xns' : 'Roo.bootstrap'
385 '|xns' : 'Roo.bootstrap',
390 '|xns' : 'Roo.bootstrap',
395 '|xns' : 'Roo.bootstrap',
399 imgResponsive : true,
400 style : 'text-align: center; margin-left: auto; margin-right: auto; ',
402 render : function (_self)
408 '|xns' : 'Roo.bootstrap'
417 '|xns' : 'Roo.bootstrap',
422 '|xns' : 'Roo.bootstrap',
428 style : 'margin:15px;',
429 url : baseURL + '/Roo/Images.php',
431 actioncomplete : function (_self, action)
433 if(action.type == 'setdata'){
435 if(_this.data.id * 1 > 0) {
436 _this.onid.setValue(_this.data.id);
437 _this.ontable.setValue('coba_company');
442 if (action.type == 'submit') { // only submitted here if we are
443 if (_this.callback) {
444 _this.callback.call(this, action.result.data);
446 console.log(action.result.data);
451 actionfailed : function (_self, action)
455 render : function (_self)
457 _this.img_upload_form = _self;
461 '|xns' : 'Roo.bootstrap',
466 fieldLabel : _this._strings['b999e07cf80ea5eca8e589cd8540a81e'] /* Select Logo */,
468 name : 'imageUpload',
470 '|xns' : 'Roo.bootstrap'
477 render : function (_self)
483 '|xns' : 'Roo.bootstrap'
490 render : function (_self)
492 _this.ontable = _self;
496 '|xns' : 'Roo.bootstrap'
503 render : function (_self)
505 _this.imgtype = _self;
509 '|xns' : 'Roo.bootstrap'
524 '|xns' : 'Roo.bootstrap',
529 '|xns' : 'Roo.bootstrap'
537 Roo.apply(Pman.Dialog.BAdminCompany, Pman.Dialog.BAdminCompany.prototype);