MailTemplateList.php
[Pman.Core] / Pman.Dialog.MailTemplateList.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 Pman.Dialog.MailTemplateList = {
6
7     dialog : false,
8     callback:  false,
9
10     show : function(data, cb)
11     {
12         if (!this.dialog) {
13             this.create();
14         }
15
16         this.callback = cb;
17         this.data = data;
18         this.dialog.show(this.data._el);
19         if (this.form) {
20            this.form.reset();
21            this.form.setValues(data);
22            this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
23         }
24
25     },
26
27     create : function()
28     {
29         var _this = this;
30         this.dialog = Roo.factory({
31             xtype: 'LayoutDialog',
32             xns: Roo,
33             closable : false,
34             collapsible : false,
35             height : 500,
36             modal : true,
37             resizable : false,
38             title : "Email Templates",
39             width : 500,
40             items : [
41                 {
42                     xtype: 'GridPanel',
43                     xns: Roo,
44                     listeners : {
45                         activate : function() {
46                             _this.panel = this;
47                             if (_this.grid) {
48                                 _this.grid.ds.load({});
49                             }
50                         }
51                     },
52                     background : false,
53                     fitContainer : true,
54                     fitToframe : true,
55                     region : 'center',
56                     tableName : 'ignore',
57                     title : "Template name",
58                     grid : {
59                         xtype: 'Grid',
60                         xns: Roo.grid,
61                         listeners : {
62                             render : function() 
63                             {
64                                 _this.grid = this; 
65                                 //_this.dialog = Pman.Dialog.FILL_IN
66                                 if (_this.panel.active) {
67                                    this.ds.load({});
68                                 }
69                             }
70                         },
71                         autoExpandColumn : 'name',
72                         loadMask : true,
73                         dataSource : {
74                             xtype: 'Store',
75                             xns: Roo.data,
76                             listeners : {
77                                 beforeload : function (_self, o)
78                                 {
79                                     o.params = o.params || {};
80                                     o.params._list = 1;
81                                 }
82                             },
83                             remoteSort : true,
84                             sortInfo : { field : 'publication', direction: 'ASC' },
85                             proxy : {
86                                 xtype: 'HttpProxy',
87                                 xns: Roo.data,
88                                 method : 'GET',
89                                 url : baseURL + '/Core/MailTemplateList.php'
90                             },
91                             reader : {
92                                 xtype: 'JsonReader',
93                                 xns: Roo.data,
94                                 totalProperty : 'total',
95                                 root : 'data',
96                                 id : 'id',
97                                 fields : [
98                                     {
99                                         'name': 'id',
100                                         'type': 'int'
101                                     },
102                                     {
103                                         'name': 'name',
104                                         'type': 'string'
105                                     },
106                                     {
107                                         'name': 'type',
108                                         'type': 'int'
109                                     },
110                                     {
111                                         'name': 'leader',
112                                         'type': 'int'
113                                     },
114                                     {
115                                         'name': 'leader_id',
116                                         'type': 'int'
117                                     },
118                                     {
119                                         'name': 'leader_office_id',
120                                         'type': 'int'
121                                     },
122                                     {
123                                         'name': 'leader_name',
124                                         'type': 'string'
125                                     },
126                                     {
127                                         'name': 'leader_phone',
128                                         'type': 'string'
129                                     },
130                                     {
131                                         'name': 'leader_fax',
132                                         'type': 'string'
133                                     },
134                                     {
135                                         'name': 'leader_email',
136                                         'type': 'string'
137                                     },
138                                     {
139                                         'name': 'leader_company_id',
140                                         'type': 'int'
141                                     },
142                                     {
143                                         'name': 'leader_role',
144                                         'type': 'string'
145                                     },
146                                     {
147                                         'name': 'leader_active',
148                                         'type': 'int'
149                                     },
150                                     {
151                                         'name': 'leader_remarks',
152                                         'type': 'string'
153                                     },
154                                     {
155                                         'name': 'leader_passwd',
156                                         'type': 'string'
157                                     },
158                                     {
159                                         'name': 'leader_owner_id',
160                                         'type': 'int'
161                                     },
162                                     {
163                                         'name': 'leader_lang',
164                                         'type': 'string'
165                                     },
166                                     {
167                                         'name': 'leader_no_reset_sent',
168                                         'type': 'int'
169                                     },
170                                     {
171                                         'name': 'leader_action_type',
172                                         'type': 'string'
173                                     },
174                                     {
175                                         'name': 'leader_project_id',
176                                         'type': 'int'
177                                     },
178                                     {
179                                         'name': 'leader_deleted_by',
180                                         'type': 'int'
181                                     },
182                                     {
183                                         'name': 'leader_deleted_dt',
184                                         'type': 'date'
185                                     },
186                                     {
187                                         'name': 'leader_firstname',
188                                         'type': 'string'
189                                     },
190                                     {
191                                         'name': 'leader_lastname',
192                                         'type': 'string'
193                                     },
194                                     {
195                                         'name': 'leader_name_facebook',
196                                         'type': 'string'
197                                     },
198                                     {
199                                         'name': 'leader_url_blog',
200                                         'type': 'string'
201                                     },
202                                     {
203                                         'name': 'leader_url_twitter',
204                                         'type': 'string'
205                                     },
206                                     {
207                                         'name': 'leader_url_linkedin',
208                                         'type': 'string'
209                                     },
210                                     {
211                                         'name': 'leader_crm_lead_percentage',
212                                         'type': 'int'
213                                     },
214                                     {
215                                         'name': 'leader_crm_industry_id',
216                                         'type': 'int'
217                                     },
218                                     {
219                                         'name': 'leader_crm_updated_action_id',
220                                         'type': 'int'
221                                     },
222                                     {
223                                         'name': 'leader_crm_created_action_id',
224                                         'type': 'int'
225                                     },
226                                     {
227                                         'name': 'leader_crm_type_id',
228                                         'type': 'int'
229                                     }
230                                 ]
231                             }
232                         },
233                         colModel : [
234                             {
235                                 xtype: 'ColumnModel',
236                                 xns: Roo.grid,
237                                 dataIndex : 'name',
238                                 header : 'Template name',
239                                 width : 200,
240                                 renderer : function(v) { return String.format('{0}', v); }
241                             }
242                         ]
243                     }
244                 }
245             ],
246             center : {
247                 xtype: 'LayoutRegion',
248                 xns: Roo,
249                 split : true,
250                 titlebar : false,
251                 width : 400
252             },
253             buttons : [
254                 {
255                     xtype: 'Button',
256                     xns: Roo,
257                     listeners : {
258                         click : function() {
259                             _this.dialog.hide();
260                         }
261                     },
262                     text : "Cancel"
263                 },
264                 {
265                     xtype: 'Button',
266                     xns: Roo,
267                     listeners : {
268                         click : function() {
269                             _this.dialog.hide();
270                         }
271                     },
272                     text : "OK"
273                 }
274             ]
275         });
276     }
277 };