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 '9e11143e29a031212f2cdefcf61f39e9' :"View Message",
17 'f49559cda3fb906fbd7736f8b8a0e37d' :"Email Template",
18 '27a7146e1e1890e289bc7fad72876831' :"<i class=\"fa fa-plus\"></i> Create a template",
19 'cd6df251f262cc64514b25f04aecf3c8' :"<i class=\"fa fa-clipboard\"></i> Copy",
20 'ed807858fcb68abdd180481f1fcba5c5' :"<i class=\"fa fa-trash\"></i> Delete",
21 '03c2e7e41ffc181a4e84080b4710e81e' :"New",
22 '4d3d769b812b6faa6b76e1a8abaece2d' :"Active",
23 'b5a7adde1af5c87d7fd797b6245c2a39' :"Description",
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 */,
43 activate : function (_self)
45 if(!document.getElementsByClassName('email-south-pane')) {
49 document.getElementsByClassName('email-south-pane')[0].classList.remove('disable-pane');
52 appDisabled.indexOf('Core.SuperAdmin') * 1 != -1
54 document.getElementsByClassName('email-south-pane')[0].classList.add('disable-pane');
58 xns : Roo.bootstrap.panel,
59 '|xns' : 'Roo.bootstrap.panel',
62 xns : Roo.bootstrap.layout,
63 '|xns' : 'Roo.bootstrap.layout',
68 xns : Roo.bootstrap.layout,
69 '|xns' : 'Roo.bootstrap.layout'
74 cls : 'email-south-pane',
80 xns : Roo.bootstrap.layout,
81 '|xns' : 'Roo.bootstrap.layout'
92 activate : function (_self)
94 _this.edit_btn.hide();
95 _this.copy_btn.hide();
96 _this.delete_btn.hide();
99 _this.table.footer.onClick('first');
103 render : function (_self)
108 xns : Roo.bootstrap.panel,
109 '|xns' : 'Roo.bootstrap.panel',
111 xtype : 'NavSimplebar',
113 '|xns' : 'Roo.bootstrap',
118 '|xns' : 'Roo.bootstrap',
123 '|xns' : 'Roo.bootstrap',
128 '|xns' : 'Roo.bootstrap',
134 '|xns' : 'Roo.bootstrap',
140 '|xns' : 'Roo.bootstrap',
144 placeholder : _this._strings['cffbd822c38679e2fbf11cc182c945e5'] /* search for email template */,
146 render : function (_self)
148 _this.searchBox = this;
150 specialkey : function (_self, e)
152 if(e.keyCode == e.ENTER) {
154 _this.table.footer.onClick('first');
162 '|xns' : 'Roo.bootstrap',
165 html : _this._strings['cdb6b6bab1fd18b9dbfe3fb84a5d34ae'] /* <i class="fa fa-search"></i> */,
167 click : function (_self, e)
169 _this.table.footer.onClick('first');
173 '|xns' : 'Roo.bootstrap'
181 style : 'text-align: right;',
183 '|xns' : 'Roo.bootstrap',
187 cls : 'roo-toolbar-button',
188 html : _this._strings['27a7146e1e1890e289bc7fad72876831'] /* <i class="fa fa-plus"></i> Create a template */,
190 render : function (_self)
196 '|xns' : 'Roo.bootstrap',
200 '|xns' : 'Roo.bootstrap',
205 html : _this._strings['03c2e7e41ffc181a4e84080b4710e81e'] /* New */,
207 click : function (_self, e)
213 _this.dialog.show( { id : 0, module : 'core_email' } , function() {
214 _this.table.footer.onClick('first');
219 '|xns' : 'Roo.bootstrap'
224 html : _this._strings['e6b391a8d2c4d45902a23a8b6585703d'] /* URL */,
226 click : function (_self, e)
228 Pman.Dialog.BAdminImportUrl.show(
230 target : '/Core/ImportMailMessage.php'
235 Pman.Dialog.BAdminEmail.dialog.show();
236 Pman.Dialog.BAdminEmail.form.findField('bodytext').setValue(data);
243 '|xns' : 'Roo.bootstrap'
248 html : _this._strings['73ea6b4441cdced246d236b22c8f991c'] /* HTML File */,
250 click : function (_self, e)
252 Pman.Dialog.BAdminImage.show(
254 _url : '/Core/ImportMailMessage.php'
259 Pman.Dialog.BAdminEmail.dialog.show();
260 Pman.Dialog.BAdminEmail.form.findField('bodytext').setValue(data);
267 '|xns' : 'Roo.bootstrap'
274 cls : 'roo-toolbar-button',
275 html : _this._strings['694e249c3a9503141fa5ce3fb71d5477'] /* <i class="fa fa-edit"></i> Edit */,
277 click : function (_self, e)
279 var sel = _this.grid.grid.selModel.getSelected();
281 if (!sel || sel.data.id * 1 < 1) {
282 Roo.MessageBox.alert("Error", "Select a message to edit");
286 Pman.Dialog.BAdminEmail.show( {id : sel.data.id, module : 'core_email'} , function() {
287 _this.table.footer.onClick('first');
290 render : function (_self)
292 _this.edit_btn = this;
298 '|xns' : 'Roo.bootstrap'
302 cls : 'roo-toolbar-button',
303 html : _this._strings['cd6df251f262cc64514b25f04aecf3c8'] /* <i class="fa fa-clipboard"></i> Copy */,
305 click : function (_self, e)
307 var sel = _this.grid.grid.selModel.getSelected();
309 Roo.MessageBox.alert("Error", "Select a message to copy");
313 url : baseURL + '/Roo/Core_email',
319 success : function() {
320 _this.table.footer.onClick('refresh');
324 render : function (_self)
326 _this.copy_btn = this;
332 '|xns' : 'Roo.bootstrap'
336 cls : 'roo-toolbar-button',
337 html : _this._strings['ed807858fcb68abdd180481f1fcba5c5'] /* <i class="fa fa-trash"></i> Delete */,
340 click : function (_self, e)
342 Pman.genericDelete(_this.grid, 'core_email');
344 render : function (_self)
346 _this.delete_btn = this;
352 '|xns' : 'Roo.bootstrap'
368 cellSelection : true,
374 cellclick : function (_self, el, rowIndex, columnIndex, e)
376 var di = this.colModel.getDataIndex(columnIndex);
382 var r = this.store.getAt(rowIndex);
384 if(r.data.active * 1 < 1){
386 Pman.Dialog.BAdminEmail.show( {id : r.data.id, module : 'core_email'} , function() {
387 _this.table.footer.onClick('refresh');
398 render : function (_self)
403 _this.dialog = Pman.Dialog.BAdminEmail;
405 rowdblclick : function (_self, el, rowIndex, e)
411 //var data = this.getDataSource().getAt(rowIndex).data;
412 var data = _this.table.store.getAt(rowIndex).data;
414 _this.dialog.show( {id : data.id, module : 'core_email'} , function() {
416 _this.table.footer.onClick('refresh');
421 '|xns' : 'Roo.bootstrap',
423 xtype : 'PagingToolbar',
427 '|xns' : 'Roo.bootstrap'
432 sortInfo : {field:'description',direction:'ASC'},
434 beforeload : function (_self, options)
436 if (!Pman.buildCompleted) {
440 options.params = options.params || {};
442 var s = _this.searchBox.getValue();
445 options.params['search[nameortitle]'] = s;
447 // hide our system emails.
448 if (appDisabled.indexOf('Core.SuperAdmin') > -1) {
449 options.params._hide_system_emails = 1;
453 load : function (_self, records, options)
455 _this.edit_btn.hide();
456 _this.copy_btn.hide();
457 _this.delete_btn.hide();
459 update : function (_self, record, operation)
461 if (operation != 'commit') {
466 url : baseURL + '/Roo/Core_email',
470 active : record.data.active
472 success : function() {
473 _this.table.footer.onClick('refresh');
483 url : baseURL+'/Roo/Core_email.php',
488 xtype : 'JsonReader',
499 "name":"description",
505 totalProperty : 'total',
511 xtype : 'RowSelectionModel',
514 afterselectionchange : function (_self)
516 _this.edit_btn.hide();
517 _this.copy_btn.hide();
518 _this.delete_btn.hide();
520 if (!this.getSelected()) {
521 _this.viewPanel.setContent("Nothing Selected");
525 if(this.getSelected().data) {
526 _this.viewPanel.setContent(this.getSelected().data.bodytext);
529 _this.edit_btn.show();
530 _this.copy_btn.show();
531 _this.delete_btn.show();
535 xns : Roo.bootstrap.Table,
536 '|xns' : 'Roo.bootstrap.Table'
540 xtype : 'ColumnModel',
543 dataIndex : 'active',
544 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
545 renderer : function(v) {
547 var state = v > 0 ? 'check-' : '';
548 var cls = v > 0 ? 'text-primary' : '';
550 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
559 xtype : 'ColumnModel',
561 dataIndex : 'description',
562 header : _this._strings['b5a7adde1af5c87d7fd797b6245c2a39'] /* Description */,
563 renderer : function(v,x,r)
565 vv = (v.length) ? v : r.data.name;
567 if(r.data.active * 1 < 1){
568 return '<small style="color: #999;">' + vv + '</small>';
571 return '<b>' + vv + '</b>';
579 xtype : 'ColumnModel',
581 dataIndex : 'from_email',
582 header : _this._strings['cae905999a2ad1dfb8f4eae0e8cda73b'] /* From Name<br/>Email */,
583 renderer : function(v,x,r)
585 if(r.data.active * 1 < 1){
589 return String.format('<small>{0}</small>', r.data.from_name );
597 xtype : 'ColumnModel',
599 dataIndex : 'to_group_name',
600 header : _this._strings['98d2ee61ddce0c7666297d81639914f1'] /* To / BCC Group */,
601 renderer : function(v,x,r)
603 if(r.data.active * 1 < 1){
607 var nid = r.data.to_group_id * 1 ;
608 var n = nid > 0 ? r.data.group_member_count * 1 : 0;
609 var grp_str = String.format('<small>To: {0} ' +
610 '<span class="badge' + (n > 0 ? '' : ' badge-danger') + '">{1}</span></small><br>',
611 r.data.to_group_id_name,
612 nid < 1 ? 'Not set' : n
615 if (nid < 0) { // no To needed..
618 nid = r.data.bcc_group_id * 1;
619 n = nid > 0 ? r.data.bcc_group_member_count * 1 : 0;
621 var bcc_str = String.format('<small>BCC: {0} <span class="badge' + (n > 0 ? '' : ' badge-danger') + '">{1}</span></small>',
622 r.data.bcc_group_id_name,
623 nid < 1 ? 'Not set' : n
626 if (nid < 0) { // no To needed..
630 return grp_str + bcc_str;
643 title : _this._strings['9e11143e29a031212f2cdefcf61f39e9'] /* View Message */,
645 render : function (_self)
647 _this.viewPanel = this;
650 xns : Roo.bootstrap.panel,
651 '|xns' : 'Roo.bootstrap.panel'