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.BAdminEmailTemplates = new Roo.XComponent({
10 'cdb6b6bab1fd18b9dbfe3fb84a5d34ae' :"<i class=\"fa fa-search\"></i>",
11 'cae905999a2ad1dfb8f4eae0e8cda73b' :"From Name<br/>Email",
12 '98d2ee61ddce0c7666297d81639914f1' :"To / BCC Group",
13 '73ea6b4441cdced246d236b22c8f991c' :"HTML File",
14 '694e249c3a9503141fa5ce3fb71d5477' :"<i class=\"fa fa-edit\"></i> Edit",
15 'cffbd822c38679e2fbf11cc182c945e5' :"search for email template",
16 'b78a3223503896721cca1303f776159b' :"Title",
17 '9e11143e29a031212f2cdefcf61f39e9' :"View Message",
18 'f49559cda3fb906fbd7736f8b8a0e37d' :"Email Template",
19 '27a7146e1e1890e289bc7fad72876831' :"<i class=\"fa fa-plus\"></i> Create a template",
20 'cd6df251f262cc64514b25f04aecf3c8' :"<i class=\"fa fa-clipboard\"></i> Copy",
21 'ed807858fcb68abdd180481f1fcba5c5' :"<i class=\"fa fa-trash\"></i> Delete",
22 '03c2e7e41ffc181a4e84080b4710e81e' :"New",
23 '49ee3087348e8d44e1feda1917443987' :"Name",
24 'e6b391a8d2c4d45902a23a8b6585703d' :"URL"
27 part : ["BAdmin", "EmailTemplates" ],
28 order : '004-Pman.Tab.BAdminEmailTemplates',
30 parent : 'Pman.Tab.BAdmin',
31 name : "Pman.Tab.BAdminEmailTemplates",
34 _tree : function(_data)
41 title : _this._strings['f49559cda3fb906fbd7736f8b8a0e37d'] /* Email Template */,
42 xns : Roo.bootstrap.panel,
43 '|xns' : 'Roo.bootstrap.panel',
46 xns : Roo.bootstrap.layout,
47 '|xns' : 'Roo.bootstrap.layout',
52 xns : Roo.bootstrap.layout,
53 '|xns' : 'Roo.bootstrap.layout'
63 xns : Roo.bootstrap.layout,
64 '|xns' : 'Roo.bootstrap.layout'
75 activate : function (_self)
77 _this.edit_btn.hide();
78 _this.copy_btn.hide();
79 _this.delete_btn.hide();
82 _this.table.footer.onClick('first');
86 render : function (_self)
91 xns : Roo.bootstrap.panel,
92 '|xns' : 'Roo.bootstrap.panel',
94 xtype : 'NavSimplebar',
96 '|xns' : 'Roo.bootstrap',
101 '|xns' : 'Roo.bootstrap',
106 '|xns' : 'Roo.bootstrap',
111 '|xns' : 'Roo.bootstrap',
117 '|xns' : 'Roo.bootstrap',
123 '|xns' : 'Roo.bootstrap',
127 placeholder : _this._strings['cffbd822c38679e2fbf11cc182c945e5'] /* search for email template */,
129 render : function (_self)
131 _this.searchBox = this;
133 specialkey : function (_self, e)
135 if(e.keyCode == e.ENTER) {
137 _this.table.footer.onClick('first');
144 '|xns' : 'Roo.bootstrap',
147 html : _this._strings['cdb6b6bab1fd18b9dbfe3fb84a5d34ae'] /* <i class="fa fa-search"></i> */,
149 click : function (_self, e)
151 _this.table.footer.onClick('first');
155 '|xns' : 'Roo.bootstrap'
163 style : 'text-align: right;',
165 '|xns' : 'Roo.bootstrap',
169 cls : 'roo-toolbar-button',
170 html : _this._strings['27a7146e1e1890e289bc7fad72876831'] /* <i class="fa fa-plus"></i> Create a template */,
172 '|xns' : 'Roo.bootstrap',
176 '|xns' : 'Roo.bootstrap',
181 html : _this._strings['03c2e7e41ffc181a4e84080b4710e81e'] /* New */,
183 click : function (_self, e)
189 _this.dialog.show( { id : 0, module : 'core_email' } , function() {
190 _this.table.footer.onClick('first');
195 '|xns' : 'Roo.bootstrap'
200 html : _this._strings['e6b391a8d2c4d45902a23a8b6585703d'] /* URL */,
202 click : function (_self, e)
204 Pman.Dialog.BAdminImportUrl.show(
206 target : '/Core/ImportMailMessage.php'
211 Pman.Dialog.BAdminEmail.dialog.show();
212 Pman.Dialog.BAdminEmail.form.findField('bodytext').setValue(data);
219 '|xns' : 'Roo.bootstrap'
224 html : _this._strings['73ea6b4441cdced246d236b22c8f991c'] /* HTML File */,
226 click : function (_self, e)
228 Pman.Dialog.BAdminImage.show(
230 _url : '/Core/ImportMailMessage.php'
235 Pman.Dialog.BAdminEmail.dialog.show();
236 Pman.Dialog.BAdminEmail.form.findField('bodytext').setValue(data);
243 '|xns' : 'Roo.bootstrap'
250 cls : 'roo-toolbar-button',
251 html : _this._strings['694e249c3a9503141fa5ce3fb71d5477'] /* <i class="fa fa-edit"></i> Edit */,
253 click : function (_self, e)
255 var sel = _this.grid.grid.selModel.getSelected();
257 if (!sel || sel.data.id * 1 < 1) {
258 Roo.MessageBox.alert("Error", "Select a message to edit");
262 Pman.Dialog.BAdminEmail.show( {id : sel.data.id, module : 'core_email'} , function() {
263 _this.table.footer.onClick('first');
266 render : function (_self)
268 _this.edit_btn = this;
274 '|xns' : 'Roo.bootstrap'
278 cls : 'roo-toolbar-button',
279 html : _this._strings['cd6df251f262cc64514b25f04aecf3c8'] /* <i class="fa fa-clipboard"></i> Copy */,
281 click : function (_self, e)
283 var sel = _this.grid.grid.selModel.getSelected();
285 Roo.MessageBox.alert("Error", "Select a message to copy");
289 url : baseURL + '/Roo/Core_email',
295 success : function() {
296 _this.table.footer.onClick('refresh');
300 render : function (_self)
302 _this.copy_btn = this;
308 '|xns' : 'Roo.bootstrap'
312 cls : 'roo-toolbar-button',
313 html : _this._strings['ed807858fcb68abdd180481f1fcba5c5'] /* <i class="fa fa-trash"></i> Delete */,
316 click : function (_self, e)
318 Pman.genericDelete(_this.grid, 'core_email');
320 render : function (_self)
322 _this.delete_btn = this;
328 '|xns' : 'Roo.bootstrap'
349 render : function (_self)
354 _this.dialog = Pman.Dialog.BAdminEmail;
356 rowdblclick : function (_self, el, rowIndex, e)
362 //var data = this.getDataSource().getAt(rowIndex).data;
363 var data = _this.table.store.getAt(rowIndex).data;
365 _this.dialog.show( {id : data.id, module : 'core_email'} , function() {
367 _this.table.footer.onClick('first');
372 '|xns' : 'Roo.bootstrap',
374 xtype : 'PagingToolbar',
378 '|xns' : 'Roo.bootstrap'
383 sortInfo : {field:'name',direction:'ASC'},
385 beforeload : function (_self, options)
387 if (!Pman.buildCompleted) {
391 options.params = options.params || {};
393 var s = _this.searchBox.getValue();
396 options.params['search[nameortitle]'] = s;
400 load : function (_self, records, options)
402 _this.edit_btn.hide();
403 _this.copy_btn.hide();
404 _this.delete_btn.hide();
412 url : baseURL+'/Roo/Core_email.php',
417 xtype : 'JsonReader',
430 totalProperty : 'total',
436 xtype : 'RowSelectionModel',
439 afterselectionchange : function (_self)
441 _this.edit_btn.hide();
442 _this.copy_btn.hide();
443 _this.delete_btn.hide();
445 if (!this.getSelected()) {
446 _this.viewPanel.setContent("Nothing Selected");
450 if(this.getSelected().data) {
451 _this.viewPanel.setContent(this.getSelected().data.bodytext);
454 _this.edit_btn.show();
455 _this.copy_btn.show();
456 _this.delete_btn.show();
460 xns : Roo.bootstrap.Table,
461 '|xns' : 'Roo.bootstrap.Table'
465 xtype : 'ColumnModel',
468 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
469 renderer : function(v,x,r)
471 if(r.data.active * 1 < 1){
473 return String.format('<small"><s>{0}</s></small>', v ? v : '');
477 return String.format('<small>{0}</small>', v ? v : '');
485 xtype : 'ColumnModel',
487 dataIndex : 'subject',
488 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
489 renderer : function(v,x,r)
491 if(r.data.active * 1 < 1){
492 return String.format('<small><s>{0}</s></small>', v ? v : '');
495 return String.format('<small>{0}</small>', v ? v : '');
503 xtype : 'ColumnModel',
505 dataIndex : 'from_email',
506 header : _this._strings['cae905999a2ad1dfb8f4eae0e8cda73b'] /* From Name<br/>Email */,
507 renderer : function(v,x,r)
509 var from_name = r.data.from_name ? r.data.from_name : '';
510 var from_email = r.data.from_email ? r.data.from_email : '';
512 //var r = from_name + '<br>' + from_email ;
514 return String.format('<small>{0}</small>', from_email);
516 return String.format('<small>{0} <br> {1}</small>', from_name, from_email);
519 return String.format(
521 r.data.from_name ? r.data.from_name : '',
522 r.data.from_email ? r.data.from_email : ''
531 xtype : 'ColumnModel',
533 dataIndex : 'to_group_name',
534 header : _this._strings['98d2ee61ddce0c7666297d81639914f1'] /* To / BCC Group */,
535 renderer : function(v,x,r)
537 // if to group id < 0 then it's disabled...
539 var nid = r.data.to_group_id * 1 ;
540 var n = nid > 0 ? r.data.group_member_count * 1 : 0;
541 var grp_str = String.format('<small>To: {0} ' +
542 '<span class="badge' + (n > 0 ? '' : ' badge-danger') + '">{1}</span></small><br>',
543 r.data.to_group_id_name,
544 nid < 1 ? 'Not set' : n
547 if (nid < 0) { // no To needed..
550 nid = r.data.bcc_group_id * 1;
551 n = nid > 0 ? r.data.bcc_group_member_count * 1 : 0;
553 var bcc_str = String.format('<small>BCC: {0} <span class="badge' + (n > 0 ? '' : ' badge-danger') + '">{1}</span></small>',
554 r.data.bcc_group_id_name,
555 nid < 1 ? 'Not set' : n
558 if (nid < 0) { // no To needed..
562 return grp_str + bcc_str;
575 title : _this._strings['9e11143e29a031212f2cdefcf61f39e9'] /* View Message */,
577 render : function (_self)
579 _this.viewPanel = this;
582 xns : Roo.bootstrap.panel,
583 '|xns' : 'Roo.bootstrap.panel'