Bug 22624: Show OPAC description for authorised values in OPAC
authorKatrin Fischer <katrin.fischer.83@web.de>
Mon, 1 Apr 2019 19:15:18 +0000 (19:15 +0000)
committerLucas Gass <lucas@bywatersolutions.com>
Wed, 17 Apr 2019 21:20:06 +0000 (21:20 +0000)
Patch adds the IS_OPAC parameter to a few GetByCode calls in
OPAC files.

To test:
- Add different OPAC and intranet descriptions to some authorised
  value categories:
  - TERM
  - DEPARTMENT
  - LOC
  - CCODE
- Create a new course using the values and adding items to it
- Check the course reserves overview and detail pages in OPAC
- Verify Department, term, location, and collection show
  the OPAC description if existing
- Create a subscription, make sure a default location is selected
- Check the OPAC detail page, subscription tab for this subsription
  in the OPAC
- Verify the location of the subscription displays correctly

Signed-off-by: Mikaƫl Olangcay Brisebois <mikael.olangcay-brisebois@inLibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3323a428eaf662a0ba1a31b2cb56002a7372461a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 764260ded4f350904c548422defb74d32581f65e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-reserves.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt

index f0f605b..6047d1a 100644 (file)
                 <h2>Course reserves for <i>[% course.course_name %]</i></h2>
                 <div class="rows">
                     <ol>
-                        [% IF ( course.term ) %]<li><span class="label">Term:</span> [% AuthorisedValues.GetByCode( 'TERM', course.term ) %]</li>[% END %]
-                        <li><span class="label">Department:</span> [% AuthorisedValues.GetByCode( 'DEPARTMENT', course.department ) %]</li>
-                        [% IF ( course.course_number ) %]<li><span class="label">Course number:</span> [% course.course_number %]</li>[% END %]
-                        [% IF ( course.section ) %]<li><span class="label">Section:</span> [% course.section %]</li>[% END %]
+                        [% IF ( course.term ) %]<li><span class="label">Term:</span> [% AuthorisedValues.GetByCode( 'TERM', course.term, 1 ) | html %]</li>[% END %]
+                        <li><span class="label">Department:</span> [% AuthorisedValues.GetByCode( 'DEPARTMENT', course.department, 1 ) | html %]</li>
+                        [% IF ( course.course_number ) %]<li><span class="label">Course number:</span> [% course.course_number | html %]</li>[% END %]
+                        [% IF ( course.section ) %]<li><span class="label">Section:</span> [% course.section | html %]</li>[% END %]
                         [% IF ( course.instructors ) %]
                             <li><span class="label">Instructors:</span>
                                 <ul>
                         <tbody>
                             [% FOREACH cr IN course_reserves %]
                                 <tr>
-                                    <td><a href="opac-detail.pl?biblionumber=[% cr.biblio.biblionumber %]">[% cr.biblio.title %]</a></td>
-                                    <td>[% cr.biblio.author %]</td>
-                                    <td>[% ItemTypes.GetDescription( cr.item.itype ) %]</td>
-                                    <td>[% Branches.GetName( cr.item.holdingbranch ) %] <br/> <i>[% AuthorisedValues.GetByCode( 'LOC', cr.item.location ) %]</i></td>
-                                    <td>[% AuthorisedValues.GetByCode( 'CCODE', cr.item.ccode ) %]</td>
-                                    <td>[% cr.item.itemcallnumber %]</td>
-                                    <td>[% cr.item.copynumber %]</td>
+                                    <td><a href="opac-detail.pl?biblionumber=[% cr.biblio.biblionumber | uri %]">[% cr.biblio.title | html %]</a></td>
+                                    <td>[% cr.biblio.author | html %]</td>
+                                    <td>[% ItemTypes.GetDescription( cr.item.itype ) | html %]</td>
+                                    <td>[% Branches.GetName( cr.item.holdingbranch ) | html %] <br/> <i>[% AuthorisedValues.GetByCode( 'LOC', cr.item.location, 1 ) | html %]</i></td>
+                                    <td>[% AuthorisedValues.GetByCode( 'CCODE', cr.item.ccode, 1 ) | html %]</td>
+                                    <td>[% cr.item.itemcallnumber | html %]</td>
+                                    <td>[% cr.item.copynumber | html %]</td>
                                     <td>[% INCLUDE 'item-status.inc' item=cr.item issue=cr.issue %]</td>
                                     <td><span title="[% cr.issue.date_due %]">[% cr.issue.date_due | $KohaDates as_due_date => 1 %]</span></td>
                                     <td>[% IF ( cr.public_note ) %]
index 87bf658..0bb1b16 100644 (file)
                         <tbody>
                             [% FOREACH c IN courses %]
                                 <tr>
-                                    <td><a href="opac-course-details.pl?course_id=[% c.course_id %]">[% c.course_name %]</a></td>
-                                    <td>[% AuthorisedValues.GetByCode( 'DEPARTMENT', c.department, 1 ) %]</td>
-                                    <td>[% c.course_number %]</td>
-                                    <td>[% c.section %]</td>
-                                    <td>[% AuthorisedValues.GetByCode( 'TERM' c.term ) %]</td>
+                                    <td><a href="opac-course-details.pl?course_id=[% c.course_id | uri %]">[% c.course_name | html %]</a></td>
+                                    <td>[% AuthorisedValues.GetByCode( 'DEPARTMENT', c.department, 1 ) | html %]</td>
+                                    <td>[% c.course_number | html %]</td>
+                                    <td>[% c.section | html %]</td>
+                                    <td>[% AuthorisedValues.GetByCode( 'TERM' c.term, 1 ) | html %]</td>
                                     <td>
                                       [% FOREACH i IN c.instructors %]
                                           <div class="instructor"><span class"inst_surname">[% i.surname %]</span>[% IF i.firstname %]<span class="instr_separator">, </span><span class="instr_firstname">[% i.firstname %]</span>[% END %]</div>
index 7ed04f6..68746d4 100644 (file)
                                 [% FOREACH r IN ITEM_RESULT.course_reserves %]
                                     [% IF r.course.enabled == 'yes' %]
                                         <p>
-                                            <a href="opac-course-details.pl?course_id=[% r.course.course_id %]">
-                                            [% r.course.course_name %]
-                                            <!--[% IF r.course.course_number %] [% r.course.course_number %] [% END %]-->
-                                            [% IF r.course.section %] [% r.course.section %] [% END %]
-                                            [% IF r.course.term %] [% AuthorisedValues.GetByCode( 'TERM', r.course.term ) %] [% END %]
+                                            <a href="opac-course-details.pl?course_id=[% r.course.course_id | uri %]">
+                                            [% r.course.course_name | html %]
+                                            <!--[% IF r.course.course_number %] [% r.course.course_number | html %] [% END %]-->
+                                            [% IF r.course.section %] [% r.course.section | html %] [% END %]
+                                            [% IF r.course.term %] [% AuthorisedValues.GetByCode( 'TERM', r.course.term, 1 ) | html %] [% END %]
                                             </a>
                                         </p>
                                     [% END %]