]> git.mxchange.org Git - jfinancials-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, 29 Sep 2017 23:06:00 +0000 (01:06 +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/jfinancials/beans/country/FinancialsAdminCountryWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/country/FinancialsCountryWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebRequestHelperBean.java
src/java/org/mxchange/jfinancials/beans/phone/FinancialsAdminPhoneWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/user/FinancialsUserWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/user/register/FinancialsUserRegisterWebRequestBean.java
src/java/org/mxchange/jfinancials/beans/user/resendlink/FinancialsResendLinkWebRequestBean.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 47ef456efc1f0bf22c658783010d2dca6a688122..78d48e963d2dfd3ee601e7ca6289fb86bd9dcd9e 100644 (file)
@@ -26,12 +26,12 @@ import javax.enterprise.inject.Any;
 import javax.faces.view.facelets.FaceletException;
 import javax.inject.Inject;
 import javax.inject.Named;
-import org.mxchange.jcountry.model.data.Country;
-import org.mxchange.jcountry.model.data.CountryData;
-import org.mxchange.jcountry.model.data.CountrySingletonBeanRemote;
 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.jfinancials.beans.BaseFinancialsBean;
 
 /**
index 2a7924354c9815717c8065a2b51a091c24c15073..9bcc4e61c5f264e4f5f1e35573335c358d43a448 100644 (file)
@@ -28,9 +28,9 @@ import javax.enterprise.context.RequestScoped;
 import javax.enterprise.event.Observes;
 import javax.inject.Inject;
 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.jfinancials.beans.BaseFinancialsBean;
 
 /**
index 4103fd4d66464ca455465cd29e8753b141579b11..14eb2cd9b6508d51cada2315200aa4c975478dfa 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.jfinancials.beans.BaseFinancialsBean;
-import org.mxchange.jfinancials.beans.contact.FinancialsAdminContactWebRequestController;
-import org.mxchange.jfinancials.beans.phone.FinancialsAdminPhoneWebRequestController;
-import org.mxchange.jfinancials.beans.user.FinancialsAdminUserWebRequestController;
 import org.mxchange.jfinancials.beans.user.FinancialsUserWebRequestController;
 import org.mxchange.jphone.events.fax.created.CreatedFaxNumberEvent;
 import org.mxchange.jphone.events.fax.created.ObservableCreatedFaxNumberEvent;
@@ -65,24 +63,6 @@ public class FinancialsWebRequestHelperBean extends BaseFinancialsBean implement
         */
        private static final long serialVersionUID = 17_258_793_567_145_701L;
 
-       /**
-        * Administrative contact controller
-        */
-       @Inject
-       private FinancialsAdminContactWebRequestController adminContactController;
-
-       /**
-        * Administrative phone controller
-        */
-       @Inject
-       private FinancialsAdminPhoneWebRequestController adminPhoneController;
-
-       /**
-        * Administrative user controller
-        */
-       @Inject
-       private FinancialsAdminUserWebRequestController adminUserController;
-
        /**
         * Contact instance
         */
@@ -541,8 +521,44 @@ public class FinancialsWebRequestHelperBean extends BaseFinancialsBean implement
        }
 
        /**
-        * 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 dea6604a56734945c80826a951b6183eb3fb4f3c..a7b21b768d2128be129d304ca5d60f513055b284 100644 (file)
@@ -68,11 +68,6 @@ import org.mxchange.jphone.model.phonenumbers.phone.AdminPhoneSessionBeanRemote;
 @RequestScoped
 public class FinancialsAdminPhoneWebRequestBean extends BaseFinancialsBean implements FinancialsAdminPhoneWebRequestController {
 
-       /**
-        * Call-stack position
-        */
-       private static final short THREAD_STACK = 5;
-
        /**
         * Serial number
         */
@@ -211,9 +206,6 @@ public class FinancialsAdminPhoneWebRequestBean extends BaseFinancialsBean imple
        public FinancialsAdminPhoneWebRequestBean () {
                // 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 401119e5d16bac00e8dc4ecdc5c7e49f13c1b0d7..feac70e54a40a60a1b3b070862672023c76f471d 100644 (file)
@@ -39,7 +39,6 @@ import org.mxchange.jcoreee.events.locale.ObservableLocaleChangeEvent;
 import org.mxchange.jfinancials.beans.BaseFinancialsBean;
 import org.mxchange.jfinancials.beans.contact.FinancialsContactWebRequestController;
 import org.mxchange.jfinancials.beans.features.FinancialsFeaturesWebApplicationController;
-import org.mxchange.jfinancials.beans.localization.FinancialsLocalizationSessionController;
 import org.mxchange.jfinancials.beans.user.login.FinancialsUserLoginWebSessionController;
 import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
 import org.mxchange.jusercore.events.user.clear.password.ObservableClearUserPasswordEvent;
@@ -96,12 +95,6 @@ public class FinancialsUserWebRequestBean extends BaseFinancialsBean implements
         */
        private Locale locale;
 
-       /**
-        * Localization controller
-        */
-       @Inject
-       private FinancialsLocalizationSessionController localizationController;
-
        /**
         * Event being fired when user updated personal data
         */
index 2e94b1b08a3b070bc382312d8f99d0d98439c168..ed6ceaaf91d7306053b4601ab6a7b8b782bc0e7a 100644 (file)
@@ -29,7 +29,6 @@ import org.mxchange.jcoreee.utils.FacesUtils;
 import org.mxchange.jfinancials.beans.BaseFinancialsBean;
 import org.mxchange.jfinancials.beans.contact.FinancialsContactWebRequestController;
 import org.mxchange.jfinancials.beans.features.FinancialsFeaturesWebApplicationController;
-import org.mxchange.jfinancials.beans.user.FinancialsAdminUserWebRequestController;
 import org.mxchange.jfinancials.beans.user.FinancialsUserWebRequestController;
 import org.mxchange.jusercore.events.user.clear.password.ClearUserPasswordEvent;
 import org.mxchange.jusercore.events.user.clear.password.ObservableClearUserPasswordEvent;
@@ -63,12 +62,6 @@ public class FinancialsUserRegisterWebRequestBean extends BaseFinancialsBean imp
         */
        private static final long serialVersionUID = 47_828_986_719_691_592L;
 
-       /**
-        * Administrative user controller
-        */
-       @Inject
-       private FinancialsAdminUserWebRequestController adminUserController;
-
        /**
         * An event being fired when a user name should be cleared
         */
index 2b1466ed61faf00f7681bf15b7a7a3f85a5fd97a..fdcf1e93393774703611475f9f5d9d31dae56c8f 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.jfinancials.beans.BaseFinancialsBean;
-import org.mxchange.jfinancials.beans.localization.FinancialsLocalizationSessionController;
 import org.mxchange.jfinancials.beans.user.FinancialsUserWebRequestController;
 import org.mxchange.jusercore.exceptions.UserEmailAddressNotFoundException;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
@@ -63,12 +62,6 @@ public class FinancialsResendLinkWebRequestBean extends BaseFinancialsBean imple
         */
        private Locale locale;
 
-       /**
-        * Localization controller
-        */
-       @Inject
-       private FinancialsLocalizationSessionController localizationController;
-
        /**
         * EJB for resending confirmation link
         */
index cc8568c82f8492453d797f28effe96d993ba8e5f..a00c7addf30109d68f0dfeef4ae8e992c7ea14c8 100644 (file)
@@ -882,9 +882,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
@@ -945,7 +945,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.
@@ -990,3 +990,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 43612beaf50aa2d618909e2f7546243051c30d03..a744bd2ded90f42493096d07e8db5a3b8b9c1a91 100644 (file)
@@ -844,9 +844,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
@@ -928,3 +928,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 6374a5b1f85d7a580cc911f5a0f65895bb62c9a8..3e0adecde76b610e97b3e5224bce2cffc55020b4 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>