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 'b999e07cf80ea5eca8e589cd8540a81e' :"Select Logo",
12 '1c76cbfe21c6f44c1d1e59d54f3e4420' :"Company",
13 'ce8ae9da5b7cd6c3df2929543a9af92d' :"Email",
14 '231bc72756b5e6de492aaaa1577f61b1' :"Remarks",
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({
63 cls : 'enable-overflow',
65 title : _this._strings['30a47f1901469a01975f8d24bbb9f701'] /* Modify Company */,
67 render : function (_self)
73 '|xns' : 'Roo.bootstrap',
77 html : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
80 click : function (_self, e)
86 '|xns' : 'Roo.bootstrap'
90 html : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
93 click : function (_self, e)
95 if(!_this.form.isValid()){
96 Roo.bootstrap.MessageBox.alert('Error', 'Please Correct all the errors in red');
100 var myID = _this.form.findField('id').getValue();
101 var myName = _this.form.findField('name').getValue();
103 console.log(myID + ' ' + myName);
106 url : baseURL + '/Roo/Core_company.php',
109 id : _this.form.findField('id').getValue() * 1,
110 name : _this.form.findField('name').getValue(),
113 success : function(res) {
116 _this.form.doAction("submit");
118 failure : function(res) {
119 _this.form.doAction("submit");
126 render : function (_self)
132 '|xns' : 'Roo.bootstrap'
138 style : 'width: 100%;',
140 '|xns' : 'Roo.bootstrap',
145 '|xns' : 'Roo.bootstrap',
151 '|xns' : 'Roo.bootstrap',
155 imgResponsive : true,
156 style : 'text-align: center; margin-left: auto; margin-right: auto; ',
158 render : function (_self)
164 '|xns' : 'Roo.bootstrap'
172 '|xns' : 'Roo.bootstrap',
178 style : 'margin:15px;',
179 url : baseURL + '/Roo/Images.php',
181 actioncomplete : function (_self, action)
183 if(action.type == 'setdata'){
185 if(_this.data.id * 1 > 0) {
186 _this.onid.setValue(_this.data.id);
187 _this.ontable.setValue('coba_company');
192 if (action.type == 'submit') { // only submitted here if we are
193 //_this.dialog.hide();
194 // replace the logo on the display dialog
195 if(action.result.data.id * 1 > 0) {
196 _this.logo.el.dom.src = String.format('{0}/Images/Thumb/300/{1}/', baseURL, action.result.data.id );
199 url : baseURL + '/Roo/Core_company.php',
202 id : _this.img_upload_form.findField('onid').getValue() * 1,
203 logo_id: action.result.data.id
205 success : function(res) {
208 failure : function(res) {
214 if (_this.callback) {
215 _this.callback.call(this, action.result.data);
217 console.log(action.result.data);
222 actionfailed : function (_self, action)
226 render : function (_self)
228 _this.img_upload_form = _self;
232 '|xns' : 'Roo.bootstrap',
237 fieldLabel : _this._strings['b999e07cf80ea5eca8e589cd8540a81e'] /* Select Logo */,
238 forceFeedback : true,
240 name : 'imageUpload',
242 '|xns' : 'Roo.bootstrap'
246 inputType : 'hidden',
249 render : function (_self)
255 '|xns' : 'Roo.bootstrap'
259 inputType : 'hidden',
262 render : function (_self)
264 _this.ontable = _self;
268 '|xns' : 'Roo.bootstrap'
272 inputType : 'hidden',
275 render : function (_self)
277 _this.imgtype = _self;
281 '|xns' : 'Roo.bootstrap'
292 '|xns' : 'Roo.bootstrap',
298 '|xns' : 'Roo.bootstrap',
302 url : baseURL + '/Roo/Core_company.php',
304 actioncomplete : function (_self, action)
306 if(action.type == 'setdata'){
308 _this.img_upload_form.reset();
309 if(_this.data.id * 1 > 0) {
310 this.doAction('load',{ method: 'GET', params: { '_id' : _this.data.id }});
311 _this.modal.setTitle('Modify Company');
312 _this.onid.setValue(_this.data.id);
314 if(_this.data.logo_id * 1 > 0) {
315 _this.logo.el.dom.src = String.format('{0}/Images/Thumb/300/{1}/', baseURL, _this.data.logo_id);
318 _this.modal.setTitle('Add Company');
319 _this.onid.setValue('');
320 _this.logo.el.dom.src = '';
322 //_this.type.store.load({});
324 _this.ontable.setValue('core_company');
326 _this.imgtype.setValue('LOGO');
331 if (action.type == 'load') {
332 _this.data = action.result.data;
333 var meth = _this.data.comptype == 'OWNER' ? 'disable' : 'enable';
336 if (_this.form.findField('comptype')) {
337 _this.form.findField('comptype')[meth]();
345 if (action.type == 'submit') { // only submitted here if we are
346 //_this.dialog.hide();
347 if (!_this.img_upload_form.findField('imageUpload')) {
350 if (_this.img_upload_form.findField('imageUpload').getValue() !='') {
351 if(action.result.data.id *1 <= 0) {
354 _this.onid.setValue(action.result.data.id);
355 _this.img_upload_form.doAction("submit");
359 if (_this.callback) {
360 _this.callback.call(this, action.result.data);
366 actionfailed : function (_self, action)
368 //Pman.standardActionFailed(_self,action);
374 Roo.bootstrap.MessageBox.alert(action.result.errorMsg);
377 render : function (_self)
383 '|xns' : 'Roo.bootstrap',
388 '|xns' : 'Roo.bootstrap',
394 '|xns' : 'Roo.bootstrap',
400 displayField : 'display_name',
402 fieldLabel : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'] /* Type */,
403 hiddenName : 'comptype',
406 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
408 name : 'comptype_display_name',
409 queryParam : 'query[name]',
410 selectOnFocus : true,
411 triggerAction : 'all',
415 render : function (_self)
418 _self.store.load({});
422 '|xns' : 'Roo.bootstrap',
426 sortInfo : '{ direction : \'ASC\', field: \'id\' }',
428 beforeload : function (_self, options)
430 options.params = options.params || {};
432 //o.params['query[empty_etype]'] = 1;
433 options.params.etype = 'COMPTYPE';
441 url : baseURL + '/Roo/core_enum.php',
446 xtype : 'JsonReader',
449 totalProperty : 'total',
462 '|xns' : 'Roo.bootstrap',
468 '|xns' : 'Roo.bootstrap',
472 fieldLabel : _this._strings['1c76cbfe21c6f44c1d1e59d54f3e4420'] /* Company */,
476 render : function (_self)
478 _this.company = _self;
482 '|xns' : 'Roo.bootstrap'
491 '|xns' : 'Roo.bootstrap',
497 '|xns' : 'Roo.bootstrap',
501 fieldLabel : _this._strings['bcc254b55c4a1babdf1dcb82c207506b'] /* Phone */,
506 render : function (_self)
512 '|xns' : 'Roo.bootstrap'
521 '|xns' : 'Roo.bootstrap',
527 '|xns' : 'Roo.bootstrap',
531 fieldLabel : _this._strings['9810aa2b9f44401be4bf73188ef2b67d'] /* Fax */,
536 render : function (_self)
542 '|xns' : 'Roo.bootstrap'
551 '|xns' : 'Roo.bootstrap',
557 '|xns' : 'Roo.bootstrap',
561 fieldLabel : _this._strings['ce8ae9da5b7cd6c3df2929543a9af92d'] /* Email */,
566 render : function (_self)
572 '|xns' : 'Roo.bootstrap'
581 '|xns' : 'Roo.bootstrap',
587 '|xns' : 'Roo.bootstrap',
591 fieldLabel : _this._strings['e6b391a8d2c4d45902a23a8b6585703d'] /* URL */,
595 render : function (_self)
601 '|xns' : 'Roo.bootstrap'
610 '|xns' : 'Roo.bootstrap',
616 '|xns' : 'Roo.bootstrap',
620 fieldLabel : _this._strings['dd7bf230fde8d4836917806aff6a6b27'] /* Address */,
625 render : function (_self)
627 _this.address = _self;
631 '|xns' : 'Roo.bootstrap'
640 '|xns' : 'Roo.bootstrap',
646 '|xns' : 'Roo.bootstrap',
650 fieldLabel : _this._strings['231bc72756b5e6de492aaaa1577f61b1'] /* Remarks */,
655 render : function (_self)
657 _this.remarks = _self;
661 '|xns' : 'Roo.bootstrap'
669 inputType : 'hidden',
672 render : function (_self)
674 _this.companyID = _self;
678 '|xns' : 'Roo.bootstrap'
692 Roo.apply(Pman.Dialog.BAdminCompany, Pman.Dialog.BAdminCompany.prototype);