From bfa2a1a148f6ac0c0ace39bebe294d0bcc38aa9a 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 screen and 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 - Confirm the description of VENDOR_TYPE shows and makes sense 8 - Add/Edit a vendor, note the vendor type is now a dropdown selection 9 - Save with a value 10 - Confirm the description shows in results and vendor page and vendor details Signed-off-by: Caroline Signed-off-by: KIT Library Germany Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- 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 | 8 +++++++- .../prog/en/modules/admin/authorised_values.tt | 2 ++ 5 files changed, 13 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..b836a435e5 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 @@ -316,6 +321,7 @@

    Vendor details

    +

    Type: [% vendor_type | html %]

    Company name: [% name | html %]

    Postal address: [% postal | html %]

    Physical address: [% address1 | html %][% address2 | html %][% address3 | html %][% address4 | html %]

    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt index 46653abec4..3f05f5e4a6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt @@ -548,6 +548,8 @@

    Terms to be used in Course Reserves module. Enter terms that will show in the drop down menu when setting up a Course reserve. (For example: Spring, Summer, Winter, Fall).

    [% CASE 'UPLOAD' %]

    Categories to be assigned to file uploads. Without a category an upload is considered temporary and may be removed during automated cleanup.

    + [% CASE 'VENDOR_TYPE' %] +

    Values that can be entered to fill in the 'Vendor type' field in the acquisitions module, that can be used for statistical purposes

    [% CASE 'WITHDRAWN' %]

    Description of a withdrawn item (appears when adding or editing an item)

    [% CASE 'YES_NO' %] -- 2.39.5