1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Dialog.CorePersonContact = {
10 show : function(data, cb)
18 this.dialog.show(this.data._el);
21 this.form.setValues(data);
22 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
30 this.dialog = Roo.factory({
31 xtype: 'LayoutDialog',
37 title : "Edit / Create Contact Details",
41 xtype: 'ContentPanel',
49 actioncomplete : function(_self,action)
51 if (action.type == 'setdata') {
52 //_this.dialog.el.mask("Loading");
53 //this.load({ method: 'GET', params: { '_id' : _this.data.id }});
56 if (action.type == 'load') {
57 _this.dialog.el.unmask();
60 if (action.type =='submit') {
62 _this.dialog.el.unmask();
66 _this.callback.call(_this, _this.form.getValues());
72 rendered : function (form)
78 style : 'margin:10px;',
79 url : baseURL + '/Roo/Person.php',
85 add : function (combo)
88 Pman.Dialog.Companies.show( { id: 0 }, function(data) {
89 _this.form.setValues({
90 company_id_name : data.name,
97 displayField : 'code',
99 emptyText : "Select Companies",
100 fieldLabel : 'Company',
101 forceSelection : true,
102 hiddenName : 'company_id',
104 loadingText : "Searching...",
106 name : 'company_id_code',
108 qtip : "Select Companies",
109 queryParam : 'query[code]',
110 selectOnFocus : true,
111 tpl : '<div class="x-grid-cell-text x-btn button"><b>{code}</b> </div>',
112 triggerAction : 'all',
120 sortInfo : { direction : 'ASC', field: 'id' },
122 beforeload : function (_self, o){
123 o.params = o.params || {};
131 url : baseURL + '/Roo/Companies.php'
138 totalProperty : 'total',
139 fields : [{"name":"id","type":"int"},{"name":"code","type":"string"}]
147 add : function (combo)
149 var coid = _this.form.findField('company_id').getValue();
152 Ext.MessageBox.alert("Error", "Select An Company First");
156 Pman.Dialog.Office.show(cfg, function(data) {
157 _this.form.setValues({
158 office_id_name : data.name,
165 beforequery : function (combo, query, forceAll, cancel, e)
170 allowBlank : 'false',
171 displayField : 'name',
173 emptyText : "Select Office",
174 fieldLabel : 'Office',
175 forceSelection : true,
176 hiddenName : 'office_id',
178 loadingText : "Searching...",
180 name : 'office_id_name',
182 qtip : "Select Office",
183 queryParam : 'query[name]',
184 selectOnFocus : true,
185 tpl : '<div class="x-grid-cell-text x-btn button"><b>{name}</b> </div>',
186 triggerAction : 'all',
194 beforeload : function (_self, o){
195 o.params = o.params || {};
196 var coid = _this.form.findField('company_id').getValue();
197 o.params.company_id = coid;
201 sortInfo : { direction : 'ASC', field: 'id' },
206 url : baseURL + '/Roo/Office.php'
213 totalProperty : 'total',
214 fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}]
235 fieldLabel : 'Phone',
249 fieldLabel : 'Email',
264 xtype: 'LayoutRegion',
272 click : function (_self, e)
283 click : function (_self, e)
288 _this.dialog.el.mask("Saving");
289 _this.form.doAction("submit");