From 8d8dd560f2faa964441a73cde836e750537becb9 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 23 Jun 2022 10:58:31 +0000 Subject: [PATCH] Bug 31017: Add new vendor_type field to edit screena dn display This patch adds a new vendor_type field when creating/editing vendors and displays the field on search and details for a vendor To test: 1 - Apply patch, update database 2 - Edit/create a vendor in acquisitions 3 - Note new 'Vendor type' field, free text in editor 4 - Save a value 5 - Confirm it displays in vendor search results and vendor main page 6 - In Authorised values add a new value to 'VENDOR_TYPE' category 7 - Add/Edit a vendor, note the vendor type is now a dropdown selection 8 - Save with a value 9 - Confirm the description shows in results and vendor page --- acqui/booksellers.pl | 1 + acqui/updatesupplier.pl | 1 + .../intranet-tmpl/prog/en/modules/acqui/booksellers.tt | 2 ++ koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt | 7 ++++++- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/acqui/booksellers.pl b/acqui/booksellers.pl index f2a7f56b1f..83076b44ee 100755 --- a/acqui/booksellers.pl +++ b/acqui/booksellers.pl @@ -150,6 +150,7 @@ for my $vendor (@suppliers) { booksellerid => $vendor->id, name => $vendor->name, active => $vendor->active, + vendor_type => $vendor->vendor_type, basketcount => $vendor->baskets->count, subscriptioncount => $vendor->subscriptions->count, }; diff --git a/acqui/updatesupplier.pl b/acqui/updatesupplier.pl index b195c88fb6..5d1114df83 100755 --- a/acqui/updatesupplier.pl +++ b/acqui/updatesupplier.pl @@ -76,6 +76,7 @@ $data{'address3'}=$addresses[2]; $data{'address4'}=$addresses[3]; $data{'phone'}=$input->param('company_phone'); $data{'accountnumber'}=$input->param('accountnumber'); +$data{'vendor_type'}=$input->param('vendor_type'); $data{'fax'}=$input->param('company_fax'); $data{'url'}=$input->param('website'); # warn "".$data{'contnotes'}; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt index c1e5fc8af0..1ef745795c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt @@ -1,6 +1,7 @@ [% PROCESS 'i18n.inc' %] [% USE raw %] [% USE Asset %] +[% USE AuthorisedValues %] [% USE KohaDates %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] @@ -86,6 +87,7 @@ [% END %] + [% IF (supplier.vendor_type) %]([% AuthorisedValues.GetByCode( 'VENDOR_TYPE', supplier.vendor_type ) | html %])[% END %] [% IF ( !supplier.active ) %](inactive)[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt index 1ccc71b4ce..37b6f3c4c8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt @@ -172,7 +172,12 @@
  • -
  • + +
  • + + [% PROCESS 'av-build-dropbox.inc' name="vendor_type", category="VENDOR_TYPE", default=vendor_type, empty=1, size = 20 %] +
  • +
    Contacts -- 2.30.2