Friday, September 30, 2022

Redesigning Cover Flow (KohaCon2022)

 Report 


SELECT * FROM (


SELECT b.biblionumber, SUBSTRING_INDEX(m.isbn, ' ', 1) AS isbn, b.title, dateaccessioned


  FROM items i


  LEFT JOIN biblioitems m USING (biblioitemnumber)


  LEFT JOIN biblio b ON (i.biblionumber=b.biblionumber)


  WHERE m.isbn IS NOT NULL AND m.isbn != '' AND 'cover' != ''


     HAVING isbn != ""


  LIMIT 24     /*limits the number of covers in the gallery*/


) covers


GROUP BY biblionumber     /*prevents displaying duplicate covers for same bib*/



ORDER BY rand()     /*displays covers in random order*/



Customized coverflow report



Add some elements to the WHERE statement

  •   Location - permanent_location IN ('FN’) 

  •   Status - notforloan != '-2’ 

  •   Date - DATE_SUB(CURDATE(),INTERVAL 30 DAY) <= i.dateaccessioned

  •   Bibs without cover images - b.biblionumber != 234838