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

11 Comments

  1. Health Benefits of Pineapple – PillsPalace | TechoJob
    TechoJob

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

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

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

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

    ReplyDelete
  5. It is possible to find the best domestic violence lawyers in Chennai, Tamil Nadu, India. Among the best services offered by Icon Legal Services is criminal litigation.

    ReplyDelete
  6. Relieve your stress by consulting with the most dependable anticipatory bail lawyers in Chennai When someone is facing criminal charges, one of their top priorities is to apply for anticipatory bail.

    ReplyDelete
  7. The best divorce lawyers in Chennai are well experienced in handling divorce cases.With Icon Legal Service, you can get the best divorce advocate in Chennai.

    ReplyDelete
  8. Nice articel and usefull also do visit color blind test and check your eye sight.

    ReplyDelete