Bug 23140: Fix typo in branchcode parameters for print slip
[koha-equinox.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / returns.tt
index 2a06845..46aede9 100644 (file)
     </div>
 [% END %]
 
-[% IF ( wrongbranch ) %]
-    <div class="dialog alert"><h3>Cannot check in</h3>
-        <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">[% itembarcode | html %]: [% title | html %]</a></p>
-        </p><strong>NOT CHECKED IN</strong></p>
-        <p>This item must be checked in at following library: <strong>[% Branches.GetName( rightbranch ) | html %]</strong></p>
+[% IF wrongbranch %]
+    <div id="wrong-branch-modal" class="modal fade audio-alert-action">
+        <div class="modal-dialog">
+            <div class="modal-content">
+                <form method="post" action="returns.pl" name="mainform" id="mainform">
+                    <div class="modal-header">
+                        <h3>
+                            Cannot check in
+                        </h3>
+                    </div>
+                    <div class="modal-body">
+                        <p>
+                        <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">
+                            [% itembarcode | html %]: [% title | html %]
+                        </a>
+                        </p>
+                        <p>
+                            <strong>
+                                NOT CHECKED IN
+                            </strong>
+                        </p>
+                        <p>
+                            This item must be checked in at following library:
+                            <strong>
+                                [% Branches.GetName( rightbranch ) | html %]
+                            </strong>
+                        </p>
+                    </div>
+                    <div class="modal-footer">
+                        <button type="submit" class="btn btn-default approve"><i class="fa fa-check"></i> OK</button>
+                    </div>
+                </form>
+            </div>
+        </div>
     </div>
 [% END %]
 
 <!-- case of a mistake in transfer loop -->
-[% IF ( WrongTransfer ) %]
-    <div id="return2" class="dialog message">
-        <!-- WrongTransfer -->
-        <h3>Please return item to: [% Branches.GetName( TransferWaitingAt ) | html %]</h3>
-            <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">[% itembarcode | html %]: [% title | html %]</a></p>
-        <button type="submit" class="openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber | html %]&amp;&amp;branchcode=[% TransferWaitingAt | html %]&amp;op=slip"><i class="fa fa-print"></i> Print transfer slip</button>
-        <button class="deny" type="submit" onclick="window.location.href='/cgi-bin/koha/circ/returns.pl?itemnumber=[% itemnumber | html %]&amp;canceltransfer=1'"><i class="fa fa-times"></i> Cancel transfer</button>
-[% IF ( patron.cardnumber ) %]<h5>Hold for:</h5>
-        <ul>
-            <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">
-            [% patron.surname | html %], [% patron.firstname | html %]</a> ([% patron.cardnumber | html %]) <span class="patron-category"> - [% patron.category.description | html %]</span> </li>
-            [% INCLUDE display_holdpatron_address %]
-            [% IF ( patron.phone ) %]<li>[% patron.phone | html %]</li>[% END %]
-            [% IF ( patron.email ) %]<li><a id="boremail" href="mailto:[% patron.email | html %]">[% patron.email | html %]</a></li>[% END %]
-        </ul>
-
-    <form method="post" action="returns.pl" class="confirm">
-            <input type="hidden" name="WT-itemNumber" value="[% WrongTransferItem | html %]" />
-            <input type="hidden" name="WT-waitingAt" value="[% TransferWaitingAt | html %]" />
-            <input type="hidden" name="WT-From" value="[% wtransfertFrom | html %]" />
-            <button type="submit" class="approve"><i class="fa fa-check"></i> Confirm</button>
-            <input type="hidden" name="print_slip" value="0" />
-            <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
-            <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
-            <button type="submit" class="print" onclick="this.form.print_slip.value = 1; this.form.submit();"><i class="fa fa-print"></i> Print slip and confirm</button>
-        <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
-        <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
-    </form>
-    [% END %]</div>
+[% IF WrongTransfer && !transfertodo %]
+    <div id="wrong-transfer-modal" class="modal fade audio-alert-action">
+        <div class="modal-dialog">
+            <div class="modal-content">
+                <form method="post" action="returns.pl" name="mainform" id="mainform">
+                    <div class="modal-header">
+                        <h3>
+                            Please return item to: [% Branches.GetName( TransferWaitingAt ) | html %]
+                        </h3>
+                    </div>
+                    <div class="modal-body">
+                        <p>
+                            <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">
+                                [% itembarcode | html %]: [% title | html %]
+                            </a>
+                        </p>
+                    </div>
+                    <div class="modal-footer">
+                        <button type="submit" class="btn btn-default approve"><i class="fa fa-check"></i> OK</button>
+                        <button type="submit" class="btn btn-default print openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber | html %]&amp;&amp;branchcode=[% TransferWaitingAt | html %]&amp;op=slip"><i class="fa fa-print"></i> Print transfer slip</button>
+                        <button class="btn btn-default deny cancel-transfer" type="submit"><i class="fa fa-times"></i> Cancel transfer</button>
+                        <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
+                        <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
+                    </div>
+                </form>
+            </div>
+        </div>
+    </div>
 [% END %]
 
 [% IF ( found ) %]
                     </button>
 
                     <input type="hidden" name="print_slip" value="0" />
-                    <button type="submit" class="btn btn-default print" onclick="this.form.print_slip.value = 1; this.form.submit();">
+                    <button type="submit" class="btn btn-default print">
                         <i class="fa fa-print"></i> Print slip and confirm
                     </button>
 
-                    <button type="submit" class="btn btn-default deny" onclick="this.form.cancel_reserve.value = 1; this.form.submit();">
+                    <button type="submit" class="btn btn-default deny cancel-hold">
                         <i class="fa fa-times"></i> Cancel hold
                     </button>
                 </div>
             <input type="hidden" name="print_slip" value="0" />
             <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
             <input type="hidden" name="biblionumber" value="[% itembiblionumber | html %]" />
-            <button type="submit" class="print" onclick="this.form.print_slip.value = 1; this.form.submit();"><i class="fa fa-print"></i> Print slip and continue</button>
+            <button type="submit" class="print"><i class="fa fa-print"></i> Print slip and continue</button>
             [% FOREACH inputloo IN inputloop %]
                 <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
                 <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
                </div>
     [% END %]
 
-    [% IF ( transfer ) %]
-    <!-- transfer: item with no reservation, must be returned according to home library circulation rules -->
-        <div id="return1" class="dialog message audio-alert-action">
-            <h3>Please return item to: [% Branches.GetName( returnbranch ) | html %]</h3>
-            <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">[% itembarcode | html %]: [% title | html %]</a></p>
-            <p><button type="button" class="openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber | html %]&amp;branchcode=[% returnbranch | html %]&amp;op=slip"><i class="fa fa-print"></i> Print slip</button></p>
+    [% IF transfer || needstransfer %]
+    <div id="item-transfer-modal" class="modal fade audio-alert-action">
+        <div class="modal-dialog">
+            <div class="modal-content">
+                <form method="post" action="returns.pl" name="mainform" id="mainform">
+                    <div class="modal-header">
+                        <h3>
+                            Please return this item to [% Branches.GetName( returnbranch ) | html %]
+                        </h3>
+                    </div>
+                    <div class="modal-body">
+                        <p>
+                        <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">
+                            [% itembarcode | html %]: [% title | html %]
+                        </a>
+                        </p>
+                        [% IF !transfer %]
+                        <p>
+                        Transfer now?
+                        </p>
+                        [% END %]
+                        <input type="hidden" name="tobranch" value="[% returnbranch | html %]" />
+                        <input type="hidden" name="transferitem" value="[% itemnumber | html %]" />
+                        <input type="hidden" name="barcode" value="0" />
+                    </div>
+                    <div class="modal-footer">
+                        [% IF !transfer %]
+                        <button type="submit" name="dotransfer" value="Yes" class="btn btn-default approve"><i class="fa fa-check"></i> Yes</button>
+                        <button type="submit" name="dotransfer" value="Yes" class="btn btn-default print openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber | html %]&amp;&amp;branchcode=[% returnbranch | html %]&amp;op=slip"><i class="fa fa-print"></i> Yes, print slip</button><button type="submit" class="btn btn-default deny" name="notransfer" value="No"><i class="fa fa-times"></i> No</button>
+                        [% ELSE %]
+                        <button type="submit" class="btn btn-default approve"><i class="fa fa-check"></i> OK</button>
+                        <button type="submit" name="dotransfer" value="Yes" class="btn btn-default print openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber | html %]&amp;&amp;branchcode=[% returnbranch | html %]&amp;op=slip"><i class="fa fa-print"></i> Print slip</button>
+                        [% END %]
+                        <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
+                        <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
+                        <input type="hidden" name="exemptfine" value="[% exemptfine | html %]" />
+                        <input type="hidden" name="dropboxmode" value="[% dropboxmode | html %]" />
+                        <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire | html %]" />
+                        [% FOREACH inputloo IN inputloop %]
+                        <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
+                        <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
+                        <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
+                        [% END %]
+                    </div>
+                </form>
+            </div>
         </div>
-    [% END %]
-
-    [% IF ( needstransfer ) %]
-       <!-- needstransfer -->
-    <div id="item-transfer" class="dialog message audio-alert-action"><h3> This item needs to be transferred to [% Branches.GetName( returnbranch ) | html %]</h3>
-    Transfer now?<br />
-    <form method="post" action="returns.pl" name="mainform" id="mainform">
-    [% IF itemnumber %]
-        <button type="submit" name="dotransfer" value="Yes" class="print openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber | html %]&amp;&amp;branchcode=[% returnbranch | html %]&amp;op=slip"><i class="fa fa-print"></i> Yes, print slip</button>
-    [% END %]
-    <button type="submit" name="dotransfer" value="Yes" class="submit"><i class="fa fa-check"></i> Yes</button>
-    <button type="submit" name="notransfer" value="No" class="submit"><i class="fa fa-times"></i> No</button>
-    <input type="hidden" name="tobranch" value="[% returnbranch | html %]" />
-       <input type="hidden" name="transferitem" value="[% itemnumber | html %]" />
-        <input type="hidden" name="exemptfine" value="[% exemptfine | html %]" />
-        <input type="hidden" name="dropboxmode" value="[% dropboxmode | html %]" />
-        <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire | html %]" />
-       [% FOREACH inputloo IN inputloop %]
-       <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
-       <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
-       <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
-       [% END %]
-       <input type="hidden" name="barcode" value="0" />
-        <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
-        <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
-       </form>   </div>
+    </div>
     [% END %]
 
     [% IF ( diffbranch ) %]
                         <button type="submit" class="btn btn-default approve">
                             <i class="fa fa-check"></i> Confirm hold and transfer
                         </button>
-                        <button type="submit" class="btn btn-default print" onclick="this.form.print_slip.value = 1; this.form.submit()">
+                        <button type="submit" class="btn btn-default print">
                             <i class="fa fa-print"></i> Print slip, transfer, and confirm
                         </button>
                     [% ELSE %]
                         <button type="submit" class="btn btn-default approve">
                             <i class="fa fa-check"></i> Confirm hold
                         </button>
-                        <button type="submit" class="btn btn-default print" onclick="this.form.print_slip.value = 1; this.form.submit();">
+                        <button type="submit" class="btn btn-default print">
                             <i class="fa fa-print"></i> Print slip and confirm
                         </button>
                     [% END %]
 
-                    <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-default deny" onclick="$('#barcode').focus(); return false;">
+                    <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-default deny">
                         <i class="fa fa-times"></i> Ignore
                     </button>
                 </div>
                     [% END %]
                 </p>
             [% END %]
+            [% IF ( errmsgloo.ItemLocationUpdated ) %]
+                 <p class="problem">
+                     Item shelving location updated.
+                    <br />Old value:
+                    [% IF errmsgloo.ItemLocationUpdated.from %]
+                        [% IF errmsgloo.ItemLocationUpdated.from == '' %]
+                            empty
+                        [% ELSIF AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.from ) == '' %]
+                            [% errmsgloo.ItemLocationUpdated.from | html %] (No description available)
+                        [% ELSE %]
+                            [% AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.from ) | html %]
+                        [% END %]
+                    [% ELSE %]
+                        "Blank"
+                    [% END %]
+                    <br />New value:
+                    [% IF errmsgloo.ItemLocationUpdated.to %]
+                        [% IF errmsgloo.ItemLocationUpdated.to == '' %]
+                            empty
+                        [% ELSIF AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.to ) == '' %]
+                            [% errmsgloo.ItemLocationUpdated.to | html %] (Not an authorized value)
+                        [% ELSE %]
+                            [% AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.to ) | html %]
+                        [% END %]
+                    [% ELSE %]
+                        "Blank"
+                    [% END %]
+                 </p>
+            [% END %]
             [% IF ( errmsgloo.badbarcode ) %]
                 <p class="problem">No item with barcode: [% errmsgloo.msg | html %]</p>
             [% END %]
                 [% ELSE %]
                     <p class="problem">Item was lost, now found.</p>
                 [% END %]
-
                 [% IF LostItemFeeRefunded and not Koha.Preference('BlockReturnOfLostItems') %]
                     <p class="problem">A refund has been applied to the borrowing patron's account.</p>
                 [% ELSIF Koha.Preference('BlockReturnOfLostItems') %]
         <p>Fines are not charged for manually cancelled holds.</p>
     </div>
     <div id="dropboxmode" class="dialog message" style="display:none;">
-        <p>Book drop mode.  (Effective checkin date is [% dropboxdate | html %] ).</p>
+        <p>Book drop mode.  (Effective checkin date is [% dropboxdate | $KohaDates %] ).</p>
     </div>
 
 <div class="row">
 
                     <label for="return_date_override_remember"> Remember for next check in:</label>
                     [% IF ( return_date_override_remember ) %]
-                        <input type="checkbox" id="return_date_override_remember" onclick="this.form.barcode.focus();" name="return_date_override_remember" checked="checked" />
+                        <input type="checkbox" id="return_date_override_remember" name="return_date_override_remember" checked="checked" />
                     [% ELSE %]
-                        <input type="checkbox" id="return_date_override_remember" onclick="this.form.barcode.focus();" name="return_date_override_remember" />
+                        <input type="checkbox" id="return_date_override_remember" name="return_date_override_remember" />
                     [% END %]
 
-                    <input type="button" class="action" id="cleardate" value="Clear" name="cleardate" onclick="this.checked = false; this.form.return_date_override.value = ''; this.form.return_date_override_remember.checked = false; this.form.barcode.focus(); return false;" />
+                    <input type="button" class="action" id="cleardate" value="Clear" name="cleardate" />
             </div>
         [% END %]
             [% FOREACH inputloo IN inputloop %]
             $('.openWin').on("click",function(e){
                 Dopop( $(this).data("url") );
             });
+
+            $('.print').on("click",function(e){
+                this.form.print_slip.value = 1;
+                this.form.submit();
+            });
+
+            $('.cancel-hold').on("click",function(e){
+                this.form.cancel_reserve.value = 1;
+                this.form.submit();
+            });
+
+            $('.cancel-transfer').on("click",function(e){
+                window.location.href='/cgi-bin/koha/circ/returns.pl?itemnumber=[% itemnumber | html %]&amp;canceltransfer=1'
+            });
+
+            $('.action').on("click",function(e){
+                this.checked = false;
+                this.form.return_date_override.value = '';
+                this.form.return_date_override_remember.checked = false;
+                this.form.barcode.focus();
+                return false;
+            });
         });
     </script>
 [% END %]