Bugzilla – Attachment 175722 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), 7.86 KB, created by
Matt Blenkinsop
on 2024-12-19 12:34:32 UTC
(
hide
)
Description:
Bug 38208: Provide a link from vendors to ERM
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2024-12-19 12:34:32 UTC
Size:
7.86 KB
patch
obsolete
>From 148f7471845a0109cbd9e33a0427809f161359c0 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 >--- > acqui/vendors.pl | 3 ++- > .../prog/en/modules/acqui/vendors.tt | 1 + > .../js/vue/components/ERM/AgreementsList.vue | 7 ++++++ > .../js/vue/components/ERM/LicensesFormAdd.vue | 4 ++-- > .../js/vue/components/ERM/LicensesList.vue | 11 ++++++++- > .../js/vue/components/Islands/VendorMenu.vue | 24 +++++++++++++++++++ > .../prog/js/vue/components/Vendors/Main.vue | 1 + > 7 files changed, 47 insertions(+), 4 deletions(-) > >diff --git a/acqui/vendors.pl b/acqui/vendors.pl >index a160284308c..b9d2628e805 100755 >--- a/acqui/vendors.pl >+++ b/acqui/vendors.pl >@@ -48,7 +48,8 @@ $template->param( > user_permissions => $user_permissions, > currencies => Koha::Acquisition::Currencies->search->unblessed, > gst_values => \@gst_values, >- edifact => C4::Context->preference('EDIFACT') >+ edifact => C4::Context->preference('EDIFACT'), >+ erm_module => C4::Context->preference('ERMModule') > ); > > output_html_with_http_headers $query, $cookie, $template->output; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/vendors.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/vendors.tt >index f71b42881f5..17d350e1a97 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/vendors.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/vendors.tt >@@ -33,6 +33,7 @@ > const currencies = [% To.json(currencies) | $raw %]; > const gstValues = [% To.json(gst_values) | $raw %]; > const edifact = [% To.json(edifact) | $raw %]; >+ const ermModule = [% To.json(erm_module) | $raw %]; > </script> > > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue >index 5484c76d24b..656057276aa 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue >@@ -234,6 +234,13 @@ export default { > if (this.filters.by_expired) > url += > "?max_expiration_date=" + this.filters.max_expiration_date >+ >+ const vendorId = this.$route.query.vendor_id >+ if (vendorId) { >+ url = this.filters.by_expired >+ ? url + "&vendor_id=" + vendorId >+ : url + "?vendor_id=" + vendorId >+ } > return url > }, > filter_table: async function () { >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicensesFormAdd.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicensesFormAdd.vue >index e0e8348142f..c60a15ebc34 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicensesFormAdd.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicensesFormAdd.vue >@@ -152,12 +152,12 @@ import { storeToRefs } from "pinia" > export default { > setup() { > const AVStore = inject("AVStore") >- const { av_license_types, av_license_statuses, av_user_roles } = >+ const { av_license_statuses, av_license_types, av_user_roles } = > storeToRefs(AVStore) > > return { >- av_license_types, > av_license_statuses, >+ av_license_types, > av_user_roles, > max_allowed_packet, > } >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicensesList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicensesList.vue >index 42fbd52d8ad..47fe36b95a4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicensesList.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicensesList.vue >@@ -69,7 +69,7 @@ export default { > searchable_av_options: [], > tableOptions: { > columns: this.getTableColumns(), >- url: this.getResourceTableUrl(), >+ url: this.tableURL(), > options: { embed: "vendor,extended_attributes,+strings" }, > table_settings: this.license_table_settings, > add_filters: true, >@@ -113,6 +113,15 @@ export default { > error => {} > ) > }, >+ tableURL() { >+ let url = this.getResourceTableUrl() >+ >+ const vendorId = this.$route.query.vendor_id >+ if (vendorId) { >+ url += "?vendor_id=" + vendorId >+ } >+ return url >+ }, > async getSearchableAdditionalFields() { > const client = APIClient.additional_fields > await client.additional_fields.getAll("license").then( >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 442723ee39c..254ce58c966 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 >@@ -68,6 +68,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> >@@ -96,22 +107,35 @@ export default { > issuemanage: { > type: String, > }, >+ ermmodule: { >+ type: String, >+ }, >+ erm: { >+ type: String, >+ }, > }, > setup() { > const permissionsStore = inject("permissionsStore") > const { isUserPermitted } = permissionsStore > const navigationStore = inject("navigationStore") > const { params } = storeToRefs(navigationStore) >+ const vendorStore = inject("vendorStore") >+ const { config } = storeToRefs(vendorStore) > > return { > isUserPermitted, > params, >+ config, > } > }, > data() { > const vendorId = this.vendorid ? this.vendorid : this.params.id >+ const ermModule = this.ermmodule >+ ? this.ermmodule >+ : this.config.settings.ermModule > return { > vendorId, >+ ermModule, > } > }, > } >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 e78555857c3..323e0d8d4c8 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 >@@ -99,6 +99,7 @@ export default { > this.loaded() > this.userPermissions = userPermissions > this.config.settings.edifact = edifact >+ this.config.settings.ermModule = ermModule > this.vendorStore.currencies = currencies > this.vendorStore.gstValues = gstValues.map(gv => { > return { >-- >2.39.5 (Apple Git-154)
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