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 _this.img_upload_form.reset();
148 if(_this.data.id * 1 > 0) {
149 this.doAction('load',{ method: 'GET', params: { '_id' : _this.data.id }});
150 _this.modal.setTitle('Modify Company');
151 _this.onid.setValue(_this.data.id);
153 if(_this.data.logo_id * 1 > 0) {
154 _this.logo.el.dom.src = String.format('{0}/Images/Thumb/300/{1}/', baseURL, _this.data.logo_id);
157 _this.modal.setTitle('Add Company');
158 _this.onid.setValue('');
159 _this.logo.el.dom.src = '';
161 //_this.type.store.load({});
163 _this.ontable.setValue('core_company');
165 _this.imgtype.setValue('LOGO');
170 if (action.type == 'load') {
171 _this.data = action.result.data;
172 var meth = _this.data.comptype == 'OWNER' ? 'disable' : 'enable';
175 if (_this.form.findField('comptype')) {
176 _this.form.findField('comptype')[meth]();
184 if (action.type == 'submit') { // only submitted here if we are
185 //_this.dialog.hide();
187 if(_this.logo.getValue()!='')
189 _this.img_upload_form.method = 'POST';
190 _this.form.doAction("submit");
193 if (_this.callback) {
194 _this.callback.call(this, action.result.data);
199 actionfailed : function (_self, action)
201 //Pman.standardActionFailed(_self,action);
203 Roo.bootstrap.MessageBox.alert(action.result.errorMsg);
206 render : function (_self)
212 '|xns' : 'Roo.bootstrap',
216 inputType : 'hidden',
219 render : function (_self)
221 _this.companyID = _self;
225 '|xns' : 'Roo.bootstrap'
231 displayField : 'display_name',
233 fieldLabel : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'] /* Type */,
234 hiddenName : 'comptype',
237 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
239 name : 'comptype_display_name',
240 queryParam : 'query[name]',
241 selectOnFocus : true,
242 triggerAction : 'all',
246 render : function (_self)
249 _self.store.load({});
253 '|xns' : 'Roo.bootstrap',
257 sortInfo : '{ direction : \'ASC\', field: \'id\' }',
259 beforeload : function (_self, options)
261 options.params = options.params || {};
263 //o.params['query[empty_etype]'] = 1;
264 options.params.etype = 'COMPTYPE';
272 url : baseURL + '/Roo/core_enum.php',
277 xtype : 'JsonReader',
280 totalProperty : 'total',
288 fieldLabel : _this._strings['1c76cbfe21c6f44c1d1e59d54f3e4420'] /* Company */,
292 render : function (_self)
294 _this.company = _self;
298 '|xns' : 'Roo.bootstrap'
302 fieldLabel : _this._strings['bcc254b55c4a1babdf1dcb82c207506b'] /* Phone */,
306 render : function (_self)
312 '|xns' : 'Roo.bootstrap'
316 fieldLabel : _this._strings['9810aa2b9f44401be4bf73188ef2b67d'] /* Fax */,
320 render : function (_self)
326 '|xns' : 'Roo.bootstrap'
330 fieldLabel : _this._strings['ce8ae9da5b7cd6c3df2929543a9af92d'] /* Email */,
334 render : function (_self)
340 '|xns' : 'Roo.bootstrap'
344 fieldLabel : _this._strings['e6b391a8d2c4d45902a23a8b6585703d'] /* URL */,
348 render : function (_self)
354 '|xns' : 'Roo.bootstrap'
358 fieldLabel : _this._strings['dd7bf230fde8d4836917806aff6a6b27'] /* Address */,
362 render : function (_self)
364 _this.address = _self;
368 '|xns' : 'Roo.bootstrap'
372 fieldLabel : _this._strings['231bc72756b5e6de492aaaa1577f61b1'] /* Remarks */,
376 render : function (_self)
378 _this.remarks = _self;
382 '|xns' : 'Roo.bootstrap'
392 '|xns' : 'Roo.bootstrap',
397 '|xns' : 'Roo.bootstrap',
402 '|xns' : 'Roo.bootstrap',
406 imgResponsive : true,
407 style : 'text-align: center; margin-left: auto; margin-right: auto; ',
409 render : function (_self)
415 '|xns' : 'Roo.bootstrap'
424 '|xns' : 'Roo.bootstrap',
429 '|xns' : 'Roo.bootstrap',
435 style : 'margin:15px;',
436 url : baseURL + '/Roo/Images.php',
438 actioncomplete : function (_self, action)
440 if(action.type == 'setdata'){
442 if(_this.data.id * 1 > 0) {
443 _this.onid.setValue(_this.data.id);
444 _this.ontable.setValue('coba_company');
449 if (action.type == 'submit') { // only submitted here if we are
450 if (_this.callback) {
451 _this.callback.call(this, action.result.data);
453 console.log(action.result.data);
458 actionfailed : function (_self, action)
462 render : function (_self)
464 _this.img_upload_form = _self;
468 '|xns' : 'Roo.bootstrap',
473 fieldLabel : _this._strings['b999e07cf80ea5eca8e589cd8540a81e'] /* Select Logo */,
474 forceFeedback : true,
477 'change' : function(e) {
481 name : 'imageUpload',
483 change : function (_self, newValue, oldValue)
485 console.log(newValue);
489 '|xns' : 'Roo.bootstrap'
496 render : function (_self)
502 '|xns' : 'Roo.bootstrap'
509 render : function (_self)
511 _this.ontable = _self;
515 '|xns' : 'Roo.bootstrap'
522 render : function (_self)
524 _this.imgtype = _self;
528 '|xns' : 'Roo.bootstrap'
543 '|xns' : 'Roo.bootstrap',
548 '|xns' : 'Roo.bootstrap'
556 Roo.apply(Pman.Dialog.BAdminCompany, Pman.Dialog.BAdminCompany.prototype);