From fb221bc4c18e8f943cb0510bd8451c9692e7d2b4 Mon Sep 17 00:00:00 2001 From: jensp Date: Mon, 18 Oct 2010 09:38:47 +0000 Subject: [PATCH] Verschiedene kleinere Fehlerkorrekturen. git-svn-id: https://svn.libreccm.org/ccm/trunk@582 8810af33-2d31-482b-a856-94f89814c4df --- .../ContenttypesResources.properties | 1 + .../ContenttypesResources_de.properties | 1 + ...GenericOrganizationalUnitPersonsTable.java | 6 ++--- .../cms/contenttypes/SciDepartment.java | 22 +++++++++++++++---- .../cms/contenttypes/SciOrganization.java | 9 +++++--- .../cms/contenttypes/SciProject.java | 9 ++++++-- .../ui/SciDepartmentOrganizationSheet.java | 17 +++++++++----- .../ui/SciDepartmentProjectsTable.java | 2 +- .../ui/SciDepartmentSuperDepartmentSheet.java | 18 ++++++++++----- .../ui/SciOrganizationDepartmentsTable.java | 2 +- .../ui/SciOrganizationProjectsTable.java | 2 +- .../ui/SciOrganizationResources.properties | 2 +- .../ui/SciOrganizationResources_de.properties | 2 +- .../ui/SciProjectOrganizationsTable.java | 6 ++--- .../ui/SciProjectSuperProjectSheet.java | 8 +------ 15 files changed, 69 insertions(+), 38 deletions(-) diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources.properties b/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources.properties index efaaef669..0c79122b2 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources.properties +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources.properties @@ -113,3 +113,4 @@ cms.contenttypes.ui.genericorgaunit.select_person=Select person cms.contenttypes.ui.contact.contactEntry.none=No contact information yet cms.contenttypes.ui.genericorgaunit.person.role=Role cms.ui.delete=Remove +sciorganization.ui.department.project.confirm_remove=Are you sure to remove this project? diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources_de.properties b/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources_de.properties index 4209f6f5b..e925f4707 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources_de.properties +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources_de.properties @@ -115,3 +115,4 @@ cms.contenttypes.ui.genericorgaunit.addendum=Zusatz cms.contenttypes.ui.genericorgaunit.select_person=Person ausw\u00e4hlen cms.contenttypes.ui.genericorgaunit.person.role=Rolle cms.ui.delete=Entfernen +sciorganization.ui.department.project.confirm_remove=Wollen Sie dieses Projekt wirklich entfernen? diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonsTable.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonsTable.java index fbd065ae4..47eaac45b 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonsTable.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonsTable.java @@ -177,7 +177,7 @@ public class GenericOrganizationalUnitPersonsTable extends Table implements Object key, int row, int col) { - com.arsdigita.cms.SecurityManager securityManager = Utilities. + /*com.arsdigita.cms.SecurityManager securityManager = Utilities. getSecurityManager(state); GenericOrganizationalUnit orgaunit = (GenericOrganizationalUnit) m_itemModel. getSelectedObject( @@ -189,9 +189,9 @@ public class GenericOrganizationalUnitPersonsTable extends Table implements if (canEdit) { ControlLink link = new ControlLink(value.toString()); return link; - } else { + } else {*/ return new Label(value.toString()); - } + // } } } diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartment.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartment.java index bfdede493..2f4ce6b1a 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartment.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartment.java @@ -158,11 +158,16 @@ public class SciDepartment extends GenericOrganizationalUnit { SciDepartment oldSuperDepartment; oldSuperDepartment = getSuperDepartment(); - remove(SUPER_DEPARTMENT, oldSuperDepartment); + if (oldSuperDepartment != null) { + remove(SUPER_DEPARTMENT, oldSuperDepartment); + } if (null != department) { Assert.exists(department, SciDepartment.class); - add(SUPER_DEPARTMENT, department); + DataObject link = add(SUPER_DEPARTMENT, department); + link.set(SUBDEPARTMENT_ORDER, + Integer.valueOf((int) department.getSubDepartments().size())); + link.save(); } } @@ -187,11 +192,16 @@ public class SciDepartment extends GenericOrganizationalUnit { SciOrganization oldOrganization; oldOrganization = getOrganization(); - remove(ORGANIZATION, oldOrganization); + if (oldOrganization != null) { + remove(ORGANIZATION, oldOrganization); + } if (null != orga) { Assert.exists(orga, SciOrganization.class); - add(ORGANIZATION, orga); + DataObject link = add(ORGANIZATION, orga); + link.set(SciOrganization.DEPARTMENT_ORDER, + Integer.valueOf((int) orga.getDepartments().size())); + link.save(); } } @@ -207,6 +217,7 @@ public class SciDepartment extends GenericOrganizationalUnit { link.set(SUBDEPARTMENT_ORDER, Integer.valueOf((int) getSubDepartments(). size())); + link.save(); } public void removeSubDepartment(SciDepartment subDepartment) { @@ -231,6 +242,9 @@ public class SciDepartment extends GenericOrganizationalUnit { link.set(PROJECT_ORDER, Integer.valueOf((int) getProjects().size())); + link.set(SciProject.DEPARTMENTS_ORDER, + Integer.valueOf((int) project.getDepartments().size())); + link.save(); } public void removeProject(SciProject project) { diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganization.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganization.java index f363c4b4b..3aad68a65 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganization.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganization.java @@ -61,7 +61,7 @@ import java.math.BigDecimal; public class SciOrganization extends GenericOrganizationalUnit { public static final String ORGANIZATION_SHORT_DESCRIPTION = - "organizationShortDescription"; + "organizationShortDescription"; public static final String ORGANIZATION_DESCRIPTION = "organizationDescription"; public static final String DEPARTMENTS = "departments"; @@ -129,6 +129,7 @@ public class SciOrganization extends GenericOrganizationalUnit { link.set(DEPARTMENT_ORDER, Integer.valueOf((int) getDepartments().size())); + link.save(); } public void removeDepartment(SciDepartment department) { @@ -150,8 +151,10 @@ public class SciOrganization extends GenericOrganizationalUnit { Assert.exists(project, SciProject.class); DataObject link = add(PROJECTS, project); - - link.set(PROJECT_ORDER, Integer.valueOf((int) getProjects().size())); + link.set(PROJECT_ORDER, Integer.valueOf((int) getProjects().size())); + link.set(SciProject.ORGANIZATIONS_ORDER, Integer.valueOf((int) project. + getOrganizations().size())); + link.save(); } public void removeProject(SciProject project) { diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProject.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProject.java index 280ce0a48..1bfa20428 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProject.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProject.java @@ -73,10 +73,10 @@ public class SciProject extends GenericOrganizationalUnit { public static final String SUBPROJECTS = "subProjects"; public static final String SUBPROJECT_ORDER = "subProjectOrder"; public static final String ORGANIZATIONS = "organization"; - public static final String ORGANIZATIONS_ORDER = "organization"; + public static final String ORGANIZATIONS_ORDER = "organizationOrder"; public static final String SUPER_PROJECT = "superProject"; public static final String DEPARTMENTS = "department"; - public static final String DEPARTMENTS_ORDER = "department"; + public static final String DEPARTMENTS_ORDER = "departmentOrder"; public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.SciProject"; private static final SciOrganizationConfig s_config = @@ -163,6 +163,7 @@ public class SciProject extends GenericOrganizationalUnit { link.set(SUBPROJECT_ORDER, Integer.valueOf((int) getSubProjects().size())); + link.save(); } public void removeSubProject(SciProject project) { @@ -189,6 +190,9 @@ public class SciProject extends GenericOrganizationalUnit { link.set(ORGANIZATIONS_ORDER, Integer.valueOf((int) getOrganizations().size())); + link.set(SciOrganization.PROJECT_ORDER, + Integer.valueOf((int) orga.getProjects().size())); + link.save(); } public void removeOrganization(SciOrganization orga) { @@ -213,6 +217,7 @@ public class SciProject extends GenericOrganizationalUnit { link.set(DEPARTMENTS_ORDER, Integer.valueOf((int) getDepartments().size())); + link.save(); } public void removeDepartment(SciDepartment department) { diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentOrganizationSheet.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentOrganizationSheet.java index e95f3fbe5..959b1d33c 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentOrganizationSheet.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentOrganizationSheet.java @@ -108,12 +108,18 @@ public class SciDepartmentOrganizationSheet private Table m_table; private SciOrganization m_orga; + private boolean m_done; public SciDepartmentOrganizationSheetModel(Table table, PageState state, SciDepartment department) { m_table = table; m_orga = department.getOrganization(); + if (m_orga == null) { + m_done = false; + } else { + m_done = true; + } } public int getColumnCount() { @@ -123,11 +129,11 @@ public class SciDepartmentOrganizationSheet public boolean nextRow() { boolean ret; - if (null == m_orga) { - ret = false; - } else { + if (m_done) { ret = true; - m_orga = null; + m_done = false; + } else { + ret = false; } return ret; @@ -139,7 +145,8 @@ public class SciDepartmentOrganizationSheet return m_orga.getTitle(); case 1: return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.organization.remove"); + "sciorganization.ui.department.organization.remove"). + localize(); default: return null; } diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsTable.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsTable.java index 756173138..d2fe9cdcc 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsTable.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsTable.java @@ -241,7 +241,7 @@ public class SciDepartmentProjectsTable link.setConfirmation((String) SciOrganizationGlobalizationUtil. globalize( "sciorganization.ui.department.project." - + ".confirm_remove"). + + "confirm_remove"). localize()); return link; } else { diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentSheet.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentSheet.java index 3e089b8f8..7b47314db 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentSheet.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentSheet.java @@ -106,12 +106,18 @@ public class SciDepartmentSuperDepartmentSheet private Table m_table; private SciDepartment m_superDepartment; + private boolean m_done; public SciDepartmentSuperDepartmentSheetModel(Table table, PageState state, SciDepartment department) { m_table = table; m_superDepartment = department.getSuperDepartment(); + if (m_superDepartment == null) { + m_done = false; + } else { + m_done = true; + } } @Override @@ -123,11 +129,11 @@ public class SciDepartmentSuperDepartmentSheet public boolean nextRow() { boolean ret; - if (null == m_superDepartment) { - ret = false; - } else { + if (m_done) { ret = true; - m_superDepartment = null; + m_done = false; + } else { + ret = false; } return ret; @@ -140,7 +146,8 @@ public class SciDepartmentSuperDepartmentSheet return m_superDepartment.getTitle(); case 1: return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.superdepartment.remove"); + "sciorganization.ui.department.superdepartment.remove"). + localize(); default: return null; } @@ -214,7 +221,6 @@ public class SciDepartmentSuperDepartmentSheet TableColumn column = getColumnModel().get(event.getColumn().intValue()); if (column.getHeaderKey().toString().equals(TABLE_COL_EDIT)) { - } else if (column.getHeaderKey().toString().equals(TABLE_COL_DEL)) { department.setSuperDepartment(null); } diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDepartmentsTable.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDepartmentsTable.java index 65cbb6b78..7445e787a 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDepartmentsTable.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDepartmentsTable.java @@ -241,7 +241,7 @@ public class SciOrganizationDepartmentsTable link.setConfirmation((String) SciOrganizationGlobalizationUtil. globalize( "sciorganization.ui.organization.department." - + ".confirm_remove"). + + "confirm_remove"). localize()); return link; } else { diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationProjectsTable.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationProjectsTable.java index 75afdf5bd..ab335fb1a 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationProjectsTable.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationProjectsTable.java @@ -242,7 +242,7 @@ public class SciOrganizationProjectsTable link.setConfirmation((String) SciOrganizationGlobalizationUtil. globalize( "sciorganization.ui.organization.project." - + ".confirm_remove"). + + "confirm_remove"). localize()); return link; } else { diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationResources.properties b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationResources.properties index 1023c613a..c234d2c6b 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationResources.properties +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationResources.properties @@ -88,7 +88,7 @@ sciorganization.ui.organization.description=Description sciorganization.ui.organization.description.upload=Upload description sciorganization.ui.organization.description.upload.mimetype=Type of file sciorganization.ui.project.select_superproject=Select superior project -sciorganization.ui.department.setSuperDepartment=Set superior project +sciorganization.ui.department.setSuperDepartment=Set superior department sciorganization.ui.department.superdepartment_none=No superior department found sciorganization.ui.department.superdepartment=Superior department sciorganization.ui.department.superdepartment.remove=Remove superior department diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationResources_de.properties b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationResources_de.properties index 7a6164d7f..191a556e9 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationResources_de.properties +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationResources_de.properties @@ -88,7 +88,7 @@ sciorganization.ui.organization.description=Beschreibung sciorganization.ui.organization.description.upload=Beschriebung hochladen sciorganization.ui.organization.description.upload.mimetype=Dateityp sciorganization.ui.project.select_superproject=\u00dcbergeordnetes Projekt ausw\u00e4hlen -sciorganization.ui.department.setSuperDepartment=\u00dcbergeordnetes Projekt setzen +sciorganization.ui.department.setSuperDepartment=\u00dcbergeordnete Abteilung setzen sciorganization.ui.department.superdepartment_none=Keine \u00fcbergeordnete Abteilung gefunden sciorganization.ui.department.superdepartment=\u00dcbergeordnete Abteilung sciorganization.ui.department.superdepartment.remove=\u00dcbergeordnete Abteilung entfernen diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectOrganizationsTable.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectOrganizationsTable.java index 1fe0f2028..463439037 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectOrganizationsTable.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectOrganizationsTable.java @@ -294,10 +294,10 @@ public class SciProjectOrganizationsTable SciProject project = (SciProject) m_itemModel.getSelectedObject( state); - SciProjectSubProjectsCollection subProjects = - project.getSubProjects(); + SciProjectOrganizationsCollection orgas = + project.getOrganizations(); - if ((subProjects.size() - 1) == row) { + if ((orgas.size() - 1) == row) { Label label = new Label(""); return label; } else { diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectSheet.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectSheet.java index 9dbf9c833..739c2cad0 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectSheet.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectSheet.java @@ -132,13 +132,7 @@ public class SciProjectSuperProjectSheet public boolean nextRow() { boolean ret; - - /*if (m_superProject == null) { - ret = false; - } else { - ret = true; - m_superProject = null; - }*/ + if (m_done) { logger.debug("Returning true for nextRow()"); ret = true;