Pman.Dialog.VerifyAccess.bjs
authoredward <edward@roojs.com>
Thu, 15 Feb 2018 03:55:39 +0000 (11:55 +0800)
committeredward <edward@roojs.com>
Thu, 15 Feb 2018 03:55:39 +0000 (11:55 +0800)
Pman.Dialog.VerifyAccess.js

Pman.Dialog.VerifyAccess.bjs
Pman.Dialog.VerifyAccess.js

index 28f183d..c2cca07 100644 (file)
@@ -8,6 +8,7 @@
  "strings" : {
   "e2c9d024b79dfb48b42a7807206c6aed" : "Verify New IP Access",
   "d41d8cd98f00b204e9800998ecf8427e" : "",
+  "7c5ba892645af8d7dba520e3978c726f" : "Director",
   "f6039d44b29456b20f8f373155ae4973" : "Username",
   "dfb790522fdea3859af206d32916fe77" : "User Agent",
   "d71940f24ee38ee09f6e06b908480bcf" : "Resend email",
          "$ xns" : "Roo.bootstrap",
          "items" : [
           {
-           "String name" : "user_agent",
-           "Boolean readOnly" : true,
-           "xtype" : "TextArea",
-           "string fieldLabel" : "User Agent",
-           "Number rows" : 3,
-           "$ xns" : "Roo.bootstrap"
+           "Boolean allowBlank" : false,
+           "String name" : "_existing_director_name",
+           "Number minChars" : 2,
+           "Number md" : 12,
+           "String valueField" : "id",
+           "String queryParam" : "query[name]",
+           "Boolean typeAhead" : true,
+           "xtype" : "ComboBox",
+           "String triggerAction" : "all",
+           "Boolean editable" : true,
+           "Boolean alwaysQuery" : true,
+           "$ xns" : "Roo.bootstrap",
+           "String/Roo.Template tpl" : "<div class=\"roo-select2-result\">{fullname}</div>",
+           "String fieldLabel" : "Director",
+           "String hiddenName" : "_existing_director",
+           "String displayField" : "fullname",
+           "Boolean forceSelection" : true,
+           "String indicatorpos" : "right",
+           "items" : [
+            {
+             "listeners" : {
+              "beforeload" : "function (_self, o)\n{\n    o.params = o.params || {};\n    \n    o.params._with_fullname = 1;\n    \n    var parent = _this.form.findField('parent_company_id').getValue() * 1;\n    \n    o.params._hide_existing = 1;\n    \n    o.params._parent_company_id = parent;\n    \n    if (Roo.select('main').first().dom.className.indexOf('trust') >= 0) {\n        \n        o.params._find_person_type = 'trustee';\n    }\n    \n}"
+             },
+             "xtype" : "Store",
+             "boolean remoteSort" : true,
+             "$ xns" : "Roo.data",
+             "$ sortInfo" : "{field:\"firstname\",direction:\"ASC\"}",
+             "* prop" : "store",
+             "items" : [
+              {
+               "xtype" : "HttpProxy",
+               "$ xns" : "Roo.data",
+               "String method" : "GET",
+               "* prop" : "proxy",
+               "$ String url" : "baseURL+'/Roo/Coba_person'"
+              },
+              {
+               "xtype" : "JsonReader",
+               "$ xns" : "Roo.data",
+               "$ fields" : "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'honor',\n        'type': 'string'\n    },\n    {\n        'name': 'firstname',\n        'type': 'string'\n    },\n    {\n        'name': 'middlename',\n        'type': 'string'\n    },\n    {\n        'name': 'lastname',\n        'type': 'string'\n    },\n    {\n        'name': 'fullname',\n        'type': 'string'\n    }\n]",
+               "* prop" : "reader"
+              }
+             ]
+            }
+           ]
           }
          ]
         }
index aee6691..a39fa81 100644 (file)
@@ -10,6 +10,7 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
  _strings : {
   'e2c9d024b79dfb48b42a7807206c6aed' :"Verify New IP Access",
   'd41d8cd98f00b204e9800998ecf8427e' :"",
+  '7c5ba892645af8d7dba520e3978c726f' :"Director",
   'f6039d44b29456b20f8f373155ae4973' :"Username",
   'dfb790522fdea3859af206d32916fe77' :"User Agent",
   'd71940f24ee38ee09f6e06b908480bcf' :"Resend email",
@@ -286,13 +287,90 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
           '|xns' : 'Roo.bootstrap',
           items  : [
            {
-            xtype : 'TextArea',
-            fieldLabel : _this._strings['dfb790522fdea3859af206d32916fe77'] /* User Agent */,
-            name : 'user_agent',
-            readOnly : true,
-            rows : 3,
+            xtype : 'ComboBox',
+            allowBlank : false,
+            alwaysQuery : true,
+            displayField : 'fullname',
+            editable : true,
+            fieldLabel : _this._strings['7c5ba892645af8d7dba520e3978c726f'] /* Director */,
+            forceSelection : true,
+            hiddenName : '_existing_director',
+            indicatorpos : 'right',
+            md : 12,
+            minChars : 2,
+            name : '_existing_director_name',
+            queryParam : 'query[name]',
+            tpl : '<div class=\"roo-select2-result\">{fullname}</div>',
+            triggerAction : 'all',
+            typeAhead : true,
+            valueField : 'id',
             xns : Roo.bootstrap,
-            '|xns' : 'Roo.bootstrap'
+            '|xns' : 'Roo.bootstrap',
+            store : {
+             xtype : 'Store',
+             remoteSort : true,
+             sortInfo : {field:"firstname",direction:"ASC"},
+             listeners : {
+              beforeload : function (_self, o)
+               {
+                   o.params = o.params || {};
+                   
+                   o.params._with_fullname = 1;
+                   
+                   var parent = _this.form.findField('parent_company_id').getValue() * 1;
+                   
+                   o.params._hide_existing = 1;
+                   
+                   o.params._parent_company_id = parent;
+                   
+                   if (Roo.select('main').first().dom.className.indexOf('trust') >= 0) {
+                       
+                       o.params._find_person_type = 'trustee';
+                   }
+                   
+               }
+             },
+             xns : Roo.data,
+             '|xns' : 'Roo.data',
+             proxy : {
+              xtype : 'HttpProxy',
+              method : 'GET',
+              url : baseURL+'/Roo/Coba_person',
+              xns : Roo.data,
+              '|xns' : 'Roo.data'
+             },
+             reader : {
+              xtype : 'JsonReader',
+              fields : [
+                  {
+                      'name': 'id',
+                      'type': 'int'
+                  },
+                  {
+                      'name': 'honor',
+                      'type': 'string'
+                  },
+                  {
+                      'name': 'firstname',
+                      'type': 'string'
+                  },
+                  {
+                      'name': 'middlename',
+                      'type': 'string'
+                  },
+                  {
+                      'name': 'lastname',
+                      'type': 'string'
+                  },
+                  {
+                      'name': 'fullname',
+                      'type': 'string'
+                  }
+              ],
+              xns : Roo.data,
+              '|xns' : 'Roo.data'
+             }
+            }
            }
           ]
          }