diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 6e787f4b..0d7878dc 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -19,8 +19,7 @@ TODO: Customer wo form - Printing - Rights with tags system test all rights + Printing report button when print report if allowed the *server* chooses the report template, not the client, based on the global settings Look at cases re wo and csr stuff diff --git a/ayanova/src/views/customer-workorder.vue b/ayanova/src/views/customer-workorder.vue index c9043b72..9bc1a1a6 100644 --- a/ayanova/src/views/customer-workorder.vue +++ b/ayanova/src/views/customer-workorder.vue @@ -200,6 +200,21 @@ async function clickHandler(menuItem) { const m = window.$gz.menu.parseMenuItem(menuItem); if (m.owner == FORM_KEY && !m.disabled) { switch (m.key) { + case "report": + alert("STUB:PRINT REPORT"); + // const res = await m.vm.$refs.reportSelector.open( + // { + // AType: window.$gz.type.Customer, + // selectedRowIds: [m.vm.obj.id] + // }, + // m.id + // ); + // if (res == null) { + // return; + // } + // window.$gz.form.setLastReport(FORM_KEY, res); + // generateMenu(m.vm); + break; default: window.$gz.eventBus.$emit( "notify-warning", @@ -223,6 +238,14 @@ function generateMenu(vm) { menuItems: [] }; + if (vm.obj.canReport) + menuOptions.menuItems.push({ + title: "Report", + icon: "$ayiFileAlt", + key: FORM_KEY + ":report", + vm: vm + }); + menuOptions.menuItems.push({ divider: true, inset: false }); window.$gz.eventBus.$emit("menu-change", menuOptions); }