From 83061f79058ddddf7a888a4580c913d5caa18c91 Mon Sep 17 00:00:00 2001 From: Charles du Jeu Date: Thu, 17 Sep 2009 14:22:46 +0000 Subject: [PATCH] CoWorker Nature git-svn-id: https://svn.argeo.org/commons/trunk@2951 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- .../argeo/security/ria/UserEditorApplet.js | 12 +++- .../org/argeo/security/ria/UsersApplet.js | 6 +- .../ria/components/CoworkerNatureImpl.js | 48 +++++++++++++++ .../ria/components/SimpleUserNatureImpl.js | 59 ++++++++++--------- 4 files changed, 93 insertions(+), 32 deletions(-) create mode 100644 security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/components/CoworkerNatureImpl.js diff --git a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/UserEditorApplet.js b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/UserEditorApplet.js index 1960ff8dc..772cf2e7f 100644 --- a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/UserEditorApplet.js +++ b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/UserEditorApplet.js @@ -147,12 +147,19 @@ qx.Class.define("org.argeo.security.ria.UserEditorApplet", this.passGB.add(this.passPane.getContainer()); this.naturesTab = new qx.ui.tabview.TabView("top"); - this.simpleNature = new org.argeo.security.ria.components.SimpleUserNatureImpl(); + this.simpleNature = new org.argeo.security.ria.components.SimpleUserNatureImpl(); var page1 = new qx.ui.tabview.Page(this.simpleNature.getNatureLabel()); page1.setLayout(new qx.ui.layout.Dock()); page1.add(this.simpleNature.getContainer(), {edge:"center"}); this.naturesTab.add(page1); + + this.coWorkerNature = new org.argeo.security.ria.components.CoworkerNatureImpl(); + var page2 = new qx.ui.tabview.Page(this.coWorkerNature.getNatureLabel()); + page2.setLayout(new qx.ui.layout.Dock()); + page2.add(this.coWorkerNature.getContainer(), {edge:"center"}); + this.naturesTab.add(page2); + this.naturesGB.add(this.naturesTab, {edge:"center"}); }, @@ -170,6 +177,9 @@ qx.Class.define("org.argeo.security.ria.UserEditorApplet", this.simpleNature.addListener("modified", function(){ this.setModified(true); }, this); + this.coWorkerNature.addListener("modified", function(){ + this.setModified(true); + }, this); }, _initializeGroupBox: function(groupBox){ diff --git a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/UsersApplet.js b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/UsersApplet.js index a44d3bb06..f5e13c121 100644 --- a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/UsersApplet.js +++ b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/UsersApplet.js @@ -133,18 +133,18 @@ qx.Class.define("org.argeo.security.ria.UsersApplet", this.getCommands()["edit_user"].command.execute(); }, this); - this.setGuiMode("chooser"); + this.setGuiMode("clear"); }, _applyGuiMode : function(newMode, oldMode){ this.table.getSelectionModel().clearSelection(); this.resetHiddenRows(); if(newMode == "filter"){ - this.table.getSelectionModel().setSelectionMode(qx.ui.table.selection.Model.SINGLE_INTERVAL_SELECTION); + this.table.getSelectionModel().setSelectionMode(qx.ui.table.selection.Model.SINGLE_SELECTION); }else if(newMode == "chooser"){ this.table.getSelectionModel().setSelectionMode(qx.ui.table.selection.Model.MULTIPLE_INTERVAL_SELECTION_TOGGLE); }else if(newMode == "clear"){ - this.table.getSelectionModel().setSelectionMode(qx.ui.table.selection.Model.SINGLE_INTERVAL_SELECTION); + this.table.getSelectionModel().setSelectionMode(qx.ui.table.selection.Model.SINGLE_SELECTION); } }, diff --git a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/components/CoworkerNatureImpl.js b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/components/CoworkerNatureImpl.js new file mode 100644 index 000000000..da11c7247 --- /dev/null +++ b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/components/CoworkerNatureImpl.js @@ -0,0 +1,48 @@ +qx.Class.define("org.argeo.security.ria.components.CoworkerNatureImpl", { + extend : org.argeo.security.ria.components.SimpleUserNatureImpl, + properties : { + natureType : { + refine : true, + init : "Coworker" + } + }, + + construct : function(){ + this.base(arguments); + }, + + members : { + _createGui : function(){ + var grid = new qx.ui.layout.Grid(5,5); + this.setLayout(grid); + grid.setColumnFlex(0,1); + grid.setColumnAlign(0,"right", "middle"); + grid.setColumnFlex(1,3); + + this.descField = new qx.ui.form.TextField(); + this.mobileField = new qx.ui.form.TextField(); + this.phoneField = new qx.ui.form.TextField(); + + var labels = ["Description", "Mobile Phone", "Home Phone"]; + this.fields = { + "description" : this.descField, + "mobile": this.mobileField, + "telephoneNumber" : this.phoneField + }; + + for(var i=0;i