DataObjects/Core_person_signup.php
[Pman.Core] / Pman.Dialog.CoreEnum.js
index 418fba9..9897e40 100644 (file)
@@ -39,7 +39,7 @@ Pman.Dialog.CoreEnum = {
             background : true,
             closable : false,
             collapsible : false,
-            height : 100,
+            height : 150,
             modal : true,
             resizable : false,
             title : "Add / Edit Core Enum",
@@ -59,6 +59,13 @@ Pman.Dialog.CoreEnum = {
                                 actioncomplete : function (_self, action)
                                 {
                                   if (action.type == 'setdata') {
+                                
+                                        if((typeof(_this.data.etype) == 'undefined') || !_this.data.etype.length){
+                                            Roo.MessageBox.alert('Error', 'Missing etype');
+                                            _this.dialog.hide();
+                                            return;
+                                        }
+                                  
                                         if(_this.data.id){
                                             _this.dialog.el.mask("Loading");
                                             this.load({ method: 'GET', params: { '_id' : _this.data.id }}); 
@@ -92,19 +99,48 @@ Pman.Dialog.CoreEnum = {
                                 {
                                     xtype: 'TextField',
                                     xns: Roo.form,
+                                    actionMode : 'fieldEl',
                                     allowBlank : false,
                                     fieldLabel : 'Name',
+                                    hidden : true,
                                     name : 'name',
                                     width : 200
                                 },
                                 {
                                     xtype: 'TextField',
                                     xns: Roo.form,
+                                    listeners : {
+                                        keyup : function (_self, e)
+                                        {
+                                            _this.form.findField('name').setValue(this.getValue().replace(/[^a-z0-9]/ig, '').toUpperCase());
+                                            
+                                        }
+                                    },
                                     allowBlank : false,
-                                    fieldLabel : 'Industry Name',
+                                    fieldLabel : 'Display Name',
                                     name : 'display_name',
                                     width : 200
                                 },
+                                {
+                                    xtype: 'Checkbox',
+                                    xns: Roo.form,
+                                    fieldLabel : 'Active',
+                                    inputValue : 1,
+                                    name : 'active',
+                                    value : 0,
+                                    valueOff : 0
+                                },
+                                {
+                                    xtype: 'Hidden',
+                                    xns: Roo.form,
+                                    name : 'etype'
+                                },
+                                {
+                                    xtype: 'Hidden',
+                                    xns: Roo.form,
+                                    name : 'seqid',
+                                    value : 0
+                                },
                                 {
                                     xtype: 'Hidden',
                                     xns: Roo.form,
@@ -138,14 +174,13 @@ Pman.Dialog.CoreEnum = {
                     listeners : {
                         click : function() {
                         
-                            var name =     _this.form.findField('display_name').getValue();
+                            var name =     _this.form.findField('name').getValue();
                             name = name.toUpperCase().replace(/[^A-Z]+/g, '');
                             if (!name.length) {
                                 Roo.MessageBox.alert("Error","Please fill in a valid name");
                                 return;
                             }
                             _this.form.findField('name').setValue(name);
-                        
                          
                             _this.form.doAction('submit');