/**
* 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>
- <h:outputLink value="#{department.departmentCompany.companyWebsiteUrl}" target="_blank" title="#{msg.LINK_COMPANY_WEBSITE_URL_TITLE}" rel="external" rendered="#{not empty department.departmentCompany.companyWebsiteUrl}">
- <h:outputText value="#{beanHelper.renderBasicData(department.departmentCompany)}" />
- </h:outputLink>
-
- <h:outputText value="#{beanHelper.renderBasicData(department.departmentCompany)}" title="#{msg.NO_WEBSITE_URL_ENTERED}" rendered="#{empty department.departmentCompany.companyWebsiteUrl}" />
+ <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>
<p:column headerText="#{msg.ADMIN_ASSIGNED_BRANCH_OFFICE}" sortBy="#{department.departmentBranchOffice}" filterBy="#{department.departmentBranchOffice}" filterMatchMode="in">
value="#{basicDataListController.allBasicData}"
var="basicData"
itemValue="#{basicData}"
- itemLabel="#{beanHelper.renderBasicData(basicData)}"
+ itemLabel="#{beanHelper.renderBasicData(basicData, true)}"
/>
</p:selectCheckboxMenu>
</f:facet>
- <h:outputLink value="#{employee.employeeBasicData.companyWebsiteUrl}" target="_blank" title="#{msg.LINK_COMPANY_WEBSITE_URL_TITLE}" rel="external" rendered="#{not empty employee.employeeBasicData.companyWebsiteUrl}">
- <h:outputText value="#{beanHelper.renderBasicData(employee.employeeBasicData)}" />
- </h:outputLink>
-
- <h:outputText value="#{beanHelper.renderBasicData(employee.employeeBasicData)}" title="#{msg.NO_WEBSITE_URL_ENTERED}" rendered="#{empty employee.employeeBasicData.companyWebsiteUrl}" />
+ <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>
<p:column headerText="#{msg.DATA_EMAIL_ADDRESS}" sortBy="#{employee.employeeEmailAddress}" filterBy="#{employee.employeeEmailAddress}" filterMatchMode="contains">