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('');
159 //_this.type.store.load({});
161 _this.ontable.setValue('core_company');
163 _this.imgtype.setValue('LOGO');
168 if (action.type == 'load') {
169 _this.data = action.result.data;
170 var meth = _this.data.comptype == 'OWNER' ? 'disable' : 'enable';
173 if (_this.form.findField('comptype')) {
174 _this.form.findField('comptype')[meth]();
182 if (action.type == 'submit') { // only submitted here if we are
185 if (_this.callback) {
186 _this.callback.call(this, action.result.data);
191 actionfailed : function (_self, action)
193 //Pman.standardActionFailed(_self,action);
195 Roo.bootstrap.MessageBox.alert(action.result.errorMsg);
198 render : function (_self)
204 '|xns' : 'Roo.bootstrap',
208 inputType : 'hidden',
211 render : function (_self)
213 _this.companyID = _self;
217 '|xns' : 'Roo.bootstrap'
223 displayField : 'display_name',
225 fieldLabel : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'] /* Type */,
226 hiddenName : 'comptype',
229 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
231 name : 'comptype_display_name',
232 queryParam : 'query[name]',
233 selectOnFocus : true,
234 triggerAction : 'all',
238 render : function (_self)
241 _self.store.load({});
245 '|xns' : 'Roo.bootstrap',
249 sortInfo : '{ direction : \'ASC\', field: \'id\' }',
251 beforeload : function (_self, options)
253 options.params = options.params || {};
255 //o.params['query[empty_etype]'] = 1;
256 options.params.etype = 'COMPTYPE';
264 url : baseURL + '/Roo/core_enum.php',
269 xtype : 'JsonReader',
272 totalProperty : 'total',
280 fieldLabel : _this._strings['1c76cbfe21c6f44c1d1e59d54f3e4420'] /* Company */,
284 render : function (_self)
286 _this.company = _self;
290 '|xns' : 'Roo.bootstrap'
294 fieldLabel : _this._strings['bcc254b55c4a1babdf1dcb82c207506b'] /* Phone */,
298 render : function (_self)
304 '|xns' : 'Roo.bootstrap'
308 fieldLabel : _this._strings['9810aa2b9f44401be4bf73188ef2b67d'] /* Fax */,
312 render : function (_self)
318 '|xns' : 'Roo.bootstrap'
322 fieldLabel : _this._strings['ce8ae9da5b7cd6c3df2929543a9af92d'] /* Email */,
326 render : function (_self)
332 '|xns' : 'Roo.bootstrap'
336 fieldLabel : _this._strings['e6b391a8d2c4d45902a23a8b6585703d'] /* URL */,
340 render : function (_self)
346 '|xns' : 'Roo.bootstrap'
350 fieldLabel : _this._strings['dd7bf230fde8d4836917806aff6a6b27'] /* Address */,
354 render : function (_self)
356 _this.address = _self;
360 '|xns' : 'Roo.bootstrap'
364 fieldLabel : _this._strings['231bc72756b5e6de492aaaa1577f61b1'] /* Remarks */,
368 render : function (_self)
370 _this.remarks = _self;
374 '|xns' : 'Roo.bootstrap'
384 '|xns' : 'Roo.bootstrap',
389 '|xns' : 'Roo.bootstrap',
394 '|xns' : 'Roo.bootstrap',
398 imgResponsive : true,
399 style : 'text-align: center; margin-left: auto; margin-right: auto; ',
401 render : function (_self)
407 '|xns' : 'Roo.bootstrap'
416 '|xns' : 'Roo.bootstrap',
421 '|xns' : 'Roo.bootstrap',
427 style : 'margin:15px;',
428 url : baseURL + '/Roo/Images.php',
430 actioncomplete : function (_self, action)
432 if(action.type == 'setdata'){
434 if(_this.data.id * 1 > 0) {
435 _this.onid.setValue(_this.data.id);
436 _this.ontable.setValue('coba_company');
441 if (action.type == 'submit') { // only submitted here if we are
442 if (_this.callback) {
443 _this.callback.call(this, action.result.data);
445 console.log(action.result.data);
450 actionfailed : function (_self, action)
454 render : function (_self)
456 _this.img_upload_form = _self;
460 '|xns' : 'Roo.bootstrap',
465 fieldLabel : _this._strings['b999e07cf80ea5eca8e589cd8540a81e'] /* Select Logo */,
467 name : 'imageUpload',
469 '|xns' : 'Roo.bootstrap'
476 render : function (_self)
482 '|xns' : 'Roo.bootstrap'
489 render : function (_self)
491 _this.ontable = _self;
495 '|xns' : 'Roo.bootstrap'
502 render : function (_self)
504 _this.imgtype = _self;
508 '|xns' : 'Roo.bootstrap'
523 '|xns' : 'Roo.bootstrap',
528 '|xns' : 'Roo.bootstrap'
536 Roo.apply(Pman.Dialog.BAdminCompany, Pman.Dialog.BAdminCompany.prototype);