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 '4d3d769b812b6faa6b76e1a8abaece2d' :"Active",
24 '49ee3087348e8d44e1feda1917443987' :"Name",
25 'e6b391a8d2c4d45902a23a8b6585703d' :"URL"
28 part : ["BAdmin", "EmailTemplates" ],
29 order : '004-Pman.Tab.BAdminEmailTemplates',
31 parent : 'Pman.Tab.BAdmin',
32 name : "Pman.Tab.BAdminEmailTemplates",
35 _tree : function(_data)
42 title : _this._strings['f49559cda3fb906fbd7736f8b8a0e37d'] /* Email Template */,
43 xns : Roo.bootstrap.panel,
44 '|xns' : 'Roo.bootstrap.panel',
47 xns : Roo.bootstrap.layout,
48 '|xns' : 'Roo.bootstrap.layout',
53 xns : Roo.bootstrap.layout,
54 '|xns' : 'Roo.bootstrap.layout'
64 xns : Roo.bootstrap.layout,
65 '|xns' : 'Roo.bootstrap.layout'
76 activate : function (_self)
78 _this.edit_btn.hide();
79 _this.copy_btn.hide();
80 _this.delete_btn.hide();
83 _this.table.footer.onClick('first');
87 render : function (_self)
92 xns : Roo.bootstrap.panel,
93 '|xns' : 'Roo.bootstrap.panel',
95 xtype : 'NavSimplebar',
97 '|xns' : 'Roo.bootstrap',
102 '|xns' : 'Roo.bootstrap',
107 '|xns' : 'Roo.bootstrap',
112 '|xns' : 'Roo.bootstrap',
118 '|xns' : 'Roo.bootstrap',
124 '|xns' : 'Roo.bootstrap',
128 placeholder : _this._strings['cffbd822c38679e2fbf11cc182c945e5'] /* search for email template */,
130 render : function (_self)
132 _this.searchBox = this;
134 specialkey : function (_self, e)
136 if(e.keyCode == e.ENTER) {
138 _this.table.footer.onClick('first');
146 '|xns' : 'Roo.bootstrap',
149 html : _this._strings['cdb6b6bab1fd18b9dbfe3fb84a5d34ae'] /* <i class="fa fa-search"></i> */,
151 click : function (_self, e)
153 _this.table.footer.onClick('first');
157 '|xns' : 'Roo.bootstrap'
165 style : 'text-align: right;',
167 '|xns' : 'Roo.bootstrap',
171 cls : 'roo-toolbar-button',
172 html : _this._strings['27a7146e1e1890e289bc7fad72876831'] /* <i class="fa fa-plus"></i> Create a template */,
174 '|xns' : 'Roo.bootstrap',
178 '|xns' : 'Roo.bootstrap',
183 html : _this._strings['03c2e7e41ffc181a4e84080b4710e81e'] /* New */,
185 click : function (_self, e)
191 _this.dialog.show( { id : 0, module : 'core_email' } , function() {
192 _this.table.footer.onClick('first');
197 '|xns' : 'Roo.bootstrap'
202 html : _this._strings['e6b391a8d2c4d45902a23a8b6585703d'] /* URL */,
204 click : function (_self, e)
206 Pman.Dialog.BAdminImportUrl.show(
208 target : '/Core/ImportMailMessage.php'
213 Pman.Dialog.BAdminEmail.dialog.show();
214 Pman.Dialog.BAdminEmail.form.findField('bodytext').setValue(data);
221 '|xns' : 'Roo.bootstrap'
226 html : _this._strings['73ea6b4441cdced246d236b22c8f991c'] /* HTML File */,
228 click : function (_self, e)
230 Pman.Dialog.BAdminImage.show(
232 _url : '/Core/ImportMailMessage.php'
237 Pman.Dialog.BAdminEmail.dialog.show();
238 Pman.Dialog.BAdminEmail.form.findField('bodytext').setValue(data);
245 '|xns' : 'Roo.bootstrap'
252 cls : 'roo-toolbar-button',
253 html : _this._strings['694e249c3a9503141fa5ce3fb71d5477'] /* <i class="fa fa-edit"></i> Edit */,
255 click : function (_self, e)
257 var sel = _this.grid.grid.selModel.getSelected();
259 if (!sel || sel.data.id * 1 < 1) {
260 Roo.MessageBox.alert("Error", "Select a message to edit");
264 Pman.Dialog.BAdminEmail.show( {id : sel.data.id, module : 'core_email'} , function() {
265 _this.table.footer.onClick('first');
268 render : function (_self)
270 _this.edit_btn = this;
276 '|xns' : 'Roo.bootstrap'
280 cls : 'roo-toolbar-button',
281 html : _this._strings['cd6df251f262cc64514b25f04aecf3c8'] /* <i class="fa fa-clipboard"></i> Copy */,
283 click : function (_self, e)
285 var sel = _this.grid.grid.selModel.getSelected();
287 Roo.MessageBox.alert("Error", "Select a message to copy");
291 url : baseURL + '/Roo/Core_email',
297 success : function() {
298 _this.table.footer.onClick('refresh');
302 render : function (_self)
304 _this.copy_btn = this;
310 '|xns' : 'Roo.bootstrap'
314 cls : 'roo-toolbar-button',
315 html : _this._strings['ed807858fcb68abdd180481f1fcba5c5'] /* <i class="fa fa-trash"></i> Delete */,
318 click : function (_self, e)
320 Pman.genericDelete(_this.grid, 'core_email');
322 render : function (_self)
324 _this.delete_btn = this;
330 '|xns' : 'Roo.bootstrap'
351 render : function (_self)
356 _this.dialog = Pman.Dialog.BAdminEmail;
358 rowclick : function (_self, el, rowIndex, e)
362 rowdblclick : function (_self, el, rowIndex, e)
368 //var data = this.getDataSource().getAt(rowIndex).data;
369 var data = _this.table.store.getAt(rowIndex).data;
371 _this.dialog.show( {id : data.id, module : 'core_email'} , function() {
373 _this.table.footer.onClick('first');
378 '|xns' : 'Roo.bootstrap',
380 xtype : 'PagingToolbar',
384 '|xns' : 'Roo.bootstrap'
389 sortInfo : {field:'name',direction:'ASC'},
391 beforeload : function (_self, options)
393 if (!Pman.buildCompleted) {
397 options.params = options.params || {};
399 var s = _this.searchBox.getValue();
402 options.params['search[nameortitle]'] = s;
406 load : function (_self, records, options)
408 _this.edit_btn.hide();
409 _this.copy_btn.hide();
410 _this.delete_btn.hide();
418 url : baseURL+'/Roo/Core_email.php',
423 xtype : 'JsonReader',
436 totalProperty : 'total',
442 xtype : 'RowSelectionModel',
445 afterselectionchange : function (_self)
447 _this.edit_btn.hide();
448 _this.copy_btn.hide();
449 _this.delete_btn.hide();
451 if (!this.getSelected()) {
452 _this.viewPanel.setContent("Nothing Selected");
456 if(this.getSelected().data) {
457 _this.viewPanel.setContent(this.getSelected().data.bodytext);
460 _this.edit_btn.show();
461 _this.copy_btn.show();
462 _this.delete_btn.show();
466 xns : Roo.bootstrap.Table,
467 '|xns' : 'Roo.bootstrap.Table'
471 xtype : 'ColumnModel',
474 dataIndex : 'active',
475 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
476 renderer : function(v) {
478 var state = v > 0 ? 'check-' : '';
479 var cls = v > 0 ? 'text-primary' : '';
481 return '<i class=\"far fa-'+ state + 'square-o ' + cls + '\" aria-hidden=\"true\"></i>';
490 xtype : 'ColumnModel',
492 dataIndex : 'description',
493 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
494 renderer : function(v,x,r)
496 if(r.data.active * 1 < 1){
497 return String.format('<small">{0}</small>', v ? v : '');
500 return String.format('<b>{0}</b>', v ? v : '');
508 xtype : 'ColumnModel',
510 dataIndex : 'subject',
511 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
512 renderer : function(v,x,r)
514 if(r.data.active * 1 < 1){
515 return String.format('<small">{0}</small>', v ? v : '');
518 return String.format('<b>{0}</b>', v ? v : '');
526 xtype : 'ColumnModel',
528 dataIndex : 'from_email',
529 header : _this._strings['cae905999a2ad1dfb8f4eae0e8cda73b'] /* From Name<br/>Email */,
530 renderer : function(v,x,r)
532 if(r.data.active * 1 < 1){
536 var from_name = r.data.from_name ? r.data.from_name : '';
537 var from_email = r.data.from_email ? r.data.from_email : '';
540 return String.format('<small>{0}</small>', from_email);
543 return String.format('<small>{0} <br> {1}</small>', from_name, from_email);
551 xtype : 'ColumnModel',
553 dataIndex : 'to_group_name',
554 header : _this._strings['98d2ee61ddce0c7666297d81639914f1'] /* To / BCC Group */,
555 renderer : function(v,x,r)
557 if(r.data.active * 1 < 1){
561 var nid = r.data.to_group_id * 1 ;
562 var n = nid > 0 ? r.data.group_member_count * 1 : 0;
563 var grp_str = String.format('<small>To: {0} ' +
564 '<span class="badge' + (n > 0 ? '' : ' badge-danger') + '">{1}</span></small><br>',
565 r.data.to_group_id_name,
566 nid < 1 ? 'Not set' : n
569 if (nid < 0) { // no To needed..
572 nid = r.data.bcc_group_id * 1;
573 n = nid > 0 ? r.data.bcc_group_member_count * 1 : 0;
575 var bcc_str = String.format('<small>BCC: {0} <span class="badge' + (n > 0 ? '' : ' badge-danger') + '">{1}</span></small>',
576 r.data.bcc_group_id_name,
577 nid < 1 ? 'Not set' : n
580 if (nid < 0) { // no To needed..
584 return grp_str + bcc_str;
597 title : _this._strings['9e11143e29a031212f2cdefcf61f39e9'] /* View Message */,
599 render : function (_self)
601 _this.viewPanel = this;
604 xns : Roo.bootstrap.panel,
605 '|xns' : 'Roo.bootstrap.panel'