Bug 18375: Better readability of patron category table for zero ages and fees
authorMarc Véron <veron@veron.ch>
Tue, 4 Apr 2017 11:03:04 +0000 (13:03 +0200)
committerKyle M Hall <kyle@bywatersolutions.com>
Thu, 13 Apr 2017 12:52:08 +0000 (08:52 -0400)
In patron category table, this patch displays zero / empty values for ages and
fees with '-' for better readability

To test:
- Go to Home > Administration > Patron categories
- Verify that you have 0 years and/or only years in Age required and Uper age limit colums
- Verify that you have Enrollment and Hold fees of 0.00
- Apply patch
- Verify that such values are replaced by - to enhance table readability

Signed-off-by: Luke Honiss <luke.honiss@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt

index b28b634..2c2863b 100644 (file)
                                 until [% category.enrolmentperioddate | $KohaDates %]
                             [% END %]
                         </td>
-                        <td>[% category.dateofbirthrequired %] years</td>
-                        <td>[% category.upperagelimit %] years</td>
-                        <td>[% category.enrolmentfee | $Price %]</td>
+                        [% IF (category.dateofbirthrequired) %]
+                            <td>[% category.dateofbirthrequired %] years</td>
+                        [% ELSE %]
+                            <td>-</td>
+                        [% END %]
+                        [% IF (category.upperagelimit) %]
+                            <td>[% category.upperagelimit %] years</td>
+                        [% ELSE %]
+                            <td>-</td>
+                        [% END %]
+                        [% IF (category.enrolmentfee > 0) %]
+                            <td>[% category.enrolmentfee | $Price %]</td>
+                        [% ELSE %]
+                            <td>-</td>
+                        [% END %]
                         <td>[% IF ( category.overduenoticerequired ) %]Yes[% ELSE %]No[% END %]</td>
                         <td>[% IF ( category.hidelostitems ) %]Hidden[% ELSE %]Shown[% END %]</td>
-                        <td>[% category.reservefee | $Price %]</td>
+                        [% IF (category.reservefee > 0) %]
+                            <td>[% category.reservefee | $Price %]</td>
+                        [% ELSE %]
+                            <td>-</td>
+                        [% END %]
                         [% IF Koha.Preference('EnhancedMessagingPreferences') %]
                             <td style="white-space: nowrap; font-size:80%;">
                                 [% SET default_messaging = category.default_messaging %]