sync
[Pman.Admin] / Pman.Tab.AdminEmailTemplates.js
index abad146..1415de2 100644 (file)
@@ -12,6 +12,7 @@ Pman.Tab.AdminEmailTemplates = new Roo.XComponent({
   '00d6e06d2f3c092b4f5e1e708a360b0f' :"Displaying Message{0} - {1} of {2}",
   '9076cbba1d9ef79280b4f39e2aa0d115' :"Nothing found",
   'b78a3223503896721cca1303f776159b' :"Title",
+  '68b00d723d37122f64da8d9939f836f0' :"BCC Group",
   '9e11143e29a031212f2cdefcf61f39e9' :"View Message",
   'f49559cda3fb906fbd7736f8b8a0e37d' :"Email Template",
   '01bd6a16732dfa2b760dc8566c58afae' :"Download to Excel",
@@ -29,7 +30,7 @@ Pman.Tab.AdminEmailTemplates = new Roo.XComponent({
   name     : "Manage Email Templates",
   disabled : false, 
   permname : '', 
-  _tree : function()
+  _tree : function(_data)
   {
    var _this = this;
    var MODULE = this;
@@ -37,6 +38,12 @@ Pman.Tab.AdminEmailTemplates = new Roo.XComponent({
    xtype : 'NestedLayoutPanel',
    region : 'center',
    title : _this._strings['f49559cda3fb906fbd7736f8b8a0e37d'] /* Email Template */,
+   listeners : {
+    render : function (_self)
+     {
+         _this.nest = this;
+     }
+   },
    xns : Roo,
    '|xns' : 'Roo',
    layout : {
@@ -52,7 +59,6 @@ Pman.Tab.AdminEmailTemplates = new Roo.XComponent({
     },
     south : {
      xtype : 'LayoutRegion',
-     autoScroll : false,
      height : 300,
      split : true,
      titlebar : true,
@@ -268,7 +274,7 @@ Pman.Tab.AdminEmailTemplates = new Roo.XComponent({
        dataSource : {
         xtype : 'Store',
         remoteSort : true,
-        sortInfo : { field : 'name', direction: 'ASC' },
+        sortInfo : { field : 'description', direction: 'ASC' },
         listeners : {
          beforeload : function (_self, options)
           {
@@ -316,12 +322,24 @@ Pman.Tab.AdminEmailTemplates = new Roo.XComponent({
         xns : Roo.grid,
         '|xns' : 'Roo.grid'
        },
-       colModel : [
+       cm : [
         {
          xtype : 'ColumnModel',
          dataIndex : 'name',
          header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
-         renderer : function(v) { return String.format('{0}', v); },
+         renderer : function(v,x,r) 
+         { 
+             if (r.data.description.length > 0) {
+                 v = r.data.description;
+             }
+             
+             
+             if(r.data.active * 1 < 1){
+                 return String.format('<s>{0}</s>', v ? v : ''); 
+             }
+             
+             return String.format('{0}', v ? v : ''); 
+         },
          sortable : true,
          width : 250,
          xns : Roo.grid,
@@ -331,7 +349,14 @@ Pman.Tab.AdminEmailTemplates = new Roo.XComponent({
          xtype : 'ColumnModel',
          dataIndex : 'subject',
          header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
-         renderer : function(v) { return String.format('{0}', v); },
+         renderer : function(v,x,r) 
+         { 
+             if(r.data.active * 1 < 1){
+                 return String.format('<s>{0}</s>', v ? v : ''); 
+             }
+             
+             return String.format('{0}', v ? v : ''); 
+         },
          sortable : true,
          width : 300,
          xns : Roo.grid,
@@ -341,9 +366,9 @@ Pman.Tab.AdminEmailTemplates = new Roo.XComponent({
          xtype : 'ColumnModel',
          dataIndex : 'from_name',
          header : _this._strings['4a4a8fe0c6dfb6bd2a41755d15eb6f0b'] /* From Name */,
-         renderer : function(v) { return String.format('{0}', v); },
+         renderer : function(v) { return String.format('{0}', v ? v : ''); },
          sortable : true,
-         width : 400,
+         width : 150,
          xns : Roo.grid,
          '|xns' : 'Roo.grid'
         },
@@ -351,9 +376,19 @@ Pman.Tab.AdminEmailTemplates = new Roo.XComponent({
          xtype : 'ColumnModel',
          dataIndex : 'from_email',
          header : _this._strings['4ca679a383343ab3d4ca1cd7c91b43f7'] /* From Email */,
-         renderer : function(v) { return String.format('{0}', v); },
+         renderer : function(v) { return String.format('{0}', v ? v : ''); },
+         sortable : true,
+         width : 150,
+         xns : Roo.grid,
+         '|xns' : 'Roo.grid'
+        },
+        {
+         xtype : 'ColumnModel',
+         dataIndex : 'bcc_group_name',
+         header : _this._strings['68b00d723d37122f64da8d9939f836f0'] /* BCC Group */,
+         renderer : function(v) { return String.format('{0}', v ? v : ''); },
          sortable : true,
-         width : 400,
+         width : 150,
          xns : Roo.grid,
          '|xns' : 'Roo.grid'
         }
@@ -411,40 +446,7 @@ Pman.Tab.AdminEmailTemplates = new Roo.XComponent({
                   this.removeAll();
                   return false;
               }
-            /*  
-              new Pman.Request({
-                  url : baseURL + '/Roo/crm_action.php',
-                  method : 'GET',
-                  params : {
-                      person_id : p.data.id,
-                      sort : 'action_dt',
-                      dir : 'DESC'
-                  },
-                  success : function(res) {
-                      if(res.success){
-                          var el = _this.cpanel.el.select('.crm-history-content').first();
-                          _this.historyTemplate.overwrite(el, res);
-                          el.select('.crm-history-log').on('click', Pman.Crm.auditToggle);
-                          //Roo.log(res);
-                      }
-                  },
-                  failure : function(e) {
-                      //Roo.log(e);
-                    _this.grid.ds.load({});
-                  }
-                  
-              });
-              */
-          
-          //_this.historyTemplate = new Roo.DomTemplate({url : rootURL+'/Pman/Crm/domtemplates/crm_history.html'})
-          
-          /*
-            new pman request ([
-            
-            } successs(data)
-                 el = _this.elemmnt.select('.services')
-                 _this.serviceTemplate.overwite(el, data)
-            */
+           
           }
         },
         xns : Roo.data,