Profil kezelés bővítésének átvezetése
authorVásáry Dániel <vasary@elgekko.net>
Thu, 29 Feb 2024 10:15:56 +0000 (11:15 +0100)
committerVásáry Dániel <vasary@elgekko.net>
Thu, 29 Feb 2024 10:15:56 +0000 (11:15 +0100)
13 files changed:
sly-crm-app/src/main/resources/application-dev.yaml
sly-crm-ui/src/main/java/hu/user/lis/ui/data/common/CachedSpringDataModel.java
sly-crm-ui/src/main/java/hu/user/lis/ui/properties/ApplicationUIProperties.java
sly-crm-ui/src/main/java/hu/user/lis/ui/view/AssociatesViewModel.java
sly-crm-ui/src/main/java/hu/user/lis/ui/view/ImportInvoicesSuspendedViewModel.java
sly-crm-ui/src/main/java/hu/user/lis/ui/view/ProjectsViewModel.java
sly-crm-ui/src/main/java/hu/user/lis/ui/view/ServiceRecordsViewModel.java
sly-crm-ui/src/main/resources/web/associates.zul
sly-crm-ui/src/main/resources/web/import-invoices-suspended.zul
sly-crm-ui/src/main/resources/web/invoices.zul
sly-crm-ui/src/main/resources/web/partners.zul
sly-crm-ui/src/main/resources/web/projects.zul
sly-crm-ui/src/main/resources/web/service-records.zul

index f8b7d084552d981ddb50cbb49d2043be78e7611d..ae55e134328333b88efdf938b2b0def07906fada 100644 (file)
@@ -20,9 +20,12 @@ spring:
       enabled: always
   datasource:
     type: com.zaxxer.hikari.HikariDataSource
-    url: jdbc:db2://localhost:50000/slycrm
+    #    url: jdbc:db2://localhost:50000/slycrm
+    #    username: db2admin
+    #    password: password
+    url: jdbc:db2://db2.in.useribm.hu:50000/slycrm
     username: db2admin
-    password: password
+    password: Passw@rd01
 camunda.bpm:
   generic-properties.properties:
     telemetry-reporter-activate: false
@@ -56,6 +59,7 @@ application:
   ui:
     user-name: user
     password: password
+    disable-profile-save: true
   workflow:
     import-invoice:
       input-path: /temp/invoice-import
index db8b7e4428187bcb4d2865af71f5a23c557c76d2..e3a9d946ddf95b24070de2c7fca3f67ef8b2bd0c 100644 (file)
@@ -3,6 +3,7 @@ package hu.user.lis.ui.data.common;
 import hu.user.lis.db.Profile;
 import hu.user.lis.service.data.EntityDataService;
 import hu.user.lis.ui.auth.CurrentProfile;
+import hu.user.lis.ui.properties.ApplicationUIProperties;
 import hu.user.lis.ui.view.renderer.ReorderedItemsRenderer;
 import lombok.Getter;
 import lombok.extern.log4j.Log4j2;
@@ -34,6 +35,9 @@ public abstract class CachedSpringDataModel<T> extends CachedDataModel<T> {
     @Autowired
     private ReorderedItemsRenderer renderer;
 
+    @Autowired
+    private ApplicationUIProperties applicationUIProperties;
+
     public void addColumns(List<ColDef> columns) {
         Profile profile = currentProfile.getSetting(getClass().getSimpleName());
         ColDef[] savedColumns = getValidSavedColumns(profile, columns);
@@ -76,12 +80,14 @@ public abstract class CachedSpringDataModel<T> extends CachedDataModel<T> {
     }
 
     private void saveProfileSetting() {
-        Profile columnProfile = Profile.builder()
-                .login(currentProfile.getAssociate().getLogin())
-                .type(getClass().getSimpleName())
-                .setting(entityDataService.toJSON(renderer.getColumnSettings()))
-                .build();
-        currentProfile.persistSetting(columnProfile);
+        if (!applicationUIProperties.isDisableProfileSave()) {
+            Profile columnProfile = Profile.builder()
+                    .login(currentProfile.getAssociate().getLogin())
+                    .type(getClass().getSimpleName())
+                    .setting(entityDataService.toJSON(renderer.getColumnSettings()))
+                    .build();
+            currentProfile.persistSetting(columnProfile);
+        }
     }
 
     private void setSortDirection(ColDef colDef) {
index c706d932576f4a56a94b26c3f0e66af9c9249a3a..9299b29b9771a64a2aa1318065fbbfb7e34e1ea5 100644 (file)
@@ -10,6 +10,11 @@ import org.springframework.stereotype.Component;
 @Component
 @ConfigurationProperties(prefix = "application.ui")
 public class ApplicationUIProperties {
-    String userName;
-    String password;
+
+    private String userName;
+
+    private String password;
+
+    private boolean disableProfileSave;
+
 }
index afb5edec9d37cd1db5e018d5fc2bac0e805b8f7c..0a07e9a8294fd37c6767b38cc852b35f6079cd04 100644 (file)
@@ -1,6 +1,5 @@
 package hu.user.lis.ui.view;
 
-import com.google.common.collect.ImmutableMap;
 import hu.user.lis.db.Associate;
 import hu.user.lis.ui.Constants;
 import hu.user.lis.ui.data.AssociatesDataModel;
@@ -16,8 +15,7 @@ import org.zkoss.bind.annotation.Init;
 import org.zkoss.zk.ui.select.annotation.WireVariable;
 import org.zkoss.zul.Messagebox;
 
-import static hu.user.lis.ui.data.common.CachedDataModel.ASCENDING;
-import static hu.user.lis.ui.data.common.CachedDataModel.NATURAL;
+import java.util.Arrays;
 
 @Log4j2
 public class AssociatesViewModel extends FilterActiveViewModel<Associate> {
@@ -39,10 +37,10 @@ public class AssociatesViewModel extends FilterActiveViewModel<Associate> {
     @Override
     public void init() {
         super.init();
-        addColumns(ImmutableMap.of(
-                "name", ASCENDING,
-                "login", NATURAL,
-                "active", NATURAL
+        addColumns(Arrays.asList(
+                "name,Név,ascending,left,true",
+                "login,Login,natural,left,true",
+                "active,Aktív,natural,left,true"
         ));
     }
 
index e7c5132342a0165721c8c628599ba67ee081d00d..9ef3518d24d4bcc215147fd020eae9600bf5f017 100644 (file)
@@ -1,6 +1,5 @@
 package hu.user.lis.ui.view;
 
-import com.google.common.collect.ImmutableMap;
 import hu.user.lis.db.*;
 import hu.user.lis.db.repository.InvoiceImportRepository;
 import hu.user.lis.db.repository.InvoiceRepository;
@@ -25,12 +24,10 @@ import org.zkoss.zk.ui.event.Event;
 import org.zkoss.zk.ui.event.EventListener;
 import org.zkoss.zk.ui.select.annotation.WireVariable;
 
+import java.util.Arrays;
 import java.util.Objects;
 import java.util.Optional;
 
-import static hu.user.lis.ui.data.common.CachedDataModel.ASCENDING;
-import static hu.user.lis.ui.data.common.CachedDataModel.NATURAL;
-
 @Log4j2
 public class ImportInvoicesSuspendedViewModel extends EntityViewModel<Invoice> implements EventListener<Event> {
     @Getter
@@ -70,16 +67,17 @@ public class ImportInvoicesSuspendedViewModel extends EntityViewModel<Invoice> i
 
         eventBus.register(this);
         eventBus.registerForBinding(this);
-        addColumns(ImmutableMap.of(
-                "partner.humanId", NATURAL,
-                "partner.name", NATURAL,
-                "partner.vatNr", NATURAL,
-                "project.name", NATURAL,
-                "paymentDeadline", ASCENDING,
-                "grossAmount", NATURAL,
-                "currency", NATURAL,
-                "incoming", NATURAL
+        addColumns(Arrays.asList(
+                "partner.humanId,Sorszám,natural,left,true",
+                "partner.name,Partner név,natural,left,true",
+                "partner.vatNr,Partner adószám,left,true",
+                "project.name,Projekt név,natural,left,true",
+                "paymentDeadline,Fizetési határidő,ascending,left,true",
+                "grossAmount,Bruttó összeg,natural,left,true",
+                "currency,Pénznem,natural,left,true",
+                "incoming,Költség/Bevétel,natural,left,true"
         ));
+
         refresh();
     }
 
index 8e67ec850ce6734a99ae301289080476cde7d4fe..20f61791922872bec3d8ed64c91a85563c64def2 100644 (file)
@@ -1,6 +1,5 @@
 package hu.user.lis.ui.view;
 
-import com.google.common.collect.ImmutableMap;
 import hu.user.lis.db.Project;
 import hu.user.lis.ui.Constants;
 import hu.user.lis.ui.data.ProjectsDataModel;
@@ -21,12 +20,10 @@ import org.zkoss.zk.ui.select.annotation.WireVariable;
 import org.zkoss.zk.ui.util.Notification;
 import org.zkoss.zul.Messagebox;
 
+import java.util.Arrays;
 import java.util.Map;
 import java.util.Objects;
 
-import static hu.user.lis.ui.data.common.CachedDataModel.ASCENDING;
-import static hu.user.lis.ui.data.common.CachedDataModel.NATURAL;
-
 
 @Log4j2
 public class ProjectsViewModel extends FilterActiveViewModel<Project> implements EventListener {
@@ -53,13 +50,13 @@ public class ProjectsViewModel extends FilterActiveViewModel<Project> implements
     public void init() {
         super.init();
         eventBus.register(this);
-        addColumns(ImmutableMap.of(
-                "humanId", ASCENDING,
-                "partner.name", NATURAL,
-                "projectStatus.name", NATURAL,
-                "name", NATURAL,
-                "contactName", NATURAL,
-                "active", NATURAL
+        addColumns(Arrays.asList(
+                "humanId,Azonosító,ascending,left,true",
+                "partner.name,Ügyfél,natural,left,true",
+                "projectStatus.name,Státusz,natural,left,true",
+                "name,Megnevezés,natural,left,true",
+                "contactName,Kapcsolattartó,natural,left,true",
+                "active,Aktív,natural,left,true"
         ));
     }
 
index c3a0f21add4069d1afd3a103cfb970cbcb702872..2ec785b547e5287290aef85ddbe3a100be98a3e2 100644 (file)
@@ -1,6 +1,5 @@
 package hu.user.lis.ui.view;
 
-import com.google.common.collect.ImmutableMap;
 import hu.user.lis.db.Associate;
 import hu.user.lis.db.Project;
 import hu.user.lis.db.ServiceRecord;
@@ -28,13 +27,11 @@ import org.zkoss.zk.ui.select.annotation.VariableResolver;
 import org.zkoss.zk.ui.select.annotation.WireVariable;
 import org.zkoss.zkplus.spring.DelegatingVariableResolver;
 
+import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 
-import static hu.user.lis.ui.data.common.CachedDataModel.ASCENDING;
-import static hu.user.lis.ui.data.common.CachedDataModel.NATURAL;
-
 
 @Log4j2
 @VariableResolver(DelegatingVariableResolver.class)
@@ -75,14 +72,14 @@ public class ServiceRecordsViewModel extends EntityViewModel<ServiceRecord> impl
         super.init();
         eventBus.register(this);
         eventBus.registerForBinding(this);
-        addColumns(ImmutableMap.of(
-                "project.humanId", ASCENDING,
-                "project.name", NATURAL,
-                "project.partner.name", NATURAL,
-                "associate.name", NATURAL,
-                "workDay", NATURAL,
-                "description", NATURAL,
-                "workHours", NATURAL
+        addColumns(Arrays.asList(
+                "project.humanId,Projekt azonosító,ascending,left,true",
+                "project.name,Projekt név,natural,left,true",
+                "project.partner.name,Partner név,natural,left,true",
+                "associate.name,Munkatárs,natural,left,true",
+                "workDay,Munkanap,natural,left,true",
+                "description,Leírás,natural,left,true",
+                "workHours,Óraszám,natural,left,true"
         ));
     }
 
index cf76fc2f14e78c6dffc1970fed47ae7ee2aaf6c8..215aa02cd38f3b637380e5915c5dcece77795e4e 100644 (file)
                                    checked="@bind(vm.filterShowBoth)"/>
                 </toolbar>
             </north>
-            <center border="none" flex="true">
-                <listbox vflex="true" model="@load(vm.associatesDataModel)"
-                         autopaging="true" mold="paging" pagingPosition="top" multiple="false"
-                         onSelect="@command('onListSelection')">
-                    <listhead sizable="true">
-                        <listheader label="Név" sort="auto(name)" align="left"
-                                    sortDirection="@load(vm.cols['name'].sortDirection)"/>
-                        <listheader label="Login" sort="auto(login)" align="left"
-                                    sortDirection="@load(vm.cols['login'].sortDirection)"/>
-                        <listheader label="Aktív" sort="auto(active)" align="left"
-                                    sortDirection="@load(vm.cols['active'].sortDirection)"/>
-
-                    </listhead>
-                    <template name="model">
-                        <listitem onDoubleClick="@command('onEdit')">
-                            <listcell label="@load(each.name)"/>
-                            <listcell label="@load(each.login)"/>
-                            <listcell>
-                                <a iconSclass="z-icon-check" visible="@load(each.active)"/>
-                                <a iconSclass="z-icon-ban" visible="@load(!each.active)"/>
-                            </listcell>
-                        </listitem>
-                    </template>
-                </listbox>
+            <center border="none">
+                <vlayout vflex="true">
+                    <menupopup id="editPopup"
+                               children="@bind(vm.associatesDataModel.renderer.columnSettings) @template('menu-item')">
+                        <template name="menu-item" var="node">
+                            <menuitem label="@load(node.label)" checked="@load(node.visible)"
+                                      onClick="@command('onHeaderMenuClicked', node=node)"/>
+                        </template>
+                    </menupopup>
+                    <listbox vflex="true" model="@load(vm.associatesDataModel)" multiple="false"
+                             itemRenderer="@load(vm.associatesDataModel.renderer)"
+                             onSelect="@command('onListSelection')">
+                        <listhead sizable="true" menupopup="editPopup"
+                                  onColSize="@command('onHeaderSizeChanged', node=node)"
+                                  children="@bind(vm.associatesDataModel.renderer.columnSettings) @template('head-item')">
+                            <template name="head-item" var="node">
+                                <listheader label="@load(node.label)" sort="@load(node.sort)" align="@load(node.align)"
+                                            visible="@load(node.visible)" width="@load(node.width)" draggable="head"
+                                            droppable="head" sortDirection="@load(node.sortDirection)"
+                                            onDrop="@command('onHeaderReorder')"/>
+                            </template>
+                        </listhead>
+                        <template name="model">
+                            <listitem onDoubleClick="@command('onEdit')">
+                                <listcell label="@load(each.name)"/>
+                                <listcell label="@load(each.login)"/>
+                                <listcell>
+                                    <a iconSclass="z-icon-check" visible="@load(each.active)"/>
+                                    <a iconSclass="z-icon-ban" visible="@load(!each.active)"/>
+                                </listcell>
+                            </listitem>
+                        </template>
+                    </listbox>
+                </vlayout>
             </center>
         </borderlayout>
 
index 5f184cfae4a890539b62fcf59841cd33efc4a0b2..8cb69ff6b3ae15c3b5c8be8f39821f12406bf521 100644 (file)
                     </toolbar>
                 </vlayout>
             </north>
-            <center border="none" hflex="true" vflex="true">
-                <listbox id="invoicesList" vflex="true" model="@load(vm.invoicesDataModel)"
-                         autopaging="true" mold="paging" pagingPosition="top" multiple="false"
-                         onSelect="@command('onListSelection')">
-                    <listhead sizable="true">
-                        <listheader label="Sorszám" sort="auto(partner.humanId)" align="left"
-                                    sortDirection="@load(vm.cols['partner.name'].sortDirection)"/>
-                        <listheader label="Partner név" sort="auto(partner.name)" align="left"
-                                    sortDirection="@load(vm.cols['partner.name'].sortDirection)"/>
-                        <listheader label="Partner adószám" sort="auto(partner.vatNr)" align="left"
-                                    sortDirection="@load(vm.cols['partner.vatNr'].sortDirection)"/>
-                        <listheader label="Projekt név" sort="auto(project.name)" align="left"
-                                    sortDirection="@load(vm.cols['project.name'].sortDirection)"/>
-                        <listheader label="Fizetési határidő" sort="auto(paymentDeadline)" align="left"
-                                    sortDirection="@load(vm.cols['paymentDeadline'].sortDirection)"/>
-                        <listheader label="Bruttó összeg" sort="auto(grossAmount)" align="right"
-                                    style="text-align: center"
-                                    sortDirection="@load(vm.cols['grossAmount'].sortDirection)"/>
-                        <listheader label="Pénznem" sort="auto(currency)" align="left"
-                                    sortDirection="@load(vm.cols['currency'].sortDirection)"/>
-                        <listheader label="Költség/Bevétel" sort="auto(incoming)" align="left"
-                                    sortDirection="@load(vm.cols['incoming'].sortDirection)"/>
-                    </listhead>
-                    <template name="model">
-                        <listitem>
-                            <listcell label="@load(each.humanId)"/>
-                            <listcell label="@load(each.partner.name)"/>
-                            <listcell label="@load(each.partner.vatNr)"/>
-                            <listcell label="@load(each.project.name)"/>
-                            <listcell
-                                    label="@load(each.paymentDeadline) @converter('hu.user.lis.ui.converter.DateToStringConverter')"/>
-                            <listcell
-                                    label="@load(each.grossAmount) @converter('hu.user.lis.ui.converter.DoubleToStringConverter')"/>
-                            <listcell label="@load(each.currency)"/>
-                            <listcell>
-                                <a iconSclass="z-icon-external-link" visible="@load(each.incoming)"/>
-                                <a iconSclass="z-icon-sign-in" visible="@load(!each.incoming)"/>
-                            </listcell>
-                        </listitem>
-                    </template>
-                </listbox>
+            <center border="none">
+                <vlayout vflex="true">
+                    <menupopup id="editPopup"
+                               children="@bind(vm.invoicesDataModel.renderer.columnSettings) @template('menu-item')">
+                        <template name="menu-item" var="node">
+                            <menuitem label="@load(node.label)" checked="@load(node.visible)"
+                                      onClick="@command('onHeaderMenuClicked', node=node)"/>
+                        </template>
+                    </menupopup>
+                    <listbox vflex="true" model="@load(vm.invoicesDataModel)" multiple="false"
+                             itemRenderer="@load(vm.invoicesDataModel.renderer)" onSelect="@command('onListSelection')">
+                        <listhead sizable="true" menupopup="editPopup"
+                                  onColSize="@command('onHeaderSizeChanged', node=node)"
+                                  children="@bind(vm.invoicesDataModel.renderer.columnSettings) @template('head-item')">
+                            <template name="head-item" var="node">
+                                <listheader label="@load(node.label)" sort="@load(node.sort)" align="@load(node.align)"
+                                            visible="@load(node.visible)" width="@load(node.width)" draggable="head"
+                                            droppable="head" sortDirection="@load(node.sortDirection)"
+                                            onDrop="@command('onHeaderReorder')"/>
+                            </template>
+                        </listhead>
+                        <template name="model">
+                            <listitem>
+                                <listcell label="@load(each.humanId)"/>
+                                <listcell label="@load(each.partner.name)"/>
+                                <listcell label="@load(each.partner.vatNr)"/>
+                                <listcell label="@load(each.project.name)"/>
+                                <listcell
+                                        label="@load(each.paymentDeadline) @converter('hu.user.lis.ui.converter.DateToStringConverter')"/>
+                                <listcell
+                                        label="@load(each.grossAmount) @converter('hu.user.lis.ui.converter.DoubleToStringConverter')"/>
+                                <listcell label="@load(each.currency)"/>
+                                <listcell>
+                                    <a iconSclass="z-icon-external-link" visible="@load(each.incoming)"/>
+                                    <a iconSclass="z-icon-sign-in" visible="@load(!each.incoming)"/>
+                                </listcell>
+                            </listitem>
+                        </template>
+                    </listbox>
+                </vlayout>
             </center>
         </borderlayout>
     </window>
index 1bb0112baae5599618e7a4ead4ff7a48a21bd9bb..7de81faaeeb20c15ef72dcf9c40566756f3b3a23 100644 (file)
@@ -70,7 +70,7 @@
                 </vlayout>
             </north>
             <center border="none">
-                <vlayout vflex="true" hflex="true">
+                <vlayout vflex="true">
                     <listbox id="invoicesList" vflex="true" model="@load(vm.invoicesDataModel)" multiple="false"
                              itemRenderer="@load(vm.invoicesDataModel.renderer)" onSelect="@command('onListSelection')">
                         <listhead sizable="true" menupopup="editPopup"
index acdd9b2e7bad390a40e7bf77d5631e9f4197ecca..bbf9bf1fc4d3ec2bb2a14cb82d9ab9715c288d9b 100644 (file)
@@ -19,7 +19,7 @@
                 </toolbar>
             </north>
             <center border="none">
-                <vlayout vflex="true" hflex="true">
+                <vlayout vflex="true">
                     <menupopup id="editPopup"
                                children="@bind(vm.partnersDataModel.renderer.columnSettings) @template('menu-item')">
                         <template name="menu-item" var="node">
index 976620e4eb1475f4f9347822986365a5424a5302..65d06728df1e9bdd5f22508d8d7e6762e4b62f7e 100644 (file)
                                    checked="@bind(vm.filterShowBoth)"/>
                 </toolbar>
             </north>
-            <center border="none" flex="true">
-                <listbox vflex="true" model="@load(vm.projectsDataModel)"
-                         autopaging="true" mold="paging" pagingPosition="top" multiple="false"
-                         onSelect="@command('onListSelection')">
-                    <listhead sizable="true">
-                        <listheader label="Azonosító" sort="auto(humanId)" align="left"
-                                    sortDirection="@load(vm.cols['humanId'].sortDirection)"/>
-                        <listheader label="Ügyfél" sort="auto(partner.name)" align="left"
-                                    sortDirection="@load(vm.cols['partner.name'].sortDirection)"/>
-                        <listheader label="Státusz" sort="auto(projectStatus.name)" align="left"
-                                    sortDirection="@load(vm.cols['projectStatus.name'].sortDirection)"/>
-                        <listheader label="Megnevezés" sort="auto(name)" align="left"
-                                    sortDirection="@load(vm.cols['name'].sortDirection)"/>
-                        <listheader label="Kapcsolattartó" sort="auto(contactName)" align="left"
-                                    sortDirection="@load(vm.cols['contactName'].sortDirection)"/>
-                        <listheader label="Aktív" sort="auto(active)" align="left"
-                                    sortDirection="@load(vm.cols['active'].sortDirection)"/>
-                    </listhead>
-                    <template name="model">
-                        <listitem onDoubleClick="@command('onEdit')">
-                            <listcell label="@load(each.humanId)"/>
-                            <listcell label="@load(each.partner.name)"/>
-                            <listcell label="@load(each.projectStatus.name)"/>
-                            <listcell label="@load(each.name)"/>
-                            <listcell label="@load(each.contactName)"/>
-                            <listcell>
-                                <a iconSclass="z-icon-check" visible="@load(each.active)"/>
-                                <a iconSclass="z-icon-ban" visible="@load(!each.active)"/>
-                            </listcell>
-                        </listitem>
-                    </template>
-                </listbox>
+            <center border="none">
+                <vlayout vflex="true">
+                    <menupopup id="editPopup"
+                               children="@bind(vm.projectsDataModel.renderer.columnSettings) @template('menu-item')">
+                        <template name="menu-item" var="node">
+                            <menuitem label="@load(node.label)" checked="@load(node.visible)"
+                                      onClick="@command('onHeaderMenuClicked', node=node)"/>
+                        </template>
+                    </menupopup>
+                    <listbox vflex="true" model="@load(vm.projectsDataModel)" multiple="false"
+                             itemRenderer="@load(vm.projectsDataModel.renderer)" onSelect="@command('onListSelection')">
+                        <listhead sizable="true" menupopup="editPopup"
+                                  onColSize="@command('onHeaderSizeChanged', node=node)"
+                                  children="@bind(vm.projectsDataModel.renderer.columnSettings) @template('head-item')">
+                            <template name="head-item" var="node">
+                                <listheader label="@load(node.label)" sort="@load(node.sort)" align="@load(node.align)"
+                                            visible="@load(node.visible)" width="@load(node.width)" draggable="head"
+                                            droppable="head" sortDirection="@load(node.sortDirection)"
+                                            onDrop="@command('onHeaderReorder')"/>
+                            </template>
+                        </listhead>
+                        <template name="model">
+                            <listitem onDoubleClick="@command('onEdit')">
+                                <listcell label="@load(each.humanId)"/>
+                                <listcell label="@load(each.partner.name)"/>
+                                <listcell label="@load(each.projectStatus.name)"/>
+                                <listcell label="@load(each.name)"/>
+                                <listcell label="@load(each.contactName)"/>
+                                <listcell>
+                                    <a iconSclass="z-icon-check" visible="@load(each.active)"/>
+                                    <a iconSclass="z-icon-ban" visible="@load(!each.active)"/>
+                                </listcell>
+                            </listitem>
+                        </template>
+                    </listbox>
+                </vlayout>
             </center>
         </borderlayout>
 
index 115c318f276574f02d71be5f8b3d736d1f7f7d32..2a0416a52ceef3d9d396699642a36e36db416e59 100644 (file)
                     <toolbarbutton label="Nincs szűrés" iconSclass="z-icon-ban" onClick="@command('onClearFilters')"/>
                 </toolbar>
             </north>
-            <center border="none" flex="true">
-                <listbox vflex="true" model="@load(vm.serviceRecordsDataModel)"
-                         autopaging="true" mold="paging" pagingPosition="top" onSelect="@command('onListSelection')">
-                    <listhead sizable="true">
-                        <listheader label="Projekt azonosító" sort="auto(project.humanId)" align="left"
-                                    sortDirection="@load(vm.cols['project.humanId'].sortDirection)"/>
-                        <listheader label="Projekt név" sort="auto(project.name)" align="left"
-                                    sortDirection="@load(vm.cols['project.name'].sortDirection)"/>
-                        <listheader label="Partner név" sort="auto(project.partner.name)" align="left"
-                                    sortDirection="@load(vm.cols['project.partner.name'].sortDirection)"/>
-                        <listheader label="Munkatárs" sort="auto(associate.name)" align="left"
-                                    sortDirection="@load(vm.cols['associate.name'].sortDirection)"/>
-                        <listheader label="Munkanap" sort="auto(workDay)" align="left"
-                                    sortDirection="@load(vm.cols['workDay'].sortDirection)"/>
-                        <listheader label="Leírás" sort="auto(description)" align="left"
-                                    sortDirection="@load(vm.cols['description'].sortDirection)"/>
-                        <listheader label="Óraszám" sort="auto(workHours)" align="right" style="text-align: center"
-                                    sortDirection="@load(vm.cols['workHours'].sortDirection)"/>
-                        <listheader label="Aláírt" align="left"/>
-                    </listhead>
-                    <template name="model">
-                        <listitem onDoubleClick="@command('onEdit')">
-                            <listcell label="@load(each.project.humanId)"/>
-                            <listcell label="@load(each.project.name)"/>
-                            <listcell label="@load(each.project.partner.name)"/>
-                            <listcell label="@load(each.associate.name)"/>
-                            <listcell
-                                    label="@load(each.workDay) @converter('hu.user.lis.ui.converter.DateToStringConverter')"/>
-                            <listcell label="@load(each.description)"/>
-                            <listcell>
-                                <label value="@load(each.workHours)"/>
-                            </listcell>
-                            <listcell>
-                                <a iconSclass="z-icon-check" visible="@load(each.signed)"/>
-                                <a iconSclass="z-icon-ban" visible="@load(not each.signed)"/>
-                            </listcell>
-                        </listitem>
-                    </template>
-                </listbox>
+            <center border="none">
+                <vlayout vflex="true">
+                    <menupopup id="editPopup"
+                               children="@bind(vm.serviceRecordsDataModel.renderer.columnSettings) @template('menu-item')">
+                        <template name="menu-item" var="node">
+                            <menuitem label="@load(node.label)" checked="@load(node.visible)"
+                                      onClick="@command('onHeaderMenuClicked', node=node)"/>
+                        </template>
+                    </menupopup>
+                    <listbox vflex="true" model="@load(vm.serviceRecordsDataModel)" multiple="false"
+                             itemRenderer="@load(vm.serviceRecordsDataModel.renderer)"
+                             onSelect="@command('onListSelection')">
+                        <listhead sizable="true" menupopup="editPopup"
+                                  onColSize="@command('onHeaderSizeChanged', node=node)"
+                                  children="@bind(vm.serviceRecordsDataModel.renderer.columnSettings) @template('head-item')">
+                            <template name="head-item" var="node">
+                                <listheader label="@load(node.label)" sort="@load(node.sort)" align="@load(node.align)"
+                                            visible="@load(node.visible)" width="@load(node.width)" draggable="head"
+                                            droppable="head" sortDirection="@load(node.sortDirection)"
+                                            onDrop="@command('onHeaderReorder')"/>
+                            </template>
+                        </listhead>
+                        <template name="model">
+                            <listitem onDoubleClick="@command('onEdit')">
+                                <listcell label="@load(each.project.humanId)"/>
+                                <listcell label="@load(each.project.name)"/>
+                                <listcell label="@load(each.project.partner.name)"/>
+                                <listcell label="@load(each.associate.name)"/>
+                                <listcell
+                                        label="@load(each.workDay) @converter('hu.user.lis.ui.converter.DateToStringConverter')"/>
+                                <listcell label="@load(each.description)"/>
+                                <listcell>
+                                    <label value="@load(each.workHours)"/>
+                                </listcell>
+                                <listcell>
+                                    <a iconSclass="z-icon-check" visible="@load(each.signed)"/>
+                                    <a iconSclass="z-icon-ban" visible="@load(not each.signed)"/>
+                                </listcell>
+                            </listitem>
+                        </template>
+                    </listbox>
+                </vlayout>
             </center>
         </borderlayout>