1 <?xml version="1.0" encoding="UTF-8" ?>
3 template="/WEB-INF/templates/admin/admin_base.tpl"
4 xmlns="http://www.w3.org/1999/xhtml"
5 xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
6 xmlns:h="http://xmlns.jcp.org/jsf/html"
7 xmlns:f="http://xmlns.jcp.org/jsf/core"
8 xmlns:p="http://primefaces.org/ui"
11 <ui:define name="document_admin_title">
12 <h:outputText value="#{product.PAGE_TITLE_ADMIN_LIST_GENERIC_PRODUCT}" />
15 <ui:define name="content_header">
16 <h:outputText value="#{product.CONTENT_TITLE_ADMIN_LIST_GENERIC_PRODUCT}" />
19 <ui:define name="content">
20 <h:form id="form-list-products">
24 value="#{productListController.allProducts}"
26 paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
27 filteredValue="#{productListController.filteredProducts}"
29 rowKey="#{genericProduct.productId}"
31 resizableColumns="true"
32 rowsPerPageTemplate="5,10,20,50,100"
34 summary="#{product.TABLE_SUMMARY_ADMIN_LIST_GENERIC_PRODUCTS}"
35 emptyMessage="#{product.ADMIN_EMPTY_LIST_GENERIC_PRODUCTS}"
36 widgetVar="productList"
37 selectionMode="single"
38 selection="#{productListController.selectedProduct}"
42 <f:facet name="header">
46 columnClasses="ui-grid-col-4,ui-grid-col-6,ui-grid-col-2"
52 columnClasses="ui-grid-4,ui-grid-8"
54 styleClass="ui-noborder"
58 value="#{msg.SEARCH_ALL_FIELDS}"
64 onkeyup="PF('productList').filter()"
65 placeholder="#{msg.ENTER_KEYWORD}"
70 <p:spacer height="4" />
75 value="#{msg.SELECT_SHOWN_COLUMNS}"
76 styleClass="column-selector"
79 <p:columnToggler datasource="productList" trigger="toggler" />
86 update="form-list-products:product-details"
87 oncomplete="PF('productDialog').show()"
91 headerText="#{msg.ID_HEADER}"
92 sortBy="#{genericProduct.productId}"
96 outcome="admin_show_generic_product"
97 title="#{product.ADMIN_LINK_SHOW_GENERIC_PRODUCT_TITLE}"
98 value="#{genericProduct.productId}"
100 <f:param name="productId" value="#{genericProduct.productId}" />
105 headerText="#{msg.ADMIN_I18N_KEY_HEADER}"
106 sortBy="#{local[genericProduct.productI18nKey]}"
107 filterBy="#{local[genericProduct.productI18nKey]}"
108 filterMatchMode="contains"
110 <h:outputText value="#{local[genericProduct.productI18nKey]}" title="#{genericProduct.productI18nKey}" />
114 headerText="#{product.ADMIN_PRODUCT_NUMBER_HEADER}"
115 sortBy="#{genericProduct.productNumber}"
116 filterBy="#{genericProduct.productNumber}"
117 filterMatchMode="contains"
119 <h:outputText value="#{genericProduct.productNumber}" rendered="#{not empty genericProduct.productNumber}" />
120 <h:outputText value="-" rendered="#{empty genericProduct.productNumber}" />
124 headerText="#{product.ADMIN_PRODUCT_FSC_NUMBER_HEADER}"
125 sortBy="#{genericProduct.productFscNumber}"
126 filterBy="#{genericProduct.productFscNumber}"
127 filterMatchMode="contains"
129 <h:outputText value="#{genericProduct.productFscNumber}" rendered="#{not empty genericProduct.productFscNumber}" />
130 <h:outputText value="-" rendered="#{empty genericProduct.productFscNumber}" />
134 headerText="#{product.ADMIN_PRODUCT_BARCODE_HEADER}"
135 sortBy="#{genericProduct.productBarCodeNumber}"
136 filterBy="#{genericProduct.productBarCodeNumber}"
137 filterMatchMode="contains"
139 <h:outputText value="#{genericProduct.productBarCodeNumber}" rendered="#{not empty genericProduct.productBarCodeNumber}" />
140 <h:outputText value="-" rendered="#{empty genericProduct.productBarCodeNumber}" />
144 headerText="#{product.ADMIN_PRODUCT_CATEGORY_HEADER}"
145 sortBy="#{genericProduct.productCategory}"
146 filterBy="#{genericProduct.productCategory}"
149 <f:facet name="filter">
150 <p:selectCheckboxMenu
152 filterMatchMode="contains"
153 label="#{product.LABEL_PRODUCT_CATEGORIES}"
154 onchange="PF('productList').filter()"
156 title="#{product.FILTER_BY_MULTIPLE_PRODUCT_CATEGORIES_TITLE}"
158 <f:converter converterId="ProductCategoryConverter" />
161 value="#{productCategoryListController.allProductCategories}"
163 itemValue="#{category}"
164 itemLabel="#{productBeanHelper.renderProductCategory(category)}"
166 </p:selectCheckboxMenu>
170 outcome="admin_show_product_category"
171 title="#{product.ADMIN_LINK_SHOW_GENERIC_PRODUCT_CATEGORY_TITLE}"
172 value="#{local[genericProduct.productCategory.categoryI18nKey]}"
174 <f:param name="categoryId" value="#{genericProduct.productCategory.categoryId}" />
179 headerText="#{product.GROSS_PRICE_HEADER}"
180 sortBy="#{genericProduct.productGrossPrice}"
181 filterBy="#{genericProduct.productGrossPrice}"
182 filterFunction="#{productListController.filterByPrice}"
184 <h:outputText value="#{genericProduct.productGrossPrice}">
185 <!-- @TODO Hard-coded EUR again -->
186 <f:convertNumber type="currency" currencyCode="EUR" />
191 headerText="#{msg.AVAILABLE_HEADER}"
192 sortBy="#{genericProduct.productAvailability}"
193 filterBy="#{genericProduct.productAvailability}"
194 filterMatchMode="exact"
196 <f:facet name="filter">
197 <p:selectOneMenu onchange="PF('productList').filter()">
198 <f:converter converterId="javax.faces.Boolean" />
199 <f:selectItem itemLabel="#{msg.CHOICE_ALL}" itemValue="#{null}" />
200 <f:selectItem itemLabel="#{msg.CHOICE_YES}" itemValue="true" />
201 <f:selectItem itemLabel="#{msg.CHOICE_NO}" itemValue="false" />
205 <h:outputText value="#{genericProduct.productAvailability ? msg.CHOICE_YES : msg.CHOICE_NO}" />
209 headerText="#{msg.ADMIN_MANUFACTURER_HEADER}"
210 sortBy="#{genericProduct.productManufacturer}"
211 filterBy="#{genericProduct.productManufacturer}"
214 <f:facet name="filter">
215 <p:selectCheckboxMenu
217 filterMatchMode="contains"
218 label="#{msg.LABEL_COMPANIES}"
219 onchange="PF('productList').filter()"
221 title="#{msg.FILTER_BY_MULTIPLE_COMPANIES_TITLE}"
223 <f:converter converterId="BasicCompanyDataConverter" />
226 value="#{basicDataListController.allBasicData}"
228 itemValue="#{basicData}"
229 itemLabel="#{beanHelper.renderBasicData(basicData, true, false)}"
231 </p:selectCheckboxMenu>
235 outcome="admin_show_basic_data"
236 value="#{beanHelper.renderBasicData(genericProduct.productManufacturer, true, false)}"
237 title="#{msg.ADMIN_LINK_SHOW_BASIC_DATA_TITLE}"
238 rendered="#{not empty genericProduct.productManufacturer}"
240 <f:param name="basicDataId" value="#{genericProduct.productManufacturer.basicDataId}" />
244 value="#{msg.ADMIN_NOT_ASSIGNED}"
245 title="#{product.ADMIN_NO_PRODUCT_MANUFACTURER_ASSIGNED_TITLE}"
246 rendered="#{empty genericProduct.productManufacturer}"
251 headerText="#{msg.ENTRY_CREATED_HEADER}"
252 sortBy="#{genericProduct.productEntryCreated}"
255 <h:outputText value="#{genericProduct.productEntryCreated}">
256 <f:convertDateTime type="both" timeStyle="short" dateStyle="short" />
261 headerText="#{msg.ENTRY_UPDATED_HEADER}"
262 sortBy="#{genericProduct.productEntryUpdated}"
265 <h:outputText value="#{genericProduct.productEntryUpdated}">
266 <f:convertDateTime type="both" timeStyle="short" dateStyle="short" />
271 headerText="#{msg.ADMIN_ACTION_LINKS_HEADER}"
275 <p:menuButton value="#{msg.OPTIONS}">
277 outcome="admin_show_generic_product"
278 value="#{msg.ADMIN_LINK_SHOW_SHORT}"
279 title="#{product.ADMIN_LINK_SHOW_GENERIC_PRODUCT_TITLE}"
281 <f:param name="productId" value="#{genericProduct.productId}" />
285 outcome="admin_edit_generic_product"
286 value="#{msg.ADMIN_LINK_EDIT_SHORT}"
287 title="#{product.ADMIN_LINK_EDIT_GENERIC_PRODUCT_TITLE}"
289 <f:param name="productId" value="#{genericProduct.productId}" />
292 <p:menuitem outcome="admin_delete_generic_product">
294 styleClass="link-danger"
295 value="#{msg.ADMIN_LINK_DELETE_SHORT}"
296 title="#{product.ADMIN_LINK_DELETE_GENERIC_PRODUCT_TITLE}"
298 <f:param name="productId" value="#{genericProduct.productId}" />
308 header="#{product.ADMIN_SINGLE_PRODUCT_DETAILS_HEADER}"
311 widgetVar="productDialog"
316 <p:outputPanel id="product-details">
317 <p:panelGrid columns="2" rendered="#{not empty productListController.selectedProduct}">
318 <f:facet name="header">
319 <h:outputFormat value="#{product.ADMIN_PRODUCT_DETAILS_HEADER}">
320 <f:param value="#{local[productListController.selectedProduct.productI18nKey]}" />
321 <f:param value="#{productListController.selectedProduct.productId}" />
325 <p:outputLabel value="#{msg.ID_HEADER}" title="#{product.PRODUCT_ID_NUMBER_TITLE}" />
326 <h:outputText value="#{productListController.selectedProduct.productId}" />
328 <p:outputLabel value="#{msg.ADMIN_I18N_KEY_HEADER}" title="#{product.PRODUCT_I18N_KEY_TITLE}" />
329 <h:outputText value="#{productListController.selectedProduct.productI18nKey}" title="#{local[productListController.selectedProduct.productI18nKey]}" />
331 <p:outputLabel value="#{product.PRODUCT_NUMBER_HEADER}" title="#{product.PRODUCT_NUMBER_TITLE}" />
332 <h:outputText value="#{productListController.selectedProduct.productNumber}" rendered="#{not empty productListController.selectedProduct.productNumber}" />
333 <h:outputText value="#{product.ADMIN_NO_PRODUCT_NUMBER_ASSIGNED}" rendered="#{empty productListController.selectedProduct.productNumber}" />
335 <p:outputLabel value="#{project.BARCODE_HEADER}" title="#{product.PRODUCT_BARCODE_NUMBER_TITLE}" />
336 <h:outputText value="#{product.PRODUCT_NO_BARCODE_NUMBER_ASSIGNED}" rendered="#{empty productListController.selectedProduct.productBarCodeNumber}" />
339 type="#{initParam['product_barcode_type']}"
340 value="#{productListController.selectedProduct.productBarCodeNumber}"
341 rendered="#{not empty productListController.selectedProduct.productBarCodeNumber}"
344 <p:outputLabel value="#{product.ADMIN_PRODUCT_FSC_NUMBER_HEADER}" title="#{product.PRODUCT_FSC_NUMBER_TITLE}" />
345 <h:outputText value="#{productListController.selectedProduct.productFscNumber}" rendered="#{not empty productListController.selectedProduct.productFscNumber}" />
346 <h:outputText value="#{product.ADMIN_NO_PRODUCT_FSC_NUMBER_ASSIGNED}" rendered="#{empty productListController.selectedProduct.productFscNumber}" />
348 <p:outputLabel value="#{msg.AVAILABLE_HEADER}" title="#{product.PRODUCT_AVAILABILITY_TITLE}" />
349 <h:outputText value="#{productListController.selectedProduct.productAvailability ? msg.CHOICE_YES : msg.CHOICE_NO}" />
351 <p:outputLabel value="#{product.AGE_GROUP_HEADER}" title="#{product.PRODUCT_AGE_GROUP_TITLE}" />
352 <h:outputText value="#{project[productListController.selectedProduct.productAgeGroup.messageKey]}" title="#{productListController.selectedProduct.productAgeGroup.messageKey}" rendered="#{not empty productListController.selectedProduct.productAgeGroup.messageKey}" />
353 <h:outputText value="#{product.PRODUCT_HAS_NO_AGE_GROUP}" rendered="#{empty productListController.selectedProduct.productAgeGroup.messageKey}" />
355 <p:outputLabel value="#{product.CURRENCY_CODE_HEADER}" title="#{product.PRODUCT_CURRENCY_CODE_TITLE}" />
356 <h:outputText value="#{productListController.selectedProduct.productCurrencyCode}" />
358 <p:outputLabel value="#{product.GROSS_PRICE_HEADER}" title="#{product.PRODUCT_GROSS_PRICE_TITLE}" />
359 <h:outputText value="#{productListController.selectedProduct.productGrossPrice}">
360 <!-- @TODO Hard-coded EUR again -->
361 <f:convertNumber type="currency" currencyCode="EUR" />
364 <p:outputLabel value="#{product.NET_PRICE_HEADER}" title="#{product.PRODUCT_NET_PRICE_TITLE}" />
365 <h:outputText value="#{productListController.selectedProduct.productNetPrice}">
366 <!-- @TODO Hard-coded EUR again -->
367 <f:convertNumber type="currency" currencyCode="EUR" />
370 <p:outputLabel value="#{product.TAX_RATE_HEADER}" title="#{product.PRODUCT_TAX_RATE_TITLE}" />
371 <h:outputText value="#{productListController.selectedProduct.productTaxRate}">
372 <!-- @TODO No real percentage number, 7.0 means 7.0%, not 700% -->
373 <f:convertNumber type="number" />
376 <p:outputLabel value="#{product.PRODUCT_SIZE_HEADER}" title="#{product.PRODUCT_SIZE_TITLE}" />
377 <h:outputText value="#{productListController.selectedProduct.productSize}" />
379 <p:outputLabel value="#{product.PRODUCT_UNIT_AMOUNT_HEADER}" title="#{product.PRODUCT_UNIT_AMOUNT_TITLE}" />
380 <h:outputText value="#{productListController.selectedProduct.productUnitAmount}">
381 <f:convertNumber type="number" />
384 <p:outputLabel value="#{product.PRODUCT_UNIT_I18N_KEY_HEADER}" title="#{product.PRODUCT_UNIT_I18N_KEY_TITLE}" />
385 <h:outputText value="#{productListController.selectedProduct.productUnitI18nKey}" title="#{local[productListController.selectedProduct.productUnitI18nKey]}" />
387 <p:outputLabel value="#{product.ADMIN_ASSIGNED_PRODUCT_CATEGORY_LABEL}" title="#{product.ADMIN_ASSIGNED_PRODUCT_CATEGORY_TITLE}" />
389 outcome="admin_show_product_category"
390 value="#{local[productListController.selectedProduct.productCategory.categoryI18nKey]}"
391 title="#{product.ADMIN_LINK_SHOW_GENERIC_PRODUCT_CATEGORY_TITLE}"
393 <f:param name="categoryId" value="#{productListController.selectedProduct.productCategory.categoryId}" />
396 <p:outputLabel value="#{msg.ADMIN_ASSIGNED_MANUFACTURER_LABEL}" title="#{product.ADMIN_ASSIGNED_PRODUCT_MANUFACTURER_TITLE}" />
398 outcome="admin_show_basic_data"
399 title="#{msg.ADMIN_LINK_SHOW_BASIC_DATA_TITLE}"
400 rendered="#{not empty productListController.selectedProduct.productManufacturer}"
402 <h:outputFormat value="#{msg.BASIC_DATA_LINK_MASK}">
403 <f:param value="#{productListController.selectedProduct.productManufacturer.companyName}" />
404 <f:param value="#{productListController.selectedProduct.productManufacturer.basicDataId}" />
406 <f:param name="basicDataId" value="#{productListController.selectedProduct.productManufacturer.basicDataId}" />
408 <h:outputText value="#{product.PRODUCT_HAS_NO_MANUFACTURER_ASSIGNED}" rendered="#{empty productListController.selectedProduct.productManufacturer}" />
410 <p:outputLabel value="#{msg.ENTRY_CREATED_HEADER}" title="#{product.ADMIN_PRODUCT_ENTRY_CREATED_TITLE}" />
411 <h:outputText value="#{productListController.selectedProduct.productEntryCreated}">
412 <f:convertDateTime type="both" timeStyle="short" dateStyle="short" />
415 <p:outputLabel value="#{msg.ENTRY_UPDATED_HEADER}" title="#{product.ADMIN_PRODUCT_ENTRY_UPDATED_TITLE}" />
416 <h:outputText value="#{productListController.selectedProduct.productEntryUpdated}">
417 <f:convertDateTime type="both" timeStyle="short" dateStyle="short" />
429 <f:facet name="header">
430 <h:outputText value="#{product.ADMIN_ADD_GENERIC_PRODUCT_TITLE}" />
433 <h:panelGroup styleClass="para" layout="block">
434 <h:outputText value="#{product.ADMIN_ADD_GENERIC_PRODUCT_MINIMUM_DATA}" />
437 <ui:include src="/WEB-INF/templates/admin/generic_product/admin_form_generic_product_data.tpl" />
439 <f:facet name="footer">
440 <p:panelGrid columns="2" layout="grid">
443 value="#{msg.BUTTON_RESET_FORM}"
448 value="#{product.BUTTON_ADMIN_ADD_GENERIC_PRODUCT}"
449 action="#{adminGenericProductActionController.addProduct()}"
450 update="form-list-products:productList"