PHP8
[Pman.BAdmin] / Pman.Tab.BAdminIPAccess.bjs
index 700d2b7..df5ae51 100644 (file)
@@ -2,33 +2,25 @@
  "name" : "Pman.Tab.BAdminIPAccess",
  "parent" : "Pman.Tab.BAdmin",
  "title" : "",
- "path" : "/home/edward/gitlive/Pman.BAdmin/Pman.Tab.BAdminIPAccess.bjs",
+ "path" : "/home/alan/gitlive/Pman.BAdmin/Pman.Tab.BAdminIPAccess.bjs",
  "permname" : "",
  "modOrder" : "006",
  "strings" : {
   "ce8ae9da5b7cd6c3df2929543a9af92d" : "Email",
-  "231bc72756b5e6de492aaaa1577f61b1" : "Remarks",
   "86f16ddf147752b95ffe69e2dfa769a1" : "Authorized By",
   "ec53a8c4f07baed5d8825072c89799be" : "Status",
-  "b80bb7740288fda1f201890375a60c8f" : "id",
   "7dce122004969d56ae2e0245cb754d35" : "Edit",
   "fc6f97505d89fe9277965c126744647a" : "No Companies found",
   "11e8622b4aa4b1924aee81a9ec54c555" : "Create Date",
   "a12a3079e14ced46e69ba52b8a90b21a" : "IP",
-  "694e249c3a9503141fa5ce3fb71d5477" : "<i class=\"fa fa-edit\"></i> Edit",
   "155ca6a755e25c15ad7ce45e2f638f10" : "Displaying Companies{0} - {1} of {2}",
   "5a787141d53b573ec9b86e900bfe0d79" : "Expire Date",
-  "fd5293a712d172f5c556a83c62d44bd6" : "<i class=\"fa fa-plus\"></i> Add",
-  "ed807858fcb68abdd180481f1fcba5c5" : "<i class=\"fa fa-trash\"></i> Delete",
   "f2a6c498fb90ee345d997f888fce3b18" : "Delete",
-  "f78e208016407d8756c29673558ac14d" : "Company List",
-  "a1fa27779242b4902f7ae3bdd5c6d508" : "Type",
-  "9c9745a343efeacc9efe9b7222b27afb" : "Ref#",
-  "49ee3087348e8d44e1feda1917443987" : "Name",
-  "2e006b735fbd916d8ab26978ae6714d4" : "Tel",
-  "dd7bf230fde8d4836917806aff6a6b27" : "Address",
-  "e3030abfa75de4573fb37032affa11e7" : "IP Access",
-  "9810aa2b9f44401be4bf73188ef2b67d" : "Fax"
+  "e3030abfa75de4573fb37032affa11e7" : "IP Access"
+ },
+ "named_strings" : {
+  "footer_displayMsg" : "155ca6a755e25c15ad7ce45e2f638f10",
+  "footer_emptyMsg" : "fc6f97505d89fe9277965c126744647a"
  },
  "items" : [
   {
       },
       {
        "listeners" : {
-        "activate" : "function (_self)\n{\n    _this.edit_btn.hide();\n    _this.delete_btn.hide();\n    \n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}",
-        "render" : "function (_self)\n{\n    _this.panel = this;\n}"
+        "activate" : "function (_self)\n{\n    _this.edit_btn.hide();\n    _this.delete_btn.hide();\n    \n    if (_this.table) {\n        _this.table.footer.onClick('first');\n    }\n}",
+        "render" : "function (_self)\n{\n    _this.grid = _self;\n}"
        },
-       "Boolean fitContainer" : true,
        "xtype" : "Grid",
        "Boolean fitToFrame" : true,
-       "String region" : "center",
        "$ xns" : "Roo.bootstrap.panel",
+       "String region" : "center",
        "String title" : "IP Access",
-       "Boolean background" : false,
+       "Boolean closable" : false,
        "items" : [
         {
          "xtype" : "NavSimplebar",
                  "$ xns" : "Roo.bootstrap",
                  "items" : [
                   {
-                   "Number md" : 12,
+                   "Number md" : 3,
                    "xtype" : "Column",
                    "$ xns" : "Roo.bootstrap",
+                   "items" : [
+                    {
+                     "listeners" : {
+                      "render" : "function (_self)\n{\n    _this.status = this;\n    \n    this.setValue(0);\n}",
+                      "select" : "function (combo, record, index)\n{\n    _this.table.footer.onClick('first'); \n}"
+                     },
+                     "Boolean allowBlank" : false,
+                     "String name" : "status_name",
+                     "String mode" : "local",
+                     "String valueField" : "code",
+                     "Boolean editable" : false,
+                     "xtype" : "ComboBox",
+                     "String triggerAction" : "all",
+                     "$ xns" : "Roo.bootstrap",
+                     "String/Roo.Template tpl" : "<div class=\"roo-select2-result\"><b>{value}</b></div>",
+                     "String hiddenName" : "status",
+                     "String displayField" : "value",
+                     "items" : [
+                      {
+                       "$ string data" : "[\n    ['0', 'Pending'],\n    ['1', 'Approve'],\n    ['-2', 'Temporary'],\n    ['-1', 'Reject']\n] ",
+                       "xtype" : "SimpleStore",
+                       "$ xns" : "Roo.data",
+                       "$ fields" : "[ 'code', 'value' ]",
+                       "* prop" : "store"
+                      }
+                     ]
+                    }
+                   ]
+                  },
+                  {
+                   "Number md" : 9,
+                   "xtype" : "Column",
+                   "$ xns" : "Roo.bootstrap",
+                   "String style" : "text-align: right;",
                    "items" : [
                     {
                      "listeners" : {
                       "render" : "function (_self)\n{\n    _this.edit_btn = this;\n    \n    this.hide();\n}",
-                      "click" : "function (_self, e)\n{\n    var sel = _this.option_grid.getSelectionModel().getSelected();\n    \n    if(!sel || sel.data.id * 1 < 1){\n        Roo.bootstrap.MessageBox.alert('Error', 'Please select a option');\n        return;\n    }\n\n    Pman.Dialog.BAdminCoreEnum.show({ \n        id : sel.data.id\n    }, function(res) {\n        _this.option_grid.store.load({});\n    });\n\n}"
+                      "click" : "function (_self, e)\n{\n    var sel = _this.table.getSelectionModel().getSelected();\n    \n    if(!sel || sel.data.id * 1 < 1){\n        Roo.bootstrap.MessageBox.alert('Error', 'Please select a row');\n        return;\n    }\n\n    Pman.Dialog.BAdminIPAccess.show({ \n        id : sel.data.id\n    }, function(res) {\n        _this.table.store.load({});\n    });\n\n}"
                      },
                      "String cls" : "roo-toolbar-button",
                      "String weight" : "default",
                     {
                      "listeners" : {
                       "render" : "function (_self)\n{\n    _this.delete_btn = this;\n    \n    this.hide();\n}",
-                      "click" : "function (_self, e)\n{\n    Pman.genericDelete(_this.panel, 'core_ip_access'); \n\n}"
+                      "click" : "function (_self, e)\n{\n    Pman.genericDelete(_this.grid, 'core_ip_access'); \n\n}"
                      },
                      "String cls" : "roo-toolbar-button",
                      "String weight" : "primary",
         },
         {
          "listeners" : {
-          "rowdblclick" : "function (_self, el, rowIndex, e)\n{\n    var sel = _this.option_grid.store.getAt(rowIndex);\n    \n    if(!sel || sel.data.id * 1 < 1){\n        return;\n    }\n    \n    Pman.Dialog.BAdminCoreEnum.show({ \n        id : sel.data.id\n    }, function(res) {\n        _this.option_grid.store.load({});\n    });\n    \n}",
-          "render" : "function (_self)\n{\n    _this.grid = this;\n}"
+          "rowdblclick" : "function (_self, el, rowIndex, e)\n{\n    var s = _this.table.store.getAt(rowIndex);\n    \n    if(!s || s.data.id * 1 < 1){\n        return;\n    }\n    \n    Pman.Dialog.BAdminIPAccess.show({ \n        id : s.data.id\n    }, function(res) {\n        _this.table.footer.onClick('first');\n    });\n}",
+          "render" : "function (_self)\n{\n    _this.table = this;\n}"
          },
-         "Boolean cellSelection" : true,
          "String cls" : "table-fixed",
-         "Boolean footerShow" : false,
          "boolean hover" : true,
-         "boolean striped" : true,
+         "boolean striped" : false,
          "xtype" : "Table",
-         "boolean responsive" : true,
          "Boolean rowSelection" : true,
          "$ xns" : "Roo.bootstrap",
          "Boolean loadMask" : true,
           },
           {
            "listeners" : {
-            "beforeload" : "function (_self, o)\n{\n    o.params = o.params || {};\n    \n    \n}",
+            "beforeload" : "function (_self, o)\n{\n     if (!Pman.buildCompleted) {\n        return false;\n    }\n\n    o.params = o.params || {};\n    \n    var status = _this.status.getValue() * 1;\n    \n    o.params.status = status;\n    \n}",
             "load" : "function (_self, records, options)\n{\n    _this.edit_btn.hide();\n    _this.delete_btn.hide();\n}"
            },
            "xtype" : "Store",
            "boolean remoteSort" : true,
            "$ xns" : "Roo.data",
-           "$ sortinfo" : "{ field : 'display_name', direction: 'ASC' }",
+           "$ sortInfo" : "{ field : 'display_name', direction: 'ASC' }",
            "* prop" : "store",
            "items" : [
             {
           },
           {
            "Number pageSize" : 25,
-           "Boolean displayInfo" : false,
-           "xtype" : "PagingToolbar",
-           "$ xns" : "Roo.bootstrap",
-           "* prop" : "footer",
-           "string name" : "footer"
-          }
-         ]
-        }
-       ]
-      }
-     ]
-    },
-    {
-     "xtype" : "Border",
-     "$ xns" : "Roo.bootstrap.layout",
-     "* prop" : "layout",
-     "items" : [
-      {
-       "String tabPosition" : "top",
-       "xtype" : "Region",
-       "$ xns" : "Roo.bootstrap.layout",
-       "* prop" : "center"
-      },
-      {
-       "listeners" : {
-        "activate" : "function (_self)\n{\n    _this.edit_btn.hide();\n    _this.delete_btn.hide();\n    \n    if (_this.table) {\n        _this.table.footer.onClick('first');\n    }\n}",
-        "render" : "function (_self)\n{\n    _this.grid = _self;\n}"
-       },
-       "xtype" : "Grid",
-       "Boolean fitToFrame" : true,
-       "$ xns" : "Roo.bootstrap.panel",
-       "String region" : "center",
-       "String title" : "Company List",
-       "Boolean closable" : false,
-       "items" : [
-        {
-         "xtype" : "NavSimplebar",
-         "$ xns" : "Roo.bootstrap",
-         "* prop" : "toolbar",
-         "items" : [
-          {
-           "xtype" : "NavGroup",
-           "$ xns" : "Roo.bootstrap",
-           "items" : [
-            {
-             "xtype" : "NavItem",
-             "$ xns" : "Roo.bootstrap",
-             "items" : [
-              {
-               "xtype" : "Element",
-               "$ xns" : "Roo.bootstrap",
-               "items" : [
-                {
-                 "String cls" : "roo-toolbar",
-                 "xtype" : "Row",
-                 "$ xns" : "Roo.bootstrap",
-                 "items" : [
-                  {
-                   "Number md" : 12,
-                   "xtype" : "Column",
-                   "$ xns" : "Roo.bootstrap",
-                   "items" : [
-                    {
-                     "listeners" : {
-                      "click" : "function (_self, e)\n{\n    Pman.Dialog.BAdminCompany.show({}, function() {\n        if (_this.table) {\n            _this.table.footer.onClick('first');\n        }\n    }); \n}"
-                     },
-                     "String cls" : "roo-toolbar-button",
-                     "String weight" : "default",
-                     "xtype" : "Button",
-                     "$ xns" : "Roo.bootstrap",
-                     "String html" : "<i class=\"fa fa-plus\"></i> Add"
-                    },
-                    {
-                     "listeners" : {
-                      "render" : "function (_self)\n{\n    _this.edit_btn = this;\n    \n    this.hide();\n}",
-                      "click" : "function (_self, e)\n{\n    var s = _this.table.getSelectionModel().getSelected();\n        \n    if (!s || s.data.id * 1 < 1)  {\n        Roo.bootstrap.MessageBox.alert(\"Error\", 'Please select a company');\n        return;\n    }\n    \n    Pman.Dialog.BAdminCompany.show({\n        id : s.data.id\n    }, function() {\n        if (_this.table) {\n            _this.table.footer.onClick('refresh');\n        }\n    });\n    \n    \n}"
-                     },
-                     "String cls" : "roo-toolbar-button",
-                     "String weight" : "default",
-                     "xtype" : "Button",
-                     "$ xns" : "Roo.bootstrap",
-                     "String html" : "<i class=\"fa fa-edit\"></i> Edit"
-                    },
-                    {
-                     "listeners" : {
-                      "render" : "function (_self)\n{\n    _this.delete_btn = this;\n    \n    this.hide();\n}",
-                      "click" : "function (_self, e)\n{\n    Pman.genericDelete(_this.grid, 'core_company'); \n}"
-                     },
-                     "String cls" : "roo-toolbar-button",
-                     "String weight" : "primary",
-                     "xtype" : "Button",
-                     "$ xns" : "Roo.bootstrap",
-                     "String html" : "<i class=\"fa fa-trash\"></i> Delete"
-                    }
-                   ]
-                  }
-                 ]
-                }
-               ]
-              }
-             ]
-            }
-           ]
-          }
-         ]
-        },
-        {
-         "listeners" : {
-          "rowdblclick" : "function (_self, el, rowIndex, e)\n{\n    var s = _this.table.store.getAt(rowIndex);\n    \n    if(!s || s.data.id * 1 < 1){\n        return;\n    }\n    \n    Pman.Dialog.BAdminCompany.show({\n        id : s.data.id\n    }, function() {\n        if (_this.table) {\n            _this.table.footer.onClick('refresh');\n        }\n    });\n}",
-          "render" : "function (_self)\n{\n    _this.table = this;\n}",
-          "rowclick" : "function (_self, el, rowIndex, e)\n{\n    (function(){\n        \n        _this.edit_btn.hide();\n        _this.delete_btn.hide();\n        \n        var s = _this.table.getSelectionModel().getSelected();\n        \n        if (!s || s.data.id * 1 < 1)  {\n            return;\n        }\n        \n        _this.edit_btn.show();\n        _this.delete_btn.show();\n        \n    }).defer(100);\n    \n}"
-         },
-         "String cls" : "table-fixed",
-         "boolean hover" : true,
-         "boolean striped" : false,
-         "xtype" : "Table",
-         "boolean responsive" : true,
-         "Boolean rowSelection" : true,
-         "$ xns" : "Roo.bootstrap",
-         "Boolean loadMask" : true,
-         "* prop" : "grid",
-         "items" : [
-          {
-           "Boolean singleSelect" : true,
-           "xtype" : "RowSelectionModel",
-           "$ xns" : "Roo.bootstrap.Table",
-           "* prop" : "sm"
-          },
-          {
-           "listeners" : {
-            "beforeload" : "function (_self, options)\n{\n    options.params = options.params || {};\n}",
-            "load" : "function (_self, records, options)\n{\n    _this.delete_btn.hide();\n    _this.edit_btn.hide();\n}"
-           },
-           "boolean hover" : true,
-           "boolean striped" : true,
-           "xtype" : "Store",
-           "Boolean rowSelection" : true,
-           "$ xns" : "Roo.data",
-           "Boolean loadMask" : true,
-           "* prop" : "store",
-           "items" : [
-            {
-             "xtype" : "JsonReader",
-             "String root" : "data",
-             "$ xns" : "Roo.data",
-             "String id" : "id",
-             "* prop" : "reader",
-             "String totalProperty" : "total"
-            },
-            {
-             "listeners" : {
-              "load" : "function (This, o, arg)\n{\n    _this.table.footer.onClick('first');\n}"
-             },
-             "xtype" : "HttpProxy",
-             "$ xns" : "Roo.data",
-             "String method" : "GET",
-             "* prop" : "proxy",
-             "$ String url" : "baseURL + '/Roo/core_company'"
-            }
-           ]
-          },
-          {
-           "String header" : "Type",
-           "String cursor" : "pointer",
-           "String dataIndex" : "comptype",
-           "Number md" : 1,
-           "xtype" : "ColumnModel",
-           "Number xs" : 1,
-           "$ xns" : "Roo.grid",
-           "$ renderer" : "function (v,x ,r) {\n    //return Pman.Dialog.Companies.comptypeListToString(r.data.isOwner ? 'OWNER' : v);\n    return v;\n}",
-           "Boolean sortable" : true,
-           "* prop" : "cm[]",
-           "Number sm" : 1
-          },
-          {
-           "String header" : "Ref#",
-           "String cursor" : "pointer",
-           "String dataIndex" : "code",
-           "xtype" : "ColumnModel",
-           "$ xns" : "Roo.grid",
-           "$ renderer" : "function(v) { return String.format('{0}', v); }",
-           "Boolean sortable" : true,
-           "* prop" : "cm[]",
-           "Boolean hidden" : true
-          },
-          {
-           "String header" : "Name",
-           "String cursor" : "pointer",
-           "String dataIndex" : "name",
-           "Number md" : 2,
-           "xtype" : "ColumnModel",
-           "Number xs" : 2,
-           "$ xns" : "Roo.grid",
-           "$ renderer" : "function(v,x,r) {\n    return String.format(r.data.comptype == 'OWNER' ? '<B>{0}</B>' : '{0}',v);    \n}",
-           "Boolean sortable" : true,
-           "* prop" : "cm[]",
-           "Number sm" : 2
-          },
-          {
-           "String header" : "Tel",
-           "String cursor" : "pointer",
-           "String dataIndex" : "tel",
-           "Number md" : 1,
-           "xtype" : "ColumnModel",
-           "Number xs" : 1,
-           "$ xns" : "Roo.grid",
-           "$ renderer" : "function(v) { return String.format('{0}', v); }",
-           "* prop" : "cm[]",
-           "Number sm" : 1
-          },
-          {
-           "String header" : "Fax",
-           "String cursor" : "pointer",
-           "String dataIndex" : "fax",
-           "Number md" : 1,
-           "xtype" : "ColumnModel",
-           "Number xs" : 1,
-           "$ xns" : "Roo.grid",
-           "$ renderer" : "function(v) { return String.format('{0}', v); }",
-           "* prop" : "cm[]",
-           "Number sm" : 1
-          },
-          {
-           "String header" : "Email",
-           "String cursor" : "pointer",
-           "String dataIndex" : "email",
-           "Number md" : 2,
-           "xtype" : "ColumnModel",
-           "Number xs" : 2,
-           "$ xns" : "Roo.grid",
-           "$ renderer" : "function (v) {\n        return (v.length && v.indexOf('@') > 0 ) ? \n            String.format('<a href=\"mailto:{0}\">{0}</a>',v) : v;\n            \n    }",
-           "Boolean sortable" : true,
-           "* prop" : "cm[]",
-           "Number sm" : 2
-          },
-          {
-           "String header" : "Address",
-           "String cursor" : "pointer",
-           "String dataIndex" : "address",
-           "Number md" : 5,
-           "xtype" : "ColumnModel",
-           "Number xs" : 5,
-           "$ xns" : "Roo.grid",
-           "$ renderer" : "function(v) { return String.format('{0}', v); }",
-           "Boolean sortable" : true,
-           "* prop" : "cm[]",
-           "Number sm" : 5
-          },
-          {
-           "String header" : "Remarks",
-           "String cursor" : "pointer",
-           "String dataIndex" : "remarks",
-           "Number width" : 200,
-           "xtype" : "ColumnModel",
-           "$ xns" : "Roo.grid",
-           "$ renderer" : "function(v) { return String.format('{0}', v); }",
-           "* prop" : "cm[]",
-           "Boolean hidden" : true
-          },
-          {
-           "String header" : "id",
-           "String cursor" : "pointer",
-           "String dataIndex" : "id",
-           "Number width" : 50,
-           "xtype" : "ColumnModel",
-           "$ xns" : "Roo.grid",
-           "$ renderer" : "function(v) { return String.format('{0}', v); }",
-           "Boolean sortable" : true,
-           "* prop" : "cm[]",
-           "Boolean hidden" : true
-          },
-          {
-           "listeners" : {
-            "render" : "function (_self)\n{\n    _this.footer = _self;\n}"
-           },
-           "Number pageSize" : 25,
-           "Boolean displayInfo" : false,
            "String displayMsg" : "Displaying Companies{0} - {1} of {2}",
+           "Boolean displayInfo" : false,
            "xtype" : "PagingToolbar",
            "String emptyMsg" : "No Companies found",
            "$ xns" : "Roo.bootstrap",