Bug 6739: (follow-up) template changes for the bootstrap theme
authorJonathan Druart <jonathan.druart@biblibre.com>
Wed, 15 Jan 2014 10:53:56 +0000 (11:53 +0100)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 5 May 2014 01:55:28 +0000 (01:55 +0000)
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes QA script, t, xt and t/db_dependent/Members*.

Testing notes:
    - Database update
      * Changes to kohastructure match changes done by the updatedatabase
        statement. Feature is activated by default!
      * Ran database update succesfully.
      * Note: Expired patrons are now blocked by default in new
        AND in updated installations.
    - System preference
      * Verified system preference shows up correctly.
    - Category configuration
      * Add new patron category
      * Edit existing patron category
      * Delete patron category
      * Check patron category summary table.
      => Verified all actions work as expected.
      => Verified chosen value for BlockExpiredPatronOpacActions
         is always displayed and saved correctly.
      * Note: The new value is missing from the summary table.
      * Note: The new value is also not shown when deleting a patron
        category.
    - Check functionality
      * Renew and place a hold for an NOT EXPIRED patron with
        a) category: use syspref (default)
           syspref: block  (default)
        b) category: use syspref (default)
           syspref: don't block
        c) category: block
           syspref: don't block
        d) category: block
           syspref: block
        e) category: don't block
           sypref: block
        f) category: don't block
           syspref: don't block
        Holds and renewals were always possible.
      * Also verified that the warning from NotifyBorrowerDeparture
        still shows up correctly.
      * Verified holds and renewals are still blocked, when the
        user has a restriction with a date in the future.
      * Renew and place a hold for an EXPIRED patron with
        a) category: use syspref (default)
           syspref: block  (default)
           Holds and renewals blocked.
        b) category: use syspref (default)
           syspref: don't block
           Holds an renewals possible.
        c) category: block
           syspref: don't block
           Holds and renewals blocked.
        d) category: block
           syspref: block
           Holds and renewals blocked.
        e) category: don't block
           sypref: block
           Holds and renewals possible.
        f) category: don't block
           syspref: don't block
           Holds and renewals possible.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt

index f551584..66fd0c7 100644 (file)
                             <div id="bad_data" class="alert">ERROR: Internal error: incomplete hold request.</div>
                         [% END %]
 
+                        [% IF ( expired_patron ) %]
+                            <div id="expired_patron" class="alert"><strong>Sorry</strong>, you cannot place holds because your library card has expired.</p><p>Please contact your librarian if you wish to renew your card.</div>
+                        [% END %]
+
                     [% ELSE %]
 
                         [% IF ( none_available ) %]
index 95c597c..ffcac2f 100644 (file)
 
                     [% IF ( BORROWER_INF.warnexpired ) %]
                         <div class="alert" id="warnexpired">
-                            <strong>Please note:</strong><span> Your card has expired. Please contact the library for more information.</span>
+                            <strong>Please note: </strong><span>Your account has expired as of [% BORROWER_INF.warnexpired | $KohaDates %]. Please contact the library if you wish to renew your account.</span>
+                        </div>
+                    [% END %]
+
+                    [% IF ( RENEW_ERROR ) %]
+                        <div class="dialog alert">
+                            <strong>Please note:</strong>
+                            <span>
+                                Your account renewal failed because of the following:
+                                [% FOREACH error IN RENEW_ERROR.split('\|') %]
+                                    [% IF error == 'card_expired' %]
+                                        Your account has expired. Please contact the library for more information.
+                                    [% ELSIF error == 'too_many' %]
+                                        You have renewed this item the maximum number of times allowed.
+                                    [% ELSIF error == 'on_reserve' %]
+                                        This item is on hold for another patron.
+                                    [% END %]
+                                [% END %]
+                            </span>
                         </div>
                     [% END %]
 
                                                     <th>Barcode</th>
                                                 [% END %]
                                                     <th>Call No.</th>
-                                                [% IF ( OpacRenewalAllowed ) %]
+                                                [% IF ( OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %]
                                                     <th class="nosort">Renew</th>
                                                 [% END %]
                                                 [% IF ( OPACFinesTab ) %]
                                                     <span class="tdlabel">Call number:</span>
                                                     [% ISSUE.itemcallnumber %]
                                                 </td>
-                                                [% IF ( OpacRenewalAllowed ) %]
+                                                [% IF ( OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %]
                                                     <td class="renew">
                                                     [% IF ( ISSUE.status ) %]
                                                         [% IF ( canrenew ) %]
                                         [% END # /FOREACH ISSUES %]
                                     </tbody>
                                 </table>
-                                [% IF ( canrenew && !userdebarred && OpacRenewalAllowed ) %]
+                                [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %]
                                     <input type="submit" class="btn" value="Renew selected" />
                                 [% END %]
                                 </form>
 
-                                [% IF ( canrenew && !userdebarred && OpacRenewalAllowed ) %]
+                                [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %]
                                 <form id="renewall" action="/cgi-bin/koha/opac-renew.pl" method="post">
                                     <input type="hidden" name="from" value="opac_user" />
                                     <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
         var MSG_CONFIRM_SUSPEND_HOLDS = _("Are you sure you want to suspend all holds?");
         var MSG_CONFIRM_RESUME_HOLDS  = _("Are you sure you want to resume all suspended holds?");
 
-        $(function() {
+        $(document).ready(function(){
             $('#opac-user-views').tabs();
             $(".js-show").show();
             $(".js-hide").hide();
                     e.preventDefault();
                     $("#renewall").submit();
                 });
-                $("#checkoutst caption").append("<div id=\"renewcontrols\"><a id=\"renewselected_link\" href=\"#\">"+_("Renew selected")+"</a> <a id=\"renewall_link\" href=\"#\">"+_("Renew all")+"</a></div>");
+                [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %]
+                    $("#checkoutst caption").append("<div id=\"renewcontrols\"><a id=\"renewselected_link\" href=\"#\">"+_("Renew selected")+"</a> <a id=\"renewall_link\" href=\"#\">"+_("Renew all")+"</a></div>");
+                [% END %]
             [% END %]
+
             $( ".suspend-until" ).datepicker({ minDate: 1 }); // Require that "until date" be in the future
         });
         //]]>