Bug 33003: Show the vendor type on vendor detail page
authorKatrin Fischer <katrin.fischer.83@web.de>
Sat, 18 Feb 2023 10:25:04 +0000 (10:25 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Thu, 2 Mar 2023 12:37:42 +0000 (09:37 -0300)
When using an authorised value VENDOR_TYPE for the
vendor type, we should show the AV description
everywhere instead of the code. It already works on
the vendor search, but not on the vendor detail page.
With this patch it will also work there.

To test:
1. Add at least one authorized value in VENDOR_TYPE
   1.1. Go to Administration > Authorized values
   1.2. Search for VENDOR_TYPE
   1.3. Click 'Add'
   1.4. Fill out the form
        - Authorized value: BOOK
        - Description: Print books
   1.5. Click 'Save'
2. Add a new vendor
   2.1. Go to Acquisitions
   2.2. Click 'New vendor'
   2.3. Fill out the form
        - Name: ABC Bookstore
        - Vendor type: Print books
   2.4. Click 'Save'
3. Go to the vendor page
   3.1. Click on the vendor name
   --> The value in "Type" is BOOK, it should be "Print books"
4. Apply patch
   4.1. Repeat test, now it should show the description

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt

index 0a49619..9dd4995 100644 (file)
@@ -1,6 +1,7 @@
 [% USE raw %]
 [% USE Asset %]
 [% USE KohaDates %]
+[% USE AuthorisedValues %]
 [% BLOCK edit_contact %]
     <ol id="contact-form">
         <input type="hidden" name="contact_id" value="[% contact.id | html %]" />
             <div class="col-sm-6">
                 <div id="supplier-company-details" class="page-section">
                     <h2>Vendor details</h2>
-                    <p><span class="label">Type: </span>[% type | html %]</p>
+                    <p>
+                        <span class="label">Type: </span>
+                        [% IF (type) %][% AuthorisedValues.GetByCode( 'VENDOR_TYPE', type ) | html %][% END %]
+                    </p>
                     <p><span class="label">Company name: </span>[% name | html %]</p>
                     <p><span class="label">Postal address: </span>[% postal | html %]</p>
                     <p><span class="label">Physical address: </span>[% address1 | html %][% address2 | html %][% address3 | html %][% address4 | html %]</p>