PHP8
[Pman.BAdmin] / Pman.Tab.BAdminEmailTemplates.js
index aedddec..1f28738 100644 (file)
@@ -39,6 +39,22 @@ Pman.Tab.BAdminEmailTemplates = new Roo.XComponent({
    xtype : 'Nest',
    background : true,
    title : _this._strings['f49559cda3fb906fbd7736f8b8a0e37d'] /* Email Template */,
+   listeners : {
+    activate : function (_self)
+     {
+         if(!document.getElementsByClassName('email-south-pane')) {
+             return;
+         }
+         
+         document.getElementsByClassName('email-south-pane')[0].classList.remove('disable-pane');
+         
+         if(
+             appDisabled.indexOf('Core.SuperAdmin') * 1 != -1
+         ) {
+             document.getElementsByClassName('email-south-pane')[0].classList.add('disable-pane');
+         }
+     }
+   },
    xns : Roo.bootstrap.panel,
    '|xns' : 'Roo.bootstrap.panel',
    layout : {
@@ -55,6 +71,7 @@ Pman.Tab.BAdminEmailTemplates = new Roo.XComponent({
     south : {
      xtype : 'Region',
      autoScroll : true,
+     cls : 'email-south-pane',
      height : 200,
      hideTabs : true,
      split : true,
@@ -169,6 +186,12 @@ Pman.Tab.BAdminEmailTemplates = new Roo.XComponent({
                    xtype : 'Button',
                    cls : 'roo-toolbar-button',
                    html : _this._strings['27a7146e1e1890e289bc7fad72876831'] /* <i class="fa fa-plus"></i> Create a template */,
+                   listeners : {
+                    render : function (_self)
+                     {
+                         this.hide();
+                     }
+                   },
                    xns : Roo.bootstrap,
                    '|xns' : 'Roo.bootstrap',
                    menu : {
@@ -345,7 +368,6 @@ Pman.Tab.BAdminEmailTemplates = new Roo.XComponent({
        cellSelection : true,
        hover : true,
        loadMask : true,
-       responsive : true,
        rowSelection : true,
        listeners : {
         cellclick : function (_self, el, rowIndex, columnIndex, e)
@@ -359,12 +381,17 @@ Pman.Tab.BAdminEmailTemplates = new Roo.XComponent({
               var r = this.store.getAt(rowIndex);
               
              if(r.data.active * 1  < 1){
+             
+                 Pman.Dialog.BAdminEmail.show( {id : r.data.id, module : 'core_email'} , function() {
+                     _this.table.footer.onClick('refresh');
+                 });
                  
                  return;
              }
              
              r.set('active', 0);
              r.commit();
+             
               
          },
         render : function (_self)
@@ -385,7 +412,7 @@ Pman.Tab.BAdminEmailTemplates = new Roo.XComponent({
              
              _this.dialog.show( {id : data.id, module : 'core_email'} , function() {
                  
-                 _this.table.footer.onClick('first');
+                 _this.table.footer.onClick('refresh');
              }); 
          }
        },
@@ -416,6 +443,10 @@ Pman.Tab.BAdminEmailTemplates = new Roo.XComponent({
               if(s.length){
                   options.params['search[nameortitle]'] = s;
               }
+              // hide our system emails.
+              if (appDisabled.indexOf('Core.SuperAdmin') > -1) {
+                  options.params._hide_system_emails = 1;
+              } 
           
           },
          load : function (_self, records, options)
@@ -438,7 +469,7 @@ Pman.Tab.BAdminEmailTemplates = new Roo.XComponent({
                     active : record.data.active
                   },
                   success : function() { 
-                      _this.basketTable.ds.load({});
+                      _this.table.footer.onClick('refresh');
                   }
             });
           }
@@ -557,7 +588,7 @@ Pman.Tab.BAdminEmailTemplates = new Roo.XComponent({
              return String.format('<small>{0}</small>', r.data.from_name );
              
          },
-         xs : 2,
+         xs : 3,
          xns : Roo.grid,
          '|xns' : 'Roo.grid'
         },
@@ -597,7 +628,7 @@ Pman.Tab.BAdminEmailTemplates = new Roo.XComponent({
              
              return grp_str + bcc_str;
          },
-         xs : 5,
+         xs : 4,
          xns : Roo.grid,
          '|xns' : 'Roo.grid'
         }