/**
* 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) {
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
// 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
}
value="#{basicDataListController.allBasicData}"
var="basicData"
itemValue="#{basicData}"
- itemLabel="#{beanHelper.renderBasicData(basicData)}"
+ itemLabel="#{beanHelper.renderBasicData(basicData, true)}"
/>
</p:selectOneMenu>
value="#{basicDataListController.allBasicData}"
var="basicData"
itemValue="#{basicData}"
- itemLabel="#{beanHelper.renderBasicData(basicData)}"
+ itemLabel="#{beanHelper.renderBasicData(basicData, true)}"
/>
</p:selectOneMenu>
<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>
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>
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>
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>