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

svn-commits at proxmox.com svn-commits at proxmox.com
Thu Jul 14 07:12:59 CEST 2011


Author: dietmar
Date: 2011-07-14 07:12:58 +0200 (Thu, 14 Jul 2011)
New Revision: 6297

Modified:
   pve-manager/pve2/ChangeLog
   pve-manager/pve2/www/manager/dc/UserEdit.js
Log:
	* www/manager/dc/UserEdit.js: added expire field, modify expire
	value on load to make it work with datefield.



Modified: pve-manager/pve2/ChangeLog
===================================================================
--- pve-manager/pve2/ChangeLog	2011-07-14 04:16:59 UTC (rev 6296)
+++ pve-manager/pve2/ChangeLog	2011-07-14 05:12:58 UTC (rev 6297)
@@ -1,3 +1,8 @@
+2011-07-14  Proxmox Support Team  <support at proxmox.com>
+
+	* www/manager/dc/UserEdit.js: added expire field, modify expire
+	value on load to make it work with datefield.
+
 2011-07-13  Proxmox Support Team  <support at proxmox.com>
 
 	* www/manager/form/Checkbox.js: new deleteDefaultValue option to

Modified: pve-manager/pve2/www/manager/dc/UserEdit.js
===================================================================
--- pve-manager/pve2/www/manager/dc/UserEdit.js	2011-07-14 04:16:59 UTC (rev 6296)
+++ pve-manager/pve2/www/manager/dc/UserEdit.js	2011-07-14 05:12:58 UTC (rev 6297)
@@ -37,6 +37,14 @@
                 name: 'email',
                 fieldLabel: 'Email',
 		vtype: 'email'
+            },
+            {
+                xtype: 'datefield',
+                name: 'expire',
+		emptyText: 'never',
+		format: 'Y-m-d',
+		submitFormat: 'U',
+                fieldLabel: 'Expiration'
             }
         ];
 
@@ -62,15 +70,16 @@
             });
         }
 
+	var ipanel = Ext.create('PVE.panel.InputPanel', {
+	    column1: column1,
+	    column2: column2
+	});
+
         Ext.applyIf(me, {
             title: me.create ? "Create User" : "Edit User '" + me.userid + "'",
             url: url,
             method: method,
-	    items: {
-                xtype: 'inputpanel',
-		column1: column1,
-		column2: column2
-	    }
+	    items: [ ipanel ]
         });
 
         me.callParent();
@@ -78,13 +87,10 @@
         if (!me.create) {
             me.load({
                 success: function(form, action) {
-//                    if (action.result.data.type !== me.userid) {
-//                        var msg = "Got unexpected userid";
-//                        Ext.Msg.alert("Load failed", msg, function() {
-//                            me.close();
-//                        });
-//                        return;
-//                    }
+		    var data = action.result.data;
+		    if (Ext.isDefined(data.expire)) {
+			ipanel.setValues({ expire: new Date(data.expire * 1000) });
+		    }
                 }
             });
         }




More information about the pve-devel mailing list