1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Roo.namespace('Pman.Tab');
7 Pman.Tab.AdminEmailTemplates = new Roo.XComponent({
10 'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
11 'c7d299bf3f9e37c77ab646f7e5366696' :"core_email",
12 '00d6e06d2f3c092b4f5e1e708a360b0f' :"Displaying Message{0} - {1} of {2}",
13 '9076cbba1d9ef79280b4f39e2aa0d115' :"Nothing found",
14 'b78a3223503896721cca1303f776159b' :"Title",
15 '9e11143e29a031212f2cdefcf61f39e9' :"View Message",
16 'f49559cda3fb906fbd7736f8b8a0e37d' :"Email Template",
17 '4a4a8fe0c6dfb6bd2a41755d15eb6f0b' :"From Name",
18 '4ca679a383343ab3d4ca1cd7c91b43f7' :"From Email",
19 '5fb63579fc981698f97d55bfecb213ea' :"Copy",
20 'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
21 '49ee3087348e8d44e1feda1917443987' :"Name"
24 part : ["Admin", "EmailTemplates" ],
25 order : '999-Pman.Tab.AdminEmailTemplates',
27 parent : 'Pman.Tab.Admin',
28 name : "Manage Email Templates",
37 title : _this._strings['f49559cda3fb906fbd7736f8b8a0e37d'] /* Email Template */,
40 xtype : 'NestedLayoutPanel',
44 xtype : 'BorderLayout',
50 xtype : 'LayoutRegion'
59 xtype : 'LayoutRegion'
67 tableName : 'core_email',
68 title : _this._strings['c7d299bf3f9e37c77ab646f7e5366696'] /* core_email */,
73 activate : function() {
76 _this.grid.footer.onClick('first');
81 autoExpandColumn : 'subject',
90 _this.dialog = Pman.Dialog.CoreEmail;
91 if (_this.panel.active) {
92 _this.grid.footer.onClick('first');
95 rowclick : function (_self, rowIndex, e)
97 // _this.grid.ds.load({});
98 _this.viewPanel.view.store.load({});
100 rowdblclick : function (_self, rowIndex, e)
102 if (!_this.dialog) return;
103 var data = this.getDataSource().getAt(rowIndex).data;
104 _this.dialog.show( {id : data.id, module : 'core_email'} , function() {
105 _this.grid.footer.onClick('first');
111 displayMsg : _this._strings['00d6e06d2f3c092b4f5e1e708a360b0f'] /* Displaying Message{0} - {1} of {2} */,
112 emptyMsg : _this._strings['9076cbba1d9ef79280b4f39e2aa0d115'] /* Nothing found */,
116 xtype : 'PagingToolbar'
128 render : function (_self)
130 _this.searchBox = _self;
132 specialkey : function (_self, e)
134 _this.grid.footer.onClick('first');
140 icon : rootURL + '/Pman/templates/images/search.gif',
142 '|xns' : 'Roo.Toolbar',
145 click : function (_self, e)
147 _this.grid.footer.onClick('first');
153 icon : rootURL + '/Pman/templates/images/edit-clear.gif',
155 '|xns' : 'Roo.Toolbar',
158 click : function (_self, e)
160 _this.searchBox.setValue('');
161 _this.grid.footer.onClick('first');
167 '|xns' : 'Roo.Toolbar',
171 cls : 'x-btn-text-icon',
172 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
173 text : _this._strings['5fb63579fc981698f97d55bfecb213ea'] /* Copy */,
175 '|xns' : 'Roo.Toolbar',
180 var sel = _this.grid.selModel.getSelected();
182 Roo.MessageBox.alert("Error", "Select a message to copy");
186 url : baseURL + '/Roo/Core_email',
192 success : function() {
193 _this.grid.footer.onClick('refresh');
201 cls : 'x-btn-text-icon',
202 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
203 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
205 '|xns' : 'Roo.Toolbar',
210 if (!_this.dialog) return;
211 _this.dialog.show( { id : 0, module : 'core_email' } , function() {
212 _this.grid.footer.onClick('first');
219 '|xns' : 'Roo.Toolbar',
223 cls : 'x-btn-text-icon',
224 icon : rootURL + '/Pman/templates/images/trash.gif',
225 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
227 '|xns' : 'Roo.Toolbar',
232 Pman.genericDelete(_this, 'core_email');
241 sortInfo : { field : 'name', direction: 'ASC' },
246 beforeload : function (_self, options)
248 options.params = options.params || {};
250 var s = _this.searchBox.getValue();
253 options.params['search[nameortitle]'] = s;
260 url : baseURL + '/Roo/Core_email.php',
278 totalProperty : 'total',
288 xtype : 'RowSelectionModel'
293 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
294 renderer : function(v) { return String.format('{0}', v); },
299 xtype : 'ColumnModel'
302 dataIndex : 'subject',
303 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
304 renderer : function(v) { return String.format('{0}', v); },
309 xtype : 'ColumnModel'
312 dataIndex : 'from_name',
313 header : _this._strings['4a4a8fe0c6dfb6bd2a41755d15eb6f0b'] /* From Name */,
314 renderer : function(v) { return String.format('{0}', v); },
319 xtype : 'ColumnModel'
322 dataIndex : 'from_email',
323 header : _this._strings['4ca679a383343ab3d4ca1cd7c91b43f7'] /* From Email */,
324 renderer : function(v) { return String.format('{0}', v); },
329 xtype : 'ColumnModel'
340 title : _this._strings['9e11143e29a031212f2cdefcf61f39e9'] /* View Message */,
343 xtype : 'ContentPanel',
345 render : function (_self)
347 _this.viewPanel = _self;
351 tpl : new Roo.DomTemplate({url : rootURL+'/Pman/Crm/domtemplates/crm_mail.html'}),
356 preparedata : function (_self, data, i, rec)
359 //Roo.apply(data, rec.json);
367 beforeload : function (_self, options)
369 options.params = options.params || {};
370 var p = _this.grid.selModel.getSelected();
371 if (!p || !p.data.id) {
376 options.params['id'] = p.data.id;
379 load : function (_self, records, options)
381 var p = _this.grid.selModel.getSelected();
383 if (!p || !p.data.id) {
389 url : baseURL + '/Roo/crm_action.php',
392 person_id : p.data.id,
396 success : function(res) {
398 var el = _this.cpanel.el.select('.crm-history-content').first();
399 _this.historyTemplate.overwrite(el, res);
400 el.select('.crm-history-log').on('click', Pman.Crm.auditToggle);
404 failure : function(e) {
406 _this.grid.ds.load({});
412 //_this.historyTemplate = new Roo.DomTemplate({url : rootURL+'/Pman/Crm/domtemplates/crm_history.html'})
418 el = _this.elemmnt.select('.services')
419 _this.serviceTemplate.overwite(el, data)
425 url : baseURL+'/Roo/Core_email.php',
433 totalProperty : 'total',