fix #8131 - chinese translations
[Pman.Core] / Pman.Dialog.CorePersonContact.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 Roo.namespace('Pman.Dialog');
6
7 Pman.Dialog.CorePersonContact = {
8
9  _strings : {
10   '1c76cbfe21c6f44c1d1e59d54f3e4420' :"Company",
11   'ce8ae9da5b7cd6c3df2929543a9af92d' :"Email",
12   'c8972faa3b9e1c7250db23c57c85aa23' :"Edit / Create Contact Details",
13   '1243daf593fa297e07ab03bf06d925af' :"Searching...",
14   'bcc254b55c4a1babdf1dcb82c207506b' :"Phone",
15   'ea4788705e6873b424c65e91c2846b19' :"Cancel",
16   '9675747b5ab12d05f18518761e68a533' :"Select Companies",
17   'df814135652a5a308fea15bff37ea284' :"Office",
18   'c373dd4bd4ba0b5d3e0c7522c5629880' :"Select Office",
19   '49ee3087348e8d44e1feda1917443987' :"Name",
20   'bbbabdbe1b262f75d99d62880b953be1' :"Role",
21   'c9cc8cce247e49bae79f15173ce97354' :"Save",
22   '9810aa2b9f44401be4bf73188ef2b67d' :"Fax"
23  },
24  _named_strings : {
25   'company_id_code_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
26   'role_fieldLabel' : 'bbbabdbe1b262f75d99d62880b953be1' /* Role */ ,
27   'fax_fieldLabel' : '9810aa2b9f44401be4bf73188ef2b67d' /* Fax */ ,
28   'office_id_name_emptyText' : 'c373dd4bd4ba0b5d3e0c7522c5629880' /* Select Office */ ,
29   'name_fieldLabel' : '49ee3087348e8d44e1feda1917443987' /* Name */ ,
30   'phone_fieldLabel' : 'bcc254b55c4a1babdf1dcb82c207506b' /* Phone */ ,
31   'office_id_name_fieldLabel' : 'df814135652a5a308fea15bff37ea284' /* Office */ ,
32   'office_id_name_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
33   'company_id_code_qtip' : '9675747b5ab12d05f18518761e68a533' /* Select Companies */ ,
34   'office_id_name_qtip' : 'c373dd4bd4ba0b5d3e0c7522c5629880' /* Select Office */ ,
35   'email_fieldLabel' : 'ce8ae9da5b7cd6c3df2929543a9af92d' /* Email */ ,
36   'company_id_code_emptyText' : '9675747b5ab12d05f18518761e68a533' /* Select Companies */ ,
37   'company_id_code_fieldLabel' : '1c76cbfe21c6f44c1d1e59d54f3e4420' /* Company */ 
38  },
39
40  dialog : false,
41  callback:  false,
42
43  show : function(data, cb)
44  {
45   if (!this.dialog) {
46    this.create();
47   }
48
49   this.callback = cb;
50   this.data = data;
51   this.dialog.show(this.data._el);
52   if (this.form) {
53    this.form.reset();
54    this.form.setValues(data);
55    this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
56   }
57
58  },
59
60  create : function()
61  {
62    var _this = this;
63    this.dialog = Roo.factory({
64     xtype : 'LayoutDialog',
65     closable : false,
66     collapsible : false,
67     height : 290,
68     resizable : false,
69     title : _this._strings['c8972faa3b9e1c7250db23c57c85aa23'] /* Edit / Create Contact Details */,
70     width : 450,
71     xns : Roo,
72     '|xns' : 'Roo',
73     center : {
74      xtype : 'LayoutRegion',
75      xns : Roo,
76      '|xns' : 'Roo'
77     },
78     buttons : [
79      {
80       xtype : 'Button',
81       text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
82       listeners : {
83        click : function (_self, e)
84         {
85             _this.dialog.hide();
86         }
87       },
88       xns : Roo,
89       '|xns' : 'Roo'
90      },
91      {
92       xtype : 'Button',
93       text : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
94       listeners : {
95        click : function (_self, e)
96         {
97             // do some checks?
98              
99             
100             _this.dialog.el.mask("Saving");
101             _this.form.doAction("submit");
102         
103         }
104       },
105       xns : Roo,
106       '|xns' : 'Roo'
107      }
108     ],
109     items  : [
110      {
111       xtype : 'ContentPanel',
112       region : 'center',
113       xns : Roo,
114       '|xns' : 'Roo',
115       items  : [
116        {
117         xtype : 'Form',
118         method : 'POST',
119         style : 'margin:10px;',
120         url : baseURL + '/Roo/core_person',
121         listeners : {
122          actioncomplete : function(_self,action)
123           {
124               if (action.type == 'setdata') {
125                  //_this.dialog.el.mask("Loading");
126                  //this.load({ method: 'GET', params: { '_id' : _this.data.id }});
127                  return;
128               }
129               if (action.type == 'load') {
130                   _this.dialog.el.unmask();
131                   return;
132               }
133               if (action.type =='submit') {
134               
135                   _this.dialog.el.unmask();
136                   _this.dialog.hide();
137               
138                    if (_this.callback) {
139                       _this.callback.call(_this, _this.form.getValues());
140                    }
141                    _this.form.reset();
142                    return;
143               }
144           },
145          rendered : function (form)
146           {
147               _this.form= form;
148           }
149         },
150         xns : Roo.form,
151         '|xns' : 'Roo.form',
152         items  : [
153          {
154           xtype : 'ComboBox',
155           allowBlank : false,
156           displayField : 'code',
157           editable : false,
158           emptyText : _this._strings['9675747b5ab12d05f18518761e68a533'] /* Select Companies */,
159           fieldLabel : _this._strings['1c76cbfe21c6f44c1d1e59d54f3e4420'] /* Company */,
160           forceSelection : true,
161           hiddenName : 'company_id',
162           listWidth : 400,
163           loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
164           minChars : 2,
165           name : 'company_id_code',
166           pageSize : 20,
167           qtip : _this._strings['9675747b5ab12d05f18518761e68a533'] /* Select Companies */,
168           queryParam : 'query[code]',
169           selectOnFocus : true,
170           tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{code}</b> </div>',
171           triggerAction : 'all',
172           typeAhead : true,
173           valueField : 'id',
174           width : 300,
175           listeners : {
176            add : function (combo)
177             {
178             
179                 Pman.Dialog.Companies.show( {  id: 0 },  function(data) {
180                         _this.form.setValues({
181                                 company_id_name : data.name,
182                                 company_id : data.id
183                         });
184                 }); 
185             }
186           },
187           xns : Roo.form,
188           '|xns' : 'Roo.form',
189           store : {
190            xtype : 'Store',
191            remoteSort : true,
192            sortInfo : { direction : 'ASC', field: 'id' },
193            listeners : {
194             beforeload : function (_self, o){
195                  o.params = o.params || {};
196                  // set more here
197              }
198            },
199            xns : Roo.data,
200            '|xns' : 'Roo.data',
201            proxy : {
202             xtype : 'HttpProxy',
203             method : 'GET',
204             url : baseURL + '/Roo/core_company.php',
205             xns : Roo.data,
206             '|xns' : 'Roo.data'
207            },
208            reader : {
209             xtype : 'JsonReader',
210             fields : [{"name":"id","type":"int"},{"name":"code","type":"string"}],
211             id : 'id',
212             root : 'data',
213             totalProperty : 'total',
214             xns : Roo.data,
215             '|xns' : 'Roo.data'
216            }
217           }
218          },
219          {
220           xtype : 'ComboBox',
221           allowBlank : false,
222           displayField : 'name',
223           editable : false,
224           emptyText : _this._strings['c373dd4bd4ba0b5d3e0c7522c5629880'] /* Select Office */,
225           fieldLabel : _this._strings['df814135652a5a308fea15bff37ea284'] /* Office */,
226           forceSelection : true,
227           hiddenName : 'office_id',
228           listWidth : 400,
229           loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
230           minChars : 2,
231           name : 'office_id_name',
232           pageSize : 20,
233           qtip : _this._strings['c373dd4bd4ba0b5d3e0c7522c5629880'] /* Select Office */,
234           queryParam : 'query[name]',
235           selectOnFocus : true,
236           tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>',
237           triggerAction : 'all',
238           typeAhead : true,
239           valueField : 'id',
240           width : 300,
241           listeners : {
242            add : function (combo)
243             {
244                 var coid = _this.form.findField('company_id').getValue();
245                 if (!coid ) {
246                 
247                      Ext.MessageBox.alert("Error", "Select An Company First");
248                     return false;
249             
250                 }
251                 Pman.Dialog.Office.show(cfg, function(data) {
252                             _this.form.setValues({
253                                 office_id_name : data.name,
254                                 office_id : data.id
255                         });
256                     }); 
257                 
258                 
259             },
260            beforequery : function (combo, query, forceAll, cancel, e)
261             {
262                     var coid = _this.form.findField('company_id').getValue();
263                     if (coid < 1 ) {
264                         Ext.MessageBox.alert("Error", "Select An Company First");
265                         return false;
266                     }
267             }
268           },
269           xns : Roo.form,
270           '|xns' : 'Roo.form',
271           store : {
272            xtype : 'Store',
273            remoteSort : true,
274            sortInfo : { direction : 'ASC', field: 'id' },
275            listeners : {
276             beforeload : function (_self, o){
277                  o.params = o.params || {};
278                  var coid = _this.form.findField('company_id').getValue();
279                  o.params.company_id = coid;
280              }
281            },
282            xns : Roo.data,
283            '|xns' : 'Roo.data',
284            proxy : {
285             xtype : 'HttpProxy',
286             method : 'GET',
287             url : baseURL + '/Roo/Office.php',
288             xns : Roo.data,
289             '|xns' : 'Roo.data'
290            },
291            reader : {
292             xtype : 'JsonReader',
293             fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}],
294             id : 'id',
295             root : 'data',
296             totalProperty : 'total',
297             xns : Roo.data,
298             '|xns' : 'Roo.data'
299            }
300           }
301          },
302          {
303           xtype : 'TextField',
304           allowBlank : true,
305           fieldLabel : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
306           name : 'name',
307           width : 300,
308           xns : Roo.form,
309           '|xns' : 'Roo.form'
310          },
311          {
312           xtype : 'TextField',
313           fieldLabel : _this._strings['bbbabdbe1b262f75d99d62880b953be1'] /* Role */,
314           name : 'role',
315           width : 200,
316           xns : Roo.form,
317           '|xns' : 'Roo.form'
318          },
319          {
320           xtype : 'TextField',
321           fieldLabel : _this._strings['bcc254b55c4a1babdf1dcb82c207506b'] /* Phone */,
322           name : 'phone',
323           width : 200,
324           xns : Roo.form,
325           '|xns' : 'Roo.form'
326          },
327          {
328           xtype : 'TextField',
329           fieldLabel : _this._strings['9810aa2b9f44401be4bf73188ef2b67d'] /* Fax */,
330           name : 'fax',
331           width : 200,
332           xns : Roo.form,
333           '|xns' : 'Roo.form'
334          },
335          {
336           xtype : 'TextField',
337           allowBlank : false,
338           fieldLabel : _this._strings['ce8ae9da5b7cd6c3df2929543a9af92d'] /* Email */,
339           name : 'email',
340           width : 200,
341           xns : Roo.form,
342           '|xns' : 'Roo.form'
343          },
344          {
345           xtype : 'Hidden',
346           name : 'id',
347           xns : Roo.form,
348           '|xns' : 'Roo.form'
349          }
350         ]
351        }
352       ]
353      }
354     ]
355    });
356  }
357 };