PHP8
[Pman.BAdmin] / Pman.Dialog.BAdminAddToGroup.js
index cb63c9e..d1f3079 100644 (file)
@@ -8,10 +8,16 @@ Pman.Dialog.BAdminAddToGroup= function() {}
 Roo.apply(Pman.Dialog.BAdminAddToGroup.prototype, {
 
  _strings : {
+  '34ec78fcc91ffb1e54cd85e4a0924332' :"add",
   '05b763f7d24f32575493b3c23f299b0e' :"Add To Group",
   'ea4788705e6873b424c65e91c2846b19' :"Cancel",
+  'df1eb600b1e8e619756781831c41e346' :"Please select a group",
   'c9cc8cce247e49bae79f15173ce97354' :"Save"
  },
+ _named_strings : {
+  'group_id_name_placeholder' : 'df1eb600b1e8e619756781831c41e346' /* Please select a group */ ,
+  '_action_value' : '34ec78fcc91ffb1e54cd85e4a0924332' /* add */ 
+ },
 
  dialog : false,
  callback:  false,
@@ -75,7 +81,7 @@ Roo.apply(Pman.Dialog.BAdminAddToGroup.prototype, {
      {
       xtype : 'Form',
       labelAlign : 'top',
-      url : baseURL + '/Roo/Core_group_member',
+      url : baseURL + '/Roo/Core_group',
       listeners : {
        actioncomplete : function (_self, action)
         {
@@ -105,7 +111,16 @@ Roo.apply(Pman.Dialog.BAdminAddToGroup.prototype, {
         },
        actionfailed : function (_self, action)
         {
-            Roo.bootstrap.MessageBox.alert(action.result.errorMsg);
+            Roo.log(action);
+            
+            var err = 'Please fill in all the request fields';
+            
+            if (typeof(action) != 'undefined' && (action.failureType == 'server' || action.failureType == 'load')) {    
+                err = action.result.errorMsg;
+            }
+            
+            Roo.bootstrap.MessageBox.alert('Error', err);
+        
         },
        render : function (_self)
         {
@@ -125,6 +140,7 @@ Roo.apply(Pman.Dialog.BAdminAddToGroup.prototype, {
         minChars : 2,
         name : 'group_id_name',
         pageSize : 25,
+        placeholder : _this._strings['df1eb600b1e8e619756781831c41e346'] /* Please select a group */,
         queryParam : 'query[name_starts]',
         tpl : '<div class=\"roo-select2-result\"><b>{name}</b></div>',
         triggerAction : 'all',
@@ -135,13 +151,12 @@ Roo.apply(Pman.Dialog.BAdminAddToGroup.prototype, {
         store : {
          xtype : 'Store',
          remoteSort : true,
-         sortInfo : {field:"id",direction:"ASC"},
+         sortInfo : { field: 'name', direction: 'ASC'},
          listeners : {
           beforeload : function (_self, o)
            {
                o.params = o.params || {};
-               o.params.active = 1;
-               o.params.etype = 'Hydra.Plans';
+               o.params.type = 0;
            }
          },
          xns : Roo.data,
@@ -149,7 +164,7 @@ Roo.apply(Pman.Dialog.BAdminAddToGroup.prototype, {
          proxy : {
           xtype : 'HttpProxy',
           method : 'GET',
-          url : baseURL+'/Roo/Core_enum',
+          url : baseURL+'/Roo/Core_group',
           xns : Roo.data,
           '|xns' : 'Roo.data'
          },
@@ -163,14 +178,6 @@ Roo.apply(Pman.Dialog.BAdminAddToGroup.prototype, {
               {
                   'name': 'name',
                   'type': 'string'
-              },
-              {
-                  'name': 'display_name',
-                  'type': 'string'    
-              },
-              {
-                  'name': 'display_name_t',
-                  'type': 'string'    
               }
           ],
           xns : Roo.data,
@@ -181,7 +188,15 @@ Roo.apply(Pman.Dialog.BAdminAddToGroup.prototype, {
        {
         xtype : 'Input',
         inputType : 'hidden',
-        name : '_persons',
+        name : 'user_ids',
+        xns : Roo.bootstrap,
+        '|xns' : 'Roo.bootstrap'
+       },
+       {
+        xtype : 'Input',
+        inputType : 'hidden',
+        name : '_action',
+        value : _this._strings['34ec78fcc91ffb1e54cd85e4a0924332'] /* add */,
         xns : Roo.bootstrap,
         '|xns' : 'Roo.bootstrap'
        },