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 */,
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');
145 '|xns' : 'Roo.bootstrap',
148 html : _this._strings['cdb6b6bab1fd18b9dbfe3fb84a5d34ae'] /* <i class="fa fa-search"></i> */,
150 click : function (_self, e)
152 _this.table.footer.onClick('first');
156 '|xns' : 'Roo.bootstrap'
164 style : 'text-align: right;',
166 '|xns' : 'Roo.bootstrap',
170 cls : 'roo-toolbar-button',
171 html : _this._strings['27a7146e1e1890e289bc7fad72876831'] /* <i class="fa fa-plus"></i> Create a template */,
173 '|xns' : 'Roo.bootstrap',
177 '|xns' : 'Roo.bootstrap',
182 html : _this._strings['03c2e7e41ffc181a4e84080b4710e81e'] /* New */,
184 click : function (_self, e)
190 _this.dialog.show( { id : 0, module : 'core_email' } , function() {
191 _this.table.footer.onClick('first');
196 '|xns' : 'Roo.bootstrap'
201 html : _this._strings['e6b391a8d2c4d45902a23a8b6585703d'] /* URL */,
203 click : function (_self, e)
205 Pman.Dialog.BAdminImportUrl.show(
207 target : '/Core/ImportMailMessage.php'
212 Pman.Dialog.BAdminEmail.dialog.show();
213 Pman.Dialog.BAdminEmail.form.findField('bodytext').setValue(data);
220 '|xns' : 'Roo.bootstrap'
225 html : _this._strings['73ea6b4441cdced246d236b22c8f991c'] /* HTML File */,
227 click : function (_self, e)
229 Pman.Dialog.BAdminImage.show(
231 _url : '/Core/ImportMailMessage.php'
236 Pman.Dialog.BAdminEmail.dialog.show();
237 Pman.Dialog.BAdminEmail.form.findField('bodytext').setValue(data);
244 '|xns' : 'Roo.bootstrap'
251 cls : 'roo-toolbar-button',
252 html : _this._strings['694e249c3a9503141fa5ce3fb71d5477'] /* <i class="fa fa-edit"></i> Edit */,
254 click : function (_self, e)
256 var sel = _this.grid.grid.selModel.getSelected();
258 if (!sel || sel.data.id * 1 < 1) {
259 Roo.MessageBox.alert("Error", "Select a message to edit");
263 Pman.Dialog.BAdminEmail.show( {id : sel.data.id, module : 'core_email'} , function() {
264 _this.table.footer.onClick('first');
267 render : function (_self)
269 _this.edit_btn = this;
275 '|xns' : 'Roo.bootstrap'
279 cls : 'roo-toolbar-button',
280 html : _this._strings['cd6df251f262cc64514b25f04aecf3c8'] /* <i class="fa fa-clipboard"></i> Copy */,
282 click : function (_self, e)
284 var sel = _this.grid.grid.selModel.getSelected();
286 Roo.MessageBox.alert("Error", "Select a message to copy");
290 url : baseURL + '/Roo/Core_email',
296 success : function() {
297 _this.table.footer.onClick('refresh');
301 render : function (_self)
303 _this.copy_btn = this;
309 '|xns' : 'Roo.bootstrap'
313 cls : 'roo-toolbar-button',
314 html : _this._strings['ed807858fcb68abdd180481f1fcba5c5'] /* <i class="fa fa-trash"></i> Delete */,
317 click : function (_self, e)
319 Pman.genericDelete(_this.grid, 'core_email');
321 render : function (_self)
323 _this.delete_btn = this;
329 '|xns' : 'Roo.bootstrap'
345 cellSelection : true,
351 cellclick : function (_self, el, rowIndex, columnIndex, e)
353 var di = this.colModel.getDataIndex(columnIndex);
359 var r = this.store.getAt(rowIndex);
361 if(r.data.active * 1 < 1){
363 Pman.Dialog.BAdminEmail.show( {id : r.data.id, module : 'core_email'} , function() {
364 _this.table.footer.onClick('refresh');
374 render : function (_self)
379 _this.dialog = Pman.Dialog.BAdminEmail;
381 rowdblclick : function (_self, el, rowIndex, e)
387 //var data = this.getDataSource().getAt(rowIndex).data;
388 var data = _this.table.store.getAt(rowIndex).data;
390 _this.dialog.show( {id : data.id, module : 'core_email'} , function() {
392 _this.table.footer.onClick('refresh');
397 '|xns' : 'Roo.bootstrap',
399 xtype : 'PagingToolbar',
403 '|xns' : 'Roo.bootstrap'
408 sortInfo : {field:'description',direction:'ASC'},
410 beforeload : function (_self, options)
412 if (!Pman.buildCompleted) {
416 options.params = options.params || {};
418 var s = _this.searchBox.getValue();
421 options.params['search[nameortitle]'] = s;
425 load : function (_self, records, options)
427 _this.edit_btn.hide();
428 _this.copy_btn.hide();
429 _this.delete_btn.hide();
431 update : function (_self, record, operation)
433 if (operation != 'commit') {
438 url : baseURL + '/Roo/Core_email',
442 active : record.data.active
444 success : function() {
445 _this.table.footer.onClick('refresh');
455 url : baseURL+'/Roo/Core_email.php',
460 xtype : 'JsonReader',
471 "name":"description",
477 totalProperty : 'total',
483 xtype : 'RowSelectionModel',
486 afterselectionchange : function (_self)
488 _this.edit_btn.hide();
489 _this.copy_btn.hide();
490 _this.delete_btn.hide();
492 if (!this.getSelected()) {
493 _this.viewPanel.setContent("Nothing Selected");
497 if(this.getSelected().data) {
498 _this.viewPanel.setContent(this.getSelected().data.bodytext);
501 _this.edit_btn.show();
502 _this.copy_btn.show();
503 _this.delete_btn.show();
507 xns : Roo.bootstrap.Table,
508 '|xns' : 'Roo.bootstrap.Table'
512 xtype : 'ColumnModel',
515 dataIndex : 'active',
516 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
517 renderer : function(v) {
519 var state = v > 0 ? 'check-' : '';
520 var cls = v > 0 ? 'text-primary' : '';
522 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
531 xtype : 'ColumnModel',
533 dataIndex : 'description',
534 header : _this._strings['b5a7adde1af5c87d7fd797b6245c2a39'] /* Description */,
535 renderer : function(v,x,r)
537 vv = (v.length) ? v : r.data.name;
539 if(r.data.active * 1 < 1){
540 return '<small style="color: #999;">' + vv + '</small>';
543 return '<b>' + vv + '</b>';
551 xtype : 'ColumnModel',
553 dataIndex : 'from_email',
554 header : _this._strings['cae905999a2ad1dfb8f4eae0e8cda73b'] /* From Name<br/>Email */,
555 renderer : function(v,x,r)
557 if(r.data.active * 1 < 1){
561 return String.format('<small>{0}</small>', r.data.from_name );
569 xtype : 'ColumnModel',
571 dataIndex : 'to_group_name',
572 header : _this._strings['98d2ee61ddce0c7666297d81639914f1'] /* To / BCC Group */,
573 renderer : function(v,x,r)
575 if(r.data.active * 1 < 1){
579 var nid = r.data.to_group_id * 1 ;
580 var n = nid > 0 ? r.data.group_member_count * 1 : 0;
581 var grp_str = String.format('<small>To: {0} ' +
582 '<span class="badge' + (n > 0 ? '' : ' badge-danger') + '">{1}</span></small><br>',
583 r.data.to_group_id_name,
584 nid < 1 ? 'Not set' : n
587 if (nid < 0) { // no To needed..
590 nid = r.data.bcc_group_id * 1;
591 n = nid > 0 ? r.data.bcc_group_member_count * 1 : 0;
593 var bcc_str = String.format('<small>BCC: {0} <span class="badge' + (n > 0 ? '' : ' badge-danger') + '">{1}</span></small>',
594 r.data.bcc_group_id_name,
595 nid < 1 ? 'Not set' : n
598 if (nid < 0) { // no To needed..
602 return grp_str + bcc_str;
615 title : _this._strings['9e11143e29a031212f2cdefcf61f39e9'] /* View Message */,
617 render : function (_self)
619 _this.viewPanel = this;
622 xns : Roo.bootstrap.panel,
623 '|xns' : 'Roo.bootstrap.panel'