DataObjects/Core_domain.php
[Pman.Core] / Pman.Dialog.PersonEditor.js
index ca8a5dd..dc2bb32 100644 (file)
@@ -90,7 +90,7 @@ Pman.Dialog.PersonEditor.prototype = {
                         var data = _this.data;
                         // we dont have  a form where company name is sent in - and is editable..
                         //this.form.findField('office_id')
-                        if(!data.countries){
+                        if(!data.countries && _this.form.findField('countries')){
                             _this.form.findField('countries').setValue();// set empty array by default...
                         }
                         
@@ -172,10 +172,16 @@ Pman.Dialog.PersonEditor.prototype = {
         this.loadItemTypes();
         Roo.each(this.itemList, function(il) {
             if (typeof(il) != 'object') {
+                // no permission for Core offices.. - can not show department...
+                if (il == 'office_id_name' && !Pman.hasPerm('Core.Offices','S')) {
+                    return true;
+                }
+                
                 _this.form.addxtype(_this.itemTypes[il]);
                 return true;
             }
             _this.form.addxtype(Roo.apply(il, _this.itemTypes[il.name]));
+            return true;
             
         });
         var ef = this.dialog.getLayout().getEl().createChild({tag: 'div'});
@@ -511,6 +517,25 @@ Pman.Dialog.PersonEditor.prototype = {
                 xtype : 'TextField',
                 width : 220
             },
+            secure_passowrd : {
+                name : 'secure_passowrd',
+                fieldLabel : "Secure passwords",
+                inputValue : 1,
+                valueOff : 0,
+                checked : true,
+                xtype : 'Checkbox',
+                xns : Roo.form,
+                width : 220,
+                listeners : {
+                    check : function (_self, checked) {
+                        this.form.findField('passwd1').insecure = false;
+                        
+                        if(!checked){
+                            this.form.findField('passwd1').insecure = true;
+                        }
+                    }
+                }
+            },
             project_id_fs : {
                 xtype : 'FieldSetEx',
                 name: 'project_id_fs',