Force Default messaging preferences on Patron Categories #Koha

By abhisheknagar

Oh, I was sending Notifications to Patrons on Item Issue, but suddenly the management have instructed to send notifications on Item Return, Renewal etc as well or they have asked to send Notifications as SMS/WhatsApp in addition to Email, and now i realise that this will ge a pain to implement as i will need to implement this for each patron.

NO NO

This can be done automatically here is the solution

Step 1 ) Modify Messaging Preference for each  Patron Categories

For Each Patron Category set the Default Message Templates from the link  http://<your-library-staff-panel>/cgi-bin/koha/admin/categories.pl

 

Step 2) Use the following commands on the Koha Server Terminal

sudo su

export PERL5LIB="/usr/share/koha/lib"

export KOHA_CONF="/etc/koha/sites/library/koha-conf.xml"

cd /usr/share/koha/bin/maintenance

perl borrowers-force-messaging-defaults.pl --doit

 

You are Done !!!

The Script borrowers-force-messaging-defaults.pl  will force update messaging preference of all Patrons

Ensure that the koha-conf.xml PATH is correctly set in Step 2 in case your library name is other than library.


This will be useful if you have just implemented my New Module to send Notifications via WhatsApp Business API

 

Koha SMS Driver for WhatsApp Business API (GupShup)

By abhisheknagar

Screemshot

Koha already have a feature to Push Notices via SMS

Koha uses SMS Drivers to push these Notices to a Service Provider

SMS Driver can be written which can Push Notices using an External API (Gupshup WhatsApp API) in this case which can inturn send the Notice as WhatsApp Messages.

Requirements

  1. Facebook Business Account
  2. GupShup Account with WhatsApp Business API
  3. GupShup API Key
  4. Approved Templates for CHECKOUT, CHECKIN, DUE
  5. GupShup Endpoint URL for API
  6. SOURCE Number as Registered in Facebook Business Account and Mapped in Gupshup

How to Install

  1. Download the Package File (.KPZ) from this github Repository
  2. Upload the Package File in the Koha Plugins
  3. Configure the Plugin by entering the Information already stated in Requirements
  4. Modify the SMSSendDriver Value to SMS::Send::Gs in the System Preferences in Koha
  5. Enable Notices via SMS in Koha for desired category of Patrons
  6. Configure the messages cron if not already configured on Koha Server

Configuration

Step 1

Step 2

Step 3


Assumptions of this Driver

Template for CHECKOUT, CHECKIN, DUE is already approved by Facebook and contains 2 Variables/Parameters

eg Template

==================================================

Screemshot

Dear {{1}},

The following books have been issued to you as per your request in Library

{{2}}

Thank you for visiting The Institute Library.

==================================================

The Driver will replace {{1}} with the Patron First Name & {{2}} will be replaced with the SMS Template Data as recieved from KOHA eg {{2}} can contain Barcode of Books issued which will convert the Template to the following and send

==================================================

Dear Abhishek,

The following books have been issued to you as per your request in Library

6754, 5754

Thank you for visiting The Institute Library.

Github Repository : https://github.com/abhisheknagar/gupshup-wa-koha-driver

 

Need Help in Configuration

Koha Notices via Custom Self Hosted End Point

By abhisheknagar

#Idea

Use the SMS Service present in Koha to send Notices to Patrons

SMS Plugin which send Notices as JSON Data to an Endpoint using POST, Endpoint can be yours own endpoint or a service provided by a service provider. Handle the JSON data in Endpoint and send the Notice using your Custom Code or Service Provider to WhatsApp / Telegram / Whatever

GIT Repository : https://github.com/abhisheknagar/wa

 

JSON POST made by this Koha Plugin to Endpoint will look as follows : 

{
           "api_key"        => $api_key,
           "customerFirstName" => $patron->firstname,
           "customerLastName"  => $patron->surname,
           "phone"             => $patron->smsalertnumber || $patron->phone,
           "code"              => $m->letter_code,
           "messageBody"       => $m->content,
    }

 

What is Koha ?

Community Driven world's first free and open source library system, Koha https://koha-community.org/ powers major libararies around the world. 

Drupal 10 is here !!! Upgrade Now

By abhisheknagar

Drupal 10 is officially with us since a month now , After all the efforts and much wait i have started upgrading sites to D10, have upgraded a few which had very minimum functionality including this site, now planning to upgrade rest to D 9.5 so that D10 could be possible for others soon, but again it will take much time as it requires various modules and theme compatibility issues resolution.

What's included ?

  • Symphony 6
  • CKEditor 5
  • Claro Admin Theme
  • Olivero default theme
  • Starterkit theme generator
  • and mush more

What's Required ?

  • PHP 8.1
  • MariaDB 10.3.7+ / MySQL 8
  • Composer 2.3.6 +

Upgrading your Site

  • Use Upgrade Status to evaluate requirements
  • Upgrade to Drupal 9.4 +
  • Disable Upgrade Status
  • Upgrade to Drupal 10 if all requirements are met
Popular Modules already available for Drupal 10
  • Webform 
  • Ctools
  • Token
  • Pathauto
  • metatag
  • captcha
  • SAML Authentication
  • SAML SP 2.0 Single Sign On (SSO) - SAML Service Provider
  • and more
Wait for these popular once to come on board

 

 

Koha Initial Setup/Installation, Configuration on Ubuntu 20.04

By abhisheknagar

Koha is an open source integrated library system (ILS), used world-wide by public, school and special libraries. The name comes from a Māori term for a gift or donation. ~ Wikipedia

In this blog post we will discuss how to Install the Latest Version of Koha (21.05.XX)

System Requirements

  • Ubuntu 18.04 + or Debian 9+
  • Maria DB 10.1 +
  • Perl 5.24 +

Installation of Koha is quite easy and simple you can install Koha on your Local Machine or a Virtual Machine / Cloud / Compute Engine, I recommend using a minimum of 4 Gb RAM based machine / virtual setup.

Pre-requisite

The System must have Ubuntu 18.04 + Operating System Installed.

Koha Installation Process

  • Update Operating System
    • sudo apt-get update
    • sudo apt-get upgrade
  • Add Koha Repositories
  • Install Database Server
    • sudo apt-get install -y mariadb-server
    • sudo mysqladmin -u root password <yourpassword>
  • Install Koha
    • sudo apt install -y koha-common

Configuration Considerations

Koha Provides 2 Services namely

  • Staff Portal : Portal Used by Staff for Library Services
  • Web OPAC : Portal Used by Patrons for OPAC Services

Both of these services are installed on a single system/server there are multiple ways to access these

  • Named Services
  • IP Port Based Services
    • Where you want to access both the Portals using Same IP but different Ports eg XX.XX.XX.XX (Web Opac), XX.XX.XX.XX:8080 (Staff Portal)

Generally the Staff Portal is restricted to your Local Network while Web OPAC is Publically available, in this tutorial we will be using IP Port Based Setup, Lets Start Configuring Koha

Basic Web Based Installation & Configuration

Change the Port No of Staff Portal to 8080

sudo vim /etc/koha/koha-sites.conf

Find the following line and edit

INTRAPORT="8080"

Create a Koha Instance

sudo koha-create --create-db library (you can change <library> to whatever name you want to give)

Add a Port to Apache

sudo vim /etc/apache2/ports.conf

Listen 8080

Enable Module & Sites

sudo a2dissite 000-default

sudo a2enmod deflate

sudo a2ensite library

sudo service apache2 restart

sudo service memcached restart

Web Installation

Detailed Guide available @ https://koha-community.org/manual/21.05/en/html/installation.html

Once you are done with the above you can Open the Koha Web Installer to Install & Configure Koha to start the Web Installer open the following URL on your Favourite Web Browser

http://127.0.0.1:8080 (Replace 127.0.0.1 with Actual IP of VM/External Machine if being used)

The Web Installer will require a username & password to continue your can get the same from the file /etc/koha/sites/library/koha-conf.xml

sudo vim /etc/koha/sites/library/koha-conf.xml

Find the Following to know the User & Password

<config>
 <db_scheme>mysql</db_scheme>
 <database>koha_library</database>
 <hostname>localhost</hostname>
 <port>3306</port>
 <user>koha_library</user>
 <pass>CoPKrCzmoh0G7bQ@</pass>

 

The Web Installer will ask for various inputs like branch, itemtype, super user info, defaults, MARC Flavor and much more select/enter as per your preference and enjoy Koha.

Once Installation is Complete you can access

If your System is Connected to Network and proper firewall rules are in place then both the Staff Portal & Web OPAC will be available in your Local Network instantly. If you configured the above on a Cloud VM/Compute replace 127.0.0.1 with the Public IP as available with you.

 

For Professional Koha Support do contact abhishek [a t] nagar [d o t] me