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');
151 _this.modal.setTitle('Add Company');
153 //_this.type.store.load({});
154 if(_this.data.logo_id * 1 > 0) {
155 _this.logo.el.dom.src = String.format('{0}/Images/Thumb/300/{1}/', baseURL, _this.data.logo_id);
161 if (action.type == 'load') {
162 _this.data = action.result.data;
163 var meth = _this.data.comptype == 'OWNER' ? 'disable' : 'enable';
166 if (_this.form.findField('comptype')) {
167 _this.form.findField('comptype')[meth]();
175 if (action.type == 'submit') { // only submitted here if we are
178 if (_this.callback) {
179 _this.callback.call(this, action.result.data);
184 actionfailed : function (_self, action)
186 //Pman.standardActionFailed(_self,action);
188 Roo.bootstrap.MessageBox.alert(action.result.errorMsg);
191 render : function (_self)
197 '|xns' : 'Roo.bootstrap',
201 inputType : 'hidden',
204 render : function (_self)
206 _this.companyID = _self;
210 '|xns' : 'Roo.bootstrap'
216 displayField : 'display_name',
218 fieldLabel : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'] /* Type */,
219 hiddenName : 'comptype',
222 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
224 name : 'comptype_display_name',
225 queryParam : 'query[name]',
226 selectOnFocus : true,
227 triggerAction : 'all',
231 render : function (_self)
234 _self.store.load({});
238 '|xns' : 'Roo.bootstrap',
242 sortInfo : '{ direction : \'ASC\', field: \'id\' }',
244 beforeload : function (_self, options)
246 options.params = options.params || {};
248 //o.params['query[empty_etype]'] = 1;
249 options.params.etype = 'COMPTYPE';
257 url : baseURL + '/Roo/core_enum.php',
262 xtype : 'JsonReader',
265 totalProperty : 'total',
273 fieldLabel : _this._strings['1c76cbfe21c6f44c1d1e59d54f3e4420'] /* Company */,
277 render : function (_self)
279 _this.company = _self;
283 '|xns' : 'Roo.bootstrap'
287 fieldLabel : _this._strings['bcc254b55c4a1babdf1dcb82c207506b'] /* Phone */,
291 render : function (_self)
297 '|xns' : 'Roo.bootstrap'
301 fieldLabel : _this._strings['9810aa2b9f44401be4bf73188ef2b67d'] /* Fax */,
305 render : function (_self)
311 '|xns' : 'Roo.bootstrap'
315 fieldLabel : _this._strings['ce8ae9da5b7cd6c3df2929543a9af92d'] /* Email */,
319 render : function (_self)
325 '|xns' : 'Roo.bootstrap'
329 fieldLabel : _this._strings['e6b391a8d2c4d45902a23a8b6585703d'] /* URL */,
333 render : function (_self)
339 '|xns' : 'Roo.bootstrap'
343 fieldLabel : _this._strings['dd7bf230fde8d4836917806aff6a6b27'] /* Address */,
347 render : function (_self)
349 _this.address = _self;
353 '|xns' : 'Roo.bootstrap'
357 fieldLabel : _this._strings['231bc72756b5e6de492aaaa1577f61b1'] /* Remarks */,
361 render : function (_self)
363 _this.remarks = _self;
367 '|xns' : 'Roo.bootstrap'
377 '|xns' : 'Roo.bootstrap',
382 '|xns' : 'Roo.bootstrap',
387 '|xns' : 'Roo.bootstrap',
391 imgResponsive : true,
392 style : 'text-align: center; margin-left: auto; margin-right: auto; ',
394 render : function (_self)
400 '|xns' : 'Roo.bootstrap'
409 '|xns' : 'Roo.bootstrap',
414 '|xns' : 'Roo.bootstrap',
420 style : 'margin:15px;',
421 url : baseURL + '/Roo/Images.php',
423 actioncomplete : function (_self, action)
425 if(action.type == 'setdata'){
427 if(_this.data.id * 1 > 0) {
428 _this.onid.setValue(_this.data.id);
429 _this.ontable.setValue('coba_company');
434 if (action.type == 'submit') { // only submitted here if we are
435 if (_this.callback) {
436 _this.callback.call(this, action.result.data);
438 console.log(action.result.data);
443 actionfailed : function (_self, action)
447 render : function (_self)
449 _this.img_upload_form = _self;
453 '|xns' : 'Roo.bootstrap',
458 fieldLabel : _this._strings['b999e07cf80ea5eca8e589cd8540a81e'] /* Select Logo */,
460 name : 'imageUpload',
462 '|xns' : 'Roo.bootstrap'
469 render : function (_self)
475 '|xns' : 'Roo.bootstrap'
482 render : function (_self)
484 _this.ontable = _self;
488 '|xns' : 'Roo.bootstrap'
495 render : function (_self)
497 _this.imgtype = _self;
501 '|xns' : 'Roo.bootstrap'
516 '|xns' : 'Roo.bootstrap',
521 '|xns' : 'Roo.bootstrap'
529 Roo.apply(Pman.Dialog.BAdminCompany, Pman.Dialog.BAdminCompany.prototype);