Bug 12904: Force browser to load new javascript files after upgrade
[koha_ffzg] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / categories.tt
index b555505..d8c393f 100644 (file)
@@ -1,22 +1,16 @@
 [% USE Koha %]
 [% USE KohaDates %]
 [% USE Price %]
+[% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Administration &rsaquo; Patron categories &rsaquo; [% IF op == 'add_form' %][% IF ( categorycode ) %]Modify category '[% categorycode |html %]'[% ELSE %]New category[% END %][% END %]
 [% IF op == 'delete_confirm' %][% IF ( patrons_in_category > 0 ) %]Cannot delete: category [% categorycode |html %] in use[% ELSE %]Confirm deletion of category '[% categorycode |html %]'[% END %][% END %]
 </title>
 [% INCLUDE 'doc-head-close.inc' %]
-[% INCLUDE 'calendar.inc' %]
-<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
-[% INCLUDE 'datatables.inc' %]
-<script type="text/javascript">
-    var MSG_CATEGORYCODE_CHARS = _("Category code can only contain the following characters: letters, numbers, - and _.");
-    var MSG_BOTH_ENROLLMENTPERIODS = _("Please choose only one enrollment period setting.");
-    var MSG_ONE_ENROLLMENTPERIOD = ("Please choose an enrollment period in months OR by date.");
-</script>
-<script type="text/javascript" src="[% themelang %]/js/categories.js"></script>
+<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
 <style type="text/css">#enrolmentmessage.hint { display : none; }</style>
 </head>
+
 <body id="admin_categorie" class="admin">
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'patrons-admin-search.inc' %]
                         <ol>
                             <li>
                                 <label for="enrolmentperiod" style="width:6em;">In months: </label>
-                                <input type="text" class="enrollmentperiod" name="enrolmentperiod" id="enrolmentperiod" size="3" maxlength="3" value="[% IF category.enrolmentperiod %][% category.enrolmentperiod %][% END %]" /> months
+                                [% IF category.enrolmentperiod %]
+                                    <input type="text" class="enrollmentperiod" name="enrolmentperiod" id="enrolmentperiod" size="3" maxlength="3" value="[% category.enrolmentperiod %]" /> months
+                               [% ELSE %]
+                                    <input type="text" class="enrollmentperiod" name="enrolmentperiod" id="enrolmentperiod" size="3" maxlength="3" value="" /> months
+                               [% END %]
                             </li>
                             <li>
                                 <label for="enrolmentperioddate" style="width:6em;">Until date: </label>
-                                <input type="text" class="enrollmentperiod" name="enrolmentperioddate" id="enrolmentperioddate" value="[% category.enrolmentperioddate | $KohaDates %]" />
+                                <input type="text" class="enrollmentperiod datepicker" name="enrolmentperioddate" id="enrolmentperioddate" value="[% category.enrolmentperioddate | $KohaDates %]" />
                             </li>
                         </ol>
                     </fieldset>
                         <option value="">All branches</option>
                         [% FOREACH branch IN branches_loop %]
                           [% IF branch.selected %]
-                            <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option>
+                            <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname |html %]</option>
                           [% ELSE %]
-                            <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
+                            <option value="[% branch.branchcode %]">[% branch.branchname |html %]</option>
                           [% END %]
                         [% END %]
                     </select>
                         Choose whether patrons of this category be blocked from public catalog actions such as renewing and placing holds when their cards have expired.
                     </span>
                 </li>
+                [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' )  %]
+                  <li><label for="checkprevcheckout">Check for previous checkouts: </label>
+                      <select name="checkprevcheckout" id="checkprevcheckout">
+                          [% IF category.checkprevcheckout == 'yes' %]
+                          <option value="yes" selected="selected">Yes and try to override system preferences</option>
+                          <option value="no">No and try to override system preferences</option>
+                          <option value="inherit">Inherit from system preferences</option>
+                          [% ELSIF category.checkprevcheckout == 'no' %]
+                          <option value="yes">Yes and try to override system preferences</option>
+                          <option value="no" selected="selected">No and try to override system preferences</option>
+                          <option value="inherit">Inherit from system preferences</option>
+                          [% ELSE %]
+                          <option value="yes">Yes and try to override system preferences</option>
+                          <option value="no">No and try to override system preferences</option>
+                          <option value="inherit" selected="selected">Inherit from system preferences</option>
+                          [% END %]
+                      </select>
+                      <span>
+                          Choose whether patrons of this category by default are reminded if they try to borrow an item they borrowed before.
+                      </span>
+                  </li>
+                [% END %]
                 <li>
                     <label for="default_privacy">Default privacy: </label>
                     <select id="default_privacy" name="default_privacy">
                 <tr><th scope="row">Receives overdue notices: </th><td>[% IF category. overduenoticerequired %]Yes[% ELSE %]No[% END %]</td></tr>
                 <tr><th scope="row">Lost items in staff client</th><td>[% IF category.hidelostitems %]Hidden by default[% ELSE %]Shown[% END %]</td></tr>
                 <tr><th scope="row">Hold fee: </th><td>[% category.reservefee | $Price %]</td></tr>
+
+                [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
+                  <tr>
+                      <th scope="row">Check previous checkouts: </th>
+                      <td>
+                          [% SWITCH category.checkprevcheckout %]
+                          [% CASE 'yes' %]
+                              Yes
+                          [% CASE 'no' %]
+                              No
+                          [% CASE 'inherit' %]
+                              Inherit
+                          [% END %]
+                      </td>
+                  </tr>
+                [% END %]
                 <tr>
                     <th scope="row">Default privacy: </th>
                     <td>
 [% IF op == 'list' %]
 
     <div id="toolbar" class="btn-toolbar">
-        <a class="btn btn-small" id="newcategory" href="/cgi-bin/koha/admin/categories.pl?op=add_form"><i class="fa fa-plus"></i> New category</a>
+        <a class="btn btn-default btn-sm" id="newcategory" href="/cgi-bin/koha/admin/categories.pl?op=add_form"><i class="fa fa-plus"></i> New category</a>
     </div>
 
     <h2>Patron categories</h2>
     [% IF searchfield %]
-        You Searched for [% searchfield %]</span>
+        You Searched for [% searchfield |html %]</span>
     [% END %]
     [% IF categories%]
         <table id="table_categorie">
                     <th scope="col">Messaging</th>
                     [% END %]
                     <th scope="col">Branches limitations</th>
+                    [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
+                    <th scope="col">Check previous checkout?</th>
+                    [% END %]
                     <th scope="col">Default privacy</th>
-                    <th scope="col">&nbsp; </th>
-                    <th scope="col">&nbsp; </th>
+                    <th scope="col">Actions</th>
                 </tr>
             </thead>
             <tbody>
                                 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 %]
                                 No limitation
                             [% END %]
                         </td>
+                        [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
+                          <td>
+                              [% SWITCH category.checkprevcheckout %]
+                              [% CASE 'yes' %]
+                              Yes
+                              [% CASE 'no' %]
+                              No
+                              [% CASE 'inherit' %]
+                              Inherit
+                              [% END %]
+                          </td>
+                        [% END %]
                         <td>
                             [% SWITCH category.default_privacy %]
                             [% CASE 'default' %]
                                 Forever
                             [% END %]
                         </td>
-                        <td class="actions"><a class="btn btn-mini" href="/cgi-bin/koha/admin/categories.pl?op=add_form&amp;categorycode=[% category.categorycode |uri %]"><i class="fa fa-pencil"></i> Edit</a></td>
-                        <td class="actions"><a class="btn btn-mini" href="/cgi-bin/koha/admin/categories.pl?op=delete_confirm&amp;categorycode=[% category.categorycode |uri %]"><i class="fa fa-trash"></i> Delete</a></td>
+                        <td class="actions">
+                            <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/categories.pl?op=add_form&amp;categorycode=[% category.categorycode |uri %]"><i class="fa fa-pencil"></i> Edit</a>
+                            <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/categories.pl?op=delete_confirm&amp;categorycode=[% category.categorycode |uri %]"><i class="fa fa-trash"></i> Delete</a>
+                        </td>
                     </tr>
                 [% END %]
             </tbody>
 [% INCLUDE 'admin-menu.inc' %]
 </div>
 </div>
+
+[% MACRO jsinclude BLOCK %]
+    <script type="text/javascript" src="[% interface %]/[% theme %]/js/admin-menu_[% KOHA_VERSION %].js"></script>
+    [% INCLUDE 'calendar.inc' %]
+    [% INCLUDE 'datatables.inc' %]
+    <script type="text/javascript">
+        var MSG_CATEGORYCODE_CHARS = _("Category code can only contain the following characters: letters, numbers, - and _.");
+        var MSG_ONE_ENROLLMENTPERIOD = ("Please choose an enrollment period in months OR by date.");
+    </script>
+    <script type="text/javascript" src="[% themelang %]/js/categories_[% KOHA_VERSION %].js"></script>
+[% END %]
 [% INCLUDE 'intranet-bottom.inc' %]