From: Roland Häder Date: Fri, 29 Sep 2017 23:06:00 +0000 (+0200) Subject: Please cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a86d9cbe20625f91d22b92871b042389c3507c63;p=jfinancials-war.git Please cherry-pick: - 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 --- diff --git a/src/java/org/mxchange/jfinancials/beans/country/FinancialsAdminCountryWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/country/FinancialsAdminCountryWebRequestBean.java index 47ef456e..78d48e96 100644 --- a/src/java/org/mxchange/jfinancials/beans/country/FinancialsAdminCountryWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/country/FinancialsAdminCountryWebRequestBean.java @@ -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; /** diff --git a/src/java/org/mxchange/jfinancials/beans/country/FinancialsCountryWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/country/FinancialsCountryWebRequestBean.java index 2a792435..9bcc4e61 100644 --- a/src/java/org/mxchange/jfinancials/beans/country/FinancialsCountryWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/country/FinancialsCountryWebRequestBean.java @@ -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; /** diff --git a/src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebRequestHelperBean.java b/src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebRequestHelperBean.java index 4103fd4d..14eb2cd9 100644 --- a/src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebRequestHelperBean.java +++ b/src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebRequestHelperBean.java @@ -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. + *

+ * @param employee Employee instance + *

+ * @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. *

* @param headquarters Headquarters instance *

diff --git a/src/java/org/mxchange/jfinancials/beans/phone/FinancialsAdminPhoneWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/phone/FinancialsAdminPhoneWebRequestBean.java index dea6604a..a7b21b76 100644 --- a/src/java/org/mxchange/jfinancials/beans/phone/FinancialsAdminPhoneWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/phone/FinancialsAdminPhoneWebRequestBean.java @@ -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)); } /** diff --git a/src/java/org/mxchange/jfinancials/beans/user/FinancialsUserWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/user/FinancialsUserWebRequestBean.java index 401119e5..feac70e5 100644 --- a/src/java/org/mxchange/jfinancials/beans/user/FinancialsUserWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/user/FinancialsUserWebRequestBean.java @@ -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 */ diff --git a/src/java/org/mxchange/jfinancials/beans/user/register/FinancialsUserRegisterWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/user/register/FinancialsUserRegisterWebRequestBean.java index 2e94b1b0..ed6ceaaf 100644 --- a/src/java/org/mxchange/jfinancials/beans/user/register/FinancialsUserRegisterWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/user/register/FinancialsUserRegisterWebRequestBean.java @@ -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 */ diff --git a/src/java/org/mxchange/jfinancials/beans/user/resendlink/FinancialsResendLinkWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/user/resendlink/FinancialsResendLinkWebRequestBean.java index 2b1466ed..fdcf1e93 100644 --- a/src/java/org/mxchange/jfinancials/beans/user/resendlink/FinancialsResendLinkWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/user/resendlink/FinancialsResendLinkWebRequestBean.java @@ -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 */ diff --git a/src/java/org/mxchange/localization/bundle_de_DE.properties b/src/java/org/mxchange/localization/bundle_de_DE.properties index cc8568c8..a00c7add 100644 --- a/src/java/org/mxchange/localization/bundle_de_DE.properties +++ b/src/java/org/mxchange/localization/bundle_de_DE.properties @@ -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: diff --git a/src/java/org/mxchange/localization/bundle_en_US.properties b/src/java/org/mxchange/localization/bundle_en_US.properties index 43612bea..a744bd2d 100644 --- a/src/java/org/mxchange/localization/bundle_en_US.properties +++ b/src/java/org/mxchange/localization/bundle_en_US.properties @@ -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 index 00000000..68bbe317 --- /dev/null +++ b/web/WEB-INF/project-links.jsf.taglib.xml @@ -0,0 +1,23 @@ + + + + http://mxchange.org/jsf/jfinancials/links + diff --git a/web/WEB-INF/templates/admin/admin_menu.tpl b/web/WEB-INF/templates/admin/admin_menu.tpl index 870647c0..4db9edbd 100644 --- a/web/WEB-INF/templates/admin/admin_menu.tpl +++ b/web/WEB-INF/templates/admin/admin_menu.tpl @@ -27,7 +27,7 @@ - + diff --git a/web/WEB-INF/web.xml b/web/WEB-INF/web.xml index 6374a5b1..3e0adecd 100644 --- a/web/WEB-INF/web.xml +++ b/web/WEB-INF/web.xml @@ -30,7 +30,7 @@ Generic custom JSF tags library javax.faces.FACELETS_LIBRARIES - /WEB-INF/widgets.jsf.taglib.xml;/WEB-INF/links.jsf.taglib.xml + /WEB-INF/widgets.jsf.taglib.xml;/WEB-INF/links.jsf.taglib.xml;/WEB-INF/project-links.jsf.taglib.xml Project stage diff --git a/web/admin/branch_office/admin_branch_office_list.xhtml b/web/admin/branch_office/admin_branch_office_list.xhtml index 9c91c184..8ff058ba 100644 --- a/web/admin/branch_office/admin_branch_office_list.xhtml +++ b/web/admin/branch_office/admin_branch_office_list.xhtml @@ -51,14 +51,21 @@ - + - + @@ -101,7 +108,7 @@ - +