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 : 180,
53     modal : true,
54     resizable : false,
55     title : _this._strings['790f855c2139f2faecb810519e90b833'],
56     width : 600,
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              _this.form.doAction('submit');
81              
82          }
83        }
84       }
85     ],
86     listeners : {
87      show : function (_self)
88       {
89           
90       }
91     },
92     items : [
93      {
94       '|xns' : 'Roo',
95       background : true,
96       fitToFrame : true,
97       region : 'center',
98       xns : Roo,
99       xtype : 'ContentPanel',
100       items : [
101        {
102         '|xns' : 'Roo.form',
103         method : 'POST',
104         style : 'margin: 5px',
105         url : baseURL + '/Roo/Core_notify_recur.php',
106         xns : Roo.form,
107         xtype : 'Form',
108         listeners : {
109          actioncomplete : function (_self, action)
110           {
111             if (action.type == 'setdata') {
112                   
113                   if(_this.data.id){
114                       _this.dialog.el.mask("Loading");
115                       this.load({ method: 'GET', params: { '_id' : _this.data.id }}); 
116                   }
117                   
118                   return;
119               }
120               if (action.type == 'load') {
121                   
122                   _this.dialog.el.unmask();
123                   
124                   _this.data = action.result.data;
125                   
126                   if(typeof(_this.data.keywords) != 'undefined'){
127                       
128                       var n = Roo.decode(_this.data.keywords);
129                       _this.form.findField(c.join('_')).setValue(n);
130                   }
131                   
132                   return;
133               }
134               if (action.type == 'submit' ) {
135                   _this.dialog.el.unmask();
136                   _this.dialog.hide();
137           
138                   if (_this.callback) {
139                      _this.callback.call(_this, action.result.data);
140                   }
141                   _this.form.reset();
142               }
143           },
144          rendered : function (form)
145           {
146              _this.form = form;
147           }
148         },
149         items : [
150          {
151           store : {
152            proxy : {
153             '|xns' : 'Roo.data',
154             method : 'GET',
155             url : baseURL + '/Roo/Projects.php',
156             xns : Roo.data,
157             xtype : 'HttpProxy'
158            },
159            reader : {
160             '|xns' : 'Roo.data',
161             fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}],
162             id : 'id',
163             root : 'data',
164             totalProperty : 'total',
165             xns : Roo.data,
166             xtype : 'JsonReader'
167            },
168            '|xns' : 'Roo.data',
169            remoteSort : true,
170            sortInfo : { direction : 'DESC', field: 'id' },
171            xns : Roo.data,
172            xtype : 'Store',
173            listeners : {
174             beforeload : function (_self, o){
175                  o.params = o.params || {};
176                  
177              }
178            },
179            items : [
180
181            ]
182
183           },
184           '|xns' : 'Roo.form',
185           allowBlank : false,
186           alwaysQuery : true,
187           displayField : 'name',
188           editable : true,
189           emptyText : _this._strings['ded4cba1b04eb8236e24a3e39470d8a7'],
190           fieldLabel : 'Campaign',
191           forceSelection : true,
192           hiddenName : 'campaign_id',
193           listWidth : 400,
194           loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
195           minChars : 2,
196           name : 'camapign_id_name',
197           pageSize : 20,
198           qtip : _this._strings['0ee0f676f631ad4e8a5844314a3a20de'],
199           queryParam : 'query[name]',
200           selectOnFocus : true,
201           tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b></div>',
202           triggerAction : 'all',
203           typeAhead : false,
204           valueField : 'id',
205           width : 400,
206           xns : Roo.form,
207           xtype : 'ComboBox',
208           items : [
209
210           ]
211
212          },
213          {
214           combo : {
215            store : {
216             proxy : {
217              '|xns' : 'Roo.data',
218              method : 'GET',
219              url : baseURL + '/Roo/clipping_keywords.php',
220              xns : Roo.data,
221              xtype : 'HttpProxy'
222             },
223             reader : {
224              '|xns' : 'Roo.data',
225              fields : [{"name":"id","type":"int"},{"name":"keyword","type":"string"}],
226              id : 'code',
227              root : 'data',
228              totalProperty : 'total',
229              xns : Roo.data,
230              xtype : 'JsonReader'
231             },
232             '|xns' : 'Roo.data',
233             remoteSort : true,
234             sortInfo : { direction : 'ASC', field: 'display_name' },
235             xns : Roo.data,
236             xtype : 'Store',
237             listeners : {
238              beforeload : function (_self, o){
239                   o.params = o.params || {};
240                   
241                   var s = _this.form.findField('campaign_id').getValue() * 1;
242                   
243                   if(isNaN(s) || s < 1){
244                       return false;
245                   }
246                   
247                   o.params.is_active  = 1;
248                   o.params.is_keyword = 1;
249                   o.params.project_id = s;
250               }
251             },
252             items : [
253
254             ]
255
256            },
257            '|xns' : 'Roo.form',
258            allowBlank : true,
259            alwaysQuery : true,
260            displayField : 'keyword',
261            editable : true,
262            fieldLabel : 'Keyword',
263            forceSelection : true,
264            listWidth : 400,
265            minChars : 2,
266            queryParam : 'query[keyword]',
267            tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{keyword}</b> </div>',
268            triggerAction : 'all',
269            valueField : 'id',
270            width : 400,
271            xns : Roo.form,
272            xtype : 'ComboBox',
273            items : [
274
275            ]
276
277           },
278           '|xns' : 'Roo.form',
279           allowBlank : false,
280           fieldLabel : 'Keywords',
281           hiddenName : 'keyword_filters',
282           name : 'keyword_filters_name',
283           width : 410,
284           xns : Roo.form,
285           xtype : 'ComboBoxArray',
286           items : [
287
288           ]
289
290          },
291          {
292           '|xns' : 'Roo.form',
293           name : 'id',
294           xns : Roo.form,
295           xtype : 'Hidden'
296          }
297         ]
298
299        }
300       ]
301
302      }
303     ]
304
305    });
306  }
307 };