X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=Pman.Dialog.VerifyAccess.js;h=45f7613b9bc3bbe08e0ea2019abab9bcb1ddb7a6;hp=b55492a94d7a66ae4ee05f4bcf9eb3f9c8a7484b;hb=refs%2Fheads%2Fwip_alan_T5884_add_photo_to_report;hpb=68b92bfa791ec38cd3065479f331fe4b568202e3 diff --git a/Pman.Dialog.VerifyAccess.js b/Pman.Dialog.VerifyAccess.js index b55492a9..45f7613b 100644 --- a/Pman.Dialog.VerifyAccess.js +++ b/Pman.Dialog.VerifyAccess.js @@ -9,7 +9,7 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, { _strings : { 'e2c9d024b79dfb48b42a7807206c6aed' :"Verify New IP Access", - 'd41d8cd98f00b204e9800998ecf8427e' :"", + 'a12a3079e14ced46e69ba52b8a90b21a' :"IP", 'f6039d44b29456b20f8f373155ae4973' :"Username", '004bf6c9a40003140292e97330236c53' :"Action", '5a787141d53b573ec9b86e900bfe0d79' :"Expire Date", @@ -67,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; @@ -101,7 +109,7 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, { if(!_this.form.isValid()){ return; } - + _this.dialog.el.mask('Sending...'); _this.form.doAction('submit'); @@ -133,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; } @@ -185,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, @@ -263,6 +289,7 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, { xtype : 'DateField', allowBlank : false, fieldLabel : _this._strings['5a787141d53b573ec9b86e900bfe0d79'] /* Expire Date */, + format : 'Y-m-d', indicatorpos : 'right', name : 'expire_dt', listeners : { @@ -270,7 +297,11 @@ Roo.apply(Pman.Dialog.VerifyAccess.prototype, { { _this.expire_dt = this; - this.setStartDate(new Date()); + var d = new Date(); + + d.setDate(d.getDate() - 1); + + this.setStartDate(d); this.el.setVisibilityMode(Roo.Element.DISPLAY); @@ -314,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' - } - ] - } - ] } ] } );