SimpleExcel.php
[Pman.Core] / Pman.Dialog.VerifyAccess.js
index d90f2a5..45f7613 100644 (file)
@@ -9,9 +9,10 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
 
  _strings : {
   'e2c9d024b79dfb48b42a7807206c6aed' :"Verify New IP Access",
-  'd41d8cd98f00b204e9800998ecf8427e' :"",
+  'a12a3079e14ced46e69ba52b8a90b21a' :"IP",
   'f6039d44b29456b20f8f373155ae4973' :"Username",
   '004bf6c9a40003140292e97330236c53' :"Action",
+  '5a787141d53b573ec9b86e900bfe0d79' :"Expire Date",
   'dfb790522fdea3859af206d32916fe77' :"User Agent",
   '70d9be9b139893aa6c69b5e77e614311' :"Confirm"
  },
@@ -66,12 +67,20 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
               
                   _this.data = res.data;
                   
+                  if(_this.data.status != 0){
+                      _this.dialog.hide();
+                      Roo.bootstrap.MessageBox.alert('Notice', 'This IP has been verified [' + _this.data.ip + ']');
+                      return;
+                  }
+                  
                   _this.form.setValues(_this.data);
                   
                   if(_this.data.status * 1 == 0){
                       _this.form.findField('status').reset();
                   }
                   
+                  _this.form.findField('expire_dt').reset();
+                  
                   _this.form.clearInvalid();
                   
                   return;
@@ -100,7 +109,7 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
             if(!_this.form.isValid()){
                 return;
             }
-            
+        
             _this.dialog.el.mask('Sending...');
             _this.form.doAction('submit');
             
@@ -132,6 +141,8 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
                 
                 _this.dialog.hide();
                 
+                Roo.bootstrap.MessageBox.alert('Notice', 'You have verified the IP [' + _this.data.ip + ']');
+                
                 return;
             }
             
@@ -184,6 +195,22 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
            }
           ]
          },
+         {
+          xtype : 'Column',
+          xs : 12,
+          xns : Roo.bootstrap,
+          '|xns' : 'Roo.bootstrap',
+          items  : [
+           {
+            xtype : 'Input',
+            fieldLabel : _this._strings['a12a3079e14ced46e69ba52b8a90b21a'] /* IP */,
+            name : 'ip',
+            readOnly : true,
+            xns : Roo.bootstrap,
+            '|xns' : 'Roo.bootstrap'
+           }
+          ]
+         },
          {
           xtype : 'Column',
           xs : 12,
@@ -227,7 +254,13 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
             listeners : {
              select : function (combo, record, index)
               {
+                  _this.expire_dt.allowBlank = true;
+                  _this.expire_dt.el.hide();
                   
+                  if(record.data.code == '-2'){
+                      _this.expire_dt.allowBlank = false;
+                      _this.expire_dt.el.show();
+                  }
               }
             },
             xns : Roo.bootstrap,
@@ -253,40 +286,30 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
           '|xns' : 'Roo.bootstrap',
           items  : [
            {
-            xtype : 'ComboBox',
+            xtype : 'DateField',
             allowBlank : false,
-            alwaysQuery : true,
-            displayField : 'value',
-            editable : false,
-            fieldLabel : _this._strings['004bf6c9a40003140292e97330236c53'] /* Action */,
-            forceSelection : true,
-            hiddenName : 'status',
+            fieldLabel : _this._strings['5a787141d53b573ec9b86e900bfe0d79'] /* Expire Date */,
+            format : 'Y-m-d',
             indicatorpos : 'right',
-            mode : 'local',
-            name : 'status_name',
-            selectOnFocus : true,
-            tpl : '<div class=\"roo-select2-result\"><b>{value}</b></div>',
-            triggerAction : 'all',
-            valueField : 'code',
+            name : 'expire_dt',
             listeners : {
-             select : function (combo, record, index)
+             render : function (_self)
               {
+                  _this.expire_dt = this;
+                  
+                  var d = new Date();
+                  
+                  d.setDate(d.getDate() - 1);
+              
+                  this.setStartDate(d);
+                  
+                  this.el.setVisibilityMode(Roo.Element.DISPLAY);
                   
+                  this.el.hide();
               }
             },
             xns : Roo.bootstrap,
-            '|xns' : 'Roo.bootstrap',
-            store : {
-             xtype : 'SimpleStore',
-             data : [
-                 ['1', 'Approve'],
-                 ['-2', 'Temporary'],
-                 ['-1', 'Reject']
-             ],
-             fields : [ 'code', 'value' ],
-             xns : Roo.data,
-             '|xns' : 'Roo.data'
-            }
+            '|xns' : 'Roo.bootstrap'
            }
           ]
          }
@@ -322,43 +345,6 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
         ]
        }
       ]
-     },
-     {
-      xtype : 'Row',
-      listeners : {
-       render : function (_self)
-        {
-            _this.error_row = this;
-            
-            this.el.setVisibilityMode(Roo.Element.DISPLAY);
-            
-            this.el.hide();
-        }
-      },
-      xns : Roo.bootstrap,
-      '|xns' : 'Roo.bootstrap',
-      items  : [
-       {
-        xtype : 'Column',
-        xs : 12,
-        xns : Roo.bootstrap,
-        '|xns' : 'Roo.bootstrap',
-        items  : [
-         {
-          xtype : 'Element',
-          html : _this._strings['d41d8cd98f00b204e9800998ecf8427e'] /*  */,
-          listeners : {
-           render : function (_self)
-            {
-                _this.text_el = _self;
-            }
-          },
-          xns : Roo.bootstrap,
-          '|xns' : 'Roo.bootstrap'
-         }
-        ]
-       }
-      ]
      }
     ]
    }  );