Associates editor, page caption
authorelgekko <vasary@elgekko.net>
Mon, 24 Apr 2023 20:37:12 +0000 (22:37 +0200)
committerelgekko <vasary@elgekko.net>
Mon, 24 Apr 2023 20:37:12 +0000 (22:37 +0200)
19 files changed:
lis-db/src/main/java/hu/user/lis/db/Associate.java
lis-services/src/main/java/hu/user/lis/services/data/AssociateServiceImpl.java
lis-ui/src/main/java/hu/user/lis/ui/config/ResourceConfigurer.java
lis-ui/src/main/java/hu/user/lis/ui/data/AssociatesDataModel.java [new file with mode: 0644]
lis-ui/src/main/java/hu/user/lis/ui/view/AssociateEditorModel.java [new file with mode: 0644]
lis-ui/src/main/java/hu/user/lis/ui/view/AssociatesViewModel.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/PartnersViewModel.java
lis-ui/src/main/java/hu/user/lis/ui/view/ProjectsViewModel.java
lis-ui/src/main/resources/web/associate-editor.zul [new file with mode: 0644]
lis-ui/src/main/resources/web/associates.zul [new file with mode: 0644]
lis-ui/src/main/resources/web/incoming-invoice-editor.zul
lis-ui/src/main/resources/web/index.zul
lis-ui/src/main/resources/web/outgoing-invoice-editor.zul
lis-ui/src/main/resources/web/partner-editor.zul
lis-ui/src/main/resources/web/partners.zul
lis-ui/src/main/resources/web/project-editor.zul
lis-ui/src/main/resources/web/project.zul
lis-ui/src/main/resources/web/projects.zul

index a7b66e814d18b5bd3e08c3b5dc9de009e8073a49..dcabbe87a8b307dd3b267ff0f47786d04a6ad7ee 100644 (file)
@@ -10,6 +10,8 @@ import lombok.*;
 public class Associate {
     String id;
     String name;
+    String login;
+    String password;
     double hourlyRate;
     boolean active;
 }
index e112dcd03197ff882c59ead7e53480964c55a488..5127581085d2b76457bef6ee43ed93e1addc5f96 100644 (file)
@@ -55,11 +55,12 @@ public class AssociateServiceImpl implements AssociateService {
 
     private List<Associate> generate() {
         List<Associate> result = new ArrayList<>();
-        for (int i = 0; i < 100; i++) {
+        for (int i = 0; i < 10; i++) {
             String id = RandomStringUtils.random(8, "0123456789abcdef");
             String name = dataGeneratorService.faker().name().fullName();
-
-            Associate entity = Associate.builder().active(true).id(id).name(name).build();
+            String login = "user" + (i + 1);
+            String password = "password";
+            Associate entity = Associate.builder().active(true).id(id).name(name).login(login).password(password).build();
             result.add(entity);
         }
         return result;
index 31b63dbe18e19250159ad3945d7c3b691364fe09..ffa5562ab06a8a9ae65d662ffef55aa29ec756f4 100644 (file)
@@ -14,4 +14,9 @@ public class ResourceConfigurer {
     public String projects() {
         return "index";
     }
+
+    @GetMapping("/associates")
+    public String associates() {
+        return "index";
+    }
 }
diff --git a/lis-ui/src/main/java/hu/user/lis/ui/data/AssociatesDataModel.java b/lis-ui/src/main/java/hu/user/lis/ui/data/AssociatesDataModel.java
new file mode 100644 (file)
index 0000000..b5b2616
--- /dev/null
@@ -0,0 +1,110 @@
+package hu.user.lis.ui.data;
+
+import hu.user.lis.db.Associate;
+import hu.user.lis.services.data.AssociateService;
+import lombok.Getter;
+import lombok.extern.log4j.Log4j2;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.config.ConfigurableBeanFactory;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+import org.zkoss.bind.BindUtils;
+import org.zkoss.zul.FieldComparator;
+
+import java.util.Comparator;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Component
+@Log4j2
+@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
+public class AssociatesDataModel extends CachedDataModel<Associate> {
+    @Getter
+    @Autowired
+    AssociateService associateService;
+    private String partialName;
+    private boolean listAll;
+    private boolean filterShowInActive;
+    private boolean filterShowActive;
+
+
+    private boolean canExecuteSearch() {
+        boolean result = listAll || filterShowActive || filterShowInActive ||
+                StringUtils.isNotBlank(partialName);
+        log.info("Can execute search: {}", result);
+        return result;
+    }
+
+    private boolean filter(Associate associate) {
+        if (listAll) {
+            return true;
+        }
+
+        boolean result = true;
+        if (StringUtils.isNotBlank(partialName)) {
+            if (!associate.getName().toLowerCase().startsWith(partialName.toLowerCase())) {
+                result = false;
+            }
+        }
+        if (!filterShowActive && associate.isActive()) {
+            result = false;
+        }
+
+        if (!filterShowInActive && !associate.isActive()) {
+            result = false;
+        }
+
+        return result;
+    }
+
+    @Override
+    protected List<Associate> getResultSet(long offset, int limit, FieldComparator sortComparator) {
+        List<Associate> result = null;
+        if (canExecuteSearch()) {
+            result = associateService.getAll().stream()
+                    .filter(s -> filter(s))
+                    .sorted(Comparator.comparing(Associate::getName, String.CASE_INSENSITIVE_ORDER))
+                    .collect(Collectors.toList());
+        }
+        return result;
+    }
+
+    @Override
+    public int getResultSetCount() {
+        int result = 0;
+        if (canExecuteSearch()) {
+            result = (int) associateService.getAll().stream()
+                    .filter(s -> filter(s))
+                    .count();
+        }
+        return result;
+    }
+
+    public void search(String partialName) {
+        log.info("Searching ssociate using filters: name LIKE {}",
+                partialName);
+        listAll = false;
+        this.partialName = partialName;
+        super.reset();
+        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 associates");
+        listAll = true;
+        super.reset();
+        BindUtils.postNotifyChange(null, null, this, "*");
+    }
+}
diff --git a/lis-ui/src/main/java/hu/user/lis/ui/view/AssociateEditorModel.java b/lis-ui/src/main/java/hu/user/lis/ui/view/AssociateEditorModel.java
new file mode 100644 (file)
index 0000000..1a6ec86
--- /dev/null
@@ -0,0 +1,86 @@
+package hu.user.lis.ui.view;
+
+import hu.user.lis.db.Associate;
+import hu.user.lis.services.data.AssociateService;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.extern.log4j.Log4j2;
+import org.apache.commons.lang3.StringUtils;
+import org.zkoss.bind.BindUtils;
+import org.zkoss.bind.ValidationContext;
+import org.zkoss.bind.annotation.BindingParam;
+import org.zkoss.bind.annotation.Command;
+import org.zkoss.bind.annotation.Init;
+import org.zkoss.bind.validator.AbstractValidator;
+import org.zkoss.zk.ui.Component;
+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;
+import org.zkoss.zk.ui.select.annotation.WireVariable;
+import org.zkoss.zkplus.spring.DelegatingVariableResolver;
+import org.zkoss.zul.Window;
+
+import java.util.Objects;
+
+@Log4j2
+@Getter
+@Setter
+@VariableResolver(DelegatingVariableResolver.class)
+public class AssociateEditorModel extends AbstractValidator {
+    @WireVariable
+    AssociateService associateServiceImpl;
+    private Associate formDocument;
+    private Associate origDocument;
+    private boolean formInvalid = true;
+
+    @Init
+    public void init() {
+        log.info("Initialized");
+        origDocument = (Associate) Executions.getCurrent().getArg().get("origDocument");
+        formDocument = (Associate) Executions.getCurrent().getArg().get("formDocument");
+    }
+
+    @Command
+    public void onCloseWindow(@BindingParam("target") Window target, @BindingParam("select") boolean select) {
+        if (select && formInvalid) {
+            return;
+        }
+        Event closeEvent = new Event("onClose", target, select ? formDocument : null);
+        Events.postEvent(closeEvent);
+    }
+
+    @Override
+    public void validate(ValidationContext ctx) {
+        Component target = ctx.getBindContext().getComponent();
+        String property = ctx.getProperty().getProperty();
+        Object value = ctx.getProperty().getValue();
+        log.info("Validating caused by {} {} {}", target.getId(), property, value);
+        updateFormInvalid(false);
+        try {
+            Associate newData = associateServiceImpl.copy(formDocument, property, value);
+            if (!Objects.isNull(origDocument) && associateServiceImpl.toString(origDocument).equals(associateServiceImpl.toString(newData))) {
+                log.info("Document not changed");
+                updateFormInvalid(true);
+                return;
+            }
+            if (StringUtils.isBlank(newData.getName()) ||
+                    StringUtils.isBlank(newData.getLogin()) ||
+                    StringUtils.isBlank(newData.getPassword()) ||
+                    newData.getHourlyRate() < 1
+            ) {
+                log.info("Document is not valid");
+                updateFormInvalid(true);
+            }
+
+
+        } catch (Exception e) {
+            log.catching(e);
+        }
+    }
+
+    private void updateFormInvalid(boolean invalid) {
+        setFormInvalid(invalid);
+        BindUtils.postNotifyChange(this, "formInvalid");
+    }
+}
diff --git a/lis-ui/src/main/java/hu/user/lis/ui/view/AssociatesViewModel.java b/lis-ui/src/main/java/hu/user/lis/ui/view/AssociatesViewModel.java
new file mode 100644 (file)
index 0000000..90d8cdf
--- /dev/null
@@ -0,0 +1,155 @@
+package hu.user.lis.ui.view;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import hu.user.lis.db.Associate;
+import hu.user.lis.ui.data.AssociatesDataModel;
+import lombok.Getter;
+import lombok.extern.log4j.Log4j2;
+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.WireVariable;
+import org.zkoss.zk.ui.util.Clients;
+import org.zkoss.zkplus.spring.DelegatingVariableResolver;
+import org.zkoss.zul.Window;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+@Log4j2
+@VariableResolver(DelegatingVariableResolver.class)
+public class AssociatesViewModel {
+    @WireVariable
+    @Getter
+    AssociatesDataModel associatesDataModel;
+    @Getter
+    private Associate selectedEntity;
+    private boolean filterShowInActive;
+    private boolean filterShowActive;
+    private boolean filterShowBoth;
+
+    @AfterCompose
+    public void onAfterCompose(@ContextParam(ContextType.VIEW) Component view) {
+        Selectors.wireComponents(view, this, false);
+        Selectors.wireEventListeners(view, this);
+    }
+
+    @Init
+    public void init() {
+        setFilterShowActive(true);
+        log.info("Initialized");
+        Clients.evalJavaScript("pushNav('/associates')");
+    }
+
+    private void refresh() {
+        associatesDataModel.clearSelection();
+        selectedEntity = null;
+        if (filterShowBoth) {
+            associatesDataModel.search(true, true);
+        } else {
+            associatesDataModel.search(filterShowActive, filterShowInActive);
+        }
+    }
+
+    @Command
+    @NotifyChange("selectedPartner")
+    public void search() {
+    }
+
+    @Command
+    @NotifyChange("selectedPartner")
+    public void onListSelection() {
+        selectedEntity = null;
+        Set<Associate> selections = associatesDataModel.getSelection();
+        if (selections.size() == 1) {
+            selectedEntity = selections.iterator().next();
+            log.info("Selected {}", selectedEntity);
+        }
+    }
+
+    @Command
+    public void onAfterRenderList() {
+    }
+
+    @Command
+    public void onAdd() {
+        String page = "~./associate-editor.zul";
+        Associate newEntity = associatesDataModel.getAssociateService().createNew();
+        Window editorWindow = (Window) Executions.createComponents(page, null,
+                Collections.singletonMap("formDocument", newEntity));
+        editorWindow.addEventListener("onClose", e -> {
+            if (e.getData() != null) {
+                log.info("Associate popup result {}", e.getData());
+                associatesDataModel.getAssociateService().add(newEntity);
+                associatesDataModel.clearSelection();
+                refresh();
+                associatesDataModel.addToSelection(newEntity);
+                selectedEntity = newEntity;
+            }
+        });
+        editorWindow.doModal();
+    }
+
+    @Command
+    public void onEdit() throws JsonProcessingException {
+        String page = "~./associate-editor.zul";
+        Associate editEntity = associatesDataModel.getAssociateService().copy(selectedEntity);
+        Map<String, Object> arg = new HashMap<>();
+        arg.put("origDocument", selectedEntity);
+        arg.put("formDocument", editEntity);
+        Window editorWindow = (Window) Executions.createComponents(page, null, arg);
+        editorWindow.addEventListener("onClose", e -> {
+            if (e.getData() != null) {
+                log.info("Partner popup result {}", e.getData());
+                Associate modifiedEntity = (Associate) e.getData();
+                associatesDataModel.clearSelection();
+                associatesDataModel.getAssociateService().replace(selectedEntity, modifiedEntity);
+                refresh();
+                associatesDataModel.addToSelection(modifiedEntity);
+                selectedEntity = modifiedEntity;
+            }
+        });
+        editorWindow.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 35b3686c50fbb748ac6d4ae7a33a1a41f245fca5..7034e5475373692d9e4ca4bd59d2800dbb2ec318 100644 (file)
@@ -29,6 +29,7 @@ public class IndexViewModel implements EventListener {
     public static final String PROJECT_EDITOR_PAGE = "~./project-editor.zul";
     private static final String PARTNERS_LIST = "~./partners.zul";
     private static final String PROJECTS_LIST = "~./projects.zul";
+    private static final String ASSOCIATES_LIST = "~./associates.zul";
     @WireVariable
     BuildProperties buildProperties;
     @WireVariable
@@ -36,7 +37,8 @@ public class IndexViewModel implements EventListener {
     String searchPhrase;
     String page;
     private Map<String, String> navigation = ImmutableMap.of(
-            "/projects", PROJECTS_LIST
+            "/projects", PROJECTS_LIST,
+            "/accociates", ASSOCIATES_LIST
     );
 
     @Init
index 0ad8556dc466abe6cb2d3044b507b125c5c2ee12..f96ced4204b015b0064233d1353ca4b57d6ebfce 100644 (file)
@@ -12,6 +12,7 @@ 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.zk.ui.util.Clients;
 import org.zkoss.zkplus.spring.DelegatingVariableResolver;
 import org.zkoss.zul.Listbox;
 import org.zkoss.zul.Window;
@@ -43,8 +44,9 @@ public class PartnersViewModel extends AsyncBaseModel {
 
     @Init
     public void init() {
-        log.info("Initialized");
         setFilterShowActive(true);
+        Clients.evalJavaScript("pushNav('/')");
+        log.info("Initialized");
     }
 
     private void refresh() {
index 6c27919f79bf59da3eba3c10ad0ea275fb32a775..90eb386860e00a430847dc09f15aeb00bb7e8d4f 100644 (file)
@@ -14,6 +14,7 @@ import org.zkoss.zk.ui.event.EventListener;
 import org.zkoss.zk.ui.select.Selectors;
 import org.zkoss.zk.ui.select.annotation.VariableResolver;
 import org.zkoss.zk.ui.select.annotation.WireVariable;
+import org.zkoss.zk.ui.util.Clients;
 import org.zkoss.zkplus.spring.DelegatingVariableResolver;
 
 import java.util.Map;
@@ -44,6 +45,7 @@ public class ProjectsViewModel extends AsyncBaseModel implements EventListener {
     public void init() {
         setFilterShowActive(true);
         eventBus.register(this);
+        Clients.evalJavaScript("pushNav('/projects')");
         log.info("Initialized");
     }
 
diff --git a/lis-ui/src/main/resources/web/associate-editor.zul b/lis-ui/src/main/resources/web/associate-editor.zul
new file mode 100644 (file)
index 0000000..cb21931
--- /dev/null
@@ -0,0 +1,51 @@
+<?link rel="stylesheet" type="text/css" href="~./static/css/skeleton.css" ?>
+<?link rel="stylesheet" type="text/css" href="~./static/css/webclient.css" ?>
+<zk>
+    <window id="associatePopup" width="60%" height="40%" closable="true"
+            viewModel="@id('vm') @init('hu.user.lis.ui.view.AssociateEditorModel')">
+        <caption label="Munkatárs szerkesztés"/>
+        <borderlayout>
+            <center border="none" vflex="true" hflex="true">
+                <tabbox vflex="true" hflex="true">
+                    <tabs>
+                        <tab label="Adatok" selected="true"/>
+                    </tabs>
+                    <tabpanels>
+                        <tabpanel>
+                            <vlayout hflex="true">
+                                <label value="Név"/>
+                                <textbox hflex="true" instant="true" value="@bind(vm.formDocument.name) @validator(vm)"
+                                         forward="onOK=submit.onClick, onCancel=cancel.onClick"/>
+                                <label value="Login"/>
+                                <textbox hflex="true" instant="true" value="@bind(vm.formDocument.login) @validator(vm)"
+                                         forward="onOK=submit.onClick, onCancel=cancel.onClick"/>
+                                <label value="Jelszó"/>
+                                <hlayout>
+                                    <textbox hflex="true" instant="true" type="password"
+                                             value="@bind(vm.formDocument.password) @validator(vm)"
+                                             forward="onOK=submit.onClick, onCancel=cancel.onClick"/>
+                                    <button iconSclass="z-icon-eye"/>
+                                </hlayout>
+                                <label value="Óradíj"/>
+                                <doublebox value="@bind(vm.formDocument.hourlyRate) @validator(vm)"
+                                           format="#.##" instant="true"
+                                           forward="onOK=submit.onClick, onCancel=cancel.onClick"/>
+                                <label value="Aktív"/>
+                                <checkbox mold="switch" checked="@bind(vm.formDocument.active)"/>
+                            </vlayout>
+                        </tabpanel>
+                    </tabpanels>
+                </tabbox>
+            </center>
+            <south border="none" flex="true" style="text-align: right; padding: 10px">
+                <hlayout>
+                    <button id="cancel" label="Bezár"
+                            onClick="@command('onCloseWindow', target=associatePopup, select=false)"/>
+                    <button id="submit" label="Mentés"
+                            onClick="@command('onCloseWindow', target=associatePopup, select=true)"
+                            disabled="@bind(vm.formInvalid)"/>
+                </hlayout>
+            </south>
+        </borderlayout>
+    </window>
+</zk>
\ No newline at end of file
diff --git a/lis-ui/src/main/resources/web/associates.zul b/lis-ui/src/main/resources/web/associates.zul
new file mode 100644 (file)
index 0000000..9168afa
--- /dev/null
@@ -0,0 +1,53 @@
+<?link rel="stylesheet" type="text/css" href="~./static/css/skeleton.css" ?>
+<?link rel="stylesheet" type="text/css" href="~./static/css/webclient.css" ?>
+<zk>
+    <style>
+        .z-listitem-selected>.z-listcell>.z-listcell-content {
+        font-weight: bold;
+        }
+    </style>
+    <window vflex="true" viewModel="@id('vm') @init('hu.user.lis.ui.view.AssociatesViewModel')">
+        <caption label="Munkatársak"/>
+        <borderlayout>
+            <north flex="true">
+                <toolbar>
+                    <toolbarbutton label="Hozzáadás" iconSclass="z-icon-plus" onClick="@command('onAdd')"/>
+                    <toolbarbutton label="Szerkesztés" iconSclass="z-icon-edit" onClick="@command('onEdit')"
+                                   disabled="@load(empty vm.selectedEntity)"/>
+                    <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 vflex="true" model="@load(vm.associatesDataModel)"
+                         autopaging="true" pagingPosition="top" multiple="false"
+                         onSelect="@command('onListSelection')" onDoubleClick="@command('onEdit')"
+                         onAfterRender="@command('onAfterRenderList')">
+                    <custom-attributes org.zkoss.zul.listbox.selectOnHighlight.disabled="true"/>
+
+                    <listhead>
+                        <listheader label="Név" align="left"/>
+                        <listheader label="Login" align="left"/>
+                        <listheader label="Aktív" align="left"/>
+                    </listhead>
+                    <template name="model">
+                        <listitem>
+                            <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>
+        </borderlayout>
+
+    </window>
+</zk>
\ No newline at end of file
index 9457614887d7958150f2e81d25f94cc977c033bb..77010bdf564ac6e79eefc553ff42cd923d58a48e 100644 (file)
@@ -6,8 +6,9 @@
         import hu.user.lis.db.Currency;
         ListModelList currencies = new ListModelList(Currency.values());
     </zscript>
-    <window id="invoicePopup" title="Bejövő számla szerkesztés" width="50%" height="50%" closable="true"
+    <window id="invoicePopup" width="50%" height="50%" closable="true"
             maximizable="true" sizable="true" viewModel="@id('vm') @init('hu.user.lis.ui.view.InvoiceEditorModel')">
+        <caption label="Bejövő számla szerkesztés"/>
         <borderlayout>
             <center border="none" vflex="true" hflex="true">
                 <tabbox vflex="true" hflex="true">
index 56556e4c10d7c7ee6f7bf4299c8c5b573b6ca9b8..75aacb99f0eb1826e4f8e32fbc9df484d0927b91 100644 (file)
@@ -7,6 +7,11 @@
         font-weight: bolder;
         }
     </style>
+    <script>
+        function pushNav(nav) {
+        history.pushState({}, "", nav);
+        }
+    </script>
     <window vflex="true" viewModel="@id('vm') @init('hu.user.lis.ui.view.IndexViewModel')">
         <caption>
             <hlayout valign="middle">
             <north border="none" hflex="true">
                 <hlayout valign="middle">
                     <menubar autodrop="true" hflex="true">
-                        <menuitem id="partnersMenuItem" iconSclass="z-icon-group" label="Partnerek"
+                        <menuitem iconSclass="z-icon-group" label="Partnerek"
                                   onClick="@command(vm.selectPage('~./partners.zul'))"/>
-                        <menuitem id="projectsMenuItem" iconSclass="z-icon-tasks" label="Projektek"
+                        <menuitem iconSclass="z-icon-tasks" label="Projektek"
                                   onClick="@command(vm.selectPage('~./projects.zul'))"/>
+                        <menuitem iconSclass="z-icon-th" label="Munkalapok" disabled="true"
+                                  onClick="@command(vm.selectPage('~./worksheets.zul'))"/>
+                        <menuseparator/>
+                        <menuitem iconSclass="z-icon-user" label="Munkatársak"
+                                  onClick="@command(vm.selectPage('~./associates.zul'))"/>
                     </menubar>
                     <hbox hflex="min" pack="right">
                         <textbox value="@bind(vm.searchPhrase)" onOK="@command('search')"></textbox>
index 6643ee0680075c0889d6defe1496758904f1deb0..09dd76ee00234a82641ebc6ba39be74eb19db4f1 100644 (file)
@@ -6,8 +6,9 @@
         import hu.user.lis.db.Currency;
         ListModelList currencies = new ListModelList(Currency.values());
     </zscript>
-    <window id="invoicePopup" title="Kimenő számla szerkesztés" width="50%" height="50%" closable="true"
+    <window id="invoicePopup" width="50%" height="50%" closable="true"
             maximizable="true" sizable="true" viewModel="@id('vm') @init('hu.user.lis.ui.view.InvoiceEditorModel')">
+        <caption label="Kimenő számla szerkesztés"/>
         <borderlayout>
             <center border="none" vflex="true" hflex="true">
                 <tabbox vflex="true" hflex="true">
index d4f2b06841e527825400c1bfeb6e87478dba67fe..2f4dbae591d74ae2e74f22488667466d7c99f2b6 100644 (file)
@@ -1,8 +1,9 @@
 <?link rel="stylesheet" type="text/css" href="~./static/css/skeleton.css" ?>
 <?link rel="stylesheet" type="text/css" href="~./static/css/webclient.css" ?>
 <zk>
-    <window id="partnerPopup" title="Partner szerkesztés" width="60%" height="40%" closable="true"
+    <window id="partnerPopup" width="60%" height="40%" closable="true"
             viewModel="@id('vm') @init('hu.user.lis.ui.view.PartnerEditorModel')">
+        <caption label="Partner szerkesztés"/>
         <borderlayout>
             <center border="none" vflex="true" hflex="true">
                 <tabbox vflex="true" hflex="true">
index 25daa28edb087580fdd23f1f97e6f63d32306aa9..19292ed83063cfaaf51249bf8ad1fb0b2c30cd5a 100644 (file)
@@ -6,8 +6,9 @@
         font-weight: bold;
         }
     </style>
-    <window title="Partnerek" vflex="true" viewModel="@id('vm') @init('hu.user.lis.ui.view.PartnersViewModel')">
+    <window vflex="true" viewModel="@id('vm') @init('hu.user.lis.ui.view.PartnersViewModel')">
         <!--        <timer id="timer" delay="500" repeats="true" onTimer="@command('uiTick')"/>-->
+        <caption label="Partnerek"/>
         <borderlayout>
             <north flex="true">
                 <toolbar>
index 02020cfffe18d8d3de426c4ff9807109c89f4364..c2146d709fa5f9524b168e2c21b73432939d75f7 100644 (file)
@@ -2,8 +2,9 @@
 <?link rel="stylesheet" type="text/css" href="~./static/css/webclient.css" ?>
 <?component name="partner-selector" inline="true" macroURI="~./partner-selector.zul"?>
 <zk>
-    <window id="projectEditor" title="Projekt szerkesztés" hflex="true" vflex="true"
+    <window id="projectEditor" hflex="true" vflex="true"
             viewModel="@id('vm') @init('hu.user.lis.ui.view.ProjectEditorModel')">
+        <caption label="Projekt szerkesztés"/>
         <borderlayout>
             <center id="centerPanel" border="none" vflex="true" hflex="true" autoscroll="true">
                 <vlayout hflex="true" vflex="min">
index 9dad1021355b84fef7dfbd2cb17f36bd5dd8089f..8356b45ef0dde2da9aa972b10e0857b978265a6f 100644 (file)
@@ -2,8 +2,9 @@
 <?link rel="stylesheet" type="text/css" href="~./static/css/webclient.css" ?>
 <?component name="partner-selector" inline="true" macroURI="~./partner-selector.zul"?>
 <zk>
-    <window id="projectEditor" title="Projekt szerkesztés" width="60%" height="80%" closable="true"
+    <window id="projectEditor" width="60%" height="80%" closable="true"
             viewModel="@id('vm') @init('hu.user.lis.ui.view.ProjectEditorModel')">
+        <caption label="Projekt szerkesztés"/>
         <borderlayout>
             <center border="none" vflex="true" hflex="true">
                 <tabbox vflex="true" hflex="true">
index cb3e309f1a81eede76944192d161ed0b9aa7e17e..0da8854e270efeda0359066d060f2f5ae104c298 100644 (file)
@@ -6,10 +6,8 @@
         font-weight: bold;
         }
     </style>
-    <script>
-        history.pushState({}, "", "/projects");
-    </script>
-    <window title="Projektek" vflex="true" viewModel="@id('vm') @init('hu.user.lis.ui.view.ProjectsViewModel')">
+    <window vflex="true" viewModel="@id('vm') @init('hu.user.lis.ui.view.ProjectsViewModel')">
+        <caption label="Projektek"/>
         <borderlayout>
             <north flex="true">
                 <toolbar>