]> git.mxchange.org Git - jjobs-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Fri, 29 Sep 2017 23:06:00 +0000 (01:06 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 19 Jul 2019 22:32:13 +0000 (00:32 +0200)
- removed no longer used backing bean injections, may reduce memory footprint
- added project-specific JSF taglib
- made long one-line p:selectCheckboxMenu into multi-line to have it easier
  updated
- renamed *_BRANCH_OFFICES_* to *_BRANCH_OFFICE_*
- added missing i18n strings

Signed-off-by: Roland Häder <roland@mxchange.org>
13 files changed:
src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebRequestBean.java
src/java/org/mxchange/jjobs/beans/country/JobsCountryWebRequestBean.java
src/java/org/mxchange/jjobs/beans/helper/JobsWebRequestHelperBean.java
src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java
src/java/org/mxchange/jjobs/beans/user/JobsUserWebRequestBean.java
src/java/org/mxchange/jjobs/beans/user/register/JobsUserRegisterWebRequestBean.java
src/java/org/mxchange/jjobs/beans/user/resendlink/JobsResendLinkWebRequestBean.java
src/java/org/mxchange/localization/bundle_de_DE.properties
src/java/org/mxchange/localization/bundle_en_US.properties
web/WEB-INF/project-links.jsf.taglib.xml [new file with mode: 0644]
web/WEB-INF/templates/admin/admin_menu.tpl
web/WEB-INF/web.xml
web/admin/branch_office/admin_branch_office_list.xhtml

index 9a0817e93f8a3797e9cadb4ae1a6f9670be46efd..e730dd54e51bf15dd00d6d32b18afe91ac288034 100644 (file)
@@ -29,6 +29,9 @@ import javax.inject.Named;
 import org.mxchange.jcountry.events.AdminAddedCountryEvent;
 import org.mxchange.jcountry.events.ObservableAdminAddedCountryEvent;
 import org.mxchange.jcountry.exceptions.CountryAlreadyAddedException;
+import org.mxchange.jcountry.model.data.Country;
+import org.mxchange.jcountry.model.data.CountryData;
+import org.mxchange.jcountry.model.data.CountrySingletonBeanRemote;
 import org.mxchange.jjobs.beans.BaseJobsBean;
 
 /**
index e028d395a1fdf3822dcae92cacc06e8c488eecce..94a27c29963e2ef1832b08dc6505c02ca381e10b 100644 (file)
@@ -31,7 +31,6 @@ import javax.inject.Named;
 import org.mxchange.jcountry.events.ObservableAdminAddedCountryEvent;
 import org.mxchange.jcountry.model.data.Country;
 import org.mxchange.jcountry.model.data.CountrySingletonBeanRemote;
-import org.mxchange.jcountry.events.ObservableAdminAddedCountryEvent;
 import org.mxchange.jjobs.beans.BaseJobsBean;
 
 /**
index 7b531d19512063ec66843024a08522da62b97f75..e7e6b3ddb9e66d5f98bc6bbd82cadfc4e4d21e12 100644 (file)
@@ -27,11 +27,9 @@ import org.mxchange.jcontacts.events.contact.created.ObservableCreatedContactEve
 import org.mxchange.jcontacts.model.contact.Contact;
 import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
 import org.mxchange.jcontactsbusiness.model.department.Department;
+import org.mxchange.jcontactsbusiness.model.employee.Employee;
 import org.mxchange.jcontactsbusiness.model.headquarters.HeadquartersData;
 import org.mxchange.jjobs.beans.BaseJobsBean;
-import org.mxchange.jjobs.beans.contact.JobsAdminContactWebRequestController;
-import org.mxchange.jjobs.beans.phone.JobsAdminPhoneWebRequestController;
-import org.mxchange.jjobs.beans.user.JobsAdminUserWebRequestController;
 import org.mxchange.jjobs.beans.user.JobsUserWebRequestController;
 import org.mxchange.jphone.events.fax.created.CreatedFaxNumberEvent;
 import org.mxchange.jphone.events.fax.created.ObservableCreatedFaxNumberEvent;
@@ -65,24 +63,6 @@ public class JobsWebRequestHelperBean extends BaseJobsBean implements JobsWebReq
         */
        private static final long serialVersionUID = 17_258_793_567_145_701L;
 
-       /**
-        * Administrative contact controller
-        */
-       @Inject
-       private JobsAdminContactWebRequestController adminContactController;
-
-       /**
-        * Administrative phone controller
-        */
-       @Inject
-       private JobsAdminPhoneWebRequestController adminPhoneController;
-
-       /**
-        * Administrative user controller
-        */
-       @Inject
-       private JobsAdminUserWebRequestController adminUserController;
-
        /**
         * Contact instance
         */
@@ -541,8 +521,44 @@ public class JobsWebRequestHelperBean extends BaseJobsBean implements JobsWebReq
        }
 
        /**
-        * Returns the headquarters' address. If null is
-        * provided, an empty string is returned.
+        * Returns the employee's number, personal title, family name and name if
+        * available. If null is provided, an empty string is returned.
+        * <p>
+        * @param employee Employee instance
+        * <p>
+        * @return Contact's full name
+        */
+       public String renderEmployee (final Employee employee) {
+               // Default is empty string, so let's get started
+               final StringBuilder sb = new StringBuilder(20);
+
+               // Is employee set?
+               if (employee instanceof Employee) {
+                       // Then create name
+                       sb.append(employee.getEmployeeNumber());
+
+                       // Is contact data found?
+                       if (employee.getEmployeePersonalData() instanceof Contact) {
+                               // Yes, then render it
+                               final String contactName = this.renderContact(employee.getEmployeePersonalData());
+
+                               // Is it given?
+                               if (contactName != null) {
+                                       // Then add it
+                                       sb.append(" ("); //NOI18N
+                                       sb.append(contactName);
+                                       sb.append(")"); //NOI18N
+                               }
+                       }
+               }
+
+               // Return it
+               return sb.toString();
+       }
+
+       /**
+        * Returns the headquarters' address. If null is provided, an empty string
+        * is returned.
         * <p>
         * @param headquarters Headquarters instance
         * <p>
index d0fc3a2924846014c05f5a776b47b6571461f44e..0a521a0e6dc6e3ff7f9a7107dae4f81f6acbfa65 100644 (file)
@@ -68,11 +68,6 @@ import org.mxchange.jphone.model.phonenumbers.phone.AdminPhoneSessionBeanRemote;
 @RequestScoped
 public class JobsAdminPhoneWebRequestBean extends BaseJobsBean implements JobsAdminPhoneWebRequestController {
 
-       /**
-        * Call-stack position
-        */
-       private static final short THREAD_STACK = 5;
-
        /**
         * Serial number
         */
@@ -211,9 +206,6 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsBean implements JobsAd
        public JobsAdminPhoneWebRequestBean () {
                // Call super constructor
                super();
-
-               // String caller = MessageFormat.format("{0}.{1}", Thread.currentThread().getStackTrace()[3].getClassName(), Thread.currentThread().getStackTrace()[3].getMethodName());
-               // System.out.println(MessageFormat.format("{0}: Constructed, caller: {1}", this.getClass().getSimpleName(), caller));
        }
 
        /**
index dd1deb9ba2826121a6b9efdc8d9f8bdc9812aa18..b26a455d6812d35ddd299b5a4f684ccfb146c888 100644 (file)
@@ -39,7 +39,6 @@ import org.mxchange.jcoreee.events.locale.ObservableLocaleChangeEvent;
 import org.mxchange.jjobs.beans.BaseJobsBean;
 import org.mxchange.jjobs.beans.contact.JobsContactWebRequestController;
 import org.mxchange.jjobs.beans.features.JobsFeaturesWebApplicationController;
-import org.mxchange.jjobs.beans.localization.JobsLocalizationSessionController;
 import org.mxchange.jjobs.beans.user.login.JobsUserLoginWebSessionController;
 import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
 import org.mxchange.jusercore.events.user.clear.password.ObservableClearUserPasswordEvent;
@@ -96,12 +95,6 @@ public class JobsUserWebRequestBean extends BaseJobsBean implements JobsUserWebR
         */
        private Locale locale;
 
-       /**
-        * Localization controller
-        */
-       @Inject
-       private JobsLocalizationSessionController localizationController;
-
        /**
         * Event being fired when user updated personal data
         */
index 74bae16e4b0e98bdc4505d964bc9ff1940cd416e..3bdf7f5ec127469db303bf75632632ac4ddd93dc 100644 (file)
@@ -29,7 +29,6 @@ import org.mxchange.jcoreee.utils.FacesUtils;
 import org.mxchange.jjobs.beans.BaseJobsBean;
 import org.mxchange.jjobs.beans.contact.JobsContactWebRequestController;
 import org.mxchange.jjobs.beans.features.JobsFeaturesWebApplicationController;
-import org.mxchange.jjobs.beans.user.JobsAdminUserWebRequestController;
 import org.mxchange.jjobs.beans.user.JobsUserWebRequestController;
 import org.mxchange.jusercore.events.user.clear.password.ClearUserPasswordEvent;
 import org.mxchange.jusercore.events.user.clear.password.ObservableClearUserPasswordEvent;
@@ -63,12 +62,6 @@ public class JobsUserRegisterWebRequestBean extends BaseJobsBean implements Jobs
         */
        private static final long serialVersionUID = 47_828_986_719_691_592L;
 
-       /**
-        * Administrative user controller
-        */
-       @Inject
-       private JobsAdminUserWebRequestController adminUserController;
-
        /**
         * An event being fired when a user name should be cleared
         */
index c58a92e6c355cc9150bafd63ef4494f89a55e10e..5b4d7ad3c20e2a22d302f53ac8b2bacf08cfb413 100644 (file)
@@ -27,7 +27,6 @@ import javax.inject.Named;
 import org.mxchange.jcoreee.events.locale.ObservableLocaleChangeEvent;
 import org.mxchange.jcoreee.utils.FacesUtils;
 import org.mxchange.jjobs.beans.BaseJobsBean;
-import org.mxchange.jjobs.beans.localization.JobsLocalizationSessionController;
 import org.mxchange.jjobs.beans.user.JobsUserWebRequestController;
 import org.mxchange.jusercore.exceptions.UserEmailAddressNotFoundException;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
@@ -63,12 +62,6 @@ public class JobsResendLinkWebRequestBean extends BaseJobsBean implements JobsRe
         */
        private Locale locale;
 
-       /**
-        * Localization controller
-        */
-       @Inject
-       private JobsLocalizationSessionController localizationController;
-
        /**
         * EJB for resending confirmation link
         */
index 69981ddbab64dfcdc4b82ef1bde350bf67a3f99f..05ff570597c2c0b12765c2bc98021b9d811a023d 100644 (file)
@@ -918,9 +918,9 @@ ADMIN_BRANCH_OFFICE_ZIP_CODE_REQUIRED=Bitte geben Sie die Postleitzahl zur Filia
 ADMIN_BRANCH_OFFICE_CITY_REQUIRED=Bitte geben Sie die Stadt der Filiale ein.
 ADMIN_BRANCH_OFFICE_ALREADY_CREATED=Eine Filiale existiert bereits mit den angegebenen Daten.
 ADMIN_LINK_SHOW_BRANCH_OFFICE_TITLE=Zeigt Details dieser Filiale an.
-ADMIN_LINK_SHOW_BRANCH_OFFICES_OWNER_USER_TITLE=Zeigt das Benutzerprofil des Besitzers des Filialeintrages an.
+ADMIN_LINK_SHOW_BRANCH_OFFICE_OWNER_USER_TITLE=Zeigt das Benutzerprofil des Besitzers des Filialeintrages an.
 ADMIN_LINK_ASSIGN_BRANCH_OFFICES_OWNER_USER_TITLE=Dieser Filiale einen Benutzer als Besitzer zuweisen.
-ADMIN_LINK_SHOW_BRANCH_OFFICES_CONTACT_PERSON_TITLE=Zeit die Daten der Kontaktperson dieser Filiale an.
+ADMIN_LINK_SHOW_BRANCH_OFFICE_CONTACT_PERSON_TITLE=Zeit die Daten der Kontaktperson dieser Filiale an.
 ADMIN_LINK_ASSIGN_BRANCH_OFFICES_CONTACT_PERSON_TITLE=Einen Mitarbeiter als Kontaktperson dieser Filiale zuweisen.
 NO_EMAIL_ADDRESS_ENTERED=Keine Email-Adresse eingegeben.
 DATA_ADDRESS=Adresse
@@ -981,7 +981,7 @@ SELECT_SHOWN_COLUMNS=Angezeigte Spalten
 ADMIN_LIST_BRANCH_OFFICES_HEADER=Alle Filialen auflisten
 LABEL_USERS=Benutzer
 FILTER_BY_MULTIPLE_USERS_TITLE=Liste durch Auswahl von ein oder mehr Benutzern durchsuchen.
-LABEL_COMPANIES=Firmen
+LABEL_COMPANIES=Unternehmen
 FILTER_BY_MULTIPLE_COMPANIES_TITLE=Liste durch Auswahl von ein oder mehr Unternehmen durchsuchen.
 LABEL_COMPANY_EMPLOYEES=Mitarbeiter
 FILTER_BY_MULTIPLE_COMPANY_EMPLOYEES_TITLE=Liste durch Auswahl von ein oder mehr Mitarbeiter durchsuchen.
@@ -1026,3 +1026,7 @@ ADMIN_ASSIGN_COMPANY_EMPLOYEE_HEADQUARTERS=Hauptsitz einem Mitarbeiter zuweisen:
 ADMIN_ENTER_COMPANY_EMPLOYEE_MOBILE_NUMBER=Geschaefliche Mobilfunknummer des Mitarbeiters eingeben:
 ADMIN_COMPANY_EMPLOYEE_GENERAL_LEGEND=Allgemeine Daten des Mitarbeiters:
 ADMIN_COMPANY_EMPLOYEE_GENERAL_LEGEND_TITLE=Geben Sie hier die generellen Daten des Mitarbeiters an.
+ADMIN_ASSIGNED_BRANCH_OFFICE=Zugewiesene Filiale:
+LABEL_BRANCH_OFFICES=Filialen
+ADMIN_DATE_OF_ISSUE=Ausstellungsdatum:
+ADMIN_PAYMENT_TYPE=Zahlungsmethode:
index 68279e60d17b0a73c72b4140be0231612d231f6d..22e3ec661ce52d15caa562588439c84607854f62 100644 (file)
@@ -896,9 +896,9 @@ ADMIN_BRANCH_OFFICE_ZIP_CODE_REQUIRED=Please enter ZIP code for the branch offic
 ADMIN_BRANCH_OFFICE_CITY_REQUIRED=Please enter city for the branch office.
 ADMIN_BRANCH_OFFICE_ALREADY_CREATED=A branch office with same data already exists.
 ADMIN_LINK_SHOW_BRANCH_OFFICE_TITLE=Show details of this branch office.
-ADMIN_LINK_SHOW_BRANCH_OFFICES_OWNER_USER_TITLE=Show the profile of the branch office entry owning user.
+ADMIN_LINK_SHOW_BRANCH_OFFICE_OWNER_USER_TITLE=Show the profile of the branch office entry owning user.
 ADMIN_LINK_ASSIGN_BRANCH_OFFICES_OWNER_USER_TITLE=Assign a user as owner to this branch office.
-ADMIN_LINK_SHOW_BRANCH_OFFICES_CONTACT_PERSON_TITLE=Shows contact data of this branch office's contact person.
+ADMIN_LINK_SHOW_BRANCH_OFFICE_CONTACT_PERSON_TITLE=Shows contact data of this branch office's contact person.
 ADMIN_LINK_ASSIGN_BRANCH_OFFICES_CONTACT_PERSON_TITLE=Assign a company employee as contact person for this branch office.
 NO_EMAIL_ADDRESS_ENTERED=No email address entered.
 DATA_ADDRESS=Address
@@ -980,3 +980,7 @@ ADMIN_ASSIGN_COMPANY_EMPLOYEE_HEADQUARTERS=Assign headquarters to employee:
 ADMIN_ENTER_COMPANY_EMPLOYEE_MOBILE_NUMBER=Enter business mobile number of employee:
 ADMIN_COMPANY_EMPLOYEE_GENERAL_LEGEND=General data of employee:
 ADMIN_COMPANY_EMPLOYEE_GENERAL_LEGEND_TITLE=You can enter here the general data of the employee.
+ADMIN_ASSIGNED_BRANCH_OFFICE=Assigned branch office:
+LABEL_BRANCH_OFFICES=Branch offices
+ADMIN_DATE_OF_ISSUE=Issue date:
+ADMIN_PAYMENT_TYPE=Payment type:
diff --git a/web/WEB-INF/project-links.jsf.taglib.xml b/web/WEB-INF/project-links.jsf.taglib.xml
new file mode 100644 (file)
index 0000000..68bbe31
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (C) 2017 Roland Häder
+
+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/>.
+-->
+<facelet-taglib version="2.2"
+                               xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+                               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+                               xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facelettaglibrary_2_2.xsd">
+       <namespace>http://mxchange.org/jsf/jfinancials/links</namespace>
+</facelet-taglib>
index 870647c04f32bb55ffba8be9f376c106b09e8476..4db9edbd9e704c1a3c8659f23e9b937e00dcf371 100644 (file)
@@ -27,7 +27,7 @@
 
                        <p:submenu label="#{msg.ADMIN_MENU_BASIC_COMPANY_DATA_TITLE}" rendered="#{featureController.isFeatureEnabled('basic_company_data')}">
                                <p:menuitem title="#{msg.ADMIN_LINK_LIST_BASIC_COMPANY_DATA_TITLE}" outcome="admin_list_basic_company_data" value="#{msg.ADMIN_LINK_LIST_BASIC_COMPANY_DATA}" />
-                               <p:menuitem title="#{msg.ADMIN_LINK_LIST_BRANCH_OFFICES_TITLE}" outcome="admin_list_branch_office" value="#{msg.ADMIN_LINK_LIST_BRANCH_OFFICES}" />
+                               <p:menuitem title="#{msg.ADMIN_LINK_LIST_BRANCH_OFFICE_TITLE}" outcome="admin_list_branch_office" value="#{msg.ADMIN_LINK_LIST_BRANCH_OFFICES}" />
                        </p:submenu>
 
                        <p:submenu label="#{msg.ADMIN_MENU_COMPANY_EMPLOYEE_TITLE}" rendered="#{featureController.isFeatureEnabled('company_employee')}">
index ae2ea043d6110a43dbd04f80dbc3793bc9c97d16..d471bb7b8da293dd228449d7770f9c94733c0d49 100644 (file)
@@ -30,7 +30,7 @@
     <context-param>
         <description>Generic custom JSF tags library</description>
         <param-name>javax.faces.FACELETS_LIBRARIES</param-name>
-        <param-value>/WEB-INF/widgets.jsf.taglib.xml;/WEB-INF/links.jsf.taglib.xml</param-value>
+        <param-value>/WEB-INF/widgets.jsf.taglib.xml;/WEB-INF/links.jsf.taglib.xml;/WEB-INF/project-links.jsf.taglib.xml</param-value>
     </context-param>
     <context-param>
         <description>Project stage</description>
index 9c91c1849eadf58a0beb95be4793b3cc1f0a5b67..8ff058ba13e2fabf0bbcb828b60b1b8aba096ce5 100644 (file)
 
                                <p:column headerText="#{msg.ADMIN_ASSIGNED_USER}" sortBy="#{branchOffice.branchUserOwner.userName}" filterBy="#{branchOffice.branchUserOwner}" filterMatchMode="in">
                                        <f:facet name="filter">
-                                               <p:selectCheckboxMenu filter="true" filterMatchMode="contains" label="#{msg.LABEL_USERS}" onchange="PF('branchOfficeTable').filter()" updateLabel="true" title="#{msg.FILTER_BY_MULTIPLE_USERS_TITLE}">
+                                               <p:selectCheckboxMenu
+                                                       filter="true"
+                                                       filterMatchMode="contains"
+                                                       label="#{msg.LABEL_USERS}"
+                                                       onchange="PF('branchOfficeList').filter()"
+                                                       updateLabel="true"
+                                                       title="#{msg.FILTER_BY_MULTIPLE_USERS_TITLE}"
+                                                       >
                                                        <f:converter converterId="UserConverter" />
                                                        <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
                                                        <f:selectItems value="#{userController.allUsers()}" var="user" itemValue="#{user}" itemLabel="#{user.userName}" />
                                                </p:selectCheckboxMenu>
                                        </f:facet>
 
-                                       <p:link outcome="admin_show_user" title="#{msg.ADMIN_LINK_SHOW_BRANCH_OFFICES_OWNER_USER_TITLE}" value="#{branchOffice.branchUserOwner.userId}" rendered="#{not empty branchOffice.branchUserOwner}">
+                                       <p:link outcome="admin_show_user" title="#{msg.ADMIN_LINK_SHOW_BRANCH_OFFICE_OWNER_USER_TITLE}" value="#{branchOffice.branchUserOwner.userId}" rendered="#{not empty branchOffice.branchUserOwner}">
                                                <f:param name="userId" value="#{branchOffice.branchUserOwner.userId}" />
                                        </p:link>
 
                                                </p:selectCheckboxMenu>
                                        </f:facet>
 
-                                       <p:link outcome="admin_show_business_employee" title="#{msg.ADMIN_LINK_SHOW_BRANCH_OFFICES_CONTACT_PERSON_TITLE}" value="#{branchOffice.branchContactEmployee.employeeId}" rendered="#{not empty branchOffice.branchContactEmployee}">
+                                       <p:link outcome="admin_show_business_employee" title="#{msg.ADMIN_LINK_SHOW_BRANCH_OFFICE_CONTACT_PERSON_TITLE}" value="#{branchOffice.branchContactEmployee.employeeId}" rendered="#{not empty branchOffice.branchContactEmployee}">
                                                <f:param name="employeeId" value="#{branchOffice.branchContactEmployee.employeeId}" />
                                        </p:link>