]> git.mxchange.org Git - jfinancials-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Sat, 22 Dec 2018 00:15:33 +0000 (01:15 +0100)
committerRoland Häder <roland@mxchange.org>
Sat, 22 Dec 2018 00:15:33 +0000 (01:15 +0100)
- introduced 2nd parameter for beanHelper.renderBasicData() to include short or
  long name in view components
- also use that method instead of invoking getter in same helper backing-bean
- re-aligned some JSF tags to have their attributes in distinct lines (easy to
  add another)

Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/jfinancials/beans/helper/FinancialsWebViewHelperBean.java
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/admin/branch_office/admin_branch_office_list.xhtml
web/admin/department/admin_department_list.xhtml
web/admin/employee/admin_employee_list.xhtml

index a2709ec322696b0e4857840f7d13e559092510fb..811af1a7ebcc3d598d3a578295de7abd5cefd329 100644 (file)
@@ -443,18 +443,25 @@ public class FinancialsWebViewHelperBean extends BaseFinancialsBean implements F
        /**
         * Renders data of basic company data
         * <p>
-        * @param basicData Basic company data instance
+        * @param basicData    Basic company data instance
+        * @param useShortName Whether to use short name or long name of company
         * <p>
         * @return Basic company data as string
         */
-       public String renderBasicData (final BasicData basicData) {
+       public String renderBasicData (final BasicData basicData, final boolean useShortName) {
                // Default is empty string, so let's get started
                final StringBuilder sb = new StringBuilder(30);
 
                // Is basic company data set?
                if (basicData instanceof BasicData) {
-                       // Add company name
-                       sb.append(basicData.getCompanyName()); //NOI18N
+                       // Short or long name?
+                       if (useShortName) {
+                               // Add company's long name
+                               sb.append(basicData.getCompanyShortName()); //NOI18N
+                       } else {
+                               // Add company's long name
+                               sb.append(basicData.getCompanyName()); //NOI18N
+                       }
 
                        // Is email address set?
                        if (basicData.getCompanyEmailAddress() != null) {
@@ -491,7 +498,7 @@ public class FinancialsWebViewHelperBean extends BaseFinancialsBean implements F
                        assert (branchOffice.getBranchCompany() instanceof BasicData) : "branchOffice.branchCompany is null"; //NOI18N
 
                        // Yes, then append all data
-                       sb.append(branchOffice.getBranchCompany().getCompanyName());
+                       sb.append(this.renderBasicData(branchOffice.getBranchCompany(), true));
                        sb.append(", "); //NOI18N
                        sb.append(branchOffice.getBranchStreet());
                        sb.append(" "); //NOI18N
@@ -576,7 +583,7 @@ public class FinancialsWebViewHelperBean extends BaseFinancialsBean implements F
                        // Then create name
                        sb.append(this.getMessageFromBundle(department.getDepartmentI18nKey()));
                        sb.append(" ("); //NOI18N
-                       sb.append(department.getDepartmentCompany().getCompanyName());
+                       sb.append(this.renderBasicData(department.getDepartmentCompany(), true));
                        sb.append(")"); //NOI18N
                }
 
index 90a88a8d4169406794aa4bf99166c49d80271532..6b4e9f96126288aba08c8a8f86c8ce96d3e279c3 100644 (file)
@@ -36,7 +36,7 @@
                                        value="#{basicDataListController.allBasicData}"
                                        var="basicData"
                                        itemValue="#{basicData}"
-                                       itemLabel="#{beanHelper.renderBasicData(basicData)}"
+                                       itemLabel="#{beanHelper.renderBasicData(basicData, true)}"
                                        />
                        </p:selectOneMenu>
 
index 4274790236653b179e61de6a8f9f1be293ad3efe..6d45042d116d1f84542a8dbaaae23c0d6edae082 100644 (file)
@@ -43,7 +43,7 @@
                                        value="#{basicDataListController.allBasicData}"
                                        var="basicData"
                                        itemValue="#{basicData}"
-                                       itemLabel="#{beanHelper.renderBasicData(basicData)}"
+                                       itemLabel="#{beanHelper.renderBasicData(basicData, true)}"
                                        />
                        </p:selectOneMenu>
 
index be6680b6d0161548823c51e10e4a452998142a3d..2aef9d520bc75b8640b259085c4eab2e015d15ff 100644 (file)
 
                                <f:converter converterId="BasicCompanyDataConverter" />
 
-                               <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="#{basicDataListController.allBasicData}"
                                        var="basicData"
                                        itemValue="#{basicData}"
-                                       itemLabel="#{basicData.companyName}"
+                                       itemLabel="#{beanHelper.renderBasicData(basicData)}"
                                        />
                        </p:selectOneMenu>
 
index f4feb5f83f91b16df1954ce03a56a9237834a198..7edd83914de9ca306ed7125aac6659096c140435 100644 (file)
                                                                value="#{basicDataListController.allBasicData}"
                                                                var="basicData"
                                                                itemValue="#{basicData}"
-                                                               itemLabel="#{beanHelper.renderBasicData(basicData)}"
+                                                               itemLabel="#{beanHelper.renderBasicData(basicData, true)}"
                                                                />
                                                </p:selectCheckboxMenu>
                                        </f:facet>
 
-                                       <p:link outcome="admin_show_basic_data" value="#{beanHelper.renderBasicData(branchOffice.branchCompany)}" title="#{msg.ADMIN_LINK_SHOW_BASIC_DATA_TITLE}">
+                                       <p:link
+                                               outcome="admin_show_basic_data"
+                                               value="#{beanHelper.renderBasicData(branchOffice.branchCompany, true)}"
+                                               title="#{msg.ADMIN_LINK_SHOW_BASIC_DATA_TITLE}"
+                                               >
                                                <f:param name="basicDataId" value="#{branchOffice.branchCompany.basicDataId}" />
                                        </p:link>
                                </p:column>
                                                                <h:outputText value="#{branchOfficeListController.selectedBranchOffice.branchNumber}" />
 
                                                                <p:outputLabel value="#{msg.ASSIGNED_BASIC_DATA_HEADER}" title="#{msg.ASSIGNED_BASIC_DATA_TO_BRANCH_OFFICE_TITLE}" />
-                                                               <p:link outcome="admin_show_basic_data" target="_blank" value="#{beanHelper.renderBasicData(branchOfficeListController.selectedBranchOffice.branchCompany)}" title="#{msg.ADMIN_LINK_SHOW_BASIC_DATA_TITLE}">
+                                                               <p:link
+                                                                       outcome="admin_show_basic_data"
+                                                                       target="_blank"
+                                                                       value="#{beanHelper.renderBasicData(branchOfficeListController.selectedBranchOffice.branchCompany, false)}"
+                                                                       title="#{msg.ADMIN_LINK_SHOW_BASIC_DATA_TITLE}"
+                                                                       >
                                                                        <f:param name="basicDataId" value="#{branchOfficeListController.selectedBranchOffice.branchCompany.basicDataId}" />
                                                                </p:link>
 
index a5329f06733ccfc0b2d2a3f61613af16f009cc27..f9df8cc0a65b5e9ea6d585a9717b732fb1e2d2f4 100644 (file)
                                                                value="#{basicDataListController.allBasicData}"
                                                                var="basicData"
                                                                itemValue="#{basicData}"
-                                                               itemLabel="#{beanHelper.renderBasicData(basicData)}"
+                                                               itemLabel="#{beanHelper.renderBasicData(basicData, true)}"
                                                                />
                                                </p:selectCheckboxMenu>
                                        </f:facet>
 
-                                       <p:link outcome="admin_show_basic_data" value="#{beanHelper.renderBasicData(department.departmentCompany)}" title="#{msg.ADMIN_LINK_SHOW_BASIC_DATA_TITLE}">
+                                       <p:link
+                                               outcome="admin_show_basic_data"
+                                               value="#{beanHelper.renderBasicData(department.departmentCompany, true)}"
+                                               title="#{msg.ADMIN_LINK_SHOW_BASIC_DATA_TITLE}"
+                                               >
                                                <f:param name="basicDataId" value="#{department.departmentCompany.basicDataId}" />
                                        </p:link>
                                </p:column>
index 12e7bd848bc7e46517c094b9207b742ace370ec3..bcff7fd25fc4a7ce40135f173e58fa9cfc5b5124 100644 (file)
                                                                value="#{basicDataListController.allBasicData}"
                                                                var="basicData"
                                                                itemValue="#{basicData}"
-                                                               itemLabel="#{beanHelper.renderBasicData(basicData)}"
+                                                               itemLabel="#{beanHelper.renderBasicData(basicData, true)}"
                                                                />
                                                </p:selectCheckboxMenu>
                                        </f:facet>
 
-                                       <p:link outcome="admin_show_basic_data" value="#{beanHelper.renderBasicData(employee.employeeBasicData)}" title="#{msg.ADMIN_LINK_SHOW_BASIC_DATA_TITLE}">
+                                       <p:link
+                                               outcome="admin_show_basic_data"
+                                               value="#{beanHelper.renderBasicData(employee.employeeBasicData, true)}"
+                                               title="#{msg.ADMIN_LINK_SHOW_BASIC_DATA_TITLE}"
+                                               >
                                                <f:param name="basicDataId" value="#{employee.employeeBasicData.basicDataId}" />
                                        </p:link>
                                </p:column>