Alex Buckley and Aleisha Amohia
27 July 2021
Login details:
Username: FirstnameLastname
Password: CatalystTrain1
Read the blog post
In the News Tool:
These sections are translatable and you do not need to know HTML to modify them.
Still in the system preferences:
/* Hide the no image found image */
.no-image { display: none; }
$("#opacnav").append("<p>This is a test.</p>");
These system preferences require you to know:
CSS: https://www.w3schools.com/css/default.asp
Javscript: https://www.w3schools.com/js/default.asp
Read the blog post
Using system preferences!
Or using the News Tool
Koha reports wiki
Koha Database Schema
Important
Always run your report on your test site before trying it in production.
Do not query the action_logs table, use the Log Viewer Tool instead.
Do not refresh the page while running a report, and do not press Run more than once.
You can only view (not modify) data using Koha reports.
SELECT column FROM table
SELECT count(*) FROM table
SELECT column1, column2, column3 FROM table
SELECT biblionumber FROM biblio
SELECT count(*) FROM items
SELECT firstname, surname, email FROM borrowers
SELECT count(*) FROM table WHERE column = "value"
SELECT column1, column 2 FROM table WHERE column IS NULL
SELECT column1 FROM table WHERE column != "value"
SELECT count(*) FROM statistics WHERE type = "issue"
SELECT count(*) FROM items WHERE barcode IS NULL
SELECT count(*) FROM items WHERE barcode IS NOT NULL
SELECT column AS "Column name" FROM table SELECT column AS ColumnName FROM table
SELECT firstname AS "First name" FROM borrowers SELECT surname AS Surname FROM borrowers
SELECT column FROM table WHERE column LIKE "%middle%";
SELECT column FROM table WHERE column NOT LIKE "%value%";
SELECT column FROM table WHERE column LIKE "%end";
SELECT column FROM table WHERE column LIKE "start%";
SELECT surname AS Surname, firstname AS "First Name", cardnumber AS "Card Number", email AS Email FROM borrowers WHERE email NOT LIKE '%@%.%'
SELECT title FROM biblio WHERE title LIKE "%dog%";
SELECT DISTINCT(column) FROM table
SELECT DISTINCT(itype) FROM items
SELECT column1, column2 FROM table WHERE column = 'data' AND column != 'data' AND column >= 'number'
SELECT itemnumber, barcode FROM items WHERE homebranch = 'CPL' AND ccode = 'FIC'
SELECT * FROM items WHERE ccode = 'FIC' AND dateaccessioned > '2021';
SELECT column1, column2 FROM table WHERE column = "data" OR column IS NOT NULL
SELECT biblionumber, itemnumber FROM items WHERE itemlost = 1 OR damaged = 1 OR withdrawn = 1 OR notforloan = 1
SELECT column FROM table WHERE NOT column = "data"
SELECT DISTINCT(firstname) FROM borrowers WHERE NOT firstname LIKE "A%"
SELECT column FROM table WHERE column = <<Label for free text input>>
SELECT column FROM table WHERE column = <<Label for dropdown|dropdown>>
Koha 20.05: Manual documentation
Koha 21.05: Manual documentation
SELECT biblionumber, title FROM biblio WHERE frameworkcode=<<Please enter the framework code to filter on>>
SELECT itemnumber, barcode FROM items WHERE homebranch= <<Select the homebranch|branches>>
SELECT column FROM table WHERE column = "data" ORDER BY column ASC
SELECT column FROM table WHERE column = "data" ORDER BY column DESC
SELECT surname, firstname FROM borrowers WHERE branchcode = "CPL" ORDER BY surname ASC
SELECT surname, firstname FROM borrowers WHERE branchcode = "CPL" ORDER BY firstname DESC
SELECT column FROM table LIMIT rows
SELECT * FROM biblio WHERE datecreated > '2020' LIMIT 5;
SELECT * FROM biblio WHERE datecreated > '2020' ORDER BY title ASC LIMIT 5;
SELECT a.column, b.column FROM table a JOIN table b USING (sameColumnName) WHERE a.column = "value"
SELECT a.column, b.column FROM table a JOIN table b ON (a.column = b.column) WHERE c.column = "value"
SELECT b.biblionumber, b.title, i.barcode FROM biblio b JOIN items i USING (biblionumber) WHERE b.frameworkcode=<<Framework code>>
SELECT DISTINCT(b.title), i.itype, bi.itemtype FROM items i JOIN biblio b USING (biblionumber) JOIN biblioitems bi ON (i.itype=bi.itemtype)
SELECT COUNT(column), column FROM table GROUP BY column
SELECT SUM(column), column FROM table GROUP BY column
SELECT COUNT(items.itemcallnumber) AS 'Number of Items', items.itemcallnumber FROM items GROUP BY items.itemcallnumber
SELECT b.title, SUM(i.issues) FROM biblio b LEFT JOIN items i USING (biblionumber) WHERE i.issues > 0 GROUP BY b.title;
WHERE - filter results before grouping
HAVING - filter results after grouping
SELECT COUNT(column1), column2 FROM table GROUP BY column2 HAVING COUNT(column1) > 'num'
SELECT GROUP_CONCAT(biblionumber SEPARATOR ', ') AS 'Duplicate biblionumbers', isbn FROM biblioitems GROUP BY isbn HAVING COUNT(isbn)>1
SELECT ExtractValue(metadata,'//datafield[@tag="tag"]/*'), ExtractValue(metadata,'//datafield[@tag="tag"]/subfield[@code="subfield"]'), ExtractValue(metadata,'//datafield[@tag="tag"]/subfield[@code>="subfield"]') FROM table
Table will always be biblio_metadata or auth_header
SELECT ExtractValue(metadata, '//datafield[@tag="245"]/*') AS 'Full Title information' FROM biblio_metadata WHERE biblionumber=14
SELECT ExtractValue(metadata, '//datafield[@tag="245"]/subfield[@code="a"]') AS 'Title' FROM biblio_metadata WHERE biblionumber=14
SELECT c.description, COUNT(*) AS 'Number of patrons expiring after this date' FROM borrowers b LEFT JOIN categories c USING (categorycode) WHERE b.dateexpiry > <<Choose a date|date>> GROUP BY b.categorycode
Read the blog post