https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41124

Kendall Purser <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]
                URL|                            |https://github.com/orwek/Ko
                   |                            |ha-Bits/blob/main/IntranetU
                   |                            |serJS.js#L92

--- Comment #1 from Kendall Purser <[email protected]> ---
I wrote a JavaScript workaround for this. It allows you to scan an item barcode
then does an api lookup to get the biblio number. It then inserts the biblio
number in place of the item barcode. It is currently on a 1 second loop.

// Move hold modal, item barcode lookup
// Written Mar 2026 for Koha 25.11
$(document).ready(function(){
        if (location.href.indexOf("request.pl") != -1) {
            let hold_status = 1;
            let hold_item_id = 0;

                let hold_move = () => {
              if (hold_item_id == 0) {
                let tmp_id = $("#biblio_id").val();
                if (tmp_id != "") {
                  hold_item_id = tmp_id; 
                  hold_status = 0;
                }
              }
              if (hold_status == 0) {
             // fetch biblio id on change
             let tmp_url = "/api/v1/items?external_id=" + hold_item_id;
             fetch(tmp_url, {method: "GET"})
              .then (res => {
                  if (!res.ok) { throw new Error ("hold_fetch Not OK!"); }
                    return res.json();
                  })
              .then (data => {
                //put bib_id in other field
                  $("#biblio_id").val(data[0].biblio_id);
              })
                .catch(error => console.error('Error hold_fetch: ', error));
              }
           }
           // Run the above code in a loop on the given page
           setInterval(hold_move, 1000);
        }
});

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to