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 '68b00d723d37122f64da8d9939f836f0' :"BCC Group",
16 '9e11143e29a031212f2cdefcf61f39e9' :"View Message",
17 'f49559cda3fb906fbd7736f8b8a0e37d' :"Email Template",
18 '01bd6a16732dfa2b760dc8566c58afae' :"Download to Excel",
19 '4a4a8fe0c6dfb6bd2a41755d15eb6f0b' :"From Name",
20 '4ca679a383343ab3d4ca1cd7c91b43f7' :"From Email",
21 '5fb63579fc981698f97d55bfecb213ea' :"Copy",
22 'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
23 '49ee3087348e8d44e1feda1917443987' :"Name"
26 part : ["Admin", "EmailTemplates" ],
27 order : '999-Pman.Tab.AdminEmailTemplates',
29 parent : 'Pman.Tab.Admin',
30 name : "Manage Email Templates",
39 title : _this._strings['f49559cda3fb906fbd7736f8b8a0e37d'] /* Email Template */,
42 xtype : 'NestedLayoutPanel',
46 xtype : 'BorderLayout',
52 xtype : 'LayoutRegion'
61 xtype : 'LayoutRegion'
69 tableName : 'core_email',
70 title : _this._strings['c7d299bf3f9e37c77ab646f7e5366696'] /* core_email */,
75 activate : function() {
78 _this.grid.footer.onClick('first');
83 autoExpandColumn : 'subject',
92 _this.dialog = Pman.Dialog.CoreEmail;
93 if (_this.panel.active) {
94 _this.grid.footer.onClick('first');
97 rowclick : function (_self, rowIndex, e)
99 // _this.grid.ds.load({});
100 _this.viewPanel.view.store.load({});
102 rowdblclick : function (_self, rowIndex, e)
107 var data = this.getDataSource().getAt(rowIndex).data;
108 _this.dialog.show( {id : data.id, module : 'core_email'} , function() {
109 _this.grid.footer.onClick('first');
115 displayMsg : _this._strings['00d6e06d2f3c092b4f5e1e708a360b0f'] /* Displaying Message{0} - {1} of {2} */,
116 emptyMsg : _this._strings['9076cbba1d9ef79280b4f39e2aa0d115'] /* Nothing found */,
120 xtype : 'PagingToolbar',
123 text : _this._strings['01bd6a16732dfa2b760dc8566c58afae'] /* Download to Excel */,
125 '|xns' : 'Roo.Toolbar',
132 url : baseURL + '/Roo/Core_email',
139 Roo.MessageBox.alert("Notice", "Should be downloading now");
156 render : function (_self)
158 _this.searchBox = _self;
160 specialkey : function (_self, e)
162 _this.grid.footer.onClick('first');
168 icon : rootURL + '/Pman/templates/images/search.gif',
170 '|xns' : 'Roo.Toolbar',
173 click : function (_self, e)
175 _this.grid.footer.onClick('first');
181 icon : rootURL + '/Pman/templates/images/edit-clear.gif',
183 '|xns' : 'Roo.Toolbar',
186 click : function (_self, e)
188 _this.searchBox.setValue('');
\r
189 _this.grid.footer.onClick('first');
\r
195 '|xns' : 'Roo.Toolbar',
199 cls : 'x-btn-text-icon',
200 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
201 text : _this._strings['5fb63579fc981698f97d55bfecb213ea'] /* Copy */,
203 '|xns' : 'Roo.Toolbar',
208 var sel = _this.grid.selModel.getSelected();
210 Roo.MessageBox.alert("Error", "Select a message to copy");
214 url : baseURL + '/Roo/Core_email',
220 success : function() {
221 _this.grid.footer.onClick('refresh');
229 cls : 'x-btn-text-icon',
230 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
231 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
233 '|xns' : 'Roo.Toolbar',
241 _this.dialog.show( { id : 0, module : 'core_email' } , function() {
242 _this.grid.footer.onClick('first');
249 '|xns' : 'Roo.Toolbar',
253 cls : 'x-btn-text-icon',
254 icon : rootURL + '/Pman/templates/images/trash.gif',
255 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
257 '|xns' : 'Roo.Toolbar',
262 Pman.genericDelete(_this, 'core_email');
271 sortInfo : { field : 'name', direction: 'ASC' },
276 beforeload : function (_self, options)
278 options.params = options.params || {};
280 var s = _this.searchBox.getValue();
283 options.params['search[nameortitle]'] = s;
290 url : baseURL + '/Roo/Core_email.php',
308 totalProperty : 'total',
318 xtype : 'RowSelectionModel'
323 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
324 renderer : function(v,x,r)
326 if(r.data.active * 1 < 1){
327 return String.format('<s>{0}</s>', v ? v : '');
330 return String.format('{0}', v ? v : '');
336 xtype : 'ColumnModel'
339 dataIndex : 'subject',
340 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
341 renderer : function(v,x,r)
343 if(r.data.active * 1 < 1){
344 return String.format('<s>{0}</s>', v ? v : '');
347 return String.format('{0}', v ? v : '');
353 xtype : 'ColumnModel'
356 dataIndex : 'from_name',
357 header : _this._strings['4a4a8fe0c6dfb6bd2a41755d15eb6f0b'] /* From Name */,
358 renderer : function(v) { return String.format('{0}', v ? v : ''); },
363 xtype : 'ColumnModel'
366 dataIndex : 'from_email',
367 header : _this._strings['4ca679a383343ab3d4ca1cd7c91b43f7'] /* From Email */,
368 renderer : function(v) { return String.format('{0}', v ? v : ''); },
373 xtype : 'ColumnModel'
376 dataIndex : 'bcc_group_name',
377 header : _this._strings['68b00d723d37122f64da8d9939f836f0'] /* BCC Group */,
378 renderer : function(v) { return String.format('{0}', v ? v : ''); },
383 xtype : 'ColumnModel'
394 title : _this._strings['9e11143e29a031212f2cdefcf61f39e9'] /* View Message */,
397 xtype : 'ContentPanel',
399 render : function (_self)
401 _this.viewPanel = _self;
405 tpl : new Roo.DomTemplate({url : rootURL+'/Pman/Crm/domtemplates/crm_mail.html'}),
410 preparedata : function (_self, data, i, rec)
413 //Roo.apply(data, rec.json);
421 beforeload : function (_self, options)
423 options.params = options.params || {};
424 var p = _this.grid.selModel.getSelected();
425 if (!p || !p.data.id) {
430 options.params['id'] = p.data.id;
433 load : function (_self, records, options)
435 var p = _this.grid.selModel.getSelected();
437 if (!p || !p.data.id) {
443 url : baseURL + '/Roo/crm_action.php',
446 person_id : p.data.id,
450 success : function(res) {
452 var el = _this.cpanel.el.select('.crm-history-content').first();
453 _this.historyTemplate.overwrite(el, res);
454 el.select('.crm-history-log').on('click', Pman.Crm.auditToggle);
458 failure : function(e) {
460 _this.grid.ds.load({});
466 //_this.historyTemplate = new Roo.DomTemplate({url : rootURL+'/Pman/Crm/domtemplates/crm_history.html'})
472 el = _this.elemmnt.select('.services')
473 _this.serviceTemplate.overwite(el, data)
479 url : baseURL+'/Roo/Core_email.php',
487 totalProperty : 'total',