PHP8
[Pman.BAdmin] / Pman.Tab.BAdminStaff.js
index 10ccd09..83afb73 100644 (file)
@@ -7,16 +7,17 @@ Roo.namespace('Pman.Tab');
 Pman.Tab.BAdminStaff = new Roo.XComponent({
 
  _strings : {
-  'b15aafc19dc2ba4b788adf77268d8ca4' :"Hide Inactive",
+  'cdb6b6bab1fd18b9dbfe3fb84a5d34ae' :"<i class=\"fa fa-search\"></i>",
   'ce8ae9da5b7cd6c3df2929543a9af92d' :"Email",
+  'b15aafc19dc2ba4b788adf77268d8ca4' :"Hide Inactive",
   'f29c99f082755399839b64ebaf9f608a' :"List / View",
   '4f3cdff2e6a5e08440be182ef40d93f7' :"Print / Export",
   'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
   'a37ede293936e29279ed543129451ec3' :"Groups",
   '7dce122004969d56ae2e0245cb754d35' :"Edit",
   '05b763f7d24f32575493b3c23f299b0e' :"Add To Group",
+  '9bac86fd9f499d47cea5f2fd70d701c1' :"search for account",
   'e0a7cc944485bdedafb92b0cf98632fa' :"Remove From Group",
-  'bcc254b55c4a1babdf1dcb82c207506b' :"Phone",
   '25f57527ae8a27c94fb5230b5486c743' :"Permission List",
   '09f0c5159c5e34504e453eff3fc70324' :"Account Management",
   '054176c3a541fb2d4b63e29360c749aa' :"Members List",
@@ -141,6 +142,49 @@ Pman.Tab.BAdminStaff = new Roo.XComponent({
                items  : [
                 {
                  xtype : 'Column',
+                 md : 3,
+                 xns : Roo.bootstrap,
+                 '|xns' : 'Roo.bootstrap',
+                 items  : [
+                  {
+                   xtype : 'Input',
+                   placeholder : _this._strings['9bac86fd9f499d47cea5f2fd70d701c1'] /* search for account */,
+                   listeners : {
+                    render : function (_self)
+                     {
+                         _this.searchBox = this;
+                     },
+                    specialkey : function (_self, e)
+                     {    
+                          if(e.keyCode == e.ENTER) {
+                             if (_this.member_grid) {
+                                 _this.member_grid.footer.onClick('first'); 
+                             }
+                         
+                         }
+                         
+                     }
+                   },
+                   xns : Roo.bootstrap,
+                   '|xns' : 'Roo.bootstrap',
+                   after : {
+                    xtype : 'Button',
+                    html : _this._strings['cdb6b6bab1fd18b9dbfe3fb84a5d34ae'] /* <i class="fa fa-search"></i> */,
+                    listeners : {
+                     click : function (_self, e)
+                      {
+                          _this.member_grid.footer.onClick('first');
+                      }
+                    },
+                    xns : Roo.bootstrap,
+                    '|xns' : 'Roo.bootstrap'
+                   }
+                  }
+                 ]
+                },
+                {
+                 xtype : 'Column',
+                 cls : 'text-right',
                  md : 9,
                  xns : Roo.bootstrap,
                  '|xns' : 'Roo.bootstrap',
@@ -165,7 +209,9 @@ Pman.Tab.BAdminStaff = new Roo.XComponent({
                              }
                              
                              Pman.Dialog.BAdminStaffTwoFactorQRCode.show({
-                                 id : res.id
+                                 id : res.id,
+                                 allow_close: false,
+                                 allow_cancel : true
                              }, function(res){
                                  _this.member_grid.footer.onClick('first');
                              });
@@ -409,42 +455,6 @@ Pman.Tab.BAdminStaff = new Roo.XComponent({
                    '|xns' : 'Roo.bootstrap'
                   }
                  ]
-                },
-                {
-                 xtype : 'Column',
-                 cls : 'text-right',
-                 md : 3,
-                 xns : Roo.bootstrap,
-                 '|xns' : 'Roo.bootstrap',
-                 items  : [
-                  {
-                   xtype : 'Button',
-                   cls : 'roo-toolbar-button',
-                   html : _this._strings['5bc3fd20294c17c9803942958fd7f26d'] /* Show Inactive */,
-                   name : 'activeButton',
-                   _offtext : _this._strings['5bc3fd20294c17c9803942958fd7f26d'] /* Show Inactive */,
-                   _ontext : _this._strings['b15aafc19dc2ba4b788adf77268d8ca4'] /* Hide Inactive */,
-                   pressed : false,
-                   weight : 'default',
-                   listeners : {
-                    render : function (_self)
-                     {
-                         _this.footerActiveBtn = this;
-                     },
-                    toggle : function (_self, e, pressed)
-                     {
-                         this.setText(this.pressed ? this._ontext : this._offtext);
-                     
-                         _this.member_grid.footer.onClick('first');
-                         
-                         return;
-                         
-                     }
-                   },
-                   xns : Roo.bootstrap,
-                   '|xns' : 'Roo.bootstrap'
-                  }
-                 ]
                 }
                ]
               }
@@ -458,12 +468,11 @@ Pman.Tab.BAdminStaff = new Roo.XComponent({
       },
       grid : {
        xtype : 'Table',
-       autoHideFooter : true,
+       auto_hide_footer : true,
        cellSelection : true,
        cls : 'table-fixed',
        hover : true,
        loadMask : true,
-       responsive : true,
        rowSelection : true,
        striped : false,
        listeners : {
@@ -494,22 +503,38 @@ Pman.Tab.BAdminStaff = new Roo.XComponent({
                  },this,{single:true});
              }
          },
-        render : function (_self)
-         {
-             _this.member_grid = _self;
-            
-         },
-        rowdblclick : function (_self, el, rowIndex, e)
+        celldblclick : function (_self, el, rowIndex, columnIndex, e)
          {
+             var di = _this.member_grid.colModel.getDataIndex(columnIndex);
+         
+             if (di == 'active') {
+                 return;
+             }
              var s = _this.member_grid.store.getAt(rowIndex);
              
              if(s.data.id * 1 < 1){
                  return;
              }
              
-             Pman.Dialog.BAdminStaff.show( { id : s.data.id }, function() {
+             if (di == 'member_of') {
+                 Pman.Dialog.BAdminStaffGroups.show(   s.data , function() {
+                     _this.member_grid.footer.onClick('first');
+                 });
+                 return;
+             }
+             // show edit user dialog..
+             
+             
+             
+             Pman.Dialog.BAdminStaff.show( s.data , function() {
                  _this.member_grid.footer.onClick('first');
              });
+              
+         },
+        render : function (_self)
+         {
+             _this.member_grid = _self;
+            
          }
        },
        xns : Roo.bootstrap,
@@ -520,7 +545,36 @@ Pman.Tab.BAdminStaff = new Roo.XComponent({
         name : 'footer',
         pageSize : 25,
         xns : Roo.bootstrap,
-        '|xns' : 'Roo.bootstrap'
+        '|xns' : 'Roo.bootstrap',
+        buttons : [
+         {
+          xtype : 'Button',
+          cls : 'roo-toolbar-button',
+          html : _this._strings['5bc3fd20294c17c9803942958fd7f26d'] /* Show Inactive */,
+          name : 'activeButton',
+          _offtext : _this._strings['5bc3fd20294c17c9803942958fd7f26d'] /* Show Inactive */,
+          _ontext : _this._strings['b15aafc19dc2ba4b788adf77268d8ca4'] /* Hide Inactive */,
+          pressed : false,
+          weight : 'default',
+          listeners : {
+           render : function (_self)
+            {
+                _this.footerActiveBtn = this;
+            },
+           toggle : function (_self, e, pressed)
+            {
+                this.setText(this.pressed ? this._ontext : this._offtext);
+            
+                _this.member_grid.footer.onClick('first');
+                
+                return;
+                
+            }
+          },
+          xns : Roo.bootstrap,
+          '|xns' : 'Roo.bootstrap'
+         }
+        ]
        },
        store : {
         xtype : 'Store',
@@ -551,7 +605,10 @@ Pman.Tab.BAdminStaff = new Roo.XComponent({
               
               if(_this.footerActiveBtn && !_this.footerActiveBtn.pressed){
                   options.params.active = 1;
-              }
+              } 
+              
+              options.params._with_group_membership = 1;
+              options.params['query[name_or_email]'] =    _this.searchBox.getValue();
               
               options.params['query[in_group]'] = group.data.id;
             
@@ -704,10 +761,12 @@ Pman.Tab.BAdminStaff = new Roo.XComponent({
         {
          xtype : 'ColumnModel',
          cursor : 'pointer',
-         dataIndex : 'phone',
-         header : _this._strings['bcc254b55c4a1babdf1dcb82c207506b'] /* Phone */,
+         dataIndex : 'member_of',
+         header : _this._strings['a37ede293936e29279ed543129451ec3'] /* Groups */,
          md : 2,
-         renderer : function(v) { return String.format('{0}', v); },
+         renderer : function(v) {
+              return String.format('{0}', v).split("\n").join("<br/>"); 
+          },
          sm : 2,
          xs : 2,
          xns : Roo.grid,
@@ -766,7 +825,6 @@ Pman.Tab.BAdminStaff = new Roo.XComponent({
        footerShow : false,
        hover : true,
        loadMask : true,
-       responsive : true,
        rowSelection : true,
        striped : true,
        listeners : {
@@ -980,7 +1038,7 @@ Pman.Tab.BAdminStaff = new Roo.XComponent({
          xtype : 'ColumnModel',
          dataIndex : 'rightname',
          header : _this._strings['e55f75a29310d7b60f7ac1d390c8ae42'] /* Module */,
-         hidden : true,
+         hidden : appDisabled.indexOf('Core.SuperAdmin') > 0 ? 1 : 0,
          renderer : function (v) {
              return String.format('<span tooltip="{1}">{0}</span>', v.split('.').shift(), v);
          },
@@ -1143,6 +1201,7 @@ Pman.Tab.BAdminStaff = new Roo.XComponent({
          items  : [
           {
            xtype : 'NavItem',
+           cls : 'account-management-group-nav-item',
            xns : Roo.bootstrap,
            '|xns' : 'Roo.bootstrap',
            items  : [
@@ -1284,7 +1343,6 @@ Pman.Tab.BAdminStaff = new Roo.XComponent({
        footerShow : false,
        hover : true,
        loadMask : true,
-       responsive : true,
        rowSelection : true,
        striped : true,
        listeners : {
@@ -1338,7 +1396,7 @@ Pman.Tab.BAdminStaff = new Roo.XComponent({
               options.params.type = 0;
               
               options.params._add_everyone = 1;
-          
+          options.params.limit = 999;
           }
         },
         xns : Roo.data,