From 3a73f771e6a88ab25f72e0ec2bc284da07675098 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 12 Sep 2012 14:35:32 +0800 Subject: [PATCH] Pman.Dialog.CoreCompanies.bjs Pman.Dialog.CoreCompanies.js --- Pman.Dialog.CoreCompanies.bjs | 3 +++ Pman.Dialog.CoreCompanies.js | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/Pman.Dialog.CoreCompanies.bjs b/Pman.Dialog.CoreCompanies.bjs index 470697ca..64cb919b 100644 --- a/Pman.Dialog.CoreCompanies.bjs +++ b/Pman.Dialog.CoreCompanies.bjs @@ -6,6 +6,9 @@ "path": "/home/chris/gitlive/Pman.Core/Pman.Dialog.CoreCompanies.bjs", "items": [ { + "listeners": { + "beforeshow": "function (_self)\n{\n if (data.isOwner || !Pman.Login.isOwner()) {\n this.dialog.setTitle(\"Your Company Details\");\n if (this.form.findField('comptype')) {\n this.form.findField('comptype').disable();\n }\n \n \n \n \n } else {\n this.dialog.setTitle(data.id ? \"Edit Company\" : \"Add Company\");\n if (this.form.findField('comptype')) {\n this.form.findField('comptype').enable();\n }\n }\n}" + }, "autoCreate": "true", "closable": false, "collapsible": false, diff --git a/Pman.Dialog.CoreCompanies.js b/Pman.Dialog.CoreCompanies.js index 2ee9ff10..d4d2c2a4 100644 --- a/Pman.Dialog.CoreCompanies.js +++ b/Pman.Dialog.CoreCompanies.js @@ -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, -- 2.39.2