bddf1de2589a80485fd5f012706714068efc8da7
[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                       var n = Roo.decode(_this.data.keywords);
128                       _this.form.findField('keyword_filters').setValue(n);
129                   }
130                   
131                   return;
132               }
133               if (action.type == 'submit' ) {
134                   _this.dialog.el.unmask();
135                   _this.dialog.hide();
136           
137                   if (_this.callback) {
138                      _this.callback.call(_this, action.result.data);
139                   }
140                   _this.form.reset();
141               }
142           },
143          rendered : function (form)
144           {
145              _this.form = form;
146           }
147         },
148         items : [
149          {
150           store : {
151            proxy : {
152             '|xns' : 'Roo.data',
153             method : 'GET',
154             url : baseURL + '/Roo/Projects.php',
155             xns : Roo.data,
156             xtype : 'HttpProxy'
157            },
158            reader : {
159             '|xns' : 'Roo.data',
160             fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}],
161             id : 'id',
162             root : 'data',
163             totalProperty : 'total',
164             xns : Roo.data,
165             xtype : 'JsonReader'
166            },
167            '|xns' : 'Roo.data',
168            remoteSort : true,
169            sortInfo : { direction : 'DESC', field: 'id' },
170            xns : Roo.data,
171            xtype : 'Store',
172            listeners : {
173             beforeload : function (_self, o){
174                  o.params = o.params || {};
175                  
176              }
177            },
178            items : [
179
180            ]
181
182           },
183           '|xns' : 'Roo.form',
184           allowBlank : false,
185           alwaysQuery : true,
186           displayField : 'name',
187           editable : true,
188           emptyText : _this._strings['ded4cba1b04eb8236e24a3e39470d8a7'],
189           fieldLabel : 'Campaign',
190           forceSelection : true,
191           hiddenName : 'campaign_id',
192           listWidth : 400,
193           loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
194           minChars : 2,
195           name : 'campaign_id_name',
196           pageSize : 20,
197           qtip : _this._strings['0ee0f676f631ad4e8a5844314a3a20de'],
198           queryParam : 'query[name]',
199           selectOnFocus : true,
200           tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b></div>',
201           triggerAction : 'all',
202           typeAhead : false,
203           valueField : 'id',
204           width : 400,
205           xns : Roo.form,
206           xtype : 'ComboBox',
207           items : [
208
209           ]
210
211          },
212          {
213           combo : {
214            store : {
215             proxy : {
216              '|xns' : 'Roo.data',
217              method : 'GET',
218              url : baseURL + '/Roo/clipping_keywords.php',
219              xns : Roo.data,
220              xtype : 'HttpProxy'
221             },
222             reader : {
223              '|xns' : 'Roo.data',
224              fields : [{"name":"id","type":"int"},{"name":"keyword","type":"string"}],
225              id : 'code',
226              root : 'data',
227              totalProperty : 'total',
228              xns : Roo.data,
229              xtype : 'JsonReader'
230             },
231             '|xns' : 'Roo.data',
232             remoteSort : true,
233             sortInfo : { direction : 'ASC', field: 'display_name' },
234             xns : Roo.data,
235             xtype : 'Store',
236             listeners : {
237              beforeload : function (_self, o){
238                   o.params = o.params || {};
239                   
240                   var s = _this.form.findField('campaign_id').getValue() * 1;
241                   
242                   if(isNaN(s) || s < 1){
243                       return false;
244                   }
245                   
246                   o.params.is_active  = 1;
247                   o.params.is_keyword = 1;
248                   o.params.project_id = s;
249               }
250             },
251             items : [
252
253             ]
254
255            },
256            '|xns' : 'Roo.form',
257            allowBlank : true,
258            alwaysQuery : true,
259            displayField : 'keyword',
260            editable : true,
261            fieldLabel : 'Keyword',
262            forceSelection : true,
263            listWidth : 400,
264            minChars : 2,
265            queryParam : 'query[keyword]',
266            tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{keyword}</b> </div>',
267            triggerAction : 'all',
268            valueField : 'id',
269            width : 400,
270            xns : Roo.form,
271            xtype : 'ComboBox',
272            items : [
273
274            ]
275
276           },
277           '|xns' : 'Roo.form',
278           allowBlank : false,
279           fieldLabel : 'Keywords',
280           hiddenName : 'keyword_filters',
281           name : 'keyword_filters_name',
282           width : 410,
283           xns : Roo.form,
284           xtype : 'ComboBoxArray',
285           items : [
286
287           ]
288
289          },
290          {
291           '|xns' : 'Roo.form',
292           name : 'id',
293           xns : Roo.form,
294           xtype : 'Hidden'
295          }
296         ]
297
298        }
299       ]
300
301      }
302     ]
303
304    });
305  }
306 };