]> git.mxchange.org Git - jjobs-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Mon, 11 May 2020 01:12:04 +0000 (03:12 +0200)
committerRoland Häder <roland@mxchange.org>
Wed, 10 Jun 2020 17:58:22 +0000 (19:58 +0200)
- since departments, headquarters and branch offices cannot link to employes,
  so also the view navigation rules must reflect this. Employees can have a
  relationship to any these 3 entities and would lead to endless loop
- introduced adminDepartmentActionController instead of without "Action", let
  us keep these empty ("dead") backing beans around, they may one day be filled
  with life again. Or they will be removed if no purpose could be found.
- closed some TODOs in views where p:fieldset allows a title attribute
- also a ui:fragment can be avoided when p:fieldset allows a render attribute
- added view for administrative editing of departments
- removed double // NOI18N strings (ops?) which is for some language string
  scanning and translation tools to ignore these lines (exception messages
  should normally not show up to the user).

Signed-off-by: Roland Häder <roland@mxchange.org>
25 files changed:
src/java/org/mxchange/jjobs/beans/business/branchoffice/JobsAdminBranchOfficeWebRequestController.java
src/java/org/mxchange/jjobs/beans/business/branchoffice/action/JobsAdminDepartmentActionWebRequestBean.java [new file with mode: 0644]
src/java/org/mxchange/jjobs/beans/business/branchoffice/action/JobsAdminDepartmentActionWebRequestController.java [new file with mode: 0644]
src/java/org/mxchange/jjobs/beans/business/department/JobsAdminDepartmentWebRequestBean.java
src/java/org/mxchange/jjobs/beans/business/department/action/JobsAdminBranchOfficeActionWebRequestBean.java
src/java/org/mxchange/jjobs/beans/business/department/list/JobsDepartmentListWebViewBean.java
src/java/org/mxchange/jjobs/beans/business/headquarter/action/JobsAdminHeadquarterActionWebRequestBean.java
src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestBean.java
src/java/org/mxchange/jjobs/beans/contact/list/JobsContactListWebViewBean.java
src/java/org/mxchange/jjobs/beans/contact/mobile/JobsAdminContactMobileWebRequestBean.java
src/java/org/mxchange/jjobs/beans/contact/phone/JobsAdminContactPhoneWebRequestBean.java
src/java/org/mxchange/localization/generic_de_DE.properties
src/java/org/mxchange/localization/generic_en_US.properties
web/WEB-INF/faces-config.xml
web/WEB-INF/resources/tags/admin/form_data/contact/admin_form_contact_data.tpl
web/WEB-INF/resources/tags/admin/form_data/user/admin_form_user_data.tpl
web/WEB-INF/templates/admin/branch_office/admin_form_branch_office_data.tpl
web/WEB-INF/templates/admin/department/admin_form_department_data.tpl
web/WEB-INF/templates/admin/employee/admin_form_employee_data.tpl
web/WEB-INF/templates/admin/headquarter/admin_form_headquarter.tpl
web/admin/branch_office/admin_branch_office_list.xhtml
web/admin/department/admin_department_edit.xhtml [new file with mode: 0644]
web/admin/department/admin_department_list.xhtml
web/admin/headquarter/admin_headquarter_list.xhtml
web/admin/user/admin_user_list.xhtml

index bf2be0d57adb53244e0a715d3b54722f33647ad4..1d62624da59b2e4c66433ae170f2d64558760123 100644 (file)
@@ -19,7 +19,7 @@ package org.mxchange.jjobs.beans.business.branchoffice;
 import java.io.Serializable;
 
 /**
- * An interface for administrative branch office controller
+ * An interface for administrative department controller
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
diff --git a/src/java/org/mxchange/jjobs/beans/business/branchoffice/action/JobsAdminDepartmentActionWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/business/branchoffice/action/JobsAdminDepartmentActionWebRequestBean.java
new file mode 100644 (file)
index 0000000..6042220
--- /dev/null
@@ -0,0 +1,412 @@
+/*
+ * Copyright (C) 2017 - 2020 Free Software Foundation
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.beans.business.department.action;
+
+import java.text.MessageFormat;
+import java.util.Objects;
+import javax.ejb.EJB;
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.event.Event;
+import javax.enterprise.inject.Any;
+import javax.faces.FacesException;
+import javax.faces.application.FacesMessage;
+import javax.inject.Inject;
+import javax.inject.Named;
+import org.mxchange.jcontacts.model.contact.Contact;
+import org.mxchange.jcontactsbusiness.events.department.added.AdminDepartmentAddedEvent;
+import org.mxchange.jcontactsbusiness.events.department.added.ObservableAdminDepartmentAddedEvent;
+import org.mxchange.jcontactsbusiness.events.department.updated.AdminDepartmentUpdatedEvent;
+import org.mxchange.jcontactsbusiness.events.department.updated.ObservableAdminDepartmentUpdatedEvent;
+import org.mxchange.jcontactsbusiness.exceptions.department.DepartmentAlreadyAddedException;
+import org.mxchange.jcontactsbusiness.exceptions.department.DepartmentNotFoundException;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
+import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
+import org.mxchange.jcontactsbusiness.model.department.AdminDepartmentSessionBeanRemote;
+import org.mxchange.jcontactsbusiness.model.department.BusinessDepartment;
+import org.mxchange.jcontactsbusiness.model.department.Department;
+import org.mxchange.jcontactsbusiness.model.department.Departments;
+import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
+import org.mxchange.jjobs.beans.BaseJobsBean;
+import org.mxchange.jjobs.beans.business.department.list.JobsDepartmentListWebViewController;
+import org.mxchange.jusercore.model.user.User;
+
+/**
+ * An administrative action bean for departments
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Named ("adminDepartmentActionController")
+@RequestScoped
+public class JobsAdminDepartmentActionWebRequestBean extends BaseJobsBean implements JobsAdminDepartmentActionWebRequestController {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 5_028_697_360_473L;
+
+       /**
+        * EJB for administrative purposes
+        */
+       @EJB (lookup = "java:global/jjobs-ejb/adminDepartment!org.mxchange.jcontactsbusiness.model.department.AdminDepartmentSessionBeanRemote")
+       private AdminDepartmentSessionBeanRemote adminDepartmentBean;
+
+       /**
+        * Currently worked on department
+        */
+       private Department currentDepartment;
+
+       /**
+        * An event being fired when a department has been successfully added
+        */
+       @Inject
+       @Any
+       private Event<ObservableAdminDepartmentAddedEvent> departmentAddedEvent;
+
+       /**
+        * Assigned branch office (if apply-able)
+        */
+       private BranchOffice departmentBranchOffice;
+
+       /**
+        * Assigned company for this department
+        */
+       private BasicData departmentCompany;
+
+       /**
+        * Assigned headquarter (if apply-able)
+        */
+       private Headquarter departmentHeadquarter;
+
+       /**
+        * Department name
+        */
+       private String departmentI18nKey;
+
+       /**
+        * Primary key of department
+        */
+       private Long departmentId;
+
+       /**
+        * Lead person of this department
+        */
+       private Contact departmentLead;
+
+       /**
+        * A general department controller (backing bean)
+        */
+       @Inject
+       private JobsDepartmentListWebViewController departmentListController;
+
+       /**
+        * Owning user instance (which this department is assigned to)
+        */
+       private User departmentUserOwner;
+
+       /**
+        * Event being fired when a department has been updated
+        */
+       @Inject
+       @Any
+       private Event<ObservableAdminDepartmentUpdatedEvent> updatedDepartmentEvent;
+
+       /**
+        * Default constructor
+        */
+       public JobsAdminDepartmentActionWebRequestBean () {
+               // Call super constructor
+               super();
+       }
+
+       /**
+        * Adds department with all data from this backing bean. First this action
+        * method will validate if the department's address is already registered
+        * and if found, it will output a proper faces message.
+        */
+       public void addDepartment () {
+               // Get instance
+               final Department department = this.createDepartment();
+
+               // Is the department not created yet?
+               if (this.departmentListController.isDepartmentAlreadyAdded(department)) {
+                       // Then show proper faces message
+                       this.showFacesMessage("form-admin-add-department:branchStreet", "ADMIN_DEPARTMENT_ALREADY_CREATED", FacesMessage.SEVERITY_WARN); //NOI18N
+                       return;
+               }
+
+               // Delcare updated instance
+               final Department updatedDepartment;
+
+               try {
+                       // Try to call EJB
+                       updatedDepartment = this.adminDepartmentBean.addDepartment(department);
+               } catch (final DepartmentAlreadyAddedException ex) {
+                       // Output message
+                       this.showFacesMessage("form-admin-add-department:departmentI18nKey", "ADMIN_DEPARTMENT_ALREADY_CREATED", FacesMessage.SEVERITY_ERROR); //NOI18N
+                       return;
+               }
+
+               // Fire event
+               this.departmentAddedEvent.fire(new AdminDepartmentAddedEvent(updatedDepartment));
+       }
+
+       /**
+        * Copies all properties from current department to this bean.
+        */
+       public void copyAllDepartmentProperties () {
+               // Is current department set?
+               if (this.getCurrentDepartment() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("this.currentDepartment is null"); //NOI18N
+               } else if (this.getCurrentDepartment().getDepartmentId() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("this.currentDepartment.departmentId is null"); //NOI18N
+               } else if (this.getCurrentDepartment().getDepartmentId() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("this.currentDepartment.departmentId={0} is not valid", this.getCurrentDepartment().getDepartmentId())); //NOI18N
+               }
+
+               // Copy all fields
+               this.setDepartmentBranchOffice(this.getCurrentDepartment().getDepartmentBranchOffice());
+               this.setDepartmentCompany(this.getCurrentDepartment().getDepartmentCompany());
+               this.setDepartmentHeadquarter(this.getCurrentDepartment().getDepartmentHeadquarter());
+               this.setDepartmentI18nKey(this.getCurrentDepartment().getDepartmentI18nKey());
+               this.setDepartmentId(this.getCurrentDepartment().getDepartmentId());
+               this.setDepartmentLead(this.getCurrentDepartment().getDepartmentLead());
+               this.setDepartmentUserOwner(this.getCurrentDepartment().getDepartmentUserOwner());
+       }
+
+       /**
+        * Getter for current department
+        * <p>
+        * @return Current department
+        */
+       public Department getCurrentDepartment () {
+               return this.currentDepartment;
+       }
+
+       /**
+        * Setter for current department
+        * <p>
+        * @param currentDepartment Current department
+        */
+       public void setCurrentDepartment (final Department currentDepartment) {
+               this.currentDepartment = currentDepartment;
+       }
+
+       /**
+        * Getter for assigned branch office
+        * <p>
+        * @return Branch office
+        */
+       public BranchOffice getDepartmentBranchOffice () {
+               return this.departmentBranchOffice;
+       }
+
+       /**
+        * Setter for assigned branch office
+        * <p>
+        * @param departmentDepartment Branch office
+        */
+       public void setDepartmentBranchOffice (final BranchOffice departmentDepartment) {
+               this.departmentBranchOffice = departmentDepartment;
+       }
+
+       /**
+        * Getter for basic company data
+        * <p>
+        * @return Basic company data
+        */
+       public BasicData getDepartmentCompany () {
+               return this.departmentCompany;
+       }
+
+       /**
+        * Setter for basic company data
+        * <p>
+        * @param departmentCompany Basic company data
+        */
+       public void setDepartmentCompany (final BasicData departmentCompany) {
+               this.departmentCompany = departmentCompany;
+       }
+
+       /**
+        * Getter for assigned headquarter data
+        * <p>
+        * @return Headquarter data
+        */
+       public Headquarter getDepartmentHeadquarter () {
+               return this.departmentHeadquarter;
+       }
+
+       /**
+        * Setter for assigned headquarter data
+        * <p>
+        * @param departmentHeadquarter Headquarter data
+        */
+       public void setDepartmentHeadquarter (final Headquarter departmentHeadquarter) {
+               this.departmentHeadquarter = departmentHeadquarter;
+       }
+
+       /**
+        * Getter for department name
+        * <p>
+        * @return Department name
+        */
+       public String getDepartmentI18nKey () {
+               return this.departmentI18nKey;
+       }
+
+       /**
+        * Setter for department name
+        * <p>
+        * @param departmentI18nKey Department name
+        */
+       public void setDepartmentI18nKey (final String departmentI18nKey) {
+               this.departmentI18nKey = departmentI18nKey;
+       }
+
+       /**
+        * Getter for primary key
+        * <p>
+        * @return Primary key
+        */
+       public Long getDepartmentId () {
+               return this.departmentId;
+       }
+
+       /**
+        * Setter for primary key
+        * <p>
+        * @param departmentId Primary key
+        */
+       public void setDepartmentId (final Long departmentId) {
+               this.departmentId = departmentId;
+       }
+
+       /**
+        * Getter for department contact person
+        * <p>
+        * @return Department contact person
+        */
+       public Contact getDepartmentLead () {
+               return this.departmentLead;
+       }
+
+       /**
+        * Setter for department contact person
+        * <p>
+        * @param departmentLead Department contact person
+        */
+       public void setDepartmentLead (final Contact departmentLead) {
+               this.departmentLead = departmentLead;
+       }
+
+       /**
+        * Getter for owning user instance
+        * <p>
+        * @return Owning user instance
+        */
+       public User getDepartmentUserOwner () {
+               return this.departmentUserOwner;
+       }
+
+       /**
+        * Setter for owning user instance
+        * <p>
+        * @param departmentUserOwner Owning user instance
+        */
+       public void setDepartmentUserOwner (final User departmentUserOwner) {
+               this.departmentUserOwner = departmentUserOwner;
+       }
+
+       /**
+        * Updates department record with data from this bean.
+        * <p>
+        * @return Redirection outcome
+        */
+       public String updateDepartment () {
+               // Is current department set?
+               if (this.getCurrentDepartment() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("this.currentDepartment is null"); //NOI18N
+               } else if (this.getCurrentDepartment().getDepartmentId() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("this.currentDepartment.departmentId is null"); //NOI18N
+               } else if (this.getCurrentDepartment().getDepartmentId() < 1) {
+                       // Throw IAE
+                       throw new IllegalArgumentException(MessageFormat.format("this.currentDepartment.departmentId={0} is not valid", this.getCurrentDepartment().getDepartmentId())); //NOI18N
+               }
+
+               // Init instance with current data
+               final Department department = this.createDepartment();
+
+               // Does current (not updated) and just created (maybe updated) match?
+               System.out.println("this.currentDepartment.departmentLead=" + this.getCurrentDepartment().getDepartmentLead() + ",department.departmentLead=" + department.getDepartmentLead() + " - BEFORE!");
+               if (Objects.equals(this.getCurrentDepartment(), department)) {
+                       // Yes, then output message
+                       this.showFacesMessage("form-admin-edit-department:departmentI18nKey", "ADMIN_DEPARTMENT_NOT_UPDATED", FacesMessage.SEVERITY_WARN); //NOI18N
+
+                       // Skip below code
+                       return ""; //NOI18N
+               }
+
+               // Copy all fields
+               Departments.copyDepartmentData(this.getCurrentDepartment(), department);
+
+               // Initialize updated instance
+               final Department updatedDepartment;
+
+               // Try it
+               try {
+                       // Invoke EJB
+                       updatedDepartment = this.adminDepartmentBean.updateDepartment(department);
+               } catch (final DepartmentNotFoundException ex) {
+                       // Throw as a cause
+                       throw new FacesException(ex);
+               }
+
+               // Fire event
+               this.updatedDepartmentEvent.fire(new AdminDepartmentUpdatedEvent(updatedDepartment));
+
+               // Return to list view
+               return "admin_list_departments"; //NOI18N
+       }
+
+       /**
+        * Prepares an instance of a Department object (entity) with all data from
+        * this bean. If a complete fax number or land-line number was provided, it
+        * will be set in the instance as well.
+        * <p>
+        * @return An instance of a Department class (entity)
+        */
+       private Department createDepartment () {
+               // Create new department instance
+               final Department department = new BusinessDepartment(this.getDepartmentCompany(), this.getDepartmentI18nKey());
+
+               // Add all optional fields
+               department.setDepartmentBranchOffice(this.getDepartmentBranchOffice());
+               department.setDepartmentHeadquarter(this.getDepartmentHeadquarter());
+               department.setDepartmentId(this.getDepartmentId());
+               department.setDepartmentLead(this.getDepartmentLead());
+               department.setDepartmentUserOwner(this.getDepartmentUserOwner());
+
+               // Return fully prepared instance
+               return department;
+       }
+
+}
diff --git a/src/java/org/mxchange/jjobs/beans/business/branchoffice/action/JobsAdminDepartmentActionWebRequestController.java b/src/java/org/mxchange/jjobs/beans/business/branchoffice/action/JobsAdminDepartmentActionWebRequestController.java
new file mode 100644 (file)
index 0000000..2423b62
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2017 - 2020 Free Software Foundation
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.beans.business.department.action;
+
+import java.io.Serializable;
+
+/**
+ * An interface for administrative action department controller
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface JobsAdminDepartmentActionWebRequestController extends Serializable {
+
+}
index b55c66255e146b123232cb72800642eabf80b7fa..58f03e760cc8dd0b6746a8a340bf6406e00683f5 100644 (file)
  */
 package org.mxchange.jjobs.beans.business.department;
 
-import javax.ejb.EJB;
 import javax.enterprise.context.RequestScoped;
-import javax.enterprise.event.Event;
-import javax.enterprise.inject.Any;
-import javax.faces.application.FacesMessage;
-import javax.inject.Inject;
 import javax.inject.Named;
-import org.mxchange.jcontactsbusiness.events.department.added.DepartmentAddedEvent;
-import org.mxchange.jcontactsbusiness.events.department.added.ObservableDepartmentAddedEvent;
-import org.mxchange.jcontactsbusiness.exceptions.department.DepartmentAlreadyAddedException;
-import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
-import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
-import org.mxchange.jcontactsbusiness.model.department.AdminDepartmentSessionBeanRemote;
-import org.mxchange.jcontactsbusiness.model.department.BusinessDepartment;
-import org.mxchange.jcontactsbusiness.model.department.Department;
-import org.mxchange.jcontactsbusiness.model.employee.Employable;
-import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
 import org.mxchange.jjobs.beans.BaseJobsBean;
-import org.mxchange.jjobs.beans.business.department.list.JobsDepartmentListWebViewController;
-import org.mxchange.jusercore.model.user.User;
 
 /**
  * An administrative bean for departments
@@ -51,55 +34,6 @@ public class JobsAdminDepartmentWebRequestBean extends BaseJobsBean implements J
         */
        private static final long serialVersionUID = 5_028_697_360_464L;
 
-       /**
-        * EJB for administrative purposes
-        */
-       @EJB (lookup = "java:global/jjobs-ejb/adminDepartment!org.mxchange.jcontactsbusiness.model.department.AdminDepartmentSessionBeanRemote")
-       private AdminDepartmentSessionBeanRemote adminDepartmentBean;
-
-       /**
-        * An event being fired when a department has been successfully added
-        */
-       @Inject
-       @Any
-       private Event<ObservableDepartmentAddedEvent> departmentAddedEvent;
-
-       /**
-        * Assigned branch office (if apply-able)
-        */
-       private BranchOffice departmentBranchOffice;
-
-       /**
-        * Assigned company for this department
-        */
-       private BasicData departmentCompany;
-
-       /**
-        * Assigned headquarter (if apply-able)
-        */
-       private Headquarter departmentHeadquarter;
-
-       /**
-        * Department name
-        */
-       private String departmentI18nKey;
-
-       /**
-        * Lead person of this department
-        */
-       private Employable departmentLead;
-
-       /**
-        * A general department controller (backing bean)
-        */
-       @Inject
-       private JobsDepartmentListWebViewController departmentListController;
-
-       /**
-        * Owning user instance (which this department is assigned to)
-        */
-       private User departmentUserOwner;
-
        /**
         * Default constructor
         */
@@ -108,165 +42,4 @@ public class JobsAdminDepartmentWebRequestBean extends BaseJobsBean implements J
                super();
        }
 
-       /**
-        * Adds department with all data from this backing bean. First this action
-        * method will validate if the department's address is already registered
-        * and if found, it will output a proper faces message.
-        */
-       public void addDepartment () {
-               // Get instance
-               final Department department = this.createDepartment();
-
-               // Is the department not created yet?
-               if (this.departmentListController.isDepartmentAlreadyAdded(department)) {
-                       // Then show proper faces message
-                       this.showFacesMessage("form-admin-add-department:branchStreet", "ADMIN_DEPARTMENT_ALREADY_CREATED", FacesMessage.SEVERITY_WARN); //NOI18N
-                       return;
-               }
-
-               // Delcare updated instance
-               final Department updatedDepartment;
-
-               try {
-                       // Try to call EJB
-                       updatedDepartment = this.adminDepartmentBean.addDepartment(department);
-               } catch (final DepartmentAlreadyAddedException ex) {
-                       // Output message
-                       this.showFacesMessage("form-admin-add-department:departmentI18nKey", "ADMIN_DEPARTMENT_ALREADY_CREATED", FacesMessage.SEVERITY_ERROR); //NOI18N
-                       return;
-               }
-
-               // Fire event
-               this.departmentAddedEvent.fire(new DepartmentAddedEvent(updatedDepartment));
-       }
-
-       /**
-        * Getter for assigned branch office
-        * <p>
-        * @return Branch office
-        */
-       public BranchOffice getDepartmentBranchOffice () {
-               return this.departmentBranchOffice;
-       }
-
-       /**
-        * Setter for assigned branch office
-        * <p>
-        * @param departmentBranchOffice Branch office
-        */
-       public void setDepartmentBranchOffice (final BranchOffice departmentBranchOffice) {
-               this.departmentBranchOffice = departmentBranchOffice;
-       }
-
-       /**
-        * Getter for basic company data
-        * <p>
-        * @return Basic company data
-        */
-       public BasicData getDepartmentCompany () {
-               return this.departmentCompany;
-       }
-
-       /**
-        * Setter for basic company data
-        * <p>
-        * @param departmentCompany Basic company data
-        */
-       public void setDepartmentCompany (final BasicData departmentCompany) {
-               this.departmentCompany = departmentCompany;
-       }
-
-       /**
-        * Getter for assigned headquarter data
-        * <p>
-        * @return Headquarter data
-        */
-       public Headquarter getDepartmentHeadquarter () {
-               return this.departmentHeadquarter;
-       }
-
-       /**
-        * Setter for assigned headquarter data
-        * <p>
-        * @param departmentHeadquarter Headquarter data
-        */
-       public void setDepartmentHeadquarter (final Headquarter departmentHeadquarter) {
-               this.departmentHeadquarter = departmentHeadquarter;
-       }
-
-       /**
-        * Getter for department name
-        * <p>
-        * @return Department name
-        */
-       public String getDepartmentI18nKey () {
-               return this.departmentI18nKey;
-       }
-
-       /**
-        * Setter for department name
-        * <p>
-        * @param departmentI18nKey Department name
-        */
-       public void setDepartmentI18nKey (final String departmentI18nKey) {
-               this.departmentI18nKey = departmentI18nKey;
-       }
-
-       /**
-        * Getter for department contact person
-        * <p>
-        * @return Department contact person
-        */
-       public Employable getDepartmentLead () {
-               return this.departmentLead;
-       }
-
-       /**
-        * Setter for department contact person
-        * <p>
-        * @param departmentLead Department contact person
-        */
-       public void setDepartmentLead (final Employable departmentLead) {
-               this.departmentLead = departmentLead;
-       }
-
-       /**
-        * Getter for owning user instance
-        * <p>
-        * @return Owning user instance
-        */
-       public User getDepartmentUserOwner () {
-               return this.departmentUserOwner;
-       }
-
-       /**
-        * Setter for owning user instance
-        * <p>
-        * @param departmentUserOwner Owning user instance
-        */
-       public void setDepartmentUserOwner (final User departmentUserOwner) {
-               this.departmentUserOwner = departmentUserOwner;
-       }
-
-       /**
-        * Prepares an instance of a Department object (entity) with all data from
-        * this bean. If a complete fax number or land-line number was provided, it
-        * will be set in the instance as well.
-        * <p>
-        * @return An instance of a Department class (entity)
-        */
-       private Department createDepartment () {
-               // Create new department instance
-               final Department department = new BusinessDepartment(this.getDepartmentCompany(), this.getDepartmentI18nKey());
-
-               // Add all optional fields
-               department.setDepartmentHeadquarter(this.getDepartmentHeadquarter());
-               department.setDepartmentBranchOffice(this.getDepartmentBranchOffice());
-               department.setDepartmentLead(this.getDepartmentLead());
-               department.setDepartmentUserOwner(this.getDepartmentUserOwner());
-
-               // Return fully prepared instance
-               return department;
-       }
-
 }
index 7d339305b39fedd227922c1cb3db47f492550ec1..d912a3fb5ecddaadd7bcdb8c43e556b237cc2a32 100644 (file)
@@ -29,6 +29,7 @@ import javax.faces.FacesException;
 import javax.faces.application.FacesMessage;
 import javax.inject.Inject;
 import javax.inject.Named;
+import org.mxchange.jcontacts.model.contact.Contact;
 import org.mxchange.jcontactsbusiness.events.branchoffice.added.AdminBranchOfficeAddedEvent;
 import org.mxchange.jcontactsbusiness.events.branchoffice.added.ObservableAdminBranchOfficeAddedEvent;
 import org.mxchange.jcontactsbusiness.events.branchoffice.updated.AdminBranchOfficeUpdatedEvent;
@@ -40,7 +41,6 @@ import org.mxchange.jcontactsbusiness.model.branchoffice.AdminBranchOfficeSessio
 import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
 import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffices;
 import org.mxchange.jcontactsbusiness.model.branchoffice.BusinessBranchOffice;
-import org.mxchange.jcontactsbusiness.model.employee.Employable;
 import org.mxchange.jcontactsbusiness.model.opening_time.BusinessOpeningTime;
 import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime;
 import org.mxchange.jcoreee.dates.DayOfTheWeek;
@@ -91,7 +91,7 @@ public class JobsAdminBranchOfficeActionWebRequestBean extends BaseJobsBean impl
        /**
         * Contact person in branch office
         */
-       private Employable branchContactEmployee;
+       private Contact branchContactEmployee;
 
        /**
         * Country
@@ -144,7 +144,7 @@ public class JobsAdminBranchOfficeActionWebRequestBean extends BaseJobsBean impl
        /**
         * Owner/leader of branch office
         */
-       private Employable branchOwnerEmployee;
+       private Contact branchOwnerEmployee;
 
        /**
         * Store
@@ -396,7 +396,7 @@ public class JobsAdminBranchOfficeActionWebRequestBean extends BaseJobsBean impl
         * <p>
         * @return Branch office contact person
         */
-       public Employable getBranchContactEmployee () {
+       public Contact getBranchContactEmployee () {
                return this.branchContactEmployee;
        }
 
@@ -405,7 +405,7 @@ public class JobsAdminBranchOfficeActionWebRequestBean extends BaseJobsBean impl
         * <p>
         * @param branchContactEmployee Branch office contact person
         */
-       public void setBranchContactEmployee (final Employable branchContactEmployee) {
+       public void setBranchContactEmployee (final Contact branchContactEmployee) {
                this.branchContactEmployee = branchContactEmployee;
        }
 
@@ -560,7 +560,7 @@ public class JobsAdminBranchOfficeActionWebRequestBean extends BaseJobsBean impl
         * <p>
         * @return Branch office contact person
         */
-       public Employable getBranchOwnerEmployee () {
+       public Contact getBranchOwnerEmployee () {
                return this.branchOwnerEmployee;
        }
 
@@ -569,7 +569,7 @@ public class JobsAdminBranchOfficeActionWebRequestBean extends BaseJobsBean impl
         * <p>
         * @param branchOwnerEmployee Branch office contact person
         */
-       public void setBranchOwnerEmployee (final Employable branchOwnerEmployee) {
+       public void setBranchOwnerEmployee (final Contact branchOwnerEmployee) {
                this.branchOwnerEmployee = branchOwnerEmployee;
        }
 
@@ -871,8 +871,17 @@ public class JobsAdminBranchOfficeActionWebRequestBean extends BaseJobsBean impl
         * @return Redirection outcome
         */
        public String updateBranchOffice () {
-               // Id should be set
-               if (this.getBranchId() == null) {
+               // Validate current product instance and id
+               if (this.getCurrentBranchOffice() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("this.product is null"); //NOI18N
+               } else if (this.getCurrentBranchOffice().getBranchId() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("this.product.branchId is null"); //NOI18N
+               } else if (this.getCurrentBranchOffice().getBranchId() < 1) {
+                       // Not valid
+                       throw new IllegalStateException(MessageFormat.format("this.product.branchId={0} is not valid.", this.getCurrentBranchOffice().getBranchId())); //NOI18N
+               } else if (this.getBranchId() == null) {
                        // Throw NPE
                        throw new NullPointerException("this.branchId is null"); //NOI18N
                } else if (this.getBranchId() < 1) {
index 3d2d155d9e83e980b90e485fb64436d469cedd61..82328f79d65a166adb7eb9658358b0316bbc8928 100644 (file)
@@ -28,7 +28,7 @@ import javax.enterprise.event.Observes;
 import javax.faces.view.ViewScoped;
 import javax.inject.Inject;
 import javax.inject.Named;
-import org.mxchange.jcontactsbusiness.events.department.added.ObservableDepartmentAddedEvent;
+import org.mxchange.jcontactsbusiness.events.department.added.ObservableAdminDepartmentAddedEvent;
 import org.mxchange.jcontactsbusiness.exceptions.department.DepartmentNotFoundException;
 import org.mxchange.jcontactsbusiness.model.department.Department;
 import org.mxchange.jcontactsbusiness.model.department.DepartmentSessionBeanRemote;
@@ -97,25 +97,25 @@ public class JobsDepartmentListWebViewBean extends BaseJobsBean implements JobsD
         * null
         * @throws IllegalArgumentException If the branchId is zero or lower
         */
-       public void afterDepartmentAddedEvent (@Observes final ObservableDepartmentAddedEvent event) {
+       public void afterDepartmentAddedEvent (@Observes final ObservableAdminDepartmentAddedEvent event) {
                // Validate parameter
                if (null == event) {
                        // Throw NPE
                        throw new NullPointerException("event is null"); //NOI18N
-               } else if (event.getDepartment() == null) {
+               } else if (event.getAddedDepartment() == null) {
                        // Throw NPE again
                        throw new NullPointerException("event.department is null"); //NOI18N
-               } else if (event.getDepartment().getDepartmentId() == null) {
+               } else if (event.getAddedDepartment().getDepartmentId() == null) {
                        // Throw it again
                        throw new NullPointerException("event.department.branchId is null"); //NOI18N
-               } else if (event.getDepartment().getDepartmentId() < 1) {
+               } else if (event.getAddedDepartment().getDepartmentId() < 1) {
                        // Throw IAE
-                       throw new IllegalArgumentException(MessageFormat.format("event.department.branchId={0} is not valid", event.getDepartment().getDepartmentId())); //NOI18N
+                       throw new IllegalArgumentException(MessageFormat.format("event.department.branchId={0} is not valid", event.getAddedDepartment().getDepartmentId())); //NOI18N
                }
 
                // Add instance to cache
-               this.departmentCache.put(event.getDepartment().getDepartmentId(), event.getDepartment());
-               this.getAllDepartments().add(event.getDepartment());
+               this.departmentCache.put(event.getAddedDepartment().getDepartmentId(), event.getAddedDepartment());
+               this.getAllDepartments().add(event.getAddedDepartment());
        }
 
        @Override
index 4d622a310197a0a03b251cce6bece9db01785fc7..bea4d47562a1cf92eadcbc567a45f54056fc7a04 100644 (file)
@@ -27,10 +27,10 @@ import javax.enterprise.inject.Any;
 import javax.faces.application.FacesMessage;
 import javax.inject.Inject;
 import javax.inject.Named;
+import org.mxchange.jcontacts.model.contact.Contact;
 import org.mxchange.jcontactsbusiness.events.headquarter.added.HeadquarterAddedEvent;
 import org.mxchange.jcontactsbusiness.events.headquarter.added.ObservableHeadquarterAddedEvent;
 import org.mxchange.jcontactsbusiness.exceptions.headquarter.HeadquarterAlreadyAddedException;
-import org.mxchange.jcontactsbusiness.model.employee.Employable;
 import org.mxchange.jcontactsbusiness.model.headquarter.AdminHeadquarterSessionBeanRemote;
 import org.mxchange.jcontactsbusiness.model.headquarter.BusinessHeadquarter;
 import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
@@ -106,7 +106,7 @@ public class JobsAdminHeadquarterActionWebRequestBean extends BaseJobsBean imple
        /**
         * Contact person in headquarter
         */
-       private Employable headquarterContactEmployee;
+       private Contact headquarterContactEmployee;
 
        /**
         * Country
@@ -380,7 +380,7 @@ public class JobsAdminHeadquarterActionWebRequestBean extends BaseJobsBean imple
         * <p>
         * @return Headquarter contact person
         */
-       public Employable getHeadquarterContactEmployee () {
+       public Contact getHeadquarterContactEmployee () {
                return this.headquarterContactEmployee;
        }
 
@@ -389,7 +389,7 @@ public class JobsAdminHeadquarterActionWebRequestBean extends BaseJobsBean imple
         * <p>
         * @param headquarterContactEmployee Headquarter contact person
         */
-       public void setHeadquarterContactEmployee (final Employable headquarterContactEmployee) {
+       public void setHeadquarterContactEmployee (final Contact headquarterContactEmployee) {
                this.headquarterContactEmployee = headquarterContactEmployee;
        }
 
index d99296c43f67a3e77364a5982cf6f47f82847fc2..8bb3fdb8ef1de09c6703349830e4fd1f312a492c 100644 (file)
@@ -332,10 +332,10 @@ public class JobsAdminContactWebRequestBean extends BaseJobsBean implements Jobs
                        throw new NullPointerException("event is null"); //NOI18N
                } else if (event.getCreatedContact() == null) {
                        // Throw NPE again
-                       throw new NullPointerException("event.createdContact is null"); //NOI18N //NOI18N
+                       throw new NullPointerException("event.createdContact is null"); //NOI18N
                } else if (event.getCreatedContact().getContactId() == null) {
                        // Throw NPE again
-                       throw new NullPointerException("event.createdContact.contactId is null"); //NOI18N //NOI18N
+                       throw new NullPointerException("event.createdContact.contactId is null"); //NOI18N
                } else if (event.getCreatedContact().getContactId() < 1) {
                        // Not valid
                        throw new IllegalStateException(MessageFormat.format("event.createdContact.contactId={0} is not valid.", event.getCreatedContact().getContactId())); //NOI18N
@@ -565,7 +565,7 @@ public class JobsAdminContactWebRequestBean extends BaseJobsBean implements Jobs
                        throw new NullPointerException("beanHelper.contact is null"); //NOI18N
                } else if (createdContact.getContactId() == null) {
                        // Throw NPE again
-                       throw new NullPointerException("beanHelper.contact.contactId is null"); //NOI18N //NOI18N
+                       throw new NullPointerException("beanHelper.contact.contactId is null"); //NOI18N
                } else if (createdContact.getContactId() < 1) {
                        // Invalid id
                        throw new IllegalStateException(MessageFormat.format("beanHelper.contact.contactId={0} is invalid", createdContact.getContactId())); //NOI18N
@@ -1193,7 +1193,7 @@ public class JobsAdminContactWebRequestBean extends BaseJobsBean implements Jobs
                        throw new NullPointerException("contact is null"); //NOI18N
                } else if (contact.getContactId() == null) {
                        // Throw NPE again
-                       throw new NullPointerException("contact.contactId is null"); //NOI18N //NOI18N
+                       throw new NullPointerException("contact.contactId is null"); //NOI18N
                } else if (contact.getContactId() < 1) {
                        // Invalid id
                        throw new IllegalStateException(MessageFormat.format("contact.contactId={0} is invalid", contact.getContactId())); //NOI18N
index c4de0434422ef5e0f5f0d7610e1f89d7130c52aa..beacb843a8c385ced6a0e8f0abddc3f08a69bd27 100644 (file)
@@ -118,7 +118,7 @@ public class JobsContactListWebViewBean extends BaseJobsBean implements JobsCont
                        throw new NullPointerException("event.addedContact.contactId is null"); //NOI18N
                } else if (event.getAddedContact().getContactId() < 1) {
                        // Not valid
-                       throw new IllegalArgumentException(MessageFormat.format("event.addedContact.contactId={0} is not valid", event.getAddedContact().getContactId())); //NOI18N //NOI18N
+                       throw new IllegalArgumentException(MessageFormat.format("event.addedContact.contactId={0} is not valid", event.getAddedContact().getContactId())); //NOI18N
                }
 
                // Call other method
index a0c26bb35db3a7eb79286594feb3bd541498ec2a..fe7653f1b30ce3e8a71f945ee14ccc64523e2a88 100644 (file)
@@ -213,10 +213,10 @@ public class JobsAdminContactMobileWebRequestBean extends BaseJobsBean implement
                        throw new NullPointerException("event is null"); //NOI18N
                } else if (event.getCreatedContact() == null) {
                        // Throw NPE again
-                       throw new NullPointerException("event.createdContact is null"); //NOI18N //NOI18N
+                       throw new NullPointerException("event.createdContact is null"); //NOI18N
                } else if (event.getCreatedContact().getContactId() == null) {
                        // Throw NPE again
-                       throw new NullPointerException("event.createdContact.contactId is null"); //NOI18N //NOI18N
+                       throw new NullPointerException("event.createdContact.contactId is null"); //NOI18N
                } else if (event.getCreatedContact().getContactId() < 1) {
                        // Not valid
                        throw new IllegalStateException(MessageFormat.format("event.createdContact.contactId={0} is not valid.", event.getCreatedContact().getContactId())); //NOI18N
index eb8a01fe3076a115ba061fe031dd7aeff4c4c01f..e074842ce77f51294c87dc674ad4cfb4296c8db9 100644 (file)
@@ -266,10 +266,10 @@ public class JobsAdminContactPhoneWebRequestBean extends BaseJobsBean implements
                        throw new NullPointerException("event is null"); //NOI18N
                } else if (event.getCreatedContact() == null) {
                        // Throw NPE again
-                       throw new NullPointerException("event.createdContact is null"); //NOI18N //NOI18N
+                       throw new NullPointerException("event.createdContact is null"); //NOI18N
                } else if (event.getCreatedContact().getContactId() == null) {
                        // Throw NPE again
-                       throw new NullPointerException("event.createdContact.contactId is null"); //NOI18N //NOI18N
+                       throw new NullPointerException("event.createdContact.contactId is null"); //NOI18N
                } else if (event.getCreatedContact().getContactId() < 1) {
                        // Not valid
                        throw new IllegalStateException(MessageFormat.format("event.createdContact.contactId={0} is not valid.", event.getCreatedContact().getContactId())); //NOI18N
index 0062dd5ffdb328158e6d20f1c6722c8f2d6e09a5..6b7efdb4afbd9785c475b043b2f9a42ba35b3b75 100644 (file)
@@ -291,8 +291,7 @@ ADMIN_MENU_COUNTRY_TITLE=L\u00e4nderdaten
 ADMIN_LINK_LIST_COUNTRIES=L\u00e4nder
 ADMIN_LINK_LIST_COUNTRIES_TITLE=Bestehende L\u00e4nderdaten auflisten, neue hinzuf\u00fcgen, \u00e4ndern und l\u00f6schen.
 PAGE_TITLE_ADMIN_LIST_COUNTRY=L\u00e4nderdaten auflisten
-#@TODO Please fix German umlauts!
-CONTENT_TITLE_ADMIN_LIST_COUNTRY=Auflisten von Laenderdaten:
+CONTENT_TITLE_ADMIN_LIST_COUNTRY=Auflisten von L\u00e4nderdaten:
 ADMIN_ADD_COUNTRY_TITLE=Neues Land hinzuf\u00fcgen
 ADMIN_COUNTRY_DATA_MINIMUM_NOTICE=Bitte geben Sie alle Felder an.
 ADMIN_ADD_COUNTRY_I18N_KEY_NOTICE=Der Schl\u00fcssel f\u00fcr das Sprachpaket ist in Grossbuchstaben und Unterstrichen zu schreiben. Beispiel: COUNTRY_GERMANY f\u00fcr Deutschland
@@ -928,12 +927,11 @@ ADMIN_LINK_EDIT_MOBILE_PROVIDER_TITLE=Edieren des Mobilfunkanbieters.
 #@TODO Please fix German umlauts!
 ADMIN_LINK_DELETE_MOBILE_PROVIDER_TITLE=Loescht den Mobilfunkanbieter.
 ADMIN_LINK_SHOW_COUNTRY_TITLE=Zeigt Details des Landes an.
+ADMIN_LINK_EDIT_COUNTRY_TITLE=Editieren der L\u00e4nderdaten.
 #@TODO Please fix German umlauts!
-ADMIN_LINK_EDIT_COUNTRY_TITLE=Editieren der Laenderdaten.
-#@TODO Please fix German umlauts!
-ADMIN_LINK_DELETE_COUNTRY_TITLE=Loescht die Laenderdaten.
+ADMIN_LINK_DELETE_COUNTRY_TITLE=Loescht die L\u00e4nderdaten.
 #@TODO Please fix German umlauts!
-ADMIN_EMPTY_LIST_COUNTRY=Es befinden sich keine Laender in der Datenbank. Oder Ihre Suche ergab keine Uebereinstimmungen.
+ADMIN_EMPTY_LIST_COUNTRY=Es befinden sich keine L\u00e4nder in der Datenbank. Oder Ihre Suche ergab keine Uebereinstimmungen.
 #@TODO Please fix German umlauts!
 ADMIN_EMPTY_LIST_FAX_NUMBER=Es befinden sich keine Faxnummern in der Datenbank oder Ihre Suche ergab keine Uebereinstimmungen.
 #@TODO Please fix German umlauts!
@@ -944,10 +942,8 @@ ADMIN_EMPTY_LIST_MOBILE_NUMBER=Es befinden sich keine Mobilfunknummern in der Da
 ADMIN_EMPTY_LIST_CONTACT_MOBILE=Es befinden sich keine Mobilfunknummern von Kontakten in der Datenbank oder Ihre Suche ergab keine Uebereinstimmungen.
 #@TODO Please fix German umlauts!
 ADMIN_MOBILE_PROVIDER_COUNTRY_REQUIRED=Bitte waehlen Sie ein Land f\u00fcr den Mobilfunkanbieter aus.
-#@TODO Please fix German umlauts!
-LABEL_COUNTRIES=Laender
-#@TODO Please fix German umlauts!
-FILTER_BY_MULTIPLE_COUNTRY_TITLE=Liste durch Auswahl von ein oder mehr Laendern durchsuchen.
+LABEL_COUNTRIES=L\u00e4nder
+FILTER_BY_MULTIPLE_COUNTRY_TITLE=Liste durch Auswahl von ein oder mehr L\u00e4ndern durchsuchen.
 ADMIN_LIST_MOBILE_PROVIDERS_HEADER=Liste aller Mobilfunkanbieter
 SELECT_SHOWN_COLUMNS=Angezeigte Spalten
 ADMIN_LIST_BRANCH_OFFICES_HEADER=Alle Filialen auflisten
@@ -1239,3 +1235,13 @@ CONTENT_TITLE_ADMIN_EDIT_BRANCH_OFFICE=Filiale editieren:
 ADMIN_EDIT_BRANCH_OFFICE_TITLE=Filiale mit Id-Nummer {0} editieren:
 ADMIN_EDIT_BRANCH_OFFICE_NUMBER_TITLE=Filiale Nummer {1} (Id {0}) editieren:
 BUTTON_ADMIN_EDIT_BRANCH_OFFICE=Filiale \u00e4ndern
+ERROR_PARAMETER_DEPARTMENT_ID_NOT_SET=Fehler: Parameter "departmentId" ist nicht gesetzt.
+PARAMETER_DEPARTMENT_ID_INVALID=Unter der angegebenen Id-Nummer konnte keine Abteilung gefunden werden..
+PAGE_TITLE_ADMIN_EDIT_DEPARTMENT=Abteilung editieren
+CONTENT_TITLE_ADMIN_EDIT_DEPARTMENT=Abteilung editieren:
+ADMIN_EDIT_DEPARTMENT_TITLE=Editing department {0} (Id {1}):
+#@TODO Please fix German umlauts!
+ADMIN_DEPARTMENT_MINIMUM_DATA=Bitte geben Sie mindestens den Internationalisierungsschlussel ein, waehlen Sie ein Unternehmen aus und entweder eine Filiale oder einen Hauptsitz als mindest benoetigte Daten aus.
+BUTTON_ADMIN_EDIT_DEPARTMENT=Abteilung \u00e4ndern
+#@TODO Please fix German umlauts!
+ADMIN_DEPARTMENT_NOT_UPDATED=Sie haben keine Daten der Filiale geaendert.
index 9c03ef6d16ec592738bdd7173a2817d3b9abdbc8..37d3e8bbe8aea5a8bb051ec938ca87d915fce292 100644 (file)
@@ -1145,3 +1145,11 @@ CONTENT_TITLE_ADMIN_EDIT_BRANCH_OFFICE=Edit branch office:
 ADMIN_EDIT_BRANCH_OFFICE_TITLE=Edit branch office with id {0}:
 ADMIN_EDIT_BRANCH_OFFICE_NUMBER_TITLE=Edit branch office number {1} (Id {0}):
 BUTTON_ADMIN_EDIT_BRANCH_OFFICE=Change branch office
+ERROR_PARAMETER_DEPARTMENT_ID_NOT_SET=Error: Parameter "departmentId" is not set.
+PARAMETER_DEPARTMENT_ID_INVALID=No depatment could be found by provided id number.
+PAGE_TITLE_ADMIN_EDIT_DEPARTMENT=Edit department
+CONTENT_TITLE_ADMIN_EDIT_DEPARTMENT=Edit department:
+ADMIN_EDIT_DEPARTMENT_TITLE=Editing department {0} (Id {1}):
+ADMIN_DEPARTMENT_MINIMUM_DATA=Please entet at least an i18n string, selecct a company and either select a branch office or a headquarter as minimum required data.
+BUTTON_ADMIN_EDIT_DEPARTMENT=Change department
+ADMIN_DEPARTMENT_NOT_UPDATED=You have not changed any data of the department.
index 1529c0eecd9a1377be031e8ad8b914e05f1b09b4..84e09fa3a9be7c0b3cac680450f1274483dc21f5 100644 (file)
                        <to-view-id>/admin/opening_time/admin_opening_time_list.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
-                       <from-outcome>admin_list_company_employee</from-outcome>
+                       <from-outcome>admin_list_employee</from-outcome>
                        <to-view-id>/admin/employee/admin_employee_list.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
                        <to-view-id>/admin/basic_data/admin_basic_data_assign_owner.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
-                       <from-outcome>admin_show_employee</from-outcome>
-                       <to-view-id>/admin/company_employee/admin_company_employee_show.xhtml</to-view-id>
+                       <from-outcome>admin_show_contact</from-outcome>
+                       <to-view-id>/admin/contact/admin_contact_show.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
                        <from-outcome>admin_assign_basic_data_employee</from-outcome>
                        <to-view-id>/admin/headquarter/admin_headquarter_assign_owner.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
-                       <from-outcome>admin_show_employee</from-outcome>
-                       <to-view-id>/admin/company_employee/admin_company_employee_show.xhtml</to-view-id>
+                       <from-outcome>admin_show_contact</from-outcome>
+                       <to-view-id>/admin/contact/admin_contact_show.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
-                       <from-outcome>admin_assign_headquarter_employee</from-outcome>
-                       <to-view-id>/admin/headquarter/admin_headquarter_assign_employee.xhtml</to-view-id>
+                       <from-outcome>admin_assign_headquarter_contact</from-outcome>
+                       <to-view-id>/admin/headquarter/admin_headquarter_assign_contact.xhtml</to-view-id>
                </navigation-case>
        </navigation-rule>
        <navigation-rule>
                        <to-view-id>/admin/basic_data/admin_basic_data_show.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
-                       <from-outcome>admin_show_employee</from-outcome>
-                       <to-view-id>/admin/company_employee/admin_company_employee_show.xhtml</to-view-id>
+                       <from-outcome>admin_show_contact</from-outcome>
+                       <to-view-id>/admin/contact/admin_contact_show.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
                        <from-outcome>admin_assign_branch_office_employee</from-outcome>
                        <to-view-id>/admin/department/admin_assign_department_branch_office.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
-                       <from-outcome>admin_show_employee</from-outcome>
-                       <to-view-id>/admin/employee/admin_employee_show.xhtml</to-view-id>
+                       <from-outcome>admin_show_contact</from-outcome>
+                       <to-view-id>/admin/contact/admin_contact_show.xhtml</to-view-id>
                </navigation-case>
                <navigation-case>
                        <from-outcome>admin_assign_department_employee</from-outcome>
                        <to-view-id>/admin/department/admin_assign_department_user.xhtml</to-view-id>
                </navigation-case>
        </navigation-rule>
+       <navigation-rule>
+               <from-view-id>/admin/department/admin_department_edit.xhtml</from-view-id>
+               <navigation-case>
+                       <from-outcome>admin_list_departments</from-outcome>
+                       <to-view-id>/admin/department/admin_department_list.xhtml</to-view-id>
+                       <redirect></redirect>
+               </navigation-case>
+       </navigation-rule>
        <navigation-rule>
                <from-view-id>/admin/employee/admin_employee_list.xhtml</from-view-id>
                <navigation-case>
index 5a0557a9b6d7b00f7af7fc39c6abde8828ba08be..769aef856726a7b8823933a2f58234e27300a9b9 100644 (file)
@@ -8,11 +8,11 @@
        xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
        xmlns:p="http://primefaces.org/ui"
        >
-
-       <!--
-       @TODO title="#{msg.ADMIN_CONTACT_PERSONAL_DATA_LEGEND_TITLE}"
-       -->
-       <p:fieldset legend="#{msg.ADMIN_CONTACT_PERSONAL_DATA_LEGEND}" rendered="#{empty rendered or rendered}">
+       <p:fieldset
+               legend="#{msg.ADMIN_CONTACT_PERSONAL_DATA_LEGEND}"
+               title="#{msg.ADMIN_CONTACT_PERSONAL_DATA_LEGEND_TITLE}"
+               rendered="#{empty rendered or rendered}"
+               >
                <p:panelGrid
                        layout="grid"
                        columns="2"
index c551f2899597d7eca5b92a48ad47e873359a4f71..4028b2fbb8168c1e532f5a0c46196e2e9289ea92 100644 (file)
@@ -8,57 +8,59 @@
        xmlns:p="http://primefaces.org/ui"
        >
 
-       <!--
-       @TODO title="#{msg.ADMIN_USER_DATA_EMAIL_LEGEND_TITLE}"
-       -->
-       <ui:fragment rendered="#{not empty mode}">
-               <p:fieldset legend="#{msg.ADMIN_USER_DATA_EMAIL_LEGEND}">
-                       <p:panelGrid
-                               columns="2"
-                               columnClasses="ui-grid-col-4,ui-grid-col-8"
-                               styleClass="ui-noborder"
-                               >
-                               <p:outputLabel for="userName" value="#{msg.ADMIN_PERSONAL_DATA_ENTER_USER_NAME}" />
-                               <p:inputText id="userName" size="20" maxlength="255" value="#{adminUserController.userName}" required="true" requiredMessage="#{msg.ADMIN_USER_NAME_IS_REQUIRED}" />
+       <p:fieldset
+               legend="#{msg.ADMIN_USER_DATA_EMAIL_LEGEND}"
+               title="#{msg.ADMIN_USER_DATA_EMAIL_LEGEND_TITLE}"
+               rendered="#{not empty mode}"
+               >
+               <p:panelGrid
+                       columns="2"
+                       columnClasses="ui-grid-col-4,ui-grid-col-8"
+                       styleClass="ui-noborder"
+                       >
+                       <p:outputLabel for="userName" value="#{msg.ADMIN_PERSONAL_DATA_ENTER_USER_NAME}" />
+                       <p:inputText id="userName" size="20" maxlength="255" value="#{adminUserController.userName}" required="true" requiredMessage="#{msg.ADMIN_USER_NAME_IS_REQUIRED}" />
 
-                               <p:outputLabel for="userPassword" value="#{msg.ADMIN_USER_DATA_ENTER_PASSWORD}" />
-                               <p:inputText type="password" id="userPassword" size="10" maxlength="255" value="#{adminUserController.userPassword}" />
+                       <p:outputLabel for="userPassword" value="#{msg.ADMIN_USER_DATA_ENTER_PASSWORD}" />
+                       <p:inputText type="password" id="userPassword" size="10" maxlength="255" value="#{adminUserController.userPassword}" />
 
-                               <p:outputLabel for="userPasswordRepeat" value="#{msg.ADMIN_USER_DATA_ENTER_PASSWORD_REPEAT}" />
-                               <p:inputText type="password" id="userPasswordRepeat" size="10" maxlength="255" value="#{adminUserController.userPasswordRepeat}" />
+                       <p:outputLabel for="userPasswordRepeat" value="#{msg.ADMIN_USER_DATA_ENTER_PASSWORD_REPEAT}" />
+                       <p:inputText type="password" id="userPasswordRepeat" size="10" maxlength="255" value="#{adminUserController.userPasswordRepeat}" />
 
-                               <p:outputLabel for="userMustChangePassword" value="#{msg.ADMIN_USER_MUST_CHANGE_PASSWORD}" />
-                               <p:selectBooleanCheckbox id="userMustChangePassword" value="#{adminUserController.userMustChangePassword}" />
+                       <p:outputLabel for="userMustChangePassword" value="#{msg.ADMIN_USER_MUST_CHANGE_PASSWORD}" />
+                       <p:selectBooleanCheckbox id="userMustChangePassword" value="#{adminUserController.userMustChangePassword}" />
 
-                               <p:outputLabel for="userProfileMode" value="#{msg.ADMIN_SELECT_USER_PROFILE_MODE}" />
-                               <p:selectOneMenu
-                                       id="userProfileMode"
-                                       value="#{adminUserController.userProfileMode}"
-                                       filter="true"
-                                       filterMatchMode="contains"
-                                       >
+                       <p:outputLabel for="userProfileMode" value="#{msg.ADMIN_SELECT_USER_PROFILE_MODE}" />
+                       <p:selectOneMenu
+                               id="userProfileMode"
+                               value="#{adminUserController.userProfileMode}"
+                               filter="true"
+                               filterMatchMode="contains"
+                               >
 
-                                       <f:selectItem itemValue="#{null}" itemLabel="#{msg.PLEASE_SELECT}" noSelectionOption="true" itemDisabled="true" />
+                               <f:selectItem itemValue="#{null}" itemLabel="#{msg.PLEASE_SELECT}" noSelectionOption="true" itemDisabled="true" />
 
-                                       <f:selectItems
-                                               value="#{dataController.profileModes}"
-                                               var="profileMode"
-                                               itemValue="#{profileMode}"
-                                               itemLabel="#{msg[profileMode.messageKey]}"
-                                               />
-                               </p:selectOneMenu>
-                       </p:panelGrid>
-               </p:fieldset>
+                               <f:selectItems
+                                       value="#{dataController.profileModes}"
+                                       var="profileMode"
+                                       itemValue="#{profileMode}"
+                                       itemLabel="#{msg[profileMode.messageKey]}"
+                                       />
+                       </p:selectOneMenu>
+               </p:panelGrid>
+       </p:fieldset>
 
-               <h:panelGroup styleClass="para notice" layout="block">
-                       <ul>
-                               <li><h:outputText value="#{msg.ADMIN_USER_DATA_USER_NAME_NOTICE}" /></li>
+       <p:fieldset
+               legend="#{msg.ADMIN_USER_DATA_NOTICES_LEGEND}"
+               rendered="#{not empty mode}"
+               >
+               <ul>
+                       <li><h:outputText value="#{msg.ADMIN_USER_DATA_USER_NAME_NOTICE}" /></li>
 
-                               <li>
-                                       <h:outputText value="#{msg.ADMIN_USER_DATA_PASSWORD_EDIT_NOTICE}" rendered="#{mode == 'edit'}" />
-                                       <h:outputText value="#{msg.ADMIN_USER_DATA_PASSWORD_ADD_NOTICE}" rendered="#{mode == 'add'}" />
-                               </li>
-                       </ul>
-               </h:panelGroup>
-       </ui:fragment>
+                       <li>
+                               <h:outputText value="#{msg.ADMIN_USER_DATA_PASSWORD_EDIT_NOTICE}" rendered="#{mode == 'edit'}" />
+                               <h:outputText value="#{msg.ADMIN_USER_DATA_PASSWORD_ADD_NOTICE}" rendered="#{mode == 'add'}" />
+                       </li>
+               </ul>
+       </p:fieldset>
 </ui:composition>
index 8cc47ec8496e266936fa03cbc6bb1430a54d74a7..2864d093a537ad3c326a82aab1b39af4fab8a0b6 100644 (file)
                                filterMatchMode="contains"
                                >
 
-                               <f:converter converterId="EmployeeConverter" />
+                               <f:converter converterId="ContactConverter" />
 
                                <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
 
                                <f:selectItems
-                                       value="#{employeeListController.allEmployees}"
-                                       var="companyEmployee"
-                                       itemValue="#{companyEmployee}"
-                                       itemLabel="#{beanHelper.renderEmployee(companyEmployee, false)}"
+                                       value="#{contactListController.allContacts}"
+                                       var="contact"
+                                       itemValue="#{contact}"
+                                       itemLabel="#{beanHelper.renderContact(contact)}"
                                        />
                        </p:selectOneMenu>
 
                                filterMatchMode="contains"
                                >
 
-                               <f:converter converterId="EmployeeConverter" />
+                               <f:converter converterId="ContactConverter" />
 
                                <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
 
                                <f:selectItems
-                                       value="#{employeeListController.allEmployees}"
-                                       var="companyEmployee"
-                                       itemValue="#{companyEmployee}"
-                                       itemLabel="#{beanHelper.renderEmployee(companyEmployee, false)}"
+                                       value="#{contactListController.allContacts}"
+                                       var="contact"
+                                       itemValue="#{contact}"
+                                       itemLabel="#{beanHelper.renderContact(contact)}"
                                        />
                        </p:selectOneMenu>
 
index 2a8e99badf3a16e35542002b681aefe90e02e2d9..0ef2e0d88c73d243df6f3a5029d0e60a18d374cf 100644 (file)
@@ -20,7 +20,7 @@
                        <p:inputText
                                id="departmentI18nKey"
                                maxlength="255"
-                               value="#{adminDepartmentController.departmentI18nKey}"
+                               value="#{adminDepartmentActionController.departmentI18nKey}"
                                required="true"
                                requiredMessage="#{msg.ADMIN_DEPARTMENT_I18N_KEY_REQUIRED}"
                                />
@@ -28,7 +28,7 @@
                        <p:outputLabel for="departmentCompany" value="#{msg.ADMIN_ASSIGN_DEPARTMENT_COMPANY}" />
                        <p:selectOneMenu
                                id="departmentCompany"
-                               value="#{adminDepartmentController.departmentCompany}"
+                               value="#{adminDepartmentActionController.departmentCompany}"
                                filter="true"
                                filterMatchMode="contains"
                                required="true"
@@ -50,7 +50,7 @@
                        <p:outputLabel for="departmentBranchOffice" value="#{msg.ADMIN_ASSIGN_DEPARTMENT_BRANCH_OFFICE}" />
                        <p:selectOneMenu
                                id="departmentBranchOffice"
-                               value="#{adminDepartmentController.departmentBranchOffice}"
+                               value="#{adminDepartmentActionController.departmentBranchOffice}"
                                filter="true"
                                filterMatchMode="contains"
                                >
@@ -69,7 +69,7 @@
                        <p:outputLabel for="departmentHeadquarter" value="#{msg.ADMIN_ASSIGN_DEPARTMENT_HEADQUARTER}" />
                        <p:selectOneMenu
                                id="departmentHeadquarter"
-                               value="#{adminDepartmentController.departmentHeadquarter}"
+                               value="#{adminDepartmentActionController.departmentHeadquarter}"
                                filter="true"
                                filterMatchMode="contains"
                                >
@@ -89,7 +89,7 @@
                        <p:outputLabel for="departmentLead" value="#{msg.ADMIN_ASSIGN_DEPARTMENT_LEAD_EMPLOYEE}" />
                        <p:selectOneMenu
                                id="departmentLead"
-                               value="#{adminDepartmentController.departmentLead}"
+                               value="#{adminDepartmentActionController.departmentLead}"
                                filter="true"
                                filterMatchMode="contains"
                                >
                                <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
 
                                <f:selectItems
-                                       value="#{employeeListController.allEmployees}"
-                                       var="employee"
-                                       itemValue="#{employee}"
-                                       itemLabel="#{beanHelper.renderEmployee(employee, false)}"
+                                       value="#{contactListController.allContacts}"
+                                       var="contact"
+                                       itemValue="#{contact}"
+                                       itemLabel="#{beanHelper.renderContact(contact)}"
                                        />
                        </p:selectOneMenu>
 
                        <p:outputLabel for="departmentUserOwner" value="#{msg.ADMIN_ASSIGN_DEPARTMENT_USER_OWNER}" />
                        <p:selectOneMenu
                                id="departmentUserOwner"
-                               value="#{adminDepartmentController.departmentUserOwner}"
+                               value="#{adminDepartmentActionController.departmentUserOwner}"
                                filter="true"
                                filterMatchMode="contains"
                                >
index 7e2dd3f7ae820020b2afd40df91166ade727afe5..3efb0ef94e5033d256e61dc986e267947581b0c7 100644 (file)
@@ -1,7 +1,4 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<!--
-@TODO title="#{msg.ADMIN_EMPLOYEE_GENERAL_LEGEND_TITLE}"
--->
 <ui:composition
        xmlns="http://www.w3.org/1999/xhtml"
        xmlns:core="http://mxchange.org/jsf/core/widgets"
@@ -11,7 +8,10 @@
        xmlns:p="http://primefaces.org/ui"
        >
 
-       <p:fieldset legend="#{msg.ADMIN_EMPLOYEE_GENERAL_LEGEND}">
+       <p:fieldset
+               legend="#{msg.ADMIN_EMPLOYEE_GENERAL_LEGEND}"
+               title="#{msg.ADMIN_EMPLOYEE_GENERAL_LEGEND_TITLE}"
+               >
                <p:panelGrid
                        layout="grid"
                        columns="2"
                </p:panelGrid>
        </p:fieldset>
 
-       <!--
-       @TODO title="#{msg.ADMIN_EMPLOYEE_OTHER_LEGEND_TITLE}"
-       -->
-       <p:fieldset legend="#{msg.ADMIN_EMPLOYEE_OTHER_LEGEND}">
+       <p:fieldset
+               legend="#{msg.ADMIN_EMPLOYEE_OTHER_LEGEND}"
+               title="#{msg.ADMIN_EMPLOYEE_OTHER_LEGEND_TITLE}"
+               >
                <p:panelGrid
                        layout="grid"
                        columns="2"
index 5035f1199af97041f5004a62720e049be56b11da..39970174a4109ffaa83a6be0eb7fdd31a963430c 100644 (file)
                                filterMatchMode="contains"
                                >
 
-                               <f:converter converterId="EmployeeConverter" />
+                               <f:converter converterId="ContactConverter" />
 
                                <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
 
                                <f:selectItems
-                                       value="#{employeeListController.allEmployees}"
-                                       var="companyEmployee"
-                                       itemValue="#{companyEmployee}"
-                                       itemLabel="#{beanHelper.renderEmployee(companyEmployee, false)}"
+                                       value="#{contactListController.allContacts}"
+                                       var="contact"
+                                       itemValue="#{contact}"
+                                       itemLabel="#{beanHelper.renderContact(contact)}"
                                        />
                        </p:selectOneMenu>
 
index f491f4d0e4726525330fa536ac1965db345f8e64..3eb65bed7b25f7daf9eec31e40efe5be29c8cae4 100644 (file)
                                                        updateLabel="true"
                                                        title="#{msg.FILTER_BY_MULTIPLE_EMPLOYEES_TITLE}"
                                                        >
-                                                       <f:converter converterId="EmployeeConverter" />
+                                                       <f:converter converterId="ContactConverter" />
 
                                                        <f:selectItems
-                                                               value="#{employeeListController.allEmployees}"
-                                                               var="employee"
-                                                               itemValue="#{employee}"
-                                                               itemLabel="#{beanHelper.renderEmployee(employee, false)}"
+                                                               value="#{contactListController.allContacts}"
+                                                               var="contact"
+                                                               itemValue="#{contact}"
+                                                               itemLabel="#{beanHelper.renderContact(contact)}"
                                                                />
                                                </p:selectCheckboxMenu>
                                        </f:facet>
 
                                        <p:link
-                                               outcome="admin_show_employee"
-                                               value="#{beanHelper.renderEmployee(branchOffice.branchContactEmployee, false)}"
+                                               outcome="admin_show_contact"
+                                               value="#{beanHelper.renderContact(branchOffice.branchContactEmployee)}"
                                                title="#{msg.ADMIN_LINK_SHOW_BRANCH_OFFICE_CONTACT_PERSON_TITLE}"
                                                rendered="#{not empty branchOffice.branchContactEmployee}"
                                                >
-                                               <f:param name="employeeId" value="#{branchOffice.branchContactEmployee.employeeId}" />
+                                               <f:param name="contactId" value="#{branchOffice.branchContactEmployee.contactId}" />
                                        </p:link>
 
                                        <p:link
-                                               outcome="admin_assign_branch_office_employee"
+                                               outcome="admin_assign_branch_office_contact"
                                                value="#{msg.ADMIN_LINK_ASSIGN}"
                                                title="#{msg.ADMIN_LINK_ASSIGN_BRANCH_OFFICES_CONTACT_PERSON_TITLE}"
                                                rendered="#{empty branchOffice.branchContactEmployee}"
 
                                                                <p:outputLabel value="#{msg.ASSIGNED_CONTACT_PERSON_HEADER}" title="#{msg.ASSIGNED_CONTACT_PERSON_TO_BRANCH_OFFICE_TITLE}" />
                                                                <p:link
-                                                                       outcome="admin_show_employee"
+                                                                       outcome="admin_show_contact"
                                                                        target="_blank"
-                                                                       value="#{beanHelper.renderEmployee(branchOfficeListController.selectedBranchOffice.branchContactEmployee, true)}"
+                                                                       value="#{beanHelper.renderContact(branchOfficeListController.selectedBranchOffice.branchContactEmployee)}"
                                                                        title="#{msg.ADMIN_LINK_SHOW_BRANCH_OFFICE_CONTACT_PERSON_TITLE}"
                                                                        rendered="#{not empty branchOfficeListController.selectedBranchOffice.branchContactEmployee}"
                                                                        >
-                                                                       <f:param name="employeeId" value="#{branchOfficeListController.selectedBranchOffice.branchContactEmployee.employeeId}" />
+                                                                       <f:param name="contactId" value="#{branchOfficeListController.selectedBranchOffice.branchContactEmployee.contactId}" />
                                                                </p:link>
                                                                <h:outputText value="#{msg.NO_CONTACT_EMPLOYEE_ASSIGNED_TO_BRANCH_OFFICE}" rendered="#{empty branchOfficeListController.selectedBranchOffice.branchContactEmployee}" />
 
                                                                <p:outputLabel value="#{msg.ASSIGNED_OWNER_EMPLOYEE_HEADER}" title="#{msg.ASSIGNED_OWNER_EMPLOYEE_TO_BRANCH_OFFICE_TITLE}" />
                                                                <p:link
-                                                                       outcome="admin_show_employee"
+                                                                       outcome="admin_show_contact"
                                                                        target="_blank"
-                                                                       value="#{beanHelper.renderEmployee(branchOfficeListController.selectedBranchOffice.branchOwnerEmployee, true)}"
+                                                                       value="#{beanHelper.renderContact(branchOfficeListController.selectedBranchOffice.branchOwnerEmployee)}"
                                                                        title="#{msg.ADMIN_LINK_SHOW_BRANCH_OFFICE_OWNER_EMPLOYEE_TITLE}"
                                                                        rendered="#{not empty branchOfficeListController.selectedBranchOffice.branchOwnerEmployee}"
                                                                        >
-                                                                       <f:param name="employeeId" value="#{branchOfficeListController.selectedBranchOffice.branchContactEmployee.employeeId}" />
+                                                                       <f:param name="contactId" value="#{branchOfficeListController.selectedBranchOffice.branchContactEmployee.contactId}" />
                                                                </p:link>
                                                                <h:outputText value="#{msg.NO_OWNER_EMPLOYEE_ASSIGNED_TO_BRANCH_OFFICE}" rendered="#{empty branchOfficeListController.selectedBranchOffice.branchOwnerEmployee}" />
 
diff --git a/web/admin/department/admin_department_edit.xhtml b/web/admin/department/admin_department_edit.xhtml
new file mode 100644 (file)
index 0000000..fd1917d
--- /dev/null
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ui:composition
+       template="/WEB-INF/templates/admin/admin_base.tpl"
+       xmlns="http://www.w3.org/1999/xhtml"
+       xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
+       xmlns:h="http://xmlns.jcp.org/jsf/html"
+       xmlns:f="http://xmlns.jcp.org/jsf/core"
+       xmlns:p="http://primefaces.org/ui"
+       >
+
+       <ui:define name="metadata">
+               <f:metadata>
+                       <f:viewParam
+                               name="departmentId"
+                               value="#{adminDepartmentActionController.currentDepartment}"
+                               converter="DepartmentConverter"
+                               required="true"
+                               requiredMessage="#{msg.ERROR_PARAMETER_DEPARTMENT_ID_NOT_SET}"
+                               converterMessage="#{msg.PARAMETER_DEPARTMENT_ID_INVALID}"
+                               />
+
+                       <f:viewAction
+                               action="#{adminDepartmentActionController.copyAllDepartmentProperties()}"
+                               />
+               </f:metadata>
+       </ui:define>
+
+       <ui:define name="document_admin_title">
+               <h:outputText value="#{msg.PAGE_TITLE_ADMIN_EDIT_DEPARTMENT}" />
+       </ui:define>
+
+       <ui:define name="content_header">
+               <h:outputText value="#{msg.CONTENT_TITLE_ADMIN_EDIT_DEPARTMENT}" />
+       </ui:define>
+
+       <ui:define name="content">
+               <h:form
+                       id="form-admin-edit-department"
+                       rendered="#{not empty adminDepartmentActionController.currentDepartment}"
+                       >
+                       <h:inputHidden value="#{adminDepartmentActionController.departmentId}" />
+
+                       <p:panelGrid
+                               columns="1"
+                               layout="grid"
+                               >
+                               <f:facet name="header">
+                                       <h:outputFormat
+                                               value="#{msg.ADMIN_EDIT_DEPARTMENT_TITLE}"
+                                               title="#{beanHelper.renderDepartment(adminDepartmentActionController.currentDepartment, false)}"
+                                               >
+                                               <f:param value="#{local[adminDepartmentActionController.departmentI18nKey]}" />
+                                               <f:param value="#{adminDepartmentActionController.departmentId}" />
+                                       </h:outputFormat>
+                               </f:facet>
+
+                               <h:panelGroup styleClass="para" layout="block">
+                                       <h:outputText value="#{msg.ADMIN_DEPARTMENT_MINIMUM_DATA}" />
+                               </h:panelGroup>
+
+                               <ui:include src="/WEB-INF/templates/admin/department/admin_form_department_data.tpl" />
+
+                               <f:facet name="footer">
+                                       <p:panelGrid columns="2" layout="grid">
+                                               <p:commandButton
+                                                       type="reset"
+                                                       value="#{msg.BUTTON_RESET_FORM}"
+                                                       />
+
+                                               <p:commandButton
+                                                       type="submit"
+                                                       value="#{msg.BUTTON_ADMIN_EDIT_DEPARTMENT}"
+                                                       action="#{adminDepartmentActionController.updateDepartment()}"
+                                                       />
+                                       </p:panelGrid>
+                               </f:facet>
+                       </p:panelGrid>
+               </h:form>
+       </ui:define>
+</ui:composition>
index 807e1628b4280d00ee5f4e8423710a71c51777f1..f64afc28da8ca6daaeddbfb29de3c4a0eb959629 100644 (file)
 
                                <p:column
                                        headerText="#{msg.ADMIN_DEPARTMENT_LEAD_EMPLOYEE}"
-                                       sortBy="#{department.departmentLead.employeePersonalData.contactFamilyName}"
+                                       sortBy="#{department.departmentLead.contactFamilyName}"
                                        filterBy="#{department.departmentLead}"
                                        filterMatchMode="in"
                                        >
                                                        updateLabel="true"
                                                        title="#{msg.FILTER_BY_MULTIPLE_EMPLOYEES_TITLE}"
                                                        >
-                                                       <f:converter converterId="EmployeeConverter" />
+                                                       <f:converter converterId="ContactConverter" />
 
                                                        <f:selectItems
-                                                               value="#{employeeListController.allEmployees}"
-                                                               var="employee"
-                                                               itemValue="#{employee}"
-                                                               itemLabel="#{beanHelper.renderEmployee(employee, false, false)}"
+                                                               value="#{contactListController.allContacts}"
+                                                               var="contact"
+                                                               itemValue="#{contact}"
+                                                               itemLabel="#{beanHelper.renderContact(contact)}"
                                                                />
                                                </p:selectCheckboxMenu>
                                        </f:facet>
 
                                        <p:link
-                                               outcome="admin_show_employee"
-                                               value="#{beanHelper.renderEmployee(department.departmentLead, true)}"
-                                               title="#{msg.ADMIN_LINK_SHOW_DEPARTMENT_LEAD_EMPLOYEE_TITLE}"
+                                               outcome="admin_show_contact"
+                                               value="#{beanHelper.renderContact(department.departmentLead)}"
+                                               title="#{msg.ADMIN_LINK_SHOW_DEPARTMENT_LEAD_CONTACT_TITLE}"
                                                rendered="#{not empty department.departmentLead}"
                                                >
-                                               <f:param name="employeeId" value="#{department.departmentLead.employeeId}" />
+                                               <f:param name="contactId" value="#{department.departmentLead.contactId}" />
                                        </p:link>
 
                                        <p:link
-                                               outcome="admin_assign_department_employee"
+                                               outcome="admin_assign_department_lead"
                                                value="#{msg.ADMIN_LINK_ASSIGN}"
-                                               title="#{msg.ADMIN_LINK_ASSIGN_DEPARTMENTS_LEAD_EMPLOYEE_TITLE}"
+                                               title="#{msg.ADMIN_LINK_ASSIGN_DEPARTMENTS_LEAD_CONTACT_TITLE}"
                                                rendered="#{empty department.departmentLead}"
                                                >
                                                <f:param name="departmentId" value="#{department.departmentId}" />
                                                <p:commandButton
                                                        type="submit"
                                                        value="#{msg.BUTTON_ADMIN_ADD_DEPARTMENT_DATA}"
-                                                       action="#{adminDepartmentController.addDepartment()}"
+                                                       action="#{adminDepartmentActionController.addDepartment()}"
                                                        update="form-list-departments:departmentList"
                                                        />
                                        </p:panelGrid>
index f8f18a88436abaefd8aa9de1deae17829672d18e..c19e0f27cc5a37fff97d2aa67cb63effce9f5b40 100644 (file)
@@ -2,7 +2,6 @@
 <ui:composition
        template="/WEB-INF/templates/admin/admin_base.tpl"
        xmlns="http://www.w3.org/1999/xhtml"
-       xmlns:links="http://mxchange.org/jsf/core/links"
        xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
        xmlns:h="http://xmlns.jcp.org/jsf/html"
        xmlns:f="http://xmlns.jcp.org/jsf/core"
                                                        updateLabel="true"
                                                        title="#{msg.FILTER_BY_MULTIPLE_EMPLOYEES_TITLE}"
                                                        >
-                                                       <f:converter converterId="EmployeeConverter" />
+                                                       <f:converter converterId="ContactConverter" />
 
                                                        <f:selectItems
-                                                               value="#{employeeListController.allEmployees}"
-                                                               var="employee"
-                                                               itemValue="#{employee}"
-                                                               itemLabel="#{beanHelper.renderEmployee(employee, false)}"
+                                                               value="#{contactListController.allContacts}"
+                                                               var="contact"
+                                                               itemValue="#{contact}"
+                                                               itemLabel="#{beanHelper.renderContact(contact)}"
                                                                />
                                                </p:selectCheckboxMenu>
                                        </f:facet>
 
                                        <p:link
-                                               outcome="admin_show_employee"
-                                               value="#{beanHelper.renderEmployee(headquarter.headquarterContactEmployee, false)}"
+                                               outcome="admin_show_contact"
+                                               value="#{beanHelper.renderContact(headquarter.headquarterContactEmployee)}"
                                                title="#{msg.ADMIN_LINK_SHOW_HEADQUARTER_CONTACT_PERSON_TITLE}"
                                                rendered="#{not empty headquarter.headquarterContactEmployee}"
                                                >
-                                               <f:param name="employeeId" value="#{headquarter.headquarterContactEmployee.employeeId}" />
+                                               <f:param name="contactId" value="#{headquarter.headquarterContactEmployee.contactId}" />
                                        </p:link>
 
                                        <p:link
-                                               outcome="admin_assign_headquarter_employee"
+                                               outcome="admin_assign_headquarter_contact"
                                                value="#{msg.ADMIN_LINK_ASSIGN}"
                                                title="#{msg.ADMIN_LINK_ASSIGN_HEADQUARTER_CONTACT_PERSON_TITLE}"
                                                rendered="#{empty headquarter.headquarterContactEmployee}"
index 884aae50af07527b7e8f17dacfc137a1d4c9a36c..a3fed78d7734eb71024d3584f7571fed676acad2 100644 (file)
                                        <h:outputText value="#{msg.ADMIN_ADD_USER_TITLE}" />
                                </f:facet>
 
-                               <!-- Whether select contact data .. //-->
-                               <!--
-                               @TODO title="#{msg.ADMIN_SELECT_USER_CONTACT_LEGEND_TITLE}"
-                               -->
-                               <p:fieldset legend="#{msg.ADMIN_SELECT_USER_CONTACT_LEGEND}">
+                               <p:fieldset
+                                       legend="#{msg.ADMIN_SELECT_USER_CONTACT_LEGEND}"
+                                       title="#{msg.ADMIN_SELECT_USER_CONTACT_LEGEND_TITLE}"
+                                       >
                                        <p:panelGrid
                                                columns="2"
                                                columnClasses="ui-grid-col-3,ui-grid-col-9"