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