sync
[Pman.Admin] / Pman.Dialog.AdminNotifySender.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.AdminNotifySender = {
8
9  _strings : {
10   'b46cf6d1278a6e8ba1e1fb3290ad9166' :"Add / Edit Sender",
11   'ce8ae9da5b7cd6c3df2929543a9af92d' :"Email",
12   '7e240928383acb93e5066a6149430337' :"Pool Name",
13   'ea4788705e6873b424c65e91c2846b19' :"Cancel",
14   'e253f01e45700c07327115a5e6d677bf' :"Is Active?",
15   'c9cc8cce247e49bae79f15173ce97354' :"Save"
16  },
17  _named_strings : {
18   'is_active_fieldLabel' : 'e253f01e45700c07327115a5e6d677bf' /* Is Active? */ ,
19   'poolname_fieldLabel' : '7e240928383acb93e5066a6149430337' /* Pool Name */ ,
20   'email_fieldLabel' : 'ce8ae9da5b7cd6c3df2929543a9af92d' /* Email */ 
21  },
22
23  dialog : false,
24  callback:  false,
25
26  show : function(data, cb)
27  {
28   if (!this.dialog) {
29    this.create();
30   }
31
32   this.callback = cb;
33   this.data = data;
34   this.dialog.show.apply(this.dialog,  Array.prototype.slice.call(arguments).slice(2));
35   if (this.form) {
36    this.form.reset();
37    this.form.setValues(data);
38    this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
39   }
40
41  },
42
43  create : function()
44  {
45    var _this = this;
46    this.dialog = Roo.factory({
47     xtype : 'LayoutDialog',
48     closable : true,
49     collapsible : false,
50     height : 200,
51     modal : true,
52     resizable : false,
53     title : _this._strings['b46cf6d1278a6e8ba1e1fb3290ad9166'] /* Add / Edit Sender */,
54     width : 500,
55     xns : Roo,
56     '|xns' : 'Roo',
57     center : {
58      xtype : 'LayoutRegion',
59      xns : Roo,
60      '|xns' : 'Roo'
61     },
62     buttons : [
63      {
64       xtype : 'Button',
65       text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
66       listeners : {
67        click : function (_self, e)
68         {
69            _this.dialog.hide();
70         
71         }
72       },
73       xns : Roo,
74       '|xns' : 'Roo'
75      },
76      {
77       xtype : 'Button',
78       text : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
79       listeners : {
80        click : function (_self, e)
81         {
82          
83             _this.form.doAction("submit");
84         
85         }
86       },
87       xns : Roo,
88       '|xns' : 'Roo'
89      }
90     ],
91     items  : [
92      {
93       xtype : 'ContentPanel',
94       region : 'center',
95       xns : Roo,
96       '|xns' : 'Roo',
97       items  : [
98        {
99         xtype : 'Form',
100         labelWidth : 150,
101         method : 'POST',
102         style : 'margin:10px;',
103         url : baseURL + '/Roo/core_notify_sender',
104         listeners : {
105          actioncomplete : function(_self,action)
106           {
107               if (action.type == 'setdata') {
108                  
109                  if (_this.data.clone_of) {
110                      _this.dialog.el.mask("Loading");
111                       this.load({ method: 'GET', params: { '_id' : _this.data.clone_of }});
112                  }
113                  return;
114               }
115               if (action.type == 'load') {
116                   _this.dialog.el.unmask();
117                   // unset the id..
118                   
119                   return;
120               }
121               if (action.type =='submit') {
122               
123                   _this.dialog.el.unmask();
124                   _this.dialog.hide();
125                   
126                    
127                   _this.form.reset();
128                    
129                    _this.callback.call(_this, action.result.data);
130             
131                   
132                    return;
133               }
134           },
135          actionfailed : function (_self, action)
136           {
137               _this.dialog.el.unmask();
138               
139               Pman.standardActionFailed(_self, action);
140           },
141          rendered : function (form)
142           {
143               _this.form= form;
144           }
145         },
146         xns : Roo.form,
147         '|xns' : 'Roo.form',
148         items  : [
149          {
150           xtype : 'TextField',
151           allowBlank : false,
152           fieldLabel : _this._strings['ce8ae9da5b7cd6c3df2929543a9af92d'] /* Email */,
153           name : 'email',
154           vtype : 'email',
155           width : 200,
156           xns : Roo.form,
157           '|xns' : 'Roo.form'
158          },
159          {
160           xtype : 'TextField',
161           allowBlank : false,
162           fieldLabel : _this._strings['7e240928383acb93e5066a6149430337'] /* Pool Name */,
163           name : 'poolname',
164           width : 200,
165           xns : Roo.form,
166           '|xns' : 'Roo.form'
167          },
168          {
169           xtype : 'Checkbox',
170           fieldLabel : _this._strings['e253f01e45700c07327115a5e6d677bf'] /* Is Active? */,
171           name : 'is_active',
172           xns : Roo.form,
173           '|xns' : 'Roo.form'
174          },
175          {
176           xtype : 'Hidden',
177           name : 'id',
178           xns : Roo.form,
179           '|xns' : 'Roo.form'
180          }
181         ]
182        }
183       ]
184      }
185     ]
186    });
187  }
188 };