Pman.Dialog.VerifyAccess.bjs
[Pman.Core] / Pman.Dialog.VerifyAccess.js
index d90f2a5..ef4056a 100644 (file)
@@ -12,6 +12,7 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
   'd41d8cd98f00b204e9800998ecf8427e' :"",
   'f6039d44b29456b20f8f373155ae4973' :"Username",
   '004bf6c9a40003140292e97330236c53' :"Action",
+  '5a787141d53b573ec9b86e900bfe0d79' :"Expire Date",
   'dfb790522fdea3859af206d32916fe77' :"User Agent",
   '70d9be9b139893aa6c69b5e77e614311' :"Confirm"
  },
@@ -100,7 +101,8 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
             if(!_this.form.isValid()){
                 return;
             }
-            
+            Roo.log('submit');
+            return;
             _this.dialog.el.mask('Sending...');
             _this.form.doAction('submit');
             
@@ -227,7 +229,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 +261,28 @@ 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 */,
             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'
            }
           ]
          }