Pman.Dialog.CoreCompanies.bjs
[Pman.Core] / Pman.Dialog.CoreCompanies.js
index 2ee9ff1..d4d2c2a 100644 (file)
@@ -30,6 +30,26 @@ Pman.Dialog.CoreCompanies = {
         this.dialog = Roo.factory({
             xtype: 'LayoutDialog',
             xns: Roo,
+            listeners : {
+                beforeshow : function (_self)
+                {
+                    if (data.isOwner || !Pman.Login.isOwner()) {
+                        this.dialog.setTitle("Your Company Details");
+                        if (this.form.findField('comptype')) {
+                            this.form.findField('comptype').disable();
+                        }
+                        
+                        
+                        
+                        
+                    } else {
+                        this.dialog.setTitle(data.id ? "Edit Company" : "Add Company");
+                        if (this.form.findField('comptype')) {
+                            this.form.findField('comptype').enable();
+                        }
+                    }
+                }
+            },
             autoCreate : 'true',
             closable : false,
             collapsible : false,