Displaying auto updated unique title and volume count on the Koha staff client or OPAC

Step - 1

 First Create the SQL Public Report 

Go to: Reports/ Create from SQL and (Copy and paste the following SQL query )

SELECT homebranch, count(DISTINCT biblionumber) AS bibs, 
       count(itemnumber) AS items 
FROM items 
GROUP BY homebranch 
ORDER BY homebranch ASC


Save to public report. (Report is public: 



Step - 2

Go to: Koha administration/System preferences/Staff interface/IntranetUserJS

Copy and paste the following JQuery

Replace your IP address and report ID

http://Your koha IP Address/cgi-bin/koha/svc/report?id=36&annotated=1

//**No.of.Book.Dis in home page**//
$("label[for='sql_params_Reselectthesubjecttag']").hide()
 $('#sql_params_Reselectthesubjecttag').hide();
 $("#sql_params_Selectthesubject").change(function() {
   var subval = $('#sql_params_Selectthesubject').val();
   $("#sql_params_Reselectthesubjecttag").val(subval);
 });

$(document).ready(function() {
    if ( $('#main_intranet-main').length ) {
    $.getJSON("http://Your koha IP Address/cgi-bin/koha/svc/report?id=36&annotated=1",
           
        function(data) {
        var branches = data[0].homebranch;
        var bibs = data[0].bibs;
        var items = data[0].items;
        $('div.newsitem').prepend('<div class="newsitem" id="mystats"><table class="table table-striped" style="width: 100%; background: none;"><thead><th colspan="3" style="text-align: center; font-weight: bold; padding: 8px; line-height: 1.42857143; vertical-align: middle; text-transform: uppercase;">Library Statistics</thead><tbody><tr><td><strong>Branch</strong></td><td><strong>Unique Titles</strong></td><td><strong>Total Vols</strong></td></tr><tr><td class="text-center">'+branches+'</td><td class="text-center">'+bibs+'</td><td class="text-center">'+items+'</td></tr></tbody></table></div>');
    });
    }
});


 


Step - 3

Go to: Home Page (Successfully Your library unique title and volume displaying)


Information courtesy

Post a Comment

9 Comments

  1. ICON Legal Services provides its best family lawyer in Chennai, family law matters including divorce, adoption, child custody, surrogacy, dowry harassments, domestic violence, probate, Will and inheritance.

    Best Family Lawyer in Chennai

    ReplyDelete
  2. Health Benefits of Pineapple – PillsPalace | TechoJob
    TechoJob

    https://techojob.blogspot.com/2022/07/health-benefits-of-pineapple-pillspalace.html

    ReplyDelete
  3. Thanks for sharing the article. This blog is full of useful information
    .

    ReplyDelete
  4. This blog is really informative because nobody has the proper knowledge about legal action and best lawyer see more about Best law Advisor

    ReplyDelete
  5. Find the best domestic violence lawyers in Chennai at Lead Chennai who can assist you and get you out of a tough situation.

    ReplyDelete