Pman.Dialog.CoreNotifyRecurKeywords.bjs
[Pman.Core] / Pman.Dialog.CoreNotifyRecurKeywords.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.CoreNotifyRecurKeywords = {
8
9  _strings : {
10   '0ee0f676f631ad4e8a5844314a3a20de' :"Select campaign",
11   '1243daf593fa297e07ab03bf06d925af' :"Searching...",
12   'ea4788705e6873b424c65e91c2846b19' :"Cancel",
13   'e0aa021e21dddbd6d8cecec71e9cf564' :"OK",
14   '790f855c2139f2faecb810519e90b833' :"Add Notification Keywords",
15   'ded4cba1b04eb8236e24a3e39470d8a7' :"Select Campaign"
16  },
17
18  dialog : false,
19  callback:  false,
20
21  show : function(data, cb)
22  {
23   if (!this.dialog) {
24    this.create();
25   }
26
27   this.callback = cb;
28   this.data = data;
29   this.dialog.show(this.data._el);
30   if (this.form) {
31    this.form.reset();
32    this.form.setValues(data);
33    this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
34   }
35
36  },
37
38  create : function()
39  {
40    var _this = this;
41    this.dialog = Roo.factory({
42     center : {
43      '|xns' : 'Roo',
44      titlebar : false,
45      xns : Roo,
46      xtype : 'LayoutRegion'
47     },
48     '|xns' : 'Roo',
49     background : true,
50     closable : false,
51     collapsible : false,
52     height : 150,
53     modal : true,
54     resizable : false,
55     title : _this._strings['790f855c2139f2faecb810519e90b833'],
56     width : 400,
57     xns : Roo,
58     xtype : 'LayoutDialog',
59     buttons : [
60       {
61        '|xns' : 'Roo',
62        text : _this._strings['ea4788705e6873b424c65e91c2846b19'],
63        xns : Roo,
64        xtype : 'Button',
65        listeners : {
66         click : function() {
67              _this.form.reset();
68              _this.dialog.hide();
69          }
70        }
71       },
72 {
73        '|xns' : 'Roo',
74        text : _this._strings['e0aa021e21dddbd6d8cecec71e9cf564'],
75        xns : Roo,
76        xtype : 'Button',
77        listeners : {
78         click : function() {
79          
80              var name =     _this.form.findField('name').getValue();
81              name = name.toUpperCase().replace(/[^A-Z]+/g, '');
82              if (!name.length) {
83                  Roo.MessageBox.alert("Error","Please fill in a valid name");
84                  return;
85              }
86              _this.form.findField('name').setValue(name);
87           
88              _this.form.doAction('submit');
89              
90          }
91        }
92       }
93     ],
94     listeners : {
95      show : function (_self)
96       {
97           
98       }
99     },
100     items : [
101      {
102       '|xns' : 'Roo',
103       background : true,
104       fitToFrame : true,
105       region : 'center',
106       xns : Roo,
107       xtype : 'ContentPanel',
108       items : [
109        {
110         '|xns' : 'Roo.form',
111         method : 'POST',
112         style : 'margin: 5px',
113         url : baseURL + '/Roo/Core_notify_recur.php',
114         xns : Roo.form,
115         xtype : 'Form',
116         listeners : {
117          actioncomplete : function (_self, action)
118           {
119             if (action.type == 'setdata') {
120                   
121                   if(_this.data.id){
122                       _this.dialog.el.mask("Loading");
123                       this.load({ method: 'GET', params: { '_id' : _this.data.id }}); 
124                   }
125                   
126                   return;
127               }
128               if (action.type == 'load') {
129                   _this.dialog.el.unmask();
130                   return;
131               }
132               if (action.type == 'submit' ) {
133                   _this.dialog.el.unmask();
134                   _this.dialog.hide();
135           
136                   if (_this.callback) {
137                      _this.callback.call(_this, action.result.data);
138                   }
139                   _this.form.reset();
140               }
141           },
142          rendered : function (form)
143           {
144              _this.form = form;
145           }
146         },
147         items : [
148          {
149           '|xns' : 'Roo.form',
150           name : 'id',
151           xns : Roo.form,
152           xtype : 'Hidden'
153          },
154          {
155           store : {
156            proxy : {
157             '|xns' : 'Roo.data',
158             method : 'GET',
159             url : baseURL + '/Roo/core_enum.php',
160             xns : Roo.data,
161             xtype : 'HttpProxy'
162            },
163            reader : {
164             '|xns' : 'Roo.data',
165             fields : [{"name":"id","type":"int"},{"name":"etype","type":"string"}],
166             id : 'id',
167             root : 'data',
168             totalProperty : 'total',
169             xns : Roo.data,
170             xtype : 'JsonReader'
171            },
172            '|xns' : 'Roo.data',
173            remoteSort : true,
174            sortInfo : { direction : 'ASC', field: 'display_name' },
175            xns : Roo.data,
176            xtype : 'Store',
177            listeners : {
178             beforeload : function (_self, o){
179                  o.params = o.params || {};
180                  // set more here
181                  o.params.etype = 'crm_industry';
182                  o.params.active  = 1;
183              }
184            },
185            items : [
186
187            ]
188
189           },
190           '|xns' : 'Roo.form',
191           allowBlank : false,
192           alwaysQuery : true,
193           displayField : 'name',
194           editable : true,
195           emptyText : _this._strings['ded4cba1b04eb8236e24a3e39470d8a7'],
196           fieldLabel : 'Campaign',
197           forceSelection : true,
198           hiddenName : 'campaign_id',
199           listWidth : 400,
200           loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
201           minChars : 2,
202           name : 'camapign_id_name',
203           pageSize : 20,
204           qtip : _this._strings['0ee0f676f631ad4e8a5844314a3a20de'],
205           queryParam : 'search[display_name]',
206           selectOnFocus : true,
207           tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
208           triggerAction : 'all',
209           typeAhead : false,
210           valueField : 'id',
211           width : 217,
212           xns : Roo.form,
213           xtype : 'ComboBox',
214           items : [
215
216           ]
217
218          }
219         ]
220
221        }
222       ]
223
224      }
225     ]
226
227    });
228  }
229 };