Main Koha release repository https://koha-community.org
Find a file
Jared Camins-Esakov c0714a99f2 Bug 6557: Record bib popularity in totalissues
Because updating the total issues count associated with a bibliographic
record on issue could cause a significant load on the server, this
commit adds the syspref UpdateTotalIssuesOnCirc (which defaults to OFF
to match existing behavior). The syspref has the following description:

  Do/Do not update a bibliographic record's total issues count whenever
  an item is issued (WARNING! This increases server load significantly;
  if performance is a concern, use the update_totalissues.pl cron job
  to update the total issues count).

Bug 6557: automatically increment totalissues

Adds the ability to automatically increment biblioitems.totalissues
whenever an item is issued.

To test:
1) Choose a record with at least one item that can circulate
2) Check the value of 942$0 (you may need to look at the plain MARC view
   on the OPAC). Most likely there won't be any 942$0 at all
3) Enable UpdateTotalIssuesOnCirc
4) Check out the item you selected
5) Check the value of 942$0 (you may need to look at the plain MARC view
   on the OPAC). That value should now be one greater than before
6) Discharge the item
7) Disable UpdateTotalIssuesOnCirc
8) Check out the item you selected again
9) Check the value of 942$0 (you may need to look at the plain MARC view
   on the OPAC). That value should not have changed

Bug 6557: add script to update totalissues from stats

NAME
       update_totalissues.pl

SYNOPSIS
         update_totalissues.pl --use-stats
         update_totalissues.pl --use-items
         update_totalissues.pl --commit=1000
         update_totalissues.pl --since='2012-01-01'
         update_totalissues.pl --interval=30d

DESCRIPTION
       This batch job populates bibliographic records' total issues count
       based on historical issue statistics.

       --help  Prints this help

       -v|--verbose
               Provide verbose log information (list every bib modified).

       --use-stats
               Use the data in the statistics table for populating total
               issues.

       --use-items
               Use items.issues data for populating total issues. Note that
               issues data from the items table does not respect the --since
               or --interval options, by definition. Also note that if both
               --use-stats and --use-items are specified, the count of biblios
               processed will be misleading.

       -s|--since=DATE
               Only process issues recorded in the statistics table since
               DATE.

       -i|--interval=S
               Only process issues recorded in the statistics table in the
               last N units of time. The interval should consist of a number
               with a one-letter unit suffix. The valid suffixes are h
               (hours), d (days), w (weeks), m (months), and y (years). The
               default unit is days.

       --incremental
               Add the number of issues found in the statistics table to the
               existing total issues count. Intended so that this script can
               be used as a cron job to update popularity information during
               low-usage periods. If neither --since or --interval are
               specified, incremental mode will default to processing the
               last twenty-four hours.

       --commit=N
               Commit the results to the database after every N records are
               processed.

       --test  Only test the popularity population script.

WARNING

If the time on your database server does not match the time on your Koha
server you will need to take that into account, and probably use the
--since argument instead of the --interval argument for incremental
updating.

=== TESTING PLAN ===

NOTE: in order to test this script, you will need to have some sort of
circulation data already existing in your Koha installation.

1) Disable UpdateTotalIssuesOnCirc
2) Run: misc/cronjobs/update_totalissues.pl --use-items -t -v
3) If you have total checkout data in your item records (i.e. anything
   in 952$l), you should see messages like "Processing bib 43 (1 issues)"
4) Choose one of the lines that shows more than 0 issues, and view the
   record with that biblionumber in the staff client, choosing the "Items"
   tab (moredetail.pl). Add up the "Total checkouts" listed for each item,
   and confirm it matches what the script reported
5) Run: misc/cronjobs/update_totalissues.pl --use-stats -t -v
6) If you have any circulation statistics in your database (i.e. any
   'issue' entries in your statistics table), you should see messages
   like "Processing bib 43 (1 issues)";
7) Choose one of the lines and view the record with that biblionumber in
   the staff client, choosing the "Items" tab (moredetail.pl). If you
   count the number of checkouts listed in each item's checkout history,
   the total should match what the script reported.
8) Check out an item
9) Run: misc/cronjobs/update_totalissues.pl --use-stats
   --incremental --interval=1h -t -v
10) You should see one line reporting a single circ for the bib record
    associated with the item you just checked out (there may be more if
    you checked out any books in the hour prior to running these tests
11) If the results in steps 4, 7, and 10 match the predictions, the
    script worked

This patch to Koha was sponsored by the Arcadia Public Library and the
Arcadia Public Library Foundation in honor of Jackie Faust-Moreno, late
director of the Arcadia Public Library.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Tested this with my test data - numbers are correct and updated appropriately.

More importantly - if I do a popularity search, the most popular items *come up first*. Amazing.
2012-06-29 14:29:22 +02:00
acqui Bug 7304: More permissions for budgets 2012-06-27 16:25:44 +02:00
admin Bug 7304: More permissions for budgets 2012-06-27 16:25:44 +02:00
authorities Bug 5910: [SIGNED-OFF] only add "All authority types" for UNIMARC 2012-06-20 22:22:25 +02:00
basket
C4 Bug 6557: Record bib popularity in totalissues 2012-06-29 14:29:22 +02:00
catalogue Bug 8255: allow local cover images to be cached 2012-06-25 18:12:29 +02:00
cataloguing Bug 6939 DefaultClassificationSource should be default in 942 2012-06-28 09:29:14 +02:00
circ Bug 8043 - today's checkouts are in Previous checkouts in circulation.pl 2012-06-20 23:25:31 +02:00
debian Bug 7411: Remove diacritics from generated userid 2012-06-11 16:43:39 +02:00
docs Merge remote-tracking branch 'origin/new/bug_7143' 2012-06-25 18:01:28 +02:00
errors
etc Bug 7586 - Search: Language restriction does NOT show expected results (no items shown) 2012-06-10 11:00:14 +02:00
install_misc Bug 7411: Remove diacritics from generated userid 2012-06-11 16:43:39 +02:00
installer Bug 6557: Record bib popularity in totalissues 2012-06-29 14:29:22 +02:00
Koha Bug 8130 - attach PDF files to a patron record 2012-06-28 10:55:51 +02:00
koha-tmpl Bug 6557: Record bib popularity in totalissues 2012-06-29 14:29:22 +02:00
labels Bug 8140 - [SIGNED-OFF] Error when exporting label xml 2012-05-28 18:15:31 +02:00
members Bug 8130 - attach PDF files to a patron record 2012-06-28 10:55:51 +02:00
misc Bug 6557: Record bib popularity in totalissues 2012-06-29 14:29:22 +02:00
offline_circ Bug 8006 - Loading offline circulation does not anonymize 2012-06-20 19:40:41 +02:00
opac Bug 8315 - fix 'C4::Output 3.02' errors in Koha 2012-06-29 11:59:13 +02:00
patroncards Bug 7318: Fixes category display in patroncards Patron Search results. 2012-02-27 18:01:00 +01:00
reports Bug 4330 : Fixing FSF address and copyright headers 2012-05-28 17:53:40 +02:00
reserve Bug 7815 : Order pickup libraries list by name rather than by code 2012-06-10 13:09:00 +02:00
reviews Bug 1623 - Provide view of approved comments 2011-12-27 18:26:50 +01:00
rotating_collections
selenium
serials Bug 5337: EAN management : Adds ean for various searches 2012-06-09 18:26:34 +02:00
services Bug 7178: Acquisition item creation improvement 2012-03-26 11:07:23 +02:00
skel
sms
suggestion Bug 7304: More permissions for budgets 2012-06-27 16:25:44 +02:00
svc Bug 7248 follow-up (alternative) 2012-05-15 18:05:58 +02:00
t Bug 7304: More permissions for budgets 2012-06-27 16:25:44 +02:00
tags Bug 8315 - fix 'C4::Output 3.02' errors in Koha 2012-06-29 11:59:13 +02:00
test
tmp/modified_authorities
tools Bug 7961 - Local cover images should support CSV link files 2012-06-20 09:42:25 +02:00
virtualshelves Bug 7788: [SIGNED-OFF] Followup: GetShelf call in addbybiblio script corrected 2012-05-22 12:06:26 +02:00
xt Bug 7994: scripts to check yaml files 2012-06-20 21:07:46 +02:00
.htaccess
.mailmap 7439 Mailmap for master 2012-01-27 12:27:58 +01:00
about.pl Merge remote-tracking branch 'origin/new/bug_7143' 2012-06-25 18:01:28 +02:00
changelanguage.pl
edithelp.pl
fix-perl-path.PL
help.pl
INSTALL Bug 7759, update of install files to use background indexing (and some whitespace tidy) 2012-04-20 16:11:52 +02:00
install-CPAN.pl
INSTALL.debian Bug 8092 follow-up: Add optional dependency on CHI 2012-06-09 13:08:18 +02:00
INSTALL.fedora7 Bug 8092 follow-up: Add optional dependency on CHI 2012-06-09 13:08:18 +02:00
INSTALL.opensuse Bug 7759, update of install files to use background indexing (and some whitespace tidy) 2012-04-20 16:11:52 +02:00
INSTALL.ubuntu Bug 8092 follow-up: Add optional dependency on CHI 2012-06-09 13:08:18 +02:00
INSTALL.ubuntu.lucid Bug 8092 follow-up: Add optional dependency on CHI 2012-06-09 13:08:18 +02:00
koha_perl_deps.pl
kohaversion.pl Bug 8130 follow-up DBRev number 2012-06-28 13:53:50 +02:00
LICENSE
mainpage.pl Bug 6875 cleaning mainpage.pl 2012-02-15 14:58:31 +01:00
Makefile.PL Bug 7818: update installer for biblio DOM indexing 2012-06-09 11:43:56 +02:00
MANIFEST.SKIP
README
README.robots
rewrite-config.PL Bug 7818: update installer for biblio DOM indexing 2012-06-09 11:43:56 +02:00

Koha is a free software integrated library system.

Koha is distributed under the GNU GPL version 2 or later.
Please read the file LICENSE for more details.

To install or upgrade Koha, please see the INSTALL file appropriate
to your platform.

Report bugs at http://bugs.koha-community.org/

Visit the Koha Project website at http://www.koha-community.org/