// Auto generated file - created by app.Builder.js- do not edit directly (at present!)
+Roo.namespace('Pman.Dialog');
+
Pman.Dialog.XtupleQuickContact = {
dialog : false,
{
var _this = this;
this.dialog = Roo.factory({
- xtype: 'LayoutDialog',
- xns: Roo,
- closable : false,
- collapsible : false,
- height : 480,
+ center : {
+ '|xns' : 'Roo',
+ xtype : 'LayoutRegion',
+ xns : Roo
+ },
+ '|xns' : 'Roo',
modal : true,
- resizable : false,
+ collapsible : false,
title : "Quick enter Contact / Address",
+ xtype : 'LayoutDialog',
width : 500,
+ xns : Roo,
+ closable : false,
+ resizable : false,
+ height : 480,
+ buttons : [
+ {
+ '|xns' : 'Roo',
+ text : "Cancel",
+ xtype : 'Button',
+ xns : Roo,
+ listeners : {
+ click : function (_self, e)
+ {
+ _this.dialog.hide();
+ }
+ }
+ },
+{
+ '|xns' : 'Roo',
+ text : "Save",
+ xtype : 'Button',
+ xns : Roo,
+ listeners : {
+ click : function (_self, e)
+ {
+ // do some checks?
+
+
+
+ _this.form.doAction("submit");
+
+ }
+ }
+ }
+ ],
items : [
- {
- xtype: 'ContentPanel',
- xns: Roo,
+ {
+ '|xns' : 'Roo',
region : 'center',
+ xtype : 'ContentPanel',
+ xns : Roo,
items : [
- {
- xtype: 'Form',
- xns: Roo.form,
- listeners : {
- actioncomplete : function(_self,action)
- {
- if (action.type == 'setdata') {
- if (_this.data._id) {
- this.load({ method: 'GET', params: {
- _id : _this.data._id ,
- _with_addr : 1
- }});
- }
- return;
- }
- if (action.type == 'load') {
- return;
- }
- if (action.type =='submit') {
-
- _this.dialog.hide();
-
- if (_this.callback) {
- _this.form.setValues(action.result.data);
- _this.callback.call(_this, _this.form.getValues());
- }
- _this.form.reset();
- return;
- }
- },
- rendered : function (form)
- {
- _this.form= form;
- }
- },
+ {
+ '|xns' : 'Roo.form',
+ url : baseURL + '/Roo/cntct.php',
+ xtype : 'Form',
method : 'POST',
style : 'margin:10px;',
- url : baseURL + '/Roo/cntct.php',
+ xns : Roo.form,
+ listeners : {
+ actioncomplete : function(_self,action)
+ {
+ if (action.type == 'setdata') {
+ if (_this.data._id) {
+ this.load({ method: 'GET', params: {
+ _id : _this.data._id ,
+ _with_addr : 1
+ }});
+ }
+ return;
+ }
+ if (action.type == 'load') {
+ return;
+ }
+ if (action.type =='submit') {
+
+ _this.dialog.hide();
+
+ if (_this.callback) {
+ _this.form.setValues(action.result.data);
+ _this.callback.call(_this, _this.form.getValues());
+ }
+ _this.form.reset();
+ return;
+ }
+ },
+ rendered : function (form)
+ {
+ _this.form= form;
+ }
+ },
items : [
- {
- xtype: 'TextField',
- xns: Roo.form,
- allowBlank : false,
+ {
+ '|xns' : 'Roo.form',
fieldLabel : 'First Name',
- name : 'cntct_first_name',
- width : 300
+ xtype : 'TextField',
+ allowBlank : false,
+ width : 300,
+ xns : Roo.form,
+ name : 'cntct_first_name'
},
- {
- xtype: 'TextField',
- xns: Roo.form,
+ {
+ '|xns' : 'Roo.form',
fieldLabel : 'Last Name',
- name : 'cntct_last_name',
- width : 300
+ xtype : 'TextField',
+ width : 300,
+ xns : Roo.form,
+ name : 'cntct_last_name'
},
- {
- xtype: 'TextField',
- xns: Roo.form,
- fieldLabel : 'Phone',
- name : 'cntct_phone',
- width : 200,
- regex : /^[0-9 +-]+$/
+ {
+ '|xns' : 'Roo.form',
+ fieldLabel : 'ID Card',
+ xtype : 'TextField',
+ width : 300,
+ xns : Roo.form,
+ name : 'cntct_id_card'
+ },
+ {
+ '|xns' : 'Roo.form',
+ xtype : 'Row',
+ labelWidth : 120,
+ width : 500,
+ xns : Roo.form,
+ items : [
+ {
+ '|xns' : 'Roo.form',
+ xtype : 'Column',
+ xns : Roo.form,
+ items : [
+ {
+ '|xns' : 'Roo.form',
+ fieldLabel : 'Phone / Alt',
+ xtype : 'TextField',
+ regex : /^[0-9 +-]+$/,
+ width : 130,
+ xns : Roo.form,
+ name : 'cntct_phone'
+ }
+ ]
+
+ },
+ {
+ '|xns' : 'Roo.form',
+ xtype : 'Column',
+ xns : Roo.form,
+ hideLabels : true,
+ style : 'padding-left:10px',
+ items : [
+ {
+ '|xns' : 'Roo.form',
+ fieldLabel : 'Phone (Alt)',
+ xtype : 'TextField',
+ regex : /^[0-9 +-]+$/,
+ width : 150,
+ xns : Roo.form,
+ name : 'cntct_phone2'
+ }
+ ]
+
+ }
+ ]
+
},
- {
- xtype: 'TextField',
- xns: Roo.form,
+ {
+ '|xns' : 'Roo.form',
fieldLabel : 'Email',
- name : 'cntct_email',
vtype : 'email',
- width : 200
+ xtype : 'TextField',
+ width : 200,
+ xns : Roo.form,
+ name : 'cntct_email'
},
- {
- xtype: 'FieldSet',
- xns: Roo.form,
+ {
+ '|xns' : 'Roo.form',
+ xtype : 'FieldSet',
legend : "Address",
style : 'width:420px',
+ xns : Roo.form,
items : [
- {
- xtype: 'TextField',
- xns: Roo.form,
- listeners : {
- keyup : function (_self, e)
- {
- _this.form.findField('addr_number').sync();
- }
- },
- allowBlank : false,
+ {
+ '|xns' : 'Roo.form',
fieldLabel : 'Line 1',
+ xtype : 'TextField',
+ allowBlank : false,
+ width : 300,
+ xns : Roo.form,
name : 'cntct_addr_id_addr_line1',
- width : 300
+ listeners : {
+ keyup : function (_self, e)
+ {
+ _this.form.findField('addr_number').sync();
+ }
+ }
},
- {
- xtype: 'TextField',
- xns: Roo.form,
+ {
+ '|xns' : 'Roo.form',
fieldLabel : 'Line 2',
- name : 'cntct_addr_id_addr_line2',
- width : 300
+ xtype : 'TextField',
+ width : 300,
+ xns : Roo.form,
+ name : 'cntct_addr_id_addr_line2'
},
- {
- xtype: 'TextField',
- xns: Roo.form,
+ {
+ '|xns' : 'Roo.form',
fieldLabel : 'Line 3',
- name : 'cntct_addr_id_addr_line3',
- width : 300
+ xtype : 'TextField',
+ width : 300,
+ xns : Roo.form,
+ name : 'cntct_addr_id_addr_line3'
},
- {
- xtype: 'ComboBox',
- xns: Roo.form,
- allowBlank : true,
+ {
+ store : {
+ proxy : {
+ '|xns' : 'Roo.data',
+ url : baseURL + '/Roo/addr.php',
+ xtype : 'HttpProxy',
+ method : 'GET',
+ xns : Roo.data
+ },
+ reader : {
+ '|xns' : 'Roo.data',
+ id : 'addr_state',
+ root : 'data',
+ xtype : 'JsonReader',
+ fields : [ "addr_state"],
+ xns : Roo.data,
+ totalProperty : 'total'
+ },
+ '|xns' : 'Roo.data',
+ xtype : 'Store',
+ remoteSort : true,
+ sortInfo : { direction : 'ASC', field: 'addr_state' },
+ xns : Roo.data,
+ listeners : {
+ beforeload : function (_self, o){
+ o.params = o.params || {};
+
+ // o.params.state_country_id_country_name = _this.form.findField('addr_country').getValue();
+ //if (!o.params.state_country_id_country_name.length) {
+ // Roo.MessageBox.alert("Select Country First");
+ // return false;
+ // }
+
+ o.params._distinct = 'addr_state';
+ o.params._columns = 'addr_state';
+ o.params.limit = 999;
+ // set more here
+ }
+ },
+ items : [
+
+ ]
+
+ },
+ '|xns' : 'Roo.form',
+ listWidth : 400,
+ triggerAction : 'all',
+ fieldLabel : 'State',
+ selectOnFocus : true,
displayField : 'addr_state',
- editable : true,
emptyText : "State",
- fieldLabel : 'State',
hiddenName : 'cntct_addr_id_addr_state',
- listWidth : 400,
- loadingText : "Searching...",
minChars : 2,
+ valueField : 'addr_state',
+ xtype : 'ComboBox',
+ allowBlank : true,
+ typeAhead : true,
+ editable : true,
+ width : 200,
+ xns : Roo.form,
name : 'cntct_addr_id_addr_state',
qtip : "Select State",
queryParam : 'query[addr_state]',
- selectOnFocus : true,
- tpl : '<div class="x-grid-cell-text x-btn button"><b>{addr_state}</b> </div>',
- triggerAction : 'all',
- typeAhead : true,
- valueField : 'addr_state',
- width : 200,
+ tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{addr_state}</b> </div>',
+ loadingText : "Searching...",
+ items : [
+
+ ]
+
+ },
+ {
+ '|xns' : 'Roo.form',
+ fieldLabel : 'City',
+ xtype : 'TextField',
+ width : 300,
+ xns : Roo.form,
+ name : 'cntct_addr_id_addr_city'
+ },
+ {
+ '|xns' : 'Roo.form',
+ fieldLabel : 'Zip code',
+ xtype : 'TextField',
+ width : 300,
+ xns : Roo.form,
+ name : 'cntct_addr_id_addr_postalcode'
+ },
+ {
store : {
- xtype: 'Store',
- xns: Roo.data,
- listeners : {
- beforeload : function (_self, o){
- o.params = o.params || {};
-
- // o.params.state_country_id_country_name = _this.form.findField('addr_country').getValue();
- //if (!o.params.state_country_id_country_name.length) {
- // Roo.MessageBox.alert("Select Country First");
- // return false;
- // }
-
- o.params._distinct = 'addr_state';
- o.params._columns = 'addr_state';
- o.params.limit = 999;
- // set more here
- }
- },
- remoteSort : true,
- sortInfo : { direction : 'ASC', field: 'addr_state' },
proxy : {
- xtype: 'HttpProxy',
- xns: Roo.data,
+ '|xns' : 'Roo.data',
+ url : baseURL + '/Roo/country.php',
+ xtype : 'HttpProxy',
method : 'GET',
- url : baseURL + '/Roo/addr.php'
+ xns : Roo.data
},
reader : {
- xtype: 'JsonReader',
- xns: Roo.data,
- id : 'addr_state',
+ '|xns' : 'Roo.data',
+ id : 'country_id',
root : 'data',
- totalProperty : 'total',
- fields : [ "addr_state"]
- }
- }
- },
- {
- xtype: 'TextField',
- xns: Roo.form,
- fieldLabel : 'City',
- name : 'cntct_addr_id_addr_city',
- width : 300
- },
- {
- xtype: 'TextField',
- xns: Roo.form,
- fieldLabel : 'Zip code',
- name : 'cntct_addr_id_addr_postalcode',
- width : 300
- },
- {
- xtype: 'ComboBox',
- xns: Roo.form,
- allowBlank : true,
+ xtype : 'JsonReader',
+ fields : [{"name":"country_id","type":"int"},"county_name"],
+ xns : Roo.data,
+ totalProperty : 'total'
+ },
+ '|xns' : 'Roo.data',
+ xtype : 'Store',
+ remoteSort : true,
+ sortInfo : { direction : 'ASC', field: 'country_name' },
+ xns : Roo.data,
+ listeners : {
+ beforeload : function (_self, o){
+ o.params = o.params || {};
+ // set more here
+ o.params.limit = 999;
+ }
+ },
+ items : [
+
+ ]
+
+ },
+ '|xns' : 'Roo.form',
+ listWidth : 400,
+ triggerAction : 'all',
+ fieldLabel : 'Country',
+ selectOnFocus : true,
displayField : 'country_name',
- editable : true,
emptyText : "Country",
- fieldLabel : 'Country',
hiddenName : 'cntct_addr_id_addr_country',
- listWidth : 400,
- loadingText : "Searching...",
minChars : 2,
+ valueField : 'country_name',
+ xtype : 'ComboBox',
+ allowBlank : true,
+ typeAhead : true,
+ editable : true,
+ width : 200,
+ xns : Roo.form,
name : 'cntct_addr_id_addr_country',
qtip : "Select Country",
queryParam : 'query[country_name]',
- selectOnFocus : true,
- tpl : '<div class="x-grid-cell-text x-btn button"><b>{country_name}</b> </div>',
- triggerAction : 'all',
- typeAhead : true,
- valueField : 'country_name',
- width : 200,
- store : {
- xtype: 'Store',
- xns: Roo.data,
- listeners : {
- beforeload : function (_self, o){
- o.params = o.params || {};
- // set more here
- o.params.limit = 999;
- }
- },
- remoteSort : true,
- sortInfo : { direction : 'ASC', field: 'country_name' },
- proxy : {
- xtype: 'HttpProxy',
- xns: Roo.data,
- method : 'GET',
- url : baseURL + '/Roo/country.php'
- },
- reader : {
- xtype: 'JsonReader',
- xns: Roo.data,
- id : 'country_id',
- root : 'data',
- totalProperty : 'total',
- fields : [{"name":"country_id","type":"int"},"county_name"]
- }
- }
+ tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{country_name}</b> </div>',
+ loadingText : "Searching...",
+ items : [
+
+ ]
+
}
]
+
},
- {
- xtype: 'FieldSet',
- xns: Roo.form,
+ {
+ '|xns' : 'Roo.form',
legend : "Store Details (Delivery only)",
+ xtype : 'FieldSet',
+ xns : Roo.form,
items : [
- {
- xtype: 'TextField',
- xns: Roo.form,
- allowBlank : true,
+ {
+ '|xns' : 'Roo.form',
fieldLabel : 'Name',
- name : 'vend_name',
+ xtype : 'TextField',
+ allowBlank : true,
readOnly : true,
- width : 300
+ width : 300,
+ xns : Roo.form,
+ name : 'vend_name'
},
- {
- xtype: 'TextField',
- xns: Roo.form,
- allowBlank : true,
+ {
+ '|xns' : 'Roo.form',
fieldLabel : 'Code',
- name : 'vend_name',
+ xtype : 'TextField',
+ allowBlank : true,
readOnly : true,
- width : 300
+ width : 300,
+ xns : Roo.form,
+ name : 'vendaddr_code'
}
]
+
},
- {
- xtype: 'Hidden',
- xns: Roo.form,
- name : 'customer_id',
- width : 100
+ {
+ '|xns' : 'Roo.form',
+ xtype : 'Hidden',
+ width : 100,
+ xns : Roo.form,
+ name : 'customer_id'
},
- {
- xtype: 'Hidden',
- xns: Roo.form,
- name : 'cntct_addr_id',
- width : 100
+ {
+ '|xns' : 'Roo.form',
+ xtype : 'Hidden',
+ width : 100,
+ xns : Roo.form,
+ name : 'cntct_addr_id'
},
- {
- xtype: 'Hidden',
- xns: Roo.form,
+ {
+ '|xns' : 'Roo.form',
+ xtype : 'Hidden',
+ xns : Roo.form,
name : 'cntct_id'
}
]
+
}
]
- }
- ],
- center : {
- xtype: 'LayoutRegion',
- xns: Roo
- },
- buttons : [
- {
- xtype: 'Button',
- xns: Roo,
- listeners : {
- click : function (_self, e)
- {
- _this.dialog.hide();
- }
- },
- text : "Cancel"
- },
- {
- xtype: 'Button',
- xns: Roo,
- listeners : {
- click : function (_self, e)
- {
- // do some checks?
-
-
-
- _this.form.doAction("submit");
-
- }
- },
- text : "Save"
+
}
]
+
});
}
};