Bugzilla – Attachment 188410 Details for
Bug 38208
Provide a link to ERM agreements and licenses from a vendor record
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38208: Provide a link from vendors to ERM
Bug-38208-Provide-a-link-from-vendors-to-ERM.patch (text/plain), 6.90 KB, created by
Matt Blenkinsop
on 2025-10-24 14:49:31 UTC
(
hide
)
Description:
Bug 38208: Provide a link from vendors to ERM
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2025-10-24 14:49:31 UTC
Size:
6.90 KB
patch
obsolete
>From 93db893bc4eb1324ee96b48ed305a1da688621b4 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Fri, 18 Oct 2024 14:18:23 +0000 >Subject: [PATCH] Bug 38208: Provide a link from vendors to ERM > >This patch provides a link in the left hand menu so that from a vendor record you can access ERM agreements and licenses relevant to that vendor > >Test plan: >1) Apply patch and reset_all >2) Navigate to ERM and create some agreements and licenses that link to a vendor and some that don't >3) Navigate to a vendor record >4) There should be links in the left hand menu for agreements and licenses >5) Click on these and you should be taken to ERM and see a filtered table based on that vendor > >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com> >--- > Koha/REST/V1/Acquisitions/Vendors.pm | 1 + > .../swagger/definitions/vendors_config.yaml | 3 +++ > .../vue/components/ERM/AgreementResource.vue | 6 +++++ > .../js/vue/components/ERM/LicenseResource.vue | 11 ++++++++- > .../js/vue/components/Islands/VendorMenu.vue | 24 ++++++++++++++++++- > .../prog/js/vue/components/Vendors/Main.vue | 1 + > 6 files changed, 44 insertions(+), 2 deletions(-) > >diff --git a/Koha/REST/V1/Acquisitions/Vendors.pm b/Koha/REST/V1/Acquisitions/Vendors.pm >index e0ec5c8fe90..8196bafc30a 100644 >--- a/Koha/REST/V1/Acquisitions/Vendors.pm >+++ b/Koha/REST/V1/Acquisitions/Vendors.pm >@@ -216,6 +216,7 @@ sub config { > gst_values => \@gst_values, > edifact => C4::Context->preference('EDIFACT'), > marc_orders => C4::Context->preference('MarcOrderingAutomation'), >+ erm_module => C4::Context->preference('ERMModule'), > }, > ); > } >diff --git a/api/v1/swagger/definitions/vendors_config.yaml b/api/v1/swagger/definitions/vendors_config.yaml >index 7e7819a95e1..776b346a82d 100644 >--- a/api/v1/swagger/definitions/vendors_config.yaml >+++ b/api/v1/swagger/definitions/vendors_config.yaml >@@ -16,4 +16,7 @@ properties: > marc_orders: > type: boolean > description: MarcOrderingAutomation system preference value >+ erm_module: >+ type: boolean >+ description: ERMModule system preference value > additionalProperties: false >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementResource.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementResource.vue >index e3b26a33094..a1075e8a866 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementResource.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementResource.vue >@@ -831,6 +831,12 @@ export default { > let url = baseResource.getResourceTableUrl(); > if (filters?.by_expired) > url += "?max_expiration_date=" + filters.max_expiration_date; >+ const vendorId = baseResource.route.query.vendor_id; >+ if (vendorId) { >+ url = filters?.by_expired >+ ? url + "&vendor_id=" + vendorId >+ : url + "?vendor_id=" + vendorId; >+ } > return url; > }; > const filterTable = async (filters, table, embedded = false) => { >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicenseResource.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicenseResource.vue >index f21b4523aec..34396cd13f1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicenseResource.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicenseResource.vue >@@ -288,9 +288,18 @@ export default { > }, > ], > }); >+ const tableURL = () => { >+ let url = baseResource.getResourceTableUrl(); >+ >+ const vendorId = baseResource.route.query.vendor_id; >+ if (vendorId) { >+ url += "?vendor_id=" + vendorId; >+ } >+ return url; >+ }; > > const tableOptions = { >- url: baseResource.getResourceTableUrl(), >+ url: tableURL(), > options: { embed: "vendor,extended_attributes,+strings" }, > table_settings: license_table_settings, > add_filters: true, >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Islands/VendorMenu.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Islands/VendorMenu.vue >index 73b6bb4d76e..b2db2a84fea 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Islands/VendorMenu.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Islands/VendorMenu.vue >@@ -75,6 +75,17 @@ > >{{ $__("Uncertain prices") }}</a > > > </li> >+ <li v-if="ermModule && (erm || isUserPermitted('CAN_user_erm'))"> >+ <a >+ :href="`/cgi-bin/koha/erm/agreements?vendor_id=${vendorId}`" >+ >{{ $__("ERM agreements") }}</a >+ > >+ </li> >+ <li v-if="ermModule && (erm || isUserPermitted('CAN_user_erm'))"> >+ <a :href="`/cgi-bin/koha/erm/licenses?vendor_id=${vendorId}`">{{ >+ $__("ERM licenses") >+ }}</a> >+ </li> > </ul> > </div> > </template> >@@ -103,14 +114,23 @@ export default { > issuemanage: { > type: String, > }, >+ ermmodule: { >+ type: String, >+ }, >+ erm: { >+ type: String, >+ }, > }, > setup(props) { > const vendorStore = inject("vendorStore"); >- const { isUserPermitted } = vendorStore; >+ const { isUserPermitted, config } = vendorStore; > const navigationStore = inject("navigationStore"); > const { params } = storeToRefs(navigationStore); > > const vendorId = ref(props.vendorid || params.value.id); >+ const ermModule = props.ermmodule >+ ? props.ermmodule >+ : config.settings.ermModule; > const templateRefs = ref([]); > > onMounted(() => { >@@ -123,6 +143,8 @@ export default { > return { > isUserPermitted, > params, >+ config, >+ ermModule, > vendorId, > templateRefs, > }; >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/Main.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/Main.vue >index 647cf6bce25..796b521d555 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/Main.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/Main.vue >@@ -55,6 +55,7 @@ export default { > client.config.get("vendors").then(result => { > userPermissions.value = result.permissions; > config.value.settings.edifact = result.edifact; >+ config.value.settings.ermModule = result.erm_module; > config.value.settings.marcOrderAutomation = > result.marcOrderAutomation; > vendorStore.currencies = result.currencies; >-- >2.50.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 38208
:
175138
|
175139
|
175722
|
182601
|
182682
|
185490
|
188409
| 188410