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