old version of group mgr got merged
authorAlan Knowles <alan@roojs.com>
Thu, 22 Jul 2021 05:21:40 +0000 (13:21 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 22 Jul 2021 05:21:40 +0000 (13:21 +0800)
Pman.Dialog.BAdminEmail.bjs
Pman.Dialog.BAdminEmail.js
Pman.Dialog.BAdminStaffGroups.bjs
Pman.Dialog.BAdminStaffGroups.js

index 653ed37..1d2c6ba 100644 (file)
  "named_strings" : {
   "description_fieldLabel" : "b5a7adde1af5c87d7fd797b6245c2a39",
   "active_boxLabel" : "28690be026c0bb9003aa58e45e5662ca",
-  "to_group_id_name_loadingText" : "843627586c62e389041a4d8800143974",
-  "to_group_id_name_fieldLabel" : "fb981fe689fbec75c6531eb7410971f4",
   "save_html" : "c9cc8cce247e49bae79f15173ce97354",
+  "to_group_id_display_name_loadingText" : "843627586c62e389041a4d8800143974",
   "bcc_group_id_name_placeholder" : "2c466a2c159463f1d9ef5a7b57b52827",
   "name_fieldLabel" : "292f75d54a6892cfe18a93e64230112a",
   "cancel_html" : "ea4788705e6873b424c65e91c2846b19",
   "from_email_fieldLabel" : "e71c729cd7f3c6b6ebdb447e65952dfd",
-  "to_group_id_name_placeholder" : "e05f77bdf3f659c1fd354a88526c03da",
+  "to_group_id_display_name_fieldLabel" : "fb981fe689fbec75c6531eb7410971f4",
   "preview_html" : "31fde7b05ac8952dacf4af8a704074ec",
   "active_value" : "c4ca4238a0b923820dcc509a6f75849b",
+  "to_group_id_display_name_placeholder" : "e05f77bdf3f659c1fd354a88526c03da",
   "send_html" : "5b8ef4e762c00a15a41cfc26dc3ef99c",
   "from_name_fieldLabel" : "1e6d57e813355689e9c77e947d73ad8f",
   "bcc_group_id_name_loadingText" : "843627586c62e389041a4d8800143974",
              "Boolean allowBlank" : true,
              "String loadingText" : "Searching",
              "Number pageSize" : 20,
-             "String name" : "to_group_id_name",
+             "String name" : "to_group_id_display_name",
              "Number minChars" : 2,
              "String valueField" : "id",
              "Boolean typeAhead" : true,
              "$ xns" : "Roo.bootstrap",
              "Number labelWidth" : 4,
              "String hiddenName" : "to_group_id",
-             "String displayField" : "name",
+             "String displayField" : "display_name",
              "Boolean forceSelection" : true,
              "String indicatorpos" : "right",
              "items" : [
                  "$ String url" : "baseURL + '/Roo/Core_group'"
                 },
                 {
-                 "$ Array fields" : "[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"id\",\"type\":\"int\"}]",
+                 "$ Array fields" : "['name','display_name',{\"name\":\"id\",\"type\":\"int\"}]",
                  "xtype" : "JsonReader",
                  "String root" : "data",
                  "$ xns" : "Roo.data",
index b359e78..65852fc 100644 (file)
@@ -38,16 +38,16 @@ Roo.apply(Pman.Dialog.BAdminEmail.prototype, {
  _named_strings : {
   'description_fieldLabel' : 'b5a7adde1af5c87d7fd797b6245c2a39' /* Description */ ,
   'active_boxLabel' : '28690be026c0bb9003aa58e45e5662ca' /* Enabled - will be sent out */ ,
-  'to_group_id_name_loadingText' : '843627586c62e389041a4d8800143974' /* Searching */ ,
-  'to_group_id_name_fieldLabel' : 'fb981fe689fbec75c6531eb7410971f4' /* To group: */ ,
   'save_html' : 'c9cc8cce247e49bae79f15173ce97354' /* Save */ ,
+  'to_group_id_display_name_loadingText' : '843627586c62e389041a4d8800143974' /* Searching */ ,
   'bcc_group_id_name_placeholder' : '2c466a2c159463f1d9ef5a7b57b52827' /* Select BCC Group */ ,
   'name_fieldLabel' : '292f75d54a6892cfe18a93e64230112a' /* Mailout Name: */ ,
   'cancel_html' : 'ea4788705e6873b424c65e91c2846b19' /* Cancel */ ,
   'from_email_fieldLabel' : 'e71c729cd7f3c6b6ebdb447e65952dfd' /* From email address: */ ,
-  'to_group_id_name_placeholder' : 'e05f77bdf3f659c1fd354a88526c03da' /* Select Group */ ,
+  'to_group_id_display_name_fieldLabel' : 'fb981fe689fbec75c6531eb7410971f4' /* To group: */ ,
   'preview_html' : '31fde7b05ac8952dacf4af8a704074ec' /* Preview */ ,
   'active_value' : 'c4ca4238a0b923820dcc509a6f75849b' /* 1 */ ,
+  'to_group_id_display_name_placeholder' : 'e05f77bdf3f659c1fd354a88526c03da' /* Select Group */ ,
   'send_html' : '5b8ef4e762c00a15a41cfc26dc3ef99c' /* Send me a test copy */ ,
   'from_name_fieldLabel' : '1e6d57e813355689e9c77e947d73ad8f' /* From: */ ,
   'bcc_group_id_name_loadingText' : '843627586c62e389041a4d8800143974' /* Searching */ ,
@@ -548,7 +548,7 @@ Roo.apply(Pman.Dialog.BAdminEmail.prototype, {
               xtype : 'ComboBox',
               allowBlank : true,
               alwaysQuery : true,
-              displayField : 'name',
+              displayField : 'display_name',
               editable : false,
               fieldLabel : _this._strings['fb981fe689fbec75c6531eb7410971f4'] /* To group: */,
               forceSelection : true,
@@ -558,7 +558,7 @@ Roo.apply(Pman.Dialog.BAdminEmail.prototype, {
               labelWidth : 4,
               loadingText : _this._strings['843627586c62e389041a4d8800143974'] /* Searching */,
               minChars : 2,
-              name : 'to_group_id_name',
+              name : 'to_group_id_display_name',
               pageSize : 20,
               placeholder : _this._strings['e05f77bdf3f659c1fd354a88526c03da'] /* Select Group */,
               triggerAction : 'all',
@@ -595,7 +595,7 @@ Roo.apply(Pman.Dialog.BAdminEmail.prototype, {
                },
                reader : {
                 xtype : 'JsonReader',
-                fields : [{"name":"name","type":"string"},{"name":"id","type":"int"}],
+                fields : ['name','display_name',{"name":"id","type":"int"}],
                 id : 'name',
                 root : 'data',
                 totalProperty : 'total',
index 9a4506b..cbfef75 100644 (file)
   "566a352f95c879ff26e50bad767a28dc" : "Group Membership",
   "6b79852e4370cae80ee551e0671616bb" : "Manage Users Group",
   "28974c2c793e780427dfb571b26443e6" : "Group Name",
-  "ea4788705e6873b424c65e91c2846b19" : "Cancel",
-  "c9cc8cce247e49bae79f15173ce97354" : "Save"
+  "d3d2e617335f08df83599665eef8a418" : "Close"
  },
  "items" : [
   {
    "listeners" : {
-    "show" : "function (_self)\n{\n    this.setTitle(\"Manage Membership for \" + _this.data.name);\n}",
+    "show" : "function (_self)\n{\n    this.setTitle(\"Manage Membership for \" + _this.data.name);\n     if(_this.option_grid){\n        _this.option_grid.store.load({});\n    }\n}",
     "render" : "function (_self)\n{\n    _this.dialog = this;\n}"
    },
-   "String cls" : "add-user-dialog",
-   "string fit_content" : true,
+   "String size" : "md",
    "xtype" : "Modal",
+   "Boolean fitwindow" : true,
    "$ xns" : "Roo.bootstrap",
+   "Number max_width" : 500,
    "String title" : "Manage Users Group",
    "items" : [
     {
      "$ xns" : "Roo.bootstrap.layout",
      "items" : [
       {
-       "alwaysShowTabs" : true,
-       "String tabPosition" : "top",
        "xtype" : "Region",
        "$ xns" : "Roo.bootstrap.layout",
        "* prop" : "center"
       },
       {
        "listeners" : {
-        "activate" : "function (_self)\n{\n    if(_this.option_grid){\n        _this.option_grid.store.load({});\n    }\n    \n}",
+        "activate" : "function (_self)\n{\n   \n    \n}",
         "render" : "function (_self)\n{\n    _this.option_panel = this;\n    \n    \n}"
        },
        "fitToFrame" : true,
     },
     {
      "listeners" : {
-      "click" : "function (_self, e)\n{\n    _this.dialog.hide(); \n}"
-     },
-     "xtype" : "Button",
-     "$ xns" : "Roo.bootstrap",
-     "String html" : "Cancel",
-     "* prop" : "buttons[]"
-    },
-    {
-     "listeners" : {
-      "click" : "function (_self, e)\n{\n    if(!_this.form.isValid()){\n        //Roo.bootstrap.MessageBox.alert('Error', 'Please Correct all the errors in red');\n        return;\n    }\n    \n    var myID = _this.form.findField('id').getValue() * 1;\n    var myName = _this.form.findField('name').getValue();\n\n    if (_this.form.findField('company_id') && !_this.form.findField('company_id').getValue()) {\n        Roo.bootstrap.MessageBox.alert(\"Error\", \"Select a Company\");\n        return;\n    }\n        \n       // validate password match (only needed if we are not using generated one..\n    if (_this.form.findField('passwd1') \n            && _this.form.findField('passwd1').getValue().length > 0 \n            && _this.form.findField('passwd1').inputEl().dom.type == \"password\") {\n            \n        var p1 = _this.form.findField('passwd1').getValue();\n        var p2 = _this.form.findField('passwd2').getValue();\n            \n            \n        if (Pman.Login.authUser.id < 0 && !p1.length) {\n            Roo.bootstrap.MessageBox.alert(\"Error\", \"You must create a password for the admin account\");\n            return;\n        }\n            \n            \n        if (p1.length || p2.length) {\n            if (p1 != p2) {\n                Roo.bootstrap.MessageBox.alert(\"Error\", \"Passwords do not match\");\n                return;\n            }\n        }\n            \n        \n    }\n    \n    // get the list of record with tick\n    \n    _this.form.doAction(\"submit\");\n    \n    return;\n\n}"
+      "click" : "function (_self, e)\n{\n    _this.dialog.hide();\n    _this.callback();\n    \n    return;\n\n}"
      },
      "String weight" : "primary",
      "xtype" : "Button",
      "$ xns" : "Roo.bootstrap",
-     "String html" : "Save",
+     "String html" : "Close",
      "* prop" : "buttons[]"
     }
    ]
index 109b6cf..4547199 100644 (file)
@@ -12,8 +12,7 @@ Roo.apply(Pman.Dialog.BAdminStaffGroups.prototype, {
   '566a352f95c879ff26e50bad767a28dc' :"Group Membership",
   '6b79852e4370cae80ee551e0671616bb' :"Manage Users Group",
   '28974c2c793e780427dfb571b26443e6' :"Group Name",
-  'ea4788705e6873b424c65e91c2846b19' :"Cancel",
-  'c9cc8cce247e49bae79f15173ce97354' :"Save"
+  'd3d2e617335f08df83599665eef8a418' :"Close"
  },
 
  dialog : false,
@@ -41,8 +40,9 @@ Roo.apply(Pman.Dialog.BAdminStaffGroups.prototype, {
   var _this = this;
   this.dialog = Roo.factory({
     xtype : 'Modal',
-    cls : 'add-user-dialog',
-    fit_content : true,
+    fitwindow : true,
+    max_width : 500,
+    size : 'md',
     title : _this._strings['6b79852e4370cae80ee551e0671616bb'] /* Manage Users Group */,
     listeners : {
      render : function (_self)
@@ -52,6 +52,9 @@ Roo.apply(Pman.Dialog.BAdminStaffGroups.prototype, {
      show : function (_self)
       {
           this.setTitle("Manage Membership for " + _this.data.name);
+           if(_this.option_grid){
+              _this.option_grid.store.load({});
+          }
       }
     },
     xns : Roo.bootstrap,
@@ -59,64 +62,13 @@ Roo.apply(Pman.Dialog.BAdminStaffGroups.prototype, {
     buttons : [
      {
       xtype : 'Button',
-      html : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
-      listeners : {
-       click : function (_self, e)
-        {
-            _this.dialog.hide(); 
-        }
-      },
-      xns : Roo.bootstrap,
-      '|xns' : 'Roo.bootstrap'
-     },
-     {
-      xtype : 'Button',
-      html : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
+      html : _this._strings['d3d2e617335f08df83599665eef8a418'] /* Close */,
       weight : 'primary',
       listeners : {
        click : function (_self, e)
         {
-            if(!_this.form.isValid()){
-                //Roo.bootstrap.MessageBox.alert('Error', 'Please Correct all the errors in red');
-                return;
-            }
-            
-            var myID = _this.form.findField('id').getValue() * 1;
-            var myName = _this.form.findField('name').getValue();
-        
-            if (_this.form.findField('company_id') && !_this.form.findField('company_id').getValue()) {
-                Roo.bootstrap.MessageBox.alert("Error", "Select a Company");
-                return;
-            }
-                
-               // validate password match (only needed if we are not using generated one..
-            if (_this.form.findField('passwd1') 
-                    && _this.form.findField('passwd1').getValue().length > 0 
-                    && _this.form.findField('passwd1').inputEl().dom.type == "password") {
-                    
-                var p1 = _this.form.findField('passwd1').getValue();
-                var p2 = _this.form.findField('passwd2').getValue();
-                    
-                    
-                if (Pman.Login.authUser.id < 0 && !p1.length) {
-                    Roo.bootstrap.MessageBox.alert("Error", "You must create a password for the admin account");
-                    return;
-                }
-                    
-                    
-                if (p1.length || p2.length) {
-                    if (p1 != p2) {
-                        Roo.bootstrap.MessageBox.alert("Error", "Passwords do not match");
-                        return;
-                    }
-                }
-                    
-                
-            }
-            
-            // get the list of record with tick
-            
-            _this.form.doAction("submit");
+            _this.dialog.hide();
+            _this.callback();
             
             return;
         
@@ -139,8 +91,6 @@ Roo.apply(Pman.Dialog.BAdminStaffGroups.prototype, {
       '|xns' : 'Roo.bootstrap.layout',
       center : {
        xtype : 'Region',
-       alwaysShowTabs : true,
-       tabPosition : 'top',
        xns : Roo.bootstrap.layout,
        '|xns' : 'Roo.bootstrap.layout'
       },
@@ -155,9 +105,7 @@ Roo.apply(Pman.Dialog.BAdminStaffGroups.prototype, {
         listeners : {
          activate : function (_self)
           {
-              if(_this.option_grid){
-                  _this.option_grid.store.load({});
-              }
+             
               
           },
          render : function (_self)