Bug 5786 - Move AllowOnShelfHolds and OPACItemHolds system prefs to the Circulation...
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / smart-rules.tt
index a029443..2f7ec7e 100644 (file)
@@ -6,7 +6,7 @@
 //<![CDATA[
 
 function clear_edit(){
-    var cancel = confirm(_("Are you sure you want to lost your changes?"));
+    var cancel = confirm(_("Are you sure you want to cancel your changes?"));
     if ( !cancel ) return;
     $('#default-circulation-rules td').removeClass('highlighted-row');
     var edit_row = $("#edit_row");
@@ -42,7 +42,9 @@ $(document).ready(function() {
                     $(current_column).find("input[type='text']").val(itm);
                     // select the corresponding option
                     $(current_column).find("select option").each(function(){
-                        if ( $(this).text().toLowerCase() == itm.toLowerCase() ) {
+                        opt = $(this).text().toLowerCase();
+                        opt = opt.replace(/^\s*|\s*$/g,'');
+                        if ( opt == itm.toLowerCase() ) {
                             $(this).attr('selected', 'selected');
                         }
                     });
@@ -133,7 +135,7 @@ for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde
 
         <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
             <input type="hidden" name="op" value="add" />
-            <input type="hidden" name="branch" value="[% branch %]"/>
+            <input type="hidden" name="branch" value="[% current_branch %]"/>
             <table id="default-circulation-rules">
             <thead>
             <tr>
@@ -146,21 +148,23 @@ for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde
                 <th>Fine amount</th>
                 <th>Fine charging interval</th>
                 <th>Fine grace period (day)</th>
-                <th>Overdue Fines Cap ($)</th>
+                <th>Overdue fines cap (amount)</th>
                 <th>Suspension in days (day)</th>
+                <th>Max. suspension duration (day)</th>
                 <th>Renewals allowed (count)</th>
+                <th>Renewal period</th>
+                <th>No renewal before</th>
+                <th>Automatic renewal</th>
                 <th>Holds allowed (count)</th>
+                <th>On shelf holds allowed</th>
+                <th>Item level holds</th>
                 <th>Rental discount (%)</th>
                 <th colspan="2">&nbsp;</th>
             </tr>
             </thead>
             <tbody>
                                [% FOREACH rule IN rules %]
-                                       [% UNLESS ( loop.odd ) %]
-                                       <tr class="highlight" id="row_[% loop.count %]">
-                                       [% ELSE %]
                                        <tr id="row_[% loop.count %]">
-                                       [% END %]
                                                        <td>[% IF ( rule.default_humancategorycode ) %]
                                                                        <em>All</em>
                                                                [% ELSE %]
@@ -204,8 +208,20 @@ for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde
                                                        <td>[% rule.firstremind %]</td>
                             <td>[% rule.overduefinescap FILTER format("%.2f") %]</td>
                                                        <td>[% rule.finedays %]</td>
+                            <td>[% rule.maxsuspensiondays %]</td>
                                                        <td>[% rule.renewalsallowed %]</td>
+                            <td>[% rule.renewalperiod %]</td>
+                            <td>[% rule.norenewalbefore %]</td>
+                            <td>
+                                [% IF ( rule.auto_renew ) %]
+                                Yes
+                                [% ELSE %]
+                                No
+                                [% END %]
+                            </td>
                                                        <td>[% rule.reservesallowed %]</td>
+                                                        <td>[% IF rule.onshelfholds %]Yes[% ELSE %]No[% END %]</td>
+                                                        <td>[% IF rule.opacitemholds == 'F'%]Enforce[% ELSIF rule.opacitemholds == 'Y'%]Allow[% ELSE %]Don't allow[% END %]</td>
                                                        <td>[% rule.rentaldiscount %]</td>
                             <td><a href="#" class="editrule">Edit</a></td>
                                                        <td>
@@ -234,7 +250,7 @@ for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde
                     <td><input type="text" name="issuelength" id="issuelength" size="3" /> </td>
                     <td>
                       <select name="lengthunit" id="lengthunit">
-                        <option value="days" selected>Days</option>
+                        <option value="days" selected="selected">Days</option>
                         <option value="hours">Hours</option>
                       </select>
                     </td>
@@ -252,8 +268,30 @@ for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde
                     <td><input type="text" name="firstremind" id="firstremind" size="2" /> </td>
                     <td><input type="text" name="overduefinescap" id="overduefinescap" size="6" /> </td>
                     <td><input type="text" name="finedays" id="fined" size="3" /> </td>
+                    <td><input type="text" name="maxsuspensiondays" id="maxsuspensiondays" size="3" /> </td>
                     <td><input type="text" name="renewalsallowed" id="renewalsallowed" size="2" /></td>
+                    <td><input type="text" name="renewalperiod" id="renewalperiod" size="3" /></td>
+                    <td><input type="text" name="norenewalbefore" id="norenewalbefore" size="3" /></td>
+                    <td>
+                        <select name="auto_renew" id="auto_renew">
+                            <option value="no" selected>No</option>
+                            <option value="yes">Yes</option>
+                        </select>
+                    </td>
                     <td><input type="text" name="reservesallowed" id="reservesallowed" size="2" /></td>
+                    <td>
+                        <select name="onshelfholds" id="onshelfholds">
+                            <option value="0" selected>No</option>
+                            <option value="1">Yes</option>
+                        </select>
+                    </td>
+                    <td>
+                        <select id="opacitemholds" name="opacitemholds">
+                            <option value="N">Don't allow</option>
+                            <option value="Y">Allow</option>
+                            <option value="F">Enforce</option>
+                        </select>
+                    </td>
                     <td><input type="text" name="rentaldiscount" id="rentaldiscount" size="2" /></td>
                     <td colspan="2">
                         <input type="hidden" name="branch" value="[% current_branch %]"/>