]> git.mxchange.org Git - jjobs-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Thu, 12 Oct 2017 23:51:26 +0000 (01:51 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 19 Jul 2019 22:47:53 +0000 (00:47 +0200)
- added template for adding branch office opening times
- added all required fields in adminBranchOfficeController bean
- opening times for branch offices are now set, if provided, in new branchOffice
  instance
- double opening times won't be accepted
- added clear() method, seem not to affect formular in PrimeFaces
- added missing navigation cases

Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/jjobs/beans/business/branchoffice/JobsAdminBranchOfficeWebRequestBean.java
src/java/org/mxchange/localization/bundle_de_DE.properties
src/java/org/mxchange/localization/bundle_en_US.properties
web/WEB-INF/faces-config.xml
web/WEB-INF/templates/admin/branch_office/admin_form_opening_time.tpl [new file with mode: 0644]
web/admin/branch_office/admin_branch_office_list.xhtml
web/admin/opening_time/admin_opening_time_list.xhtml

index 2e5aa9399b5babc30342345266506eda09f95c8a..be6b6734e676f9bb70fd22b184e18618c55b55d4 100644 (file)
  */
 package org.mxchange.jjobs.beans.business.branchoffice;
 
+import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
+import java.util.Objects;
 import javax.ejb.EJB;
-import javax.enterprise.context.RequestScoped;
+import javax.enterprise.context.SessionScoped;
 import javax.enterprise.event.Event;
 import javax.enterprise.inject.Any;
 import javax.inject.Inject;
@@ -32,6 +35,9 @@ import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
 import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffices;
 import org.mxchange.jcontactsbusiness.model.branchoffice.CompanyBranchOffice;
 import org.mxchange.jcontactsbusiness.model.employee.Employee;
+import org.mxchange.jcontactsbusiness.model.opening_time.BusinessOpeningTime;
+import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime;
+import org.mxchange.jcontactsbusiness.model.opening_time.dayofweek.DayOfTheWeek;
 import org.mxchange.jcountry.model.data.Country;
 import org.mxchange.jjobs.beans.BaseJobsBean;
 import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
@@ -46,7 +52,7 @@ import org.mxchange.jusercore.model.user.User;
  * @author Roland Häder<roland@mxchange.org>
  */
 @Named ("adminBranchOfficeController")
-@RequestScoped
+@SessionScoped
 public class JobsAdminBranchOfficeWebRequestBean extends BaseJobsBean implements JobsAdminBranchOfficeWebRequestController {
 
        /**
@@ -108,6 +114,11 @@ public class JobsAdminBranchOfficeWebRequestBean extends BaseJobsBean implements
        @Inject
        private JobsBranchOfficeWebRequestController branchOfficeController;
 
+       /**
+        * Opening times of this branch office
+        */
+       private static List<OpeningTime> branchOpeningTimes;
+
        /**
         * Store
         */
@@ -163,12 +174,38 @@ public class JobsAdminBranchOfficeWebRequestBean extends BaseJobsBean implements
         */
        private Long landLineNumber;
 
+       /**
+        * Ending week day
+        */
+       private DayOfTheWeek openingEndDay;
+
+       /**
+        * Ending time
+        */
+       private Date openingEndTime;
+
+       /**
+        * Starting week day
+        */
+       private DayOfTheWeek openingStartDay;
+
+       /**
+        * Starting time
+        */
+       private Date openingStartTime;
+
        /**
         * Default constructor
         */
        public JobsAdminBranchOfficeWebRequestBean () {
                // Call super constructor
                super();
+
+               // Is the opening times list there?
+               if (null == branchOpeningTimes) {
+                       // Init list
+                       branchOpeningTimes = new ArrayList<>(1);
+               }
        }
 
        /**
@@ -204,10 +241,50 @@ public class JobsAdminBranchOfficeWebRequestBean extends BaseJobsBean implements
                // Fire event
                this.branchOfficeAddedEvent.fire(new BranchOfficeAddedEvent(updatedOffice));
 
+               // Clear this bean
+               this.clear();
+
                // Redirect to list
                return "admin_list_branch_office"; //NOI18N
        }
 
+       /**
+        * Adds opening time to temporary list which will be sent along with the
+        * branch office data to the EJB.
+        */
+       public void addOpeningTime () {
+               // Validate all required fields
+               if (this.getOpeningEndDay() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("this.openingEndDay is null"); //NOI18N
+               } else if (this.getOpeningEndTime() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("this.openingEndTime is null"); //NOI18N
+               } else if (this.getOpeningStartDay() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("this.openingStartDay is null"); //NOI18N
+               } else if (this.getOpeningStartTime() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("this.openingStartTime is null"); //NOI18N
+               }
+
+               // Get opening time instance
+               final OpeningTime openingTime = this.createOpeningTimes();
+
+               // Is same found?
+               if (this.isSameOpeningTimeFound(openingTime)) {
+                       // Yes then abort here
+                       this.showFacesMessage("form-admin-add-branch-opening-time:openingStartDay", "ADMIN_OPENING_TIME_ALREADY_CREATED"); //NOI18N
+                       return;
+               }
+
+               // Add to temporary list
+               branchOpeningTimes.add(openingTime);
+
+               // Clear opening time fields
+               this.clearOpeningTime();
+       }
+
        /**
         * Getter for city
         * <p>
@@ -334,6 +411,26 @@ public class JobsAdminBranchOfficeWebRequestBean extends BaseJobsBean implements
                this.branchNumber = branchNumber;
        }
 
+       /**
+        * Getter for opening times of this branch office
+        * <p>
+        * @return Opening times
+        */
+       @SuppressWarnings ("ReturnOfCollectionOrArrayField")
+       public List<OpeningTime> getBranchOpeningTimes () {
+               return branchOpeningTimes;
+       }
+
+       /**
+        * Setter for opening times of this branch office
+        * <p>
+        * @param branchOpeningTimes Opening times
+        */
+       @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter")
+       public void setBranchOpeningTimes (final List<OpeningTime> branchOpeningTimes) {
+               FinancialsAdminBranchOfficeWebRequestBean.branchOpeningTimes = branchOpeningTimes;
+       }
+
        /**
         * Getter for store
         * <p>
@@ -532,6 +629,116 @@ public class JobsAdminBranchOfficeWebRequestBean extends BaseJobsBean implements
                this.landLineNumber = landLineNumber;
        }
 
+       /**
+        * Getter for ending week day
+        * <p>
+        * @return Ending week day
+        */
+       public DayOfTheWeek getOpeningEndDay () {
+               return this.openingEndDay;
+       }
+
+       /**
+        * Setter for ending week day
+        * <p>
+        * @param openingEndDay Ending week day
+        */
+       public void setOpeningEndDay (final DayOfTheWeek openingEndDay) {
+               this.openingEndDay = openingEndDay;
+       }
+
+       /**
+        * Getter for ending time
+        * <p>
+        * @return Ending time
+        */
+       @SuppressWarnings ("ReturnOfDateField")
+       public Date getOpeningEndTime () {
+               return this.openingEndTime;
+       }
+
+       /**
+        * Getter for ending time
+        * <p>
+        * @param openingEndTime Ending time
+        */
+       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+       public void setOpeningEndTime (final Date openingEndTime) {
+               this.openingEndTime = openingEndTime;
+       }
+
+       /**
+        * Getter for starting week day
+        * <p>
+        * @return Starting week day
+        */
+       public DayOfTheWeek getOpeningStartDay () {
+               return this.openingStartDay;
+       }
+
+       /**
+        * Getter for starting week day
+        * <p>
+        * @param openingStartDay Starting week day
+        */
+       public void setOpeningStartDay (final DayOfTheWeek openingStartDay) {
+               this.openingStartDay = openingStartDay;
+       }
+
+       /**
+        * Getter for starting time
+        * <p>
+        * @return Starting time
+        */
+       @SuppressWarnings ("ReturnOfDateField")
+       public Date getOpeningStartTime () {
+               return this.openingStartTime;
+       }
+
+       /**
+        * Getter for starting time
+        * <p>
+        * @param openingStartTime Starting time
+        */
+       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+       public void setOpeningStartTime (final Date openingStartTime) {
+               this.openingStartTime = openingStartTime;
+       }
+
+       /**
+        * Clears this bean data
+        */
+       private void clear () {
+               // Clear all branch office data
+               this.setBranchCity(null);
+               this.setBranchCompany(null);
+               this.setBranchContactEmployee(null);
+               this.setBranchCountry(null);
+               this.setBranchEmailAddress(null);
+               this.setBranchHouseNumber(null);
+               this.setBranchNumber(null);
+               this.setBranchStore(null);
+               this.setBranchStreet(null);
+               this.setBranchSuiteNumber(null);
+               this.setBranchUserOwner(null);
+               this.setBranchZipCode(null);
+               this.setBranchOpeningTimes(null);
+
+               // Extra-clear opening time
+               this.clearOpeningTime();
+       }
+
+       /**
+        * Clears all opening time fields
+        */
+       private void clearOpeningTime () {
+               // Clear all opening time fields
+               this.setOpeningEndDay(null);
+               this.setOpeningEndTime(null);
+               this.setOpeningStartDay(null);
+               this.setOpeningStartTime(null);
+       }
+
        /**
         * Prepares an instance of a BranchOffice object (entity) with all data from
         * this bean. If a complete fax number or land-line number was provided, it
@@ -596,11 +803,31 @@ public class JobsAdminBranchOfficeWebRequestBean extends BaseJobsBean implements
                        // Set fax number
                        branchOffice.setBranchFaxNumber(fax);
                }
+               // Is the opening times list filled?
+               if (!this.getBranchOpeningTimes().isEmpty()) {
+                       // Yes, then set in branch office, too
+                       branchOffice.setBranchOpeningTimes(this.getBranchOpeningTimes());
+               }
 
                // Return fully prepared instance
                return branchOffice;
        }
 
+       /**
+        * Prepares an instance of a OpeningTimes 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 OpeningTimes class (entity)
+        */
+       private OpeningTime createOpeningTimes () {
+               // Create new openingTime instance
+               final OpeningTime openingTime = new BusinessOpeningTime(this.getOpeningEndDay(), this.getOpeningEndTime(), this.getOpeningStartDay(), this.getOpeningStartTime());
+
+               // Return fully prepared instance
+               return openingTime;
+       }
+
        /**
         * Checks whether the given branch office's address is already found in
         * local cache. Please note that this method fully relies on the cache, so
@@ -632,4 +859,29 @@ public class JobsAdminBranchOfficeWebRequestBean extends BaseJobsBean implements
                return isFound;
        }
 
+       /**
+        * Checks if given opening time is already added
+        * <p>
+        * @param openingTime Opening time to be checked
+        * <p>
+        * @return Whether it has been added already
+        */
+       private boolean isSameOpeningTimeFound (final OpeningTime openingTime) {
+               // Default is not found
+               boolean isFound = false;
+
+               // Loop through list
+               for (final OpeningTime ot : this.getBranchOpeningTimes()) {
+                       // Check it
+                       if (Objects.equals(ot, openingTime)) {
+                               // Found same match
+                               isFound = true;
+                               break;
+                       }
+               }
+
+               // Return it
+               return isFound;
+       }
+
 }
index f565b2617925132e40f349c76de4212f83c3f093..6e639df31d89e29e628149e65303975470a77201 100644 (file)
@@ -529,7 +529,7 @@ BUTTON_ADMIN_EXPORT_USERS_XLS=Benutzerdaten als Excel-Datei
 ADMIN_LINK_EXPORT_CONTACT=Daten exportieren
 ADMIN_LINK_EXPORT_CONTACT_TITLE=Kontaktdaten exportieren
 #@TODO Please fix German umlauts!
-ADMIN_EMPTY_LIST_CONTACT=Keine Kontaktdaten in Datenbank gefunden. Oder Ihre Suche ergab keine Uebereinstimmungen.
+ADMIN_EMPTY_LIST_CONTACT=Es befinden sich leine Kontaktdaten in der Datenbank. Oder Ihre Suche ergab keine Uebereinstimmungen.
 #@TODO Please fix German umlauts!
 ADMIN_EMPTY_LIST_USER=Keine Benutzerdaten in Datenbank gefunden. Oder Ihre Suche ergab keine Uebereinstimmungen.
 ADMIN_PERSONAL_DATA_COMMENT=Kommentar: (optional)
@@ -817,7 +817,7 @@ ADMIN_BASIC_COMPANY_DATA_COMPANY_COMMENTS=Anmerkungen:
 ADMIN_BASIC_COMPANY_DATA_PHONE_NUMBER=Haupttelefonnummer:
 ADMIN_BASIC_COMPANY_DATA_FAX_NUMBER=Hauptfaxnummer:
 #@TODO Please fix German umlauts!
-ADMIN_ADD_BASIC_COMPANY_DATA_TITLE=Neuen geschaeftlichen Kontakt hinzufuegen
+ADMIN_ADD_BASIC_COMPANY_DATA_TITLE=Geschaeftlichen Kontakt hinzufuegen
 ADMIN_ADD_BASIC_COMPANY_DATA_MINIMUM_DATA=Bitte mindestens Firmennamen inklusive Rechtsform ein.
 #@TODO Please fix German umlauts!
 ENTERED_EMAIL_ADDRESS_IS_INVALID=Die eingegebene Email-Addresse entspricht nicht dem gueltigen Format.
@@ -873,7 +873,7 @@ ADMIN_ASSIGN_BRANCH_OFFICE_COMPANY=Filiale dem Unternehmen zuweisen:
 PAGE_TITLE_ADMIN_LIST_BRANCH_OFFICES=Filialen auflisten
 CONTENT_TITLE_ADMIN_LIST_BRANCH_OFFICES=Auflisten von Filialen:
 #@TODO Please fix German umlauts!
-ADMIN_EMPTY_LIST_BRANCH_OFFICES=Es wurden keine Filialen in der Datenbank gefunden. Oder Ihre Suche ergab keine Uebereinstimmungen.
+ADMIN_EMPTY_LIST_BRANCH_OFFICES=Es befinden sich keine Filialen in der Datenbank gefunden. Oder Ihre Suche ergab keine Uebereinstimmungen.
 #@TODO Please fix German umlauts!
 ADMIN_ADD_BRANCH_OFFICE_TITLE=Filiale hinzufuegen
 #@TODO Please fix German umlauts!
@@ -1078,6 +1078,7 @@ ADMIN_OPENING_TIME_LEGEND_TITLE=Geben Sie die Daten einer einzelnen Oeffnungszei
 ADMIN_ADD_OPENING_TIME_TITLE=Oeffnungszeit hinzufuegen:
 #@TODO Please fix German umlauts!
 ADMIN_ADD_OPENING_TIME_MINIMUM_DATA=Bitte geben Sie zum Hinzufuegen einer Oeffnungszeit alle Angaben an. Diese sollten nicht konfliktieren.
+#@TODO Please fix German umlauts!
 BUTTON_ADMIN_ADD_OPENING_TIME=Oeffnungszeit hinzufuegen
 ADMIN_LINK_ASSIGN_DEPARTMENT_BRANCH_OFFICE_TITLE=Dieser Abteilung eine Filiale zuweisen.
 ADMIN_LINK_ASSIGN_DEPARTMENTS_LEAD_EMPLOYEE_TITLE=Dieser Abteilung einen leitenden Mitarbeiter zuweisen.
@@ -1085,3 +1086,20 @@ ADMIN_LINK_ASSIGN_DEPARTMENTS_OWNER_USER_TITLE=Dieser Abteilung einen besitzende
 #@TODO Please fix German umlauts!
 FIELD_PAYMENT_TYPE_REQUIRED=Bitte waehlen Sie eine Zahlungsmethode aus.
 ADMIN_LIST_USERS_HEADER=Liste aller Benutzer
+#@TODO Please fix German umlauts!
+ADMIN_BRANCH_OFFICE_OPENING_TIMES_LEGEND=Oeffnungszeiten der Filiale:
+#@TODO Please fix German umlauts!
+TABLE_SUMMARY_ADMIN_LIST_BRANCH_OFFICE_OPENING_TIMES=Diese Tabelle listet Oeffnungszeiten der Filiale auf.
+TABLE_SUMMARY_ADMIN_LIST_BRANCH_OFFICES=Diese Tabelle listet Filialen auf.
+#@TODO Please fix German umlauts!
+ADMIN_EMPTY_LIST_BRANCH_OFFICE_OPENING_TIMES=Es befinden sich keine Oeffnungszeiten dieser Filiale in der Datenbank.
+#@TODO Please fix German umlauts!
+ADMIN_LIST_BRANCH_OFFICE_OPENING_TIMES_HEADER=Alle Oeffnungszeiten der Filiale auflisten
+#@TODO Please fix German umlauts!
+ADMIN_ADD_BRANCH_OFFICE_OPENING_TIME_TITLE=Oeffnungszeit zur Filiale hinzufuegen
+#@TODO Please fix German umlauts!
+BUTTON_ADMIN_ADD_BRANCH_OFFICE_OPENING_TIME=Oeffnungszeit zur Filiale hinzufuegen
+ADMIN_BRANCH_OFFICE_OPENING_TIME_LEGEND=Einzelne Oeffnungzeit der Filiale:
+ADMIN_BRANCH_OFFICE_OPENING_TIME_LEGEND_TITLE=Geben Sie hier eine einzelne Oeffnungszeit der Filiale ein.
+#@TODO Please fix German umlauts!
+ADMIN_OPENING_TIME_ALREADY_CREATED=Die Oeffnungzeit wurde bereits hinzugefuegt.
index 1af50fccee025191324ef5a919e0c2c9e11a53d4..f654cbad2bc7a6b062334e0597e2ea1f77f18133 100644 (file)
@@ -1009,3 +1009,13 @@ ADMIN_LINK_ASSIGN_DEPARTMENTS_LEAD_EMPLOYEE_TITLE=Assign this department a leadi
 ADMIN_LINK_ASSIGN_DEPARTMENTS_OWNER_USER_TITLE=Assign this department an owning user.
 FIELD_PAYMENT_TYPE_REQUIRED=Please choose a payment method.
 ADMIN_LIST_USERS_HEADER=List of all users
+ADMIN_BRANCH_OFFICE_OPENING_TIMES_LEGEND=Opening times of branch office:
+TABLE_SUMMARY_ADMIN_LIST_BRANCH_OFFICE_OPENING_TIMES=This table lists opening times of this branch office.
+TABLE_SUMMARY_ADMIN_LIST_BRANCH_OFFICES=This table lists branch offices.
+ADMIN_EMPTY_LIST_BRANCH_OFFICE_OPENING_TIMES=There are no opening times of this branch office in database.
+ADMIN_LIST_BRANCH_OFFICE_OPENING_TIMES_HEADER=List all opening times of branch office
+ADMIN_ADD_BRANCH_OFFICE_OPENING_TIME_TITLE=Add opening time to branch office
+BUTTON_ADMIN_ADD_BRANCH_OFFICE_OPENING_TIME=Add opening time to branch office
+ADMIN_BRANCH_OFFICE_OPENING_TIME_LEGEND=Single opening time of branch office:
+ADMIN_BRANCH_OFFICE_OPENING_TIME_LEGEND_TITLE=Enter single opening time of branch office.
+ADMIN_OPENING_TIME_ALREADY_CREATED=The opening time has already been added.
index 52ce29ff8d4f005333973fba099faa07131b13b1..25ccb302c034e797578ea6c172a4c03f93986e7b 100644 (file)
                        <to-view-id>/admin/employee/admin_employee_delete.xhtml</to-view-id>
                </navigation-case>
        </navigation-rule>
+       <navigation-rule>
+               <from-view-id>/admin/opening_time/admin_opening_time_list.xhtml</from-view-id>
+               <navigation-case>
+                       <from-outcome>admin_show_opening_time</from-outcome>
+                       <to-view-id>/admin/opening_time/admin_opening_time_show.xhtml</to-view-id>
+               </navigation-case>
+               <navigation-case>
+                       <from-outcome>admin_edit_opening_time</from-outcome>
+                       <to-view-id>/admin/opening_time/admin_opening_time_edit.xhtml</to-view-id>
+               </navigation-case>
+               <navigation-case>
+                       <from-outcome>admin_delete_opening_time</from-outcome>
+                       <to-view-id>/admin/opening_time/admin_opening_time_delete.xhtml</to-view-id>
+               </navigation-case>
+       </navigation-rule>
        <!--
        <factory>
                <exception-handler-factory>
diff --git a/web/WEB-INF/templates/admin/branch_office/admin_form_opening_time.tpl b/web/WEB-INF/templates/admin/branch_office/admin_form_opening_time.tpl
new file mode 100644 (file)
index 0000000..b64846e
--- /dev/null
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ui:composition
+       xmlns="http://www.w3.org/1999/xhtml"
+       xmlns:widgets="http://mxchange.org/jsf/core/widgets"
+       xmlns:f="http://xmlns.jcp.org/jsf/core"
+       xmlns:h="http://xmlns.jcp.org/jsf/html"
+       xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
+       xmlns:p="http://primefaces.org/ui">
+
+       <!--
+       @TODO: title="#{msg.ADMIN_BRANCH_OFFICE_OPENING_TIME_LEGEND_TITLE}"
+       -->
+       <p:fieldset legend="#{msg.ADMIN_BRANCH_OFFICE_OPENING_TIME_LEGEND}">
+               <p:panelGrid layout="grid" columns="4" columnClasses="ui-grid-col-4, ui-grid-col-8" styleClass="table table-full ui-noborder">
+                       <p:outputLabel for="openingStartDay" value="#{msg.ADMIN_START_WEEK_DAY}" />
+                       <p:outputLabel for="openingEndDay" value="#{msg.ADMIN_END_WEEK_DAY}" />
+                       <p:outputLabel for="openingStartTime" value="#{msg.ADMIN_START_TIME}" />
+                       <p:outputLabel for="openingEndTime" value="#{msg.ADMIN_END_TIME}" />
+
+                       <p:selectOneMenu
+                               id="openingStartDay"
+                               value="#{adminBranchOfficeController.openingStartDay}"
+                               filter="true"
+                               filterMatchMode="contains"
+                               required="true"
+                               requiredMessage="#{msg.ADMIN_START_WEEK_DAY_REQUIRED}"
+                               >
+                               <f:converter converterId="DayOfTheWeekConverter" />
+                               <f:selectItem itemValue="#{null}" itemLabel="#{msg.PLEASE_SELECT}" noSelectionOption="true" itemDisabled="true" />
+                               <f:selectItems value="#{dataController.dayOfTheWeek}" var="dayOfWeek" itemValue="#{dayOfWeek}" itemLabel="#{dayOfWeek.toString()}" />
+                       </p:selectOneMenu>
+
+                       <p:selectOneMenu
+                               id="openingEndDay"
+                               value="#{adminBranchOfficeController.openingEndDay}"
+                               filter="true"
+                               filterMatchMode="contains"
+                               required="true"
+                               requiredMessage="#{msg.ADMIN_END_WEEK_DAY_REQUIRED}"
+                               >
+                               <f:converter converterId="DayOfTheWeekConverter" />
+                               <f:selectItem itemValue="#{null}" itemLabel="#{msg.PLEASE_SELECT}" noSelectionOption="true" itemDisabled="true" />
+                               <f:selectItems value="#{dataController.dayOfTheWeek}" var="dayOfWeek" itemValue="#{dayOfWeek}" itemLabel="#{dayOfWeek.toString()}" />
+                       </p:selectOneMenu>
+
+                       <p:calendar
+                               id="openingStartTime"
+                               value="#{adminBranchOfficeController.openingStartTime}"
+                               pattern="HH:mm"
+                               timeOnly="true"
+                               required="true"
+                               stepMinute="5"
+                               requiredMessage="#{msg.ADMIN_START_TIME_REQUIRED}"
+                               />
+
+                       <p:calendar
+                               id="openingEndTime"
+                               value="#{adminBranchOfficeController.openingEndTime}"
+                               pattern="HH:mm"
+                               timeOnly="true"
+                               required="true"
+                               stepMinute="5"
+                               requiredMessage="#{msg.ADMIN_END_TIME_REQUIRED}"
+                               />
+               </p:panelGrid>
+       </p:fieldset>
+</ui:composition>
index 26bd0c6859436127e81bfb019d9c38a7b6bad464..ff66511940c13c3c9b7383622c094df8d33a771c 100644 (file)
                                </f:facet>
                        </p:panelGrid>
                </h:form>
+
+               <h:form id="form-list-branch-opening-time">
+                       <p:fieldset legend="#{msg.ADMIN_BRANCH_OFFICE_OPENING_TIMES_LEGEND}">
+                               <p:dataTable
+                                       id="table-list-branch-opening-time"
+                                       var="openingTime"
+                                       value="#{adminBranchOfficeController.branchOpeningTimes}"
+                                       tableStyleClass="table table-full"
+                                       rows="10"
+                                       reflow="true"
+                                       summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_BRANCH_OFFICE_OPENING_TIMES}"
+                                       emptyMessage="#{msg.ADMIN_EMPTY_LIST_BRANCH_OFFICE_OPENING_TIMES}"
+                                       widgetVar="branchOpeningTimeList"
+                                       >
+
+                                       <f:facet name="header">
+                                               <h:outputText value="#{msg.ADMIN_LIST_BRANCH_OFFICE_OPENING_TIMES_HEADER}" />
+                                       </f:facet>
+
+                                       <p:column headerText="#{msg.ADMIN_START_WEEK_DAY}">
+                                               <h:outputText value="#{openingTime.openingStartDay.toString()}" />
+                                       </p:column>
+
+                                       <p:column headerText="#{msg.ADMIN_END_WEEK_DAY}">
+                                               <h:outputText value="#{openingTime.openingEndDay.toString()}" />
+                                       </p:column>
+
+                                       <p:column headerText="#{msg.ADMIN_START_TIME}">
+                                               <h:outputText value="#{openingTime.openingStartTime.time}">
+                                                       <f:convertDateTime type="time" timeStyle="short" />
+                                               </h:outputText>
+                                       </p:column>
+
+                                       <p:column headerText="#{msg.ADMIN_END_TIME}">
+                                               <h:outputText value="#{openingTime.openingEndTime.time}">
+                                                       <f:convertDateTime type="time" timeStyle="short" />
+                                               </h:outputText>
+                                       </p:column>
+                               </p:dataTable>
+                       </p:fieldset>
+               </h:form>
+
+               <h:form id="form-admin-add-branch-opening-time">
+                       <p:panelGrid columns="1" styleClass="table table-full" layout="grid">
+                               <f:facet name="header">
+                                       <h:outputText value="#{msg.ADMIN_ADD_BRANCH_OFFICE_OPENING_TIME_TITLE}" />
+                               </f:facet>
+
+                               <h:panelGroup styleClass="para" layout="block">
+                                       <h:outputText value="#{msg.ADMIN_ADD_OPENING_TIME_MINIMUM_DATA}" />
+                               </h:panelGroup>
+
+                               <ui:include src="/WEB-INF/templates/admin/branch_office/admin_form_opening_time.tpl" />
+
+                               <f:facet name="footer">
+                                       <p:panelGrid columns="2" layout="grid">
+                                               <p:commandButton
+                                                       styleClass="reset"
+                                                       type="reset"
+                                                       value="#{msg.BUTTON_RESET_FORM}"
+                                                       />
+
+                                               <p:commandButton
+                                                       styleClass="submit"
+                                                       type="submit"
+                                                       value="#{msg.BUTTON_ADMIN_ADD_BRANCH_OFFICE_OPENING_TIME}"
+                                                       action="#{adminBranchOfficeController.addOpeningTime()}"
+                                                       update=":master:form-list-branch-opening-time:table-list-branch-opening-time"
+                                                       />
+                                       </p:panelGrid>
+                               </f:facet>
+                       </p:panelGrid>
+               </h:form>
        </ui:define>
 </ui:composition>
index a91a699e915da867dce3ccc63d09d9eecbfa7aaa..66d2630e9f1a8edac737ab1bd403b8401d712990 100644 (file)
@@ -48,7 +48,7 @@
                                </f:facet>
 
                                <p:column headerText="#{msg.ADMIN_ID_NUMBER}" sortBy="#{openingTime.openingId}" filterable="false">
-                                       <p:link outcome="admin_show_department" title="#{msg.ADMIN_LINK_SHOW_DEPARTMENT_TITLE}" value="#{openingTime.openingId}">
+                                       <p:link outcome="admin_show_opening_time" title="#{msg.ADMIN_LINK_SHOW_DEPARTMENT_TITLE}" value="#{openingTime.openingId}">
                                                <f:param name="openingId" value="#{openingTime.openingId}" />
                                        </p:link>
                                </p:column>
                                </p:column>
 
                                <p:column headerText="#{msg.ADMIN_START_TIME}" sortBy="#{openingTime.openingStartTime}" filterBy="#{openingTime.openingStartTime}" filterable="false">
-                                       <h:outputText value="#{openingTime.openingStartTime.time}" />
+                                       <h:outputText value="#{openingTime.openingStartTime.time}">
+                                               <f:convertDateTime type="time" timeStyle="short" />
+                                       </h:outputText>
                                </p:column>
 
                                <p:column headerText="#{msg.ADMIN_END_TIME}" sortBy="#{openingTime.openingEndTime}" filterBy="#{openingTime.openingEndTime}" filterable="false">
-                                       <h:outputText value="#{openingTime.openingEndTime.time}" />
+                                       <h:outputText value="#{openingTime.openingEndTime.time}">
+                                               <f:convertDateTime type="time" timeStyle="short" />
+                                       </h:outputText>
                                </p:column>
 
                                <p:column headerText="#{msg.ADMIN_ACTION_LINKS}" sortable="false" filterable="false">