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 '01bd6a16732dfa2b760dc8566c58afae' :"Download to Excel",
18 '4a4a8fe0c6dfb6bd2a41755d15eb6f0b' :"From Name",
19 '4ca679a383343ab3d4ca1cd7c91b43f7' :"From Email",
20 '5fb63579fc981698f97d55bfecb213ea' :"Copy",
21 'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
22 '49ee3087348e8d44e1feda1917443987' :"Name"
25 part : ["Admin", "EmailTemplates" ],
26 order : '999-Pman.Tab.AdminEmailTemplates',
28 parent : 'Pman.Tab.Admin',
29 name : "Manage Email Templates",
38 title : _this._strings['f49559cda3fb906fbd7736f8b8a0e37d'] /* Email Template */,
41 xtype : 'NestedLayoutPanel',
45 xtype : 'BorderLayout',
51 xtype : 'LayoutRegion'
60 xtype : 'LayoutRegion'
68 tableName : 'core_email',
69 title : _this._strings['c7d299bf3f9e37c77ab646f7e5366696'] /* core_email */,
74 activate : function() {
77 _this.grid.footer.onClick('first');
82 autoExpandColumn : 'subject',
91 _this.dialog = Pman.Dialog.CoreEmail;
92 if (_this.panel.active) {
93 _this.grid.footer.onClick('first');
96 rowclick : function (_self, rowIndex, e)
98 // _this.grid.ds.load({});
99 _this.viewPanel.view.store.load({});
101 rowdblclick : function (_self, rowIndex, e)
106 var data = this.getDataSource().getAt(rowIndex).data;
107 _this.dialog.show( {id : data.id, module : 'core_email'} , function() {
108 _this.grid.footer.onClick('first');
114 displayMsg : _this._strings['00d6e06d2f3c092b4f5e1e708a360b0f'] /* Displaying Message{0} - {1} of {2} */,
115 emptyMsg : _this._strings['9076cbba1d9ef79280b4f39e2aa0d115'] /* Nothing found */,
119 xtype : 'PagingToolbar',
122 text : _this._strings['01bd6a16732dfa2b760dc8566c58afae'] /* Download to Excel */,
124 '|xns' : 'Roo.Toolbar',
131 url : baseURL + '/Roo/Core_email',
138 Roo.MessageBox.alert("Notice", "Should be downloading now");
155 render : function (_self)
157 _this.searchBox = _self;
159 specialkey : function (_self, e)
161 _this.grid.footer.onClick('first');
167 icon : rootURL + '/Pman/templates/images/search.gif',
169 '|xns' : 'Roo.Toolbar',
172 click : function (_self, e)
174 _this.grid.footer.onClick('first');
180 icon : rootURL + '/Pman/templates/images/edit-clear.gif',
182 '|xns' : 'Roo.Toolbar',
185 click : function (_self, e)
187 _this.searchBox.setValue('');
\r
188 _this.grid.footer.onClick('first');
\r
194 '|xns' : 'Roo.Toolbar',
198 cls : 'x-btn-text-icon',
199 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
200 text : _this._strings['5fb63579fc981698f97d55bfecb213ea'] /* Copy */,
202 '|xns' : 'Roo.Toolbar',
207 var sel = _this.grid.selModel.getSelected();
209 Roo.MessageBox.alert("Error", "Select a message to copy");
213 url : baseURL + '/Roo/Core_email',
219 success : function() {
220 _this.grid.footer.onClick('refresh');
228 cls : 'x-btn-text-icon',
229 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
230 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
232 '|xns' : 'Roo.Toolbar',
240 _this.dialog.show( { id : 0, module : 'core_email' } , function() {
241 _this.grid.footer.onClick('first');
248 '|xns' : 'Roo.Toolbar',
252 cls : 'x-btn-text-icon',
253 icon : rootURL + '/Pman/templates/images/trash.gif',
254 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
256 '|xns' : 'Roo.Toolbar',
261 Pman.genericDelete(_this, 'core_email');
270 sortInfo : { field : 'name', direction: 'ASC' },
275 beforeload : function (_self, options)
277 options.params = options.params || {};
279 var s = _this.searchBox.getValue();
282 options.params['search[nameortitle]'] = s;
289 url : baseURL + '/Roo/Core_email.php',
307 totalProperty : 'total',
317 xtype : 'RowSelectionModel'
322 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
323 renderer : function(v) { return String.format('{0}', v); },
328 xtype : 'ColumnModel'
331 dataIndex : 'subject',
332 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
333 renderer : function(v) { return String.format('{0}', v); },
338 xtype : 'ColumnModel'
341 dataIndex : 'from_name',
342 header : _this._strings['4a4a8fe0c6dfb6bd2a41755d15eb6f0b'] /* From Name */,
343 renderer : function(v) { return String.format('{0}', v); },
348 xtype : 'ColumnModel'
351 dataIndex : 'from_email',
352 header : _this._strings['4ca679a383343ab3d4ca1cd7c91b43f7'] /* From Email */,
353 renderer : function(v) { return String.format('{0}', v); },
358 xtype : 'ColumnModel'
363 dataIndex : 'subject',
364 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
365 renderer : function(v) { return String.format('{0}', v); },
370 xtype : 'ColumnModel'
373 dataIndex : 'subject',
374 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
375 renderer : function(v) { return String.format('{0}', v); },
380 xtype : 'ColumnModel'
391 title : _this._strings['9e11143e29a031212f2cdefcf61f39e9'] /* View Message */,
394 xtype : 'ContentPanel',
396 render : function (_self)
398 _this.viewPanel = _self;
402 tpl : new Roo.DomTemplate({url : rootURL+'/Pman/Crm/domtemplates/crm_mail.html'}),
407 preparedata : function (_self, data, i, rec)
410 //Roo.apply(data, rec.json);
418 beforeload : function (_self, options)
420 options.params = options.params || {};
421 var p = _this.grid.selModel.getSelected();
422 if (!p || !p.data.id) {
427 options.params['id'] = p.data.id;
430 load : function (_self, records, options)
432 var p = _this.grid.selModel.getSelected();
434 if (!p || !p.data.id) {
440 url : baseURL + '/Roo/crm_action.php',
443 person_id : p.data.id,
447 success : function(res) {
449 var el = _this.cpanel.el.select('.crm-history-content').first();
450 _this.historyTemplate.overwrite(el, res);
451 el.select('.crm-history-log').on('click', Pman.Crm.auditToggle);
455 failure : function(e) {
457 _this.grid.ds.load({});
463 //_this.historyTemplate = new Roo.DomTemplate({url : rootURL+'/Pman/Crm/domtemplates/crm_history.html'})
469 el = _this.elemmnt.select('.services')
470 _this.serviceTemplate.overwite(el, data)
476 url : baseURL+'/Roo/Core_email.php',
484 totalProperty : 'total',