[pve-devel] r6307 - in pve-manager/pve2: . www/manager/dc

svn-commits at proxmox.com svn-commits at proxmox.com
Fri Jul 15 07:26:01 CEST 2011


Author: dietmar
Date: 2011-07-15 07:26:01 +0200 (Fri, 15 Jul 2011)
New Revision: 6307

Modified:
   pve-manager/pve2/ChangeLog
   pve-manager/pve2/www/manager/dc/UserEdit.js
Log:
	* www/manager/dc/UserEdit.js: use onGetValues to workaround ExtJS
	datefield behaviour, set expired to 'never' instead of '1970-01-01'



Modified: pve-manager/pve2/ChangeLog
===================================================================
--- pve-manager/pve2/ChangeLog	2011-07-15 04:31:44 UTC (rev 6306)
+++ pve-manager/pve2/ChangeLog	2011-07-15 05:26:01 UTC (rev 6307)
@@ -1,3 +1,8 @@
+2011-07-15  Proxmox Support Team  <support at proxmox.com>
+
+	* www/manager/dc/UserEdit.js: use onGetValues to workaround ExtJS
+	datefield behaviour, set expired to 'never' instead of '1970-01-01'
+
 2011-07-14  Seth Lauzon  <seth.lauzon at gmail.com>
 
 	* www/manager/dc/UserEdit.js: impl. set groups, impl. comments

Modified: pve-manager/pve2/www/manager/dc/UserEdit.js
===================================================================
--- pve-manager/pve2/www/manager/dc/UserEdit.js	2011-07-15 04:31:44 UTC (rev 6306)
+++ pve-manager/pve2/www/manager/dc/UserEdit.js	2011-07-15 05:26:01 UTC (rev 6307)
@@ -122,7 +122,16 @@
 
 	var ipanel = Ext.create('PVE.panel.InputPanel', {
 	    column1: column1,
-	    column2: column2
+	    column2: column2,
+	    onGetValues: function(values) {
+		// hack: ExtJS datefield does not submit 0, so we need to set that
+		if (!values.expire) {
+		    values.expire = 0;
+		}
+
+		return values;
+	    },
+
 	});
 
         Ext.applyIf(me, {
@@ -139,7 +148,12 @@
                 success: function(form, action) {
 		    var data = action.result.data;
 		    if (Ext.isDefined(data.expire)) {
-			ipanel.setValues({ expire: new Date(data.expire * 1000) });
+			if (data.expire) {
+			    ipanel.setValues({ expire: new Date(data.expire * 1000) });
+			} else {
+			    // display 'never' instead of '1970-01-01'
+			    ipanel.setValues({ expire: '' });
+			}
 		    }
                 }
             });




More information about the pve-devel mailing list