Koha-clms/misc/migration_tools
Joshua Ferraro 5c23369af2 Fixing Database Definitions for Statuses *PARTIAL*
Prior to this fix, the status fields had three 'off' values, NULL, "",
and 0. I've reduced it to two in the db, removing the option for NULL, and
setting the default value to 0, however, we need to verify that we don't ever
write out as "" as this needlessly complicates the indexing process,
critical for searching or limiting by status (e.g., availability). Also,
queries that attempt to write a NULL value to one of these fields will fail
(based on my tests).

This patch includes the following changes:

* Updated the database definition for notforloan, damaged, itemlost, and
wthdrawn in kohastructure.sql to forbid NULL and default to 0; MySQL
can't forbid other values (such as empty ""), so this has to be handled
at the application layer and REQUIRES further patching.

* Fixed the 'limit by availability' query node in Search.pm to use a
much less confusing definition of 'available'

* Added code to set values to 0 where they are NULL or empty ( "" ) for
notforloan, damaged, itemlost or wthdrawn in both the MARC and the items
table:

  * Biblio.pm -> AddBiblioAndItems
  * catalogue/updateitem.pl
  * SEE NOTE BELOW, REQUIRES UPDATE TO THE REST OF KOHA'S ITEM MGT!

* Removed code in bulkmarcimport.pl that sets notforloan status depending
  on item-level or bib-level itemtype -- that flag is designed to be set
  only to override the notforloan setting for the item's (or bib's,
  depending on the syspref) assigned itemtype (it doesn't need to override
  to 'for loan', only to 'not for loan').

  added $dbh->do("truncate zebraqueue"); when operation is 'delete'

* I updated some notes in catalogue/updateitem.pl as to why ModItem can't be
used -- we don't have _a_ place where we can change the item and marc :/

  I've tested the following:

  bulkmarcimport.pl..........................MARC/items OK
  Staged Records Import......................NOT OK
  updateitem.pl (via moredetail.pl)..........MARC/items OK
  circulation.pl.............................NOT OK
  returns.pl.................................NOT OK
  addbiblio.pl...............................NOT OK
  additem.pl.................................NOT OK

Basically, there isn't a single place to apply this patch that will
update both item data and MARC data in one place ... a future patch
needs to address this issue.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-03 16:23:04 -06:00
..
22_to_30 Adding rebuild field 100$a for Unimarc 2007-12-20 18:40:43 -06:00
build6xx.pl C4 and misc: permissions fixes 2007-12-13 19:00:34 -06:00
buildCOUNTRY.pl synch'ing 2.2 and head 2005-05-04 08:58:30 +00:00
buildEDITORS.pl rel_3_0 moved to HEAD 2007-03-09 14:52:58 +00:00
buildLANG.pl synch'ing 2.2 and head 2005-08-04 14:10:52 +00:00
bulkauthimport.pl fixing nomenclature on files in misc/, adding a few new utilities 2007-12-30 12:13:34 -06:00
bulkmarcimport.pl Fixing Database Definitions for Statuses *PARTIAL* 2008-01-03 16:23:04 -06:00
merge_authority.pl fixing nomenclature on files in misc/, adding a few new utilities 2007-12-30 12:13:34 -06:00
rebuild_nozebra.pl Escaping the $title in the regexes with \Q and \E to handle nested quantifiers 2008-01-03 01:20:40 -06:00
rebuild_zebra.pl rebuild_zebra : directories updated 2008-01-03 00:55:12 -06:00