Quicktip – Ordering the display of your custom patron fields

An easy-peasy way to order the display of Koha’s ExtendedPatronAttributes fields.

This is going to be a brief tutorial, ExtendedPatronAttributes provide the capability to add custom fields to Koha’s patron management e.g. if we wish to capture say Program enrolled or Roll No. or other demographic details that we may be required to maintain under (a) law of the land or (b) governing rules of our library, this feature of Koha is friend we need to take help of.

If you have just landed on this blog and have no idea what we are talking about, we suggest that you may like to first read this earlier post – Harnessing Koha’s ExtendedPatronAttributes (aka patron custom fields). And while you are here, you may also like to visit this article.

Ok! Enough backstory, now back on topic! 🙂 When we define new custom fields to Koha using Home › Administration › Patron attribute types, the key thing to remember here is that these are ordered and displayed using alphabetic ascending sorting order of the defined Patron attribute type code.

Which means, when we defined a list of custom fields to capture student registration details e.g. as given in the screenshot below, we want them to be displayed in the order of the codes are numbered in the blue circles i.e. Student code, Registration No. and Roll No. in that order respectively.

Instead what we get is this:

The Solution

We simply need to number our codes. The way to do this is simply to prefix them with a serial number. Here we chose to use 00_, 01_, 02_”. Of course, this also meant that we had to dump off our old codes and put in these as replacement.

Hint: Do this before you start using the defined fields while entering your patron records. While it can be done later, you need to know what you are doing if you don’t want to mess up your patron data.

You can see what we did below:

And as you can see below, we have the fields displayed exactly in the order we had wanted in the first place.

A knotty problem – an Arabic catalog that refused to work in Koha 17.11

Watching out for custom developed themes during Koha upgradation will save you a lot of grief.

Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth.

– Sherlock Holmes [by Arthor Conan Doyle]

Early last week my good friend Vimal Kumar Vazaphally asked me if he could connect me to a friend of his who was facing some trouble after migrating to Koha 17.11 from 3.18. I agreed to take a look, since the problems that Vimal sends my way from time to time are usually interesting rather than mundane. Soon I was talking to Hussain (‎حسين رضوي‎) who manages the systems at the Public Library of Imam Hussain (AS) Holy Shrine, at Bab Alqibla, Karbala, Iraq.

The problem

Hussain informed that things used to be fine in the older 3.18 system, but after migrating to 17.11, they could no longer use the cataloging editor properly as the value builder for 008 MARC21 tag i.e. Fixed-Length Data Elements-General Information was not being displayed properly anymore, and the data being pushed back was the default value.

The chase begins

After looking at his system over Teamviewer and not making much headway, I asked Hussain to send over a copy of his database and went to bed.

By next day he had sent over his 1.2 GB database. I had it hoisted up on a test 17.11.01 system we have around, the same one which we had used the week before to migrate Bangabasi College from their earlier Koha 3.14.06. Since it was a multi-tenanted setup I could see the staged Bangabasi catalog working OK in it. Once the zebra reindexing has been done, our sleuthing started, we were able to reproduce the error.

The steps to the Truth

The first thing to check was for MARC framework validation – Ok! that was clean. Next up – detailed manual check of the framework in use. But everything looked shipshape. So what we had here was a curious beast. Since we were on a multi-tenant system and one was working just fine, the problem therefore had to be coming up from somewhere in Hussain’s database. But from what exactly was the question. When I mentioned about it on #koha (the IRC channel of Koha ILS), @wizzyrea (Liz Rea from CatalystIT) said that the issue sounded familiar and asked me to check whether it was bug no. 19473. It was not. However, 19473 looked interested so I added myself to the bug for tracking its status in future, and as I did bugzilla prompted – “The next bug in your list is bug 19965”

Bug no. 19965 turned out to be Hussain’s bug which he had reported on the Koha bug tracking database on 12th Jan 2018. This was from before we had connected. As I read through the comments on the bug by @cait – Katrin Fischer our indomitable QA lead, and incidentally visiting India at the moment for LTC2018 in Goa, I had my light bulb moment! 😉 I ran the 008 value builder and checked the JavaScript console. Firefox gave some hint that there was something wrong, but it was Google Chrome that showed exactly what was wrong.

Apparently, we had a 404 (file not found) error for marc21_field_088.xml. Now this was the file that Koha uses to load the list of values possible in the 008 field. This is what drives the drop-downs in the 008 value builder. I knew that we certainly had the file on the system, which is why things had worked for Bangabasi. The error message showed that somehow Koha was looking for the marc21_field_088.xml at a different location – intranet-tmpl/imam/en/data/marc21_field_008.xml rather than where it should intranet-tmpl/prog/en/data/marc21_field_008.xml.

The story was clear – this Koha installation had a custom staff client theme / template installed with the name of imam. So now we checked the template system preference under “Staff client” of Administration -> System preferences. But no the system preference showed only prog as the solitary value. Knowing that rhe staff client system preferences values are principally driven via a YAML file inside Koha called staff_client.pref, I decided to go for the source, in other words – the database itself.

A simple query :

SELECT * FROM `systempreferences` WHERE variable = "template"

showed what I had suspected, the actual value was set to “imam“. Another line of SQL later

UPDATE `systempreferences` SET value = "prog" WHERE variable = "template"

I was ready to test it. And Voila! there was it was… all working again! 😀

An explanation and an update

Now, you may be wondering why did Koha show the system preference template as only “prog” while its actual value was set to “imam”… is that not a bug? Well, not really! The value in the database is supposed to be one from the possible values in the YAML code for that system preference. So when you actually add a different value into the database and do not update the value in the YAML script, this is the expected fallback behavior.

You may also wonder so what happened to the bug no 19965 that Hussain had filed in the Koha bugzilla. Since, I had been able to verify that this was not a Koha bug, rather a user infused data error, I closed the bug report with the status – “RESOLVED-INVALID” along with this comment.

For Hussain, the first level solution was to update his database and point the installation to use the “prog” staff client theme / template rather than “imam”. At the secondary level, he had to port his old 3.18 theme – “imam” over to 17.11, which is quite likely to be a non-trivial exercise, should he / the library authority choose to do that.

Quick Tip – What to avoid when adding news items to your Koha OPAC

Avoiding common errors while using Koha – setting the library name correctly for news.

The News tool available in the Home -> Tools -> Additional tools section of the Koha staff client allows us to publish news and updates across – (a) OPACs (b) staff client and (c) printed slips generated by the library.

Being a handy way to publish library related updates, librarians like to use it. However, there are a few things that we need to keep in mind when doing this. For starters, we should not be logged in into the staff client as Koha’s database administrator; we must be logged in either as a superlibrarian OR as a library staff user with access rights to the News tool. The next thing to understand is even more important – the “Display location” and “Library” drop-downs.

Earlier today, we received a ticket on our online helpdesk –

“We have written a new notice but nothing is displayed on the opac.”

When we cross-checked, we found that to be true. So we checked the new notice to find out what may be the problem. And sure enough it was exactly what we had expected had happened. The notice / news was set to display on the OPAC of client-partner’s defined library branch, instead of being set to “All libraries”.

Now you may ask how can this be wrong??? Well, up until an user logs in via the OPAC, the “library (branch)” is *NOT* set as Koha has no way of knowing which branch (since a Koha instance can cater to multiple library branches of an organisation) of the library the user is looking at at the moment. The notices / news would have showed up *if* the user had logged in into *that* defined branch in this case.

So, the logic to keep in mind while publishing a news item on the OPAC – select a specific branch for display *ONLY* if you want the notice to be branch specific, otherwise, keep it generic as “All libraries”.

Once this was corrected, the news defined showed up just fine as can be seen below.

New and improved SLA management from L2C2 Technologies

Adding weekly SLA Management Reports for our hosted accounts of Koha ILS.

Starting this January, on every Monday (first day of the week for us) we will be mailing out weekly service level management reports and updates to our hosted Koha ILS client partners. We already have phone calls and the online support helpdesk covered and are now trying to figure out how to manage the instant messaging requests via Whatsapp, Telegram, Twitter and FB Messanger etc.

While the LIS professionals working with us from our client partners’ side already know where they stand with their SLA status, often the management is not fully aware of the work being done. With this new initiative we hope for greater transparency in our communication with our clients. Enclosed below are sample of these reports with the contact details reducted.

Planning new data quality QA tools

Looking at cataloging data for institution after institution, it often appears that LIS professionals themselves are their greatest adversaries. Plagued by short staffing, pressed for time, pressured by management deadlines and objectives, often their own poor IT skills or even a lack of attention to details – all these factors and more, often lead to poor quality cataloging data.

Most of them love the fact that Koha is Free Software, but usually choose to overlook the fact that being Free Software means, the users themselves need to step up to the plate either learn new concepts, upgrade skills OR seek qualified support (often paid). Short of attention to these, Koha is not a magic wand that one can wield like Harry Potter and utter “Catalogus Bibliothecam” (‘catalogue the library’).

And once poor quality bibliographic data makes it way into a catalog, without oversight and correction, Koha is often unable to deliver the goods. This is not Koha’s short-coming. I will be harsh here and say that the fault largely lies with the catalogers for entering bad data in the first place. You need to be nit-picky about data and logically sharp in order to be a good cataloger – either you one, or you can acquire the habit with practice or you do not.

On L2C2 Technologies’s online helpdesk, we often encounter requests that lead us back to bad quality cataloging data entered by our client partners. While LIS professionals need to upgrade / sharpen their skills, we have decided to regularly release a bunch of cataloging data quality audit tools for Koha so that we can help our user community.

In the spirit of Koha Library System Project these will all be released as open source via the blog (http://blog.l2c2.co.in) and our GitHub repository.

#Koha #cataloging #data_quality #new_stuff

Koha ILS workshop at ICAR-NAARM, Hyderabad, Feb 5 – 9, 2018.

Indranil Das Gupta, Co-Founder, L2C2 Technologies will conduct sessions at the upcoming ICAR-NAARM organised Koha workshop.

Indranil Das Gupta, Co-Founder, L2C2 Technologies has been invited by ICAR-NAARM as resource person and faculty at ICAR-NAARM’s upcoming Koha ILS workshop in Hyderabad, India.

About the program

The ICAR – National Academy of Agricultural Research Management (NAARM) is organizing a training programme on Koha for library staff of ICAR during February 5-9, 2018. Dr. S.K. Soam, Head, ICM Division, NAARM and Dr. N. Srinivasa Rao, Principal Scientist are the programme directors for this training. They are expecting about 35 librarians to participate from various ICAR institutes in this training programme

About ICAR NAARM

The National Academy of Agricultural Research Management (NAARM) is a national-level research center located in Hyderabad, Telangana, India. It was established by the Indian Council of Agricultural Research (ICAR) in 1976, to address issues related to agricultural research and education management, in India. In the initial years, the Academy primarily imparted foundation training to the new entrants of the Agricultural Research Service of ICAR.

Subsequently, its role expanded to include research, capacity building of senior professionals of national and international NARS in agricultural research and education management, and policy and consultancy support to NARS. The Academy also renders services for building IP portfolios like patents and geographical indications to various stakeholders including farmers and scientists.

About L2C2 Technologies

L2C2 Technologies is a leading member of the global Koha developer community from India. Aside from upstream contribution, L2C2 Technologies have been active in the global Koha Release team for version 3.22, 16.05, 16.11 and 17.05. L2C2 started cloud hosting of Koha ILS in eastern India and have to its credit the first fully hosted Koha ILS having passed NAAC inspection in entire eastern India. We collaborate globally with people who write and publish Koha ILS software, thus ensuring international quality support while always being at the forefront of latest Koha development.​

[FOR IMMEDIATE RELEASE]

Queen Mission School Salt Lake your future catalog thanks you :-)

A high school adopts the use of authority records in their Koha ILS based library catalog.

Client-partners who work with L2C2 Technologies know how fond we are of authority records. Without basic authority control of the personal names and subjects, catalogs over times end up having a mish-mash of variously spelled names and subjects which are essentially one and the same. One of the particular horror stories from the time when we started cloud hosting of Koha in Eastern India in 2015 was a case when we encountered the subject heading of “Commerce” spelled with 19 different spellings in the catalog and it’s bengali variant “বাণিজ্য” spelled in 3 more ways. And that was just one of those things. The author name variations of the same author were even greater horrors. Yes, as you can tell by now, we feel rather strongly about the use of authority records, which essentially help create better quality catalog data and also provide an easy way to update and manage spellings of headings.

It makes us happy that the three young women working on the cataloging project of Our Lady Queen of the Mission School, Salt Lake have taken heed of our suggestion to use authority files since they are starting from scratch. They began with the most simple personal name authorised heading for authors and editors of the books in the school’s collection. This work is being carried out by Priya Show and Shreya Mullick under the leadership of Swarnali Mitra, Librarian. Priya had earlier participated a departmental workshop I had helped conduct at the Department of Library & Information Science, Calcutta University. For Shreya and Swarnali, I am working with them for the first time. But luckily for their project, all these young ladies are showing that they have what it takes – the vision and eagerness to do things the right way. Wishing them all the best.

Displaying unique title and volume count on the Koha staff client

An upgrade-friendly way to show unique title and copies’ count using Koha’s SQL reports in tandem with Koha’s Reports web service API, JSON formatted data and some Javascript.

Kia ora!

Last week my good friend Dr. Gautam Sarma, Asst Librarian, K.K. Handique State Open University in Assam posed an question on the Koha Users forum on Facebook. He wanted to know what was the easiest way to view the total count of unique titles as well as total number of copies (item holdings) in his Koha catalog.

Given that he comes to us from a SOUL user’s background, this is a reasonable demand. SOUL developed and marketed by Inflibnet does show this information at a glance, especially when using the cataloging module. Similarly, so does e-Granthalaya, another LMS developed by NIC, Govt of India. The following screenshot snippets show how this information is displayed for SOUL v2.0 and e-Granthalaya 4.0 respectively.

soul

egrant

In Gautam’s own words he was looking for something that would allow him to:

hurriedly say that how much data we have by entering our ILS

While Koha’s SQL reporting facility makes finding this information a breeze, thanks to this ready-made SQL report by Nicole C. Baratta, it does not immediately allow the users to have the sort of heads-up view that SOUL and e-Granthalaya allows. A library staffer have to go to Reports -> Guided Reports -> Use Saved and then finally manually select the actual report and run it to see the unique title and copy count statistics.

At L2C2 Technologies we have been doing some things like these for our client-partners. So I promised Gautam that I will soon post about it. And as it would happen, yesterday Mr. Kalipada Jana, Librarian, Basanti Devi College and a client partner wanted the same facility for his hosted instance’s staff client. We decided to use the Basanti Devi College library as a live use-case (since they are currently doing retro-conversion) and document the same so that other users may also be able to benefit from the same.

Concepts – or what makes it all work

Koha since long have provided a set of HTTP based web service API. According to the World Wide Web Consortium (W3C) – the global standards body that defines anything and everything related to the web, a web service is “a software system designed to support inter-operable machine-to-machine interaction over a network”.

Among the various things Koha’s web services API allow includes the Reports web service, which allows an SQL report’s data to be made available in JSON format, as long as the report is marked as “public“. A public report is accessible via a URL that looks like this: http://MYOPAC/cgi-bin/koha/svc/report?id=REPORTID.

basanti-stats1

In this case, we called the report as a public report using the reports web service via https://bdcl-staff.l2c2.co.in/cgi-bin/koha/svc/report?id=6&annotated=1.

The SQL query being executed by the call was :

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

The JSON data (which thanks to the annotated=1 querystring parameter) was returned as the following key-value pairs : [{"bibs":"1374","homebranch":"BDCL","items":"2359"}].

The solution

With the report (in this case report id #6) returning the branch-wise unique title and copies information in JSON format, it was now only a small matter of putting together some JavaScript so that the information could be displayed in a more human-friendly format on the staff client. The following JQuery snippet was all that was required to be placed into BDCL’s IntranetUserJS system preference to get our desired result.

$(document).ready(function() {
    if ( $('#main_intranet-main').length ) {
    $.getJSON("https://bdcl-staff.l2c2.co.in/cgi-bin/koha/svc/report?id=6&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 Copies</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>');
    });
    }
});

And voila! Houston! We have touchdown! 🙂

koha-count

Hope this post helps you at your library. Happy hacking!

Koha and the “magic” of XSLT – Part 2 : Show accession no. in OPAC results page

How to add 952$p (typically the accession no.) to your OPAC’s Results page display.

About 6 months back, we had posted about “Koha and the “magic” of XSLT : displaying new MARC fields on the OPAC“. This post can be thought of as its Part 2 as it introduces a couple of new concepts – (a) looping through a list of repeatable values and (b) punctuating these values for correct display. If XSLT or Koha with XSLT sound like something you are hearing for the first time, we strongly suggest that you first read the Part 1 first (see above).

The Backstory

Our tutorial style blog posts are usually the result of addressing some sort of user demand. In this case, this post came about because of Mr. Kalipada Jana, Librarian at Basanti Devi College, Kolkata. Yesterday he had filed a ticket on our helpdesk saying that he would like accession number(s) attached to each bibliographic record to be displayed on the OPAC results page. This is something that Koha does not do by default. But having seen such a display elsewhere he wanted to have the same.

The default Results page

chrome_2017-11-28_22-58-45

What the user wanted

chrome_2017-11-28_22-57-56

The Process

Koha stores it holdings item identification in MARC21 tag 952$p. The user here was using this field to store the individually unique accession numbers of their items in holdings. Now a bibliographic record may quite easily have multiple copies with separate accession numbers. So the XSLT snipped we needed must do the following:

  1. Handle looping over to display repeated 952$p (when there were multiple copies of the same book.
  2. Separate the accn nos. with “commas” if there where multiple copies of a book and after the final accession number terminate the line with a period instead of a comma. And if there was only a single copy, then instead of comma use a period.
  3. .

  4. Suppress this accession no. display for bibliographic records that do not have any holdings.

The code

<!-- L2C2 - 2017-11-28 adding accn no to results page 952$p -->
<xsl:if test="marc:datafield[@tag=952]/marc:subfield[@code='p']">
<span class="results_summary accn_no">
<span class="label">Accession number(s): </span>
    <xsl:for-each select="marc:datafield[@tag=952]">
        <xsl:value-of select="marc:subfield[@code='p']"/>
        <xsl:choose>
            <xsl:when test="position()=last()">
                <xsl:text>.</xsl:text>
            </xsl:when>
            <xsl:otherwise>
                <xsl:text>, </xsl:text>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:for-each>
</span>
</xsl:if>

In the first line (not the comment) we check if the MARC record has a 952$p field and sub-tag. If it does only then the rest of the code is executed. This is what helps us to suppress this new display for records without any accession numbers in its 952$p. The next couple of lines push out the necessary HTML code since the record has at least one accession number i.e. 952$p. In the subsequent two lines immediately after, we set up two loops. The first one loops through all the 952 (holdings) field in the bib record, while the inner loop looks up the $p sub-field. The inner most bit i.e. <xsl:choose><xsl:when test="position()=last()"> handled the punctuation. First if it checks if the currect MARCXML 952$p sub-node is the last one, if so it places a period and terminates the line. Otherwise, it places a comma as punctuation between the multiple accession numbers.

This code was added into the custom file which we named as MARC21slim2OPACResults-bdcl.xsl. This file is same as the default MARC21slim2OPACResults.xsl file, the only addition being the snippet given above. In order to get Koha to start using our file instead of the default, we placed the full path of our new file into the OPAC system preference – OPACXSLTResultsDisplay.

See it in action

If you want to see this XSLT in action, click here.

Vidyasagar College for Women moves to Koha on cloud with L2C2 Technologies

One more academic library moves from SOUL to Koha ILS

We are pleased to welcome Vidyasagar College for Women Central Library to L2C2 Technologies’ cloud hosted Koha ILS platform. The college, so far an user of SOUL software from INFLIBNET is making this move under the leadership of the librarian Smt. Moumita Ash. In the coming days, their catalogue data will be moved to Koha so that a complete OPAC can be presented to its users 24/7.

About the college

Vidyasagar College for Women as a full fledged separate college affiliated to the University of Calcutta was founded in 1960. However, its history went back to 1931 when a separate womens’ section of the Vidyasagar College was started to cater to the educational requirements of the women folk of Kolkata. Its classes were held in the morning. The womens’ section was temporarily brought to a stop during the second world war. Since 1947, however, expansion in all branches of its activities took place steadily and regularly. New subjects were introduced and a group of dedicated teachers inspired confidence among the students who enrolled in large numbers. Since its foundation in 1960, Vidyasagar College for Women committed itself to carry forward the ideals and principles of Pundit Iswar Chandra Vidyasagar, the great educationist and social reformer of the 19th century. At present the college consists of three campuses. (From the college website)

About the library

The college maintains two libraries i.e. (a) the central library is open to all users of the college between 8 am – 2 pm, Monday to Saturday. The library has a physical collection of over 23,000 documents, along with online subscriptions to electronic resources; (b) the seminar library is located on the main campus of the college. Catering mainly to Humanities departments, the seminar library has over 1000 reference books. It remains open to users based on the college’s regular timings and academic calendar.

About the OPAC

The OPAC is located at https://vcfw-opac.l2c2.co.in. Along side providing 24/7 access to the catalog, it also provides the library personnel with advanced usage analytics based on the open source Piwik software. It also provides for a real-time one-to-one chat option with the library staff, whenever they are logged in for “Ask A Librarian” function. As a standard security best practice the OPAC runs over HTTPS rather than plain vanilla HTTP, thereby protecting the traffic between users browsing the OPAC and the server by using industrial grade “A” rated SSL certificate.