From a877b7c771c51d052f40f62caae2be760994c0c8 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Thu, 17 Oct 2024 17:47:59 +0100 Subject: [PATCH] Bug 38010: Allow searching by alias in the vendors table --- Koha/Schema/Result/Aqbookseller.pm | 16 ++++++++++++++++ .../js/vue/components/Vendors/VendorDetails.vue | 11 +++++++---- .../js/vue/components/Vendors/VendorList.vue | 2 +- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/Koha/Schema/Result/Aqbookseller.pm b/Koha/Schema/Result/Aqbookseller.pm index d1236a43b0b..52773ec4525 100644 --- a/Koha/Schema/Result/Aqbookseller.pm +++ b/Koha/Schema/Result/Aqbookseller.pm @@ -535,6 +535,22 @@ __PACKAGE__->add_columns( '+invoiceincgst' => { is_boolean => 1 }, ); + +=head2 aliases + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "aliases", + "Koha::Schema::Result::AqbooksellerAlias", + { "foreign.vendor_id" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + sub koha_object_class { 'Koha::Acquisition::Bookseller'; } diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorDetails.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorDetails.vue index 16180944b36..61290372172 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorDetails.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorDetails.vue @@ -60,11 +60,14 @@ {{ vendor.accountnumber }} -
  • +
  • -
      -
    • - {{ alias }} +
        +
      • + {{ $__("Alias") + " " + (i + 1) }}: {{ alias.alias }}
    • diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorList.vue index 5c3d31b8ebc..e28ba15b53e 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorList.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorList.vue @@ -172,7 +172,7 @@ export default { return [ { title: __("Name"), - data: "me.name:me.id", + data: "me.name:aliases.alias:me.id", searchable: true, orderable: true, render(data, type, row, meta) { -- 2.39.3 (Apple Git-146)