Pman.Dialog.VerifyAccess.bjs
[Pman.Core] / Pman.Dialog.VerifyAccess.js
index c37ca8c..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');
             
@@ -183,14 +185,7 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
             '|xns' : 'Roo.bootstrap'
            }
           ]
-         }
-        ]
-       },
-       {
-        xtype : 'Row',
-        xns : Roo.bootstrap,
-        '|xns' : 'Roo.bootstrap',
-        items  : [
+         },
          {
           xtype : 'Column',
           xs : 12,
@@ -208,14 +203,7 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
             '|xns' : 'Roo.bootstrap'
            }
           ]
-         }
-        ]
-       },
-       {
-        xtype : 'Row',
-        xns : Roo.bootstrap,
-        '|xns' : 'Roo.bootstrap',
-        items  : [
+         },
          {
           xtype : 'Column',
           xs : 12,
@@ -235,13 +223,19 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
             mode : 'local',
             name : 'status_name',
             selectOnFocus : true,
-            tpl : '<div class=\"roo-select2-result\">{value}</div>',
+            tpl : '<div class=\"roo-select2-result\"><b>{value}</b></div>',
             triggerAction : 'all',
             valueField : 'code',
             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,
@@ -250,6 +244,7 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
              xtype : 'SimpleStore',
              data : [
                  ['1', 'Approve'],
+                 ['-2', 'Temporary'],
                  ['-1', 'Reject']
              ],
              fields : [ 'code', 'value' ],
@@ -258,6 +253,38 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, {
             }
            }
           ]
+         },
+         {
+          xtype : 'Column',
+          xs : 12,
+          xns : Roo.bootstrap,
+          '|xns' : 'Roo.bootstrap',
+          items  : [
+           {
+            xtype : 'DateField',
+            allowBlank : false,
+            fieldLabel : _this._strings['5a787141d53b573ec9b86e900bfe0d79'] /* Expire Date */,
+            indicatorpos : 'right',
+            name : 'expire_dt',
+            listeners : {
+             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'
+           }
+          ]
          }
         ]
        },