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.XtupleAddress = {
10 '59716c97497eb9694541f7c3d37b1a4d' :"Country",
11 '3c1df4260ce594cb5594696461087f2f' :"Select Country",
12 '0dbd2559b7f2c43a6e5f0a649c4b172a' :"Edit Address",
13 '46a2a41cc6e552044816a2d04634545d' :"State",
14 '1243daf593fa297e07ab03bf06d925af' :"Searching...",
15 'ea4788705e6873b424c65e91c2846b19' :"Cancel",
16 'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
17 'c9cc8cce247e49bae79f15173ce97354' :"Save",
18 'be2933038f93e25262400220080c111f' :"Select State"
24 show : function(data, cb)
32 this.dialog.show(this.data._el);
35 this.form.setValues(data);
36 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
44 this.dialog = Roo.factory({
48 xtype : 'LayoutRegion'
51 builderCfg : '{\"cols\":[{\"table\":\"addr\",\"column\":\"addr_id\",\"columnshort\":\"addr_id\",\"ctype\":\"int4\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"\",\"display\":\"addr_id\"},{\"table\":\"addr\",\"column\":\"addr_active\",\"columnshort\":\"addr_active\",\"ctype\":\"bool\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"addr\",\"column\":\"addr_line1\",\"columnshort\":\"addr_line1\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"addr\",\"column\":\"addr_line2\",\"columnshort\":\"addr_line2\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"addr\",\"column\":\"addr_line3\",\"columnshort\":\"addr_line3\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"addr\",\"column\":\"addr_city\",\"columnshort\":\"addr_city\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"addr\",\"column\":\"addr_state\",\"columnshort\":\"addr_state\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"addr\",\"column\":\"addr_postalcode\",\"columnshort\":\"addr_postalcode\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"addr\",\"column\":\"addr_country\",\"columnshort\":\"addr_country\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"addr\",\"column\":\"addr_notes\",\"columnshort\":\"addr_notes\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"addr\",\"column\":\"addr_number\",\"columnshort\":\"addr_number\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"}],\"cols_ex\":[\"addr_id\"],\"table\":\"addr\",\"xtype\":\"LayoutDialog\",\"|xns\":\"Roo\"}',
57 title : _this._strings['0dbd2559b7f2c43a6e5f0a649c4b172a'],
60 xtype : 'LayoutDialog',
64 text : _this._strings['ea4788705e6873b424c65e91c2846b19'],
68 click : function (_self, e)
76 text : _this._strings['c9cc8cce247e49bae79f15173ce97354'],
80 click : function (_self, e)
86 _this.form.doAction('submit');
100 '|xns' : 'Roo.Toolbar',
105 '|xns' : 'Roo.Toolbar',
106 cls : 'x-btn-text-icon',
107 icon : rootURL + '/Pman/templates/images/trash.gif',
108 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'],
114 var id = _this.form.findField('addr_id').getValue() *1;
116 Roo.MessageBox.alert("Error", "You can not delete this, you have not created it yet");
121 Roo.MessageBox.confirm("Confirm", "You will only be able to delete this if it is not referenced anywhere<BR>"+
122 ", are you sure you want to try that?",
130 url: baseURL+ '/Roo/addr',
134 success : function() {
135 _this.callback({ addr_id : 0, addr_line1 : '' });
152 xtype : 'ContentPanel',
157 style : 'margin:10px;',
158 url : baseURL + '/Roo/addr.php',
162 actioncomplete : function(_self,action)
164 if (action.type == 'setdata') {
165 if (_this.data.addr_id) {
166 this.load({ method: 'GET', params: { '_id' : _this.data.addr_id }});
170 if (action.type == 'load') {
173 if (action.type =='submit') {
177 if (_this.callback) {
178 _this.form.setValues(action.result.data);
179 _this.callback.call(_this, _this.form.getValues());
185 rendered : function (form)
194 fieldLabel : 'Line 1',
200 keyup : function (_self, e)
202 _this.form.findField('addr_number').sync();
208 fieldLabel : 'Line 2',
216 fieldLabel : 'Line 3',
235 url : baseURL + '/Roo/addr.php',
241 fields : [ 'addr_state' ],
244 totalProperty : 'total',
250 sortInfo : { direction : 'ASC', field: 'addr_state' },
254 beforeload : function (_self, o){
255 o.params = o.params || {};
257 // o.params.state_country_id_country_name = _this.form.findField('addr_country').getValue();
258 //if (!o.params.state_country_id_country_name.length) {
259 // Roo.MessageBox.alert("Select Country First");
263 o.params._distinct = 'addr_state';
264 o.params._columns = 'addr_state';
265 o.params.limit = 999;
276 displayField : 'addr_state',
278 emptyText : _this._strings['46a2a41cc6e552044816a2d04634545d'],
279 fieldLabel : 'State',
281 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
284 qtip : _this._strings['be2933038f93e25262400220080c111f'],
285 queryParam : 'query[addr_state]',
286 selectOnFocus : true,
287 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{addr_state}</b></div>',
288 triggerAction : 'all',
290 valueField : 'addr_state',
304 url : baseURL + '/Roo/country.php',
310 fields : [{'name':'country_id','type':'int'},'county_name'],
313 totalProperty : 'total',
319 sortInfo : { direction : 'ASC', field: 'country_name' },
323 beforeload : function (_self, o){
324 o.params = o.params || {};
326 o.params.limit = 999;
336 displayField : 'country_name',
338 emptyText : _this._strings['59716c97497eb9694541f7c3d37b1a4d'],
339 fieldLabel : 'Country',
341 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
343 name : 'addr_country',
344 qtip : _this._strings['3c1df4260ce594cb5594696461087f2f'],
345 queryParam : 'query[country_name]',
346 selectOnFocus : true,
347 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{country_name}</b> </div>',
348 triggerAction : 'all',
350 valueField : 'country_name',
361 fieldLabel : 'postalcode',
362 name : 'addr_postalcode',
369 fieldLabel : 'Unique#',
370 name : 'addr_number',
372 if (_this.form.findField('addr_id') * 1 > 0 ) {
375 this.setValue('C' + _this.form.findField('customer_id').getValue() + '-' +
376 _this.form.findField('addr_line1').getValue()
386 fieldLabel : 'notes',
394 name : 'customer_id',