Main page, partner list, partner editor modifications
authorelgekko <vasary@elgekko.net>
Mon, 17 Apr 2023 08:22:49 +0000 (10:22 +0200)
committerelgekko <vasary@elgekko.net>
Mon, 17 Apr 2023 08:22:49 +0000 (10:22 +0200)
54 files changed:
lis-app/pom.xml
lis-db/src/main/java/hu/user/lis/db/Partner.java
lis-services/pom.xml
lis-services/src/main/java/hu/user/lis/services/data/PartnerService.java
lis-services/src/main/java/hu/user/lis/services/data/PartnerServiceImpl.java
lis-ui/pom.xml
lis-ui/src/main/java/hu/user/lis/ui/data/CachedDataModel.java
lis-ui/src/main/java/hu/user/lis/ui/data/FormDocument.java
lis-ui/src/main/java/hu/user/lis/ui/data/PartnersDataModel.java
lis-ui/src/main/java/hu/user/lis/ui/form/Field.java [deleted file]
lis-ui/src/main/java/hu/user/lis/ui/form/FormValidator.java [deleted file]
lis-ui/src/main/java/hu/user/lis/ui/view/AsyncBaseModel.java [new file with mode: 0644]
lis-ui/src/main/java/hu/user/lis/ui/view/IndexViewModel.java
lis-ui/src/main/java/hu/user/lis/ui/view/PartnerEditorModel.java
lis-ui/src/main/java/hu/user/lis/ui/view/PartnersViewModel.java
lis-ui/src/main/java/hu/user/lis/ui/view/SuppliersViewModel.java
lis-ui/src/main/java/hu/user/lis/ui/view/UITask.java [new file with mode: 0644]
lis-ui/src/main/resources/metainfo/zk/zk.xml
lis-ui/src/main/resources/web/fields/address.zul [deleted file]
lis-ui/src/main/resources/web/fields/agreement.zul [deleted file]
lis-ui/src/main/resources/web/fields/check.zul [deleted file]
lis-ui/src/main/resources/web/fields/checkgroup.zul [deleted file]
lis-ui/src/main/resources/web/fields/company.zul [deleted file]
lis-ui/src/main/resources/web/fields/current-date.zul [deleted file]
lis-ui/src/main/resources/web/fields/date.zul [deleted file]
lis-ui/src/main/resources/web/fields/deadline.zul [deleted file]
lis-ui/src/main/resources/web/fields/domain.zul [deleted file]
lis-ui/src/main/resources/web/fields/double.zul [deleted file]
lis-ui/src/main/resources/web/fields/field-label.zul
lis-ui/src/main/resources/web/fields/freeperson.zul [deleted file]
lis-ui/src/main/resources/web/fields/inline-radio.zul
lis-ui/src/main/resources/web/fields/location.zul [deleted file]
lis-ui/src/main/resources/web/fields/nobornperson.zul [deleted file]
lis-ui/src/main/resources/web/fields/number.zul [deleted file]
lis-ui/src/main/resources/web/fields/person-name.zul [deleted file]
lis-ui/src/main/resources/web/fields/person.zul [deleted file]
lis-ui/src/main/resources/web/fields/publicplace.zul [deleted file]
lis-ui/src/main/resources/web/fields/radio.zul [deleted file]
lis-ui/src/main/resources/web/fields/radiodate.zul [deleted file]
lis-ui/src/main/resources/web/fields/radiodouble.zul [deleted file]
lis-ui/src/main/resources/web/fields/radiogroup.zul [deleted file]
lis-ui/src/main/resources/web/fields/radionumber.zul [deleted file]
lis-ui/src/main/resources/web/fields/rate.zul [deleted file]
lis-ui/src/main/resources/web/fields/settlement.zul [deleted file]
lis-ui/src/main/resources/web/fields/signature.zul [deleted file]
lis-ui/src/main/resources/web/fields/stamp.zul [deleted file]
lis-ui/src/main/resources/web/fields/textarea.zul [deleted file]
lis-ui/src/main/resources/web/fields/title-deed-content.zul [deleted file]
lis-ui/src/main/resources/web/fields/title-deed.zul [deleted file]
lis-ui/src/main/resources/web/fields/zipcode.zul [deleted file]
lis-ui/src/main/resources/web/index.zul
lis-ui/src/main/resources/web/partner.zul
lis-ui/src/main/resources/web/partners.zul
pom.xml

index d691406540f0ecfab5ae3d3caad1810528d122aa..24ffec744e926937a25d0c56293a0ae4c0ae0e63 100644 (file)
@@ -4,6 +4,7 @@
     <modelVersion>4.0.0</modelVersion>
     <groupId>hu.user</groupId>
     <artifactId>lis-app</artifactId>
+    <version>0.0.2-SNAPSHOT</version>
     <parent>
         <groupId>hu.user</groupId>
         <artifactId>lis</artifactId>
index 60317319a6ec64fe318c2bbab4d47a58b1260c55..ac903d621470783f269857751a00be9bc997e24c 100644 (file)
@@ -1,22 +1,16 @@
 package hu.user.lis.db;
 
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Getter;
-import lombok.Setter;
+import lombok.*;
 
 @Getter
 @Setter
 @Builder
 @AllArgsConstructor
+@NoArgsConstructor
 public class Partner {
     String id;
     String name;
     String vatNr;
     String address;
     boolean active;
-
-    public static class PartnerBuilder {
-        private boolean active = true;
-    }
 }
index 24159d94c9b6ce9e3d46f50e3e38475c1c8d8ed3..da1d43bb912b446a43675d51cda7855de167e85a 100644 (file)
             <groupId>org.springframework</groupId>
             <artifactId>spring-context</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+        </dependency>
     </dependencies>
 </project>
index 5363fa39b44d33087f5bac56a5519c2cf9e792ce..48c801a24dd989e4536b7b4a5a2ff92efdfc317a 100644 (file)
@@ -1,9 +1,18 @@
 package hu.user.lis.services.data;
 
+import com.fasterxml.jackson.core.JsonProcessingException;
 import hu.user.lis.db.Partner;
 
 import java.util.List;
 
 public interface PartnerService {
     List<Partner> getAll();
+
+    Partner createNew();
+
+    void add(Partner partner);
+
+    Partner copy(Partner selectedPartner) throws JsonProcessingException;
+
+    void replace(Partner selectedPartner, Partner editPartner);
 }
index 60ddcf313af02ede11c30db53c739c760c540674..dc59f2bd32f56bf33d9b01fe2f3085a9480f75e6 100644 (file)
@@ -1,8 +1,11 @@
 package hu.user.lis.services.data;
 
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.github.javafaker.Faker;
 import hu.user.lis.db.Partner;
 import org.apache.commons.lang3.RandomStringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
@@ -12,6 +15,9 @@ import java.util.List;
 public class PartnerServiceImpl implements PartnerService {
     private List<Partner> partners;
 
+    @Autowired
+    ObjectMapper mapper;
+
     @Override
     public List<Partner> getAll() {
         if (partners == null) {
@@ -20,6 +26,32 @@ public class PartnerServiceImpl implements PartnerService {
         return partners;
     }
 
+    @Override
+    public Partner createNew() {
+        String id = RandomStringUtils.random(8, "0123456789abcdef");
+        return Partner.builder().id(id).active(true).build();
+    }
+
+    @Override
+    public void add(Partner partner) {
+        partners.add(partner);
+    }
+
+    @Override
+    public Partner copy(Partner selectedPartner) throws JsonProcessingException {
+        ObjectMapper mapper = new ObjectMapper();
+        String json = mapper.writeValueAsString(selectedPartner);
+        return mapper.readValue(json, Partner.class);
+    }
+
+    @Override
+    public void replace(Partner selectedPartner, Partner editPartner) {
+        Partner partnerInList = partners.stream().filter(p -> p.getId().equals(selectedPartner.getId())).findFirst().get();
+        partners.remove(partnerInList);
+        //partners.remove(selectedPartner);
+        partners.add(editPartner);
+    }
+
     private List<Partner> generate() {
         List<Partner> result = new ArrayList<>();
         Faker faker = new Faker();
@@ -29,7 +61,7 @@ public class PartnerServiceImpl implements PartnerService {
             String vatNr = RandomStringUtils.random(12, "0123456789");
             String address = String.format("%s %s, %s street %s", faker.address().zipCode(), faker.address().city(),
                     faker.address().streetName(), faker.address().buildingNumber());
-            Partner partner = Partner.builder().id(id).name(name).vatNr(vatNr).address(address).build();
+            Partner partner = Partner.builder().active(true).id(id).name(name).vatNr(vatNr).address(address).build();
             result.add(partner);
         }
         return result;
index b461fcbcbbc76b2aa6a4399e296ce458fc0b1f41..f5c7e8d59d7d50f5ce0cdc60319bc5d50fbe207f 100644 (file)
             <artifactId>lis-services</artifactId>
             <version>0.0.1-SNAPSHOT</version>
         </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-devtools</artifactId>
-            <optional>true</optional>
-        </dependency>
     </dependencies>
 </project>
\ No newline at end of file
index 8929998bc33826738044805215c2bee92074db1b..2c15a11957bffbd22f872b4338a8107a33aec0be 100644 (file)
@@ -2,13 +2,9 @@ package hu.user.lis.ui.data;
 
 import lombok.extern.log4j.Log4j2;
 import org.springframework.stereotype.Component;
-import org.zkoss.zk.ui.event.Event;
-import org.zkoss.zk.ui.event.EventListener;
-import org.zkoss.zk.ui.event.Events;
 import org.zkoss.zul.FieldComparator;
 import org.zkoss.zul.ListModelList;
 
-import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.HashMap;
 import java.util.List;
@@ -130,5 +126,5 @@ public abstract class CachedDataModel<T> extends ListModelList<T> {
         log.info("Sort {} {}", sortComparator.getOrderBy(), ascending);
         reset();
     }
+}
 
-}
\ No newline at end of file
index 6653d3587b93fcab6e5c3839413ba6bcd4462af9..ce8613cdf5311a8d6a8eecfef045e79e746d280a 100644 (file)
@@ -9,10 +9,10 @@ import org.zkoss.lang.Strings;
 
 @Builder
 @Log4j2
-public class FormDocument<T> extends JSONObject {
-    private T data;
+public class FormDocument extends JSONObject {
+    private Object data;
 
-    public FormDocument setData(T data) {
+    public FormDocument setData(Object data) {
         try {
             ObjectMapper mapper = new ObjectMapper();
             String json = mapper.writeValueAsString(data);
index 6de36e1016f5c7a2d429c7f6f0ade8de7da89345..6dc7031259c06ca792f1219f99d27f2f8cf57a8c 100644 (file)
@@ -2,6 +2,7 @@ package hu.user.lis.ui.data;
 
 import hu.user.lis.db.Partner;
 import hu.user.lis.services.data.PartnerService;
+import lombok.Getter;
 import lombok.extern.log4j.Log4j2;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,12 +24,16 @@ public class PartnersDataModel extends CachedDataModel<Partner> {
     private String partialAddress;
     private String partialVatNr;
     private boolean listAll;
+
+    @Getter
     @Autowired
     PartnerService partnerService;
+    private boolean filterShowInActive;
+    private boolean filterShowActive;
 
 
     private boolean canExecuteSearch() {
-        boolean result = listAll ||
+        boolean result = listAll || filterShowActive || filterShowInActive ||
                 StringUtils.isNotBlank(partialName) ||
                 StringUtils.isNotBlank(partialVatNr) ||
                 StringUtils.isNotBlank(partialAddress);
@@ -57,6 +62,15 @@ public class PartnersDataModel extends CachedDataModel<Partner> {
                 result = false;
             }
         }
+
+        if (!filterShowActive && partner.isActive()) {
+            result = false;
+        }
+
+        if (!filterShowInActive && !partner.isActive()) {
+            result = false;
+        }
+
         return result;
     }
 
@@ -65,8 +79,8 @@ public class PartnersDataModel extends CachedDataModel<Partner> {
         List<Partner> result = null;
         if (canExecuteSearch()) {
             result = partnerService.getAll().stream()
-                    .sorted(Comparator.comparing(Partner::getName))
                     .filter(s -> filter(s))
+                    .sorted(Comparator.comparing(Partner::getName, String.CASE_INSENSITIVE_ORDER))
                     .collect(Collectors.toList());
         }
         return result;
@@ -94,6 +108,17 @@ public class PartnersDataModel extends CachedDataModel<Partner> {
         BindUtils.postNotifyChange(null, null, this, "*");
     }
 
+
+    public void search(boolean filterShowActive, boolean filterShowInActive) {
+        log.info("Searching partner using filters: filterShowActive {}, filterShowInActive {}",
+                filterShowActive, filterShowInActive);
+        this.filterShowActive = filterShowActive;
+        this.filterShowInActive = filterShowInActive;
+        listAll = false;
+        super.reset();
+        BindUtils.postNotifyChange(null, null, this, "*");
+    }
+
     public void listAll() {
         log.info("List all partners");
         listAll = true;
diff --git a/lis-ui/src/main/java/hu/user/lis/ui/form/Field.java b/lis-ui/src/main/java/hu/user/lis/ui/form/Field.java
deleted file mode 100644 (file)
index c5c2a1d..0000000
+++ /dev/null
@@ -1,240 +0,0 @@
-package hu.user.lis.ui.form;
-
-import org.zkoss.zk.ui.Component;
-import org.zkoss.zul.Include;
-
-public class Field extends Include {
-    public static final String FIELD_POSTFIX_ERROR = "_error";
-    public static final String FIELD_POSTFIX_DATA = "_data";
-    public static final String FIELD_POSTFIX_UNIT = "_unit";
-
-    public static class Address extends Field {
-        public Address() {
-            super();
-            setSrc("~./fields/address.zul");
-        }
-    }
-
-    public static class Agreement extends Field {
-        public Agreement() {
-            super();
-            setSrc("~./fields/agreement.zul");
-        }
-    }
-
-    public static class Check extends Field {
-        public Check() {
-            super();
-            setSrc("~./fields/check.zul");
-        }
-    }
-
-    public static class CheckGroup extends Field {
-        public CheckGroup() {
-            super();
-            setSrc("~./fields/checkgroup.zul");
-        }
-    }
-
-    public static class Company extends Field {
-        public Company() {
-            super();
-            setSrc("~./fields/company.zul");
-        }
-    }
-
-    public static class CurrentDate extends Field {
-        public CurrentDate() {
-            super();
-            setSrc("~./fields/current-date.zul");
-        }
-    }
-
-    public static class Date extends Field {
-        public Date() {
-            super();
-            setSrc("~./fields/date.zul");
-        }
-    }
-
-    public static class Deadline extends Field {
-        public Deadline() {
-            super();
-            setSrc("~./fields/deadline.zul");
-        }
-    }
-
-    public static class Domain extends Field {
-        public Domain() {
-            super();
-            setSrc("~./fields/domain.zul");
-        }
-    }
-
-    public static class Double extends Field {
-        public Double() {
-            super();
-            setSrc("~./fields/double.zul");
-        }
-    }
-
-    public static class FreePerson extends Field {
-        public FreePerson() {
-            super();
-            setSrc("~./fields/freeperson.zul");
-        }
-    }
-
-    public static class InlineRadio extends Field {
-        public InlineRadio() {
-            super();
-            setSrc("~./fields/inline-radio.zul");
-        }
-    }
-
-    public static class Location extends Field {
-        public Location() {
-            super();
-            setSrc("~./fields/location.zul");
-        }
-    }
-
-    public static class NoBornPerson extends Field {
-        public NoBornPerson() {
-            super();
-            setSrc("~./fields/nobornperson.zul");
-        }
-    }
-
-    public static class Number extends Field {
-        public Number() {
-            super();
-            setSrc("~./fields/number.zul");
-        }
-    }
-
-    public static class Person extends Field {
-        public Person() {
-            super();
-            setSrc("~./fields/person.zul");
-        }
-    }
-
-    public static class PersonName extends Field {
-        public PersonName() {
-            super();
-            setSrc("~./fields/person-name.zul");
-        }
-    }
-
-    public static class Radio extends Field {
-        public Radio() {
-            super();
-            setSrc("~./fields/radio.zul");
-        }
-    }
-
-    public static class RadioDate extends Field {
-        public RadioDate() {
-            super();
-            setSrc("~./fields/radiodate.zul");
-        }
-    }
-
-    public static class RadioDouble extends Field {
-        public RadioDouble() {
-            super();
-            setSrc("~./fields/radiodouble.zul");
-        }
-    }
-
-    public static class RadioGroup extends Field {
-        public RadioGroup() {
-            super();
-            setSrc("~./fields/radiogroup.zul");
-        }
-    }
-
-    public static class RadioNumber extends Field {
-        public RadioNumber() {
-            super();
-            setSrc("~./fields/radionumber.zul");
-        }
-    }
-
-    public static class Rate extends Field {
-        public Rate() {
-            super();
-            setSrc("~./fields/rate.zul");
-        }
-    }
-
-    public static class Settlement extends Field {
-        public Settlement() {
-            super();
-            setSrc("~./fields/settlement.zul");
-        }
-    }
-
-    public static class Signature extends Field {
-        public Signature() {
-            super();
-            setSrc("~./fields/signature.zul");
-        }
-    }
-
-    public static class Stamp extends Field {
-        public Stamp() {
-            super();
-            setSrc("~./fields/stamp.zul");
-        }
-    }
-
-    public static class Text extends Field {
-        public Text() {
-            super();
-            setSrc("~./fields/text.zul");
-        }
-    }
-
-    public static class TextArea extends Field {
-        public TextArea() {
-            super();
-            setSrc("~./fields/textarea.zul");
-        }
-    }
-
-    public static class TitleDeed extends Field {
-        public TitleDeed() {
-            super();
-            setSrc("~./fields/title-deed.zul");
-        }
-    }
-
-    public static class ZipCode extends Field {
-        public ZipCode() {
-            super();
-            setSrc("~./fields/zipcode.zul");
-        }
-    }
-
-    private void set(String name, Object value) {
-        setAttribute(name, value, Component.SPACE_SCOPE);
-    }
-
-    @Override
-    public void setDynamicProperty(String name, Object value) {
-        super.setDynamicProperty(name, value);
-        // a dinamikus parametereket letoljuk az egesz szkopon + letrehozunk technikai
-        // parametereket
-        // ezek az include altal behuzott Composit-okban cimezhetoek pl. ${field}
-        set(name, value);
-        if ("field".equals(name)) {
-            String field = (String) value;
-            set("errorField", field + FIELD_POSTFIX_ERROR);
-            set("dataField", field + FIELD_POSTFIX_DATA);
-            set("unitField", field + FIELD_POSTFIX_UNIT);
-        }
-    }
-
-}
diff --git a/lis-ui/src/main/java/hu/user/lis/ui/form/FormValidator.java b/lis-ui/src/main/java/hu/user/lis/ui/form/FormValidator.java
deleted file mode 100644 (file)
index de13c84..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-package hu.user.lis.ui.form;
-
-import lombok.extern.log4j.Log4j2;
-import org.springframework.stereotype.Service;
-import org.zkoss.bind.ValidationContext;
-import org.zkoss.bind.validator.AbstractValidator;
-
-@Service
-@Log4j2
-public class FormValidator extends AbstractValidator {
-    @Override
-    public void validate(ValidationContext ctx) {
-    }
-}
diff --git a/lis-ui/src/main/java/hu/user/lis/ui/view/AsyncBaseModel.java b/lis-ui/src/main/java/hu/user/lis/ui/view/AsyncBaseModel.java
new file mode 100644 (file)
index 0000000..051ea26
--- /dev/null
@@ -0,0 +1,43 @@
+package hu.user.lis.ui.view;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.zkoss.bind.BindUtils;
+import org.zkoss.bind.annotation.Command;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+public class AsyncBaseModel {
+    private static final Logger logger = LogManager.getLogger();
+    private List<UITask> uiTasks = new ArrayList<>();
+
+    protected void doKeepAlive() {
+
+    }
+
+    protected void notifyChange(String... names) {
+        List<String> nameList = Arrays.asList(names);
+        nameList.forEach(name -> BindUtils.postNotifyChange(null, null, this, name));
+    }
+
+    protected void registerTask(UITask task) {
+        synchronized (uiTasks) {
+            uiTasks.add(task);
+        }
+    }
+
+    @Command
+    public void uiTick() {
+        // logger.info("{} tick {}", this.getClass().getSimpleName(), System.currentTimeMillis());
+        doKeepAlive();
+        synchronized (uiTasks) {
+            for (UITask task : uiTasks) {
+                task.execute();
+            }
+            uiTasks.clear();
+        }
+    }
+
+}
index e252c7d9a0a9de6d3f5fb8aab0754e4c4b29d1de..16f8ea22b82a086b8bbf958905ed4026ad41262a 100644 (file)
@@ -4,7 +4,6 @@ import lombok.Getter;
 import lombok.Setter;
 import lombok.extern.log4j.Log4j2;
 import org.springframework.boot.info.BuildProperties;
-import org.zkoss.bind.annotation.Command;
 import org.zkoss.bind.annotation.Init;
 import org.zkoss.zk.ui.select.annotation.VariableResolver;
 import org.zkoss.zk.ui.select.annotation.WireVariable;
@@ -25,8 +24,4 @@ public class IndexViewModel {
         log.info("Init");
     }
 
-    @Command
-    public void search() {
-
-    }
 }
index 20cb7db1622ecc382e6f15e74b58470e59c6a125..a884519e8529a32135d8f78cc9306d4bbc5302c0 100644 (file)
@@ -1,15 +1,13 @@
 package hu.user.lis.ui.view;
 
 import hu.user.lis.db.Partner;
-import hu.user.lis.ui.data.FormDocument;
-import hu.user.lis.ui.form.FormValidator;
 import lombok.Getter;
 import lombok.Setter;
 import lombok.extern.log4j.Log4j2;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.zkoss.bind.annotation.BindingParam;
 import org.zkoss.bind.annotation.Command;
 import org.zkoss.bind.annotation.Init;
+import org.zkoss.zk.ui.Executions;
 import org.zkoss.zk.ui.event.Event;
 import org.zkoss.zk.ui.event.Events;
 import org.zkoss.zk.ui.select.annotation.VariableResolver;
@@ -21,26 +19,13 @@ import org.zkoss.zul.Window;
 @Setter
 @VariableResolver(DelegatingVariableResolver.class)
 public class PartnerEditorModel {
-    private FormDocument formDocument;
     private boolean canEdit;
     private Partner selectedPartner;
-    @Autowired
-    FormValidator formValidator;
 
     @Init
     public void init() {
         log.info("Initialized");
-        //TODO atnevezni, mert forditva mukodik
-        setCanEdit(true);
-    }
-
-    public String getFieldStyle(String field, String baseStyle) {
-//             Object error = getFormDocument().get(field + FIELD_POSTFIX_ERROR);
-//             if (error != null && (boolean) error)
-//                     return baseStyle + " " + ERROR;
-//             else
-//                     return baseStyle;
-        return baseStyle;
+        selectedPartner = (Partner) Executions.getCurrent().getArg().get("formDocument");
     }
 
     @Command
@@ -48,4 +33,5 @@ public class PartnerEditorModel {
         Event closeEvent = new Event("onClose", target, select ? selectedPartner : null);
         Events.postEvent(closeEvent);
     }
+
 }
index a88aad7d79938d8912bc716600220ae33ec4b736..966a3062508dc656a1c75304b084d8724d8ffcbe 100644 (file)
 package hu.user.lis.ui.view;
 
+import com.fasterxml.jackson.core.JsonProcessingException;
 import hu.user.lis.db.Partner;
-import hu.user.lis.ui.data.FormDocument;
 import hu.user.lis.ui.data.PartnersDataModel;
-import hu.user.lis.ui.form.FormValidator;
 import lombok.Getter;
-import lombok.Setter;
 import lombok.extern.log4j.Log4j2;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.zkoss.bind.annotation.Command;
-import org.zkoss.bind.annotation.Init;
-import org.zkoss.bind.annotation.NotifyChange;
+import org.zkoss.bind.annotation.*;
+import org.zkoss.zk.ui.Component;
+import org.zkoss.zk.ui.Executions;
+import org.zkoss.zk.ui.select.Selectors;
 import org.zkoss.zk.ui.select.annotation.VariableResolver;
+import org.zkoss.zk.ui.select.annotation.Wire;
 import org.zkoss.zk.ui.select.annotation.WireVariable;
 import org.zkoss.zkplus.spring.DelegatingVariableResolver;
+import org.zkoss.zul.Listbox;
+import org.zkoss.zul.Window;
 
+import java.util.Collections;
 import java.util.Set;
 
 @Log4j2
-@Getter
-@Setter
 @VariableResolver(DelegatingVariableResolver.class)
-public class PartnersViewModel {
-    private FormDocument formDocument;
-    private boolean canEdit;
-    private String partialName;
-    private String partialVatNr;
-    private String partialAddress;
+public class PartnersViewModel extends AsyncBaseModel {
+    @Getter
     private Partner selectedPartner;
     @WireVariable
+    @Getter
     PartnersDataModel partnersDataModel;
-    @Autowired
-    FormValidator formValidator;
+    private boolean filterShowInActive;
+    private boolean filterShowActive;
+    private boolean filterShowBoth;
+
+    @Wire
+    Listbox partnersList;
+
+    @AfterCompose
+    public void onAfterCompose(@ContextParam(ContextType.VIEW) Component view) {
+        Selectors.wireComponents(view, this, false);
+        Selectors.wireEventListeners(view, this);
+    }
 
     @Init
     public void init() {
         log.info("Initialized");
-        //TODO atnevezni, mert forditva mukodik
-        setCanEdit(true);
-        partnersDataModel.listAll();
+        setFilterShowActive(true);
     }
 
-    public String getFieldStyle(String field, String baseStyle) {
-//             Object error = getFormDocument().get(field + FIELD_POSTFIX_ERROR);
-//             if (error != null && (boolean) error)
-//                     return baseStyle + " " + ERROR;
-//             else
-//                     return baseStyle;
-        return baseStyle;
+    private void refresh() {
+        if (filterShowBoth) {
+            partnersDataModel.search(true, true);
+        } else {
+            partnersDataModel.search(filterShowActive, filterShowInActive);
+        }
     }
 
     @Command
-    @NotifyChange("formDocument")
+    @NotifyChange("selectedPartner")
     public void search() {
         partnersDataModel.clearSelection();
-        formDocument = null;
-        partnersDataModel.search(partialName, partialVatNr, partialAddress);
+        selectedPartner = null;
+        //partnersDataModel.search(partialName, partialVatNr, partialAddress);
     }
 
     @Command
-    @NotifyChange("formDocument")
+    @NotifyChange("selectedPartner")
     public void onListSelection() {
-        formDocument = null;
         selectedPartner = null;
         Set<Partner> selections = partnersDataModel.getSelection();
         if (selections.iterator().hasNext()) {
             selectedPartner = selections.iterator().next();
-            formDocument = FormDocument.builder().build()
-                    .setData(selectedPartner);
-            log.info("Selected {}", formDocument);
+            log.info("Selected {}", selectedPartner);
         }
     }
 
+    @Command
+    public void onAfterRenderPartners() {
+    }
+
     @Command
     public void onAddNew() {
+        String page = "~./partner.zul";
+        Partner editPartner = partnersDataModel.getPartnerService().createNew();
+        Window partnerWindow = (Window) Executions.createComponents(page, null,
+                Collections.singletonMap("formDocument", editPartner));
+        partnerWindow.addEventListener("onClose", e -> {
+            if (e.getData() != null) {
+                log.info("Partner popup result {}", e.getData());
+                partnersDataModel.getPartnerService().add(editPartner);
+                partnersDataModel.clearSelection();
+                refresh();
+                partnersDataModel.addToSelection(editPartner);
+//                Optional<Listitem> listItem = partnersList.getItems().stream()
+//                        .filter(li -> ((Partner) li.getValue()).getId().equals(editPartner.getId()))
+//                        .findFirst();
+//                if (listItem.isPresent()) {
+//                    Clients.scrollIntoView(listItem.get());
+//                }
+//                registerTask(() -> {
+//                });
+            }
+        });
+        partnerWindow.doModal();
     }
 
     @Command
-    public void onEdit() {
+    public void onEdit() throws JsonProcessingException {
+        String page = "~./partner.zul";
+        Partner editPartner = partnersDataModel.getPartnerService().copy(selectedPartner);
+        Window partnerWindow = (Window) Executions.createComponents(page, null,
+                Collections.singletonMap("formDocument", editPartner));
+        partnerWindow.addEventListener("onClose", e -> {
+            if (e.getData() != null) {
+                log.info("Partner popup result {}", e.getData());
+                selectedPartner = (Partner) e.getData();
+                partnersDataModel.getPartnerService().replace(selectedPartner, editPartner);
+                partnersDataModel.clearSelection();
+                refresh();
+                partnersDataModel.addToSelection(editPartner);
+            }
+        });
+        partnerWindow.doModal();
+    }
+
+
+    public boolean isFilterShowInActive() {
+        return filterShowInActive;
+    }
+
+    @NotifyChange({"filterShowActive", "filterShowInActive", "filterShowBoth"})
+    public void setFilterShowInActive(boolean filterShowInActive) {
+        this.filterShowBoth = false;
+        this.filterShowActive = false;
+        this.filterShowInActive = filterShowInActive;
+        refresh();
+    }
+
+    public boolean isFilterShowActive() {
+        return filterShowActive;
+    }
+
+    @NotifyChange({"filterShowActive", "filterShowInActive", "filterShowBoth"})
+    public void setFilterShowActive(boolean filterShowActive) {
+        this.filterShowBoth = false;
+        this.filterShowInActive = false;
+        this.filterShowActive = filterShowActive;
+        refresh();
+    }
+
+    public boolean isFilterShowBoth() {
+        return this.filterShowBoth;
+    }
+
+    @NotifyChange({"filterShowActive", "filterShowInActive", "filterShowBoth"})
+    public void setFilterShowBoth(boolean filterShowBoth) {
+        this.filterShowActive = false;
+        this.filterShowInActive = false;
+        this.filterShowBoth = filterShowBoth;
+        refresh();
     }
 }
index fcd3d99cc0eff4d21fb47bdeda2b6c12fc7ba5a7..bfed18955fb7762f320083678766cff0cc6f40af 100644 (file)
@@ -3,11 +3,9 @@ package hu.user.lis.ui.view;
 import hu.user.lis.db.Supplier;
 import hu.user.lis.ui.data.FormDocument;
 import hu.user.lis.ui.data.SuppliersDataModel;
-import hu.user.lis.ui.form.FormValidator;
 import lombok.Getter;
 import lombok.Setter;
 import lombok.extern.log4j.Log4j2;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.zkoss.bind.annotation.BindingParam;
 import org.zkoss.bind.annotation.Command;
 import org.zkoss.bind.annotation.Init;
@@ -34,8 +32,6 @@ public class SuppliersViewModel {
     private Supplier selectedSupplier;
     @WireVariable
     SuppliersDataModel suppliersDataModel;
-    @Autowired
-    FormValidator formValidator;
 
     @Init
     public void init() {
diff --git a/lis-ui/src/main/java/hu/user/lis/ui/view/UITask.java b/lis-ui/src/main/java/hu/user/lis/ui/view/UITask.java
new file mode 100644 (file)
index 0000000..6f2f784
--- /dev/null
@@ -0,0 +1,5 @@
+package hu.user.lis.ui.view;
+
+public interface UITask {
+    void execute();
+}
\ No newline at end of file
index 0396154817de4fd1b195ffb71119669d7c0d69eb..e332e56e15edc9f0b192f1ddb1c7fbe2cb7da617 100644 (file)
@@ -10,7 +10,7 @@
     </library-property>
     <library-property>
         <name>org.zkoss.zul.grid.rod</name>
-        <value>true</value>
+        <value>false</value>
     </library-property>
     <library-property>
         <name>org.zkoss.zul.grid.autohidePaging</name>
@@ -18,7 +18,7 @@
     </library-property>
     <library-property>
         <name>org.zkoss.zul.listbox.rod</name>
-        <value>true</value>
+        <value>false</value>
     </library-property>
     <library-property>
         <name>org.zkoss.zul.listbox.autohidePaging</name>
diff --git a/lis-ui/src/main/resources/web/fields/address.zul b/lis-ui/src/main/resources/web/fields/address.zul
deleted file mode 100644 (file)
index 8ab15c0..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<?component name="text" class="hu.bitcity.form.field.Field$Text" ?>
-<?component name="number" class="hu.bitcity.form.field.Field$Number" ?>
-<?component name="domain" class="hu.bitcity.form.field.Field$Domain" ?>
-<?component name="zipcode" class="hu.bitcity.form.field.Field$ZipCode" ?>
-<?component name="location" class="hu.bitcity.form.field.Field$Location" ?>
-<div class="row">
-       <div class="row">
-               <zipcode class="one column" label="Irányítószám" origField="${field}" field="${field}_iranyitoszam" validators="${validators}" />
-               <text class="four columns" label="Helység" field="${field}_helyseg" validators="${validators}" />
-               <location class="four columns" label="Közterület neve" origField="${field}" field="${field}_kozterulet_nev" validators="${validators}"/>
-               <domain class="two columns" label="Közterület" origField="${field}" field="${field}_kozterulet" 
-                       values="${['-', 'árok','átjáró','dűlő','dűlőút','erdősor','fasor','forduló','gát','határsor','határút','kapu','körönd','körtér','körút','köz','lakótelep','lejáró','lejtő','lépcső','liget','mélyút','orom','ösvény','park','part','pincesor','rakpart','sétány','sikátor','sor','sugárút','tér','udvar','út','utca','üdülőpart']}" 
-                       validators="${validators}"/>
-               <text class="one column" label="Házszám" field="${field}_hazszam" validators="${validators}"/>
-       </div>
-       <div class="row">
-               <text class="three columns" label="Lépcsőház" field="${field}_lepcsohaz" />
-               <text class="three columns" label="Emelet" field="${field}_emelet" />
-               <text class="three columns" label="Ajtó" field="${field}_ajto" />
-               <text class="three columns" label="Egyéb" field="${field}_egyeb" />
-       </div>
-</div>
\ No newline at end of file
diff --git a/lis-ui/src/main/resources/web/fields/agreement.zul b/lis-ui/src/main/resources/web/fields/agreement.zul
deleted file mode 100644 (file)
index 0b9626a..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<div class="agreement field">
-       <div class="row field-top">
-               <label xmlns:ca="client/attribute" ca:data-markdown="true">
-${text}
-               </label>
-       </div>
-</div>
\ No newline at end of file
diff --git a/lis-ui/src/main/resources/web/fields/check.zul b/lis-ui/src/main/resources/web/fields/check.zul
deleted file mode 100644 (file)
index f77eb53..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<div class="field" xmlns:w="client" w:onClick="console.log('field : ${field}')">
-       <div class="@load(vm.getFieldStyle(field, 'field-label'))">
-               <checkbox label="${label}" onCheck="@command('submit') @global-command('autosave', source=self)"
-                       checked="@load(vm.formDocument[field]) @save(vm.formDocument[field], before='submit') @validator(vm.formValidator)" 
-                       disabled="@load(vm.formDocument['ro'] || ro)" />
-       </div>
-
-</div> 
diff --git a/lis-ui/src/main/resources/web/fields/checkgroup.zul b/lis-ui/src/main/resources/web/fields/checkgroup.zul
deleted file mode 100644 (file)
index 5c46be2..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<div class="field">
-       <div class="row field-top">
-               <include src="/fields/field-label.zul"/>
-       </div>  
-       <div class="row field-textbox field-top">
-               <zk forEach="${values}">
-                       <checkbox label="${each}"
-                               checked="@load(vm.formDocument[field]) @save(vm.formDocument[field], before='submit') @validator(vm.formValidator)" 
-                               disabled="@load(vm.formDocument['ro'] || ro)" onCheck="@command('submit') @global-command('autosave', source=self)" >
-                               <custom-attributes field="${field}_${forEachStatus.index + 1}" />
-                       </checkbox>
-               </zk>
-       </div>  
-</div>
diff --git a/lis-ui/src/main/resources/web/fields/company.zul b/lis-ui/src/main/resources/web/fields/company.zul
deleted file mode 100644 (file)
index fb3d7d6..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-<?component name="address" class="hu.bitcity.form.field.Field$Address" ?>
-<?component name="date" class="hu.bitcity.form.field.Field$Date" ?>
-<?component name="text" class="hu.bitcity.form.field.Field$Text" ?>
-<?component name="personname" class="hu.bitcity.form.field.Field$PersonName" ?>
-<div class="row">
-       <div class="row">
-               <personname class="eight columns" label="Cégnév" origField="${field}" field="${field}_nev" validators="nonempty"/>
-               <text class="four columns" label="Adószám" field="${field}_adoszam" validators="nonempty" />
-       </div>
-       <address class="row" label="Székhely" field="${field}_cim" validators="nonempty,address" />
-       <div class="row">
-               <text class="four columns" label="Cégjegyzékszám" field="${field}_cegjegyzekszam" validators="nonempty"/>
-               <text class="eight columns" label="Képviseli" field="${field}_kepviseli" validators="nonempty" />
-       </div>
-       <div class="row no-print" if="${empty param.token or nocontacts}">
-               <text class="six columns" label="Telefonszám" field="${field}_telefon" validators="phone" />
-               <text class="six columns" label="E-mail" field="${field}_email" validators="email" />
-       </div>
-</div>
\ No newline at end of file
diff --git a/lis-ui/src/main/resources/web/fields/current-date.zul b/lis-ui/src/main/resources/web/fields/current-date.zul
deleted file mode 100644 (file)
index d0bca4d..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<div class="row" style="margin-top: 10px; margin-bottom: 10px;">
-<label value="${isEmpty}"/>
-       <variables defaultValue="Budapest" isEmpty="${isEmpty}" />
-       <label class="form-label" >Kelt: </label>
-       <combobox class="@load(vm.getFieldStyle(field, 'inline-intbox'))" 
-               model="@load(vm.settlementsModel)"
-               value="@load(vm.formDocument[field]) @save(vm.formDocument[field], before='submit') @validator(vm.formValidator, parameters=validatorargs)" 
-               onBlur="@command('submit') @global-command('autosave', source=self)"
-               disabled="@load(vm.formDocument['ro'] || ro)"
-               autodrop="true" buttonVisible="true" onCreate="if (self.getValue() == null || self.getValue().length() == 0) self.setValue(defaultValue)" >
-               <!--  
-               -->
-       </combobox>
-       <label>,</label>
-       <textbox class="inline-textbox" readonly="true" value="@load(vm.formDocument[dataField]) @save(vm.formDocument[dataField], before='submit') @converter('hu.bitcity.converter.CurrentDateConverter', field=dataField, isEmpty=isEmpty)"/>
-</div> 
diff --git a/lis-ui/src/main/resources/web/fields/date.zul b/lis-ui/src/main/resources/web/fields/date.zul
deleted file mode 100644 (file)
index 04b2998..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<div class="field">
-       <div class="row field-top">
-               <include src="/fields/field-label.zul" />
-       </div>  
-       <div class="row field-top">
-               <datebox class="field-textbox" value="@load(vm.formDocument[field]) @save(vm.formDocument[field], before='submit') @validator(vm.formValidator, parameters=validatorargs) @converter('hu.bitcity.converter.JSONDateConverter')" 
-                       format="yyyy.MM.dd" disabled="@load(vm.formDocument['ro'] || ro)" onChange="@command('submit') @global-command('autosave', source=self)" />
-       </div>  
-</div>
diff --git a/lis-ui/src/main/resources/web/fields/deadline.zul b/lis-ui/src/main/resources/web/fields/deadline.zul
deleted file mode 100644 (file)
index 22216dc..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<?component name="text" class="hu.bitcity.form.field.Field$Text" ?>
-<?component name="number" class="hu.bitcity.form.field.Field$Number" ?>
-<?component name="domain" class="hu.bitcity.form.field.Field$Domain" ?>
-<?component name="int" class="hu.bitcity.form.field.Field$ZipCode" ?>
-<div class="row">
-       <int class="four columns" label="Év" field="${field}_ev" validators="nonempty"/>
-       <domain class="four columns" label="Hónap" field="${field}_honap" readonly="true" 
-               values="${['január','február','március','április','május','június','július','augusztus','szeptember','október','november','december']}" 
-               validators="nonempty" />
-       <int class="four columns" label="Nap" field="${field}_nap" validators="nonempty"/>
-</div>
\ No newline at end of file
diff --git a/lis-ui/src/main/resources/web/fields/domain.zul b/lis-ui/src/main/resources/web/fields/domain.zul
deleted file mode 100644 (file)
index 3025172..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<div class="field">
-       <div class="row field-top">
-               <include src="~./fields/field-label.zul"/>
-       </div>  
-       <div class="row field-top">
-                 <!-- 
-                       @converter('hu.bitcity.converter.ComboBoxConverter')
-                 -->
-               <combobox class="field-textbox" autodrop="false" value="@load(vm.formDocument[field]) @save(vm.formDocument[field], before='submit') @validator(vm.formValidator)" 
-                       disabled="@load(vm.canEdit || ro)" onBlur="@command('submit') @global-command('autosave', source=self)" readonly="${readonly}">
-                   <comboitem label="${each}" value="${each}" forEach="${values}" />
-               </combobox>             
-       </div>  
-</div>
\ No newline at end of file
diff --git a/lis-ui/src/main/resources/web/fields/double.zul b/lis-ui/src/main/resources/web/fields/double.zul
deleted file mode 100644 (file)
index 8bd04d5..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<div class="field">
-       <div class="row field-top">
-               <include src="/fields/field-label.zul"/>
-       </div>  
-       <div class="row field-top">
-               <doublebox class="field-textbox" value="@load(vm.formDocument[field]) @save(vm.formDocument[field], before='submit') @validator(vm.formValidator, parameters=validatorargs)" format="#,##0.##" 
-                       disabled="@load(vm.formDocument['ro'] || ro)"  onChange="@command('submit') @global-command('autosave', source=self)" />
-       </div>  
-</div>
\ No newline at end of file
index d05d4187f1f31a50670b35ec94f694c9e0ac8a13..299f1ada502924d5945c5951a13698ce1b8bb995 100644 (file)
@@ -1,3 +1,3 @@
-<div xmlns:w="client" w:onClick="console.log('field : ${field}')">
-       <label class="@load(vm.getFieldStyle(field, 'field-label'))" value="${label}" visible="@load(!empty label)"/>
+<div>
+    <label class="@load(vm.getFieldStyle(field, 'field-label'))" value="${label}" visible="@load(!empty label)"/>
 </div>
diff --git a/lis-ui/src/main/resources/web/fields/freeperson.zul b/lis-ui/src/main/resources/web/fields/freeperson.zul
deleted file mode 100644 (file)
index 744c038..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<?component name="address" class="hu.bitcity.form.field.Field$Address" ?>
-<?component name="date" class="hu.bitcity.form.field.Field$Date" ?>
-<?component name="text" class="hu.bitcity.form.field.Field$Text" ?>
-<?component name="personname" class="hu.bitcity.form.field.Field$PersonName" ?>
-<div class="row">
-       <div class="row">
-               <personname class="four columns" label="Név" origField="${field}" field="${field}_nev"/>
-               <text class="four columns" label="Állampolgárság" field="${field}_allampolgarsag" />
-               <text class="four columns" label="Szem. ig./Útlevél szám" field="${field}_azonosito_irat" />
-       </div>
-       <address class="row" label="Lakcím" field="${field}_cim" />
-       <div class="row">
-               <text class="six columns" label="Születési hely" field="${field}_szuletesi_hely" />
-               <date class="two columns" label="Születés dátuma" field="${field}_szuletes_datuma" />
-               <text class="four columns" label="Anyja neve" field="${field}_anyja_neve" />
-       </div>
-       <div class="row no-print" if="${empty param.token or nocontacts}">
-               <text class="six columns" label="Telefonszám" field="${field}_telefon" />
-               <text class="six columns" label="E-mail" field="${field}_email" />
-       </div>
-</div>
\ No newline at end of file
index 178e5857d62f3f79e8cffeb1e7ee397daec9f35c..9cf16bd07ec44e510bd090fdbc288d926cb3ddba 100644 (file)
@@ -1,4 +1,4 @@
-<radio class="@load(vm.getFieldStyle(field, 'inline-radio'))" label="${label}" value="${value}" 
-       onCheck="@command('onRadioCheck', target=self) @global-command('autosave', source=self)" 
-       checked="@load(vm.formDocument[field]) @save(vm.formDocument[field], before='submit') @validator(vm.formValidator) @converter('hu.bitcity.converter.RadioCheckConverter')" 
-       disabled="@load(vm.formDocument['ro'] || ro)" />
+<radio class="@load(vm.getFieldStyle(field, 'inline-radio'))" label="${label}" value="${value}"
+          onCheck="@command('onRadioCheck', target=self) @global-command('autosave', source=self)"
+          checked="@load(vm.formDocument[field]) @save(vm.formDocument[field], before='submit') @validator(vm.formValidator) @converter('hu.user.lis.ui.converter.RadioCheckConverter')"
+          disabled="@load(vm.formDocument['ro'] || ro)"/>
diff --git a/lis-ui/src/main/resources/web/fields/location.zul b/lis-ui/src/main/resources/web/fields/location.zul
deleted file mode 100644 (file)
index 4bbf9da..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<div class="field">
-       <div class="row field-top">
-               <include src="/fields/field-label.zul" />
-       </div>
-       <div class="row field-top">
-               <combobox class="field-textbox" autodrop="false"
-                       value="@load(vm.formDocument[field]) @save(vm.formDocument[field], before='submit') @validator(vm.formValidator) @converter('hu.bitcity.converter.LocationConverter')"
-                       disabled="@load(vm.formDocument['ro'] || ro)" onBlur="@command('decorateSettlementLocationType', source=self) @global-command('autosave', source=self)" >
-                       <!-- 
-                        -->
-                       <template name="model">
-                               <comboitem label="${each.locationDisplay}" value="${each}" />
-                       </template>
-               </combobox>
-       </div>
-</div>
\ No newline at end of file
diff --git a/lis-ui/src/main/resources/web/fields/nobornperson.zul b/lis-ui/src/main/resources/web/fields/nobornperson.zul
deleted file mode 100644 (file)
index 8c3fd76..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<?component name="address" class="hu.bitcity.form.field.Field$Address" ?>
-<?component name="date" class="hu.bitcity.form.field.Field$Date" ?>
-<?component name="text" class="hu.bitcity.form.field.Field$Text" ?>
-<?component name="personname" class="hu.bitcity.form.field.Field$PersonName" ?>
-<div class="row">
-       <div class="row">
-               <personname class="four columns" label="Név" origField="${field}" field="${field}_nev" validators="nonempty"/>
-               <text class="four columns" label="Állampolgárság" field="${field}_allampolgarsag" />
-               <text class="four columns" label="Szem. ig./Útlevél szám" field="${field}_azonosito_irat" />
-       </div>
-       <address class="row" label="Lakcím" field="${field}_cim" validators="nonempty,address" />
-       <div class="row">
-               <text class="six columns" label="Születési hely" field="${field}_szuletesi_hely" />
-               <date class="two columns" label="Születés dátuma" field="${field}_szuletes_datuma" />
-               <text class="four columns" label="Anyja neve" field="${field}_anyja_neve" validators="nonempty"/>
-       </div>
-       <div class="row no-print" if="${empty param.token or nocontacts}">
-               <text class="six columns" label="Telefonszám" field="${field}_telefon" validators="phone" />
-               <text class="six columns" label="E-mail" field="${field}_email" validators="email" />
-       </div>
-</div>
\ No newline at end of file
diff --git a/lis-ui/src/main/resources/web/fields/number.zul b/lis-ui/src/main/resources/web/fields/number.zul
deleted file mode 100644 (file)
index a8f1f21..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<div class="field">
-       <div class="row field-top">
-               <include src="/fields/field-label.zul"/>
-       </div>  
-       <div class="row field-top">
-               <longbox class="field-textbox" format=",###" disabled="@load(vm.formDocument['ro'] || ro)"  
-                       value="@load(vm.formDocument[field]) @save(vm.formDocument[field], before='submit') @validator(vm.formValidator, parameters=validatorargs)" 
-                       onChange="@command('submit') @global-command('autosave', source=self)">
-<!-- 
-               <attribute name="format" if="${format}">
-               
-               </attribute>    
- -->
-               </longbox>
-       </div>  
-</div>
\ No newline at end of file
diff --git a/lis-ui/src/main/resources/web/fields/person-name.zul b/lis-ui/src/main/resources/web/fields/person-name.zul
deleted file mode 100644 (file)
index 5d5450a..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<div class="field">
-       <div class="row field-top" if="${!noheader}">
-               <include src="/fields/field-label.zul" />
-       </div>
-       <div class="row field-top">
-               <combobox class="field-textbox" autodrop="true" model="@load(vm.personsModel)"
-                       value="@load(vm.formDocument[field]) @save(vm.formDocument[field], before='submit') @validator(vm.formValidator)"
-                       disabled="@load(vm.formDocument['ro'] || ro)" onSelect="@command('decoratePersonFields', source=self) @global-command('autosave', source=self)">
-                       <template name="model">
-                               <comboitem label="@load(each.name)" content="@load(each.card)" value="@load(each)" />
-                       </template>
-               </combobox>
-       </div>
-</div>
\ No newline at end of file
diff --git a/lis-ui/src/main/resources/web/fields/person.zul b/lis-ui/src/main/resources/web/fields/person.zul
deleted file mode 100644 (file)
index ead1ecd..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<?component name="address" class="hu.bitcity.form.field.Field$Address" ?>
-<?component name="date" class="hu.bitcity.form.field.Field$Date" ?>
-<?component name="text" class="hu.bitcity.form.field.Field$Text" ?>
-<?component name="personname" class="hu.bitcity.form.field.Field$PersonName" ?>
-<div class="row">
-       <div class="row">
-               <personname class="four columns" label="Név" origField="${field}" field="${field}_nev" validators="nonempty"/>
-               <text class="four columns" label="Állampolgárság" field="${field}_allampolgarsag" />
-               <text class="four columns" label="Szem. ig./Útlevél szám" field="${field}_azonosito_irat" />
-       </div>
-       <address class="row" label="Lakcím" field="${field}_cim" validators="nonempty,address" />
-       <div class="row">
-               <text class="six columns" label="Születési hely" field="${field}_szuletesi_hely" validators="nonempty" />
-               <date class="two columns" label="Születés dátuma" field="${field}_szuletes_datuma" validators="nonempty"/>
-               <text class="four columns" label="Anyja neve" field="${field}_anyja_neve" validators="nonempty"/>
-       </div>
-       <div class="row no-print" if="${empty param.token or nocontacts}">
-               <text class="six columns" label="Telefonszám" field="${field}_telefon" validators="phone" />
-               <text class="six columns" label="E-mail" field="${field}_email" validators="email" />
-       </div>
-</div>
\ No newline at end of file
diff --git a/lis-ui/src/main/resources/web/fields/publicplace.zul b/lis-ui/src/main/resources/web/fields/publicplace.zul
deleted file mode 100644 (file)
index 3d10762..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<div class="field">
-       <div class="row field-top">
-               <include src="/fields/field-label.zul"/>
-       </div>  
-       <div class="row field-top">
-               <combobox class="field-textbox" autodrop="true" value="@load(vm.formDocument[field]) @save(vm.formDocument[field], before='submit') @validator(vm.formValidator)" 
-                       disabled="@load(vm.formDocument['ro'] || ro)" onChange="@command('submit') @global-command('autosave', source=self)" />
-       </div>  
-</div>
\ No newline at end of file
diff --git a/lis-ui/src/main/resources/web/fields/radio.zul b/lis-ui/src/main/resources/web/fields/radio.zul
deleted file mode 100644 (file)
index 86cd3ac..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<div class="field" xmlns:w="client" w:onClick="console.log('field : ${field}')">
-       <div class="@load(vm.getFieldStyle(field, 'field-label'))">
-               <radio id="r" label="${label}" value="${value}" onCheck="@command('onRadioCheck', target=self) @global-command('autosave', source=self)" 
-                       checked="@load(vm.formDocument[field]) @save(vm.formDocument[field], before='submit') @validator(vm.formValidator) @converter('hu.bitcity.converter.RadioCheckConverter')" 
-                       disabled="@load(vm.formDocument['ro'] || ro)" />
-       </div>
-</div> 
diff --git a/lis-ui/src/main/resources/web/fields/radiodate.zul b/lis-ui/src/main/resources/web/fields/radiodate.zul
deleted file mode 100644 (file)
index 45d57be..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<div class="field">
-       <div class="@load(vm.getFieldStyle(field, 'field-label'))">
-               <radio id="r" label="${label}" value="${value}" onCheck="@command('onRadioCheck', target=self) @global-command('autosave', source=self)" 
-                       checked="@load(vm.formDocument[field]) @save(vm.formDocument[field], before='submit') @validator(vm.formValidator) @converter('hu.bitcity.converter.RadioCheckConverter')" 
-                       disabled="@load(vm.formDocument['ro'] || ro)">
-                       <custom-attributes dataField="${dataField}" checkData="true"/>
-               </radio>
-               <datebox value="@bind(vm.formDocument[dataField])" format="yyyy.MM.dd" disabled="@load(vm.formDocument['ro'] || arg.readonly)">
-                       <!-- 
-                       onChange="@command('onForceRadioCheck', target=r, force=true)"
-                        -->
-                       <custom-attributes field="${dataField}"/>
-               </datebox>              
-       </div>
-</div> 
diff --git a/lis-ui/src/main/resources/web/fields/radiodouble.zul b/lis-ui/src/main/resources/web/fields/radiodouble.zul
deleted file mode 100644 (file)
index f81fe75..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<div class="field">
-       <div class="@load(vm.getFieldStyle(field, 'field-label'))">
-               <radio id="r" label="${label}" value="${value}" 
-                       onCheck="@command('onRadioCheck', target=self) @global-command('autosave', source=self)" 
-                       checked="@load(vm.formDocument[field]) @save(vm.formDocument[field], before='submit') @validator(vm.formValidator) @converter('hu.bitcity.converter.RadioCheckConverter')" 
-                       disabled="@load(vm.formDocument['ro'] || ro)" >
-                       <custom-attributes dataField="${dataField}" checkData="true"/>
-               </radio>
-               <doublebox class="radio-intbox" value="@bind(vm.formDocument[dataField])" format="#,##0.##" 
-                       disabled="@load(vm.formDocument['ro'] || arg.readonly)" onBlur="@command('submit')">
-                       <custom-attributes field="${dataField}"/>
-               </doublebox>
-               ${postfix}
-       </div>
-</div> 
diff --git a/lis-ui/src/main/resources/web/fields/radiogroup.zul b/lis-ui/src/main/resources/web/fields/radiogroup.zul
deleted file mode 100644 (file)
index d145f8b..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<div class="field">
-    <div class="row field-top">
-        <include src="/fields/field-label.zul"/>
-    </div>
-    <div class="row field-textbox field-top">
-        <radio label="${each}" forEach="${arg.values}" value="'${forEachStatus.index + 1}'"
-               checked="@bind(vm.formDocument[field]) @converter('hu.user.lis.ui.converter.RadioCheckConverter')"
-               onCheck="@command('onRadioCheck', target=self) @global-command('autosave', source=self)"
-               disabled="@load(vm.formDocument['ro'] || ro)"/>
-        <textbox class="inline-textbox"
-                 value="@load(vm.formDocument[dataField]) @save(vm.formDocument[dataField], before='submit') @validator(vm.formValidator, parameters=validatorargs)"
-                 disabled="@load(vm.formDocument['ro'] || ro)" onChange="@command('submit')"/>
-    </div>
-</div>
diff --git a/lis-ui/src/main/resources/web/fields/radionumber.zul b/lis-ui/src/main/resources/web/fields/radionumber.zul
deleted file mode 100644 (file)
index bae947a..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<div class="field">
-       <div class="@load(vm.getFieldStyle(field, 'field-label'))">
-               <radio id="r" label="${label}" value="${value}" 
-                       onCheck="@command('onRadioCheck', target=self) @global-command('autosave', source=self)" 
-                       checked="@load(vm.formDocument[field]) @save(vm.formDocument[field], before='submit') @validator(vm.formValidator) @converter('hu.bitcity.converter.RadioCheckConverter')" 
-                       disabled="@load(vm.formDocument['ro'] || ro)">
-                       <custom-attributes dataField="${dataField}" checkData="true"/>
-               </radio>
-               <intbox class="radio-intbox" value="@bind(vm.formDocument[dataField])" format=",###" 
-                       disabled="@load(vm.formDocument['ro'] || arg.readonly)" onBlur="@command('submit')"> 
-                       <custom-attributes field="${dataField}"/>
-               </intbox>
-               ${postfix}
-       </div>
-</div> 
diff --git a/lis-ui/src/main/resources/web/fields/rate.zul b/lis-ui/src/main/resources/web/fields/rate.zul
deleted file mode 100644 (file)
index 5cd257b..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<div class="field"> 
-       <div class="row field-top">
-               <include src="/fields/field-label.zul" />
-       </div>  
-       <div class="row field-top">
-               <doublebox class="ten columns field-textbox" format="#,##0.##" disabled="@load(vm.formDocument['ro'] || ro)"
-                       value="@load(vm.formDocument[field]) @save(vm.formDocument[field], before='submit') @validator(vm.formValidator)" onChange="@command('submit') @global-command('autosave', source=self)" />
-               <combobox id="combo" class="two columns field-textbox" readonly="true" autodrop="true" selectedItem="@bind(vm.formDocument[unitField])" disabled="@load(vm.formDocument['ro'] || ro)"
-                       onChange="@command('submit')" >
-                   <comboitem label="${each}" value="${each}" forEach="Ft, %" />
-               </combobox>             
-       </div>  
-</div>
\ No newline at end of file
diff --git a/lis-ui/src/main/resources/web/fields/settlement.zul b/lis-ui/src/main/resources/web/fields/settlement.zul
deleted file mode 100644 (file)
index 439db79..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<div class="field">
-       <div class="row field-top">
-               <include src="/fields/field-label.zul" />
-       </div>  
-       <div class="row">
-               <textbox class="field-textbox" value="@load(vm.formDocument[field]) @save(vm.formDocument[field], before='submit') @validator(vm.formValidator, parameters=validatorargs)" 
-                       disabled="@load(vm.formDocument['ro'] || ro)" onChange="@command('submit') @global-command('autosave', source=self)" />
-       </div>  
-</div>
\ No newline at end of file
diff --git a/lis-ui/src/main/resources/web/fields/signature.zul b/lis-ui/src/main/resources/web/fields/signature.zul
deleted file mode 100644 (file)
index 733455d..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<div class="field">
-       <div class="row field-top">
-               <include src="/fields/field-label.zul" />
-       </div>  
-       <div class="row field-textbox" style="background: white">
-               <button class="@load(vm.getFieldStyle(dataField, 'field-label no-print'))" label="Aláírás" onClick="@command('showSignDialog', field=field)" disabled="@load(vm.formDocument['ro'] || ro)" />
-               <image style="min-height:30px; max-height:30px; margin: 2px;" src="@bind(vm.formDocument[field])" />
-               <textbox value="@load(vm.formDocument[dataField]) @save(vm.formDocument[dataField], before='submit') @validator(vm.formValidator, force=true)" visible="false" />
-       </div>  
-</div>
\ No newline at end of file
diff --git a/lis-ui/src/main/resources/web/fields/stamp.zul b/lis-ui/src/main/resources/web/fields/stamp.zul
deleted file mode 100644 (file)
index 59f23fb..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<div class="row">
-       <div class="row field-top">
-               <include src="/fields/field-label.zul"/>
-       </div>  
-       <div class="row field-textbox" style="text-align: center;">
-               <image class="logo-image" width="100%"  src="/img/pecset.jpg" />
-       </div>                          
-</div>
\ No newline at end of file
diff --git a/lis-ui/src/main/resources/web/fields/textarea.zul b/lis-ui/src/main/resources/web/fields/textarea.zul
deleted file mode 100644 (file)
index 5ccf52c..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-<div class="field">
-       <textbox style="background: white" class="field-textbox" value="@load(vm.formDocument[field]) @save(vm.formDocument[field], before='submit') @validator(vm.formValidator)" 
-               multiline="true" inplace="true" rows="5" cols="42" disabled="@load(vm.formDocument['ro'] || ro)" onChange="@command('submit') @global-command('autosave', source=self)" />
-</div> 
diff --git a/lis-ui/src/main/resources/web/fields/title-deed-content.zul b/lis-ui/src/main/resources/web/fields/title-deed-content.zul
deleted file mode 100644 (file)
index 1c07c14..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<div xmlns:w="client" w:onClick='console.log("field : ${field}")'>
-       Megbízó
-       <radio class="@load(vm.getFieldStyle(field, 'inline-radio'))" value="1" onCheck="@command('onRadioCheck', target=self)" 
-               checked="@load(vm.formDocument[field]) @save(vm.formDocument[field], before='submit') @validator(vm.formValidator) @converter('hu.bitcity.converter.RadioCheckConverter')" 
-               disabled="@load(vm.formDocument['ro'] || ro)" />
-       átad egy 60 napnál nem régebbi tulajdoni lapot, vagy
-       <radio class="@load(vm.getFieldStyle(field, 'inline-radio'))" value="2" onCheck="@command('onRadioCheck', target=self)" 
-               checked="@load(vm.formDocument[field]) @save(vm.formDocument[field], before='submit') @validator(vm.formValidator) @converter('hu.bitcity.converter.RadioCheckConverter')" 
-               disabled="@load(vm.formDocument['ro'] || ro)" />
-       megbízza a Home Service képviselőjét, hogy szerezzen be egy tulajdoni lapot.
-</div>
diff --git a/lis-ui/src/main/resources/web/fields/title-deed.zul b/lis-ui/src/main/resources/web/fields/title-deed.zul
deleted file mode 100644 (file)
index 072eb3f..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<?component name="field" class="hu.bitcity.form.field.Field" ?>
-<div class="row">
-       <field class="twelve columms agreement" src="/fields/title-deed-content.zul" visible="@load(not vm.formDocument[errorField])" field="${field}" />
-       <field class="twelve columms agreement error" src="/fields/title-deed-content.zul" visible="@load(vm.formDocument[errorField])" field="${field}" />
-</div>
diff --git a/lis-ui/src/main/resources/web/fields/zipcode.zul b/lis-ui/src/main/resources/web/fields/zipcode.zul
deleted file mode 100644 (file)
index d357e88..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<div class="field">
-       <div class="row field-top">
-               <include src="/fields/field-label.zul"/>
-       </div>  
-       <div class="row field-top">
-               <intbox class="field-textbox" disabled="@load(vm.formDocument['ro'] || ro)"  
-                       value="@load(vm.formDocument[field]) @save(vm.formDocument[field], before='submit') @validator(vm.formValidator)" 
-                       onChange="@command('decorateSettlementFields', source=self) @global-command('autosave', source=self)" format="####">
-               </intbox>
-       </div>  
-</div>
\ No newline at end of file
index ec483d217859780bc393b9495241eddea6db5b0d..16c6aa94a69c47fdd7a26466dc34cf15b0aa033f 100644 (file)
@@ -2,11 +2,11 @@
 <zk>
     <window vflex="true" viewModel="@id('vm') @init('hu.user.lis.ui.view.IndexViewModel')">
         <caption>
-            <hlayout hflex="max">
+            <hlayout valign="middle">
+                <image width="24px" height="24px" src="~./static/images/logo.png"/>
                 <label value="LEADER INFORMATION SYSTEM"/>
-                <separator/>
-                <label value="@load(vm.buildProperties.version)"/>
-                <!--                <button iconSclass="z-icon-user"/>-->
+                <separator orient="vertical"/>
+                <label style="font-size: 0.8em" value="@load(vm.buildProperties.version)"/>
             </hlayout>
         </caption>
         <borderlayout>
index 1bb96938fda2b2dfff0eae20667621a5daf0db33..7e6c144ab1431a9ffa907bdb745e23135d5468d5 100644 (file)
@@ -1,33 +1,30 @@
 <?link rel="stylesheet" type="text/css" href="~./static/css/skeleton.css" ?>
 <?link rel="stylesheet" type="text/css" href="~./static/css/webclient.css" ?>
-<?component name="text" class="hu.user.lis.ui.form.Field$Text" ?>
 <zk>
     <window id="partnerPopup" title="Partner szerkesztés" width="60%" height="40%" closable="true"
             viewModel="@id('vm') @init('hu.user.lis.ui.view.PartnerEditorModel')">
         <borderlayout>
-            <center border="none" vflex="true">
-                <div class="container u-form-width u-max-form-width">
-                    <div class="row">
-                        <text class="twelve columns" label="Név" field="name"/>
-                    </div>
-                    <div class="row">
-                        <text class="twelve columns" label="Adószám" field="vatNr"/>
-                    </div>
-                    <div class="row">
-                        <text class="twelve columns" label="Cím" field="address"/>
-                    </div>
-                    <div class="row">
-                        <radiogroup model="@bind(vm.active)">
-                            <radio label="Aktív" value="true"/>
-                            <radio label="Inaktív" value="false"/>
-                        </radiogroup>
-                    </div>
-                </div>
+            <center border="none" vflex="true" hflex="true">
+                <vlayout hflex="true">
+                    <label value="Név"/>
+                    <textbox hflex="true" instant="true" value="@bind(vm.selectedPartner.name)"
+                             forward="onOK=submit.onClick, onCancel=cancel.onClick"/>
+                    <label value="Adószám"/>
+                    <textbox hflex="true" instant="true" value="@bind(vm.selectedPartner.vatNr)"
+                             forward="onOK=submit.onClick, onCancel=cancel.onClick"/>
+                    <label value="Cím"/>
+                    <textbox hflex="true" instant="true" value="@bind(vm.selectedPartner.address)"
+                             forward="onOK=submit.onClick, onCancel=cancel.onClick"/>
+                    <label value="Aktív"/>
+                    <checkbox mold="switch" checked="@bind(vm.selectedPartner.active)"/>
+                </vlayout>
             </center>
             <south flex="true" style="text-align: right; padding: 10px">
                 <hlayout>
-                    <button label="Bezár" onClick="@command('onCloseWindow', target=partnerPopup, select=false)"/>
-                    <button label="Mentés" onClick="@command('onCloseWindow', target=partnerPopup, select=true)"/>
+                    <button id="cancel" label="Bezár"
+                            onClick="@command('onCloseWindow', target=partnerPopup, select=false)"/>
+                    <button id="submit" label="Mentés"
+                            onClick="@command('onCloseWindow', target=partnerPopup, select=true)"/>
                 </hlayout>
             </south>
         </borderlayout>
index aaa67fa8ddf9a534abf01acf38a521260a24f656..d70f867cf86de580a21a57a50d7dd6514cc17f2c 100644 (file)
@@ -7,19 +7,29 @@
         }
     </style>
     <window title="Partnerek" vflex="true" viewModel="@id('vm') @init('hu.user.lis.ui.view.PartnersViewModel')">
-
+        <!--        <timer id="timer" delay="500" repeats="true" onTimer="@command('uiTick')"/>-->
         <borderlayout>
             <north flex="true">
                 <toolbar>
                     <toolbarbutton label="Új partner" iconSclass="z-icon-plus" onClick="@command('onAddNew')"/>
                     <toolbarbutton label="Szerkesztés" iconSclass="z-icon-edit" onClick="@command('onEdit')"
-                                   disabled="@load(empty vm.formDocument)"/>
+                                   disabled="@load(empty vm.selectedPartner)"/>
+                    <separator orient="vertical"/>
+                    <toolbarbutton mode="toggle" iconSclass="z-icon-check" label="Aktív"
+                                   checked="@bind(vm.filterShowActive)"/>
+                    <toolbarbutton mode="toggle" iconSclass="z-icon-ban" label="Inaktív"
+                                   checked="@bind(vm.filterShowInActive)"/>
+                    <toolbarbutton mode="toggle" iconSclass="z-icon-adjust" label="Mind"
+                                   checked="@bind(vm.filterShowBoth)"/>
                 </toolbar>
             </north>
             <center border="none" flex="true">
-                <listbox id="partnersList" vflex="true" model="@load(vm.partnersDataModel)" mold="paging"
-                         autopaging="true"
-                         pagingPosition="top" onSelect="@command('onListSelection')">
+                <listbox id="partnersList" vflex="true" model="@load(vm.partnersDataModel)"
+                         autopaging="true" pagingPosition="top"
+                         onSelect="@command('onListSelection')" onDoubleClick="@command('onEdit')"
+                         onAfterRender="@command('onAfterRenderPartners')">
+                    <custom-attributes org.zkoss.zul.listbox.selectOnHighlight.disabled="true"/>
+
                     <listhead>
                         <listheader label="Név" align="left"/>
                         <listheader label="Adószám" align="left"/>
diff --git a/pom.xml b/pom.xml
index 5c55112afe94637d0f1d6125a98c3913e50019c7..576b70d7a4626563e9bf8c7bd0cba78f681cacfb 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -16,8 +16,6 @@
         <java.version>1.8</java.version>
         <maven.compiler.source>1.8</maven.compiler.source>
         <maven.compiler.target>1.8</maven.compiler.target>
-        <spring.version>2.2.4.RELEASE</spring.version>
-        <springboot.version>2.2.4.RELEASE</springboot.version>
     </properties>
     <parent>
         <groupId>org.springframework.boot</groupId>
         <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-api</artifactId>
-            <version>2.19.0</version>
+            <version>2.20.0</version>
         </dependency>
-        <!--        <dependency>-->
-        <!--            <groupId>org.springframework.boot</groupId>-->
-        <!--            <artifactId>spring-boot-devtools</artifactId>-->
-        <!--            <optional>true</optional>-->
-        <!--        </dependency>-->
     </dependencies>
 </project>