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"
26 'tel_fieldLabel' : 'bcc254b55c4a1babdf1dcb82c207506b' /* Phone */ ,
27 'comptype_display_name_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
28 'fax_fieldLabel' : '9810aa2b9f44401be4bf73188ef2b67d' /* Fax */ ,
29 'name_fieldLabel' : '1c76cbfe21c6f44c1d1e59d54f3e4420' /* Company */ ,
30 'remarks_fieldLabel' : '231bc72756b5e6de492aaaa1577f61b1' /* Remarks */ ,
31 'url_fieldLabel' : 'e6b391a8d2c4d45902a23a8b6585703d' /* URL */ ,
32 'email_fieldLabel' : 'ce8ae9da5b7cd6c3df2929543a9af92d' /* Email */ ,
33 'address_fieldLabel' : 'dd7bf230fde8d4836917806aff6a6b27' /* Address */ ,
34 'imageUpload_fieldLabel' : 'b999e07cf80ea5eca8e589cd8540a81e' /* Select Logo */ ,
35 'comptype_display_name_fieldLabel' : 'a1fa27779242b4902f7ae3bdd5c6d508' /* Type */
41 show : function(data, cb)
49 this.dialog.show(this.data._el);
52 this.form.setValues(data);
53 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
61 this.dialog = Roo.factory({
64 title : _this._strings['30a47f1901469a01975f8d24bbb9f701'] /* Modify Company */,
66 render : function (_self)
72 '|xns' : 'Roo.bootstrap',
76 html : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
79 click : function (_self, e)
85 '|xns' : 'Roo.bootstrap'
89 html : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
92 click : function (_self, e)
94 if(!_this.form.isValid()){
95 Roo.bootstrap.MessageBox.alert('Error', 'Please Correct all the errors in red');
99 var myID = _this.form.findField('id').getValue();
100 var myName = _this.form.findField('name').getValue();
102 console.log(myID + ' ' + myName);
105 url : baseURL + '/Roo/Core_company.php',
108 id : _this.form.findField('id').getValue() * 1,
109 name : _this.form.findField('name').getValue(),
112 success : function(res) {
115 _this.form.doAction("submit");
117 failure : function(res) {
118 _this.form.doAction("submit");
125 render : function (_self)
131 '|xns' : 'Roo.bootstrap'
139 '|xns' : 'Roo.bootstrap',
144 '|xns' : 'Roo.bootstrap',
150 '|xns' : 'Roo.bootstrap',
155 '|xns' : 'Roo.bootstrap',
160 '|xns' : 'Roo.bootstrap',
164 imgResponsive : true,
165 style : 'text-align: center; margin-left: auto; margin-right: auto; ',
167 render : function (_self)
173 '|xns' : 'Roo.bootstrap'
189 '|xns' : 'Roo.bootstrap',
195 '|xns' : 'Roo.bootstrap',
199 url : baseURL + '/Roo/Core_company.php',
201 actioncomplete : function (_self, action)
203 if(action.type == 'setdata'){
205 _this.img_upload_form.reset();
206 if(_this.data.id * 1 > 0) {
207 this.doAction('load',{ method: 'GET', params: { '_id' : _this.data.id }});
208 _this.modal.setTitle('Modify Company');
209 _this.onid.setValue(_this.data.id);
211 if(_this.data.logo_id * 1 > 0) {
212 _this.logo.el.dom.src = String.format('{0}/Images/Thumb/300/{1}/', baseURL, _this.data.logo_id);
215 _this.modal.setTitle('Add Company');
216 _this.onid.setValue('');
217 _this.logo.el.dom.src = '';
219 //_this.type.store.load({});
221 _this.ontable.setValue('core_company');
223 _this.imgtype.setValue('LOGO');
228 if (action.type == 'load') {
229 _this.data = action.result.data;
230 var meth = _this.data.comptype == 'OWNER' ? 'disable' : 'enable';
233 if (_this.form.findField('comptype')) {
234 _this.form.findField('comptype')[meth]();
242 if (action.type == 'submit') { // only submitted here if we are
243 //_this.dialog.hide();
244 if (!_this.img_upload_form.findField('imageUpload')) {
247 if (_this.img_upload_form.findField('imageUpload').getValue() !='') {
248 if(action.result.data.id *1 <= 0) {
251 _this.onid.setValue(action.result.data.id);
252 _this.img_upload_form.doAction("submit");
256 if (_this.callback) {
257 _this.callback.call(this, action.result.data);
263 actionfailed : function (_self, action)
265 //Pman.standardActionFailed(_self,action);
271 Roo.bootstrap.MessageBox.alert(action.result.errorMsg);
274 render : function (_self)
280 '|xns' : 'Roo.bootstrap',
284 inputType : 'hidden',
287 render : function (_self)
289 _this.companyID = _self;
293 '|xns' : 'Roo.bootstrap'
299 displayField : 'display_name',
301 fieldLabel : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'] /* Type */,
302 hiddenName : 'comptype',
305 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
307 name : 'comptype_display_name',
308 queryParam : 'query[name]',
309 selectOnFocus : true,
310 triggerAction : 'all',
314 render : function (_self)
317 _self.store.load({});
321 '|xns' : 'Roo.bootstrap',
325 sortInfo : '{ direction : \'ASC\', field: \'id\' }',
327 beforeload : function (_self, options)
329 options.params = options.params || {};
331 //o.params['query[empty_etype]'] = 1;
332 options.params.etype = 'COMPTYPE';
340 url : baseURL + '/Roo/core_enum.php',
345 xtype : 'JsonReader',
348 totalProperty : 'total',
356 fieldLabel : _this._strings['1c76cbfe21c6f44c1d1e59d54f3e4420'] /* Company */,
360 render : function (_self)
362 _this.company = _self;
366 '|xns' : 'Roo.bootstrap'
370 fieldLabel : _this._strings['bcc254b55c4a1babdf1dcb82c207506b'] /* Phone */,
374 render : function (_self)
380 '|xns' : 'Roo.bootstrap'
384 fieldLabel : _this._strings['9810aa2b9f44401be4bf73188ef2b67d'] /* Fax */,
388 render : function (_self)
394 '|xns' : 'Roo.bootstrap'
398 fieldLabel : _this._strings['ce8ae9da5b7cd6c3df2929543a9af92d'] /* Email */,
402 render : function (_self)
408 '|xns' : 'Roo.bootstrap'
412 fieldLabel : _this._strings['e6b391a8d2c4d45902a23a8b6585703d'] /* URL */,
416 render : function (_self)
422 '|xns' : 'Roo.bootstrap'
426 fieldLabel : _this._strings['dd7bf230fde8d4836917806aff6a6b27'] /* Address */,
430 render : function (_self)
432 _this.address = _self;
436 '|xns' : 'Roo.bootstrap'
440 fieldLabel : _this._strings['231bc72756b5e6de492aaaa1577f61b1'] /* Remarks */,
444 render : function (_self)
446 _this.remarks = _self;
450 '|xns' : 'Roo.bootstrap'
460 '|xns' : 'Roo.bootstrap',
465 '|xns' : 'Roo.bootstrap',
470 '|xns' : 'Roo.bootstrap',
474 imgResponsive : true,
475 style : 'text-align: center; margin-left: auto; margin-right: auto; ',
477 render : function (_self)
483 '|xns' : 'Roo.bootstrap'
492 '|xns' : 'Roo.bootstrap',
497 '|xns' : 'Roo.bootstrap',
503 style : 'margin:15px;',
504 url : baseURL + '/Roo/Images.php',
506 actioncomplete : function (_self, action)
508 if(action.type == 'setdata'){
510 if(_this.data.id * 1 > 0) {
511 _this.onid.setValue(_this.data.id);
512 _this.ontable.setValue('coba_company');
517 if (action.type == 'submit') { // only submitted here if we are
518 //_this.dialog.hide();
519 // replace the logo on the display dialog
520 if(action.result.data.id * 1 > 0) {
521 _this.logo.el.dom.src = String.format('{0}/Images/Thumb/300/{1}/', baseURL, action.result.data.id );
524 url : baseURL + '/Roo/Core_company.php',
527 id : _this.img_upload_form.findField('onid').getValue() * 1,
528 logo_id: action.result.data.id
530 success : function(res) {
533 failure : function(res) {
539 if (_this.callback) {
540 _this.callback.call(this, action.result.data);
542 console.log(action.result.data);
547 actionfailed : function (_self, action)
551 render : function (_self)
553 _this.img_upload_form = _self;
557 '|xns' : 'Roo.bootstrap',
562 fieldLabel : _this._strings['b999e07cf80ea5eca8e589cd8540a81e'] /* Select Logo */,
563 forceFeedback : true,
566 'change' : function(e) {
570 name : 'imageUpload',
572 change : function (_self, newValue, oldValue)
574 console.log(newValue);
578 '|xns' : 'Roo.bootstrap'
582 inputType : 'hidden',
585 render : function (_self)
591 '|xns' : 'Roo.bootstrap'
595 inputType : 'hidden',
598 render : function (_self)
600 _this.ontable = _self;
604 '|xns' : 'Roo.bootstrap'
608 inputType : 'hidden',
611 render : function (_self)
613 _this.imgtype = _self;
617 '|xns' : 'Roo.bootstrap'
632 '|xns' : 'Roo.bootstrap',
637 '|xns' : 'Roo.bootstrap'
645 Roo.apply(Pman.Dialog.BAdminCompany, Pman.Dialog.BAdminCompany.prototype);