{
"name" : "Pman.Tab.BAdminEmailTemplates",
"parent" : "Pman.Tab.BAdmin",
"title" : "Pman.Tab.BAdminEmailTemplates",
"path" : "/home/alan/gitlive/Pman.BAdmin/Pman.Tab.BAdminEmailTemplates.bjs",
"permname" : "",
"modOrder" : "004",
"strings" : {
"cdb6b6bab1fd18b9dbfe3fb84a5d34ae" : "",
"cae905999a2ad1dfb8f4eae0e8cda73b" : "From Name
Email",
"98d2ee61ddce0c7666297d81639914f1" : "To / BCC Group",
"73ea6b4441cdced246d236b22c8f991c" : "HTML File",
"694e249c3a9503141fa5ce3fb71d5477" : " Edit",
"cffbd822c38679e2fbf11cc182c945e5" : "search for email template",
"9e11143e29a031212f2cdefcf61f39e9" : "View Message",
"f49559cda3fb906fbd7736f8b8a0e37d" : "Email Template",
"27a7146e1e1890e289bc7fad72876831" : " Create a template",
"cd6df251f262cc64514b25f04aecf3c8" : " Copy",
"ed807858fcb68abdd180481f1fcba5c5" : " Delete",
"03c2e7e41ffc181a4e84080b4710e81e" : "New",
"4d3d769b812b6faa6b76e1a8abaece2d" : "Active",
"b5a7adde1af5c87d7fd797b6245c2a39" : "Description",
"e6b391a8d2c4d45902a23a8b6585703d" : "URL"
},
"items" : [
{
"listeners" : {
"activate" : "function (_self)\n{\n if(!document.getElementsByClassName('email-south-pane')) {\n return;\n }\n \n document.getElementsByClassName('email-south-pane')[0].classList.remove('disable-pane');\n \n if(\n appDisabled.indexOf('Core.SuperAdmin') * 1 != -1\n ) {\n document.getElementsByClassName('email-south-pane')[0].classList.add('disable-pane');\n }\n}"
},
"xtype" : "Nest",
"$ xns" : "Roo.bootstrap.panel",
"String title" : "Email Template",
"Boolean background" : true,
"items" : [
{
"xtype" : "Border",
"$ xns" : "Roo.bootstrap.layout",
"* prop" : "layout",
"items" : [
{
"String tabPosition" : "top",
"Boolean hideTabs" : true,
"xtype" : "Region",
"$ xns" : "Roo.bootstrap.layout",
"* prop" : "center"
},
{
"Boolean titlebar" : true,
"String tabPosition" : "top",
"xtype" : "Region",
"Boolean hideTabs" : true,
"Number height" : 200,
"string cls" : "email-south-pane",
"$ xns" : "Roo.bootstrap.layout",
"Boolean autoScroll" : true,
"* prop" : "south",
"Boolean split" : true
},
{
"listeners" : {
"activate" : "function (_self)\n{\n _this.edit_btn.hide();\n _this.copy_btn.hide();\n _this.delete_btn.hide();\n \n if (_this.table) {\n _this.table.footer.onClick('first');\n }\n \n}",
"render" : "function (_self)\n{\n _this.grid = this;\n}"
},
"Boolean fitContainer" : true,
"xtype" : "Grid",
"Boolean fitToFrame" : true,
"$ xns" : "Roo.bootstrap.panel",
"String region" : "center",
"Boolean background" : false,
"Boolean closable" : false,
"items" : [
{
"xtype" : "NavSimplebar",
"$ xns" : "Roo.bootstrap",
"* prop" : "toolbar",
"items" : [
{
"xtype" : "NavGroup",
"$ xns" : "Roo.bootstrap",
"items" : [
{
"xtype" : "NavItem",
"$ xns" : "Roo.bootstrap",
"items" : [
{
"xtype" : "Element",
"$ xns" : "Roo.bootstrap",
"items" : [
{
"String cls" : "roo-toolbar",
"xtype" : "Row",
"$ xns" : "Roo.bootstrap",
"items" : [
{
"Number md" : 4,
"xtype" : "Column",
"$ xns" : "Roo.bootstrap",
"items" : [
{
"listeners" : {
"specialkey" : "function (_self, e)\n{ \n if(e.keyCode == e.ENTER) {\n if (_this.table) {\n _this.table.footer.onClick('first'); \n }\n \n }\n \n}",
"render" : "function (_self)\n{\n _this.searchBox = this;\n}"
},
"xtype" : "Input",
"string placeholder" : "search for email template",
"$ xns" : "Roo.bootstrap",
"items" : [
{
"listeners" : {
"click" : "function (_self, e)\n{\n _this.table.footer.onClick('first');\n}"
},
"xtype" : "Button",
"$ xns" : "Roo.bootstrap",
"String html" : "",
"* prop" : "after"
}
]
}
]
},
{
"Number md" : 8,
"xtype" : "Column",
"$ xns" : "Roo.bootstrap",
"String style" : "text-align: right;",
"items" : [
{
"listeners" : {
"render" : "function (_self)\n{\n this.hide();\n}"
},
"String cls" : "roo-toolbar-button",
"xtype" : "Button",
"$ xns" : "Roo.bootstrap",
"String html" : " Create a template",
"items" : [
{
"xtype" : "Menu",
"$ xns" : "Roo.bootstrap",
"* prop" : "menu",
"items" : [
{
"listeners" : {
"click" : "function (_self, e)\n{\n if (!_this.dialog) {\n return;\n }\n \n _this.dialog.show( { id : 0, module : 'core_email' } , function() {\n _this.table.footer.onClick('first');\n });\n}"
},
"xtype" : "MenuItem",
"String fa" : "file-o",
"$ xns" : "Roo.bootstrap",
"String html" : "New"
},
{
"listeners" : {
"click" : "function (_self, e)\n{\n Pman.Dialog.BAdminImportUrl.show(\n {\n target : '/Core/ImportMailMessage.php'\n },\n \n function(data) {\n if (data) {\n Pman.Dialog.BAdminEmail.dialog.show();\n Pman.Dialog.BAdminEmail.form.findField('bodytext').setValue(data);\n }\n }\n );\n}"
},
"xtype" : "MenuItem",
"String fa" : "link",
"$ xns" : "Roo.bootstrap",
"String html" : "URL"
},
{
"listeners" : {
"click" : "function (_self, e)\n{\n Pman.Dialog.BAdminImage.show(\n {\n _url : '/Core/ImportMailMessage.php'\n },\n \n function(data) {\n if (data) {\n Pman.Dialog.BAdminEmail.dialog.show();\n Pman.Dialog.BAdminEmail.form.findField('bodytext').setValue(data);\n }\n }\n );\n}"
},
"xtype" : "MenuItem",
"String fa" : "code",
"$ xns" : "Roo.bootstrap",
"String html" : "HTML File"
}
]
}
]
},
{
"listeners" : {
"render" : "function (_self)\n{\n _this.edit_btn = this;\n \n this.hide();\n}",
"click" : "function (_self, e)\n{\n var sel = _this.grid.grid.selModel.getSelected();\n \n if (!sel || sel.data.id * 1 < 1) {\n Roo.MessageBox.alert(\"Error\", \"Select a message to edit\");\n return;\n }\n \n Pman.Dialog.BAdminEmail.show( {id : sel.data.id, module : 'core_email'} , function() {\n _this.table.footer.onClick('first');\n }); \n}"
},
"String cls" : "roo-toolbar-button",
"xtype" : "Button",
"$ xns" : "Roo.bootstrap",
"String html" : " Edit"
},
{
"listeners" : {
"render" : "function (_self)\n{\n _this.copy_btn = this;\n \n this.hide();\n}",
"click" : "function (_self, e)\n{\n var sel = _this.grid.grid.selModel.getSelected();\n if (!sel) {\n Roo.MessageBox.alert(\"Error\", \"Select a message to copy\");\n return;\n }\n new Pman.Request({\n url : baseURL + '/Roo/Core_email',\n method : 'POST',\n params : {\n id : sel.data.id,\n _make_copy : 1\n },\n success : function() {\n _this.table.footer.onClick('refresh');\n }\n });\n}"
},
"String cls" : "roo-toolbar-button",
"xtype" : "Button",
"$ xns" : "Roo.bootstrap",
"String html" : " Copy"
},
{
"listeners" : {
"render" : "function (_self)\n{\n _this.delete_btn = this;\n \n this.hide();\n}",
"click" : "function (_self, e)\n{\n Pman.genericDelete(_this.grid, 'core_email');\n}"
},
"String cls" : "roo-toolbar-button",
"String weight" : "primary",
"xtype" : "Button",
"$ xns" : "Roo.bootstrap",
"String html" : " Delete"
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"listeners" : {
"rowdblclick" : "function (_self, el, rowIndex, e)\n{\n if (!_this.dialog) {\n return;\n }\n \n //var data = this.getDataSource().getAt(rowIndex).data;\n var data = _this.table.store.getAt(rowIndex).data;\n \n _this.dialog.show( {id : data.id, module : 'core_email'} , function() {\n \n _this.table.footer.onClick('refresh');\n }); \n}",
"cellclick" : "function (_self, el, rowIndex, columnIndex, e)\n{\n var di = this.colModel.getDataIndex(columnIndex);\n \n if(di != 'active'){\n return;\n }\n \n var r = this.store.getAt(rowIndex);\n \n if(r.data.active * 1 < 1){\n \n Pman.Dialog.BAdminEmail.show( {id : r.data.id, module : 'core_email'} , function() {\n _this.table.footer.onClick('refresh');\n });\n \n return;\n }\n \n r.set('active', 0);\n r.commit();\n \n \n}",
"render" : "function (_self)\n{\n \n _this.table = this;\n \n _this.dialog = Pman.Dialog.BAdminEmail;\n}"
},
"Boolean cellSelection" : true,
"boolean hover" : true,
"xtype" : "Table",
"Boolean rowSelection" : true,
"$ xns" : "Roo.bootstrap",
"Boolean loadMask" : true,
"* prop" : "grid",
"items" : [
{
"listeners" : {
"afterselectionchange" : "function (_self)\n{\n _this.edit_btn.hide();\n _this.copy_btn.hide();\n _this.delete_btn.hide();\n \n if (!this.getSelected()) {\n _this.viewPanel.setContent(\"Nothing Selected\");\n return;\n }\n \n if(this.getSelected().data) {\n _this.viewPanel.setContent(this.getSelected().data.bodytext);\n }\n \n _this.edit_btn.show();\n _this.copy_btn.show();\n _this.delete_btn.show();\n \n}"
},
"Boolean singleSelect" : true,
"xtype" : "RowSelectionModel",
"$ xns" : "Roo.bootstrap.Table",
"* prop" : "sm"
},
{
"listeners" : {
"update" : "function (_self, record, operation)\n{\n if (operation != 'commit') {\n return;\n }\n\n new Pman.Request({\n url : baseURL + '/Roo/Core_email',\n method : 'POST',\n params : {\n id : record.data.id,\n active : record.data.active\n },\n success : function() { \n _this.table.footer.onClick('refresh');\n }\n });\n}",
"beforeload" : "function (_self, options)\n{\n if (!Pman.buildCompleted) {\n return false;\n }\n \n options.params = options.params || {};\n \n var s = _this.searchBox.getValue();\n \n if(s.length){\n options.params['search[nameortitle]'] = s;\n }\n // hide our system emails.\n if (appDisabled.indexOf('Core.SuperAdmin') > -1) {\n options.params._hide_system_emails = 1;\n } \n\n}",
"load" : "function (_self, records, options)\n{\n _this.edit_btn.hide();\n _this.copy_btn.hide();\n _this.delete_btn.hide();\n}"
},
"xtype" : "Store",
"boolean remoteSort" : true,
"$ xns" : "Roo.data",
"$ sortInfo" : "{field:'description',direction:'ASC'} ",
"* prop" : "store",
"items" : [
{
"xtype" : "HttpProxy",
"$ xns" : "Roo.data",
"String method" : "GET",
"* prop" : "proxy",
"$ String url" : "baseURL+'/Roo/Core_email.php'"
},
{
"$ Array fields" : "[\n {\n \"name\":\"name\",\n \"type\":\"string\"\n },\n {\n \"name\":\"subject\",\n \"type\":\"string\"\n },\n {\n \"name\":\"description\",\n \"type\":\"string\"\n }\n]",
"xtype" : "JsonReader",
"String root" : "data",
"$ xns" : "Roo.data",
"String id" : "id",
"* prop" : "reader",
"String totalProperty" : "total"
}
]
},
{
"Number pageSize" : 25,
"Boolean displayInfo" : true,
"xtype" : "PagingToolbar",
"$ xns" : "Roo.bootstrap",
"* prop" : "footer"
},
{
"String header" : "Active",
"String cursor" : "pointer",
"String dataIndex" : "active",
"xtype" : "ColumnModel",
"Number xs" : 1,
"String align" : "center",
"$ xns" : "Roo.grid",
"$ renderer" : "function(v) { \n\n var state = v > 0 ? 'check-' : '';\n var cls = v > 0 ? 'text-primary' : '';\n \n return '';\n \n }",
"Boolean sortable" : true,
"* prop" : "cm[]"
},
{
"String cursor" : "pointer",
"xtype" : "ColumnModel",
"Number xs" : 4,
"header" : "Description",
"$ renderer" : "function(v,x,r) \n{ \n vv = (v.length) ? v : r.data.name;\n \n if(r.data.active * 1 < 1){\n return '' + vv + '';\n }\n \n return '' + vv + '';\n}",
"$ xns" : "Roo.grid",
"Boolean sortable" : true,
"* prop" : "cm[]",
"dataIndex" : "description"
},
{
"String cursor" : "pointer",
"xtype" : "ColumnModel",
"Number xs" : 3,
"header" : "From Name
Email",
"$ renderer" : "function(v,x,r)\n{\n if(r.data.active * 1 < 1){\n return '';\n }\n \n return String.format('{0}', r.data.from_name );\n \n}",
"$ xns" : "Roo.grid",
"* prop" : "cm[]",
"dataIndex" : "from_email"
},
{
"String cursor" : "pointer",
"xtype" : "ColumnModel",
"Number xs" : 4,
"header" : "To / BCC Group",
"$ renderer" : "function(v,x,r)\n{ \n if(r.data.active * 1 < 1){\n return '';\n }\n \n var nid = r.data.to_group_id * 1 ;\n var n = nid > 0 ? r.data.group_member_count * 1 : 0;\n var grp_str = String.format('To: {0} ' + \n ' 0 ? '' : ' badge-danger') + '\">{1}
',\n r.data.to_group_id_name,\n nid < 1 ? 'Not set' : n\n );\n \n if (nid < 0) { // no To needed..\n grp_str = '';\n }\n nid = r.data.bcc_group_id * 1;\n n = nid > 0 ? r.data.bcc_group_member_count * 1 : 0;\n\n var bcc_str = String.format('BCC: {0} 0 ? '' : ' badge-danger') + '\">{1}',\n r.data.bcc_group_id_name,\n nid < 1 ? 'Not set' : n\n );\n \n if (nid < 0) { // no To needed..\n bcc_str = '';\n } \n \n return grp_str + bcc_str;\n}",
"$ xns" : "Roo.grid",
"* prop" : "cm[]",
"dataIndex" : "to_group_name"
}
]
}
]
},
{
"listeners" : {
"render" : "function (_self)\n{\n _this.viewPanel = this;\n}"
},
"xtype" : "Content",
"Boolean fitToFrame" : true,
"$ xns" : "Roo.bootstrap.panel",
"String region" : "south",
"String title" : "View Message"
}
]
}
]
}
]
}