Merge remote branch 'kc/new/bug_4885' into kcmaster
authorChris Cormack <chrisc@catalyst.net.nz>
Sun, 27 Feb 2011 21:11:09 +0000 (10:11 +1300)
committerChris Cormack <chrisc@catalyst.net.nz>
Sun, 27 Feb 2011 21:11:09 +0000 (10:11 +1300)
Conflicts:
opac/opac-detail.pl

512 files changed:
-- [new file with mode: 0644]
C4/Auth.pm
C4/AuthoritiesMarc.pm
C4/Barcodes.pm
C4/Biblio.pm
C4/Branch.pm
C4/Charset.pm
C4/Circulation.pm
C4/Creators/Lib.pm
C4/Form/MessagingPreferences.pm
C4/Items.pm
C4/Koha.pm
C4/Members.pm
C4/Members/Messaging.pm
C4/Overdues.pm
C4/SIP/Sip.pm
C4/Search.pm
C4/Serials.pm
C4/ShelfBrowser.pm [new file with mode: 0644]
C4/XSLT.pm
acqui/addorderiso2709.pl
acqui/basketgroup.pl
acqui/neworderempty.pl
admin/auth_subfields_structure.pl
admin/auth_tag_structure.pl
admin/authorised_values.pl
admin/branches.pl
admin/itemtypes.pl
admin/marc_subfields_structure.pl
admin/marctagstructure.pl
admin/systempreferences.pl
authorities/authorities-home.pl
catalogue/MARCdetail.pl
catalogue/moredetail.pl
catalogue/showmarc.pl
cataloguing/addbiblio.pl
cataloguing/additem.pl
cataloguing/moveitem.pl
circ/branchoverdues.pl
circ/returns.pl
circ/waitingreserves.pl
docs/history.txt
etc/zebradb/marc_defs/marc21/authorities/record.abs
etc/zebradb/marc_defs/marc21/biblios/record.abs
installer/data/mysql/de-DE/mandatory/subtag_registry.sql
installer/data/mysql/de-DE/mandatory/sysprefs.sql
installer/data/mysql/de-DE/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql
installer/data/mysql/en/mandatory/subtag_registry.sql
installer/data/mysql/en/mandatory/sysprefs.sql
installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql
installer/data/mysql/en/optional/auth_val.sql
installer/data/mysql/fr-FR/1-Obligatoire/subtag_registry.sql
installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql
installer/data/mysql/fr-FR/2-Optionel/sample_news.sql
installer/data/mysql/fr-FR/marcflavour/marc21/Obligatoire/marc21_framework_DEFAULT.sql
installer/data/mysql/it-IT/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql
installer/data/mysql/it-IT/necessari/subtag_registry.sql
installer/data/mysql/it-IT/necessari/sysprefs.sql
installer/data/mysql/kohastructure.sql
installer/data/mysql/pl-PL/mandatory/subtag_registry.sql
installer/data/mysql/pl-PL/mandatory/sysprefs.sql
installer/data/mysql/pl-PL/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql
installer/data/mysql/ru-RU/mandatory/subtag_registry.sql
installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql
installer/data/mysql/uk-UA/mandatory/subtag_registry.sql
installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/prog/en/css/login.css
koha-tmpl/intranet-tmpl/prog/en/css/preferences.css
koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css
koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-menu.inc
koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc
koha-tmpl/intranet-tmpl/prog/en/includes/header.inc
koha-tmpl/intranet-tmpl/prog/en/includes/members-menu.inc
koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc
koha-tmpl/intranet-tmpl/prog/en/includes/patron-toolbar.inc
koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc
koha-tmpl/intranet-tmpl/prog/en/js/basket.js
koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js
koha-tmpl/intranet-tmpl/prog/en/lib/calendar/calendar.js
koha-tmpl/intranet-tmpl/prog/en/modules/about.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_tag_structure.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/authtypes.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced-content.pref [deleted file]
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n-l10n.pref [deleted file]
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/local-use.pref [deleted file]
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/local_use.pref [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff-client.pref [deleted file]
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web-services.pref [deleted file]
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/auth.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchoverdues.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/labels/search.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/maint/catmaintain.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview-slip.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tmpl
koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/bd.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/cd.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/cdrom.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/dossier_de_presse.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/dvd.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/dvd_musical.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/livre.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/livre_ancien.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/livre_artiste.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/livre_audio.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/livre_en_gros_caracteres.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/livre_multimedia.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/partition.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/revue.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/vhs.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/addtocart.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/addtoshelf.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/audiobook-cd.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/audiobook.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/beginner-reader.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/big-book-icon.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-bag-icon.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-author-search.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-biography.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-mystery.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-non-fiction.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-sifi.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-subject-search.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-title-search.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-western.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-large-print.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/card.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/cd-rom-icon.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/clear-book-bag.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/detail.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/faculty-course-manual.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/icon-refrence.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/keyword-search.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/music-cd.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/newspaper-icon.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/videocassette.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/vynal-sound-recording.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc
koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc
koha-tmpl/opac-tmpl/prog/en/includes/opac-topissues.inc
koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc
koha-tmpl/opac-tmpl/prog/en/js/tags.js
koha-tmpl/opac-tmpl/prog/en/lib/calendar/calendar.js
koha-tmpl/opac-tmpl/prog/en/modules/errors/400.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/errors/401.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/errors/402.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/errors/403.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/errors/404.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/errors/500.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/ilsdi.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/kohaerror.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-addbybiblionumber.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-alert-subscribe.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-auth.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-authorities-home.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-authoritiesdetail.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-authoritiessearchresultlist.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-basket.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-browser.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-downloadcart.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-downloadshelf.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-full-serial-issues.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-passwd.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-privacy.tmpl [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-results-grouped.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-review.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-search-history.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-sendbasketform.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-sendshelfform.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-serial-issues.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-showreviews.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-tags.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-tags_subject.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-topissues.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-userdetails.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tmpl
koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/bd.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/cd.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/cdrom.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/dossier_de_presse.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/dvd.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/dvd_musical.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/livre.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/livre_ancien.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/livre_artiste.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/livre_audio.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/livre_en_gros_caracteres.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/livre_multimedia.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/partition.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/revue.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/vhs.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/addtocart.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/addtoshelf.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/audiobook-cd.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/audiobook.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/beginner-reader.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/big-book-icon.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-bag-icon.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-author-search.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-biography.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-mystery.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-non-fiction.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-sifi.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-subject-search.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-title-search.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-western.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-large-print.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/card.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/cd-rom-icon.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/clear-book-bag.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/detail.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/faculty-course-manual.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/icon-refrence.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/keyword-search.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/music-cd.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/newspaper-icon.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/videocassette.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/vynal-sound-recording.png [new file with mode: 0644]
kohaversion.pl
members/memberentry.pl
members/members-home.pl
members/moremember.pl
members/readingrec.pl
members/update-child.pl
misc/cronjobs/overdue_notices.pl
misc/installer_devel_notes/data/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql [deleted file]
misc/installer_devel_notes/data/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.txt [deleted file]
misc/installer_devel_notes/data/en/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql [deleted file]
misc/installer_devel_notes/data/en/marcflavour/marc21/optional/marc21_simple_bib_frameworks.txt [deleted file]
misc/installer_devel_notes/data/en/marcflavour/unimarc/mandatory/unimarc_framework_DEFAULT.sql [deleted file]
misc/installer_devel_notes/data/en/marcflavour/unimarc/mandatory/unimarc_framework_DEFAULT.txt [deleted file]
misc/translator/LangInstaller.pm
opac/opac-ISBDdetail.pl
opac/opac-MARCdetail.pl
opac/opac-addbybiblionumber.pl
opac/opac-alert-subscribe.pl
opac/opac-authorities-home.pl
opac/opac-authoritiesdetail.pl
opac/opac-basket.pl
opac/opac-browser.pl
opac/opac-detail.pl
opac/opac-main.pl
opac/opac-privacy.pl [new file with mode: 0755]
opac/opac-renew.pl
opac/opac-reserve.pl
opac/opac-review.pl
opac/opac-search.pl
opac/opac-sendbasket.pl
opac/opac-shelves.pl
opac/opac-showmarc.pl
opac/opac-showreviews.pl
opac/opac-suggestions.pl
opac/opac-tags_subject.pl
opac/opac-topissues.pl
opac/opac-userupdate.pl
serials/serials-collection.pl
serials/serials-edit.pl
t/00-load.t
t/Amazon.t [deleted file]
t/Auth_with_cas.t [deleted file]
t/Biblio.t [deleted file]
t/Debug.t
t/External_BakerTaylor.t [deleted file]
t/Koha.t
t/Members.t [deleted file]
t/Output_JSONStream.t
t/Record.t [deleted file]
t/Reports_Guided.t [deleted file]
t/Serials.t [deleted file]
t/Service.t [deleted file]
t/Tags.t [deleted file]
t/UploadedFile.t [deleted file]
t/VirtualShelves_Page.t [deleted file]
t/XISBN.t [deleted file]
t/database_dependent.pl [deleted file]
t/db_dependent/Accounts.t [new file with mode: 0644]
t/db_dependent/Amazon.t [new file with mode: 0755]
t/db_dependent/Auth.t [new file with mode: 0644]
t/db_dependent/Auth_with_cas.t [new file with mode: 0755]
t/db_dependent/BackgroundJob.t [new file with mode: 0644]
t/db_dependent/Biblio.t [new file with mode: 0755]
t/db_dependent/External_BakerTaylor.t [new file with mode: 0755]
t/db_dependent/Members.t [new file with mode: 0755]
t/db_dependent/Record.t [new file with mode: 0755]
t/db_dependent/Reports_Guided.t [new file with mode: 0755]
t/db_dependent/Serials_2.t [new file with mode: 0644]
t/db_dependent/Service.t [new file with mode: 0755]
t/db_dependent/Tags.t [new file with mode: 0755]
t/db_dependent/UploadedFile.t [new file with mode: 0755]
t/db_dependent/VirtualShelves_Page.t [new file with mode: 0755]
t/db_dependent/XISBN.t [new file with mode: 0755]
t/db_dependent/database_dependent.pl [new file with mode: 0644]
t/db_dependent/lib/KohaTest.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Accounts.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Acquisition.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Acquisition/GetHistory.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Acquisition/GetLateOrders.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Acquisition/GetParcel.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Acquisition/GetParcels.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Acquisition/GetPendingOrders.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Acquisition/NewOrder.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/AuthoritiesMarc.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Biblio.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Biblio/GetNoZebraIndexes.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Biblio/ModBiblio.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Biblio/get_biblio_authorised_values.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Branch.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Branch/GetBranches.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Breeding.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Calendar.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Calendar/New.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Category.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Circulation.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Circulation/AddIssue.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Circulation/GetUpcomingDueIssues.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Circulation/MarkIssueReturned.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Context.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Context/preference.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Dates.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Dates/Usage.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Heading.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Heading/MARC21.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/ImportBatch.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/ImportBatch/AddImportBatch.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/ImportBatch/AddItemsToImportBiblio.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/ImportBatch/BatchStageCommitRevert.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/ImportBatch/GetImportBatch.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/ImportBatch/GetImportRecordMarc.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/ImportBatch/GetZ3950BatchId.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Installer.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Installer/SqlScripts.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Installer/get_file_path_from_name.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/ItemCirculationAlertPreference.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/ItemType.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Items.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Items/ColumnFixes.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Items/GetItemsForInventory.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Items/ModItemsFromMarc.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Items/SetDefaults.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Koha.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Koha/displayServers.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Koha/get_itemtypeinfos_of.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Koha/getitemtypeimagedir.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Letters.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Letters/GetLetter.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Letters/GetLetters.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Log.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Members.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Members/AttributeTypes.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Members/DebarMember.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Members/GetMember.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Members/GetMemberDetails.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Members/ModMember.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Message.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/NewsChannels.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Overdues.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Overdues/GetBranchcodesWithOverdueRules.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Overdues/GetOverdues.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Print.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Reserves.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/SMS.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/SMS/send_sms.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Scripts.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Scripts/longoverdue.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Search.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Search/NoZebra.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Search/SimpleSearch.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Serials.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Suggestions.pm [new file with mode: 0644]
t/db_dependent/lib/KohaTest/Z3950.pm [new file with mode: 0644]
t/lib/KohaTest.pm [deleted file]
t/lib/KohaTest/Accounts.pm [deleted file]
t/lib/KohaTest/Acquisition.pm [deleted file]
t/lib/KohaTest/Acquisition/GetHistory.pm [deleted file]
t/lib/KohaTest/Acquisition/GetLateOrders.pm [deleted file]
t/lib/KohaTest/Acquisition/GetParcel.pm [deleted file]
t/lib/KohaTest/Acquisition/GetParcels.pm [deleted file]
t/lib/KohaTest/Acquisition/GetPendingOrders.pm [deleted file]
t/lib/KohaTest/Acquisition/NewOrder.pm [deleted file]
t/lib/KohaTest/AuthoritiesMarc.pm [deleted file]
t/lib/KohaTest/Biblio.pm [deleted file]
t/lib/KohaTest/Biblio/GetNoZebraIndexes.pm [deleted file]
t/lib/KohaTest/Biblio/ModBiblio.pm [deleted file]
t/lib/KohaTest/Biblio/get_biblio_authorised_values.pm [deleted file]
t/lib/KohaTest/Branch.pm [deleted file]
t/lib/KohaTest/Branch/GetBranches.pm [deleted file]
t/lib/KohaTest/Breeding.pm [deleted file]
t/lib/KohaTest/Calendar.pm [deleted file]
t/lib/KohaTest/Calendar/New.pm [deleted file]
t/lib/KohaTest/Category.pm [deleted file]
t/lib/KohaTest/Circulation.pm [deleted file]
t/lib/KohaTest/Circulation/AddIssue.pm [deleted file]
t/lib/KohaTest/Circulation/GetUpcomingDueIssues.pm [deleted file]
t/lib/KohaTest/Circulation/MarkIssueReturned.pm [deleted file]
t/lib/KohaTest/Context.pm [deleted file]
t/lib/KohaTest/Context/preference.pm [deleted file]
t/lib/KohaTest/Dates.pm [deleted file]
t/lib/KohaTest/Dates/Usage.pm [deleted file]
t/lib/KohaTest/Heading.pm [deleted file]
t/lib/KohaTest/Heading/MARC21.pm [deleted file]
t/lib/KohaTest/ImportBatch.pm [deleted file]
t/lib/KohaTest/ImportBatch/AddImportBatch.pm [deleted file]
t/lib/KohaTest/ImportBatch/AddItemsToImportBiblio.pm [deleted file]
t/lib/KohaTest/ImportBatch/BatchStageCommitRevert.pm [deleted file]
t/lib/KohaTest/ImportBatch/GetImportBatch.pm [deleted file]
t/lib/KohaTest/ImportBatch/GetImportRecordMarc.pm [deleted file]
t/lib/KohaTest/ImportBatch/GetZ3950BatchId.pm [deleted file]
t/lib/KohaTest/Installer.pm [deleted file]
t/lib/KohaTest/Installer/SqlScripts.pm [deleted file]
t/lib/KohaTest/Installer/get_file_path_from_name.pm [deleted file]
t/lib/KohaTest/ItemCirculationAlertPreference.pm [deleted file]
t/lib/KohaTest/ItemType.pm [deleted file]
t/lib/KohaTest/Items.pm [deleted file]
t/lib/KohaTest/Items/ColumnFixes.pm [deleted file]
t/lib/KohaTest/Items/GetItemsForInventory.pm [deleted file]
t/lib/KohaTest/Items/ModItemsFromMarc.pm [deleted file]
t/lib/KohaTest/Items/SetDefaults.pm [deleted file]
t/lib/KohaTest/Koha.pm [deleted file]
t/lib/KohaTest/Koha/displayServers.pm [deleted file]
t/lib/KohaTest/Koha/get_itemtypeinfos_of.pm [deleted file]
t/lib/KohaTest/Koha/getitemtypeimagedir.pm [deleted file]
t/lib/KohaTest/Letters.pm [deleted file]
t/lib/KohaTest/Letters/GetLetter.pm [deleted file]
t/lib/KohaTest/Letters/GetLetters.pm [deleted file]
t/lib/KohaTest/Log.pm [deleted file]
t/lib/KohaTest/Members.pm [deleted file]
t/lib/KohaTest/Members/AttributeTypes.pm [deleted file]
t/lib/KohaTest/Members/DebarMember.pm [deleted file]
t/lib/KohaTest/Members/GetMember.pm [deleted file]
t/lib/KohaTest/Members/GetMemberDetails.pm [deleted file]
t/lib/KohaTest/Members/ModMember.pm [deleted file]
t/lib/KohaTest/Message.pm [deleted file]
t/lib/KohaTest/NewsChannels.pm [deleted file]
t/lib/KohaTest/Overdues.pm [deleted file]
t/lib/KohaTest/Overdues/GetBranchcodesWithOverdueRules.pm [deleted file]
t/lib/KohaTest/Overdues/GetOverdues.pm [deleted file]
t/lib/KohaTest/Print.pm [deleted file]
t/lib/KohaTest/Reserves.pm [deleted file]
t/lib/KohaTest/SMS.pm [deleted file]
t/lib/KohaTest/SMS/send_sms.pm [deleted file]
t/lib/KohaTest/Scripts.pm [deleted file]
t/lib/KohaTest/Scripts/longoverdue.pm [deleted file]
t/lib/KohaTest/Search.pm [deleted file]
t/lib/KohaTest/Search/NoZebra.pm [deleted file]
t/lib/KohaTest/Search/SimpleSearch.pm [deleted file]
t/lib/KohaTest/Serials.pm [deleted file]
t/lib/KohaTest/Suggestions.pm [deleted file]
t/lib/KohaTest/Z3950.pm [deleted file]
tools/batchMod.pl
tools/export.pl
tools/inventory.pl

diff --git a/-- b/--
new file mode 100644 (file)
index 0000000..e69de29
index 2f13b86..39eb50f 100644 (file)
@@ -332,7 +332,7 @@ sub get_template_and_user {
             LoginSurname                 => C4::Context->userenv?C4::Context->userenv->{"surname"}:"Inconnu",
             TagsEnabled                  => C4::Context->preference("TagsEnabled"),
             hide_marc                    => C4::Context->preference("hide_marc"),
-            'item-level_itypes'          => C4::Context->preference('item-level_itypes'),
+            item_level_itypes            => C4::Context->preference('item-level_itypes'),
             patronimages                 => C4::Context->preference("patronimages"),
             singleBranchMode             => C4::Context->preference("singleBranchMode"),
             XSLTDetailsDisplay           => C4::Context->preference("XSLTDetailsDisplay"),
@@ -418,6 +418,7 @@ sub get_template_and_user {
             OpacNav                   => "" . C4::Context->preference("OpacNav"),
             OpacPasswordChange        => C4::Context->preference("OpacPasswordChange"),
             OPACPatronDetails        => C4::Context->preference("OPACPatronDetails"),
+            OPACPrivacy               => C4::Context->preference("OPACPrivacy"),
             OPACFinesTab              => C4::Context->preference("OPACFinesTab"),
             OpacTopissue              => C4::Context->preference("OpacTopissue"),
             RequestOnOpac             => C4::Context->preference("RequestOnOpac"),
@@ -455,6 +456,8 @@ sub get_template_and_user {
             SyndeticsSeries              => C4::Context->preference("SyndeticsSeries"),
             SyndeticsCoverImageSize      => C4::Context->preference("SyndeticsCoverImageSize"),
         );
+
+        $template->param(OpacPublic => '1') if ($template->param( 'loggedinusername') || C4::Context->preference("OpacPublic"));
     }
        $template->param(listloop=>[{shelfname=>"Freelist", shelfnumber=>110}]);
     return ( $template, $borrowernumber, $cookie, $flags);
@@ -941,8 +944,10 @@ sub checkauth {
         intranetuserjs     => C4::Context->preference("intranetuserjs"),
         IndependantBranches=> C4::Context->preference("IndependantBranches"),
         AutoLocation       => C4::Context->preference("AutoLocation"),
-               wrongip            => $info{'wrongip'}
+               wrongip            => $info{'wrongip'},
     );
+
+    $template->param( OpacPublic => C4::Context->preference("OpacPublic"));
     $template->param( loginprompt => 1 ) unless $info{'nopermission'};
 
     if ($cas) { 
index 9421be9..9315e55 100644 (file)
@@ -220,6 +220,7 @@ sub SearchAuthorities {
         my $dosearch;
         my $and=" \@and " ;
         my $q2;
+        my $attr_cnt = 0;
         for(my $i = 0 ; $i <= $#{$value} ; $i++)
         {
             if (@$value[$i]){
@@ -246,15 +247,16 @@ sub SearchAuthorities {
                 }
                 $attr =$attr."\"".@$value[$i]."\"";
                 $q2 .=$attr;
-            $dosearch=1;
+                $dosearch=1;
+                ++$attr_cnt;
             }#if value
         }
         ##Add how many queries generated
-        if ($query=~/\S+/){    
-          $query= $and.$query.$q2 
+        if ($query=~/\S+/){
+          $query= $and x $attr_cnt . $query . $q2;
         } else {
-          $query=$q2;    
-        }         
+          $query= $q2;
+        }
         ## Adding order
         #$query=' @or  @attr 7=2 @attr 1=Heading 0 @or  @attr 7=1 @attr 1=Heading 1'.$query if ($sortby eq "HeadingDsc");
         my $orderstring= ($sortby eq "HeadingAsc"?
@@ -264,8 +266,9 @@ sub SearchAuthorities {
                             '@attr 7=2 @attr 1=Heading 0'
                            :''
                         );            
-        $query=($query?"\@or $orderstring $query":"\@or \@attr 1=_ALLRECORDS \@attr 2=103 '' $orderstring ");
-        
+        $query=($query?$query:"\@attr 1=_ALLRECORDS \@attr 2=103 ''");
+        $query="\@or $orderstring $query" if $orderstring;
+
         $offset=0 unless $offset;
         my $counter = $offset;
         $length=10 unless $length;
@@ -716,8 +719,8 @@ sub DelAuthority {
     my $dbh=C4::Context->dbh;
 
     ModZebra($authid,"recordDelete","authorityserver",GetAuthority($authid),undef);
-    $dbh->do("delete from auth_header where authid=$authid") ;
-
+    my $sth = prepare("DELETE FROM auth_header WHERE authid=?");
+    $sth->execute($authid);
 }
 
 sub ModAuthority {
index 176d878..a528bd9 100644 (file)
@@ -135,14 +135,11 @@ sub next_value ($;$) {
                # Note, this enlargement might be undesireable for some barcode formats.
                # Those should override next_value() to work accordingly.
        $incr++;
-       my $width = $self->width || undef;
-       # we would want to use %$x.$xd, but that would break on large values, like 2160700004168
-       # so we let the object tell us if it has a width to focus on.  If not, we use float.
-       my $format = ($width ? '%'."$width.$width".'d' : '%.0f');
-       $debug and warn "sprintf(\"$format\",$incr)";
+
+       $debug and warn "$incr";
        $head = $self->process_head($head,$max,$specific);
        $tail = $self->process_tail($tail,$max,$specific);
-       my $next_value = $head . sprintf($format,$incr) . $tail;
+       my $next_value = $head . $incr . $tail;
        $debug and print STDERR "(  next ) max barcode found: $next_value\n";
        return $next_value;
 }
index 232ffb3..8ea5da5 100644 (file)
@@ -83,7 +83,6 @@ BEGIN {
       &GetMarcStructure
       &GetMarcFromKohaField
       &GetFrameworkCode
-      &GetPublisherNameFromIsbn
       &TransformKohaToMarc
 
       &CountItemsIssued
@@ -327,6 +326,14 @@ sub ModBiblio {
         $record->append_fields($field);
     }
 
+    foreach my $field ($record->fields()) {
+        if (! $field->is_control_field()) {
+            if (scalar($field->subfields()) == 0) {
+                $record->delete_fields($field);
+            }
+        }
+    }
+
     # update biblionumber and biblioitemnumber in MARC
     # FIXME - this is assuming a 1 to 1 relationship between
     # biblios and biblioitems
@@ -1633,36 +1640,6 @@ sub GetFrameworkCode {
     return $frameworkcode;
 }
 
-=head2 GetPublisherNameFromIsbn
-
-    $name = GetPublishercodeFromIsbn($isbn);
-    if(defined $name){
-        ...
-    }
-
-=cut
-
-sub GetPublisherNameFromIsbn($) {
-    my $isbn = shift;
-    $isbn =~ s/[- _]//g;
-    $isbn =~ s/^0*//;
-    my @codes = ( split '-', DisplayISBN($isbn) );
-    my $code  = $codes[0] . $codes[1] . $codes[2];
-    my $dbh   = C4::Context->dbh;
-    my $query = qq{
-        SELECT distinct publishercode
-        FROM   biblioitems
-        WHERE  isbn LIKE ?
-        AND    publishercode IS NOT NULL
-        LIMIT 1
-    };
-    my $sth = $dbh->prepare($query);
-    $sth->execute("$code%");
-    my $name = $sth->fetchrow;
-    return $name if length $name;
-    return undef;
-}
-
 =head2 TransformKohaToMarc
 
     $record = TransformKohaToMarc( $hash )
@@ -1703,13 +1680,18 @@ sub TransformKohaToMarcOneField {
     }
     $sth->execute( $frameworkcode, $kohafieldname );
     if ( ( $tagfield, $tagsubfield ) = $sth->fetchrow ) {
+        my @values = split(/\s?\|\s?/, $value, -1);
+        
+        foreach my $itemvalue (@values){
         my $tag = $record->field($tagfield);
         if ($tag) {
-            $tag->update( $tagsubfield => $value );
+                $tag->add_subfields( $tagsubfield => $itemvalue );
             $record->delete_field($tag);
             $record->insert_fields_ordered($tag);
-        } else {
-            $record->add_fields( $tagfield, " ", " ", $tagsubfield => $value );
+            }
+            else {
+                $record->add_fields( $tagfield, " ", " ", $tagsubfield => $itemvalue );
+            }
         }
     }
     return $record;
@@ -1942,8 +1924,14 @@ sub TransformHtmlToMarc {
             if ( $tag < 10 ) {                              # no code for theses fields
                                                             # in MARC editor, 000 contains the leader.
                 if ( $tag eq '000' ) {
-                    $record->leader( $cgi->param( $params->[ $j + 1 ] ) ) if length( $cgi->param( $params->[ $j + 1 ] ) ) == 24;
-
+                    # Force a fake leader even if not provided to avoid crashing
+                    # during decoding MARC record containing UTF-8 characters
+                    $record->leader(
+                        length( $cgi->param($params->[$j+1]) ) == 24
+                        ? $cgi->param( $params->[ $j + 1 ] )
+                        : '     nam a22        4500'
+                       )
+                    ;
                     # between 001 and 009 (included)
                 } elsif ( $cgi->param( $params->[ $j + 1 ] ) ne '' ) {
                     $newfield = MARC::Field->new( $tag, $cgi->param( $params->[ $j + 1 ] ), );
index db7a87f..1f26e35 100644 (file)
@@ -160,7 +160,7 @@ sub GetBranchesLoop (;$$) {  # since this is what most pages want anyway
     my $onlymine = @_ ? shift : onlymine();
     my $branches = GetBranches($onlymine);
     my @loop;
-    foreach (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) {
+    foreach ( sort { uc($branches->{$a}->{branchname}) cmp uc($branches->{$b}->{branchname}) } keys %$branches ) {
         push @loop, {
             value => $_,
             selected => ($_ eq $branch) ? 1 : 0, 
index b3b4b72..712bd85 100644 (file)
@@ -33,6 +33,7 @@ BEGIN {
     require Exporter;
     @ISA    = qw(Exporter);
     @EXPORT = qw(
+        NormalizeString
         IsStringUTF8ish
         MarcToUTF8Record
         SetUTF8Flag
@@ -148,27 +149,28 @@ sub SetUTF8Flag{
 
 =head2 NormalizeString
 
-    my $normalized_string=NormalizeString($string);
+    my $normalized_string=NormalizeString($string,$nfd,$transform);
 
 Given a string
-
-nfc : If you want to set NFC and not NFD
+nfd : If you want to set NFD and not NFC
 transform : If you expect all the signs to be removed
+
 Sets the PERL UTF8 Flag on your initial data if need be
-and applies cleaning if required 
+and applies cleaning if required
 
-Returns a utf8 NFD normalized string
+Returns a utf8 NFC normalized string
 
 Sample code :
-    my $string=NormalizeString ("l'ornithoptère");
-    #results into ornithoptère in NFD form and sets UTF8 Flag
+   my $string=NormalizeString ("l'ornithoptère");
+   #results into ornithoptère in NFC form and sets UTF8 Flag
 
 =cut
 
+
 sub NormalizeString{
-       my ($string,$nfc,$transform)=@_;
+       my ($string,$nfd,$transform)=@_;
        utf8::decode($string) unless (utf8::is_utf8($string));
-       if ($nfc){
+       if ($nfd){
                $string= NFD($string);
        }
        else {
index b741794..f7846ac 100644 (file)
@@ -1516,7 +1516,7 @@ sub AddReturn {
         }
 
         if ($borrowernumber) {
-            MarkIssueReturned($borrowernumber, $item->{'itemnumber'}, $circControlBranch);
+            MarkIssueReturned($borrowernumber, $item->{'itemnumber'}, $circControlBranch, '', $borrower->{'privacy'});
             $messages->{'WasReturned'} = 1;    # FIXME is the "= 1" right?  This could be the borrower hash.
         }
 
@@ -1621,7 +1621,7 @@ sub AddReturn {
 
 =head2 MarkIssueReturned
 
-  MarkIssueReturned($borrowernumber, $itemnumber, $dropbox_branch, $returndate);
+  MarkIssueReturned($borrowernumber, $itemnumber, $dropbox_branch, $returndate, $privacy);
 
 Unconditionally marks an issue as being returned by
 moving the C<issues> row to C<old_issues> and
@@ -1633,6 +1633,9 @@ it's safe to do this, i.e. last non-holiday > issuedate.
 if C<$returndate> is specified (in iso format), it is used as the date
 of the return. It is ignored when a dropbox_branch is passed in.
 
+C<$privacy> contains the privacy parameter. If the patron has set privacy to 2,
+the old_issue is immediately anonymised
+
 Ideally, this function would be internal to C<C4::Circulation>,
 not exported, but it is currently needed by one 
 routine in C<C4::Accounts>.
@@ -1640,7 +1643,7 @@ routine in C<C4::Accounts>.
 =cut
 
 sub MarkIssueReturned {
-    my ( $borrowernumber, $itemnumber, $dropbox_branch, $returndate ) = @_;
+    my ( $borrowernumber, $itemnumber, $dropbox_branch, $returndate, $privacy ) = @_;
     my $dbh   = C4::Context->dbh;
     my $query = "UPDATE issues SET returndate=";
     my @bind;
@@ -1664,6 +1667,16 @@ sub MarkIssueReturned {
                                   WHERE borrowernumber = ?
                                   AND itemnumber = ?");
     $sth_copy->execute($borrowernumber, $itemnumber);
+    # anonymise patron checkout immediately if $privacy set to 2 and AnonymousPatron is set to a valid borrowernumber
+    if ( $privacy == 2) {
+        # The default of 0 does not work due to foreign key constraints
+        # The anonymisation will fail quietly if AnonymousPatron is not a valid entry
+        my $anonymouspatron = (C4::Context->preference('AnonymousPatron')) ? C4::Context->preference('AnonymousPatron') : 0;
+        my $sth_ano = $dbh->prepare("UPDATE old_issues SET borrowernumber=?
+                                  WHERE borrowernumber = ?
+                                  AND itemnumber = ?");
+       $sth_ano->execute($anonymouspatron, $borrowernumber, $itemnumber);
+    }
     my $sth_del  = $dbh->prepare("DELETE FROM issues
                                   WHERE borrowernumber = ?
                                   AND itemnumber = ?");
@@ -2417,11 +2430,14 @@ sub DeleteTransfer {
 
 =head2 AnonymiseIssueHistory
 
-  $rows = AnonymiseIssueHistory($borrowernumber,$date)
+  $rows = AnonymiseIssueHistory($date,$borrowernumber)
 
 This function write NULL instead of C<$borrowernumber> given on input arg into the table issues.
 if C<$borrowernumber> is not set, it will delete the issue history for all borrower older than C<$date>.
 
+If c<$borrowernumber> is set, it will delete issue history for only that borrower, regardless of their opac privacy
+setting (force delete).
+
 return the number of affected rows.
 
 =cut
@@ -2432,12 +2448,24 @@ sub AnonymiseIssueHistory {
     my $dbh            = C4::Context->dbh;
     my $query          = "
         UPDATE old_issues
-        SET    borrowernumber = NULL
-        WHERE  returndate < '".$date."'
+        SET    borrowernumber = ?
+        WHERE  returndate < ?
           AND borrowernumber IS NOT NULL
     ";
-    $query .= " AND borrowernumber = '".$borrowernumber."'" if defined $borrowernumber;
-    my $rows_affected = $dbh->do($query);
+
+    # The default of 0 does not work due to foreign key constraints
+    # The anonymisation will fail quietly if AnonymousPatron is not a valid entry
+    my $anonymouspatron = (C4::Context->preference('AnonymousPatron')) ? C4::Context->preference('AnonymousPatron') : 0;
+    my @bind_params = ($anonymouspatron, $date);
+    if (defined $borrowernumber) {
+       $query .= " AND borrowernumber = ?";
+       push @bind_params, $borrowernumber;
+    } else {
+       $query .= " AND (SELECT privacy FROM borrowers WHERE borrowers.borrowernumber=old_issues.borrowernumber) <> 0";
+    }
+    my $sth = $dbh->prepare($query);
+    $sth->execute(@bind_params);
+    my $rows_affected = $sth->rows;  ### doublecheck row count return function
     return $rows_affected;
 }
 
index ded0a5d..8fd25fd 100644 (file)
@@ -306,7 +306,7 @@ sub get_label_summary {
     my %params = @_;
     my $label_number = 0;
     my @label_summaries = ();
-    my $query = "     SELECT b.title, b.author, bi.itemtype, i.barcode, i.biblionumber
+    my $query = "     SELECT b.title, b.author, bi.itemtype, i.barcode, i.biblionumber, i.itype
                       FROM creator_batches AS c LEFT JOIN items AS i ON (c.item_number=i.itemnumber)
                       LEFT JOIN biblioitems AS bi ON (i.biblioitemnumber=bi.biblioitemnumber)
                       LEFT JOIN biblio AS b ON (bi.biblionumber=b.biblionumber)
@@ -329,7 +329,7 @@ sub get_label_summary {
         # should not know that it's part of a web app
         $record->{'title'} = '<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=' . $record->{'biblionumber'} . '"> ' . $record->{'title'} . '</a>';
         $label_summary->{'_summary'} = $record->{'title'} . " | " . ($record->{'author'} ? $record->{'author'} : 'N/A');
-        $label_summary->{'_item_type'} = $record->{'itemtype'};
+        $label_summary->{'_item_type'} = C4::Context->preference("item-level_itypes") ? $record->{'itype'} : $record->{'itemtype'};
         $label_summary->{'_barcode'} = $record->{'barcode'};
         $label_summary->{'_item_number'} = $item->{'item_number'};
         $label_summary->{'_label_id'} = $item->{'label_id'};
index 22b2048..bd1c22f 100644 (file)
@@ -132,7 +132,7 @@ sub set_form_values {
             } ( 0..30 ); # FIXME: 30 is a magic number.
         }
         foreach my $transport ( @{$pref->{'transports'}} ) {
-            $option->{'transport-'.$transport} = 'checked="checked"';
+            $option->{'transport_'.$transport} = 'checked="checked"';
         }
         $option->{'digest'} = 'checked="checked"' if $pref->{'wants_digest'};
     }
index a7c190c..05df0c5 100644 (file)
@@ -1,6 +1,7 @@
 package C4::Items;
 
 # Copyright 2007 LibLime, Inc.
+# Parts Copyright Biblibre 2010
 #
 # This file is part of Koha.
 #
@@ -402,7 +403,7 @@ my %default_values_for_mod_from_marc = (
     'items.cn_source'    => undef, 
     copynumber           => undef, 
     damaged              => 0,
-    dateaccessioned      => undef, 
+#    dateaccessioned      => undef,
     enumchron            => undef, 
     holdingbranch        => undef, 
     homebranch           => undef, 
@@ -429,18 +430,18 @@ sub ModItemFromMarc {
     my $biblionumber = shift;
     my $itemnumber = shift;
 
-    my $dbh = C4::Context->dbh;
-    my $frameworkcode = GetFrameworkCode( $biblionumber );
-       my ($itemtag,$itemsubfield)=GetMarcFromKohaField("items.itemnumber",$frameworkcode);
-       
-       my $localitemmarc=MARC::Record->new;
-       $localitemmarc->append_fields($item_marc->field($itemtag));
-    my $item = &TransformMarcToKoha( $dbh, $localitemmarc, $frameworkcode, 'items');
-    foreach my $item_field (keys %default_values_for_mod_from_marc) {
-        $item->{$item_field} = $default_values_for_mod_from_marc{$item_field} unless exists $item->{$item_field};
+    my $dbh           = C4::Context->dbh;
+    my $frameworkcode = GetFrameworkCode($biblionumber);
+    my ( $itemtag, $itemsubfield ) = GetMarcFromKohaField( "items.itemnumber", $frameworkcode );
+
+    my $localitemmarc = MARC::Record->new;
+    $localitemmarc->append_fields( $item_marc->field($itemtag) );
+    my $item = &TransformMarcToKoha( $dbh, $localitemmarc, $frameworkcode, 'items' );
+    foreach my $item_field ( keys %default_values_for_mod_from_marc ) {
+        $item->{$item_field} = $default_values_for_mod_from_marc{$item_field} unless (exists $item->{$item_field});
     }
-    my $unlinked_item_subfields = _get_unlinked_item_subfields($localitemmarc, $frameworkcode);
-   
+    my $unlinked_item_subfields = _get_unlinked_item_subfields( $localitemmarc, $frameworkcode );
+
     return ModItem($item, $biblionumber, $itemnumber, $dbh, $frameworkcode, $unlinked_item_subfields); 
 }
 
@@ -954,7 +955,7 @@ $statushash requires a hashref that has the authorized values fieldname (intems.
 =cut
 
 sub GetItemsForInventory {
-    my ( $minlocation, $maxlocation,$location, $itemtype, $ignoreissued, $datelastseen, $branch, $offset, $size, $statushash ) = @_;
+    my ( $minlocation, $maxlocation,$location, $itemtype, $ignoreissued, $datelastseen, $branchcode, $branch, $offset, $size, $statushash ) = @_;
     my $dbh = C4::Context->dbh;
     my ( @bind_params, @where_strings );
 
@@ -993,10 +994,14 @@ END_SQL
         push @where_strings, 'items.location = ?';
         push @bind_params, $location;
     }
-    
-    if ( $branch ) {
+
+    if ( $branchcode ) {
+        if($branch eq "homebranch"){
         push @where_strings, 'items.homebranch = ?';
-        push @bind_params, $branch;
+        }else{
+            push @where_strings, 'items.holdingbranch = ?';
+        }
+        push @bind_params, $branchcode;
     }
     
     if ( $itemtype ) {
@@ -1763,6 +1768,9 @@ sub _do_column_fixes_for_mod {
     if (exists $item->{'location'} && !exists $item->{'permanent_location'}) {
         $item->{'permanent_location'} = $item->{'location'};
     }
+    if (exists $item->{'timestamp'}) {
+        delete $item->{'timestamp'};
+    }
 }
 
 =head2 _get_single_item_column
@@ -2024,21 +2032,31 @@ sub DelItemCheck {
     my $sth=$dbh->prepare("select * from issues i where i.itemnumber=?");
     $sth->execute($itemnumber);
 
-    my $onloan=$sth->fetchrow;
-
-    if ($onloan){
-        $error = "book_on_loan" 
-    }else{
-        # check it doesnt have a waiting reserve
-        $sth=$dbh->prepare("SELECT * FROM reserves WHERE (found = 'W' or found = 'T') AND itemnumber = ?");
-        $sth->execute($itemnumber);
-        my $reserve=$sth->fetchrow;
-        if ($reserve){
-            $error = "book_reserved";
-        }else{
-            DelItem($dbh, $biblionumber, $itemnumber);
-            return 1;
-        }
+    my $item = GetItem($itemnumber);
+    my $onloan = $sth->fetchrow;
+    if ($onloan) {
+        $error = "book_on_loan";
+    }
+    elsif (C4::Context->preference("IndependantBranches") and (C4::Context->userenv->{branch} ne $item->{C4::Context->preference("HomeOrHoldingBranch")||'homebranch'})){
+        $error = "not_same_branch";
+    } 
+    else {
+       if ($onloan){ 
+           $error = "book_on_loan" 
+       }
+       else {
+           # check it doesnt have a waiting reserve
+           $sth=$dbh->prepare("SELECT * FROM reserves WHERE (found = 'W' or found = 'T') AND itemnumber = ?");
+           $sth->execute($itemnumber);
+           my $reserve=$sth->fetchrow;
+           if ($reserve) {
+               $error = "book_reserved";
+           } 
+           else {
+               DelItem($dbh, $biblionumber, $itemnumber);
+               return 1;
+           }
+       }
     }
     return $error;
 }
@@ -2136,17 +2154,20 @@ sub _marc_from_item_hash {
                                 : ()  } keys %{ $item } }; 
 
     my $item_marc = MARC::Record->new();
-    foreach my $item_field (keys %{ $mungeditem }) {
-        my ($tag, $subfield) = GetMarcFromKohaField($item_field, $frameworkcode);
-        next unless defined $tag and defined $subfield; # skip if not mapped to MARC field
-        if (my $field = $item_marc->field($tag)) {
-            $field->add_subfields($subfield => $mungeditem->{$item_field});
-        } else {
-            my $add_subfields = [];
-            if (defined $unlinked_item_subfields and ref($unlinked_item_subfields) eq 'ARRAY' and $#$unlinked_item_subfields > -1) {
-                $add_subfields = $unlinked_item_subfields;
+    foreach my $item_field ( keys %{$mungeditem} ) {
+        my ( $tag, $subfield ) = GetMarcFromKohaField( $item_field, $frameworkcode );
+        next unless defined $tag and defined $subfield;    # skip if not mapped to MARC field
+        my @values = split(/\s?\|\s?/, $mungeditem->{$item_field}, -1);
+        foreach my $value (@values){
+            if ( my $field = $item_marc->field($tag) ) {
+                    $field->add_subfields( $subfield => $value );
+            } else {
+                my $add_subfields = [];
+                if (defined $unlinked_item_subfields and ref($unlinked_item_subfields) eq 'ARRAY' and $#$unlinked_item_subfields > -1) {
+                    $add_subfields = $unlinked_item_subfields;
+            }
+            $item_marc->add_fields( $tag, " ", " ", $subfield => $value, @$add_subfields );
             }
-            $item_marc->add_fields( $tag, " ", " ", $subfield =>  $mungeditem->{$item_field}, @$add_subfields);
         }
     }
 
index d10c52e..2bdcc28 100644 (file)
@@ -35,7 +35,6 @@ BEGIN {
        @ISA    = qw(Exporter);
        @EXPORT = qw(
                &slashifyDate
-               &DisplayISBN
                &subfield_is_koha_internal_p
                &GetPrinters &GetPrinter
                &GetItemTypes &getitemtypeinfo
@@ -106,106 +105,6 @@ sub slashifyDate {
     return ("$dateOut[2]/$dateOut[1]/$dateOut[0]");
 }
 
-
-=head2 DisplayISBN
-
-  my $string = DisplayISBN( $isbn );
-
-=cut
-
-sub DisplayISBN {
-    my ($isbn) = @_;
-    if (length ($isbn)<13){
-    my $seg1;
-    if ( substr( $isbn, 0, 1 ) <= 7 ) {
-        $seg1 = substr( $isbn, 0, 1 );
-    }
-    elsif ( substr( $isbn, 0, 2 ) <= 94 ) {
-        $seg1 = substr( $isbn, 0, 2 );
-    }
-    elsif ( substr( $isbn, 0, 3 ) <= 995 ) {
-        $seg1 = substr( $isbn, 0, 3 );
-    }
-    elsif ( substr( $isbn, 0, 4 ) <= 9989 ) {
-        $seg1 = substr( $isbn, 0, 4 );
-    }
-    else {
-        $seg1 = substr( $isbn, 0, 5 );
-    }
-    my $x = substr( $isbn, length($seg1) );
-    my $seg2;
-    if ( substr( $x, 0, 2 ) <= 19 ) {
-
-        # if(sTmp2 < 10) sTmp2 = "0" sTmp2;
-        $seg2 = substr( $x, 0, 2 );
-    }
-    elsif ( substr( $x, 0, 3 ) <= 699 ) {
-        $seg2 = substr( $x, 0, 3 );
-    }
-    elsif ( substr( $x, 0, 4 ) <= 8399 ) {
-        $seg2 = substr( $x, 0, 4 );
-    }
-    elsif ( substr( $x, 0, 5 ) <= 89999 ) {
-        $seg2 = substr( $x, 0, 5 );
-    }
-    elsif ( substr( $x, 0, 6 ) <= 9499999 ) {
-        $seg2 = substr( $x, 0, 6 );
-    }
-    else {
-        $seg2 = substr( $x, 0, 7 );
-    }
-    my $seg3 = substr( $x, length($seg2) );
-    $seg3 = substr( $seg3, 0, length($seg3) - 1 );
-    my $seg4 = substr( $x, -1, 1 );
-    return "$seg1-$seg2-$seg3-$seg4";
-    } else {
-      my $seg1;
-      $seg1 = substr( $isbn, 0, 3 );
-      my $seg2;
-      if ( substr( $isbn, 3, 1 ) <= 7 ) {
-          $seg2 = substr( $isbn, 3, 1 );
-      }
-      elsif ( substr( $isbn, 3, 2 ) <= 94 ) {
-          $seg2 = substr( $isbn, 3, 2 );
-      }
-      elsif ( substr( $isbn, 3, 3 ) <= 995 ) {
-          $seg2 = substr( $isbn, 3, 3 );
-      }
-      elsif ( substr( $isbn, 3, 4 ) <= 9989 ) {
-          $seg2 = substr( $isbn, 3, 4 );
-      }
-      else {
-          $seg2 = substr( $isbn, 3, 5 );
-      }
-      my $x = substr( $isbn, length($seg2) +3);
-      my $seg3;
-      if ( substr( $x, 0, 2 ) <= 19 ) {
-  
-          # if(sTmp2 < 10) sTmp2 = "0" sTmp2;
-          $seg3 = substr( $x, 0, 2 );
-      }
-      elsif ( substr( $x, 0, 3 ) <= 699 ) {
-          $seg3 = substr( $x, 0, 3 );
-      }
-      elsif ( substr( $x, 0, 4 ) <= 8399 ) {
-          $seg3 = substr( $x, 0, 4 );
-      }
-      elsif ( substr( $x, 0, 5 ) <= 89999 ) {
-          $seg3 = substr( $x, 0, 5 );
-      }
-      elsif ( substr( $x, 0, 6 ) <= 9499999 ) {
-          $seg3 = substr( $x, 0, 6 );
-      }
-      else {
-          $seg3 = substr( $x, 0, 7 );
-      }
-      my $seg4 = substr( $x, length($seg3) );
-      $seg4 = substr( $seg4, 0, length($seg4) - 1 );
-      my $seg5 = substr( $x, -1, 1 );
-      return "$seg1-$seg2-$seg3-$seg4-$seg5";       
-    }    
-}
-
 # FIXME.. this should be moved to a MARC-specific module
 sub subfield_is_koha_internal_p ($) {
     my ($subfield) = @_;
@@ -671,8 +570,9 @@ sub getImageSets {
 
     my @imagesets = (); # list of hasrefs of image set data to pass to template
     my @subdirectories = _getSubdirectoryNames( $paths->{'staff'}{'filesystem'} );
-
+warn $paths->{'staff'}{'filesystem'};
     foreach my $imagesubdir ( @subdirectories ) {
+       warn $imagesubdir;
         my @imagelist     = (); # hashrefs of image info
         my @imagenames = _getImagesFromDirectory( File::Spec->catfile( $paths->{'staff'}{'filesystem'}, $imagesubdir ) );
         my $imagesetactive = 0;
index 00716cd..fafc99b 100644 (file)
@@ -93,6 +93,7 @@ BEGIN {
        push @EXPORT, qw(
                &ModMember
                &changepassword
+         &ModPrivacy
        );
 
        #Delete data
@@ -2022,6 +2023,31 @@ sub DebarMember {
     
 }
 
+=head2 ModPrivacy
+
+=over 4
+
+my $success = ModPrivacy( $borrowernumber, $privacy );
+
+Update the privacy of a patron.
+
+return :
+true on success, false on failure
+
+=back
+
+=cut
+
+sub ModPrivacy {
+    my $borrowernumber = shift;
+    my $privacy = shift;
+    return unless defined $borrowernumber;
+    return unless $borrowernumber =~ /^\d+$/;
+
+    return ModMember( borrowernumber => $borrowernumber,
+                      privacy        => $privacy );
+}
+
 =head2 AddMessage
 
   AddMessage( $borrowernumber, $message_type, $message, $branchcode );
index bc0f81b..2b39f11 100644 (file)
@@ -213,7 +213,7 @@ END_SQL
         $choices->{ $row->{'message_name'} }->{'message_name'}         = $row->{'message_name'};
         $choices->{ $row->{'message_name'} }->{'takes_days'}           = $row->{'takes_days'};
         $choices->{ $row->{'message_name'} }->{'has_digest'}           = 1 if $row->{'is_digest'};
-        $choices->{ $row->{'message_name'} }->{'transport-' . $row->{'message_transport_type'}} = ' ';
+        $choices->{ $row->{'message_name'} }->{'transport_' . $row->{'message_transport_type'}} = ' ';
     }
 
     my @return = values %$choices;
index 032ca93..adba979 100644 (file)
@@ -1176,12 +1176,14 @@ sub GetOverduesForBranch {
             borrowers.phone,
             borrowers.email,
                biblio.title,
+               biblio.author,
                biblio.biblionumber,
                issues.date_due,
                issues.returndate,
                issues.branchcode,
              branches.branchname,
                 items.barcode,
+                items.homebranch,
                 items.itemcallnumber,
                 items.location,
                 items.itemnumber,
index 38bbba8..8a0f067 100644 (file)
@@ -85,7 +85,8 @@ sub add_field {
 #
 # maybe_add(field_id, value):
 #    If value is defined and non-empty, then return the
-#    constructed field value, otherwise return the empty string
+#    constructed field value, otherwise return the empty string.
+#    NOTE: if zero is a valid value for your field, don't use maybe_add!
 #
 sub maybe_add {
     my ($fid, $value) = @_;
@@ -142,46 +143,63 @@ sub boolspace {
 }
 
 
+# read_SIP_packet($file)
+#
 # Read a packet from $file, using the correct record separator
 #
 sub read_SIP_packet {
     my $record;
-       my $fh = shift or syslog("LOG_ERR", "read_SIP_packet: no filehandle argument!");
-       my $len1 = 999;
-       # local $/ = "\012";    # Internet Record Separator (lax version)
-       {               # adapted from http://perldoc.perl.org/5.8.8/functions/readline.html
-               for (my $tries=1; $tries<=3; $tries++) {
-                       undef $!;
-                       $record = readline($fh);
-                       if (defined($record)) {
-                               while(chomp($record)){1;}
-                               $len1 = length($record);
-                               syslog("LOG_DEBUG", "read_SIP_packet, INPUT MSG: '$record'");
-                               $record =~ s/^\s*[^A-z0-9]+//s;
-                               $record =~ s/[^A-z0-9]+$//s;
-                               $record =~ s/\015?\012//g;
-                               $record =~ s/\015?\012//s;
-                               $record =~ s/\015*\012*$//s;    # treat as one line to include the extra linebreaks we are trying to remove!
-                               while(chomp($record)){1;}
-                               if ($record) {
-                                       last;   # success
-                               }
-                       } else {
-                               if ($!) {
-                               syslog("LOG_DEBUG", "read_SIP_packet (try #$tries) ERROR: $!");
-                                       # die "read_SIP_packet ERROR: $!";
-                                       warn "read_SIP_packet ERROR: $!";
-                               }
-                       }
-               }
-       }
-       if ($record) {
-               my $len2 = length($record);
-               syslog("LOG_INFO", "read_SIP_packet, INPUT MSG: '$record'") if $record;
-               ($len1 != $len2) and syslog("LOG_DEBUG", "read_SIP_packet, trimmed %s character(s) (after chomps).", $len1-$len2);
-       } else {
-               syslog("LOG_WARNING", "read_SIP_packet input %s, end of input.", (defined($record)? "empty ($record)" : 'undefined')); 
-       }
+    my $fh = shift or syslog("LOG_ERR", "read_SIP_packet: no filehandle argument!");
+    my $len1 = 999;
+
+    # local $/ = "\r";      # don't need any of these here.  use whatever the prevailing $/ is.
+    local $/ = "\015";    # proper SPEC: (octal) \015 = (hex) x0D = (dec) 13 = (ascii) carriage return
+    {    # adapted from http://perldoc.perl.org/5.8.8/functions/readline.html
+        for ( my $tries = 1 ; $tries <= 3 ; $tries++ ) {
+            undef $!;
+            $record = readline($fh);
+            if ( defined($record) ) {
+                while ( chomp($record) ) { 1; }
+                $len1 = length($record);
+                syslog( "LOG_DEBUG", "read_SIP_packet, INPUT MSG: '$record'" );
+                $record =~ s/^\s*[^A-z0-9]+//s; # Every line must start with a "real" character.  Not whitespace, control chars, etc. 
+                $record =~ s/[^A-z0-9]+$//s;    # Same for the end.  Note this catches the problem some clients have sending empty fields at the end, like |||
+                $record =~ s/\015?\012//g;      # Extra line breaks must die
+                $record =~ s/\015?\012//s;      # Extra line breaks must die
+                $record =~ s/\015*\012*$//s;    # treat as one line to include the extra linebreaks we are trying to remove!
+                while ( chomp($record) ) { 1; }
+
+                $record and last;    # success
+            } else {
+                if ($!) {
+                    syslog( "LOG_DEBUG", "read_SIP_packet (try #$tries) ERROR: $! $@" );
+                    # die "read_SIP_packet ERROR: $!";
+                    warn "read_SIP_packet ERROR: $! $@";
+                }
+            }
+        }
+    }
+    if ($record) {
+        my $len2 = length($record);
+        syslog("LOG_INFO", "read_SIP_packet, INPUT MSG: '$record'") if $record;
+        ($len1 != $len2) and syslog("LOG_DEBUG", "read_SIP_packet, trimmed %s character(s) (after chomps).", $len1-$len2);
+    } else {
+        syslog("LOG_WARNING", "read_SIP_packet input %s, end of input.", (defined($record) ? "empty ($record)" : 'undefined'));
+    }
+    #
+    # Cen-Tec self-check terminals transmit '\r\n' line terminators.
+    # This is actually very hard to deal with in perl in a reasonable
+    # since every OTHER piece of hardware out there gets the protocol
+    # right.
+    # 
+    # The incorrect line terminator presents as a \r at the end of the
+    # first record, and then a \n at the BEGINNING of the next record.
+    # So, the simplest thing to do is just throw away a leading newline
+    # on the input.
+    #  
+    # This is now handled by the vigorous cleansing above.
+    # syslog("LOG_INFO", encode_utf8("INPUT MSG: '$record'")) if $record;
+    syslog("LOG_INFO", "INPUT MSG: '$record'") if $record;
     return $record;
 }
 
@@ -200,22 +218,23 @@ sub write_msg {
     my ($self, $msg, $file) = @_;
     my $cksum;
 
+    # $msg = encode_utf8($msg);
     if ($error_detection) {
-               if (defined($self->{seqno})) {
-                   $msg .= 'AY' . $self->{seqno};
-               }
-               $msg .= 'AZ';
-               $cksum = checksum($msg);
-               $msg .= sprintf('%04.4X', $cksum);
+        if (defined($self->{seqno})) {
+            $msg .= 'AY' . $self->{seqno};
+        }
+        $msg .= 'AZ';
+        $cksum = checksum($msg);
+        $msg .= sprintf('%04.4X', $cksum);
     }
 
+
     if ($file) {
-               print $file "$msg$CRLF";
-               syslog("LOG_DEBUG", "write_msg outputting to $file");
+        print $file "$msg\r";
     } else {
-               print "$msg$CRLF";
+        print "$msg\r";
+        syslog("LOG_INFO", "OUTPUT MSG: '$msg'");
     }
-       syslog("LOG_INFO", "OUTPUT MSG: '$msg'");
 
     $last_response = $msg;
 }
index dd41886..a469948 100644 (file)
@@ -1612,7 +1612,7 @@ sub searchResults {
                 if (   $item->{wthdrawn}
                     || $item->{itemlost}
                     || $item->{damaged}
-                    || $item->{notforloan}
+                    || $item->{notforloan} > 0
                    || $reservestatus eq 'Waiting'
                     || ($transfertwhen ne ''))
                 {
index 1abebb4..da0f4bd 100644 (file)
@@ -125,10 +125,11 @@ sub GetLateIssues {
             LEFT JOIN  biblio ON biblio.biblionumber = subscription.biblionumber
             LEFT JOIN  aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id
             WHERE      ((planneddate < now() AND serial.STATUS =1) OR serial.STATUS = 3)
-            AND        subscription.aqbooksellerid=$supplierid
+            AND        subscription.aqbooksellerid=?
             ORDER BY   title
         |;
         $sth = $dbh->prepare($query);
+        $sth->execute($supplierid);
     } else {
         my $query = qq|
             SELECT     name,title,planneddate,serialseq,serial.subscriptionid
@@ -140,8 +141,8 @@ sub GetLateIssues {
             ORDER BY   title
         |;
         $sth = $dbh->prepare($query);
+        $sth->execute;
     }
-    $sth->execute;
     my @issuelist;
     my $last_title;
     my $odd   = 0;
@@ -724,9 +725,16 @@ sub GetSerials2 {
     my @serials;
 
     while ( my $line = $sth->fetchrow_hashref ) {
-        $line->{ "status" . $line->{status} } = 1;                                         # fills a "statusX" value, used for template status select list
-        $line->{"planneddate"}                = format_date( $line->{"planneddate"} );
-        $line->{"publisheddate"}              = format_date( $line->{"publisheddate"} );
+        $line->{ "status" . $line->{status} } = 1; # fills a "statusX" value, used for template status select list
+        # Format dates for display
+        for my $datefield ( qw( planneddate publisheddate ) ) {
+            if ($line->{$datefield} =~m/^00/) {
+                $line->{$datefield} = q{};
+            }
+            else {
+                $line->{$datefield} = format_date( $line->{$datefield} );
+            }
+        }
         push @serials, $line;
     }
     return @serials;
diff --git a/C4/ShelfBrowser.pm b/C4/ShelfBrowser.pm
new file mode 100644 (file)
index 0000000..ee91bf4
--- /dev/null
@@ -0,0 +1,235 @@
+#!/usr/bin/perl
+
+package C4::ShelfBrowser;
+
+# Copyright 2010 Catalyst IT
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+use strict;
+use warnings;
+
+use C4::Biblio;
+use C4::Branch;
+use C4::Context;
+use C4::Koha;
+
+use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
+
+BEGIN {
+       $VERSION = 3.02;
+       require Exporter;
+       @ISA    = qw(Exporter);
+       @EXPORT = qw(
+           &GetNearbyItems
+    );
+    @EXPORT_OK = qw(
+    );
+}
+
+=head1 NAME
+
+C4::ShelfBrowser - functions that deal with the shelf browser feature found in
+the OPAC.
+
+=head1 SYNOPSIS
+
+  use C4::ShelfBrowser;
+
+=head1 DESCRIPTION
+
+This module provides functions to get items nearby to another item, for use
+in the shelf browser function.
+
+'Nearby' is controlled by a handful of system preferences that specify what
+to take into account.
+
+=head1 FUNCTIONS
+
+=head2 GetNearbyItems($itemnumber, [$num_each_side])
+
+  $nearby = GetNearbyItems($itemnumber, [$num_each_side]);
+
+  @next = @{ $nearby->{next} };
+  @prev = @{ $nearby->{prev} };
+
+  foreach (@next) {
+      # These won't format well like this, but here are the fields
+         print $_->{title};
+         print $_->{biblionumber};
+         print $_->{itemnumber};
+         print $_->{browser_normalized_upc};
+         print $_->{browser_normalized_oclc};
+         print $_->{browser_normalized_isbn};
+  }
+
+  # This is the information required to scroll the browser to the next left
+  # or right set. Can be derived from next/prev, but it's here for convenience.
+  print $nearby->{prev_itemnumber};
+  print $nearby->{next_itemnumber};
+  print $nearby->{prev_biblionumber};
+  print $nearby->{next_biblionumber};
+
+  # These will be undef if the values are not used to calculate the 
+  # nearby items.
+  print $nearby->{starting_homebranch}->{code};
+  print $nearby->{starting_homebranch}->{description};
+  print $nearby->{starting_location}->{code};
+  print $nearby->{starting_location}->{description};
+  print $nearby->{starting_ccode}->{code};
+  print $nearby->{starting_ccode}->{description};
+
+  print $nearby->{starting_itemnumber};
+  
+This finds the items that are nearby to the supplied item, and supplies
+those previous and next, along with the other useful information for displaying
+the shelf browser.
+
+It automatically applies the following user preferences to work out how to
+calculate things: C<ShelfBrowserUsesLocation>, C<ShelfBrowserUsesHomeBranch>, 
+C<ShelfBrowserUsesCcode>.
+
+The option C<$num_each_side> value determines how many items will be fetched
+each side of the supplied item. Note that the item itself is the first entry
+in the 'next' set, and counts towards this limit (this is to keep the
+behaviour consistant with the code that this is a refactor of.) Default is
+3.
+
+This will throw an exception if something went wrong.
+
+=cut
+
+sub GetNearbyItems {
+       my ($itemnumber, $num_each_side) = @_;
+       $num_each_side ||= 3;
+
+    my $dbh         = C4::Context->dbh;
+    my $marcflavour = C4::Context->preference("marcflavour");
+    my $branches = GetBranches();
+
+    my $sth_get_item_details = $dbh->prepare("SELECT cn_sort,homebranch,location,ccode from items where itemnumber=?");
+    $sth_get_item_details->execute($itemnumber);
+    my $item_details_result = $sth_get_item_details->fetchrow_hashref();
+    die "Unable to find item '$itemnumber' for shelf browser" if (!$sth_get_item_details);
+    my $start_cn_sort = $item_details_result->{'cn_sort'};
+
+    my ($start_homebranch, $start_location, $start_ccode);
+    if (C4::Context->preference('ShelfBrowserUsesHomeBranch') && 
+       defined($item_details_result->{'homebranch'})) {
+        $start_homebranch->{code} = $item_details_result->{'homebranch'};
+        $start_homebranch->{description} = $branches->{$item_details_result->{'homebranch'}}{branchname};
+    }
+    if (C4::Context->preference('ShelfBrowserUsesLocation') && 
+       defined($item_details_result->{'location'})) {
+        $start_location->{code} = $item_details_result->{'location'};
+        $start_location->{description} = GetAuthorisedValueDesc('','',$item_details_result->{'location'},'','','LOC','opac');
+    }
+    if (C4::Context->preference('ShelfBrowserUsesCcode') && 
+       defined($item_details_result->{'ccode'})) {
+        $start_ccode->{code} = $item_details_result->{'ccode'};
+        $start_ccode->{description} = GetAuthorisedValueDesc('', '', $item_details_result->{'ccode'}, '', '', 'CCODE', 'opac');
+    }
+
+    # Build the query for previous and next items
+    my $prev_query ='
+        SELECT *
+        FROM items
+        WHERE
+            ((cn_sort = ? AND itemnumber < ?) OR cn_sort < ?) ';
+    my $next_query ='
+        SELECT *
+        FROM items
+        WHERE
+            ((cn_sort = ? AND itemnumber >= ?) OR cn_sort > ?) ';
+    my @params;
+    my $query_cond;
+    push @params, ($start_cn_sort, $itemnumber, $start_cn_sort);
+    if ($start_homebranch) {
+       $query_cond .= 'AND homebranch = ? ';
+       push @params, $start_homebranch->{code};
+    }
+    if ($start_location) {
+       $query_cond .= 'AND location = ? ';
+       push @params, $start_location->{code};
+    }
+    if ($start_ccode) {
+       $query_cond .= 'AND ccode = ? ';
+       push @params, $start_ccode->{code};
+    }
+
+    my $sth_prev_items = $dbh->prepare($prev_query . $query_cond . ' ORDER BY cn_sort DESC, itemnumber LIMIT ?');
+    my $sth_next_items = $dbh->prepare($next_query . $query_cond . ' ORDER BY cn_sort, itemnumber LIMIT ?');
+    push @params, $num_each_side;
+    $sth_prev_items->execute(@params);
+    $sth_next_items->execute(@params);
+    
+    # Now we have the query run, suck out the data like marrow
+    my @prev_items = reverse GetShelfInfo($sth_prev_items, $marcflavour);
+    my @next_items = GetShelfInfo($sth_next_items, $marcflavour);
+
+    my $next_itemnumber = $next_items[-1]->{itemnumber} if @next_items;
+    my $next_biblionumber = $next_items[-1]->{biblionumber} if @next_items;
+
+    my $prev_itemnumber = $prev_items[0]->{itemnumber} if @prev_items;
+    my $prev_biblionumber = $prev_items[0]->{biblionumber} if @prev_items;
+
+    my %result = (
+        next                => \@next_items,
+        prev                => \@prev_items,
+        next_itemnumber     => $next_itemnumber,
+        next_biblionumber   => $next_biblionumber,
+        prev_itemnumber     => $prev_itemnumber,
+        prev_biblionumber   => $prev_biblionumber,   
+        starting_itemnumber => $itemnumber,
+    );
+    $result{starting_homebranch} = $start_homebranch if $start_homebranch;
+    $result{starting_location}   = $start_location   if $start_location;
+    $result{starting_ccode}         = $start_ccode      if $start_ccode;
+    return \%result;
+}
+
+# This runs through a statement handle and pulls out all the items in it, fills
+# them up with additional info that shelves want, and returns those as a list.
+# Not really intended to be exported.
+sub GetShelfInfo {
+    my ($sth, $marcflavour) = @_;
+
+    my @items;
+    while (my $this_item = $sth->fetchrow_hashref()) {
+        my $this_biblio = GetBibData($this_item->{biblionumber});
+        next if (!defined($this_biblio));
+        $this_item->{'title'} = $this_biblio->{'title'};
+        my $this_record = GetMarcBiblio($this_biblio->{'biblionumber'});
+        $this_item->{'browser_normalized_upc'} = GetNormalizedUPC($this_record,$marcflavour);
+        $this_item->{'browser_normalized_oclc'} = GetNormalizedOCLCNumber($this_record,$marcflavour);
+        $this_item->{'browser_normalized_isbn'} = GetNormalizedISBN(undef,$this_record,$marcflavour);
+        push @items, $this_item;
+    }
+    return @items;
+}
+
+# Fetches some basic biblio data needed by the shelf stuff
+sub GetBibData {
+       my ($bibnum) = @_;
+
+    my $dbh         = C4::Context->dbh;
+    my $sth = $dbh->prepare("SELECT biblionumber, title FROM biblio WHERE biblionumber=?");
+    $sth->execute($bibnum);
+    my $bib = $sth->fetchrow_hashref();
+    return $bib;
+}
+
+1;
index 7844330..f1c5293 100644 (file)
@@ -129,9 +129,9 @@ sub XSLTParse4Display {
     my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour'));
     my $sysxml = "<sysprefs>\n";
     foreach my $syspref ( qw/OPACURLOpenInNewWindow DisplayOPACiconsXSLT URLLinkText viewISBD OPACBaseURL/ ) {
-        $sysxml .= "<syspref name=\"$syspref\">" .
-                   C4::Context->preference( $syspref ) .
-                   "</syspref>\n";
+        my $sp = C4::Context->preference( $syspref );
+        next unless defined($sp);
+        $sysxml .= "<syspref name=\"$syspref\">$sp</syspref>\n";
     }
     $sysxml .= "</sysprefs>\n";
     $xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml\<\/record\>/;
index 781df61..29f8143 100755 (executable)
@@ -37,7 +37,7 @@ use C4::Biblio;
 use C4::Items;
 use C4::Koha qw/GetItemTypes/;
 use C4::Budgets qw/GetBudgets/;
-use C4::Acquisition qw/NewOrderItem/;
+use C4::Acquisition qw/NewOrderItem GetBasket/;
 use C4::Bookseller qw/GetBookSellerFromId/;
 
 my $input = new CGI;
@@ -145,8 +145,6 @@ if ($op eq ""){
               if ($orderinfo{'listprice'} =~ /^([\d\.,]*)/) {
                   $orderinfo{'listprice'} = $1;
                   $orderinfo{'listprice'} =~ s/,/\./;
-                  eval "use C4::Acquisition qw/GetBasket/;";
-                  eval "use C4::Bookseller qw/GetBookSellerFromId/;";
                   my $basket = GetBasket($orderinfo{basketno});
                   my $bookseller = GetBookSellerFromId($basket->{booksellerid});
                   # '//' is like '||' but tests for defined, rather than true
@@ -163,8 +161,6 @@ if ($op eq ""){
               if ($orderinfo{'listprice'} =~ /^([\d\.,]*)/) {
                   $orderinfo{'listprice'} = $1;
                   $orderinfo{'listprice'} =~ s/,/\./;
-                  eval "use C4::Acquisition qw/GetBasket/;";
-                  eval "use C4::Bookseller qw/GetBookSellerFromId/;";
                   my $basket = GetBasket($orderinfo{basketno});
                   my $bookseller = GetBookSellerFromId($basket->{booksellerid});
                   my $gst = $bookseller->{gstrate} // C4::Context->preference("gist") // 0;
index aba32d4..2a35f3a 100755 (executable)
@@ -4,6 +4,7 @@
 #written by john.soros@biblibre.com 01/10/2008
 
 # Copyright 2008 - 2009 BibLibre SARL
+# Parts Copyright Catalyst 2010
 #
 # This file is part of Koha.
 #
@@ -183,8 +184,9 @@ sub printbasketgrouppdf{
     my ($basketgroupid) = @_;
     
     my $pdfformat = C4::Context->preference("OrderPdfFormat");
-    eval "use $pdfformat" ;
-    eval "use C4::Branch";
+    eval "use $pdfformat";
+    # FIXME consider what would happen if $pdfformat does not
+    # contain the name of a valid Perl module.
     
     my $basketgroup = GetBasketgroup($basketgroupid);
     my $bookseller = GetBookSellerFromId($basketgroup->{'booksellerid'});
@@ -244,7 +246,6 @@ sub printbasketgrouppdf{
     );
     my $pdf = printpdf($basketgroup, $bookseller, $baskets, \%orders, $bookseller->{gstrate} // C4::Context->preference("gist")) || die "pdf generation failed";
     print $pdf;
-    exit;
 }
 
 my $op = $input->param('op');
@@ -382,10 +383,12 @@ if ( $op eq "add" ) {
     CloseBasketgroup($basketgroupid);
     
     printbasketgrouppdf($basketgroupid);
+    exit;
 }elsif ($op eq 'print'){
     my $basketgroupid = $input->param('basketgroupid');
     
     printbasketgrouppdf($basketgroupid);
+    exit;
 }elsif( $op eq "delete"){
     my $basketgroupid = $input->param('basketgroupid');
     DelBasketgroup($basketgroupid);
index 84fc81e..6af057d 100755 (executable)
@@ -134,7 +134,14 @@ if ( $ordernumber eq '' and defined $params->{'breedingid'}){
 
     my $duplicatetitle;
 #look for duplicates
-    if (! (($biblionumber,$duplicatetitle) = FindDuplicate($marcrecord))){
+    ($biblionumber,$duplicatetitle) = FindDuplicate($marcrecord);
+    if($biblionumber && !$input->param('use_external_source')) {
+       #if duplicate record found and user did not decide yet, first warn user
+       #and let him choose between using new record or existing record
+       Load_Duplicate($duplicatetitle);
+       exit;
+    }
+    #from this point: add a new record
         if (C4::Context->preference("BiblioAddsAuthorities")){
             my ($countlinked,$countcreated)=BiblioAddAuthorities($marcrecord, $params->{'frameworkcode'});
         }
@@ -163,7 +170,6 @@ if ( $ordernumber eq '' and defined $params->{'breedingid'}){
             }
         }
         SetImportRecordStatus($params->{'breedingid'}, 'imported');
-    }
 }
 
 
@@ -471,3 +477,26 @@ sub MARCfindbreeding {
     return -1;
 }
 
+sub Load_Duplicate {
+  my ($duplicatetitle)= @_;
+  ($template, $loggedinuser, $cookie) = get_template_and_user(
+    {
+        template_name   => "acqui/neworderempty_duplicate.tmpl",
+        query           => $input,
+        type            => "intranet",
+        authnotrequired => 0,
+        flagsrequired   => { acquisition => 'order_manage' },
+#        debug           => 1,
+    }
+  );
+
+  $template->param(
+    biblionumber        => $biblionumber,
+    basketno            => $basketno,
+    booksellerid        => $basket->{'booksellerid'},
+    breedingid          => $params->{'breedingid'},
+    duplicatetitle      => $duplicatetitle,
+  );
+
+  output_html_with_http_headers $input, $cookie, $template->output;
+}
index cee3312..432d496 100755 (executable)
@@ -370,8 +370,8 @@ if ($op eq 'add_form') {
                $row_data{row} = $i;
                push(@loop_data, \%row_data);
        }
-       $template->param('use-heading-flags-p' => 1);
-       $template->param('heading-edit-subfields-p' => 1);
+       $template->param('use_heading_flags_p' => 1);
+       $template->param('heading_edit_subfields_p' => 1);
        $template->param(action => "Edit subfields",
                                                        tagfield => $tagfield,
                                                        tagfieldinput => "<input type=\"hidden\" name=\"tagfield\" value=\"$tagfield\" />",
index b6ae347..9c55df3 100755 (executable)
@@ -120,13 +120,13 @@ if ($op eq 'add_form') {
        if ($searchfield) {
                $template->param(action => "Modify tag",
                                                                searchfield => "<input type=\"hidden\" name=\"tagfield\" value=\"$searchfield\" />$searchfield");
-               $template->param('heading-modify-tag-p' => 1);
+               $template->param('heading_modify_tag_p' => 1);
        } else {
                $template->param(action => "Add tag",
                                                                searchfield => "<input type=\"text\" name=\"tagfield\" size=\"5\" maxlength=\"3\" />");
-               $template->param('heading-add-tag-p' => 1);
+               $template->param('heading_add_tag_p' => 1);
        }
-       $template->param('use-heading-flags-p' => 1);
+       $template->param('use_heading_flags_p' => 1);
        $template->param(liblibrarian => $data->{'liblibrarian'},
                                                        libopac => $data->{'libopac'},
                                                        repeatable => "".$data->{'repeatable'},
@@ -188,9 +188,10 @@ if ($op eq 'add_form') {
 # called by delete_confirm, used to effectively confirm deletion of data in DB
 } elsif ($op eq 'delete_confirmed') {
        unless (C4::Context->config('demo') eq 1) {
-               $dbh->do("delete from auth_tag_structure where tagfield='$searchfield' and authtypecode='$authtypecode'");
-               $dbh->do("delete from auth_subfield_structure where tagfield='$searchfield' and authtypecode='$authtypecode'");
-        # FIXME: Secuity vulnerability -- use placeholders, prepare and execute!
+               my $sth = $dbh->prepare("delete from auth_tag_structure where tagfield=? and authtypecode=?");
+               $sth->execute($searchfield,$authtypecode);
+               my $sth = $dbh->prepare("delete from auth_subfield_structure where tagfield=? and authtypecode=?");
+               $sth->execute($searchfield,$authtypecode);
        }
     print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=auth_tag_structure.pl?searchfield=".$input->param('tagfield')."&authtypecode=$authtypecode\">";
     exit;
index de05512..c26f3a9 100755 (executable)
@@ -60,7 +60,6 @@ my ($template, $borrowernumber, $cookie)= get_template_and_user({
     type => "intranet",
     debug => 1,
 });
-my $pagesize = 20;
 
 $template->param(  script_name => $script_name,
                  ($op||'else') => 1 );
@@ -77,15 +76,15 @@ if ($op eq 'add_form') {
        }
        if ($id) {
                $template->param(action_modify => 1);
-               $template->param('heading-modify-authorized-value-p' => 1);
+               $template->param('heading_modify_authorized_value_p' => 1);
        } elsif ( ! $data->{'category'} ) {
                $template->param(action_add_category => 1);
-               $template->param('heading-add-new-category-p' => 1);
+               $template->param('heading_add_new_category_p' => 1);
        } else {
                $template->param(action_add_value => 1);
-               $template->param('heading-add-authorized-value-p' => 1);
+               $template->param('heading_add_authorized_value_p' => 1);
        }
-       $template->param('use-heading-flags-p' => 1);
+       $template->param('use_heading_flags_p' => 1);
        $template->param( category        => $data->{'category'},
                          authorised_value => $data->{'authorised_value'},
                          lib              => $data->{'lib'},
@@ -220,7 +219,7 @@ sub default_form {
     my $count = scalar(@$results);
        my @loop_data = ();
        # builds value list
-       for (my $i=$offset; $i < ($offset+$pagesize<$count?$offset+$pagesize:$count); $i++){
+       for (my $i=0; $i < $count; $i++){
                my %row_data;  # get a fresh hash for the row data
                $row_data{category}              = $results->[$i]{'category'};
                $row_data{authorised_value}      = $results->[$i]{'authorised_value'};
@@ -235,19 +234,5 @@ sub default_form {
        $template->param( loop     => \@loop_data,
                           tab_list => $tab_list,
                           category => $searchfield );
-
-       if ($offset>0) {
-               my $prevpage = $offset-$pagesize;
-               $template->param(isprevpage => $offset,
-                                               prevpage=> $prevpage,
-                                               searchfield => $searchfield,
-                );
-       }
-       if ($offset+$pagesize<$count) {
-               my $nextpage =$offset+$pagesize;
-               $template->param(nextpage =>$nextpage,
-                                               searchfield => $searchfield,
-               );
-       }
 }
 
index 758fa32..f4bcf66 100755 (executable)
@@ -76,14 +76,14 @@ $template->param( ($op || 'else') => 1 );
 if ( $op eq 'add' ) {
 
     # If the user has pressed the "add new branch" button.
-    $template->param( 'heading-branches-add-branch-p' => 1 );
+    $template->param( 'heading_branches_add_branch_p' => 1 );
     editbranchform($branchcode,$template);
 
 }
 elsif ( $op eq 'edit' ) {
 
     # if the user has pressed the "edit branch settings" button.
-    $template->param( 'heading-branches-add-branch-p' => 0,
+    $template->param( 'heading_branches_add_branch_p' => 0,
                         'add' => 1, );
     editbranchform($branchcode,$template);
 }
@@ -103,7 +103,7 @@ elsif ( $op eq 'add_validate' ) {
             if ($existing > 0) {
                 $mod_branch = 0;
                 _branch_to_template($params, $template); # preserve most (FIXME) of user's input
-                $template->param( 'heading-branches-add-branch-p' => 1, 'add' => 1, 'ERROR1' => 1 );
+                $template->param( 'heading_branches_add_branch_p' => 1, 'add' => 1, 'ERROR1' => 1 );
             }
         }
         if ($mod_branch) {
@@ -113,7 +113,7 @@ elsif ( $op eq 'add_validate' ) {
                 # copy input parameters back to form
                 # FIXME - doing this doesn't preserve any branch group selections, but good enough for now
                 editbranchform($branchcode,$template);
-                $template->param( 'heading-branches-add-branch-p' => 1, 'add' => 1, "ERROR$error" => 1 );
+                $template->param( 'heading_branches_add_branch_p' => 1, 'add' => 1, "ERROR$error" => 1 );
             } else {
                 $template->param( else => 1);
                 default("MESSAGE2",$template);
@@ -160,7 +160,7 @@ elsif ( $op eq 'delete_confirmed' ) {
 elsif ( $op eq 'editcategory' ) {
 
     # If the user has pressed the "add new category" or "modify" buttons.
-    $template->param( 'heading-branches-edit-category-p' => 1 );
+    $template->param( 'heading_branches_edit_category_p' => 1 );
     editcatform($categorycode,$template);
 }
 elsif ( $op eq 'addcategory_validate' ) {
@@ -221,7 +221,7 @@ sub default {
     my $innertemplate = shift or return;
     $innertemplate->param($message => 1) if $message;
     $innertemplate->param(
-        'heading-branches-p' => 1,
+        'heading_branches_p' => 1,
     );
     branchinfotable("",$innertemplate);
 }
index 9876852..1a33a21 100755 (executable)
@@ -69,7 +69,6 @@ my $input       = new CGI;
 my $searchfield = $input->param('description');
 my $script_name = "/cgi-bin/koha/admin/itemtypes.pl";
 my $itemtype    = $input->param('itemtype');
-my $pagesize    = 10;
 my $op          = $input->param('op');
 $searchfield =~ s/\,//g;
 my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
@@ -230,14 +229,8 @@ elsif ( $op eq 'delete_confirmed' ) {
 }
 else {    # DEFAULT
     my ($results) = StringSearch( $searchfield, 'web' );
-    my $page = $input->param('page') || 1;
-    my $first = ( $page - 1 ) * $pagesize;
-
-    # if we are on the last page, the number of the last word to display
-    # must not exceed the length of the results array
-    my $last = min( $first + $pagesize - 1, scalar @{$results} - 1, );
     my @loop;
-    foreach my $itemtype ( @{$results}[ $first .. $last ] ) {
+    foreach my $itemtype ( @{$results} ) {
         $itemtype->{imageurl} = getitemtypeimagelocation( 'intranet', $itemtype->{imageurl} );
         $itemtype->{rentalcharge} = sprintf( '%.2f', $itemtype->{rentalcharge} );
         push( @loop, $itemtype );
@@ -245,10 +238,6 @@ else {    # DEFAULT
 
     $template->param(
         loop           => \@loop,
-        pagination_bar => pagination_bar(
-            $script_name, getnbpages( scalar @{$results}, $pagesize ),
-            $page,        'page'
-        )
     );
 }    #---- END $OP eq DEFAULT
 
index 372a811..0049376 100755 (executable)
@@ -364,8 +364,8 @@ if ( $op eq 'add_form' ) {
         $row_data{row}    = $j;
         push( @loop_data, \%row_data );
     }
-    $template->param( 'use-heading-flags-p'      => 1 );
-    $template->param( 'heading-edit-subfields-p' => 1 );
+    $template->param( 'use_heading_flags_p'      => 1 );
+    $template->param( 'heading_edit_subfields_p' => 1 );
     $template->param(
         action   => "Edit subfields",
         tagfield => $tagfield,
index a20f77c..92e0d99 100755 (executable)
@@ -118,12 +118,12 @@ if ($op eq 'add_form') {
        if ($searchfield) {
         $template->param(searchfield => $searchfield);
                $template->param(action => "Modify tag");
-               $template->param('heading-modify-tag-p' => 1);
+               $template->param('heading_modify_tag_p' => 1);
        } else {
                $template->param(action => "Add tag");
-               $template->param('heading-add-tag-p' => 1);
+               $template->param('heading_add_tag_p' => 1);
        }
-       $template->param('use-heading-flags-p' => 1);
+       $template->param('use_heading_flags_p' => 1);
        $template->param(liblibrarian => $data->{'liblibrarian'},
                        libopac => $data->{'libopac'},
                        repeatable => CGI::checkbox(-name=>'repeatable',
index 9ff009d..b33c7ec 100755 (executable)
@@ -486,30 +486,30 @@ sub GetPrefParams {
     $params->{'prefoptions'} = $data->{'options'};
 
     if ( not defined( $data->{'type'} ) ) {
-        $params->{'type-free'} = 1;
+        $params->{'type_free'} = 1;
         $params->{'fieldlength'} = ( defined( $data->{'options'} ) and $data->{'options'} and $data->{'options'} > 0 );
     } elsif ( $data->{'type'} eq 'Upload' ) {
-        $params->{'type-upload'} = 1;
+        $params->{'type_upload'} = 1;
     } elsif ( $data->{'type'} eq 'Choice' ) {
-        $params->{'type-choice'} = 1;
+        $params->{'type_choice'} = 1;
     } elsif ( $data->{'type'} eq 'YesNo' ) {
-        $params->{'type-yesno'} = 1;
+        $params->{'type_yesno'} = 1;
         $data->{'value'}        = C4::Context->boolean_preference( $data->{'variable'} );
         if ( defined( $data->{'value'} ) and $data->{'value'} eq '1' ) {
-            $params->{'value-yes'} = 1;
+            $params->{'value_yes'} = 1;
         } else {
-            $params->{'value-no'} = 1;
+            $params->{'value_no'} = 1;
         }
     } elsif ( $data->{'type'} eq 'Integer' || $data->{'type'} eq 'Float' ) {
-        $params->{'type-free'} = 1;
+        $params->{'type_free'} = 1;
         $params->{'fieldlength'} = ( defined( $data->{'options'} ) and $data->{'options'} and $data->{'options'} > 0 ) ? $data->{'options'} : 10;
     } elsif ( $data->{'type'} eq 'Textarea' ) {
-        $params->{'type-textarea'} = 1;
+        $params->{'type_textarea'} = 1;
         $data->{options} =~ /(.*)\|(.*)/;
         $params->{'cols'} = $1;
         $params->{'rows'} = $2;
     } elsif ( $data->{'type'} eq 'Themes' ) {
-        $params->{'type-choice'} = 1;
+        $params->{'type_choice'} = 1;
         my $type = '';
         ( $data->{'variable'} =~ m#opac#i ) ? ( $type = 'opac' ) : ( $type = 'intranet' );
         @options = ();
@@ -527,7 +527,7 @@ sub GetPrefParams {
             $counter++;
         }
     } elsif ( $data->{'type'} eq 'ClassSources' ) {
-        $params->{'type-choice'} = 1;
+        $params->{'type_choice'} = 1;
         my $type = '';
         @options = ();
         my $sources = GetClassSources();
@@ -564,13 +564,13 @@ sub GetPrefParams {
         my $languages_loop = getTranslatedLanguages( $interface, $theme, $lang, $currently_selected_languages );
 
         $params->{'languages_loop'}    = $languages_loop;
-        $params->{'type-langselector'} = 1;
+        $params->{'type_langselector'} = 1;
     } else {
-        $params->{'type-free'} = 1;
+        $params->{'type_free'} = 1;
         $params->{'fieldlength'} = ( defined( $data->{'options'} ) and $data->{'options'} and $data->{'options'} > 0 ) ? $data->{'options'} : 30;
     }
 
-    if ( $params->{'type-choice'} || $params->{'type-free'} || $params->{'type-yesno'} ) {
+    if ( $params->{'type_choice'} || $params->{'type_free'} || $params->{'type_yesno'} ) {
         $params->{'oneline'} = 1;
     }
 
@@ -787,7 +787,7 @@ if ( $op eq 'add_form' ) {
         $row_data->{delete} = "$script_name?op=delete_confirm&amp;searchfield=" . $results->[$i]{'variable'};
         push( @loop_data, $row_data );
     }
-    $tab = ( $tab ? $tab : "local-use" );
+    $tab = ( $tab ? $tab : "local_use" );
     $template->param( loop => \@loop_data, $tab => 1 );
     if ( $offset > 0 ) {
         my $prevpage = $offset - $pagesize;
index edf02a5..e4eae84 100755 (executable)
@@ -147,9 +147,6 @@ if ( $op eq "do_search" ) {
 
 }
 elsif ( $op eq "delete" ) {
-
-    &DelAuthority( $authid, 1 );
-
     ( $template, $loggedinuser, $cookie ) = get_template_and_user(
         {
             template_name   => "authorities/authorities-home.tmpl",
@@ -160,7 +157,7 @@ elsif ( $op eq "delete" ) {
             debug           => 1,
         }
     );
-
+    &DelAuthority( $authid, 1 );
 }
 else {
     ( $template, $loggedinuser, $cookie ) = get_template_and_user(
index 2dc7b1d..d73c5d9 100755 (executable)
@@ -227,7 +227,7 @@ for ( my $tabloop = 0 ; $tabloop <= 10 ; $tabloop++ ) {
             undef @subfields_data;
         }
     }
-    $template->param( $tabloop . "XX" => \@loop_data );
+    $template->param( "tab" . $tabloop . "XX" => \@loop_data );
 }
 
 # now, build item tab !
index d790c41..4f40b04 100755 (executable)
@@ -87,7 +87,7 @@ my $itemnumber;
 foreach my $item (@items){
     $item->{itemlostloop}= GetAuthorisedValues(GetAuthValCode('items.itemlost',$fw),$item->{itemlost}) if GetAuthValCode('items.itemlost',$fw);
     $item->{itemdamagedloop}= GetAuthorisedValues(GetAuthValCode('items.damaged',$fw),$item->{damaged}) if GetAuthValCode('items.damaged',$fw);
-    $item->{'collection'}              = $ccodes->{ $item->{ccode} };
+    $item->{'collection'}              = $ccodes->{ $item->{ccode} } if ($ccodes);
     $item->{'itype'}                   = $itemtypes->{ $item->{'itype'} }->{'description'};
     $item->{'replacementprice'}        = sprintf( "%.2f", $item->{'replacementprice'} );
     $item->{'datelastborrowed'}        = format_date( $item->{'datelastborrowed'} );
index d0011ba..d316833 100755 (executable)
@@ -79,6 +79,7 @@ my $results = $stylesheet->transform($source);
 my $newxmlrecord = $stylesheet->output_string($results);
 #warn $newxmlrecord;
 print "Content-type: text/html\n\n";
+utf8::encode($newxmlrecord);
 print $newxmlrecord;
 
 } else {
index 2c0c63d..da58166 100755 (executable)
@@ -2,6 +2,7 @@
 
 
 # Copyright 2000-2002 Katipo Communications
+# Copyright 2004-2010 BibLibre
 #
 # This file is part of Koha.
 #
@@ -757,7 +758,7 @@ AND (authtypecode IS NOT NULL AND authtypecode<>\"\")|);
   my ($countcreated,$countlinked);
   while (my $data=$query->fetchrow_hashref){
     foreach my $field ($record->field($data->{tagfield})){
-      next if ($field->subfield('3')||$field->subfield('9'));
+      next if ($field->subfield('9'));
       # No authorities id in the tag.
       # Search if there is any authorities to link to.
       my $query='at='.$data->{authtypecode}.' ';
@@ -932,8 +933,7 @@ if ( $op eq "addbiblio" ) {
         else {
             ( $biblionumber, $oldbibitemnum ) = AddBiblio( $record, $frameworkcode );
         }
-
-        if (($mode ne "popup" && !$is_a_modif) || $redirect eq "items"){
+        if ($mode ne "popup" && !$is_a_modif && $redirect eq "items"){
             print $input->redirect(
                 "/cgi-bin/koha/cataloguing/additem.pl?biblionumber=$biblionumber&frameworkcode=$frameworkcode"
             );
index 6dc190a..c5dd7d9 100755 (executable)
@@ -2,6 +2,7 @@
 
 
 # Copyright 2000-2002 Katipo Communications
+# Copyright 2004-2010 BibLibre
 #
 # This file is part of Koha.
 #
@@ -30,6 +31,7 @@ use C4::Koha; # XXX subfield_is_koha_internal_p
 use C4::Branch; # XXX subfield_is_koha_internal_p
 use C4::ClassSource;
 use C4::Dates;
+use List::MoreUtils qw/any/;
 
 use MARC::File::XML;
 
@@ -91,7 +93,176 @@ sub _increment_barcode {
 }
 
 
-my $input = new CGI;
+sub generate_subfield_form {
+        my ($tag, $subfieldtag, $value, $tagslib,$subfieldlib, $branches, $today_iso, $biblionumber, $temp, $loop_data, $i) = @_;
+        
+        my %subfield_data;
+        my $dbh = C4::Context->dbh;        
+        my $authorised_values_sth = $dbh->prepare("SELECT authorised_value,lib FROM authorised_values WHERE category=? ORDER BY lib");
+        
+        my $index_subfield = int(rand(1000000)); 
+        if ($subfieldtag eq '@'){
+            $subfield_data{id} = "tag_".$tag."_subfield_00_".$index_subfield;
+        } else {
+            $subfield_data{id} = "tag_".$tag."_subfield_".$subfieldtag."_".$index_subfield;
+        }
+        
+        $subfield_data{tag}        = $tag;
+        $subfield_data{subfield}   = $subfieldtag;
+        $subfield_data{random}     = int(rand(1000000));    # why do we need 2 different randoms?
+        $subfield_data{marc_lib}   ="<span id=\"error$i\" title=\"".$subfieldlib->{lib}."\">".$subfieldlib->{lib}."</span>";
+        $subfield_data{mandatory}  = $subfieldlib->{mandatory};
+        $subfield_data{repeatable} = $subfieldlib->{repeatable};
+        
+        $value =~ s/"/&quot;/g;
+        if ( ! defined( $value ) || $value eq '')  {
+            $value = $subfieldlib->{defaultvalue};
+            # get today date & replace YYYY, MM, DD if provided in the default value
+            my ( $year, $month, $day ) = split ',', $today_iso;     # FIXME: iso dates don't have commas!
+            $value =~ s/YYYY/$year/g;
+            $value =~ s/MM/$month/g;
+            $value =~ s/DD/$day/g;
+        }
+        
+        $subfield_data{visibility} = "display:none;" if (($subfieldlib->{hidden} > 4) || ($subfieldlib->{hidden} < -4));
+        
+        my $pref_itemcallnumber = C4::Context->preference('itemcallnumber');
+        if (!$value && $subfieldlib->{kohafield} eq 'items.itemcallnumber' && $pref_itemcallnumber) {
+            my $CNtag       = substr($pref_itemcallnumber, 0, 3);
+            my $CNsubfield  = substr($pref_itemcallnumber, 3, 1);
+            my $CNsubfield2 = substr($pref_itemcallnumber, 4, 1);
+            my $temp2 = $temp->field($CNtag);
+            if ($temp2) {
+                $value = ($temp2->subfield($CNsubfield)).' '.($temp2->subfield($CNsubfield2));
+                #remove any trailing space incase one subfield is used
+                $value =~ s/^\s+|\s+$//g;
+            }
+        }
+        
+        my $attributes_no_value = qq(tabindex="1" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="67" maxlength="255" );
+        my $attributes          = qq($attributes_no_value value="$value" );
+        
+        if ( $subfieldlib->{authorised_value} ) {
+            my @authorised_values;
+            my %authorised_lib;
+            # builds list, depending on authorised value...
+            if ( $subfieldlib->{authorised_value} eq "branches" ) {
+                foreach my $thisbranch (@$branches) {
+                    push @authorised_values, $thisbranch->{value};
+                    $authorised_lib{$thisbranch->{value}} = $thisbranch->{branchname};
+                    $value = $thisbranch->{value} if $thisbranch->{selected};
+                }
+            }
+            elsif ( $subfieldlib->{authorised_value} eq "itemtypes" ) {
+                  push @authorised_values, "" unless ( $subfieldlib->{mandatory} );
+                  my $sth = $dbh->prepare("SELECT itemtype,description FROM itemtypes ORDER BY description");
+                  $sth->execute;
+                  while ( my ( $itemtype, $description ) = $sth->fetchrow_array ) {
+                      push @authorised_values, $itemtype;
+                      $authorised_lib{$itemtype} = $description;
+                  }
+        
+                  unless ( $value ) {
+                      my $itype_sth = $dbh->prepare("SELECT itemtype FROM biblioitems WHERE biblionumber = ?");
+                      $itype_sth->execute( $biblionumber );
+                      ( $value ) = $itype_sth->fetchrow_array;
+                  }
+          
+                  #---- class_sources
+            }
+            elsif ( $subfieldlib->{authorised_value} eq "cn_source" ) {
+                  push @authorised_values, "" unless ( $subfieldlib->{mandatory} );
+                    
+                  my $class_sources = GetClassSources();
+                  my $default_source = C4::Context->preference("DefaultClassificationSource");
+                  
+                  foreach my $class_source (sort keys %$class_sources) {
+                      next unless $class_sources->{$class_source}->{'used'} or
+                                  ($value and $class_source eq $value)      or
+                                  ($class_source eq $default_source);
+                      push @authorised_values, $class_source;
+                      $authorised_lib{$class_source} = $class_sources->{$class_source}->{'description'};
+                  }
+                         $value = $default_source unless ($value);
+        
+                  #---- "true" authorised value
+            }
+            else {
+                  push @authorised_values, "" unless ( $subfieldlib->{mandatory} );
+                  $authorised_values_sth->execute( $subfieldlib->{authorised_value} );
+                  while ( my ( $value, $lib ) = $authorised_values_sth->fetchrow_array ) {
+                      push @authorised_values, $value;
+                      $authorised_lib{$value} = $lib;
+                  }
+            }
+
+            $subfield_data{marc_value} =CGI::scrolling_list(      # FIXME: factor out scrolling_list
+                  -name     => "field_value",
+                  -values   => \@authorised_values,
+                  -default  => $value,
+                  -labels   => \%authorised_lib,
+                  -override => 1,
+                  -size     => 1,
+                  -multiple => 0,
+                  -tabindex => 1,
+                  -id       => "tag_".$tag."_subfield_".$subfieldtag."_".$index_subfield,
+                  -class    => "input_marceditor",
+            );
+
+            # it's a thesaurus / authority field
+        }
+        elsif ( $subfieldlib->{authtypecode} ) {
+                $subfield_data{marc_value} = "<input type=\"text\" $attributes />
+                    <a href=\"#\" class=\"buttonDot\"
+                        onclick=\"Dopop('/cgi-bin/koha/authorities/auth_finder.pl?authtypecode=".$subfieldlib->{authtypecode}."&index=$subfield_data{id}','$subfield_data{id}'); return false;\" title=\"Tag Editor\">...</a>
+            ";
+            # it's a plugin field
+        }
+        elsif ( $subfieldlib->{value_builder} ) {
+                # opening plugin
+                my $plugin = C4::Context->intranetdir . "/cataloguing/value_builder/" . $subfieldlib->{'value_builder'};
+                if (do $plugin) {
+                    my $extended_param = plugin_parameters( $dbh, $temp, $tagslib, $subfield_data{id}, $loop_data );
+                    my ( $function_name, $javascript ) = plugin_javascript( $dbh, $temp, $tagslib, $subfield_data{id}, $loop_data );
+                   my $change = index($javascript, 'function Change') > -1 ?
+                       "return Change$function_name($subfield_data{random}, '$subfield_data{id}');" :
+                       'return 1;';
+                    $subfield_data{marc_value} = qq[<input $attributes
+                        onfocus="Focus$function_name($subfield_data{random}, '$subfield_data{id}');"
+                       onchange=" $change"
+                         onblur=" Blur$function_name($subfield_data{random}, '$subfield_data{id}');" />
+                        <a href="#" class="buttonDot" onclick="Clic$function_name('$subfield_data{id}'); return false;" title="Tag Editor">...</a>
+                        $javascript];
+                } else {
+                    warn "Plugin Failed: $plugin";
+                    $subfield_data{marc_value} = "<input $attributes />"; # supply default input form
+                }
+        }
+        elsif ( $tag eq '' ) {       # it's an hidden field
+            $subfield_data{marc_value} = qq(<input type="hidden" $attributes />);
+        }
+        elsif ( $subfieldlib->{'hidden'} ) {   # FIXME: shouldn't input type be "hidden" ?
+            $subfield_data{marc_value} = qq(<input type="text" $attributes />);
+        }
+        elsif ( length($value) > 100
+                    or (C4::Context->preference("marcflavour") eq "UNIMARC" and
+                          300 <= $tag && $tag < 400 && $subfieldtag eq 'a' )
+                    or (C4::Context->preference("marcflavour") eq "MARC21"  and
+                          500 <= $tag && $tag < 600                     )
+                  ) {
+            # oversize field (textarea)
+            $subfield_data{marc_value} = "<textarea $attributes_no_value>$value</textarea>\n";
+        } else {
+           # it's a standard field
+           $subfield_data{marc_value} = "<input $attributes />";
+        }
+        
+        return \%subfield_data;
+}
+
+
+my $input        = new CGI;
+my $dbh          = C4::Context->dbh;
 my $error        = $input->param('error');
 my $biblionumber = $input->param('biblionumber');
 my $itemnumber   = $input->param('itemnumber');
@@ -265,14 +436,28 @@ if ($op eq "additem") {
 } elsif ($op eq "delallitems") {
 #-------------------------------------------------------------------------------
     my @biblioitems = &GetBiblioItemByBiblioNumber($biblionumber);
-    foreach my $biblioitem (@biblioitems){
-        my $items = &GetItemsByBiblioitemnumber($biblioitem->{biblioitemnumber});
-
-        foreach my $item (@$items){
-            # FIXME although it won't delete items that have loans
-            # or waiting holds on them, should explicitly tell operator
-            # about items that are not deleted
-            &DelItemCheck($dbh,$biblionumber,$item->{itemnumber});
+    my $errortest=0;
+    my $itemfail;
+    foreach my $biblioitem (@biblioitems) {
+        my $items = &GetItemsByBiblioitemnumber( $biblioitem->{biblioitemnumber} );
+
+        foreach my $item (@$items) {
+            $error =&DelItemCheck( $dbh, $biblionumber, $item->{itemnumber} );
+            $itemfail =$item;
+        if($error == 1){
+            next
+            }
+        else {
+            push @errors,$error;
+            $errortest++
+            }
+        }
+        if($errortest > 0){
+            $nextop="additem";
+        } 
+        else {
+            print $input->redirect("/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=$biblionumber");
+            exit;
         }
        }
 #-------------------------------------------------------------------------------
@@ -318,30 +503,35 @@ my (  $itemtagfield,   $itemtagsubfield) = &GetMarcFromKohaField("items.itemnumb
 my ($branchtagfield, $branchtagsubfield) = &GetMarcFromKohaField("items.homebranch", $frameworkcode);
 
 foreach my $field (@fields) {
-    next if ($field->tag()<10);
-    my @subf = $field->subfields or (); # don't use ||, as that forces $field->subfelds to be interpreted in scalar context
+    next if ( $field->tag() < 10 );
+
+    my @subf = $field->subfields or ();    # don't use ||, as that forces $field->subfelds to be interpreted in scalar context
     my %this_row;
-# loop through each subfield
-    for my $i (0..$#subf) {
-        next if ($tagslib->{$field->tag()}->{$subf[$i][0]}->{tab} ne 10 
-                && ($field->tag() ne $itemtagfield 
-                && $subf[$i][0]   ne $itemtagsubfield));
+    # loop through each subfield
+    my $i = 0;
+    foreach my $subfield (@subf){
+        my $subfieldcode = $subfield->[0];
+        my $subfieldvalue= $subfield->[1];
 
-        $witness{$subf[$i][0]} = $tagslib->{$field->tag()}->{$subf[$i][0]}->{lib} if ($tagslib->{$field->tag()}->{$subf[$i][0]}->{tab}  eq 10);
-               if ($tagslib->{$field->tag()}->{$subf[$i][0]}->{tab}  eq 10) {
-               $this_row{$subf[$i][0]}=GetAuthorisedValueDesc( $field->tag(),
-                        $subf[$i][0], $subf[$i][1], '', $tagslib) 
-                                               || $subf[$i][1];
-               }
+        next if ($tagslib->{$field->tag()}->{$subfieldcode}->{tab} ne 10 
+                && ($field->tag() ne $itemtagfield 
+                && $subfieldcode   ne $itemtagsubfield));
+        $witness{$subfieldcode} = $tagslib->{$field->tag()}->{$subfieldcode}->{lib} if ($tagslib->{$field->tag()}->{$subfieldcode}->{tab}  eq 10);
+               if ($tagslib->{$field->tag()}->{$subfieldcode}->{tab}  eq 10) {
+                   $this_row{$subfieldcode} .= " | " if($this_row{$subfieldcode});
+               $this_row{$subfieldcode} .= GetAuthorisedValueDesc( $field->tag(),
+                        $subfieldcode, $subfieldvalue, '', $tagslib) 
+                                               || $subfieldvalue;
+        }
 
-        if (($field->tag eq $branchtagfield) && ($subf[$i][$0] eq $branchtagsubfield) && C4::Context->preference("IndependantBranches")) {
+        if (($field->tag eq $branchtagfield) && ($subfieldcode eq $branchtagsubfield) && C4::Context->preference("IndependantBranches")) {
             #verifying rights
             my $userenv = C4::Context->userenv();
-            unless (($userenv->{'flags'} == 1) or (($userenv->{'branch'} eq $subf[$i][1]))){
-                    $this_row{'nomod'}=1;
+            unless (($userenv->{'flags'} == 1) or (($userenv->{'branch'} eq $subfieldvalue))){
+                $this_row{'nomod'} = 1;
             }
         }
-        $this_row{itemnumber} = $subf[$i][1] if ($field->tag() eq $itemtagfield && $subf[$i][0] eq $itemtagsubfield);
+        $this_row{itemnumber} = $subfieldvalue if ($field->tag() eq $itemtagfield && $subfieldcode eq $itemtagsubfield);
     }
     if (%this_row) {
         push(@big_array, \%this_row);
@@ -374,201 +564,55 @@ foreach my $subfield_code (sort keys(%witness)) {
 my @loop_data =();
 my $i=0;
 
-my $branches = GetBranchesLoop();  # build once ahead of time, instead of multiple times later.
 my $pref_itemcallnumber = C4::Context->preference('itemcallnumber');
 
-# Getting the fields where the item location is
-my ($location_field, $location_subfield) = GetMarcFromKohaField('items.location', $frameworkcode);
-
-# Getting the name of the authorised values' category for item location
-my $item_location_category = $tagslib->{$location_field}->{$location_subfield}->{'authorised_value'};
-
-foreach my $tag (sort keys %{$tagslib}) {
-# loop through each subfield
-  foreach my $subfield (sort keys %{$tagslib->{$tag}}) {
-    next if subfield_is_koha_internal_p($subfield);
-    next if ($tagslib->{$tag}->{$subfield}->{'tab'} ne "10");
-    my %subfield_data;
-    my $index_subfield = int(rand(1000000)); 
-    if ($subfield eq '@'){
-        $subfield_data{id} = "tag_".$tag."_subfield_00_".$index_subfield;
-    } else {
-        $subfield_data{id} = "tag_".$tag."_subfield_".$subfield."_".$index_subfield;
-    }
-    $subfield_data{tag}        = $tag;
-    $subfield_data{subfield}   = $subfield;
-    $subfield_data{random}     = int(rand(1000000));    # why do we need 2 different randoms?
-#   $subfield_data{marc_lib}   = $tagslib->{$tag}->{$subfield}->{lib};
-    $subfield_data{marc_lib}   ="<span id=\"error$i\" title=\"".$tagslib->{$tag}->{$subfield}->{lib}."\">".$tagslib->{$tag}->{$subfield}->{lib}."</span>";
-    $subfield_data{mandatory}  = $tagslib->{$tag}->{$subfield}->{mandatory};
-    $subfield_data{repeatable} = $tagslib->{$tag}->{$subfield}->{repeatable};
-    my ($x,$value);
-    ($x,$value) = find_value($tag,$subfield,$itemrecord) if ($itemrecord);
-    $value =~ s/"/&quot;/g;
-    unless ($value) {
-        $value = $tagslib->{$tag}->{$subfield}->{defaultvalue};
-        # get today date & replace YYYY, MM, DD if provided in the default value
-        my ( $year, $month, $day ) = split ',', $today_iso;     # FIXME: iso dates don't have commas!
-        $value =~ s/YYYY/$year/g;
-        $value =~ s/MM/$month/g;
-        $value =~ s/DD/$day/g;
-    }
-    $subfield_data{visibility} = "display:none;" if (($tagslib->{$tag}->{$subfield}->{hidden} > 4) || ($tagslib->{$tag}->{$subfield}->{hidden} < -4));
-    # testing branch value if IndependantBranches.
-    if (!$value && $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.itemcallnumber' && $pref_itemcallnumber) {
-        my $CNtag       = substr($pref_itemcallnumber, 0, 3);
-        my $CNsubfield  = substr($pref_itemcallnumber, 3, 1);
-        my $CNsubfield2 = substr($pref_itemcallnumber, 4, 1);
-        my $temp2 = $temp->field($CNtag);
-        if ($temp2) {
-            $value = ($temp2->subfield($CNsubfield)).' '.($temp2->subfield($CNsubfield2));
-            #remove any trailing space incase one subfield is used
-            $value =~ s/^\s+|\s+$//g;
-        }
-    }
+my $onlymine = C4::Context->preference('IndependantBranches') && 
+               C4::Context->userenv                           && 
+               C4::Context->userenv->{flags}!=1               && 
+               C4::Context->userenv->{branch};
+my $branches = GetBranchesLoop(undef,$onlymine);  # build once ahead of time, instead of multiple times later.
 
-    my $attributes_no_value = qq(id="$subfield_data{id}" name="field_value" class="input_marceditor" size="67" maxlength="255" );
-    my $attributes          = qq($attributes_no_value value="$value" );
-    if ( $tagslib->{$tag}->{$subfield}->{authorised_value} ) {
-      my @authorised_values;
-      my %authorised_lib;
-      # builds list, depending on authorised value...
-  
-      if ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "branches" ) {
-          foreach my $thisbranch (@$branches) {
-              push @authorised_values, $thisbranch->{value};
-              $authorised_lib{$thisbranch->{value}} = $thisbranch->{branchname};
-              # in edit item this is set to the data value otherwise use default
-              if ($op ne 'edititem' && $thisbranch->{selected} ) {
-                  $value = $thisbranch->{value};
-              }
-          }
-      }
-      elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "itemtypes" ) {
-          push @authorised_values, "" unless ( $tagslib->{$tag}->{$subfield}->{mandatory} );
-          my $sth = $dbh->prepare("select itemtype,description from itemtypes order by description");
-          $sth->execute;
-          while ( my ( $itemtype, $description ) = $sth->fetchrow_array ) {
-              push @authorised_values, $itemtype;
-              $authorised_lib{$itemtype} = $description;
-          }
-
-          unless ( $value ) {
-              my $itype_sth = $dbh->prepare("SELECT itemtype FROM biblioitems WHERE biblionumber = ?");
-              $itype_sth->execute( $biblionumber );
-              ( $value ) = $itype_sth->fetchrow_array;
-          }
-  
-          #---- class_sources
-      }
-      elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "cn_source" ) {
-          push @authorised_values, "" unless ( $tagslib->{$tag}->{$subfield}->{mandatory} );
-            
-          my $class_sources = GetClassSources();
-          my $default_source = C4::Context->preference("DefaultClassificationSource");
-          
-          foreach my $class_source (sort keys %$class_sources) {
-              next unless $class_sources->{$class_source}->{'used'} or
-                          ($value and $class_source eq $value)      or
-                          ($class_source eq $default_source);
-              push @authorised_values, $class_source;
-              $authorised_lib{$class_source} = $class_sources->{$class_source}->{'description'};
-          }
-                 $value = $default_source unless ($value);
-
-          #---- "true" authorised value
-      }
-      else {
-          push @authorised_values, "" unless ( $tagslib->{$tag}->{$subfield}->{mandatory} );
-
-         # Are we dealing with item location ?
-          my $item_location = ($tagslib->{$tag}->{$subfield}->{authorised_value} eq $item_location_category) ? 1 : 0;
-
-          # If so, we sort by authorised_value, else by libelle
-          my $orderby = $item_location ? 'authorised_value' : 'lib';
-
-          my $authorised_values_sth = $dbh->prepare("SELECT authorised_value,lib FROM authorised_values WHERE category=? ORDER BY $orderby");
-
-          $authorised_values_sth->execute( $tagslib->{$tag}->{$subfield}->{authorised_value});
-
-
-          while ( my ( $value, $lib ) = $authorised_values_sth->fetchrow_array ) {
-            push @authorised_values, $value;
-               if ($tagslib->{$tag}->{$subfield}->{authorised_value} eq $item_location_category) {
-                               $authorised_lib{$value} = $value . " - " . $lib;
-               } else {
-                               $authorised_lib{$value} = $lib;
-               }
-
-               # For item location, we show the code and the libelle
-               $authorised_lib{$value} = ($item_location) ? $value . " - " . $lib : $lib;
-          }
-      }
-      $subfield_data{marc_value} =CGI::scrolling_list(      # FIXME: factor out scrolling_list
-          -name     => "field_value",
-          -values   => \@authorised_values,
-          -default  => $value,
-          -labels   => \%authorised_lib,
-          -override => 1,
-          -size     => 1,
-          -multiple => 0,
-         # -tabindex => 1,
-          -id       => "tag_".$tag."_subfield_".$subfield."_".$index_subfield,
-          -class    => "input_marceditor",
-      );
-    # it's a thesaurus / authority field
-    }
-    elsif ( $tagslib->{$tag}->{$subfield}->{authtypecode} ) {
-        $subfield_data{marc_value} = "<input type=\"text\" $attributes />
-            <a href=\"#\" class=\"buttonDot\"
-                onclick=\"Dopop('/cgi-bin/koha/authorities/auth_finder.pl?authtypecode=".$tagslib->{$tag}->{$subfield}->{authtypecode}."&index=$subfield_data{id}','$subfield_data{id}'); return false;\" title=\"Tag Editor\">...</a>
-    ";
-    # it's a plugin field
-    }
-    elsif ( $tagslib->{$tag}->{$subfield}->{value_builder} ) {
-        # opening plugin
-        my $plugin = C4::Context->intranetdir . "/cataloguing/value_builder/" . $tagslib->{$tag}->{$subfield}->{'value_builder'};
-        if (do $plugin) {
-            my $extended_param = plugin_parameters( $dbh, $temp, $tagslib, $subfield_data{id}, \@loop_data );
-            my ( $function_name, $javascript ) = plugin_javascript( $dbh, $temp, $tagslib, $subfield_data{id}, \@loop_data );
-            my $change = index($javascript, 'function Change') > -1 ?
-                "return Change$function_name($subfield_data{random}, '$subfield_data{id}');" :
-                'return 1;';
-            $subfield_data{marc_value} = qq[<input $attributes
-                onfocus="Focus$function_name($subfield_data{random}, '$subfield_data{id}');"
-                onchange=" $change"
-                 onblur=" Blur$function_name($subfield_data{random}, '$subfield_data{id}');" />
-                <a href="#" class="buttonDot" onclick="Clic$function_name('$subfield_data{id}'); return false;" title="Tag Editor">...</a>
-                $javascript];
-        } else {
-            warn "Plugin Failed: $plugin";
-            $subfield_data{marc_value} = "<input $attributes />"; # supply default input form
-        }
-    }
-    elsif ( $tag eq '' ) {       # it's an hidden field
-        $subfield_data{marc_value} = qq(<input type="hidden" $attributes />);
-    }
-    elsif ( $tagslib->{$tag}->{$subfield}->{'hidden'} ) {   # FIXME: shouldn't input type be "hidden" ?
-        $subfield_data{marc_value} = qq(<input type="text" $attributes />);
-    }
-    elsif ( length($value) > 100
-            or (C4::Context->preference("marcflavour") eq "UNIMARC" and
-                  300 <= $tag && $tag < 400 && $subfield eq 'a' )
-            or (C4::Context->preference("marcflavour") eq "MARC21"  and
-                  500 <= $tag && $tag < 600                     )
-          ) {
-        # oversize field (textarea)
-        $subfield_data{marc_value} = "<textarea $attributes_no_value>$value</textarea>\n";
-    } else {
-        # it's a standard field
-         $subfield_data{marc_value} = "<input $attributes />";
-    }
-#   $subfield_data{marc_value}="<input type=\"text\" name=\"field_value\">";
-    push (@loop_data, \%subfield_data);
-    $i++
+# We generate form, from actuel record
+my @fields;
+if($itemrecord){
+    foreach my $field ($itemrecord->fields()){
+        my $tag = $field->{_tag};
+        foreach my $subfield ( $field->subfields() ){
+
+            my $subfieldtag = $subfield->[0];
+            my $value       = $subfield->[1];
+            my $subfieldlib = $tagslib->{$tag}->{$subfieldtag};
+
+            next if subfield_is_koha_internal_p($subfieldtag);
+            next if ($tagslib->{$tag}->{$subfieldtag}->{'tab'} ne "10");
+
+            my $subfield_data = generate_subfield_form($tag, $subfieldtag, $value, $tagslib, $subfieldlib, $branches, $today_iso, $biblionumber, $temp, \@loop_data, $i);        
+
+            push @fields, "$tag$subfieldtag";
+            push (@loop_data, $subfield_data);
+            $i++;
+                    }
+
+                }
+            }
+    # and now we add fields that are empty
+
+foreach my $tag ( keys %{$tagslib}){
+    foreach my $subtag (keys %{$tagslib->{$tag}}){
+        next if subfield_is_koha_internal_p($subtag);
+        next if ($tagslib->{$tag}->{$subtag}->{'tab'} ne "10");
+        next if any { /^$tag$subtag$/ }  @fields;
+
+        my @values = (undef);
+        @values = $itemrecord->field($tag)->subfield($subtag) if ($itemrecord && defined($itemrecord->field($tag)->subfield($subtag)));
+        for my $value (@values){
+            my $subfield_data = generate_subfield_form($tag, $subtag, $value, $tagslib, $tagslib->{$tag}->{$subtag}, $branches, $today_iso, $biblionumber, $temp, \@loop_data, $i); 
+            push (@loop_data, $subfield_data);
+            $i++;
+        } 
   }
 }
+@loop_data = sort {$a->{subfield} cmp $b->{subfield} } @loop_data;
 
 # what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit.
 $template->param( title => $record->title() ) if ($record ne "-1");
index e0ab551..24414cc 100755 (executable)
@@ -48,7 +48,7 @@ my ($template, $loggedinuser, $cookie)
                  query => $query,
                  type => "intranet",
                  authnotrequired => 0,
-                 flagsrequired => {editcatalogue => 'edit_catalogue'},
+        flagsrequired   => { editcatalogue => 'edit_items' },
                  debug => 1,
                  });
 
index 905af94..5c1dcaf 100755 (executable)
@@ -27,6 +27,7 @@ use C4::Overdues;    # AddNotifyLine
 use C4::Biblio;
 use C4::Koha;
 use C4::Debug;
+use C4::Branch;
 
 =head1 branchoverdues.pl
 
@@ -103,21 +104,27 @@ my ($tag,$subfield) = GetMarcFromKohaField('items.location','');
 my $tagslib = &GetMarcStructure(1,'');
 if ($tagslib->{$tag}->{$subfield}->{authorised_value}) {
     my $values= GetAuthorisedValues($tagslib->{$tag}->{$subfield}->{authorised_value});
+    for (@$values) { $_->{selected} = 1 if $location eq $_->{authorised_value} }
     $template->param(locationsloop => $values);
 }
 # now display infos
 foreach my $num (@getoverdues) {
-
     my %overdueforbranch;
+    my $record = GetMarcBiblio($num->{biblionumber});
+    if ($record){
+        $overdueforbranch{'subtitle'} = GetRecordValue('subtitle',$record,'')->[0]->{subfield};
+    }
     $overdueforbranch{'date_due'}          = format_date( $num->{'date_due'} );
     $overdueforbranch{'title'}             = $num->{'title'};
     $overdueforbranch{'description'}       = $num->{'description'};
     $overdueforbranch{'barcode'}           = $num->{'barcode'};
     $overdueforbranch{'biblionumber'}      = $num->{'biblionumber'};
+    $overdueforbranch{'author'}            = $num->{'author'};
     $overdueforbranch{'borrowersurname'}   = $num->{'surname'};
     $overdueforbranch{'borrowerfirstname'} = $num->{'firstname'};
     $overdueforbranch{'borrowerphone'}     = $num->{'phone'};
     $overdueforbranch{'borroweremail'}     = $num->{'email'};
+    $overdueforbranch{'homebranch'}        = GetBranchName($num->{'homebranch'});
     $overdueforbranch{'itemcallnumber'}    = $num->{'itemcallnumber'};
     $overdueforbranch{'borrowernumber'}    = $num->{'borrowernumber'};
     $overdueforbranch{'itemnumber'}        = $num->{'itemnumber'};
index 2aac76a..c05277c 100755 (executable)
@@ -241,6 +241,13 @@ if ($barcode) {
         $input{duedate}        = $duedate;
         $input{return_overdue} = 1 if ($duedate and $duedate lt $today->output('iso'));
         push( @inputloop, \%input );
+
+        my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrower->{'borrowernumber'} );
+        if ($fines) {
+            $template->param( fines => sprintf("%.2f",$fines) );
+            $template->param( fineborrowernumber => $borrower->{'borrowernumber'} );
+        }
+
     }
     elsif ( !$messages->{'BadBarcode'} ) {
         $input{duedate}   = 0;
index e924bcf..0183f19 100755 (executable)
@@ -155,7 +155,8 @@ $template->param(
     overloop    => \@overloop,
     overcount   => $overcount,
     show_date   => format_date(C4::Dates->today('iso')),
-       dateformat  => C4::Context->preference("dateformat"),
+    dateformat  => C4::Context->preference("dateformat"),
+    ReservesMaxPickUpDelay => C4::Context->preference('ReservesMaxPickUpDelay')
 );
 
 output_html_with_http_headers $input, $cookie, $template->output;
index 155907e..1affa37 100644 (file)
@@ -400,7 +400,7 @@ January 16 2009      Daniel Sweeney becomes the 75th committer to Koha      developer
 January 24 2009         KUDOS (Koha Users and Developers of Open Source) for those using the software, Meeting at ALA
 January 24 2009         KOHA Interest Group Meeting at ALA
 February 5 2009         Koha 3.0.1 beta released
-February 6 2009         J. David Bavousett becomes the 76th committer to Koha  developer
+February 6 2009         D Ruth Bavousett becomes the 76th committer to Koha    developer
 February 10 2009        Andrew Elwell becomes the 77th committer to Koha       developer
 February 13 2009        K's Helping Hand launched http://krishnanm.com/khh
 February 13-14 2009     Prashant Kulkarni and Krishnan Mani present Koha at Gnunify 09
@@ -515,6 +515,19 @@ December 8 2010    General IRC meeting http://wiki.koha-community.org/wiki/General_
 December 15 2010       Serhij Dubyk becomes the 121st developer to have a patch pushed
 December 16 2010       Christophe Croullebois becomes the 122nd developer to have a patch pushed
 December 19 2010       Edward Allen becomes the 123rd developer to have a patch pushed
+December 20 2010       Dobrica Pavlinusic becomes the 124th developer to have a patch pushed
 December 22 2010       Koha 3.2.2 released
 January 5 2011 General IRC meeting http://wiki.koha-community.org/wiki/General_IRC_Meeting,_5_January_2011
-January 12 2011        Brice Sanchez becomes the 124th developer to have a patch pushed
+January 12 2011        Brice Sanchez becomes the 125th developer to have a patch pushed
+January 17 2011        Zach Sim becomes the 126th developer to have a patch pushed
+January 17 2011        Claudia Forsman becomes the 127th developer to have a patch pushed
+January 17 2011        John Copeland becomes the 128th developer to have a patch pushed
+January 17 2011        Stephanie Hogan becomes the 129th developer to have a patch pushed
+January 22 2011        Koha 3.2.3 released
+January 26 2011        Jerome Charaoui becomes the 130th developer to have a patch pushed
+January 31 2011        Reed Wade becomes the 131sth developer to have a patch pushed
+February 1 2011        #koha moves from irc.katipo.co.nz to irc.oftc.net
+February 2 2011        General IRC meeting http://wiki.koha-community.org/wiki/General_IRC_Meeting,_2_February_2011
+February 3 2011        Frédérick Capovilla becomes the 132nd developer to have a patch pushed
+February 4 2011        Christopher Hall becomes the 133rd developer to have a patch pushed
+
index 7d40310..5baa5b2 100644 (file)
@@ -15,8 +15,8 @@ melm 001 Local-Number
 melm 942$a authtype:w,authtype:p
 
 # Personal Name
-melm 100 Personal-name:w,Personal-name:p,Personal-name:s,Heading:w,Heading:p,Heading:s
 melm 100$a Personal-name-heading:w,Personal-name-heading:p,Personal-name-heading:s,Personal-name:w,Personal-name:p,Heading:w,Heading:p,Heading:s,Heading-Main:w,Heading-Main:p,Heading-Main:s
+melm 100 Personal-name:w,Personal-name:p,Personal-name:s,Heading:w,Heading:p,Heading:s
 melm 400 Personal-name-see-from:w,Personal-name-see-from:p,Personal-name-see-from:s,See-from:w,See-from:p,See-from:s
 melm 500 Personal-name-see-also-from:w,Personal-name-see-also-from:p,Personal-name-see-also-from:s,See-also-from:w,See-also-from:p,See-also-from:s
 
index c43cad1..85eaedd 100755 (executable)
@@ -122,23 +122,23 @@ melm 400$a      Name-and-title
 melm 400$t      Author-title,Name-and-title,Title,Title-series
 melm 400$9      Koha-Auth-Number
 melm 400        Author,Author-name-personal,Name,Personal-name
-melm 410        Author,Corporate-name
 melm 410$a      Name-and-title
 melm 410$t      Author-title,Title,Title-series
 melm 410$9      Koha-Auth-Number
-melm 410        Author-name-corporate,Name
-melm 411        Author,Conference-name
+melm 410        Author,Corporate-name
+#melm 410        Author-name-corporate,Name
 melm 411$a      Name-and-title
 #melm 411$t     title,author,Author-title,Title-series
 melm 411$t      Author-title,Title-series
+melm 411        Author,Conference-name
 #melm 411       author,Author-name-corporate,Name
-melm 411        Author-name-corporate,Name
+#melm 411        Author-name-corporate,Name
 melm 440$a      Title-series:w,Title-series:p
 melm 440$9      Koha-Auth-Number
 melm 440        Title-series:w,Title-series:p,Title,Title-series
 melm 490$a      Title-series:w,Title-series:p
-melm 490        Title,Title-series
 melm 490$9      Koha-Auth-Number
+melm 490        Title,Title-series
 
 melm 500        Note:w,Note:p
 melm 502        Material-type
@@ -163,11 +163,10 @@ melm 610$a      Name-and-title
 melm 610$t      Name-and-title,Title
 melm 610$9      Koha-Auth-Number
 melm 610        Name,Subject,Corporate-name
-melm 611        Conference-name
 melm 611$a      Name-and-title
 melm 611$t      Name-and-title,Title
 melm 611$9      Koha-Auth-Number
-melm 611        Name,Subject
+melm 611        Conference-name,Name,Subject
 melm 630$n      Thematic-number
 melm 630$r      Music-key
 melm 630$9      Koha-Auth-Number
@@ -201,14 +200,12 @@ melm 700$r      Music-key
 #melm 700$t     author,Author-title,Name-and-title,Title,Title-uniform
 melm 700$t      Author-title,Name-and-title,Title,Title-uniform
 melm 700        Author,Author-name-corporate,Author-name-personal,Name,Editor,Personal-name
-melm 710        Author,Corporate-name
 #melm 710$t     author,Author-title,Name-and-title,Title,Title-uniform
 melm 710$t      Author-title,Name-and-title,Title,Title-uniform
 #melm 710$a     author,author:p,Name-and-title
 melm 710$a      Name-and-title
 melm 710$9      Koha-Auth-Number    
-#melm 710       author,Name
-melm 710        Author,Name
+melm 710        Author,Corporate-name,Name
 melm 711$a      Name-and-title
 #melm 711$t     author,Author-title,Title,Title-uniform
 melm 711$t      Author-title,Title,Title-uniform
@@ -220,6 +217,9 @@ melm 730$r      Music-key
 melm 730$9      Koha-Auth-Number
 melm 730        Title,Title-uniform
 melm 740        Title,Title-other-variant
+melm 751$a      Name-geographic
+melm 751$9      Koha-Auth-Number
+melm 751        Name-geographic
 melm 770$w      Record-control-number
 melm 772$w      Record-control-number
 melm 773$t      Host-item
@@ -231,16 +231,16 @@ melm 777$w      Record-control-number
 melm 780$t      Title
 melm 780$w      Record-control-number
 melm 780        Title,Title-former,Related-periodical
-melm 785        Related-periodical
 melm 785$w      Record-control-number
+melm 785        Related-periodical
 melm 787$w      Record-control-number
 
 melm 800$a      Name-and-title
 #melm 800$t     author,Author-title,Name-and-title,Title,Title-series
 melm 800$t      Author-title,Name-and-title,Title,Title-series
 melm 800$9      Koha-Auth-Number
-melm 800        Author,Author-name-personal,Name,Personal-name
 melm 800$w      Record-control-number
+melm 800        Author,Author-name-personal,Name,Personal-name
 melm 810$a      Name-and-title
 melm 810$t      Author-title,Name-and-title,Title,Title-series
 melm 810$w      Record-control-number
index f2e0648..4121a59 100644 (file)
@@ -135,7 +135,7 @@ INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
 VALUES( 'da','dan');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES ( 'da', 'language', 'da', 'D&aelig;nsk');
+VALUES ( 'da', 'language', 'da', 'Dansk');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'da', 'language', 'en', 'Danish');
@@ -151,7 +151,7 @@ INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
 VALUES( 'nl','dut');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES ( 'nl', 'language', 'nl', 'ned&#601;rl&#593;ns');
+VALUES ( 'nl', 'language', 'nl', 'Nederlands');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'nl', 'language', 'en', 'Dutch');
@@ -385,21 +385,43 @@ VALUES( 'gl', 'language', 'gl', 'Galego');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'gl', 'language', 'en', 'Galician');
 
--- Norwegian
+-- Norwegian (bokmål)
 INSERT INTO language_subtag_registry( subtag, type, description, added)
-VALUES ( 'nb', 'language', 'Norwegian','2005-10-16' );
+VALUES ( 'nb', 'language', 'Norwegian bokm&#229;l','2005-10-16' );
 
 INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
 VALUES( 'nb','nor');
 
+INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
+VALUES( 'nb','nob');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'nb', 'language', 'nb', 'Norsk bokm&#229;l');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'nb', 'language', 'en', 'Norwegian bokm&#229;l');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'nb', 'language', 'fr', 'Norvégien bokm&#229;l');
+
+-- Norwegian (nynorsk)
+INSERT INTO language_subtag_registry( subtag, type, description, added)
+VALUES ( 'nn', 'language', 'Norwegian nynorsk','2011-02-14' );
+
+INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
+VALUES( 'nn','nno');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'nn', 'language', 'nb', 'Norsk nynorsk');
+
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES( 'nb', 'language', 'nb', 'Norsk');
+VALUES( 'nn', 'language', 'nn', 'Norsk nynorsk');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES( 'nb', 'language', 'en', 'Norwegian');
+VALUES( 'nn', 'language', 'en', 'Norwegian nynorsk');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES( 'nb', 'language', 'fr', 'Norvégien');
+VALUES( 'nn', 'language', 'fr', 'Norvégien nynorsk');
 
 -- Persian
 INSERT INTO language_subtag_registry( subtag, type, description, added)
index f636097..02511d8 100644 (file)
@@ -9,7 +9,8 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AmazonLocale','US','Use to set the Locale of your Amazon.com Web Services','US|CA|DE|FR|JP|UK','Choice');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AWSAccessKeyID','','See:  http://aws.amazon.com','','free');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AmazonAssocTag','','See:  http://aws.amazon.com','','free');
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AnonSuggestions',0,'Set to anonymous borrowernumber to enable Anonymous suggestions',NULL,'free');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AnonSuggestions',0,'Set to enable Anonymous suggestions to AnonymousPatron borrowernumber',NULL,'YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AnonymousPatron', '0', 'Set the identifier (borrowernumber) of the anonymous patron. Used for Suggestion and reading history privacy',NULL,'');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('Babeltheque',0,'Turn ON Babeltheque content  - See babeltheque.com to subscribe to this service','','YesNo');
 
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('authoritysep','--','Used to separate a list of authorities in a display. Usually --',10,'free');
@@ -79,6 +80,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacNav','Important links here.','Use HTML tags to add navigational links to the left-hand navigational bar in OPAC','70|10','Textarea');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACNoResultsFound','','Display this HTML when no results are found for a search in the OPAC','70|10','Textarea');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPasswordChange',1,'If ON, enables patron-initiated password change in OPAC (disable it when using LDAP auth)',NULL,'YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPrivacy', '0', 'if ON, allows patrons to define their privacy rules (reading history)',NULL,'YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacreadinghistory',1,'If ON, enables display of Patron Circulation History in OPAC','','YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacsmallimage','','Enter a complete URL to an image to replace the default Koha logo','','free');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacstylesheet','','Enter a complete URL to use an alternate layout stylesheet in OPAC','','free');
@@ -279,3 +281,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('DisplayMultiPlaceHold','1','Display the ability to place multiple holds or not','','YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('HomeOrHoldingBranchReturn','homebranch','Used by Circulation to determine which branch of an item to check checking-in items','holdingbranch|homebranch','Choice');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UseTablesortForCirc','0','If on, use the JQuery tablesort function on the list of current borrower checkouts on the circulation page.  Note that the use of this function may slow down circ for patrons with may checkouts.','','YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo');
index 206100c..cc45fdd 100644 (file)
@@ -1808,6 +1808,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('648', '3', 'Spezifische Materialangaben', 'Spezifische Materialangaben', 0, 0, NULL, 6, NULL, NULL, '', NULL, -6, '', '', '', NULL),
                ('648', '6', 'Verknüpfung', 'Verknüpfung', 0, 0, NULL, 6, NULL, NULL, '', NULL, -6, '', '', '', NULL),
                ('648', '8', 'Feldverknüpfung und Reihenfolge', 'Feldverknüpfung und Reihenfolge', 1, 0, NULL, 6, NULL, NULL, '', NULL, -6, '', '', '', NULL),
+               ('648', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('648', 'a', 'Zeitschlagwort', 'Zeitschlagwort', 0, 0, NULL, 6, NULL, 'CHRON_TERM', '', NULL, 0, '', '', '', NULL),
                ('648', 'v', 'Titel eines Werkes', 'Titel eines Werkes', 1, 0, NULL, 6, NULL, NULL, '', NULL, 0, '', '', '', NULL),
                ('648', 'x', 'Allgemeine Unterteilung', 'Allgemeine Unterteilung', 1, 0, NULL, 6, NULL, NULL, '', NULL, 0, '', '', '', NULL),
@@ -1853,6 +1854,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('654', '4', 'Funktionsbezeichnungscode', 'Funktionsbezeichnungscode', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('654', '6', 'Verknüpfung', 'Verknüpfung', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('654', '8', 'Feldverknüpfung und Reihenfolge', 'Feldverknüpfung und Reihenfolge', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
+               ('654', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('654', 'a', 'Fokussierter Term', 'Fokussierter Term', 1, 0, '', 6, '', 'TOPIC_TERM', '', NULL, 0, '', '', '', NULL),
                ('654', 'b', 'Nicht-fokussierter Term', 'Nicht-fokussierter Term', 1, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
                ('654', 'c', 'Benennung der Normierung/Hierarchie', 'Benennung der Normierung/Hierarchie', 1, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
@@ -1866,6 +1868,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('655', '5', 'Das Unterfeld gibt die Institution an, auf die sich das Feld bezieht', 'Das Unterfeld gibt die Institution an, auf die sich das Feld bezieht', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('655', '6', 'Verknüpfung', 'Verknüpfung', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('655', '8', 'Feldverknüpfung und Reihenfolge', 'Feldverknüpfung und Reihenfolge', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
+               ('655', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('655', 'a', 'Genre/Form oder fokussierter Term', 'Genre/Form oder fokussierter Term', 0, 0, '', 6, '', 'GENRE/FORM', '', NULL, 0, '', '', '', NULL),
                ('655', 'b', 'Nicht-fokussierter Term', 'Nicht-fokussierter Term', 1, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
                ('655', 'c', 'Benennung der Normierung/Hierarchie', 'Benennung der Normierung/Hierarchie', 1, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
@@ -1877,6 +1880,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('656', '3', 'Spezifische Materialangaben', 'Spezifische Materialangaben', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('656', '6', 'Verknüpfung', 'Verknüpfung', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('656', '8', 'Feldverknüpfung und Reihenfolge', 'Feldverknüpfung und Reihenfolge', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
+               ('656', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('656', 'a', 'Beruf', 'Beruf', 0, 0, '', 6, '', 'TOPIC_TERM', '', NULL, -6, '', '', '', NULL),
                ('656', 'k', 'Form', 'Form', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('656', 'v', 'Unterteilung nach Form', 'Unterteilung nach Form', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
@@ -1887,6 +1891,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('657', '3', 'Spezifische Materialangaben', 'Spezifische Materialangaben', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('657', '6', 'Verknüpfung', 'Verknüpfung', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('657', '8', 'Feldverknüpfung und Reihenfolge', 'Feldverknüpfung und Reihenfolge', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
+               ('657', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('657', 'a', 'Funktion', 'Funktion', 0, 0, '', 6, '', 'TOPIC_TERM', '', NULL, -6, '', '', '', NULL),
                ('657', 'v', 'Titel eines Werkes', 'Titel eines Werkes', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('657', 'x', 'Allgemeine Unterteilung', 'Allgemeine Unterteilung', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
@@ -1895,6 +1900,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('658', '2', 'Quelle des Terms', 'Quelle des Terms', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('658', '6', 'Verknüpfung', 'Verknüpfung', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('658', '8', 'Feldverknüpfung und Reihenfolge', 'Feldverknüpfung und Reihenfolge', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
+               ('658', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('658', 'a', 'Hauptlehrplanziel', 'Hauptlehrplanziel', 0, 0, '', 6, '', 'TOPIC_TERM', '', NULL, -6, '', '', '', NULL),
                ('658', 'b', 'Untergeordnetes Lehrplanziel', 'Untergeordnetes Lehrplanziel', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('658', 'c', 'Lehrplan-Code', 'Lehrplan-Code', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
@@ -1904,6 +1910,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('662', '4', 'Funktionsbezeichnungscode', 'Funktionsbezeichnungscode', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('662', '6', 'Verknüpfung', 'Verknüpfung', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('662', '8', 'Feldverknüpfung und Reihenfolge', 'Feldverknüpfung und Reihenfolge', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
+               ('662', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('662', 'a', 'Land oder größere Einheit', 'Land oder größere Einheit', 1, 0, '', 6, '', 'GEOGR_NAME', '', NULL, 0, '', '', '', NULL),
                ('662', 'b', 'Politische Zuständigkeit erster Instanz', 'Politische Zuständigkeit erster Instanz', 0, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
                ('662', 'c', 'Politische Zuständigkeit erster Instanz', 'Politische Zuständigkeit erster Instanz', 1, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
@@ -3985,4 +3992,4 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('998', 'p', 'PROC (RLIN)', 'PROC (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
                ('998', 's', 'CC (RLIN)', 'CC (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
                ('998', 't', 'RTYP (RLIN)', 'RTYP (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('998', 'w', 'PLINK (RLIN)', 'PLINK (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL);
\ No newline at end of file
+               ('998', 'w', 'PLINK (RLIN)', 'PLINK (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL);
index 852805d..90a3bed 100644 (file)
@@ -135,7 +135,7 @@ INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
 VALUES( 'da','dan');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES ( 'da', 'language', 'da', 'D&aelig;nsk');
+VALUES ( 'da', 'language', 'da', 'Dansk');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'da', 'language', 'en', 'Danish');
@@ -151,7 +151,7 @@ INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
 VALUES( 'nl','dut');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES ( 'nl', 'language', 'nl', 'ned&#601;rl&#593;ns');
+VALUES ( 'nl', 'language', 'nl', 'Nederlands');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'nl', 'language', 'en', 'Dutch');
@@ -388,21 +388,43 @@ VALUES( 'gl', 'language', 'gl', 'Galego');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'gl', 'language', 'en', 'Galician');
 
--- Norwegian
+-- Norwegian (bokmål)
 INSERT INTO language_subtag_registry( subtag, type, description, added)
-VALUES ( 'nb', 'language', 'Norwegian','2005-10-16' );
+VALUES ( 'nb', 'language', 'Norwegian bokm&#229;l','2005-10-16' );
 
 INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
 VALUES( 'nb','nor');
 
+INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
+VALUES( 'nb','nob');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'nb', 'language', 'nb', 'Norsk bokm&#229;l');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'nb', 'language', 'en', 'Norwegian bokm&#229;l');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'nb', 'language', 'fr', 'Norvégien bokm&#229;l');
+
+-- Norwegian (nynorsk)
+INSERT INTO language_subtag_registry( subtag, type, description, added)
+VALUES ( 'nn', 'language', 'Norwegian nynorsk','2011-02-14' );
+
+INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
+VALUES( 'nn','nno');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'nn', 'language', 'nb', 'Norsk nynorsk');
+
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES( 'nb', 'language', 'nb', 'Norsk');
+VALUES( 'nn', 'language', 'nn', 'Norsk nynorsk');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES( 'nb', 'language', 'en', 'Norwegian');
+VALUES( 'nn', 'language', 'en', 'Norwegian nynorsk');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES( 'nb', 'language', 'fr', 'Norvégien');
+VALUES( 'nn', 'language', 'fr', 'Norvégien nynorsk');
 
 -- Persian
 INSERT INTO language_subtag_registry( subtag, type, description, added)
index 3e16fd5..0b75e98 100644 (file)
@@ -9,7 +9,8 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AmazonLocale','US','Use to set the Locale of your Amazon.com Web Services','US|CA|DE|FR|JP|UK','Choice');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AWSAccessKeyID','','See:  http://aws.amazon.com','','free');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AmazonAssocTag','','See:  http://aws.amazon.com','','free');
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AnonSuggestions',0,'Set to anonymous borrowernumber to enable Anonymous suggestions',NULL,'free');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AnonSuggestions',0,'Set to enable Anonymous suggestions to AnonymousPatron borrowernumber',NULL,'YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AnonymousPatron', '0', 'Set the identifier (borrowernumber) of the anonymous patron. Used for Suggestion and reading history privacy',NULL,'');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('Babeltheque',0,'Turn ON Babeltheque content  - See babeltheque.com to subscribe to this service','','YesNo');
 
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('authoritysep','--','Used to separate a list of authorities in a display. Usually --',10,'free');
@@ -79,11 +80,13 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacNav','Important links here.','Use HTML tags to add navigational links to the left-hand navigational bar in OPAC','70|10','Textarea');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACNoResultsFound','','Display this HTML when no results are found for a search in the OPAC','70|10','Textarea');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPasswordChange',1,'If ON, enables patron-initiated password change in OPAC (disable it when using LDAP auth)',NULL,'YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPrivacy', '0', 'if ON, allows patrons to define their privacy rules (reading history)',NULL,'YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacreadinghistory',1,'If ON, enables display of Patron Circulation History in OPAC','','YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacsmallimage','','Enter a complete URL to an image to replace the default Koha logo','','free');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacstylesheet','','Enter a complete URL to use an alternate layout stylesheet in OPAC','','free');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacthemes','prog','Define the current theme for the OPAC interface.','','Themes');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacTopissue',0,'If ON, enables the \'most popular items\' link on OPAC. Warning, this is an EXPERIMENTAL feature, turning ON may overload your server',NULL,'YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacuserjs','','Define custom javascript for inclusion in OPAC','70|10','Textarea');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacuserlogin',1,'Enable or disable display of user login features',NULL,'YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('patronimages',0,'Enable patron images for the Staff Client',NULL,'YesNo');
@@ -279,3 +282,6 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ILS-DI:AuthorizedIPs','','.','Restricts usage of ILS-DI to some IPs','Free');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OverduesBlockCirc','noblock','When checking out an item should overdues block checkout, generate a confirmation dialogue, or allow checkout','noblock|confirmation|block','Choice');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('DisplayMultiPlaceHold','1','Display the ability to place multiple holds or not','','YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo');
index 3278c2f..5b4fa11 100644 (file)
@@ -1808,6 +1808,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('648', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 6, NULL, NULL, '', NULL, -6, '', '', '', NULL),
                ('648', '6', 'Linkage', 'Linkage', 0, 0, NULL, 6, NULL, NULL, '', NULL, -6, '', '', '', NULL),
                ('648', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 6, NULL, NULL, '', NULL, -6, '', '', '', NULL),
+               ('648', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('648', 'a', 'Chronological term', 'Chronological term', 0, 0, NULL, 6, NULL, 'CHRON_TERM', '', NULL, 0, '', '', '', NULL),
                ('648', 'v', 'Form subdivision', 'Form subdivision', 1, 0, NULL, 6, NULL, NULL, '', NULL, 0, '', '', '', NULL),
                ('648', 'x', 'General subdivision', 'General subdivision', 1, 0, NULL, 6, NULL, NULL, '', NULL, 0, '', '', '', NULL),
@@ -1853,6 +1854,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('654', '4', 'Relator code', 'Relator code', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('654', '6', 'Linkage', 'Linkage', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('654', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
+               ('654', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('654', 'a', 'Focus term', 'Focus term', 1, 0, '', 6, '', 'TOPIC_TERM', '', NULL, 0, '', '', '', NULL),
                ('654', 'b', 'Non-focus term', 'Non-focus term', 1, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
                ('654', 'c', 'Facet/hierarchy designation', 'Facet/hierarchy designation', 1, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
@@ -1866,6 +1868,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('655', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('655', '6', 'Linkage', 'Linkage', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('655', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
+               ('655', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('655', 'a', 'Genre/form data or focus term', 'Genre/form data or focus term', 0, 0, '', 6, '', 'GENRE/FORM', '', NULL, 0, '', '', '', NULL),
                ('655', 'b', 'Non-focus term', 'Non-focus term', 1, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
                ('655', 'c', 'Facet/hierarchy designation', 'Facet/hierarchy designation', 1, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
@@ -1877,6 +1880,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('656', '3', 'Materials specified', 'Materials specified', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('656', '6', 'Linkage', 'Linkage', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('656', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
+               ('656', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('656', 'a', 'Occupation', 'Occupation', 0, 0, '', 6, '', 'TOPIC_TERM', '', NULL, -6, '', '', '', NULL),
                ('656', 'k', 'Form', 'Form', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('656', 'v', 'Form subdivision', 'Form subdivision', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
@@ -1887,6 +1891,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('657', '3', 'Materials specified', 'Materials specified', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('657', '6', 'Linkage', 'Linkage', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('657', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
+               ('657', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('657', 'a', 'Function', 'Function', 0, 0, '', 6, '', 'TOPIC_TERM', '', NULL, -6, '', '', '', NULL),
                ('657', 'v', 'Form subdivision', 'Form subdivision', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('657', 'x', 'General subdivision', 'General subdivision', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
@@ -1895,6 +1900,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('658', '2', 'Source of term', 'Source of term', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('658', '6', 'Linkage', 'Linkage', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('658', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
+               ('658', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('658', 'a', 'Main curriculum objective', 'Main curriculum objective', 0, 0, '', 6, '', 'TOPIC_TERM', '', NULL, 0, '', '', '', NULL),
                ('658', 'b', 'Subordinate curriculum objective', 'Subordinate curriculum objective', 1, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
                ('658', 'c', 'Curriculum code', 'Curriculum code', 0, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
@@ -1904,6 +1910,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('662', '4', 'Relator code', 'Relator code', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('662', '6', 'Linkage', 'Linkage', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('662', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
+               ('662', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('662', 'a', 'Country or larger entity', 'Country or larger entity', 1, 0, '', 6, '', 'GEOGR_NAME', '', NULL, 0, '', '', '', NULL),
                ('662', 'b', 'First-order political jurisdiction', 'First-order political jurisdiction', 0, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
                ('662', 'c', 'Intermediate political jurisdiction', 'Intermediate political jurisdiction', 1, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
index 12856d0..4c81325 100644 (file)
@@ -51,3 +51,7 @@ INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('MANUA
 
 -- custom borrower notes
 INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('BOR_NOTES','ADDR','Address Notes');
+
+-- OPAC Suggestions reasons
+INSERT INTO authorised_values (category,authorised_value,lib,lib_opac) VALUES ('OPAC_SUG','damaged','The copy on the shelf is damaged','The copy on the shelf is damaged');
+INSERT INTO authorised_values (category,authorised_value,lib,lib_opac) VALUES ('OPAC_SUG','bestseller','Upcoming title by popular author','Upcoming title by popular author');
index 0f298c3..caa354b 100644 (file)
@@ -119,7 +119,7 @@ INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
 VALUES( 'da','dan');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES ( 'da', 'language', 'da', 'D&aelig;nsk');
+VALUES ( 'da', 'language', 'da', 'Dansk');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'da', 'language', 'en', 'Danish');
@@ -135,7 +135,7 @@ INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
 VALUES( 'nl','dut');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES ( 'nl', 'language', 'nl', 'ned&#601;rl&#593;ns');
+VALUES ( 'nl', 'language', 'nl', 'Nederlands');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'nl', 'language', 'en', 'Dutch');
@@ -332,21 +332,43 @@ VALUES( 'la', 'language', 'en', 'Latin');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'la', 'language', 'fr', 'Latin');
 
--- Norwegian
+-- Norwegian (bokmål)
 INSERT INTO language_subtag_registry( subtag, type, description, added)
-VALUES ( 'nb', 'language', 'Norwegian','2005-10-16' );
+VALUES ( 'nb', 'language', 'Norwegian bokm&#229;l','2005-10-16' );
 
 INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
 VALUES( 'nb','nor');
 
+INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
+VALUES( 'nb','nob');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'nb', 'language', 'nb', 'Norsk bokm&#229;l');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'nb', 'language', 'en', 'Norwegian bokm&#229;l');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'nb', 'language', 'fr', 'Norvégien bokm&#229;l');
+
+-- Norwegian (nynorsk)
+INSERT INTO language_subtag_registry( subtag, type, description, added)
+VALUES ( 'nn', 'language', 'Norwegian nynorsk','2011-02-14' );
+
+INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
+VALUES( 'nn','nno');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'nn', 'language', 'nb', 'Norsk nynorsk');
+
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES( 'nb', 'language', 'nb', 'Norsk');
+VALUES( 'nn', 'language', 'nn', 'Norsk nynorsk');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES( 'nb', 'language', 'en', 'Norwegian');
+VALUES( 'nn', 'language', 'en', 'Norwegian nynorsk');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES( 'nb', 'language', 'fr', 'Norvégien');
+VALUES( 'nn', 'language', 'fr', 'Norvégien nynorsk');
 
 -- Persian
 INSERT INTO language_subtag_registry( subtag, type, description, added)
index d85c5c1..757f255 100644 (file)
@@ -10,7 +10,8 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AmazonLocale','US','Utilisé pour définir la localisation des web services Amazon','US|CA|DE|FR|JP|UK','Choice');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AWSAccessKeyID','','Voir :  http://aws.amazon.com','','free');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AmazonAssocTag', '', 'Voir : associates.amazon.com/gp/flex/associates/apply-login.html', '', '');
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AnonSuggestions', '0', 'Attribuée au n° de l''emprunteur anonyme pour activer les suggestions anonymes. 0, pas de suggestions anonymes.', '', 'free');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AnonSuggestions',0,'Set to enable Anonymous suggestions to AnonymousPatron borrowernumber',NULL,'YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AnonymousPatron', '0', 'Set the identifier (borrowernumber) of the anonymous patron. Used for Suggestion and reading history privacy',NULL,'');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('Babeltheque',0,'Active les contenus Babelthèque - Voir babeltheque.com pour s''abonner','','YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('authoritysep', '--', 'Le séparateur utilisé dans les autorités. Habituellement --', '10', 'free');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('autoBarcode', 'OFF', 'Utilisé pour générer automatiquement les codes barre: incremental sera de la forme 1, 2, 3; annual de la forme 2007-0001, 2007-0002, hbyymmincr de la forme HB09010001 où HB=la branche d''appartenance', 'incremental|annual|hbyymmincr|OFF', 'Choice');
@@ -91,6 +92,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacMainUserBlock','Bienvenue dans Koha...\r\n<hr>','Bloc HTML défini par la bibliothèque, qui apparaît sur la page principale de l''OPAC','70|10','Textarea');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacNav', '', 'Ce paramètre contient du code HTML, qui est mis au début de la barre de navigation, sur la gauche, à l''OPAC.','70|10',  'Textarea');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPasswordChange', '1', 'Si ce paramètre est activé, les adhérents peuvent modifier leur mot de passe à l''OPAC. A désactiver si vous utilisez l''authentification ldap', '', 'YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPrivacy', '0', 'if ON, allows patrons to define their privacy rules (reading history)',NULL,'YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacreadinghistory', '1', 'Si ce paramètre est activé, les adhérents peuvent consulter leur historique de lecture à l''OPAC', '', 'YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacsmallimage', '', 'Ce paramètre contient une URL. Il permet de définir l''image qui est affichée en haut, à gauche de l''OPAC', '', 'free');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacstylesheet', '', 'Ce paramètre a la forme d''une URL. Il définit la feuille de style utilisée à l''OPAC. S''il est vide, vous aurez la feuille de style par défault de Koha', '', 'free');
@@ -281,3 +283,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetBiblioDefaultView','normal','Choix de la vue par défaut d''une notice détaillée à l''intranet : normal, labeled_marc, marc or isbd','normal|marc|isbd|labeled_marc','Choice');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('IntranetUserCSS','','Add CSS to be included in the intranet in an embedded <style> tag.',NULL,'free');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OPACNoResultsFound','','Display this HTML when no results are found for a search in the OPAC','70|10','Textare    a');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo');
\ No newline at end of file
index 0f3d9c5..888a17a 100644 (file)
@@ -1,2 +1,2 @@
 SET NAMES utf8;
-INSERT INTO `opac_news` VALUES (1,'Bienvenue dans Koha !','Bienvenue dans Koha 3, la toute nouvelle version du système intégré de gestion de bibliothèque (SIGB) open source de référence. Développé initialement en Nouvelle Zélande et déployé pour la première fois en janvier 2000, Koha est un projet international soutenu par des sociétés de services en logiciels libres et par des bibliothécaires du monde entier.','koha','2008-01-14 03:25:58','2099-01-10',1),(2,'Et maintenant ?','Félicitations ! vous avez désormais une version opérationnelle de Koha. Et maintenant, que faire ?\r\n<ul>\r\n<li><a href=\"http://koha-community.org/documentation/\">lisez la documentation de Koha ;</a></li>\r\n<li><a href=\"http://wiki.koha-community.org\">lisez et participez au Wiki de Koha ;</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">abonnez-vous aux listes de discussion ;</a></li>\r\n<li><a href=\"http://bugs.koha-community.org\">signalez des bugs ;</a></li>\r\n<li><a href=\"http://wiki.koha-community.org/wiki/Version_Control_Using_Git\">proposez des correctifs et des  améliorations ;</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">discutez avec les utilisateurs et les développeurs de Koha.</a></li>\r\n</ul>\r\n','koha','2008-01-14 03:34:45','2099-01-10',2);
+INSERT INTO `opac_news` VALUES (1,'Bienvenue dans Koha !','Bienvenue dans Koha 3, la toute nouvelle version du système intégré de gestion de bibliothèque (SIGB) open source de référence. Développé initialement en Nouvelle Zélande et déployé pour la première fois en janvier 2000, Koha est un projet international soutenu par des sociétés de services en logiciels libres et par des bibliothécaires du monde entier.','koha','2008-01-14 03:25:58','2099-01-10',1),(2,'Et maintenant ?','Félicitations ! vous avez désormais une version opérationnelle de Koha. Et maintenant, que faire ?\r\n<ul>\r\n<li><a href=\"http://koha-community.org/documentation/\">lisez la documentation de Koha ;</a></li>\r\n<li><a href=\"http://wiki.koha-community.org\">lisez et participez au Wiki de Koha ;</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">abonnez-vous aux listes de discussion ;</a></li>\r\n<li><a href=\"http://bugs.koha-community.org\">signalez des bugs ;</a></li>\r\n<li><a href=\"http://wiki.koha-community.org/doku.php?id=en:development:git_usage\">proposez des correctifs et des  améliorations ;</a></li>\r\n<li><a href=\"http://koha-community.org/support/\">discutez avec les utilisateurs et les développeurs de Koha.</a></li>\r\n</ul>\r\n','koha','2008-01-14 03:34:45','2099-01-10',2);
index cb673dc..3dddb02 100644 (file)
@@ -1808,6 +1808,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('648', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 6, NULL, NULL, '', NULL, -6, '', '', '', NULL),
                ('648', '6', 'Linkage', 'Linkage', 0, 0, NULL, 6, NULL, NULL, '', NULL, -6, '', '', '', NULL),
                ('648', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 6, NULL, NULL, '', NULL, -6, '', '', '', NULL),
+               ('648', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('648', 'a', 'Chronological term', 'Chronological term', 0, 0, NULL, 6, NULL, 'CHRON_TERM', '', NULL, 0, '', '', '', NULL),
                ('648', 'v', 'Form subdivision', 'Form subdivision', 1, 0, NULL, 6, NULL, NULL, '', NULL, 0, '', '', '', NULL),
                ('648', 'x', 'General subdivision', 'General subdivision', 1, 0, NULL, 6, NULL, NULL, '', NULL, 0, '', '', '', NULL),
@@ -1853,6 +1854,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('654', '4', 'Relator code', 'Relator code', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('654', '6', 'Linkage', 'Linkage', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('654', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
+               ('654', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('654', 'a', 'Focus term', 'Focus term', 1, 0, '', 6, '', 'TOPIC_TERM', '', NULL, 0, '', '', '', NULL),
                ('654', 'b', 'Non-focus term', 'Non-focus term', 1, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
                ('654', 'c', 'Facet/hierarchy designation', 'Facet/hierarchy designation', 1, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
@@ -1866,6 +1868,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('655', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('655', '6', 'Linkage', 'Linkage', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('655', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
+               ('655', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('655', 'a', 'Genre/form data or focus term', 'Genre/form data or focus term', 0, 0, '', 6, '', 'GENRE/FORM', '', NULL, 0, '', '', '', NULL),
                ('655', 'b', 'Non-focus term', 'Non-focus term', 1, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
                ('655', 'c', 'Facet/hierarchy designation', 'Facet/hierarchy designation', 1, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
@@ -1877,6 +1880,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('656', '3', 'Materials specified', 'Materials specified', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('656', '6', 'Linkage', 'Linkage', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('656', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
+               ('656', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('656', 'a', 'Occupation', 'Occupation', 0, 0, '', 6, '', 'TOPIC_TERM', '', NULL, -6, '', '', '', NULL),
                ('656', 'k', 'Form', 'Form', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('656', 'v', 'Form subdivision', 'Form subdivision', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
@@ -1887,6 +1891,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('657', '3', 'Materials specified', 'Materials specified', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('657', '6', 'Linkage', 'Linkage', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('657', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
+               ('657', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('657', 'a', 'Function', 'Function', 0, 0, '', 6, '', 'TOPIC_TERM', '', NULL, -6, '', '', '', NULL),
                ('657', 'v', 'Form subdivision', 'Form subdivision', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('657', 'x', 'General subdivision', 'General subdivision', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
@@ -1895,6 +1900,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('658', '2', 'Source of term', 'Source of term', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('658', '6', 'Linkage', 'Linkage', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('658', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
+               ('658', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('658', 'a', 'Main curriculum objective', 'Main curriculum objective', 0, 0, '', 6, '', 'TOPIC_TERM', '', NULL, -6, '', '', '', NULL),
                ('658', 'b', 'Subordinate curriculum objective', 'Subordinate curriculum objective', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('658', 'c', 'Curriculum code', 'Curriculum code', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
@@ -1904,6 +1910,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('662', '4', 'Relator code', 'Relator code', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('662', '6', 'Linkage', 'Linkage', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('662', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
+               ('662', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('662', 'a', 'Country or larger entity', 'Country or larger entity', 1, 0, '', 6, '', 'GEOGR_NAME', '', NULL, 0, '', '', '', NULL),
                ('662', 'b', 'First-order political jurisdiction', 'First-order political jurisdiction', 0, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
                ('662', 'c', 'Intermediate political jurisdiction', 'Intermediate political jurisdiction', 1, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
index a5e7d77..99611b4 100644 (file)
@@ -1808,6 +1808,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('648', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 6, NULL, NULL, '', NULL, -6, '', '', '', NULL),
                ('648', '6', 'Linkage', 'Linkage', 0, 0, NULL, 6, NULL, NULL, '', NULL, -6, '', '', '', NULL),
                ('648', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 6, NULL, NULL, '', NULL, -6, '', '', '', NULL),
+               ('648', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('648', 'a', 'Chronological term', 'Chronological term', 0, 0, NULL, 6, NULL, 'CHRON_TERM', '', NULL, 0, '', '', '', NULL),
                ('648', 'v', 'Form subdivision', 'Form subdivision', 1, 0, NULL, 6, NULL, NULL, '', NULL, 0, '', '', '', NULL),
                ('648', 'x', 'General subdivision', 'General subdivision', 1, 0, NULL, 6, NULL, NULL, '', NULL, 0, '', '', '', NULL),
@@ -1853,6 +1854,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('654', '4', 'Relator code', 'Relator code', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('654', '6', 'Linkage', 'Linkage', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('654', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
+               ('654', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('654', 'a', 'Focus term', 'Focus term', 1, 0, '', 6, '', 'TOPIC_TERM', '', NULL, 0, '', '', '', NULL),
                ('654', 'b', 'Non-focus term', 'Non-focus term', 1, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
                ('654', 'c', 'Facet/hierarchy designation', 'Facet/hierarchy designation', 1, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
@@ -1866,6 +1868,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('655', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('655', '6', 'Linkage', 'Linkage', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('655', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
+               ('655', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('655', 'a', 'Genre/form data or focus term', 'Genre/form data or focus term', 0, 0, '', 6, '', 'GENRE/FORM', '', NULL, 0, '', '', '', NULL),
                ('655', 'b', 'Non-focus term', 'Non-focus term', 1, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
                ('655', 'c', 'Facet/hierarchy designation', 'Facet/hierarchy designation', 1, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
@@ -1877,6 +1880,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('656', '3', 'Materials specified', 'Materials specified', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('656', '6', 'Linkage', 'Linkage', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('656', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
+               ('656', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('656', 'a', 'Occupation', 'Occupation', 0, 0, '', 6, '', 'TOPIC_TERM', '', NULL, -6, '', '', '', NULL),
                ('656', 'k', 'Form', 'Form', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('656', 'v', 'Form subdivision', 'Form subdivision', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
@@ -1887,6 +1891,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('657', '3', 'Materials specified', 'Materials specified', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('657', '6', 'Linkage', 'Linkage', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('657', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
+               ('657', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('657', 'a', 'Function', 'Function', 0, 0, '', 6, '', 'TOPIC_TERM', '', NULL, -6, '', '', '', NULL),
                ('657', 'v', 'Form subdivision', 'Form subdivision', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('657', 'x', 'General subdivision', 'General subdivision', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
@@ -1895,6 +1900,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('658', '2', 'Source of term', 'Source of term', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('658', '6', 'Linkage', 'Linkage', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('658', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
+               ('658', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('658', 'a', 'Main curriculum objective', 'Main curriculum objective', 0, 0, '', 6, '', 'TOPIC_TERM', '', NULL, -6, '', '', '', NULL),
                ('658', 'b', 'Subordinate curriculum objective', 'Subordinate curriculum objective', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('658', 'c', 'Curriculum code', 'Curriculum code', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
@@ -1904,6 +1910,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('662', '4', 'Relator code', 'Relator code', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('662', '6', 'Linkage', 'Linkage', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('662', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
+               ('662', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('662', 'a', 'Country or larger entity', 'Country or larger entity', 1, 0, '', 6, '', 'GEOGR_NAME', '', NULL, 0, '', '', '', NULL),
                ('662', 'b', 'First-order political jurisdiction', 'First-order political jurisdiction', 0, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
                ('662', 'c', 'Intermediate political jurisdiction', 'Intermediate political jurisdiction', 1, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
index b19af90..a8029d5 100644 (file)
@@ -137,7 +137,7 @@ INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
 VALUES( 'da','dan');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES ( 'da', 'language', 'da', 'D&aelig;nsk');
+VALUES ( 'da', 'language', 'da', 'Dansk');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'da', 'language', 'en', 'Danish');
@@ -153,7 +153,7 @@ INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
 VALUES( 'nl','dut');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES ( 'nl', 'language', 'nl', 'ned&#601;rl&#593;ns');
+VALUES ( 'nl', 'language', 'nl', 'Nederlands');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'nl', 'language', 'en', 'Dutch');
@@ -387,21 +387,43 @@ VALUES( 'gl', 'language', 'gl', 'Galego');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'gl', 'language', 'en', 'Galician');
 
--- Norwegian
+-- Norwegian (bokmål)
 INSERT INTO language_subtag_registry( subtag, type, description, added)
-VALUES ( 'nb', 'language', 'Norwegian','2005-10-16' );
+VALUES ( 'nb', 'language', 'Norwegian bokm&#229;l','2005-10-16' );
 
 INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
 VALUES( 'nb','nor');
 
+INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
+VALUES( 'nb','nob');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'nb', 'language', 'nb', 'Norsk bokm&#229;l');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'nb', 'language', 'en', 'Norwegian bokm&#229;l');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'nb', 'language', 'fr', 'Norvégien bokm&#229;l');
+
+-- Norwegian (nynorsk)
+INSERT INTO language_subtag_registry( subtag, type, description, added)
+VALUES ( 'nn', 'language', 'Norwegian nynorsk','2011-02-14' );
+
+INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
+VALUES( 'nn','nno');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'nn', 'language', 'nb', 'Norsk nynorsk');
+
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES( 'nb', 'language', 'nb', 'Norsk');
+VALUES( 'nn', 'language', 'nn', 'Norsk nynorsk');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES( 'nb', 'language', 'en', 'Norwegian');
+VALUES( 'nn', 'language', 'en', 'Norwegian nynorsk');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES( 'nb', 'language', 'fr', 'Norvégien');
+VALUES( 'nn', 'language', 'fr', 'Norvégien nynorsk');
 
 -- Persian
 INSERT INTO language_subtag_registry( subtag, type, description, added)
@@ -723,4 +745,4 @@ VALUES ( 'US', 'region', 'United States','2005-10-16');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'US', 'region', 'en', 'United States');
 
-SET FOREIGN_KEY_CHECKS=1;
\ No newline at end of file
+SET FOREIGN_KEY_CHECKS=1;
index 079c4bb..79c469c 100644 (file)
@@ -17,7 +17,8 @@ insert into `systempreferences` (`variable`, `value`, `options`, `explanation`,
 insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('AmazonLocale','US','US|CA|DE|FR|JP|UK','Usalo per definire il tuo specifico Amazon.com Web Services','Choice');
 insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('AmazonReviews','0','','Visualizza Amazon reviews sull\'interfaccia dello staff.','YesNo');
 insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('AmazonSimilarItems','0','','Messa su ON attiva l\' Amazon Similar Items feature  - Devi settare i valori in  AWSAccessKeyID e in AmazonAssocTag per usarla','YesNo');
-insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('AnonSuggestions','0','','Imposta un utente anonimo per abilitare i suggerimenti d\'acquisto da utenti non registrati.','free');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AnonSuggestions',0,'Set to enable Anonymous suggestions to AnonymousPatron borrowernumber',NULL,'YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AnonymousPatron', '0', 'Set the identifier (borrowernumber) of the anonymous patron. Used for Suggestion and reading history privacy',NULL,'');
 insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('authoritysep','--','10','Carattere usato nella visualizzazione come separatore della lista delle authority. Normalmente è --','free');
 insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('autoBarcode','annual','incremental|annual|hbyymmincr|OFF','Da usare per impostare la generazione automatica dei barcode: incremental per la tipologia 1, 2, 3; annuale per 2007-0001, 2007-0002; hbyymmincr per HB08010001 dove HB sta per Home Branch (sottobiblioteca predefinita)','Choice');
 insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('AutoEmailOpacUser','0','','Quando viene creato un account, invia notifica via email all\'utente con i dettagli del nuovo account.','YesNo');
@@ -89,6 +90,7 @@ insert into `systempreferences` (`variable`, `value`, `options`, `explanation`,
 -- insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('marcflavour','UNIMARC','MARC21|UNIMARC','Define global MARC flavor (MARC21 or UNIMARC) used for character encoding','Choice');
 insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('MARCOrgCode','0','','Il MARC Organization Code - http://www.loc.gov/marc/organizations/orgshome.html','free');
 insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('MaxFine','9999','','Multa massima che un utente potrebbe avere per un singolo ritardo.','Integer');
+insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('maxItemsInSearchResults','20','','Specifica il numero massimo di copie visualizzate nelle pagine di risultati','free');
 insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('maxoutstanding','5','','Definisci il numero massimo di operazioni in corso (prestiti+prenotazioni) dopo il quale si blocca la possibilità di fare prenotazioni','Integer');
 insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('maxreserves','2','','Definisce il numero massimo di prenotazioni che un utente può effettuare.','Integer');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('maxItemsInSearchResults',20,'Specify the maximum number of items to display for each result on a page of results',NULL,'free');
@@ -130,6 +132,7 @@ insert into `systempreferences` (`variable`, `value`, `options`, `explanation`,
 insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('OPACNoResultsFound','','Display this HTML when no results are found for a search in the OPAC','70|10','Textarea');
 insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('OPACnumSearchResults','20','','Specifica il numero massimo di risposte da visualizzare nella pagina dei risultati ','Integer');
 insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('OpacPasswordChange','1','','Se ON, abilita l\'utente alla modifica della password nell\'OPAC (disabiltare la funzione quando è usato LDAP auth)','YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPrivacy', '0', 'if ON, allows patrons to define their privacy rules (reading history)',NULL,'YesNo');
 insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('opacreadinghistory','1','','Se ON, si abilita la visualizzazione dello storico circolazione utente nell\'OPAC','YesNo');
 insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('OpacRenewalAllowed','0','','Se ON, gli utenti possono rinnovare i propri prestiti direttamente dal proprio account OPAC','YesNo');
 insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('OPACShelfBrowser','0','','Abilita/disabilita una ricerca per scaffale (Shelf Browser) nella pagina dettagli documento. ATTENZIONE: questa feature consuma molte risorse nelle collezioni molto grandi.','YesNo');
@@ -265,3 +268,7 @@ INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('S
 INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('SpineLabelShowPrintOnBibDetails', '0', '', 'If turned on, a "Print Label" link will appear for each item on the bib details page in the staff interface.', 'YesNo');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HomeOrHoldingBranchReturn','homebranch','Used by Circulation to determine which branch of an item to check checking-in items','holdingbranch|homebranch','Choice');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UseTablesortForCirc','0','If on, use the JQuery tablesort function on the list of current borrower checkouts on the circulation page.  Note that the use of this function may slow down circ for patrons with may checkouts.','','YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo');
\ No newline at end of file
index 5e0c6b6..e7ad97f 100644 (file)
@@ -563,7 +563,7 @@ CREATE TABLE `currency` (
   `currency` varchar(10) NOT NULL default '',
   `symbol` varchar(5) default NULL,
   `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
-  `rate` float(7,5) default NULL,
+  `rate` float(15,5) default NULL,
   `active` tinyint(1) default NULL,
   PRIMARY KEY  (`currency`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
index 3b63cd9..b246a7c 100644 (file)
@@ -135,7 +135,7 @@ INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
 VALUES( 'da','dan');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES ( 'da', 'language', 'da', 'D&aelig;nsk');
+VALUES ( 'da', 'language', 'da', 'Dansk');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'da', 'language', 'en', 'Danish');
@@ -151,7 +151,7 @@ INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
 VALUES( 'nl','dut');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES ( 'nl', 'language', 'nl', 'ned&#601;rl&#593;ns');
+VALUES ( 'nl', 'language', 'nl', 'Nederlands');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'nl', 'language', 'en', 'Dutch');
@@ -385,21 +385,43 @@ VALUES( 'gl', 'language', 'gl', 'Galego');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'gl', 'language', 'en', 'Galician');
 
--- Norwegian
+-- Norwegian (bokmål)
 INSERT INTO language_subtag_registry( subtag, type, description, added)
-VALUES ( 'nb', 'language', 'Norwegian','2005-10-16' );
+VALUES ( 'nb', 'language', 'Norwegian bokm&#229;l','2005-10-16' );
 
 INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
 VALUES( 'nb','nor');
 
+INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
+VALUES( 'nb','nob');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'nb', 'language', 'nb', 'Norsk bokm&#229;l');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'nb', 'language', 'en', 'Norwegian bokm&#229;l');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'nb', 'language', 'fr', 'Norvégien bokm&#229;l');
+
+-- Norwegian (nynorsk)
+INSERT INTO language_subtag_registry( subtag, type, description, added)
+VALUES ( 'nn', 'language', 'Norwegian nynorsk','2011-02-14' );
+
+INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
+VALUES( 'nn','nno');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'nn', 'language', 'nb', 'Norsk nynorsk');
+
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES( 'nb', 'language', 'nb', 'Norsk');
+VALUES( 'nn', 'language', 'nn', 'Norsk nynorsk');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES( 'nb', 'language', 'en', 'Norwegian');
+VALUES( 'nn', 'language', 'en', 'Norwegian nynorsk');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES( 'nb', 'language', 'fr', 'Norvégien');
+VALUES( 'nn', 'language', 'fr', 'Norvégien nynorsk');
 
 -- Persian
 INSERT INTO language_subtag_registry( subtag, type, description, added)
index 93864a3..8689c4c 100644 (file)
@@ -9,7 +9,8 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AmazonLocale','US','Use to set the Locale of your Amazon.com Web Services','US|CA|DE|FR|JP|UK','Choice');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AWSAccessKeyID','','See:  http://aws.amazon.com','','free');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AmazonAssocTag','','See:  http://aws.amazon.com','','free');
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AnonSuggestions',0,'Set to anonymous borrowernumber to enable Anonymous suggestions',NULL,'free');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AnonSuggestions',0,'Set to enable Anonymous suggestions to AnonymousPatron borrowernumber',NULL,'YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AnonymousPatron', '0', 'Set the identifier (borrowernumber) of the anonymous patron. Used for Suggestion and reading history privacy',NULL,'');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('Babeltheque',0,'Turn ON Babeltheque content  - See babeltheque.com to subscribe to this service','','YesNo');
 
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('authoritysep','--','Used to separate a list of authorities in a display. Usually --',10,'free');
@@ -78,6 +79,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacMainUserBlock','Welcome to Koha...\r\n<hr>','A user-defined block of HTML  in the main content area of the opac main page','70|10','Textarea');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacNav','Important links here.','Use HTML tags to add navigational links to the left-hand navigational bar in OPAC','70|10','Textarea');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPasswordChange',1,'If ON, enables patron-initiated password change in OPAC (disable it when using LDAP auth)',NULL,'YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPrivacy', '0', 'if ON, allows patrons to define their privacy rules (reading history)',NULL,'YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacreadinghistory',1,'If ON, enables display of Patron Circulation History in OPAC','','YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacsmallimage','','Enter a complete URL to an image to replace the default Koha logo','','free');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacstylesheet','','Enter a complete URL to use an alternate layout stylesheet in OPAC','','free');
@@ -278,3 +280,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('DisplayMultiPlaceHold','1','Display the ability to place multiple holds or not','','YesNo');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('IntranetUserCSS','','Add CSS to be included in the intranet in an embedded <style> tag.',NULL,'free');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OPACNoResultsFound','','Display this HTML when no results are found for a search in the OPAC','70|10','Textare    a');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo');
\ No newline at end of file
index 81c25f7..ee9a439 100644 (file)
@@ -1807,6 +1807,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('648', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 6, NULL, NULL, '', NULL, -6, '', '', '', NULL),
                ('648', '6', 'Linkage', 'Linkage', 0, 0, NULL, 6, NULL, NULL, '', NULL, -6, '', '', '', NULL),
                ('648', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 6, NULL, NULL, '', NULL, -6, '', '', '', NULL),
+               ('648', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('648', 'a', 'Chronological term', 'Chronological term', 0, 0, NULL, 6, NULL, 'CHRON_TERM', '', NULL, 0, '', '', '', NULL),
                ('648', 'v', 'Form subdivision', 'Form subdivision', 1, 0, NULL, 6, NULL, NULL, '', NULL, 0, '', '', '', NULL),
                ('648', 'x', 'General subdivision', 'General subdivision', 1, 0, NULL, 6, NULL, NULL, '', NULL, 0, '', '', '', NULL),
@@ -1852,6 +1853,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('654', '4', 'Relator code', 'Relator code', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('654', '6', 'Linkage', 'Linkage', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('654', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
+               ('654', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('654', 'a', 'Focus term', 'Focus term', 1, 0, '', 6, '', 'TOPIC_TERM', '', NULL, 0, '', '', '', NULL),
                ('654', 'b', 'Non-focus term', 'Non-focus term', 1, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
                ('654', 'c', 'Facet/hierarchy designation', 'Facet/hierarchy designation', 1, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
@@ -1865,6 +1867,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('655', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('655', '6', 'Linkage', 'Linkage', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('655', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
+               ('655', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('655', 'a', 'Genre/form data or focus term', 'Genre/form data or focus term', 0, 0, '', 6, '', 'GENRE/FORM', '', NULL, 0, '', '', '', NULL),
                ('655', 'b', 'Non-focus term', 'Non-focus term', 1, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
                ('655', 'c', 'Facet/hierarchy designation', 'Facet/hierarchy designation', 1, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
@@ -1876,6 +1879,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('656', '3', 'Materials specified', 'Materials specified', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('656', '6', 'Linkage', 'Linkage', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('656', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
+               ('656', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('656', 'a', 'Occupation', 'Occupation', 0, 0, '', 6, '', 'TOPIC_TERM', '', NULL, -6, '', '', '', NULL),
                ('656', 'k', 'Form', 'Form', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('656', 'v', 'Form subdivision', 'Form subdivision', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
@@ -1886,6 +1890,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('657', '3', 'Materials specified', 'Materials specified', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('657', '6', 'Linkage', 'Linkage', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('657', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
+               ('657', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('657', 'a', 'Function', 'Function', 0, 0, '', 6, '', 'TOPIC_TERM', '', NULL, -6, '', '', '', NULL),
                ('657', 'v', 'Form subdivision', 'Form subdivision', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('657', 'x', 'General subdivision', 'General subdivision', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
@@ -1894,6 +1899,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('658', '2', 'Source of term', 'Source of term', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('658', '6', 'Linkage', 'Linkage', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('658', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
+               ('658', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('658', 'a', 'Main curriculum objective', 'Main curriculum objective', 0, 0, '', 6, '', 'TOPIC_TERM', '', NULL, -6, '', '', '', NULL),
                ('658', 'b', 'Subordinate curriculum objective', 'Subordinate curriculum objective', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('658', 'c', 'Curriculum code', 'Curriculum code', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
@@ -1903,6 +1909,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
                ('662', '4', 'Relator code', 'Relator code', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('662', '6', 'Linkage', 'Linkage', 0, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
                ('662', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 6, '', '', '', NULL, -6, '', '', '', NULL),
+               ('662', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL),
                ('662', 'a', 'Country or larger entity', 'Country or larger entity', 1, 0, '', 6, '', 'GEOGR_NAME', '', NULL, 0, '', '', '', NULL),
                ('662', 'b', 'First-order political jurisdiction', 'First-order political jurisdiction', 0, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
                ('662', 'c', 'Intermediate political jurisdiction', 'Intermediate political jurisdiction', 1, 0, '', 6, '', '', '', NULL, 0, '', '', '', NULL),
index f2e0648..4121a59 100644 (file)
@@ -135,7 +135,7 @@ INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
 VALUES( 'da','dan');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES ( 'da', 'language', 'da', 'D&aelig;nsk');
+VALUES ( 'da', 'language', 'da', 'Dansk');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'da', 'language', 'en', 'Danish');
@@ -151,7 +151,7 @@ INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
 VALUES( 'nl','dut');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES ( 'nl', 'language', 'nl', 'ned&#601;rl&#593;ns');
+VALUES ( 'nl', 'language', 'nl', 'Nederlands');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'nl', 'language', 'en', 'Dutch');
@@ -385,21 +385,43 @@ VALUES( 'gl', 'language', 'gl', 'Galego');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'gl', 'language', 'en', 'Galician');
 
--- Norwegian
+-- Norwegian (bokmål)
 INSERT INTO language_subtag_registry( subtag, type, description, added)
-VALUES ( 'nb', 'language', 'Norwegian','2005-10-16' );
+VALUES ( 'nb', 'language', 'Norwegian bokm&#229;l','2005-10-16' );
 
 INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
 VALUES( 'nb','nor');
 
+INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
+VALUES( 'nb','nob');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'nb', 'language', 'nb', 'Norsk bokm&#229;l');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'nb', 'language', 'en', 'Norwegian bokm&#229;l');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'nb', 'language', 'fr', 'Norvégien bokm&#229;l');
+
+-- Norwegian (nynorsk)
+INSERT INTO language_subtag_registry( subtag, type, description, added)
+VALUES ( 'nn', 'language', 'Norwegian nynorsk','2011-02-14' );
+
+INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
+VALUES( 'nn','nno');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'nn', 'language', 'nb', 'Norsk nynorsk');
+
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES( 'nb', 'language', 'nb', 'Norsk');
+VALUES( 'nn', 'language', 'nn', 'Norsk nynorsk');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES( 'nb', 'language', 'en', 'Norwegian');
+VALUES( 'nn', 'language', 'en', 'Norwegian nynorsk');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES( 'nb', 'language', 'fr', 'Norvégien');
+VALUES( 'nn', 'language', 'fr', 'Norvégien nynorsk');
 
 -- Persian
 INSERT INTO language_subtag_registry( subtag, type, description, added)
index 60913c2..c862e60 100644 (file)
@@ -24,7 +24,8 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AmazonLocale','US','Use to set the Locale of your Amazon.com Web Services','US|CA|DE|FR|JP|UK','Choice');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AWSAccessKeyID','','See:  http://aws.amazon.com','','free');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AmazonAssocTag','','See:  http://aws.amazon.com','','free');
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AnonSuggestions',0,'Set to anonymous borrowernumber to enable Anonymous suggestions',NULL,'free');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AnonSuggestions',0,'Set to enable Anonymous suggestions to AnonymousPatron borrowernumber',NULL,'YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AnonymousPatron', '0', 'Set the identifier (borrowernumber) of the anonymous patron. Used for Suggestion and reading history privacy',NULL,'');
 
 
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('authoritysep','--','Used to separate a list of authorities in a display. Usually --',10,'free');
@@ -107,6 +108,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacMainUserBlock','Добро пожаловать в АБИС Koha...\r\n<hr>','A user-defined block of HTML  in the main content area of the opac main page','50|20','Textarea');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacNav','Здесь будут важные ссылки.','Use HTML tags to add navigational links to the left-hand navigational bar in OPAC','70|10','Textarea');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPasswordChange',1,'If ON, enables patron-initiated password change in OPAC (disable it when using LDAP auth)',NULL,'YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPrivacy', '0', 'if ON, allows patrons to define their privacy rules (reading history)',NULL,'YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacreadinghistory',1,'If ON, enables display of Patron Circulation History in OPAC','','YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacsmallimage','','Enter a complete URL to an image to replace the default Koha logo','','free');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacstylesheet','','Enter a complete URL to use an alternate layout stylesheet in OPAC','','free');
@@ -333,3 +335,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('DisplayMultiPlaceHold','1','Display the ability to place multiple holds or not','','YesNo');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('IntranetUserCSS','','Add CSS to be included in the intranet in an embedded <style> tag.',NULL,'free');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OPACNoResultsFound','','Display this HTML when no results are found for a search in the OPAC','70|10','Textare    a');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo');
\ No newline at end of file
index f2e0648..4121a59 100644 (file)
@@ -135,7 +135,7 @@ INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
 VALUES( 'da','dan');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES ( 'da', 'language', 'da', 'D&aelig;nsk');
+VALUES ( 'da', 'language', 'da', 'Dansk');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'da', 'language', 'en', 'Danish');
@@ -151,7 +151,7 @@ INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
 VALUES( 'nl','dut');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES ( 'nl', 'language', 'nl', 'ned&#601;rl&#593;ns');
+VALUES ( 'nl', 'language', 'nl', 'Nederlands');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'nl', 'language', 'en', 'Dutch');
@@ -385,21 +385,43 @@ VALUES( 'gl', 'language', 'gl', 'Galego');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'gl', 'language', 'en', 'Galician');
 
--- Norwegian
+-- Norwegian (bokmål)
 INSERT INTO language_subtag_registry( subtag, type, description, added)
-VALUES ( 'nb', 'language', 'Norwegian','2005-10-16' );
+VALUES ( 'nb', 'language', 'Norwegian bokm&#229;l','2005-10-16' );
 
 INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
 VALUES( 'nb','nor');
 
+INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
+VALUES( 'nb','nob');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'nb', 'language', 'nb', 'Norsk bokm&#229;l');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'nb', 'language', 'en', 'Norwegian bokm&#229;l');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'nb', 'language', 'fr', 'Norvégien bokm&#229;l');
+
+-- Norwegian (nynorsk)
+INSERT INTO language_subtag_registry( subtag, type, description, added)
+VALUES ( 'nn', 'language', 'Norwegian nynorsk','2011-02-14' );
+
+INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
+VALUES( 'nn','nno');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'nn', 'language', 'nb', 'Norsk nynorsk');
+
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES( 'nb', 'language', 'nb', 'Norsk');
+VALUES( 'nn', 'language', 'nn', 'Norsk nynorsk');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES( 'nb', 'language', 'en', 'Norwegian');
+VALUES( 'nn', 'language', 'en', 'Norwegian nynorsk');
 
 INSERT INTO language_descriptions(subtag, type, lang, description)
-VALUES( 'nb', 'language', 'fr', 'Norvégien');
+VALUES( 'nn', 'language', 'fr', 'Norvégien nynorsk');
 
 -- Persian
 INSERT INTO language_subtag_registry( subtag, type, description, added)
index 0fe8bb9..82e285b 100644 (file)
@@ -24,8 +24,8 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AmazonLocale','US','Use to set the Locale of your Amazon.com Web Services','US|CA|DE|FR|JP|UK','Choice');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AWSAccessKeyID','','See:  http://aws.amazon.com','','free');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AmazonAssocTag','','See:  http://aws.amazon.com','','free');
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AnonSuggestions',0,'Set to anonymous borrowernumber to enable Anonymous suggestions',NULL,'free');
-
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AnonSuggestions',0,'Set to enable Anonymous suggestions to AnonymousPatron borrowernumber',NULL,'YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AnonymousPatron', '0', 'Set the identifier (borrowernumber) of the anonymous patron. Used for Suggestion and reading history privacy',NULL,'');
 
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('authoritysep','--','Used to separate a list of authorities in a display. Usually --',10,'free');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('autoBarcode','incremental','Used to autogenerate a barcode: incremental will be of the form 1, 2, 3; annual of the form 2007-0001, 2007-0002; hbyymmincr of the form HB08010001 where HB=Home Branch','incremental|annual|hbyymmincr|OFF','Choice');
@@ -107,6 +107,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacMainUserBlock','Вітаємо у АБІС Koha...\r\n<hr>','A user-defined block of HTML  in the main content area of the opac main page','50|20','Textarea');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacNav','Тут будуть важливі посилання.','Use HTML tags to add navigational links to the left-hand navigational bar in OPAC','70|10','Textarea');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPasswordChange',1,'If ON, enables patron-initiated password change in OPAC (disable it when using LDAP auth)',NULL,'YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPrivacy', '0', 'if ON, allows patrons to define their privacy rules (reading history)',NULL,'YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacreadinghistory',1,'If ON, enables display of Patron Circulation History in OPAC','','YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacsmallimage','','Enter a complete URL to an image to replace the default Koha logo','','free');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacstylesheet','','Enter a complete URL to use an alternate layout stylesheet in OPAC','','free');
@@ -359,3 +360,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('DisplayMultiPlaceHold','1','Display the ability to place multiple holds or not','','YesNo');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('IntranetUserCSS','','Add CSS to be included in the intranet in an embedded <style> tag.',NULL,'free');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OPACNoResultsFound','','Display this HTML when no results are found for a search in the OPAC','70|10','Textare    a');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo');
\ No newline at end of file
index cb88827..31aa998 100755 (executable)
@@ -3937,6 +3937,83 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
    SetVersion ($DBversion);
 }
 
+$DBversion = "3.03.00.013";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacPublic','1','If set to OFF and user is not logged in, all  OPAC pages require authentication, and OPAC searchbar is removed)','','YesNo')");
+    print "Upgrade to $DBversion done (added 'OpacPublic' syspref)\n";
+   SetVersion ($DBversion);
+}
+
+$DBversion = "3.03.00.014";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo')");
+    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo')");
+    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','0','Use the item collection code when finding items for the shelf browser.','1','YesNo')");
+    print "Upgrade to $DBversion done (Add flexible shelf browser constraints)\n";
+    SetVersion ($DBversion);
+}
+
+$DBversion = "3.03.00.015";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    my $sth = $dbh->prepare("INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, 
+                             `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`)
+                             VALUES ( ?, '9', '9 (RLIN)', '9 (RLIN)', 0, 0, '', 6, '', '', '', 0, -5, '', '', '', NULL)");
+    $sth->execute('648');
+    $sth->execute('654');
+    $sth->execute('655');
+    $sth->execute('656');
+    $sth->execute('657');
+    $sth->execute('658');
+    $sth->execute('662');
+    $sth->finish;
+    print "Upgrade to $DBversion done (Bug 5619: Add subfield 9 to marc21 648,654,655,656,657,658,662)\n";
+    SetVersion ($DBversion);
+}
+
+$DBversion = '3.03.00.016';
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    # reimplement OpacPrivacy system preference
+    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPrivacy', '0', 'if ON, allows patrons to define their privacy rules (reading history)',NULL,'YesNo')");
+    $dbh->do("ALTER TABLE `borrowers` ADD `privacy` INTEGER NOT NULL DEFAULT 1;");
+    $dbh->do("ALTER TABLE `deletedborrowers` ADD `privacy` INTEGER NOT NULL DEFAULT 1;");
+    print "Upgrade to $DBversion done (OpacPrivacy reimplementation)\n";
+    SetVersion($DBversion);
+};
+
+$DBversion = '3.03.00.017';
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("ALTER TABLE  `currency` CHANGE `rate` `rate` FLOAT( 15, 5 ) NULL DEFAULT NULL;");
+    print "Upgrade to $DBversion done (Enable currency rates >= 100)\n";
+    SetVersion ($DBversion);
+}
+
+$DBversion = '3.03.00.018';
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do( q|update language_descriptions set description = 'Nederlands' where lang = 'nl' and subtag = 'nl'|);
+    $dbh->do( q|update language_descriptions set description = 'Dansk' where lang = 'da' and subtag = 'da'|);
+    print "Upgrade to $DBversion done (Correct language descriptions)\n";
+    SetVersion ($DBversion);
+}
+
+$DBversion = '3.03.00.019';
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    # Fix bokmål
+    $dbh->do("UPDATE language_subtag_registry SET description = 'Norwegian bokm&#229;l' WHERE subtag = 'nb';");
+    $dbh->do("INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) VALUES( 'nb','nob');");
+    $dbh->do("UPDATE language_descriptions SET description = 'Norsk bokm&#229;l' WHERE subtag = 'nb' AND lang = 'nb';");
+    $dbh->do("UPDATE language_descriptions SET description = 'Norwegian bokm&#229;l' WHERE subtag = 'nb' AND lang = 'en';");
+    $dbh->do("UPDATE language_descriptions SET description = 'Norvégien bokm&#229;l' WHERE subtag = 'nb' AND lang = 'fr';");
+    # Add nynorsk
+    $dbh->do("INSERT INTO language_subtag_registry( subtag, type, description, added) VALUES ( 'nn', 'language', 'Norwegian nynorsk','2011-02-14' )");
+    $dbh->do("INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) VALUES( 'nn','nno')");
+    $dbh->do("INSERT INTO language_descriptions(subtag, type, lang, description) VALUES( 'nn', 'language', 'nb', 'Norsk nynorsk')");
+    $dbh->do("INSERT INTO language_descriptions(subtag, type, lang, description) VALUES( 'nn', 'language', 'nn', 'Norsk nynorsk')");
+    $dbh->do("INSERT INTO language_descriptions(subtag, type, lang, description) VALUES( 'nn', 'language', 'en', 'Norwegian nynorsk')");
+    $dbh->do("INSERT INTO language_descriptions(subtag, type, lang, description) VALUES( 'nn', 'language', 'fr', 'Norvégien nynorsk')");
+    print "Upgrade to $DBversion done (Correct language descriptions for Norwegian)\n";
+    SetVersion ($DBversion);
+}
+
 =head1 FUNCTIONS
 
 =head2 DropAllForeignKeys($table)
index 88b8782..5ed2c64 100644 (file)
@@ -20,7 +20,7 @@ a:hover {
 }
 
 body   {
-       background: #f9fcfe;
+       background: #f5f5f5;
 }
 
 form, label input {
@@ -52,13 +52,29 @@ label {
 }
 
 #login #login_error {
-       background: #c00;
+       background: #D23F3F;
        border: 1px solid #a40000;
        color: #fff;
-       font-size: 16px;
+       font-size: 120%;
+       line-height: 140%;
        font-weight: bold;
+       margin: 1em 0;
        padding: .5em;
        text-align: center;
+       text-shadow: 0px 1px 1px #6C1010;
+       filter: dropshadow(color=#6C1010, offx=0, offy=1);
+       -moz-border-radius: 5px;
+       border-radius: 5px;
+}
+
+#login #login_error a:link,
+#login #login_error a:visited {
+       color : #FFC;
+}
+
+#login #login_error a:hover,
+#login #login_error a:active {
+       color : #FCFC4D;
 }
 
 #login h1 {
index 095b007..d9fde24 100644 (file)
@@ -61,3 +61,8 @@ h3.collapsed {
        cursor : pointer;
        padding-left : 12px;
 }
+
+.humanMsg strong {
+       display: block;
+       font-weight: normal;
+}
\ No newline at end of file
index b6d439d..66b092c 100644 (file)
@@ -237,11 +237,11 @@ table {
        border-right : 1px solid #BCBCBC;
 }
 
-table.invis{
-       border : white;
-}
-table.invis tr,table.invis td {
-       border : white;
+table.invis,
+table.invis tr,
+table.invis td,
+tr.highlight table.invis td {
+       border : none;
 }
 
 td, th {
@@ -304,7 +304,7 @@ tr.onissue td {
        background-color: #FFFFCC;
 }
 
-tr.highlight.onissue td {
+tr.odd.onissue td {
        background-color: #FFFFE1;
 }
 
@@ -1119,6 +1119,10 @@ div.first fieldset {
        margin : .4em;
        padding : .4em .4em .4em 25px;
  }
+
+ .dialog input[type="submit"] {
+       background : #FFF none;
+ }
  
 .dialog input.approve, td input.approve {
        background : #FFF url(../../img/approve.gif) no-repeat 4px center;
index 392a6c5..7b6f196 100644 (file)
@@ -2,7 +2,7 @@
        <li><a href="/cgi-bin/koha/acqui/lateorders.pl">Late orders</a></li>
        <!-- TMPL_IF NAME="suggestion" --><li><a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions</a></li><!-- TMPL_ELSE --><!-- /TMPL_IF -->
     <!-- TMPL_IF name="CAN_user_acquisition_budget_manage" -->
-       <li><a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets & Funds</a></li>
+       <li><a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets &amp; Funds</a></li>
     <!-- /TMPL_IF -->
     <!-- TMPL_IF name="CAN_user_parameters" -->
      <li><a href="/cgi-bin/koha/admin/currency.pl">Currencies</a></li>
index 5d05b94..df1acbf 100644 (file)
@@ -14,7 +14,7 @@
                                 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
                                 button : "newduedate_button",
                                 disableFunc : validate1,
-                                dateStatusFunc : validate1,
+                                dateStatusFunc : validate1
                               }
                            );
                        //]]>
@@ -22,4 +22,4 @@
                        <p><label>Forgive fines on return: <input type="checkbox" name="exemptfine" value="1" /></label></p>
                </td>
        </tr>
-</tfoot>
\ No newline at end of file
+</tfoot>
index a7c1ab8..ea556c4 100644 (file)
@@ -64,7 +64,7 @@
             <span class="loggedinusername">
                 <!-- TMPL_VAR NAME="loggedinusername" -->
             </span>
-            (<a href="/cgi-bin/koha/mainpage.pl?logout.x=1">Log Out</a>) |
+            (<a href="/cgi-bin/koha/mainpage.pl?logout.x=1"<!-- TMPL_IF NAME="intranetbookbag" --> onclick="delBasket(true);"<!-- /TMPL_IF -->>Log Out</a>) |
         <!-- TMPL_ELSE -->
             You are not logged in |
         <!-- /TMPL_IF -->
index 513d415..6f796d1 100644 (file)
@@ -7,9 +7,9 @@
        <!-- /TMPL_IF -->
        <!-- TMPL_IF NAME="intranetreadinghistory" --><!-- TMPL_IF NAME="readingrecordview" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a href="/cgi-bin/koha/members/readingrec.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->">Circulation History</a></li><!-- /TMPL_IF -->
        <!-- TMPL_IF NAME="CAN_user_parameters"--><!-- TMPL_IF NAME="logview" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a href="/cgi-bin/koha/tools/viewlog.pl?do_it=1&amp;modules=MEMBERS&amp;action=MODIFY&amp;object=<!-- TMPL_VAR NAME="borrowernumber" -->">Modification Log</a></li><!-- /TMPL_IF -->
-<!-- TMPL_IF NAME="EnhancedMessagingPreferences" -->
-          <!-- TMPL_IF NAME="messagingview" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a href="/cgi-bin/koha/members/messaging.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->">Messaging</a></li>
-        <!-- /TMPL_IF -->
-</ul>
-</div>
+    <!-- TMPL_IF NAME="EnhancedMessagingPreferences" -->
+    <!-- TMPL_IF NAME="messagingview" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a href="/cgi-bin/koha/members/messaging.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->">Messaging</a></li>
+    <!-- /TMPL_IF -->
+       <!-- TMPL_IF NAME="sentnotices" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a href="/cgi-bin/koha/members/notices.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->">Notices</a></li>
+</ul></div>
 <!-- /TMPL_IF -->
index 1655afc..28dc633 100644 (file)
       <!-- TMPL_ELSE -->
       <td>-</td>
       <!-- /TMPL_IF -->
-      <!-- TMPL_IF NAME="transport-sms" -->
+      <!-- TMPL_IF NAME="transport_sms" -->
       <!-- TMPL_IF NAME="SMSSendDriver" --><td>
           <!-- TMPL_IF NAME="messaging_form_inactive" -->
                  <input type="checkbox"
                  id="sms<!-- TMPL_VAR NAME="message_attribute_id" -->"
                  name="<!-- TMPL_VAR NAME="message_attribute_id" -->"
-                 value="sms"   <!-- TMPL_VAR NAME="transport-sms" --> disabled="disabled" />
+                 value="sms"   <!-- TMPL_VAR NAME="transport_sms" --> disabled="disabled" />
           <!-- TMPL_ELSE -->
                  <input type="checkbox"
                  id="sms<!-- TMPL_VAR NAME="message_attribute_id" -->"
                  name="<!-- TMPL_VAR NAME="message_attribute_id" -->"
-                 value="sms"   <!-- TMPL_VAR NAME="transport-sms"   --> onclick = "$('#none'+'<!-- TMPL_VAR NAME="message_attribute_id" -->').attr('checked','');" />
+                 value="sms"   <!-- TMPL_VAR NAME="transport_sms"   --> onclick = "$('#none'+'<!-- TMPL_VAR NAME="message_attribute_id" -->').attr('checked','');" />
           <!-- /TMPL_IF -->
       </td><!-- /TMPL_IF -->
       <!-- TMPL_ELSE -->
       <td>-</td>
       <!-- /TMPL_IF -->
 
-      <!-- TMPL_IF NAME="transport-email" -->
+      <!-- TMPL_IF NAME="transport_email" -->
       <td>
           <!-- TMPL_IF NAME="messaging_form_inactive" -->
             <input type="checkbox"
                  id="email<!-- TMPL_VAR NAME="message_attribute_id" -->"
                  name="<!-- TMPL_VAR NAME="message_attribute_id" -->"
-                 value="email"   <!-- TMPL_VAR NAME="transport-email"   --> disabled="disabled" />
+                 value="email"   <!-- TMPL_VAR NAME="transport_email"   --> disabled="disabled" />
           <!-- TMPL_ELSE -->
             <input type="checkbox"
                  id="email<!-- TMPL_VAR NAME="message_attribute_id" -->"
                  name="<!-- TMPL_VAR NAME="message_attribute_id" -->"
-                 value="email"   <!-- TMPL_VAR NAME="transport-email"   --> onclick = "$('#none'+'<!-- TMPL_VAR NAME="message_attribute_id" -->').attr('checked','');" />
+                 value="email"   <!-- TMPL_VAR NAME="transport_email"   --> onclick = "$('#none'+'<!-- TMPL_VAR NAME="message_attribute_id" -->').attr('checked','');" />
           <!-- /TMPL_IF -->
       </td>
       <!-- TMPL_ELSE -->
       <td>-</td>
       <!-- /TMPL_IF -->
 
-<!--       <!-- TMPL_IF NAME="transport-rss" -->
+<!--       <!-- TMPL_IF NAME="transport_rss" -->
       <td>
           <!-- TMPL_IF NAME="messaging_form_inactive" -->
             <input type="checkbox"
                  id="rss<!-- TMPL_VAR NAME="message_attribute_id" -->"
                  name="<!-- TMPL_VAR NAME="message_attribute_id" -->"
-                 value="rss"   <!-- TMPL_VAR NAME="transport-rss"   --> disabled="disabled" />
+                 value="rss"   <!-- TMPL_VAR NAME="transport_rss"   --> disabled="disabled" />
           <!-- TMPL_ELSE -->
             <input type="checkbox"
                  id="rss<!-- TMPL_VAR NAME="message_attribute_id" -->"
                  name="<!-- TMPL_VAR NAME="message_attribute_id" -->"
-                 value="rss"   <!-- TMPL_VAR NAME="transport-rss"   --> onclick = "$('#none'+'<!-- TMPL_VAR NAME="message_attribute_id" -->').attr('checked','');" />
+                 value="rss"   <!-- TMPL_VAR NAME="transport_rss"   --> onclick = "$('#none'+'<!-- TMPL_VAR NAME="message_attribute_id" -->').attr('checked','');" />
           <!-- /TMPL_IF -->
       </td>
       <!-- TMPL_ELSE -->
index c508af0..bc4dbc4 100644 (file)
@@ -1,3 +1,4 @@
+<!-- TMPL_UNLESS NAME="no_add" -->
 <div id="toolbar">
        <script type="text/javascript">
        //<![CDATA[
@@ -69,3 +70,4 @@
        </li>
 </ul>
 </div>
+<!-- /TMPL_UNLESS -->
\ No newline at end of file
index 1fc624a..4e0d0b0 100644 (file)
@@ -6,15 +6,15 @@
 <!-- TMPL_IF NAME="cataloguing" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Cataloging" href="/cgi-bin/koha/admin/preferences.pl?tab=cataloguing">Cataloging</a></li>
 <!-- TMPL_IF NAME="circulation" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Circulation" href="/cgi-bin/koha/admin/preferences.pl?tab=circulation">Circulation</a></li>
 <!-- TMPL_IF NAME="creators" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Creators" href="/cgi-bin/koha/admin/preferences.pl?tab=creators">Creators</a></li>
-<!-- TMPL_IF NAME="enhanced-content" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Enhanced Content Settings" href="/cgi-bin/koha/admin/preferences.pl?tab=enhanced-content">Enhanced Content</a></li>
-<!-- TMPL_IF NAME="i18n-l10n" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Internationalization and Localization" href="/cgi-bin/koha/admin/preferences.pl?tab=i18n-l10n">I18N/L10N</a></li>
-<!-- TMPL_IF NAME="local-use" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a href="/cgi-bin/koha/admin/systempreferences.pl">Local Use</a></li>
+<!-- TMPL_IF NAME="enhanced_content" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Enhanced Content Settings" href="/cgi-bin/koha/admin/preferences.pl?tab=enhanced_content">Enhanced Content</a></li>
+<!-- TMPL_IF NAME="i18n_l10n" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Internationalization and Localization" href="/cgi-bin/koha/admin/preferences.pl?tab=i18n_l10n">I18N/L10N</a></li>
+<!-- TMPL_IF NAME="local_use" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a href="/cgi-bin/koha/admin/systempreferences.pl">Local Use</a></li>
 <!-- TMPL_IF NAME="logs" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Transaction Logs" href="/cgi-bin/koha/admin/preferences.pl?tab=logs">Logs</a></li>
 <!-- TMPL_IF NAME="opac" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Online Public Access Catalog" href="/cgi-bin/koha/admin/preferences.pl?tab=opac">OPAC</a></li>
 <!-- TMPL_IF NAME="patrons" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Patrons" href="/cgi-bin/koha/admin/preferences.pl?tab=patrons">Patrons</a></li>
 <!-- TMPL_IF NAME="searching" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Searching" href="/cgi-bin/koha/admin/preferences.pl?tab=searching">Searching</a></li>
 <!-- TMPL_IF NAME="serials" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Serials" href="/cgi-bin/koha/admin/preferences.pl?tab=serials">Serials</a></li>
-<!-- TMPL_IF NAME="staff-client" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Staff Client" href="/cgi-bin/koha/admin/preferences.pl?tab=staff-client">Staff Client</a></li>
-<!-- TMPL_IF NAME="web-services" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Web Services" href="/cgi-bin/koha/admin/preferences.pl?tab=web-services">Web Services</a></li>
+<!-- TMPL_IF NAME="staff_client" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Staff Client" href="/cgi-bin/koha/admin/preferences.pl?tab=staff_client">Staff Client</a></li>
+<!-- TMPL_IF NAME="web_services" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a title="Web Services" href="/cgi-bin/koha/admin/preferences.pl?tab=web_services">Web Services</a></li>
 </ul>
 </div>
index 0ab6711..9946cf7 100644 (file)
@@ -299,10 +299,10 @@ function delRecord (n, s) {
 }
 
 
-function delBasket() {
-
-    var rep = false;
-    rep = confirm(MSG_CONFIRM_DEL_BASKET);
+function delBasket(rep) {
+    if (rep == undefined){
+        rep = confirm(MSG_CONFIRM_DEL_BASKET);
+    }
     if (rep) {
         delCookie(nameCookie);
         document.location = "about:blank";
index cbf98b8..93dfaac 100644 (file)
@@ -9,12 +9,13 @@ $(document).ready(function() {
 
 KOHA.Preferences = {
     Save: function ( form ) {
-        data = $( form ).find( '.modified' ).serialize();
+        modified_prefs = $( form ).find( '.modified' );
+        data = modified_prefs.serialize();
         if ( !data ) {
-            humanMsg.displayAlert( 'Nothing to save' );
+            humanMsg.displayAlert( MSG_NOTHING_TO_SAVE );
             return;
         }
-        KOHA.AJAX.MarkRunning( $( form ).find( '.save-all' ), _( 'Saving...' ) );
+        KOHA.AJAX.MarkRunning( $( form ).find( '.save-all' ), _( MSG_SAVING ) );
         KOHA.AJAX.Submit( {
             data: data,
             url: '/cgi-bin/koha/svc/config/systempreferences/',
@@ -23,7 +24,13 @@ KOHA.Preferences = {
         } );
     },
     Success: function ( form ) {
-        humanMsg.displayAlert( 'Saved' );
+        var msg = "";
+        modified_prefs.each(function(){
+            var modified_pref = $(this).attr("id");
+            modified_pref = modified_pref.replace("pref_","");
+            msg += '<strong>Saved preference '+modified_pref+'</strong>\n';
+        });
+        humanMsg.displayAlert(msg);
 
         $( form )
             .find( '.modified-warning' ).remove().end()
@@ -38,7 +45,7 @@ $( document ).ready( function () {
         $( this ).addClass( 'modified' );
         var name_cell = $( this ).parents( '.name-row' ).find( '.name-cell' );
                if ( !name_cell.find( '.modified-warning' ).length )
-            name_cell.append( '<em class="modified-warning">(modified)</em>' );
+            name_cell.append( '<em class="modified-warning">('+MSG_MODIFIED+')</em>' );
         KOHA.Preferences.Modified = true;
     }
 
@@ -54,7 +61,7 @@ $( document ).ready( function () {
 
     window.onbeforeunload = function () {
         if ( KOHA.Preferences.Modified ) {
-            return _( "You have made changes to system preferences." );
+            return MSG_MADE_CHANGES;
         }
     }
 
@@ -73,16 +80,16 @@ $( document ).ready( function () {
         return false;
     } ).nextAll( 'textarea, input[type=submit]' ).hide().css( { opacity: 0 } );
 
-    $("h3").attr("class","expanded").attr("title",_("Click to expand this section"));
+    $("h3").attr("class","expanded").attr("title",MSG_CLICK_TO_EXPAND);
     var collapsible = $(".collapsed,.expanded");
 
     $(collapsible).toggle(
         function () {
-            $(this).addClass("collapsed").removeClass("expanded").attr("title",_("Click to expand this section"));
+            $(this).addClass("collapsed").removeClass("expanded").attr("title",MSG_CLICK_TO_EXPAND);
             $(this).next("table").hide();
         },
         function () {
-            $(this).addClass("expanded").removeClass("collapsed").attr("title",_("Click to collapse this section"));
+            $(this).addClass("expanded").removeClass("collapsed").attr("title",MSG_CLICK_TO_COLLAPSE);
             $(this).next("table").show();
         }
     );
index 028ad4a..bac31ab 100644 (file)
@@ -1200,7 +1200,7 @@ Calendar.prototype.callCloseHandler = function () {
        if (this.onClose) {
                this.onClose(this);
        }
-       this.hideShowCovered();
+       // this.hideShowCovered();
 };
 
 /** Removes the calendar object from the DOM tree and destroys it. */
@@ -1258,7 +1258,7 @@ Calendar.prototype.show = function () {
                Calendar.addEvent(document, "keypress", Calendar._keyEvent);
                Calendar.addEvent(document, "mousedown", Calendar._checkCalendar);
        }
-       this.hideShowCovered();
+       // this.hideShowCovered();
 };
 
 /**
@@ -1273,7 +1273,7 @@ Calendar.prototype.hide = function () {
        }
        this.element.style.display = "none";
        this.hidden = true;
-       this.hideShowCovered();
+       // this.hideShowCovered();
 };
 
 /**
@@ -1463,7 +1463,7 @@ Calendar.prototype.parseDate = function (str, fmt) {
        }
 };
 
-Calendar.prototype.hideShowCovered = function () {
+/* Calendar.prototype.hideShowCovered = function () {
        var self = this;
        Calendar.continuation_for_the_fucking_khtml_browser = function() {
                function getVisib(obj){
@@ -1523,7 +1523,7 @@ Calendar.prototype.hideShowCovered = function () {
                setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()", 10);
        else
                Calendar.continuation_for_the_fucking_khtml_browser();
-};
+}; */
 
 /** Internal function; it displays the bar with the names of the weekday. */
 Calendar.prototype._displayWeekdays = function () {
index a836290..c7f8b4d 100644 (file)
                 <li>Al Banks</li>
                 <li>Daniel Banzli</li>
                 <li>Benedykt P. Barszcz (Polish for 2.0)</li>
-                <li>J. David Bavousett</li>
+                <li>D Ruth Bavousett</li>
                 <li>John Beppu</li>
                 <li>David Birmingham</li>
                 <li>Florian Bischof</li>
 <li><strong>Hrvatski (Croatian)</strong></li>
 <li><strong>&#x010D;e&#353;tina (Czech)</strong></li>
 <li><strong>D&aelig;nsk (Danish)</strong></li>
-<li><strong>ned&#601;rl&#593;ns (Dutch)</strong></li>
+<li><strong>Nederlands-Nederland (Dutch-The Netherlands)</strong> Sponsored by Rijksmuseum</li>
+<li><strong>Nederlands-Belgi&euml; (Dutch-Belgium)</strong></li>
 <li><strong>English</strong></li>
 <li><strong>suomi, suomen kieli (Finnish)</strong> Pasi Korkalo</li>
 <li><strong>Fran&ccedil;ais (French) </strong> Pascale Nalon (ENSMP) and Jean Yves Lemaire (Chatel Saint Germain)</li>
index a76cb5c..45ef2ef 100644 (file)
@@ -68,7 +68,7 @@ ff.submit();
 //]]>
 </script>
 </head>
-<body onload="calcNeworderTotal()">
+<body>
 
 <!-- TMPL_INCLUDE NAME="header.inc" -->
 <!-- TMPL_INCLUDE NAME="acquisitions-search.inc" -->
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl
new file mode 100644 (file)
index 0000000..7203526
--- /dev/null
@@ -0,0 +1,73 @@
+<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
+<title>Koha &rsaquo; Acquisitions &rsaquo; Basket <!-- TMPL_VAR NAME="basketno" --> &rsaquo; Duplicate warning</title>
+<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
+</head>
+<body>
+
+<!-- TMPL_INCLUDE NAME="header.inc" -->
+<!-- TMPL_INCLUDE NAME="acquisitions-search.inc" -->
+
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo; <a href="/cgi-bin/koha/acqui/basket.pl?basketno=<!-- TMPL_VAR NAME="basketno" -->">Basket <!-- TMPL_VAR NAME="basketno" --></a> &rsaquo; Duplicate warning</div>
+
+<div id="doc3" class="yui-t2">
+
+<div id="bd">
+    <div id="yui-main">
+    <div class="yui-b">
+
+<div class="dialog alert">
+<h4>Duplicate warning</h4>
+<p>You selected a record from an external source that matches an existing record in your catalog: <!-- TMPL_IF name="BiblioDefaultViewmarc" --><a class="popup" target="_blank" title="Open in new window" href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->">
+<!-- TMPL_ELSIF NAME="BiblioDefaultViewlabeled_marc" --><a class="popup" target="_blank" title="Open in new window" href="/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->">
+<!-- TMPL_ELSIF NAME="BiblioDefaultViewisbd" --><a class="popup" target="_blank" title="Open in new window" href="/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->">
+<!-- TMPL_ELSE --><a class="popup" target="_blank" title="Open in new window" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->"><!-- /TMPL_IF --><!-- TMPL_VAR NAME="duplicatetitle" --></a></p>
+</div>
+
+<div class="yui-gb">
+<div class="yui-u first">
+<div style="border: 1px solid #DDD; padding:1em;">
+<form action="/cgi-bin/koha/acqui/neworderempty.pl">
+<h4>Use existing record</h4>
+<p>Do not create a duplicate record. Add an order from the existing record in your catalog.</p>
+<input type="hidden" name="booksellerid" value="<!-- TMPL_VAR NAME="booksellerid" -->" />
+<input type="hidden" name="basketno" value="<!-- TMPL_VAR NAME="basketno" -->" />
+<input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
+<input type="submit" value="Use Existing" />
+</form>
+</div>
+</div>
+
+<div class="yui-u">
+<div style="border: 1px solid #DDD; padding:1em;">
+<form action="/cgi-bin/koha/acqui/basket.pl">
+<h4>Cancel and return to order</h4>
+<p>Return to the basket without making a new order.</p>
+<input type="hidden" name="basketno" value="<!-- TMPL_VAR NAME="basketno" -->" />
+<input type="submit" value="Cancel" />
+</form>
+</div>
+</div>
+
+<div class="yui-u">
+<div style="border: 1px solid #DDD; padding:1em;">
+<form action="/cgi-bin/koha/acqui/neworderempty.pl">
+<h4>Crete new record</h4>
+<p>Create a new record by importing the external (duplicate) record.</p>
+<input type="hidden" name="booksellerid" value="<!-- TMPL_VAR NAME="booksellerid" -->" />
+<input type="hidden" name="basketno" value="<!-- TMPL_VAR NAME="basketno" -->" />
+<input type="hidden" name="breedingid" value="<!-- TMPL_VAR NAME="breedingid" -->" />
+<input type="hidden" name="use_external_source" value="1" />
+<input type="submit" value="Create New" />
+</form>
+</div>
+</div>
+
+</div>
+
+</div>
+</div>
+<div class="yui-b">
+<!-- TMPL_INCLUDE NAME="acquisitions-menu.inc" -->
+</div>
+</div>
+<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
index 523fd13..ff336a9 100644 (file)
         inputField     :    "budget_period_enddate",
         ifFormat         :    "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
         button         :    "openCalendarTo",
-        align          :    "Tl",
+        align          :    "Tl"
         });
     </script>
                                <div class="hint"><!-- TMPL_INCLUDE NAME="date-format.inc" --></div>
index 80d9156..39e341a 100644 (file)
         <input type="submit" class="submit" name="filter" value="Go" />
     </fieldset>
 </form><!-- /TMPL_IF -->
-
-</div>
-<div class="yui-b">
 <!-- TMPL_INCLUDE NAME="acquisitions-menu.inc" -->
 </div>
 </div>
index 2192178..0472c5e 100644 (file)
@@ -1,8 +1,8 @@
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
-<title>Koha &rsaquo; Administration &rsaquo; Budgets &rsaquo; Budget planning</title>
+<title>Koha &rsaquo; Administration &rsaquo; Budgets &rsaquo; Funds &rsaquo; Planning for <!-- TMPL_VAR NAME="budget_period_description" --> by <!-- TMPL_VAR NAME="authcat" --></title>
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
 <!-- TMPL_INCLUDE NAME="calendar.inc" -->
-<script type="text/javascript" src="<!-- TMPL_VAR NAME='themelang' -->/js/acq.js"></script>
+<script type="text/javascript" src="<!-- TMPL_VAR NAME="themelang" -->/js/acq.js"></script>
 <script type="text/javascript">
 //<![CDATA[
 // ---------------------------------------------------------------------
@@ -64,7 +64,7 @@ YAHOO.util.Event.onAvailable("popmenu", function () {
 });
 //]]>
 </script>
-
+<style type="text/css">td.locked { background-image: url('/intranet-tmpl/prog/img/locked.png'); padding-left : 20px; background-repeat: no-repeat; background-position: 4% 50%; } a.control { font-size:85%;text-decoration:none; }</style>
 </head>
 <body>
 <!-- TMPL_INCLUDE NAME="header.inc" -->
@@ -86,60 +86,26 @@ YAHOO.util.Event.onAvailable("popmenu", function () {
 
 <!-- TMPL_INCLUDE NAME="budgets-admin-toolbar.inc" -->
 
-<br />
-
-<form method="post" id='Aform' name="Aform"  action="/cgi-bin/koha/admin/aqplan.pl">
-
-<input type="hidden" id="budget_period_id" name="budget_period_id" value="<!-- TMPL_VAR NAME="budget_period_id" -->"/>
-<fieldset style=" border:2px solid #EEEEEE; " >
-<legend>Planning for <!-- TMPL_VAR NAME="budget_period_description" --> by <!-- TMPL_VAR NAME="authcat" --></legend>
-    <table class="invis" >
-    <tr><td>
-    <!-- TMPL_IF NAME="show_mine" -->
-        <input type="checkbox" id="show_mine"  name="show_mine" value="1" checked="checked" />
-    <!-- TMPL_ELSE -->
-        <input type="checkbox" id="show_mine"  name="show_mine" value="1"  />
-    <!-- /TMPL_IF -->
-    <label for="show_mine">Show my funds only</label>
-    </td>
-    <td>
-        <label for="authcat"  > Select planning type:</label>
-        <!-- TMPL_VAR NAME="authcat_dropbox" -->
-        <input type="submit" name="option_submit" value="Select" />
-    </td>
-    </tr>
-
-    <tr><td>
-    <!-- TMPL_IF NAME="show_active" -->
-        <input type="checkbox" id="show_active" name="show_active" value="1" checked="checked" />
-    <!-- TMPL_ELSE -->
-        <input type="checkbox" id="show_active" name="show_active" value="1" />
-        <!-- /TMPL_IF -->
-    <label for="show_active">Show active funds only</label>
-    </td>
-    <td></td>
-    </tr>
-
-    <tr><td>
-        <!-- TMPL_IF NAME="show_actual" -->
-            <input type="checkbox"    id="show_actual"   name="show_actual" value="1"   checked="checked" />
-        <!-- TMPL_ELSE -->
-            <input type="checkbox" id="show_actual" name="show_actual" value="1"  />
-        <!-- /TMPL_IF -->
-        <label for="show_actual">Show actual/estimated values:</label>
-    </td>
-    <td></td>
-    </tr>
-    </table>
-</fieldset>
-
-<br />
+<form method="post" id="Aform" name="Aform"  action="/cgi-bin/koha/admin/aqplan.pl">
+<h3>Planning for <!-- TMPL_VAR NAME="budget_period_description" --> by <!-- TMPL_VAR NAME="authcat" --></h3>
 
 <!-- Budget Lines -->
 
     <!-- TMPL_IF NAME="budget_lines" -->
 
-    <!-- TMPL_INCLUDE NAME="budgets-active-currency.inc" -->
+    <!-- TMPL_IF name="currency" --><p><b>Currency = <!-- TMPL_VAR name="currency" --></b>.
+    <!-- TMPL_IF NAME="show_actual" -->
+        <b>Each cell contain both actual and estimated values.</b>
+    <!-- TMPL_ELSE -->
+        <b>Cells contain estimated values only.</b>
+    <!-- /TMPL_IF -->
+    </p><!-- TMPL_ELSE --><div class="dialog alert"><h3>No active currency is defined</h3><p>Please <a href="/cgi-bin/koha/admin/currency.pl">specify an active currency</a>.</p></div>
+<!-- TMPL_IF NAME="show_actual" -->
+        <p><b>Each cell contain both actual and estimated values.</b></p>
+    <!-- TMPL_ELSE -->
+        <p><b>Cells contain estimated values only.</b></p>
+    <!-- /TMPL_IF -->
+    <!-- /TMPL_IF -->
 
     <table id="plan" width="100%">
     <thead>
@@ -149,38 +115,43 @@ YAHOO.util.Event.onAvailable("popmenu", function () {
 
     <!-- TMPL_LOOP NAME="authvals_row" -->
          <!-- TMPL_IF NAME="display" -->
-            <th id="<!-- TMPL_VAR NAME="code" -->"   style="text-align: center;"
-                        class="<!-- TMPL_VAR NAME='colnum' -->" >
+            <th id="col<!-- TMPL_VAR NAME="code" -->" class="<!-- TMPL_VAR NAME="colnum" -->">
         <!-- TMPL_ELSE -->
-            <th id="<!-- TMPL_VAR NAME="code" -->"   style="text-align: center;
-                            display:none;" 
-                        class="<!-- TMPL_VAR NAME='colnum' -->" >
+            <th id="col<!-- TMPL_VAR NAME="code" -->" styl="display:none;" class="<!-- TMPL_VAR NAME="colnum" -->">
         <!-- /TMPL_IF -->
 
-    <!-- TMPL_VAR NAME="code" -->&nbsp;<span class="buttonPlus" onclick="delColumn('<!-- TMPL_VAR NAME="colnum" -->', '<!-- TMPL_VAR NAME="code" -->')"  > - &nbsp;</span></th>
-
+    <!-- TMPL_VAR NAME="code" --></th>
     <!-- /TMPL_LOOP -->
 
-    <th>Fund remaining</th>
-
-    <th id='popmenu' style=" text-align: center;" >
-    <span id="add_popmenu_item" class="buttonPlus" > + </span></th>
+    <th>Fund remaining</th><th>&nbsp;</th>
     </tr>
+    <tr>
+    <th>&nbsp;</th><th>&nbsp;</th>
+    <!-- TMPL_LOOP NAME="authvals_row" -->
+         <!-- TMPL_IF NAME="display" -->
+            <th class="<!-- TMPL_VAR NAME="colnum" -->">
+        <!-- TMPL_ELSE -->
+            <th style="display:none;" class="<!-- TMPL_VAR NAME="colnum" -->">
+        <!-- /TMPL_IF -->
+
+    <a class="control" onclick="delColumn('<!-- TMPL_VAR NAME="colnum" -->', 'col<!-- TMPL_VAR NAME="code" -->')" href="#" title="Hide this column">[ hide ]</a></th>
+
+    <!-- /TMPL_LOOP -->
+    <th id="popmenu"><a style="font-size:85%;text-decoration:none;" id="add_popmenu_item" href="#" title="Show a hidden column">[ show a column ]</a></th><th>&nbsp;</th>
+     </tr>
+
     </thead>
 
     <tbody>
     <!-- TMPL_LOOP NAME="budget_lines" -->
-            <!-- TMPL_IF Name="budget_lock" -->
-        <tr  class="highlight"  > 
-            <!--TMPL_ELSE -->
-        <tr > 
-            <!--/TMPL_IF -->
+    <!-- TMPL_UNLESS NAME="__odd__" --><tr class="highlight"><!-- TMPL_ELSE --><tr><!-- /TMPL_UNLESS -->
+
+        <td align="left"<!-- TMPL_IF NAME="budget_lock" --> class="locked" title="Fund locked"<!-- /TMPL_IF -->><a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&amp;budget_id=<!-- TMPL_VAR NAME="budget_id" -->&amp;budget_period_id=<!-- TMPL_VAR NAME="budget_period_id" -->"><!-- TMPL_VAR NAME="budget_name_indent"--></a></td>
+        <td><span id="budget_tot_formatted_<!-- TMPL_VAR NAME="budget_id" -->"><!-- TMPL_VAR NAME="budget_amount_formatted"-->&nbsp;</span>
 
-        <td align='left'><!-- TMPL_VAR NAME="budget_name_indent"--></td>
-        <td align='right'><span id='budget_tot_formatted_<!-- TMPL_VAR NAME="budget_id" -->'><!-- TMPL_VAR NAME="budget_amount_formatted"-->&nbsp;</span>
 
         <!-- NEXT DIV ELEMENT IS USED BY JS FOR CALC-ING AUTO-FILL AND ESTIMATED AMOUNTS -->
-        <div style="display:none;" id='budget_tot_<!-- TMPL_VAR NAME="budget_id" -->'><!-- TMPL_VAR NAME="budget_amount"--></div></td>
+        <div style="display:none;" id="budget_tot_<!-- TMPL_VAR NAME="budget_id" -->"><!-- TMPL_VAR NAME="budget_amount"--></div></td>
 
         <!-- TMPL_LOOP NAME="lines"    -->
             <!-- TMPL_IF NAME="display" -->
@@ -191,15 +162,15 @@ YAHOO.util.Event.onAvailable("popmenu", function () {
             <table class="invis" width="100%">
                 <tr>
                     <!-- TMPL_IF Name="show_actual" -->
-                        <td   width="50%"  align="right" ><!-- TMPL_VAR NAME="actual_amount" --></td>
+                        <td   width="50%"  ><!-- TMPL_VAR NAME="actual_amount" --></td>
                     <!--/TMPL_IF -->
-                <td align="right">
+                <td>
 
                 <!--TMPL_IF  Name="budget_lock" -->
                     <!-- TMPL_VAR NAME="estimated_amount" -->&nbsp;
-                    <input type="hidden" style="text-align: right;"  name='<!-- TMPL_VAR NAME="cell_name"-->' value="<!-- TMPL_VAR NAME="estimated_amount" -->"   />
+                    <input type="hidden" style="text-align: right;"  name="<!-- TMPL_VAR NAME="cell_name"-->" value="<!-- TMPL_VAR NAME="estimated_amount" -->"   />
                 <!--TMPL_ELSE -->
-                    <input type="text" style="text-align: right;  width:90%; " size='6' name='<!-- TMPL_VAR NAME="cell_name"-->'  value="<!-- TMPL_VAR NAME="estimated_amount" -->"  id='budget_<!-- TMPL_VAR NAME="budget_id"--><!-- TMPL_VAR NAME="colnum"-->' class='plan_entry_<!-- TMPL_VAR NAME="budget_id"-->' onchange="calcTotalRow(this);" />
+                    <input type="text" style="text-align: right;  width:90%; " size="6" name="<!-- TMPL_VAR NAME="cell_name"-->"  value="<!-- TMPL_VAR NAME="estimated_amount" -->"  id="budget_<!-- TMPL_VAR NAME="budget_id"--><!-- TMPL_VAR NAME="colnum"-->" class="plan_entry_<!-- TMPL_VAR NAME="budget_id"-->" onchange="calcTotalRow(this);" />
                 <!--/TMPL_IF -->
 
                 </td></tr>
@@ -212,32 +183,30 @@ YAHOO.util.Event.onAvailable("popmenu", function () {
             <tr>
        <!-- TMPL_IF Name="show_actual" -->
             <!-- TMPL_IF NAME="act_negative" -->
-                <td width="50%" align="right" style="color: red;"> 
+                <td width="50%" style="color: red;">
             <!-- TMPL_ELSIF NAME="act_positive" -->
-                <td width="50%" align="right" style="color: green;"> 
+                <td width="50%" style="color: green;">
             <!-- TMPL_ELSE -->
-                <td width="50%" align="right">
+                <td width="50%">
             <!--/TMPL_IF -->
                     <!-- TMPL_VAR NAME="budget_act_remain"-->
-        <!-- TMPL_ELSE -->
-            <td width="50%" align="right">
-        <!-- /TMPL_IF -->
             </td>
+        <!-- /TMPL_IF -->
 
         <!-- TMPL_IF NAME="est_negative" -->
-            <td width="50%"    align="right"  style="color: red;" id='budget_est_<!-- TMPL_VAR NAME="budget_id"-->'> 
+            <td width="50%" style="color: red;" id="budget_est_<!-- TMPL_VAR NAME="budget_id"-->">
         <!-- TMPL_ELSIF NAME="est_positive" -->
-            <td width="50%"    align="right"  style="color: green;" id='budget_est_<!-- TMPL_VAR NAME="budget_id"-->'> 
+            <td width="50%" style="color: green;" id="budget_est_<!-- TMPL_VAR NAME="budget_id"-->">
         <!-- TMPL_ELSE -->
-            <td width="50%"    align="right" id='budget_est_<!-- TMPL_VAR NAME="budget_id"-->'> 
+            <td width="50%" id="budget_est_<!-- TMPL_VAR NAME="budget_id"-->">
         <!--/TMPL_IF --> 
-                <!-- TMPL_VAR NAME="budget_est_remain"-->&nbsp;    
+                <!-- TMPL_VAR NAME="budget_est_remain"-->&nbsp;
             </td>
             </tr>
         </table>
         </td>
 
-        <td align="center">
+        <td>
              <!-- TMPL_UNLESS Name="budget_lock" -->
                     <input type="button"  onclick="autoFillRow('<!-- TMPL_VAR NAME="budget_id"-->')" value="Auto-fill row"/>
             <!-- TMPL_ELSE  -->
@@ -249,19 +218,14 @@ YAHOO.util.Event.onAvailable("popmenu", function () {
     </tbody>
     </table>
 
-    <!-- TMPL_IF NAME="show_actual" -->
-        <span><b>Each cell contain both actual and estimated values.</b></span><br />
-    <!-- TMPL_ELSE -->
-        <span><b>Cells contain estimated values only.</b></span><br />
-    <!-- /TMPL_IF -->
     <!-- TMPL_IF name="budget_period_locked" -->
-        <!-- <input STYLE="background: gray;"   type="submit" value="Save" disabled='disabled'/> -->
+        <!-- <input STYLE="background: gray;"   type="submit" value="Save" disabled="disabled"/> -->
     <!-- TMPL_ELSE -->
-        <input type="button"  onclick="Check(this.form)" value="Save"/>
+        <fieldset class="action"><input type="button"  onclick="Check(this.form)" value="Save"/></fieldset>
     <!-- /TMPL_IF -->
 
 
-<div id='hide_div'>
+<div id="hide_div">
     <!-- TMPL_LOOP NAME="authvals_row" -->
 
      <!-- TMPL_UNLESS Name="display" -->
@@ -274,28 +238,73 @@ YAHOO.util.Event.onAvailable("popmenu", function () {
 
 </form>
 
+        <!-- TMPL_ELSE     -->
+<div class="dialog message">No funds to display for this search criteria</div>
+        <!-- /TMPL_IF  -->
+
+
+</div>
+</div>
+<div class="yui-b">
+
+<form method="post" action="/cgi-bin/koha/admin/aqplan.pl">
+<fieldset class="brief">
+<h4>Filter</h4>
+
+<ol>
+    <li>
+        <label for="authcat"> Select planning type:</label>
+        <!-- TMPL_VAR NAME="authcat_dropbox" -->
+    </li>
+    <li class="radio">
+    <!-- TMPL_IF NAME="show_mine" -->
+        <input type="checkbox" id="show_mine"  name="show_mine" value="1" checked="checked" />
+    <!-- TMPL_ELSE -->
+        <input type="checkbox" id="show_mine"  name="show_mine" value="1"  />
+    <!-- /TMPL_IF -->
+    <label for="show_mine">Show my funds only</label>
+    </li>
+
+    <li class="radio">
+    <!-- TMPL_IF NAME="show_active" -->
+        <input type="checkbox" id="show_active" name="show_active" value="1" checked="checked" />
+    <!-- TMPL_ELSE -->
+        <input type="checkbox" id="show_active" name="show_active" value="1" />
+        <!-- /TMPL_IF -->
+    <label for="show_active">Show active funds only</label>
+    </li>
+
+
+    <li class="radio">
+        <!-- TMPL_IF NAME="show_actual" -->
+            <input type="checkbox" id="show_actual" name="show_actual" value="1" checked="checked" />
+        <!-- TMPL_ELSE -->
+            <input type="checkbox" id="show_actual" name="show_actual" value="1"  />
+        <!-- /TMPL_IF -->
+        <label for="show_actual">Show actual/estimated values</label>
+    </li>
+    </ol>
+<fieldset class="action">
+        <input type="submit" name="option_submit" value="Submit" /></fieldset>
+</fieldset>
+</form>
+<!-- TMPL_IF NAME="budget_lines" -->
 <form method="post" action="/cgi-bin/koha/admin/aqplan.pl">
-<fieldset class="rows">
+<h4>Export</h4>
+<fieldset class="brief">
     <ol>
-    <li><label for="basename">Output to a file named: </label><input type="text" name="basename" id="basename" value="Export" />
-    <label class="inline" for="MIME">Into an application
+    <li><label for="basename">Output to a file named: </label><input type="text" name="basename" id="basename" value="Export" /></li>
+    <li><label class="inline" for="MIME">Into an application
     </label><!-- TMPL_VAR NAME="CGIextChoice" -->
-    <!-- TMPL_VAR NAME="CGIsepChoice" --> &nbsp;&nbsp;&nbsp;
-    <input type="submit" value="Output"/>
+    <!-- TMPL_VAR NAME="CGIsepChoice" --></li>
+    </ol>
+    <fieldset class="action">    <input type="submit" value="Submit"/>
     <input type="hidden" name="report_name" value="<!--TMPL_VAR NAME="report_name" -->" />
-    <input type="hidden" name="output" value="file" />
-    </li></ol>
+    <input type="hidden" name="output" value="file" /></fieldset>
     </fieldset>
 </form>
+<!-- /TMPL_IF -->
 
-        <!-- TMPL_ELSE         -->
-No funds to display for this search criteria
-        <!-- /TMPL_IF  -->
-
-
-</div>
-</div>
-<div class="yui-b">
 <!-- TMPL_INCLUDE NAME="acquisitions-menu.inc" -->
 </div>
 </div>
index 0dbff36..f63fbe6 100644 (file)
@@ -32,8 +32,8 @@ function displayMoreConstraint(numlayer){
   <!-- TMPL_IF NAME="delete_confirm" -->Confirm Deletion of Subfield <!-- TMPL_VAR NAME="tagsubfield" -->?<!-- /TMPL_IF -->
   <!-- TMPL_IF NAME="delete_confirmed" -->Data deleted<!-- /TMPL_IF -->
   <!-- TMPL_IF NAME="add_form" -->
-  <!-- TMPL_IF NAME="use-heading-flags-p" -->
-  <!-- TMPL_IF NAME="heading-edit-subfields-p" -->Edit MARC subfields constraints<!-- /TMPL_IF -->
+  <!-- TMPL_IF NAME="use_heading_flags_p" -->
+  <!-- TMPL_IF NAME="heading_edit_subfields_p" -->Edit MARC subfields constraints<!-- /TMPL_IF -->
   <!-- TMPL_ELSE --><!-- TMPL_VAR NAME="action" --><!-- /TMPL_IF -->
   <!-- /TMPL_IF -->
 </div>
@@ -46,8 +46,8 @@ function displayMoreConstraint(numlayer){
 
 <!-- TMPL_IF NAME="add_form" -->
 
-    <h1><!-- TMPL_IF NAME="use-heading-flags-p" -->
-    <!-- TMPL_IF NAME="heading-edit-subfields-p" -->Edit MARC subfields constraints for field <!-- TMPL_VAR name="tagfield" --> authority <!-- TMPL_VAR name="authtypecode" --><!-- /TMPL_IF -->
+    <h1><!-- TMPL_IF NAME="use_heading_flags_p" -->
+    <!-- TMPL_IF NAME="heading_edit_subfields_p" -->Edit MARC subfields constraints for field <!-- TMPL_VAR name="tagfield" --> authority <!-- TMPL_VAR name="authtypecode" --><!-- /TMPL_IF -->
     <!-- TMPL_ELSE --><!-- TMPL_VAR NAME="action" --><!-- /TMPL_IF --></h1>
     <form action="<!-- TMPL_VAR NAME="script_name" -->" name="Aform" method="post">
         <input type="hidden" name="op" value="add_validate" />
index 5752cfe..2449fd9 100644 (file)
@@ -1,7 +1,7 @@
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
-<title>Koha &rsaquo; Administration &rsaquo; Authority MARC framework <!-- TMPL_IF NAME="add_form" --><!-- TMPL_IF NAME="use-heading-flags-p" -->
-    <!-- TMPL_IF NAME="heading-modify-tag-p" -->&rsaquo; <!-- TMPL_IF NAME="authtypecode" --><!-- TMPL_VAR NAME="authtypecode" --> Framework<!-- TMPL_ELSE -->Default Framework<!-- /TMPL_IF --> &rsaquo; Modify tag<!-- /TMPL_IF -->
-    <!-- TMPL_IF NAME="heading-add-tag-p" -->&rsaquo; <!-- TMPL_IF NAME="authtypecode" --><!-- TMPL_VAR NAME="authtypecode" --> Framework<!-- TMPL_ELSE -->Default Framework<!-- /TMPL_IF --> &rsaquo; New tag<!-- /TMPL_IF -->
+<title>Koha &rsaquo; Administration &rsaquo; Authority MARC framework <!-- TMPL_IF NAME="add_form" --><!-- TMPL_IF NAME="use_heading_flags_p" -->
+    <!-- TMPL_IF NAME="heading_modify_tag_p" -->&rsaquo; <!-- TMPL_IF NAME="authtypecode" --><!-- TMPL_VAR NAME="authtypecode" --> Framework<!-- TMPL_ELSE -->Default Framework<!-- /TMPL_IF --> &rsaquo; Modify tag<!-- /TMPL_IF -->
+    <!-- TMPL_IF NAME="heading_add_tag_p" -->&rsaquo; <!-- TMPL_IF NAME="authtypecode" --><!-- TMPL_VAR NAME="authtypecode" --> Framework<!-- TMPL_ELSE -->Default Framework<!-- /TMPL_IF --> &rsaquo; New tag<!-- /TMPL_IF -->
     <!-- TMPL_ELSE -->&rsaquo; <!-- TMPL_VAR NAME="action" --><!-- /TMPL_IF --><!-- /TMPL_IF --><!-- TMPL_IF NAME="delete_confirm" -->&rsaquo; <!-- TMPL_IF NAME="authtypecode" --><!-- TMPL_VAR NAME="authtypecode" --> Framework<!-- TMPL_ELSE -->Default Framework<!-- /TMPL_IF --> &rsaquo; Confirm Deletion<!-- /TMPL_IF --><!-- TMPL_IF NAME="delete_confirmed" -->&rsaquo; <!-- TMPL_IF NAME="authtypecode" --><!-- TMPL_VAR NAME="authtypecode" --> Framework<!-- TMPL_ELSE -->Default Framework<!-- /TMPL_IF --> &rsaquo; Data Deleted<!-- /TMPL_IF --></title>
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
@@ -69,9 +69,9 @@ return false;
 <!-- TMPL_INCLUDE NAME="header.inc" -->
 <!-- TMPL_INCLUDE NAME="cat-search.inc" -->
 
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; <!-- TMPL_IF NAME="add_form" --><!-- TMPL_IF NAME="use-heading-flags-p" -->
-    <!-- TMPL_IF NAME="heading-modify-tag-p" --><a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Authority MARC Framework</a> &rsaquo; <!-- TMPL_IF NAME="authtypecode" --><a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=<!-- TMPL_VAR NAME="authtypecode" -->"><!-- TMPL_VAR NAME="authtypecode" --> Framework</a><!-- TMPL_ELSE --><a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default Framework</a><!-- /TMPL_IF --> &rsaquo; Modify tag<!-- /TMPL_IF -->
-    <!-- TMPL_IF NAME="heading-add-tag-p" --><a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Authority MARC Framework</a> &rsaquo; <!-- TMPL_IF NAME="authtypecode" --><a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=<!-- TMPL_VAR NAME="authtypecode" -->"><!-- TMPL_VAR NAME="authtypecode" --> Framework</a><!-- TMPL_ELSE --><a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default Framework</a><!-- /TMPL_IF --> &rsaquo; New tag<!-- /TMPL_IF -->
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; <!-- TMPL_IF NAME="add_form" --><!-- TMPL_IF NAME="use_heading_flags_p" -->
+    <!-- TMPL_IF NAME="heading_modify_tag_p" --><a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Authority MARC Framework</a> &rsaquo; <!-- TMPL_IF NAME="authtypecode" --><a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=<!-- TMPL_VAR NAME="authtypecode" -->"><!-- TMPL_VAR NAME="authtypecode" --> Framework</a><!-- TMPL_ELSE --><a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default Framework</a><!-- /TMPL_IF --> &rsaquo; Modify tag<!-- /TMPL_IF -->
+    <!-- TMPL_IF NAME="heading_add_tag_p" --><a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Authority MARC Framework</a> &rsaquo; <!-- TMPL_IF NAME="authtypecode" --><a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=<!-- TMPL_VAR NAME="authtypecode" -->"><!-- TMPL_VAR NAME="authtypecode" --> Framework</a><!-- TMPL_ELSE --><a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default Framework</a><!-- /TMPL_IF --> &rsaquo; New tag<!-- /TMPL_IF -->
     <!-- TMPL_ELSE --><a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Authority MARC Framework</a> &rsaquo; <!-- TMPL_VAR NAME="action" -->
     <!-- /TMPL_IF -->
     <!-- TMPL_ELSE -->
@@ -99,14 +99,14 @@ return false;
 <!-- TMPL_IF NAME="add_form" -->
 
     <h2>
-    <!-- TMPL_IF NAME="use-heading-flags-p" -->
-    <!-- TMPL_IF NAME="heading-modify-tag-p" -->Modify tag<!-- /TMPL_IF -->
-    <!-- TMPL_IF NAME="heading-add-tag-p" -->New tag<!-- /TMPL_IF -->
+    <!-- TMPL_IF NAME="use_heading_flags_p" -->
+    <!-- TMPL_IF NAME="heading_modify_tag_p" -->Modify tag<!-- /TMPL_IF -->
+    <!-- TMPL_IF NAME="heading_add_tag_p" -->New tag<!-- /TMPL_IF -->
     <!-- TMPL_ELSE --><!-- TMPL_VAR NAME="action" --><!-- /TMPL_IF -->
     </h2>
     <form action="<!-- TMPL_VAR NAME="script_name" -->" name="Aform" method="post">
         <input type="hidden" name="op" value="add_validate" />
-        <!-- TMPL_IF NAME="heading-modify-tag-p" --><input type="hidden" name="modif" value="1" /><!-- /TMPL_IF -->
+        <!-- TMPL_IF NAME="heading_modify_tag_p" --><input type="hidden" name="modif" value="1" /><!-- /TMPL_IF -->
         <input type="hidden" name="authtypecode" value="<!-- TMPL_VAR NAME="authtypecode" -->" />
         <fieldset class="rows"><ol>
                <li><span class="label">Tag</span><!-- TMPL_VAR NAME="searchfield" --></li>
index 1aeab0d..b4f6954 100644 (file)
  <!-- TMPL_IF EXPR="category eq 'NOT_LOAN'" -->
     <p>Statuses to describe why an item is not for loan</p>
  <!-- /TMPL_IF -->
-<h3>Authorized values for category <!-- TMPL_VAR name="category" --> :</h3>
+<h3>Authorized values for category <!-- TMPL_VAR name="category" -->:</h3>
 
-<span id="pagertable_authorized_values" class="pager">
+<!-- TMPL_IF NAME="loop" --><span id="pagertable_authorized_values" class="pager">
        <form class="formpager">&nbsp;<strong>page(s)</strong>&nbsp;:
                <img src="<!-- TMPL_VAR name="interface" -->/prog/img/first.png" class="first"/>
                <img src="<!-- TMPL_VAR name="interface" -->/prog/img/prev.png" class="prev"/>
                        <option value="200">200</option>
                </select>
        </form>
-</span>
+</span><!-- /TMPL_IF -->
 
-<table id="table_authorized_values" cellspacing="1" class="tablesorter">
+<!-- TMPL_IF NAME="loop" --><table id="table_authorized_values" class="tablesorter">
 <thead><tr>
        <th>Authorized value</th>
        <th>Description</th>
        <td><a href="<!-- TMPL_VAR name="delete" -->">Delete</a></td>
 </tr>
 <!-- /TMPL_LOOP -->
-</tbody></table>
+</tbody></table><!-- TMPL_ELSE -->
+<div class="dialog message">There are no authorized values defined for <!-- TMPL_VAR NAME="category" --></div>
+<!-- /TMPL_IF -->
 
 <!-- TMPL_IF NAME="isprevpage" -->
 <form class="inline" action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
index 1a21466..264ef21 100644 (file)
@@ -55,7 +55,7 @@ $(document).ready(function() {
 <div id="breadcrumbs">
          <a href="/cgi-bin/koha/mainpage.pl">Home</a>
 &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
-&rsaquo; <a href="<!-- TMPL_IF NAME="script_name" -->">Authority Types</a>
+&rsaquo; <a href="<!-- TMPL_VAR NAME="script_name" -->">Authority Types</a>
 <!-- TMPL_IF NAME="add_form" -->
 &rsaquo; <!-- TMPL_IF NAME="authtypecode" -->Modify<!-- TMPL_ELSE -->New<!-- /TMPL_IF --> Authority Type
 <!-- TMPL_ELSIF NAME="delete_confirm" -->
index 14da769..4b6e3f1 100644 (file)
@@ -5,7 +5,7 @@
 <!-- TMPL_ELSIF NAME="delete_category" -->
     &rsaquo; Confirm Deletion of Group <!-- TMPL_VAR name="categorycode" -->
 <!-- TMPL_ELSIF name="add" -->
-    &rsaquo;<!-- TMPL_IF name="heading-branches-add-branch-p" -->New library<!-- TMPL_ELSE -->Modify library <!-- TMPL_VAR name="branchcode" --><!-- /TMPL_IF -->
+    &rsaquo;<!-- TMPL_IF name="heading_branches_add_branch_p" -->New library<!-- TMPL_ELSE -->Modify library <!-- TMPL_VAR name="branchcode" --><!-- /TMPL_IF -->
 <!-- TMPL_ELSIF name="delete_confirm" -->
     &rsaquo; Confirm deletion of library '<!-- TMPL_VAR NAME="branchcode" -->'
 <!-- /TMPL_IF -->
@@ -27,7 +27,7 @@
 <!-- TMPL_ELSIF NAME="delete_category" -->
 &rsaquo; Confirm Deletion of Group <!-- TMPL_VAR name="categorycode" -->
 <!-- TMPL_ELSIF name="add" -->
-&rsaquo; <!-- TMPL_IF name="heading-branches-add-branch-p" -->New library<!-- TMPL_ELSE -->Modify library <!-- TMPL_VAR name="branchcode" --><!-- /TMPL_IF -->
+&rsaquo; <!-- TMPL_IF name="heading_branches_add_branch_p" -->New library<!-- TMPL_ELSE -->Modify library <!-- TMPL_VAR name="branchcode" --><!-- /TMPL_IF -->
 <!-- TMPL_ELSIF name="delete_confirm" -->
 &rsaquo; Confirm deletion of library '<!-- TMPL_VAR NAME="branchcode" -->'
 <!-- /TMPL_IF -->
 
 <!-- TMPL_IF name="add" -->
     <!-- TMPL_IF name="ERROR1" --><div class="dialog message">Library with that code already exists &mdash; Please enter a unique code</div><!-- /TMPL_IF -->
-  <h3><!-- TMPL_IF name="heading-branches-add-branch-p" -->New library<!-- TMPL_ELSE -->Modify library<!-- /TMPL_IF --></h3>
+  <h3><!-- TMPL_IF name="heading_branches_add_branch_p" -->New library<!-- TMPL_ELSE -->Modify library<!-- /TMPL_IF --></h3>
     <form action="<!-- TMPL_VAR name="action" -->" name="Aform" method="post">
        <fieldset class="rows">
         <input type="hidden" name="op" value="add_validate" />
-        <!-- TMPL_IF name="heading-branches-add-branch-p" -->
+        <!-- TMPL_IF name="heading_branches_add_branch_p" -->
             <input type="hidden" name="add" value="1" />
         <!-- TMPL_ELSE -->
             <input type="hidden" name="add" value="0" />
         <!-- /TMPL_IF -->
         <ol><li>
-            <!-- TMPL_IF name="heading-branches-add-branch-p" -->
+            <!-- TMPL_IF name="heading_branches_add_branch_p" -->
             <label for="branchcode">Library code</label>
                 <input type="text" name="branchcode" id="branchcode" size="10" maxlength="10" value="<!-- TMPL_VAR name="branchcode" escape="HTML" -->" />
             <!-- TMPL_ELSE -->
                 <td><!-- TMPL_VAR name="branch_name" escape="HTML" --></td>
                 <td><!-- TMPL_VAR name="branch_code" escape="HTML" --></td>
                 <td>
-                    <!-- TMPL_IF name="address-empty-p" -->
+                    <!-- TMPL_IF name="address_empty_p" -->
                         (nothing entered)
                     <!-- TMPL_ELSE -->
                         <!-- TMPL_IF name="branchaddress1" -->
                     <!-- /TMPL_IF -->
                 </td>
                 <td>
-                    <!-- TMPL_UNLESS name="no-categories-p" -->
+                    <!-- TMPL_UNLESS name="no_categories_p" -->
                         <!-- TMPL_LOOP name="category_list" -->
                             <!-- TMPL_VAR name="categoryname" --><br />
                         <!-- /TMPL_LOOP -->
index 100719a..736f3bb 100644 (file)
                                        <!-- TMPL_IF NAME="type_S" --><option value="S" selected="selected">Staff</option><!-- TMPL_ELSE --><option value="S">Staff</option><!-- /TMPL_IF -->
                                        <!-- TMPL_IF NAME="type_I" --><option value="I" selected="selected">Organization</option><!-- TMPL_ELSE --><option value="I">Organization</option><!-- /TMPL_IF -->
                                        <!-- TMPL_IF NAME="type_P" --><option value="P" selected="selected">Professional</option><!-- TMPL_ELSE --><option value="P">Professional</option><!-- /TMPL_IF -->
-                                       <!-- TMPL_IF NXME="type_X" --><option value="X" selected="selected">Statistical</option><!-- TMPL_ELSE --><option value="X">Statistical</option><!-- /TMPL_IF -->
+                                       <!-- TMPL_IF NAME="type_X" --><option value="X" selected="selected">Statistical</option><!-- TMPL_ELSE --><option value="X">Statistical</option><!-- /TMPL_IF -->
                                        </select>
        </li></ol>
 </fieldset>
index e24a545..2d9aafc 100644 (file)
@@ -173,7 +173,7 @@ Item Types Administration
       <li>
           <label for="description">Description</label><input type="text" id="description" name="description" size="48" maxlength="80" value="<!-- TMPL_VAR name="description" escape="HTML" -->" />      </li>
      <!-- TMPL_IF NAME="noItemTypeImages" -->
-        <li><span class="label">Image: </span>Item type images are disabled. To enable them, turn off the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=noItemTypeImages">noItemTypeImages system preference</a></li></ol>
+        <li><span class="label">Image: </span>Item type images are disabled. To enable them, turn off the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&amp;searchfield=noItemTypeImages">noItemTypeImages system preference</a></li></ol>
         <!-- TMPL_ELSE --></ol>
                <div id="icons" class="toptabs">
                <h5 style="margin-left:10px;">Choose an Icon:</h5>
@@ -285,23 +285,23 @@ Item Types Administration
 
 <!-- TMPL_IF name="else" -->
 <h2>Item Types Administration</h2>
-<span id="pagertable_item_type" class="pager">
-       <form class="formpager">&nbsp;<strong>page(s)</strong>&nbsp;:
-               <img src="<!-- TMPL_VAR name="interface" -->/prog/img/first.png" class="first"/>
-               <img src="<!-- TMPL_VAR name="interface" -->/prog/img/prev.png" class="prev"/>
-               <input type="text" size="5" class="pagedisplay"/>
-               <img src="<!-- TMPL_VAR name="interface" -->/prog/img/next.png" class="next"/>
-               <img src="<!-- TMPL_VAR name="interface" -->/prog/img/last.png" class="last"/>
-               , entries/page : 
-               <select class="pagesize">
-               <option selected="selected" value="10">10</option>
-                       <option value="20">20</option>
-                       <option value="30">30</option>
-                       <option value="40">40</option>
-                       <option value="50">50</option>
-                       <option value="100">100</option>
-               </select>
-       </form>
+<!-- TMPL_IF NAME="loop" --><span id="pagertable_item_type" class="pager">
+  <form class="formpager">&nbsp;<strong>page(s)</strong>:&nbsp;
+    <img src="<!-- TMPL_VAR name="interface" -->/prog/img/first.png" class="first"/>
+    <img src="<!-- TMPL_VAR name="interface" -->/prog/img/prev.png" class="prev"/>
+    <input type="text" size="5" class="pagedisplay"/>
+    <img src="<!-- TMPL_VAR name="interface" -->/prog/img/next.png" class="next"/>
+    <img src="<!-- TMPL_VAR name="interface" -->/prog/img/last.png" class="last"/>
+    , entries/page:
+    <select class="pagesize">
+          <option selected="selected" value="10">10</option>
+      <option value="20">20</option>
+      <option value="30">30</option>
+      <option value="40">40</option>
+      <option value="50">50</option>
+      <option value="100">100</option>
+    </select>
+  </form>
 </span>
 <table id="table_item_type">
   <thead>
@@ -337,7 +337,9 @@ Item Types Administration
     </td>
   </tr>
   <!-- /TMPL_LOOP -->
-</table>
+</table><!-- TMPL_ELSE -->
+<div class="dialog message">There are no itemtypes defined</div>
+<!-- /TMPL_IF -->
 
 <div class="paginationBar"><!-- TMPL_VAR NAME="pagination_bar" --></div>
 
index 212d8a2..bb7fab2 100644 (file)
@@ -1,5 +1,5 @@
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
-<title>Koha &rsaquo; Administration &rsaquo;<!-- TMPL_IF name="add_form" --><!-- TMPL_IF NAME="use-heading-flags-p" --><!-- TMPL_IF NAME="heading-edit-subfields-p" --> MARC Subfield Structure &rsaquo; Edit MARC subfields constraints<!-- /TMPL_IF --><!-- TMPL_ELSE --> MARC Subfield Structure &rsaquo; <!-- TMPL_VAR NAME="action" --><!-- /TMPL_IF --><!-- /TMPL_IF -->
+<title>Koha &rsaquo; Administration &rsaquo;<!-- TMPL_IF name="add_form" --><!-- TMPL_IF NAME="use_heading_flags_p" --><!-- TMPL_IF NAME="heading_edit_subfields_p" --> MARC Subfield Structure &rsaquo; Edit MARC subfields constraints<!-- /TMPL_IF --><!-- TMPL_ELSE --> MARC Subfield Structure &rsaquo; <!-- TMPL_VAR NAME="action" --><!-- /TMPL_IF --><!-- /TMPL_IF -->
 <!-- TMPL_IF name="delete_confirm" --> MARC Subfield Structure &rsaquo; Confirm Deletion of Subfield <!-- TMPL_VAR NAME="tagsubfield" --><!-- /TMPL_IF --><!-- TMPL_IF name="delete_confirmed" --> MARC Subfield Structure &rsaquo; Subfield Deleted<!-- /TMPL_IF --><!-- TMPL_IF name="else" -->MARC Subfield Structure<!-- /TMPL_IF --></title>
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
 <script type="text/javascript">
@@ -38,8 +38,8 @@
 <div id="breadcrumbs">
   <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; <a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC Frameworks</a> &rsaquo; <a href="/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=<!-- TMPL_VAR NAME="frameworkcode" -->&amp;searchfield=<!-- TMPL_VAR name="tagfield" -->"><!-- TMPL_VAR NAME="frameworkcode" --> Framework Structure</a> &rsaquo;
   <!-- TMPL_IF name="add_form" -->
-  <!-- TMPL_IF NAME="use-heading-flags-p" -->
-  <!-- TMPL_IF NAME="heading-edit-subfields-p" --> <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=<!-- TMPL_VAR NAME="tagfield" -->&amp;frameworkcode=<!-- TMPL_VAR NAME="frameworkcode" -->">Tag <!-- TMPL_VAR NAME="tagfield" --> Subfield Structure</a> &rsaquo; Edit subfields constraints
+  <!-- TMPL_IF NAME="use_heading_flags_p" -->
+  <!-- TMPL_IF NAME="heading_edit_subfields_p" --> <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=<!-- TMPL_VAR NAME="tagfield" -->&amp;frameworkcode=<!-- TMPL_VAR NAME="frameworkcode" -->">Tag <!-- TMPL_VAR NAME="tagfield" --> Subfield Structure</a> &rsaquo; Edit subfields constraints
   <!-- /TMPL_IF -->
   <!-- TMPL_ELSE --> <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=<!-- TMPL_VAR NAME="tagfield" -->&amp;frameworkcode=<!-- TMPL_VAR NAME="frameworkcode" -->">Tag <!-- TMPL_VAR NAME="tagfield" --> Subfield Structure</a> &rsaquo; <!-- TMPL_VAR NAME="action" -->
   <!-- /TMPL_IF -->
@@ -59,8 +59,8 @@
 
 <!-- TMPL_IF NAME="add_form" -->
     <h1>
-        <!-- TMPL_IF NAME="use-heading-flags-p" -->
-            <!-- TMPL_IF NAME="heading-edit-subfields-p" -->Tag <!-- TMPL_VAR NAME="tagfield" --> Subfield Constraints<!-- /TMPL_IF -->
+        <!-- TMPL_IF NAME="use_heading_flags_p" -->
+            <!-- TMPL_IF NAME="heading_edit_subfields_p" -->Tag <!-- TMPL_VAR NAME="tagfield" --> Subfield Constraints<!-- /TMPL_IF -->
         <!-- TMPL_ELSE -->
             <!-- TMPL_VAR NAME="action" -->
         <!-- /TMPL_IF -->
index eb912d6..e587967 100644 (file)
@@ -76,7 +76,7 @@ $(document).ready(function() {
 
     <form action="<!-- TMPL_VAR NAME="script_name" -->" name="Aform" method="post">
        
-      <fieldset class="rows"><legend><!-- TMPL_IF NAME="use-heading-flags-p" --><!-- TMPL_IF NAME="heading-modify-tag-p" -->Modify tag <input type="hidden" name="modif" value="1" /><!-- TMPL_VAR NAME="searchfield" --><!-- /TMPL_IF --><!-- TMPL_IF NAME="heading-add-tag-p" -->Add tag<!-- /TMPL_IF --><!-- TMPL_ELSE --><!-- TMPL_VAR NAME="action" --><!-- /TMPL_IF --></legend>  <input type="hidden" name="op" value="add_validate" />
+      <fieldset class="rows"><legend><!-- TMPL_IF NAME="use_heading_flags_p" --><!-- TMPL_IF NAME="heading_modify_tag_p" -->Modify tag <input type="hidden" name="modif" value="1" /><!-- TMPL_VAR NAME="searchfield" --><!-- /TMPL_IF --><!-- TMPL_IF NAME="heading_add_tag_p" -->Add tag<!-- /TMPL_IF --><!-- TMPL_ELSE --><!-- TMPL_VAR NAME="action" --><!-- /TMPL_IF --></legend>  <input type="hidden" name="op" value="add_validate" />
        <input type="hidden" name="frameworkcode" value="<!-- TMPL_VAR NAME="frameworkcode" -->" />
 
        <ol> <li><label for="tagfield">Tag: </label><input id="tagfield" type="text" name="tagfield" value="<!-- TMPL_VAR NAME="searchfield" -->" maxlength="3" size="3" /></li>    
index 3ae0281..06a0592 100644 (file)
@@ -6,15 +6,21 @@
 <link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR NAME="themelang"-->/css/humanmsg.css" />
 <script src="<!-- TMPL_VAR NAME="themelang" -->/lib/jquery/plugins/humanmsg.js" type="text/javascript"></script>
 <script src="<!-- TMPL_VAR NAME="themelang" -->/js/ajax.js" type="text/javascript"></script>
-<script src="<!-- TMPL_VAR NAME="themelang" -->/js/pages/preferences.js" type="text/javascript"></script>
-<script src="<!-- TMPL_VAR NAME="themelang" -->/lib/jquery/plugins/jquery.highlight-3.js" type="text/javascript"></script>
 <script type="text/javascript">
- //<![CDATA[
+//<![CDATA[
     // This is here because of its dependence on template variables, everything else should go in js/pages/preferences.js - jpw
     var to_highlight = "<!-- TMPL_VAR NAME="searchfield" ESCAPE="JS"-->";
     var search_jumped = <!-- TMPL_IF NAME="search_jumped" -->true<!-- TMPL_ELSE -->false<!-- /TMPL_IF -->;
+    var MSG_NOTHING_TO_SAVE = _("Nothing to save");
+    var MSG_SAVING = _("Saving...");
+    var MSG_MODIFIED = _("modified");
+    var MSG_MADE_CHANGES = _("You have made changes to system preferences.");
+    var MSG_CLICK_TO_EXPAND = _("Click to expand this section");
+    var MSG_CLICK_TO_COLLAPSE = _("Click to collapse this section");
 //]]>
 </script>
+<script src="<!-- TMPL_VAR NAME="themelang" -->/js/pages/preferences.js" type="text/javascript"></script>
+<script src="<!-- TMPL_VAR NAME="themelang" -->/lib/jquery/plugins/jquery.highlight-3.js" type="text/javascript"></script>
 </head>
 <body>
 <!-- TMPL_INCLUDE NAME="header.inc" -->
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced-content.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced-content.pref
deleted file mode 100644 (file)
index 5367a42..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
-Enhanced Content:
-    All:
-        -
-            - <strong>NOTE:</strong> you can only choose one source of cover images from below, otherwise Koha will show the images from all sources selected.
-        -
-            - pref: FRBRizeEditions
-              default: 0
-              choices:
-                  yes: Show
-                  no: "Don't show"
-            - other editions of an item on the staff client (if found by one of the services below).
-        -
-            - pref: OPACFRBRizeEditions
-              default: 0
-              choices:
-                  yes: Show
-                  no: "Don't show"
-            - other editions of an item on the OPAC.
-    Amazon:
-        -
-            - pref: AmazonEnabled
-              default: 0
-              choices:
-                  yes: Use
-                  no: "Don't use"
-            - data from Amazon on the staff interface (including reviews and "Search Inside" links on item detail pages). This requires that you have signed up for and entered an access key.
-        -
-            - pref: OPACAmazonEnabled
-              default: 0
-              choices:
-                  yes: Use
-                  no: "Don't use"
-            - data from Amazon on the OPAC (including reviews and "Search Inside" links on item detail pages). This requires that you have signed up for and entered an access key.
-        -
-            - Use Amazon data from its
-            - pref: AmazonLocale
-              choices:
-                  US: American
-                  CA: Canadian
-                  DE: German
-                  FR: French
-                  JP: Japanese
-                  UK: British
-            - website.
-        -
-            - Access Amazon content using the access key
-            - pref: AWSAccessKeyID
-            - (free, at <a href="http://aws.amazon.com/">http://aws.amazon.com/</a>).
-        -
-            - Access Amazon content (other than book jackets) using the private key
-            - pref: AWSPrivateKey
-            - (free, at <a href="http://aws.amazon.com/">http://aws.amazon.com/</a>).
-        -
-            - Put the associate tag
-            - pref: AmazonAssocTag
-            - on links to Amazon. This can net your library referral fees if a patron decides to buy an item.
-        -
-            - pref: AmazonCoverImages
-              default: 1
-              choices:
-                  yes: Show
-                  no: "Don't show"
-            - cover images from Amazon on search results and item detail pages on the staff interface.
-        -
-            - pref: AmazonReviews
-              default: 1
-              choices:
-                  yes: Show
-                  no: "Don't show"
-            - reviews from Amazon on item detail pages on the staff interface.
-        -
-            - pref: AmazonSimilarItems
-              default: 1
-              choices:
-                  yes: Show
-                  no: "Don't show"
-            - similar items, as determined by Amazon, on item detail pages on the staff interface.
-        -
-            - pref: OPACAmazonCoverImages
-              default: 1
-              choices:
-                  yes: Show
-                  no: "Don't show"
-            - cover images from Amazon on search results and item detail pages on the OPAC.
-        -
-            - pref: OPACAmazonSimilarItems
-              default: 1
-              choices:
-                  yes: Show
-                  no: "Don't show"
-            - similar items, as determined by Amazon, on item detail pages on the OPAC.
-        -
-            - pref: OPACAmazonReviews
-              default: 1
-              choices:
-                  yes: Show
-                  no: "Don't show"
-            - reviews from Amazon on item detail pages on the OPAC.
-    Babelthèque:
-        -
-            - pref: Babeltheque
-              choices:
-                  yes: Do
-                  no: "Don't"
-            - include information (such as reviews and citations) from Babelthèque in item detail pages on the OPAC.
-    Baker and Taylor:
-        -
-            - pref: BakerTaylorEnabled
-              choices:
-                  yes: Add
-                  no: "Don't add"
-            - Baker and Taylor links and cover images to the OPAC and staff client. This requires that you have entered in a username and password (which can be seen in image links).
-        -
-            - 'Baker and Taylor "My Library Bookstore" links should be accessed at <code>https://'
-            - pref: BakerTaylorBookstoreURL
-              class: url
-            - <em>isbn</em></code> (this should be filled in with something like <code>ocls.mylibrarybookstore.com/MLB/actions/searchHandler.do?nextPage=bookDetails&amp;parentNum=10923&amp;key=</code>). Leave it blank to disable these links.
-        -
-            - Access Baker and Taylor using username
-            - pref: BakerTaylorUsername
-              class: password
-            - and password
-            - pref: BakerTaylorPassword
-              class: password
-            - .
-    Google:
-        -
-            - pref: GoogleJackets
-              choices:
-                  yes: Add
-                  no: "Don't add"
-            - cover images from Google Books to search results and item detail pages on the OPAC.
-    Library Thing:
-        # Awkward syntax below, due to quoting conflicts
-        -
-            - pref: ThingISBN
-              choices:
-                  yes: Use
-                  no: "Don't use"
-            - the ThingISBN service to show other editions of a title (when either FRBRizeEditions or OPACFRBRizeEditions is on). This is separate from Library Thing for Libraries.
-        -
-            - pref: LibraryThingForLibrariesEnabled
-              choices:
-                  yes: Show
-                  no: "Don't show"
-            - "reviews, similar items, and tags from Library Thing for Libraries on item detail pages on the OPAC. If you've enabled this, you need to "
-            - <a href="http://www.librarything.com/forlibraries/">sign up</a>, then enter in your ID below.
-        -
-            - Access Library Thing for Libraries using the customer ID
-            - pref: LibraryThingForLibrariesID
-            - .
-        -
-            - Show Library Thing for Libraries content
-            - pref: LibraryThingForLibrariesTabbedView
-              choices:
-                  yes: in tabs.
-                  no: in line with the bibliographic information.
-    OCLC:
-        -
-            - pref: XISBN
-              choices:
-                  yes: Use
-                  no: "Don't use"
-            - the OCLC xISBN service to show other editions of a title (when either FRBRizeEditions or OPACFRBRizeEditions is on).
-        -
-            - Use the <a href="http://www.worldcat.org/affiliate/webservices/xisbn/app.jsp">OCLC affiliate ID</a>
-            - pref: OCLCAffiliateID
-            - to access the xISBN service. Note that unless you have signed up for an ID, you are limited to 1000 requests per day.
-        -
-            - Only use the xISBN service
-            - pref: XISBNDailyLimit
-              class: integer
-            - times a day. Unless you are paying for the xISBN service, you should leave this at the default of 999 (as detailed above).
-    Syndetics:
-        -
-            - pref: SyndeticsEnabled
-              choices:
-                  yes: Use
-                  no: "Don't use"
-            - content from Syndetics. Note that this requires that you have signed up for the service and entered in your client code below.
-        -
-            - Use the client code
-            - pref: SyndeticsClientCode
-            - to access Syndetics.
-        -
-            - pref: SyndeticsCoverImages
-              choices:
-                  yes: Show
-                  no: "Don't show"
-            - cover images from Syndetics on search results and item detail pages on the OPAC in a
-            - pref: SyndeticsCoverImageSize
-              choices:
-                  MC: medium
-                  LC: large
-            - size.
-        -
-            - pref: SyndeticsAuthorNotes
-              choices:
-                  yes: Show
-                  no: "Don't show"
-            - notes about the author of a title from Syndetics on item detail pages on the OPAC.
-        -
-            - pref: SyndeticsAwards
-              choices:
-                  yes: Show
-                  no: "Don't show"
-            - information from Syndetics about the awards a title has won on item detail pages on the OPAC.
-        -
-            - pref: SyndeticsEditions
-              choices:
-                  yes: Show
-                  no: "Don't show"
-            - information about other editions of a title from Syndetics on item detail pages on the OPAC (when OPACFRBRizeEditions is on).
-        -
-            - pref: SyndeticsExcerpt
-              choices:
-                  yes: Show
-                  no: "Don't show"
-            - excerpts from of a title from Syndetics on item detail pages on the OPAC.
-        -
-            - pref: SyndeticsReviews
-              choices:
-                  yes: Show
-                  no: "Don't show"
-            - reviews of a title from Syndetics on item detail pages on the OPAC.
-        -
-            - pref: SyndeticsSeries
-              choices:
-                  yes: Show
-                  no: "Don't show"
-            - "information on other books in a title's series from Syndetics on item detail pages on the OPAC."
-        -
-            - pref: SyndeticsSummary
-              choices:
-                  yes: Show
-                  no: "Don't show"
-            - a summary of a title from Syndetics on item detail pages on the OPAC.
-        -
-            - pref: SyndeticsTOC
-              choices:
-                  yes: Show
-                  no: "Don't show"
-            - the table of contents of a title from Syndetics on item detail pages on the OPAC.
-    Tagging:
-        -
-            - pref: TagsEnabled
-              choices:
-                  yes: Allow
-                  no: "Don't allow"
-            - patrons and staff to put tags on items.
-        -
-            - pref: TagsModeration
-              choices:
-                  yes: Require
-                  no: "Don't require"
-            - that tags submitted by patrons be reviewed by a staff member before being shown.
-        -
-            - Show
-            - pref: TagsShowOnList
-              class: integer
-            - tags on search results on the OPAC.
-        -
-            - pref: TagsInputOnList
-              choices:
-                  yes: Allow
-                  no: "Don't allow"
-            - patrons to input tags on search results on the OPAC.
-        -
-            - Show
-            - pref: TagsShowOnDetail
-              class: integer
-            - tags on item detail pages on the OPAC.
-        -
-            - pref: TagsInputOnDetail
-              choices:
-                  yes: Allow
-                  no: "Don't allow"
-            - patrons to input tags on item detail pages on the OPAC.
-        -
-            - Allow tags in the dictionary of the ispell executable
-            - pref: TagsExternalDictionary
-              class: file
-            - on the server to be approved without moderation.
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref
new file mode 100644 (file)
index 0000000..5367a42
--- /dev/null
@@ -0,0 +1,283 @@
+Enhanced Content:
+    All:
+        -
+            - <strong>NOTE:</strong> you can only choose one source of cover images from below, otherwise Koha will show the images from all sources selected.
+        -
+            - pref: FRBRizeEditions
+              default: 0
+              choices:
+                  yes: Show
+                  no: "Don't show"
+            - other editions of an item on the staff client (if found by one of the services below).
+        -
+            - pref: OPACFRBRizeEditions
+              default: 0
+              choices:
+                  yes: Show
+                  no: "Don't show"
+            - other editions of an item on the OPAC.
+    Amazon:
+        -
+            - pref: AmazonEnabled
+              default: 0
+              choices:
+                  yes: Use
+                  no: "Don't use"
+            - data from Amazon on the staff interface (including reviews and "Search Inside" links on item detail pages). This requires that you have signed up for and entered an access key.
+        -
+            - pref: OPACAmazonEnabled
+              default: 0
+              choices:
+                  yes: Use
+                  no: "Don't use"
+            - data from Amazon on the OPAC (including reviews and "Search Inside" links on item detail pages). This requires that you have signed up for and entered an access key.
+        -
+            - Use Amazon data from its
+            - pref: AmazonLocale
+              choices:
+                  US: American
+                  CA: Canadian
+                  DE: German
+                  FR: French
+                  JP: Japanese
+                  UK: British
+            - website.
+        -
+            - Access Amazon content using the access key
+            - pref: AWSAccessKeyID
+            - (free, at <a href="http://aws.amazon.com/">http://aws.amazon.com/</a>).
+        -
+            - Access Amazon content (other than book jackets) using the private key
+            - pref: AWSPrivateKey
+            - (free, at <a href="http://aws.amazon.com/">http://aws.amazon.com/</a>).
+        -
+            - Put the associate tag
+            - pref: AmazonAssocTag
+            - on links to Amazon. This can net your library referral fees if a patron decides to buy an item.
+        -
+            - pref: AmazonCoverImages
+              default: 1
+              choices:
+                  yes: Show
+                  no: "Don't show"
+            - cover images from Amazon on search results and item detail pages on the staff interface.
+        -
+            - pref: AmazonReviews
+              default: 1
+              choices:
+                  yes: Show
+                  no: "Don't show"
+            - reviews from Amazon on item detail pages on the staff interface.
+        -
+            - pref: AmazonSimilarItems
+              default: 1
+              choices:
+                  yes: Show
+                  no: "Don't show"
+            - similar items, as determined by Amazon, on item detail pages on the staff interface.
+        -
+            - pref: OPACAmazonCoverImages
+              default: 1
+              choices:
+                  yes: Show
+                  no: "Don't show"
+            - cover images from Amazon on search results and item detail pages on the OPAC.
+        -
+            - pref: OPACAmazonSimilarItems
+              default: 1
+              choices:
+                  yes: Show
+                  no: "Don't show"
+            - similar items, as determined by Amazon, on item detail pages on the OPAC.
+        -
+            - pref: OPACAmazonReviews
+              default: 1
+              choices:
+                  yes: Show
+                  no: "Don't show"
+            - reviews from Amazon on item detail pages on the OPAC.
+    Babelthèque:
+        -
+            - pref: Babeltheque
+              choices:
+                  yes: Do
+                  no: "Don't"
+            - include information (such as reviews and citations) from Babelthèque in item detail pages on the OPAC.
+    Baker and Taylor:
+        -
+            - pref: BakerTaylorEnabled
+              choices:
+                  yes: Add
+                  no: "Don't add"
+            - Baker and Taylor links and cover images to the OPAC and staff client. This requires that you have entered in a username and password (which can be seen in image links).
+        -
+            - 'Baker and Taylor "My Library Bookstore" links should be accessed at <code>https://'
+            - pref: BakerTaylorBookstoreURL
+              class: url
+            - <em>isbn</em></code> (this should be filled in with something like <code>ocls.mylibrarybookstore.com/MLB/actions/searchHandler.do?nextPage=bookDetails&amp;parentNum=10923&amp;key=</code>). Leave it blank to disable these links.
+        -
+            - Access Baker and Taylor using username
+            - pref: BakerTaylorUsername
+              class: password
+            - and password
+            - pref: BakerTaylorPassword
+              class: password
+            - .
+    Google:
+        -
+            - pref: GoogleJackets
+              choices:
+                  yes: Add
+                  no: "Don't add"
+            - cover images from Google Books to search results and item detail pages on the OPAC.
+    Library Thing:
+        # Awkward syntax below, due to quoting conflicts
+        -
+            - pref: ThingISBN
+              choices:
+                  yes: Use
+                  no: "Don't use"
+            - the ThingISBN service to show other editions of a title (when either FRBRizeEditions or OPACFRBRizeEditions is on). This is separate from Library Thing for Libraries.
+        -
+            - pref: LibraryThingForLibrariesEnabled
+              choices:
+                  yes: Show
+                  no: "Don't show"
+            - "reviews, similar items, and tags from Library Thing for Libraries on item detail pages on the OPAC. If you've enabled this, you need to "
+            - <a href="http://www.librarything.com/forlibraries/">sign up</a>, then enter in your ID below.
+        -
+            - Access Library Thing for Libraries using the customer ID
+            - pref: LibraryThingForLibrariesID
+            - .
+        -
+            - Show Library Thing for Libraries content
+            - pref: LibraryThingForLibrariesTabbedView
+              choices:
+                  yes: in tabs.
+                  no: in line with the bibliographic information.
+    OCLC:
+        -
+            - pref: XISBN
+              choices:
+                  yes: Use
+                  no: "Don't use"
+            - the OCLC xISBN service to show other editions of a title (when either FRBRizeEditions or OPACFRBRizeEditions is on).
+        -
+            - Use the <a href="http://www.worldcat.org/affiliate/webservices/xisbn/app.jsp">OCLC affiliate ID</a>
+            - pref: OCLCAffiliateID
+            - to access the xISBN service. Note that unless you have signed up for an ID, you are limited to 1000 requests per day.
+        -
+            - Only use the xISBN service
+            - pref: XISBNDailyLimit
+              class: integer
+            - times a day. Unless you are paying for the xISBN service, you should leave this at the default of 999 (as detailed above).
+    Syndetics:
+        -
+            - pref: SyndeticsEnabled
+              choices:
+                  yes: Use
+                  no: "Don't use"
+            - content from Syndetics. Note that this requires that you have signed up for the service and entered in your client code below.
+        -
+            - Use the client code
+            - pref: SyndeticsClientCode
+            - to access Syndetics.
+        -
+            - pref: SyndeticsCoverImages
+              choices:
+                  yes: Show
+                  no: "Don't show"
+            - cover images from Syndetics on search results and item detail pages on the OPAC in a
+            - pref: SyndeticsCoverImageSize
+              choices:
+                  MC: medium
+                  LC: large
+            - size.
+        -
+            - pref: SyndeticsAuthorNotes
+              choices:
+                  yes: Show
+                  no: "Don't show"
+            - notes about the author of a title from Syndetics on item detail pages on the OPAC.
+        -
+            - pref: SyndeticsAwards
+              choices:
+                  yes: Show
+                  no: "Don't show"
+            - information from Syndetics about the awards a title has won on item detail pages on the OPAC.
+        -
+            - pref: SyndeticsEditions
+              choices:
+                  yes: Show
+                  no: "Don't show"
+            - information about other editions of a title from Syndetics on item detail pages on the OPAC (when OPACFRBRizeEditions is on).
+        -
+            - pref: SyndeticsExcerpt
+              choices:
+                  yes: Show
+                  no: "Don't show"
+            - excerpts from of a title from Syndetics on item detail pages on the OPAC.
+        -
+            - pref: SyndeticsReviews
+              choices:
+                  yes: Show
+                  no: "Don't show"
+            - reviews of a title from Syndetics on item detail pages on the OPAC.
+        -
+            - pref: SyndeticsSeries
+              choices:
+                  yes: Show
+                  no: "Don't show"
+            - "information on other books in a title's series from Syndetics on item detail pages on the OPAC."
+        -
+            - pref: SyndeticsSummary
+              choices:
+                  yes: Show
+                  no: "Don't show"
+            - a summary of a title from Syndetics on item detail pages on the OPAC.
+        -
+            - pref: SyndeticsTOC
+              choices:
+                  yes: Show
+                  no: "Don't show"
+            - the table of contents of a title from Syndetics on item detail pages on the OPAC.
+    Tagging:
+        -
+            - pref: TagsEnabled
+              choices:
+                  yes: Allow
+                  no: "Don't allow"
+            - patrons and staff to put tags on items.
+        -
+            - pref: TagsModeration
+              choices:
+                  yes: Require
+                  no: "Don't require"
+            - that tags submitted by patrons be reviewed by a staff member before being shown.
+        -
+            - Show
+            - pref: TagsShowOnList
+              class: integer
+            - tags on search results on the OPAC.
+        -
+            - pref: TagsInputOnList
+              choices:
+                  yes: Allow
+                  no: "Don't allow"
+            - patrons to input tags on search results on the OPAC.
+        -
+            - Show
+            - pref: TagsShowOnDetail
+              class: integer
+            - tags on item detail pages on the OPAC.
+        -
+            - pref: TagsInputOnDetail
+              choices:
+                  yes: Allow
+                  no: "Don't allow"
+            - patrons to input tags on item detail pages on the OPAC.
+        -
+            - Allow tags in the dictionary of the ispell executable
+            - pref: TagsExternalDictionary
+              class: file
+            - on the server to be approved without moderation.
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n-l10n.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n-l10n.pref
deleted file mode 100644 (file)
index 591e6ca..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-I18N/L10N:
-    -
-        - Format dates like
-        - pref: dateformat
-          default: us
-          choices:
-              us: mm/dd/yyyy
-              metric: dd/mm/yyyy
-              iso: yyyy/mm/dd
-        - .
-    -
-        - "Enable the following languages on the staff interface:"
-        - pref: language
-          type: staff-languages
-    -
-        - pref: opaclanguagesdisplay
-          default: 0
-          choices:
-              yes: Allow
-              no: "Don't allow"
-        - patrons to change the language they see on the OPAC.
-    -
-        - "Enable the following languages on the OPAC:"
-        - pref: opaclanguages
-          type: opac-languages
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref
new file mode 100644 (file)
index 0000000..591e6ca
--- /dev/null
@@ -0,0 +1,25 @@
+I18N/L10N:
+    -
+        - Format dates like
+        - pref: dateformat
+          default: us
+          choices:
+              us: mm/dd/yyyy
+              metric: dd/mm/yyyy
+              iso: yyyy/mm/dd
+        - .
+    -
+        - "Enable the following languages on the staff interface:"
+        - pref: language
+          type: staff-languages
+    -
+        - pref: opaclanguagesdisplay
+          default: 0
+          choices:
+              yes: Allow
+              no: "Don't allow"
+        - patrons to change the language they see on the OPAC.
+    -
+        - "Enable the following languages on the OPAC:"
+        - pref: opaclanguages
+          type: opac-languages
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/local-use.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/local-use.pref
deleted file mode 100644 (file)
index 9d9c592..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-Local Use:
-    -
-        - Nothing defined yet.
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/local_use.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/local_use.pref
new file mode 100644 (file)
index 0000000..9d9c592
--- /dev/null
@@ -0,0 +1,3 @@
+Local Use:
+    -
+        - Nothing defined yet.
index acab30a..3014e63 100644 (file)
@@ -16,6 +16,12 @@ OPAC:
               class: long
             - as the name of the library on the OPAC.
         -
+            - pref: OpacPublic
+              choices:
+                  yes: Enable
+                  no: Disable
+            - "Koha OPAC as public. Private OPAC requires authentification before accessing the OPAC."
+        -
             - pref: OpacMaintenance
               choices:
                   yes: Show
@@ -196,18 +202,6 @@ OPAC:
                   no: "Don't allow"
             - patrons to store items in a temporary "Cart" on the OPAC.
         -
-            - pref: opacreadinghistory
-              choices:
-                  yes: Allow
-                  no: "Don't allow"
-            - patrons to see what books they have checked out in the past.
-        -
-            - pref: OPACShelfBrowser
-              choices:
-                  yes: Show
-                  no: "Don't show"
-            - "a shelf browser on item details pages, allowing patrons to see what's near that item on the shelf. Note that this uses up a fairly large amount of resources on your server, and should be avoided if your collection has a large number of items."
-        -
             - pref: OpacTopissue
               choices:
                   yes: Allow
@@ -245,12 +239,6 @@ OPAC:
                   yes: Limit
                   no: "Don't limit"
             - "patrons' searches to the library they are registered at."
-        -
-            - pref: AnonSuggestions
-              choices:
-                  yes: Allow
-                  no: "Don't allow"
-            - "patrons that aren't logged in to make purchase suggestions."
 #        -
 #            This system preference does not actually affect anything
 #            - pref: OpacBrowser
@@ -288,9 +276,62 @@ OPAC:
             - purchase suggestions from other patrons on the OPAC.
     Privacy:
         -
+            - pref: AnonSuggestions
+              choices:
+                  yes: Allow
+                  no: "Don't allow"
+            - "patrons that aren't logged in to make purchase suggestions. Suggestions are connected to the AnonymousPatron syspref"
+        -
+            - pref: opacreadinghistory
+              choices:
+                  yes: Allow
+                  no: "Don't allow"
+            - patrons to see what books they have checked out in the past.
+        -
             - pref: EnableOpacSearchHistory
               default: 0
               choices:
                   yes: Keep
                   no: "Don't keep"
             - patron search history in the OPAC.
+        -
+            - pref: OPACPrivacy
+              default: 0
+              choices:
+                  yes: Allow
+                  no: "Don't allow"
+            - patrons to choose their own privacy settings for their reading history.  This requires opacreadinghistory and AnonymousPatron
+        -
+            - Use borrowernumber
+            - pref: AnonymousPatron
+              class: integer
+            - as the Anonymous Patron (for anonymous suggestions and reading history)
+
+    Shelf Browser:
+        -
+            - pref: OPACShelfBrowser
+              choices:
+                  yes: Show
+                  no: "Don't show"
+            - "a shelf browser on item details pages, allowing patrons to see what's near that item on the shelf. Note that this uses up a fairly large amount of resources on your server, and should be avoided if your collection has a large number of items."
+        -
+            - pref: ShelfBrowserUsesLocation
+              default: 1
+              choices:
+                  yes: Use
+                  no: "Don't use"
+            - "the item location when finding items for the shelf browser."
+        -
+            - pref: ShelfBrowserUsesHomeBranch
+              default: 1
+              choices:
+                  yes: Use
+                  no: "Don't use"
+            - "the item home branch when finding items for the shelf browser."      
+        -
+            - pref: ShelfBrowserUsesCcode
+              default: 0
+              choices:
+                  yes: Use
+                  no: "Don't use"
+            - "the item collection code when finding items for the shelf browser."      
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff-client.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff-client.pref
deleted file mode 100644 (file)
index ab546f1..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-Staff Client:
-    Appearance:
-        -
-            - Use the
-            - pref: template
-              choices: staff-templates
-            - theme on the staff interface.
-        -
-            - "The staff client is located at http://"
-            - pref: staffClientBaseURL
-              class: url
-            - .
-        -
-            - Include the stylesheet at
-            - pref: intranetstylesheet
-              class: url
-            - on all pages in the staff interface, instead of the default. (This should be a complete URL, starting with <code>http://</code>.)
-        -
-            - "Include the following CSS on all pages in the staff client:"
-            - pref: IntranetUserCSS
-              type: textarea
-              class: code
-        -
-            - Include the stylesheet <code><!-- TMPL_VAR NAME="themelang" -->/css/</code>
-            - pref: intranetcolorstylesheet
-              class: file
-            - on all pages in the staff interface. (Leave blank to disable.)
-        -
-            - Use include files from the
-            - pref: intranet_includes
-              class: file
-            - directory in the template directory, instead of <code>includes/</code>. (Leave blank to disable)
-        -
-            - "Show the following HTML in its own column on the main page of the staff client:"
-            - pref: IntranetmainUserblock
-              type: textarea
-              class: code
-        -
-            - "Show the following HTML in the More menu at the top of each page on the staff client (should be a list of links or blank):"
-            - pref: IntranetNav
-              type: textarea
-              class: code
-        -
-            - "Include the following JavaScript on all pages in the staff clien:"
-            - pref: intranetuserjs
-              type: textarea
-              class: code
-        -   
-            - Show biblio records on result page in the staff client
-            - pref: XSLTResultsDisplay
-              choices:
-                  yes: using XSLT stylesheets.
-                  no: normally.
-        -   
-            - Show item details pages in the staff client
-            - pref: XSLTDetailsDisplay
-              choices:
-                  yes: using XSLT stylesheets.
-                  no: normally.              
-        -
-            - Use the Yahoo UI libraries
-            - pref: yuipath
-              choices:
-                  local: "included with Koha (faster, will work if internet goes down)."
-                  "http://yui.yahooapis.com/2.5.1/build": "from Yahoo's own servers (less demand on your servers)."
-    Options:
-        -
-            - pref: viewMARC
-              choices:
-                  yes: Allow
-                  no: "Don't allow"
-            - staff to view records in plain MARC form on the staff client.
-        -
-            - pref: viewLabeledMARC
-              choices:
-                  yes: Allow
-                  no: "Don't allow"
-            - staff to view records in labeled MARC form on the staff client.
-        -
-            - pref: viewISBD
-              choices:
-                  yes: Allow
-                  no: "Don't allow"
-            - staff to view records in ISBD form on the staff client.
-        -
-            - pref: HidePatronName
-              choices:
-                  no: Show
-                  yes: "Don't show"
-            - the names of patrons that have items checked out or on hold on detail pages or the "Place Hold" screen.
-        -
-            - pref: intranetbookbag
-              choices:
-                  yes: Show
-                  no: "Don't show"
-            - the cart option in the staff client.
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref
new file mode 100644 (file)
index 0000000..0d7fedc
--- /dev/null
@@ -0,0 +1,96 @@
+Staff Client:
+    Appearance:
+        -
+            - Use the
+            - pref: template
+              choices: staff-templates
+            - theme on the staff interface.
+        -
+            - "The staff client is located at http://"
+            - pref: staffClientBaseURL
+              class: url
+            - .
+        -
+            - Include the stylesheet at
+            - pref: intranetstylesheet
+              class: url
+            - on all pages in the staff interface, instead of the default. (This should be a complete URL, starting with <code>http://</code>.)
+        -
+            - "Include the following CSS on all pages in the staff client:"
+            - pref: IntranetUserCSS
+              type: textarea
+              class: code
+        -
+            - Include the stylesheet <code><!-- TMPL_VAR NAME="themelang" -->/css/</code>
+            - pref: intranetcolorstylesheet
+              class: file
+            - on all pages in the staff interface. (Leave blank to disable.)
+        -
+            - Use include files from the
+            - pref: intranet_includes
+              class: file
+            - directory in the template directory, instead of <code>includes/</code>. (Leave blank to disable)
+        -
+            - "Show the following HTML in its own column on the main page of the staff client:"
+            - pref: IntranetmainUserblock
+              type: textarea
+              class: code
+        -
+            - "Show the following HTML in the More menu at the top of each page on the staff client (should be a list of links or blank):"
+            - pref: IntranetNav
+              type: textarea
+              class: code
+        -
+            - "Include the following JavaScript on all pages in the staff clien:"
+            - pref: intranetuserjs
+              type: textarea
+              class: code
+        -
+            - Show biblio records on result page in the staff client
+            - pref: XSLTResultsDisplay
+              choices:
+                  yes: using XSLT stylesheets.
+                  no: normally.
+        -
+            - Show item details pages in the staff client
+            - pref: XSLTDetailsDisplay
+              choices:
+                  yes: using XSLT stylesheets.
+                  no: normally.
+        -
+            - Use the Yahoo UI libraries
+            - pref: yuipath
+              choices:
+                  local: "included with Koha (faster, will work if internet goes down)."
+                  "http://yui.yahooapis.com/2.5.1/build": "from Yahoo's own servers (less demand on your servers)."
+    Options:
+        -
+            - pref: viewMARC
+              choices:
+                  yes: Allow
+                  no: "Don't allow"
+            - staff to view records in plain MARC form on the staff client.
+        -
+            - pref: viewLabeledMARC
+              choices:
+                  yes: Allow
+                  no: "Don't allow"
+            - staff to view records in labeled MARC form on the staff client.
+        -
+            - pref: viewISBD
+              choices:
+                  yes: Allow
+                  no: "Don't allow"
+            - staff to view records in ISBD form on the staff client.
+        -
+            - pref: HidePatronName
+              choices:
+                  no: Show
+                  yes: "Don't show"
+            - the names of patrons that have items checked out or on hold on detail pages or the "Place Hold" screen.
+        -
+            - pref: intranetbookbag
+              choices:
+                  yes: Show
+                  no: "Don't show"
+            - the cart option in the staff client.
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web-services.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web-services.pref
deleted file mode 100644 (file)
index f4f5d6f..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-Web Services:
-    OAI-PMH:
-        -
-            - pref: OAI-PMH
-              choices:
-                  yes: Enable
-                  no: Disable
-            - "Koha's"
-            - '<a href="http://www.openarchives.org/pmh/">OAI-PMH</a> server.'
-        -
-            - Identify records at this site with the prefix
-            - pref: "OAI-PMH:archiveID"
-            - ": ."
-        -
-            - Only return
-            - pref: "OAI-PMH:MaxCount"
-              class: integer
-            - records at a time in response to a ListRecords or ListIdentifiers query.
-        -
-            - YAML OAI Koha server configuration file:
-            - pref: "OAI-PMH:ConfFile"
-              class: file
-            - . If empty, Koha OAI Server operates in normal mode, otherwise it operates in extended mode. In extended mode, it's possible to parameter other formats than marcxml or Dublin Core. OAI-PMH:ConfFile specify a YAML configuration file which list available metadata formats and XSL file used to create them from marcxml records.
-    ILS-DI:
-        -
-            - pref: ILS-DI
-              choices:
-                yes: Enable
-                no: Disable
-            - ILS-DI services for OPAC users
-        -
-            - pref: ILS-DI:AuthorizedIPs
-              class: Text
-            - allowed IPs to use the ILS-DI services
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref
new file mode 100644 (file)
index 0000000..f4f5d6f
--- /dev/null
@@ -0,0 +1,34 @@
+Web Services:
+    OAI-PMH:
+        -
+            - pref: OAI-PMH
+              choices:
+                  yes: Enable
+                  no: Disable
+            - "Koha's"
+            - '<a href="http://www.openarchives.org/pmh/">OAI-PMH</a> server.'
+        -
+            - Identify records at this site with the prefix
+            - pref: "OAI-PMH:archiveID"
+            - ": ."
+        -
+            - Only return
+            - pref: "OAI-PMH:MaxCount"
+              class: integer
+            - records at a time in response to a ListRecords or ListIdentifiers query.
+        -
+            - YAML OAI Koha server configuration file:
+            - pref: "OAI-PMH:ConfFile"
+              class: file
+            - . If empty, Koha OAI Server operates in normal mode, otherwise it operates in extended mode. In extended mode, it's possible to parameter other formats than marcxml or Dublin Core. OAI-PMH:ConfFile specify a YAML configuration file which list available metadata formats and XSL file used to create them from marcxml records.
+    ILS-DI:
+        -
+            - pref: ILS-DI
+              choices:
+                yes: Enable
+                no: Disable
+            - ILS-DI services for OPAC users
+        -
+            - pref: ILS-DI:AuthorizedIPs
+              class: Text
+            - allowed IPs to use the ILS-DI services
index c8c9de1..5a079a3 100644 (file)
@@ -88,7 +88,7 @@
 
 <!-- TMPL_IF NAME="add_form" -->
     
-        <form action="<!-- TMPL_VAR NAME="script_name" -->" name="Aform" method="post" <!-- TMPL_IF NAME="type-upload" -->enctype="multipart/form-data"<!-- /TMPL_IF -->>
+        <form action="<!-- TMPL_VAR NAME="script_name" -->" name="Aform" method="post" <!-- TMPL_IF NAME="type_upload" -->enctype="multipart/form-data"<!-- /TMPL_IF -->>
                 
         <fieldset class="rows"><legend>
         <!-- TMPL_IF NAME="modify" -->Modify
             <li><!-- TMPL_IF NAME="searchfield" --><span class="label">Variable: </span><!-- TMPL_VAR NAME="searchfield" --><input type="hidden" name="variable" value="<!-- TMPL_VAR NAME="searchfield" -->" />
             <!-- TMPL_ELSE --><label for="variable">Variable: </label><input type="text" name="variable" id="variable" size="60" /><!-- /TMPL_IF --></li>
             <li><label for="value">Value: </label>
-                <!-- TMPL_IF NAME="type-free" -->
+                <!-- TMPL_IF NAME="type_free" -->
                     <textarea id="value" name="value" cols="<!-- TMPL_VAR NAME="fieldlength" -->"><!-- TMPL_VAR NAME="value" escape="HTML" --></textarea>
-                <!-- TMPL_ELSIF NAME="type-upload" -->
+                <!-- TMPL_ELSIF NAME="type_upload" -->
                     <input type="file" name="value" />
-                <!-- TMPL_ELSIF NAME="type-textarea" -->
+                <!-- TMPL_ELSIF NAME="type_textarea" -->
                     <textarea name="value" id="value" rows="<!--TMPL_VAR NAME="rows" -->" cols="<!-- TMPL_VAR NAME="cols" -->"><!-- TMPL_VAR NAME="value" escape="HTML" --></textarea>
-                <!-- TMPL_ELSIF NAME="type-choice" -->
+                <!-- TMPL_ELSIF NAME="type_choice" -->
                     <select name="value" id="value">
                         <!-- TMPL_LOOP NAME="options" -->
                             <!-- TMPL_IF NAME="selected" -->
                         <!-- /TMPL_LOOP -->
                     </select>
                 <!-- /TMPL_IF -->
-        <!-- TMPL_IF NAME="type-langselector" -->
+        <!-- TMPL_IF NAME="type_langselector" -->
         <!-- TMPL_IF NAME="languages_loop" -->
     <table>
         <!-- TMPL_LOOP NAME="languages_loop" -->
 
         <!-- /TMPL_IF -->
 
-                <!-- TMPL_IF NAME="type-yesno" -->
-                    <!-- TMPL_IF NAME="value-yes" -->
+                <!-- TMPL_IF NAME="type_yesno" -->
+                    <!-- TMPL_IF NAME="value_yes" -->
                         <input type="radio" name="value" id="value" value="1" checked="checked" /><!-- TMPL_ELSE --><input type="radio" name="value" id="value" value="1" />
                     <!-- /TMPL_IF -->
                     <label for="value" class="yesno">ON</label>
-                    <!-- TMPL_IF NAME="value-no" -->    
+                    <!-- TMPL_IF NAME="value_no" -->
                         <input type="radio" name="value" id="value-no" value="0" checked="checked" /><!-- TMPL_ELSE --><input type="radio" name="value" id="value-no" value="0" />
                     <!-- /TMPL_IF -->
                     <label for="value-no" class="yesno">OFF</label>
         <!-- TMPL_ELSE -->
         <td>
         <!-- /TMPL_IF -->
-            <form action="/cgi-bin/koha/admin/systempreferences.pl" method="post" <!-- TMPL_IF NAME="type-upload" -->enctype="multipart/form-data"<!-- /TMPL_IF -->>
+            <form action="/cgi-bin/koha/admin/systempreferences.pl" method="post" <!-- TMPL_IF NAME="type_upload" -->enctype="multipart/form-data"<!-- /TMPL_IF -->>
 
-                <!-- TMPL_IF NAME="type-free" -->
+                <!-- TMPL_IF NAME="type_free" -->
                 <input type="text" name="value" size="<!-- TMPL_VAR NAME="fieldlength" -->" value="<!-- TMPL_VAR NAME="value" escape="HTML" -->" />
                 <!-- /TMPL_IF -->
-                <!-- TMPL_IF NAME="type-upload" -->
+                <!-- TMPL_IF NAME="type_upload" -->
                 <input type="file" name="value" value="<!-- TMPL_VAR NAME="value" escape="HTML" -->" />
                 <!-- /TMPL_IF -->
-                <!-- TMPL_IF NAME="type-textarea" -->
+                <!-- TMPL_IF NAME="type_textarea" -->
                 <a class="expand-textarea" style="display: none" href="#">Click to Edit</a>
                 <textarea name="value" rows="<!--TMPL_VAR NAME="rows" -->" cols="<!-- TMPL_VAR NAME="cols" -->"><!-- TMPL_VAR NAME="value" escape="HTML" --></textarea>
                 <!-- /TMPL_IF -->
-                <!-- TMPL_IF NAME="type-choice" -->
+                <!-- TMPL_IF NAME="type_choice" -->
                 <select name="value">
                     <!-- TMPL_LOOP NAME="options" -->
                         <!-- TMPL_IF NAME="selected" -->
                     <!-- /TMPL_LOOP -->
                 </select>
                 <!-- /TMPL_IF -->
-                <!-- TMPL_IF NAME="type-langselector" -->
+                <!-- TMPL_IF NAME="type_langselector" -->
                 <!-- TMPL_IF NAME="languages_loop" -->
                 <table>
                 <!-- TMPL_LOOP NAME="languages_loop" -->
 
                 <!-- /TMPL_IF -->
 
-                <!-- TMPL_IF NAME="type-yesno" -->
-                    <!-- TMPL_IF NAME="value-yes" -->
+                <!-- TMPL_IF NAME="type_yesno" -->
+                    <!-- TMPL_IF NAME="value_yes" -->
                         <input type="radio" name="value" value="1" checked="checked" /><!-- TMPL_ELSE --><input type="radio" name="value" value="1" />
                     <!-- /TMPL_IF -->
                     <label for="value" class="yesno">ON</label>
-                    <!-- TMPL_IF NAME="value-no" -->    
+                    <!-- TMPL_IF NAME="value_no" -->
                         <input type="radio" name="value" value="0" checked="checked" /><!-- TMPL_ELSE --><input type="radio" name="value" value="0" />
                     <!-- /TMPL_IF -->
                     <label for="value-no" class="yesno">OFF</label>
index 847435d..93ec488 100644 (file)
 <!-- TMPL_ELSE -->
 <option value="utf8">UTF-8</option>
 <!-- /TMPL_IF -->
-<!-- TMPL_IF NAME="encodingEUC-KR" -->
+<!-- TMPL_IF NAME="encodingEUC_KR" -->
 <option value="EUC-KR" selected="selected">EUC-KR</option>
 <!-- TMPL_ELSE -->
 <option value="EUC-KR">EUC-KR</option>
 <!-- TMPL_ELSE -->
 <option value="ISO_6937">ISO_6937</option>
 <!-- /TMPL_IF -->
-<!-- TMPL_IF NAME="encodingMARC-8" -->
+<!-- TMPL_IF NAME="encodingMARC_8" -->
 <option value="MARC-8" selected="selected">MARC-8</option>
 <!-- TMPL_ELSE -->
 <option value="MARC-8">MARC-8</option>
index fe2cd96..becdfe2 100644 (file)
 <div id="login">
 <h1><a href="http://koha-community.org">Koha</a></h1>
 <!-- TMPL_IF NAME="nopermission" -->
-<div id="login_error"><strong>Error: </strong>Unauthorized user<a href="/cgi-bin/koha/mainpage.pl?logout.x=1">click to log out</a></div>
+<div id="login_error"><strong>Error:</strong> You do not have permission to access this page. <a href="/cgi-bin/koha/mainpage.pl?logout.x=1">Click to log out</a></div>
 <!-- /TMPL_IF -->
 
 <!-- TMPL_IF NAME="timed_out" -->
-<div id="login_error"><strong>Error: </strong>Session timed out, please log in again</div>
+<div id="login_error"><strong>Error: </strong>Session timed out.<br /> Please log in again</div>
 <!-- /TMPL_IF -->
 
 <!-- TMPL_IF NAME="different_ip" -->
-<div id="login_error"><strong>Error: </strong>IP address has changed, please log in again </div>
+<div id="login_error"><strong>Error: </strong>IP address has changed. Please log in again </div>
 <!-- /TMPL_IF -->
 
 <!-- TMPL_IF NAME="wrongip" -->
index 8880f8b..f9cc90d 100644 (file)
@@ -45,42 +45,42 @@ function Changefwk(FwkList) {
 
 <div id="bibliotabs" class="toptabs numbered">
        <ul>
-            <!-- TMPL_IF name="0XX" -->
+            <!-- TMPL_IF name="tab0XX" -->
                 <li><a href="/cgi-bin/koha/catalogue/MARCdetail.pl#tab0XX">0</a></li>
             <!-- /TMPL_IF -->
-            <!-- TMPL_IF name="1XX" -->
+            <!-- TMPL_IF name="tab1XX" -->
                 <li><a href="/cgi-bin/koha/catalogue/MARCdetail.pl#tab1XX">1</a></li>
             <!-- /TMPL_IF -->
-            <!-- TMPL_IF name="2XX" -->
+            <!-- TMPL_IF name="tab2XX" -->
                 <li><a href="/cgi-bin/koha/catalogue/MARCdetail.pl#tab2XX">2</a></li>
             <!-- /TMPL_IF -->
-            <!-- TMPL_IF name="3XX" -->
+            <!-- TMPL_IF name="tab3XX" -->
                 <li><a href="/cgi-bin/koha/catalogue/MARCdetail.pl#tab3XX">3</a></li>
             <!-- /TMPL_IF -->
-            <!-- TMPL_IF name="4XX" -->
+            <!-- TMPL_IF name="tab4XX" -->
                 <li><a href="/cgi-bin/koha/catalogue/MARCdetail.pl#tab4XX">4</a></li>
             <!-- /TMPL_IF -->
-            <!-- TMPL_IF name="5XX" -->
+            <!-- TMPL_IF name="tab5XX" -->
                 <li><a href="/cgi-bin/koha/catalogue/MARCdetail.pl#tab5XX">5</a></li>
             <!-- /TMPL_IF -->
-            <!-- TMPL_IF name="6XX" -->
+            <!-- TMPL_IF name="tab6XX" -->
                 <li><a href="/cgi-bin/koha/catalogue/MARCdetail.pl#tab6XX">6</a></li>
             <!-- /TMPL_IF -->
-            <!-- TMPL_IF name="7XX" -->
+            <!-- TMPL_IF name="tab7XX" -->
                 <li><a href="/cgi-bin/koha/catalogue/MARCdetail.pl#tab7XX">7</a></li>
             <!-- /TMPL_IF -->
-            <!-- TMPL_IF name="8XX" -->
+            <!-- TMPL_IF name="tab8XX" -->
                 <li><a href="/cgi-bin/koha/catalogue/MARCdetail.pl#tab8XX">8</a></li>
             <!-- /TMPL_IF -->
-            <!-- TMPL_IF name="9XX" -->
+            <!-- TMPL_IF name="tab9XX" -->
                 <li><a href="/cgi-bin/koha/catalogue/MARCdetail.pl#tab9XX">9</a></li>
             <!-- /TMPL_IF -->
-            <!-- TMPL_IF name="10XX" -->
+            <!-- TMPL_IF name="tab10XX" -->
                 <li><a href="/cgi-bin/koha/catalogue/MARCdetail.pl#tab10XX">Item(s)</a></li>
             <!-- /TMPL_IF -->
         </ul>
     <div id="tab0XX">
-        <!-- TMPL_LOOP NAME="0XX" -->
+        <!-- TMPL_LOOP NAME="tab0XX" -->
             <!-- TMPL_IF name="tag" -->
                 <div class="tag">
                 <div class="tag_title">
@@ -110,7 +110,7 @@ function Changefwk(FwkList) {
     </div>
 
     <div id="tab1XX">
-        <!-- TMPL_LOOP NAME="1XX" -->
+        <!-- TMPL_LOOP NAME="tab1XX" -->
                 <!-- TMPL_IF name="tag" -->
                     <div class="tag">
                     <div class="tag_title">
@@ -140,7 +140,7 @@ function Changefwk(FwkList) {
     </div>
 
     <div id="tab2XX">
-        <!-- TMPL_LOOP NAME="2XX" -->
+        <!-- TMPL_LOOP NAME="tab2XX" -->
                 <!-- TMPL_IF name="tag" -->
                     <div class="tag">
                     <div class="tag_title">
@@ -170,7 +170,7 @@ function Changefwk(FwkList) {
     </div>
 
     <div id="tab3XX">
-        <!-- TMPL_LOOP NAME="3XX" -->
+        <!-- TMPL_LOOP NAME="tab3XX" -->
                 <!-- TMPL_IF name="tag" -->
                     <div class="tag">
                     <div class="tag_title">
@@ -200,7 +200,7 @@ function Changefwk(FwkList) {
     </div>
 
     <div id="tab4XX">
-        <!-- TMPL_LOOP NAME="4XX" -->
+        <!-- TMPL_LOOP NAME="tab4XX" -->
                 <!-- TMPL_IF name="tag" -->
                     <div class="tag">
                     <div class="tag_title">
@@ -230,7 +230,7 @@ function Changefwk(FwkList) {
     </div>
 
     <div  id="tab5XX">
-        <!-- TMPL_LOOP NAME="5XX" -->
+        <!-- TMPL_LOOP NAME="tab5XX" -->
                 <!-- TMPL_IF name="tag" -->
                     <div class="tag">
                     <div class="tag_title">
@@ -260,7 +260,7 @@ function Changefwk(FwkList) {
     </div>
 
     <div id="tab6XX">
-        <!-- TMPL_LOOP NAME="6XX" -->
+        <!-- TMPL_LOOP NAME="tab6XX" -->
                 <!-- TMPL_IF name="tag" -->
                     <div class="tag">
                     <div class="tag_title">
@@ -290,7 +290,7 @@ function Changefwk(FwkList) {
     </div>
 
     <div  id="tab7XX">
-        <!-- TMPL_LOOP NAME="7XX" -->
+        <!-- TMPL_LOOP NAME="tab7XX" -->
                 <!-- TMPL_IF name="tag" -->
                     <div class="tag">
                     <div class="tag_title">
@@ -320,7 +320,7 @@ function Changefwk(FwkList) {
     </div>
 
     <div id="tab8XX">
-        <!-- TMPL_LOOP NAME="8XX" -->
+        <!-- TMPL_LOOP NAME="tab8XX" -->
                 <!-- TMPL_IF name="tag" -->
                     <div class="tag">
                     <div class="tag_title">
@@ -350,7 +350,7 @@ function Changefwk(FwkList) {
     </div>
 
     <div id="tab9XX">
-        <!-- TMPL_LOOP NAME="9XX" -->
+        <!-- TMPL_LOOP NAME="tab9XX" -->
                 <!-- TMPL_IF name="tag" -->
                     <div class="tag">
                     <div class="tag_title">
@@ -379,7 +379,7 @@ function Changefwk(FwkList) {
         <!-- /TMPL_LOOP -->
     </div>
 
-     <!-- TMPL_IF name="10XX" -->
+     <!-- TMPL_IF name="tab10XX" -->
     <div id="tab10XX">
         <table>
                 <tr>
index 24984de..f751bcb 100644 (file)
 </div>
 <!-- /TMPL_IF -->
 
-<!-- TMPL_IF NAME="template-defined-limits" -->
+<!-- TMPL_IF NAME="template_defined_limits" -->
 <div id="advsearch-itemtype" class="container">
 <!-- TYPE LIMITS -->
     <fieldset>
index 6d878b3..8f53e80 100644 (file)
@@ -91,7 +91,7 @@ function verify_images() {
     <!-- TMPL_LOOP NAME="subtitle" -->
        <h4><!-- TMPL_VAR NAME="subfield" --></h4>
     <!-- /TMPL_LOOP -->
-            <!-- TMPL_UNLESS NAME="item-level_itypes" --><img src="<!-- TMPL_VAR NAME="imageurl" -->" alt="<!-- TMPL_VAR NAME="description" -->" title="<!-- TMPL_VAR NAME="description" -->"><!-- /TMPL_UNLESS -->
+            <!-- TMPL_UNLESS NAME="item_level_itypes" --><img src="<!-- TMPL_VAR NAME="imageurl" -->" alt="<!-- TMPL_VAR NAME="description" -->" title="<!-- TMPL_VAR NAME="description" -->"><!-- /TMPL_UNLESS -->
             <!-- TMPL_IF name="unititle" --><p><!-- TMPL_VAR name="unititle" escape="html" --></p><!-- /TMPL_IF -->
             <!-- TMPL_IF NAME="author" --><p>By <a href="/cgi-bin/koha/catalogue/search.pl?q=au:<!-- TMPL_VAR NAME="author" ESCAPE="url" -->"><!-- TMPL_VAR NAME="author" --></a></p><!-- /TMPL_IF -->
         <ul>
@@ -218,7 +218,7 @@ function verify_images() {
 <!-- TMPL_IF name="count" -->
         <table>
             <tr>
-                <!-- TMPL_IF NAME="item-level_itypes" --><th>Item type</th><!-- /TMPL_IF -->
+                <!-- TMPL_IF NAME="item_level_itypes" --><th>Item type</th><!-- /TMPL_IF -->
                 <th>Current Location</th>
                 <th>Home Library</th>
                 <!-- TMPL_IF NAME="itemdata_ccode" --><th>Collection</th><!-- /TMPL_IF -->
@@ -234,7 +234,7 @@ function verify_images() {
             </tr>
             <!-- TMPL_LOOP NAME="itemloop" -->
                 <tr>
-                    <!-- TMPL_IF NAME="item-level_itypes" -->
+                    <!-- TMPL_IF NAME="item_level_itypes" -->
                       <td class="itype">
                         <!-- TMPL_IF NAME="noItemTypeImages" -->
                           <!-- TMPL_VAR NAME="description" -->
@@ -452,7 +452,7 @@ function verify_images() {
 <div id="editions"><h4>Editions</h4>
 <table>
 <!-- TMPL_LOOP NAME="XISBNS" --><tr><!-- TMPL_IF NAME="AmazonEnabled" --><td><a href="http://www.amazon.com/gp/reader/<!-- TMPL_VAR NAME="normalized_isbn" -->/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img src="http://images.amazon.com/images/P/<!-- TMPL_VAR NAME="normalized_isbn" -->.01._AA75_PU_PU-5_.jpg" /></a></td><!-- /TMPL_IF -->
-<!-- TMPL_UNLESS NAME="item-level_itypes" --><td><!-- TMPL_IF NAME="noItemTypeImages" --><!-- TMPL_VAR NAME="description" --><!-- TMPL_ELSE --><img src="<!-- TMPL_VAR NAME="imageurl" -->" alt="<!-- TMPL_VAR NAME="description" -->" title="<!-- TMPL_VAR NAME="description" -->"><!-- /TMPL_IF --></td><!-- /TMPL_IF -->
+<!-- TMPL_UNLESS NAME="item_level_itypes" --><td><!-- TMPL_IF NAME="noItemTypeImages" --><!-- TMPL_VAR NAME="description" --><!-- TMPL_ELSE --><img src="<!-- TMPL_VAR NAME="imageurl" -->" alt="<!-- TMPL_VAR NAME="description" -->" title="<!-- TMPL_VAR NAME="description" -->"><!-- /TMPL_IF --></td><!-- /TMPL_IF -->
 <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="title" escape="html" --></a> by <!-- TMPL_VAR NAME="author" --> &copy;<!-- TMPL_VAR NAME="copyrightdate" -->
   <!-- TMPL_IF name="publishercode" -->
 <!-- TMPL_VAR NAME="publishercode" --> <!-- TMPL_IF name="place" -->(<!-- TMPL_VAR NAME="place"-->)<!--/TMPL_IF--> <!-- TMPL_IF NAME="publicationyear" -->, <!-- TMPL_VAR NAME="publicationyear" --><!-- /TMPL_IF --> <!-- TMPL_IF NAME="editionstatement" --><!-- TMPL_VAR NAME="editionstatement" --><!-- /TMPL_IF --> <!-- TMPL_IF NAME="editionresponsability" --><!-- TMPL_VAR NAME="editionresponsability" --><!-- /TMPL_IF -->
index 13b0e07..5156341 100644 (file)
                     <!-- TMPL_ELSE -->
                         &nbsp;
                     <!-- /TMPL_IF --></td>
+                <td><!-- TMPL_IF NAME="issuedate" -->
+                        <!-- TMPL_VAR NAME="issuedate" -->
+                    <!-- TMPL_ELSE -->
+                        &nbsp;
+                    <!-- /TMPL_IF --></td>
                 <td><!-- TMPL_IF NAME="date_due" -->
                         <!-- TMPL_VAR NAME="date_due" -->
                     <!-- TMPL_ELSE -->
index 440e652..87741d7 100644 (file)
@@ -22,7 +22,7 @@
     <h2><!-- TMPL_VAR NAME="title" ESCAPE="html" --> <!-- TMPL_IF NAME="author" -->, by <!-- TMPL_VAR NAME="author" --><!-- /TMPL_IF --></h2>
     <ol class="bibliodetails">
         <li><span class="label">Biblionumber:</span> <!-- TMPL_VAR NAME="biblionumber" -->&nbsp;</li>
-        <!-- TMPL_UNLESS NAME="item-level_itypes" -->
+        <!-- TMPL_UNLESS NAME="item_level_itypes" -->
         <li><span class="label">Item type:</span> <!-- TMPL_VAR NAME="itemtypename" -->&nbsp;</li>
         <!-- /TMPL_UNLESS -->
         <!-- deprecated? <li><span class="label">Loan length:</span> <!-- TMPL_VAR NAME="loanlength" -->&nbsp;</li> -->
@@ -49,7 +49,7 @@
          <!-- /TMPL_UNLESS --><!-- /TMPL_IF --></h4>
             <ol class="bibliodetails">
             <li><span class="label">Home Library:</span> <!-- TMPL_VAR NAME="homebranchname" -->&nbsp;</li>
-           <!-- TMPL_IF NAME="item-level_itypes" -->
+           <!-- TMPL_IF NAME="item_level_itypes" -->
             <li><span class="label">Item type:</span> <!-- TMPL_VAR NAME="itype" -->&nbsp;</li>
            <!-- /TMPL_IF -->
             <!-- TMPL_IF NAME="collection" --><li><span class="label">Collection:</span> <!-- TMPL_VAR NAME="collection" --></li> <!-- /TMPL_IF -->
index 592f3f4..df09c4f 100644 (file)
@@ -407,7 +407,7 @@ function GetZ3950Terms(){
                                             &nbsp;
                                         <!-- /TMPL_IF -->
                                     <p>
-                                    <!-- TMPL_UNLESS NAME="item-level_itypes" -->
+                                    <!-- TMPL_UNLESS NAME="item_level_itypes" -->
                                     <!-- TMPL_UNLESS NAME="noItemTypeImages" --><!-- TMPL_IF name="imageurl" -->
                                     <img src="<!-- TMPL_VAR name="imageurl" -->" title="<!-- TMPL_VAR name="description" -->" style="float: left; margin: .1em;" alt="" />
                                     <!-- /TMPL_IF --><!-- /TMPL_UNLESS -->
@@ -415,7 +415,7 @@ function GetZ3950Terms(){
                                     <!-- TMPL_VAR name="summary" --></p>
                                 <!-- TMPL_ELSE -->
                                     <p>
-                                    <!-- TMPL_UNLESS NAME="item-level_itypes" -->
+                                    <!-- TMPL_UNLESS NAME="item_level_itypes" -->
                                     <!-- TMPL_UNLESS NAME="noItemTypeImages" --><!-- TMPL_IF name="imageurl" -->
                                     <img src="<!-- TMPL_VAR name="imageurl" -->" title="<!-- TMPL_VAR name="description" -->" style="float: left; margin: .1em;" alt="" />
                                     <!-- /TMPL_IF --><!-- /TMPL_UNLESS -->
@@ -469,7 +469,7 @@ function GetZ3950Terms(){
                                     <ul>
                                     <!-- TMPL_LOOP NAME="available_items_loop" -->
 
-                                        <!-- TMPL_IF NAME="noItemTypeImages" --><li><!-- TMPL_ELSE --><!-- TMPL_IF NAME="item-level_itypes" --><!-- TMPL_IF name="imageurl" --><li style="list-style: none; list-style-type: none;"><img src="<!-- TMPL_VAR name="imageurl" -->" title="<!-- TMPL_VAR name="description" -->" alt="<!-- TMPL_VAR name="description" -->" /><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><!-- /TMPL_IF -->
+                                        <!-- TMPL_IF NAME="noItemTypeImages" --><li><!-- TMPL_ELSE --><!-- TMPL_IF NAME="item_level_itypes" --><!-- TMPL_IF name="imageurl" --><li style="list-style: none; list-style-type: none;"><img src="<!-- TMPL_VAR name="imageurl" -->" title="<!-- TMPL_VAR name="description" -->" alt="<!-- TMPL_VAR name="description" -->" /><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><!-- /TMPL_IF -->
                                         <!-- TMPL_IF NAME="branchname" --><!-- TMPL_VAR NAME="branchname" --><!-- /TMPL_IF -->
                                         <!-- TMPL_IF NAME="location" --><!-- TMPL_VAR NAME="location" --><!-- /TMPL_IF -->
                                         <!-- TMPL_IF NAME="itemcallnumber" -->[<a href="/cgi-bin/koha/catalogue/search.pl?q=callnum:<!-- TMPL_VAR NAME="itemcallnumber" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="itemcallnumber" --></a>]<!-- /TMPL_IF -->
@@ -481,7 +481,7 @@ function GetZ3950Terms(){
                                    <span class="status"><!-- TMPL_IF NAME="onloancount" --><!-- TMPL_VAR NAME="onloancount" --><!-- /TMPL_IF --> on loan:</span>
                                     <ul>
                                     <!-- TMPL_LOOP NAME="onloan_items_loop" -->
-                                       <!-- TMPL_IF NAME="noItemTypeImages" --><li><!-- TMPL_ELSE --><!-- TMPL_IF NAME="item-level_itypes" -->
+                                       <!-- TMPL_IF NAME="noItemTypeImages" --><li><!-- TMPL_ELSE --><!-- TMPL_IF NAME="item_level_itypes" -->
                                         <!-- TMPL_IF name="imageurl" -->
                                         <li style="list-style: none; list-style-type: none;"><img src="<!-- TMPL_VAR name="imageurl" -->" title="<!-- TMPL_VAR name="description" -->" alt="<!-- TMPL_VAR name="description" -->" />
                                         <!-- TMPL_ELSE --><li><!-- /TMPL_IF -->
@@ -498,7 +498,7 @@ function GetZ3950Terms(){
                                     <span class="unavailable"><!-- TMPL_IF NAME="othercount" --><!-- TMPL_VAR NAME="othercount" --><!-- /TMPL_IF --> unavailable:</span>
                                     <ul>
                                     <!-- TMPL_LOOP NAME="other_items_loop" -->
-                                        <!-- TMPL_IF NAME="noItemTypeImages" --><li><!-- TMPL_ELSE --><!-- TMPL_IF NAME="item-level_itypes" -->
+                                        <!-- TMPL_IF NAME="noItemTypeImages" --><li><!-- TMPL_ELSE --><!-- TMPL_IF NAME="item_level_itypes" -->
                                         <!-- TMPL_IF name="imageurl" -->
                                         <li style="list-style: none; list-style-type: none;"><img src="<!-- TMPL_VAR name="imageurl" -->" title="<!-- TMPL_VAR name="description" -->" alt="<!-- TMPL_VAR name="description" -->" />
                                         <!-- TMPL_ELSE --><li><!-- /TMPL_IF -->
index b33f897..be98543 100644 (file)
         
         $('#header_search > ul').tabs().bind('show.ui-tabs', function(e, ui) { $('#header_search > div:not(.ui-tabs-hide)').find('input').eq(0).focus(); });
 
-function confirmnotdup(){
+function confirmnotdup(redirect){
        $("#confirm_not_duplicate").attr("value","1");
-       // alert(_("Not a duplicate confirmed. Please click on Add biblio to save the record"));
-       var checkform = $("#f");
-       Check(checkform);
+    $("#redirect").attr("value",redirect);
+       Check();
 }
 
 /**
  * 
  * 
  */
-function Check(dest){
+function Check(){
     var StrAlert = AreMandatoriesNotOk();
     if( ! StrAlert ){
         document.f.submit();
@@ -436,21 +435,14 @@ function CloneField(index) {
                             anchors[j].setAttribute('onclick',"CloneField('" + new_id + "')");
                         } else if (anchors[j].getAttribute('class') == 'buttonMinus') {
                             anchors[j].setAttribute('onclick',"UnCloneField('" + new_id + "')");
+                        } else if (anchors[j].getAttribute('class') == 'expandfield') {
+                            anchors[j].setAttribute('onclick',"ExpandField('" + new_id + "')");
                         }
                     }
                 }
                 catch(e){
                     // do nothig CloneButtonPlus doesn't exist.
                 }
-                // setting its 'Expand' property
-                var ExpandFieldA=0;
-                try {
-                    ExpandFieldA = divs[i].getElementsByTagName('a')[0];
-                    ExpandFieldA.setAttribute('onclick',"ExpandField('" + divs[i].parentNode.getAttribute('id') + "')");
-                }
-                catch(e){
-                    // do nothig if ButtonPlus & CloneButtonPlus don t exist.
-                }
 
             }
         }
@@ -656,12 +648,15 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
                     <div class="dialog alert">
                         <h4>Duplicate Record suspected</h4>
                         <p>Is this a duplicate of <a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=<!-- TMPL_VAR name="duplicatebiblionumber" -->" onclick="openWindow('../MARCdetail.pl?biblionumber=<!-- TMPL_VAR name="duplicatebiblionumber" -->&amp;popup=1', 'Duplicate biblio'; return false;)"><!-- TMPL_VAR name="duplicatetitle" --></a>?</p>
-                        <form action="/cgi-bin/koha/cataloguing/additem.pl" method="get">
-                            <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR name="duplicatebiblionumber" -->" />
-                            <input type="submit" class="edit" value="Yes: Edit existing items" />
-                        </form>
+                        <!-- TMPL_IF NAME="CAN_user_editcatalogue_edit_items" --><form action="/cgi-bin/koha/cataloguing/additem.pl" method="get">
+                                                    <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR name="duplicatebiblionumber" -->" />
+                                                    <input type="submit" class="edit" value="Yes: Edit existing items" />
+                                                </form><!-- TMPL_ELSE --><form action="/cgi-bin/koha/catalogue/detail.pl" method="get">
+                                                    <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR name="duplicatebiblionumber" -->" />
+                                                    <input type="submit" value="Yes: View existing items" />
+                                                </form><!-- /TMPL_IF -->
                         <form action="/cgi-bin/koha/cataloguing/addbiblio.pl" method="get">
-                            <input type="submit" class="save" onclick="confirmnotdup(); return false;" value="No: Save as New Record" />
+                        <!-- TMPL_IF NAME="CAN_user_editcatalogue_edit_items" --><input type="button" class="save" onclick="confirmnotdup('items'); return false;" value="No: Save as New Record" /><!-- TMPL_ELSE --><input type="button" class="save" onclick="confirmnotdup('view'); return false;" value="No: Save as New Record" /><!-- /TMPL_IF -->
                         </form>
                     </div>
         <!-- /TMPL_IF -->
@@ -675,7 +670,7 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
     </script>
 <!--TMPL_ELSE-->
     <form method="post" name="f" id="f" action="/cgi-bin/koha/cataloguing/addbiblio.pl" onsubmit="return Check();">
-    <input type="hidden" value="" id="redirect" name="redirect" />
+    <input type="hidden" value="<!-- tmpl_if name="biblionumber" -->view<!-- tmpl_else -->items<!-- /tmpl_if -->" id="redirect" name="redirect" />
        <input type="hidden" value="0" id="confirm_not_duplicate" name="confirm_not_duplicate" />
 <!-- /TMPL_IF -->
        
@@ -692,26 +687,25 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
            yuiToolbar();
         });
 
-    var onOption = function () {
-        return Check();
-    }
-
     function redirect(dest){
         $("#redirect").attr("value",dest);
         return Check();
     }
+<!-- TMPL_IF NAME="CAN_user_editcatalogue_edit_items" -->
+    var onOption = function () {
+        return Check();
+    }
 
     var savemenu = [
         { text: _("Save and view record"), value: 1, onclick: {fn:function(){redirect("view");}} },
         { text: _("Save and edit items"), value: 2, onclick: {fn:function(){redirect("items");}} }
     ];
-
+<!-- /TMPL_IF -->
 
        // YUI Toolbar Functions
 
        function yuiToolbar() {
-           // new YAHOO.widget.Button("addbiblio");
-
+<!-- TMPL_IF NAME="CAN_user_editcatalogue_edit_items" -->
         var savesplitmenu = new YAHOO.widget.Button({
             type: "split",
             label: _("Save"),
@@ -722,7 +716,15 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
          });
 
         savesplitmenu.on("click", onOption); 
-
+<!-- TMPL_ELSE -->
+        new YAHOO.widget.Button({
+            id: "addbiblio",
+            type: "button",
+            label: _("Save"),
+            container: "savebutton",
+            onclick: {fn:function(){redirect("view");}}
+        });
+<!-- /TMPL_IF -->
                new YAHOO.widget.Button({
             id: "z3950search",
             type: "button",
index d0be875..6a32740 100644 (file)
@@ -191,6 +191,7 @@ function set_to_today(id, force) {
 <!-- TMPL_IF NAME="no_next_barcode" --><div class="dialog alert"><strong>Error saving items</strong>: Unable to automatically determine values for barcodes. No item has been inserted.</div><!-- /TMPL_IF -->
 <!-- TMPL_IF NAME="book_on_loan" --><div class="dialog alert"><strong>Cannot Delete</strong>: item is checked out.</div><!-- /TMPL_IF -->
 <!-- TMPL_IF NAME="book_reserved" --><div class="dialogalert"><strong>Cannot Delete</strong>: item has a waiting hold.</div><!-- /TMPL_IF -->
+<!-- TMPL_IF Name="not_same_branch" --><div class="dialog alert"><strong>Cannot Delete</strong>: The items do not belong to your branch.</div><!-- /TMPL_IF -->
 
 <div id="cataloguing_additem_itemlist">
     <!-- TMPL_IF name="item_loop" -->
index 6230faa..b8c4869 100644 (file)
@@ -195,8 +195,8 @@ $(document).ready(function(){
     <fieldset class="rows">
        <legend>Merge reference</legend>
        <ol>
-       <li class="radio"><input type="radio" value="<!-- TMPL_VAR NAME="biblio1" -->" checked="checked" id="mergereference1" name="mergereference" /><label for="mergereference1"><!-- TMPL_VAR NAME="title1" --> (<!-- TMPL_VAR NAME="biblio1" -->)</label></li>
-       <li class="radio"><input type="radio" value="<!-- TMPL_VAR NAME="biblio2" -->" id="mergereference2" name="mergereference" /><label for="mergereference2"><!-- TMPL_VAR NAME="title2" --> (<!-- TMPL_VAR NAME="biblio2" -->)</label></li>
+       <li class="radio"><input type="radio" value="<!-- TMPL_VAR NAME="biblio1" -->" checked="checked" id="mergereference1" name="mergereference" /><label style="float:none" for="mergereference1"><!-- TMPL_VAR NAME="title1" --> (<!-- TMPL_VAR NAME="biblio1" -->)</label></li>
+       <li class="radio"><input type="radio" value="<!-- TMPL_VAR NAME="biblio2" -->" id="mergereference2" name="mergereference" /><label style="float:none" for="mergereference2"><!-- TMPL_VAR NAME="title2" --> (<!-- TMPL_VAR NAME="biblio2" -->)</label></li>
 </ol>
        <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR name="biblio1" -->" />
        <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR name="biblio2" -->" />
@@ -254,6 +254,7 @@ $(document).ready(function(){
                <!-- /TMPL_LOOP -->
                </ul>
            </div><!-- /div.record -->
+<!-- /TMPL_IF -->
     </div><!-- /div#tabrecord1 -->
     <div id="tabrecord2">
        <!-- TMPL_IF name="record2" -->
index 8458208..fb14577 100644 (file)
 
 <h1>Circulation: Overdues at <!-- TMPL_VAR NAME="LoginBranchname" --></h1>
 
-<!-- selector of location -->
-<!-- TMPL_IF NAME="location" -->
-<h4>Location selected</h4>
-<form name="changelocation" action="branchoverdues.pl">
-    <ul>
-        <li>
-            You are working actually on the overdues for the location : <b><!-- TMPL_VAR NAME="location" --></b>
-    <input type="submit" name="changelocation" class="submit" value="change location" />
-        </li>
-    </ul>
-</form>
-<!-- TMPL_ELSE -->
 <form name="selectlocation" action="branchoverdues.pl" method="post">
-    <label for="location">Select a location: </label><select id="location" name="location">
-        <option value="">All locations</option>
+    <label for="location">Shelving location selected: </label><select id="location" name="location">
+        <option value="">All shelving locations</option>
         <!-- TMPL_LOOP NAME="locationsloop" -->
-            <option value="<!-- TMPL_VAR NAME="authorised_value" -->"><!-- TMPL_VAR NAME="lib" --></option>
+            <!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="authorised_value" -->" selected="selected"><!-- TMPL_VAR NAME="lib" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR NAME="authorised_value" -->"><!-- TMPL_VAR NAME="lib" --></option><!-- /TMPL_IF -->
         <!-- /TMPL_LOOP -->
     </select>
     <input type="submit" name="location" class="submit" value="OK" />
 </form>
 
-<!-- /TMPL_IF -->
     <!-- TMPL_IF name="overduesloop" -->
         <table style="width:100%;">
         <tr>
                         <!-- TMPL_VAR NAME="date_due" -->
                     </td>
                     <td>
-                    <!-- TMPL_INCLUDE NAME="biblio-default-view.inc" -->
-                            &nbsp; (<b><!-- TMPL_VAR NAME="description" --></b>)
+                    <!-- TMPL_INCLUDE NAME="biblio-default-view.inc" --><!-- TMPL_VAR NAME="title" escape="html" --> <!-- TMPL_IF NAME="subtitle" --><!-- TMPL_VAR NAME="subtitle" --><!-- /TMPL_IF --></a> <!-- TMPL_IF NAME="author" --> by <!-- TMPL_VAR NAME="author" --><!-- /TMPL_IF -->
+
                             <br />Barcode : <!-- TMPL_VAR NAME="barcode" -->
                     </td>
                     <td>
-                        <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!--TMPL_VAR Name="borrowernumber"-->"><!-- TMPL_VAR NAME="borrowersurname" --> &nbsp; <!-- TMPL_VAR NAME="borrowerfirstname" --></a><br /><!-- TMPL_VAR NAME="borrowerphone" --><br />
+                        <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!--TMPL_VAR Name="borrowernumber"-->"><!-- TMPL_VAR NAME="borrowersurname" -->, <!-- TMPL_VAR NAME="borrowerfirstname" --></a><br /><!-- TMPL_VAR NAME="borrowerphone" --><br />
                     <!-- TMPL_IF NAME="borroweremail" --><a href="mailto:<!-- TMPL_VAR NAME="borroweremail" -->?subject=Overdue: <!-- TMPL_VAR NAME="title" ESCAPE="html" -->">
                     <!-- TMPL_VAR NAME="borroweremail" --></a><!--/TMPL_IF-->
                     </td>
             <!-- /TMPL_LOOP -->
         </table>
     <!-- TMPL_ELSE -->
-        <div class="dialog message">There are no overdues for today.</div>
+        <div class="dialog message">There are no overdues for today<!-- TMPL_IF NAME="location" --> at the selected location<!-- /TMPL_IF -->.</div>
     <!-- /TMPL_IF -->
     <!-- TMPL_IF name="todayoverduesloop" -->
         <div id="branch_odues_today_odues">
index 71b19f0..df78c54 100644 (file)
@@ -301,6 +301,11 @@ function refocus(calendar) {
 
         <!-- TMPL_IF NAME="UNKNOWN_BARCODE" -->
             <li>The barcode was not found <!-- TMPL_VAR NAME="barcode" --></li>
+           <!-- TMPL_IF NAME="fast_cataloging" -->
+               <!-- TMPL_IF NAME="CAN_user_editcatalogue_fast_cataloging" -->
+                    <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=FA">Fast cataloging</a></li>
+               <!-- /TMPL_IF -->
+           <!-- /TMPL_IF -->
         <!-- /TMPL_IF -->
 
         <!-- TMPL_IF NAME="NOT_FOR_LOAN" -->
@@ -647,7 +652,9 @@ No patron matched <span class="ex"><!-- TMPL_VAR name="message" --></span>
     <!-- TMPL_ELSE -->
     <tr class="highlight">
     <!-- /TMPL_IF -->
-        <td><!-- TMPL_VAR NAME="dd" --></td>
+        <!-- TMPL_IF NAME="od" --><td class="od"><!-- TMPL_ELSE --><td><!-- /TMPL_IF -->
+        <!-- TMPL_VAR NAME="dd" -->
+        </td>
         <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;type=intra"><strong><!-- TMPL_VAR NAME="title" escape="html" --></strong></a><!-- TMPL_IF NAME="author" -->, by <!-- TMPL_VAR NAME="author" --><!-- /TMPL_IF --><!-- TMPL_IF NAME="itemnotes" -->- <span class="circ-hlt"><!-- TMPL_VAR name="itemnotes" --></span><!-- /TMPL_IF --> <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;itemnumber=<!-- TMPL_VAR NAME="itemnumber" -->#item<!-- TMPL_VAR NAME="itemnumber" -->"><!-- TMPL_VAR NAME="barcode" --></a></td>
         <td><!-- TMPL_UNLESS NAME="noItemTypeImages" --> <!-- TMPL_IF NAME="itemtype_image" --><img src="<!-- TMPL_VAR NAME="itemtype_image" -->" alt="" /><!-- /TMPL_IF --><!-- /TMPL_UNLESS --><!-- TMPL_VAR NAME="itemtype" --></td>
         <td><!-- TMPL_VAR NAME="checkoutdate" --></td>
index ba8d117..724a3e9 100644 (file)
@@ -58,6 +58,15 @@ function Dopop(link) {
        <div class="dialog message">This item is part of a Rotating Collection and needs to be Transferred to <!-- TMPL_VAR NAME="collectionBranch" --></div>
 <!-- /TMPL_IF -->
 
+<!-- Patron has fines -->
+<!-- TMPL_IF NAME="fines" -->
+    <div class="dialog alert">
+        <h3>Patron has outstanding fines of <!-- TMPL_VAR NAME="fines" -->.</h3>
+        <p><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=<!-- TMPL_VAR NAME="fineborrowernumber" -->">Make payment</a>.</p>
+    </div>
+<!-- /TMPL_IF -->
+
+
 <!-- TMPL_IF NAME="wrongbranch" -->
 <div class="dialog alert"><h3>Cannot Check In</h3><p>This item must be checked in at its home library. <strong>NOT CHECKED IN</strong></p>
 </div>
index b9bd702..e001d29 100644 (file)
@@ -13,7 +13,7 @@ $.tablesorter.addParser({
 $(document).ready(function() {
     <!-- TMPL_LOOP NAME="branchesloop" -->
     $.tablesorter.defaults.widgets = ['zebra'];
-    $("#transferst<!-- TMPL_VAR NAME="branchcode" -->").tablesorter({<!-- TMPL_IF ="dateformat_metric" -->
+    $("#transferst<!-- TMPL_VAR NAME="branchcode" -->").tablesorter({<!-- TMPL_IF NAME="dateformat_metric" -->
         dateFormat: 'uk',<!-- /TMPL_IF -->
         sortList: [[0,0]],
         headers: { 1: { sorter: 'articles' }}
index 6587457..e25c491 100644 (file)
@@ -116,6 +116,7 @@ $.tablesorter.addParser({
         <!-- /TMPL_IF -->
         </div>
         <div id="holdsover">
+                <p>Holds listed here have been awaiting pickup for more than <!-- TMPL_VAR NAME="ReservesMaxPickUpDelay" --> days.</p>
                 <!-- TMPL_IF NAME="overloop" -->
                <table id="holdso">
                <thead><tr>
@@ -130,7 +131,7 @@ $.tablesorter.addParser({
                         <td><p><!-- TMPL_VAR NAME="waitingdate" --></p></td>
                         <td><!-- TMPL_INCLUDE NAME="biblio-default-view.inc" --><!-- TMPL_VAR NAME="title" escape="html" --> <!-- TMPL_VAR NAME="subtitle" ESCAPE="html" -->
                         </a>
-                            &nbsp; (<b><!-- TMPL_VAR NAME="itemtype" --></b>)
+                            <!-- TMPL_UNLESS NAME="item_level_itypes" --><!-- TMPL_IF NAME="itemtype" -->&nbsp; (<b><!-- TMPL_VAR NAME="itemtype" --></b>)<!-- /TMPL_IF --><!-- /TMPL_UNLESS -->
                         <br />Barcode: <!-- TMPL_VAR NAME="barcode" -->
                     </td>
                     <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!--TMPL_VAR Name="borrowernum"-->"><!-- TMPL_VAR NAME="borrowername" -->, <!-- TMPL_VAR NAME="borrowerfirstname" --></a><br /><!-- TMPL_VAR NAME="borrowerphone" --><br />
index adcafbc..0187cf9 100644 (file)
@@ -114,7 +114,7 @@ to add to Batch <!-- TMPL_VAR NAME="batch_id" -->
         inputField     :    "dateto",
       ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
         button         :    "openCalendarTo",
-        align          :    "Tl",
+        align          :    "Tl"
     });
 </script>
 <div class="hint"><!-- TMPL_INCLUDE NAME="date-format.inc" --></div>
index 9597776..57785e2 100644 (file)
@@ -11,7 +11,7 @@
        <div id="yui-main">
        <div class="yui-b"><div class="yui-g">
 
-<!-- TMPL_IF NAME="allsub-p" -->
+<!-- TMPL_IF NAME="allsub_p" -->
 <table>
 <caption>Results</caption>
 <!-- TMPL_LOOP NAME="loop" -->
@@ -21,7 +21,7 @@
 <!-- /TMPL_IF -->
 
 
-<!-- TMPL_IF NAME="modsub-p" -->
+<!-- TMPL_IF NAME="modsub_p" -->
 <form action="/cgi-bin/koha/maint/catmaintain.pl" method="post">
 This will change the subject headings on <strong>all</strong> the records this subject is applied to.
 <table>
@@ -34,7 +34,7 @@ This will change the subject headings on <strong>all</strong> the records this s
 <!-- /TMPL_IF -->
 
 
-<!-- TMPL_IF NAME="upsub-p" -->
+<!-- TMPL_IF NAME="upsub_p" -->
 Successfully modified <!-- TMPL_VAR NAME="oldsub" ESCAPE="HTML" -->
 is now <!-- TMPL_VAR NAME="sub" ESCAPE="HTML" -->
 <!-- <![ IGNORE [
@@ -44,7 +44,7 @@ is now <!-- TMPL_VAR NAME="sub" ESCAPE="HTML" -->
 <!-- /TMPL_IF -->
 
 
-<!-- TMPL_IF NAME="undel-p" -->
+<!-- TMPL_IF NAME="undel_p" -->
 <table>
 <thead>
 <tr><th>Title</th><th>Author</th><th>Undelete</th></tr>
@@ -59,13 +59,13 @@ is now <!-- TMPL_VAR NAME="sub" ESCAPE="HTML" -->
 <!-- /TMPL_IF -->
 
 
-<!-- TMPL_IF NAME="finun-p" -->
+<!-- TMPL_IF NAME="finun_p" -->
 <h3>Successfully undeleted</h3>
 <p><a href="/cgi-bin/koha/maint/catmaintain.pl">Back to Catalog Maintenance</a></p>
 <!-- /TMPL_IF -->
 
 
-<!-- TMPL_IF NAME="fixitemtype-p" -->
+<!-- TMPL_IF NAME="fixitemtype_p" -->
 <form method="post" action="/cgi-bin/koha/maint/catmaintain.pl">
 <table>
 <tr><th scope="row"><label for="itemtype">Itemtype:</label></th><td><input type="hidden" name="bi" value="<!-- TMPL_VAR NAME="bi" ESCAPE="HTML">" />
@@ -77,13 +77,13 @@ is now <!-- TMPL_VAR NAME="sub" ESCAPE="HTML" -->
 <!-- /TMPL_IF -->
 
 
-<!-- TMPL_IF NAME="updatetype-p" -->
+<!-- TMPL_IF NAME="updatetype_p" -->
 <h3>Updated successfully</h3>
 <p><a href="/cgi-bin/koha/maint/catmaintain.pl">Back to Catalog Maintenance</a></p>
 <!-- /TMPL_IF -->
 
 
-<!-- TMPL_IF NAME="mainmenu-p" -->
+<!-- TMPL_IF NAME="mainmenu_p" -->
 
 <h1>Catalog Maintenance</h1>
 <form action="/cgi-bin/koha/maint/catmaintain.pl" method="post">
index fef7b69..50a73da 100644 (file)
 
                                <!-- TMPL_INCLUDE NAME="patron-toolbar.inc" -->
 
+       <!-- TMPL_IF NAME="no_add" --><div class="dialog alert"><h3>Cannot add patron</h3>
+               <!-- TMPL_IF NAME="no_branches" --><p>There are <strong>no libraries defined</strong>. <!-- TMPL_IF NAME="CAN_user_parameters" -->Please <a href="/cgi-bin/koha/admin/branches.pl">add a library</a>.<!-- TMPL_ELSE -->An administrator must define at least one library.<!-- /TMPL_IF --></p><!-- /TMPL_IF -->
+               <!-- TMPL_IF NAME="no_categories" --><p>There are <strong>no patron categories defined</strong>. <!-- TMPL_IF NAME="CAN_user_parameters" -->Please <a href="/cgi-bin/koha/admin/categorie.pl">add a patron category</a>.<!-- TMPL_ELSE -->An administrator must define at least one patron category.<!-- /TMPL_IF --></p><!-- /TMPL_IF --></div>
+       <!-- /TMPL_IF -->
+
                                                <div class="browse">
                                                        Browse by last name:
                                                        <!-- TMPL_LOOP name="letters" -->
index 4ecc0cb..a746307 100644 (file)
@@ -1,6 +1,6 @@
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
 <title>Koha &rsaquo; Patrons &rsaquo; 
-<!-- TMPL_IF NAME="opadd" -->  Add<!-- TMPL_ELSE --> Modify<!--/TMPL_IF--> <!--TMPL_IF Name="categoryname"--> <!--TMPL_VAR Name="categoryname"--> patron<!-- TMPL_ELSE --><!--TMPL_IF Name="I"--> Organization patron<!--/TMPL_IF --><!--TMPL_IF Name="A"--> Adult patron<!--/TMPL_IF --><!--TMPL_IF Name="C"--> Child patron<!--/TMPL_IF --><!--TMPL_IF Name="P"--> Professional patron<!--/TMPL_IF --><!--TMPL_IF Name="S"--> Staff patron<!--/TMPL_IF --><!--/TMPL_IF --><!--TMPL_UNLESS Name="opadd"--> <!-- TMPL_VAR NAME="surname" -->, <!-- TMPL_VAR name="firstname" --><!--/TMPL_UNLESS--></title>
+<!-- TMPL_IF NAME="opadd" -->Add<!-- TMPL_ELSE --> Modify<!--/TMPL_IF--> <!--TMPL_IF Name="categoryname"--> <!--TMPL_VAR Name="categoryname"--> patron<!-- TMPL_ELSE --><!--TMPL_IF Name="I"--> Organization patron<!--/TMPL_IF --><!--TMPL_IF Name="A"--> Adult patron<!--/TMPL_IF --><!--TMPL_IF Name="C"--> Child patron<!--/TMPL_IF --><!--TMPL_IF Name="P"--> Professional patron<!--/TMPL_IF --><!--TMPL_IF Name="S"--> Staff patron<!--/TMPL_IF --><!--/TMPL_IF --><!--TMPL_UNLESS Name="opadd"--> <!-- TMPL_VAR NAME="surname" -->, <!-- TMPL_VAR name="firstname" --><!--/TMPL_UNLESS--></title>
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
 <!-- TMPL_INCLUDE NAME="calendar.inc" -->
 <script type="text/JavaScript" language="JavaScript">
        <div id="yui-main">
        <div class="yui-b">
 
+       <!-- TMPL_IF NAME="no_add" --><div class="dialog alert"><h3>Cannot add patron</h3>
+               <!-- TMPL_IF NAME="no_branches" --><p>There are <strong>no libraries defined</strong>. <!-- TMPL_IF NAME="CAN_user_parameters" -->Please <a href="/cgi-bin/koha/admin/branches.pl">add a library</a>.<!-- TMPL_ELSE -->An administrator must define at least one library.<!-- /TMPL_IF --></p><!-- /TMPL_IF -->
+               <!-- TMPL_IF NAME="no_categories" --><p>There are <strong>no patron categories defined</strong>. <!-- TMPL_IF NAME="CAN_user_parameters" -->Please <a href="/cgi-bin/koha/admin/categorie.pl">add a patron category</a>.<!-- TMPL_ELSE -->An administrator must define at least one patron category.</p><!-- /TMPL_IF --><!-- /TMPL_IF --></div><!-- /TMPL_IF -->
 
+       <!-- TMPL_UNLESS NAME="no_add" -->
        <!-- TMPL_IF NAME="opadd" -->
        <h1>
                Add<!--TMPL_IF Name="categoryname"--> <!--TMPL_VAR Name="categoryname"--> patron<!-- TMPL_ELSE --><!--TMPL_IF Name="I"--> Organization patron<!--/TMPL_IF --><!--TMPL_IF Name="A"--> Adult patron<!--/TMPL_IF --><!--TMPL_IF Name="C"--> Child patron<!--/TMPL_IF --><!--TMPL_IF Name="P"--> Professional patron<!--/TMPL_IF --><!--TMPL_IF Name="S"--> Staff patron<!--/TMPL_IF --><!--/TMPL_IF --> <!-- TMPL_VAR name="firstname" --> <!-- TMPL_VAR NAME="surname" --> 
          <!-- TMPL_IF NAME="mandatorybranchcode" --><span class="required">Required</span><!-- /TMPL_IF -->
     </li>
     <li>
-    <!-- TMPL_IF NAME="typeloop" -->
         <label for="categorycode">Category: </label>
         <select id="categorycode" name="categorycode">
         <!-- TMPL_LOOP NAME="typeloop" -->
             <!-- /TMPL_LOOP -->
        <!-- /TMPL_LOOP -->
        </select>
-    <!-- TMPL_ELSE -->
-        <span class="problem">There is no category type to add <!--TMPL_IF Name="A"-->an Adult<!--/TMPL_IF--><!--TMPL_IF Name="C"-->a Child<!--/TMPL_IF--><!--TMPL_IF Name="I"-->an Institution<!--/TMPL_IF--><!--TMPL_IF Name="P"-->a Professional<!--/TMPL_IF--><!--TMPL_IF Name="S"-->a Staff Member<!--/TMPL_IF-->.</span>
-              <a href="/cgi-bin/koha/admin/categorie.pl">Please create one</a>
-    <!-- /TMPL_IF -->
     </li>
     <li>
       <!-- TMPL_IF NAME="mandatorysort1" -->
 <!-- TMPL_UNLESS NAME="opadd" --><div class="yui-b">
 <!-- TMPL_INCLUDE NAME="members-menu.inc" -->
 </div><!-- /TMPL_UNLESS -->
+<!-- /TMPL_UNLESS -->
 </div>
 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
 
index e395e3f..a45b8ff 100644 (file)
@@ -12,7 +12,8 @@
 
 <ul><li><!-- TMPL_VAR NAME="address" --><br /><!-- TMPL_VAR NAME="address2" --></li><li><!-- TMPL_VAR NAME="city" -->, <!-- TMPL_VAR NAME="zipcode" --></li>
 <li><!-- TMPL_IF NAME="phone" --><!-- TMPL_VAR NAME="phone" --><!-- TMPL_ELSE -->(no phone number on file)<!-- /TMPL_IF --></li>
-<li><!-- TMPL_IF NAME="email" --><!-- TMPL_VAR NAME="email" --><!-- TMPL_ELSE -->(no email on file)<!-- /TMPL_IF --></li>
+<li><!-- TMPL_IF NAME="email" --><!-- TMPL_VAR NAME="email" --><!-- TMPL_ELSE -->(no primary email on file)<!-- /TMPL_IF --></li>
+<!-- TMPL_IF NAME="emailpro" --><li><!-- TMPL_VAR NAME="emailpro" --></li><!-- /TMPL_IF -->
 </ul>
 
 <!-- TMPL_IF NAME="issueloop" -->
index 030c78a..2cdc13a 100644 (file)
@@ -320,6 +320,11 @@ function validate1(date) {
     
     <li><span class="label">Library: </span><!-- TMPL_VAR NAME="branchname" --></li>
 
+    <!-- TMPL_IF NAME="OPACPrivacy" --><li><span class="label">Privacy Pref:</span>
+         <!-- TMPL_IF NAME="privacy0" -->Forever<!-- /TMPL_IF -->
+         <!-- TMPL_IF NAME="privacy1" -->Default<!-- /TMPL_IF -->
+         <!-- TMPL_IF NAME="privacy2" -->Never<!-- /TMPL_IF -->
+    </li><!-- /TMPL_IF -->
     <!-- TMPL_IF NAME="sort1" --><li><span class="label">Sort field 1:</span><!-- TMPL_VAR NAME="lib1" --></li><!-- /TMPL_IF -->
     <!-- TMPL_IF NAME="sort2" --><li><span class="label">Sort field 2:</span><!-- TMPL_VAR NAME="lib2" --></li><!-- /TMPL_IF -->
     <li><span class="label">OPAC login: </span><!-- TMPL_VAR name="userid" --></li>
index aa1bf22..6d65063 100644 (file)
@@ -1,6 +1,21 @@
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
 <title>Reading Record for <!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" --></title>
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
+<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
+<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.pager.js"></script>
+<script type="text/javascript" id="js">$(document).ready(function() {
+       $.tablesorter.addParser({
+               id: 'articles',
+               is: function(s) {return false;  },
+               format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); },
+               type: 'text'
+       });
+       $.tablesorter.defaults.widgets = ['zebra'];
+       $("#table_readingrec").tablesorter({
+               sortList: [[8,1]],
+               headers: { 1: { sorter: 'articles' }}
+       }).tablesorterPager({container: $("#pagertable_readingrec"),positionFixed: false,size: 20});
+}); </script>
 </head>
 <body>
 <!-- TMPL_INCLUDE NAME="header.inc" -->
 <!-- TMPL_INCLUDE NAME="circ-toolbar.inc" -->
 <h1>Reading Record</h1>
 <form action="/cgi-bin/koha/members/readingrec.pl" method="get"><input type="hidden" name="borrowernumber" id="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->" /></form>
-<p><!-- TMPL_IF NAME="showfulllink" -->Showing All Items |
-       <a href="readingrec.pl?borrowernumber=<!-- TMPL_VAR name="borrowernumber" -->&amp;limit=50">Show Last 50 Items Only</a> <!-- TMPL_ELSE -->      Showing Last 50 Items | 
-       <a href="readingrec.pl?borrowernumber=<!-- TMPL_VAR name="borrowernumber" -->&amp;limit=full">Show All Items</a><!-- /TMPL_IF --></p>
-<table>
-<tr>
-    <th>
-        <a href="readingrec.pl?borrowernumber=<!-- TMPL_VAR name="borrowernumber" -->&amp;order=issuestimestamp&amp;limit=<!-- TMPL_VAR name="limit" -->">Date</a>
-    </th>
-       <th>
-               <a href="readingrec.pl?borrowernumber=<!-- TMPL_VAR name="borrowernumber" -->&amp;order=title&amp;limit=<!-- TMPL_VAR name="limit" -->">Title</a>
-       </th>
-       <th>
-               <a href="readingrec.pl?borrowernumber=<!-- TMPL_VAR name="borrowernumber" -->&amp;order=author&amp;limit=<!-- TMPL_VAR name="limit" -->">Author</a>
-       </th>
+
+<span id="pagertable_readingrec" class="pager">
+       <form class="formpager">&nbsp;<strong>page(s)</strong>&nbsp;:
+               <img src="<!-- TMPL_VAR name="interface" -->/prog/img/first.png" class="first"/>
+               <img src="<!-- TMPL_VAR name="interface" -->/prog/img/prev.png" class="prev"/>
+               <input type="text" size="5" class="pagedisplay"/>
+               <img src="<!-- TMPL_VAR name="interface" -->/prog/img/next.png" class="next"/>
+               <img src="<!-- TMPL_VAR name="interface" -->/prog/img/last.png" class="last"/>
+               , entries/page :
+               <select class="pagesize">
+                       <option value="10">10</option>
+                       <option selected="selected" value="20">20</option>
+                       <option value="30">30</option>
+                       <option value="40">40</option>
+                       <option value="50">50</option>
+                       <option value="100">100</option>
+               </select>
+       </form>
+</span>
+<table id="table_readingrec">
+<thead>
+    <th>Date</th>
+       <th>Title</th>
+       <th>Author</th>
        <th>Call No.</th>
        <th>Barcode</th>
        <th>Number of Renewals</th>
        <th>Checked out on</th>
        <th>Checked out from</th>
        <th>Date Due</th>
-       <th>
-               <a href="readingrec.pl?borrowernumber=<!-- TMPL_VAR name="borrowernumber" -->&amp;order=returndate%20DESC&amp;limit=<!-- TMPL_VAR name="limit" -->">Return Date</a>
-       </th>
-</tr>
+       <th>Return Date</th>
+</thead>
 <!-- TMPL_LOOP name="loop_reading" -->
-<!-- TMPL_UNLESS NAME="__odd__" -->
-    <!-- TMPL_IF NAME="returndate" --><tr class="highlight"><!-- TMPL_ELSE --><tr class="highlight onissue"><!-- /TMPL_IF -->
-<!-- TMPL_ELSE -->
     <!-- TMPL_IF NAME="returndate" --><tr><!-- TMPL_ELSE --><tr class="onissue"><!-- /TMPL_IF -->
-<!-- /TMPL_UNLESS -->
         <td>
             <!-- TMPL_VAR name="issuestimestamp" -->
         </td>
-        <td>
-            <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">
-                <!-- TMPL_VAR name="title" escape="html" -->
-            </a>
-        </td>
+        <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR name="title" escape="html" --></a></td>
 
         <td><!-- TMPL_VAR name="author" --></td>
 
index 225c4b3..53ff7b7 100644 (file)
@@ -307,7 +307,7 @@ function checkMultiHold() {
                                ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
                                button : "CalendarReserveDate",
                                disableFunc : validate1,
-                               dateStatusFunc : validate1,
+                               dateStatusFunc : validate1
                        }
                );
                //]]>
@@ -338,7 +338,7 @@ function checkMultiHold() {
                                ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
                                button : "CalendarExpirationDate",
                                disableFunc : validate1,
-                               dateStatusFunc : validate1,
+                               dateStatusFunc : validate1
                        }
                );
                //]]>
@@ -369,7 +369,7 @@ function checkMultiHold() {
         </fieldset>
         <!-- TMPL_LOOP name="bibitemloop" -->
           <ol>
-            <!-- TMPL_UNLESS NAME="item-level_itypes" -->
+            <!-- TMPL_UNLESS NAME="item_level_itypes" -->
               <li><span class="label">Item type:</span> <!-- TMPL_VAR NAME="description" --></li>
             <!-- /TMPL_UNLESS -->
 
@@ -380,7 +380,7 @@ function checkMultiHold() {
         <caption>Place a hold on a specific copy</caption>
                <tr>
             <th>Hold</th>
-            <!-- TMPL_IF NAME="item-level_itypes" -->
+            <!-- TMPL_IF NAME="item_level_itypes" -->
                 <th>Item type</th>
             <!-- /TMPL_IF -->
             <th>Barcode</th>
@@ -403,7 +403,7 @@ function checkMultiHold() {
                 <img src="/intranet-tmpl/<!-- TMPL_VAR NAME="theme" -->/img/famfamfam/silk/cross.png" alt="Cannot be put on hold" />
             <!-- /TMPL_IF -->
             </td>
-            <!-- TMPL_IF NAME="item-level_itypes" -->
+            <!-- TMPL_IF NAME="item_level_itypes" -->
                 <td>
                     <!-- TMPL_UNLESS NAME="noItemTypeImages" -->
                         <!-- TMPL_IF NAME="imageurl" --><img src="<!-- TMPL_VAR name="imageurl" -->" alt="" /> <br /> <!-- /TMPL_IF -->
@@ -468,7 +468,7 @@ function checkMultiHold() {
     <table id="requesttitles">
       <tr>
         <th>Title</th>
-        <!-- TMPL_UNLESS NAME="item-level_itypes" -->
+        <!-- TMPL_UNLESS NAME="item_level_itypes" -->
           <th>Item Type</th>
         <!-- /TMPL_UNLESS -->
         <th>Priority</th>
@@ -493,7 +493,7 @@ function checkMultiHold() {
               <span class="not_holdable" title="<!-- TMPL_VAR NAME="biblionumber" -->"></span>
             <!-- /TMPL_UNLESS -->
           </td>
-          <!-- TMPL_UNLESS NAME="item-level_itypes" -->
+          <!-- TMPL_UNLESS NAME="item_level_itypes" -->
             <td>
               <img src="<!-- TMPL_VAR name="imageurl" -->" alt="<!-- TMPL_VAR NAME="itypename" -->" title="<!-- TMPL_VAR NAME="itypename" -->" />
             </td>
@@ -639,7 +639,7 @@ function checkMultiHold() {
                 <!-- TMPL_IF name="found" -->
                 Item waiting at <b> <!-- TMPL_VAR NAME="wbrname" --></b> <input type="hidden" name="pickup" value="<!-- TMPL_VAR NAME="wbrcode" -->" />
             <!-- TMPL_ELSE -->
-                Waiting to be pulled
+                Waiting to be pulled <input type="hidden" name="pickup" value="<!-- TMPL_VAR NAME="wbrcode" -->" />
             <!-- /TMPL_IF -->
           <!-- TMPL_ELSE -->
             Item being transferred to <b> <!-- TMPL_VAR NAME="wbrname" --></b> <input type="hidden" name="pickup" value="<!-- TMPL_VAR NAME="wbrcode" -->" />
index f87aef1..a2f78ab 100644 (file)
@@ -60,7 +60,7 @@
                  {
                                        button : "openCalendar",
                      inputField : "date",
-                     ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
+                     ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->"
                  }
                 );
             </script> <span class="required">Required</span>
index d55ec74..3180337 100644 (file)
@@ -4,7 +4,10 @@
 
 <style type="text/css">
    #custom-doc { width:38.46em;*width:37.53em;min-width:500px; margin:auto; text-align:left; }
-   </style>
+</style>
+<style type="text/css" media="print">
+   .yui-t7, #custom-doc { min-width:0; width:auto; }
+</style>
 </head>
 <body>
 
@@ -25,7 +28,7 @@
 </table>
 <p><b>Notes:</b> Please return this item promptly as others are waiting for it.
 <br /><!-- TMPL_VAR NAME="routingnotes" --></p>
-   <div id="slip-block-links">
+   <div id="slip-block-links" class="noprint">
    <a class="button" href="javascript:window.print();self.close()">Print</a> &nbsp; <a class="button" href="javascript:self.close()">Close</a>
    </div>
 
index d1f32ce..0b4e351 100644 (file)
@@ -270,7 +270,7 @@ h4.collapse a { font-size : 80%; text-decoration: none; } fieldset.brief ol { di
                         <!--/TMPL_LOOP-->
                     <option value="other">Others...</option>
                     </select>   <span id="other_reason<!-- TMPL_VAR NAME="suggestiontype" -->">
-            <input type="text" size="31" id="select-other_reason<!-- TMPL_VAR NAME="suggestiontype" -->" name="other_reason<!-- TMPL_VAR NAME="suggestiontype" -->" value=_("please note your reason here...") /> <a href="#back<!-- TMPL_VAR NAME="suggestiontype" -->">Cancel</a>
+            <input type="text" size="31" id="select-other_reason<!-- TMPL_VAR NAME="suggestiontype" -->" name="other_reason<!-- TMPL_VAR NAME="suggestiontype" -->" value="please note your reason here..." /> <a href="#back<!-- TMPL_VAR NAME="suggestiontype" -->">Cancel</a>
         </span> <strong style="padding: 0 1em;">OR:</strong> <label for="<!-- TMPL_VAR NAME="suggestiontype" -->delete">Delete selected</label> <input type="checkbox" name="op" id="<!-- TMPL_VAR NAME="suggestiontype" -->delete" />
         </div>
         </div>
index ad2f360..3f8254d 100644 (file)
@@ -273,8 +273,8 @@ td input,td input[type="submit"] { font-size: 85%; padding: 1px; }
   <span id="terms_summary_status">&nbsp;</span>
   </fieldset>
   <fieldset class="brief">
-   <h4>Test Blacklist</h4>
-   <div class="description">Enter a word or phrase here to test against your whitelist/blacklist: </div>
+   <h4>Check lists</h4>
+   <div class="description">Enter a word or phrase to check against approved/rejected lists: </div>
    <form method="post" action="/cgi-bin/koha/tags/review.pl">
    <input type="text" size="14" name="test" id="test" />
    <fieldset class="action"><input type="submit" value="Test" id="test_button" name="op" /></fieldset>
index 3259497..331ec2c 100644 (file)
@@ -64,7 +64,7 @@
                 Calendar.setup(
                  {
                      inputField : "date1",
-                     ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
+                     ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->"
                  }
                 );
             </script> <span class="hint"><!-- TMPL_INCLUDE NAME="date-format.inc" --></span></p>
@@ -76,7 +76,7 @@
                 Calendar.setup(
                  {
                      inputField : "date2",
-                     ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
+                     ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->"
                  }
                 );
             </script> <span class="hint"><!-- TMPL_INCLUDE NAME="date-format.inc" --></span></p>
index 38b12dd..cc501b4 100644 (file)
@@ -6,8 +6,7 @@
 <script language="JavaScript" type="text/javascript">
 //<![CDATA[
 
-       var weekdays = new Array("Sundays", "Mondays", "Tuesdays",
-                       "Wednesdays", "Thursdays", "Fridays", "Saturdays");
+       var weekdays = new Array(_("Sundays"),_("Mondays"),_("Tuesdays"),_("Wednesdays"),_("Thursdays"),_("Fridays"),_("Saturdays"));
 
        function holidayOperation(formObject, opType) {
                var op = document.getElementsByName('operation');
index 0b35000..480441d 100644 (file)
@@ -76,6 +76,10 @@ $(document).ready(function(){
         <fieldset class="rows">
         <legend>Select items you want to check</legend>
         <ol><li>
+        <label for="branch">Branch</label>
+            <input type="radio" name="branch" value="homebranch">Home Branch</input>
+            <input type="radio" name="branch" value="holdingbranch">Holding Branch</input>
+        </li><li>
         <label for="branchloop">Library</label><select id="branchloop" name="branchcode" style="width:12em;">
             <option value="">All Locations</option>
         <!-- TMPL_LOOP NAME="branchloop" -->
@@ -228,6 +232,7 @@ $(document).ready(function(){
     </form>
     <!-- TMPL_IF NAME="offset" -->
     <form method="post" action="/cgi-bin/koha/tools/inventory.pl">
+        <input type="hidden" name="branch" value="<!-- TMPL_VAR NAME="branch" -->" />
         <input type="hidden" name="minlocation" value="<!-- TMPL_VAR NAME="minlocation" -->" />
         <input type="hidden" name="maxlocation" value="<!-- TMPL_VAR NAME="maxlocation" -->" />
         <input type="hidden" name="location" value="<!-- TMPL_VAR NAME="location" -->" />
@@ -241,6 +246,7 @@ $(document).ready(function(){
     <!-- /TMPL_IF -->
     <!-- TMPL_IF NAME="nextoffset" -->
     <form method="post">
+        <input type="hidden" name="branch" value="<!-- TMPL_VAR NAME="branch" -->" />
         <input type="hidden" name="location" value="<!-- TMPL_VAR NAME="location" -->" />
         <input type="hidden" name="branchcode" value="<!-- TMPL_VAR NAME="branchcode" -->" />
         <input type="hidden" name="minlocation" value="<!-- TMPL_VAR NAME="minlocation" -->" />
index 342e51b..9ce264c 100644 (file)
@@ -74,7 +74,7 @@ Edit News Item<!-- TMPL_ELSE -->Add News Item<!-- /TMPL_IF --><!-- TMPL_ELSE -->
                     {
                         button : "timestampButton",
                         inputField : "timestamp",
-                        ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
+                        ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->"
                     }
                     );
                 </script>
@@ -89,7 +89,7 @@ Edit News Item<!-- TMPL_ELSE -->Add News Item<!-- /TMPL_IF --><!-- TMPL_ELSE -->
                     {
                         button : "openCalendar",
                         inputField : "expirationdate",
-                        ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
+                        ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->"
                     }
                     );
                 </script>
index 827f5be..6fb3efa 100644 (file)
@@ -170,7 +170,7 @@ function placeHold () {
     <table>
             <tr>
                 <!--TMPL_IF NAME="manageshelf" --><th class="checkall">&nbsp;</th><!-- /TMPL_IF -->
-                <!-- TMPL_UNLESS NAME="item-level_itypes" --><th>Item Type</th><!-- /TMPL_UNLESS -->
+                <!-- TMPL_UNLESS NAME="item_level_itypes" --><th>Item Type</th><!-- /TMPL_UNLESS -->
                 <th>Title</th>
                 <th>Author</th>
                 <th>Date Added</th>
@@ -192,7 +192,7 @@ function placeHold () {
                                <!-- /TMPL_IF -->
                        </td>
                        <!-- /TMPL_IF -->
-                       <!-- TMPL_UNLESS NAME="item-level_itypes" --><td>
+                       <!-- TMPL_UNLESS NAME="item_level_itypes" --><td>
                 <!-- TMPL_UNLESS NAME="noItemTypeImages" --><img src="<!-- TMPL_VAR NAME="imageurl" -->" alt="<!-- TMPL_VAR NAME="description" -->" title="<!-- TMPL_VAR NAME="description" -->" /><!-- /TMPL_UNLESS --><!-- TMPL_VAR NAME="description" -->
                        </td><!-- /TMPL_UNLESS -->
                        <td>
index edaf280..e3009d8 100644 (file)
             </h5>
         </xsl:if>
 
-        <xsl:choose>
-        <xsl:when test="marc:datafield[@tag=100] or marc:datafield[@tag=110] or marc:datafield[@tag=111] or marc:datafield[@tag=700] or marc:datafield[@tag=710] or marc:datafield[@tag=711]">
-        <h5 class="author">by
-        <xsl:for-each select="marc:datafield[@tag=100 or @tag=700]">
-        <a>
-        <xsl:choose>
-            <xsl:when test="marc:subfield[@code=9]">
-                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
-            </xsl:when>
-            <xsl:otherwise>
-            <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
-            </xsl:otherwise>
-        </xsl:choose>
-        <xsl:call-template name="nameABCDQ"/></a>
-        <xsl:choose>
-        <xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
-        </xsl:for-each>
-
-        <xsl:for-each select="marc:datafield[@tag=110 or @tag=710]">
-        <a>
-        <xsl:choose>
-            <xsl:when test="marc:subfield[@code=9]">
-                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
-            </xsl:when>
-            <xsl:otherwise>
-            <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>      
-            </xsl:otherwise>
-        </xsl:choose>
-        <xsl:call-template name="nameABCDN"/></a>
-        <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
-        </xsl:for-each>
-
-        <xsl:for-each select="marc:datafield[@tag=111 or @tag=711]">
-        <a>
-        <xsl:choose>
-            <xsl:when test="marc:subfield[@code=9]">
-                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
-            </xsl:when>
-            <xsl:otherwise>
-            <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
-            </xsl:otherwise>
-        </xsl:choose>
-        <xsl:call-template name="nameACDEQ"/></a>
-        <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
-
-        </xsl:for-each>
-        </h5>
-        </xsl:when>
-        </xsl:choose>
+        <!-- Author Statement -->
+        <xsl:call-template name="showAuthor"><xsl:with-param name="authorfield" select="marc:datafield[@tag=100 or @tag=110 or @tag=111]"/></xsl:call-template>
+        <xsl:call-template name="showAuthor"><xsl:with-param name="authorfield" select="marc:datafield[@tag=700 or @tag=710 or @tag=711]"/></xsl:call-template>
 
    <xsl:if test="$materialTypeCode!=''">
         <span class="results_summary"><span class="label">Type: </span>
         <!-- 780 -->
         <xsl:if test="marc:datafield[@tag=780]">
         <xsl:for-each select="marc:datafield[@tag=780]">
+        <xsl:if test="@ind1=0">
         <span class="results_summary">
         <xsl:choose>
         <xsl:when test="@ind2=0">
             </xsl:choose>
         </span>
  
-        <xsl:choose>
-        <xsl:when test="@ind1=0">
+        <xsl:if test="marc:subfield[@code='n']">
             <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
-        </xsl:when>
-        </xsl:choose>
+        </xsl:if>
 
+        </xsl:if>
         </xsl:for-each>
         </xsl:if>
 
         <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
     </xsl:template>
 
+    <xsl:template name="showAuthor">
+       <xsl:param name="authorfield"/>
+       <xsl:if test="count($authorfield)&gt;0">
+        <h5 class="author">
+        <xsl:for-each select="$authorfield">
+        <xsl:choose>
+          <xsl:when test="position()&gt;1"/>
+          <xsl:when test="@tag&lt;700">Author(s): </xsl:when>
+          <xsl:otherwise>Additional author(s): </xsl:otherwise>
+        </xsl:choose>
+        <a>
+        <xsl:choose>
+            <xsl:when test="marc:subfield[@code=9]">
+                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
+            </xsl:when>
+            <xsl:otherwise>
+            <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
+            </xsl:otherwise>
+        </xsl:choose>
+       <xsl:choose>
+          <xsl:when test="@tag=100 or @tag=700"><xsl:call-template name="nameABCDQ"/></xsl:when>
+          <xsl:when test="@tag=110 or @tag=710"><xsl:call-template name="nameABCDN"/></xsl:when>
+          <xsl:when test="@tag=111 or @tag=711"><xsl:call-template name="nameACDEQ"/></xsl:when>
+       </xsl:choose>
+       <!-- add relator code too between brackets-->
+       <xsl:if test="marc:subfield[@code='4' or @code='e']">
+         <xsl:text>[</xsl:text>
+         <xsl:choose>
+           <xsl:when test="marc:subfield[@code=4]"><xsl:value-of select="marc:subfield[@code=4]"/></xsl:when>
+           <xsl:otherwise><xsl:value-of select="marc:subfield[@code='e']"/></xsl:otherwise>
+         </xsl:choose>
+         <xsl:text>]</xsl:text>
+       </xsl:if>
+       </a>
+        <xsl:choose>
+          <xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
+        </xsl:choose>
+        </xsl:for-each>
+        </h5>
+        </xsl:if>
+    </xsl:template>
+
 </xsl:stylesheet>
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/bd.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/bd.png
new file mode 100644 (file)
index 0000000..773a712
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/bd.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/cd.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/cd.png
new file mode 100644 (file)
index 0000000..b29e4f5
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/cd.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/cdrom.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/cdrom.png
new file mode 100644 (file)
index 0000000..25957ea
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/cdrom.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/dossier_de_presse.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/dossier_de_presse.png
new file mode 100644 (file)
index 0000000..8a13696
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/dossier_de_presse.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/dvd.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/dvd.png
new file mode 100644 (file)
index 0000000..585a2d3
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/dvd.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/dvd_musical.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/dvd_musical.png
new file mode 100644 (file)
index 0000000..f5941e2
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/dvd_musical.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/livre.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/livre.png
new file mode 100644 (file)
index 0000000..25dcb9c
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/livre.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/livre_ancien.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/livre_ancien.png
new file mode 100644 (file)
index 0000000..2ffdb2d
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/livre_ancien.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/livre_artiste.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/livre_artiste.png
new file mode 100644 (file)
index 0000000..39fedb4
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/livre_artiste.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/livre_audio.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/livre_audio.png
new file mode 100644 (file)
index 0000000..2da6a5a
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/livre_audio.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/livre_en_gros_caracteres.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/livre_en_gros_caracteres.png
new file mode 100644 (file)
index 0000000..a658285
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/livre_en_gros_caracteres.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/livre_multimedia.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/livre_multimedia.png
new file mode 100644 (file)
index 0000000..0a3e2cd
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/livre_multimedia.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/partition.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/partition.png
new file mode 100644 (file)
index 0000000..65bb645
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/partition.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/revue.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/revue.png
new file mode 100644 (file)
index 0000000..338df90
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/revue.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/vhs.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/vhs.png
new file mode 100644 (file)
index 0000000..0709532
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/carredart/vhs.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/addtocart.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/addtocart.png
new file mode 100644 (file)
index 0000000..8acaef1
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/addtocart.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/addtoshelf.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/addtoshelf.png
new file mode 100644 (file)
index 0000000..f07a0e8
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/addtoshelf.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/audiobook-cd.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/audiobook-cd.png
new file mode 100644 (file)
index 0000000..ba85607
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/audiobook-cd.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/audiobook.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/audiobook.png
new file mode 100644 (file)
index 0000000..eee19de
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/audiobook.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/beginner-reader.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/beginner-reader.png
new file mode 100644 (file)
index 0000000..4a8c3a1
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/beginner-reader.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/big-book-icon.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/big-book-icon.png
new file mode 100644 (file)
index 0000000..200bf08
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/big-book-icon.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-bag-icon.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-bag-icon.png
new file mode 100644 (file)
index 0000000..bc74205
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-bag-icon.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-author-search.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-author-search.png
new file mode 100644 (file)
index 0000000..e967455
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-author-search.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-biography.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-biography.png
new file mode 100644 (file)
index 0000000..4bcae4d
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-biography.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-mystery.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-mystery.png
new file mode 100644 (file)
index 0000000..5c4eea3
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-mystery.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-non-fiction.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-non-fiction.png
new file mode 100644 (file)
index 0000000..43be77f
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-non-fiction.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-sifi.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-sifi.png
new file mode 100644 (file)
index 0000000..4f43f7f
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-sifi.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-subject-search.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-subject-search.png
new file mode 100644 (file)
index 0000000..ed6dd10
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-subject-search.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-title-search.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-title-search.png
new file mode 100644 (file)
index 0000000..352d4b1
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-title-search.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-western.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-western.png
new file mode 100644 (file)
index 0000000..a9d4069
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon-western.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon.png
new file mode 100644 (file)
index 0000000..82bed33
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-icon.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-large-print.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-large-print.png
new file mode 100644 (file)
index 0000000..70d2725
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/book-large-print.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/card.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/card.png
new file mode 100644 (file)
index 0000000..202da49
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/card.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/cd-rom-icon.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/cd-rom-icon.png
new file mode 100644 (file)
index 0000000..8de1a50
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/cd-rom-icon.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/clear-book-bag.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/clear-book-bag.png
new file mode 100644 (file)
index 0000000..f9fbd9d
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/clear-book-bag.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/detail.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/detail.png
new file mode 100644 (file)
index 0000000..22c1242
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/detail.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/faculty-course-manual.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/faculty-course-manual.png
new file mode 100644 (file)
index 0000000..306b533
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/faculty-course-manual.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/icon-refrence.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/icon-refrence.png
new file mode 100644 (file)
index 0000000..475b8be
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/icon-refrence.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/keyword-search.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/keyword-search.png
new file mode 100644 (file)
index 0000000..3c21e57
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/keyword-search.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/music-cd.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/music-cd.png
new file mode 100644 (file)
index 0000000..9b415de
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/music-cd.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/newspaper-icon.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/newspaper-icon.png
new file mode 100644 (file)
index 0000000..1c454e0
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/newspaper-icon.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/videocassette.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/videocassette.png
new file mode 100644 (file)
index 0000000..c3a950e
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/videocassette.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/vynal-sound-recording.png b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/vynal-sound-recording.png
new file mode 100644 (file)
index 0000000..6ee36a6
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/liblime-kids/vynal-sound-recording.png differ
index beda270..d8a4423 100644 (file)
@@ -37,7 +37,6 @@
 
 <script type="text/javascript" language="javascript"
 <!-- TMPL_IF NAME="opacbookbag" -->src="<!-- TMPL_VAR NAME="themelang" -->/js/basket.js"><!-- TMPL_ELSIF NAME="virtualshelves" -->src="<!-- TMPL_VAR NAME="themelang" -->/js/basket.js"><!-- TMPL_ELSE -->>var readCookie;<!-- /TMPL_IF --></script>
-<!-- TMPL_IF NAME="opacuserlogin" --><!-- TMPL_IF NAME="TagsEnabled" --><script type="text/javascript" language="javascript" src="<!-- TMPL_VAR NAME="themelang" -->/js/tags.js"></script><!-- /TMPL_IF --><!-- TMPL_ELSE --><!-- /TMPL_IF -->
 <script type="text/javascript" language="javascript">
        //<![CDATA[
     <!-- TMPL_IF NAME="opacbookbag" -->var MSG_BASKET_EMPTY = _("Your cart is currently empty");
     var MSG_CONFIRM_DEL_RECORDS = _("Are you sure you want to remove the selected items?");
        $("#cartDetails").ready(function(){ $("#cmspan").html("<a href=\"#\" id=\"cartmenulink\" class=\"\"><i><\/i><span><i><\/i><span><\/span><img src=\"/opac-tmpl/prog/images/cart.gif\" width=\"14\" height=\"14\" alt=\"\" border=\"0\" /> "+_("Cart")+"<span id=\"basketcount\"><\/span><\/span><\/a>"); }); <!-- TMPL_ELSE --><!-- TMPL_IF NAME="virtualshelves" -->
     var MSG_NO_RECORD_SELECTED = _("No item was selected");<!-- /TMPL_IF --><!-- /TMPL_IF -->
+    <!-- TMPL_IF NAME="opacuserlogin" --><!-- TMPL_IF NAME="TagsEnabled" -->var MSG_TAGS_DISABLED = _("Sorry, tags are not enabled on this system.");
+    var MSG_TAG_ALL_BAD = _("Error! Your tag was entirely markup code.  It was NOT added.  Please try again with plain text.");
+    var MSG_ILLEGAL_PARAMETER = _("Error! Illegal parameter");
+    var MSG_TAG_SCRUBBED = _("Note: your tag contained markup code that was removed. The tag was added as ");
+    var MSG_ADD_TAG_FAILED = _("Error! The add_tag operation failed on");
+    var MSG_ADD_TAG_FAILED_NOTE = _("Note: you can only tag an item with a given term once.  Check 'My Tags' to see your current tags.");
+    var MSG_DELETE_TAG_FAILED = _("Error! You cannot delete the tag");
+    var MSG_DELETE_TAG_FAILED_NOTE = _("Note: you can only delete your own tags.")
+    var MSG_LOGIN_REQUIRED = _("You must be logged in to add tags.");
+    var MSG_TAGS_ADDED = _("Tags added: ");
+    var MSG_TAGS_DELETED = _("Tags added: ");
+    var MSG_TAGS_ERRORS = _("Errors: ");
+    var MSG_MULTI_ADD_TAG_FAILED = _("Unable to add one or more tags.");<!-- /TMPL_IF --><!-- /TMPL_IF -->
        <!-- TMPL_IF NAME="OPACAmazonCoverImages" -->$(window).load(function() {
                        verify_images();
                 });<!-- /TMPL_IF -->
@@ -61,7 +73,7 @@
        //]]>
 </script><script type="text/javascript" language="javascript"
 <!-- TMPL_IF NAME="opacbookbag" -->src="<!-- TMPL_VAR NAME="themelang" -->/js/basket.js"><!-- TMPL_ELSIF NAME="virtualshelves" -->src="<!-- TMPL_VAR NAME="themelang" -->/js/basket.js"><!-- TMPL_ELSE -->>var readCookie;<!-- /TMPL_IF --></script>
-<!-- TMPL_IF NAME="TagsEnabled" --><script type="text/javascript" language="javascript" src="<!-- TMPL_VAR NAME="themelang" -->/js/tags.js"></script><!-- /TMPL_IF -->
+<!-- TMPL_IF NAME="opacuserlogin" --><!-- TMPL_IF NAME="TagsEnabled" --><script type="text/javascript" language="javascript" src="<!-- TMPL_VAR NAME="themelang" -->/js/tags.js"></script><!-- /TMPL_IF --><!-- TMPL_ELSE --><!-- /TMPL_IF -->
 <!-- TMPL_IF NAME="GoogleJackets" -->
 <script type="text/javascript" language="javascript" src="<!-- TMPL_VAR NAME="themelang" -->/js/google-jackets.js"></script>
 <script type="text/javascript" language="javascript">
index 236f296..6db1552 100644 (file)
@@ -25,6 +25,8 @@
    <!-- /TMPL_IF --><a href="/cgi-bin/koha/opac-main.pl"><!-- TMPL_IF NAME="LibraryName" --><!-- TMPL_VAR NAME="LibraryName" --><!-- TMPL_ELSE -->Koha Online Catalog<!-- /TMPL_IF --></a></h1>
 
 <div id="fluid">
+
+<!-- TMPL_IF NAME="OpacPublic" -->
 <div id="fluid-offset">
 <!-- TMPL_UNLESS NAME="advsearch" --><form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform">
     <label for="masthead_search" class="left"> Search 
  </div>
 </div>
 
+<!-- /TMPL_IF -->  <!-- OpacPublic --> 
+
 <!-- TMPL_IF NAME="opacbookbag" --><div id="cartDetails">Your cart is empty.</div><!-- /TMPL_IF -->
 
 <!-- TMPL_IF NAME="virtualshelves" -->
index 20eba49..b96b8d3 100644 (file)
@@ -25,9 +25,9 @@
             </li>
             <li><label for="itemtype">Limit to: </label>
                     <select name="itemtype" id="itemtype" style="width: 10em;">
-                        <option value="">All item types</option>
+                        <!-- TMPL_IF NAME="ccodesearch" --><option value="">All collections</option><!-- TMPL_ELSE --><option value="">All item types</option><!-- /TMPL_IF -->
                         <!-- TMPL_LOOP name="itemtypeloop" -->
-                            <!-- TMPL_IF EXPR="itemtype eq description" --><option value="<!-- TMPL_VAR name="value" -->" selected="selected"><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR name="value" -->"><!-- /TMPL_IF -->
+                            <!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR name="value" -->" selected="selected"><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR name="value" -->"><!-- /TMPL_IF -->
                                 <!-- TMPL_VAR name="description" -->
                             </option>
                         <!-- /TMPL_LOOP -->
index b9e4f74..86ba2f6 100644 (file)
@@ -17,6 +17,9 @@
   <!-- /TMPL_IF -->
   <!-- TMPL_IF NAME="opacreadinghistory" -->
   <!-- TMPL_IF NAME="readingrecview" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a href="/cgi-bin/koha/opac-readingrecord.pl">my reading history</a></li>
+     <!-- TMPL_IF NAME="OPACPrivacy" -->
+       <!-- TMPL_IF NAME="privacyview" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a href="/cgi-bin/koha/opac-privacy.pl">my privacy</a></li>
+     <!-- /TMPL_IF -->
   <!-- /TMPL_IF -->
   <!-- TMPL_IF name="suggestion" -->
     <!-- TMPL_UNLESS NAME="AnonSuggestions" -->
index d7dc5de..cd85b18 100644 (file)
@@ -54,9 +54,9 @@ KOHA.Tags = {
        },
        common_status : function(addcount, delcount, errcount) {
            var cstat = "";
-           if (addcount && addcount > 0) {cstat += _("Added ")   + addcount + (addcount==1 ? _(" tag") : _(" tags")) + ".  " ;}
-           if (delcount && delcount > 0) {cstat += _("Deleted ") + delcount + (delcount==1 ? _(" tag") : _(" tags")) + ".  " ;}
-           if (errcount && errcount > 0) {cstat += (errcount==1 ? _("ERROR") : errcount + _(" ERRORS")) + _(" during operation.");}
+           if (addcount && addcount > 0) {cstat += MSG_TAGS_ADDED + addcount + ".  " ;}
+           if (delcount && delcount > 0) {cstat += MSG_TAGS_DELETED + delcount + ".  " ;}
+           if (errcount && errcount > 0) {cstat += MSG_TAGS_ERRORS + errcount + ". " ;}
            return cstat;
        },
        set_tag_status : function(tagid, newstatus) {
@@ -69,13 +69,13 @@ KOHA.Tags = {
        },
 
        tag_message: {
-       tagsdisabled : function(arg) {return (_("Sorry, tags are not enabled on this system."));},
-       scrubbed_all_bad : function(arg) {return (_("Error! Your tag was entirely markup code.  It was NOT added.  Please try again with plain text."));},
-       badparam : function(arg) {return (_("Error! Illegal parameter '" +arg+ "'."));},
-       scrubbed : function(arg) {return (_("Note: your tag contained markup code that was removed. The tag was added as '" +arg+ "'."));},
-    failed_add_tag : function(arg) {return (_("Error! The add_tag operation failed on '" +arg+ "'.  Note: you can only tag an item with a given term once.  Check 'My Tags' to see your current tags."));},
-    failed_delete  : function(arg) {return (_("Error! You cannot delete the tag '" +arg+ "'.  Note: you can only delete your own tags."));},
-       login : function(arg) {return (_("You must be logged in to add tags."));}
+       tagsdisabled : function(arg) {return (MSG_TAGS_DISABLED);},
+       scrubbed_all_bad : function(arg) {return (MSG_TAG_ALL_BAD);},
+       badparam : function(arg) {return (MSG_ILLEGAL_PARAMETER+" "+arg);},
+       scrubbed : function(arg) {return (MSG_TAG_SCRUBBED+" "+arg);},
+    failed_add_tag : function(arg) {return (MSG_ADD_TAG_FAILED+ " "+arg+" "+MSG_ADD_TAG_FAILED_NOTE);},
+    failed_delete  : function(arg) {return (MSG_DELETE_TAG_FAILED+ " "+arg+" "+MSG_DELETE_TAG_FAILED_NOTE);},
+       login : function(arg) {return (MSG_LOGIN_REQUIRED);}
        },
 
     // Used to tag multiple items at once.  The main difference
@@ -105,7 +105,7 @@ KOHA.Tags = {
                     if (response[bib]) {
                         var added = response[bib]["added"];
                         if (added > 0) {
-                            status = "Added " + added + (added == 1 ? " tag" : " tags") + ".  ";
+                            status = MSG_TAGS_ADDED + added + ".  ";
                                        KOHA.Tags.set_tag_status(mytagid + "_status", status);
                         }
 
@@ -115,7 +115,7 @@ KOHA.Tags = {
                             bibErrors = true;    
                             var errid = "tagerr_" + bib;
                             var errstat = "<a id=\"" + errid + "\" class=\"tagerror\" href=\"#\">";
-                            errstat += "Error" + (errors.length > 1 ? "s" : "") + " adding tag.";
+                            errstat += MSG_TAGS_ERRORS + errors.length + ". ";
                             errstat += "</a>";
                                            KOHA.Tags.append_tag_status(mytagid + "_status", errstat);
                             var errmsg = "";
@@ -135,7 +135,7 @@ KOHA.Tags = {
                 if (bibErrors || response["global_errors"]) {
                     var msg = "";
                     if (bibErrors) {
-                        msg = "Unable to add one or more tags.";
+                        msg = MSG_MULTI_ADD_TAG_FAILED;
                     }
 
                     // Show global errors in a dialog.
index 028ad4a..42dd9e3 100644 (file)
@@ -472,7 +472,7 @@ Calendar.calDragIt = function (ev) {
                posX = ev.pageX;
                posY = ev.pageY;
        }
-       cal.hideShowCovered();
+       // cal.hideShowCovered();
        var st = cal.element.style;
        st.left = (posX - cal.xOffs) + "px";
        st.top = (posY - cal.yOffs) + "px";
@@ -490,7 +490,7 @@ Calendar.calDragEnd = function (ev) {
                removeEvent(document, "mouseup", calDragEnd);
                tableMouseUp(ev);
        }
-       cal.hideShowCovered();
+       // cal.hideShowCovered();
 };
 
 Calendar.dayMouseDown = function(ev) {
@@ -1200,7 +1200,7 @@ Calendar.prototype.callCloseHandler = function () {
        if (this.onClose) {
                this.onClose(this);
        }
-       this.hideShowCovered();
+       // this.hideShowCovered();
 };
 
 /** Removes the calendar object from the DOM tree and destroys it. */
@@ -1258,7 +1258,7 @@ Calendar.prototype.show = function () {
                Calendar.addEvent(document, "keypress", Calendar._keyEvent);
                Calendar.addEvent(document, "mousedown", Calendar._checkCalendar);
        }
-       this.hideShowCovered();
+       // this.hideShowCovered();
 };
 
 /**
@@ -1273,7 +1273,7 @@ Calendar.prototype.hide = function () {
        }
        this.element.style.display = "none";
        this.hidden = true;
-       this.hideShowCovered();
+       // this.hideShowCovered();
 };
 
 /**
@@ -1463,7 +1463,7 @@ Calendar.prototype.parseDate = function (str, fmt) {
        }
 };
 
-Calendar.prototype.hideShowCovered = function () {
+/* Calendar.prototype.hideShowCovered = function () {
        var self = this;
        Calendar.continuation_for_the_fucking_khtml_browser = function() {
                function getVisib(obj){
@@ -1523,7 +1523,7 @@ Calendar.prototype.hideShowCovered = function () {
                setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()", 10);
        else
                Calendar.continuation_for_the_fucking_khtml_browser();
-};
+}; */
 
 /** Internal function; it displays the bar with the names of the weekday. */
 Calendar.prototype._displayWeekdays = function () {
index e7ec2f2..08fb3c3 100644 (file)
@@ -22,7 +22,7 @@
 </div>
 <!-- TMPL_IF NAME="OpacNav" -->
 <div class="yui-b">
-<div class="container">
+<div id="leftmenus" class="container">
 <!--TMPL_INCLUDE NAME="navigation.inc" -->
 </div>
 </div><!-- /TMPL_IF -->
index cd97560..4232a92 100644 (file)
@@ -23,7 +23,7 @@
 </div>
 <!-- TMPL_IF NAME="OpacNav" -->
 <div class="yui-b">
-<div class="container">
+<div id="leftmenus" class="container">
 <!--TMPL_INCLUDE NAME="navigation.inc" -->
 </div>
 </div><!-- /TMPL_IF -->
index 0035266..cef17ff 100644 (file)
@@ -22,7 +22,7 @@
 </div>
 <!-- TMPL_IF NAME="OpacNav" -->
 <div class="yui-b">
-<div class="container">
+<div id="leftmenus" class="container">
 <!--TMPL_INCLUDE NAME="navigation.inc" -->
 </div>
 </div><!-- /TMPL_IF -->
index f099511..f9ccf91 100644 (file)
@@ -22,7 +22,7 @@
 </div>
 <!-- TMPL_IF NAME="OpacNav" -->
 <div class="yui-b">
-<div class="container">
+<div id="leftmenus" class="container">
 <!--TMPL_INCLUDE NAME="navigation.inc" -->
 </div>
 </div><!-- /TMPL_IF -->
index 0f7472e..027c32a 100644 (file)
@@ -22,7 +22,7 @@
 </div>
 <!-- TMPL_IF NAME="OpacNav" -->
 <div class="yui-b">
-<div class="container">
+<div id="leftmenus" class="container">
 <!--TMPL_INCLUDE NAME="navigation.inc" -->
 </div>
 </div><!-- /TMPL_IF -->
index d45c5db..481b431 100644 (file)
@@ -22,7 +22,7 @@
 </div>
 <!-- TMPL_IF NAME="OpacNav" -->
 <div class="yui-b">
-<div class="container">
+<div id="leftmenus" class="container">
 <!--TMPL_INCLUDE NAME="navigation.inc" -->
 </div>
 </div><!-- /TMPL_IF -->
index dfe1495..9ffb236 100644 (file)
          </div></div>
        </div>
        <!-- TMPL_IF NAME="OpacNav" -->
-       <div class="yui-b"><div class="container">
+       <div class="yui-b"><div id="leftmenus" class="container">
        <!--TMPL_INCLUDE NAME="navigation.inc" -->
        </div></div>
        <!-- /TMPL_IF -->
index 0fa7474..25f9325 100644 (file)
@@ -7,7 +7,7 @@
 <!-- TMPL_INCLUDE name="masthead.inc" -->
 
 <div id="yui-g">
-<div class="container">
+<div id="kohaerrorcontainer" class="container">
 <div id="kohaerror">
 <div class="dialog message">
 <h3>An Error has Occurred</h3>
index 305dfce..b66870d 100644 (file)
@@ -33,7 +33,7 @@
     <div class="yui-b">
     <div id="opac-detail" class="yui-ge">
     <div class="yui-u first">
-    <div class="container">
+    <div id="userisbddetail" class="container">
     <div id="catalogue_detail_biblio">
        
      <h1 style="float:left;margin:0 1em 1em 0;">ISBD View</h1> <div id="views">
@@ -45,7 +45,7 @@
        </div>
        </div>
        <div class="yui-u">
-       <div class="container">
+       <div id="ulactioncontainer" class="container">
 <ul id="action">
 
 <!-- TMPL_UNLESS NAME="norequests" -->
index fba0c08..fad1371 100644 (file)
@@ -63,7 +63,7 @@ $(document).ready(function(){
     <div id="yui-main">
     <div class="yui-b"><div id="opac-detail" class="yui-ge">
     <div class="yui-u first">
-    <div class="container">
+    <div id="usermarcdetail" class="container">
     <div id="catalogue_detail_biblio">
 
     <h2 style="float:left;margin: 0 1em 1em 0;">MARC View</h2>
@@ -201,7 +201,7 @@ $(document).ready(function(){
     </div>
     </div>
     <div class="yui-u">
-    <div class="container">
+    <div id="ulactioncontainer" class="container">
 <ul id="action">
 
 <!-- TMPL_UNLESS NAME="norequests" -->
index 0b7f220..915a846 100644 (file)
@@ -8,7 +8,7 @@
 
        <div id="yui-main">
        <div class="yui-b"><div class="yui-g">
-               <div class="container">
+               <div id="useraccount" class="container">
 <!--CONTENT-->
     <!-- TMPL_LOOP NAME="BORROWER_INFO" -->
         <h3><a href="/cgi-bin/koha/opac-user.pl"><!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" -->'s account</a> <img src="<!-- TMPL_VAR NAME="themelang" -->../../images/caret.gif" width="16" height="16" alt="&gt;" border="0" /> Fines and Charges</h3>
 </div>
 </div>
 <div class="yui-b">
-<div class="container">
+<div id="leftmenus" class="container">
 <!--TMPL_INCLUDE NAME="navigation.inc" -->
 <!-- TMPL_INCLUDE name="usermenu.inc" -->
 </div>
 </div>
 </div>
-<!-- TMPL_INCLUDE NAME="opac-bottom.inc" -->
\ No newline at end of file
+<!-- TMPL_INCLUDE NAME="opac-bottom.inc" -->
index f85d914..745d19d 100644 (file)
@@ -7,7 +7,7 @@
 </head>
 <body id="addtolist">
 <div id="custom-doc" class="yui-t7">
-<div class="container">
+<div id="useraddbybiblionumber" class="container">
 <!-- TMPL_IF NAME="authorized" -->
        <!-- TMPL_UNLESS NAME="newshelf" -->
                <!-- TMPL_IF NAME="multiple"-->
index ec77493..3a478ff 100644 (file)
@@ -94,6 +94,7 @@
 <!-- TMPL_ELSE -->
             <option value="nb">ISBN</option>
 <!-- /TMPL_IF -->
+            <option value="bc">Barcode</option>
         </select>
         <input type="text" size="30" name="q" title="Enter search terms" value="" />
 <!-- TMPL_IF NAME="expanded_options" -->
index 66d9db6..b8721d5 100644 (file)
@@ -8,7 +8,7 @@
 <div id="bd">
     <div id="yui-main">
     <div class="yui-b">
-<div class="container">    <!-- TMPL_IF name="typeissue" -->
+<div id="useralertsubscribe" class="container">    <!-- TMPL_IF name="typeissue" -->
         <h1 class="catalogue">Subscribe issue receive warning</h1>
             <form action="opac-alert-subscribe.pl" method="post">
                 <p>Do you want to receive an email when a new issue for this subscription arrives?</p>
index 9657c87..bef863d 100644 (file)
@@ -19,7 +19,7 @@
 <!-- TMPL_INCLUDE name="masthead.inc" -->
 
        <div id="yui-g">
-<div class="container">
+<div id="userauth" class="container">
 <div id="opac-auth">
 <!--CONTENT-->
 <!-- TMPL_IF NAME="opacuserlogin" -->
index f0b4cf7..91a1412 100644 (file)
@@ -8,7 +8,7 @@
 
        <div id="yui-main">
        <div class="yui-b"><div class="yui-g">
-<div class="container">
+<div id="userauthhome" class="container">
 <form name="f" action="/cgi-bin/koha/opac-authorities-home.pl" method="get">
         <input type="hidden" name="op" value="do_search" />
         <input type="hidden" name="type" value="opac" />
@@ -74,7 +74,7 @@
 
 </div><!-- TMPL_IF NAME="OpacNav" -->
 <div class="yui-b">
-<div class="container">
+<div id="leftmenus" class="container">
 <!--TMPL_INCLUDE NAME="navigation.inc" -->
 </div>
 </div><!-- /TMPL_IF -->
index 5f41371..def5362 100644 (file)
@@ -33,7 +33,7 @@ function showChildren(mynumber) {
 <!-- TMPL_INCLUDE name="masthead.inc" -->
        <div id="yui-main">
        <div class="yui-b"><div class="yui-g">
-<div class="container">
+<div id="userauthdetails" class="container">
 
 <!-- TMPL_IF Name="displayhierarchy"-->
 
@@ -79,9 +79,9 @@ function showChildren(mynumber) {
 </div>
 <!-- TMPL_IF NAME="OpacNav" -->
 <div class="yui-b">
-<div class="container">
+<div id="leftmenus" class="container">
 <!--TMPL_INCLUDE NAME="navigation.inc" -->
 </div>
 </div><!-- /TMPL_IF -->
 </div>
-<!-- TMPL_INCLUDE NAME="opac-bottom.inc" -->
\ No newline at end of file
+<!-- TMPL_INCLUDE NAME="opac-bottom.inc" -->
index a87f162..e0c7564 100644 (file)
@@ -8,7 +8,7 @@
 
        <div id="yui-main">
        <div class="yui-b"><div class="yui-g">
-<div class="container">
+<div id="userauthsearchresults" class="container">
        <h1>Authority search results</h1>
        <div id="pages">
                        <!-- TMPL_IF name="displayprev" -->
@@ -85,7 +85,7 @@
 </div>
 <!-- TMPL_IF NAME="OpacNav" -->
 <div class="yui-b">
-<div class="container">
+<div id="leftmenus" class="container">
 <!--TMPL_INCLUDE NAME="navigation.inc" -->
 </div>
 </div><!-- /TMPL_IF -->
index b64205b..288f338 100644 (file)
@@ -117,7 +117,7 @@ function tagAdded() {
 <body id="basket">
 
 <div id="doc" class="yui-t7">
-<div class="container">
+<div id="userbasket" class="container">
 <h1>Your Cart</h1>
 
 <!-- TMPL_UNLESS NAME="print_basket" -->
index dfb4884..1686bf8 100644 (file)
@@ -8,7 +8,7 @@
 
        <div id="yui-main">
        <div class="yui-b"><div class="yui-g">
-<div class="container">
+<div id="userbrowser" class="container">
     <h1>Browse our catalogue</h1>
         <!-- TMPL_IF name="have_hierarchy" -->
         <ul>
@@ -48,7 +48,7 @@
 </div>
 <!-- TMPL_IF NAME="OpacNav" -->
 <div class="yui-b">
-<div class="container">
+<div id="leftmenus" class="container">
 <!--TMPL_INCLUDE NAME="navigation.inc" -->
 </div>
 </div><!-- /TMPL_IF -->
index 2af9584..5241d19 100644 (file)
@@ -58,7 +58,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
     <div id="yui-main">
     <div class="yui-b"><div id="opac-detail-yui-ge" class="yui-ge">
     <div class="yui-u first">
-    <div class="container">
+    <div id="userdetail" class="container">
     <div id="catalogue_detail_biblio">
 
     <div id="bookcover">
@@ -89,7 +89,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
     <div id="views"><span class="view"><span id="Normalview">Normal View</span></span> <span class="view"><a id="MARCview" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">MARC View</a></span> <!-- TMPL_IF NAME="ISBD" --><span class="view"><a id="ISBDview" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">ISBD View</a></span><!-- /TMPL_IF -->
     </div>
 
-    <span class="results_summary"><!-- TMPL_UNLESS NAME="item-level_itypes" -->
+    <span class="results_summary"><!-- TMPL_UNLESS NAME="item_level_itypes" -->
         [
         <!-- TMPL_IF name="description" -->
             <!-- TMPL_VAR NAME="description" -->
@@ -173,7 +173,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
     <!-- TMPL_IF name="copyrightdate" -->
     <span class="results_summary"><span class="label">Year: </span><!-- TMPL_VAR NAME="copyrightdate" --></span>
     <!-- /TMPL_IF -->
-    <!-- TMPL_UNLESS NAME="item-level_itypes" --><img src="<!-- TMPL_VAR NAME="imageurl" -->" alt="<!-- TMPL_VAR NAME="description" -->" title="<!-- TMPL_VAR NAME="description" -->" />
+    <!-- TMPL_UNLESS NAME="item_level_itypes" --><img src="<!-- TMPL_VAR NAME="imageurl" -->" alt="<!-- TMPL_VAR NAME="description" -->" title="<!-- TMPL_VAR NAME="description" -->" />
     <span class="results_summary"><span class="label">Item type: </span>
         <!-- TMPL_IF name="description" -->
         <!-- TMPL_VAR NAME="description" -->
@@ -306,7 +306,8 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
 
     <!-- TMPL_IF NAME="BakerTaylorContentURL" -->
         <span class="results_summary">
-        <span class="label">Enhanced Content:</span><!-- TMPL_IF NAME="OPACURLOpenInNewWindow" --><a href="<!-- TMPL_VAR NAME="BakerTaylorContentURL" ESCAPE="HTML" -->" target="_blank">Content Cafe</a><!-- TMPL_ELSE --><a href="<!-- TMPL_VAR NAME="BakerTaylorContentURL" ESCAPE="HTML" -->">Content Cafe</a><!-- /TMPL_IF -->
+        <span class="label">Enhanced Content: </span> 
+        <!-- TMPL_IF NAME="OPACURLOpenInNewWindow" --><a href="<!-- TMPL_VAR NAME="BakerTaylorContentURL" ESCAPE="HTML" -->" target="_blank">Content Cafe</a><!-- TMPL_ELSE --><a href="<!-- TMPL_VAR NAME="BakerTaylorContentURL" ESCAPE="HTML" -->">Content Cafe</a><!-- /TMPL_IF -->
         </span>
     <!-- /TMPL_IF -->
 </div>
@@ -383,11 +384,11 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
 <div id="holdings">
 <!-- TMPL_IF name="count" -->
     <!-- TMPL_IF name="lotsofitems" -->
-       <p>This record has many physical items. <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;viewallitems=1">Click here to view them all.</a></p>
+       <p>This record has many physical items. <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;viewallitems=1#holdings">Click here to view them all.</a></p>
     <!-- TMPL_ELSE -->
        <table id="holdingst">
            <thead><tr>
-               <!-- TMPL_IF NAME="item-level_itypes" --><th>Item type</th><!-- /TMPL_IF -->
+               <!-- TMPL_IF NAME="item_level_itypes" --><th>Item type</th><!-- /TMPL_IF -->
                <th>Location</th>
            <!-- TMPL_IF NAME="itemdata_ccode" --><th>Collection</th><!-- /TMPL_IF -->
            <th>Call Number</th>
@@ -399,10 +400,10 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
                <th>Date Due</th>
            </tr></thead>
            <tbody><!-- TMPL_LOOP NAME="ITEM_RESULTS" -->
-           <tr><!-- TMPL_IF NAME="item-level_itypes" --><td><!-- TMPL_UNLESS NAME="noItemTypeImages" --><!-- TMPL_IF NAME="imageurl" --><img src="<!-- TMPL_VAR NAME="imageurl" -->" title="<!-- TMPL_VAR NAME="description" -->" alt="<!-- TMPL_VAR NAME="description" -->" /><!-- /TMPL_IF --><!-- /TMPL_UNLESS --> <!-- TMPL_VAR NAME="description" --></td><!-- /TMPL_IF -->
+           <tr><!-- TMPL_IF NAME="item_level_itypes" --><td><!-- TMPL_UNLESS NAME="noItemTypeImages" --><!-- TMPL_IF NAME="imageurl" --><img src="<!-- TMPL_VAR NAME="imageurl" -->" title="<!-- TMPL_VAR NAME="description" -->" alt="<!-- TMPL_VAR NAME="description" -->" /><!-- /TMPL_IF --><!-- /TMPL_UNLESS --> <!-- TMPL_VAR NAME="description" --></td><!-- /TMPL_IF -->
                <td><!-- TMPL_UNLESS NAME="singleBranchMode" --><!-- TMPL_IF name="branchurl" --><a href="<!-- TMPL_VAR NAME="branchurl" -->"><!-- TMPL_VAR NAME="branchname" --></a><!-- TMPL_ELSE --><!-- TMPL_VAR NAME="branchname" --><!-- /TMPL_IF --><!-- /TMPL_UNLESS --> <span class="shelvingloc"><!-- TMPL_VAR NAME="location_description" --></span> </td>
                <!-- TMPL_IF NAME="itemdata_ccode" --><td><!-- TMPL_VAR NAME="ccode" --></td><!-- /TMPL_IF -->
-               <td><!-- TMPL_IF NAME="itemcallnumber" --> <!-- TMPL_VAR NAME="itemcallnumber" --><!-- TMPL_IF NAME="OPACShelfBrowser" -->(<a href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;shelfbrowse_itemnumber=<!-- TMPL_VAR NAME="itemnumber" -->#shelfbrowser">Browse Shelf</a>)<!-- /TMPL_IF --><!-- /TMPL_IF --></td>
+               <td><!-- TMPL_IF NAME="itemcallnumber" --> <!-- TMPL_VAR NAME="itemcallnumber" --><!-- TMPL_IF NAME="OPACShelfBrowser" --> (<a href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;shelfbrowse_itemnumber=<!-- TMPL_VAR NAME="itemnumber" -->#shelfbrowser">Browse Shelf</a>)<!-- /TMPL_IF --><!-- /TMPL_IF --></td>
                <!-- TMPL_IF NAME="itemdata_enumchron" --><td><!-- TMPL_VAR NAME="enumchron" --></td><!-- /TMPL_IF -->
                <!-- TMPL_IF NAME="itemdata_uri" --><td><a href="<!-- TMPL_VAR NAME="uri" -->"><!-- TMPL_VAR NAME="uri" --></a></td><!-- /TMPL_IF -->
                <!-- TMPL_IF NAME="itemdata_copynumber" --><td><!-- TMPL_VAR NAME="copynumber" --></td><!-- /TMPL_IF -->
@@ -422,7 +423,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
 
 <!-- TMPL_IF NAME="OpenOPACShelfBrowser" -->
 <div id="shelfbrowser">
-<h5 style="text-align: center;"><!-- TMPL_IF NAME="starting_homebranch" -->Browsing <!-- TMPL_VAR NAME="starting_homebranch" --> Shelves<!-- /TMPL_IF --><!-- TMPL_IF NAME="starting_location" -->, Shelving Location:</span><!-- TMPL_VAR NAME="starting_location" --> <!-- /TMPL_IF --> <a style="font-size: 75%;" href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Close Shelf Browser</a></h5>
+<h5 style="text-align: center;"><!-- TMPL_IF NAME="starting_homebranch" -->Browsing <!-- TMPL_VAR NAME="starting_homebranch" --> Shelves<!-- /TMPL_IF --><!-- TMPL_IF NAME="starting_location" -->, Shelving Location: <!-- TMPL_VAR NAME="starting_location" --><!-- /TMPL_IF --><!-- TMPL_IF name="starting_ccode" -->, Collection Code: <!-- TMPL_VAR name="starting_ccode" --><!-- /TMPL_IF --> <a style="font-size: 75%;" href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Close Shelf Browser</a></h5>
 
         
         <table><tr>
@@ -720,7 +721,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
 <!-- TMPL_ELSE --><span class="no-image">No cover image available</span><!-- /TMPL_IF --><!-- /TMPL_IF --><!-- /TMPL_IF -->
 
 </td>
-<!-- TMPL_UNLESS NAME="item-level_itypes" --><td><!-- TMPL_VAR NAME="description" --></td><!-- /TMPL_UNLESS --><td><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="title" escape="html" --></a><!-- TMPL_IF NAME="author" --> by <!-- TMPL_VAR NAME="author" ESCAPE="HTML" --><!-- /TMPL_IF --><!-- TMPL_IF NAME="copyrightdate" --> &copy;<!-- TMPL_VAR NAME="copyrightdate" --><!-- /TMPL_IF --><!-- TMPL_IF name="publishercode" -->
+<!-- TMPL_UNLESS NAME="item_level_itypes" --><td><!-- TMPL_VAR NAME="description" --></td><!-- /TMPL_UNLESS --><td><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="title" escape="html" --></a><!-- TMPL_IF NAME="author" --> by <!-- TMPL_VAR NAME="author" ESCAPE="HTML" --><!-- /TMPL_IF --><!-- TMPL_IF NAME="copyrightdate" --> &copy;<!-- TMPL_VAR NAME="copyrightdate" --><!-- /TMPL_IF --><!-- TMPL_IF name="publishercode" -->
     <p><!-- TMPL_VAR NAME="publishercode" ESCAPE="HTML" --> 
        <!-- TMPL_IF name="place" -->(<!-- TMPL_VAR NAME="place"-->)<!--/TMPL_IF--> <!-- TMPL_IF NAME="publicationyear" -->, <!-- TMPL_VAR NAME="publicationyear" --><!-- /TMPL_IF -->
         <!-- TMPL_IF NAME="pages" --><!-- TMPL_VAR NAME="pages" --> <!-- TMPL_VAR NAME="illus" --> <!-- TMPL_VAR NAME="size" --></p><!-- /TMPL_IF -->
@@ -780,7 +781,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
 </div>
 
 <div class="yui-u">
-<div class="container">
+<div id="ulactioncontainer" class="container">
 <ul id="action">
 
 <!-- TMPL_UNLESS NAME="norequests" -->
index 75adf24..8cb95da 100644 (file)
@@ -1,7 +1,7 @@
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><!-- TMPL_IF NAME="LibraryNameTitle" --><!-- TMPL_VAR NAME="LibraryNameTitle" --><!-- TMPL_ELSE -->Koha Online<!-- /TMPL_IF --> Catalog &rsaquo; Download cart<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
 </head>
 <body id="opac-downloadcart" style="padding:1em;">
-<div class="container"><!-- TMPL_IF NAME="format" -->
+<div id="userdownloadcart" class="container"><!-- TMPL_IF NAME="format" -->
     <p>Your download should begin automatically.</p>
 <!-- TMPL_ELSE -->
 <form method="post" action="/cgi-bin/koha/opac-downloadcart.pl">
index 1398cd0..607f1d4 100644 (file)
@@ -7,7 +7,7 @@
 </script>
 </head>
 <body id="opac-downloadlist" style="padding:1em;">
-<div class="container"><!-- TMPL_IF NAME="format" -->
+<div id="userdownloadshelf" class="container"><!-- TMPL_IF NAME="format" -->
     <p>Your download should begin automatically.</p>
 <!-- TMPL_ELSE -->
 <form method="post" action="/cgi-bin/koha/opac-downloadshelf.pl">
index 9995cc5..76c731b 100644 (file)
@@ -212,7 +212,7 @@ function showlayer(numlayer){
 </div>
 </div>
 <div class="yui-b">
-<div class="container">
+<div id="searchfacetscontainer" class="container">
 <div id="search-facets">
 <form action="opac-serial-issues.pl" id="filterform">
     <h4>Refine your search</h4>
index 0e0543c..1793a86 100644 (file)
       <!-- TMPL_ELSE -->
       <td>-</td>
       <!-- /TMPL_IF -->
-      <!-- TMPL_IF NAME="transport-sms" -->
+      <!-- TMPL_IF NAME="transport_sms" -->
       <!-- TMPL_IF NAME="SMSSendDriver" --><td><input type="checkbox"
                  id="sms<!-- TMPL_VAR NAME="message_attribute_id" -->"
                  name="<!-- TMPL_VAR NAME="message_attribute_id" -->"
-                 value="sms" <!-- TMPL_VAR NAME="transport-sms"   --> onclick = "document.opacmessaging.none<!-- TMPL_VAR NAME="message_attribute_id" -->.checked=false;" /></td><!-- /TMPL_IF -->
+                 value="sms" <!-- TMPL_VAR NAME="transport_sms"   --> onclick = "document.opacmessaging.none<!-- TMPL_VAR NAME="message_attribute_id" -->.checked=false;" /></td><!-- /TMPL_IF -->
       <!-- TMPL_ELSE -->
       <td>-</td>
       <!-- /TMPL_IF -->
 
-      <!-- TMPL_IF NAME="transport-email" -->
+      <!-- TMPL_IF NAME="transport_email" -->
       <td><input type="checkbox"
                  id="email<!-- TMPL_VAR NAME="message_attribute_id" -->"
                  name="<!-- TMPL_VAR NAME="message_attribute_id" -->"
-                 value="email"   <!-- TMPL_VAR NAME="transport-email"   --> onclick = "document.opacmessaging.none<!-- TMPL_VAR NAME="message_attribute_id" -->.checked=false;" />
+                 value="email"   <!-- TMPL_VAR NAME="transport_email"   --> onclick = "document.opacmessaging.none<!-- TMPL_VAR NAME="message_attribute_id" -->.checked=false;" />
       </td>
       <!-- TMPL_ELSE -->
       <td>-</td>
       <td>-</td>
       <!-- /TMPL_IF -->
 
-<!--       <!-- TMPL_IF NAME="transport-rss" -->
+<!--       <!-- TMPL_IF NAME="transport_rss" -->
       <td><input type="checkbox"
                  id="rss<!-- TMPL_VAR NAME="message_attribute_id" -->"
                  name="<!-- TMPL_VAR NAME="message_attribute_id" -->"
-                 value="rss"  <!-- TMPL_VAR NAME="transport-rss"   --> onclick = "document.opacmessaging.none<!-- TMPL_VAR NAME="message_attribute_id" -->.checked=false;" />
+                 value="rss"  <!-- TMPL_VAR NAME="transport_rss"   --> onclick = "document.opacmessaging.none<!-- TMPL_VAR NAME="message_attribute_id" -->.checked=false;" />
       </td>
       <!-- TMPL_ELSE -->
       <td>-</td>
 </div>
 </div>
 <div class="yui-b">
-<div class="container">
+<div id="leftmenus" class="container">
 <!--TMPL_INCLUDE NAME="navigation.inc" -->
 <!-- TMPL_INCLUDE name="usermenu.inc" -->
 </div>
index c50cf5c..37d7512 100644 (file)
@@ -8,7 +8,7 @@
 
        <div id="yui-main">
        <div class="yui-b"><div class="yui-g">
-       <div class="container">
+       <div id="userpasswd" class="container">
        <h3><a href="/cgi-bin/koha/opac-user.pl"><!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" -->'s account</a> <img src="<!-- TMPL_VAR NAME="themelang" -->l../../images/caret.gif" width="16" height="16" alt="&gt;" border="0" /> Change your Password </h3>
 
     <!-- TMPL_IF NAME= "Error_messages" -->
@@ -53,7 +53,7 @@
 </div>
 </div>
 <div class="yui-b">
-<div class="container">
+<div id="leftmenus" class="container">
 <!--TMPL_INCLUDE NAME="navigation.inc" -->
 <!-- TMPL_INCLUDE name="usermenu.inc" -->
 </div>
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-privacy.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-privacy.tmpl
new file mode 100644 (file)
index 0000000..4c9f0f8
--- /dev/null
@@ -0,0 +1,72 @@
+<!-- TMPL_INCLUDE name="doc-head-open.inc" --><!-- TMPL_IF NAME="LibraryNameTitle" --><!-- TMPL_VAR NAME="LibraryNameTitle" --><!-- TMPL_ELSE -->Koha Online<!-- /TMPL_IF --> Catalog &rsaquo; Privacy management for <!-- TMPL_VAR name="firstname" --> <!-- TMPL_VAR name="surname" -->
+<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
+</head>
+<body>
+<div id="doc3" class="yui-t1">
+   <div id="bd">
+<!-- TMPL_INCLUDE name="masthead.inc" -->
+
+       <div id="yui-main">
+       <div class="yui-b"><div class="yui-g">
+       <div id="userprivacy" class="container">
+       <h3><a href="/cgi-bin/koha/opac-user.pl"><!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" -->'s account</a> <img src="<!-- TMPL_VAR NAME="themelang" -->l../../images/caret.gif" width="16" height="16" alt="&gt;" border="0" /> Privacy policy </h3>
+
+    <!-- TMPL_IF name="deleted" -->
+        <div class="dialog message">Your reading history has been deleted.</div>
+    <!-- /TMPL_IF -->
+    <!-- TMPL_IF NAME= "privacy_updated" -->
+        <div class="dialog message">Your privacy rules have been updated</div>
+    <!-- /TMPL_IF -->
+
+    <h2>Privacy rule</h2>
+    <!-- TMPL_IF NAME= "Ask_data" -->
+               <p>We take great care in protecting your privacy. On this screen, you can define how long we keep your reading history.</p>
+               <p>Your options are: <p>
+               <form action="/cgi-bin/koha/opac-privacy.pl" method="post" id="opac-privacy-update-form">
+            <input type="hidden" name="op" value="update_privacy" />
+            <ul id="opac-privacy-options-list">
+                <li class="privacy0">Forever: keep my reading history without limit. This is the option for users who want to keep track of what they are reading.</li>
+                <li class="privacy1">Default: keep my reading history according to local laws. This is the default option : the library will keep your reading history for the duration permitted by local laws.</li>
+                <li class="privacy2">Never: Delete my reading history immediately. This will delete all record of the item that was checked-out upon check-in.</li>
+            </ul>
+            <p id="note1">Please note that information on any book still checked-out must be kept by the library no matter which privacy option you choose.</p>
+            <p id="note2">Please also note that the library staff can't update these values for you: it's your privacy!</p>
+            <label for:"privacy">Please choose your privacy rule:</label>
+            <select name="privacy">
+                <!-- TMPL_IF name="privacy0" -->
+                    <option value="0" selected="1" class="privacy0">Forever</option>
+                <!-- TMPL_ELSE -->
+                    <option value="0" class="privacy0">Forever</option>
+                <!-- /TMPL_IF -->
+                <!-- TMPL_IF name="privacy1" -->
+                    <option value="1" selected="1" class="privacy1">Default</option>
+                <!-- TMPL_ELSE -->
+                    <option value="1" class="privacy1">Default</option>
+                <!-- /TMPL_IF -->
+                <!-- TMPL_IF name="privacy2" -->
+                    <option value="2" selected="1" class="privacy2">Never</option>
+                <!-- TMPL_ELSE -->
+                    <option value="2" class="privacy2">Never</option>
+                <!-- /TMPL_IF -->
+            </select>
+            <input type="Submit" value="Submit" />
+        </form>
+        <h2>Immediate deletion</h2>
+        <form action="/cgi-bin/koha/opac-privacy.pl" method="post" id="opac-privacy-delete-form">
+            <input type="hidden" name="op" value="delete_record" />
+            <p>Whatever your privacy rule you choose, you can delete all your reading history immediately by clicking here. <b>BE CAREFUL</b>. Once you've confirmed the deletion, no one can retrieve the list!</p>
+            <input type="submit" value="Immediate deletion" onclick="return confirmDelete(_('Warning: Cannot be undone. Please confirm once again'));" />
+        </form>
+    <!-- /TMPL_IF -->
+    </div>
+</div>
+</div>
+</div>
+<div class="yui-b">
+<div id="leftmenus" class="container">
+<!--TMPL_INCLUDE NAME="navigation.inc" -->
+<!-- TMPL_INCLUDE name="usermenu.inc" -->
+</div>
+</div>
+</div>
+<!-- TMPL_INCLUDE NAME="opac-bottom.inc" -->
index 0b53ebd..a89c9a9 100644 (file)
@@ -20,7 +20,7 @@ $(document).ready(function(){
 
        <div id="yui-main">
        <div class="yui-b"><div class="yui-g">
-<div class="container">
+<div id="userreadingrecord" class="container">
 <!--CONTENT-->
 <h3><a href="/cgi-bin/koha/opac-user.pl"><!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" -->'s account</a> <img src="<!-- TMPL_VAR NAME="themelang" -->../../images/caret.gif" width="16" height="16" alt="&gt;" border="0" /> Checkout History</h3>
 
@@ -94,7 +94,7 @@ You have never borrowed anything from this library.
 </div>
 </div>
 <div class="yui-b">
-<div class="container">
+<div id="leftmenus" class="container">
 <!--TMPL_INCLUDE NAME="navigation.inc" -->
 <!-- TMPL_INCLUDE name="usermenu.inc" -->
 </div>
index 61a7bea..b727361 100644 (file)
                 <!-- TMPL_UNLESS NAME="none_available" --><tr>
                   <th>Hold</th>
                   <th>Title</th>
-                  <!-- TMPL_UNLESS NAME="item-level_itypes" -->
+                  <!-- TMPL_UNLESS NAME="item_level_itypes" -->
                     <th>Item Type</th>
                   <!-- /TMPL_UNLESS -->
                   <!-- TMPL_IF NAME="showpriority" -->
                         <!-- /TMPL_UNLESS -->
 
                     </td>
-                    <!-- TMPL_IF NAME="holdable" --><!-- TMPL_UNLESS NAME="item-level_itypes" -->
+                    <!-- TMPL_IF NAME="holdable" --><!-- TMPL_UNLESS NAME="item_level_itypes" -->
                                           <td>
                                             <!-- TMPL_IF NAME="imageurl" --><img src="<!-- TMPL_VAR NAME="imageurl" -->" alt="" /><!-- /TMPL_IF -->
                                 <!-- TMPL_VAR NAME="description" -->
                                           </td>
                                         <!-- /TMPL_UNLESS --><!-- /TMPL_IF -->
-                    <!-- TMPL_IF NAME="holdable" --><!-- TMPL_IF NAME="showpriority" --><td><!-- TMPL_VAR name="rank" --> out of <!-- TMPL_VAR NAME="reservecount" --></td><!-- /TMPL_IF --><!-- /TMPL_IF -->
+                    <!-- TMPL_IF NAME="holdable" -->
+                    <!-- TMPL_IF NAME="showpriority" -->
+                    <td>
+                    <!-- TMPL_VAR name="rank" --> out of <!-- TMPL_VAR NAME="reservecount" -->
+                    </td><!-- /TMPL_IF --><!-- /TMPL_IF -->
                    <!-- TMPL_IF NAME="reserve_in_future" -->
                    <!-- TMPL_IF NAME="holdable" --><td>
               <input name="reserve_date_<!-- TMPL_VAR NAME="biblionumber" -->" id="reserve_date_<!-- TMPL_VAR NAME="biblionumber" -->" size="10">
                 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
                 button : "CalendarReserveDate<!-- TMPL_VAR NAME="biblionumber" -->",
                 disableFunc : validate<!-- TMPL_VAR NAME="biblionumber" -->,
-                dateStatusFunc : validate<!-- TMPL_VAR NAME="biblionumber" -->,
+                dateStatusFunc : validate<!-- TMPL_VAR NAME="biblionumber" -->
               }
               );
               //]]>
           ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
           button : "CalendarExpirationDate_<!-- TMPL_VAR NAME="biblionumber" -->",
           disableFunc : validate1,
-          dateStatusFunc : validate1,
+          dateStatusFunc : validate1
         }
       );
       //]]>
                           <caption>Select a specific copy:</caption>
                           <tr>
                             <th>Copy</th>
-                            <!-- TMPL_IF NAME="item-level_itypes" -->
+                            <!-- TMPL_IF NAME="item_level_itypes" -->
                               <th>Item Type</th>
                             <!-- /TMPL_IF -->
                             <th>Barcode</th>
                                   <img src="/opac-tmpl/<!-- TMPL_VAR NAME="theme" -->/famfamfam/silk/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" />
                                 <!-- /TMPL_IF --> <!-- TMPL_IF NAME="copynumber" --><!-- TMPL_VAR NAME="copynumber" --><!-- /TMPL_IF -->
                               </td>
-                              <!-- TMPL_IF NAME="item-level_itypes" -->
+                              <!-- TMPL_IF NAME="item_level_itypes" -->
                                 <td>
                                   <!-- TMPL_UNLESS NAME="noItemTypeImages" -->
                                   <!-- TMPL_IF NAME="imageurl" --><img src="<!-- TMPL_VAR NAME="imageurl" -->" alt="" /><!-- /TMPL_IF -->
index 288392f..4920acb 100644 (file)
@@ -156,7 +156,9 @@ function highlightOn() {
                     <a href="/cgi-bin/koha/opac-search.pl?q=<!-- TMPL_VAR NAME="scan_use" escape="url" -->&quot;<!-- TMPL_VAR NAME="title" ESCAPE="url" -->&quot;"><!-- TMPL_VAR NAME="title" ESCAPE="html" --></a>
                 </td>
                 <td>
-                    <!-- TMPL_VAR NAME="subtitle" -->
+                    <!-- TMPL_LOOP NAME="subtitle" -->
+                      <!-- TMPL_VAR NAME="subfield" -->
+                    <!-- /TMPL_LOOP -->
                 </td>
             </tr>
             <!-- /TMPL_LOOP -->
@@ -208,11 +210,16 @@ function highlightOn() {
                         <!-- TMPL_VAR name="description" -->
                         <!-- /TMPL_IF -->
                     </td>
-                    <td><!-- TMPL_VAR NAME="result_number" -->. <!-- TMPL_IF name="BiblioDefaultViewmarc" --><a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->" title="View details for this title"><!-- TMPL_VAR NAME="title" --> <!-- TMPL_VAR NAME="subtitle" --></a>
+                    <td><!-- TMPL_VAR NAME="result_number" -->. <!-- TMPL_IF name="BiblioDefaultViewmarc" --><a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->" title="View details for this title"><!-- TMPL_VAR NAME="title" -->
                       <!-- TMPL_ELSE -->
-                      <!-- TMPL_IF name="BiblioDefaultViewisbd" --><a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->" title="View details for this title"><!-- TMPL_VAR NAME="title" --> <!-- TMPL_VAR NAME="subtitle" --></a>
-                      <!-- TMPL_ELSE --><a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->" title="View details for this title"><!-- TMPL_VAR NAME="title" --> <!-- TMPL_VAR NAME="subtitle" --></a>
-                      <!-- /TMPL_IF --><!-- /TMPL_IF -->
+                      <!-- TMPL_IF name="BiblioDefaultViewisbd" --><a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->" title="View details for this title"><!-- TMPL_VAR NAME="title" -->
+                      <!-- TMPL_ELSE --><a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->" title="View details for this title"><!-- TMPL_VAR NAME="title" -->
+                      <!-- /TMPL_IF -->
+                      <!-- TMPL_LOOP NAME="subtitle" -->
+                          <!-- TMPL_VAR NAME="subfield" -->
+                      <!-- /TMPL_LOOP -->
+                      </a>
+                      <!-- /TMPL_IF -->
                       <!-- TMPL_IF NAME="author" -->by <a href="/cgi-bin/koha/opac-search.pl?q=au:<!-- TMPL_VAR NAME="author" ESCAPE="URL" -->" title="Search for works by this author"><!-- TMPL_VAR NAME="author" --></a>
                       <!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF -->
                                <p> <!-- TMPL_IF name="publicationyear" --> - <!-- TMPL_VAR name="publicationyear" --><!-- /TMPL_IF -->
index c561f67..d7aff2e 100644 (file)
@@ -235,7 +235,7 @@ $(document).ready(function(){
 
        <div id="yui-main">
        <div class="yui-b">
-       <div class="container">
+       <div id="userresults" class="container">
   <!-- TMPL_IF NAME="koha_spsuggest" -->
        Did you mean:
     <ul style="list-style: none;">
@@ -332,8 +332,10 @@ $(document).ready(function(){
             <!-- checkall, clearall are now needed for placehold -->
             <span class="checkall"></span>
                <span class="clearall"></span>
-            <a href="#" class="highlight_toggle" id="highlight_toggle_off">Unhighlight</a>
-            <a href="#" class="highlight_toggle" id="highlight_toggle_on">Highlight</a>
+            <!-- TMPL_IF NAME="OpacHighlightedWords" -->
+               <a href="#" class="highlight_toggle" id="highlight_toggle_off">Unhighlight</a>
+               <a href="#" class="highlight_toggle" id="highlight_toggle_on">Highlight</a>
+            <!-- /TMPL_IF -->
             <!-- TMPL_IF EXPR="opacbookbag || virtualshelves" -->
                <span class="addto"></span>
             <!-- /TMPL_IF -->
@@ -372,8 +374,9 @@ $(document).ready(function(){
 <!-- TMPL_IF NAME="RequestOnOpac" --><!-- TMPL_UNLESS NAME="norequests" --><!-- TMPL_IF NAME="opacuserlogin" --><input type="checkbox" id="bib<!-- TMPL_VAR NAME="biblionumber" -->" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" /> <label for="bib<!-- TMPL_VAR NAME="biblionumber" -->"></label><!-- /TMPL_IF --><!-- /TMPL_UNLESS --><!-- /TMPL_IF --><!-- /TMPL_IF --><!-- /TMPL_IF --></td>
                 <td class="select selectcol"><!-- TMPL_VAR NAME="result_number" -->.</td>
 
-                               <!-- TMPL_UNLESS NAME="item-level_itypes" -->
+                               <!-- TMPL_UNLESS NAME="item_level_itypes" -->
                 <!-- TMPL_UNLESS NAME="noItemTypeImages" -->
+
                                <td class="itypecol">
                 <!-- TMPL_IF name="imageurl" -->
                                <img src="<!-- TMPL_VAR name="imageurl" -->" title="<!-- TMPL_VAR name="description" -->" alt="<!-- TMPL_VAR name="description" -->" />
@@ -541,7 +544,7 @@ $(document).ready(function(){
 </div>
 </div>
         <!-- TMPL_IF NAME="opacfacets" -->
-<div class="yui-b"><div class="container">
+<div class="yui-b"><div id="facetcontainer" class="container">
         <!-- FACETS START -->
                <!-- TMPL_INCLUDE NAME="opac-facets.inc" -->
         <!-- FACETS END -->
index 573295e..bac63f6 100644 (file)
@@ -48,7 +48,7 @@
 </head>
 <body id="comment">
 <div id="custom-doc" class="yui-t7">
-<div class="container">
+<div id="userreview" class="container">
 <!-- TMPL_IF NAME="cgi_debug" --><div class="debug">CGI debug is on.</div><!-- /TMPL_IF -->
 <!-- TMPL_IF NAME="ERRORS" -->
        <div class="error">
index 1847017..3c370f0 100644 (file)
      </div>
 
 <!-- TMPL_IF NAME="OpacNav" -->
-<div class="yui-b"><div class="container">
+<div class="yui-b"><div id="leftmenus" class="container">
 <!--TMPL_INCLUDE NAME="navigation.inc" -->
 <!--TMPL_INCLUDE NAME="usermenu.inc" -->
 </div></div>
 <!-- TMPL_ELSIF NAME="loggedinusername" -->
-<div class="yui-b"><div class="container">
+<div class="yui-b"><div id="leftmenus" class="container">
 <!--TMPL_INCLUDE NAME="navigation.inc" -->
 <!--TMPL_INCLUDE NAME="usermenu.inc" -->
 </div></div>
index 4104682..9ebbd4e 100644 (file)
@@ -2,7 +2,7 @@
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
 </head>
 <body style="padding: 1em;" id="sendbasket">
-<div class="container"><!-- TMPL_IF NAME="email_add" -->
+<div id="usersendbasket" class="container"><!-- TMPL_IF NAME="email_add" -->
 
        <!-- TMPL_IF NAME="SENT" -->
                <h3>Message Sent</h3>
index b74bf82..182c2a3 100644 (file)
@@ -8,7 +8,7 @@
 </script>
 </head>
 <body style="padding: 1em;" id="sendshelf">
-<div class="container"><!-- TMPL_IF NAME="email" -->
+<div id="usersendshelfform" class="container"><!-- TMPL_IF NAME="email" -->
 
     <!-- TMPL_IF NAME="SENT" -->
         <h3>Message Sent</h3>
index 13a3487..5652020 100644 (file)
@@ -9,7 +9,7 @@
        <div id="yui-main">
        <div class="yui-b"><div class="yui-g">
 
-<div class="container">
+<div id="userserialissues" class="container">
 <h2>Issues for a subscription</h2>
 <div id="views">
        <span class="view"><a id="Normalview" href="opac-detail.pl?biblionumber=<!-- TMPL_VAR name="biblionumber" -->" class="button">Normal View</a></span>
 </div>
                        <!-- TMPL_IF NAME="OpacNav" -->
                        <div class="yui-b">
-                       <div class="container">
+                       <div id="leftmenus" class="container">
                        <!--TMPL_INCLUDE NAME="navigation.inc" -->
                        </div>
                        </div><!-- /TMPL_IF -->
index 3c04429..1e1d2d5 100644 (file)
@@ -142,7 +142,7 @@ $(function() {
       <!-- TMPL_INCLUDE NAME="masthead.inc" -->
       <div id="yui-main">
         <div class="yui-b">
-          <div class="container">
+          <div id="usershelves" class="container">
           
             <!-- TMPL_IF NAME="paramsloop" -->
               <!-- TMPL_LOOP NAME="paramsloop" -->
@@ -240,7 +240,7 @@ $(function() {
                     <!-- /TMPL_UNLESS -->
                         <td><input type="checkbox" name="REM-<!-- TMPL_VAR NAME="biblionumber" -->"
                                    value="<!-- TMPL_VAR NAME="biblionumber">" /></td>
-                    <!-- TMPL_UNLESS NAME="item-level_itypes" -->
+                    <!-- TMPL_UNLESS NAME="item_level_itypes" -->
                         <td>
                           <!-- TMPL_UNLESS NAME="noItemTypeImages" -->
                           <img src="<!-- TMPL_VAR NAME="imageurl" -->" alt="<!-- TMPL_VAR NAME="description" -->" title="<!-- TMPL_VAR NAME="description" -->" />
@@ -594,7 +594,7 @@ $(function() {
       </div>
       <!-- TMPL_IF EXPR="OpacNav||loggedinusername" -->
         <div class="yui-b">
-          <div class="container">
+          <div is="leftmenus" class="container">
             <!-- TMPL_INCLUDE NAME="navigation.inc" -->
             <!-- TMPL_INCLUDE NAME="usermenu.inc" -->
           </div>
index 9f26814..b4daac5 100644 (file)
@@ -14,7 +14,7 @@ $(document).ready(function(){
    <div id="bd">
 <!-- TMPL_INCLUDE name="masthead.inc" -->
        <div id="yui-main">
-       <div class="yui-b"><div class="container">
+       <div class="yui-b"><div id="usershowreviews" class="container">
     <div id="recentcomments" class="searchresults">
 <h3>Recent comments</h3>
 <table>
@@ -89,7 +89,7 @@ $(document).ready(function(){
 </div>
 </div>
 <!-- TMPL_IF EXPR="OpacNav" -->
-<div class="yui-b"><div class="container">
+<div class="yui-b"><div id="leftmenus" class="container">
 <!--TMPL_INCLUDE NAME="navigation.inc" -->
 </div></div>
 <!-- /TMPL_IF -->
index 483551b..ab1e811 100644 (file)
@@ -70,7 +70,7 @@ $.tablesorter.addParser({
 <!-- TMPL_INCLUDE name="masthead.inc" -->
        <div id="yui-main">
        <div class="yui-b"><div class="yui-g">
-<div class="container">
+<div id="usersuggestions" class="container">
 <!-- TMPL_IF name="op_add" -->
     <h1>Enter a new purchase suggestion</h1>
 
@@ -198,7 +198,7 @@ $.tablesorter.addParser({
 </div>
 </div>
 <div class="yui-b">
-<div class="container">
+<div id="leftmenus" class="container">
 <!--TMPL_INCLUDE NAME="navigation.inc" -->
 <!-- TMPL_INCLUDE name="usermenu.inc" -->
 </div>
index 80dac79..dbfa67e 100644 (file)
@@ -56,7 +56,7 @@
 
 <div id="yui-main">
   <div class="yui-b"><div class="yui-g">
-       <div class="container">
+       <div id="usertags" class="container">
        <!-- TMPL_IF NAME="ERRORS" -->
        <!-- TMPL_LOOP NAME="ERRORS" -->
                <div class="dialog alert">There was a problem with this operation:
 </div>
 </div>
 <!-- TMPL_IF EXPR="OpacNav||loggedinusername" -->
-<div class="yui-b"><div class="container">
+<div class="yui-b"><div id="leftmenus" class="container">
 <!--TMPL_INCLUDE NAME="navigation.inc" -->
 <!--TMPL_INCLUDE NAME="usermenu.inc" -->
 </div></div>
index b5f3ce5..1e0f65c 100644 (file)
@@ -33,7 +33,7 @@
          </div></div>
        </div>
        <!-- TMPL_IF NAME="OpacNav" -->
-       <div class="yui-b"><div class="container">
+       <div class="yui-b"><div id="leftmenus" class="container">
        <!--TMPL_INCLUDE NAME="navigation.inc" -->
        </div></div>
        <!-- /TMPL_IF -->
index 871d6c9..183c483 100644 (file)
@@ -27,7 +27,19 @@ function Dopop(link) {
 </style>
 </head>
 <body id="opac-topissues">
-       <!-- TMPL_IF EXPR="OpacNav||results_loop" --><div id="doc3" class="yui-t1"><!-- TMPL_ELSE --><div id="doc3" class="yui-t7"><!-- /TMPL_IF -->
+
+<!-- TMPL_IF NAME="results_loop" -->
+<div id="doc3" class="yui-t1">
+<!-- TMPL_ELSE -->
+<!-- TMPL_IF NAME="OpacNav" -->
+<div id="doc3" class="yui-t1">
+<!-- TMPL_ELSE -->
+<div id="doc3" class="yui-t7">
+<!-- /TMPL_IF -->
+<!-- /TMPL_IF -->
+
+       
+
    <div id="bd">
 <!-- TMPL_INCLUDE name="masthead.inc" -->
 
@@ -51,7 +63,7 @@ function Dopop(link) {
     </caption>
             <thead><tr>
                 <th>Title</th>
-                <th>Itemtype</th>
+                <th><!-- TMPL_IF NAME="ccodesearch" -->Collection<!-- TMPL_ELSE -->Item type<!-- /TMPL_IF --></th>
                 <th>Checkouts</th>
                                <!-- TMPL_IF NAME="opacuserlogin" --><th>&nbsp;</th><!-- /TMPL_IF -->
                                
@@ -100,13 +112,11 @@ function Dopop(link) {
             </li>
             <li><label for="itemtype">Limit to: </label>
                     <select name="itemtype" id="itemtype">
-                        <option value="">All item types</option>
-                       <!-- TMPL_LOOP name="itemtypeloop" -->
-                           <!-- TMPL_IF name="selected" -->
-                               <option value="<!-- TMPL_VAR name="value" -->" selected="selected"><!-- TMPL_VAR name="description" --></option>
-                           <!-- TMPL_ELSE -->
-                               <option value="<!-- TMPL_VAR name="value" -->"><!-- TMPL_VAR name="description" --></option>
-                           <!-- /TMPL_IF -->
+                        <!-- TMPL_IF NAME="ccodesearch" --><option value="">All collections</option><!-- TMPL_ELSE --><option value="">All item types</option><!-- /TMPL_IF -->
+                        <!-- TMPL_LOOP name="itemtypeloop" -->
+                            <!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR name="value" -->" selected="selected"><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR name="value" -->"><!-- /TMPL_IF -->
+                                <!-- TMPL_VAR name="description" -->
+                            </option>
                         <!-- /TMPL_LOOP -->
                     </select></li>
                        <li>
@@ -126,11 +136,19 @@ function Dopop(link) {
        </div>
 </div>
 </div>
-</div><!-- TMPL_IF EXPR="OpacNav||results_loop" -->
-<div class="yui-b"><div class="container">
-<!-- TMPL_IF NAME="results_loop" --><!-- TMPL_INCLUDE NAME="opac-topissues.inc" --><!-- /TMPL_IF -->
+</div>
+<!-- TMPL_IF NAME="results_loop" -->
+<div class="yui-b"><div id="usertopissues" class="container">
+<!-- TMPL_INCLUDE NAME="opac-topissues.inc" -->
+<!-- TMPL_IF NAME="OpacNav" --><!--TMPL_INCLUDE NAME="navigation.inc" --><!-- /TMPL_IF -->
+</div></div>
+<!-- TMPL_ELSE -->
+<!-- TMPL_IF NAME="OpacNav" -->
+<div class="yui-b"><div id="leftmenus" class="container">
 <!--TMPL_INCLUDE NAME="navigation.inc" -->
 </div></div>
 <!-- /TMPL_IF -->
+<!-- /TMPL_IF -->
+
 </div>
 <!-- TMPL_INCLUDE NAME="opac-bottom.inc" -->
index 001d947..08aac17 100644 (file)
@@ -28,13 +28,13 @@ $.tablesorter.addParser({
                                widgets : ['zebra'],
                                <!-- TMPL_IF NAME="JacketImages" -->
                                        sortList: [[3,0]],
-                                               <!-- TMPL_IF NAME="item-level_itypes" -->
+                                               <!-- TMPL_IF NAME="item_level_itypes" -->
                                                        headers: { 0: { sorter: false }, 1: { sorter: 'articles' },4: { sorter: false },5: { sorter: false }}
                                                <!-- TMPL_ELSE -->
                                                        headers: { 0: { sorter: false }, 1: { sorter: 'articles' },5: { sorter: false },6: { sorter: false }}
                                                <!-- /TMPL_IF -->
                                <!-- TMPL_ELSE -->
-                                               <!-- TMPL_IF NAME="item-level_itypes" -->
+                                               <!-- TMPL_IF NAME="item_level_itypes" -->
                                                        sortList: [[2,0]],
                                                        headers: { 0: { sorter: 'articles' },3: { sorter: false },4: { sorter: false }}
                                                <!-- TMPL_ELSE -->
@@ -48,13 +48,13 @@ $.tablesorter.addParser({
                                widgets : ['zebra'],
                                <!-- TMPL_IF NAME="JacketImages" -->
                                        sortList: [[1,0]],
-                                               <!-- TMPL_IF NAME="item-level_itypes" -->
+                                               <!-- TMPL_IF NAME="item_level_itypes" -->
                                                        headers: { 0: { sorter: false }, 1: { sorter: 'articles' },4: { sorter: false },5: { sorter: false }}
                                                <!-- TMPL_ELSE -->
                                                        headers: { 0: { sorter: false }, 1: { sorter: 'articles' },5: { sorter: false },6: { sorter: false }}
                                                <!-- /TMPL_IF -->
                                <!-- TMPL_ELSE -->
-                                               <!-- TMPL_IF NAME="item-level_itypes" -->
+                                               <!-- TMPL_IF NAME="item_level_itypes" -->
                                                        sortList: [[0,0]],
                                                        headers: { 0: { sorter: 'articles' },3: { sorter: false }}
                                                <!-- TMPL_ELSE -->
@@ -192,12 +192,15 @@ $.tablesorter.addParser({
     <!-- /TMPL_IF -->
 
     <div id="opac-user-checkouts"><!-- TMPL_IF NAME="issues_count" -->
+        <form action="/cgi-bin/koha/opac-renew.pl" method="post">
+       <input type="hidden" name="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->">
+       <input type="hidden" name="from" value="opac_user" />
         <table id="checkoutst">
         <caption><!-- TMPL_VAR NAME="issues_count" --> Items Checked Out</caption>
        <thead><tr>
                <!-- TMPL_IF NAME="JacketImages" --><th>&nbsp;</th><!-- /TMPL_IF -->
         <th>Title</th>
-               <!-- TMPL_UNLESS NAME="item-level_itypes" --><th>Item Type</th> <!-- /TMPL_UNLESS -->
+               <!-- TMPL_UNLESS NAME="item_level_itypes" --><th>Item Type</th> <!-- /TMPL_UNLESS -->
         <th>Call No.</th>
         <th>Due</th>
         <!-- TMPL_IF name="OpacRenewalAllowed" -->
@@ -237,7 +240,7 @@ $.tablesorter.addParser({
                 <td><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="title" escape="html" --></a><span class="item-details">
                         <!-- TMPL_VAR NAME="author" -->
                     </span></td>
-                <!-- TMPL_UNLESS NAME="item-level_itypes" --><td><!-- TMPL_IF NAME="imageurl" --><img src="<!-- TMPL_VAR NAME="imageurl" -->" title="<!-- TMPL_VAR name="description" -->" alt="<!-- TMPL_VAR NAME="description" -->" /><!-- /TMPL_IF --> <!-- TMPL_VAR name="description" --></td><!-- /TMPL_UNLESS -->
+                <!-- TMPL_UNLESS NAME="item_level_itypes" --><td><!-- TMPL_IF NAME="imageurl" --><img src="<!-- TMPL_VAR NAME="imageurl" -->" title="<!-- TMPL_VAR name="description" -->" alt="<!-- TMPL_VAR NAME="description" -->" /><!-- /TMPL_IF --> <!-- TMPL_VAR name="description" --></td><!-- /TMPL_UNLESS -->
                 <td><!-- TMPL_VAR NAME="itemcallnumber" --></td>
                 <!-- TMPL_IF NAME="overdue" -->
                     <td class="overdue"><!-- TMPL_VAR NAME="date_due" --></td>
@@ -246,7 +249,7 @@ $.tablesorter.addParser({
                 <!-- /TMPL_IF -->
                 <!-- TMPL_IF name="OpacRenewalAllowed" -->
                     <!-- TMPL_UNLESS name="patron_flagged" -->
-                    <td><!-- TMPL_IF NAME="status" --><a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&amp;item=<!-- TMPL_VAR NAME="itemnumber" -->&amp;borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->">Renew</a> <span class="renewals">(<!-- TMPL_VAR NAME="renewsleft" --> of <!-- TMPL_VAR NAME="renewsallowed" --> renewals remaining)</span>
+                    <td><!-- TMPL_IF NAME="status" --><input type="checkbox" name="item" value="<!-- TMPL_VAR NAME="itemnumber"-->"/><a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&amp;item=<!-- TMPL_VAR NAME="itemnumber" -->&amp;borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->">Renew</a> <span class="renewals">(<!-- TMPL_VAR NAME="renewsleft" --> of <!-- TMPL_VAR NAME="renewsallowed" --> renewals remaining)</span>
                         <!-- TMPL_ELSE -->
                         Not renewable<!-- TMPL_IF NAME="too_many" --> <span class="renewals">(<!-- TMPL_VAR NAME="renewsleft" --> of <!-- TMPL_VAR NAME="renewsallowed" --> renewals remaining)</span><!-- TMPL_ELSE --><!-- TMPL_IF NAME="on_reserve" --> <span class="renewals">(On hold)</span><!-- /TMPL_IF --><!-- /TMPL_IF --> 
                         <!-- /TMPL_IF --></td>
@@ -258,7 +261,13 @@ $.tablesorter.addParser({
             </tr>
         <!-- /TMPL_LOOP --></tbody>
         </table>
+       
                <!-- TMPL_IF name="OpacRenewalAllowed" -->
+               <input type="submit" value="Renew Selected" />
+               <!-- /TMPL_IF -->
+               </form>
+               <!-- TMPL_IF name="OpacRenewalAllowed" -->
+               
                <form action="/cgi-bin/koha/opac-renew.pl" method="post">
                        <input type="hidden" name="from" value="opac_user" />
                        <input type="hidden" name="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->" />
@@ -282,7 +291,7 @@ $.tablesorter.addParser({
 <thead><tr>
 <!-- TMPL_IF NAME="JacketImages" --><th>&nbsp;</th><!-- /TMPL_IF -->
 <th>Title</th>
-<!-- TMPL_UNLESS NAME="item-level_itypes" --><th>Item Type</th> <!-- /TMPL_UNLESS -->
+<!-- TMPL_UNLESS NAME="item_level_itypes" --><th>Item Type</th> <!-- /TMPL_UNLESS -->
 <th>Call No.</th>
 <th>Due</th>
 <!-- TMPL_IF name="OpacRenewalAllowed" -->
@@ -313,7 +322,7 @@ $.tablesorter.addParser({
 
 <td><a href="/cgi-bin/koha/opac-detail.pl?bib=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="title" escape="html" --></a> <span class="item-details"><!-- TMPL_VAR NAME="author" --></span></td>
 
-<!-- TMPL_UNLESS NAME="item-level_itypes" --><td><!-- TMPL_IF NAME="imageurl" --><img src="<!-- TMPL_VAR NAME="imageurl" -->" title="<!-- TMPL_VAR name="description" -->" alt="<!-- TMPL_VAR NAME="description" -->" /><!-- /TMPL_IF --> <!-- TMPL_VAR name="description" --></td><!-- /TMPL_UNLESS -->
+<!-- TMPL_UNLESS NAME="item_level_itypes" --><td><!-- TMPL_IF NAME="imageurl" --><img src="<!-- TMPL_VAR NAME="imageurl" -->" title="<!-- TMPL_VAR name="description" -->" alt="<!-- TMPL_VAR NAME="description" -->" /><!-- /TMPL_IF --> <!-- TMPL_VAR name="description" --></td><!-- /TMPL_UNLESS -->
 <td><!-- TMPL_VAR NAME="itemcallnumber" --></td>
 <td><!-- TMPL_VAR NAME="date_due" --></td>
                 <!-- TMPL_IF name="OpacRenewalAllowed" -->
@@ -418,7 +427,7 @@ $.tablesorter.addParser({
 </div>
 </div>
 <div class="yui-b">
-<div class="container">
+<div id="leftmenus" class="container">
 <!--TMPL_INCLUDE NAME="navigation.inc" -->
 <!-- TMPL_INCLUDE name="usermenu.inc" -->
 </div>
index 174b8bd..c8b5ff8 100644 (file)
@@ -78,10 +78,10 @@ Card Number:</th><td><!-- TMPL_VAR NAME="cardnumber" --></td></tr>
 </div>
 </div>
 <div class="yui-b">
-<div class="container">
+<div id="leftmenus" class="container">
 <!--TMPL_INCLUDE NAME="navigation.inc" -->
 <!-- TMPL_INCLUDE name="usermenu.inc" -->
 </div>
 </div>
 </div>
-<!-- TMPL_INCLUDE NAME="opac-bottom.inc" -->
\ No newline at end of file
+<!-- TMPL_INCLUDE NAME="opac-bottom.inc" -->
index f806754..477e0d6 100644 (file)
@@ -9,7 +9,7 @@
        <div id="yui-main">
        <div class="yui-b"><div class="yui-g" id="userupdate">
 
-<div class="container">
+<div id="userupdatecontainer" class="container">
 <!-- TMPL_LOOP name="BORROWER_INFO" -->
 <h3><a href="/cgi-bin/koha/opac-user.pl"><!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" -->'s account</a> <img src="<!-- TMPL_VAR NAME="themelang" -->../../images/caret.gif" width="16" height="16" alt="&gt;" border="0" /> Your Personal Details</h3>
 
 </div>
 </div>
 <div class="yui-b">
-<div class="container">
+<div id="leftmenus" class="container">
 <!--TMPL_INCLUDE NAME="navigation.inc" -->
 <!-- TMPL_INCLUDE name="usermenu.inc" -->
 </div>
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/bd.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/bd.png
new file mode 100644 (file)
index 0000000..773a712
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/bd.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/cd.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/cd.png
new file mode 100644 (file)
index 0000000..b29e4f5
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/cd.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/cdrom.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/cdrom.png
new file mode 100644 (file)
index 0000000..25957ea
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/cdrom.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/dossier_de_presse.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/dossier_de_presse.png
new file mode 100644 (file)
index 0000000..8a13696
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/dossier_de_presse.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/dvd.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/dvd.png
new file mode 100644 (file)
index 0000000..585a2d3
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/dvd.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/dvd_musical.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/dvd_musical.png
new file mode 100644 (file)
index 0000000..f5941e2
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/dvd_musical.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/livre.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/livre.png
new file mode 100644 (file)
index 0000000..25dcb9c
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/livre.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/livre_ancien.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/livre_ancien.png
new file mode 100644 (file)
index 0000000..2ffdb2d
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/livre_ancien.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/livre_artiste.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/livre_artiste.png
new file mode 100644 (file)
index 0000000..39fedb4
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/livre_artiste.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/livre_audio.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/livre_audio.png
new file mode 100644 (file)
index 0000000..2da6a5a
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/livre_audio.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/livre_en_gros_caracteres.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/livre_en_gros_caracteres.png
new file mode 100644 (file)
index 0000000..a658285
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/livre_en_gros_caracteres.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/livre_multimedia.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/livre_multimedia.png
new file mode 100644 (file)
index 0000000..0a3e2cd
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/livre_multimedia.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/partition.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/partition.png
new file mode 100644 (file)
index 0000000..65bb645
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/partition.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/revue.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/revue.png
new file mode 100644 (file)
index 0000000..338df90
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/revue.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/vhs.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/vhs.png
new file mode 100644 (file)
index 0000000..0709532
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/carredart/vhs.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/addtocart.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/addtocart.png
new file mode 100644 (file)
index 0000000..8acaef1
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/addtocart.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/addtoshelf.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/addtoshelf.png
new file mode 100644 (file)
index 0000000..f07a0e8
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/addtoshelf.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/audiobook-cd.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/audiobook-cd.png
new file mode 100644 (file)
index 0000000..ba85607
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/audiobook-cd.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/audiobook.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/audiobook.png
new file mode 100644 (file)
index 0000000..eee19de
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/audiobook.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/beginner-reader.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/beginner-reader.png
new file mode 100644 (file)
index 0000000..4a8c3a1
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/beginner-reader.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/big-book-icon.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/big-book-icon.png
new file mode 100644 (file)
index 0000000..200bf08
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/big-book-icon.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-bag-icon.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-bag-icon.png
new file mode 100644 (file)
index 0000000..bc74205
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-bag-icon.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-author-search.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-author-search.png
new file mode 100644 (file)
index 0000000..e967455
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-author-search.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-biography.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-biography.png
new file mode 100644 (file)
index 0000000..4bcae4d
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-biography.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-mystery.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-mystery.png
new file mode 100644 (file)
index 0000000..5c4eea3
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-mystery.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-non-fiction.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-non-fiction.png
new file mode 100644 (file)
index 0000000..43be77f
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-non-fiction.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-sifi.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-sifi.png
new file mode 100644 (file)
index 0000000..4f43f7f
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-sifi.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-subject-search.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-subject-search.png
new file mode 100644 (file)
index 0000000..ed6dd10
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-subject-search.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-title-search.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-title-search.png
new file mode 100644 (file)
index 0000000..352d4b1
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-title-search.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-western.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-western.png
new file mode 100644 (file)
index 0000000..a9d4069
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon-western.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon.png
new file mode 100644 (file)
index 0000000..82bed33
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-icon.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-large-print.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-large-print.png
new file mode 100644 (file)
index 0000000..70d2725
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/book-large-print.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/card.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/card.png
new file mode 100644 (file)
index 0000000..202da49
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/card.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/cd-rom-icon.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/cd-rom-icon.png
new file mode 100644 (file)
index 0000000..8de1a50
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/cd-rom-icon.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/clear-book-bag.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/clear-book-bag.png
new file mode 100644 (file)
index 0000000..f9fbd9d
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/clear-book-bag.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/detail.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/detail.png
new file mode 100644 (file)
index 0000000..22c1242
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/detail.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/faculty-course-manual.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/faculty-course-manual.png
new file mode 100644 (file)
index 0000000..306b533
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/faculty-course-manual.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/icon-refrence.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/icon-refrence.png
new file mode 100644 (file)
index 0000000..475b8be
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/icon-refrence.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/keyword-search.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/keyword-search.png
new file mode 100644 (file)
index 0000000..3c21e57
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/keyword-search.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/music-cd.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/music-cd.png
new file mode 100644 (file)
index 0000000..9b415de
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/music-cd.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/newspaper-icon.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/newspaper-icon.png
new file mode 100644 (file)
index 0000000..1c454e0
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/newspaper-icon.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/videocassette.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/videocassette.png
new file mode 100644 (file)
index 0000000..c3a950e
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/videocassette.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/vynal-sound-recording.png b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/vynal-sound-recording.png
new file mode 100644 (file)
index 0000000..6ee36a6
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/liblime-kids/vynal-sound-recording.png differ
index fc595a0..2d02d0c 100644 (file)
@@ -16,7 +16,7 @@ the kohaversion is divided in 4 parts :
 use strict;
 
 sub kohaversion {
-    our $VERSION = '3.03.00.012';
+    our $VERSION = '3.03.00.019';
     # version needs to be set this way
     # so that it can be picked up by Makefile.PL
     # during install
index fbd8538..063e489 100755 (executable)
@@ -198,10 +198,7 @@ if (($op eq 'insert') and !$nodouble){
 }
 
   #recover all data from guarantor address phone ,fax... 
-if ( defined($guarantorid) and
-     ( $category_type eq 'C' || $category_type eq 'P' ) and
-     $guarantorid ne ''  and
-     $guarantorid ne '0' ) {
+if ( $guarantorid and ( $category_type eq 'C' || $category_type eq 'P' )) {
     if (my $guarantordata=GetMember(borrowernumber => $guarantorid)) {
         $guarantorinfo=$guarantordata->{'surname'}." , ".$guarantordata->{'firstname'};
         if ( !defined($data{'contactname'}) or $data{'contactname'} eq '' or
@@ -415,9 +412,12 @@ if ($ethnicitycategoriescount>=0) {
 }
 
 my @typeloop;
+my $no_categories = 1;
+my $no_add;
 foreach (qw(C A S P I X)) {
     my $action="WHERE category_type=?";
        ($categories,$labels)=GetborCatFromCatType($_,$action);
+    if(scalar(@$categories) > 0){ $no_categories = 0; }
        my @categoryloop;
        foreach my $cat (@$categories){
                push @categoryloop,{'categorycode' => $cat,
@@ -434,11 +434,14 @@ foreach (qw(C A S P I X)) {
        push @typeloop,{'typename' => $_,
         $typedescription => 1,
          'categoryloop' => \@categoryloop};
-}  
-$template->param('typeloop' => \@typeloop);
-
+}
+$template->param('typeloop' => \@typeloop,
+        no_categories => $no_categories);
+if($no_categories){ $no_add = 1; }
 # test in city
-$select_city=getidcity($data{'city'}) if defined $guarantorid and ($guarantorid ne '0');
+if ( $guarantorid ) {
+    $select_city = getidcity($data{city});
+}
 ($default_city=$select_city) if ($step eq 0);
 if (!defined($select_city) or $select_city eq '' ){
        $default_city = &getidcity($data{'city'});
@@ -527,17 +530,18 @@ my $onlymine=(C4::Context->preference('IndependantBranches') &&
               
 my $branches=GetBranches($onlymine);
 my $default;
-
+my $CGIbranch;
 for my $branch (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) {
     push @select_branch,$branch;
     $select_branches{$branch} = $branches->{$branch}->{'branchname'};
     $default = C4::Context->userenv->{'branch'} if (C4::Context->userenv && C4::Context->userenv->{'branch'});
 }
+if(scalar(@select_branch) > 0){
 # --------------------------------------------------------------------------------------------------------
   #in modify mod :default value from $CGIbranch comes from borrowers table
   #in add mod: default value come from branches table (ip correspendence)
 $default=$data{'branchcode'}  if ($op eq 'modify' || ($op eq 'add' && $category_type eq 'C'));
-my $CGIbranch = CGI::scrolling_list(-id    => 'branchcode',
+$CGIbranch = CGI::scrolling_list(-id    => 'branchcode',
             -name   => 'branchcode',
             -values => \@select_branch,
             -labels => \%select_branches,
@@ -546,6 +550,17 @@ my $CGIbranch = CGI::scrolling_list(-id    => 'branchcode',
             -multiple =>0,
             -default => $default,
         );
+}
+
+if(!$CGIbranch){
+    $no_add = 1;
+    $template->param(no_branches => 1);
+}
+if($no_categories){
+    $no_add = 1;
+    $template->param(no_categories => 1);
+}
+$template->param(no_add => $no_add);
 my $CGIorganisations;
 my $member_of_institution;
 if (C4::Context->preference("memberofinstitution")){
@@ -636,10 +651,11 @@ $template->param(
   check_member    => $check_member,#to know if the borrower already exist(=>1) or not (=>0) 
   "op$op"   => 1);
 
+$template->param(CGIbranch=>$CGIbranch) if ($CGIbranch);
 $template->param(
   nodouble  => $nodouble,
   borrowernumber  => $borrowernumber, #register number
-  guarantorid => (defined($borrower_data->{'guarantorid'})) ? $borrower_data->{'guarantorid'} : $guarantorid,
+  guarantorid => (($borrower_data->{'guarantorid'})) ? $borrower_data->{'guarantorid'} : $guarantorid,
   ethcatpopup => $ethcatpopup,
   relshiploop => \@relshipdata,
   city_loop => $city_arrayref,
@@ -653,7 +669,6 @@ $template->param(
   category_type =>$category_type,
   modify          => $modify,
   nok     => $nok,#flag to konw if an error 
-  CGIbranch => $CGIbranch,
   memberofinstution => $member_of_institution,
   CGIorganisations => $CGIorganisations,
   NoUpdateLogin =>  $NoUpdateLogin
index 120e65f..6cb60fa 100755 (executable)
@@ -1,5 +1,6 @@
 #!/usr/bin/perl
 
+# Parts Copyright Biblibre 2010
 # This file is part of Koha.
 #
 # Koha is free software; you can redistribute it and/or modify it under the
@@ -27,22 +28,10 @@ use C4::Branch;
 use C4::Category;
 
 my $query = new CGI;
-my $quicksearch = $query->param('quicksearch');
 my $branch = $query->param('branchcode');
-my ($template, $loggedinuser, $cookie);
 my $template_name;
 
-if($quicksearch){
-($template, $loggedinuser, $cookie)
-    = get_template_and_user({template_name => "members/member-quicksearch.tmpl",
-                 query => $query,
-                 type => "intranet",
-                 authnotrequired => 0,
-                 flagsrequired => {borrowers => 1},
-                 debug => 1,
-                 });
-} else {
-($template, $loggedinuser, $cookie)
+my ($template, $loggedinuser, $cookie)
     = get_template_and_user({template_name => "members/member.tmpl",
                  query => $query,
                  type => "intranet",
@@ -50,7 +39,6 @@ if($quicksearch){
                  flagsrequired => {borrowers => 1},
                  debug => 1,
                  });
-}
 
 my $branches = GetBranches;
 my @branchloop;
@@ -63,13 +51,34 @@ foreach (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname}
   push @branchloop, \%row;
 }
 
-my @categories=C4::Category->all;
-$template->param(
-    branchloop=>\@branchloop,
-       categories=>\@categories,
-);
+my @categories;
+my $no_categories;
+my $no_add = 0;
+my $branchloop = (defined $branch?GetBranchesLoop($branch):GetBranchesLoop());
+if(scalar(@$branchloop) < 1){
+    $no_add = 1;
+    $template->param(no_branches => 1);
+} 
+else {
+    $template->param(branchloop=>\@$branchloop);
+}
+
+@categories=C4::Category->all;
+if(scalar(@categories) < 1){ 
+    $no_categories = 1; 
+}
+
+if($no_categories && C4::Context->preference("AddPatronLists")=~/code/){
+    $no_add = 1;
+    $template->param(no_categories => 1);
+} 
+else {
+    $template->param(categories=>\@categories);
+}
+
 $template->param( 
         "AddPatronLists_".C4::Context->preference("AddPatronLists")=> "1",
+        no_add => $no_add,
             );
 my @letters = map { {letter => $_} } ( 'A' .. 'Z');
 $template->param( letters => \@letters );
index 7de3fb0..cc2f153 100755 (executable)
@@ -155,7 +155,7 @@ $data->{ "sex_".$data->{'sex'}."_p" } = 1;
 
 my $catcode;
 if ( $category_type eq 'C') {
-       if ($data->{'guarantorid'} ne '0' ) {
+       if ($data->{guarantorid} ) {
        my $data2 = GetMember( 'borrowernumber' => $data->{'guarantorid'} );
        foreach (qw(address city B_address B_city phone mobile zipcode country B_country)) {
            $data->{$_} = $data2->{$_};
@@ -230,6 +230,12 @@ my $lib2 = &GetSortDetails( "Bsort2", $data->{'sort2'} );
 $template->param( lib1 => $lib1 ) if ($lib1);
 $template->param( lib2 => $lib2 ) if ($lib2);
 
+# Show OPAC privacy preference is system preference is set
+if ( C4::Context->preference('OPACPrivacy') ) {
+    $template->param( OPACPrivacy => 1);
+    $template->param( "privacy".$data->{'privacy'} => 1);
+}
+
 # current issues
 #
 my $issue = GetPendingIssues($borrowernumber);
index bd6ca82..f7631db 100755 (executable)
@@ -50,21 +50,11 @@ if ($input->param('borrowernumber')) {
     $data = GetMember(borrowernumber => $borrowernumber);
 }
 
-my $order=$input->param('order') || 'date_due desc';
-my $limit=$input->param('limit');
-
-if ($limit){
-    if ($limit eq 'full'){
-               $limit=0;
-    }
-}
-else {
-  $limit=50;
-}
+my $order = 'date_due desc';
+my $limit = 0;
 my ( $issues ) = GetAllIssues($borrowernumber,$order,$limit);
 
-my ($template, $loggedinuser, $cookie)
-= get_template_and_user({template_name => "members/readingrec.tmpl",
+my ($template, $loggedinuser, $cookie)= get_template_and_user({template_name => "members/readingrec.tmpl",
                                query => $input,
                                type => "intranet",
                                authnotrequired => 0,
index 39e19a1..492219f 100755 (executable)
@@ -81,7 +81,7 @@ if ( $op eq 'multi' ) {
 
 elsif ( $op eq 'update' ) {
     my $member = GetMember('borrowernumber'=>$borrowernumber);
-    $member->{'guarantorid'}  = '0';
+    $member->{'guarantorid'}  = 0;
     $member->{'categorycode'} = $catcode;
     my $borcat = GetBorrowercategory($catcode);
     $member->{'category_type'} = $borcat->{'category_type'};
index 92bc786..671368e 100755 (executable)
@@ -112,9 +112,9 @@ directory. This can be downloaded or futher processed by library staff.
 
 comma separated list of fields that get substituted into templates in
 places of the E<lt>E<lt>items.contentE<gt>E<gt> placeholder. This
-defaults to issuedate,title,barcode,author
+defaults to due date,title,barcode,author
 
-Other possible values come from fields in the biblios, items, and
+Other possible values come from fields in the biblios, items and
 issues tables.
 
 =item B<-borcat>
@@ -255,7 +255,7 @@ my $csvfilename;
 my $htmlfilename;
 my $triggered = 0;
 my $listall = 0;
-my $itemscontent = join( ',', qw( issuedate title barcode author itemnumber ) );
+my $itemscontent = join( ',', qw( date_due title barcode author itemnumber ) );
 my @myborcat;
 my @myborcatout;
 
diff --git a/misc/installer_devel_notes/data/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql b/misc/installer_devel_notes/data/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql
deleted file mode 100644 (file)
index d444ee3..0000000
+++ /dev/null
@@ -1,712 +0,0 @@
--- *************************************************************
---  KOHA 3.0 MARC 21 STANDARD DEFAULT BIBLIOGRAPHIC FRAMEWORK
---              DEVELOPMENT NOTES AND SUPPLEMENTARY SQL
---
---                     PRETEST VERSION 0.1.7
---                          2007-11-05
---
---                            edited
---                            by thd
---
---                          BASED UPON
---
---     KOHA MARC 21 STANDARD DEFAULT BIBLIOGRAPHIC FRAMEWORK
---
---                     PRETEST VERSION 0.2.8
---                          2007-11-05
---
---     original default requiring greater user customisation
---                  created by a few Koha Hands
---                    guided by Paul POULAIN
---
---          revised and greatly enlarged to completion,
---               well not quite complete yet today
---           but close enough for someone to have use,
---                      by thd for LibLime
--- *************************************************************
-
-
--- *********************************************************************
--- These development notes and supplementary SQL statements have been
--- moved from the main file for easier readability of the main file and
--- to avoid possible bugs with lack of time to test for the use of
--- letters in field names such as used by RLIN to avoid conflict with
--- numbered field names already in use.
---
--- Retaining this file is important for future MARC frameworks
--- development work.
--- *********************************************************************
-
-
-SET FOREIGN_KEY_CHECKS = 0;
-
-
--- ******************************************************
--- KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS.
--- ******************************************************
-
--- These ought to be adjusted for different less conflicting and more
--- rationally chosen fields and subfields but I had left that for last.
-
--- ADJUST ME
--- Use values from your dump of marc_tag_structure and marc_subfield_structure
--- to provide support for your Koha database.
-
-
--- ******************************************************
-
--- Original Record ID Field/Subfields
-
-
--- INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
--- ('090', 'KOHA DATA', 'KOHA DATA', 1, 0, '', '');
-
--- INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`) VALUES
--- ('090', 'a', 'Koha Itemtype (NR)', 'Koha Itemtype (NR)', 0, 0, NULL, -1, NULL, NULL, '', NULL, '', NULL, NULL),
--- ('090', 'b', 'Koha Dewey Subclass (NR)', 'Koha Dewey Subclass (NR)', 0, 0, NULL, -1, NULL, NULL, '', NULL, '', NULL, NULL),
--- ('090', 'c', 'Koha biblionumber (NR)', 'Koha biblionumber (NR)', 0, 0, 'biblio.biblionumber', -1, NULL, NULL, '', NULL, '', NULL, NULL),
--- ('090', 'd', 'Koha biblioitemnumber (NR)', 'Koha biblioitemnumber (NR)', 0, 0, 'biblioitems.biblioitemnumber', -1, NULL, NULL, '', NULL, '', NULL, NULL);
-
-
--- Current Record ID Field/Subfields
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('999', 'SYSTEM CONTROL NUMBERS (KOHA)', 'SYSTEM CONTROL NUMBERS (KOHA)', 1, 0, '', '');
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('999', 'a', 'Item type [OBSOLETE]', 'Item type [OBSOLETE]', 0, 0, NULL, -1, NULL, NULL, '', NULL, -5, '', '', '', NULL),
-               ('999', 'b', 'Koha Dewey Subclass [OBSOLETE]', 'Koha Dewey Subclass [OBSOLETE]', 0, 0, NULL, 0, NULL, NULL, '', NULL, -5, '', '', '', NULL),
-               ('999', 'c', 'Koha biblionumber', 'Koha biblionumber', 0, 0, 'biblio.biblionumber', -1, NULL, NULL, '', NULL, -5, '', '', '', NULL),
-               ('999', 'd', 'Koha biblioitemnumber', 'Koha biblioitemnumber', 0, 0, 'biblioitems.biblioitemnumber', -1, NULL, NULL, '', NULL, -5, '', '', '', NULL);
-
-
--- ******************************************************
-
--- Original primary biblioitems Field/Subfields
-
-
--- INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
---             ('942', 'Biblioitem information', 'General classification', 0, 0, '', '');
-
--- INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`) VALUES
---             ('942', 'a', 'Institution code', 'Institution code', 0, 0, '', 5, '', '', '', NULL, '', NULL, NULL),
---             ('942', 'c', 'item type', 'item type', 0, 0, 'biblioitems.itemtype', 5, 'itemtypes', '', '', NULL, '', NULL, NULL),
---             ('942', 'k', 'dewey', 'dewey', 0, 0, 'biblioitems.classification', 5, '', '', '', NULL, '', NULL, NULL);
-
-
--- rel_2_2 primary biblioitems Field/Subfields
-
-
--- INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
---             ('942', 'ADDED ENTRY ELEMENTS (KOHA)', 'ADDED ENTRY ELEMENTS (KOHA)', 0, 0, '', '');
-
--- INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
---             ('942', 'a', 'Institution code [OBSOLETE]', 'Institution code [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -5, '', '', '', NULL),
---             ('942', 'c', 'Koha item type', 'Koha item type', 0, 1, 'biblioitems.itemtype', 9, 'itemtypes', '', '', NULL, 0, '', '', '', NULL),
---             ('942', 'j', 'Location (call number prefix code)', 'Location (call number prefix code)', 0, 0, 'biblioitems.classification', 9, '', '', '', NULL, 0, '', '', '', NULL),
---             ('942', 'k', 'Classification base (DDC to decimal or LCC letter class padded after single letter classes with trailing 0', 'Classification base', 0, 0, 'biblioitems.dewey', 9, '', '', '', NULL, 0, '', '', '', NULL),
---             ('942', 'l', 'Classification subclass (DDC after decimal or LCC number after letters', 'Classification subclass', 0, 0, 'biblioitems.subclass', 9, '', '', '', NULL, 0, '', '', '', NULL);
-
-
-
--- Plugins which need to be written for primary biblioitems Field/Subfields.
-
-
---             ('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, '', '', 'marc21_classcodes.pl', NULL, 0, '', '', '', NULL),
---             ('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', 'marc21_callnumber.pl', NULL, 0, '', '', '', NULL),
-
-
-
--- Current primary biblioitems Field/Subfields
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('942', 'ADDED ENTRY ELEMENTS (KOHA)', 'ADDED ENTRY ELEMENTS (KOHA)', 0, 0, '', '');
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('942', '0', 'Koha issues (borrowed), all copies', 'Koha issues (borrowed), all copies', 0, 0, 'biblioitems.totalissues', 9, '', '', '', NULL, -5, '', '', '', NULL),
-               ('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, '', '', '', NULL, 0, '', '', '', NULL),
-               ('942', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'biblioitems.cn_sort', -1, '', '', '', 0, 7, '', '', '', NULL),
-               ('942', 'a', 'Institution code [OBSOLETE]', 'Institution code [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -5, '', '', '', NULL),
-               ('942', 'c', 'Koha item type', 'Koha item type', 0, 1, 'biblioitems.itemtype', 9, 'itemtypes', '', '', NULL, 0, '', '', '', NULL),
-               ('942', 'e', 'Edition', 'Edition', 0, 0, 'biblioitems.cn_edition', 9, 'CN_EDITION', '', '', NULL, 0, '', '', '', NULL),
-               ('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', '', NULL, 0, '', '', '', NULL),
-               ('942', 'i', 'Item part', 'Item part', 1, 0, 'biblioitems.cn_item', 9, '', '', '', NULL, 9, '', '', '', NULL),
-               ('942', 'k', 'Call number prefix', 'Call number prefix', 0, 0, '', 9, '', '', '', NULL, 0, '', '', '', NULL),
-               ('942', 'm', 'Call number suffix', 'Call number suffix', 0, 0, 'biblioitems.cn_suffix', 9, '', '', '', 0, 0, '', '', '', NULL);
-
-
--- ******************************************************
-
--- Original items Field/Subfields
-
-
--- INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
---             ('952', 'ITEM INFORMATION', 'ITEM INFORMATION', 1, 0, '', '');
-
--- INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`) VALUES
---             ('952', 'b', 'homebranch', 'homebranch', 0, 0, 'items.homebranch', 10, 'branches', '', '', '', '', NULL, NULL),
---             ('952', 'd', 'holdingbranch', 'holdingbranch', 0, 0, 'items.holdingbranch', 10, 'branches', '', '', '\'952b\'', '', NULL, NULL),
---             ('952', 'p', 'barcode', 'barcode', 0, 1, 'items.barcode', 10, '', '', '', '', '', NULL, NULL),
---             ('952', 'r', 'price', 'price', 0, 0, 'items.replacementprice', 10, '', '', '', '', '', NULL, NULL),
---             ('952', 'v', 'dateaccessioned', 'dateaccessioned', 0, 0, 'items.dateaccessioned', 10, '', '', '', '', '', NULL, NULL),
---             ('952', 'y', 'notforloan', 'notforloan', 0, 0, 'items.notforloan', 10, '', '', '', '', '', NULL, NULL),
---             ('952', 'u', 'itemnumber', 'itemnumber', 0, 0, 'items.itemnumber', -1, '', '', '', '', '', NULL, NULL);
-
-
-
--- rel_2-2 items Field/Subfields
-
--- INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
---             ('952', 'LOCATION AND ITEM INFORMATION (KOHA)', 'LOCATION AND ITEM INFORMATION (KOHA)', 1, 0, '', '');
-
--- INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
---             ('952', '0', 'Withdrawn status', 'Withdrawn status', 0, 0, 'items.wthdrawn', 10, 'WTHDRAWN', '', '', 0, 0, '', '', '', NULL),
---             ('952', '1', 'Lost status', 'Lost status', 0, 0, 'items.itemlost', 10, 'LOST', '', '', 0, 0, '', '', '', NULL),
---             ('952', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, '', 10, '', '', 'marc21_classcodes.pl', NULL, 0, '', '', '', NULL),
---             ('952', '3', 'Materials specified (bound volume or other part)', 'Materials specified (bound volume or other part)', 0, 0, '', 10, '', '', '', NULL, -1, '', '', '', NULL),
---             ('952', '4', 'Use restrictions', 'Use restrictions', 0, 0, 'items.restricted', 10, 'RESTRICTED', '', '', 0, 0, '', '', '', NULL),
---             ('952', '6', 'Linkage', 'Linkage', 0, 0, '', 10, '', '', '', NULL, -6, '', '', '', NULL),
---             ('952', '8', 'Sequence number', 'Sequence number', 1, 0, '', 10, '', '', '', NULL, 0, '', '', '', NULL),
---             ('952', '9', 'Cost, normal purchase price', 'Cost, normal purchase price', 0, 0, 'items.price', 10, '', '', '', 0, 0, '', '', '', NULL),
---             ('952', 'a', 'Canceled barcode', 'Canceled barcode', 1, 0, '', 10, '', '', '', NULL, -1, '', '', '', NULL),
---             ('952', 'b', 'Location (home branch)', 'Location (home branch)', 0, 0, 'items.homebranch', 10, 'branches', '', '', 0, 0, '', '', '', NULL),
---             ('952', 'c', 'Shelving location', 'Shelving location', 1, 0, 'items.location', 10, 'LOC', '', '', 0, 0, '', '', '', NULL),
---             ('952', 'd', 'Sublocation or collection (holding branch)', 'Sublocation or collection (holding branch)', 0, 0, 'items.holdingbranch', 10, 'branches', '', '', 0, 0, '', '''952b''', '', NULL),
---             ('952', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, 'items.booksellerid', 10, '', '', '', 0, 0, '', '', '', NULL),
---             ('952', 'f', 'Coded location qualifier', 'Coded location qualifier', 1, 0, '', 10, '', '', 'marc21_locationqualifier.pl', NULL, 0, '', '', '', NULL),
---             ('952', 'g', 'Non-coded location qualifier', 'Non-coded location qualifier', 1, 0, '', 10, '', '', '', NULL, 0, '', '', '', NULL),
---             ('952', 'h', 'Classification part', 'Classification part', 0, 0, '', 10, '', '', '', NULL, 0, '', '', '', NULL),
---             ('952', 'i', 'Item part', 'Item part', 1, 0, '', 10, '', '', '', NULL, 0, '', '', '', NULL),
---             ('952', 'j', 'Shelving control number', 'Shelving control number', 0, 0, 'items.stack', 10, '', '', 'STOCK', NULL, 0, '', '', '', NULL),
---             ('952', 'k', 'Kohqa full call number', 'Koha full call number', 0, 0, 'items.itemcallnumber', 10, '', '', NULL, 0, 0, '', '', '', NULL),
---             ('952', 'l', 'Shelving form of title', 'Shelving form of title', 0, 0, '', 10, '', '', '', NULL, 0, '', '', '', NULL),
---             ('952', 'm', 'Call number suffix', 'Call number suffix', 0, 0, '', 10, '', '', '', NULL, 0, '', '', '', NULL),
---             ('952', 'n', 'Country code', 'Country code', 0, 0, '', 10, '', '', '', NULL, 0, '', '', '', NULL),
---             ('952', 'o', 'Call number prefix', 'Call number prefix', 0, 0, '', 10, '', '', '', NULL, 0, '', '', '', NULL),
---             ('952', 'p', 'Barcode', 'Barcode', 0, 0, 'items.barcode', 10, '', '', 'barcode.pl', 0, 0, '', '', '', NULL),
---             ('952', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 10, '', '', '', NULL, 0, '', '', '', NULL),
---             ('952', 'r', 'Cost, replacement price', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, '', '', '', NULL),
---             ('952', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 10, '', '', '', NULL, 0, '', '', '', NULL),
---             ('952', 't', 'Copy number', 'Copy number', 0, 0, '', 10, '', '', '', NULL, 0, '', '', '', NULL),
---             ('952', 'u', 'Koha itemnumber (autogenerated)', 'Koha itemnumber', 0, 0, 'items.itemnumber', -1, '', '', '', 0, -5, '', '', '', NULL),
---             ('952', 'v', 'Date acquired', 'Date acquired', 0, 0, 'items.dateaccessioned', 10, '', '', 'usmarc_field_952v.pl', 0, 0, '', '', '', NULL),
---             ('952', 'w', 'Price effective from', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, '', '', '', NULL),
---             ('952', 'x', 'Nonpublic note (lost item payment)', 'Nonpublic note', 1, 0, 'items.paidfor', 10, '', '', '', NULL, 6, '', '', '', NULL),
---             ('952', 'y', 'Not for loan', 'Not for loan', 0, 0, 'items.notforloan', 10, '', '', '', 0, 0, '', '', '', NULL),
---             ('952', 'z', 'Public note', 'Public note', 1, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, '', '', '', NULL);
-
-
-
--- Recommended items Field/Subfields
-
--- Because of upgrade issues, the following recomendation may be a problematic
--- recomendation.
-
--- Using recommended items fields/subfields might require adding columns to
--- the Koha 'items' table and might not upgrade well without special effort.
--- The following columns may not be present in 'items' and would need
--- adding.
---
--- Repeatedly recreating and dropping a stored procedure avoids the risk of an
--- 'illegal mix of collations' error from calling the stored procedure with
--- variables where MySQL has multiple UTF8 collations.
---
--- yourKohaDatabaseName must be changed appropriately below.
-
--- DELIMITER //
--- -- CREATE PROCEDURE tempaddcolumn(c VARCHAR(32), a VARCHAR(256))
--- CREATE PROCEDURE tempaddcolumn()
--- BEGIN
--- IF NOT EXISTS (
---             SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
---             WHERE TABLE_SCHEMA = 'yourKohaDatabaseName'
---             AND TABLE_NAME = 'items'
---             AND COLUMN_NAME = 'linkage')
---     THEN ALTER TABLE `items` ADD `linkage` TEXT CHARACTER SET utf8 DEFAULT NULL;
--- END IF;
--- END //
--- DELIMITER ;
--- call tempaddcolumn();
--- DROP PROCEDURE tempaddcolumn;
--- 
--- DELIMITER //
--- CREATE PROCEDURE tempaddcolumn()
--- BEGIN
--- IF NOT EXISTS (
---             SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
---             WHERE TABLE_SCHEMA = 'yourKohaDatabaseName'
---             AND TABLE_NAME = 'items'
---             AND COLUMN_NAME = 'sequence')
---     THEN ALTER TABLE `items` ADD `sequence` TEXT CHARACTER SET utf8 DEFAULT NULL;
--- END IF;
--- END //
--- DELIMITER ;
--- call tempaddcolumn();
--- DROP PROCEDURE tempaddcolumn;
--- 
--- 
--- DELIMITER //
--- CREATE PROCEDURE tempaddcolumn()
--- BEGIN
--- IF NOT EXISTS (
---             SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
---             WHERE TABLE_SCHEMA = 'yourKohaDatabaseName'
---             AND TABLE_NAME = 'items'
---             AND COLUMN_NAME = 'non_coded_location_qualifier')
---     THEN ALTER TABLE `items` ADD `non_coded_location_qualifier` TEXT CHARACTER SET utf8 DEFAULT NULL;
--- END IF;
--- END //
--- DELIMITER ;
--- call tempaddcolumn();
--- DROP PROCEDURE tempaddcolumn;
--- 
--- DELIMITER //
--- CREATE PROCEDURE tempaddcolumn()
--- BEGIN
--- IF NOT EXISTS (
---             SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
---             WHERE TABLE_SCHEMA = 'yourKohaDatabaseName'
---             AND TABLE_NAME = 'items'
---             AND COLUMN_NAME = 'cn_class')
---     THEN ALTER TABLE `items` ADD `cn_class` VARCHAR(127) CHARACTER SET utf8 DEFAULT NULL;
--- END IF;
--- END //
--- DELIMITER ;
--- call tempaddcolumn();
--- DROP PROCEDURE tempaddcolumn;
--- 
--- DELIMITER //
--- CREATE PROCEDURE tempaddcolumn()
--- BEGIN
--- IF NOT EXISTS (
---             SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
---             WHERE TABLE_SCHEMA = 'yourKohaDatabaseName'
---             AND TABLE_NAME = 'items'
---             AND COLUMN_NAME = 'cn_item')
---     THEN ALTER TABLE `items` ADD `cn_item` VARCHAR(63) CHARACTER SET utf8 DEFAULT NULL;
--- END IF;
--- END //
--- DELIMITER ;
--- call tempaddcolumn();
--- DROP PROCEDURE tempaddcolumn;
--- 
--- DELIMITER //
--- CREATE PROCEDURE tempaddcolumn()
--- BEGIN
--- IF NOT EXISTS (
---             SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
---             WHERE TABLE_SCHEMA = 'yourKohaDatabaseName'
---             AND TABLE_NAME = 'items'
---             AND COLUMN_NAME = 'cn_prefix')
---     THEN ALTER TABLE `items` ADD `cn_prefix` VARCHAR(31) CHARACTER SET utf8 DEFAULT NULL;
--- END IF;
--- END //
--- DELIMITER ;
--- call tempaddcolumn();
--- DROP PROCEDURE tempaddcolumn;
--- 
--- DELIMITER //
--- CREATE PROCEDURE tempaddcolumn()
--- BEGIN
--- IF NOT EXISTS (
---             SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
---             WHERE TABLE_SCHEMA = 'yourKohaDatabaseName'
---             AND TABLE_NAME = 'items'
---             AND COLUMN_NAME = 'shelving_title')
---     THEN ALTER TABLE `items` ADD `shelving_title` VARCHAR(255) CHARACTER SET utf8 DEFAULT NULL;
--- END IF;
--- END //
--- DELIMITER ;
--- call tempaddcolumn();
--- DROP PROCEDURE tempaddcolumn;
--- 
--- DELIMITER //
--- CREATE PROCEDURE tempaddcolumn()
--- BEGIN
--- IF NOT EXISTS (
---             SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
---             WHERE TABLE_SCHEMA = 'yourKohaDatabaseName'
---             AND TABLE_NAME = 'items'
---             AND COLUMN_NAME = 'cancelled_barcode')
---     THEN ALTER TABLE `items` ADD `cancelled_barcode` VARCHAR(255) CHARACTER SET utf8 DEFAULT NULL;
--- END IF;
--- END //
--- DELIMITER ;
--- call tempaddcolumn();
--- DROP PROCEDURE tempaddcolumn;
--- 
--- DELIMITER //
--- CREATE PROCEDURE tempaddcolumn()
--- BEGIN
--- IF NOT EXISTS (
---             SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
---             WHERE TABLE_SCHEMA = 'yourKohaDatabaseName'
---             AND TABLE_NAME = 'items'
---             AND COLUMN_NAME = 'copyright_fee')
---     THEN ALTER TABLE `items` ADD `copyright_fee` TEXT CHARACTER SET utf8 DEFAULT NULL;
--- END IF;
--- END //
--- DELIMITER ;
--- call tempaddcolumn();
--- DROP PROCEDURE tempaddcolumn;
-
--- INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
---             ('95k', 'LOCATION AND ITEM INFORMATION (KOHA)', 'LOCATION AND ITEM INFORMATION (KOHA)', 1, 0, '', '');
-
--- INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
---             ('95k', '0', 'Item status (withdrawn) (similar to 876-8 $j)', 'Item status (withdrawn)', 0, 0, 'items.wthdrawn', 10, 'WITHDRAWN', '', '', 0, 0, '', '', '', NULL),
---             ('95k', '1', 'Item status (lost) (similar to 876-8 $j)', 'Item status (lost)', 0, 0, 'items.itemlost', 10, 'LOST', '', '', 0, 0, '', '', '', NULL),
---             ('95k', '2', 'Source of classification or shelving scheme (similar to 852 $2)', 'Source of classification or shelving scheme', 0, 0, 'items.cn_source', 10, '', '', 'marc21_classcodes.pl', NULL, 0, '', '', '', NULL),
---             ('95k', '3', 'Materials specified (bound volume or other part) (similar to 852, 876-8 $3)', 'Materials specified (bound volume or other part)', 0, 0, 'items.materials', 10, '', '', '', NULL, -1, '', '', '', NULL),
---             ('95k', '4', 'Item status (damaged) (similar to 876-8 $j)', 'Item status (damaged)', 0, 0, 'items.damaged', 10, 'DAMAGED', '', '', NULL, 0, '', '', '', NULL),
---             ('95k', '5', 'Use restrictions (similar to 506 $a, 876-8 $h)', 'Use restrictions', 0, 0, 'items.restricted', 10, 'RESTRICTED', '', '', 0, 0, '', '', '', NULL),
---             ('95k', '6', 'Linkage (similar to 852, 876-8 $6)', 'Linkage', 0, 0, 'items.linkage', 10, '', '', '', NULL, -6, '', '', '', NULL),
---             ('95k', '7', 'Use restrictions (not for loan) (similar to 506 $a, 876-8 $h)', 'Use restrictions (not for loan)', 0, 0, 'items.notforloan', 10, 'NOT_LOAN', '', '', 0, 0, '', '', '', NULL),
---             ('95k', '8', 'Sequence number (similar to 852, 876-8 $8)', 'Sequence number', 1, 0, 'items.sequence', 10, '', '', '', NULL, 0, '', '', '', NULL),
---             ('95k', '9', 'Koha itemnumber (autogenerated similar to 852, 876-8 $3 $8 $t combined)', 'Koha itemnumber', 0, 0, 'items.itemnumber', -1, '', '', '', 0, -5, '', '', '', NULL),
---             ('95k', 'a', 'Location (home branch) (similar to 852 $a)', 'Location (home branch)', 0, 0, 'items.homebranch', 10, 'branches', '', '', 0, 0, '', '', '', NULL),
---             ('95k', 'b', 'Sublocation or collection (holding branch) (similar to 852 $b)', 'Sublocation or collection (holding branch)', 1, 0, 'items.holdingbranch', 10, 'branches', '', '', 0, 0, '', '', '', NULL),
---             ('95k', 'c', 'Shelving location (similar to 852 $c, 876-8 $l)', 'Shelving location', 1, 0, 'items.location', 10, 'LOC', '', '', 0, 0, '', '', '', NULL),
---             ('95k', 'd', 'Date acquired (similar to 541, 876-8 $d)', 'Date acquired', 0, 0, 'items.dateaccessioned', 10, '', '', 'dateaccessioned.pl', 0, 0, '', '', '', NULL),
---             ('95k', 'e', 'Source of acquisition (similar to 541 $a, 876-8 $e)', 'Source of acquisition', 1, 0, 'items.booksellerid', 10, '', '', 'bookseller.pl', 0, 0, '', '', '', NULL),
---             ('95k', 'f', 'Coded location qualifier (similar to 852 $f)', 'Coded location qualifier', 1, 0, 'items.coded_location_qualifier', 10, '', '', 'marc21_locationqualifier.pl', NULL, 0, '', '', '', NULL),
---             ('95k', 'g', 'Non-coded location qualifier (similar to 852 $g)', 'Non-coded location qualifier', 1, 0, 'items.non_coded_location_qualifier', 10, '', '', '', NULL, 0, '', '', '', NULL),
---             ('95k', 'h', 'Classification part (similar to 852 $h)', 'Classification part', 0, 0, 'items.cn_class', 10, '', '', '', NULL, 0, '', '', '', NULL),
---             ('95k', 'i', 'Item part (similar to 852 $i)', 'Item part', 1, 0, 'items.cn_item', 10, '', '', '', NULL, 0, '', '', '', NULL),
---             ('95k', 'j', 'Shelving control number (similar to 852 $j)', 'Shelving control number', 0, 0, 'items.stack', 10, 'STACK', '', '', NULL, 0, '', '', '', NULL),
---             ('95k', 'k', 'Call number prefix (similar to 852 $k)', 'Call number prefix', 0, 0, 'items.cn_prefix', 10, '', '', '', NULL, 0, '', '', '', NULL),
---             ('95k', 'l', 'Shelving form of title (similar to 852 $l)', 'Shelving form of title', 0, 0, 'items.shelving_title', 10, '', '', '', NULL, 0, '', '', '', NULL),
---             ('95k', 'm', 'Cost, normal purchase price (similar to 541 $h, 876-8 $c)', 'Cost, normal purchase price', 0, 0, 'items.price', 10, '', '', '', 0, 0, '', '', '', NULL),
---             ('95k', 'n', 'Koha collection', 'Koha collection', 0, 0, 'items.ccode', 10, 'CCODE', '', '', 0, 0, '', '', '', NULL),
---             ('95k', 'o', 'Koha full call number (similar to 852 $k $h $i $m $t combined)', 'Koha full call number', 0, 0, 'items.itemcallnumber', 10, '', 'marc21_itemcallnumber.pl', NULL, 0, 0, '', '', '', NULL),
---             ('95k', 'p', 'Piece designation (barcode) (similar to 852, 876-8 $p)', 'Piece designation (barcode)', 0, 0, 'items.barcode', 10, '', '', 'barcode.pl', 0, 0, '', '', '', NULL),
---             ('95k', 'q', 'Piece physical condition (similar to 562 $a, 852 $q)', 'Piece physical condition', 0, 0, 'items.condition', 10, '', '', '', NULL, 0, '', '', '', NULL),
---             ('95k', 'r', 'Invalid or canceled piece designation (canceled barcode) (similar to 876-8 $r)', 'Invalid or canceled piece designation (canceled barcode)', 1, 0, 'items.cancelled_barcode', 10, '', '', '', NULL, -1, '', '', '', NULL),
---             ('95k', 's', 'Copyright article-fee code (similar to 018 $a, 852 $s)', 'Copyright article-fee code', 1, 0, 'items.copyright_fee', 10, '', '', '', NULL, 0, '', '', '', NULL),
---             ('95k', 'q', 'Koha out on loan', 'Koha out on loan', 0, 0, 'items.onloan', 10, '', '', '', NULL, -5, '', '', '', NULL),
---             ('95k', 'r', 'Koha date last seen', 'Koha date last seen', 0, 0, 'items.datelastseen', 10, '', '', '', NULL, -5, '', '', '', NULL),
---             ('95k', 's', 'Koha date last borrowed', 'Koha date last borrowed', 0, 0, 'items.datelastborrowed', 10, '', '', '', NULL, -5, '', '', '', NULL),
---             ('95k', 't', 'Copy number (similar to 852, 876-8 $t)', 'Copy number', 0, 0, 'items.copynumber', 10, '', '', '', NULL, 0, '', '', '', NULL),
---             ('95k', 'u', 'Uniform Resource Identifier (similar to 852 $u)', 'Uniform Resource Identifier', 1, 0, 'items.uri', 10, '', '', '', 1, 0, '', '', '', NULL),
---             ('95k', 'v', 'Cost, replacement price (similar to 365 $b, 876-8 $c)', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, '', '', '', NULL),
---             ('95k', 'w', 'Price effective from (similar to 365 $f)', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, '', '', '', NULL),
---             ('95k', 'x', 'Nonpublic note (lost item payment) (similar to 852, 876-8 $x)', 'Nonpublic note', 1, 0, 'items.paidfor', 10, '', '', '', NULL, 7, '', '', '', NULL),
---             ('95k', 'y', 'Koha item type', 'Koha item type', 1, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, -5, '', '', '', NULL),
---             ('95k', 'z', 'Public note (similar to 852, 876-8 $z)', 'Public note', 1, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, '', '', '', NULL);
-
-
-
--- Plugins which need to be written for items Field/Subfields
-
-
---             ('952', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'items.cn_source', 10, '', '', 'marc21_classcodes.pl', NULL, 0, '', '', '', NULL),
---             ('952', 'o', 'Koha full call number', 'Koha full call number', 0, 0, 'items.itemcallnumber', 10, '', 'marc21_itemcallnumber.pl', NULL, 0, 0, '', '', '', NULL),
-
-
-
--- Current items Field/Subfields
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('952', 'LOCATION AND ITEM INFORMATION (KOHA)', 'LOCATION AND ITEM INFORMATION (KOHA)', 1, 0, '', '');
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('952', '0', 'Withdrawn status', 'Withdrawn status', 0, 0, 'items.wthdrawn', 10, 'WITHDRAWN', '', '', 0, 0, '', '', '', NULL),
-               ('952', '1', 'Lost status', 'Lost status', 0, 0, 'items.itemlost', 10, 'LOST', '', '', 0, 0, '', '', '', NULL),
-               ('952', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'items.cn_source', 10, '', '', '', NULL, 0, '', '', '', NULL),
-               ('952', '3', 'Materials specified (bound volume or other part)', 'Materials specified (bound volume or other part)', 0, 0, 'items.materials', 10, '', '', '', NULL, -1, '', '', '', NULL),
-               ('952', '4', 'Damaged status', 'Damaged status', 0, 0, 'items.damaged', 10, 'DAMAGED', '', '', NULL, 0, '', '', '', NULL),
-               ('952', '5', 'Use restrictions', 'Use restrictions', 0, 0, 'items.restricted', 10, 'RESTRICTED', '', '', 0, 0, '', '', '', NULL),
-               ('952', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'items.cn_sort', -1, '', '', '', 0, 7, '', '', '', NULL),
-               ('952', '7', 'Not for loan', 'Not for loan', 0, 0, 'items.notforloan', 10, 'NOT_LOAN', '', '', 0, 0, '', '', '', NULL),
-               ('952', '8', 'Koha collection', 'Koha collection', 0, 0, 'items.ccode', 10, 'CCODE', '', '', 0, 0, '', '', '', NULL),
-               ('952', '9', 'Koha itemnumber (autogenerated)', 'Koha itemnumber', 0, 0, 'items.itemnumber', -1, '', '', '', 0, 7, '', '', '', NULL),
-               ('952', 'a', 'Location (home branch)', 'Location (home branch)', 0, 0, 'items.homebranch', 10, 'branches', '', '', 0, 0, '', '', '', NULL),
-               ('952', 'b', 'Sublocation or collection (holding branch)', 'Sublocation or collection (holding branch)', 1, 0, 'items.holdingbranch', 10, 'branches', '', '', 0, 0, '', '', '', NULL),
-               ('952', 'c', 'Shelving location', 'Shelving location', 1, 0, 'items.location', 10, 'LOC', '', '', 0, 0, '', '', '', NULL),
-               ('952', 'd', 'Date acquired', 'Date acquired', 0, 0, 'items.dateaccessioned', 10, '', '', 'dateaccessioned.pl', 0, 0, '', '', '', NULL),
-               ('952', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, 'items.booksellerid', 10, '', '', 'bookseller.pl', 0, 0, '', '', '', NULL),
-               ('952', 'f', 'Coded location qualifier', 'Coded location qualifier', 1, 0, 'items.coded_location_qualifier', 10, '', '', 'marc21_locationqualifier.pl', NULL, 0, '', '', '', NULL),
-               ('952', 'g', 'Cost, normal purchase price', 'Cost, normal purchase price', 0, 0, 'items.price', 10, '', '', '', 0, 0, '', '', '', NULL),
-               ('952', 'j', 'Shelving control number', 'Shelving control number', 0, 0, 'items.stack', 10, 'STACK', '', '', NULL, -1, '', '', '', NULL),
-               ('952', 'l', 'Koha issues (times borrowed)', 'Koha issues (times borrowed)', 0, 0, 'items.issues', 10, '', '', '', NULL, -5, '', '', '', NULL),
-               ('952', 'm', 'Koha renewals', 'Koha renewals', 0, 0, 'items.renewals', 10, '', '', '', NULL, -5, '', '', '', NULL),
-               ('952', 'n', 'Koha reserves (requests)', 'Koha reserves (requests)', 0, 0, 'items.reserves', 10, '', '', '', NULL, -5, '', '', '', NULL),
-               ('952', 'o', 'Koha full call number', 'Koha full call number', 0, 0, 'items.itemcallnumber', 10, '', '', NULL, 0, 0, '', '', '', NULL),
-               ('952', 'p', 'Piece designation (barcode)', 'Piece designation (barcode)', 0, 0, 'items.barcode', 10, '', '', 'barcode.pl', 0, 0, '', '', '', NULL),
-               ('952', 'q', 'Koha out on loan', 'Koha out on loan', 0, 0, 'items.onloan', 10, '', '', '', NULL, -5, '', '', '', NULL),
-               ('952', 'r', 'Koha date last seen', 'Koha date last seen', 0, 0, 'items.datelastseen', 10, '', '', '', NULL, -5, '', '', '', NULL),
-               ('952', 's', 'Koha date last borrowed', 'Koha date last borrowed', 0, 0, 'items.datelastborrowed', 10, '', '', '', NULL, -5, '', '', '', NULL),
-               ('952', 't', 'Copy number', 'Copy number', 0, 0, 'items.copynumber', 10, '', '', '', NULL, 0, '', '', '', NULL),
-               ('952', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, 'items.uri', 10, '', '', '', 1, 0, '', '', '', NULL),
-               ('952', 'v', 'Cost, replacement price', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, '', '', '', NULL),
-               ('952', 'w', 'Price effective from', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, '', '', '', NULL),
-               ('952', 'x', 'Nonpublic note (lost item payment)', 'Nonpublic note (lost item payment)', 1, 0, 'items.paidfor', 10, '', '', '', NULL, 7, '', '', '', NULL),
-               ('952', 'y', 'Koha item type', 'Koha item type', 1, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, -1, '', '', '', NULL),
-               ('952', 'z', 'Public note', 'Public note', 1, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, '', '', '', NULL);
-
-
-
-
--- *******************************************************
-
-
-
--- *******************************************************
--- MARC 21 FIELDS/SUBFIELDS AND COMMMONLY USED EXTENSIONS
--- *******************************************************
-
-
--- A Few local use codes need specifying.  Several seealso, plugin, and
--- authority framework columns need improving.  $9 for authority record linking
--- needs to be added where not already provided by RLIN specifications.
--- Needs checking for errors but probably tolerable for use on a production.
--- A server can be upgraded easily from later versions of this file.
---
--- In the absense of more column support for qualifying the relative
--- importance of subfields to the record editor, some modest modification of
--- the default framework is needed setting the not-useful non-Koha holdings
--- subfields to not managed in Koha.
-
--- MARC fields including letters as part of the field identifier are from RLIN
--- and should be expected to remain along with RLIN $% subfields.  RLIN has
--- been using letters in fields because there are not enough local use number
--- fields which have not already been specified for very large union catalogue
--- networks such as RLIN itself.
-
-
--- Fields ending in c, o, or r are temporary placeholders for information from
--- a numeric value until a non-conflicting way to treat the content under the
--- proper original numeric field is adopted.
---
--- 090 for LC call numbers has been restored.  Formerly, 999, now used for the
--- Koha record ID, had been provided as a temporary place holder until all
--- Koha code for finding control fields has been changed from a numeric test
--- of < 10 to a regular expression match of m/^00/ to prevent mistaken
--- matching of fields with letters such as 09o if they were control fields.
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('01e', 'CODED FIELD ERROR (RLIN)', 'CODED FIELD ERROR (RLIN)', 1, 0, '', ''),
-               ('89e', 'ERRONEOUS FIELD, ERR (RLIN)', 'ERRONEOUS FIELD, ERR (RLIN)', 1, 0, '', ''),
-               ('91c', 'EQUIVALENCE OR CROSS-REFERENCE-CORPORATE NAME [LOCAL, CANADA], 910', 'EQUIVALENCE OR CROSS-REFERENCE-CORPORATE NAME [LOCAL, CANADA]', 1, 0, '', ''),
-               ('91r', 'RLG STANDARDS NOTE (RLIN), 910', 'RLG STANDARDS NOTE (RLIN)', 1, 0, '', ''),
-               ('94c', 'EQUIVALENCE OR CROSS-REFERENCE--TITLE [OBSOLETE] [CAN/MARC only], 945', 'EQUIVALENCE OR CROSS-REFERENCE--TITLE [OBSOLETE] [CAN/MARC only]', 1, 0, '', ''),
-               ('94a', 'ANALYSIS TREATMENT NOTE (RLIN)', 'ANALYSIS TREATMENT NOTE (RLIN)', 1, 0, '', ''),
-               ('94b', 'TREATMENT CODES (RLIN)', 'TREATMENT CODES (RLIN)', 1, 0, '', ''),
-               ('95c', 'EQUIVALENCE OR CROSS-REFERENCE--HIERARCHICAL PLACE NAME [OBSOLETE] [CAN/MARC only], 952', 'EQUIVALENCE OR CROSS-REFERENCE-HIERARCHICAL PLACE NAME [OBSOLETE] [CAN/MARC only]', 1, 0, '', ''),
-               ('95r', 'CLUSTER MEMBER (RLIN), 952', 'CLUSTER MEMBER (RLIN)', 1, 0, '', ''),
-               ('b99', 'PRIVATE LOCAL INFORMATION (RLIN)', 'PRIVATE LOCAL INFORMATION (RLIN)', 1, 0, '', ''),
-               ('u01', 'UNIT IDENTIFICATION, STATUS, AND TYPE (RLIN)', 'UNIT IDENTIFICATION, STATUS, AND TYPE (RLIN)', 0, 0, '', ''),
-               ('u02', 'STANDARD NUMBER (RLIN)', 'STANDARD NUMBER (RLIN)', 0, 0, '', ''),
-               ('u08', 'CODED INFORMATION (RLIN)', 'CODED INFORMATION (RLIN)', 0, 0, '', ''),
-               ('u10', 'REQUESTER IDENTIFICATION (RLIN)', 'REQUESTER IDENTIFICATION (RLIN)', 1, 0, '', ''),
-               ('u11', 'DEPARTMENT REPORT REQUEST (RLIN)', 'DEPARTMENT REPORT REQUEST (RLIN)', 1, 0, '', ''),
-               ('u20', 'SUPPLIER IDENTIFICATION, SUPN (RLIN)', 'SUPPLIER IDENTIFICATION, SUPN (RLIN)', 0, 0, '', ''),
-               ('u21', 'LIBRARY CODES FOR VENDOR AND ORDER (RLIN)', 'LIBRARY CODES FOR VENDOR AND ORDER (RLIN)', 0, 0, '', ''),
-               ('u22', 'SUPPLIER CODES AND CATALOG INFORMATION (RLIN)', 'SUPPLIER CODES AND CATALOG INFORMATION (RLIN)', 0, 0, '', ''),
-               ('u25', 'SUPPLIER REPORT(S) (RLIN)', 'SUPPLIER REPORT(S) (RLIN)', 0, 0, '', ''),
-               ('u30', 'INTERVALS (RLIN)', 'INTERVALS (RLIN)', 0, 0, '', ''),
-               ('u31', 'CLAIM COUNTS (RLIN)', 'CLAIM COUNTS (RLIN)', 0, 0, '', ''),
-               ('u33', 'INVOICE CLAIM (RLIN)', 'INVOICE CLAIM (RLIN)', 0, 0, '', ''),
-               ('u34', 'EXTENDED PROCUREMENT CLAIM AND REVIEW (RLIN)', 'EXTENDED PROCUREMENT CLAIM AND REVIEW (RLIN)', 0, 0, '', ''),
-               ('u40', 'EXTENDED PROCUREMENT CODES (RLIN)', 'EXTENDED PROCUREMENT CODES (RLIN)', 0, 0, '', ''),
-               ('u50', 'ACQUISITIONS NOTES (RLIN)', 'ACQUISITIONS NOTES (RLIN)', 0, 0, '', ''),
-               ('u51', 'SELECTION NOTES (RLIN)', 'SELECTION NOTES (RLIN)', 0, 0, '', ''),
-               ('u52', 'SUPPLIER INSTRUCTIONS AND NOTES, SINT (RLIN)', 'SUPPLIER INSTRUCTIONS AND NOTES, SINT (RLIN)', 0, 0, '', ''),
-               ('u53', 'CLAIM INSTRUCTIONS AND NOTES, CLNT (RLIN)', 'CLAIM INSTRUCTIONS AND NOTES, CLNT (RLIN)', 0, 0, '', ''),
-               ('u54', 'NOTES TO SERIALS DEPARTMENT (RLIN)', 'NOTES TO SERIALS DEPARTMENT (RLIN)', 0, 0, '', ''),
-               ('u55', 'CATALOGING NOTES (RLIN)', 'CATALOGING NOTES (RLIN)', 0, 0, '', ''),
-               ('u5f', 'ACCOUNTING NOTES (RLIN)', 'ACCOUNTING NOTES (RLIN)', 0, 0, '', ''),
-               ('u70', 'MATERIAL AND LOCATION INFORMATION (RLIN)', 'MATERIAL AND LOCATION INFORMATION (RLIN)', 0, 0, '', ''),
-               ('u71', 'FUND ACCOUNT (RLIN)', 'FUND ACCOUNT (RLIN)', 0, 0, '', ''),
-               ('u75', 'ITEM DETAILS (RLIN)', 'ITEM DETAILS (RLIN)', 1, 0, '', ''),
-               ('u7f', 'PRICE INFORMATION (RLIN)', 'PRICE INFORMATION (RLIN)', 1, 0, '', ''),
-               ('u90', 'TAPE OUTPUT, TAPE (RLIN)', 'TAPE OUTPUT, TAPE (RLIN)', 0, 0, '', ''),
-               ('ufi', 'FISCAL INFORMATION, FI (RLIN)', 'FISCAL INFORMATION, FI (RLIN)', 1, 0, '', '');
-
-
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('01e', 'a', 'Coded field error', 'Coded field error', 0, 0, '', 0, '', '', '', 0, -6, '', '', '', NULL),
-               ('89e', '0', '0', '0', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', '1', '1', '1', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', '2', '2', '2', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', '3', '3', '3', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', '4', '4', '4', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', '5', '5', '5', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', '6', '6', '6', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', '7', '7', '7', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', '8', '8', '8', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', '9', '9', '9', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', 'a', 'a', 'a', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', 'b', 'b', 'b', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', 'c', 'c', 'c', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', 'd', 'd', 'd', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', 'e', 'e', 'e', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', 'f', 'f', 'f', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', 'g', 'g', 'g', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', 'h', 'h', 'h', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', 'i', 'i', 'i', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', 'j', 'j', 'j', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', 'k', 'k', 'k', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', 'l', 'l', 'l', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', 'm', 'm', 'm', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', 'n', 'n', 'n', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', 'o', 'o', 'o', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', 'p', 'p', 'p', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', 'q', 'q', 'q', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', 'r', 'r', 'r', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', 's', 's', 's', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', 't', 't', 't', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', 'u', 'u', 'u', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', 'v', 'v', 'v', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', 'w', 'w', 'w', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', 'x', 'x', 'x', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', 'y', 'y', 'y', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('89e', 'z', 'z', 'z', 1, 0, '', 8, '', '', '', NULL, -6, '', '', '', NULL),
-               ('91c', '4', 'Relator code', 'Relator code', 1, 0, '', 9, '', '', '', NULL, -6, '', '', '', NULL),
-               ('91c', '6', 'Linkage', 'Linkage', 0, 0, '', 9, '', '', '', NULL, -6, '', '', '', NULL),
-               ('91c', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 9, '', '', '', NULL, -6, '', '', '', NULL),
-               ('91c', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, '', 9, '', '', '', NULL, -6, '', '', '', NULL),
-               ('91c', 'b', 'Subordinate unit', 'Subordinate unit', 1, 0, '', 9, '', '', '', NULL, -6, '', '', '', NULL),
-               ('91c', 'c', 'Location of meeting', 'Location of meeting', 0, 0, '', 9, '', '', '', NULL, -6, '', '', '', NULL),
-               ('91c', 'd', 'Date of meeting or treaty signing', 'Date of meeting or treaty signing', 1, 0, '', 9, '', '', '', NULL, -6, '', '', '', NULL),
-               ('91c', 'e', 'Relator term', 'Relator term', 1, 0, '', 9, '', '', '', NULL, -6, '', '', '', NULL),
-               ('91c', 'f', 'Date of a work', 'Date of a work', 0, 0, '', 9, '', '', '', NULL, -6, '', '', '', NULL),
-               ('91c', 'g', 'Miscellaneous information', 'Miscellaneous information', 0, 0, '', 9, '', '', '', NULL, -6, '', '', '', NULL),
-               ('91c', 'k', 'Form subheading', 'Form subheading', 1, 0, '', 9, '', '', '', NULL, -6, '', '', '', NULL),
-               ('91c', 'l', 'Language of a work', 'Language of a work', 0, 0, '', 9, '', '', '', NULL, -6, '', '', '', NULL),
-               ('91c', 'n', 'Number of part/section/meeting', 'Number of part/section/meeting', 1, 0, '', 9, '', '', '', NULL, -6, '', '', '', NULL),
-               ('91c', 'p', 'Name of part/section of a work', 'Name of part/section of a work', 1, 0, '', 9, '', '', '', NULL, -6, '', '', '', NULL),
-               ('91c', 't', 'Title of a work', 'Title of a work', 0, 0, '', 9, '', '', '', NULL, -6, '', '', '', NULL),
-               ('91c', 'u', 'Affiliation', 'Affiliation', 0, 0, '', 9, '', '', '', NULL, -6, '', '', '', NULL),
-               ('91r', 'a', 'RLG standards note', 'RLG standards note', 0, 0, '', 9, '', '', '', 0, -6, '', '', '', NULL),
-               ('93r', 'a', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, '', '', '', NULL),
-               ('93r', 'b', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, '', '', '', NULL),
-               ('93r', 'c', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, '', '', '', NULL),
-               ('93r', 'd', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, '', '', '', NULL),
-               ('93r', 'e', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, '', '', '', NULL),
-               ('93r', 'f', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, '', '', '', NULL),
-               ('93r', 'g', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, '', '', '', NULL),
-               ('93r', 'h', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, '', '', '', NULL),
-               ('93r', 'i', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, '', '', '', NULL),
-               ('93r', 'k', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, '', '', '', NULL),
-               ('94c', '6', 'Linkage', 'Linkage', 0, 0, '', 9, '', '', '', NULL, -6, '', '', '', NULL),
-               ('94c', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 9, '', '', '', NULL, -6, '', '', '', NULL),
-               ('94c', 'a', 'Title', 'Title', 0, 0, '', 9, '', '', '', NULL, -6, '', '', '', NULL),
-               ('94c', 'b', 'Remainder of title', 'Remainder of title', 0, 0, '', 9, '', '', '', NULL, -6, '', '', '', NULL),
-               ('94c', 'c', 'Statement of responsibility, etc', 'Statement of responsibility, etc', 0, 0, '', 9, '', '', '', NULL, -6, '', '', '', NULL),
-               ('94c', 'd', 'Designation of section/part/series (SE) [OBSOLETE]', 'Designation of section section/part/series (SE) [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -6, '', '', '', NULL),
-               ('94c', 'e', 'Name of part/section/series (SE) [OBSOLETE]', 'Name of part/section/series (SE) [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -6, '', '', '', NULL),
-               ('94c', 'f', 'Inclusive dates', 'Inclusive dates', 0, 0, '', 9, '', '', '', NULL, -6, '', '', '', NULL),
-               ('94c', 'g', 'Bulk dates', 'Bulk dates', 0, 0, '', 9, '', '', '', NULL, -6, '', '', '', NULL),
-               ('94c', 'h', 'Medium', 'Medium', 0, 0, '', 9, '', '', '', NULL, -6, '', '', '', NULL),
-               ('94c', 'k', 'Form', 'Form', 1, 0, '', 9, '', '', '', NULL, -6, '', '', '', NULL),
-               ('94c', 'n', 'Number of part/section of a work', 'Number of part/section of a work', 1, 0, '', 9, '', '', '', NULL, -6, '', '', '', NULL),
-               ('94c', 'p', 'Name of part/section of a work', 'Name of part/section of a work', 1, 0, '', 9, '', '', '', NULL, -6, '', '', '', NULL),
-               ('94c', 's', 'Version', 'Version', 0, 0, '', 9, '', '', '', NULL, -6, '', '', '', NULL),
-               ('94a', 'a', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, '', '', '', NULL),
-               ('94a', 'b', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, '', '', '', NULL),
-               ('94a', 'c', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, '', '', '', NULL),
-               ('94a', 'd', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, '', '', '', NULL),
-               ('94a', 'e', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, '', '', '', NULL),
-               ('94b', 'a', 'ATC', 'ATC', 0, 0, '', 9, '', '', '', 0, -6, '', '', '', NULL),
-               ('94b', 'b', 'SNR', 'SNR', 0, 0, '', 9, '', '', '', 0, -6, '', '', '', NULL),
-               ('95c', 'a', 'Country', 'Country', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, '', '', '', NULL),
-               ('95c', 'b', 'State, province, territory', 'State, province, territory', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, '', '', '', NULL),
-               ('95c', 'c', 'County, region, islands area', 'County, region, islands area', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, '', '', '', NULL),
-               ('95c', 'd', 'City', 'City', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, '', '', '', NULL),
-               ('95r', '6', 'Linkage', 'Linkage', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, '', '', '', NULL),
-               ('95r', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 9, NULL, NULL, '', NULL, 5, '', '', '', NULL),
-               ('95r', 'a', 'Record ID (RLIN)', 'Record ID (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('95r', 'b', 'Institution name (RLIN)', 'Institution name (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u01', 'a', 'Operator\'s initials, OID (RLIN)', 'Operator\'s initials, OID (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u01', 'd', 'UAD (RLIN)', 'UAD (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u01', 'f', 'FPST (RLIN)', 'FPST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u01', 'h', 'CPST (RLIN)', 'FPST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u01', 'i', 'CPST (RLIN)', 'FPST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u01', 's', 'UST (RLIN)', 'UST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u01', 't', 'UTYP (RLIN)', 'UTYP (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u02', '2', 'Source of number or code', 'Source of number or code', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u02', 'a', 'Standard number or code', 'Standard number or code', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u02', 'b', 'Additional codes following the standard number', 'Additional codes following the standard number', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u02', 'c', 'Terms of availability', 'Terms of availability', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u02', 'z', 'Canceled/invalid standard number or code', 'Canceled/invalid standard number or code', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u08', 'n', 'LSI', 'LSI', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u08', 'o', 'SID', 'SID', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u08', 'p', 'DP', 'DP', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u08', 'r', 'RUSH', 'RUSH', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u10', 'a', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u10', 'b', 'SID', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u10', 'c', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u10', 'd', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u10', 'e', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u10', 's', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u11', 'a', 'Department report request, DRR (DRRH for earlier occurrences)', 'DRR (DRRH for earlier occurrences)', 1, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u20', 'a', 'SUPN', 'SUPN', 1, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u20', 'b', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u20', 'c', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u20', 'd', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u20', 'e', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u20', 'x', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u21', 'a', 'SHIP', 'SHIP', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u21', 'b', 'BILL', 'BILL', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u21', 'c', 'DAC', 'DAC', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u21', 'n', 'LSAC', 'LSAC', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u22', 'a', 'SICO', 'SICO', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u22', 'b', 'SICO', 'SICO', 1, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u22', 'c', 'SCAT', 'SCAT', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u25', 'a', 'Supplier report(s), SRPT', 'Supplier report(s), SRPT', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u30', 'a', 'NCC [OBSOLETE]', 'NCC [OBSOLETE]', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u30', 'i', 'ICI', 'ICI', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u30', 'm', 'MCI', 'MCI', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u31', 'a', 'NCC', 'NCC', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u31', 'b', 'NCS', 'NCS', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u33', 'a', 'ICL', 'ICL', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u33', 'd', 'ICAD', 'ICAD', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u34', 'a', 'EPCL', 'EPCL', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u34', 'r', 'ERI', 'ERI', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u40', 'd', 'EPDT [OBSOLETE]', 'EPDT [OBSOLETE]', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u40', 'f', 'EFRQ', 'EFRQ', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u40', 's', 'EPST', 'EPST', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u40', 't', 'ETYP', 'ETYP', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u50', 'a', 'Acquisitions notes, AQNT', 'Acquisitions notes, AQNT', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u51', 'a', 'Selection notes, SLNT', 'Selection notes, SLNT', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u52', 'a', 'INT', 'INT', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u52', 'b', 'INT', 'NT', 1, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u53', 'a', 'CLNT', 'CLNT', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u53', 'b', 'CLNT', 'CLNT', 1, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u54', 'a', 'Notes to serials department, SRNT', 'Notes to serials department, SRNT', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u55', 'a', 'Cataloging notes, CTNT', 'Cataloging notes, CTNT', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u5f', 'a', 'Accounting notes, ACNT', 'Accounting notes, ACNT', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u70', 'a', 'QTY', 'QTY', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u70', 'b', 'MAT', 'MAT', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u70', 'l', 'MLOC', 'MLOC', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u71', 'a', 'Fund account, FUND', 'Fund account, FUND', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u75', 'a', 'ITEM', 'ITEM', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u75', 'c', 'CIRC', 'CIRC', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u75', 'h', 'IPST', 'IPST', 1, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u75', 'i', 'ITEM', 'ITEM', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u75', 'l', 'SLOC', 'SLOC', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u7f', 'a', 'LPRI', 'LPRI', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u7f', 'b', 'CURR', 'CURR', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u7f', 'k', 'CVRT [OBSOLETE]', 'CVRT [OBSOLETE]', 1, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u7f', 'p', 'LPD', 'LPD', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u7f', 'r', 'EDRT', 'EDRT', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u90', 'h', 'TAPE', 'TAPE', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('u90', 'i', 'TAPE', 'TAPE', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('ufi', 'a', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('ufi', 'b', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('ufi', 'c', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('ufi', 'd', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('ufi', 'e', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('ufi', 'f', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('ufi', 'g', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('ufi', 'h', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL),
-               ('ufi', 'n', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, '', '', '', NULL);
-
-
-
diff --git a/misc/installer_devel_notes/data/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.txt b/misc/installer_devel_notes/data/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.txt
deleted file mode 100644 (file)
index 632a467..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Default MARC 21 bibliographic framework.
diff --git a/misc/installer_devel_notes/data/en/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql b/misc/installer_devel_notes/data/en/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql
deleted file mode 100644 (file)
index dd8f4fb..0000000
+++ /dev/null
@@ -1,3134 +0,0 @@
--- *************************************************************
---       SIMPLE KOHA 3.0 MARC 21 BIBLIOGRAPHIC FRAMEWORKS
---           DEVELOPMENT NOTES AND SUPPLEMENTARY SQL
---
---                     PRETEST VERSION 0.1.7
---                          2007-11-05
---
---                            edited
---                            by thd
---
---                          BASED UPON
---
---       SIMPLE KOHA 3.0 MARC 21 BIBLIOGRAPHIC FRAMEWORKS
---                    POST-INSTALLATION SCRIPT
---
---                     PRETEST VERSION 0.1.7
---                          2007-11-05
---
---                            edited
---                            by thd
---
---                          BASED UPON
---
---  KOHA 3.0 MARC 21 STANDARD DEFAULT BIBLIOGRAPHIC FRAMEWORK
---
---                    PRETEST VERSION 0.1.7
---                          2007-11-05
---
---                            edited
---                            by thd
---
---                        AND BASED UPON
---
---          SIMPLE KOHA MARC 21 BIBLIOGRAPHIC FRAMEWORKS
---                    POST-INSTALLATION SCRIPT
---
---                     PRETEST VERSION 0.1.11
---                          2007-10-14
---
---                           drafted
---                      by thd for LibLime
---
---            with a frameworks nomenclature correction
---                     by kados at LibLime
---
---                             WITH
---
---     KOHA MARC 21 STANDARD DEFAULT BIBLIOGRAPHIC FRAMEWORK
---                    POST-INSTALLATION SCRIPT
---
---                     PRETEST VERSION 0.2.8
---                          2007-11-05
---
---                            edited
---                      by thd for LibLime
---
---                          BASED UPON
---
---     KOHA MARC 21 STANDARD DEFAULT BIBLIOGRAPHIC FRAMEWORK
---
---                     PRETEST VERSION 0.2.8
---                          2007-11-05
---
---     original default requiring greater user customisation
---                  created by a few Koha Hands
---                    guided by Paul POULAIN
---
---          revised and greatly enlarged to completion,
---               well not quite complete yet today
---           but close enough for someone to have use,
---                      by thd for LibLime
--- *************************************************************
-
-
--- *********************************************************************
--- These development notes and supplementary SQL statements have been
--- moved from the main file for easier readability of the main file and
--- to avoid possible bugs with lack of time to test for the use of
--- letters in field names such as used by RLIN to avoid conflict with
--- numbered field names already in use.
-
--- Retaining this file is important for future MARC frameworks
--- development work.
--- *********************************************************************
-
-
-SET FOREIGN_KEY_CHECKS = 0;
-
-
--- ********************************
--- SIMPLE KOHA MARC 21 FRAMEWORKS.
--- ********************************
-
-
-INSERT INTO `biblio_framework` (`frameworkcode`,`frameworktext`) VALUES
-               ('BKS', 'Books, Booklets, Workbooks'),
-               ('CF', 'CD-ROMs, DVD-ROMs, General Online Resources'),
-               ('SR', 'Audio Cassettes, CDs'),
-               ('VR', 'DVDs, VHS'),
-               ('AR', 'Models'),
-               ('KT', 'Kits'),
-               ('IR', 'Binders'),
-               ('SER', 'Serials');
-
-
--- ******************************************************
-
-
-
--- *******************************************************************
--- SIMPLE BOOKS KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS.
--- *******************************************************************
-
-
--- Current Record ID Field/Subfields
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('999', 'SYSTEM CONTROL NUMBERS (KOHA)', 'SYSTEM CONTROL NUMBERS (KOHA)', 1, 0, '', 'BKS');
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('999', 'a', 'Item type [OBSOLETE]', 'Item type [OBSOLETE]', 0, 0, NULL, -1, NULL, NULL, '', NULL, -5, 'BKS', '', '', NULL),
-               ('999', 'b', 'Koha Dewey Subclass [OBSOLETE]', 'Koha Dewey Subclass [OBSOLETE]', 0, 0, NULL, 0, NULL, NULL, '', NULL, -5, 'BKS', '', '', NULL),
-               ('999', 'c', 'Koha biblionumber', 'Koha biblionumber', 0, 0, 'biblio.biblionumber', -1, NULL, NULL, '', NULL, -5, 'BKS', '', '', NULL),
-               ('999', 'd', 'Koha biblioitemnumber', 'Koha biblioitemnumber', 0, 0, 'biblioitems.biblioitemnumber', -1, NULL, NULL, '', NULL, -5, 'BKS', '', '', NULL);
-
-
--- ******************************************************
-
-
--- Plugins which need to be written for primary biblioitems Field/Subfields.
-
-
---             ('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, '', '', 'marc21_classcodes.pl', NULL, 0, 'BKS', '', '', NULL),
---             ('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', 'marc21_callnumber.pl', NULL, 0, 'BKS', '', '', NULL),
-
-
-
--- Current primary biblioitems Field/Subfields
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('942', 'ADDED ENTRY ELEMENTS (KOHA)', 'ADDED ENTRY ELEMENTS (KOHA)', 0, 0, '', 'BKS');
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('942', '0', 'Koha issues (borrowed), all copies', 'Koha issues (borrowed), all copies', 0, 0, 'biblioitems.totalissues', 9, '', '', '', NULL, -5, 'BKS', '', '', NULL),
-               ('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, '', '', '', NULL, 0, 'BKS', '', '', NULL),
-               ('942', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'biblioitems.cn_sort', -1, '', '', '', 0, 7, 'BKS', '', '', NULL),
-               ('942', 'a', 'Institution code [OBSOLETE]', 'Institution code [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -5, 'BKS', '', '', NULL),
-               ('942', 'c', 'Item type', 'Item type', 0, 1, 'biblioitems.itemtype', 9, 'itemtypes', '', '', NULL, 0, 'BKS', '', '', NULL),
-               ('942', 'e', 'Edition', 'Edition', 0, 0, 'biblioitems.cn_edition', 9, 'CN_EDITION', '', '', NULL, 0, 'BKS', '', '', NULL),
-               ('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', '', NULL, 0, 'BKS', '', '', NULL),
-               ('942', 'i', 'Item part', 'Item part', 1, 0, 'biblioitems.cn_item', 9, '', '', '', NULL, 9, 'BKS', '', '', NULL),
-               ('942', 'k', 'Call number prefix', 'Call number prefix', 0, 0, 'biblioitems.cn_prefix', 9, '', '', '', NULL, 0, 'BKS', '', '', NULL),
-               ('942', 'm', 'Call number suffix', 'Call number suffix', 0, 0, 'biblioitems.cn_suffix', 9, '', '', '', 0, 0, 'BKS', '', '', NULL);
-
-
--- ******************************************************
-
-
--- Recommended items Field/Subfields
-
-
--- INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
---             ('95k', 'LOCATION AND ITEM INFORMATION (KOHA)', 'LOCATION AND ITEM INFORMATION (KOHA)', 1, 0, '', 'BKS');
-
--- INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
---             ('95k', '0', 'Item status (withdrawn) (similar to 876-8 $j)', 'Item status (withdrawn)', 0, 0, 'items.wthdrawn', 10, 'WITHDRAWN', '', '', 0, 0, 'BKS', '', '', NULL),
---             ('95k', '1', 'Item status (lost) (similar to 876-8 $j)', 'Item status (lost)', 0, 0, 'items.itemlost', 10, 'LOST', '', '', 0, 0, 'BKS', '', '', NULL),
---             ('95k', '2', 'Source of classification or shelving scheme (similar to 852 $2)', 'Source of classification or shelving scheme', 0, 0, 'items.cn_source', 10, '', '', 'marc21_classcodes.pl', NULL, 0, 'BKS', '', '', NULL),
---             ('95k', '3', 'Materials specified (bound volume or other part) (similar to 852, 876-8 $3)', 'Materials specified (bound volume or other part)', 0, 0, 'items.materials', 10, '', '', '', NULL, -1, 'BKS', '', '', NULL),
---             ('95k', '4', 'Item status (damaged) (similar to 876-8 $j)', 'Item status (damaged)', 0, 0, 'items.damaged', 10, 'DAMAGED', '', '', NULL, 0, 'BKS', '', '', NULL),
---             ('95k', '5', 'Use restrictions (similar to 506 $a, 876-8 $h)', 'Use restrictions', 0, 0, 'items.restricted', 10, 'RESTRICTED', '', '', 0, 0, 'BKS', '', '', NULL),
---             ('95k', '6', 'Linkage (similar to 852, 876-8 $6)', 'Linkage', 0, 0, 'items.linkage', 10, '', '', '', NULL, -6, 'BKS', '', '', NULL),
---             ('95k', '7', 'Use restrictions (not for loan) (similar to 506 $a, 876-8 $h)', 'Use restrictions (not for loan)', 0, 0, 'items.notforloan', 10, 'NOT_LOAN', '', '', 0, 0, 'BKS', '', '', NULL),
---             ('95k', '8', 'Sequence number (similar to 852, 876-8 $8)', 'Sequence number', 1, 0, 'items.sequence', 10, '', '', '', NULL, 0, 'BKS', '', '', NULL),
---             ('95k', '9', 'Koha itemnumber (autogenerated similar to 852, 876-8 $3 $8 $t combined)', 'Koha itemnumber', 0, 0, 'items.itemnumber', -1, '', '', '', 0, -5, 'BKS', '', '', NULL),
---             ('95k', 'a', 'Location (home branch) (similar to 852 $a)', 'Location (home branch)', 0, 0, 'items.homebranch', 10, 'branches', '', '', 0, 0, 'BKS', '', '', NULL),
---             ('95k', 'b', 'Sublocation or collection (holding branch) (similar to 852 $b)', 'Sublocation or collection (holding branch)', 1, 0, 'items.holdingbranch', 10, 'branches', '', '', 0, 0, 'BKS', '', '', NULL),
---             ('95k', 'c', 'Shelving location (similar to 852 $c, 876-8 $l)', 'Shelving location', 1, 0, 'items.location', 10, 'LOC', '', '', 0, 0, 'BKS', '', '', NULL),
---             ('95k', 'd', 'Date acquired (similar to 541, 876-8 $d)', 'Date acquired', 0, 0, 'items.dateaccessioned', 10, '', '', 'dateaccessioned.pl', 0, 0, 'BKS', '', '', NULL),
---             ('95k', 'e', 'Source of acquisition (similar to 541 $a, 876-8 $e)', 'Source of acquisition', 1, 0, 'items.booksellerid', 10, '', '', 'bookseller.pl', 0, 0, 'BKS', '', '', NULL),
---             ('95k', 'f', 'Coded location qualifier (similar to 852 $f)', 'Coded location qualifier', 1, 0, 'items.coded_location_qualifier', 10, '', '', 'marc21_locationqualifier.pl', NULL, 0, 'BKS', '', '', NULL),
---             ('95k', 'g', 'Non-coded location qualifier (similar to 852 $g)', 'Non-coded location qualifier', 1, 0, 'items.non_coded_location_qualifier', 10, '', '', '', NULL, 0, 'BKS', '', '', NULL),
---             ('95k', 'h', 'Classification part (similar to 852 $h)', 'Classification part', 0, 0, 'items.cn_class', 10, '', '', '', NULL, 0, 'BKS', '', '', NULL),
---             ('95k', 'i', 'Item part (similar to 852 $i)', 'Item part', 1, 0, 'items.cn_item', 10, '', '', '', NULL, 0, 'BKS', '', '', NULL),
---             ('95k', 'j', 'Shelving control number (similar to 852 $j)', 'Shelving control number', 0, 0, 'items.stack', 10, 'STACK', '', '', NULL, 0, 'BKS', '', '', NULL),
---             ('95k', 'k', 'Call number prefix (similar to 852 $k)', 'Call number prefix', 0, 0, 'items.cn_prefix', 10, '', '', '', NULL, 0, 'BKS', '', '', NULL),
---             ('95k', 'l', 'Shelving form of title (similar to 852 $l)', 'Shelving form of title', 0, 0, 'items.shelving_title', 10, '', '', '', NULL, 0, 'BKS', '', '', NULL),
---             ('95k', 'm', 'Cost, normal purchase price (similar to 541 $h, 876-8 $c)', 'Cost, normal purchase price', 0, 0, 'items.price', 10, '', '', '', 0, 0, 'BKS', '', '', NULL),
---             ('95k', 'n', 'Koha collection', 'Koha collection', 0, 0, 'items.ccode', 10, 'CCODE', '', '', 0, 0, 'BKS', '', '', NULL),
---             ('95k', 'o', 'Koha full call number (similar to 852 $k $h $i $m $t combined)', 'Koha full call number', 0, 0, 'items.itemcallnumber', 10, '', 'marc21_itemcallnumber.pl', NULL, 0, 0, 'BKS', '', '', NULL),
---             ('95k', 'p', 'Piece designation (barcode) (similar to 852, 876-8 $p)', 'Piece designation (barcode)', 0, 0, 'items.barcode', 10, '', '', 'barcode.pl', 0, 0, 'BKS', '', '', NULL),
---             ('95k', 'q', 'Piece physical condition (similar to 562 $a, 852 $q)', 'Piece physical condition', 0, 0, 'items.condition', 10, '', '', '', NULL, 0, 'BKS', '', '', NULL),
---             ('95k', 'r', 'Invalid or canceled piece designation (canceled barcode) (similar to 876-8 $r)', 'Invalid or canceled piece designation (canceled barcode)', 1, 0, 'items.cancelled_barcode', 10, '', '', '', NULL, -1, 'BKS', '', '', NULL),
---             ('95k', 's', 'Copyright article-fee code (similar to 018 $a, 852 $s)', 'Copyright article-fee code', 1, 0, 'items.copyright_fee', 10, '', '', '', NULL, 0, 'BKS', '', '', NULL),
---             ('95k', 'q', 'Koha out on loan', 'Koha out on loan', 1, 0, 'items.onloan', 10, '', '', '', NULL, -5, 'BKS', '', '', NULL),
---             ('95k', 'r', 'Koha date last seen', 'Koha date last seen', 1, 0, 'items.datelastseen', 10, '', '', '', NULL, -5, 'BKS', '', '', NULL),
---             ('95k', 's', 'Koha date last borrowed', 'Koha date last borrowed', 1, 0, 'items.datelastborrowed', 10, '', '', '', NULL, -5, 'BKS', '', '', NULL),
---             ('95k', 't', 'Copy number (similar to 852, 876-8 $t)', 'Copy number', 0, 0, 'items.copynumber', 10, '', '', '', NULL, 0, 'BKS', '', '', NULL),
---             ('95k', 'u', 'Uniform Resource Identifier (similar to 852 $u)', 'Uniform Resource Identifier', 1, 0, 'items.uri', 10, '', '', '', 1, 0, 'BKS', '', '', NULL),
---             ('95k', 'v', 'Cost, replacement price (similar to 365 $b, 876-8 $c)', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'BKS', '', '', NULL),
---             ('95k', 'w', 'Price effective from (similar to 365 $f)', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'BKS', '', '', NULL),
---             ('95k', 'x', 'Nonpublic note (lost item payment) (similar to 852, 876-8 $x)', 'Nonpublic note', 1, 0, 'items.paidfor', 10, '', '', '', NULL, 7, 'BKS', '', '', NULL),
---             ('95k', 'y', 'Koha item type', 'Koha item type', 1, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, -5, 'BKS', '', '', NULL),
---             ('95k', 'z', 'Public note (similar to 852, 876-8 $z)', 'Public note', 1, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'BKS', '', '', NULL);
-
-
-
--- Current items Field/Subfields
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('952', 'LOCATION AND ITEM INFORMATION (KOHA)', 'LOCATION AND ITEM INFORMATION (KOHA)', 1, 0, '', 'BKS');
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('952', '0', 'Withdrawn status', 'Withdrawn status', 0, 0, 'items.wthdrawn', 10, 'WITHDRAWN', '', '', 0, 0, 'BKS', '', '', NULL),
-               ('952', '1', 'Lost status', 'Lost status', 0, 0, 'items.itemlost', 10, 'LOST', '', '', 0, 0, 'BKS', '', '', NULL),
-               ('952', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'items.cn_source', 10, '', '', 'marc21_classcodes.pl', NULL, 0, 'BKS', '', '', NULL),
-               ('952', '3', 'Materials specified (bound volume or other part)', 'Materials specified (bound volume or other part)', 0, 0, 'items.materials', 10, '', '', '', NULL, -1, 'BKS', '', '', NULL),
-               ('952', '4', 'Damaged status', 'Damaged status', 0, 0, 'items.damaged', 10, 'DAMAGED', '', '', NULL, 0, 'BKS', '', '', NULL),
-               ('952', '5', 'Use restrictions', 'Use restrictions', 0, 0, 'items.restricted', 10, 'RESTRICTED', '', '', 0, 0, 'BKS', '', '', NULL),
-               ('952', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'items.cn_sort', -1, '', '', '', 0, 7, 'BKS', '', '', NULL),
-               ('952', '7', 'Not for loan', 'Not for loan', 0, 0, 'items.notforloan', 10, 'NOT_LOAN', '', '', 0, 0, 'BKS', '', '', NULL),
-               ('952', '8', 'Koha collection', 'Koha collection', 0, 0, 'items.ccode', 10, 'CCODE', '', '', 0, 0, 'BKS', '', '', NULL),
-               ('952', '9', 'Koha itemnumber (autogenerated)', 'Koha itemnumber', 0, 0, 'items.itemnumber', -1, '', '', '', 0, 7, 'BKS', '', '', NULL),
-               ('952', 'a', 'Location (home branch)', 'Location (home branch)', 0, 0, 'items.homebranch', 10, 'branches', '', '', 0, 0, 'BKS', '', '', NULL),
-               ('952', 'b', 'Sublocation or collection (holding branch)', 'Sublocation or collection (holding branch)', 1, 0, 'items.holdingbranch', 10, 'branches', '', '', 0, 0, 'BKS', '', '', NULL),
-               ('952', 'c', 'Shelving location', 'Shelving location', 1, 0, 'items.location', 10, 'LOC', '', '', 0, 0, 'BKS', '', '', NULL),
-               ('952', 'd', 'Date acquired', 'Date acquired', 0, 0, 'items.dateaccessioned', 10, '', '', 'dateaccessioned.pl', 0, 0, 'BKS', '', '', NULL),
-               ('952', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, 'items.booksellerid', 10, '', '', 'bookseller.pl', 0, 0, 'BKS', '', '', NULL),
-               ('952', 'f', 'Coded location qualifier', 'Coded location qualifier', 1, 0, 'items.coded_location_qualifier', 10, '', '', 'marc21_locationqualifier.pl', NULL, 0, 'BKS', '', '', NULL),
-               ('952', 'g', 'Cost, normal purchase price', 'Cost, normal purchase price', 0, 0, 'items.price', 10, '', '', '', 0, 0, 'BKS', '', '', NULL),
-               ('952', 'j', 'Shelving control number', 'Shelving control number', 0, 0, 'items.stack', 10, 'STACK', '', '', NULL, -1, 'BKS', '', '', NULL),
-               ('952', 'l', 'Koha issues (times borrowed)', 'Koha issues (times borrowed)', 0, 0, 'items.issues', 10, '', '', '', NULL, -5, 'BKS', '', '', NULL),
-               ('952', 'm', 'Koha renewals', 'Koha renewals', 0, 0, 'items.renewals', 10, '', '', '', NULL, -5, 'BKS', '', '', NULL),
-               ('952', 'n', 'Koha reserves (requests)', 'Koha reserves (requests)', 0, 0, 'items.reserves', 10, '', '', '', NULL, -5, 'BKS', '', '', NULL),
-               ('952', 'o', 'Koha full call number', 'Koha full call number', 0, 0, 'items.itemcallnumber', 10, '', 'marc21_itemcallnumber.pl', NULL, 0, 0, 'BKS', '', '', NULL),
-               ('952', 'p', 'Piece designation (barcode)', 'Piece designation (barcode)', 0, 0, 'items.barcode', 10, '', '', 'barcode.pl', 0, 0, 'BKS', '', '', NULL),
-               ('952', 'q', 'Koha out on loan', 'Koha out on loan', 1, 0, 'items.onloan', 10, '', '', '', NULL, -5, 'BKS', '', '', NULL),
-               ('952', 'r', 'Koha date last seen', 'Koha date last seen', 1, 0, 'items.datelastseen', 10, '', '', '', NULL, -5, 'BKS', '', '', NULL),
-               ('952', 's', 'Koha date last borrowed', 'Koha date last borrowed', 1, 0, 'items.datelastborrowed', 10, '', '', '', NULL, -5, 'BKS', '', '', NULL),
-               ('952', 't', 'Copy number', 'Copy number', 0, 0, 'items.copynumber', 10, '', '', '', NULL, 0, 'BKS', '', '', NULL),
-               ('952', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, 'items.uri', 10, '', '', '', 1, 0, 'BKS', '', '', NULL),
-               ('952', 'v', 'Cost, replacement price', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'BKS', '', '', NULL),
-               ('952', 'w', 'Price effective from', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'BKS', '', '', NULL),
-               ('952', 'x', 'Nonpublic note (lost item payment)', 'Nonpublic note (lost item payment)', 1, 0, 'items.paidfor', 10, '', '', '', NULL, 7, 'BKS', '', '', NULL),
-               ('952', 'y', 'Koha item type', 'Koha item type', 1, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, -1, 'BKS', '', '', NULL),
-               ('952', 'z', 'Public note', 'Public note', 1, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'BKS', '', '', NULL);
-
-
-
--- *******************************************************
-
-
-
--- *********************************************************************
--- SIMPLE BOOKS MARC 21 FIELDS/SUBFIELDS AND COMMMONLY USED EXTENSIONS.
--- *********************************************************************
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('01e', 'CODED FIELD ERROR (RLIN)', 'CODED FIELD ERROR (RLIN)', 1, 0, '', 'BKS'),
-               ('89e', 'ERRONEOUS FIELD, ERR (RLIN)', 'ERRONEOUS FIELD, ERR (RLIN)', 1, 0, '', 'BKS'),
-               ('91c', 'EQUIVALENCE OR CROSS-REFERENCE-CORPORATE NAME [LOCAL, CANADA]', 'EQUIVALENCE OR CROSS-REFERENCE-CORPORATE NAME [LOCAL, CANADA]', 1, 0, '', 'BKS'),
-               ('91r', 'RLG STANDARDS NOTE (RLIN)', 'RLG STANDARDS NOTE (RLIN)', 1, 0, '', 'BKS'),
-               ('93r', 'SUMMARY HOLDINGS STATEMENT (RLIN)', 'SUMMARY HOLDINGS STATEMENT (RLIN)', 1, 0, '', 'BKS'),
-               ('94c', 'EQUIVALENCE OR CROSS-REFERENCE--TITLE [OBSOLETE] [CAN/MARC only]', 'EQUIVALENCE OR CROSS-REFERENCE--TITLE [OBSOLETE] [CAN/MARC only]', 1, 0, '', 'BKS'),
-               ('94a', 'ANALYSIS TREATMENT NOTE (RLIN)', 'ANALYSIS TREATMENT NOTE (RLIN)', 1, 0, '', 'BKS'),
-               ('94b', 'TREATMENT CODES (RLIN)', 'TREATMENT CODES (RLIN)', 1, 0, '', 'BKS'),
-               ('95c', 'EQUIVALENCE OR CROSS-REFERENCE--HIERARCHICAL PLACE NAME [OBSOLETE] [CAN/MARC only]', 'EQUIVALENCE OR CROSS-REFERENCE-HIERARCHICAL PLACE NAME [OBSOLETE] [CAN/MARC only]', 1, 0, '', 'BKS'),
-               ('95r', 'CLUSTER MEMBER (RLIN)', 'CLUSTER MEMBER (RLIN)', 1, 0, '', 'BKS'),
-               ('b99', 'PRIVATE LOCAL INFORMATION (RLIN)', 'PRIVATE LOCAL INFORMATION (RLIN)', 1, 0, '', 'BKS'),
-               ('u01', 'UNIT IDENTIFICATION, STATUS, AND TYPE (RLIN)', 'UNIT IDENTIFICATION, STATUS, AND TYPE (RLIN)', 0, 0, '', 'BKS'),
-               ('u02', 'STANDARD NUMBER (RLIN)', 'STANDARD NUMBER (RLIN)', 0, 0, '', 'BKS'),
-               ('u08', 'CODED INFORMATION (RLIN)', 'CODED INFORMATION (RLIN)', 0, 0, '', 'BKS'),
-               ('u10', 'REQUESTER IDENTIFICATION (RLIN)', 'REQUESTER IDENTIFICATION (RLIN)', 1, 0, '', 'BKS'),
-               ('u11', 'DEPARTMENT REPORT REQUEST (RLIN)', 'DEPARTMENT REPORT REQUEST (RLIN)', 1, 0, '', 'BKS'),
-               ('u20', 'SUPPLIER IDENTIFICATION, SUPN (RLIN)', 'SUPPLIER IDENTIFICATION, SUPN (RLIN)', 0, 0, '', 'BKS'),
-               ('u21', 'LIBRARY CODES FOR VENDOR AND ORDER (RLIN)', 'LIBRARY CODES FOR VENDOR AND ORDER (RLIN)', 0, 0, '', 'BKS'),
-               ('u22', 'SUPPLIER CODES AND CATALOG INFORMATION (RLIN)', 'SUPPLIER CODES AND CATALOG INFORMATION (RLIN)', 0, 0, '', 'BKS'),
-               ('u25', 'SUPPLIER REPORT(S) (RLIN)', 'SUPPLIER REPORT(S) (RLIN)', 0, 0, '', 'BKS'),
-               ('u30', 'INTERVALS (RLIN)', 'INTERVALS (RLIN)', 0, 0, '', 'BKS'),
-               ('u31', 'CLAIM COUNTS (RLIN)', 'CLAIM COUNTS (RLIN)', 0, 0, '', 'BKS'),
-               ('u33', 'INVOICE CLAIM (RLIN)', 'INVOICE CLAIM (RLIN)', 0, 0, '', 'BKS'),
-               ('u34', 'EXTENDED PROCUREMENT CLAIM AND REVIEW (RLIN)', 'EXTENDED PROCUREMENT CLAIM AND REVIEW (RLIN)', 0, 0, '', 'BKS'),
-               ('u40', 'EXTENDED PROCUREMENT CODES (RLIN)', 'EXTENDED PROCUREMENT CODES (RLIN)', 0, 0, '', 'BKS'),
-               ('u50', 'ACQUISITIONS NOTES (RLIN)', 'ACQUISITIONS NOTES (RLIN)', 0, 0, '', 'BKS'),
-               ('u51', 'SELECTION NOTES (RLIN)', 'SELECTION NOTES (RLIN)', 0, 0, '', 'BKS'),
-               ('u52', 'SUPPLIER INSTRUCTIONS AND NOTES, SINT (RLIN)', 'SUPPLIER INSTRUCTIONS AND NOTES, SINT (RLIN)', 0, 0, '', 'BKS'),
-               ('u53', 'CLAIM INSTRUCTIONS AND NOTES, CLNT (RLIN)', 'CLAIM INSTRUCTIONS AND NOTES, CLNT (RLIN)', 0, 0, '', 'BKS'),
-               ('u54', 'NOTES TO SERIALS DEPARTMENT (RLIN)', 'NOTES TO SERIALS DEPARTMENT (RLIN)', 0, 0, '', 'BKS'),
-               ('u55', 'CATALOGING NOTES (RLIN)', 'CATALOGING NOTES (RLIN)', 0, 0, '', 'BKS'),
-               ('u5f', 'ACCOUNTING NOTES (RLIN)', 'ACCOUNTING NOTES (RLIN)', 0, 0, '', 'BKS'),
-               ('u70', 'MATERIAL AND LOCATION INFORMATION (RLIN)', 'MATERIAL AND LOCATION INFORMATION (RLIN)', 0, 0, '', 'BKS'),
-               ('u71', 'FUND ACCOUNT (RLIN)', 'FUND ACCOUNT (RLIN)', 0, 0, '', 'BKS'),
-               ('u75', 'ITEM DETAILS (RLIN)', 'ITEM DETAILS (RLIN)', 1, 0, '', 'BKS'),
-               ('u7f', 'PRICE INFORMATION (RLIN)', 'PRICE INFORMATION (RLIN)', 1, 0, '', 'BKS'),
-               ('u90', 'TAPE OUTPUT, TAPE (RLIN)', 'TAPE OUTPUT, TAPE (RLIN)', 0, 0, '', 'BKS'),
-               ('ufi', 'FISCAL INFORMATION, FI (RLIN)', 'FISCAL INFORMATION, FI (RLIN)', 1, 0, '', 'BKS');
-
-
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('01e', 'a', 'Coded field error', 'Coded field error', 0, 0, '', 0, '', '', '', 0, -6, 'BKS', '', '', NULL),
-               ('89e', '0', '0', '0', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', '1', '1', '1', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', '2', '2', '2', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', '3', '3', '3', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', '4', '4', '4', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', '5', '5', '5', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', '6', '6', '6', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', '7', '7', '7', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', '8', '8', '8', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', '9', '9', '9', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', 'a', 'a', 'a', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', 'b', 'b', 'b', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', 'c', 'c', 'c', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', 'd', 'd', 'd', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', 'e', 'e', 'e', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', 'f', 'f', 'f', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', 'g', 'g', 'g', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', 'h', 'h', 'h', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', 'i', 'i', 'i', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', 'j', 'j', 'j', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', 'k', 'k', 'k', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', 'l', 'l', 'l', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', 'm', 'm', 'm', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', 'n', 'n', 'n', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', 'o', 'o', 'o', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', 'p', 'p', 'p', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', 'q', 'q', 'q', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', 'r', 'r', 'r', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', 's', 's', 's', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', 't', 't', 't', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', 'u', 'u', 'u', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', 'v', 'v', 'v', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', 'w', 'w', 'w', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', 'x', 'x', 'x', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', 'y', 'y', 'y', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('89e', 'z', 'z', 'z', 1, 0, '', 8, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('91c', '4', 'Relator code', 'Relator code', 1, 0, '', 9, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('91c', '6', 'Linkage', 'Linkage', 0, 0, '', 9, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('91c', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 9, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('91c', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, '', 9, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('91c', 'b', 'Subordinate unit', 'Subordinate unit', 1, 0, '', 9, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('91c', 'c', 'Location of meeting', 'Location of meeting', 0, 0, '', 9, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('91c', 'd', 'Date of meeting or treaty signing', 'Date of meeting or treaty signing', 1, 0, '', 9, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('91c', 'e', 'Relator term', 'Relator term', 1, 0, '', 9, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('91c', 'f', 'Date of a work', 'Date of a work', 0, 0, '', 9, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('91c', 'g', 'Miscellaneous information', 'Miscellaneous information', 0, 0, '', 9, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('91c', 'k', 'Form subheading', 'Form subheading', 1, 0, '', 9, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('91c', 'l', 'Language of a work', 'Language of a work', 0, 0, '', 9, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('91c', 'n', 'Number of part/section/meeting', 'Number of part/section/meeting', 1, 0, '', 9, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('91c', 'p', 'Name of part/section of a work', 'Name of part/section of a work', 1, 0, '', 9, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('91c', 't', 'Title of a work', 'Title of a work', 0, 0, '', 9, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('91c', 'u', 'Affiliation', 'Affiliation', 0, 0, '', 9, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('91r', 'a', 'RLG standards note', 'RLG standards note', 0, 0, '', 9, '', '', '', 0, -6, 'BKS', '', '', NULL),
-               ('93r', 'a', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'BKS', '', '', NULL),
-               ('93r', 'b', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'BKS', '', '', NULL),
-               ('93r', 'c', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'BKS', '', '', NULL),
-               ('93r', 'd', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'BKS', '', '', NULL),
-               ('93r', 'e', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'BKS', '', '', NULL),
-               ('93r', 'f', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'BKS', '', '', NULL),
-               ('93r', 'g', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'BKS', '', '', NULL),
-               ('93r', 'h', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'BKS', '', '', NULL),
-               ('93r', 'i', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'BKS', '', '', NULL),
-               ('93r', 'k', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'BKS', '', '', NULL),
-               ('94c', '6', 'Linkage', 'Linkage', 0, 0, '', 9, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('94c', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 9, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('94c', 'a', 'Title', 'Title', 0, 0, '', 9, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('94c', 'b', 'Remainder of title', 'Remainder of title', 0, 0, '', 9, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('94c', 'c', 'Statement of responsibility, etc', 'Statement of responsibility, etc', 0, 0, '', 9, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('94c', 'd', 'Designation of section/part/series (SE) [OBSOLETE]', 'Designation of section section/part/series (SE) [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('94c', 'e', 'Name of part/section/series (SE) [OBSOLETE]', 'Name of part/section/series (SE) [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('94c', 'f', 'Inclusive dates', 'Inclusive dates', 0, 0, '', 9, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('94c', 'g', 'Bulk dates', 'Bulk dates', 0, 0, '', 9, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('94c', 'h', 'Medium', 'Medium', 0, 0, '', 9, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('94c', 'k', 'Form', 'Form', 1, 0, '', 9, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('94c', 'n', 'Number of part/section of a work', 'Number of part/section of a work', 1, 0, '', 9, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('94c', 'p', 'Name of part/section of a work', 'Name of part/section of a work', 1, 0, '', 9, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('94c', 's', 'Version', 'Version', 0, 0, '', 9, '', '', '', NULL, -6, 'BKS', '', '', NULL),
-               ('94a', 'a', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'BKS', '', '', NULL),
-               ('94a', 'b', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'BKS', '', '', NULL),
-               ('94a', 'c', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'BKS', '', '', NULL),
-               ('94a', 'd', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'BKS', '', '', NULL),
-               ('94a', 'e', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'BKS', '', '', NULL),
-               ('94b', 'a', 'ATC', 'ATC', 0, 0, '', 9, '', '', '', 0, -6, 'BKS', '', '', NULL),
-               ('94b', 'b', 'SNR', 'SNR', 0, 0, '', 9, '', '', '', 0, -6, 'BKS', '', '', NULL),
-               ('95c', 'a', 'Country', 'Country', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'BKS', '', '', NULL),
-               ('95c', 'b', 'State, province, territory', 'State, province, territory', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'BKS', '', '', NULL),
-               ('95c', 'c', 'County, region, islands area', 'County, region, islands area', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'BKS', '', '', NULL),
-               ('95c', 'd', 'City', 'City', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'BKS', '', '', NULL),
-               ('95r', '6', 'Linkage', 'Linkage', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'BKS', '', '', NULL),
-               ('95r', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'BKS', '', '', NULL),
-               ('95r', 'a', 'Record ID (RLIN)', 'Record ID (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('95r', 'b', 'Institution name (RLIN)', 'Institution name (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u01', 'a', 'Operator\'s initials, OID (RLIN)', 'Operator\'s initials, OID (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u01', 'd', 'UAD (RLIN)', 'UAD (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u01', 'f', 'FPST (RLIN)', 'FPST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u01', 'h', 'CPST (RLIN)', 'FPST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u01', 'i', 'CPST (RLIN)', 'FPST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u01', 's', 'UST (RLIN)', 'UST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u01', 't', 'UTYP (RLIN)', 'UTYP (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u02', '2', 'Source of number or code', 'Source of number or code', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u02', 'a', 'Standard number or code', 'Standard number or code', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u02', 'b', 'Additional codes following the standard number', 'Additional codes following the standard number', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u02', 'c', 'Terms of availability', 'Terms of availability', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u02', 'z', 'Canceled/invalid standard number or code', 'Canceled/invalid standard number or code', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u08', 'n', 'LSI', 'LSI', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u08', 'o', 'SID', 'SID', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u08', 'p', 'DP', 'DP', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u08', 'r', 'RUSH', 'RUSH', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u10', 'a', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u10', 'b', 'SID', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u10', 'c', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u10', 'd', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u10', 'e', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u10', 's', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u11', 'a', 'Department report request, DRR (DRRH for earlier occurrences)', 'DRR (DRRH for earlier occurrences)', 1, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u20', 'a', 'SUPN', 'SUPN', 1, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u20', 'b', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u20', 'c', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u20', 'd', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u20', 'e', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u20', 'x', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u21', 'a', 'SHIP', 'SHIP', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u21', 'b', 'BILL', 'BILL', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u21', 'c', 'DAC', 'DAC', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u21', 'n', 'LSAC', 'LSAC', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u22', 'a', 'SICO', 'SICO', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u22', 'b', 'SICO', 'SICO', 1, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u22', 'c', 'SCAT', 'SCAT', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u25', 'a', 'Supplier report(s), SRPT', 'Supplier report(s), SRPT', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u30', 'a', 'NCC [OBSOLETE]', 'NCC [OBSOLETE]', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u30', 'i', 'ICI', 'ICI', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u30', 'm', 'MCI', 'MCI', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u31', 'a', 'NCC', 'NCC', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u31', 'b', 'NCS', 'NCS', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u33', 'a', 'ICL', 'ICL', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u33', 'd', 'ICAD', 'ICAD', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u34', 'a', 'EPCL', 'EPCL', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u34', 'r', 'ERI', 'ERI', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u40', 'd', 'EPDT [OBSOLETE]', 'EPDT [OBSOLETE]', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u40', 'f', 'EFRQ', 'EFRQ', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u40', 's', 'EPST', 'EPST', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u40', 't', 'ETYP', 'ETYP', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u50', 'a', 'Acquisitions notes, AQNT', 'Acquisitions notes, AQNT', 0, 0, '', 9, '', '', '', 0, 5, 'BKS', '', '', NULL),
-               ('u51', 'a', 'Selection notes, SLNT', 'Selection notes, SLNT', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u52', 'a', 'INT', 'INT', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u52', 'b', 'INT', 'NT', 1, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u53', 'a', 'CLNT', 'CLNT', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u53', 'b', 'CLNT', 'CLNT', 1, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u54', 'a', 'Notes to serials department, SRNT', 'Notes to serials department, SRNT', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u55', 'a', 'Cataloging notes, CTNT', 'Cataloging notes, CTNT', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u5f', 'a', 'Accounting notes, ACNT', 'Accounting notes, ACNT', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u70', 'a', 'QTY', 'QTY', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u70', 'b', 'MAT', 'MAT', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u70', 'l', 'MLOC', 'MLOC', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u71', 'a', 'Fund account, FUND', 'Fund account, FUND', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u75', 'a', 'ITEM', 'ITEM', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u75', 'c', 'CIRC', 'CIRC', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u75', 'h', 'IPST', 'IPST', 1, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u75', 'i', 'ITEM', 'ITEM', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u75', 'l', 'SLOC', 'SLOC', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u7f', 'a', 'LPRI', 'LPRI', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u7f', 'b', 'CURR', 'CURR', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u7f', 'k', 'CVRT [OBSOLETE]', 'CVRT [OBSOLETE]', 1, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u7f', 'p', 'LPD', 'LPD', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u7f', 'r', 'EDRT', 'EDRT', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u90', 'h', 'TAPE', 'TAPE', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u90', 'i', 'TAPE', 'TAPE', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('ufi', 'a', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('ufi', 'b', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('ufi', 'c', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('ufi', 'd', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('ufi', 'e', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('ufi', 'f', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('ufi', 'g', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('ufi', 'h', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('ufi', 'n', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL);
-
-
--- *******************************************************
-
-
-
--- ****************************************************************************
--- SIMPLE COMPUTER FILES KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS.
--- ****************************************************************************
-
-
--- Current Record ID Field/Subfields
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('999', 'SYSTEM CONTROL NUMBERS (KOHA)', 'SYSTEM CONTROL NUMBERS (KOHA)', 1, 0, '', 'CF');
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('999', 'a', 'Item type [OBSOLETE]', 'Item type [OBSOLETE]', 0, 0, NULL, -1, NULL, NULL, '', NULL, -5, 'CF', '', '', NULL),
-               ('999', 'b', 'Koha Dewey Subclass [OBSOLETE]', 'Koha Dewey Subclass [OBSOLETE]', 0, 0, NULL, 0, NULL, NULL, '', NULL, -5, 'CF', '', '', NULL),
-               ('999', 'c', 'Koha biblionumber', 'Koha biblionumber', 0, 0, 'biblio.biblionumber', -1, NULL, NULL, '', NULL, -5, 'CF', '', '', NULL),
-               ('999', 'd', 'Koha biblioitemnumber', 'Koha biblioitemnumber', 0, 0, 'biblioitems.biblioitemnumber', -1, NULL, NULL, '', NULL, -5, 'CF', '', '', NULL);
-
-
--- ******************************************************
-
-
--- Plugins which need to be written for primary biblioitems Field/Subfields.
-
-
---             ('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, '', '', 'marc21_classcodes.pl', NULL, 0, 'CF', '', '', NULL),
---             ('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', 'marc21_callnumber.pl', NULL, 0, 'CF', '', '', NULL),
-
-
-
--- Current primary biblioitems Field/Subfields
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('942', 'ADDED ENTRY ELEMENTS (KOHA)', 'ADDED ENTRY ELEMENTS (KOHA)', 0, 0, '', 'CF');
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('942', '0', 'Koha issues (borrowed), all copies', 'Koha issues (borrowed), all copies', 0, 0, 'biblioitems.totalissues', 9, '', '', '', NULL, -5, 'CF', '', '', NULL),
-               ('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, '', '', '', NULL, 0, 'CF', '', '', NULL),
-               ('942', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'biblioitems.cn_sort', -1, '', '', '', 0, 7, 'CF', '', '', NULL),
-               ('942', 'a', 'Institution code [OBSOLETE]', 'Institution code [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -5, 'CF', '', '', NULL),
-               ('942', 'c', 'Item type', 'Item type', 0, 1, 'biblioitems.itemtype', 9, 'itemtypes', '', '', NULL, 0, 'CF', '', '', NULL),
-               ('942', 'e', 'Edition', 'Edition', 0, 0, 'biblioitems.cn_edition', 9, 'CN_EDITION', '', '', NULL, 0, 'CF', '', '', NULL),
-               ('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', '', NULL, 0, 'CF', '', '', NULL),
-               ('942', 'i', 'Item part', 'Item part', 1, 0, 'biblioitems.cn_item', 9, '', '', '', NULL, 9, 'CF', '', '', NULL),
-               ('942', 'k', 'Call number prefix', 'Call number prefix', 0, 0, 'biblioitems.cn_prefix', 9, '', '', '', NULL, 0, 'CF', '', '', NULL),
-               ('942', 'm', 'Call number suffix', 'Call number suffix', 0, 0, 'biblioitems.cn_suffix', 9, '', '', '', 0, 0, 'CF', '', '', NULL);
-
-
--- ******************************************************
-
-
--- Recommended items Field/Subfields
-
-
--- INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
---             ('95k', 'LOCATION AND ITEM INFORMATION (KOHA)', 'LOCATION AND ITEM INFORMATION (KOHA)', 1, 0, '', 'CF');
-
--- INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
---             ('95k', '0', 'Item status (withdrawn) (similar to 876-8 $j)', 'Item status (withdrawn)', 0, 0, 'items.wthdrawn', 10, 'WITHDRAWN', '', '', 0, 0, 'CF', '', '', NULL),
---             ('95k', '1', 'Item status (lost) (similar to 876-8 $j)', 'Item status (lost)', 0, 0, 'items.itemlost', 10, 'LOST', '', '', 0, 0, 'CF', '', '', NULL),
---             ('95k', '2', 'Source of classification or shelving scheme (similar to 852 $2)', 'Source of classification or shelving scheme', 0, 0, 'items.cn_source', 10, '', '', 'marc21_classcodes.pl', NULL, 0, 'CF', '', '', NULL),
---             ('95k', '3', 'Materials specified (bound volume or other part) (similar to 852, 876-8 $3)', 'Materials specified (bound volume or other part)', 0, 0, 'items.materials', 10, '', '', '', NULL, -1, 'CF', '', '', NULL),
---             ('95k', '4', 'Item status (damaged) (similar to 876-8 $j)', 'Item status (damaged)', 0, 0, 'items.damaged', 10, 'DAMAGED', '', '', NULL, 0, 'CF', '', '', NULL),
---             ('95k', '5', 'Use restrictions (similar to 506 $a, 876-8 $h)', 'Use restrictions', 0, 0, 'items.restricted', 10, 'RESTRICTED', '', '', 0, 0, 'CF', '', '', NULL),
---             ('95k', '6', 'Linkage (similar to 852, 876-8 $6)', 'Linkage', 0, 0, 'items.linkage', 10, '', '', '', NULL, -6, 'CF', '', '', NULL),
---             ('95k', '7', 'Use restrictions (not for loan) (similar to 506 $a, 876-8 $h)', 'Use restrictions (not for loan)', 0, 0, 'items.notforloan', 10, 'NOT_LOAN', '', '', 0, 0, 'CF', '', '', NULL),
---             ('95k', '8', 'Sequence number (similar to 852, 876-8 $8)', 'Sequence number', 1, 0, 'items.sequence', 10, '', '', '', NULL, 0, 'CF', '', '', NULL),
---             ('95k', '9', 'Koha itemnumber (autogenerated similar to 852, 876-8 $3 $8 $t combined)', 'Koha itemnumber', 0, 0, 'items.itemnumber', -1, '', '', '', 0, -5, 'CF', '', '', NULL),
---             ('95k', 'a', 'Location (home branch) (similar to 852 $a)', 'Location (home branch)', 0, 0, 'items.homebranch', 10, 'branches', '', '', 0, 0, 'CF', '', '', NULL),
---             ('95k', 'b', 'Sublocation or collection (holding branch) (similar to 852 $b)', 'Sublocation or collection (holding branch)', 1, 0, 'items.holdingbranch', 10, 'branches', '', '', 0, 0, 'CF', '', '', NULL),
---             ('95k', 'c', 'Shelving location (similar to 852 $c, 876-8 $l)', 'Shelving location', 1, 0, 'items.location', 10, 'LOC', '', '', 0, 0, 'CF', '', '', NULL),
---             ('95k', 'd', 'Date acquired (similar to 541, 876-8 $d)', 'Date acquired', 0, 0, 'items.dateaccessioned', 10, '', '', 'dateaccessioned.pl', 0, 0, 'CF', '', '', NULL),
---             ('95k', 'e', 'Source of acquisition (similar to 541 $a, 876-8 $e)', 'Source of acquisition', 1, 0, 'items.booksellerid', 10, '', '', 'bookseller.pl', 0, 0, 'CF', '', '', NULL),
---             ('95k', 'f', 'Coded location qualifier (similar to 852 $f)', 'Coded location qualifier', 1, 0, 'items.coded_location_qualifier', 10, '', '', 'marc21_locationqualifier.pl', NULL, 0, 'CF', '', '', NULL),
---             ('95k', 'g', 'Non-coded location qualifier (similar to 852 $g)', 'Non-coded location qualifier', 1, 0, 'items.non_coded_location_qualifier', 10, '', '', '', NULL, 0, 'CF', '', '', NULL),
---             ('95k', 'h', 'Classification part (similar to 852 $h)', 'Classification part', 0, 0, 'items.cn_class', 10, '', '', '', NULL, 0, 'CF', '', '', NULL),
---             ('95k', 'i', 'Item part (similar to 852 $i)', 'Item part', 1, 0, 'items.cn_item', 10, '', '', '', NULL, 0, 'CF', '', '', NULL),
---             ('95k', 'j', 'Shelving control number (similar to 852 $j)', 'Shelving control number', 0, 0, 'items.stack', 10, 'STACK', '', '', NULL, 0, 'CF', '', '', NULL),
---             ('95k', 'k', 'Call number prefix (similar to 852 $k)', 'Call number prefix', 0, 0, 'items.cn_prefix', 10, '', '', '', NULL, 0, 'CF', '', '', NULL),
---             ('95k', 'l', 'Shelving form of title (similar to 852 $l)', 'Shelving form of title', 0, 0, 'items.shelving_title', 10, '', '', '', NULL, 0, 'CF', '', '', NULL),
---             ('95k', 'm', 'Cost, normal purchase price (similar to 541 $h, 876-8 $c)', 'Cost, normal purchase price', 0, 0, 'items.price', 10, '', '', '', 0, 0, 'CF', '', '', NULL),
---             ('95k', 'n', 'Koha collection', 'Koha collection', 0, 0, 'items.ccode', 10, 'CCODE', '', '', 0, 0, 'CF', '', '', NULL),
---             ('95k', 'o', 'Koha full call number (similar to 852 $k $h $i $m $t combined)', 'Koha full call number', 0, 0, 'items.itemcallnumber', 10, '', 'marc21_itemcallnumber.pl', NULL, 0, 0, 'CF', '', '', NULL),
---             ('95k', 'p', 'Piece designation (barcode) (similar to 852, 876-8 $p)', 'Piece designation (barcode)', 0, 0, 'items.barcode', 10, '', '', 'barcode.pl', 0, 0, 'CF', '', '', NULL),
---             ('95k', 'q', 'Piece physical condition (similar to 562 $a, 852 $q)', 'Piece physical condition', 0, 0, 'items.condition', 10, '', '', '', NULL, 0, 'CF', '', '', NULL),
---             ('95k', 'r', 'Invalid or canceled piece designation (canceled barcode) (similar to 876-8 $r)', 'Invalid or canceled piece designation (canceled barcode)', 1, 0, 'items.cancelled_barcode', 10, '', '', '', NULL, -1, 'CF', '', '', NULL),
---             ('95k', 's', 'Copyright article-fee code (similar to 018 $a, 852 $s)', 'Copyright article-fee code', 1, 0, 'items.copyright_fee', 10, '', '', '', NULL, 0, 'CF', '', '', NULL),
---             ('95k', 'q', 'Koha out on loan', 'Koha out on loan', 1, 0, 'items.onloan', 10, '', '', '', NULL, -5, 'CF', '', '', NULL),
---             ('95k', 'r', 'Koha date last seen', 'Koha date last seen', 1, 0, 'items.datelastseen', 10, '', '', '', NULL, -5, 'CF', '', '', NULL),
---             ('95k', 's', 'Koha date last borrowed', 'Koha date last borrowed', 1, 0, 'items.datelastborrowed', 10, '', '', '', NULL, -5, 'CF', '', '', NULL),
---             ('95k', 't', 'Copy number (similar to 852, 876-8 $t)', 'Copy number', 0, 0, 'items.copynumber', 10, '', '', '', NULL, 0, 'CF', '', '', NULL),
---             ('95k', 'u', 'Uniform Resource Identifier (similar to 852 $u)', 'Uniform Resource Identifier', 1, 0, 'items.uri', 10, '', '', '', 1, 0, 'CF', '', '', NULL),
---             ('95k', 'v', 'Cost, replacement price (similar to 365 $b, 876-8 $c)', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'CF', '', '', NULL),
---             ('95k', 'w', 'Price effective from (similar to 365 $f)', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'CF', '', '', NULL),
---             ('95k', 'x', 'Nonpublic note (lost item payment) (similar to 852, 876-8 $x)', 'Nonpublic note', 1, 0, 'items.paidfor', 10, '', '', '', NULL, 7, 'CF', '', '', NULL),
---             ('95k', 'y', 'Koha item type', 'Koha item type', 1, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, -5, 'CF', '', '', NULL),
---             ('95k', 'z', 'Public note (similar to 852, 876-8 $z)', 'Public note', 1, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'CF', '', '', NULL);
-
-
-
--- Current items Field/Subfields
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('952', 'LOCATION AND ITEM INFORMATION (KOHA)', 'LOCATION AND ITEM INFORMATION (KOHA)', 1, 0, '', 'CF');
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('952', '0', 'Withdrawn status', 'Withdrawn status', 0, 0, 'items.wthdrawn', 10, 'WITHDRAWN', '', '', 0, 0, 'CF', '', '', NULL),
-               ('952', '1', 'Lost status', 'Lost status', 0, 0, 'items.itemlost', 10, 'LOST', '', '', 0, 0, 'CF', '', '', NULL),
-               ('952', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'items.cn_source', 10, '', '', 'marc21_classcodes.pl', NULL, 0, 'CF', '', '', NULL),
-               ('952', '3', 'Materials specified (bound volume or other part)', 'Materials specified (bound volume or other part)', 0, 0, 'items.materials', 10, '', '', '', NULL, -1, 'CF', '', '', NULL),
-               ('952', '4', 'Damaged status', 'Damaged status', 0, 0, 'items.damaged', 10, 'DAMAGED', '', '', NULL, 0, 'CF', '', '', NULL),
-               ('952', '5', 'Use restrictions', 'Use restrictions', 0, 0, 'items.restricted', 10, 'RESTRICTED', '', '', 0, 0, 'CF', '', '', NULL),
-               ('952', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'items.cn_sort', -1, '', '', '', 0, 7, 'CF', '', '', NULL),
-               ('952', '7', 'Not for loan', 'Not for loan', 0, 0, 'items.notforloan', 10, 'NOT_LOAN', '', '', 0, 0, 'CF', '', '', NULL),
-               ('952', '8', 'Koha collection', 'Koha collection', 0, 0, 'items.ccode', 10, 'CCODE', '', '', 0, 0, 'CF', '', '', NULL),
-               ('952', '9', 'Koha itemnumber (autogenerated)', 'Koha itemnumber', 0, 0, 'items.itemnumber', -1, '', '', '', 0, 7, 'CF', '', '', NULL),
-               ('952', 'a', 'Location (home branch)', 'Location (home branch)', 0, 0, 'items.homebranch', 10, 'branches', '', '', 0, 0, 'CF', '', '', NULL),
-               ('952', 'b', 'Sublocation or collection (holding branch)', 'Sublocation or collection (holding branch)', 1, 0, 'items.holdingbranch', 10, 'branches', '', '', 0, 0, 'CF', '', '', NULL),
-               ('952', 'c', 'Shelving location', 'Shelving location', 1, 0, 'items.location', 10, 'LOC', '', '', 0, 0, 'CF', '', '', NULL),
-               ('952', 'd', 'Date acquired', 'Date acquired', 0, 0, 'items.dateaccessioned', 10, '', '', 'dateaccessioned.pl', 0, 0, 'CF', '', '', NULL),
-               ('952', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, 'items.booksellerid', 10, '', '', 'bookseller.pl', 0, 0, 'CF', '', '', NULL),
-               ('952', 'f', 'Coded location qualifier', 'Coded location qualifier', 1, 0, 'items.coded_location_qualifier', 10, '', '', 'marc21_locationqualifier.pl', NULL, 0, 'CF', '', '', NULL),
-               ('952', 'g', 'Cost, normal purchase price', 'Cost, normal purchase price', 0, 0, 'items.price', 10, '', '', '', 0, 0, 'CF', '', '', NULL),
-               ('952', 'j', 'Shelving control number', 'Shelving control number', 0, 0, 'items.stack', 10, 'STACK', '', '', NULL, -1, 'CF', '', '', NULL),
-               ('952', 'l', 'Koha issues (times borrowed)', 'Koha issues (times borrowed)', 0, 0, 'items.issues', 10, '', '', '', NULL, -5, 'CF', '', '', NULL),
-               ('952', 'm', 'Koha renewals', 'Koha renewals', 0, 0, 'items.renewals', 10, '', '', '', NULL, -5, 'CF', '', '', NULL),
-               ('952', 'n', 'Koha reserves (requests)', 'Koha reserves (requests)', 0, 0, 'items.reserves', 10, '', '', '', NULL, -5, 'CF', '', '', NULL),
-               ('952', 'o', 'Koha full call number', 'Koha full call number', 0, 0, 'items.itemcallnumber', 10, '', 'marc21_itemcallnumber.pl', NULL, 0, 0, 'CF', '', '', NULL),
-               ('952', 'p', 'Piece designation (barcode)', 'Piece designation (barcode)', 0, 0, 'items.barcode', 10, '', '', 'barcode.pl', 0, 0, 'CF', '', '', NULL),
-               ('952', 'q', 'Koha out on loan', 'Koha out on loan', 1, 0, 'items.onloan', 10, '', '', '', NULL, -5, 'CF', '', '', NULL),
-               ('952', 'r', 'Koha date last seen', 'Koha date last seen', 1, 0, 'items.datelastseen', 10, '', '', '', NULL, -5, 'CF', '', '', NULL),
-               ('952', 's', 'Koha date last borrowed', 'Koha date last borrowed', 1, 0, 'items.datelastborrowed', 10, '', '', '', NULL, -5, 'CF', '', '', NULL),
-               ('952', 't', 'Copy number', 'Copy number', 0, 0, 'items.copynumber', 10, '', '', '', NULL, 0, 'CF', '', '', NULL),
-               ('952', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, 'items.uri', 10, '', '', '', 1, 0, 'CF', '', '', NULL),
-               ('952', 'v', 'Cost, replacement price', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'CF', '', '', NULL),
-               ('952', 'w', 'Price effective from', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'CF', '', '', NULL),
-               ('952', 'x', 'Nonpublic note (lost item payment)', 'Nonpublic note (lost item payment)', 1, 0, 'items.paidfor', 10, '', '', '', NULL, 7, 'CF', '', '', NULL),
-               ('952', 'y', 'Koha item type', 'Koha item type', 1, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, -1, 'CF', '', '', NULL),
-               ('952', 'z', 'Public note', 'Public note', 1, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'CF', '', '', NULL);
-
-
-
--- *******************************************************
-
-
-
--- ******************************************************************
--- SIMPLE COMPUTER FILES MARC 21 FIELDS/SUBFIELDS AND COMMMONLY USED
--- EXTENSIONS.
--- ******************************************************************
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('01e', 'CODED FIELD ERROR (RLIN)', 'CODED FIELD ERROR (RLIN)', 1, 0, '', 'CF'),
-               ('89e', 'ERRONEOUS FIELD, ERR (RLIN)', 'ERRONEOUS FIELD, ERR (RLIN)', 1, 0, '', 'CF'),
-               ('91c', 'EQUIVALENCE OR CROSS-REFERENCE-CORPORATE NAME [LOCAL, CANADA]', 'EQUIVALENCE OR CROSS-REFERENCE-CORPORATE NAME [LOCAL, CANADA]', 1, 0, '', 'CF'),
-               ('91r', 'RLG STANDARDS NOTE (RLIN)', 'RLG STANDARDS NOTE (RLIN)', 1, 0, '', 'CF'),
-               ('93r', 'SUMMARY HOLDINGS STATEMENT (RLIN)', 'SUMMARY HOLDINGS STATEMENT (RLIN)', 1, 0, '', 'CF'),
-               ('94c', 'EQUIVALENCE OR CROSS-REFERENCE--TITLE [OBSOLETE] [CAN/MARC only]', 'EQUIVALENCE OR CROSS-REFERENCE--TITLE [OBSOLETE] [CAN/MARC only]', 1, 0, '', 'CF'),
-               ('94a', 'ANALYSIS TREATMENT NOTE (RLIN)', 'ANALYSIS TREATMENT NOTE (RLIN)', 1, 0, '', 'CF'),
-               ('94b', 'TREATMENT CODES (RLIN)', 'TREATMENT CODES (RLIN)', 1, 0, '', 'CF'),
-               ('95c', 'EQUIVALENCE OR CROSS-REFERENCE--HIERARCHICAL PLACE NAME [OBSOLETE] [CAN/MARC only]', 'EQUIVALENCE OR CROSS-REFERENCE-HIERARCHICAL PLACE NAME [OBSOLETE] [CAN/MARC only]', 1, 0, '', 'CF'),
-               ('95r', 'CLUSTER MEMBER (RLIN)', 'CLUSTER MEMBER (RLIN)', 1, 0, '', 'CF'),
-               ('b99', 'PRIVATE LOCAL INFORMATION (RLIN)', 'PRIVATE LOCAL INFORMATION (RLIN)', 1, 0, '', 'CF'),
-               ('u01', 'UNIT IDENTIFICATION, STATUS, AND TYPE (RLIN)', 'UNIT IDENTIFICATION, STATUS, AND TYPE (RLIN)', 0, 0, '', 'CF'),
-               ('u02', 'STANDARD NUMBER (RLIN)', 'STANDARD NUMBER (RLIN)', 0, 0, '', 'CF'),
-               ('u08', 'CODED INFORMATION (RLIN)', 'CODED INFORMATION (RLIN)', 0, 0, '', 'CF'),
-               ('u10', 'REQUESTER IDENTIFICATION (RLIN)', 'REQUESTER IDENTIFICATION (RLIN)', 1, 0, '', 'CF'),
-               ('u11', 'DEPARTMENT REPORT REQUEST (RLIN)', 'DEPARTMENT REPORT REQUEST (RLIN)', 1, 0, '', 'CF'),
-               ('u20', 'SUPPLIER IDENTIFICATION, SUPN (RLIN)', 'SUPPLIER IDENTIFICATION, SUPN (RLIN)', 0, 0, '', 'CF'),
-               ('u21', 'LIBRARY CODES FOR VENDOR AND ORDER (RLIN)', 'LIBRARY CODES FOR VENDOR AND ORDER (RLIN)', 0, 0, '', 'CF'),
-               ('u22', 'SUPPLIER CODES AND CATALOG INFORMATION (RLIN)', 'SUPPLIER CODES AND CATALOG INFORMATION (RLIN)', 0, 0, '', 'CF'),
-               ('u25', 'SUPPLIER REPORT(S) (RLIN)', 'SUPPLIER REPORT(S) (RLIN)', 0, 0, '', 'CF'),
-               ('u30', 'INTERVALS (RLIN)', 'INTERVALS (RLIN)', 0, 0, '', 'CF'),
-               ('u31', 'CLAIM COUNTS (RLIN)', 'CLAIM COUNTS (RLIN)', 0, 0, '', 'CF'),
-               ('u33', 'INVOICE CLAIM (RLIN)', 'INVOICE CLAIM (RLIN)', 0, 0, '', 'CF'),
-               ('u34', 'EXTENDED PROCUREMENT CLAIM AND REVIEW (RLIN)', 'EXTENDED PROCUREMENT CLAIM AND REVIEW (RLIN)', 0, 0, '', 'CF'),
-               ('u40', 'EXTENDED PROCUREMENT CODES (RLIN)', 'EXTENDED PROCUREMENT CODES (RLIN)', 0, 0, '', 'CF'),
-               ('u50', 'ACQUISITIONS NOTES (RLIN)', 'ACQUISITIONS NOTES (RLIN)', 0, 0, '', 'CF'),
-               ('u51', 'SELECTION NOTES (RLIN)', 'SELECTION NOTES (RLIN)', 0, 0, '', 'CF'),
-               ('u52', 'SUPPLIER INSTRUCTIONS AND NOTES, SINT (RLIN)', 'SUPPLIER INSTRUCTIONS AND NOTES, SINT (RLIN)', 0, 0, '', 'CF'),
-               ('u53', 'CLAIM INSTRUCTIONS AND NOTES, CLNT (RLIN)', 'CLAIM INSTRUCTIONS AND NOTES, CLNT (RLIN)', 0, 0, '', 'CF'),
-               ('u54', 'NOTES TO SERIALS DEPARTMENT (RLIN)', 'NOTES TO SERIALS DEPARTMENT (RLIN)', 0, 0, '', 'CF'),
-               ('u55', 'CATALOGING NOTES (RLIN)', 'CATALOGING NOTES (RLIN)', 0, 0, '', 'CF'),
-               ('u5f', 'ACCOUNTING NOTES (RLIN)', 'ACCOUNTING NOTES (RLIN)', 0, 0, '', 'CF'),
-               ('u70', 'MATERIAL AND LOCATION INFORMATION (RLIN)', 'MATERIAL AND LOCATION INFORMATION (RLIN)', 0, 0, '', 'CF'),
-               ('u71', 'FUND ACCOUNT (RLIN)', 'FUND ACCOUNT (RLIN)', 0, 0, '', 'CF'),
-               ('u75', 'ITEM DETAILS (RLIN)', 'ITEM DETAILS (RLIN)', 1, 0, '', 'CF'),
-               ('u7f', 'PRICE INFORMATION (RLIN)', 'PRICE INFORMATION (RLIN)', 1, 0, '', 'CF'),
-               ('u90', 'TAPE OUTPUT, TAPE (RLIN)', 'TAPE OUTPUT, TAPE (RLIN)', 0, 0, '', 'CF'),
-               ('ufi', 'FISCAL INFORMATION, FI (RLIN)', 'FISCAL INFORMATION, FI (RLIN)', 1, 0, '', 'CF');
-
-
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('01e', 'a', 'Coded field error', 'Coded field error', 0, 0, '', 0, '', '', '', 0, -6, 'CF', '', '', NULL),
-               ('89e', '0', '0', '0', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', '1', '1', '1', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', '2', '2', '2', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', '3', '3', '3', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', '4', '4', '4', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', '5', '5', '5', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', '6', '6', '6', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', '7', '7', '7', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', '8', '8', '8', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', '9', '9', '9', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', 'a', 'a', 'a', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', 'b', 'b', 'b', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', 'c', 'c', 'c', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', 'd', 'd', 'd', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', 'e', 'e', 'e', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', 'f', 'f', 'f', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', 'g', 'g', 'g', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', 'h', 'h', 'h', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', 'i', 'i', 'i', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', 'j', 'j', 'j', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', 'k', 'k', 'k', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', 'l', 'l', 'l', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', 'm', 'm', 'm', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', 'n', 'n', 'n', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', 'o', 'o', 'o', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', 'p', 'p', 'p', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', 'q', 'q', 'q', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', 'r', 'r', 'r', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', 's', 's', 's', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', 't', 't', 't', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', 'u', 'u', 'u', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', 'v', 'v', 'v', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', 'w', 'w', 'w', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', 'x', 'x', 'x', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', 'y', 'y', 'y', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('89e', 'z', 'z', 'z', 1, 0, '', 8, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('91c', '4', 'Relator code', 'Relator code', 1, 0, '', 9, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('91c', '6', 'Linkage', 'Linkage', 0, 0, '', 9, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('91c', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 9, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('91c', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, '', 9, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('91c', 'b', 'Subordinate unit', 'Subordinate unit', 1, 0, '', 9, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('91c', 'c', 'Location of meeting', 'Location of meeting', 0, 0, '', 9, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('91c', 'd', 'Date of meeting or treaty signing', 'Date of meeting or treaty signing', 1, 0, '', 9, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('91c', 'e', 'Relator term', 'Relator term', 1, 0, '', 9, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('91c', 'f', 'Date of a work', 'Date of a work', 0, 0, '', 9, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('91c', 'g', 'Miscellaneous information', 'Miscellaneous information', 0, 0, '', 9, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('91c', 'k', 'Form subheading', 'Form subheading', 1, 0, '', 9, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('91c', 'l', 'Language of a work', 'Language of a work', 0, 0, '', 9, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('91c', 'n', 'Number of part/section/meeting', 'Number of part/section/meeting', 1, 0, '', 9, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('91c', 'p', 'Name of part/section of a work', 'Name of part/section of a work', 1, 0, '', 9, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('91c', 't', 'Title of a work', 'Title of a work', 0, 0, '', 9, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('91c', 'u', 'Affiliation', 'Affiliation', 0, 0, '', 9, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('91r', 'a', 'RLG standards note', 'RLG standards note', 0, 0, '', 9, '', '', '', 0, -6, 'CF', '', '', NULL),
-               ('93r', 'a', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'CF', '', '', NULL),
-               ('93r', 'b', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'CF', '', '', NULL),
-               ('93r', 'c', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'CF', '', '', NULL),
-               ('93r', 'd', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'CF', '', '', NULL),
-               ('93r', 'e', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'CF', '', '', NULL),
-               ('93r', 'f', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'CF', '', '', NULL),
-               ('93r', 'g', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'CF', '', '', NULL),
-               ('93r', 'h', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'CF', '', '', NULL),
-               ('93r', 'i', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'CF', '', '', NULL),
-               ('93r', 'k', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'CF', '', '', NULL),
-               ('94c', '6', 'Linkage', 'Linkage', 0, 0, '', 9, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('94c', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 9, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('94c', 'a', 'Title', 'Title', 0, 0, '', 9, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('94c', 'b', 'Remainder of title', 'Remainder of title', 0, 0, '', 9, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('94c', 'c', 'Statement of responsibility, etc', 'Statement of responsibility, etc', 0, 0, '', 9, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('94c', 'd', 'Designation of section/part/series (SE) [OBSOLETE]', 'Designation of section section/part/series (SE) [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('94c', 'e', 'Name of part/section/series (SE) [OBSOLETE]', 'Name of part/section/series (SE) [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('94c', 'f', 'Inclusive dates', 'Inclusive dates', 0, 0, '', 9, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('94c', 'g', 'Bulk dates', 'Bulk dates', 0, 0, '', 9, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('94c', 'h', 'Medium', 'Medium', 0, 0, '', 9, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('94c', 'k', 'Form', 'Form', 1, 0, '', 9, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('94c', 'n', 'Number of part/section of a work', 'Number of part/section of a work', 1, 0, '', 9, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('94c', 'p', 'Name of part/section of a work', 'Name of part/section of a work', 1, 0, '', 9, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('94c', 's', 'Version', 'Version', 0, 0, '', 9, '', '', '', NULL, -6, 'CF', '', '', NULL),
-               ('94a', 'a', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'CF', '', '', NULL),
-               ('94a', 'b', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'CF', '', '', NULL),
-               ('94a', 'c', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'CF', '', '', NULL),
-               ('94a', 'd', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'CF', '', '', NULL),
-               ('94a', 'e', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'CF', '', '', NULL),
-               ('94b', 'a', 'ATC', 'ATC', 0, 0, '', 9, '', '', '', 0, -6, 'CF', '', '', NULL),
-               ('94b', 'b', 'SNR', 'SNR', 0, 0, '', 9, '', '', '', 0, -6, 'CF', '', '', NULL),
-               ('95c', 'a', 'Country', 'Country', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'CF', '', '', NULL),
-               ('95c', 'b', 'State, province, territory', 'State, province, territory', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'CF', '', '', NULL),
-               ('95c', 'c', 'County, region, islands area', 'County, region, islands area', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'CF', '', '', NULL),
-               ('95c', 'd', 'City', 'City', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'CF', '', '', NULL),
-               ('95r', '6', 'Linkage', 'Linkage', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'CF', '', '', NULL),
-               ('95r', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'CF', '', '', NULL),
-               ('95r', 'a', 'Record ID (RLIN)', 'Record ID (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('95r', 'b', 'Institution name (RLIN)', 'Institution name (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u01', 'a', 'Operator\'s initials, OID (RLIN)', 'Operator\'s initials, OID (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u01', 'd', 'UAD (RLIN)', 'UAD (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u01', 'f', 'FPST (RLIN)', 'FPST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u01', 'h', 'CPST (RLIN)', 'FPST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u01', 'i', 'CPST (RLIN)', 'FPST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u01', 's', 'UST (RLIN)', 'UST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u01', 't', 'UTYP (RLIN)', 'UTYP (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u02', '2', 'Source of number or code', 'Source of number or code', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u02', 'a', 'Standard number or code', 'Standard number or code', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u02', 'b', 'Additional codes following the standard number', 'Additional codes following the standard number', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u02', 'c', 'Terms of availability', 'Terms of availability', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u02', 'z', 'Canceled/invalid standard number or code', 'Canceled/invalid standard number or code', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u08', 'n', 'LSI', 'LSI', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u08', 'o', 'SID', 'SID', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u08', 'p', 'DP', 'DP', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u08', 'r', 'RUSH', 'RUSH', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u10', 'a', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u10', 'b', 'SID', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u10', 'c', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u10', 'd', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u10', 'e', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u10', 's', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u11', 'a', 'Department report request, DRR (DRRH for earlier occurrences)', 'DRR (DRRH for earlier occurrences)', 1, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u20', 'a', 'SUPN', 'SUPN', 1, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u20', 'b', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u20', 'c', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u20', 'd', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u20', 'e', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u20', 'x', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u21', 'a', 'SHIP', 'SHIP', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u21', 'b', 'BILL', 'BILL', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u21', 'c', 'DAC', 'DAC', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u21', 'n', 'LSAC', 'LSAC', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u22', 'a', 'SICO', 'SICO', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u22', 'b', 'SICO', 'SICO', 1, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u22', 'c', 'SCAT', 'SCAT', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u25', 'a', 'Supplier report(s), SRPT', 'Supplier report(s), SRPT', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u30', 'a', 'NCC [OBSOLETE]', 'NCC [OBSOLETE]', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u30', 'i', 'ICI', 'ICI', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u30', 'm', 'MCI', 'MCI', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u31', 'a', 'NCC', 'NCC', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u31', 'b', 'NCS', 'NCS', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u33', 'a', 'ICL', 'ICL', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u33', 'd', 'ICAD', 'ICAD', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u34', 'a', 'EPCL', 'EPCL', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u34', 'r', 'ERI', 'ERI', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u40', 'd', 'EPDT [OBSOLETE]', 'EPDT [OBSOLETE]', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u40', 'f', 'EFRQ', 'EFRQ', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u40', 's', 'EPST', 'EPST', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u40', 't', 'ETYP', 'ETYP', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u50', 'a', 'Acquisitions notes, AQNT', 'Acquisitions notes, AQNT', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u51', 'a', 'Selection notes, SLNT', 'Selection notes, SLNT', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u52', 'a', 'INT', 'INT', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u52', 'b', 'INT', 'NT', 1, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u53', 'a', 'CLNT', 'CLNT', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u53', 'b', 'CLNT', 'CLNT', 1, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u54', 'a', 'Notes to serials department, SRNT', 'Notes to serials department, SRNT', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u55', 'a', 'Cataloging notes, CTNT', 'Cataloging notes, CTNT', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u5f', 'a', 'Accounting notes, ACNT', 'Accounting notes, ACNT', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u70', 'a', 'QTY', 'QTY', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u70', 'b', 'MAT', 'MAT', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u70', 'l', 'MLOC', 'MLOC', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u71', 'a', 'Fund account, FUND', 'Fund account, FUND', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u75', 'a', 'ITEM', 'ITEM', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u75', 'c', 'CIRC', 'CIRC', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u75', 'h', 'IPST', 'IPST', 1, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u75', 'i', 'ITEM', 'ITEM', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u75', 'l', 'SLOC', 'SLOC', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u7f', 'a', 'LPRI', 'LPRI', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u7f', 'b', 'CURR', 'CURR', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u7f', 'k', 'CVRT [OBSOLETE]', 'CVRT [OBSOLETE]', 1, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u7f', 'p', 'LPD', 'LPD', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u7f', 'r', 'EDRT', 'EDRT', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u90', 'h', 'TAPE', 'TAPE', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('u90', 'i', 'TAPE', 'TAPE', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('ufi', 'a', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('ufi', 'b', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('ufi', 'c', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('ufi', 'd', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('ufi', 'e', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('ufi', 'f', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('ufi', 'g', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('ufi', 'h', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL),
-               ('ufi', 'n', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'CF', '', '', NULL);
-
-
--- *******************************************************
-
-
-
--- ************************************************************
--- SIMPLE SOUND RECORDINGS KOHA RECORD AND HOLDINGS MANAGEMENT
--- FIELDS/SUBFIELDS.
--- ************************************************************
-
-
--- Current Record ID Field/Subfields
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('999', 'SYSTEM CONTROL NUMBERS (KOHA)', 'SYSTEM CONTROL NUMBERS (KOHA)', 1, 0, '', 'SR');
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('999', 'a', 'Item type [OBSOLETE]', 'Item type [OBSOLETE]', 0, 0, NULL, -1, NULL, NULL, '', NULL, -5, 'SR', '', '', NULL),
-               ('999', 'b', 'Koha Dewey Subclass [OBSOLETE]', 'Koha Dewey Subclass [OBSOLETE]', 0, 0, NULL, 0, NULL, NULL, '', NULL, -5, 'SR', '', '', NULL),
-               ('999', 'c', 'Koha biblionumber', 'Koha biblionumber', 0, 0, 'biblio.biblionumber', -1, NULL, NULL, '', NULL, -5, 'SR', '', '', NULL),
-               ('999', 'd', 'Koha biblioitemnumber', 'Koha biblioitemnumber', 0, 0, 'biblioitems.biblioitemnumber', -1, NULL, NULL, '', NULL, -5, 'SR', '', '', NULL);
-
-
--- ******************************************************
-
-
--- Plugins which need to be written for primary biblioitems Field/Subfields.
-
-
---             ('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, '', '', 'marc21_classcodes.pl', NULL, 0, 'SR', '', '', NULL),
---             ('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', 'marc21_callnumber.pl', NULL, 0, 'SR', '', '', NULL),
-
-
-
--- Current primary biblioitems Field/Subfields
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('942', 'ADDED ENTRY ELEMENTS (KOHA)', 'ADDED ENTRY ELEMENTS (KOHA)', 0, 0, '', 'SR');
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('942', '0', 'Koha issues (borrowed), all copies', 'Koha issues (borrowed), all copies', 0, 0, 'biblioitems.totalissues', 9, '', '', '', NULL, -5, 'SR', '', '', NULL),
-               ('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, '', '', '', NULL, 0, 'SR', '', '', NULL),
-               ('942', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'biblioitems.cn_sort', -1, '', '', '', 0, 7, 'SR', '', '', NULL),
-               ('942', 'a', 'Institution code [OBSOLETE]', 'Institution code [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -5, 'SR', '', '', NULL),
-               ('942', 'c', 'Item type', 'Item type', 0, 1, 'biblioitems.itemtype', 9, 'itemtypes', '', '', NULL, 0, 'SR', '', '', NULL),
-               ('942', 'e', 'Edition', 'Edition', 0, 0, 'biblioitems.cn_edition', 9, 'CN_EDITION', '', '', NULL, 0, 'SR', '', '', NULL),
-               ('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', '', NULL, 0, 'SR', '', '', NULL),
-               ('942', 'i', 'Item part', 'Item part', 1, 0, 'biblioitems.cn_item', 9, '', '', '', NULL, 9, 'SR', '', '', NULL),
-               ('942', 'k', 'Call number prefix', 'Call number prefix', 0, 0, 'biblioitems.cn_prefix', 9, '', '', '', NULL, 0, 'SR', '', '', NULL),
-               ('942', 'm', 'Call number suffix', 'Call number suffix', 0, 0, 'biblioitems.cn_suffix', 9, '', '', '', 0, 0, 'SR', '', '', NULL);
-
-
--- ******************************************************
-
-
--- Recommended items Field/Subfields
-
-
--- INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
---             ('95k', 'LOCATION AND ITEM INFORMATION (KOHA)', 'LOCATION AND ITEM INFORMATION (KOHA)', 1, 0, '', 'SR');
-
--- INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
---             ('95k', '0', 'Item status (withdrawn) (similar to 876-8 $j)', 'Item status (withdrawn)', 0, 0, 'items.wthdrawn', 10, 'WITHDRAWN', '', '', 0, 0, 'SR', '', '', NULL),
---             ('95k', '1', 'Item status (lost) (similar to 876-8 $j)', 'Item status (lost)', 0, 0, 'items.itemlost', 10, 'LOST', '', '', 0, 0, 'SR', '', '', NULL),
---             ('95k', '2', 'Source of classification or shelving scheme (similar to 852 $2)', 'Source of classification or shelving scheme', 0, 0, 'items.cn_source', 10, '', '', 'marc21_classcodes.pl', NULL, 0, 'SR', '', '', NULL),
---             ('95k', '3', 'Materials specified (bound volume or other part) (similar to 852, 876-8 $3)', 'Materials specified (bound volume or other part)', 0, 0, 'items.materials', 10, '', '', '', NULL, -1, 'SR', '', '', NULL),
---             ('95k', '4', 'Item status (damaged) (similar to 876-8 $j)', 'Item status (damaged)', 0, 0, 'items.damaged', 10, 'DAMAGED', '', '', NULL, 0, 'SR', '', '', NULL),
---             ('95k', '5', 'Use restrictions (similar to 506 $a, 876-8 $h)', 'Use restrictions', 0, 0, 'items.restricted', 10, 'RESTRICTED', '', '', 0, 0, 'SR', '', '', NULL),
---             ('95k', '6', 'Linkage (similar to 852, 876-8 $6)', 'Linkage', 0, 0, 'items.linkage', 10, '', '', '', NULL, -6, 'SR', '', '', NULL),
---             ('95k', '7', 'Use restrictions (not for loan) (similar to 506 $a, 876-8 $h)', 'Use restrictions (not for loan)', 0, 0, 'items.notforloan', 10, 'NOT_LOAN', '', '', 0, 0, 'SR', '', '', NULL),
---             ('95k', '8', 'Sequence number (similar to 852, 876-8 $8)', 'Sequence number', 1, 0, 'items.sequence', 10, '', '', '', NULL, 0, 'SR', '', '', NULL),
---             ('95k', '9', 'Koha itemnumber (autogenerated similar to 852, 876-8 $3 $8 $t combined)', 'Koha itemnumber', 0, 0, 'items.itemnumber', -1, '', '', '', 0, -5, 'SR', '', '', NULL),
---             ('95k', 'a', 'Location (home branch) (similar to 852 $a)', 'Location (home branch)', 0, 0, 'items.homebranch', 10, 'branches', '', '', 0, 0, 'SR', '', '', NULL),
---             ('95k', 'b', 'Sublocation or collection (holding branch) (similar to 852 $b)', 'Sublocation or collection (holding branch)', 1, 0, 'items.holdingbranch', 10, 'branches', '', '', 0, 0, 'SR', '', '', NULL),
---             ('95k', 'c', 'Shelving location (similar to 852 $c, 876-8 $l)', 'Shelving location', 1, 0, 'items.location', 10, 'LOC', '', '', 0, 0, 'SR', '', '', NULL),
---             ('95k', 'd', 'Date acquired (similar to 541, 876-8 $d)', 'Date acquired', 0, 0, 'items.dateaccessioned', 10, '', '', 'dateaccessioned.pl', 0, 0, 'SR', '', '', NULL),
---             ('95k', 'e', 'Source of acquisition (similar to 541 $a, 876-8 $e)', 'Source of acquisition', 1, 0, 'items.booksellerid', 10, '', '', 'bookseller.pl', 0, 0, 'SR', '', '', NULL),
---             ('95k', 'f', 'Coded location qualifier (similar to 852 $f)', 'Coded location qualifier', 1, 0, 'items.coded_location_qualifier', 10, '', '', 'marc21_locationqualifier.pl', NULL, 0, 'SR', '', '', NULL),
---             ('95k', 'g', 'Non-coded location qualifier (similar to 852 $g)', 'Non-coded location qualifier', 1, 0, 'items.non_coded_location_qualifier', 10, '', '', '', NULL, 0, 'SR', '', '', NULL),
---             ('95k', 'h', 'Classification part (similar to 852 $h)', 'Classification part', 0, 0, 'items.cn_class', 10, '', '', '', NULL, 0, 'SR', '', '', NULL),
---             ('95k', 'i', 'Item part (similar to 852 $i)', 'Item part', 1, 0, 'items.cn_item', 10, '', '', '', NULL, 0, 'SR', '', '', NULL),
---             ('95k', 'j', 'Shelving control number (similar to 852 $j)', 'Shelving control number', 0, 0, 'items.stack', 10, 'STACK', '', '', NULL, 0, 'SR', '', '', NULL),
---             ('95k', 'k', 'Call number prefix (similar to 852 $k)', 'Call number prefix', 0, 0, 'items.cn_prefix', 10, '', '', '', NULL, 0, 'SR', '', '', NULL),
---             ('95k', 'l', 'Shelving form of title (similar to 852 $l)', 'Shelving form of title', 0, 0, 'items.shelving_title', 10, '', '', '', NULL, 0, 'SR', '', '', NULL),
---             ('95k', 'm', 'Cost, normal purchase price (similar to 541 $h, 876-8 $c)', 'Cost, normal purchase price', 0, 0, 'items.price', 10, '', '', '', 0, 0, 'SR', '', '', NULL),
---             ('95k', 'n', 'Koha collection', 'Koha collection', 0, 0, 'items.ccode', 10, 'CCODE', '', '', 0, 0, 'SR', '', '', NULL),
---             ('95k', 'o', 'Koha full call number (similar to 852 $k $h $i $m $t combined)', 'Koha full call number', 0, 0, 'items.itemcallnumber', 10, '', 'marc21_itemcallnumber.pl', NULL, 0, 0, 'SR', '', '', NULL),
---             ('95k', 'p', 'Piece designation (barcode) (similar to 852, 876-8 $p)', 'Piece designation (barcode)', 0, 0, 'items.barcode', 10, '', '', 'barcode.pl', 0, 0, 'SR', '', '', NULL),
---             ('95k', 'q', 'Piece physical condition (similar to 562 $a, 852 $q)', 'Piece physical condition', 0, 0, 'items.condition', 10, '', '', '', NULL, 0, 'SR', '', '', NULL),
---             ('95k', 'r', 'Invalid or canceled piece designation (canceled barcode) (similar to 876-8 $r)', 'Invalid or canceled piece designation (canceled barcode)', 1, 0, 'items.cancelled_barcode', 10, '', '', '', NULL, -1, 'SR', '', '', NULL),
---             ('95k', 's', 'Copyright article-fee code (similar to 018 $a, 852 $s)', 'Copyright article-fee code', 1, 0, 'items.copyright_fee', 10, '', '', '', NULL, 0, 'SR', '', '', NULL),
---             ('95k', 'q', 'Koha out on loan', 'Koha out on loan', 1, 0, 'items.onloan', 10, '', '', '', NULL, -5, 'SR', '', '', NULL),
---             ('95k', 'r', 'Koha date last seen', 'Koha date last seen', 1, 0, 'items.datelastseen', 10, '', '', '', NULL, -5, 'SR', '', '', NULL),
---             ('95k', 's', 'Koha date last borrowed', 'Koha date last borrowed', 1, 0, 'items.datelastborrowed', 10, '', '', '', NULL, -5, 'SR', '', '', NULL),
---             ('95k', 't', 'Copy number (similar to 852, 876-8 $t)', 'Copy number', 0, 0, 'items.copynumber', 10, '', '', '', NULL, 0, 'SR', '', '', NULL),
---             ('95k', 'u', 'Uniform Resource Identifier (similar to 852 $u)', 'Uniform Resource Identifier', 1, 0, 'items.uri', 10, '', '', '', 1, 0, 'SR', '', '', NULL),
---             ('95k', 'v', 'Cost, replacement price (similar to 365 $b, 876-8 $c)', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'SR', '', '', NULL),
---             ('95k', 'w', 'Price effective from (similar to 365 $f)', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'SR', '', '', NULL),
---             ('95k', 'x', 'Nonpublic note (lost item payment) (similar to 852, 876-8 $x)', 'Nonpublic note', 1, 0, 'items.paidfor', 10, '', '', '', NULL, 7, 'SR', '', '', NULL),
---             ('95k', 'y', 'Koha item type', 'Koha item type', 1, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, -5, 'SR', '', '', NULL),
---             ('95k', 'z', 'Public note (similar to 852, 876-8 $z)', 'Public note', 1, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'SR', '', '', NULL);
-
-
-
--- Current items Field/Subfields
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('952', 'LOCATION AND ITEM INFORMATION (KOHA)', 'LOCATION AND ITEM INFORMATION (KOHA)', 1, 0, '', 'SR');
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('952', '0', 'Withdrawn status', 'Withdrawn status', 0, 0, 'items.wthdrawn', 10, 'WITHDRAWN', '', '', 0, 0, 'SR', '', '', NULL),
-               ('952', '1', 'Lost status', 'Lost status', 0, 0, 'items.itemlost', 10, 'LOST', '', '', 0, 0, 'SR', '', '', NULL),
-               ('952', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'items.cn_source', 10, '', '', 'marc21_classcodes.pl', NULL, 0, 'SR', '', '', NULL),
-               ('952', '3', 'Materials specified (bound volume or other part)', 'Materials specified (bound volume or other part)', 0, 0, 'items.materials', 10, '', '', '', NULL, -1, 'SR', '', '', NULL),
-               ('952', '4', 'Damaged status', 'Damaged status', 0, 0, 'items.damaged', 10, 'DAMAGED', '', '', NULL, 0, 'SR', '', '', NULL),
-               ('952', '5', 'Use restrictions', 'Use restrictions', 0, 0, 'items.restricted', 10, 'RESTRICTED', '', '', 0, 0, 'SR', '', '', NULL),
-               ('952', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'items.cn_sort', -1, '', '', '', 0, 7, 'SR', '', '', NULL),
-               ('952', '7', 'Not for loan', 'Not for loan', 0, 0, 'items.notforloan', 10, 'NOT_LOAN', '', '', 0, 0, 'SR', '', '', NULL),
-               ('952', '8', 'Koha collection', 'Koha collection', 0, 0, 'items.ccode', 10, 'CCODE', '', '', 0, 0, 'SR', '', '', NULL),
-               ('952', '9', 'Koha itemnumber (autogenerated)', 'Koha itemnumber', 0, 0, 'items.itemnumber', -1, '', '', '', 0, 7, 'SR', '', '', NULL),
-               ('952', 'a', 'Location (home branch)', 'Location (home branch)', 0, 0, 'items.homebranch', 10, 'branches', '', '', 0, 0, 'SR', '', '', NULL),
-               ('952', 'b', 'Sublocation or collection (holding branch)', 'Sublocation or collection (holding branch)', 1, 0, 'items.holdingbranch', 10, 'branches', '', '', 0, 0, 'SR', '', '', NULL),
-               ('952', 'c', 'Shelving location', 'Shelving location', 1, 0, 'items.location', 10, 'LOC', '', '', 0, 0, 'SR', '', '', NULL),
-               ('952', 'd', 'Date acquired', 'Date acquired', 0, 0, 'items.dateaccessioned', 10, '', '', 'dateaccessioned.pl', 0, 0, 'SR', '', '', NULL),
-               ('952', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, 'items.booksellerid', 10, '', '', 'bookseller.pl', 0, 0, 'SR', '', '', NULL),
-               ('952', 'f', 'Coded location qualifier', 'Coded location qualifier', 1, 0, 'items.coded_location_qualifier', 10, '', '', 'marc21_locationqualifier.pl', NULL, 0, 'SR', '', '', NULL),
-               ('952', 'g', 'Cost, normal purchase price', 'Cost, normal purchase price', 0, 0, 'items.price', 10, '', '', '', 0, 0, 'SR', '', '', NULL),
-               ('952', 'j', 'Shelving control number', 'Shelving control number', 0, 0, 'items.stack', 10, 'STACK', '', '', NULL, -1, 'SR', '', '', NULL),
-               ('952', 'l', 'Koha issues (times borrowed)', 'Koha issues (times borrowed)', 0, 0, 'items.issues', 10, '', '', '', NULL, -5, 'SR', '', '', NULL),
-               ('952', 'm', 'Koha renewals', 'Koha renewals', 0, 0, 'items.renewals', 10, '', '', '', NULL, -5, 'SR', '', '', NULL),
-               ('952', 'n', 'Koha reserves (requests)', 'Koha reserves (requests)', 0, 0, 'items.reserves', 10, '', '', '', NULL, -5, 'SR', '', '', NULL),
-               ('952', 'o', 'Koha full call number', 'Koha full call number', 0, 0, 'items.itemcallnumber', 10, '', 'marc21_itemcallnumber.pl', NULL, 0, 0, 'SR', '', '', NULL),
-               ('952', 'p', 'Piece designation (barcode)', 'Piece designation (barcode)', 0, 0, 'items.barcode', 10, '', '', 'barcode.pl', 0, 0, 'SR', '', '', NULL),
-               ('952', 'q', 'Koha out on loan', 'Koha out on loan', 1, 0, 'items.onloan', 10, '', '', '', NULL, -5, 'SR', '', '', NULL),
-               ('952', 'r', 'Koha date last seen', 'Koha date last seen', 1, 0, 'items.datelastseen', 10, '', '', '', NULL, -5, 'SR', '', '', NULL),
-               ('952', 's', 'Koha date last borrowed', 'Koha date last borrowed', 1, 0, 'items.datelastborrowed', 10, '', '', '', NULL, -5, 'SR', '', '', NULL),
-               ('952', 't', 'Copy number', 'Copy number', 0, 0, 'items.copynumber', 10, '', '', '', NULL, 0, 'SR', '', '', NULL),
-               ('952', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, 'items.uri', 10, '', '', '', 1, 0, 'SR', '', '', NULL),
-               ('952', 'v', 'Cost, replacement price', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'SR', '', '', NULL),
-               ('952', 'w', 'Price effective from', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'SR', '', '', NULL),
-               ('952', 'x', 'Nonpublic note (lost item payment)', 'Nonpublic note (lost item payment)', 1, 0, 'items.paidfor', 10, '', '', '', NULL, 7, 'SR', '', '', NULL),
-               ('952', 'y', 'Koha item type', 'Koha item type', 1, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, -1, 'SR', '', '', NULL),
-               ('952', 'z', 'Public note', 'Public note', 1, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'SR', '', '', NULL);
-
-
-
--- *******************************************************
-
-
-
--- *********************************************************************
--- SIMPLE SOUND RECORDINGS MARC 21 FIELDS/SUBFIELDS AND COMMMONLY USED
--- EXTENSIONS.
--- *********************************************************************
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('01e', 'CODED FIELD ERROR (RLIN)', 'CODED FIELD ERROR (RLIN)', 1, 0, '', 'SR'),
-               ('89e', 'ERRONEOUS FIELD, ERR (RLIN)', 'ERRONEOUS FIELD, ERR (RLIN)', 1, 0, '', 'SR'),
-               ('91c', 'EQUIVALENCE OR CROSS-REFERENCE-CORPORATE NAME [LOCAL, CANADA]', 'EQUIVALENCE OR CROSS-REFERENCE-CORPORATE NAME [LOCAL, CANADA]', 1, 0, '', 'SR'),
-               ('91r', 'RLG STANDARDS NOTE (RLIN)', 'RLG STANDARDS NOTE (RLIN)', 1, 0, '', 'SR'),
-               ('93r', 'SUMMARY HOLDINGS STATEMENT (RLIN)', 'SUMMARY HOLDINGS STATEMENT (RLIN)', 1, 0, '', 'SR'),
-               ('94c', 'EQUIVALENCE OR CROSS-REFERENCE--TITLE [OBSOLETE] [CAN/MARC only]', 'EQUIVALENCE OR CROSS-REFERENCE--TITLE [OBSOLETE] [CAN/MARC only]', 1, 0, '', 'SR'),
-               ('94a', 'ANALYSIS TREATMENT NOTE (RLIN)', 'ANALYSIS TREATMENT NOTE (RLIN)', 1, 0, '', 'SR'),
-               ('94b', 'TREATMENT CODES (RLIN)', 'TREATMENT CODES (RLIN)', 1, 0, '', 'SR'),
-               ('95c', 'EQUIVALENCE OR CROSS-REFERENCE--HIERARCHICAL PLACE NAME [OBSOLETE] [CAN/MARC only]', 'EQUIVALENCE OR CROSS-REFERENCE-HIERARCHICAL PLACE NAME [OBSOLETE] [CAN/MARC only]', 1, 0, '', 'SR'),
-               ('95r', 'CLUSTER MEMBER (RLIN)', 'CLUSTER MEMBER (RLIN)', 1, 0, '', 'SR'),
-               ('b99', 'PRIVATE LOCAL INFORMATION (RLIN)', 'PRIVATE LOCAL INFORMATION (RLIN)', 1, 0, '', 'SR'),
-               ('u01', 'UNIT IDENTIFICATION, STATUS, AND TYPE (RLIN)', 'UNIT IDENTIFICATION, STATUS, AND TYPE (RLIN)', 0, 0, '', 'SR'),
-               ('u02', 'STANDARD NUMBER (RLIN)', 'STANDARD NUMBER (RLIN)', 0, 0, '', 'SR'),
-               ('u08', 'CODED INFORMATION (RLIN)', 'CODED INFORMATION (RLIN)', 0, 0, '', 'SR'),
-               ('u10', 'REQUESTER IDENTIFICATION (RLIN)', 'REQUESTER IDENTIFICATION (RLIN)', 1, 0, '', 'SR'),
-               ('u11', 'DEPARTMENT REPORT REQUEST (RLIN)', 'DEPARTMENT REPORT REQUEST (RLIN)', 1, 0, '', 'SR'),
-               ('u20', 'SUPPLIER IDENTIFICATION, SUPN (RLIN)', 'SUPPLIER IDENTIFICATION, SUPN (RLIN)', 0, 0, '', 'SR'),
-               ('u21', 'LIBRARY CODES FOR VENDOR AND ORDER (RLIN)', 'LIBRARY CODES FOR VENDOR AND ORDER (RLIN)', 0, 0, '', 'SR'),
-               ('u22', 'SUPPLIER CODES AND CATALOG INFORMATION (RLIN)', 'SUPPLIER CODES AND CATALOG INFORMATION (RLIN)', 0, 0, '', 'SR'),
-               ('u25', 'SUPPLIER REPORT(S) (RLIN)', 'SUPPLIER REPORT(S) (RLIN)', 0, 0, '', 'SR'),
-               ('u30', 'INTERVALS (RLIN)', 'INTERVALS (RLIN)', 0, 0, '', 'SR'),
-               ('u31', 'CLAIM COUNTS (RLIN)', 'CLAIM COUNTS (RLIN)', 0, 0, '', 'SR'),
-               ('u33', 'INVOICE CLAIM (RLIN)', 'INVOICE CLAIM (RLIN)', 0, 0, '', 'SR'),
-               ('u34', 'EXTENDED PROCUREMENT CLAIM AND REVIEW (RLIN)', 'EXTENDED PROCUREMENT CLAIM AND REVIEW (RLIN)', 0, 0, '', 'SR'),
-               ('u40', 'EXTENDED PROCUREMENT CODES (RLIN)', 'EXTENDED PROCUREMENT CODES (RLIN)', 0, 0, '', 'SR'),
-               ('u50', 'ACQUISITIONS NOTES (RLIN)', 'ACQUISITIONS NOTES (RLIN)', 0, 0, '', 'SR'),
-               ('u51', 'SELECTION NOTES (RLIN)', 'SELECTION NOTES (RLIN)', 0, 0, '', 'SR'),
-               ('u52', 'SUPPLIER INSTRUCTIONS AND NOTES, SINT (RLIN)', 'SUPPLIER INSTRUCTIONS AND NOTES, SINT (RLIN)', 0, 0, '', 'SR'),
-               ('u53', 'CLAIM INSTRUCTIONS AND NOTES, CLNT (RLIN)', 'CLAIM INSTRUCTIONS AND NOTES, CLNT (RLIN)', 0, 0, '', 'SR'),
-               ('u54', 'NOTES TO SERIALS DEPARTMENT (RLIN)', 'NOTES TO SERIALS DEPARTMENT (RLIN)', 0, 0, '', 'SR'),
-               ('u55', 'CATALOGING NOTES (RLIN)', 'CATALOGING NOTES (RLIN)', 0, 0, '', 'SR'),
-               ('u5f', 'ACCOUNTING NOTES (RLIN)', 'ACCOUNTING NOTES (RLIN)', 0, 0, '', 'SR'),
-               ('u70', 'MATERIAL AND LOCATION INFORMATION (RLIN)', 'MATERIAL AND LOCATION INFORMATION (RLIN)', 0, 0, '', 'SR'),
-               ('u71', 'FUND ACCOUNT (RLIN)', 'FUND ACCOUNT (RLIN)', 0, 0, '', 'SR'),
-               ('u75', 'ITEM DETAILS (RLIN)', 'ITEM DETAILS (RLIN)', 1, 0, '', 'SR'),
-               ('u7f', 'PRICE INFORMATION (RLIN)', 'PRICE INFORMATION (RLIN)', 1, 0, '', 'SR'),
-               ('u90', 'TAPE OUTPUT, TAPE (RLIN)', 'TAPE OUTPUT, TAPE (RLIN)', 0, 0, '', 'SR'),
-               ('ufi', 'FISCAL INFORMATION, FI (RLIN)', 'FISCAL INFORMATION, FI (RLIN)', 1, 0, '', 'SR');
-
-
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('01e', 'a', 'Coded field error', 'Coded field error', 0, 0, '', 0, '', '', '', 0, -6, 'SR', '', '', NULL),
-               ('89e', '0', '0', '0', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', '1', '1', '1', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', '2', '2', '2', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', '3', '3', '3', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', '4', '4', '4', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', '5', '5', '5', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', '6', '6', '6', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', '7', '7', '7', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', '8', '8', '8', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', '9', '9', '9', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', 'a', 'a', 'a', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', 'b', 'b', 'b', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', 'c', 'c', 'c', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', 'd', 'd', 'd', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', 'e', 'e', 'e', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', 'f', 'f', 'f', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', 'g', 'g', 'g', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', 'h', 'h', 'h', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', 'i', 'i', 'i', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', 'j', 'j', 'j', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', 'k', 'k', 'k', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', 'l', 'l', 'l', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', 'm', 'm', 'm', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', 'n', 'n', 'n', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', 'o', 'o', 'o', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', 'p', 'p', 'p', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', 'q', 'q', 'q', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', 'r', 'r', 'r', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', 's', 's', 's', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', 't', 't', 't', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', 'u', 'u', 'u', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', 'v', 'v', 'v', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', 'w', 'w', 'w', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', 'x', 'x', 'x', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', 'y', 'y', 'y', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('89e', 'z', 'z', 'z', 1, 0, '', 8, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('91c', '4', 'Relator code', 'Relator code', 1, 0, '', 9, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('91c', '6', 'Linkage', 'Linkage', 0, 0, '', 9, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('91c', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 9, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('91c', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, '', 9, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('91c', 'b', 'Subordinate unit', 'Subordinate unit', 1, 0, '', 9, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('91c', 'c', 'Location of meeting', 'Location of meeting', 0, 0, '', 9, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('91c', 'd', 'Date of meeting or treaty signing', 'Date of meeting or treaty signing', 1, 0, '', 9, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('91c', 'e', 'Relator term', 'Relator term', 1, 0, '', 9, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('91c', 'f', 'Date of a work', 'Date of a work', 0, 0, '', 9, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('91c', 'g', 'Miscellaneous information', 'Miscellaneous information', 0, 0, '', 9, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('91c', 'k', 'Form subheading', 'Form subheading', 1, 0, '', 9, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('91c', 'l', 'Language of a work', 'Language of a work', 0, 0, '', 9, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('91c', 'n', 'Number of part/section/meeting', 'Number of part/section/meeting', 1, 0, '', 9, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('91c', 'p', 'Name of part/section of a work', 'Name of part/section of a work', 1, 0, '', 9, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('91c', 't', 'Title of a work', 'Title of a work', 0, 0, '', 9, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('91c', 'u', 'Affiliation', 'Affiliation', 0, 0, '', 9, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('91r', 'a', 'RLG standards note', 'RLG standards note', 0, 0, '', 9, '', '', '', 0, -6, 'SR', '', '', NULL),
-               ('93r', 'a', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SR', '', '', NULL),
-               ('93r', 'b', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SR', '', '', NULL),
-               ('93r', 'c', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SR', '', '', NULL),
-               ('93r', 'd', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SR', '', '', NULL),
-               ('93r', 'e', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SR', '', '', NULL),
-               ('93r', 'f', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SR', '', '', NULL),
-               ('93r', 'g', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SR', '', '', NULL),
-               ('93r', 'h', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SR', '', '', NULL),
-               ('93r', 'i', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SR', '', '', NULL),
-               ('93r', 'k', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SR', '', '', NULL),
-               ('94c', '6', 'Linkage', 'Linkage', 0, 0, '', 9, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('94c', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 9, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('94c', 'a', 'Title', 'Title', 0, 0, '', 9, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('94c', 'b', 'Remainder of title', 'Remainder of title', 0, 0, '', 9, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('94c', 'c', 'Statement of responsibility, etc', 'Statement of responsibility, etc', 0, 0, '', 9, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('94c', 'd', 'Designation of section/part/series (SE) [OBSOLETE]', 'Designation of section section/part/series (SE) [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('94c', 'e', 'Name of part/section/series (SE) [OBSOLETE]', 'Name of part/section/series (SE) [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('94c', 'f', 'Inclusive dates', 'Inclusive dates', 0, 0, '', 9, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('94c', 'g', 'Bulk dates', 'Bulk dates', 0, 0, '', 9, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('94c', 'h', 'Medium', 'Medium', 0, 0, '', 9, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('94c', 'k', 'Form', 'Form', 1, 0, '', 9, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('94c', 'n', 'Number of part/section of a work', 'Number of part/section of a work', 1, 0, '', 9, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('94c', 'p', 'Name of part/section of a work', 'Name of part/section of a work', 1, 0, '', 9, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('94c', 's', 'Version', 'Version', 0, 0, '', 9, '', '', '', NULL, -6, 'SR', '', '', NULL),
-               ('94a', 'a', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'SR', '', '', NULL),
-               ('94a', 'b', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'SR', '', '', NULL),
-               ('94a', 'c', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'SR', '', '', NULL),
-               ('94a', 'd', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'SR', '', '', NULL),
-               ('94a', 'e', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'SR', '', '', NULL),
-               ('94b', 'a', 'ATC', 'ATC', 0, 0, '', 9, '', '', '', 0, -6, 'SR', '', '', NULL),
-               ('94b', 'b', 'SNR', 'SNR', 0, 0, '', 9, '', '', '', 0, -6, 'SR', '', '', NULL),
-               ('95c', 'a', 'Country', 'Country', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SR', '', '', NULL),
-               ('95c', 'b', 'State, province, territory', 'State, province, territory', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SR', '', '', NULL),
-               ('95c', 'c', 'County, region, islands area', 'County, region, islands area', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SR', '', '', NULL),
-               ('95c', 'd', 'City', 'City', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SR', '', '', NULL),
-               ('95r', '6', 'Linkage', 'Linkage', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SR', '', '', NULL),
-               ('95r', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SR', '', '', NULL),
-               ('95r', 'a', 'Record ID (RLIN)', 'Record ID (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('95r', 'b', 'Institution name (RLIN)', 'Institution name (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u01', 'a', 'Operator\'s initials, OID (RLIN)', 'Operator\'s initials, OID (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u01', 'd', 'UAD (RLIN)', 'UAD (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u01', 'f', 'FPST (RLIN)', 'FPST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u01', 'h', 'CPST (RLIN)', 'FPST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u01', 'i', 'CPST (RLIN)', 'FPST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u01', 's', 'UST (RLIN)', 'UST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u01', 't', 'UTYP (RLIN)', 'UTYP (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u02', '2', 'Source of number or code', 'Source of number or code', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u02', 'a', 'Standard number or code', 'Standard number or code', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u02', 'b', 'Additional codes following the standard number', 'Additional codes following the standard number', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u02', 'c', 'Terms of availability', 'Terms of availability', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u02', 'z', 'Canceled/invalid standard number or code', 'Canceled/invalid standard number or code', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u08', 'n', 'LSI', 'LSI', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u08', 'o', 'SID', 'SID', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u08', 'p', 'DP', 'DP', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u08', 'r', 'RUSH', 'RUSH', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u10', 'a', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u10', 'b', 'SID', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u10', 'c', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u10', 'd', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u10', 'e', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u10', 's', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u11', 'a', 'Department report request, DRR (DRRH for earlier occurrences)', 'DRR (DRRH for earlier occurrences)', 1, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u20', 'a', 'SUPN', 'SUPN', 1, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u20', 'b', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u20', 'c', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u20', 'd', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u20', 'e', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u20', 'x', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u21', 'a', 'SHIP', 'SHIP', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u21', 'b', 'BILL', 'BILL', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u21', 'c', 'DAC', 'DAC', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u21', 'n', 'LSAC', 'LSAC', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u22', 'a', 'SICO', 'SICO', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u22', 'b', 'SICO', 'SICO', 1, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u22', 'c', 'SCAT', 'SCAT', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u25', 'a', 'Supplier report(s), SRPT', 'Supplier report(s), SRPT', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u30', 'a', 'NCC [OBSOLETE]', 'NCC [OBSOLETE]', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u30', 'i', 'ICI', 'ICI', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u30', 'm', 'MCI', 'MCI', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u31', 'a', 'NCC', 'NCC', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u31', 'b', 'NCS', 'NCS', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u33', 'a', 'ICL', 'ICL', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u33', 'd', 'ICAD', 'ICAD', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u34', 'a', 'EPCL', 'EPCL', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u34', 'r', 'ERI', 'ERI', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u40', 'd', 'EPDT [OBSOLETE]', 'EPDT [OBSOLETE]', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u40', 'f', 'EFRQ', 'EFRQ', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u40', 's', 'EPST', 'EPST', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u40', 't', 'ETYP', 'ETYP', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u50', 'a', 'Acquisitions notes, AQNT', 'Acquisitions notes, AQNT', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u51', 'a', 'Selection notes, SLNT', 'Selection notes, SLNT', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u52', 'a', 'INT', 'INT', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u52', 'b', 'INT', 'NT', 1, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u53', 'a', 'CLNT', 'CLNT', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u53', 'b', 'CLNT', 'CLNT', 1, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u54', 'a', 'Notes to serials department, SRNT', 'Notes to serials department, SRNT', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u55', 'a', 'Cataloging notes, CTNT', 'Cataloging notes, CTNT', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u5f', 'a', 'Accounting notes, ACNT', 'Accounting notes, ACNT', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u70', 'a', 'QTY', 'QTY', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u70', 'b', 'MAT', 'MAT', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u70', 'l', 'MLOC', 'MLOC', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u71', 'a', 'Fund account, FUND', 'Fund account, FUND', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u75', 'a', 'ITEM', 'ITEM', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u75', 'c', 'CIRC', 'CIRC', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u75', 'h', 'IPST', 'IPST', 1, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u75', 'i', 'ITEM', 'ITEM', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u75', 'l', 'SLOC', 'SLOC', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u7f', 'a', 'LPRI', 'LPRI', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u7f', 'b', 'CURR', 'CURR', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u7f', 'k', 'CVRT [OBSOLETE]', 'CVRT [OBSOLETE]', 1, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u7f', 'p', 'LPD', 'LPD', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u7f', 'r', 'EDRT', 'EDRT', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u90', 'h', 'TAPE', 'TAPE', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('u90', 'i', 'TAPE', 'TAPE', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('ufi', 'a', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('ufi', 'b', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('ufi', 'c', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('ufi', 'd', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('ufi', 'e', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('ufi', 'f', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('ufi', 'g', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('ufi', 'h', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL),
-               ('ufi', 'n', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'SR', '', '', NULL);
-
-
--- *******************************************************
-
-
-
--- ***********************************************************
--- SIMPLE VIDEORECORDINGS KOHA RECORD AND HOLDINGS MANAGEMENT
--- FIELDS/SUBFIELDS.
--- ***********************************************************
-
-
--- Current Record ID Field/Subfields
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('999', 'SYSTEM CONTROL NUMBERS (KOHA)', 'SYSTEM CONTROL NUMBERS (KOHA)', 1, 0, '', 'VR');
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('999', 'a', 'Item type [OBSOLETE]', 'Item type [OBSOLETE]', 0, 0, NULL, -1, NULL, NULL, '', NULL, -5, 'VR', '', '', NULL),
-               ('999', 'b', 'Koha Dewey Subclass [OBSOLETE]', 'Koha Dewey Subclass [OBSOLETE]', 0, 0, NULL, 0, NULL, NULL, '', NULL, -5, 'VR', '', '', NULL),
-               ('999', 'c', 'Koha biblionumber', 'Koha biblionumber', 0, 0, 'biblio.biblionumber', -1, NULL, NULL, '', NULL, -5, 'VR', '', '', NULL),
-               ('999', 'd', 'Koha biblioitemnumber', 'Koha biblioitemnumber', 0, 0, 'biblioitems.biblioitemnumber', -1, NULL, NULL, '', NULL, -5, 'VR', '', '', NULL);
-
-
--- ******************************************************
-
-
--- Plugins which need to be written for primary biblioitems Field/Subfields.
-
-
---             ('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, '', '', 'marc21_classcodes.pl', NULL, 0, 'VR', '', '', NULL),
---             ('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', 'marc21_callnumber.pl', NULL, 0, 'VR', '', '', NULL),
-
-
-
--- Current primary biblioitems Field/Subfields
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('942', 'ADDED ENTRY ELEMENTS (KOHA)', 'ADDED ENTRY ELEMENTS (KOHA)', 0, 0, '', 'VR');
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('942', '0', 'Koha issues (borrowed), all copies', 'Koha issues (borrowed), all copies', 0, 0, 'biblioitems.totalissues', 9, '', '', '', NULL, -5, 'VR', '', '', NULL),
-               ('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, '', '', '', NULL, 0, 'VR', '', '', NULL),
-               ('942', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'biblioitems.cn_sort', -1, '', '', '', 0, 7, 'VR', '', '', NULL),
-               ('942', 'a', 'Institution code [OBSOLETE]', 'Institution code [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -5, 'VR', '', '', NULL),
-               ('942', 'c', 'Item type', 'Item type', 0, 1, 'biblioitems.itemtype', 9, 'itemtypes', '', '', NULL, 0, 'VR', '', '', NULL),
-               ('942', 'e', 'Edition', 'Edition', 0, 0, 'biblioitems.cn_edition', 9, 'CN_EDITION', '', '', NULL, 0, 'VR', '', '', NULL),
-               ('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', '', NULL, 0, 'VR', '', '', NULL),
-               ('942', 'i', 'Item part', 'Item part', 1, 0, 'biblioitems.cn_item', 9, '', '', '', NULL, 9, 'VR', '', '', NULL),
-               ('942', 'k', 'Call number prefix', 'Call number prefix', 0, 0, 'biblioitems.cn_prefix', 9, '', '', '', NULL, 0, 'VR', '', '', NULL),
-               ('942', 'm', 'Call number suffix', 'Call number suffix', 0, 0, 'biblioitems.cn_suffix', 9, '', '', '', 0, 0, 'VR', '', '', NULL);
-
-
--- ******************************************************
-
-
--- Recommended items Field/Subfields
-
-
--- INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
---             ('95k', 'LOCATION AND ITEM INFORMATION (KOHA)', 'LOCATION AND ITEM INFORMATION (KOHA)', 1, 0, '', 'VR');
-
--- INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
---             ('95k', '0', 'Item status (withdrawn) (similar to 876-8 $j)', 'Item status (withdrawn)', 0, 0, 'items.wthdrawn', 10, 'WITHDRAWN', '', '', 0, 0, 'VR', '', '', NULL),
---             ('95k', '1', 'Item status (lost) (similar to 876-8 $j)', 'Item status (lost)', 0, 0, 'items.itemlost', 10, 'LOST', '', '', 0, 0, 'VR', '', '', NULL),
---             ('95k', '2', 'Source of classification or shelving scheme (similar to 852 $2)', 'Source of classification or shelving scheme', 0, 0, 'items.cn_source', 10, '', '', 'marc21_classcodes.pl', NULL, 0, 'VR', '', '', NULL),
---             ('95k', '3', 'Materials specified (bound volume or other part) (similar to 852, 876-8 $3)', 'Materials specified (bound volume or other part)', 0, 0, 'items.materials', 10, '', '', '', NULL, -1, 'VR', '', '', NULL),
---             ('95k', '4', 'Item status (damaged) (similar to 876-8 $j)', 'Item status (damaged)', 0, 0, 'items.damaged', 10, 'DAMAGED', '', '', NULL, 0, 'VR', '', '', NULL),
---             ('95k', '5', 'Use restrictions (similar to 506 $a, 876-8 $h)', 'Use restrictions', 0, 0, 'items.restricted', 10, 'RESTRICTED', '', '', 0, 0, 'VR', '', '', NULL),
---             ('95k', '6', 'Linkage (similar to 852, 876-8 $6)', 'Linkage', 0, 0, 'items.linkage', 10, '', '', '', NULL, -6, 'VR', '', '', NULL),
---             ('95k', '7', 'Use restrictions (not for loan) (similar to 506 $a, 876-8 $h)', 'Use restrictions (not for loan)', 0, 0, 'items.notforloan', 10, 'NOT_LOAN', '', '', 0, 0, 'VR', '', '', NULL),
---             ('95k', '8', 'Sequence number (similar to 852, 876-8 $8)', 'Sequence number', 1, 0, 'items.sequence', 10, '', '', '', NULL, 0, 'VR', '', '', NULL),
---             ('95k', '9', 'Koha itemnumber (autogenerated similar to 852, 876-8 $3 $8 $t combined)', 'Koha itemnumber', 0, 0, 'items.itemnumber', -1, '', '', '', 0, -5, 'VR', '', '', NULL),
---             ('95k', 'a', 'Location (home branch) (similar to 852 $a)', 'Location (home branch)', 0, 0, 'items.homebranch', 10, 'branches', '', '', 0, 0, 'VR', '', '', NULL),
---             ('95k', 'b', 'Sublocation or collection (holding branch) (similar to 852 $b)', 'Sublocation or collection (holding branch)', 1, 0, 'items.holdingbranch', 10, 'branches', '', '', 0, 0, 'VR', '', '', NULL),
---             ('95k', 'c', 'Shelving location (similar to 852 $c, 876-8 $l)', 'Shelving location', 1, 0, 'items.location', 10, 'LOC', '', '', 0, 0, 'VR', '', '', NULL),
---             ('95k', 'd', 'Date acquired (similar to 541, 876-8 $d)', 'Date acquired', 0, 0, 'items.dateaccessioned', 10, '', '', 'dateaccessioned.pl', 0, 0, 'VR', '', '', NULL),
---             ('95k', 'e', 'Source of acquisition (similar to 541 $a, 876-8 $e)', 'Source of acquisition', 1, 0, 'items.booksellerid', 10, '', '', 'bookseller.pl', 0, 0, 'VR', '', '', NULL),
---             ('95k', 'f', 'Coded location qualifier (similar to 852 $f)', 'Coded location qualifier', 1, 0, 'items.coded_location_qualifier', 10, '', '', 'marc21_locationqualifier.pl', NULL, 0, 'VR', '', '', NULL),
---             ('95k', 'g', 'Non-coded location qualifier (similar to 852 $g)', 'Non-coded location qualifier', 1, 0, 'items.non_coded_location_qualifier', 10, '', '', '', NULL, 0, 'VR', '', '', NULL),
---             ('95k', 'h', 'Classification part (similar to 852 $h)', 'Classification part', 0, 0, 'items.cn_class', 10, '', '', '', NULL, 0, 'VR', '', '', NULL),
---             ('95k', 'i', 'Item part (similar to 852 $i)', 'Item part', 1, 0, 'items.cn_item', 10, '', '', '', NULL, 0, 'VR', '', '', NULL),
---             ('95k', 'j', 'Shelving control number (similar to 852 $j)', 'Shelving control number', 0, 0, 'items.stack', 10, 'STACK', '', '', NULL, 0, 'VR', '', '', NULL),
---             ('95k', 'k', 'Call number prefix (similar to 852 $k)', 'Call number prefix', 0, 0, 'items.cn_prefix', 10, '', '', '', NULL, 0, 'VR', '', '', NULL),
---             ('95k', 'l', 'Shelving form of title (similar to 852 $l)', 'Shelving form of title', 0, 0, 'items.shelving_title', 10, '', '', '', NULL, 0, 'VR', '', '', NULL),
---             ('95k', 'm', 'Cost, normal purchase price (similar to 541 $h, 876-8 $c)', 'Cost, normal purchase price', 0, 0, 'items.price', 10, '', '', '', 0, 0, 'VR', '', '', NULL),
---             ('95k', 'n', 'Koha collection', 'Koha collection', 0, 0, 'items.ccode', 10, 'CCODE', '', '', 0, 0, 'VR', '', '', NULL),
---             ('95k', 'o', 'Koha full call number (similar to 852 $k $h $i $m $t combined)', 'Koha full call number', 0, 0, 'items.itemcallnumber', 10, '', 'marc21_itemcallnumber.pl', NULL, 0, 0, 'VR', '', '', NULL),
---             ('95k', 'p', 'Piece designation (barcode) (similar to 852, 876-8 $p)', 'Piece designation (barcode)', 0, 0, 'items.barcode', 10, '', '', 'barcode.pl', 0, 0, 'VR', '', '', NULL),
---             ('95k', 'q', 'Piece physical condition (similar to 562 $a, 852 $q)', 'Piece physical condition', 0, 0, 'items.condition', 10, '', '', '', NULL, 0, 'VR', '', '', NULL),
---             ('95k', 'r', 'Invalid or canceled piece designation (canceled barcode) (similar to 876-8 $r)', 'Invalid or canceled piece designation (canceled barcode)', 1, 0, 'items.cancelled_barcode', 10, '', '', '', NULL, -1, 'VR', '', '', NULL),
---             ('95k', 's', 'Copyright article-fee code (similar to 018 $a, 852 $s)', 'Copyright article-fee code', 1, 0, 'items.copyright_fee', 10, '', '', '', NULL, 0, 'VR', '', '', NULL),
---             ('95k', 'q', 'Koha out on loan', 'Koha out on loan', 1, 0, 'items.onloan', 10, '', '', '', NULL, -5, 'VR', '', '', NULL),
---             ('95k', 'r', 'Koha date last seen', 'Koha date last seen', 1, 0, 'items.datelastseen', 10, '', '', '', NULL, -5, 'VR', '', '', NULL),
---             ('95k', 's', 'Koha date last borrowed', 'Koha date last borrowed', 1, 0, 'items.datelastborrowed', 10, '', '', '', NULL, -5, 'VR', '', '', NULL),
---             ('95k', 't', 'Copy number (similar to 852, 876-8 $t)', 'Copy number', 0, 0, 'items.copynumber', 10, '', '', '', NULL, 0, 'VR', '', '', NULL),
---             ('95k', 'u', 'Uniform Resource Identifier (similar to 852 $u)', 'Uniform Resource Identifier', 1, 0, 'items.uri', 10, '', '', '', 1, 0, 'VR', '', '', NULL),
---             ('95k', 'v', 'Cost, replacement price (similar to 365 $b, 876-8 $c)', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'VR', '', '', NULL),
---             ('95k', 'w', 'Price effective from (similar to 365 $f)', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'VR', '', '', NULL),
---             ('95k', 'x', 'Nonpublic note (lost item payment) (similar to 852, 876-8 $x)', 'Nonpublic note', 1, 0, 'items.paidfor', 10, '', '', '', NULL, 7, 'VR', '', '', NULL),
---             ('95k', 'y', 'Koha item type', 'Koha item type', 1, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, -5, 'VR', '', '', NULL),
---             ('95k', 'z', 'Public note (similar to 852, 876-8 $z)', 'Public note', 1, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'VR', '', '', NULL);
-
-
-
--- Current items Field/Subfields
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('952', 'LOCATION AND ITEM INFORMATION (KOHA)', 'LOCATION AND ITEM INFORMATION (KOHA)', 1, 0, '', 'VR');
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('952', '0', 'Withdrawn status', 'Withdrawn status', 0, 0, 'items.wthdrawn', 10, 'WITHDRAWN', '', '', 0, 0, 'VR', '', '', NULL),
-               ('952', '1', 'Lost status', 'Lost status', 0, 0, 'items.itemlost', 10, 'LOST', '', '', 0, 0, 'VR', '', '', NULL),
-               ('952', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'items.cn_source', 10, '', '', 'marc21_classcodes.pl', NULL, 0, 'VR', '', '', NULL),
-               ('952', '3', 'Materials specified (bound volume or other part)', 'Materials specified (bound volume or other part)', 0, 0, 'items.materials', 10, '', '', '', NULL, -1, 'VR', '', '', NULL),
-               ('952', '4', 'Damaged status', 'Damaged status', 0, 0, 'items.damaged', 10, 'DAMAGED', '', '', NULL, 0, 'VR', '', '', NULL),
-               ('952', '5', 'Use restrictions', 'Use restrictions', 0, 0, 'items.restricted', 10, 'RESTRICTED', '', '', 0, 0, 'VR', '', '', NULL),
-               ('952', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'items.cn_sort', -1, '', '', '', 0, 7, 'VR', '', '', NULL),
-               ('952', '7', 'Not for loan', 'Not for loan', 0, 0, 'items.notforloan', 10, 'NOT_LOAN', '', '', 0, 0, 'VR', '', '', NULL),
-               ('952', '8', 'Koha collection', 'Koha collection', 0, 0, 'items.ccode', 10, 'CCODE', '', '', 0, 0, 'VR', '', '', NULL),
-               ('952', '9', 'Koha itemnumber (autogenerated)', 'Koha itemnumber', 0, 0, 'items.itemnumber', -1, '', '', '', 0, 7, 'VR', '', '', NULL),
-               ('952', 'a', 'Location (home branch)', 'Location (home branch)', 0, 0, 'items.homebranch', 10, 'branches', '', '', 0, 0, 'VR', '', '', NULL),
-               ('952', 'b', 'Sublocation or collection (holding branch)', 'Sublocation or collection (holding branch)', 1, 0, 'items.holdingbranch', 10, 'branches', '', '', 0, 0, 'VR', '', '', NULL),
-               ('952', 'c', 'Shelving location', 'Shelving location', 1, 0, 'items.location', 10, 'LOC', '', '', 0, 0, 'VR', '', '', NULL),
-               ('952', 'd', 'Date acquired', 'Date acquired', 0, 0, 'items.dateaccessioned', 10, '', '', 'dateaccessioned.pl', 0, 0, 'VR', '', '', NULL),
-               ('952', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, 'items.booksellerid', 10, '', '', 'bookseller.pl', 0, 0, 'VR', '', '', NULL),
-               ('952', 'f', 'Coded location qualifier', 'Coded location qualifier', 1, 0, 'items.coded_location_qualifier', 10, '', '', 'marc21_locationqualifier.pl', NULL, 0, 'VR', '', '', NULL),
-               ('952', 'g', 'Cost, normal purchase price', 'Cost, normal purchase price', 0, 0, 'items.price', 10, '', '', '', 0, 0, 'VR', '', '', NULL),
-               ('952', 'j', 'Shelving control number', 'Shelving control number', 0, 0, 'items.stack', 10, 'STACK', '', '', NULL, -1, 'VR', '', '', NULL),
-               ('952', 'l', 'Koha issues (times borrowed)', 'Koha issues (times borrowed)', 0, 0, 'items.issues', 10, '', '', '', NULL, -5, 'VR', '', '', NULL),
-               ('952', 'm', 'Koha renewals', 'Koha renewals', 0, 0, 'items.renewals', 10, '', '', '', NULL, -5, 'VR', '', '', NULL),
-               ('952', 'n', 'Koha reserves (requests)', 'Koha reserves (requests)', 0, 0, 'items.reserves', 10, '', '', '', NULL, -5, 'VR', '', '', NULL),
-               ('952', 'o', 'Koha full call number', 'Koha full call number', 0, 0, 'items.itemcallnumber', 10, '', 'marc21_itemcallnumber.pl', NULL, 0, 0, 'VR', '', '', NULL),
-               ('952', 'p', 'Piece designation (barcode)', 'Piece designation (barcode)', 0, 0, 'items.barcode', 10, '', '', 'barcode.pl', 0, 0, 'VR', '', '', NULL),
-               ('952', 'q', 'Koha out on loan', 'Koha out on loan', 1, 0, 'items.onloan', 10, '', '', '', NULL, -5, 'VR', '', '', NULL),
-               ('952', 'r', 'Koha date last seen', 'Koha date last seen', 1, 0, 'items.datelastseen', 10, '', '', '', NULL, -5, 'VR', '', '', NULL),
-               ('952', 's', 'Koha date last borrowed', 'Koha date last borrowed', 1, 0, 'items.datelastborrowed', 10, '', '', '', NULL, -5, 'VR', '', '', NULL),
-               ('952', 't', 'Copy number', 'Copy number', 0, 0, 'items.copynumber', 10, '', '', '', NULL, 0, 'VR', '', '', NULL),
-               ('952', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, 'items.uri', 10, '', '', '', 1, 0, 'VR', '', '', NULL),
-               ('952', 'v', 'Cost, replacement price', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'VR', '', '', NULL),
-               ('952', 'w', 'Price effective from', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'VR', '', '', NULL),
-               ('952', 'x', 'Nonpublic note (lost item payment)', 'Nonpublic note (lost item payment)', 1, 0, 'items.paidfor', 10, '', '', '', NULL, 7, 'VR', '', '', NULL),
-               ('952', 'y', 'Koha item type', 'Koha item type', 1, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, -1, 'VR', '', '', NULL),
-               ('952', 'z', 'Public note', 'Public note', 1, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'VR', '', '', NULL);
-
-
-
--- *******************************************************
-
-
-
--- *******************************************************************
--- SIMPLE VIDEORECORDINGS MARC 21 FIELDS/SUBFIELDS AND COMMMONLY USED
--- EXTENSIONS.
--- *******************************************************************
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('01e', 'CODED FIELD ERROR (RLIN)', 'CODED FIELD ERROR (RLIN)', 1, 0, '', 'VR'),
-               ('89e', 'ERRONEOUS FIELD, ERR (RLIN)', 'ERRONEOUS FIELD, ERR (RLIN)', 1, 0, '', 'VR'),
-               ('91c', 'EQUIVALENCE OR CROSS-REFERENCE-CORPORATE NAME [LOCAL, CANADA]', 'EQUIVALENCE OR CROSS-REFERENCE-CORPORATE NAME [LOCAL, CANADA]', 1, 0, '', 'VR'),
-               ('91r', 'RLG STANDARDS NOTE (RLIN)', 'RLG STANDARDS NOTE (RLIN)', 1, 0, '', 'VR'),
-               ('93r', 'SUMMARY HOLDINGS STATEMENT (RLIN)', 'SUMMARY HOLDINGS STATEMENT (RLIN)', 1, 0, '', 'VR'),
-               ('94c', 'EQUIVALENCE OR CROSS-REFERENCE--TITLE [OBSOLETE] [CAN/MARC only]', 'EQUIVALENCE OR CROSS-REFERENCE--TITLE [OBSOLETE] [CAN/MARC only]', 1, 0, '', 'VR'),
-               ('94a', 'ANALYSIS TREATMENT NOTE (RLIN)', 'ANALYSIS TREATMENT NOTE (RLIN)', 1, 0, '', 'VR'),
-               ('94b', 'TREATMENT CODES (RLIN)', 'TREATMENT CODES (RLIN)', 1, 0, '', 'VR'),
-               ('95c', 'EQUIVALENCE OR CROSS-REFERENCE--HIERARCHICAL PLACE NAME [OBSOLETE] [CAN/MARC only]', 'EQUIVALENCE OR CROSS-REFERENCE-HIERARCHICAL PLACE NAME [OBSOLETE] [CAN/MARC only]', 1, 0, '', 'VR'),
-               ('95r', 'CLUSTER MEMBER (RLIN)', 'CLUSTER MEMBER (RLIN)', 1, 0, '', 'VR'),
-               ('b99', 'PRIVATE LOCAL INFORMATION (RLIN)', 'PRIVATE LOCAL INFORMATION (RLIN)', 1, 0, '', 'VR'),
-               ('u01', 'UNIT IDENTIFICATION, STATUS, AND TYPE (RLIN)', 'UNIT IDENTIFICATION, STATUS, AND TYPE (RLIN)', 0, 0, '', 'VR'),
-               ('u02', 'STANDARD NUMBER (RLIN)', 'STANDARD NUMBER (RLIN)', 0, 0, '', 'VR'),
-               ('u08', 'CODED INFORMATION (RLIN)', 'CODED INFORMATION (RLIN)', 0, 0, '', 'VR'),
-               ('u10', 'REQUESTER IDENTIFICATION (RLIN)', 'REQUESTER IDENTIFICATION (RLIN)', 1, 0, '', 'VR'),
-               ('u11', 'DEPARTMENT REPORT REQUEST (RLIN)', 'DEPARTMENT REPORT REQUEST (RLIN)', 1, 0, '', 'VR'),
-               ('u20', 'SUPPLIER IDENTIFICATION, SUPN (RLIN)', 'SUPPLIER IDENTIFICATION, SUPN (RLIN)', 0, 0, '', 'VR'),
-               ('u21', 'LIBRARY CODES FOR VENDOR AND ORDER (RLIN)', 'LIBRARY CODES FOR VENDOR AND ORDER (RLIN)', 0, 0, '', 'VR'),
-               ('u22', 'SUPPLIER CODES AND CATALOG INFORMATION (RLIN)', 'SUPPLIER CODES AND CATALOG INFORMATION (RLIN)', 0, 0, '', 'VR'),
-               ('u25', 'SUPPLIER REPORT(S) (RLIN)', 'SUPPLIER REPORT(S) (RLIN)', 0, 0, '', 'VR'),
-               ('u30', 'INTERVALS (RLIN)', 'INTERVALS (RLIN)', 0, 0, '', 'VR'),
-               ('u31', 'CLAIM COUNTS (RLIN)', 'CLAIM COUNTS (RLIN)', 0, 0, '', 'VR'),
-               ('u33', 'INVOICE CLAIM (RLIN)', 'INVOICE CLAIM (RLIN)', 0, 0, '', 'VR'),
-               ('u34', 'EXTENDED PROCUREMENT CLAIM AND REVIEW (RLIN)', 'EXTENDED PROCUREMENT CLAIM AND REVIEW (RLIN)', 0, 0, '', 'VR'),
-               ('u40', 'EXTENDED PROCUREMENT CODES (RLIN)', 'EXTENDED PROCUREMENT CODES (RLIN)', 0, 0, '', 'VR'),
-               ('u50', 'ACQUISITIONS NOTES (RLIN)', 'ACQUISITIONS NOTES (RLIN)', 0, 0, '', 'VR'),
-               ('u51', 'SELECTION NOTES (RLIN)', 'SELECTION NOTES (RLIN)', 0, 0, '', 'VR'),
-               ('u52', 'SUPPLIER INSTRUCTIONS AND NOTES, SINT (RLIN)', 'SUPPLIER INSTRUCTIONS AND NOTES, SINT (RLIN)', 0, 0, '', 'VR'),
-               ('u53', 'CLAIM INSTRUCTIONS AND NOTES, CLNT (RLIN)', 'CLAIM INSTRUCTIONS AND NOTES, CLNT (RLIN)', 0, 0, '', 'VR'),
-               ('u54', 'NOTES TO SERIALS DEPARTMENT (RLIN)', 'NOTES TO SERIALS DEPARTMENT (RLIN)', 0, 0, '', 'VR'),
-               ('u55', 'CATALOGING NOTES (RLIN)', 'CATALOGING NOTES (RLIN)', 0, 0, '', 'VR'),
-               ('u5f', 'ACCOUNTING NOTES (RLIN)', 'ACCOUNTING NOTES (RLIN)', 0, 0, '', 'VR'),
-               ('u70', 'MATERIAL AND LOCATION INFORMATION (RLIN)', 'MATERIAL AND LOCATION INFORMATION (RLIN)', 0, 0, '', 'VR'),
-               ('u71', 'FUND ACCOUNT (RLIN)', 'FUND ACCOUNT (RLIN)', 0, 0, '', 'VR'),
-               ('u75', 'ITEM DETAILS (RLIN)', 'ITEM DETAILS (RLIN)', 1, 0, '', 'VR'),
-               ('u7f', 'PRICE INFORMATION (RLIN)', 'PRICE INFORMATION (RLIN)', 1, 0, '', 'VR'),
-               ('u90', 'TAPE OUTPUT, TAPE (RLIN)', 'TAPE OUTPUT, TAPE (RLIN)', 0, 0, '', 'VR'),
-               ('ufi', 'FISCAL INFORMATION, FI (RLIN)', 'FISCAL INFORMATION, FI (RLIN)', 1, 0, '', 'VR');
-
-
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('01e', 'a', 'Coded field error', 'Coded field error', 0, 0, '', 0, '', '', '', 0, -6, 'VR', '', '', NULL),
-               ('89e', '0', '0', '0', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', '1', '1', '1', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', '2', '2', '2', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', '3', '3', '3', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', '4', '4', '4', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', '5', '5', '5', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', '6', '6', '6', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', '7', '7', '7', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', '8', '8', '8', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', '9', '9', '9', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', 'a', 'a', 'a', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', 'b', 'b', 'b', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', 'c', 'c', 'c', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', 'd', 'd', 'd', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', 'e', 'e', 'e', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', 'f', 'f', 'f', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', 'g', 'g', 'g', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', 'h', 'h', 'h', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', 'i', 'i', 'i', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', 'j', 'j', 'j', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', 'k', 'k', 'k', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', 'l', 'l', 'l', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', 'm', 'm', 'm', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', 'n', 'n', 'n', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', 'o', 'o', 'o', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', 'p', 'p', 'p', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', 'q', 'q', 'q', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', 'r', 'r', 'r', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', 's', 's', 's', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', 't', 't', 't', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', 'u', 'u', 'u', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', 'v', 'v', 'v', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', 'w', 'w', 'w', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', 'x', 'x', 'x', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', 'y', 'y', 'y', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('89e', 'z', 'z', 'z', 1, 0, '', 8, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('91c', '4', 'Relator code', 'Relator code', 1, 0, '', 9, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('91c', '6', 'Linkage', 'Linkage', 0, 0, '', 9, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('91c', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 9, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('91c', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, '', 9, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('91c', 'b', 'Subordinate unit', 'Subordinate unit', 1, 0, '', 9, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('91c', 'c', 'Location of meeting', 'Location of meeting', 0, 0, '', 9, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('91c', 'd', 'Date of meeting or treaty signing', 'Date of meeting or treaty signing', 1, 0, '', 9, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('91c', 'e', 'Relator term', 'Relator term', 1, 0, '', 9, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('91c', 'f', 'Date of a work', 'Date of a work', 0, 0, '', 9, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('91c', 'g', 'Miscellaneous information', 'Miscellaneous information', 0, 0, '', 9, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('91c', 'k', 'Form subheading', 'Form subheading', 1, 0, '', 9, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('91c', 'l', 'Language of a work', 'Language of a work', 0, 0, '', 9, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('91c', 'n', 'Number of part/section/meeting', 'Number of part/section/meeting', 1, 0, '', 9, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('91c', 'p', 'Name of part/section of a work', 'Name of part/section of a work', 1, 0, '', 9, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('91c', 't', 'Title of a work', 'Title of a work', 0, 0, '', 9, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('91c', 'u', 'Affiliation', 'Affiliation', 0, 0, '', 9, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('91r', 'a', 'RLG standards note', 'RLG standards note', 0, 0, '', 9, '', '', '', 0, -6, 'VR', '', '', NULL),
-               ('93r', 'a', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'VR', '', '', NULL),
-               ('93r', 'b', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'VR', '', '', NULL),
-               ('93r', 'c', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'VR', '', '', NULL),
-               ('93r', 'd', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'VR', '', '', NULL),
-               ('93r', 'e', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'VR', '', '', NULL),
-               ('93r', 'f', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'VR', '', '', NULL),
-               ('93r', 'g', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'VR', '', '', NULL),
-               ('93r', 'h', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'VR', '', '', NULL),
-               ('93r', 'i', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'VR', '', '', NULL),
-               ('93r', 'k', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'VR', '', '', NULL),
-               ('94c', '6', 'Linkage', 'Linkage', 0, 0, '', 9, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('94c', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 9, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('94c', 'a', 'Title', 'Title', 0, 0, '', 9, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('94c', 'b', 'Remainder of title', 'Remainder of title', 0, 0, '', 9, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('94c', 'c', 'Statement of responsibility, etc', 'Statement of responsibility, etc', 0, 0, '', 9, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('94c', 'd', 'Designation of section/part/series (SE) [OBSOLETE]', 'Designation of section section/part/series (SE) [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('94c', 'e', 'Name of part/section/series (SE) [OBSOLETE]', 'Name of part/section/series (SE) [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('94c', 'f', 'Inclusive dates', 'Inclusive dates', 0, 0, '', 9, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('94c', 'g', 'Bulk dates', 'Bulk dates', 0, 0, '', 9, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('94c', 'h', 'Medium', 'Medium', 0, 0, '', 9, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('94c', 'k', 'Form', 'Form', 1, 0, '', 9, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('94c', 'n', 'Number of part/section of a work', 'Number of part/section of a work', 1, 0, '', 9, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('94c', 'p', 'Name of part/section of a work', 'Name of part/section of a work', 1, 0, '', 9, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('94c', 's', 'Version', 'Version', 0, 0, '', 9, '', '', '', NULL, -6, 'VR', '', '', NULL),
-               ('94a', 'a', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'VR', '', '', NULL),
-               ('94a', 'b', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'VR', '', '', NULL),
-               ('94a', 'c', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'VR', '', '', NULL),
-               ('94a', 'd', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'VR', '', '', NULL),
-               ('94a', 'e', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'VR', '', '', NULL),
-               ('94b', 'a', 'ATC', 'ATC', 0, 0, '', 9, '', '', '', 0, -6, 'VR', '', '', NULL),
-               ('94b', 'b', 'SNR', 'SNR', 0, 0, '', 9, '', '', '', 0, -6, 'VR', '', '', NULL),
-               ('95c', 'a', 'Country', 'Country', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'VR', '', '', NULL),
-               ('95c', 'b', 'State, province, territory', 'State, province, territory', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'VR', '', '', NULL),
-               ('95c', 'c', 'County, region, islands area', 'County, region, islands area', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'VR', '', '', NULL),
-               ('95c', 'd', 'City', 'City', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'VR', '', '', NULL),
-               ('95r', '6', 'Linkage', 'Linkage', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'VR', '', '', NULL),
-               ('95r', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'VR', '', '', NULL),
-               ('95r', 'a', 'Record ID (RLIN)', 'Record ID (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('95r', 'b', 'Institution name (RLIN)', 'Institution name (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u01', 'a', 'Operator\'s initials, OID (RLIN)', 'Operator\'s initials, OID (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u01', 'd', 'UAD (RLIN)', 'UAD (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u01', 'f', 'FPST (RLIN)', 'FPST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u01', 'h', 'CPST (RLIN)', 'FPST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u01', 'i', 'CPST (RLIN)', 'FPST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u01', 's', 'UST (RLIN)', 'UST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u01', 't', 'UTYP (RLIN)', 'UTYP (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u02', '2', 'Source of number or code', 'Source of number or code', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u02', 'a', 'Standard number or code', 'Standard number or code', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u02', 'b', 'Additional codes following the standard number', 'Additional codes following the standard number', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u02', 'c', 'Terms of availability', 'Terms of availability', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u02', 'z', 'Canceled/invalid standard number or code', 'Canceled/invalid standard number or code', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u08', 'n', 'LSI', 'LSI', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u08', 'o', 'SID', 'SID', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u08', 'p', 'DP', 'DP', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u08', 'r', 'RUSH', 'RUSH', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u10', 'a', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u10', 'b', 'SID', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u10', 'c', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u10', 'd', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u10', 'e', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u10', 's', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u11', 'a', 'Department report request, DRR (DRRH for earlier occurrences)', 'DRR (DRRH for earlier occurrences)', 1, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u20', 'a', 'SUPN', 'SUPN', 1, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u20', 'b', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u20', 'c', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u20', 'd', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u20', 'e', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u20', 'x', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u21', 'a', 'SHIP', 'SHIP', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u21', 'b', 'BILL', 'BILL', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u21', 'c', 'DAC', 'DAC', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u21', 'n', 'LSAC', 'LSAC', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u22', 'a', 'SICO', 'SICO', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u22', 'b', 'SICO', 'SICO', 1, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u22', 'c', 'SCAT', 'SCAT', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u25', 'a', 'Supplier report(s), SRPT', 'Supplier report(s), SRPT', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u30', 'a', 'NCC [OBSOLETE]', 'NCC [OBSOLETE]', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u30', 'i', 'ICI', 'ICI', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u30', 'm', 'MCI', 'MCI', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u31', 'a', 'NCC', 'NCC', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u31', 'b', 'NCS', 'NCS', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u33', 'a', 'ICL', 'ICL', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u33', 'd', 'ICAD', 'ICAD', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u34', 'a', 'EPCL', 'EPCL', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u34', 'r', 'ERI', 'ERI', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u40', 'd', 'EPDT [OBSOLETE]', 'EPDT [OBSOLETE]', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u40', 'f', 'EFRQ', 'EFRQ', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u40', 's', 'EPST', 'EPST', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u40', 't', 'ETYP', 'ETYP', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u50', 'a', 'Acquisitions notes, AQNT', 'Acquisitions notes, AQNT', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u51', 'a', 'Selection notes, SLNT', 'Selection notes, SLNT', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u52', 'a', 'INT', 'INT', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u52', 'b', 'INT', 'NT', 1, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u53', 'a', 'CLNT', 'CLNT', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u53', 'b', 'CLNT', 'CLNT', 1, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u54', 'a', 'Notes to serials department, SRNT', 'Notes to serials department, SRNT', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u55', 'a', 'Cataloging notes, CTNT', 'Cataloging notes, CTNT', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u5f', 'a', 'Accounting notes, ACNT', 'Accounting notes, ACNT', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u70', 'a', 'QTY', 'QTY', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u70', 'b', 'MAT', 'MAT', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u70', 'l', 'MLOC', 'MLOC', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u71', 'a', 'Fund account, FUND', 'Fund account, FUND', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u75', 'a', 'ITEM', 'ITEM', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u75', 'c', 'CIRC', 'CIRC', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u75', 'h', 'IPST', 'IPST', 1, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u75', 'i', 'ITEM', 'ITEM', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u75', 'l', 'SLOC', 'SLOC', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u7f', 'a', 'LPRI', 'LPRI', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u7f', 'b', 'CURR', 'CURR', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u7f', 'k', 'CVRT [OBSOLETE]', 'CVRT [OBSOLETE]', 1, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u7f', 'p', 'LPD', 'LPD', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u7f', 'r', 'EDRT', 'EDRT', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u90', 'h', 'TAPE', 'TAPE', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('u90', 'i', 'TAPE', 'TAPE', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('ufi', 'a', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('ufi', 'b', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('ufi', 'c', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('ufi', 'd', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('ufi', 'e', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('ufi', 'f', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('ufi', 'g', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('ufi', 'h', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL),
-               ('ufi', 'n', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'VR', '', '', NULL);
-
-
-
--- *******************************************************
-
-
--- **************************************************************************
--- SIMPLE 3D ARTIFACTS KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS.
--- **************************************************************************
-
-
--- Current Record ID Field/Subfields
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('999', 'SYSTEM CONTROL NUMBERS (KOHA)', 'SYSTEM CONTROL NUMBERS (KOHA)', 1, 0, '', 'AR');
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('999', 'a', 'Item type [OBSOLETE]', 'Item type [OBSOLETE]', 0, 0, NULL, -1, NULL, NULL, '', NULL, -5, 'AR', '', '', NULL),
-               ('999', 'b', 'Koha Dewey Subclass [OBSOLETE]', 'Koha Dewey Subclass [OBSOLETE]', 0, 0, NULL, 0, NULL, NULL, '', NULL, -5, 'AR', '', '', NULL),
-               ('999', 'c', 'Koha biblionumber', 'Koha biblionumber', 0, 0, 'biblio.biblionumber', -1, NULL, NULL, '', NULL, -5, 'AR', '', '', NULL),
-               ('999', 'd', 'Koha biblioitemnumber', 'Koha biblioitemnumber', 0, 0, 'biblioitems.biblioitemnumber', -1, NULL, NULL, '', NULL, -5, 'AR', '', '', NULL);
-
-
--- ******************************************************
-
-
--- Plugins which need to be written for primary biblioitems Field/Subfields.
-
-
---             ('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, '', '', 'marc21_classcodes.pl', NULL, 0, 'AR', '', '', NULL),
---             ('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', 'marc21_callnumber.pl', NULL, 0, 'AR', '', '', NULL),
-
-
-
--- Current primary biblioitems Field/Subfields
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('942', 'ADDED ENTRY ELEMENTS (KOHA)', 'ADDED ENTRY ELEMENTS (KOHA)', 0, 0, '', 'AR');
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('942', '0', 'Koha issues (borrowed), all copies', 'Koha issues (borrowed), all copies', 0, 0, 'biblioitems.totalissues', 9, '', '', '', NULL, -5, 'AR', '', '', NULL),
-               ('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, '', '', '', NULL, 0, 'AR', '', '', NULL),
-               ('942', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'biblioitems.cn_sort', -1, '', '', '', 0, 7, 'AR', '', '', NULL),
-               ('942', 'a', 'Institution code [OBSOLETE]', 'Institution code [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -5, 'AR', '', '', NULL),
-               ('942', 'c', 'Item type', 'Item type', 0, 1, 'biblioitems.itemtype', 9, 'itemtypes', '', '', NULL, 0, 'AR', '', '', NULL),
-               ('942', 'e', 'Edition', 'Edition', 0, 0, 'biblioitems.cn_edition', 9, 'CN_EDITION', '', '', NULL, 0, 'AR', '', '', NULL),
-               ('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', '', NULL, 0, 'AR', '', '', NULL),
-               ('942', 'i', 'Item part', 'Item part', 1, 0, 'biblioitems.cn_item', 9, '', '', '', NULL, 9, 'AR', '', '', NULL),
-               ('942', 'k', 'Call number prefix', 'Call number prefix', 0, 0, 'biblioitems.cn_prefix', 9, '', '', '', NULL, 0, 'AR', '', '', NULL),
-               ('942', 'm', 'Call number suffix', 'Call number suffix', 0, 0, 'biblioitems.cn_suffix', 9, '', '', '', 0, 0, 'AR', '', '', NULL);
-
-
--- ******************************************************
-
-
--- Recommended items Field/Subfields
-
-
--- INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
---             ('95k', 'LOCATION AND ITEM INFORMATION (KOHA)', 'LOCATION AND ITEM INFORMATION (KOHA)', 1, 0, '', 'AR');
-
--- INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
---             ('95k', '0', 'Item status (withdrawn) (similar to 876-8 $j)', 'Item status (withdrawn)', 0, 0, 'items.wthdrawn', 10, 'WITHDRAWN', '', '', 0, 0, 'AR', '', '', NULL),
---             ('95k', '1', 'Item status (lost) (similar to 876-8 $j)', 'Item status (lost)', 0, 0, 'items.itemlost', 10, 'LOST', '', '', 0, 0, 'AR', '', '', NULL),
---             ('95k', '2', 'Source of classification or shelving scheme (similar to 852 $2)', 'Source of classification or shelving scheme', 0, 0, 'items.cn_source', 10, '', '', 'marc21_classcodes.pl', NULL, 0, 'AR', '', '', NULL),
---             ('95k', '3', 'Materials specified (bound volume or other part) (similar to 852, 876-8 $3)', 'Materials specified (bound volume or other part)', 0, 0, 'items.materials', 10, '', '', '', NULL, -1, 'AR', '', '', NULL),
---             ('95k', '4', 'Item status (damaged) (similar to 876-8 $j)', 'Item status (damaged)', 0, 0, 'items.damaged', 10, 'DAMAGED', '', '', NULL, 0, 'AR', '', '', NULL),
---             ('95k', '5', 'Use restrictions (similar to 506 $a, 876-8 $h)', 'Use restrictions', 0, 0, 'items.restricted', 10, 'RESTRICTED', '', '', 0, 0, 'AR', '', '', NULL),
---             ('95k', '6', 'Linkage (similar to 852, 876-8 $6)', 'Linkage', 0, 0, 'items.linkage', 10, '', '', '', NULL, -6, 'AR', '', '', NULL),
---             ('95k', '7', 'Use restrictions (not for loan) (similar to 506 $a, 876-8 $h)', 'Use restrictions (not for loan)', 0, 0, 'items.notforloan', 10, 'NOT_LOAN', '', '', 0, 0, 'AR', '', '', NULL),
---             ('95k', '8', 'Sequence number (similar to 852, 876-8 $8)', 'Sequence number', 1, 0, 'items.sequence', 10, '', '', '', NULL, 0, 'AR', '', '', NULL),
---             ('95k', '9', 'Koha itemnumber (autogenerated similar to 852, 876-8 $3 $8 $t combined)', 'Koha itemnumber', 0, 0, 'items.itemnumber', -1, '', '', '', 0, -5, 'AR', '', '', NULL),
---             ('95k', 'a', 'Location (home branch) (similar to 852 $a)', 'Location (home branch)', 0, 0, 'items.homebranch', 10, 'branches', '', '', 0, 0, 'AR', '', '', NULL),
---             ('95k', 'b', 'Sublocation or collection (holding branch) (similar to 852 $b)', 'Sublocation or collection (holding branch)', 1, 0, 'items.holdingbranch', 10, 'branches', '', '', 0, 0, 'AR', '', '', NULL),
---             ('95k', 'c', 'Shelving location (similar to 852 $c, 876-8 $l)', 'Shelving location', 1, 0, 'items.location', 10, 'LOC', '', '', 0, 0, 'AR', '', '', NULL),
---             ('95k', 'd', 'Date acquired (similar to 541, 876-8 $d)', 'Date acquired', 0, 0, 'items.dateaccessioned', 10, '', '', 'dateaccessioned.pl', 0, 0, 'AR', '', '', NULL),
---             ('95k', 'e', 'Source of acquisition (similar to 541 $a, 876-8 $e)', 'Source of acquisition', 1, 0, 'items.booksellerid', 10, '', '', 'bookseller.pl', 0, 0, 'AR', '', '', NULL),
---             ('95k', 'f', 'Coded location qualifier (similar to 852 $f)', 'Coded location qualifier', 1, 0, 'items.coded_location_qualifier', 10, '', '', 'marc21_locationqualifier.pl', NULL, 0, 'AR', '', '', NULL),
---             ('95k', 'g', 'Non-coded location qualifier (similar to 852 $g)', 'Non-coded location qualifier', 1, 0, 'items.non_coded_location_qualifier', 10, '', '', '', NULL, 0, 'AR', '', '', NULL),
---             ('95k', 'h', 'Classification part (similar to 852 $h)', 'Classification part', 0, 0, 'items.cn_class', 10, '', '', '', NULL, 0, 'AR', '', '', NULL),
---             ('95k', 'i', 'Item part (similar to 852 $i)', 'Item part', 1, 0, 'items.cn_item', 10, '', '', '', NULL, 0, 'AR', '', '', NULL),
---             ('95k', 'j', 'Shelving control number (similar to 852 $j)', 'Shelving control number', 0, 0, 'items.stack', 10, 'STACK', '', '', NULL, 0, 'AR', '', '', NULL),
---             ('95k', 'k', 'Call number prefix (similar to 852 $k)', 'Call number prefix', 0, 0, 'items.cn_prefix', 10, '', '', '', NULL, 0, 'AR', '', '', NULL),
---             ('95k', 'l', 'Shelving form of title (similar to 852 $l)', 'Shelving form of title', 0, 0, 'items.shelving_title', 10, '', '', '', NULL, 0, 'AR', '', '', NULL),
---             ('95k', 'm', 'Cost, normal purchase price (similar to 541 $h, 876-8 $c)', 'Cost, normal purchase price', 0, 0, 'items.price', 10, '', '', '', 0, 0, 'AR', '', '', NULL),
---             ('95k', 'n', 'Koha collection', 'Koha collection', 0, 0, 'items.ccode', 10, 'CCODE', '', '', 0, 0, 'AR', '', '', NULL),
---             ('95k', 'o', 'Koha full call number (similar to 852 $k $h $i $m $t combined)', 'Koha full call number', 0, 0, 'items.itemcallnumber', 10, '', 'marc21_itemcallnumber.pl', NULL, 0, 0, 'AR', '', '', NULL),
---             ('95k', 'p', 'Piece designation (barcode) (similar to 852, 876-8 $p)', 'Piece designation (barcode)', 0, 0, 'items.barcode', 10, '', '', 'barcode.pl', 0, 0, 'AR', '', '', NULL),
---             ('95k', 'q', 'Piece physical condition (similar to 562 $a, 852 $q)', 'Piece physical condition', 0, 0, 'items.condition', 10, '', '', '', NULL, 0, 'AR', '', '', NULL),
---             ('95k', 'r', 'Invalid or canceled piece designation (canceled barcode) (similar to 876-8 $r)', 'Invalid or canceled piece designation (canceled barcode)', 1, 0, 'items.cancelled_barcode', 10, '', '', '', NULL, -1, 'AR', '', '', NULL),
---             ('95k', 's', 'Copyright article-fee code (similar to 018 $a, 852 $s)', 'Copyright article-fee code', 1, 0, 'items.copyright_fee', 10, '', '', '', NULL, 0, 'AR', '', '', NULL),
---             ('95k', 'q', 'Koha out on loan', 'Koha out on loan', 1, 0, 'items.onloan', 10, '', '', '', NULL, -5, 'AR', '', '', NULL),
---             ('95k', 'r', 'Koha date last seen', 'Koha date last seen', 1, 0, 'items.datelastseen', 10, '', '', '', NULL, -5, 'AR', '', '', NULL),
---             ('95k', 's', 'Koha date last borrowed', 'Koha date last borrowed', 1, 0, 'items.datelastborrowed', 10, '', '', '', NULL, -5, 'AR', '', '', NULL),
---             ('95k', 't', 'Copy number (similar to 852, 876-8 $t)', 'Copy number', 0, 0, 'items.copynumber', 10, '', '', '', NULL, 0, 'AR', '', '', NULL),
---             ('95k', 'u', 'Uniform Resource Identifier (similar to 852 $u)', 'Uniform Resource Identifier', 1, 0, 'items.uri', 10, '', '', '', 1, 0, 'AR', '', '', NULL),
---             ('95k', 'v', 'Cost, replacement price (similar to 365 $b, 876-8 $c)', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'AR', '', '', NULL),
---             ('95k', 'w', 'Price effective from (similar to 365 $f)', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'AR', '', '', NULL),
---             ('95k', 'x', 'Nonpublic note (lost item payment) (similar to 852, 876-8 $x)', 'Nonpublic note', 1, 0, 'items.paidfor', 10, '', '', '', NULL, 7, 'AR', '', '', NULL),
---             ('95k', 'y', 'Koha item type', 'Koha item type', 1, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, -5, 'AR', '', '', NULL),
---             ('95k', 'z', 'Public note (similar to 852, 876-8 $z)', 'Public note', 1, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'AR', '', '', NULL);
-
-
-
--- Current items Field/Subfields
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('952', 'LOCATION AND ITEM INFORMATION (KOHA)', 'LOCATION AND ITEM INFORMATION (KOHA)', 1, 0, '', 'AR');
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('952', '0', 'Withdrawn status', 'Withdrawn status', 0, 0, 'items.wthdrawn', 10, 'WITHDRAWN', '', '', 0, 0, 'AR', '', '', NULL),
-               ('952', '1', 'Lost status', 'Lost status', 0, 0, 'items.itemlost', 10, 'LOST', '', '', 0, 0, 'AR', '', '', NULL),
-               ('952', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'items.cn_source', 10, '', '', 'marc21_classcodes.pl', NULL, 0, 'AR', '', '', NULL),
-               ('952', '3', 'Materials specified (bound volume or other part)', 'Materials specified (bound volume or other part)', 0, 0, 'items.materials', 10, '', '', '', NULL, -1, 'AR', '', '', NULL),
-               ('952', '4', 'Damaged status', 'Damaged status', 0, 0, 'items.damaged', 10, 'DAMAGED', '', '', NULL, 0, 'AR', '', '', NULL),
-               ('952', '5', 'Use restrictions', 'Use restrictions', 0, 0, 'items.restricted', 10, 'RESTRICTED', '', '', 0, 0, 'AR', '', '', NULL),
-               ('952', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'items.cn_sort', -1, '', '', '', 0, 7, 'AR', '', '', NULL),
-               ('952', '7', 'Not for loan', 'Not for loan', 0, 0, 'items.notforloan', 10, 'NOT_LOAN', '', '', 0, 0, 'AR', '', '', NULL),
-               ('952', '8', 'Koha collection', 'Koha collection', 0, 0, 'items.ccode', 10, 'CCODE', '', '', 0, 0, 'AR', '', '', NULL),
-               ('952', '9', 'Koha itemnumber (autogenerated)', 'Koha itemnumber', 0, 0, 'items.itemnumber', -1, '', '', '', 0, 7, 'AR', '', '', NULL),
-               ('952', 'a', 'Location (home branch)', 'Location (home branch)', 0, 0, 'items.homebranch', 10, 'branches', '', '', 0, 0, 'AR', '', '', NULL),
-               ('952', 'b', 'Sublocation or collection (holding branch)', 'Sublocation or collection (holding branch)', 1, 0, 'items.holdingbranch', 10, 'branches', '', '', 0, 0, 'AR', '', '', NULL),
-               ('952', 'c', 'Shelving location', 'Shelving location', 1, 0, 'items.location', 10, 'LOC', '', '', 0, 0, 'AR', '', '', NULL),
-               ('952', 'd', 'Date acquired', 'Date acquired', 0, 0, 'items.dateaccessioned', 10, '', '', 'dateaccessioned.pl', 0, 0, 'AR', '', '', NULL),
-               ('952', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, 'items.booksellerid', 10, '', '', 'bookseller.pl', 0, 0, 'AR', '', '', NULL),
-               ('952', 'f', 'Coded location qualifier', 'Coded location qualifier', 1, 0, 'items.coded_location_qualifier', 10, '', '', 'marc21_locationqualifier.pl', NULL, 0, 'AR', '', '', NULL),
-               ('952', 'g', 'Cost, normal purchase price', 'Cost, normal purchase price', 0, 0, 'items.price', 10, '', '', '', 0, 0, 'AR', '', '', NULL),
-               ('952', 'j', 'Shelving control number', 'Shelving control number', 0, 0, 'items.stack', 10, 'STACK', '', '', NULL, -1, 'AR', '', '', NULL),
-               ('952', 'l', 'Koha issues (times borrowed)', 'Koha issues (times borrowed)', 0, 0, 'items.issues', 10, '', '', '', NULL, -5, 'AR', '', '', NULL),
-               ('952', 'm', 'Koha renewals', 'Koha renewals', 0, 0, 'items.renewals', 10, '', '', '', NULL, -5, 'AR', '', '', NULL),
-               ('952', 'n', 'Koha reserves (requests)', 'Koha reserves (requests)', 0, 0, 'items.reserves', 10, '', '', '', NULL, -5, 'AR', '', '', NULL),
-               ('952', 'o', 'Koha full call number', 'Koha full call number', 0, 0, 'items.itemcallnumber', 10, '', 'marc21_itemcallnumber.pl', NULL, 0, 0, 'AR', '', '', NULL),
-               ('952', 'p', 'Piece designation (barcode)', 'Piece designation (barcode)', 0, 0, 'items.barcode', 10, '', '', 'barcode.pl', 0, 0, 'AR', '', '', NULL),
-               ('952', 'q', 'Koha out on loan', 'Koha out on loan', 1, 0, 'items.onloan', 10, '', '', '', NULL, -5, 'AR', '', '', NULL),
-               ('952', 'r', 'Koha date last seen', 'Koha date last seen', 1, 0, 'items.datelastseen', 10, '', '', '', NULL, -5, 'AR', '', '', NULL),
-               ('952', 's', 'Koha date last borrowed', 'Koha date last borrowed', 1, 0, 'items.datelastborrowed', 10, '', '', '', NULL, -5, 'AR', '', '', NULL),
-               ('952', 't', 'Copy number', 'Copy number', 0, 0, 'items.copynumber', 10, '', '', '', NULL, 0, 'AR', '', '', NULL),
-               ('952', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, 'items.uri', 10, '', '', '', 1, 0, 'AR', '', '', NULL),
-               ('952', 'v', 'Cost, replacement price', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'AR', '', '', NULL),
-               ('952', 'w', 'Price effective from', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'AR', '', '', NULL),
-               ('952', 'x', 'Nonpublic note (lost item payment)', 'Nonpublic note (lost item payment)', 1, 0, 'items.paidfor', 10, '', '', '', NULL, 7, 'AR', '', '', NULL),
-               ('952', 'y', 'Koha item type', 'Koha item type', 1, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, -1, 'AR', '', '', NULL),
-               ('952', 'z', 'Public note', 'Public note', 1, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'AR', '', '', NULL);
-
-
-
--- *******************************************************
-
-
-
--- ****************************************************************************
--- SIMPLE 3D ARTIFACTS MARC 21 FIELDS/SUBFIELDS AND COMMMONLY USED EXTENSIONS.
--- ****************************************************************************
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('01e', 'CODED FIELD ERROR (RLIN)', 'CODED FIELD ERROR (RLIN)', 1, 0, '', 'AR'),
-               ('89e', 'ERRONEOUS FIELD, ERR (RLIN)', 'ERRONEOUS FIELD, ERR (RLIN)', 1, 0, '', 'AR'),
-               ('91c', 'EQUIVALENCE OR CROSS-REFERENCE-CORPORATE NAME [LOCAL, CANADA]', 'EQUIVALENCE OR CROSS-REFERENCE-CORPORATE NAME [LOCAL, CANADA]', 1, 0, '', 'AR'),
-               ('91r', 'RLG STANDARDS NOTE (RLIN)', 'RLG STANDARDS NOTE (RLIN)', 1, 0, '', 'AR'),
-               ('93r', 'SUMMARY HOLDINGS STATEMENT (RLIN)', 'SUMMARY HOLDINGS STATEMENT (RLIN)', 1, 0, '', 'AR'),
-               ('94c', 'EQUIVALENCE OR CROSS-REFERENCE--TITLE [OBSOLETE] [CAN/MARC only]', 'EQUIVALENCE OR CROSS-REFERENCE--TITLE [OBSOLETE] [CAN/MARC only]', 1, 0, '', 'AR'),
-               ('94a', 'ANALYSIS TREATMENT NOTE (RLIN)', 'ANALYSIS TREATMENT NOTE (RLIN)', 1, 0, '', 'AR'),
-               ('94b', 'TREATMENT CODES (RLIN)', 'TREATMENT CODES (RLIN)', 1, 0, '', 'AR'),
-               ('95c', 'EQUIVALENCE OR CROSS-REFERENCE--HIERARCHICAL PLACE NAME [OBSOLETE] [CAN/MARC only]', 'EQUIVALENCE OR CROSS-REFERENCE-HIERARCHICAL PLACE NAME [OBSOLETE] [CAN/MARC only]', 1, 0, '', 'AR'),
-               ('95r', 'CLUSTER MEMBER (RLIN)', 'CLUSTER MEMBER (RLIN)', 1, 0, '', 'AR'),
-               ('b99', 'PRIVATE LOCAL INFORMATION (RLIN)', 'PRIVATE LOCAL INFORMATION (RLIN)', 1, 0, '', 'AR'),
-               ('u01', 'UNIT IDENTIFICATION, STATUS, AND TYPE (RLIN)', 'UNIT IDENTIFICATION, STATUS, AND TYPE (RLIN)', 0, 0, '', 'AR'),
-               ('u02', 'STANDARD NUMBER (RLIN)', 'STANDARD NUMBER (RLIN)', 0, 0, '', 'AR'),
-               ('u08', 'CODED INFORMATION (RLIN)', 'CODED INFORMATION (RLIN)', 0, 0, '', 'AR'),
-               ('u10', 'REQUESTER IDENTIFICATION (RLIN)', 'REQUESTER IDENTIFICATION (RLIN)', 1, 0, '', 'AR'),
-               ('u11', 'DEPARTMENT REPORT REQUEST (RLIN)', 'DEPARTMENT REPORT REQUEST (RLIN)', 1, 0, '', 'AR'),
-               ('u20', 'SUPPLIER IDENTIFICATION, SUPN (RLIN)', 'SUPPLIER IDENTIFICATION, SUPN (RLIN)', 0, 0, '', 'AR'),
-               ('u21', 'LIBRARY CODES FOR VENDOR AND ORDER (RLIN)', 'LIBRARY CODES FOR VENDOR AND ORDER (RLIN)', 0, 0, '', 'AR'),
-               ('u22', 'SUPPLIER CODES AND CATALOG INFORMATION (RLIN)', 'SUPPLIER CODES AND CATALOG INFORMATION (RLIN)', 0, 0, '', 'AR'),
-               ('u25', 'SUPPLIER REPORT(S) (RLIN)', 'SUPPLIER REPORT(S) (RLIN)', 0, 0, '', 'AR'),
-               ('u30', 'INTERVALS (RLIN)', 'INTERVALS (RLIN)', 0, 0, '', 'AR'),
-               ('u31', 'CLAIM COUNTS (RLIN)', 'CLAIM COUNTS (RLIN)', 0, 0, '', 'AR'),
-               ('u33', 'INVOICE CLAIM (RLIN)', 'INVOICE CLAIM (RLIN)', 0, 0, '', 'AR'),
-               ('u34', 'EXTENDED PROCUREMENT CLAIM AND REVIEW (RLIN)', 'EXTENDED PROCUREMENT CLAIM AND REVIEW (RLIN)', 0, 0, '', 'AR'),
-               ('u40', 'EXTENDED PROCUREMENT CODES (RLIN)', 'EXTENDED PROCUREMENT CODES (RLIN)', 0, 0, '', 'AR'),
-               ('u50', 'ACQUISITIONS NOTES (RLIN)', 'ACQUISITIONS NOTES (RLIN)', 0, 0, '', 'AR'),
-               ('u51', 'SELECTION NOTES (RLIN)', 'SELECTION NOTES (RLIN)', 0, 0, '', 'AR'),
-               ('u52', 'SUPPLIER INSTRUCTIONS AND NOTES, SINT (RLIN)', 'SUPPLIER INSTRUCTIONS AND NOTES, SINT (RLIN)', 0, 0, '', 'AR'),
-               ('u53', 'CLAIM INSTRUCTIONS AND NOTES, CLNT (RLIN)', 'CLAIM INSTRUCTIONS AND NOTES, CLNT (RLIN)', 0, 0, '', 'AR'),
-               ('u54', 'NOTES TO SERIALS DEPARTMENT (RLIN)', 'NOTES TO SERIALS DEPARTMENT (RLIN)', 0, 0, '', 'AR'),
-               ('u55', 'CATALOGING NOTES (RLIN)', 'CATALOGING NOTES (RLIN)', 0, 0, '', 'AR'),
-               ('u5f', 'ACCOUNTING NOTES (RLIN)', 'ACCOUNTING NOTES (RLIN)', 0, 0, '', 'AR'),
-               ('u70', 'MATERIAL AND LOCATION INFORMATION (RLIN)', 'MATERIAL AND LOCATION INFORMATION (RLIN)', 0, 0, '', 'AR'),
-               ('u71', 'FUND ACCOUNT (RLIN)', 'FUND ACCOUNT (RLIN)', 0, 0, '', 'AR'),
-               ('u75', 'ITEM DETAILS (RLIN)', 'ITEM DETAILS (RLIN)', 1, 0, '', 'AR'),
-               ('u7f', 'PRICE INFORMATION (RLIN)', 'PRICE INFORMATION (RLIN)', 1, 0, '', 'AR'),
-               ('u90', 'TAPE OUTPUT, TAPE (RLIN)', 'TAPE OUTPUT, TAPE (RLIN)', 0, 0, '', 'AR'),
-               ('ufi', 'FISCAL INFORMATION, FI (RLIN)', 'FISCAL INFORMATION, FI (RLIN)', 1, 0, '', 'AR');
-
-
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('01e', 'a', 'Coded field error', 'Coded field error', 0, 0, '', 0, '', '', '', 0, -6, 'AR', '', '', NULL),
-               ('89e', '0', '0', '0', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', '1', '1', '1', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', '2', '2', '2', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', '3', '3', '3', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', '4', '4', '4', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', '5', '5', '5', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', '6', '6', '6', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', '7', '7', '7', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', '8', '8', '8', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', '9', '9', '9', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', 'a', 'a', 'a', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', 'b', 'b', 'b', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', 'c', 'c', 'c', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', 'd', 'd', 'd', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', 'e', 'e', 'e', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', 'f', 'f', 'f', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', 'g', 'g', 'g', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', 'h', 'h', 'h', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', 'i', 'i', 'i', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', 'j', 'j', 'j', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', 'k', 'k', 'k', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', 'l', 'l', 'l', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', 'm', 'm', 'm', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', 'n', 'n', 'n', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', 'o', 'o', 'o', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', 'p', 'p', 'p', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', 'q', 'q', 'q', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', 'r', 'r', 'r', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', 's', 's', 's', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', 't', 't', 't', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', 'u', 'u', 'u', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', 'v', 'v', 'v', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', 'w', 'w', 'w', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', 'x', 'x', 'x', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', 'y', 'y', 'y', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('89e', 'z', 'z', 'z', 1, 0, '', 8, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('91c', '4', 'Relator code', 'Relator code', 1, 0, '', 9, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('91c', '6', 'Linkage', 'Linkage', 0, 0, '', 9, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('91c', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 9, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('91c', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, '', 9, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('91c', 'b', 'Subordinate unit', 'Subordinate unit', 1, 0, '', 9, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('91c', 'c', 'Location of meeting', 'Location of meeting', 0, 0, '', 9, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('91c', 'd', 'Date of meeting or treaty signing', 'Date of meeting or treaty signing', 1, 0, '', 9, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('91c', 'e', 'Relator term', 'Relator term', 1, 0, '', 9, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('91c', 'f', 'Date of a work', 'Date of a work', 0, 0, '', 9, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('91c', 'g', 'Miscellaneous information', 'Miscellaneous information', 0, 0, '', 9, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('91c', 'k', 'Form subheading', 'Form subheading', 1, 0, '', 9, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('91c', 'l', 'Language of a work', 'Language of a work', 0, 0, '', 9, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('91c', 'n', 'Number of part/section/meeting', 'Number of part/section/meeting', 1, 0, '', 9, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('91c', 'p', 'Name of part/section of a work', 'Name of part/section of a work', 1, 0, '', 9, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('91c', 't', 'Title of a work', 'Title of a work', 0, 0, '', 9, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('91c', 'u', 'Affiliation', 'Affiliation', 0, 0, '', 9, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('91r', 'a', 'RLG standards note', 'RLG standards note', 0, 0, '', 9, '', '', '', 0, -6, 'AR', '', '', NULL),
-               ('93r', 'a', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'AR', '', '', NULL),
-               ('93r', 'b', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'AR', '', '', NULL),
-               ('93r', 'c', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'AR', '', '', NULL),
-               ('93r', 'd', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'AR', '', '', NULL),
-               ('93r', 'e', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'AR', '', '', NULL),
-               ('93r', 'f', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'AR', '', '', NULL),
-               ('93r', 'g', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'AR', '', '', NULL),
-               ('93r', 'h', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'AR', '', '', NULL),
-               ('93r', 'i', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'AR', '', '', NULL),
-               ('93r', 'k', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'AR', '', '', NULL),
-               ('94c', '6', 'Linkage', 'Linkage', 0, 0, '', 9, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('94c', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 9, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('94c', 'a', 'Title', 'Title', 0, 0, '', 9, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('94c', 'b', 'Remainder of title', 'Remainder of title', 0, 0, '', 9, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('94c', 'c', 'Statement of responsibility, etc', 'Statement of responsibility, etc', 0, 0, '', 9, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('94c', 'd', 'Designation of section/part/series (SE) [OBSOLETE]', 'Designation of section section/part/series (SE) [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('94c', 'e', 'Name of part/section/series (SE) [OBSOLETE]', 'Name of part/section/series (SE) [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('94c', 'f', 'Inclusive dates', 'Inclusive dates', 0, 0, '', 9, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('94c', 'g', 'Bulk dates', 'Bulk dates', 0, 0, '', 9, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('94c', 'h', 'Medium', 'Medium', 0, 0, '', 9, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('94c', 'k', 'Form', 'Form', 1, 0, '', 9, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('94c', 'n', 'Number of part/section of a work', 'Number of part/section of a work', 1, 0, '', 9, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('94c', 'p', 'Name of part/section of a work', 'Name of part/section of a work', 1, 0, '', 9, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('94c', 's', 'Version', 'Version', 0, 0, '', 9, '', '', '', NULL, -6, 'AR', '', '', NULL),
-               ('94a', 'a', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'AR', '', '', NULL),
-               ('94a', 'b', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'AR', '', '', NULL),
-               ('94a', 'c', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'AR', '', '', NULL),
-               ('94a', 'd', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'AR', '', '', NULL),
-               ('94a', 'e', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'AR', '', '', NULL),
-               ('94b', 'a', 'ATC', 'ATC', 0, 0, '', 9, '', '', '', 0, -6, 'AR', '', '', NULL),
-               ('94b', 'b', 'SNR', 'SNR', 0, 0, '', 9, '', '', '', 0, -6, 'AR', '', '', NULL),
-               ('95c', 'a', 'Country', 'Country', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'AR', '', '', NULL),
-               ('95c', 'b', 'State, province, territory', 'State, province, territory', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'AR', '', '', NULL),
-               ('95c', 'c', 'County, region, islands area', 'County, region, islands area', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'AR', '', '', NULL),
-               ('95c', 'd', 'City', 'City', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'AR', '', '', NULL),
-               ('95r', '6', 'Linkage', 'Linkage', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'AR', '', '', NULL),
-               ('95r', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'AR', '', '', NULL),
-               ('95r', 'a', 'Record ID (RLIN)', 'Record ID (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('95r', 'b', 'Institution name (RLIN)', 'Institution name (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u01', 'a', 'Operator\'s initials, OID (RLIN)', 'Operator\'s initials, OID (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u01', 'd', 'UAD (RLIN)', 'UAD (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u01', 'f', 'FPST (RLIN)', 'FPST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u01', 'h', 'CPST (RLIN)', 'FPST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u01', 'i', 'CPST (RLIN)', 'FPST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u01', 's', 'UST (RLIN)', 'UST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u01', 't', 'UTYP (RLIN)', 'UTYP (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u02', '2', 'Source of number or code', 'Source of number or code', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u02', 'a', 'Standard number or code', 'Standard number or code', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u02', 'b', 'Additional codes following the standard number', 'Additional codes following the standard number', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u02', 'c', 'Terms of availability', 'Terms of availability', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u02', 'z', 'Canceled/invalid standard number or code', 'Canceled/invalid standard number or code', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u08', 'n', 'LSI', 'LSI', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u08', 'o', 'SID', 'SID', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u08', 'p', 'DP', 'DP', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u08', 'r', 'RUSH', 'RUSH', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u10', 'a', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u10', 'b', 'SID', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u10', 'c', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u10', 'd', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u10', 'e', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u10', 's', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u11', 'a', 'Department report request, DRR (DRRH for earlier occurrences)', 'DRR (DRRH for earlier occurrences)', 1, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u20', 'a', 'SUPN', 'SUPN', 1, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u20', 'b', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u20', 'c', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u20', 'd', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u20', 'e', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u20', 'x', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u21', 'a', 'SHIP', 'SHIP', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u21', 'b', 'BILL', 'BILL', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u21', 'c', 'DAC', 'DAC', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u21', 'n', 'LSAC', 'LSAC', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u22', 'a', 'SICO', 'SICO', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u22', 'b', 'SICO', 'SICO', 1, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u22', 'c', 'SCAT', 'SCAT', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u25', 'a', 'Supplier report(s), SRPT', 'Supplier report(s), SRPT', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u30', 'a', 'NCC [OBSOLETE]', 'NCC [OBSOLETE]', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u30', 'i', 'ICI', 'ICI', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u30', 'm', 'MCI', 'MCI', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u31', 'a', 'NCC', 'NCC', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u31', 'b', 'NCS', 'NCS', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u33', 'a', 'ICL', 'ICL', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u33', 'd', 'ICAD', 'ICAD', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u34', 'a', 'EPCL', 'EPCL', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u34', 'r', 'ERI', 'ERI', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u40', 'd', 'EPDT [OBSOLETE]', 'EPDT [OBSOLETE]', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u40', 'f', 'EFRQ', 'EFRQ', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u40', 's', 'EPST', 'EPST', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u40', 't', 'ETYP', 'ETYP', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u50', 'a', 'Acquisitions notes, AQNT', 'Acquisitions notes, AQNT', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u51', 'a', 'Selection notes, SLNT', 'Selection notes, SLNT', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u52', 'a', 'INT', 'INT', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u52', 'b', 'INT', 'NT', 1, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u53', 'a', 'CLNT', 'CLNT', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u53', 'b', 'CLNT', 'CLNT', 1, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u54', 'a', 'Notes to serials department, SRNT', 'Notes to serials department, SRNT', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u55', 'a', 'Cataloging notes, CTNT', 'Cataloging notes, CTNT', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u5f', 'a', 'Accounting notes, ACNT', 'Accounting notes, ACNT', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u70', 'a', 'QTY', 'QTY', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u70', 'b', 'MAT', 'MAT', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u70', 'l', 'MLOC', 'MLOC', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u71', 'a', 'Fund account, FUND', 'Fund account, FUND', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u75', 'a', 'ITEM', 'ITEM', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u75', 'c', 'CIRC', 'CIRC', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u75', 'h', 'IPST', 'IPST', 1, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u75', 'i', 'ITEM', 'ITEM', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u75', 'l', 'SLOC', 'SLOC', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u7f', 'a', 'LPRI', 'LPRI', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u7f', 'b', 'CURR', 'CURR', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u7f', 'k', 'CVRT [OBSOLETE]', 'CVRT [OBSOLETE]', 1, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u7f', 'p', 'LPD', 'LPD', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u7f', 'r', 'EDRT', 'EDRT', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u90', 'h', 'TAPE', 'TAPE', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('u90', 'i', 'TAPE', 'TAPE', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('ufi', 'a', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('ufi', 'b', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('ufi', 'c', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('ufi', 'd', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('ufi', 'e', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('ufi', 'f', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('ufi', 'g', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('ufi', 'h', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL),
-               ('ufi', 'n', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'AR', '', '', NULL);
-
-
-
--- *******************************************************
-
-
--- ******************************************************************
--- SIMPLE KITS KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS.
--- ******************************************************************
-
-
--- Current Record ID Field/Subfields
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('999', 'SYSTEM CONTROL NUMBERS (KOHA)', 'SYSTEM CONTROL NUMBERS (KOHA)', 1, 0, '', 'KT');
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('999', 'a', 'Item type [OBSOLETE]', 'Item type [OBSOLETE]', 0, 0, NULL, -1, NULL, NULL, '', NULL, -5, 'KT', '', '', NULL),
-               ('999', 'b', 'Koha Dewey Subclass [OBSOLETE]', 'Koha Dewey Subclass [OBSOLETE]', 0, 0, NULL, 0, NULL, NULL, '', NULL, -5, 'KT', '', '', NULL),
-               ('999', 'c', 'Koha biblionumber', 'Koha biblionumber', 0, 0, 'biblio.biblionumber', -1, NULL, NULL, '', NULL, -5, 'KT', '', '', NULL),
-               ('999', 'd', 'Koha biblioitemnumber', 'Koha biblioitemnumber', 0, 0, 'biblioitems.biblioitemnumber', -1, NULL, NULL, '', NULL, -5, 'KT', '', '', NULL);
-
-
--- ******************************************************
-
-
--- Plugins which need to be written for primary biblioitems Field/Subfields.
-
-
---             ('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, '', '', 'marc21_classcodes.pl', NULL, 0, 'KT', '', '', NULL),
---             ('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', 'marc21_callnumber.pl', NULL, 0, 'KT', '', '', NULL),
-
-
-
--- Current primary biblioitems Field/Subfields
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('942', 'ADDED ENTRY ELEMENTS (KOHA)', 'ADDED ENTRY ELEMENTS (KOHA)', 0, 0, '', 'KT');
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('942', '0', 'Koha issues (borrowed), all copies', 'Koha issues (borrowed), all copies', 0, 0, 'biblioitems.totalissues', 9, '', '', '', NULL, -5, 'KT', '', '', NULL),
-               ('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, '', '', '', NULL, 0, 'KT', '', '', NULL),
-               ('942', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'biblioitems.cn_sort', -1, '', '', '', 0, 7, 'KT', '', '', NULL),
-               ('942', 'a', 'Institution code [OBSOLETE]', 'Institution code [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -5, 'KT', '', '', NULL),
-               ('942', 'c', 'Item type', 'Item type', 0, 1, 'biblioitems.itemtype', 9, 'itemtypes', '', '', NULL, 0, 'KT', '', '', NULL),
-               ('942', 'e', 'Edition', 'Edition', 0, 0, 'biblioitems.cn_edition', 9, 'CN_EDITION', '', '', NULL, 0, 'KT', '', '', NULL),
-               ('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', '', NULL, 0, 'KT', '', '', NULL),
-               ('942', 'i', 'Item part', 'Item part', 1, 0, 'biblioitems.cn_item', 9, '', '', '', NULL, 9, 'KT', '', '', NULL),
-               ('942', 'k', 'Call number prefix', 'Call number prefix', 0, 0, 'biblioitems.cn_prefix', 9, '', '', '', NULL, 0, 'KT', '', '', NULL),
-               ('942', 'm', 'Call number suffix', 'Call number suffix', 0, 0, 'biblioitems.cn_suffix', 9, '', '', '', 0, 0, 'KT', '', '', NULL);
-
-
--- ******************************************************
-
-
--- Recommended items Field/Subfields
-
-
--- INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
---             ('95k', 'LOCATION AND ITEM INFORMATION (KOHA)', 'LOCATION AND ITEM INFORMATION (KOHA)', 1, 0, '', 'KT');
-
--- INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
---             ('95k', '0', 'Item status (withdrawn) (similar to 876-8 $j)', 'Item status (withdrawn)', 0, 0, 'items.wthdrawn', 10, 'WITHDRAWN', '', '', 0, 0, 'KT', '', '', NULL),
---             ('95k', '1', 'Item status (lost) (similar to 876-8 $j)', 'Item status (lost)', 0, 0, 'items.itemlost', 10, 'LOST', '', '', 0, 0, 'KT', '', '', NULL),
---             ('95k', '2', 'Source of classification or shelving scheme (similar to 852 $2)', 'Source of classification or shelving scheme', 0, 0, 'items.cn_source', 10, '', '', 'marc21_classcodes.pl', NULL, 0, 'KT', '', '', NULL),
---             ('95k', '3', 'Materials specified (bound volume or other part) (similar to 852, 876-8 $3)', 'Materials specified (bound volume or other part)', 0, 0, 'items.materials', 10, '', '', '', NULL, -1, 'KT', '', '', NULL),
---             ('95k', '4', 'Item status (damaged) (similar to 876-8 $j)', 'Item status (damaged)', 0, 0, 'items.damaged', 10, 'DAMAGED', '', '', NULL, 0, 'KT', '', '', NULL),
---             ('95k', '5', 'Use restrictions (similar to 506 $a, 876-8 $h)', 'Use restrictions', 0, 0, 'items.restricted', 10, 'RESTRICTED', '', '', 0, 0, 'KT', '', '', NULL),
---             ('95k', '6', 'Linkage (similar to 852, 876-8 $6)', 'Linkage', 0, 0, 'items.linkage', 10, '', '', '', NULL, -6, 'KT', '', '', NULL),
---             ('95k', '7', 'Use restrictions (not for loan) (similar to 506 $a, 876-8 $h)', 'Use restrictions (not for loan)', 0, 0, 'items.notforloan', 10, 'NOT_LOAN', '', '', 0, 0, 'KT', '', '', NULL),
---             ('95k', '8', 'Sequence number (similar to 852, 876-8 $8)', 'Sequence number', 1, 0, 'items.sequence', 10, '', '', '', NULL, 0, 'KT', '', '', NULL),
---             ('95k', '9', 'Koha itemnumber (autogenerated similar to 852, 876-8 $3 $8 $t combined)', 'Koha itemnumber', 0, 0, 'items.itemnumber', -1, '', '', '', 0, -5, 'KT', '', '', NULL),
---             ('95k', 'a', 'Location (home branch) (similar to 852 $a)', 'Location (home branch)', 0, 0, 'items.homebranch', 10, 'branches', '', '', 0, 0, 'KT', '', '', NULL),
---             ('95k', 'b', 'Sublocation or collection (holding branch) (similar to 852 $b)', 'Sublocation or collection (holding branch)', 1, 0, 'items.holdingbranch', 10, 'branches', '', '', 0, 0, 'KT', '', '', NULL),
---             ('95k', 'c', 'Shelving location (similar to 852 $c, 876-8 $l)', 'Shelving location', 1, 0, 'items.location', 10, 'LOC', '', '', 0, 0, 'KT', '', '', NULL),
---             ('95k', 'd', 'Date acquired (similar to 541, 876-8 $d)', 'Date acquired', 0, 0, 'items.dateaccessioned', 10, '', '', 'dateaccessioned.pl', 0, 0, 'KT', '', '', NULL),
---             ('95k', 'e', 'Source of acquisition (similar to 541 $a, 876-8 $e)', 'Source of acquisition', 1, 0, 'items.booksellerid', 10, '', '', 'bookseller.pl', 0, 0, 'KT', '', '', NULL),
---             ('95k', 'f', 'Coded location qualifier (similar to 852 $f)', 'Coded location qualifier', 1, 0, 'items.coded_location_qualifier', 10, '', '', 'marc21_locationqualifier.pl', NULL, 0, 'KT', '', '', NULL),
---             ('95k', 'g', 'Non-coded location qualifier (similar to 852 $g)', 'Non-coded location qualifier', 1, 0, 'items.non_coded_location_qualifier', 10, '', '', '', NULL, 0, 'KT', '', '', NULL),
---             ('95k', 'h', 'Classification part (similar to 852 $h)', 'Classification part', 0, 0, 'items.cn_class', 10, '', '', '', NULL, 0, 'KT', '', '', NULL),
---             ('95k', 'i', 'Item part (similar to 852 $i)', 'Item part', 1, 0, 'items.cn_item', 10, '', '', '', NULL, 0, 'KT', '', '', NULL),
---             ('95k', 'j', 'Shelving control number (similar to 852 $j)', 'Shelving control number', 0, 0, 'items.stack', 10, 'STACK', '', '', NULL, 0, 'KT', '', '', NULL),
---             ('95k', 'k', 'Call number prefix (similar to 852 $k)', 'Call number prefix', 0, 0, 'items.cn_prefix', 10, '', '', '', NULL, 0, 'KT', '', '', NULL),
---             ('95k', 'l', 'Shelving form of title (similar to 852 $l)', 'Shelving form of title', 0, 0, 'items.shelving_title', 10, '', '', '', NULL, 0, 'KT', '', '', NULL),
---             ('95k', 'm', 'Cost, normal purchase price (similar to 541 $h, 876-8 $c)', 'Cost, normal purchase price', 0, 0, 'items.price', 10, '', '', '', 0, 0, 'KT', '', '', NULL),
---             ('95k', 'n', 'Koha collection', 'Koha collection', 0, 0, 'items.ccode', 10, 'CCODE', '', '', 0, 0, 'KT', '', '', NULL),
---             ('95k', 'o', 'Koha full call number (similar to 852 $k $h $i $m $t combined)', 'Koha full call number', 0, 0, 'items.itemcallnumber', 10, '', 'marc21_itemcallnumber.pl', NULL, 0, 0, 'KT', '', '', NULL),
---             ('95k', 'p', 'Piece designation (barcode) (similar to 852, 876-8 $p)', 'Piece designation (barcode)', 0, 0, 'items.barcode', 10, '', '', 'barcode.pl', 0, 0, 'KT', '', '', NULL),
---             ('95k', 'q', 'Piece physical condition (similar to 562 $a, 852 $q)', 'Piece physical condition', 0, 0, 'items.condition', 10, '', '', '', NULL, 0, 'KT', '', '', NULL),
---             ('95k', 'r', 'Invalid or canceled piece designation (canceled barcode) (similar to 876-8 $r)', 'Invalid or canceled piece designation (canceled barcode)', 1, 0, 'items.cancelled_barcode', 10, '', '', '', NULL, -1, 'KT', '', '', NULL),
---             ('95k', 's', 'Copyright article-fee code (similar to 018 $a, 852 $s)', 'Copyright article-fee code', 1, 0, 'items.copyright_fee', 10, '', '', '', NULL, 0, 'KT', '', '', NULL),
---             ('95k', 'q', 'Koha out on loan', 'Koha out on loan', 1, 0, 'items.onloan', 10, '', '', '', NULL, -5, 'KT', '', '', NULL),
---             ('95k', 'r', 'Koha date last seen', 'Koha date last seen', 1, 0, 'items.datelastseen', 10, '', '', '', NULL, -5, 'KT', '', '', NULL),
---             ('95k', 's', 'Koha date last borrowed', 'Koha date last borrowed', 1, 0, 'items.datelastborrowed', 10, '', '', '', NULL, -5, 'KT', '', '', NULL),
---             ('95k', 't', 'Copy number (similar to 852, 876-8 $t)', 'Copy number', 0, 0, 'items.copynumber', 10, '', '', '', NULL, 0, 'KT', '', '', NULL),
---             ('95k', 'u', 'Uniform Resource Identifier (similar to 852 $u)', 'Uniform Resource Identifier', 1, 0, 'items.uri', 10, '', '', '', 1, 0, 'KT', '', '', NULL),
---             ('95k', 'v', 'Cost, replacement price (similar to 365 $b, 876-8 $c)', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'KT', '', '', NULL),
---             ('95k', 'w', 'Price effective from (similar to 365 $f)', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'KT', '', '', NULL),
---             ('95k', 'x', 'Nonpublic note (lost item payment) (similar to 852, 876-8 $x)', 'Nonpublic note', 1, 0, 'items.paidfor', 10, '', '', '', NULL, 7, 'KT', '', '', NULL),
---             ('95k', 'y', 'Koha item type', 'Koha item type', 1, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, -5, 'KT', '', '', NULL),
---             ('95k', 'z', 'Public note (similar to 852, 876-8 $z)', 'Public note', 1, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'KT', '', '', NULL);
-
-
-
--- Current items Field/Subfields
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('952', 'LOCATION AND ITEM INFORMATION (KOHA)', 'LOCATION AND ITEM INFORMATION (KOHA)', 1, 0, '', 'KT');
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('952', '0', 'Withdrawn status', 'Withdrawn status', 0, 0, 'items.wthdrawn', 10, 'WITHDRAWN', '', '', 0, 0, 'KT', '', '', NULL),
-               ('952', '1', 'Lost status', 'Lost status', 0, 0, 'items.itemlost', 10, 'LOST', '', '', 0, 0, 'KT', '', '', NULL),
-               ('952', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'items.cn_source', 10, '', '', 'marc21_classcodes.pl', NULL, 0, 'KT', '', '', NULL),
-               ('952', '3', 'Materials specified (bound volume or other part)', 'Materials specified (bound volume or other part)', 0, 0, 'items.materials', 10, '', '', '', NULL, -1, 'KT', '', '', NULL),
-               ('952', '4', 'Damaged status', 'Damaged status', 0, 0, 'items.damaged', 10, 'DAMAGED', '', '', NULL, 0, 'KT', '', '', NULL),
-               ('952', '5', 'Use restrictions', 'Use restrictions', 0, 0, 'items.restricted', 10, 'RESTRICTED', '', '', 0, 0, 'KT', '', '', NULL),
-               ('952', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'items.cn_sort', -1, '', '', '', 0, 7, 'KT', '', '', NULL),
-               ('952', '7', 'Not for loan', 'Not for loan', 0, 0, 'items.notforloan', 10, 'NOT_LOAN', '', '', 0, 0, 'KT', '', '', NULL),
-               ('952', '8', 'Koha collection', 'Koha collection', 0, 0, 'items.ccode', 10, 'CCODE', '', '', 0, 0, 'KT', '', '', NULL),
-               ('952', '9', 'Koha itemnumber (autogenerated)', 'Koha itemnumber', 0, 0, 'items.itemnumber', -1, '', '', '', 0, 7, 'KT', '', '', NULL),
-               ('952', 'a', 'Location (home branch)', 'Location (home branch)', 0, 0, 'items.homebranch', 10, 'branches', '', '', 0, 0, 'KT', '', '', NULL),
-               ('952', 'b', 'Sublocation or collection (holding branch)', 'Sublocation or collection (holding branch)', 1, 0, 'items.holdingbranch', 10, 'branches', '', '', 0, 0, 'KT', '', '', NULL),
-               ('952', 'c', 'Shelving location', 'Shelving location', 1, 0, 'items.location', 10, 'LOC', '', '', 0, 0, 'KT', '', '', NULL),
-               ('952', 'd', 'Date acquired', 'Date acquired', 0, 0, 'items.dateaccessioned', 10, '', '', 'dateaccessioned.pl', 0, 0, 'KT', '', '', NULL),
-               ('952', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, 'items.booksellerid', 10, '', '', 'bookseller.pl', 0, 0, 'KT', '', '', NULL),
-               ('952', 'f', 'Coded location qualifier', 'Coded location qualifier', 1, 0, 'items.coded_location_qualifier', 10, '', '', 'marc21_locationqualifier.pl', NULL, 0, 'KT', '', '', NULL),
-               ('952', 'g', 'Cost, normal purchase price', 'Cost, normal purchase price', 0, 0, 'items.price', 10, '', '', '', 0, 0, 'KT', '', '', NULL),
-               ('952', 'j', 'Shelving control number', 'Shelving control number', 0, 0, 'items.stack', 10, 'STACK', '', '', NULL, -1, 'KT', '', '', NULL),
-               ('952', 'l', 'Koha issues (times borrowed)', 'Koha issues (times borrowed)', 0, 0, 'items.issues', 10, '', '', '', NULL, -5, 'KT', '', '', NULL),
-               ('952', 'm', 'Koha renewals', 'Koha renewals', 0, 0, 'items.renewals', 10, '', '', '', NULL, -5, 'KT', '', '', NULL),
-               ('952', 'n', 'Koha reserves (requests)', 'Koha reserves (requests)', 0, 0, 'items.reserves', 10, '', '', '', NULL, -5, 'KT', '', '', NULL),
-               ('952', 'o', 'Koha full call number', 'Koha full call number', 0, 0, 'items.itemcallnumber', 10, '', 'marc21_itemcallnumber.pl', NULL, 0, 0, 'KT', '', '', NULL),
-               ('952', 'p', 'Piece designation (barcode)', 'Piece designation (barcode)', 0, 0, 'items.barcode', 10, '', '', 'barcode.pl', 0, 0, 'KT', '', '', NULL),
-               ('952', 'q', 'Koha out on loan', 'Koha out on loan', 1, 0, 'items.onloan', 10, '', '', '', NULL, -5, 'KT', '', '', NULL),
-               ('952', 'r', 'Koha date last seen', 'Koha date last seen', 1, 0, 'items.datelastseen', 10, '', '', '', NULL, -5, 'KT', '', '', NULL),
-               ('952', 's', 'Koha date last borrowed', 'Koha date last borrowed', 1, 0, 'items.datelastborrowed', 10, '', '', '', NULL, -5, 'KT', '', '', NULL),
-               ('952', 't', 'Copy number', 'Copy number', 0, 0, 'items.copynumber', 10, '', '', '', NULL, 0, 'KT', '', '', NULL),
-               ('952', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, 'items.uri', 10, '', '', '', 1, 0, 'KT', '', '', NULL),
-               ('952', 'v', 'Cost, replacement price', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'KT', '', '', NULL),
-               ('952', 'w', 'Price effective from', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'KT', '', '', NULL),
-               ('952', 'x', 'Nonpublic note (lost item payment)', 'Nonpublic note (lost item payment)', 1, 0, 'items.paidfor', 10, '', '', '', NULL, 7, 'KT', '', '', NULL),
-               ('952', 'y', 'Koha item type', 'Koha item type', 1, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, -1, 'KT', '', '', NULL),
-               ('952', 'z', 'Public note', 'Public note', 1, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'KT', '', '', NULL);
-
-
-
--- *******************************************************
-
-
-
--- ********************************************************************
--- SIMPLE KITS MARC 21 FIELDS/SUBFIELDS AND COMMMONLY USED EXTENSIONS.
--- ********************************************************************
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('01e', 'CODED FIELD ERROR (RLIN)', 'CODED FIELD ERROR (RLIN)', 1, 0, '', 'KT'),
-               ('89e', 'ERRONEOUS FIELD, ERR (RLIN)', 'ERRONEOUS FIELD, ERR (RLIN)', 1, 0, '', 'KT'),
-               ('91c', 'EQUIVALENCE OR CROSS-REFERENCE-CORPORATE NAME [LOCAL, CANADA]', 'EQUIVALENCE OR CROSS-REFERENCE-CORPORATE NAME [LOCAL, CANADA]', 1, 0, '', 'KT'),
-               ('91r', 'RLG STANDARDS NOTE (RLIN)', 'RLG STANDARDS NOTE (RLIN)', 1, 0, '', 'KT'),
-               ('93r', 'SUMMARY HOLDINGS STATEMENT (RLIN)', 'SUMMARY HOLDINGS STATEMENT (RLIN)', 1, 0, '', 'KT'),
-               ('94c', 'EQUIVALENCE OR CROSS-REFERENCE--TITLE [OBSOLETE] [CAN/MARC only]', 'EQUIVALENCE OR CROSS-REFERENCE--TITLE [OBSOLETE] [CAN/MARC only]', 1, 0, '', 'KT'),
-               ('94a', 'ANALYSIS TREATMENT NOTE (RLIN)', 'ANALYSIS TREATMENT NOTE (RLIN)', 1, 0, '', 'KT'),
-               ('94b', 'TREATMENT CODES (RLIN)', 'TREATMENT CODES (RLIN)', 1, 0, '', 'KT'),
-               ('95c', 'EQUIVALENCE OR CROSS-REFERENCE--HIERARCHICAL PLACE NAME [OBSOLETE] [CAN/MARC only]', 'EQUIVALENCE OR CROSS-REFERENCE-HIERARCHICAL PLACE NAME [OBSOLETE] [CAN/MARC only]', 1, 0, '', 'KT'),
-               ('95r', 'CLUSTER MEMBER (RLIN)', 'CLUSTER MEMBER (RLIN)', 1, 0, '', 'KT'),
-               ('b99', 'PRIVATE LOCAL INFORMATION (RLIN)', 'PRIVATE LOCAL INFORMATION (RLIN)', 1, 0, '', 'KT'),
-               ('u01', 'UNIT IDENTIFICATION, STATUS, AND TYPE (RLIN)', 'UNIT IDENTIFICATION, STATUS, AND TYPE (RLIN)', 0, 0, '', 'KT'),
-               ('u02', 'STANDARD NUMBER (RLIN)', 'STANDARD NUMBER (RLIN)', 0, 0, '', 'KT'),
-               ('u08', 'CODED INFORMATION (RLIN)', 'CODED INFORMATION (RLIN)', 0, 0, '', 'KT'),
-               ('u10', 'REQUESTER IDENTIFICATION (RLIN)', 'REQUESTER IDENTIFICATION (RLIN)', 1, 0, '', 'KT'),
-               ('u11', 'DEPARTMENT REPORT REQUEST (RLIN)', 'DEPARTMENT REPORT REQUEST (RLIN)', 1, 0, '', 'KT'),
-               ('u20', 'SUPPLIER IDENTIFICATION, SUPN (RLIN)', 'SUPPLIER IDENTIFICATION, SUPN (RLIN)', 0, 0, '', 'KT'),
-               ('u21', 'LIBRARY CODES FOR VENDOR AND ORDER (RLIN)', 'LIBRARY CODES FOR VENDOR AND ORDER (RLIN)', 0, 0, '', 'KT'),
-               ('u22', 'SUPPLIER CODES AND CATALOG INFORMATION (RLIN)', 'SUPPLIER CODES AND CATALOG INFORMATION (RLIN)', 0, 0, '', 'KT'),
-               ('u25', 'SUPPLIER REPORT(S) (RLIN)', 'SUPPLIER REPORT(S) (RLIN)', 0, 0, '', 'KT'),
-               ('u30', 'INTERVALS (RLIN)', 'INTERVALS (RLIN)', 0, 0, '', 'KT'),
-               ('u31', 'CLAIM COUNTS (RLIN)', 'CLAIM COUNTS (RLIN)', 0, 0, '', 'KT'),
-               ('u33', 'INVOICE CLAIM (RLIN)', 'INVOICE CLAIM (RLIN)', 0, 0, '', 'KT'),
-               ('u34', 'EXTENDED PROCUREMENT CLAIM AND REVIEW (RLIN)', 'EXTENDED PROCUREMENT CLAIM AND REVIEW (RLIN)', 0, 0, '', 'KT'),
-               ('u40', 'EXTENDED PROCUREMENT CODES (RLIN)', 'EXTENDED PROCUREMENT CODES (RLIN)', 0, 0, '', 'KT'),
-               ('u50', 'ACQUISITIONS NOTES (RLIN)', 'ACQUISITIONS NOTES (RLIN)', 0, 0, '', 'KT'),
-               ('u51', 'SELECTION NOTES (RLIN)', 'SELECTION NOTES (RLIN)', 0, 0, '', 'KT'),
-               ('u52', 'SUPPLIER INSTRUCTIONS AND NOTES, SINT (RLIN)', 'SUPPLIER INSTRUCTIONS AND NOTES, SINT (RLIN)', 0, 0, '', 'KT'),
-               ('u53', 'CLAIM INSTRUCTIONS AND NOTES, CLNT (RLIN)', 'CLAIM INSTRUCTIONS AND NOTES, CLNT (RLIN)', 0, 0, '', 'KT'),
-               ('u54', 'NOTES TO SERIALS DEPARTMENT (RLIN)', 'NOTES TO SERIALS DEPARTMENT (RLIN)', 0, 0, '', 'KT'),
-               ('u55', 'CATALOGING NOTES (RLIN)', 'CATALOGING NOTES (RLIN)', 0, 0, '', 'KT'),
-               ('u5f', 'ACCOUNTING NOTES (RLIN)', 'ACCOUNTING NOTES (RLIN)', 0, 0, '', 'KT'),
-               ('u70', 'MATERIAL AND LOCATION INFORMATION (RLIN)', 'MATERIAL AND LOCATION INFORMATION (RLIN)', 0, 0, '', 'KT'),
-               ('u71', 'FUND ACCOUNT (RLIN)', 'FUND ACCOUNT (RLIN)', 0, 0, '', 'KT'),
-               ('u75', 'ITEM DETAILS (RLIN)', 'ITEM DETAILS (RLIN)', 1, 0, '', 'KT'),
-               ('u7f', 'PRICE INFORMATION (RLIN)', 'PRICE INFORMATION (RLIN)', 1, 0, '', 'KT'),
-               ('u90', 'TAPE OUTPUT, TAPE (RLIN)', 'TAPE OUTPUT, TAPE (RLIN)', 0, 0, '', 'KT'),
-               ('ufi', 'FISCAL INFORMATION, FI (RLIN)', 'FISCAL INFORMATION, FI (RLIN)', 1, 0, '', 'KT');
-
-
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('01e', 'a', 'Coded field error', 'Coded field error', 0, 0, '', 0, '', '', '', 0, -6, 'KT', '', '', NULL),
-               ('89e', '0', '0', '0', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', '1', '1', '1', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', '2', '2', '2', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', '3', '3', '3', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', '4', '4', '4', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', '5', '5', '5', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', '6', '6', '6', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', '7', '7', '7', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', '8', '8', '8', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', '9', '9', '9', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', 'a', 'a', 'a', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', 'b', 'b', 'b', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', 'c', 'c', 'c', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', 'd', 'd', 'd', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', 'e', 'e', 'e', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', 'f', 'f', 'f', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', 'g', 'g', 'g', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', 'h', 'h', 'h', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', 'i', 'i', 'i', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', 'j', 'j', 'j', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', 'k', 'k', 'k', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', 'l', 'l', 'l', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', 'm', 'm', 'm', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', 'n', 'n', 'n', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', 'o', 'o', 'o', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', 'p', 'p', 'p', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', 'q', 'q', 'q', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', 'r', 'r', 'r', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', 's', 's', 's', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', 't', 't', 't', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', 'u', 'u', 'u', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', 'v', 'v', 'v', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', 'w', 'w', 'w', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', 'x', 'x', 'x', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', 'y', 'y', 'y', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('89e', 'z', 'z', 'z', 1, 0, '', 8, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('91c', '4', 'Relator code', 'Relator code', 1, 0, '', 9, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('91c', '6', 'Linkage', 'Linkage', 0, 0, '', 9, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('91c', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 9, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('91c', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, '', 9, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('91c', 'b', 'Subordinate unit', 'Subordinate unit', 1, 0, '', 9, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('91c', 'c', 'Location of meeting', 'Location of meeting', 0, 0, '', 9, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('91c', 'd', 'Date of meeting or treaty signing', 'Date of meeting or treaty signing', 1, 0, '', 9, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('91c', 'e', 'Relator term', 'Relator term', 1, 0, '', 9, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('91c', 'f', 'Date of a work', 'Date of a work', 0, 0, '', 9, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('91c', 'g', 'Miscellaneous information', 'Miscellaneous information', 0, 0, '', 9, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('91c', 'k', 'Form subheading', 'Form subheading', 1, 0, '', 9, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('91c', 'l', 'Language of a work', 'Language of a work', 0, 0, '', 9, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('91c', 'n', 'Number of part/section/meeting', 'Number of part/section/meeting', 1, 0, '', 9, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('91c', 'p', 'Name of part/section of a work', 'Name of part/section of a work', 1, 0, '', 9, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('91c', 't', 'Title of a work', 'Title of a work', 0, 0, '', 9, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('91c', 'u', 'Affiliation', 'Affiliation', 0, 0, '', 9, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('91r', 'a', 'RLG standards note', 'RLG standards note', 0, 0, '', 9, '', '', '', 0, -6, 'KT', '', '', NULL),
-               ('93r', 'a', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'KT', '', '', NULL),
-               ('93r', 'b', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'KT', '', '', NULL),
-               ('93r', 'c', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'KT', '', '', NULL),
-               ('93r', 'd', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'KT', '', '', NULL),
-               ('93r', 'e', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'KT', '', '', NULL),
-               ('93r', 'f', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'KT', '', '', NULL),
-               ('93r', 'g', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'KT', '', '', NULL),
-               ('93r', 'h', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'KT', '', '', NULL),
-               ('93r', 'i', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'KT', '', '', NULL),
-               ('93r', 'k', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'KT', '', '', NULL),
-               ('94c', '6', 'Linkage', 'Linkage', 0, 0, '', 9, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('94c', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 9, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('94c', 'a', 'Title', 'Title', 0, 0, '', 9, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('94c', 'b', 'Remainder of title', 'Remainder of title', 0, 0, '', 9, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('94c', 'c', 'Statement of responsibility, etc', 'Statement of responsibility, etc', 0, 0, '', 9, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('94c', 'd', 'Designation of section/part/series (SE) [OBSOLETE]', 'Designation of section section/part/series (SE) [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('94c', 'e', 'Name of part/section/series (SE) [OBSOLETE]', 'Name of part/section/series (SE) [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('94c', 'f', 'Inclusive dates', 'Inclusive dates', 0, 0, '', 9, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('94c', 'g', 'Bulk dates', 'Bulk dates', 0, 0, '', 9, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('94c', 'h', 'Medium', 'Medium', 0, 0, '', 9, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('94c', 'k', 'Form', 'Form', 1, 0, '', 9, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('94c', 'n', 'Number of part/section of a work', 'Number of part/section of a work', 1, 0, '', 9, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('94c', 'p', 'Name of part/section of a work', 'Name of part/section of a work', 1, 0, '', 9, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('94c', 's', 'Version', 'Version', 0, 0, '', 9, '', '', '', NULL, -6, 'KT', '', '', NULL),
-               ('94a', 'a', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'KT', '', '', NULL),
-               ('94a', 'b', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'KT', '', '', NULL),
-               ('94a', 'c', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'KT', '', '', NULL),
-               ('94a', 'd', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'KT', '', '', NULL),
-               ('94a', 'e', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'KT', '', '', NULL),
-               ('94b', 'a', 'ATC', 'ATC', 0, 0, '', 9, '', '', '', 0, -6, 'KT', '', '', NULL),
-               ('94b', 'b', 'SNR', 'SNR', 0, 0, '', 9, '', '', '', 0, -6, 'KT', '', '', NULL),
-               ('95c', 'a', 'Country', 'Country', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'KT', '', '', NULL),
-               ('95c', 'b', 'State, province, territory', 'State, province, territory', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'KT', '', '', NULL),
-               ('95c', 'c', 'County, region, islands area', 'County, region, islands area', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'KT', '', '', NULL),
-               ('95c', 'd', 'City', 'City', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'KT', '', '', NULL),
-               ('95r', '6', 'Linkage', 'Linkage', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'KT', '', '', NULL),
-               ('95r', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'KT', '', '', NULL),
-               ('95r', 'a', 'Record ID (RLIN)', 'Record ID (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('95r', 'b', 'Institution name (RLIN)', 'Institution name (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u01', 'a', 'Operator\'s initials, OID (RLIN)', 'Operator\'s initials, OID (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u01', 'd', 'UAD (RLIN)', 'UAD (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u01', 'f', 'FPST (RLIN)', 'FPST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u01', 'h', 'CPST (RLIN)', 'FPST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u01', 'i', 'CPST (RLIN)', 'FPST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u01', 's', 'UST (RLIN)', 'UST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u01', 't', 'UTYP (RLIN)', 'UTYP (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u02', '2', 'Source of number or code', 'Source of number or code', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u02', 'a', 'Standard number or code', 'Standard number or code', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u02', 'b', 'Additional codes following the standard number', 'Additional codes following the standard number', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u02', 'c', 'Terms of availability', 'Terms of availability', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u02', 'z', 'Canceled/invalid standard number or code', 'Canceled/invalid standard number or code', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u08', 'n', 'LSI', 'LSI', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u08', 'o', 'SID', 'SID', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u08', 'p', 'DP', 'DP', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u08', 'r', 'RUSH', 'RUSH', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u10', 'a', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u10', 'b', 'SID', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u10', 'c', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u10', 'd', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u10', 'e', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u10', 's', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u11', 'a', 'Department report request, DRR (DRRH for earlier occurrences)', 'DRR (DRRH for earlier occurrences)', 1, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u20', 'a', 'SUPN', 'SUPN', 1, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u20', 'b', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u20', 'c', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u20', 'd', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u20', 'e', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u20', 'x', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u21', 'a', 'SHIP', 'SHIP', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u21', 'b', 'BILL', 'BILL', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u21', 'c', 'DAC', 'DAC', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u21', 'n', 'LSAC', 'LSAC', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u22', 'a', 'SICO', 'SICO', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u22', 'b', 'SICO', 'SICO', 1, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u22', 'c', 'SCAT', 'SCAT', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u25', 'a', 'Supplier report(s), SRPT', 'Supplier report(s), SRPT', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u30', 'a', 'NCC [OBSOLETE]', 'NCC [OBSOLETE]', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u30', 'i', 'ICI', 'ICI', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u30', 'm', 'MCI', 'MCI', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u31', 'a', 'NCC', 'NCC', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u31', 'b', 'NCS', 'NCS', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u33', 'a', 'ICL', 'ICL', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u33', 'd', 'ICAD', 'ICAD', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u34', 'a', 'EPCL', 'EPCL', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u34', 'r', 'ERI', 'ERI', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u40', 'd', 'EPDT [OBSOLETE]', 'EPDT [OBSOLETE]', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u40', 'f', 'EFRQ', 'EFRQ', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u40', 's', 'EPST', 'EPST', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u40', 't', 'ETYP', 'ETYP', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u50', 'a', 'Acquisitions notes, AQNT', 'Acquisitions notes, AQNT', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u51', 'a', 'Selection notes, SLNT', 'Selection notes, SLNT', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u52', 'a', 'INT', 'INT', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u52', 'b', 'INT', 'NT', 1, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u53', 'a', 'CLNT', 'CLNT', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u53', 'b', 'CLNT', 'CLNT', 1, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u54', 'a', 'Notes to serials department, SRNT', 'Notes to serials department, SRNT', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u55', 'a', 'Cataloging notes, CTNT', 'Cataloging notes, CTNT', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u5f', 'a', 'Accounting notes, ACNT', 'Accounting notes, ACNT', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u70', 'a', 'QTY', 'QTY', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u70', 'b', 'MAT', 'MAT', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u70', 'l', 'MLOC', 'MLOC', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u71', 'a', 'Fund account, FUND', 'Fund account, FUND', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u75', 'a', 'ITEM', 'ITEM', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u75', 'c', 'CIRC', 'CIRC', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u75', 'h', 'IPST', 'IPST', 1, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u75', 'i', 'ITEM', 'ITEM', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u75', 'l', 'SLOC', 'SLOC', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u7f', 'a', 'LPRI', 'LPRI', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u7f', 'b', 'CURR', 'CURR', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u7f', 'k', 'CVRT [OBSOLETE]', 'CVRT [OBSOLETE]', 1, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u7f', 'p', 'LPD', 'LPD', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u7f', 'r', 'EDRT', 'EDRT', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u90', 'h', 'TAPE', 'TAPE', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('u90', 'i', 'TAPE', 'TAPE', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('ufi', 'a', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('ufi', 'b', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('ufi', 'c', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('ufi', 'd', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('ufi', 'e', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('ufi', 'f', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('ufi', 'g', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('ufi', 'h', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL),
-               ('ufi', 'n', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'KT', '', '', NULL);
-
-
-
--- ******************************************************
-
-
--- *****************************************************************
--- SIMPLE INTEGRATING RESOURCES KOHA RECORD AND HOLDINGS MANAGEMENT
--- FIELDS/SUBFIELDS.
--- *****************************************************************
-
-
--- Current Record ID Field/Subfields
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('999', 'SYSTEM CONTROL NUMBERS (KOHA)', 'SYSTEM CONTROL NUMBERS (KOHA)', 1, 0, '', 'IR');
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('999', 'a', 'Item type [OBSOLETE]', 'Item type [OBSOLETE]', 0, 0, NULL, -1, NULL, NULL, '', NULL, -5, 'IR', '', '', NULL),
-               ('999', 'b', 'Koha Dewey Subclass [OBSOLETE]', 'Koha Dewey Subclass [OBSOLETE]', 0, 0, NULL, 0, NULL, NULL, '', NULL, -5, 'IR', '', '', NULL),
-               ('999', 'c', 'Koha biblionumber', 'Koha biblionumber', 0, 0, 'biblio.biblionumber', -1, NULL, NULL, '', NULL, -5, 'IR', '', '', NULL),
-               ('999', 'd', 'Koha biblioitemnumber', 'Koha biblioitemnumber', 0, 0, 'biblioitems.biblioitemnumber', -1, NULL, NULL, '', NULL, -5, 'IR', '', '', NULL);
-
-
--- ******************************************************
-
-
--- Plugins which need to be written for primary biblioitems Field/Subfields.
-
-
---             ('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, '', '', 'marc21_classcodes.pl', NULL, 0, 'IR', '', '', NULL),
---             ('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', 'marc21_callnumber.pl', NULL, 0, 'IR', '', '', NULL),
-
-
-
--- Current primary biblioitems Field/Subfields
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('942', 'ADDED ENTRY ELEMENTS (KOHA)', 'ADDED ENTRY ELEMENTS (KOHA)', 0, 0, '', 'IR');
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('942', '0', 'Koha issues (borrowed), all copies', 'Koha issues (borrowed), all copies', 0, 0, 'biblioitems.totalissues', 9, '', '', '', NULL, -5, 'IR', '', '', NULL),
-               ('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, '', '', '', NULL, 0, 'IR', '', '', NULL),
-               ('942', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'biblioitems.cn_sort', -1, '', '', '', 0, 7, 'IR', '', '', NULL),
-               ('942', 'a', 'Institution code [OBSOLETE]', 'Institution code [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -5, 'IR', '', '', NULL),
-               ('942', 'c', 'Item type', 'Item type', 0, 1, 'biblioitems.itemtype', 9, 'itemtypes', '', '', NULL, 0, 'IR', '', '', NULL),
-               ('942', 'e', 'Edition', 'Edition', 0, 0, 'biblioitems.cn_edition', 9, 'CN_EDITION', '', '', NULL, 0, 'IR', '', '', NULL),
-               ('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', '', NULL, 0, 'IR', '', '', NULL),
-               ('942', 'i', 'Item part', 'Item part', 1, 0, 'biblioitems.cn_item', 9, '', '', '', NULL, 9, 'IR', '', '', NULL),
-               ('942', 'k', 'Call number prefix', 'Call number prefix', 0, 0, 'biblioitems.cn_prefix', 9, '', '', '', NULL, 0, 'IR', '', '', NULL),
-               ('942', 'm', 'Call number suffix', 'Call number suffix', 0, 0, 'biblioitems.cn_suffix', 9, '', '', '', 0, 0, 'IR', '', '', NULL);
-
-
--- ******************************************************
-
-
--- Recommended items Field/Subfields
-
-
--- INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
---             ('95k', 'LOCATION AND ITEM INFORMATION (KOHA)', 'LOCATION AND ITEM INFORMATION (KOHA)', 1, 0, '', 'IR');
-
--- INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
---             ('95k', '0', 'Item status (withdrawn) (similar to 876-8 $j)', 'Item status (withdrawn)', 0, 0, 'items.wthdrawn', 10, 'WITHDRAWN', '', '', 0, 0, 'IR', '', '', NULL),
---             ('95k', '1', 'Item status (lost) (similar to 876-8 $j)', 'Item status (lost)', 0, 0, 'items.itemlost', 10, 'LOST', '', '', 0, 0, 'IR', '', '', NULL),
---             ('95k', '2', 'Source of classification or shelving scheme (similar to 852 $2)', 'Source of classification or shelving scheme', 0, 0, 'items.cn_source', 10, '', '', 'marc21_classcodes.pl', NULL, 0, 'IR', '', '', NULL),
---             ('95k', '3', 'Materials specified (bound volume or other part) (similar to 852, 876-8 $3)', 'Materials specified (bound volume or other part)', 0, 0, 'items.materials', 10, '', '', '', NULL, -1, 'IR', '', '', NULL),
---             ('95k', '4', 'Item status (damaged) (similar to 876-8 $j)', 'Item status (damaged)', 0, 0, 'items.damaged', 10, 'DAMAGED', '', '', NULL, 0, 'IR', '', '', NULL),
---             ('95k', '5', 'Use restrictions (similar to 506 $a, 876-8 $h)', 'Use restrictions', 0, 0, 'items.restricted', 10, 'RESTRICTED', '', '', 0, 0, 'IR', '', '', NULL),
---             ('95k', '6', 'Linkage (similar to 852, 876-8 $6)', 'Linkage', 0, 0, 'items.linkage', 10, '', '', '', NULL, -6, 'IR', '', '', NULL),
---             ('95k', '7', 'Use restrictions (not for loan) (similar to 506 $a, 876-8 $h)', 'Use restrictions (not for loan)', 0, 0, 'items.notforloan', 10, 'NOT_LOAN', '', '', 0, 0, 'IR', '', '', NULL),
---             ('95k', '8', 'Sequence number (similar to 852, 876-8 $8)', 'Sequence number', 1, 0, 'items.sequence', 10, '', '', '', NULL, 0, 'IR', '', '', NULL),
---             ('95k', '9', 'Koha itemnumber (autogenerated similar to 852, 876-8 $3 $8 $t combined)', 'Koha itemnumber', 0, 0, 'items.itemnumber', -1, '', '', '', 0, -5, 'IR', '', '', NULL),
---             ('95k', 'a', 'Location (home branch) (similar to 852 $a)', 'Location (home branch)', 0, 0, 'items.homebranch', 10, 'branches', '', '', 0, 0, 'IR', '', '', NULL),
---             ('95k', 'b', 'Sublocation or collection (holding branch) (similar to 852 $b)', 'Sublocation or collection (holding branch)', 1, 0, 'items.holdingbranch', 10, 'branches', '', '', 0, 0, 'IR', '', '', NULL),
---             ('95k', 'c', 'Shelving location (similar to 852 $c, 876-8 $l)', 'Shelving location', 1, 0, 'items.location', 10, 'LOC', '', '', 0, 0, 'IR', '', '', NULL),
---             ('95k', 'd', 'Date acquired (similar to 541, 876-8 $d)', 'Date acquired', 0, 0, 'items.dateaccessioned', 10, '', '', 'dateaccessioned.pl', 0, 0, 'IR', '', '', NULL),
---             ('95k', 'e', 'Source of acquisition (similar to 541 $a, 876-8 $e)', 'Source of acquisition', 1, 0, 'items.booksellerid', 10, '', '', 'bookseller.pl', 0, 0, 'IR', '', '', NULL),
---             ('95k', 'f', 'Coded location qualifier (similar to 852 $f)', 'Coded location qualifier', 1, 0, 'items.coded_location_qualifier', 10, '', '', 'marc21_locationqualifier.pl', NULL, 0, 'IR', '', '', NULL),
---             ('95k', 'g', 'Non-coded location qualifier (similar to 852 $g)', 'Non-coded location qualifier', 1, 0, 'items.non_coded_location_qualifier', 10, '', '', '', NULL, 0, 'IR', '', '', NULL),
---             ('95k', 'h', 'Classification part (similar to 852 $h)', 'Classification part', 0, 0, 'items.cn_class', 10, '', '', '', NULL, 0, 'IR', '', '', NULL),
---             ('95k', 'i', 'Item part (similar to 852 $i)', 'Item part', 1, 0, 'items.cn_item', 10, '', '', '', NULL, 0, 'IR', '', '', NULL),
---             ('95k', 'j', 'Shelving control number (similar to 852 $j)', 'Shelving control number', 0, 0, 'items.stack', 10, 'STACK', '', '', NULL, 0, 'IR', '', '', NULL),
---             ('95k', 'k', 'Call number prefix (similar to 852 $k)', 'Call number prefix', 0, 0, 'items.cn_prefix', 10, '', '', '', NULL, 0, 'IR', '', '', NULL),
---             ('95k', 'l', 'Shelving form of title (similar to 852 $l)', 'Shelving form of title', 0, 0, 'items.shelving_title', 10, '', '', '', NULL, 0, 'IR', '', '', NULL),
---             ('95k', 'm', 'Cost, normal purchase price (similar to 541 $h, 876-8 $c)', 'Cost, normal purchase price', 0, 0, 'items.price', 10, '', '', '', 0, 0, 'IR', '', '', NULL),
---             ('95k', 'n', 'Koha collection', 'Koha collection', 0, 0, 'items.ccode', 10, 'CCODE', '', '', 0, 0, 'IR', '', '', NULL),
---             ('95k', 'o', 'Koha full call number (similar to 852 $k $h $i $m $t combined)', 'Koha full call number', 0, 0, 'items.itemcallnumber', 10, '', 'marc21_itemcallnumber.pl', NULL, 0, 0, 'IR', '', '', NULL),
---             ('95k', 'p', 'Piece designation (barcode) (similar to 852, 876-8 $p)', 'Piece designation (barcode)', 0, 0, 'items.barcode', 10, '', '', 'barcode.pl', 0, 0, 'IR', '', '', NULL),
---             ('95k', 'q', 'Piece physical condition (similar to 562 $a, 852 $q)', 'Piece physical condition', 0, 0, 'items.condition', 10, '', '', '', NULL, 0, 'IR', '', '', NULL),
---             ('95k', 'r', 'Invalid or canceled piece designation (canceled barcode) (similar to 876-8 $r)', 'Invalid or canceled piece designation (canceled barcode)', 1, 0, 'items.cancelled_barcode', 10, '', '', '', NULL, -1, 'IR', '', '', NULL),
---             ('95k', 's', 'Copyright article-fee code (similar to 018 $a, 852 $s)', 'Copyright article-fee code', 1, 0, 'items.copyright_fee', 10, '', '', '', NULL, 0, 'IR', '', '', NULL),
---             ('95k', 'q', 'Koha out on loan', 'Koha out on loan', 1, 0, 'items.onloan', 10, '', '', '', NULL, -5, 'IR', '', '', NULL),
---             ('95k', 'r', 'Koha date last seen', 'Koha date last seen', 1, 0, 'items.datelastseen', 10, '', '', '', NULL, -5, 'IR', '', '', NULL),
---             ('95k', 's', 'Koha date last borrowed', 'Koha date last borrowed', 1, 0, 'items.datelastborrowed', 10, '', '', '', NULL, -5, 'IR', '', '', NULL),
---             ('95k', 't', 'Copy number (similar to 852, 876-8 $t)', 'Copy number', 0, 0, 'items.copynumber', 10, '', '', '', NULL, 0, 'IR', '', '', NULL),
---             ('95k', 'u', 'Uniform Resource Identifier (similar to 852 $u)', 'Uniform Resource Identifier', 1, 0, 'items.uri', 10, '', '', '', 1, 0, 'IR', '', '', NULL),
---             ('95k', 'v', 'Cost, replacement price (similar to 365 $b, 876-8 $c)', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'IR', '', '', NULL),
---             ('95k', 'w', 'Price effective from (similar to 365 $f)', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'IR', '', '', NULL),
---             ('95k', 'x', 'Nonpublic note (lost item payment) (similar to 852, 876-8 $x)', 'Nonpublic note', 1, 0, 'items.paidfor', 10, '', '', '', NULL, 7, 'IR', '', '', NULL),
---             ('95k', 'y', 'Koha item type', 'Koha item type', 1, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, -5, 'IR', '', '', NULL),
---             ('95k', 'z', 'Public note (similar to 852, 876-8 $z)', 'Public note', 1, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'IR', '', '', NULL);
-
-
-
--- Current items Field/Subfields
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('952', 'LOCATION AND ITEM INFORMATION (KOHA)', 'LOCATION AND ITEM INFORMATION (KOHA)', 1, 0, '', 'IR');
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('952', '0', 'Withdrawn status', 'Withdrawn status', 0, 0, 'items.wthdrawn', 10, 'WITHDRAWN', '', '', 0, 0, 'IR', '', '', NULL),
-               ('952', '1', 'Lost status', 'Lost status', 0, 0, 'items.itemlost', 10, 'LOST', '', '', 0, 0, 'IR', '', '', NULL),
-               ('952', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'items.cn_source', 10, '', '', 'marc21_classcodes.pl', NULL, 0, 'IR', '', '', NULL),
-               ('952', '3', 'Materials specified (bound volume or other part)', 'Materials specified (bound volume or other part)', 0, 0, 'items.materials', 10, '', '', '', NULL, -1, 'IR', '', '', NULL),
-               ('952', '4', 'Damaged status', 'Damaged status', 0, 0, 'items.damaged', 10, 'DAMAGED', '', '', NULL, 0, 'IR', '', '', NULL),
-               ('952', '5', 'Use restrictions', 'Use restrictions', 0, 0, 'items.restricted', 10, 'RESTRICTED', '', '', 0, 0, 'IR', '', '', NULL),
-               ('952', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'items.cn_sort', -1, '', '', '', 0, 7, 'IR', '', '', NULL),
-               ('952', '7', 'Not for loan', 'Not for loan', 0, 0, 'items.notforloan', 10, 'NOT_LOAN', '', '', 0, 0, 'IR', '', '', NULL),
-               ('952', '8', 'Koha collection', 'Koha collection', 0, 0, 'items.ccode', 10, 'CCODE', '', '', 0, 0, 'IR', '', '', NULL),
-               ('952', '9', 'Koha itemnumber (autogenerated)', 'Koha itemnumber', 0, 0, 'items.itemnumber', -1, '', '', '', 0, 7, 'IR', '', '', NULL),
-               ('952', 'a', 'Location (home branch)', 'Location (home branch)', 0, 0, 'items.homebranch', 10, 'branches', '', '', 0, 0, 'IR', '', '', NULL),
-               ('952', 'b', 'Sublocation or collection (holding branch)', 'Sublocation or collection (holding branch)', 1, 0, 'items.holdingbranch', 10, 'branches', '', '', 0, 0, 'IR', '', '', NULL),
-               ('952', 'c', 'Shelving location', 'Shelving location', 1, 0, 'items.location', 10, 'LOC', '', '', 0, 0, 'IR', '', '', NULL),
-               ('952', 'd', 'Date acquired', 'Date acquired', 0, 0, 'items.dateaccessioned', 10, '', '', 'dateaccessioned.pl', 0, 0, 'IR', '', '', NULL),
-               ('952', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, 'items.booksellerid', 10, '', '', 'bookseller.pl', 0, 0, 'IR', '', '', NULL),
-               ('952', 'f', 'Coded location qualifier', 'Coded location qualifier', 1, 0, 'items.coded_location_qualifier', 10, '', '', 'marc21_locationqualifier.pl', NULL, 0, 'IR', '', '', NULL),
-               ('952', 'g', 'Cost, normal purchase price', 'Cost, normal purchase price', 0, 0, 'items.price', 10, '', '', '', 0, 0, 'IR', '', '', NULL),
-               ('952', 'j', 'Shelving control number', 'Shelving control number', 0, 0, 'items.stack', 10, 'STACK', '', '', NULL, -1, 'IR', '', '', NULL),
-               ('952', 'l', 'Koha issues (times borrowed)', 'Koha issues (times borrowed)', 0, 0, 'items.issues', 10, '', '', '', NULL, -5, 'IR', '', '', NULL),
-               ('952', 'm', 'Koha renewals', 'Koha renewals', 0, 0, 'items.renewals', 10, '', '', '', NULL, -5, 'IR', '', '', NULL),
-               ('952', 'n', 'Koha reserves (requests)', 'Koha reserves (requests)', 0, 0, 'items.reserves', 10, '', '', '', NULL, -5, 'IR', '', '', NULL),
-               ('952', 'o', 'Koha full call number', 'Koha full call number', 0, 0, 'items.itemcallnumber', 10, '', 'marc21_itemcallnumber.pl', NULL, 0, 0, 'IR', '', '', NULL),
-               ('952', 'p', 'Piece designation (barcode)', 'Piece designation (barcode)', 0, 0, 'items.barcode', 10, '', '', 'barcode.pl', 0, 0, 'IR', '', '', NULL),
-               ('952', 'q', 'Koha out on loan', 'Koha out on loan', 1, 0, 'items.onloan', 10, '', '', '', NULL, -5, 'IR', '', '', NULL),
-               ('952', 'r', 'Koha date last seen', 'Koha date last seen', 1, 0, 'items.datelastseen', 10, '', '', '', NULL, -5, 'IR', '', '', NULL),
-               ('952', 's', 'Koha date last borrowed', 'Koha date last borrowed', 1, 0, 'items.datelastborrowed', 10, '', '', '', NULL, -5, 'IR', '', '', NULL),
-               ('952', 't', 'Copy number', 'Copy number', 0, 0, 'items.copynumber', 10, '', '', '', NULL, 0, 'IR', '', '', NULL),
-               ('952', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, 'items.uri', 10, '', '', '', 1, 0, 'IR', '', '', NULL),
-               ('952', 'v', 'Cost, replacement price', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'IR', '', '', NULL),
-               ('952', 'w', 'Price effective from', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'IR', '', '', NULL),
-               ('952', 'x', 'Nonpublic note (lost item payment)', 'Nonpublic note (lost item payment)', 1, 0, 'items.paidfor', 10, '', '', '', NULL, 7, 'IR', '', '', NULL),
-               ('952', 'y', 'Koha item type', 'Koha item type', 1, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, -1, 'IR', '', '', NULL),
-               ('952', 'z', 'Public note', 'Public note', 1, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'IR', '', '', NULL);
-
-
-
--- *******************************************************
-
-
-
--- *************************************************************************
--- SIMPLE INTEGRATING RESOURCES MARC 21 FIELDS/SUBFIELDS AND COMMMONLY USED
--- EXTENSIONS.
--- *************************************************************************
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('01e', 'CODED FIELD ERROR (RLIN)', 'CODED FIELD ERROR (RLIN)', 1, 0, '', 'IR'),
-               ('89e', 'ERRONEOUS FIELD, ERR (RLIN)', 'ERRONEOUS FIELD, ERR (RLIN)', 1, 0, '', 'IR'),
-               ('91c', 'EQUIVALENCE OR CROSS-REFERENCE-CORPORATE NAME [LOCAL, CANADA]', 'EQUIVALENCE OR CROSS-REFERENCE-CORPORATE NAME [LOCAL, CANADA]', 1, 0, '', 'IR'),
-               ('91r', 'RLG STANDARDS NOTE (RLIN)', 'RLG STANDARDS NOTE (RLIN)', 1, 0, '', 'IR'),
-               ('93r', 'SUMMARY HOLDINGS STATEMENT (RLIN)', 'SUMMARY HOLDINGS STATEMENT (RLIN)', 1, 0, '', 'IR'),
-               ('94c', 'EQUIVALENCE OR CROSS-REFERENCE--TITLE [OBSOLETE] [CAN/MARC only]', 'EQUIVALENCE OR CROSS-REFERENCE--TITLE [OBSOLETE] [CAN/MARC only]', 1, 0, '', 'IR'),
-               ('94a', 'ANALYSIS TREATMENT NOTE (RLIN)', 'ANALYSIS TREATMENT NOTE (RLIN)', 1, 0, '', 'IR'),
-               ('94b', 'TREATMENT CODES (RLIN)', 'TREATMENT CODES (RLIN)', 1, 0, '', 'IR'),
-               ('95c', 'EQUIVALENCE OR CROSS-REFERENCE--HIERARCHICAL PLACE NAME [OBSOLETE] [CAN/MARC only]', 'EQUIVALENCE OR CROSS-REFERENCE-HIERARCHICAL PLACE NAME [OBSOLETE] [CAN/MARC only]', 1, 0, '', 'IR'),
-               ('95r', 'CLUSTER MEMBER (RLIN)', 'CLUSTER MEMBER (RLIN)', 1, 0, '', 'IR'),
-               ('b99', 'PRIVATE LOCAL INFORMATION (RLIN)', 'PRIVATE LOCAL INFORMATION (RLIN)', 1, 0, '', 'IR'),
-               ('u01', 'UNIT IDENTIFICATION, STATUS, AND TYPE (RLIN)', 'UNIT IDENTIFICATION, STATUS, AND TYPE (RLIN)', 0, 0, '', 'IR'),
-               ('u02', 'STANDARD NUMBER (RLIN)', 'STANDARD NUMBER (RLIN)', 0, 0, '', 'IR'),
-               ('u08', 'CODED INFORMATION (RLIN)', 'CODED INFORMATION (RLIN)', 0, 0, '', 'IR'),
-               ('u10', 'REQUESTER IDENTIFICATION (RLIN)', 'REQUESTER IDENTIFICATION (RLIN)', 1, 0, '', 'IR'),
-               ('u11', 'DEPARTMENT REPORT REQUEST (RLIN)', 'DEPARTMENT REPORT REQUEST (RLIN)', 1, 0, '', 'IR'),
-               ('u20', 'SUPPLIER IDENTIFICATION, SUPN (RLIN)', 'SUPPLIER IDENTIFICATION, SUPN (RLIN)', 0, 0, '', 'IR'),
-               ('u21', 'LIBRARY CODES FOR VENDOR AND ORDER (RLIN)', 'LIBRARY CODES FOR VENDOR AND ORDER (RLIN)', 0, 0, '', 'IR'),
-               ('u22', 'SUPPLIER CODES AND CATALOG INFORMATION (RLIN)', 'SUPPLIER CODES AND CATALOG INFORMATION (RLIN)', 0, 0, '', 'IR'),
-               ('u25', 'SUPPLIER REPORT(S) (RLIN)', 'SUPPLIER REPORT(S) (RLIN)', 0, 0, '', 'IR'),
-               ('u30', 'INTERVALS (RLIN)', 'INTERVALS (RLIN)', 0, 0, '', 'IR'),
-               ('u31', 'CLAIM COUNTS (RLIN)', 'CLAIM COUNTS (RLIN)', 0, 0, '', 'IR'),
-               ('u33', 'INVOICE CLAIM (RLIN)', 'INVOICE CLAIM (RLIN)', 0, 0, '', 'IR'),
-               ('u34', 'EXTENDED PROCUREMENT CLAIM AND REVIEW (RLIN)', 'EXTENDED PROCUREMENT CLAIM AND REVIEW (RLIN)', 0, 0, '', 'IR'),
-               ('u40', 'EXTENDED PROCUREMENT CODES (RLIN)', 'EXTENDED PROCUREMENT CODES (RLIN)', 0, 0, '', 'IR'),
-               ('u50', 'ACQUISITIONS NOTES (RLIN)', 'ACQUISITIONS NOTES (RLIN)', 0, 0, '', 'IR'),
-               ('u51', 'SELECTION NOTES (RLIN)', 'SELECTION NOTES (RLIN)', 0, 0, '', 'IR'),
-               ('u52', 'SUPPLIER INSTRUCTIONS AND NOTES, SINT (RLIN)', 'SUPPLIER INSTRUCTIONS AND NOTES, SINT (RLIN)', 0, 0, '', 'IR'),
-               ('u53', 'CLAIM INSTRUCTIONS AND NOTES, CLNT (RLIN)', 'CLAIM INSTRUCTIONS AND NOTES, CLNT (RLIN)', 0, 0, '', 'IR'),
-               ('u54', 'NOTES TO SERIALS DEPARTMENT (RLIN)', 'NOTES TO SERIALS DEPARTMENT (RLIN)', 0, 0, '', 'IR'),
-               ('u55', 'CATALOGING NOTES (RLIN)', 'CATALOGING NOTES (RLIN)', 0, 0, '', 'IR'),
-               ('u5f', 'ACCOUNTING NOTES (RLIN)', 'ACCOUNTING NOTES (RLIN)', 0, 0, '', 'IR'),
-               ('u70', 'MATERIAL AND LOCATION INFORMATION (RLIN)', 'MATERIAL AND LOCATION INFORMATION (RLIN)', 0, 0, '', 'IR'),
-               ('u71', 'FUND ACCOUNT (RLIN)', 'FUND ACCOUNT (RLIN)', 0, 0, '', 'IR'),
-               ('u75', 'ITEM DETAILS (RLIN)', 'ITEM DETAILS (RLIN)', 1, 0, '', 'IR'),
-               ('u7f', 'PRICE INFORMATION (RLIN)', 'PRICE INFORMATION (RLIN)', 1, 0, '', 'IR'),
-               ('u90', 'TAPE OUTPUT, TAPE (RLIN)', 'TAPE OUTPUT, TAPE (RLIN)', 0, 0, '', 'IR'),
-               ('ufi', 'FISCAL INFORMATION, FI (RLIN)', 'FISCAL INFORMATION, FI (RLIN)', 1, 0, '', 'IR');
-
-
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('01e', 'a', 'Coded field error', 'Coded field error', 0, 0, '', 0, '', '', '', 0, -6, 'IR', '', '', NULL),
-               ('89e', '0', '0', '0', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', '1', '1', '1', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', '2', '2', '2', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', '3', '3', '3', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', '4', '4', '4', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', '5', '5', '5', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', '6', '6', '6', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', '7', '7', '7', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', '8', '8', '8', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', '9', '9', '9', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', 'a', 'a', 'a', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', 'b', 'b', 'b', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', 'c', 'c', 'c', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', 'd', 'd', 'd', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', 'e', 'e', 'e', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', 'f', 'f', 'f', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', 'g', 'g', 'g', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', 'h', 'h', 'h', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', 'i', 'i', 'i', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', 'j', 'j', 'j', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', 'k', 'k', 'k', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', 'l', 'l', 'l', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', 'm', 'm', 'm', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', 'n', 'n', 'n', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', 'o', 'o', 'o', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', 'p', 'p', 'p', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', 'q', 'q', 'q', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', 'r', 'r', 'r', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', 's', 's', 's', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', 't', 't', 't', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', 'u', 'u', 'u', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', 'v', 'v', 'v', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', 'w', 'w', 'w', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', 'x', 'x', 'x', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', 'y', 'y', 'y', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('89e', 'z', 'z', 'z', 1, 0, '', 8, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('91c', '4', 'Relator code', 'Relator code', 1, 0, '', 9, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('91c', '6', 'Linkage', 'Linkage', 0, 0, '', 9, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('91c', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 9, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('91c', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, '', 9, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('91c', 'b', 'Subordinate unit', 'Subordinate unit', 1, 0, '', 9, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('91c', 'c', 'Location of meeting', 'Location of meeting', 0, 0, '', 9, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('91c', 'd', 'Date of meeting or treaty signing', 'Date of meeting or treaty signing', 1, 0, '', 9, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('91c', 'e', 'Relator term', 'Relator term', 1, 0, '', 9, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('91c', 'f', 'Date of a work', 'Date of a work', 0, 0, '', 9, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('91c', 'g', 'Miscellaneous information', 'Miscellaneous information', 0, 0, '', 9, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('91c', 'k', 'Form subheading', 'Form subheading', 1, 0, '', 9, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('91c', 'l', 'Language of a work', 'Language of a work', 0, 0, '', 9, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('91c', 'n', 'Number of part/section/meeting', 'Number of part/section/meeting', 1, 0, '', 9, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('91c', 'p', 'Name of part/section of a work', 'Name of part/section of a work', 1, 0, '', 9, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('91c', 't', 'Title of a work', 'Title of a work', 0, 0, '', 9, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('91c', 'u', 'Affiliation', 'Affiliation', 0, 0, '', 9, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('91r', 'a', 'RLG standards note', 'RLG standards note', 0, 0, '', 9, '', '', '', 0, -6, 'IR', '', '', NULL),
-               ('93r', 'a', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'IR', '', '', NULL),
-               ('93r', 'b', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'IR', '', '', NULL),
-               ('93r', 'c', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'IR', '', '', NULL),
-               ('93r', 'd', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'IR', '', '', NULL),
-               ('93r', 'e', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'IR', '', '', NULL),
-               ('93r', 'f', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'IR', '', '', NULL),
-               ('93r', 'g', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'IR', '', '', NULL),
-               ('93r', 'h', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'IR', '', '', NULL),
-               ('93r', 'i', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'IR', '', '', NULL),
-               ('93r', 'k', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'IR', '', '', NULL),
-               ('94c', '6', 'Linkage', 'Linkage', 0, 0, '', 9, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('94c', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 9, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('94c', 'a', 'Title', 'Title', 0, 0, '', 9, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('94c', 'b', 'Remainder of title', 'Remainder of title', 0, 0, '', 9, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('94c', 'c', 'Statement of responsibility, etc', 'Statement of responsibility, etc', 0, 0, '', 9, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('94c', 'd', 'Designation of section/part/series (SE) [OBSOLETE]', 'Designation of section section/part/series (SE) [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('94c', 'e', 'Name of part/section/series (SE) [OBSOLETE]', 'Name of part/section/series (SE) [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('94c', 'f', 'Inclusive dates', 'Inclusive dates', 0, 0, '', 9, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('94c', 'g', 'Bulk dates', 'Bulk dates', 0, 0, '', 9, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('94c', 'h', 'Medium', 'Medium', 0, 0, '', 9, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('94c', 'k', 'Form', 'Form', 1, 0, '', 9, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('94c', 'n', 'Number of part/section of a work', 'Number of part/section of a work', 1, 0, '', 9, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('94c', 'p', 'Name of part/section of a work', 'Name of part/section of a work', 1, 0, '', 9, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('94c', 's', 'Version', 'Version', 0, 0, '', 9, '', '', '', NULL, -6, 'IR', '', '', NULL),
-               ('94a', 'a', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'IR', '', '', NULL),
-               ('94a', 'b', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'IR', '', '', NULL),
-               ('94a', 'c', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'IR', '', '', NULL),
-               ('94a', 'd', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'IR', '', '', NULL),
-               ('94a', 'e', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'IR', '', '', NULL),
-               ('94b', 'a', 'ATC', 'ATC', 0, 0, '', 9, '', '', '', 0, -6, 'IR', '', '', NULL),
-               ('94b', 'b', 'SNR', 'SNR', 0, 0, '', 9, '', '', '', 0, -6, 'IR', '', '', NULL),
-               ('95c', 'a', 'Country', 'Country', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'IR', '', '', NULL),
-               ('95c', 'b', 'State, province, territory', 'State, province, territory', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'IR', '', '', NULL),
-               ('95c', 'c', 'County, region, islands area', 'County, region, islands area', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'IR', '', '', NULL),
-               ('95c', 'd', 'City', 'City', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'IR', '', '', NULL),
-               ('95r', '6', 'Linkage', 'Linkage', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'IR', '', '', NULL),
-               ('95r', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'IR', '', '', NULL),
-               ('95r', 'a', 'Record ID (RLIN)', 'Record ID (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('95r', 'b', 'Institution name (RLIN)', 'Institution name (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u01', 'a', 'Operator\'s initials, OID (RLIN)', 'Operator\'s initials, OID (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u01', 'd', 'UAD (RLIN)', 'UAD (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u01', 'f', 'FPST (RLIN)', 'FPST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u01', 'h', 'CPST (RLIN)', 'FPST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u01', 'i', 'CPST (RLIN)', 'FPST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u01', 's', 'UST (RLIN)', 'UST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u01', 't', 'UTYP (RLIN)', 'UTYP (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u02', '2', 'Source of number or code', 'Source of number or code', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u02', 'a', 'Standard number or code', 'Standard number or code', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u02', 'b', 'Additional codes following the standard number', 'Additional codes following the standard number', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u02', 'c', 'Terms of availability', 'Terms of availability', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u02', 'z', 'Canceled/invalid standard number or code', 'Canceled/invalid standard number or code', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u08', 'n', 'LSI', 'LSI', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u08', 'o', 'SID', 'SID', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u08', 'p', 'DP', 'DP', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u08', 'r', 'RUSH', 'RUSH', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u10', 'a', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u10', 'b', 'SID', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u10', 'c', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u10', 'd', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u10', 'e', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u10', 's', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u11', 'a', 'Department report request, DRR (DRRH for earlier occurrences)', 'DRR (DRRH for earlier occurrences)', 1, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u20', 'a', 'SUPN', 'SUPN', 1, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u20', 'b', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u20', 'c', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u20', 'd', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u20', 'e', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u20', 'x', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u21', 'a', 'SHIP', 'SHIP', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u21', 'b', 'BILL', 'BILL', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u21', 'c', 'DAC', 'DAC', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u21', 'n', 'LSAC', 'LSAC', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u22', 'a', 'SICO', 'SICO', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u22', 'b', 'SICO', 'SICO', 1, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u22', 'c', 'SCAT', 'SCAT', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u25', 'a', 'Supplier report(s), SRPT', 'Supplier report(s), SRPT', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u30', 'a', 'NCC [OBSOLETE]', 'NCC [OBSOLETE]', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u30', 'i', 'ICI', 'ICI', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u30', 'm', 'MCI', 'MCI', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u31', 'a', 'NCC', 'NCC', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u31', 'b', 'NCS', 'NCS', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u33', 'a', 'ICL', 'ICL', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u33', 'd', 'ICAD', 'ICAD', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u34', 'a', 'EPCL', 'EPCL', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u34', 'r', 'ERI', 'ERI', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u40', 'd', 'EPDT [OBSOLETE]', 'EPDT [OBSOLETE]', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u40', 'f', 'EFRQ', 'EFRQ', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u40', 's', 'EPST', 'EPST', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u40', 't', 'ETYP', 'ETYP', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u50', 'a', 'Acquisitions notes, AQNT', 'Acquisitions notes, AQNT', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u51', 'a', 'Selection notes, SLNT', 'Selection notes, SLNT', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u52', 'a', 'INT', 'INT', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u52', 'b', 'INT', 'NT', 1, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u53', 'a', 'CLNT', 'CLNT', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u53', 'b', 'CLNT', 'CLNT', 1, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u54', 'a', 'Notes to serials department, SRNT', 'Notes to serials department, SRNT', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u55', 'a', 'Cataloging notes, CTNT', 'Cataloging notes, CTNT', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u5f', 'a', 'Accounting notes, ACNT', 'Accounting notes, ACNT', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u70', 'a', 'QTY', 'QTY', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u70', 'b', 'MAT', 'MAT', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u70', 'l', 'MLOC', 'MLOC', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u71', 'a', 'Fund account, FUND', 'Fund account, FUND', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u75', 'a', 'ITEM', 'ITEM', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u75', 'c', 'CIRC', 'CIRC', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u75', 'h', 'IPST', 'IPST', 1, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u75', 'i', 'ITEM', 'ITEM', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u75', 'l', 'SLOC', 'SLOC', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u7f', 'a', 'LPRI', 'LPRI', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u7f', 'b', 'CURR', 'CURR', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u7f', 'k', 'CVRT [OBSOLETE]', 'CVRT [OBSOLETE]', 1, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u7f', 'p', 'LPD', 'LPD', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u7f', 'r', 'EDRT', 'EDRT', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u90', 'h', 'TAPE', 'TAPE', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('u90', 'i', 'TAPE', 'TAPE', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('ufi', 'a', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('ufi', 'b', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('ufi', 'c', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('ufi', 'd', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('ufi', 'e', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('ufi', 'f', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('ufi', 'g', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('ufi', 'h', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL),
-               ('ufi', 'n', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'IR', '', '', NULL);
-
-
--- *******************************************************
-
-
--- *********************************************************************
--- SIMPLE SERIALS KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS.
--- *********************************************************************
-
-
--- Current Record ID Field/Subfields
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('999', 'SYSTEM CONTROL NUMBERS (KOHA)', 'SYSTEM CONTROL NUMBERS (KOHA)', 1, 0, '', 'SER');
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('999', 'a', 'Item type [OBSOLETE]', 'Item type [OBSOLETE]', 0, 0, NULL, -1, NULL, NULL, '', NULL, -5, 'SER', '', '', NULL),
-               ('999', 'b', 'Koha Dewey Subclass [OBSOLETE]', 'Koha Dewey Subclass [OBSOLETE]', 0, 0, NULL, 0, NULL, NULL, '', NULL, -5, 'SER', '', '', NULL),
-               ('999', 'c', 'Koha biblionumber', 'Koha biblionumber', 0, 0, 'biblio.biblionumber', -1, NULL, NULL, '', NULL, -5, 'SER', '', '', NULL),
-               ('999', 'd', 'Koha biblioitemnumber', 'Koha biblioitemnumber', 0, 0, 'biblioitems.biblioitemnumber', -1, NULL, NULL, '', NULL, -5, 'SER', '', '', NULL);
-
-
--- ******************************************************
-
-
--- Plugins which need to be written for primary biblioitems Field/Subfields.
-
-
---             ('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, '', '', 'marc21_classcodes.pl', NULL, 0, 'SER', '', '', NULL),
---             ('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', 'marc21_callnumber.pl', NULL, 0, 'SER', '', '', NULL),
-
-
-
--- Current primary biblioitems Field/Subfields
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('942', 'ADDED ENTRY ELEMENTS (KOHA)', 'ADDED ENTRY ELEMENTS (KOHA)', 0, 0, '', 'SER');
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('942', '0', 'Koha issues (borrowed), all copies', 'Koha issues (borrowed), all copies', 0, 0, 'biblioitems.totalissues', 9, '', '', '', NULL, -5, 'SER', '', '', NULL),
-               ('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, '', '', '', NULL, 0, 'SER', '', '', NULL),
-               ('942', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'biblioitems.cn_sort', -1, '', '', '', 0, 7, 'SER', '', '', NULL),
-               ('942', 'a', 'Institution code [OBSOLETE]', 'Institution code [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -5, 'SER', '', '', NULL),
-               ('942', 'c', 'Item type', 'Item type', 0, 1, 'biblioitems.itemtype', 9, 'itemtypes', '', '', NULL, 0, 'SER', '', '', NULL),
-               ('942', 'e', 'Edition', 'Edition', 0, 0, 'biblioitems.cn_edition', 9, 'CN_EDITION', '', '', NULL, 0, 'SER', '', '', NULL),
-               ('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', '', NULL, 0, 'SER', '', '', NULL),
-               ('942', 'i', 'Item part', 'Item part', 1, 0, 'biblioitems.cn_item', 9, '', '', '', NULL, 9, 'SER', '', '', NULL),
-               ('942', 'k', 'Call number prefix', 'Call number prefix', 0, 0, 'biblioitems.cn_prefix', 9, '', '', '', NULL, 0, 'SER', '', '', NULL),
-               ('942', 'm', 'Call number suffix', 'Call number suffix', 0, 0, 'biblioitems.cn_suffix', 9, '', '', '', 0, 0, 'SER', '', '', NULL);
-
-
--- ******************************************************
-
-
--- Recommended items Field/Subfields
-
-
--- INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
---             ('95k', 'LOCATION AND ITEM INFORMATION (KOHA)', 'LOCATION AND ITEM INFORMATION (KOHA)', 1, 0, '', 'SER');
-
--- INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
---             ('95k', '0', 'Item status (withdrawn) (similar to 876-8 $j)', 'Item status (withdrawn)', 0, 0, 'items.wthdrawn', 10, 'WITHDRAWN', '', '', 0, 0, 'SER', '', '', NULL),
---             ('95k', '1', 'Item status (lost) (similar to 876-8 $j)', 'Item status (lost)', 0, 0, 'items.itemlost', 10, 'LOST', '', '', 0, 0, 'SER', '', '', NULL),
---             ('95k', '2', 'Source of classification or shelving scheme (similar to 852 $2)', 'Source of classification or shelving scheme', 0, 0, 'items.cn_source', 10, '', '', 'marc21_classcodes.pl', NULL, 0, 'SER', '', '', NULL),
---             ('95k', '3', 'Materials specified (bound volume or other part) (similar to 852, 876-8 $3)', 'Materials specified (bound volume or other part)', 0, 0, 'items.materials', 10, '', '', '', NULL, -1, 'SER', '', '', NULL),
---             ('95k', '4', 'Item status (damaged) (similar to 876-8 $j)', 'Item status (damaged)', 0, 0, 'items.damaged', 10, 'DAMAGED', '', '', NULL, 0, 'SER', '', '', NULL),
---             ('95k', '5', 'Use restrictions (similar to 506 $a, 876-8 $h)', 'Use restrictions', 0, 0, 'items.restricted', 10, 'RESTRICTED', '', '', 0, 0, 'SER', '', '', NULL),
---             ('95k', '6', 'Linkage (similar to 852, 876-8 $6)', 'Linkage', 0, 0, 'items.linkage', 10, '', '', '', NULL, -6, 'SER', '', '', NULL),
---             ('95k', '7', 'Use restrictions (not for loan) (similar to 506 $a, 876-8 $h)', 'Use restrictions (not for loan)', 0, 0, 'items.notforloan', 10, 'NOT_LOAN', '', '', 0, 0, 'SER', '', '', NULL),
---             ('95k', '8', 'Sequence number (similar to 852, 876-8 $8)', 'Sequence number', 1, 0, 'items.sequence', 10, '', '', '', NULL, 0, 'SER', '', '', NULL),
---             ('95k', '9', 'Koha itemnumber (autogenerated similar to 852, 876-8 $3 $8 $t combined)', 'Koha itemnumber', 0, 0, 'items.itemnumber', -1, '', '', '', 0, -5, 'SER', '', '', NULL),
---             ('95k', 'a', 'Location (home branch) (similar to 852 $a)', 'Location (home branch)', 0, 0, 'items.homebranch', 10, 'branches', '', '', 0, 0, 'SER', '', '', NULL),
---             ('95k', 'b', 'Sublocation or collection (holding branch) (similar to 852 $b)', 'Sublocation or collection (holding branch)', 1, 0, 'items.holdingbranch', 10, 'branches', '', '', 0, 0, 'SER', '', '', NULL),
---             ('95k', 'c', 'Shelving location (similar to 852 $c, 876-8 $l)', 'Shelving location', 1, 0, 'items.location', 10, 'LOC', '', '', 0, 0, 'SER', '', '', NULL),
---             ('95k', 'd', 'Date acquired (similar to 541, 876-8 $d)', 'Date acquired', 0, 0, 'items.dateaccessioned', 10, '', '', 'dateaccessioned.pl', 0, 0, 'SER', '', '', NULL),
---             ('95k', 'e', 'Source of acquisition (similar to 541 $a, 876-8 $e)', 'Source of acquisition', 1, 0, 'items.booksellerid', 10, '', '', 'bookseller.pl', 0, 0, 'SER', '', '', NULL),
---             ('95k', 'f', 'Coded location qualifier (similar to 852 $f)', 'Coded location qualifier', 1, 0, 'items.coded_location_qualifier', 10, '', '', 'marc21_locationqualifier.pl', NULL, 0, 'SER', '', '', NULL),
---             ('95k', 'g', 'Non-coded location qualifier (similar to 852 $g)', 'Non-coded location qualifier', 1, 0, 'items.non_coded_location_qualifier', 10, '', '', '', NULL, 0, 'SER', '', '', NULL),
---             ('95k', 'h', 'Classification part (similar to 852 $h)', 'Classification part', 0, 0, 'items.cn_class', 10, '', '', '', NULL, 0, 'SER', '', '', NULL),
---             ('95k', 'i', 'Item part (similar to 852 $i)', 'Item part', 1, 0, 'items.cn_item', 10, '', '', '', NULL, 0, 'SER', '', '', NULL),
---             ('95k', 'j', 'Shelving control number (similar to 852 $j)', 'Shelving control number', 0, 0, 'items.stack', 10, 'STACK', '', '', NULL, 0, 'SER', '', '', NULL),
---             ('95k', 'k', 'Call number prefix (similar to 852 $k)', 'Call number prefix', 0, 0, 'items.cn_prefix', 10, '', '', '', NULL, 0, 'SER', '', '', NULL),
---             ('95k', 'l', 'Shelving form of title (similar to 852 $l)', 'Shelving form of title', 0, 0, 'items.shelving_title', 10, '', '', '', NULL, 0, 'SER', '', '', NULL),
---             ('95k', 'm', 'Cost, normal purchase price (similar to 541 $h, 876-8 $c)', 'Cost, normal purchase price', 0, 0, 'items.price', 10, '', '', '', 0, 0, 'SER', '', '', NULL),
---             ('95k', 'n', 'Koha collection', 'Koha collection', 0, 0, 'items.ccode', 10, 'CCODE', '', '', 0, 0, 'SER', '', '', NULL),
---             ('95k', 'o', 'Koha full call number (similar to 852 $k $h $i $m $t combined)', 'Koha full call number', 0, 0, 'items.itemcallnumber', 10, '', 'marc21_itemcallnumber.pl', NULL, 0, 0, 'SER', '', '', NULL),
---             ('95k', 'p', 'Piece designation (barcode) (similar to 852, 876-8 $p)', 'Piece designation (barcode)', 0, 0, 'items.barcode', 10, '', '', 'barcode.pl', 0, 0, 'SER', '', '', NULL),
---             ('95k', 'q', 'Piece physical condition (similar to 562 $a, 852 $q)', 'Piece physical condition', 0, 0, 'items.condition', 10, '', '', '', NULL, 0, 'SER', '', '', NULL),
---             ('95k', 'r', 'Invalid or canceled piece designation (canceled barcode) (similar to 876-8 $r)', 'Invalid or canceled piece designation (canceled barcode)', 1, 0, 'items.cancelled_barcode', 10, '', '', '', NULL, -1, 'SER', '', '', NULL),
---             ('95k', 's', 'Copyright article-fee code (similar to 018 $a, 852 $s)', 'Copyright article-fee code', 1, 0, 'items.copyright_fee', 10, '', '', '', NULL, 0, 'SER', '', '', NULL),
---             ('95k', 'q', 'Koha out on loan', 'Koha out on loan', 1, 0, 'items.onloan', 10, '', '', '', NULL, -5, 'SER', '', '', NULL),
---             ('95k', 'r', 'Koha date last seen', 'Koha date last seen', 1, 0, 'items.datelastseen', 10, '', '', '', NULL, -5, 'SER', '', '', NULL),
---             ('95k', 's', 'Koha date last borrowed', 'Koha date last borrowed', 1, 0, 'items.datelastborrowed', 10, '', '', '', NULL, -5, 'SER', '', '', NULL),
---             ('95k', 't', 'Copy number (similar to 852, 876-8 $t)', 'Copy number', 0, 0, 'items.copynumber', 10, '', '', '', NULL, 0, 'SER', '', '', NULL),
---             ('95k', 'u', 'Uniform Resource Identifier (similar to 852 $u)', 'Uniform Resource Identifier', 1, 0, 'items.uri', 10, '', '', '', 1, 0, 'SER', '', '', NULL),
---             ('95k', 'v', 'Cost, replacement price (similar to 365 $b, 876-8 $c)', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'SER', '', '', NULL),
---             ('95k', 'w', 'Price effective from (similar to 365 $f)', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'SER', '', '', NULL),
---             ('95k', 'x', 'Nonpublic note (lost item payment) (similar to 852, 876-8 $x)', 'Nonpublic note', 1, 0, 'items.paidfor', 10, '', '', '', NULL, 7, 'SER', '', '', NULL),
---             ('95k', 'y', 'Koha item type', 'Koha item type', 1, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, -5, 'SER', '', '', NULL),
---             ('95k', 'z', 'Public note (similar to 852, 876-8 $z)', 'Public note', 1, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'SER', '', '', NULL);
-
-
-
--- Current items Field/Subfields
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('952', 'LOCATION AND ITEM INFORMATION (KOHA)', 'LOCATION AND ITEM INFORMATION (KOHA)', 1, 0, '', 'SER');
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('952', '0', 'Withdrawn status', 'Withdrawn status', 0, 0, 'items.wthdrawn', 10, 'WITHDRAWN', '', '', 0, 0, 'SER', '', '', NULL),
-               ('952', '1', 'Lost status', 'Lost status', 0, 0, 'items.itemlost', 10, 'LOST', '', '', 0, 0, 'SER', '', '', NULL),
-               ('952', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'items.cn_source', 10, '', '', 'marc21_classcodes.pl', NULL, 0, 'SER', '', '', NULL),
-               ('952', '3', 'Materials specified (bound volume or other part)', 'Materials specified (bound volume or other part)', 0, 0, 'items.materials', 10, '', '', '', NULL, -1, 'SER', '', '', NULL),
-               ('952', '4', 'Damaged status', 'Damaged status', 0, 0, 'items.damaged', 10, 'DAMAGED', '', '', NULL, 0, 'SER', '', '', NULL),
-               ('952', '5', 'Use restrictions', 'Use restrictions', 0, 0, 'items.restricted', 10, 'RESTRICTED', '', '', 0, 0, 'SER', '', '', NULL),
-               ('952', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'items.cn_sort', -1, '', '', '', 0, 7, 'SER', '', '', NULL),
-               ('952', '7', 'Not for loan', 'Not for loan', 0, 0, 'items.notforloan', 10, 'NOT_LOAN', '', '', 0, 0, 'SER', '', '', NULL),
-               ('952', '8', 'Koha collection', 'Koha collection', 0, 0, 'items.ccode', 10, 'CCODE', '', '', 0, 0, 'SER', '', '', NULL),
-               ('952', '9', 'Koha itemnumber (autogenerated)', 'Koha itemnumber', 0, 0, 'items.itemnumber', -1, '', '', '', 0, 7, 'SER', '', '', NULL),
-               ('952', 'a', 'Location (home branch)', 'Location (home branch)', 0, 0, 'items.homebranch', 10, 'branches', '', '', 0, 0, 'SER', '', '', NULL),
-               ('952', 'b', 'Sublocation or collection (holding branch)', 'Sublocation or collection (holding branch)', 1, 0, 'items.holdingbranch', 10, 'branches', '', '', 0, 0, 'SER', '', '', NULL),
-               ('952', 'c', 'Shelving location', 'Shelving location', 1, 0, 'items.location', 10, 'LOC', '', '', 0, 0, 'SER', '', '', NULL),
-               ('952', 'd', 'Date acquired', 'Date acquired', 0, 0, 'items.dateaccessioned', 10, '', '', 'dateaccessioned.pl', 0, 0, 'SER', '', '', NULL),
-               ('952', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, 'items.booksellerid', 10, '', '', 'bookseller.pl', 0, 0, 'SER', '', '', NULL),
-               ('952', 'f', 'Coded location qualifier', 'Coded location qualifier', 1, 0, 'items.coded_location_qualifier', 10, '', '', 'marc21_locationqualifier.pl', NULL, 0, 'SER', '', '', NULL),
-               ('952', 'g', 'Cost, normal purchase price', 'Cost, normal purchase price', 0, 0, 'items.price', 10, '', '', '', 0, 0, 'SER', '', '', NULL),
-               ('952', 'j', 'Shelving control number', 'Shelving control number', 0, 0, 'items.stack', 10, 'STACK', '', '', NULL, -1, 'SER', '', '', NULL),
-               ('952', 'l', 'Koha issues (times borrowed)', 'Koha issues (times borrowed)', 0, 0, 'items.issues', 10, '', '', '', NULL, -5, 'SER', '', '', NULL),
-               ('952', 'm', 'Koha renewals', 'Koha renewals', 0, 0, 'items.renewals', 10, '', '', '', NULL, -5, 'SER', '', '', NULL),
-               ('952', 'n', 'Koha reserves (requests)', 'Koha reserves (requests)', 0, 0, 'items.reserves', 10, '', '', '', NULL, -5, 'SER', '', '', NULL),
-               ('952', 'o', 'Koha full call number', 'Koha full call number', 0, 0, 'items.itemcallnumber', 10, '', 'marc21_itemcallnumber.pl', NULL, 0, 0, 'SER', '', '', NULL),
-               ('952', 'p', 'Piece designation (barcode)', 'Piece designation (barcode)', 0, 0, 'items.barcode', 10, '', '', 'barcode.pl', 0, 0, 'SER', '', '', NULL),
-               ('952', 'q', 'Koha out on loan', 'Koha out on loan', 1, 0, 'items.onloan', 10, '', '', '', NULL, -5, 'SER', '', '', NULL),
-               ('952', 'r', 'Koha date last seen', 'Koha date last seen', 1, 0, 'items.datelastseen', 10, '', '', '', NULL, -5, 'SER', '', '', NULL),
-               ('952', 's', 'Koha date last borrowed', 'Koha date last borrowed', 1, 0, 'items.datelastborrowed', 10, '', '', '', NULL, -5, 'SER', '', '', NULL),
-               ('952', 't', 'Copy number', 'Copy number', 0, 0, 'items.copynumber', 10, '', '', '', NULL, 0, 'SER', '', '', NULL),
-               ('952', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, 'items.uri', 10, '', '', '', 1, 0, 'SER', '', '', NULL),
-               ('952', 'v', 'Cost, replacement price', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'SER', '', '', NULL),
-               ('952', 'w', 'Price effective from', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'SER', '', '', NULL),
-               ('952', 'x', 'Nonpublic note (lost item payment)', 'Nonpublic note (lost item payment)', 1, 0, 'items.paidfor', 10, '', '', '', NULL, 7, 'SER', '', '', NULL),
-               ('952', 'y', 'Koha item type', 'Koha item type', 1, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, -1, 'SER', '', '', NULL),
-               ('952', 'z', 'Public note', 'Public note', 1, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'SER', '', '', NULL);
-
-
-
--- *******************************************************
-
-
--- ***********************************************************************
--- SIMPLE SERIALS MARC 21 FIELDS/SUBFIELDS AND COMMMONLY USED EXTENSIONS.
--- ***********************************************************************
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('01e', 'CODED FIELD ERROR (RLIN)', 'CODED FIELD ERROR (RLIN)', 1, 0, '', 'SER'),
-               ('89e', 'ERRONEOUS FIELD, ERR (RLIN)', 'ERRONEOUS FIELD, ERR (RLIN)', 1, 0, '', 'SER'),
-               ('91c', 'EQUIVALENCE OR CROSS-REFERENCE-CORPORATE NAME [LOCAL, CANADA]', 'EQUIVALENCE OR CROSS-REFERENCE-CORPORATE NAME [LOCAL, CANADA]', 1, 0, '', 'SER'),
-               ('91r', 'RLG STANDARDS NOTE (RLIN)', 'RLG STANDARDS NOTE (RLIN)', 1, 0, '', 'SER'),
-               ('93r', 'SUMMARY HOLDINGS STATEMENT (RLIN)', 'SUMMARY HOLDINGS STATEMENT (RLIN)', 1, 0, '', 'SER'),
-               ('94c', 'EQUIVALENCE OR CROSS-REFERENCE--TITLE [OBSOLETE] [CAN/MARC only]', 'EQUIVALENCE OR CROSS-REFERENCE--TITLE [OBSOLETE] [CAN/MARC only]', 1, 0, '', 'SER'),
-               ('94a', 'ANALYSIS TREATMENT NOTE (RLIN)', 'ANALYSIS TREATMENT NOTE (RLIN)', 1, 0, '', 'SER'),
-               ('94b', 'TREATMENT CODES (RLIN)', 'TREATMENT CODES (RLIN)', 1, 0, '', 'SER'),
-               ('95c', 'EQUIVALENCE OR CROSS-REFERENCE--HIERARCHICAL PLACE NAME [OBSOLETE] [CAN/MARC only]', 'EQUIVALENCE OR CROSS-REFERENCE-HIERARCHICAL PLACE NAME [OBSOLETE] [CAN/MARC only]', 1, 0, '', 'SER'),
-               ('95r', 'CLUSTER MEMBER (RLIN)', 'CLUSTER MEMBER (RLIN)', 1, 0, '', 'SER'),
-               ('b99', 'PRIVATE LOCAL INFORMATION (RLIN)', 'PRIVATE LOCAL INFORMATION (RLIN)', 1, 0, '', 'SER'),
-               ('u01', 'UNIT IDENTIFICATION, STATUS, AND TYPE (RLIN)', 'UNIT IDENTIFICATION, STATUS, AND TYPE (RLIN)', 0, 0, '', 'SER'),
-               ('u02', 'STANDARD NUMBER (RLIN)', 'STANDARD NUMBER (RLIN)', 0, 0, '', 'SER'),
-               ('u08', 'CODED INFORMATION (RLIN)', 'CODED INFORMATION (RLIN)', 0, 0, '', 'SER'),
-               ('u10', 'REQUESTER IDENTIFICATION (RLIN)', 'REQUESTER IDENTIFICATION (RLIN)', 1, 0, '', 'SER'),
-               ('u11', 'DEPARTMENT REPORT REQUEST (RLIN)', 'DEPARTMENT REPORT REQUEST (RLIN)', 1, 0, '', 'SER'),
-               ('u20', 'SUPPLIER IDENTIFICATION, SUPN (RLIN)', 'SUPPLIER IDENTIFICATION, SUPN (RLIN)', 0, 0, '', 'SER'),
-               ('u21', 'LIBRARY CODES FOR VENDOR AND ORDER (RLIN)', 'LIBRARY CODES FOR VENDOR AND ORDER (RLIN)', 0, 0, '', 'SER'),
-               ('u22', 'SUPPLIER CODES AND CATALOG INFORMATION (RLIN)', 'SUPPLIER CODES AND CATALOG INFORMATION (RLIN)', 0, 0, '', 'SER'),
-               ('u25', 'SUPPLIER REPORT(S) (RLIN)', 'SUPPLIER REPORT(S) (RLIN)', 0, 0, '', 'SER'),
-               ('u30', 'INTERVALS (RLIN)', 'INTERVALS (RLIN)', 0, 0, '', 'SER'),
-               ('u31', 'CLAIM COUNTS (RLIN)', 'CLAIM COUNTS (RLIN)', 0, 0, '', 'SER'),
-               ('u33', 'INVOICE CLAIM (RLIN)', 'INVOICE CLAIM (RLIN)', 0, 0, '', 'SER'),
-               ('u34', 'EXTENDED PROCUREMENT CLAIM AND REVIEW (RLIN)', 'EXTENDED PROCUREMENT CLAIM AND REVIEW (RLIN)', 0, 0, '', 'SER'),
-               ('u40', 'EXTENDED PROCUREMENT CODES (RLIN)', 'EXTENDED PROCUREMENT CODES (RLIN)', 0, 0, '', 'SER'),
-               ('u50', 'ACQUISITIONS NOTES (RLIN)', 'ACQUISITIONS NOTES (RLIN)', 0, 0, '', 'SER'),
-               ('u51', 'SELECTION NOTES (RLIN)', 'SELECTION NOTES (RLIN)', 0, 0, '', 'SER'),
-               ('u52', 'SUPPLIER INSTRUCTIONS AND NOTES, SINT (RLIN)', 'SUPPLIER INSTRUCTIONS AND NOTES, SINT (RLIN)', 0, 0, '', 'SER'),
-               ('u53', 'CLAIM INSTRUCTIONS AND NOTES, CLNT (RLIN)', 'CLAIM INSTRUCTIONS AND NOTES, CLNT (RLIN)', 0, 0, '', 'SER'),
-               ('u54', 'NOTES TO SERIALS DEPARTMENT (RLIN)', 'NOTES TO SERIALS DEPARTMENT (RLIN)', 0, 0, '', 'SER'),
-               ('u55', 'CATALOGING NOTES (RLIN)', 'CATALOGING NOTES (RLIN)', 0, 0, '', 'SER'),
-               ('u5f', 'ACCOUNTING NOTES (RLIN)', 'ACCOUNTING NOTES (RLIN)', 0, 0, '', 'SER'),
-               ('u70', 'MATERIAL AND LOCATION INFORMATION (RLIN)', 'MATERIAL AND LOCATION INFORMATION (RLIN)', 0, 0, '', 'SER'),
-               ('u71', 'FUND ACCOUNT (RLIN)', 'FUND ACCOUNT (RLIN)', 0, 0, '', 'SER'),
-               ('u75', 'ITEM DETAILS (RLIN)', 'ITEM DETAILS (RLIN)', 1, 0, '', 'SER'),
-               ('u7f', 'PRICE INFORMATION (RLIN)', 'PRICE INFORMATION (RLIN)', 1, 0, '', 'SER'),
-               ('u90', 'TAPE OUTPUT, TAPE (RLIN)', 'TAPE OUTPUT, TAPE (RLIN)', 0, 0, '', 'SER'),
-               ('ufi', 'FISCAL INFORMATION, FI (RLIN)', 'FISCAL INFORMATION, FI (RLIN)', 1, 0, '', 'SER');
-
-
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('01e', 'a', 'Coded field error', 'Coded field error', 0, 0, '', 0, '', '', '', 0, -6, 'SER', '', '', NULL),
-               ('89e', '0', '0', '0', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', '1', '1', '1', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', '2', '2', '2', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', '3', '3', '3', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', '4', '4', '4', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', '5', '5', '5', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', '6', '6', '6', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', '7', '7', '7', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', '8', '8', '8', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', '9', '9', '9', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', 'a', 'a', 'a', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', 'b', 'b', 'b', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', 'c', 'c', 'c', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', 'd', 'd', 'd', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', 'e', 'e', 'e', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', 'f', 'f', 'f', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', 'g', 'g', 'g', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', 'h', 'h', 'h', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', 'i', 'i', 'i', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', 'j', 'j', 'j', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', 'k', 'k', 'k', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', 'l', 'l', 'l', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', 'm', 'm', 'm', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', 'n', 'n', 'n', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', 'o', 'o', 'o', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', 'p', 'p', 'p', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', 'q', 'q', 'q', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', 'r', 'r', 'r', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', 's', 's', 's', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', 't', 't', 't', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', 'u', 'u', 'u', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', 'v', 'v', 'v', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', 'w', 'w', 'w', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', 'x', 'x', 'x', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', 'y', 'y', 'y', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('89e', 'z', 'z', 'z', 1, 0, '', 8, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('91c', '4', 'Relator code', 'Relator code', 1, 0, '', 9, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('91c', '6', 'Linkage', 'Linkage', 0, 0, '', 9, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('91c', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 9, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('91c', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, '', 9, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('91c', 'b', 'Subordinate unit', 'Subordinate unit', 1, 0, '', 9, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('91c', 'c', 'Location of meeting', 'Location of meeting', 0, 0, '', 9, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('91c', 'd', 'Date of meeting or treaty signing', 'Date of meeting or treaty signing', 1, 0, '', 9, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('91c', 'e', 'Relator term', 'Relator term', 1, 0, '', 9, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('91c', 'f', 'Date of a work', 'Date of a work', 0, 0, '', 9, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('91c', 'g', 'Miscellaneous information', 'Miscellaneous information', 0, 0, '', 9, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('91c', 'k', 'Form subheading', 'Form subheading', 1, 0, '', 9, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('91c', 'l', 'Language of a work', 'Language of a work', 0, 0, '', 9, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('91c', 'n', 'Number of part/section/meeting', 'Number of part/section/meeting', 1, 0, '', 9, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('91c', 'p', 'Name of part/section of a work', 'Name of part/section of a work', 1, 0, '', 9, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('91c', 't', 'Title of a work', 'Title of a work', 0, 0, '', 9, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('91c', 'u', 'Affiliation', 'Affiliation', 0, 0, '', 9, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('91r', 'a', 'RLG standards note', 'RLG standards note', 0, 0, '', 9, '', '', '', 0, -6, 'SER', '', '', NULL),
-               ('93r', 'a', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SER', '', '', NULL),
-               ('93r', 'b', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SER', '', '', NULL),
-               ('93r', 'c', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SER', '', '', NULL),
-               ('93r', 'd', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SER', '', '', NULL),
-               ('93r', 'e', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SER', '', '', NULL),
-               ('93r', 'f', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SER', '', '', NULL),
-               ('93r', 'g', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SER', '', '', NULL),
-               ('93r', 'h', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SER', '', '', NULL),
-               ('93r', 'i', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SER', '', '', NULL),
-               ('93r', 'k', 'SHS', 'SHS', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SER', '', '', NULL),
-               ('94c', '6', 'Linkage', 'Linkage', 0, 0, '', 9, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('94c', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 9, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('94c', 'a', 'Title', 'Title', 0, 0, '', 9, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('94c', 'b', 'Remainder of title', 'Remainder of title', 0, 0, '', 9, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('94c', 'c', 'Statement of responsibility, etc', 'Statement of responsibility, etc', 0, 0, '', 9, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('94c', 'd', 'Designation of section/part/series (SE) [OBSOLETE]', 'Designation of section section/part/series (SE) [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('94c', 'e', 'Name of part/section/series (SE) [OBSOLETE]', 'Name of part/section/series (SE) [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('94c', 'f', 'Inclusive dates', 'Inclusive dates', 0, 0, '', 9, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('94c', 'g', 'Bulk dates', 'Bulk dates', 0, 0, '', 9, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('94c', 'h', 'Medium', 'Medium', 0, 0, '', 9, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('94c', 'k', 'Form', 'Form', 1, 0, '', 9, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('94c', 'n', 'Number of part/section of a work', 'Number of part/section of a work', 1, 0, '', 9, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('94c', 'p', 'Name of part/section of a work', 'Name of part/section of a work', 1, 0, '', 9, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('94c', 's', 'Version', 'Version', 0, 0, '', 9, '', '', '', NULL, -6, 'SER', '', '', NULL),
-               ('94a', 'a', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'SER', '', '', NULL),
-               ('94a', 'b', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'SER', '', '', NULL),
-               ('94a', 'c', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'SER', '', '', NULL),
-               ('94a', 'd', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'SER', '', '', NULL),
-               ('94a', 'e', 'ATN', 'ATN', 0, 0, '', 9, '', '', '', 0, -6, 'SER', '', '', NULL),
-               ('94b', 'a', 'ATC', 'ATC', 0, 0, '', 9, '', '', '', 0, -6, 'SER', '', '', NULL),
-               ('94b', 'b', 'SNR', 'SNR', 0, 0, '', 9, '', '', '', 0, -6, 'SER', '', '', NULL),
-               ('95c', 'a', 'Country', 'Country', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SER', '', '', NULL),
-               ('95c', 'b', 'State, province, territory', 'State, province, territory', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SER', '', '', NULL),
-               ('95c', 'c', 'County, region, islands area', 'County, region, islands area', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SER', '', '', NULL),
-               ('95c', 'd', 'City', 'City', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SER', '', '', NULL),
-               ('95r', '6', 'Linkage', 'Linkage', 0, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SER', '', '', NULL),
-               ('95r', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 9, NULL, NULL, '', NULL, 5, 'SER', '', '', NULL),
-               ('95r', 'a', 'Record ID (RLIN)', 'Record ID (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('95r', 'b', 'Institution name (RLIN)', 'Institution name (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u01', 'a', 'Operator\'s initials, OID (RLIN)', 'Operator\'s initials, OID (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u01', 'd', 'UAD (RLIN)', 'UAD (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u01', 'f', 'FPST (RLIN)', 'FPST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u01', 'h', 'CPST (RLIN)', 'FPST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u01', 'i', 'CPST (RLIN)', 'FPST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u01', 's', 'UST (RLIN)', 'UST (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u01', 't', 'UTYP (RLIN)', 'UTYP (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u02', '2', 'Source of number or code', 'Source of number or code', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u02', 'a', 'Standard number or code', 'Standard number or code', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u02', 'b', 'Additional codes following the standard number', 'Additional codes following the standard number', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u02', 'c', 'Terms of availability', 'Terms of availability', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u02', 'z', 'Canceled/invalid standard number or code', 'Canceled/invalid standard number or code', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u08', 'n', 'LSI', 'LSI', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u08', 'o', 'SID', 'SID', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u08', 'p', 'DP', 'DP', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u08', 'r', 'RUSH', 'RUSH', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u10', 'a', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u10', 'b', 'SID', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u10', 'c', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u10', 'd', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u10', 'e', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u10', 's', 'REQ', 'REQ', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u11', 'a', 'Department report request, DRR (DRRH for earlier occurrences)', 'DRR (DRRH for earlier occurrences)', 1, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u20', 'a', 'SUPN', 'SUPN', 1, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u20', 'b', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u20', 'c', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u20', 'd', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u20', 'e', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u20', 'x', 'SUPN', 'SUPN', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u21', 'a', 'SHIP', 'SHIP', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u21', 'b', 'BILL', 'BILL', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u21', 'c', 'DAC', 'DAC', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u21', 'n', 'LSAC', 'LSAC', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u22', 'a', 'SICO', 'SICO', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u22', 'b', 'SICO', 'SICO', 1, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u22', 'c', 'SCAT', 'SCAT', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u25', 'a', 'Supplier report(s), SRPT', 'Supplier report(s), SRPT', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u30', 'a', 'NCC [OBSOLETE]', 'NCC [OBSOLETE]', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u30', 'i', 'ICI', 'ICI', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u30', 'm', 'MCI', 'MCI', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u31', 'a', 'NCC', 'NCC', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u31', 'b', 'NCS', 'NCS', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u33', 'a', 'ICL', 'ICL', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u33', 'd', 'ICAD', 'ICAD', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u34', 'a', 'EPCL', 'EPCL', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u34', 'r', 'ERI', 'ERI', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u40', 'd', 'EPDT [OBSOLETE]', 'EPDT [OBSOLETE]', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u40', 'f', 'EFRQ', 'EFRQ', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u40', 's', 'EPST', 'EPST', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u40', 't', 'ETYP', 'ETYP', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u50', 'a', 'Acquisitions notes, AQNT', 'Acquisitions notes, AQNT', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u51', 'a', 'Selection notes, SLNT', 'Selection notes, SLNT', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u52', 'a', 'INT', 'INT', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u52', 'b', 'INT', 'NT', 1, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u53', 'a', 'CLNT', 'CLNT', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u53', 'b', 'CLNT', 'CLNT', 1, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u54', 'a', 'Notes to serials department, SRNT', 'Notes to serials department, SRNT', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u55', 'a', 'Cataloging notes, CTNT', 'Cataloging notes, CTNT', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u5f', 'a', 'Accounting notes, ACNT', 'Accounting notes, ACNT', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u70', 'a', 'QTY', 'QTY', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u70', 'b', 'MAT', 'MAT', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u70', 'l', 'MLOC', 'MLOC', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u71', 'a', 'Fund account, FUND', 'Fund account, FUND', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u75', 'a', 'ITEM', 'ITEM', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u75', 'c', 'CIRC', 'CIRC', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u75', 'h', 'IPST', 'IPST', 1, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u75', 'i', 'ITEM', 'ITEM', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u75', 'l', 'SLOC', 'SLOC', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u7f', 'a', 'LPRI', 'LPRI', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u7f', 'b', 'CURR', 'CURR', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u7f', 'k', 'CVRT [OBSOLETE]', 'CVRT [OBSOLETE]', 1, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u7f', 'p', 'LPD', 'LPD', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u7f', 'r', 'EDRT', 'EDRT', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u90', 'h', 'TAPE', 'TAPE', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('u90', 'i', 'TAPE', 'TAPE', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('ufi', 'a', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('ufi', 'b', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('ufi', 'c', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('ufi', 'd', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('ufi', 'e', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('ufi', 'f', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('ufi', 'g', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('ufi', 'h', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL),
-               ('ufi', 'n', 'FI', 'FI', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL);
-
-
diff --git a/misc/installer_devel_notes/data/en/marcflavour/marc21/optional/marc21_simple_bib_frameworks.txt b/misc/installer_devel_notes/data/en/marcflavour/marc21/optional/marc21_simple_bib_frameworks.txt
deleted file mode 100644 (file)
index cf49dc3..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-Simple MARC 21 bibliographic frameworks for some common types of bibliographic material.  Frameworks are used to define the structure of your MARC records and the behavior of the integrated MARC editor. You can change these at any time after installation. The frameworks in this optional default setting include:
-
-BKS    Books, Booklets, Workbooks
-CF     CD-ROMs, DVD-ROMs, General Online Resources
-SR     Audio Cassettes, CDs
-VR     DVDs, VHS
-AR     Models
-KT     Kits
-IR     Binders
-SER    Serials
diff --git a/misc/installer_devel_notes/data/en/marcflavour/unimarc/mandatory/unimarc_framework_DEFAULT.sql b/misc/installer_devel_notes/data/en/marcflavour/unimarc/mandatory/unimarc_framework_DEFAULT.sql
deleted file mode 100644 (file)
index c82a59f..0000000
+++ /dev/null
@@ -1,272 +0,0 @@
--- ***********************************************************************
--- KOHA UNIMARC STANDARD DEFAULT BIBLIOGRAPHIC FRAMEWORK
--- DEVELOPMENT NOTES AND SUPPLEMENTARY SQL
---
--- Pretest Version 0.0.1
--- 2007-11-05
---
--- edited
--- with much more work remaining
--- (PLEASE SEE WARNING BELOW)
--- by thd
---
--- originally compiled
--- by Roberto Sturman
---
--- from
---
--- UNIMARC manual : bibliographic format 1994 / IFLA Universal
--- Bibliographic Control and International MARC Core Programme (UBCIM). -
--- "The following list represents the state of the format as at 1 March
--- 2000.  It includes the changes published in Update 3." -
--- http://www.ifla.org/VI/3/p1996-1/sec-uni.htm .
--- 2006-03-15 a
--- ***********************************************************************
-
-
--- *********************************************************************
--- These development notes and supplementary SQL statements have been
--- moved from the main file for easier readability of the main file and
--- to avoid possible bugs with lack of time to test for the use of
--- letters in field names such as used by RLIN to avoid conflict with
--- numbered field names already in use.
---
--- Retaining this file is important for future MARC frameworks
--- development work.
--- *********************************************************************
-
-
--- ****************************************************************************
--- WARNING
--- RISK OF DATA LOSS
---
--- Modestly corrected and augmented.  Missing many elements.  The work of the
--- original compiler had been done before significant improvements to Koha
--- MARC frameworks implementation had been introduced in 2006 for displaying,
--- editing, and preserving record data.
---
--- The documentation cited by the original compiler is known to be out of date
--- and incomplete.  Furthermore, the original compiler did not include all
--- fields and subfields from the documentation he consulted.
---
--- Completely unsafe for production use without significant correction and
--- augmentation.  These problems could be fixed but a few days work would be
--- required to fix them completely. -- thd.
--- ****************************************************************************
-
-
-SET FOREIGN_KEY_CHECKS = 0;
-
-
--- ******************************************************
--- KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS.
--- ******************************************************
-
-
--- Original Record ID Field/Subfields
-
-
--- INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
---             ('090', 'Biblio Number (Koha)', 'Biblio Number (Koha)', 0, 0, '', '');
-
--- INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
---             ('090', '9', 'Biblio  Number (Koha)', 'Biblio  Number (Koha)', 0, 0, 'biblio.biblionumber', 0, '', '', '', 0, -5, '', '', '', NULL),
---             ('090', 'a', 'BiblioItem Number (Koha)', 'BiblioItem Number (Koha)', 0, 0, 'biblioitems.biblioitemnumber', 0, '', '', '', 0, -5, '', '', '', NULL);
-
-
--- Current Record ID Field/Subfields
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('999', 'System Control Numbers (Koha)', 'System Control Numbers (Koha)', 0, 0, '', '');
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('999', '9', 'Koha biblio number (autogenerated)', 'Koha biblio number', 0, 0, 'biblio.biblionumber', -1, '', '', '', 0, -5, '', '', '', NULL),
-               ('999', 'a', 'Koha biblioitem number (autogenerated)', 'Koha biblioitem number', 0, 0, 'biblioitems.biblioitemnumber', -1, '', '', '', 0, -5, '', '', '', NULL);
-
-
--- ******************************************************
-
-
--- Original primary biblioitems Field/Subfields
-
-
--- INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
---             ('990', 'Biblio Type (Koha)', 'Biblio Type (Koha)', 0, 1, '', '');
-
--- INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
---             ('990', 'a', 'Biblio Type (Koha)', 'Biblio Type', 0, 0, 'biblioitems.itemtype', 0, 'itemtypes', '', NULL, 0, 0, '', '', '', NULL);
-
-
-
--- Plugins which need to be written for primary biblioitems Field/Subfields.
-
-
---             ('990', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, '', '', 'unimarc_en_classcodes.pl', NULL, 0, '', '', '', NULL),
---             ('990', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', 'unimarc_callnumber.pl', NULL, 0, '', '', '', NULL),
-
-
-
--- Current primary biblioitems Field/Subfields
-
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('990', 'ADDED ENTRY ELEMENTS (KOHA)', 'ADDED ENTRY ELEMENTS (KOHA)', 0, 0, '', '');
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('990', '0', 'Koha issues (borrowed), all copies', 'Koha issues (borrowed), all copies', 0, 0, 'biblioitems.totalissues', 9, '', '', '', NULL, -5, '', '', '', NULL),
-               ('990', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, '', '', '', NULL, 0, '', '', '', NULL),
-               ('990', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'biblioitems.cn_sort', -1, '', '', '', 0, 7, '', '', '', NULL),
-               ('990', 'a', 'Koha item type [OBSOLETE]', 'Koha item type [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -5, '', '', '', NULL),
-               ('990', 'c', 'Koha item type', 'Koha item type', 0, 1, 'biblioitems.itemtype', 9, 'itemtypes', '', '', NULL, 0, '', '', '', NULL),
-               ('990', 'e', 'Edition', 'Edition', 0, 0, 'biblioitems.cn_edition', 9, 'CN_EDITION', '', '', NULL, 0, '', '', '', NULL),
-               ('990', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', '', NULL, 0, '', '', '', NULL),
-               ('990', 'i', 'Item part', 'Item part', 1, 0, 'biblioitems.cn_item', 9, '', '', '', NULL, 9, '', '', '', NULL),
-               ('990', 'k', 'Call number prefix', 'Call number prefix', 0, 0, 'biblioitems.cn_prefix', 9, '', '', '', NULL, 0, '', '', '', NULL),
-               ('990', 'm', 'Call number suffix', 'Call number suffix', 0, 0, 'biblioitems.cn_suffix', 9, '', '', '', 0, 0, '', '', '', NULL);
-
-
-
--- ******************************************************
-
-
--- Recommandation 995 is designed for interlibrary loan.  It is not designed
--- for holdings even if libraries have used it for holdings.
-
--- Original items Field/Subfields
-
--- Adapted from:
--- Recommandation 995 sur la fourniture de données locales dans les
--- échanges de notices bibliographiques en UNIMARC accompagnant le prêt
--- ou le dépôt d'exemplaires / ABF (Association des bibliothécaires
--- français) ; FULBI (Fédération des utilisateurs de logiciels de
--- bibliothèque) ; ADBDP (Association des directeurs de bibliothèques
--- départementales de prêt) ; ADBGV (Association des directeurs de
--- bibliothèques municipales et intercommunales des grandes villes de
--- France) ADDNB (Association pour le développement des documents
--- numériques en bibliothèque.
-
-
--- INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
---             ('995', 'Holdings', 'Holdings', 0, 0, '', ''),
--- 
--- INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
---             ('995', '9', 'Itemnumber (Koha Itemnumber))', '', 0, 0, 'items.itemnumber', -1, '', '', '', 0, 0, '', '', '', NULL),
---             ('995', 'a', 'Origin of Item (Free Text)', '', 0, 1, '', -1, '', '', '', 0, 0, '', '', '', NULL),
---             ('995', 'b', 'Owner Library', '', 0, 1, 'items.homebranch', 10, 'branches', '', '', 0, 0, '', '', '', NULL),
---             ('995', 'c', 'Holding Branch', '', 0, 1, 'items.holdingbranch', 10, 'branches', '', '', 0, 0, '', '', '', NULL),
---             ('995', 'd', 'Code of Lending or Depository Institution', '', 0, 0, '', -1, '', '', '', 0, 0, '', '', '', NULL),
---             ('995', 'e', 'Localization of Item', '', 0, 1, '', 10, '', '', '', 0, 0, '', '', '', NULL),
---             ('995', 'f', 'Inventory Number', '', 0, 0, '', 10, '', '', '', 0, 0, '', '', '', NULL),
---             ('995', 'g', 'Barcode Prefix', '', 0, 0, '', -1, '', '', '', 0, 0, '', '', '', NULL),
---             ('995', 'h', 'Barcode Incrementation', '', 0, 0, '', -1, '', '', '', 0, 0, '', '', '', NULL),
---             ('995', 'i', 'Barcode Suffix', '', 0, 0, '', -1, '', '', '', 0, 0, '', '', '', NULL),
---             ('995', 'j', 'Barcode', 'Barcode', 0, 0, 'items.barcode', 10, '', '', '', 0, 0, '', '', '', NULL),
---             ('995', 'k', 'Call Number', 'Call Number', 0, 1, 'items.itemcallnumber', 10, '', '', '', 0, 0, '', '', '', NULL),
---             ('995', 'l', 'Numbering (Vol., Issue, etc.)', '', 0, 1, '', -1, '', '', '', 0, 0, '', '', '', NULL),
---             ('995', 'm', 'Date of Loan or Deposit', '', 0, 0, 'items.datelastseen', 10, '', '', '', 0, 0, '', '', '', NULL),
---             ('995', 'n', 'Expiration Loan Date', '', 0, 0, '', -1, '', '', '', 0, 0, '', '', '', NULL),
---             ('995', 'o', 'For Loan (0), Not for Loan  (1)', '', 0, 1, 'items.notforloan', 10, '', '', '', 0, 0, '', '', '', NULL),
---             ('995', 'q', 'Intended Audience', '', 0, 0, '', -1, '', '', '', 0, 0, '', '', '', NULL),
---             ('995', 'r', 'Document Type and Material Type', '', 0, 1, '', -1, '', '', '', 0, 0, '', '', '', NULL),
---             ('995', 's', 'Acquisition Mode', '', 0, 1, '', -1, '', '', '', 0, 0, '', '', '', NULL),
---             ('995', 'u', 'Notes', '', 0, 0, 'items.itemnotes', 10, '', '', '', 0, 0, '', '', '', NULL);
-
-
-
--- Recommended items Field/Subfields
-
--- INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
---             ('995', 'Location and Item Information (Koha)', 'Location and Item Information (Koha)', 0, 0, '', '');
-
--- INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
---             ('995', '0', 'Withdrawn status', 'Withdrawn status', 0, 0, 'items.wthdrawn', 10, 'WTHDRAWN', '', '', 0, 0, '', '', '', NULL),
---             ('995', '1', 'Lost status', 'Lost status', 0, 0, 'items.itemlost', 10, 'LOST', '', '', 0, 0, '', '', '', NULL),
---             ('995', '2', 'System code (specific classification or other scheme and edition)', 'System code (specific classification or other scheme and edition)', 0, 0, '', 10, '', '', 'unimarc_en_classcodes.pl', NULL, 0, '', '', '', NULL),
---             ('995', '3', 'Classification part', 'Classification part', 0, 0, '', 10, '', '', '', NULL, 0, '', '', '', NULL),
---             ('995', '4', 'Item part', 'Item part', 1, 0, '', 10, '', '', '', NULL, 0, '', '', '', NULL),
---             ('995', '5', 'Use restrictions', 'Use restrictions', 0, 0, 'items.restricted', 10, 'RESTRICTED', '', '', 0, 0, '', '', '', NULL),
---             ('995', '6', 'Coded location qualifier', 'Coded location qualifier', 1, 0, '', 10, '', '', 'marc21_locationqualifier.pl', NULL, 0, '', '', '', NULL),
---             ('995', '7', 'Copy number', 'Copy number', 0, 0, 'items.copynumber', 10, '', '', '', NULL, 0, '', '', '', NULL),
---             ('995', '8', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, 'items.uri', 10, '', '', '', 1, 0, '', '', '', NULL),
---             ('995', '9', 'Internal item number (Koha itemnumber, autogenerated)', 'Internal itemnumber (Koha itemnumber)', 0, 0, 'items.itemnumber', -1, '', '', '', 0, -5, '', '', '', NULL),
---             ('995', 'a', 'Origin of the item (home branch) (free text)', 'Origin of item (home branch) (free text)', 0, 1, 'items.homebranch', 10, 'branches', '', '', 0, 0, '', '', '', NULL),
---             ('995', 'b', 'Origin of item (home branch) (coded)', 'Origin of item (home branch (coded)', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL),
---             ('995', 'c', 'Lending or holding organisation (holding branch) (free text)', 'Lending or holding organisation (holding branch) (free text)', 0, 1, 'items.holdingbranch', 10, 'branches', '', '', 0, 0, '', '', '', NULL),
---             ('995', 'd', 'Lending or holding organisation (holding branch) code', 'Lending or holding organisation (holding branch) code', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL),
---             ('995', 'e', 'Genre detail', 'Genre', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL),
---             ('995', 'f', 'Barcode', 'Barcode', 0, 0, 'items.barcode', 10, '', '', 'barcode.pl', 0, 0, '', '', '', NULL),
---             ('995', 'g', 'Barcode prefix', 'Barcode prefix', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL),
---             ('995', 'h', 'Barcode incrementation', 'Barcode incrementation', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL),
---             ('995', 'i', 'Barcode suffix', 'Barcode suffix', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL),
---             ('995', 'j', 'Section', 'Section', 0, 0, '', 10, '', '', '', 0, 0, '', '', '', NULL),
---             ('995', 'k', 'Call number (full call number)', 'Call number (full call number)', 0, 0, 'items.itemcallnumber', 10, '', '', 'unimarc_itemcallnumber.pl', 0, 0, '', '', '', NULL),
---             ('995', 'l', 'Numbering (volume or other part)', 'Numbering (bound volume or other part)', 0, 0, 'items.materials', 10, '', '', '', 0, 0, '', '', '', NULL),
---             ('995', 'm', 'Date of loan or deposit', 'Date of loan or deposit', 0, 0, 'items.datelastborrowed', 10, '', '', '', 0, -5, '', '', '', NULL),
---             ('995', 'n', 'Expiration of loan date', 'Expiration of loan date', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL),
---             ('995', 'o', 'Circulation type (not for loan)', 'Circulation type (not for loan)', 1, 0, 'items.notforloan', 10, '', '', '', 0, 0, '', '', '', NULL),
---             ('995', 'p', 'Serial', 'Serial', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL),
---             ('995', 'q', 'Intended audience (age level)', 'Intended audience (age level)', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL),
---             ('995', 'r', 'Type of item and material', 'Type of item and material', 0, 0, '', 10, '', '', '', 0, 0, '', '', '', NULL),
---             ('995', 's', 'Acquisition mode', 'Acquisition mode', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL),
---             ('995', 't', 'Genre', 'Genre', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL),
---             ('995', 'u', 'Copy note', 'Copy note', 0, 0, 'items.itemnotes', 10, '', '', '', 0, 0, '', '', '', NULL),
---             ('995', 'v', 'Periodical number', 'Periodical number', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL),
---             ('995', 'w', 'Recipient organisation code', 'Recipient organisation code', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL),
---             ('995', 'x', 'Recipient organisation, free text', 'Recipient organisation, free text', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL),
---             ('995', 'y', 'Recipient parent organisation code', 'Recipient parent organisation code', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL),
---             ('995', 'z', 'Recipient parent organisation, free text', 'Recipient parent organisation, free text', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL);
-
-
-
--- Plugins which need to be written for items Field/Subfields
-
-
---             ('995', '2', 'System code (specific classification or other scheme and edition)', 'System code (specific classification or other scheme and edition)', 0, 0, '', 10, '', '', 'unimarc_en_classcodes.pl', NULL, 0, '', '', '', NULL),
---             ('995', 'k', 'Call number (full call number)', 'Call number (full call number)', 0, 0, 'items.itemcallnumber', 10, '', '', 'unimarc_itemcallnumber.pl', 0, 0, '', '', '', NULL),
-
-
-
--- Current items Field/Subfields
-
-INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
-               ('995', 'Location and Item Information (Koha)', 'Location and Item Information (Koha)', 0, 0, '', '');
-
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
-               ('995', '0', 'Withdrawn status', 'Withdrawn status', 0, 0, 'items.wthdrawn', 10, 'WTHDRAWN', '', '', 0, 0, '', '', '', NULL),
-               ('995', '1', 'Lost status', 'Lost status', 0, 0, 'items.itemlost', 10, 'LOST', '', '', 0, 0, '', '', '', NULL),
-               ('995', '2', 'System code (specific classification or other scheme and edition)', 'System code (specific classification or other scheme and edition)', 0, 0, '', 10, '', '', '', NULL, 0, '', '', '', NULL),
-               ('995', '3', 'Use restrictions', 'Use restrictions', 0, 0, 'items.restricted', 10, 'RESTRICTED', '', '', 0, 0, '', '', '', NULL),
-               ('995', '4', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'items.cn_sort', -1, '', '', '', 0, 7, '', '', '', NULL),
-               ('995', '5', 'Coded location qualifier', 'Coded location qualifier', 1, 0, '', 10, '', '', 'marc21_locationqualifier.pl', NULL, 0, '', '', '', NULL),
-               ('995', '6', 'Copy number', 'Copy number', 0, 0, 'items.copynumber', 10, '', '', '', NULL, 0, '', '', '', NULL),
-               ('995', '7', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, 'items.uri', 10, '', '', '', 1, 0, '', '', '', NULL),
-               ('995', '8', 'Koha collection', 'Koha collection', 0, 0, 'items.ccode', 10, 'CCODE', '', '', 0, 0, '', '', '', NULL),
-               ('995', '9', 'Internal item number (Koha itemnumber, autogenerated)', 'Internal itemnumber (Koha itemnumber)', 0, 0, 'items.itemnumber', -1, '', '', '', 0, -5, '', '', '', NULL),
-               ('995', 'a', 'Origin of the item (home branch) (free text)', 'Origin of item (home branch) (free text)', 0, 1, 'items.homebranch', 10, 'branches', '', '', 0, 0, '', '', '', NULL),
-               ('995', 'b', 'Origin of item (home branch) (coded)', 'Origin of item (home branch (coded)', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL),
-               ('995', 'c', 'Lending or holding organisation (holding branch) (free text)', 'Lending or holding organisation (holding branch) (free text)', 0, 1, 'items.holdingbranch', 10, 'branches', '', '', 0, 0, '', '', '', NULL),
-               ('995', 'd', 'Lending or holding organisation (holding branch) code', 'Lending or holding organisation (holding branch) code', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL),
-               ('995', 'e', 'Genre detail', 'Genre', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL),
-               ('995', 'f', 'Barcode', 'Barcode', 0, 0, 'items.barcode', 10, '', '', 'barcode.pl', 0, 0, '', '', '', NULL),
-               ('995', 'g', 'Barcode prefix', 'Barcode prefix', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL),
-               ('995', 'h', 'Barcode incrementation', 'Barcode incrementation', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL),
-               ('995', 'i', 'Barcode suffix', 'Barcode suffix', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL),
-               ('995', 'j', 'Section', 'Section', 0, 0, '', 10, '', '', '', 0, 0, '', '', '', NULL),
-               ('995', 'k', 'Call number (full call number)', 'Call number (full call number)', 0, 0, 'items.itemcallnumber', 10, '', '', '', 0, 0, '', '', '', NULL),
-               ('995', 'l', 'Numbering (volume or other part)', 'Numbering (bound volume or other part)', 0, 0, 'items.materials', 10, '', '', '', 0, 0, '', '', '', NULL),
-               ('995', 'm', 'Date of loan or deposit', 'Date of loan or deposit', 0, 0, 'items.datelastborrowed', 10, '', '', '', 0, -5, '', '', '', NULL),
-               ('995', 'n', 'Expiration of loan date', 'Expiration of loan date', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL),
-               ('995', 'o', 'Circulation type (not for loan)', 'Circulation type (not for loan)', 1, 0, 'items.notforloan', 10, '', '', '', 0, 0, '', '', '', NULL),
-               ('995', 'p', 'Serial', 'Serial', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL),
-               ('995', 'q', 'Intended audience (age level)', 'Intended audience (age level)', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL),
-               ('995', 'r', 'Type of item and material', 'Type of item and material', 0, 0, '', 10, '', '', '', 0, 0, '', '', '', NULL),
-               ('995', 's', 'Acquisition mode', 'Acquisition mode', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL),
-               ('995', 't', 'Genre', 'Genre', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL),
-               ('995', 'u', 'Copy note', 'Copy note', 0, 0, 'items.itemnotes', 10, '', '', '', 0, 0, '', '', '', NULL),
-               ('995', 'v', 'Periodical number', 'Periodical number', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL),
-               ('995', 'w', 'Recipient organisation code', 'Recipient organisation code', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL),
-               ('995', 'x', 'Recipient organisation, free text', 'Recipient organisation, free text', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL),
-               ('995', 'y', 'Recipient parent organisation code', 'Recipient parent organisation code', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL),
-               ('995', 'z', 'Recipient parent organisation, free text', 'Recipient parent organisation, free text', 0, 0, '', 10, '', '', '', 0, -1, '', '', '', NULL);
-
-
diff --git a/misc/installer_devel_notes/data/en/marcflavour/unimarc/mandatory/unimarc_framework_DEFAULT.txt b/misc/installer_devel_notes/data/en/marcflavour/unimarc/mandatory/unimarc_framework_DEFAULT.txt
deleted file mode 100644 (file)
index a82f9dc..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Default UNIMARC bibligraphic framework in English.
index 010b4a7..c38c53e 100644 (file)
@@ -86,7 +86,7 @@ sub po_filename {
     my $self = shift;
 
     my $context    = C4::Context->new;
-    my $trans_path = $context->config('intranetdir') . '/misc/translator/po';
+    my $trans_path = $Bin . '/po';
     my $trans_file = "$trans_path/" . $self->{lang} . "-pref.po";
     return $trans_file;
 }
@@ -131,7 +131,7 @@ sub add_prefs {
                     }
                 }
             }
-            elsif ( $element ) {
+            elsif ( $element && $pref_name ) {
                 $self->po_append( $self->{file} . "#$pref_name# $element", $comment );
             }
         }
@@ -173,7 +173,7 @@ sub update_tab_prefs {
                     }
                 }
             }
-            elsif ( $element ) {
+            elsif ( $element && $pref_name ) {
                 my $id = $self->{file} . "#$pref_name# $element";
                 my $text = $self->get_trans_text( $id );
                 $p->[$i] = $text if $text;
@@ -189,6 +189,8 @@ sub get_po_from_prefs {
     for my $file ( @{$self->{pref_files}} ) {
         my $pref = LoadFile( $self->{path_pref_en} . "/$file" );
         $self->{file} = $file;
+        # Entries for tab titles
+        $self->po_append( $self->{file}, $_ ) for keys %$pref;
         while ( my ($tab, $tab_content) = each %$pref ) {
             if ( ref($tab_content) eq 'ARRAY' ) {
                 $self->add_prefs( $tab, $tab_content );
@@ -254,6 +256,13 @@ sub install_prefs {
     for my $file ( @{$self->{pref_files}} ) {
         my $pref = LoadFile( $self->{path_pref_en} . "/$file" );
         $self->{file} = $file;
+        # First, keys are replaced (tab titles)
+        $pref = do {
+            my %pref = map { 
+                $self->get_trans_text( $self->{file} ) || $_ => $pref->{$_}
+            } keys %$pref;
+            \%pref;
+        };
         while ( my ($tab, $tab_content) = each %$pref ) {
             if ( ref($tab_content) eq 'ARRAY' ) {
                 $self->update_tab_prefs( $pref, $tab_content );
index d3ffecc..e022497 100755 (executable)
@@ -61,7 +61,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
         template_name   => "opac-ISBDdetail.tmpl",
         query           => $query,
         type            => "opac",
-        authnotrequired => 1,
+        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
         debug           => 1,
     }
 );
index 1a9dc34..fd909f5 100755 (executable)
@@ -71,7 +71,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
         template_name   => "opac-MARCdetail.tmpl",
         query           => $query,
         type            => "opac",
-        authnotrequired => 1,
+        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
         debug           => 1,
     }
 );
index 8cbd239..b1bf224 100755 (executable)
@@ -59,7 +59,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
         template_name   => "opac-addbybiblionumber.tmpl",
         query           => $query,
         type            => "opac",
-        authnotrequired => 1,
+        authnotrequired =>( C4::Context->preference("OpacPublic") ? 1 : 0 ),
     }
 );
 
index c899b4b..7a95750 100755 (executable)
@@ -46,7 +46,7 @@ my $biblionumber = $query->param('biblionumber');
         template_name   => "opac-alert-subscribe.tmpl",
         query           => $query,
         type            => "opac",
-        authnotrequired => 1,
+        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
         debug           => 1,
     }
 );
index 292d0a8..a87030e 100755 (executable)
@@ -152,7 +152,7 @@ else {
             template_name   => "opac-authorities-home.tmpl",
             query           => $query,
             type            => 'opac',
-            authnotrequired => 1,
+            authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
             debug           => 1,
         }
     );
index 71f746e..7e06310 100755 (executable)
@@ -62,7 +62,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
         template_name   => "opac-authoritiesdetail.tmpl",
         query           => $query,
         type            => "opac",
-        authnotrequired => 1,
+        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
         debug           => 1,
     }
 );
index c453c87..2ec664d 100755 (executable)
@@ -32,7 +32,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user (
         template_name   => "opac-basket.tmpl",
         query           => $query,
         type            => "opac",
-        authnotrequired => 1,
+        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
         flagsrequired   => { borrow => 1 },
     }
 );
index 4fe5f50..0e9a632 100755 (executable)
@@ -44,7 +44,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
         template_name   => "opac-browser.tmpl",
         query           => $query,
         type            => "opac",
-        authnotrequired => 1,
+        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
         debug           => 1,
     }
 );
index 03bd8a4..93edc15 100755 (executable)
@@ -39,6 +39,7 @@ use C4::Review;
 use C4::Members;
 use C4::VirtualShelves;
 use C4::XSLT;
+use C4::ShelfBrowser;
 
 BEGIN {
        if (C4::Context->preference('BakerTaylorEnabled')) {
@@ -53,7 +54,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
         template_name   => "opac-detail.tmpl",
         query           => $query,
         type            => "opac",
-        authnotrequired => 1,
+        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
         flagsrequired   => { borrow => 1 },
     }
 );
@@ -210,7 +211,6 @@ my $subtitle         = GetRecordValue('subtitle', $record, GetFrameworkCode($bib
                      MARCAUTHORS             => $marcauthorsarray,
                      MARCSERIES              => $marcseriesarray,
                      MARCURLS                => $marcurlsarray,
-                     MARCISBNS               => $marcisbnsarray,
                      norequests              => $norequests,
                      RequestOnOpac           => C4::Context->preference("RequestOnOpac"),
                      itemdata_ccode          => $itemfields{ccode},
@@ -446,111 +446,23 @@ if ( C4::Context->preference("Babeltheque") ) {
 if (C4::Context->preference("OPACShelfBrowser")) {
     # pick the first itemnumber unless one was selected by the user
     my $starting_itemnumber = $query->param('shelfbrowse_itemnumber'); # || $items[0]->{itemnumber};
-    $template->param( OpenOPACShelfBrowser => 1) if $starting_itemnumber;
-    # find the right cn_sort value for this item
-    my ($starting_cn_sort, $starting_homebranch, $starting_location);
-    my $sth_get_cn_sort = $dbh->prepare("SELECT cn_sort,homebranch,location from items where itemnumber=?");
-    $sth_get_cn_sort->execute($starting_itemnumber);
-    while (my $result = $sth_get_cn_sort->fetchrow_hashref()) {
-        $starting_cn_sort = $result->{'cn_sort'};
-        $starting_homebranch->{code} = $result->{'homebranch'};
-        $starting_homebranch->{description} = $branches->{$result->{'homebranch'}}{branchname};
-        $starting_location->{code} = $result->{'location'};
-        $starting_location->{description} = GetAuthorisedValueDesc('','',   $result->{'location'} ,'','','LOC', 'opac');
-    
-    }
-    
-    ## List of Previous Items
-    # order by cn_sort, which should include everything we need for ordering purposes (though not
-    # for limits, those need to be handled separately
-    my $sth_shelfbrowse_previous;
-    if (defined $starting_location->{code}) {
-      $sth_shelfbrowse_previous = $dbh->prepare("
-        SELECT *
-        FROM items
-        WHERE
-            ((cn_sort = ? AND itemnumber < ?) OR cn_sort < ?) AND
-            homebranch = ? AND location = ?
-        ORDER BY cn_sort DESC, itemnumber LIMIT 3
-        ");
-      $sth_shelfbrowse_previous->execute($starting_cn_sort, $starting_itemnumber, $starting_cn_sort, $starting_homebranch->{code}, $starting_location->{code});
-    } else {
-      $sth_shelfbrowse_previous = $dbh->prepare("
-        SELECT *
-        FROM items
-        WHERE
-            ((cn_sort = ? AND itemnumber < ?) OR cn_sort < ?) AND
-            homebranch = ?
-        ORDER BY cn_sort DESC, itemnumber LIMIT 3
-        ");
-      $sth_shelfbrowse_previous->execute($starting_cn_sort, $starting_itemnumber, $starting_cn_sort, $starting_homebranch->{code});
-    }
-    my @previous_items;
-    while (my $this_item = $sth_shelfbrowse_previous->fetchrow_hashref()) {
-        my $sth_get_biblio = $dbh->prepare("SELECT biblio.*,biblioitems.isbn AS isbn FROM biblio LEFT JOIN biblioitems ON biblio.biblionumber=biblioitems.biblionumber WHERE biblio.biblionumber=?");
-        $sth_get_biblio->execute($this_item->{biblionumber});
-        while (my $this_biblio = $sth_get_biblio->fetchrow_hashref()) {
-                       $this_item->{'title'} = $this_biblio->{'title'};
-                       my $this_record = GetMarcBiblio($this_biblio->{'biblionumber'});
-                       $this_item->{'browser_normalized_upc'} = GetNormalizedUPC($this_record,$marcflavour);
-                       $this_item->{'browser_normalized_oclc'} = GetNormalizedOCLCNumber($this_record,$marcflavour);
-                       $this_item->{'browser_normalized_isbn'} = GetNormalizedISBN(undef,$this_record,$marcflavour);
-        }
-        unshift @previous_items, $this_item;
-    }
-    
-    ## List of Next Items; this also intentionally catches the current item
-    my $sth_shelfbrowse_next;
-    if (defined $starting_location->{code}) {
-      $sth_shelfbrowse_next = $dbh->prepare("
-        SELECT *
-        FROM items
-        WHERE
-            ((cn_sort = ? AND itemnumber >= ?) OR cn_sort > ?) AND
-            homebranch = ? AND location = ?
-        ORDER BY cn_sort, itemnumber LIMIT 3
-        ");
-      $sth_shelfbrowse_next->execute($starting_cn_sort, $starting_itemnumber, $starting_cn_sort, $starting_homebranch->{code}, $starting_location->{code});
-    } else {
-      $sth_shelfbrowse_next = $dbh->prepare("
-        SELECT *
-        FROM items
-        WHERE
-            ((cn_sort = ? AND itemnumber >= ?) OR cn_sort > ?) AND
-            homebranch = ?
-        ORDER BY cn_sort, itemnumber LIMIT 3
-        ");
-      $sth_shelfbrowse_next->execute($starting_cn_sort, $starting_itemnumber, $starting_cn_sort, $starting_homebranch->{code});
-    }
-    my @next_items;
-    while (my $this_item = $sth_shelfbrowse_next->fetchrow_hashref()) {
-        my $sth_get_biblio = $dbh->prepare("SELECT biblio.*,biblioitems.isbn AS isbn FROM biblio LEFT JOIN biblioitems ON biblio.biblionumber=biblioitems.biblionumber WHERE biblio.biblionumber=?");
-        $sth_get_biblio->execute($this_item->{biblionumber});
-        while (my $this_biblio = $sth_get_biblio->fetchrow_hashref()) {
-            $this_item->{'title'} = $this_biblio->{'title'};
-                       my $this_record = GetMarcBiblio($this_biblio->{'biblionumber'});
-            $this_item->{'browser_normalized_upc'} = GetNormalizedUPC($this_record,$marcflavour);
-            $this_item->{'browser_normalized_oclc'} = GetNormalizedOCLCNumber($this_record,$marcflavour);
-            $this_item->{'browser_normalized_isbn'} = GetNormalizedISBN(undef,$this_record,$marcflavour);
-        }
-        push @next_items, $this_item;
+    if (defined($starting_itemnumber)) {
+        $template->param( OpenOPACShelfBrowser => 1) if $starting_itemnumber;
+        my $nearby = GetNearbyItems($starting_itemnumber,3);
+
+        $template->param(
+            starting_homebranch => $nearby->{starting_homebranch}->{description},
+            starting_location => $nearby->{starting_location}->{description},
+            starting_ccode => $nearby->{starting_ccode}->{description},
+            starting_itemnumber => $nearby->{starting_itemnumber},
+            shelfbrowser_prev_itemnumber => $nearby->{prev_itemnumber},
+            shelfbrowser_next_itemnumber => $nearby->{next_itemnumber},
+            shelfbrowser_prev_biblionumber => $nearby->{prev_biblionumber},
+            shelfbrowser_next_biblionumber => $nearby->{next_biblionumber},
+            PREVIOUS_SHELF_BROWSE => $nearby->{prev},
+            NEXT_SHELF_BROWSE => $nearby->{next},
+        );
     }
-    
-    # alas, these won't auto-vivify, see http://www.perlmonks.org/?node_id=508481
-    my $shelfbrowser_next_itemnumber = $next_items[-1]->{itemnumber} if @next_items;
-    my $shelfbrowser_next_biblionumber = $next_items[-1]->{biblionumber} if @next_items;
-    
-    $template->param(
-        starting_homebranch => $starting_homebranch->{description},
-        starting_location => $starting_location->{description},
-        starting_itemnumber => $starting_itemnumber,
-        shelfbrowser_prev_itemnumber => (@previous_items ? $previous_items[0]->{itemnumber} : 0),
-        shelfbrowser_next_itemnumber => $shelfbrowser_next_itemnumber,
-        shelfbrowser_prev_biblionumber => (@previous_items ? $previous_items[0]->{biblionumber} : 0),
-        shelfbrowser_next_biblionumber => $shelfbrowser_next_biblionumber,
-        PREVIOUS_SHELF_BROWSE => \@previous_items,
-        NEXT_SHELF_BROWSE => \@next_items,
-    );
 }
 
 if (C4::Context->preference("BakerTaylorEnabled")) {
index e0a65a9..177d812 100755 (executable)
@@ -36,7 +36,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
         template_name   => "opac-main.tmpl",
         type            => "opac",
         query           => $input,
-        authnotrequired => 1,
+        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
         flagsrequired   => { borrow => 1 },
     }
 );
diff --git a/opac/opac-privacy.pl b/opac/opac-privacy.pl
new file mode 100755 (executable)
index 0000000..ca50560
--- /dev/null
@@ -0,0 +1,68 @@
+#!/usr/bin/perl
+# This script lets the users change their privacy rules
+#
+# copyright 2009, BibLibre, paul.poulain@biblibre.com
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use CGI;
+
+use C4::Auth;    # checkauth, getborrowernumber.
+use C4::Context;
+use C4::Circulation;
+use C4::Members;
+use C4::Output;
+use C4::Dates;
+
+my $query = new CGI;
+my $dbh   = C4::Context->dbh;
+
+my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
+    {
+        template_name   => "opac-privacy.tmpl",
+        query           => $query,
+        type            => "opac",
+        authnotrequired => 0,
+        flagsrequired   => { borrow => 1 },
+        debug           => 1,
+    }
+);
+
+my $op = $query->param("op");
+my $privacy = $query->param("privacy");
+
+if ($op eq "update_privacy")
+{
+    ModPrivacy($borrowernumber,$privacy);
+    $template->param('privacy_updated' => 1);
+}
+if ($op eq "delete_record") {
+    # delete all reading records for items returned
+    # uses a hardcoded date ridiculously far in the future
+    AnonymiseIssueHistory('2999-12-12',$borrowernumber);
+    # confirm the user the deletion has been done
+    $template->param('deleted' => 1);
+}
+# get borrower privacy ....
+my ( $borr ) = GetMemberDetails( $borrowernumber );
+
+$template->param( 'Ask_data'       => '1',
+                    'privacy'.$borr->{'privacy'} => 1,
+                    'firstname' => $borr->{'firstname'},
+                    'surname' => $borr->{'surname'},
+                    'privacyview' => 1,
+);
+
+output_html_with_http_headers $query, $cookie, $template->output;
index 205f48a..a84be25 100755 (executable)
@@ -2,7 +2,24 @@
 
 #written 18/1/2000 by chris@katipo.co.nz
 # adapted for use in the hlt opac by finlay@katipo.co.nz 29/11/2002
-#script to renew items from the web
+# script to renew items from the web
+# Parts Copyright 2010 Catalyst IT
+
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
 
 use strict;
 use warnings;
@@ -27,15 +44,16 @@ my @items          = $query->param('item');
 $borrowernumber = $query->param('borrowernumber') || $query->param('bornum');
 my $opacrenew = C4::Context->preference("OpacRenewalAllowed");
 
+my $errorstring='';
 for my $itemnumber ( @items ) {
     my ($status,$error) = CanBookBeRenewed( $borrowernumber, $itemnumber );
     if ( $status == 1 && $opacrenew == 1 ) {
         AddRenewal( $borrowernumber, $itemnumber );
     }
+    else {
+       $errorstring .= $error ."|";
+    }
 }
-# FIXME: else return ERROR to user!!
 
-if ( $query->param('from') eq 'opac_user' ) {
-    print $query->redirect("/cgi-bin/koha/opac-user.pl");
-} 
-# FIXME: ELSE WHAT?  No response at all.  Not very robust.
+print $query->redirect("/cgi-bin/koha/opac-user.pl?renew_error=$errorstring");
+
index fca1e0b..f4181d6 100755 (executable)
@@ -291,7 +291,7 @@ my $numBibsAvailable = 0;
 my $itemdata_enumchron = 0;
 my $anyholdable;
 my $itemLevelTypes = C4::Context->preference('item-level_itypes');
-$template->param('item-level_itypes' => $itemLevelTypes);
+$template->param('item_level_itypes' => $itemLevelTypes);
 
 foreach my $biblioNum (@biblionumbers) {
 
index 7b43c21..16ed56a 100755 (executable)
@@ -36,7 +36,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
         template_name   => "opac-review.tmpl",
         query           => $query,
         type            => "opac",
-        authnotrequired => 1,
+        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
     }
 );
 
index 45cb766..0f52650 100755 (executable)
@@ -80,7 +80,7 @@ else {
     template_name => $template_name,
     query => $cgi,
     type => "opac",
-    authnotrequired => 1,
+    authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
     }
 );
 
index 76400a5..6213965 100755 (executable)
@@ -38,7 +38,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user (
         template_name   => "opac-sendbasketform.tmpl",
         query           => $query,
         type            => "opac",
-        authnotrequired => 0,
+        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
         flagsrequired   => { borrow => 1 },
     }
 );
index abfcc8b..f1b7f96 100755 (executable)
@@ -29,7 +29,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
         template_name   => "opac-shelves.tmpl",
         query           => $query,
         type            => "opac",
-        authnotrequired => 1,
+        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
     });
 $template->param(listsview => 1);
 # if $loggedinuser is not defined, set it to -1, which should
index 2e0be75..4475512 100755 (executable)
@@ -48,7 +48,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
         template_name   => "opac-showmarc.tmpl",
         query           => $input,
         type            => "opac",
-        authnotrequired => 1,
+        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
         debug           => 1,
 });
 
index 19693b0..c254d26 100755 (executable)
@@ -52,7 +52,7 @@ my ( $template, $borrowernumber, $cookie ) = &get_template_and_user(
         template_name   => $template_name,
         query           => $query,
         type            => "opac",
-        authnotrequired => 1,
+        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
     }
 );
 
index 75d0791..2f0dc36 100755 (executable)
@@ -44,11 +44,11 @@ if ( C4::Context->preference("AnonSuggestions") ) {
             template_name   => "opac-suggestions.tmpl",
             query           => $input,
             type            => "opac",
-            authnotrequired => 1,
+            authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
         }
     );
     if ( !$$suggestion{suggestedby} ) {
-        $$suggestion{suggestedby} = C4::Context->preference("AnonSuggestions");
+        $$suggestion{suggestedby} = C4::Context->preference("AnonymousPatron");
     }
 }
 else {
index 0e3c264..a19f406 100755 (executable)
@@ -44,7 +44,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
         template_name   => "opac-tags_subject.tmpl",
         query           => $query,
         type            => "opac",
-        authnotrequired => 1,
+        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
         debug           => 1,
     }
 );
index 70b712e..80e7c35 100755 (executable)
@@ -46,7 +46,7 @@ my ($template, $borrowernumber, $cookie)
        = get_template_and_user({template_name => 'opac-topissues.tmpl',
                                query => $input,
                                type => "opac",
-                               authnotrequired => 1,
+               authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
                                debug => 1,
                                });
 my $dbh = C4::Context->dbh;
@@ -55,27 +55,52 @@ my $limit = $input->param('limit') || 10;
 my $branch = $input->param('branch') || '';
 my $itemtype = $input->param('itemtype') || '';
 my $timeLimit = $input->param('timeLimit') || 3;
+my $advanced_search_types = C4::Context->preference('AdvancedSearchTypes');
+
 my $whereclause = '';
-$whereclause .= 'items.homebranch='.$dbh->quote($branch)." AND " if ($branch);
-$whereclause .= 'biblioitems.itemtype='.$dbh->quote($itemtype)." AND " if $itemtype;
-$whereclause .= ' TO_DAYS(NOW()) - TO_DAYS(biblio.datecreated) <= '.($timeLimit*30).' AND ' if $timeLimit < 999;
+$whereclause .= ' AND items.homebranch='.$dbh->quote($branch) if ($branch);
+$whereclause .= ' AND TO_DAYS(NOW()) - TO_DAYS(biblio.datecreated) <= '.($timeLimit*30) if $timeLimit < 999;
 $whereclause =~ s/ AND $// if $whereclause;
-$whereclause = " WHERE ".$whereclause if $whereclause;
-
-my $query = "SELECT datecreated, biblio.biblionumber, title, 
-                author, sum( items.issues ) AS tot, biblioitems.itemtype,
-                biblioitems.publishercode,biblioitems.publicationyear,
-                itemtypes.description
-                FROM biblio
-                LEFT JOIN items USING (biblionumber)
-                LEFT JOIN biblioitems USING (biblionumber)
-                LEFT JOIN itemtypes ON itemtypes.itemtype = biblioitems.itemtype
-                $whereclause
-                GROUP BY biblio.biblionumber
-                HAVING tot >0
-                ORDER BY tot DESC
-                LIMIT $limit
-                ";
+my $query;
+
+if($advanced_search_types eq 'ccode'){
+    $whereclause .= ' AND authorised_values.authorised_value='.$dbh->quote($itemtype) if $itemtype;
+    $query = "SELECT datecreated, biblio.biblionumber, title,
+                    author, sum( items.issues ) AS tot, biblioitems.itemtype,
+                    biblioitems.publishercode,biblioitems.publicationyear,
+                    authorised_values.lib as description
+                    FROM biblio
+                    LEFT JOIN items USING (biblionumber)
+                    LEFT JOIN biblioitems USING (biblionumber)
+                    LEFT JOIN authorised_values ON items.ccode = authorised_values.authorised_value
+                    WHERE 1
+                    $whereclause
+                    AND authorised_values.category = 'ccode' 
+                    GROUP BY biblio.biblionumber
+                    HAVING tot >0
+                    ORDER BY tot DESC
+                    LIMIT $limit
+                    ";
+    $template->param(ccodesearch => 1);
+}else{
+    $whereclause .= ' AND biblioitems.itemtype='.$dbh->quote($itemtype) if $itemtype;
+    $query = "SELECT datecreated, biblio.biblionumber, title,
+                    author, sum( items.issues ) AS tot, biblioitems.itemtype,
+                    biblioitems.publishercode,biblioitems.publicationyear,
+                    itemtypes.description
+                    FROM biblio
+                    LEFT JOIN items USING (biblionumber)
+                    LEFT JOIN biblioitems USING (biblionumber)
+                    LEFT JOIN itemtypes ON itemtypes.itemtype = biblioitems.itemtype
+                    WHERE 1
+                    $whereclause
+                    GROUP BY biblio.biblionumber
+                    HAVING tot >0
+                    ORDER BY tot DESC
+                    LIMIT $limit
+                    ";
+     $template->param(itemtypesearch => 1);
+}
 
 my $sth = $dbh->prepare($query);
 $sth->execute();
@@ -98,20 +123,34 @@ $template->param(do_it => 1,
 
 $template->param( branchloop => GetBranchesLoop(C4::Context->userenv->{'branch'}));
 
-#doctype
+# the index parameter is different for item-level itemtypes
+my $itype_or_itemtype = (C4::Context->preference("item-level_itypes"))?'itype':'itemtype';
 $itemtypes = GetItemTypes;
-my @itemtypeloop;
-foreach my $thisitemtype (sort {$itemtypes->{$a}->{'description'} cmp $itemtypes->{$b}->{'description'}} keys %$itemtypes) {
+my @itemtypesloop;
+my $selected=1;
+if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') {
+        foreach my $thisitemtype ( sort {$itemtypes->{$a}->{'description'} cmp $itemtypes->{$b}->{'description'} } keys %$itemtypes ) {
         my $selected = 1 if $thisitemtype eq $itemtype;
-        my %row =(value => $thisitemtype,
-                    description => $itemtypes->{$thisitemtype}->{'description'},
-                    selected => $selected,
-                 );
-        push @itemtypeloop, \%row;
+        my %row =( value => $thisitemtype,
+                   description => $itemtypes->{$thisitemtype}->{'description'},
+                   selected => $selected,
+            );
+        push @itemtypesloop, \%row;
+        }
+} else {
+    my $advsearchtypes = GetAuthorisedValues($advanced_search_types, '', 'opac');
+        for my $thisitemtype (@$advsearchtypes) {
+                my $selected = 1 if $thisitemtype->{authorised_value} eq $itemtype;
+                my %row =( value => $thisitemtype->{authorised_value},
+                selected => $selected,
+                description => $thisitemtype->{'lib'},
+            );
+                push @itemtypesloop, \%row;
+        }
 }
 
 $template->param(
-                 itemtypeloop =>\@itemtypeloop,
+                 itemtypeloop =>\@itemtypesloop,
                  dateformat    => C4::Context->preference("dateformat"),
                 );
 output_html_with_http_headers $input, $cookie, $template->output;
index 18cafdb..2e8fb5e 100755 (executable)
@@ -40,7 +40,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
         template_name   => "opac-userupdate.tmpl",
         query           => $query,
         type            => "opac",
-        authnotrequired => 0,
+        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
         flagsrequired   => { borrow => 1 },
         debug           => 1,
     }
index 10e18e0..8c7c32b 100755 (executable)
@@ -49,6 +49,7 @@ my $biblionumber = $query->param('biblionumber');
 my @subscriptionid = $query->param('subscriptionid');
 
 @subscriptionid= uniq @subscriptionid;
+@subscriptionid= sort @subscriptionid;
 my $subscriptiondescs;
 my $subscriptions;
 
index 58936be..fbf9ad5 100755 (executable)
@@ -92,19 +92,18 @@ my @errseq;
 
 # If user comes from subscription details
 unless (@serialids) {
-    foreach my $subscriptionid (@subscriptionids) {
-        my $serstatus = $query->param('serstatus');
-        if ($serstatus) {
+    my $serstatus = $query->param('serstatus');
+    if ($serstatus) {
+        foreach my $subscriptionid (@subscriptionids) {
             my @tmpser = GetSerials2( $subscriptionid, $serstatus );
-            foreach (@tmpser) {
-                push @serialids, $_->{'serialid'};
-            }
+            push @serialids, map { $_->{serialid} } @tmpser;
         }
     }
 }
 
-unless ( scalar(@serialids) ) {
-    my $string = "serials-collection.pl?subscriptionid=" . join( ",", uniq @subscriptionids );
+unless ( @serialids ) {
+    my $string =
+      'serials-collection.pl?subscriptionid=' . join ',', uniq @subscriptionids;
     $string =~ s/,$//;
 
     print $query->redirect($string);
@@ -112,12 +111,12 @@ unless ( scalar(@serialids) ) {
 
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     {
-       template_name   => "serials/serials-edit.tmpl",
-       query           => $query,
-       type            => "intranet",
-       authnotrequired => 0,
-       flagsrequired   => {serials => 'receive_serials'},
-       debug           => 1,
+        template_name   => 'serials/serials-edit.tmpl',
+        query           => $query,
+        type            => 'intranet',
+        authnotrequired => 0,
+        flagsrequired   => { serials => 1 },
+        debug           => 1,
     }
 );
 
@@ -125,36 +124,37 @@ my @serialdatalist;
 my %processedserialid;
 
 my $today = C4::Dates->new();
-foreach my $tmpserialid (@serialids) {
+foreach my $serialid (@serialids) {
 
     #filtering serialid for duplication
     #NEW serial should appear only once and are created afterwards
-    if (   defined($tmpserialid)
-        && $tmpserialid =~ /^[0-9]+$/
-        && !$processedserialid{$tmpserialid} )
+    if (   $serialid
+        && $serialid =~ /^[0-9]+$/
+        && !$processedserialid{$serialid} )
     {
-        my $data = GetSerialInformation($tmpserialid);
-        for my $datefield ( qw( publisheddate planneddate) ) {
-            if ($data->{$datefield} && $data->{$datefield}!~m/^00/) {
-                $data->{$datefield} = format_date( $data->{$datefield} );
+        my $serinfo = GetSerialInformation($serialid); #TODO duplicates work done by GetSerials2 above
+        for my $d ( qw( publisheddate planneddate )){
+            if ( $serinfo->{$d} =~m/^00/ ) {
+                $serinfo->{$d} = q{};
             }
             else {
-                $data->{$datefield} = q{};
+                $serinfo->{$d} = format_date( $serinfo->{$d} );
             }
         }
-        $data->{arriveddate}=$today->output('syspref');
-        $data->{'editdisable'} = (
+        $serinfo->{arriveddate}=$today->output('syspref');
+
+        $serinfo->{'editdisable'} = (
             (
-                HasSubscriptionExpired( $data->{subscriptionid} ) == 1
-                  && $data->{'status1'}
+                HasSubscriptionExpired( $serinfo->{subscriptionid} )
+                && $serinfo->{'status1'}
             )
-              || $data->{'cannotedit'}
+            || $serinfo->{'cannotedit'}
         );
-        push @serialdatalist, $data;
-        $processedserialid{$tmpserialid} = 1;
+        push @serialdatalist, $serinfo;
+        $processedserialid{$serialid} = 1;
     }
 }
-my $bibdata = GetBiblioData( $serialdatalist[0]->{'biblionumber'} );
+my $biblio = GetBiblioData( $serialdatalist[0]->{'biblionumber'} );
 
 my @newserialloop;
 my @subscriptionloop;
@@ -164,8 +164,7 @@ my %processedsubscriptionid;
 foreach my $subscriptionid (@subscriptionids) {
 
     #Do not process subscriptionid twice if it was already processed.
-    if ( defined($subscriptionid)
-        && !$processedsubscriptionid{$subscriptionid} )
+    if ( $subscriptionid && !$processedsubscriptionid{$subscriptionid} )
     {
         my $cell;
         if ( $serialdatalist[0]->{'serialsadditems'} ) {
@@ -177,8 +176,8 @@ foreach my $subscriptionid (@subscriptionids) {
             $cell->{serialsadditems} = 1;
         }
         $cell->{'subscriptionid'} = $subscriptionid;
-        $cell->{'itemid'}         = "NNEW";
-        $cell->{'serialid'}       = "NEW";
+        $cell->{'itemid'}         = 'NNEW';
+        $cell->{'serialid'}       = 'NEW';
         $cell->{'issuesatonce'}   = 1;
         $cell->{arriveddate}=$today->output('syspref');
 
@@ -199,8 +198,16 @@ if ( $op and $op eq 'serialchangestatus' ) {
 
     my $newserial;
     for ( my $i = 0 ; $i <= $#serialids ; $i++ ) {
+        my ($plan_date, $pub_date);
+
+        if (defined $planneddates[$i] && $planneddates[$i] ne 'XXX') {
+            $plan_date = format_date_in_iso( $planneddates[$i] );
+        }
+        if (defined $publisheddates[$i] && $publisheddates[$i] ne 'XXX') {
+            $pub_date = format_date_in_iso( $publisheddates[$i] );
+        }
 
-        if ( $serialids[$i] && $serialids[$i] eq "NEW" ) {
+        if ( $serialids[$i] && $serialids[$i] eq 'NEW' ) {
             if ( $serialseqs[$i] ) {
 
             #IF newserial was provided a name Then we have to create a newSerial
@@ -210,8 +217,8 @@ if ( $op and $op eq 'serialchangestatus' ) {
                     $subscriptionids[0],
                     $serialdatalist[0]->{'biblionumber'},
                     $status[$i],
-                    format_date_in_iso( $planneddates[$i] ),
-                    format_date_in_iso( $publisheddates[$i] ),
+                    $plan_date,
+                    $pub_date,
                     $notes[$i]
                 );
             }
@@ -220,8 +227,8 @@ if ( $op and $op eq 'serialchangestatus' ) {
             ModSerialStatus(
                 $serialids[$i],
                 $serialseqs[$i],
-                format_date_in_iso( $planneddates[$i] ),
-                format_date_in_iso( $publisheddates[$i] ),
+                $plan_date,
+                $pub_date,
                 $status[$i],
                 $notes[$i]
             );
@@ -300,14 +307,14 @@ if ( $op and $op eq 'serialchangestatus' ) {
                             $serialdatalist[0]->{'biblionumber'}
                         )
                       );
-                    if ( C4::Context->preference("autoBarcode") eq
+                    if ( C4::Context->preference('autoBarcode') eq
                         'incremental' )
                     {
                         if ( !$bib_record->field($barcodetagfield)
                             ->subfield($barcodetagsubfield) )
                         {
                             my $sth_barcode = $dbh->prepare(
-                                "select max(abs(barcode)) from items");
+                                'select max(abs(barcode)) from items');
                             $sth_barcode->execute;
                             my ($newbarcode) = $sth_barcode->fetchrow;
 
@@ -365,8 +372,8 @@ if ( $op and $op eq 'serialchangestatus' ) {
         }
     }
     else {
-        my $redirect = "serials-collection.pl?";
-        $redirect .= join( '&', map { "subscriptionid=" . $_ } sort @subscriptionids );# ID The sort necessary
+        my $redirect = 'serials-collection.pl?';
+        $redirect .= join( '&', map { 'subscriptionid=' . $_ } @subscriptionids );
         print $query->redirect($redirect);
     }
 }
@@ -380,7 +387,7 @@ my $default_bib_view = get_default_view();
 $template->param(
     serialsadditems => $serialdatalist[0]->{'serialsadditems'},
     callnumber      => $serialdatalist[0]->{'callnumber'},
-    bibliotitle     => $bibdata->{'title'},
+    bibliotitle     => $biblio->{'title'},
     biblionumber    => $serialdatalist[0]->{'biblionumber'},
     serialslist     => \@serialdatalist,
     default_bib_view => $default_bib_view,
index b5c7181..fa8181f 100644 (file)
@@ -13,12 +13,23 @@ find({
     wanted => sub {
         my $m = $_;
            return unless $m =~ s/[.]pm$//;
+           $m =~ s{^.*/C4/}{C4/};      
+           $m =~ s{/}{::}g;
            return if $m =~ /Auth_with_ldap/; # Dont test this, it will fail on use
            return if $m =~ /Cache/; # Cache modules are a WIP, add the tests back when we are using them more
            return if $m =~ /SIP/; # SIP modules will not load clean
-           $m =~ s{^.*/C4/}{C4/};      
-           $m =~ s{/}{::}g;
-           use_ok($m) || BAIL_OUT("***** PROBLEMS LOADING FILE '$m'");
+           return if $m =~ /C4::VirtualShelves$/; # Requires a DB
+           return if $m =~ /C4::Auth$/; # DB
+           return if $m =~ /C4::Tags$/; # DB
+           return if $m =~ /C4::Service/; # DB
+           return if $m =~ /C4::Auth_with_cas/; # DB
+           return if $m =~ /C4::BackgroundJob/; # DB
+           return if $m =~ /C4::UploadedFile/; # DB
+           return if $m =~ /C4::Record/; # DB
+           return if $m =~ /C4::Reports::Guided/; # DB
+           return if $m =~ /C4::Serials/; # DB
+           return if $m =~ /C4::VirtualShelves::Page/; # DB
+        use_ok($m) || BAIL_OUT("***** PROBLEMS LOADING FILE '$m'");
     },
 }, $lib);
 done_testing();
diff --git a/t/Amazon.t b/t/Amazon.t
deleted file mode 100755 (executable)
index a0ca21b..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/perl
-#
-# This Koha test module is a stub!  
-# Add more tests here!!!
-
-use strict;
-use warnings;
-
-use Test::More tests => 1;
-
-BEGIN {
-        use_ok('C4::External::Amazon');
-}
-
diff --git a/t/Auth_with_cas.t b/t/Auth_with_cas.t
deleted file mode 100755 (executable)
index 77dd21f..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/perl
-#
-# This Koha test module is a stub!  
-# Add more tests here!!!
-
-use strict;
-use warnings;
-
-use Test::More tests => 1;
-
-BEGIN {
-        use_ok('C4::Auth_with_cas');
-}
-
diff --git a/t/Biblio.t b/t/Biblio.t
deleted file mode 100755 (executable)
index c186058..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/perl
-#
-# This Koha test module is a stub!  
-# Add more tests here!!!
-
-use strict;
-use warnings;
-
-use Test::More tests => 1;
-
-BEGIN {
-        use_ok('C4::Biblio');
-}
-
index 967229c..54ef5c6 100755 (executable)
--- a/t/Debug.t
+++ b/t/Debug.t
@@ -3,11 +3,13 @@
 use strict;
 use warnings;
 
-use Test::More tests => 3;
+use Test::More tests => 5;
 
 use vars qw($debug $cgi_debug);
 
 BEGIN {
+$ENV{'KOHA_CGI_DEBUG'}='2';
+$ENV{'KOHA_DEBUG'}='5';
        diag "BEFORE use:     \$debug is " . (defined     $debug ?     $debug : 'not defined');
        diag "BEFORE use: \$cgi_debug is " . (defined $cgi_debug ? $cgi_debug : 'not defined');
        use_ok('C4::Debug');
@@ -17,5 +19,7 @@ diag " AFTER use:     \$debug is " . (defined     $debug ?     $debug : 'not def
 diag " AFTER use: \$cgi_debug is " . (defined $cgi_debug ? $cgi_debug : 'not defined');
 ok(defined     $debug, "    \$debug defined and imported.");
 ok(defined $cgi_debug, "\$cgi_debug defined and imported.");
+is($cgi_debug,2,"cgi_debug gets the ENV{'KOHA_CGI_DEBUG'}");
+is($debug,5,"debug gets the ENV{'KOHA_DEBUG'}");
 
 diag "Done.";
diff --git a/t/External_BakerTaylor.t b/t/External_BakerTaylor.t
deleted file mode 100755 (executable)
index fdccaee..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/perl
-#
-# This Koha test module is a stub!  
-# Add more tests here!!!
-
-use strict;
-use warnings;
-
-use Test::More tests => 1;
-
-BEGIN {
-        use_ok('C4::External::BakerTaylor');
-}
-
index be5a838..025ab98 100755 (executable)
--- a/t/Koha.t
+++ b/t/Koha.t
@@ -11,6 +11,10 @@ use_ok('C4::Koha');
 #
 my $date = "01/01/2002";
 my $newdate = &slashifyDate("2002-01-01");
+my $isbn13 = "9780330356473";
+my $isbn13D = "978-0-330-35647-3";
+my $isbn10 = "033035647X";
+my $isbn10D = "0-330-35647-X";
 
 ok($date eq $newdate, 'slashifyDate');
 
@@ -23,3 +27,5 @@ is($str, q{'"&<>'}, '... and does not change input in place');
 is(C4::Koha::_isbn_cleanup('0-590-35340-3'), '0590353403', '_isbn_cleanup removes hyphens');
 is(C4::Koha::_isbn_cleanup('0590353403 (pbk.)'), '0590353403', '_isbn_cleanup removes parenthetical');
 is(C4::Koha::_isbn_cleanup('978-0-321-49694-2'), '0321496949', '_isbn_cleanup converts ISBN-13 to ISBN-10');
+
+
diff --git a/t/Members.t b/t/Members.t
deleted file mode 100755 (executable)
index bbcfc95..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/perl
-#
-# This Koha test module is a stub!  
-# Add more tests here!!!
-
-use strict;
-use warnings;
-
-use Test::More tests => 1;
-
-BEGIN {
-        use_ok('C4::Members');
-}
-
index 2ee22fe..1d0cf35 100755 (executable)
@@ -6,9 +6,25 @@
 use strict;
 use warnings;
 
-use Test::More tests => 1;
+use Test::More tests => 8;
 
 BEGIN {
         use_ok('C4::Output::JSONStream');
 }
 
+my $json = new C4::Output::JSONStream;
+is($json->output,'{}',"Making sure JSON output is blank just after its created.");
+$json->param( issues => [ 'yes!', 'please', 'no' ] );
+is($json->output,'{"issues":["yes!","please","no"]}',"Making sure JSON output has added what we told it to.");
+$json->param( stuff => ['realia'] );
+is($json->output,'{"issues":["yes!","please","no"],"stuff":["realia"]}',"Making sure JSON output has added more params correctly.");
+$json->param( stuff => ['fun','love'] );
+is($json->output,'{"issues":["yes!","please","no"],"stuff":["fun","love"]}',"Making sure JSON output can obverwrite params.");
+
+eval{$json->param( die )};
+ok($@,'Dies');
+
+eval{$json->param( die => ['yes','sure','now'])};
+ok(!$@,'Dosent die.');
+eval{$json->param( die => ['yes','sure','now'], die2 =>)};
+ok($@,'Dies.');
diff --git a/t/Record.t b/t/Record.t
deleted file mode 100755 (executable)
index c01bc04..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/perl
-#
-# This Koha test module is a stub!  
-# Add more tests here!!!
-
-use strict;
-use warnings;
-
-use Test::More tests => 1;
-
-BEGIN {
-        use_ok('C4::Record');
-}
-
diff --git a/t/Reports_Guided.t b/t/Reports_Guided.t
deleted file mode 100755 (executable)
index 0b0cda6..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/perl
-#
-# This Koha test module is a stub!  
-# Add more tests here!!!
-
-use strict;
-use warnings;
-
-use Test::More tests => 1;
-
-BEGIN {
-        use_ok('C4::Reports::Guided');
-}
-
diff --git a/t/Serials.t b/t/Serials.t
deleted file mode 100644 (file)
index 01cf853..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/perl
-use strict;
-use warnings;
-
-use Test::More;
-
-use_ok('C4::Serials');
-my $supplierlist=eval{GetSuppliersWithLateIssues()};
-ok(length($@)==0,"No SQL problem in GetSuppliersWithLateIssues");
-done_testing();
diff --git a/t/Service.t b/t/Service.t
deleted file mode 100755 (executable)
index 497cc1b..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/perl
-#
-# This Koha test module is a stub!  
-# Add more tests here!!!
-
-use strict;
-use warnings;
-
-use Test::More tests => 1;
-
-BEGIN {
-        use_ok('C4::Service');
-}
-
diff --git a/t/Tags.t b/t/Tags.t
deleted file mode 100755 (executable)
index 83b3c9b..0000000
--- a/t/Tags.t
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/perl
-#
-# This Koha test module is a stub!  
-# Add more tests here!!!
-
-use strict;
-use warnings;
-
-use Test::More tests => 1;
-
-BEGIN {
-        use_ok('C4::Tags');
-}
-
diff --git a/t/UploadedFile.t b/t/UploadedFile.t
deleted file mode 100755 (executable)
index dd01e1b..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/perl
-#
-# This Koha test module is a stub!  
-# Add more tests here!!!
-
-use strict;
-use warnings;
-
-use Test::More tests => 1;
-
-BEGIN {
-        use_ok('C4::UploadedFile');
-}
-
diff --git a/t/VirtualShelves_Page.t b/t/VirtualShelves_Page.t
deleted file mode 100755 (executable)
index 236d147..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/perl
-#
-# This Koha test module is a stub!  
-# Add more tests here!!!
-
-use strict;
-use warnings;
-
-use Test::More tests => 1;
-
-BEGIN {
-        use_ok('C4::VirtualShelves::Page');
-}
-
diff --git a/t/XISBN.t b/t/XISBN.t
deleted file mode 100755 (executable)
index 9e08efb..0000000
--- a/t/XISBN.t
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/perl
-#
-# This Koha test module is a stub!  
-# Add more tests here!!!
-
-use strict;
-use warnings;
-
-use Test::More tests => 1;
-
-BEGIN {
-        use_ok('C4::XISBN');
-}
-
diff --git a/t/database_dependent.pl b/t/database_dependent.pl
deleted file mode 100644 (file)
index 1b52be7..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/perl
-
-use warnings;
-use strict;
-
-=head2
-
-
-
-=cut
-
-use C4::Context;
-use Data::Dumper;
-use Test::More;
-
-use Test::Class::Load qw ( . ); # run from the t directory
-
-KohaTest::clear_test_database();
-KohaTest::create_test_database();
-
-KohaTest::start_zebrasrv();
-KohaTest::start_zebraqueue_daemon();
-
-if ($ENV{'TEST_CLASS'}) {
-    # assume only one test class is specified;
-    # should extend to allow multiples, but that will 
-    # mean changing how test classes are loaded.
-    eval "KohaTest::$ENV{'TEST_CLASS'}->runtests";
-} else {
-    Test::Class->runtests;
-}
-
-KohaTest::stop_zebraqueue_daemon();
-KohaTest::stop_zebrasrv();
-
diff --git a/t/db_dependent/Accounts.t b/t/db_dependent/Accounts.t
new file mode 100644 (file)
index 0000000..1c2dd5a
--- /dev/null
@@ -0,0 +1,16 @@
+#!/usr/bin/perl
+#
+# This Koha test module is a stub!  
+# Add more tests here!!!
+
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+BEGIN {
+        use_ok('C4::Accounts');
+}
+
+
+
diff --git a/t/db_dependent/Amazon.t b/t/db_dependent/Amazon.t
new file mode 100755 (executable)
index 0000000..f8352c8
--- /dev/null
@@ -0,0 +1,49 @@
+#!/usr/bin/perl
+#
+# This Koha test module is a stub!  
+# Add more tests here!!!
+
+use strict;
+use warnings;
+
+use Test::More tests => 8;
+use C4::Context;
+
+BEGIN {
+        use_ok('C4::External::Amazon');
+}
+
+my $context = C4::Context->new();
+
+my $locale = $context->preference('AmazonLocale');
+
+$context->set_preference('AmazonLocale','CA');
+$context->clear_syspref_cache();
+is(get_amazon_tld,'.ca','Changes locale to CA and tests get_amazon_tld');
+
+$context->set_preference('AmazonLocale','DE');
+$context->clear_syspref_cache();
+is(get_amazon_tld,'.de','Changes locale to DE and tests get_amazon_tld');
+
+$context->set_preference('AmazonLocale','FR');
+$context->clear_syspref_cache();
+is(get_amazon_tld,'.fr','Changes locale to FR and tests get_amazon_tld');
+
+$context->set_preference('AmazonLocale','JP');
+$context->clear_syspref_cache();
+is(get_amazon_tld,'.jp','Changes locale to JP and tests get_amazon_tld');
+
+$context->set_preference('AmazonLocale','UK');
+$context->clear_syspref_cache();
+is(get_amazon_tld,'.co.uk','Changes locale to UK and tests get_amazon_tld');
+
+$context->set_preference('AmazonLocale','US');
+$context->clear_syspref_cache();
+is(get_amazon_tld,'.com','Changes locale to US and tests get_amazon_tld');
+
+$context->set_preference('AmazonLocale','NZ');
+$context->clear_syspref_cache();
+is(get_amazon_tld,'.com','Changes locale to one not in the array and tests get_amazon_tld');
+
+$context->set_preference('AmazonLocale',$locale);
+$context->clear_syspref_cache();
diff --git a/t/db_dependent/Auth.t b/t/db_dependent/Auth.t
new file mode 100644 (file)
index 0000000..08b6849
--- /dev/null
@@ -0,0 +1,15 @@
+#!/usr/bin/perl
+#
+# This Koha test module is a stub!  
+# Add more tests here!!!
+
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+BEGIN {
+        use_ok('C4::Auth');
+}
+
+
diff --git a/t/db_dependent/Auth_with_cas.t b/t/db_dependent/Auth_with_cas.t
new file mode 100755 (executable)
index 0000000..77dd21f
--- /dev/null
@@ -0,0 +1,14 @@
+#!/usr/bin/perl
+#
+# This Koha test module is a stub!  
+# Add more tests here!!!
+
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+BEGIN {
+        use_ok('C4::Auth_with_cas');
+}
+
diff --git a/t/db_dependent/BackgroundJob.t b/t/db_dependent/BackgroundJob.t
new file mode 100644 (file)
index 0000000..2726eb3
--- /dev/null
@@ -0,0 +1,36 @@
+#!/usr/bin/perl
+#
+# This Koha test module is a stub!  
+# Add more tests here!!!
+
+use strict;
+use warnings;
+use C4::Auth;
+use CGI;
+use Test::More tests => 8;
+
+BEGIN {
+        use_ok('C4::BackgroundJob');
+}
+my $query = new CGI;
+my ($userid, $cookie, $sessionID) = &checkauth($query, 1);
+#my ($sessionID, $job_name, $job_invoker, $num_work_units) = @_;
+my $background;
+diag $sessionID;
+ok ($background=C4::BackgroundJob->new($sessionID));
+ok ($background->id);
+
+$background->name("George");
+is ($background->name, "George", "testing name");
+
+$background->invoker("enjoys");
+is ($background->invoker, "enjoys", "testing invoker");
+
+$background->progress("testing");
+is ($background->progress, "testing", "testing progress");
+
+ok ($background->status);
+
+$background->size("56");
+is ($background->size, "56", "testing size");
+
diff --git a/t/db_dependent/Biblio.t b/t/db_dependent/Biblio.t
new file mode 100755 (executable)
index 0000000..6012f5f
--- /dev/null
@@ -0,0 +1,39 @@
+#!/usr/bin/perl
+#
+# This Koha test module is a stub!  
+# Add more tests here!!!
+
+use strict;
+use warnings;
+use Test::More tests => 6;
+use MARC::Record;
+use C4::Biblio;
+
+BEGIN {
+       use_ok('C4::Biblio');
+}
+
+my $isbn = '0590353403';
+my $title = 'Foundation';
+
+my $marc_record=MARC::Record->new;
+my $field = MARC::Field->new('020','','','a' => $isbn);
+$marc_record->append_fields($field);
+my($biblionumber,$biblioitemnumber) = AddBiblio($marc_record,'');
+my $data = &GetBiblioData($biblionumber);
+is($data->{Title},undef,'Makes sure title field in biblio is empty.');
+
+$field = MARC::Field->new('245','','','a' => $title);
+$marc_record->append_fields($field);
+ModBiblio($marc_record,$biblionumber,'');
+$data = &GetBiblioData($biblionumber);
+is($data->{title},$title,'uses ModBiblio to add a title to the previously created record and checks that its there.');
+is($data->{isbn},$isbn,'Makes sure the isbn is still there after using ModBiblio.');
+
+my $itemdata = &GetBiblioItemData($biblioitemnumber);
+is($itemdata->{title},$title,'First test of GetBiblioItemData to get same result of previous two GetBiblioData tests.');
+is($itemdata->{isbn},$isbn,'Second test checking it returns the correct isbn.');
+
+
+# clean up after ourselves
+DelBiblio($biblionumber);
diff --git a/t/db_dependent/External_BakerTaylor.t b/t/db_dependent/External_BakerTaylor.t
new file mode 100755 (executable)
index 0000000..fdccaee
--- /dev/null
@@ -0,0 +1,14 @@
+#!/usr/bin/perl
+#
+# This Koha test module is a stub!  
+# Add more tests here!!!
+
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+BEGIN {
+        use_ok('C4::External::BakerTaylor');
+}
+
diff --git a/t/db_dependent/Members.t b/t/db_dependent/Members.t
new file mode 100755 (executable)
index 0000000..8e26643
--- /dev/null
@@ -0,0 +1,83 @@
+#!/usr/bin/perl
+#
+# This is to test C4/Members
+# It requires a working Koha database with the sample data
+
+use strict;
+use warnings;
+
+use Test::More tests => 15;
+
+BEGIN {
+        use_ok('C4::Members');
+}
+
+
+# Make a borrower for testing
+my $data = { cardnumber => 'TESTCARD01',
+    firstname => 'Marie',
+    surname => 'Mcknight',
+    categorycode => 'S',
+    branchcode => 's'
+    };
+
+my $addmem=AddMember(%$data);
+
+
+my $member=GetMemberDetails("","TESTCARD01");
+is ($member->{firstname}, "Marie", "Got member");
+
+$member->{firstname}="Claire";
+ModMember(%$member);
+my $changedmember=GetMemberDetails("","TESTCARD01");
+is ($changedmember->{firstname}, "Claire", "Member Changed");
+
+$member->{firstname}="Marie";
+ModMember(%$member);
+$changedmember=GetMemberDetails("","TESTCARD01");
+is ($changedmember->{firstname}, "Marie", "Member Returned");
+
+$member->{email}="Marie\@email.com";
+ModMember(%$member);
+my $searchemail=Search($member);
+is ($member->{email}, "Marie\@email.com", "Email search works");
+
+$member->{ethnicity}="German";
+ModMember(%$member);
+my $searcheth=Search($member);
+is ($member->{ethnicity}, "German", "Ethnicity Works");
+
+my @searchstring=("Mcknight");
+my ($results) = Search(\@searchstring,undef,undef,undef,["surname"]);
+is ($results->[0]->{surname}, "Mcknight", "Surname Search works");
+
+$member->{phone}="555-12123";
+ModMember(%$member);
+
+@searchstring=("555-12123");
+($results) = Search(\@searchstring,undef,undef,undef,["phone"]);
+is ($results->[0]->{phone}, "555-12123", "phone Search works");
+
+my $checkcardnum=C4::Members::checkcardnumber("TESTCARD01", "");
+is ($checkcardnum, "1", "Card No. in use");
+
+$checkcardnum=C4::Members::checkcardnumber("67", "");
+is ($checkcardnum, "0", "Card No. not used");
+
+my $age=GetAge("1992-08-14", "2011-01-19");
+is ($age, "18", "Age correct");
+
+$age=GetAge("2011-01-19", "1992-01-19");
+is ($age, "-19", "Birthday In the Future");
+
+my $sortdet=C4::Members::GetSortDetails("lost", "3");
+is ($sortdet, "Lost and Paid For", "lost and paid works");
+
+my $sortdet2=C4::Members::GetSortDetails("loc", "child");
+is ($sortdet2, "Children's Area", "Child area works");
+
+my $sortdet3=C4::Members::GetSortDetails("withdrawn", "1");
+is ($sortdet3, "Withdrawn", "Withdrawn works");
+
+# clean up 
+DelMember($member->{borrowernumber});
diff --git a/t/db_dependent/Record.t b/t/db_dependent/Record.t
new file mode 100755 (executable)
index 0000000..2e04449
--- /dev/null
@@ -0,0 +1,110 @@
+#!/usr/bin/perl
+#
+# This Koha test module is a stub!  
+# Add more tests here!!!
+
+use strict;
+use warnings;
+
+use Test::More tests => 10;
+use MARC::Record;
+
+BEGIN {
+        use_ok('C4::Record');
+}
+
+#my ($marc,$to_flavour,$from_flavour,$encoding) = @_;
+
+my @marcarray=marc2marc;
+is ($marcarray[0],"Feature not yet implemented\n","error works");
+
+my $marc=new MARC::Record;
+my $marcxml=marc2marcxml($marc);
+my $testxml=qq(<?xml version="1.0" encoding="UTF-8"?>
+<record
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd"
+    xmlns="http://www.loc.gov/MARC21/slim">
+
+  <leader>         a              </leader>
+</record>
+);
+is ($marcxml, $testxml, "testing marc2xml");
+
+my $rawmarc=$marc->as_usmarc;
+$marcxml=marc2marcxml($rawmarc);
+$testxml=qq(<?xml version="1.0" encoding="UTF-8"?>
+<record
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd"
+    xmlns="http://www.loc.gov/MARC21/slim">
+
+  <leader>00026    a2200025   4500</leader>
+</record>
+);
+is ($marcxml, $testxml, "testing marc2xml");
+
+my $marcconvert=marcxml2marc($marcxml);
+is ($marcconvert->as_xml,$marc->as_xml, "testing xml2marc");
+
+my $marcdc=marc2dcxml($marc);
+my $test2xml=qq(<?xml version="1.0" encoding="UTF-8"?>
+<metadata
+  xmlns="http://example.org/myapp/"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://example.org/myapp/ http://example.org/myapp/schema.xsd"
+  xmlns:dc="http://purl.org/dc/elements/1.1/"
+  xmlns:dcterms="http://purl.org/dc/terms/">
+</metadata>);
+
+is ($marcdc, $test2xml, "testing marc2dcxml");
+
+my $marcqualified=marc2dcxml($marc,1);
+my $test3xml=qq(<?xml version="1.0" encoding="UTF-8"?>
+<metadata
+  xmlns="http://example.org/myapp/"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://example.org/myapp/ http://example.org/myapp/schema.xsd"
+  xmlns:dc="http://purl.org/dc/elements/1.1/"
+  xmlns:dcterms="http://purl.org/dc/terms/">
+</metadata>);
+
+is ($marcqualified, $test3xml, "testing marcQualified");
+
+my $mods=marc2modsxml($marc);
+my $test4xml=qq(<?xml version="1.0" encoding="UTF-8"?>
+<mods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.loc.gov/mods/v3" version="3.1" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-1.xsd">
+  <typeOfResource/>
+  <originInfo>
+    <issuance/>
+  </originInfo>
+  <recordInfo/>
+</mods>
+);
+
+is ($mods, $test4xml, "testing marc2mosxml");
+
+my $field = MARC::Field->new('245','','','a' => "Harry potter");
+$marc->append_fields($field);
+
+#my $endnote=marc2endnote($marc->as_usmarc);
+#print $endnote;
+
+my $bibtex=marc2bibtex($marc);
+my $test5xml=qq(\@book{,
+       title = "Harry potter"
+}
+);
+
+is ($bibtex, $test5xml, "testing bibtex");
+
+my @entity=C4::Record::_entity_encode("Björn");
+is ($entity[0], "Bj&#xC3;&#xB6;rn", "Html umlauts");
+
+
+
+
+
+
+
+
diff --git a/t/db_dependent/Reports_Guided.t b/t/db_dependent/Reports_Guided.t
new file mode 100755 (executable)
index 0000000..0b0cda6
--- /dev/null
@@ -0,0 +1,14 @@
+#!/usr/bin/perl
+#
+# This Koha test module is a stub!  
+# Add more tests here!!!
+
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+BEGIN {
+        use_ok('C4::Reports::Guided');
+}
+
diff --git a/t/db_dependent/Serials_2.t b/t/db_dependent/Serials_2.t
new file mode 100644 (file)
index 0000000..01cf853
--- /dev/null
@@ -0,0 +1,10 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+
+use Test::More;
+
+use_ok('C4::Serials');
+my $supplierlist=eval{GetSuppliersWithLateIssues()};
+ok(length($@)==0,"No SQL problem in GetSuppliersWithLateIssues");
+done_testing();
diff --git a/t/db_dependent/Service.t b/t/db_dependent/Service.t
new file mode 100755 (executable)
index 0000000..497cc1b
--- /dev/null
@@ -0,0 +1,14 @@
+#!/usr/bin/perl
+#
+# This Koha test module is a stub!  
+# Add more tests here!!!
+
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+BEGIN {
+        use_ok('C4::Service');
+}
+
diff --git a/t/db_dependent/Tags.t b/t/db_dependent/Tags.t
new file mode 100755 (executable)
index 0000000..83b3c9b
--- /dev/null
@@ -0,0 +1,14 @@
+#!/usr/bin/perl
+#
+# This Koha test module is a stub!  
+# Add more tests here!!!
+
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+BEGIN {
+        use_ok('C4::Tags');
+}
+
diff --git a/t/db_dependent/UploadedFile.t b/t/db_dependent/UploadedFile.t
new file mode 100755 (executable)
index 0000000..dd01e1b
--- /dev/null
@@ -0,0 +1,14 @@
+#!/usr/bin/perl
+#
+# This Koha test module is a stub!  
+# Add more tests here!!!
+
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+BEGIN {
+        use_ok('C4::UploadedFile');
+}
+
diff --git a/t/db_dependent/VirtualShelves_Page.t b/t/db_dependent/VirtualShelves_Page.t
new file mode 100755 (executable)
index 0000000..236d147
--- /dev/null
@@ -0,0 +1,14 @@
+#!/usr/bin/perl
+#
+# This Koha test module is a stub!  
+# Add more tests here!!!
+
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+BEGIN {
+        use_ok('C4::VirtualShelves::Page');
+}
+
diff --git a/t/db_dependent/XISBN.t b/t/db_dependent/XISBN.t
new file mode 100755 (executable)
index 0000000..a3c5c6d
--- /dev/null
@@ -0,0 +1,51 @@
+#!/usr/bin/perl
+#
+# This Koha test module is a stub!  
+# Add more tests here!!!
+
+use strict;
+use warnings;
+# use Test::Class::Load qw ( t/db_dependent/ );
+use Test::More tests => 4;
+use MARC::Record;
+use C4::Biblio;
+use C4::XISBN;
+use Data::Dumper;
+use C4::Context;
+
+BEGIN {
+       use_ok('C4::XISBN');
+}
+
+# KohaTest::clear_test_database();
+# KohaTest::create_test_database();
+
+my $isbn = '0590353403';
+my $isbn2 = '0747554560';
+
+my $marc_record=MARC::Record->new;
+my $field = MARC::Field->new('020','','','a' => $isbn);
+$marc_record->append_fields($field);
+my($biblionumber,$biblioitemnumber) = AddBiblio($marc_record,'');
+
+my $marc_record=MARC::Record->new;
+my $field = MARC::Field->new('020','','','a' => $isbn2);
+$marc_record->append_fields($field);
+my($biblionumber2,$biblioitemnumber2) = AddBiblio($marc_record,'');
+
+
+my $trial = C4::XISBN::get_biblionumber_from_isbn($isbn);
+is($trial->[0]->{biblionumber},$biblionumber,"It gets the correct biblionumber from the only isbn we have added.");
+
+$trial = C4::XISBN::_get_biblio_from_xisbn($isbn);
+is($trial->{biblionumber},$biblionumber,"Gets biblionumber like the previous test.");
+
+my $context = C4::Context->new();
+$context->set_preference('ThingISBN','on');
+diag C4::Context::preference('ThingISBN');
+my $var = C4::XISBN::get_xisbns($isbn);
+is($var->[0]->{biblionumber},$biblionumber2,"Gets correct biblionumber from a book with a similar isbn.");
+
+# clean up after ourselves
+DelBiblio($biblionumber);
+DelBiblio($biblionumber2);
\ No newline at end of file
diff --git a/t/db_dependent/database_dependent.pl b/t/db_dependent/database_dependent.pl
new file mode 100644 (file)
index 0000000..de05224
--- /dev/null
@@ -0,0 +1,35 @@
+#!/usr/bin/perl
+
+use warnings;
+use strict;
+
+=head2
+
+
+
+=cut
+
+use C4::Context;
+use Data::Dumper;
+use Test::More;
+
+use Test::Class::Load qw ( . ); # run from the t/db_dependent directory
+
+KohaTest::clear_test_database();
+KohaTest::create_test_database();
+
+KohaTest::start_zebrasrv();
+KohaTest::start_zebraqueue_daemon();
+
+if ($ENV{'TEST_CLASS'}) {
+    # assume only one test class is specified;
+    # should extend to allow multiples, but that will 
+    # mean changing how test classes are loaded.
+    eval "KohaTest::$ENV{'TEST_CLASS'}->runtests";
+} else {
+    Test::Class->runtests;
+}
+
+KohaTest::stop_zebraqueue_daemon();
+KohaTest::stop_zebrasrv();
+
diff --git a/t/db_dependent/lib/KohaTest.pm b/t/db_dependent/lib/KohaTest.pm
new file mode 100644 (file)
index 0000000..323b55a
--- /dev/null
@@ -0,0 +1,844 @@
+package KohaTest;
+use base qw(Test::Class);
+
+use Test::More;
+use Data::Dumper;
+
+eval "use Test::Class";
+plan skip_all => "Test::Class required for performing database tests" if $@;
+# Or, maybe I should just die there.
+
+use C4::Auth;
+use C4::Biblio;
+use C4::Bookseller;
+use C4::Context;
+use C4::Items;
+use C4::Members;
+use C4::Search;
+use C4::Installer;
+use C4::Languages;
+use File::Temp qw/ tempdir /;
+use CGI;
+use Time::localtime;
+
+# Since this is an abstract base class, this prevents these tests from
+# being run directly unless we're testing a subclass. It just makes
+# things faster.
+__PACKAGE__->SKIP_CLASS( 1 );
+
+INIT {
+    if ($ENV{SINGLE_TEST}) {
+        # if we're running the tests in one
+        # or more test files specified via
+        #
+        #   make test-single TEST_FILES=lib/KohaTest/Foo.pm
+        #
+        # use this INIT trick taken from the POD for
+        # Test::Class::Load.
+        start_zebrasrv();
+        Test::Class->runtests;
+        stop_zebrasrv();
+    }
+}
+
+use Attribute::Handlers;
+
+=head2 Expensive test method attribute
+
+If a test method is decorated with an Expensive
+attribute, it is skipped unless the RUN_EXPENSIVE_TESTS
+environment variable is defined.
+
+To declare an entire test class and its subclasses expensive,
+define a SKIP_CLASS with the Expensive attribute:
+
+    sub SKIP_CLASS : Expensive { }
+
+=cut
+
+sub Expensive : ATTR(CODE) {
+    my ($package, $symbol, $sub, $attr, $data, $phase) = @_;
+    my $name = *{$symbol}{NAME};
+    if ($name eq 'SKIP_CLASS') {
+        if ($ENV{'RUN_EXPENSIVE_TESTS'}) {
+            *{$symbol} = sub { 0; }
+        } else {
+            *{$symbol} = sub { "Skipping expensive test classes $package (and subclasses)"; }
+        }
+    } else {
+        unless ($ENV{'RUN_EXPENSIVE_TESTS'}) {
+            # a test method that runs no tests and just returns a scalar is viewed by Test::Class as a skip
+            *{$symbol} = sub { "Skipping expensive test $package\:\:$name"; }
+        }
+    }
+}
+
+=head2 startup methods
+
+these are run once, at the beginning of the whole test suite
+
+=cut
+
+sub startup_15_truncate_tables : Test( startup => 1 ) {
+    my $self = shift;
+
+#     my @truncate_tables = qw( accountlines
+#                               accountoffsets
+#                               action_logs
+#                               alert
+#                               aqbasket
+#                               aqbookfund
+#                               aqbooksellers
+#                               aqbudget
+#                               aqorderdelivery
+#                               aqorders
+#                               auth_header
+#                               auth_subfield_structure
+#                               auth_tag_structure
+#                               auth_types
+#                               authorised_values
+#                               biblio
+#                               biblio_framework
+#                               biblioitems
+#                               borrowers
+#                               branchcategories
+#                               branches
+#                               branchrelations
+#                               branchtransfers
+#                               browser
+#                               categories
+#                               cities
+#                               class_sort_rules
+#                               class_sources
+#                               currency
+#                               deletedbiblio
+#                               deletedbiblioitems
+#                               deletedborrowers
+#                               deleteditems
+#                               ethnicity
+#                               import_batches
+#                               import_biblios
+#                               import_items
+#                               import_record_matches
+#                               import_records
+#                               issues
+#                               issuingrules
+#                               items
+#                               itemtypes
+#                               labels
+#                               labels_conf
+#                               labels_profile
+#                               labels_templates
+#                               language_descriptions
+#                               language_rfc4646_to_iso639
+#                               language_script_bidi
+#                               language_script_mapping
+#                               language_subtag_registry
+#                               letter
+#                               marc_matchers
+#                               marc_subfield_structure
+#                               marc_tag_structure
+#                               matchchecks
+#                               matcher_matchpoints
+#                               matchpoint_component_norms
+#                               matchpoint_components
+#                               matchpoints
+#                               notifys
+#                               nozebra
+#                               old_issues
+#                               old_reserves
+#                               opac_news
+#                               overduerules
+#                               patroncards
+#                               patronimage
+#                               printers
+#                               printers_profile
+#                               repeatable_holidays
+#                               reports_dictionary
+#                               reserveconstraints
+#                               reserves
+#                               reviews
+#                               roadtype
+#                               saved_reports
+#                               saved_sql
+#                               serial
+#                               serialitems
+#                               services_throttle
+#                               sessions
+#                               special_holidays
+#                               statistics
+#                               stopwords
+#                               subscription
+#                               subscriptionhistory
+#                               subscriptionroutinglist
+#                               suggestions
+#                               systempreferences
+#                               tags
+#                               userflags
+#                               virtualshelfcontents
+#                               virtualshelves
+#                               z3950servers
+#                               zebraqueue
+#                         );
+
+    my @truncate_tables = qw( accountlines
+                              accountoffsets
+                              alert
+                              aqbasket
+                              aqbooksellers
+                              aqorderdelivery
+                              aqorders
+                              auth_header
+                              branchcategories
+                              branchrelations
+                              branchtransfers
+                              browser
+                              cities
+                              deletedbiblio
+                              deletedbiblioitems
+                              deletedborrowers
+                              deleteditems
+                              ethnicity
+                              issues
+                              issuingrules
+                              labels
+                              labels_profile
+                              matchchecks
+                              notifys
+                              nozebra
+                              old_issues
+                              old_reserves
+                              overduerules
+                              patroncards
+                              patronimage
+                              printers
+                              printers_profile
+                              reports_dictionary
+                              reserveconstraints
+                              reserves
+                              reviews
+                              roadtype
+                              saved_reports
+                              saved_sql
+                              serial
+                              serialitems
+                              services_throttle
+                              special_holidays
+                              statistics
+                              subscription
+                              subscriptionhistory
+                              subscriptionroutinglist
+                              suggestions
+                              tags
+                              virtualshelfcontents
+                        );
+
+    my $failed_to_truncate = 0;
+    foreach my $table ( @truncate_tables ) {
+        my $dbh = C4::Context->dbh();
+        $dbh->do( "truncate $table" )
+          or $failed_to_truncate = 1;
+    }
+    is( $failed_to_truncate, 0, 'truncated tables' );
+}
+
+=head2 startup_20_add_bookseller
+
+we need a bookseller for many of the tests, so let's insert one. Feel
+free to use this one, or insert your own.
+
+=cut
+
+sub startup_20_add_bookseller : Test(startup => 1) {
+    my $self = shift;
+
+    my $booksellerinfo = { name => 'bookseller ' . $self->random_string(),
+                      };
+
+    my $id = AddBookseller( $booksellerinfo );
+    ok( $id, "created bookseller: $id" );
+    $self->{'booksellerid'} = $id;
+
+    return;
+}
+
+=head2 startup_22_add_bookfund
+
+we need a bookfund for many of the tests. This currently uses one that
+is in the skeleton database.  free to use this one, or insert your
+own.
+
+=cut
+
+sub startup_22_add_bookfund : Test(startup => 2) {
+    my $self = shift;
+
+    my $bookfundid = 'GEN';
+    my $bookfund = GetBookFund( $bookfundid, undef );
+    # diag( Data::Dumper->Dump( [ $bookfund ], qw( bookfund  ) ) );
+    is( $bookfund->{'bookfundid'},   $bookfundid,      "found bookfund: '$bookfundid'" );
+    is( $bookfund->{'bookfundname'}, 'General Stacks', "found bookfund: '$bookfundid'" );
+
+    $self->{'bookfundid'} = $bookfundid;
+    return;
+}
+
+=head2 startup_24_add_branch
+
+=cut
+
+sub startup_24_add_branch : Test(startup => 1) {
+    my $self = shift;
+
+    my $branch_info = {
+        add            => 1,
+        branchcode     => $self->random_string(3),
+        branchname     => $self->random_string(),
+        branchaddress1 => $self->random_string(),
+        branchaddress2 => $self->random_string(),
+        branchaddress3 => $self->random_string(),
+        branchphone    => $self->random_phone(),
+        branchfax      => $self->random_phone(),
+        brancemail     => $self->random_email(),
+        branchip       => $self->random_ip(),
+        branchprinter  => $self->random_string(),
+      };
+    C4::Branch::ModBranch($branch_info);
+    $self->{'branchcode'} = $branch_info->{'branchcode'};
+    ok( $self->{'branchcode'}, "created branch: $self->{'branchcode'}" );
+
+}
+
+=head2 startup_24_add_member
+
+Add a patron/member for the tests to use
+
+=cut
+
+sub startup_24_add_member : Test(startup => 1) {
+    my $self = shift;
+
+    my $memberinfo = { surname      => 'surname '  . $self->random_string(),
+                       firstname    => 'firstname' . $self->random_string(),
+                       address      => 'address'   . $self->random_string(),
+                       city         => 'city'      . $self->random_string(),
+                       cardnumber   => 'card'      . $self->random_string(),
+                       branchcode   => 'CPL', # CPL => Centerville
+                       categorycode => 'PT',  # PT  => PaTron
+                       dateexpiry   => '2010-01-01',
+                       password     => 'testpassword',
+                       dateofbirth  => $self->random_date(),
+                  };
+
+    my $borrowernumber = AddMember( %$memberinfo );
+    ok( $borrowernumber, "created member: $borrowernumber" );
+    $self->{'memberid'} = $borrowernumber;
+
+    return;
+}
+
+=head2 startup_30_login
+
+=cut
+
+sub startup_30_login : Test( startup => 2 ) {
+    my $self = shift;
+
+    $self->{'sessionid'} = '12345678'; # does this value matter?
+    my $borrower_details = C4::Members::GetMemberDetails( $self->{'memberid'} );
+    ok( $borrower_details->{'cardnumber'}, 'cardnumber' );
+
+    # make a cookie and force it into $cgi.
+    # This would be a lot easier with Test::MockObject::Extends.
+    my $cgi = CGI->new( { userid   => $borrower_details->{'cardnumber'},
+                          password => 'testpassword' } );
+    my $setcookie = $cgi->cookie( -name  => 'CGISESSID',
+                                  -value => $self->{'sessionid'} );
+    $cgi->{'.cookies'} = { CGISESSID => $setcookie };
+    is( $cgi->cookie('CGISESSID'), $self->{'sessionid'}, 'the CGISESSID cookie is set' );
+    # diag( Data::Dumper->Dump( [ $cgi->cookie('CGISESSID') ], [ qw( cookie ) ] ) );
+
+    # C4::Auth::checkauth sometimes emits a warning about unable to append to sessionlog. That's OK.
+    my ( $userid, $cookie, $sessionID ) = C4::Auth::checkauth( $cgi, 'noauth', {}, 'intranet' );
+    # diag( Data::Dumper->Dump( [ $userid, $cookie, $sessionID ], [ qw( userid cookie sessionID ) ] ) );
+
+    # my $session = C4::Auth::get_session( $sessionID );
+    # diag( Data::Dumper->Dump( [ $session ], [ qw( session ) ] ) );
+
+
+}
+
+=head2 setup methods
+
+setup methods are run before every test method
+
+=cut
+
+=head2 teardown methods
+
+teardown methods are many time, once at the end of each test method.
+
+=cut
+
+=head2 shutdown methods
+
+shutdown methods are run once, at the end of the test suite
+
+=cut
+
+=head2 utility methods
+
+These are not test methods, but they're handy
+
+=cut
+
+=head3 random_string
+
+Nice for generating names and such. It's not actually random, more
+like arbitrary.
+
+=cut
+
+sub random_string {
+    my $self = shift;
+
+    my $wordsize = shift || 6;  # how many letters in your string?
+
+    # leave out these characters: "oOlL10". They're too confusing.
+    my @alphabet = ( 'a'..'k','m','n','p'..'z', 'A'..'K','M','N','P'..'Z', 2..9 );
+
+    my $randomstring;
+    foreach ( 0..$wordsize ) {
+        $randomstring .= $alphabet[ rand( scalar( @alphabet ) ) ];
+    }
+    return $randomstring;
+
+}
+
+=head3 random_phone
+
+generates a random phone number. Currently, it's not actually random. It's an unusable US phone number
+
+=cut
+
+sub random_phone {
+    my $self = shift;
+
+    return '212-555-5555';
+
+}
+
+=head3 random_email
+
+generates a random email address. They're all in the unusable
+'example.com' domain that is designed for this purpose.
+
+=cut
+
+sub random_email {
+    my $self = shift;
+
+    return $self->random_string() . '@example.com';
+
+}
+
+=head3 random_ip
+
+returns an IP address suitable for testing purposes.
+
+=cut
+
+sub random_ip {
+    my $self = shift;
+
+    return '127.0.0.2';
+
+}
+
+=head3 random_date
+
+returns a somewhat random date in the iso (yyyy-mm-dd) format.
+
+=cut
+
+sub random_date {
+    my $self = shift;
+
+    my $year  = 1800 + int( rand(300) );    # 1800 - 2199
+    my $month = 1 + int( rand(12) );        # 1 - 12
+    my $day   = 1 + int( rand(28) );        # 1 - 28
+                                            # stop at the 28th to keep us from generating February 31st and such.
+
+    return sprintf( '%04d-%02d-%02d', $year, $month, $day );
+
+}
+
+=head3 tomorrow
+
+returns tomorrow's date as YYYY-MM-DD.
+
+=cut
+
+sub tomorrow {
+    my $self = shift;
+
+    return $self->days_from_now( 1 );
+
+}
+
+=head3 yesterday
+
+returns yesterday's date as YYYY-MM-DD.
+
+=cut
+
+sub yesterday {
+    my $self = shift;
+
+    return $self->days_from_now( -1 );
+}
+
+
+=head3 days_from_now
+
+returns an arbitrary date based on today in YYYY-MM-DD format.
+
+=cut
+
+sub days_from_now {
+    my $self = shift;
+    my $days = shift or return;
+
+    my $seconds = time + $days * 60*60*24;
+    my $yyyymmdd = sprintf( '%04d-%02d-%02d',
+                            localtime( $seconds )->year() + 1900,
+                            localtime( $seconds )->mon() + 1,
+                            localtime( $seconds )->mday() );
+    return $yyyymmdd;
+}
+
+=head3 add_biblios
+
+  $self->add_biblios( count     => 10,
+                      add_items => 1, );
+
+  named parameters:
+     count: number of biblios to add
+     add_items: should you add items for each one?
+
+  returns:
+    I don't know yet.
+
+  side effects:
+    adds the biblionumbers to the $self->{'biblios'} listref
+
+  Notes:
+    Should I allow you to pass in biblio information, like title?
+    Since this method is in the KohaTest class, all tests in it will be ignored, unless you call this from your own namespace.
+    This runs 10 tests, plus 4 for each "count", plus 3 more for each item added.
+
+=cut
+
+sub add_biblios {
+    my $self = shift;
+    my %param = @_;
+
+    $param{'count'}     = 1 unless defined( $param{'count'} );
+    $param{'add_items'} = 0 unless defined( $param{'add_items'} );
+
+    foreach my $counter ( 1..$param{'count'} ) {
+        my $marcrecord  = MARC::Record->new();
+        isa_ok( $marcrecord, 'MARC::Record' );
+        my @marc_fields = ( MARC::Field->new( '100', '1', '0',
+                                              a => 'Twain, Mark',
+                                              d => "1835-1910." ),
+                            MARC::Field->new( '245', '1', '4',
+                                              a => sprintf( 'The Adventures of Huckleberry Finn Test %s', $counter ),
+                                              c => "Mark Twain ; illustrated by E.W. Kemble." ),
+                            MARC::Field->new( '952', '0', '0',
+                                              p => '12345678' . $self->random_string() ),   # barcode
+                            MARC::Field->new( '952', '0', '0',
+                                              o => $self->random_string() ),   # callnumber
+                            MARC::Field->new( '952', '0', '0',
+                                              a => 'CPL',
+                                              b => 'CPL' ),
+                       );
+
+        my $appendedfieldscount = $marcrecord->append_fields( @marc_fields );
+
+        diag $MARC::Record::ERROR if ( $MARC::Record::ERROR );
+        is( $appendedfieldscount, scalar @marc_fields, 'added correct number of MARC fields' );
+
+        my $frameworkcode = ''; # XXX I'd like to put something reasonable here.
+        my ( $biblionumber, $biblioitemnumber ) = AddBiblio( $marcrecord, $frameworkcode );
+        ok( $biblionumber, "the biblionumber is $biblionumber" );
+        ok( $biblioitemnumber, "the biblioitemnumber is $biblioitemnumber" );
+        if ( $param{'add_items'} ) {
+            # my @iteminfo = AddItem( {}, $biblionumber );
+            my @iteminfo = AddItemFromMarc( $marcrecord, $biblionumber );
+            is( $iteminfo[0], $biblionumber,     "biblionumber is $biblionumber" );
+            is( $iteminfo[1], $biblioitemnumber, "biblioitemnumber is $biblioitemnumber" );
+            ok( $iteminfo[2], "itemnumber is $iteminfo[2]" );
+        push @{ $self->{'items'} },
+          { biblionumber     => $iteminfo[0],
+            biblioitemnumber => $iteminfo[1],
+            itemnumber       => $iteminfo[2],
+          };
+        }
+        push @{$self->{'biblios'}}, $biblionumber;
+    }
+
+    $self->reindex_marc();
+    my $query = 'Finn Test';
+    my ( $error, $results ) = SimpleSearch( $query );
+    if ( $param{'count'} <= scalar( @$results ) ) {
+        pass( "found all $param{'count'} titles" );
+    } else {
+        fail( "we never found all $param{'count'} titles" );
+    }
+
+}
+
+=head3 reindex_marc
+
+Do a fast reindexing of all of the bib and authority
+records and mark all zebraqueue entries done.
+
+Useful for test routines that need to do a
+lot of indexing without having to wait for
+zebraqueue.
+
+In NoZebra model, this only marks zebraqueue
+done - the records should already be indexed.
+
+=cut
+
+sub reindex_marc {
+    my $self = shift;
+
+    # mark zebraqueue done regardless of the indexing mode
+    my $dbh = C4::Context->dbh();
+    $dbh->do("UPDATE zebraqueue SET done = 1 WHERE done = 0");
+
+    return if C4::Context->preference('NoZebra');
+
+    my $directory = tempdir(CLEANUP => 1);
+    foreach my $record_type qw(biblio authority) {
+        mkdir "$directory/$record_type";
+        my $sth = $dbh->prepare($record_type eq "biblio" ? "SELECT marc FROM biblioitems" : "SELECT marc FROM auth_header");
+        $sth->execute();
+        open OUT, ">:utf8", "$directory/$record_type/records";
+        while (my ($blob) = $sth->fetchrow_array) {
+            print OUT $blob;
+        }
+        close OUT;
+        my $zebra_server = "${record_type}server";
+        my $zebra_config  = C4::Context->zebraconfig($zebra_server)->{'config'};
+        my $zebra_db_dir  = C4::Context->zebraconfig($zebra_server)->{'directory'};
+        my $zebra_db = $record_type eq 'biblio' ? 'biblios' : 'authorities';
+        system "zebraidx -c $zebra_config -d $zebra_db -g iso2709 init > /dev/null 2>\&1";
+        system "zebraidx -c $zebra_config -d $zebra_db -g iso2709 update $directory/${record_type} > /dev/null 2>\&1";
+        system "zebraidx -c $zebra_config -d $zebra_db -g iso2709 commit > /dev/null 2>\&1";
+    }
+
+}
+
+
+=head3 clear_test_database
+
+  removes all tables from test database so that install starts with a clean slate
+
+=cut
+
+sub clear_test_database {
+
+    diag "removing tables from test database";
+
+    my $dbh = C4::Context->dbh;
+    my $schema = C4::Context->config("database");
+
+    my @tables = get_all_tables($dbh, $schema);
+    foreach my $table (@tables) {
+        drop_all_foreign_keys($dbh, $table);
+    }
+
+    foreach my $table (@tables) {
+        drop_table($dbh, $table);
+    }
+}
+
+sub get_all_tables {
+  my ($dbh, $schema) = @_;
+  my $sth = $dbh->prepare("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = ?");
+  my @tables = ();
+  $sth->execute($schema);
+  while (my ($table) = $sth->fetchrow_array) {
+    push @tables, $table;
+  }
+  $sth->finish;
+  return @tables;
+}
+
+sub drop_all_foreign_keys {
+    my ($dbh, $table) = @_;
+    # get the table description
+    my $sth = $dbh->prepare("SHOW CREATE TABLE $table");
+    $sth->execute;
+    my $vsc_structure = $sth->fetchrow;
+    # split on CONSTRAINT keyword
+    my @fks = split /CONSTRAINT /,$vsc_structure;
+    # parse each entry
+    foreach (@fks) {
+        # isolate what is before FOREIGN KEY, if there is something, it's a foreign key to drop
+        $_ = /(.*) FOREIGN KEY.*/;
+        my $id = $1;
+        if ($id) {
+            # we have found 1 foreign, drop it
+            $dbh->do("ALTER TABLE $table DROP FOREIGN KEY $id");
+            if ( $dbh->err ) {
+                diag "unable to DROP FOREIGN KEY '$id' on TABLE '$table' due to: " . $dbh->errstr();
+            }
+            undef $id;
+        }
+    }
+}
+
+sub drop_table {
+    my ($dbh, $table) = @_;
+    $dbh->do("DROP TABLE $table");
+    if ( $dbh->err ) {
+        diag "unable to drop table: '$table' due to: " . $dbh->errstr();
+    }
+}
+
+=head3 create_test_database
+
+  sets up the test database.
+
+=cut
+
+sub create_test_database {
+
+    diag 'creating testing database...';
+    my $installer = C4::Installer->new() or die 'unable to create new installer';
+    # warn Data::Dumper->Dump( [ $installer ], [ 'installer' ] );
+    my $all_languages = getAllLanguages();
+    my $error = $installer->load_db_schema();
+    die "unable to load_db_schema: $error" if ( $error );
+    my $list = $installer->sql_file_list('en', 'marc21', { optional  => 1,
+                                                           mandatory => 1 } );
+    my ($fwk_language, $installed_list) = $installer->load_sql_in_order($all_languages, @$list);
+    $installer->set_version_syspref();
+    $installer->set_marcflavour_syspref('MARC21');
+    $installer->set_indexing_engine(0);
+    diag 'database created.'
+}
+
+
+=head3 start_zebrasrv
+
+  This method deletes and reinitializes the zebra database directory,
+  and then spans off a zebra server.
+
+=cut
+
+sub start_zebrasrv {
+
+    stop_zebrasrv();
+    diag 'cleaning zebrasrv...';
+
+    foreach my $zebra_server ( qw( biblioserver authorityserver ) ) {
+        my $zebra_config  = C4::Context->zebraconfig($zebra_server)->{'config'};
+        my $zebra_db_dir  = C4::Context->zebraconfig($zebra_server)->{'directory'};
+        foreach my $zebra_db_name ( qw( biblios authorities ) ) {
+            my $command = "zebraidx -c $zebra_config -d $zebra_db_name init";
+            my $return = system( $command . ' > /dev/null 2>&1' );
+            if ( $return != 0 ) {
+                diag( "command '$command' died with value: " . $? >> 8 );
+            }
+
+            $command = "zebraidx -c $zebra_config -d $zebra_db_name create $zebra_db_name";
+            diag $command;
+            $return = system( $command . ' > /dev/null 2>&1' );
+            if ( $return != 0 ) {
+                diag( "command '$command' died with value: " . $? >> 8 );
+            }
+        }
+    }
+
+    diag 'starting zebrasrv...';
+
+    my $pidfile = File::Spec->catdir( C4::Context->config("logdir"), 'zebra.pid' );
+    my $command = sprintf( 'zebrasrv -f %s -D -l %s -p %s',
+                           $ENV{'KOHA_CONF'},
+                           File::Spec->catdir( C4::Context->config("logdir"), 'zebra.log' ),
+                           $pidfile,
+                      );
+    diag $command;
+    my $output = qx( $command );
+    if ( $output ) {
+        diag $output;
+    }
+    if ( -e $pidfile, 'pidfile exists' ) {
+        diag 'zebrasrv started.';
+    } else {
+        die 'unable to start zebrasrv';
+    }
+    return $output;
+}
+
+=head3 stop_zebrasrv
+
+  using the PID file for the zebra server, send it a TERM signal with
+  "kill". We can't tell if the process actually dies or not.
+
+=cut
+
+sub stop_zebrasrv {
+
+    my $pidfile = File::Spec->catdir( C4::Context->config("logdir"), 'zebra.pid' );
+    if ( -e $pidfile ) {
+        open( my $pidh, '<', $pidfile )
+          or return;
+        if ( defined $pidh ) {
+            my ( $pid ) = <$pidh> or return;
+            close $pidh;
+            my $killed = kill 15, $pid; # 15 is TERM
+            if ( $killed != 1 ) {
+                warn "unable to kill zebrasrv with pid: $pid";
+            }
+        }
+    }
+}
+
+
+=head3 start_zebraqueue_daemon
+
+  kick off a zebraqueue_daemon.pl process.
+
+=cut
+
+sub start_zebraqueue_daemon {
+
+    my $command = q(run/bin/koha-zebraqueue-ctl.sh start);
+    diag $command;
+    my $started = system( $command );
+    diag "started: $started";
+
+}
+
+=head3 stop_zebraqueue_daemon
+
+
+=cut
+
+sub stop_zebraqueue_daemon {
+
+    my $command = q(run/bin/koha-zebraqueue-ctl.sh stop);
+    diag $command;
+    my $started = system( $command );
+    diag "started: $started";
+
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Accounts.pm b/t/db_dependent/lib/KohaTest/Accounts.pm
new file mode 100644 (file)
index 0000000..703d478
--- /dev/null
@@ -0,0 +1,30 @@
+package KohaTest::Accounts;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Accounts;
+sub testing_class { 'C4::Accounts' };
+
+
+sub methods : Test( 1 ) {
+    my $self = shift;
+    my @methods = qw( recordpayment
+                      makepayment
+                      getnextacctno
+                      returnlost
+                      manualinvoice
+                      fixcredit
+                      refund
+                      getcharges
+                      getcredits
+                      getrefunds
+                );     # removed fixaccounts (unused by codebase)
+    
+    can_ok( $self->testing_class, @methods );    
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Acquisition.pm b/t/db_dependent/lib/KohaTest/Acquisition.pm
new file mode 100644 (file)
index 0000000..eca0b16
--- /dev/null
@@ -0,0 +1,147 @@
+package KohaTest::Acquisition;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Acquisition;
+use C4::Context;
+use C4::Members;
+use Time::localtime;
+
+sub testing_class { 'C4::Acquisition' };
+
+
+sub methods : Test( 1 ) {
+    my $self = shift;
+    my @methods = qw(  GetBasket 
+                       NewBasket 
+                       CloseBasket 
+                       GetPendingOrders 
+                       GetOrders 
+                       GetOrderNumber 
+                       GetOrder 
+                       NewOrder 
+                       ModOrder 
+                       ModOrderBiblioNumber 
+                       ModReceiveOrder 
+                       SearchOrder 
+                       DelOrder 
+                       GetParcel 
+                       GetParcels 
+                       GetLateOrders 
+                       GetHistory 
+                       GetRecentAcqui 
+                );
+    
+    can_ok( $self->testing_class, @methods );    
+}
+
+=head3 create_new_basket
+
+  creates a baseket by creating an order with no baseket number.
+
+  named parameters:
+    authorizedby
+    invoice
+    date
+
+  returns: baseket number, order number
+
+  runs 4 tests
+
+=cut
+
+sub create_new_basket {
+    my $self = shift;
+    my %param = @_;
+    $param{'authorizedby'} = $self->{'memberid'} unless exists $param{'authorizedby'};
+    $param{'invoice'}      = 123                 unless exists $param{'invoice'};
+    
+    my $today = sprintf( '%04d-%02d-%02d',
+                         localtime->year() + 1900,
+                         localtime->mon() + 1,
+                         localtime->mday() );
+    
+    # I actually think that this parameter is unused.
+    $param{'date'}         = $today              unless exists $param{'date'};
+
+    $self->add_biblios( add_items => 1 );
+    ok( scalar @{$self->{'biblios'}} > 0, 'we have added at least one biblio' );
+
+    my ( $basketno, $ordernumber ) = NewOrder( undef, # $basketno,
+                                          $self->{'biblios'}[0], # $bibnum,
+                                          undef, # $title,
+                                          1, # $quantity,
+                                          undef, # $listprice,
+                                          $self->{'booksellerid'}, # $booksellerid,
+                                          $param{'authorizedby'}, # $authorisedby,
+                                          undef, # $notes,
+                                          $self->{'bookfundid'},     # $bookfund,
+                                          undef, # $bibitemnum,
+                                          1, # $rrp,
+                                          1, # $ecost,
+                                          undef, # $gst,
+                                          undef, # $budget,
+                                          undef, # $cost,
+                                          undef, # $sub,
+                                          $param{'invoice'}, # $invoice,
+                                          undef, # $sort1,
+                                          undef, # $sort2,
+                                          undef, # $purchaseorder
+                                     );
+    ok( $basketno, "my basket number is $basketno" );
+    ok( $ordernumber,   "my order number is $ordernumber" );
+    
+    my $order = GetOrder( $ordernumber );
+    is( $order->{'ordernumber'}, $ordernumber, 'got the right order' )
+      or diag( Data::Dumper->Dump( [ $order ], [ 'order' ] ) );
+    
+    is( $order->{'budgetdate'}, $today, "the budget date is $today" );
+
+    # XXX should I stuff these in $self?
+    return ( $basketno, $ordernumber );
+    
+}
+
+
+sub enable_independant_branches {
+    my $self = shift;
+    
+    my $member = GetMember( 'borrowernumber' =>$self->{'memberid'} );
+    
+    C4::Context::set_userenv( 0, # usernum
+                              $self->{'memberid'}, # userid
+                              undef, # usercnum
+                              undef, # userfirstname
+                              undef, # usersurname
+                              $member->{'branchcode'}, # userbranch
+                              undef, # branchname
+                              0, # userflags
+                              undef, # emailaddress
+                              undef, # branchprinter
+                         );
+
+    # set a preference. There's surely a method for this, but I can't find it.
+    my $retval = C4::Context->dbh->do( q(update systempreferences set value = '1' where variable = 'IndependantBranches') );
+    ok( $retval, 'set the preference' );
+    
+    ok( C4::Context->userenv, 'usernev' );
+    isnt( C4::Context->userenv->{flags}, 1, 'flag != 1' )
+      or diag( Data::Dumper->Dump( [ C4::Context->userenv ], [ 'userenv' ] ) );
+
+    is( C4::Context->userenv->{branch}, $member->{'branchcode'}, 'we have set the right branch in C4::Context: ' . $member->{'branchcode'} );
+    
+}
+
+sub disable_independant_branches {
+    my $self = shift;
+
+    my $retval = C4::Context->dbh->do( q(update systempreferences set value = '0' where variable = 'IndependantBranches') );
+    ok( $retval, 'set the preference back' );
+
+    
+}
+1;
diff --git a/t/db_dependent/lib/KohaTest/Acquisition/GetHistory.pm b/t/db_dependent/lib/KohaTest/Acquisition/GetHistory.pm
new file mode 100644 (file)
index 0000000..8c7c475
--- /dev/null
@@ -0,0 +1,157 @@
+package KohaTest::Acquisition::GetHistory;
+use base qw( KohaTest::Acquisition );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Acquisition;
+use C4::Context;
+use C4::Members;
+use C4::Biblio;
+use C4::Bookseller;
+
+=head3 no_history
+
+
+
+=cut
+
+sub no_history : Test( 4 ) {
+    my $self = shift;
+
+    # my ( $order_loop, $total_qty, $total_price, $total_qtyreceived) = GetHistory( $title, $author, $name, $from_placed_on, $to_placed_on )
+
+    my ( $order_loop, $total_qty, $total_price, $total_qtyreceived) = GetHistory();
+    # diag( Data::Dumper->Dump( [ $order_loop, $total_qty, $total_price, $total_qtyreceived ], [ qw( order_loop total_qty total_price total_qtyreceived ) ] ) );
+
+    is( scalar @$order_loop, 0, 'order_loop is empty' );
+    is( $total_qty,          0, 'total_qty' );
+    is( $total_price,        0, 'total_price' );
+    is( $total_qtyreceived,  0, 'total_qtyreceived' );
+
+    
+}
+
+=head3 one_order
+
+=cut
+
+sub one_order : Test( 50 ) {
+    my $self = shift;
+    
+    my ( $basketno, $ordernumber ) = $self->create_new_basket();
+    ok( $basketno, "basketno is $basketno" );
+    ok( $ordernumber, "ordernumber is $ordernumber" );
+
+    # No arguments fetches no history.
+    {
+        my ( $order_loop, $total_qty, $total_price, $total_qtyreceived) = GetHistory();
+        # diag( Data::Dumper->Dump( [ $order_loop, $total_qty, $total_price, $total_qtyreceived ], [ qw( order_loop total_qty total_price total_qtyreceived ) ] ) );
+        
+        is( scalar @$order_loop, 0, 'order_loop is empty' );
+        is( $total_qty,          0, 'total_qty' );
+        is( $total_price,        0, 'total_price' );
+        is( $total_qtyreceived,  0, 'total_qtyreceived' );
+    }
+
+    my $bibliodata = GetBiblioData( $self->{'biblios'}[0] );
+    ok( $bibliodata->{'title'}, 'the biblio has a title' )
+      or diag( Data::Dumper->Dump( [ $bibliodata ], [ 'bibliodata' ] ) );
+    
+    # searching by title should find it.
+    {
+        my ( $order_loop, $total_qty, $total_price, $total_qtyreceived) = GetHistory( $bibliodata->{'title'} );
+        # diag( Data::Dumper->Dump( [ $order_loop, $total_qty, $total_price, $total_qtyreceived ], [ qw( order_loop total_qty total_price total_qtyreceived ) ] ) );
+    
+        is( scalar @$order_loop, 1, 'order_loop searched by title' );
+        is( $total_qty,          1, 'total_qty searched by title' );
+        is( $total_price,        1, 'total_price searched by title' );
+        is( $total_qtyreceived,  0, 'total_qtyreceived searched by title' );
+
+        # diag( Data::Dumper->Dump( [ $order_loop ], [ 'order_loop' ] ) );
+    }
+
+    # searching by author
+    {
+        my ( $order_loop, $total_qty, $total_price, $total_qtyreceived) = GetHistory( undef, $bibliodata->{'author'} );
+        # diag( Data::Dumper->Dump( [ $order_loop, $total_qty, $total_price, $total_qtyreceived ], [ qw( order_loop total_qty total_price total_qtyreceived ) ] ) );
+    
+        is( scalar @$order_loop, 1, 'order_loop searched by author' );
+        is( $total_qty,          1, 'total_qty searched by author' );
+        is( $total_price,        1, 'total_price searched by author' );
+        is( $total_qtyreceived,  0, 'total_qtyreceived searched by author' );
+    }
+
+    # searching by name
+    {
+        # diag( Data::Dumper->Dump( [ $bibliodata ], [ 'bibliodata' ] ) );
+
+        my $bookseller = GetBookSellerFromId( $self->{'booksellerid'} );
+        ok( $bookseller->{'name'}, 'bookseller name' )
+          or diag( Data::Dumper->Dump( [ $bookseller ], [ 'bookseller' ] ) );
+        
+        my ( $order_loop, $total_qty, $total_price, $total_qtyreceived) = GetHistory( undef, undef, $bookseller->{'name'} );
+        # diag( Data::Dumper->Dump( [ $order_loop, $total_qty, $total_price, $total_qtyreceived ], [ qw( order_loop total_qty total_price total_qtyreceived ) ] ) );
+    
+        is( scalar @$order_loop, 1, 'order_loop searched by name' );
+        is( $total_qty,          1, 'total_qty searched by name' );
+        is( $total_price,        1, 'total_price searched by name' );
+        is( $total_qtyreceived,  0, 'total_qtyreceived searched by name' );
+    }
+
+    # searching by from_date
+    {
+        my $tomorrow = $self->tomorrow();
+        # diag( "tomorrow is $tomorrow" );
+
+        my ( $order_loop, $total_qty, $total_price, $total_qtyreceived) = GetHistory( undef, undef, undef, undef, $tomorrow );
+        # diag( Data::Dumper->Dump( [ $order_loop, $total_qty, $total_price, $total_qtyreceived ], [ qw( order_loop total_qty total_price total_qtyreceived ) ] ) );
+    
+        is( scalar @$order_loop, 1, 'order_loop searched by to_date' );
+        is( $total_qty,          1, 'total_qty searched by to_date' );
+        is( $total_price,        1, 'total_price searched by to_date' );
+        is( $total_qtyreceived,  0, 'total_qtyreceived searched by to_date' );
+    }
+
+    # searching by from_date
+    {
+        my $yesterday = $self->yesterday();
+        # diag( "yesterday was $yesterday" );
+    
+        my ( $order_loop, $total_qty, $total_price, $total_qtyreceived) = GetHistory( undef, undef, undef, $yesterday );
+        # diag( Data::Dumper->Dump( [ $order_loop, $total_qty, $total_price, $total_qtyreceived ], [ qw( order_loop total_qty total_price total_qtyreceived ) ] ) );
+    
+        is( scalar @$order_loop, 1, 'order_loop searched by from_date' );
+        is( $total_qty,          1, 'total_qty searched by from_date' );
+        is( $total_price,        1, 'total_price searched by from_date' );
+        is( $total_qtyreceived,  0, 'total_qtyreceived searched by from_date' );
+    }
+
+    # set up some things necessary to make GetHistory use the IndependantBranches
+    $self->enable_independant_branches();    
+
+    # just search by title here, we need to search by something.
+    {
+        my ( $order_loop, $total_qty, $total_price, $total_qtyreceived) = GetHistory( $bibliodata->{'title'} );
+        # diag( Data::Dumper->Dump( [ $order_loop, $total_qty, $total_price, $total_qtyreceived ], [ qw( order_loop total_qty total_price total_qtyreceived ) ] ) );
+    
+        is( scalar @$order_loop, 1, 'order_loop searched by title' );
+        is( $total_qty,          1, 'total_qty searched by title' );
+        is( $total_price,        1, 'total_price searched by title' );
+        is( $total_qtyreceived,  0, 'total_qtyreceived searched by title' );
+
+        # diag( Data::Dumper->Dump( [ $order_loop ], [ 'order_loop' ] ) );
+    }
+    
+    # reset that.
+    $self->disable_independant_branches();    
+
+    
+
+    
+}
+
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Acquisition/GetLateOrders.pm b/t/db_dependent/lib/KohaTest/Acquisition/GetLateOrders.pm
new file mode 100644 (file)
index 0000000..a2f95ea
--- /dev/null
@@ -0,0 +1,106 @@
+package KohaTest::Acquisition::GetLateOrders;
+use base qw( KohaTest::Acquisition );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Acquisition;
+use C4::Context;
+use C4::Members;
+
+=head3 no_orders
+
+=cut
+
+sub no_orders : Test( 1 ) {
+    my $self = shift;
+
+    my @orders = GetLateOrders( 1 );
+    is( scalar @orders, 0, 'There are no orders, so we found 0.' ) 
+      or diag( Data::Dumper->Dump( [ \@orders ], [ 'orders' ] ) );
+
+}
+
+=head3 one_order
+
+=cut
+
+sub one_order : Test( 29 ) {
+    my $self = shift;
+
+    my ( $basketid, $ordernumber ) = $self->create_new_basket();
+    ok( $basketid, 'a new basket was created' );
+    ok( $ordernumber, 'the basket has an order in it.' );
+    # we need this basket to be closed.
+    CloseBasket( $basketid );
+    
+    my @orders = GetLateOrders( 0 );
+
+    {
+        my @orders = GetLateOrders( 0 );
+        is( scalar @orders, 1, 'An order closed today is 0 days late.' ) 
+          or diag( Data::Dumper->Dump( [ \@orders ], [ 'orders' ] ) );
+    }
+    {
+        my @orders = GetLateOrders( 1 );
+        is( scalar @orders, 0, 'An order closed today is not 1 day late.' ) 
+          or diag( Data::Dumper->Dump( [ \@orders ], [ 'orders' ] ) );
+    }
+    {
+        my @orders = GetLateOrders( -1 );
+        is( scalar @orders, 1, 'an order closed today is -1 day late.' ) 
+          or diag( Data::Dumper->Dump( [ \@orders ], [ 'orders' ] ) );
+    }
+
+    # provide some vendor information
+    {
+        my @orders = GetLateOrders( 0, $self->{'booksellerid'} );
+        is( scalar @orders, 1, 'We found this late order with the right supplierid.' ) 
+          or diag( Data::Dumper->Dump( [ \@orders ], [ 'orders' ] ) );
+    }
+    {
+        my @orders = GetLateOrders( 0, $self->{'booksellerid'} + 1 );
+        is( scalar @orders, 0, 'We found no late orders with the wrong supplierid.' ) 
+          or diag( Data::Dumper->Dump( [ \@orders ], [ 'orders' ] ) );
+    }
+
+    # provide some branch information
+    my $member = GetMember( borrowernumber=>$self->{'memberid'} );
+    # diag( Data::Dumper->Dump( [ $member ], [ 'member' ] ) );
+    {
+        my @orders = GetLateOrders( 0, $self->{'booksellerid'}, $member->{'branchcode'} );
+        is( scalar @orders, 1, 'We found this late order with the right branchcode.' ) 
+          or diag( Data::Dumper->Dump( [ \@orders ], [ 'orders' ] ) );
+    }
+    {
+        my @orders = GetLateOrders( 0, $self->{'booksellerid'}, 'This is not the branch' );
+        is( scalar @orders, 0, 'We found no late orders with the wrong branchcode.' ) 
+          or diag( Data::Dumper->Dump( [ \@orders ], [ 'orders' ] ) );
+    }
+
+    # set up some things necessary to make GetLateOrders use the IndependantBranches
+    $self->enable_independant_branches();    
+
+    {
+        my @orders = GetLateOrders( 0, $self->{'booksellerid'}, $member->{'branchcode'} );
+        is( scalar @orders, 1, 'We found this late order with the right branchcode.' ) 
+          or diag( Data::Dumper->Dump( [ \@orders ], [ 'orders' ] ) );
+    }
+    {
+        my @orders = GetLateOrders( 0, $self->{'booksellerid'}, 'This is not the branch' );
+        is( scalar @orders, 0, 'We found no late orders with the wrong branchcode.' ) 
+          or diag( Data::Dumper->Dump( [ \@orders ], [ 'orders' ] ) );
+    }
+
+    # reset that.
+    $self->disable_independant_branches();    
+
+}
+
+
+
+
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Acquisition/GetParcel.pm b/t/db_dependent/lib/KohaTest/Acquisition/GetParcel.pm
new file mode 100644 (file)
index 0000000..c26e5f2
--- /dev/null
@@ -0,0 +1,65 @@
+package KohaTest::Acquisition::GetParcel;
+use base qw( KohaTest::Acquisition );
+
+use strict;
+use warnings;
+
+use Test::More;
+use Time::localtime;
+
+use C4::Acquisition;
+
+=head3 no_parcel
+
+at first, there should be no parcels for our bookseller.
+
+=cut
+
+sub no_parcel : Test( 1 ) {
+    my $self = shift;
+
+    my @parcel = GetParcel( $self->{'booksellerid'}, undef, undef );
+    is( scalar @parcel, 0, 'our new bookseller has no parcels' )
+      or diag( Data::Dumper->Dump( [ \@parcel ], [ 'parcel' ] ) );
+}
+
+=head3 one_parcel
+
+we create an order, mark it as received, and then see if we can find
+it with GetParcel.
+
+=cut
+
+sub one_parcel : Test( 17 ) {
+    my $self = shift;
+
+    my $invoice = 123;    # XXX what should this be?
+
+    my $today = sprintf( '%04d-%02d-%02d',
+                         localtime->year() + 1900,
+                         localtime->mon() + 1,
+                         localtime->mday() );
+    my ( $basketno, $ordernumber ) = $self->create_new_basket();
+    
+    ok( $basketno, "my basket number is $basketno" );
+    ok( $ordernumber,   "my order number is $ordernumber" );
+    my $datereceived = ModReceiveOrder( $self->{'biblios'}[0],             # biblionumber
+                                        $ordernumber,       # $ordernumber,
+                                        undef,         # $quantrec,
+                                        undef,         # $user,
+                                        undef,         # $cost,
+                                        $invoice,         # $invoiceno,
+                                        undef,         # $freight,
+                                        undef,         # $rrp,
+                                        $self->{'bookfundid'},         # $bookfund,
+                                        $today,         # $datereceived
+                                   );
+    is( $datereceived, $today, "the parcel was received on $datereceived" );
+
+    my @parcel = GetParcel( $self->{'booksellerid'}, $invoice, $today );
+    is( scalar @parcel, 1, 'we found one (1) parcel.' )
+      or diag( Data::Dumper->Dump( [ \@parcel ], [ 'parcel' ] ) );
+
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Acquisition/GetParcels.pm b/t/db_dependent/lib/KohaTest/Acquisition/GetParcels.pm
new file mode 100644 (file)
index 0000000..fd3ad0f
--- /dev/null
@@ -0,0 +1,289 @@
+package KohaTest::Acquisition::GetParcels;
+use base qw( KohaTest::Acquisition );
+
+use strict;
+use warnings;
+
+use Test::More;
+use Time::localtime;
+
+use C4::Acquisition;
+
+=head2 NOTE
+
+Please do not confuse this with the test suite for C4::Acquisition::GetParcel.
+
+=head3 no_parcels
+
+at first, there should be no parcels for our bookseller.
+
+=cut
+
+sub no_parcels : Test( 1 ) {
+    my $self = shift;
+
+    my @parcels = GetParcels( $self->{'booksellerid'},  # bookseller
+                             # order
+                             # code ( aqorders.booksellerinvoicenumber )
+                             # datefrom
+                             # date to
+                        );
+                            
+    is( scalar @parcels, 0, 'our new bookseller has no parcels' )
+      or diag( Data::Dumper->Dump( [ \@parcels ], [ 'parcels' ] ) );
+}
+
+=head3 one_parcel
+
+we create an order, mark it as received, and then see if we can find
+it with GetParcels.
+
+=cut
+
+sub one_parcel : Test( 19 ) {
+    my $self = shift;
+
+    my $invoice = 123;    # XXX what should this be?
+    my $today = sprintf( '%04d-%02d-%02d',
+                         localtime->year() + 1900,
+                         localtime->mon() + 1,
+                         localtime->mday() );
+
+    $self->create_order( authorizedby => 1,   # XXX what should this be?
+                         invoice      => $invoice,
+                         date         => $today );
+    
+    my @parcels = GetParcels( $self->{'booksellerid'},  # bookseller
+                             # order
+                             # code ( aqorders.booksellerinvoicenumber )
+                             # datefrom
+                             # date to
+                        );
+    is( scalar @parcels, 1, 'we found one (1) parcel.' )
+      or diag( Data::Dumper->Dump( [ \@parcels ], [ 'parcels' ] ) );
+
+    my $thisparcel = shift( @parcels );
+    is( scalar ( keys( %$thisparcel ) ), 6, 'my parcel hashref has 6 keys' )
+      or diag( Data::Dumper->Dump( [ $thisparcel ], [ 'thisparcel' ] ) );
+      
+    is( $thisparcel->{'datereceived'},             $today,   'datereceived' );
+    is( $thisparcel->{'biblio'},                   1,        'biblio' );
+    is( $thisparcel->{'booksellerinvoicenumber'}, $invoice, 'booksellerinvoicenumber' );
+
+    # diag( Data::Dumper->Dump( [ $thisparcel ], [ 'thisparcel' ] ) );
+
+}
+
+=head3 two_parcels
+
+we create another order, mark it as received, and then see if we can find
+them all with GetParcels.
+
+=cut
+
+sub two_parcels : Test( 31 ) {
+    my $self = shift;
+
+    my $invoice = 1234;    # XXX what should this be?
+    my $today = sprintf( '%04d-%02d-%02d',
+                         localtime->year() + 1900,
+                         localtime->mon() + 1,
+                         localtime->mday() );
+    $self->create_order( authorizedby => 1,   # XXX what should this be?
+                         invoice      => $invoice,
+                         date         => $today );
+
+    {
+        # fetch them all and check that this one is last
+        my @parcels = GetParcels( $self->{'booksellerid'},  # bookseller
+                                  # order
+                                  # code ( aqorders.booksellerinvoicenumber )
+                                  # datefrom
+                                  # date to
+                             );
+        is( scalar @parcels, 2, 'we found two (2) parcels.' )
+          or diag( Data::Dumper->Dump( [ \@parcels ], [ 'parcels' ] ) );
+        
+        my $thisparcel = pop( @parcels );
+        is( scalar ( keys( %$thisparcel ) ), 6, 'my parcel hashref has 6 keys' )
+          or diag( Data::Dumper->Dump( [ $thisparcel ], [ 'thisparcel' ] ) );
+        
+        is( $thisparcel->{'datereceived'},             $today,   'datereceived' );
+        is( $thisparcel->{'biblio'},                   1,        'biblio' );
+        is( $thisparcel->{'booksellerinvoicenumber'}, $invoice, 'booksellerinvoicenumber' );
+    }
+
+    {
+        # fetch just one, by using the exact code
+        my @parcels = GetParcels( $self->{'booksellerid'},  # bookseller
+                                  undef,    # order
+                                  $invoice, # code ( aqorders.booksellerinvoicenumber )
+                                  undef,    # datefrom
+                                  undef,    # date to
+                             );
+        is( scalar @parcels, 1, 'we found one (1) parcels.' )
+          or diag( Data::Dumper->Dump( [ \@parcels ], [ 'parcels' ] ) );
+        
+        my $thisparcel = pop( @parcels );
+        is( scalar ( keys( %$thisparcel ) ), 6, 'my parcel hashref has 6 keys' )
+          or diag( Data::Dumper->Dump( [ $thisparcel ], [ 'thisparcel' ] ) );
+        
+        is( $thisparcel->{'datereceived'},             $today,   'datereceived' );
+        is( $thisparcel->{'biblio'},                   1,        'biblio' );
+        is( $thisparcel->{'booksellerinvoicenumber'}, $invoice, 'booksellerinvoicenumber' );
+    }
+    
+    {
+        # fetch them both by using code 123, which gets 123 and 1234
+        my @parcels = GetParcels( $self->{'booksellerid'},  # bookseller
+                                  undef,    # order
+                                  '123', # code ( aqorders.booksellerinvoicenumber )
+                                  undef,    # datefrom
+                                  undef,    # date to
+                             );
+        is( scalar @parcels, 2, 'we found 2 parcels.' )
+          or diag( Data::Dumper->Dump( [ \@parcels ], [ 'parcels' ] ) );
+        
+    }
+    
+    {
+        # fetch them both, and try to order them
+        my @parcels = GetParcels( $self->{'booksellerid'},  # bookseller
+                                  'aqorders.booksellerinvoicenumber',    # order
+                                  undef, # code ( aqorders.booksellerinvoicenumber )
+                                  undef,    # datefrom
+                                  undef,    # date to
+                             );
+        is( scalar @parcels, 2, 'we found 2 parcels.' )
+          or diag( Data::Dumper->Dump( [ \@parcels ], [ 'parcels' ] ) );
+        is( $parcels[0]->{'booksellerinvoicenumber'}, 123 );
+        is( $parcels[1]->{'booksellerinvoicenumber'}, 1234 );
+        
+    }
+    
+    {
+        # fetch them both, and try to order them, descending
+        my @parcels = GetParcels( $self->{'booksellerid'},  # bookseller
+                                  'aqorders.booksellerinvoicenumber desc',    # order
+                                  undef, # code ( aqorders.booksellerinvoicenumber )
+                                  undef,    # datefrom
+                                  undef,    # date to
+                             );
+        is( scalar @parcels, 2, 'we found 2 parcels.' )
+          or diag( Data::Dumper->Dump( [ \@parcels ], [ 'parcels' ] ) );
+        is( $parcels[0]->{'booksellerinvoicenumber'}, 1234 );
+        is( $parcels[1]->{'booksellerinvoicenumber'}, 123 );
+        
+    }
+    
+    
+    
+
+    # diag( Data::Dumper->Dump( [ $thisparcel ], [ 'thisparcel' ] ) );
+
+}
+
+
+=head3 z_several_parcels_with_different_dates
+
+we create an order, mark it as received, and then see if we can find
+it with GetParcels.
+
+=cut
+
+sub z_several_parcels_with_different_dates : Test( 44 ) {
+    my $self = shift;
+
+    my $authorizedby = 1; # XXX what should this be?
+
+    my @inputs = ( { invoice => 10,
+                      date     => sprintf( '%04d-%02d-%02d',
+                                           1950,
+                                           localtime->mon() + 1,
+                                           10 ), # I'm using the invoice number as the day.
+                 },
+                    { invoice => 15,
+                      date     => sprintf( '%04d-%02d-%02d',
+                                           1950,
+                                           localtime->mon() + 1,
+                                           15 ), # I'm using the invoice number as the day.
+                 },
+                    { invoice => 20,
+                      date     => sprintf( '%04d-%02d-%02d',
+                                           1950,
+                                           localtime->mon() + 1,
+                                           20 ), # I'm using the invoice number as the day.
+                 },
+               );
+
+    foreach my $input ( @inputs ) {
+        $self->create_order( authorizedby => $authorizedby,
+                             invoice      => $input->{'invoice'},
+                             date         => $input->{'date'},
+                        );
+    }
+                         
+    my @parcels = GetParcels( $self->{'booksellerid'},  # bookseller
+                              undef, # order
+                              undef, # code ( aqorders.booksellerinvoicenumber )
+                              sprintf( '%04d-%02d-%02d',
+                                       1950,
+                                       localtime->mon() + 1,
+                                       10 ), # datefrom
+                              sprintf( '%04d-%02d-%02d',
+                                       1950,
+                                       localtime->mon() + 1,
+                                       20 ), # dateto
+                        );
+    is( scalar @parcels, scalar @inputs, 'we found all of the parcels.' )
+      or diag( Data::Dumper->Dump( [ \@parcels ], [ 'parcels' ] ) );
+
+    @parcels = GetParcels( $self->{'booksellerid'},  # bookseller
+                           undef, # order
+                           undef, # code ( aqorders.booksellerinvoicenumber )
+                           sprintf( '%04d-%02d-%02d',
+                                    1950,
+                                    localtime->mon() + 1,
+                                    10 ), # datefrom
+                           sprintf( '%04d-%02d-%02d',
+                                    1950,
+                                    localtime->mon() + 1,
+                                    16 ), # dateto
+                        );
+    is( scalar @parcels, scalar @inputs - 1, 'we found all of the parcels except one' )
+      or diag( Data::Dumper->Dump( [ \@parcels ], [ 'parcels' ] ) );
+
+
+
+    # diag( Data::Dumper->Dump( [ $thisparcel ], [ 'thisparcel' ] ) );
+
+}
+
+sub create_order {
+    my $self = shift;
+    my %param = @_;
+    $param{'authorizedby'} = 1 unless exists $param{'authorizedby'};
+    $param{'invoice'}      = 1 unless exists $param{'invoice'};
+    $param{'date'} = sprintf( '%04d-%02d-%02d',
+                              localtime->year() + 1900,
+                              localtime->mon() + 1,
+                              localtime->mday() ) unless exists $param{'date'};
+
+    my ( $basketno, $ordernumber ) = $self->create_new_basket( %param );
+
+    my $datereceived = ModReceiveOrder( $self->{'biblios'}[0],             # biblionumber
+                                        $ordernumber,       # $ordernumber,
+                                        undef,         # $quantrec,
+                                        undef,         # $user,
+                                        undef,         # $cost,
+                                        $param{'invoice'},         # $invoiceno,
+                                        undef,         # $freight,
+                                        undef,         # $rrp,
+                                        $self->{'bookfundid'},         # $bookfund,
+                                        $param{'date'},         # $datereceived
+                                   );
+    is( $datereceived, $param{'date'}, "the parcel was received on $datereceived" );
+
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Acquisition/GetPendingOrders.pm b/t/db_dependent/lib/KohaTest/Acquisition/GetPendingOrders.pm
new file mode 100644 (file)
index 0000000..cf4bb15
--- /dev/null
@@ -0,0 +1,82 @@
+package KohaTest::Acquisition::GetPendingOrders;
+use base qw( KohaTest::Acquisition );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Acquisition;
+
+=head3 no_orders
+
+at first, there should be no orders for our bookseller.
+
+=cut
+
+sub no_orders : Test( 1 ) {
+    my $self = shift;
+
+    my $orders = GetPendingOrders( $self->{'booksellerid'} );
+    is( scalar @$orders, 0, 'our new bookseller has no pending orders' )
+      or diag( Data::Dumper->Dump( [ $orders ], [ 'orders' ] ) );
+}
+
+=head3 new_order
+
+we make an order, then see if it shows up in the pending orders
+
+=cut
+
+sub one_new_order : Test( 49 ) {
+    my $self = shift;
+
+    my ( $basketno, $ordernumber ) = $self->create_new_basket();
+
+    ok( $basketno, "basketno is $basketno" );
+    ok( $ordernumber, "ordernumber is $ordernumber" );
+    
+    my $orders = GetPendingOrders( $self->{'booksellerid'} );
+    is( scalar @$orders, 1, 'we successfully entered one order.' );
+
+    my @expectedfields = qw( basketno
+                             biblioitemnumber
+                             biblionumber
+                             booksellerinvoicenumber
+                             budgetdate
+                             cancelledby
+                             closedate
+                             creationdate
+                             currency
+                             datecancellationprinted
+                             datereceived
+                             ecost
+                             entrydate
+                             firstname
+                             freight
+                             gst
+                             listprice
+                             notes
+                             ordernumber
+                             purchaseordernumber
+                             quantity
+                             quantityreceived
+                             rrp
+                             serialid
+                             sort1
+                             sort2
+                             subscription
+                             supplierreference
+                             surname
+                             timestamp
+                             title
+                             totalamount
+                             unitprice );
+    my $firstorder = $orders->[0];
+    for my $field ( @expectedfields ) {
+        ok( exists( $firstorder->{ $field } ), "This order has a $field field" );
+    }
+    
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Acquisition/NewOrder.pm b/t/db_dependent/lib/KohaTest/Acquisition/NewOrder.pm
new file mode 100644 (file)
index 0000000..972cde2
--- /dev/null
@@ -0,0 +1,108 @@
+package KohaTest::Acquisition::NewOrder;
+use base qw( KohaTest::Acquisition );
+
+use strict;
+use warnings;
+
+use Test::More;
+use Time::localtime;
+
+use C4::Acquisition;
+
+=head3 new_order_no_budget
+
+If we make a new order and don't pass in a budget date, it defaults to
+today.
+
+=cut
+
+sub new_order_no_budget : Test( 4 ) {
+    my $self = shift;
+
+    my $authorizedby = 1; # XXX what should this be?
+    my $invoice = 123;    # XXX what should this be?
+    my $today = sprintf( '%04d-%02d-%02d',
+                         localtime->year() + 1900,
+                         localtime->mon() + 1,
+                         localtime->mday() );
+    my ( $basketno, $ordernumber ) = NewOrder( undef, # $basketno,
+                                          1, # $bibnum,
+                                          undef, # $title,
+                                          undef, # $quantity,
+                                          undef, # $listprice,
+                                          $self->{'booksellerid'}, # $booksellerid,
+                                          $authorizedby, # $authorisedby,
+                                          undef, # $notes,
+                                          $self->{'bookfundid'},     # $bookfund,
+                                          undef, # $bibitemnum,
+                                          undef, # $rrp,
+                                          undef, # $ecost,
+                                          undef, # $gst,
+                                          undef, # $budget,
+                                          undef, # $cost,
+                                          undef, # $sub,
+                                          $invoice, # $invoice,
+                                          undef, # $sort1,
+                                          undef, # $sort2,
+                                          undef, # $purchaseorder,
+                                                                                 undef, # $branchcode
+                                     );
+    ok( $basketno, "my basket number is $basketno" );
+    ok( $ordernumber,   "my order number is $ordernumber" );
+
+    my $order = GetOrder( $ordernumber );
+    is( $order->{'ordernumber'}, $ordernumber, 'got the right order' )
+      or diag( Data::Dumper->Dump( [ $order ], [ 'order' ] ) );
+    
+    is( $order->{'budgetdate'}, $today, "the budget date is $today" );
+}
+
+=head3 new_order_set_budget
+
+Let's set the budget date of this new order. It actually pretty much
+only pays attention to the current month and year.
+
+=cut
+
+sub new_order_set_budget : Test( 4 ) {
+    my $self = shift;
+
+    my $authorizedby = 1; # XXX what should this be?
+    my $invoice = 123;    # XXX what should this be?
+    my $today = sprintf( '%04d-%02d-%02d',
+                         localtime->year() + 1900,
+                         localtime->mon() + 1,
+                         localtime->mday() );
+    my ( $basketno, $ordernumber ) = NewOrder( undef, # $basketno,
+                                          1, # $bibnum,
+                                          undef, # $title,
+                                          undef, # $quantity,
+                                          undef, # $listprice,
+                                          $self->{'booksellerid'}, # $booksellerid,
+                                          $authorizedby, # $authorisedby,
+                                          undef, # $notes,
+                                          $self->{'bookfundid'},     # $bookfund,
+                                          undef, # $bibitemnum,
+                                          undef, # $rrp,
+                                          undef, # $ecost,
+                                          undef, # $gst,
+                                          'does not matter, just not undef', # $budget,
+                                          undef, # $cost,
+                                          undef, # $sub,
+                                          $invoice, # $invoice,
+                                          undef, # $sort1,
+                                          undef, # $sort2,
+                                          undef, # $purchaseorder,
+                                                                                 undef, # $branchcode
+                                     );
+    ok( $basketno, "my basket number is $basketno" );
+    ok( $ordernumber,   "my order number is $ordernumber" );
+
+    my $order = GetOrder( $ordernumber );
+    is( $order->{'ordernumber'}, $ordernumber, 'got the right order' )
+      or diag( Data::Dumper->Dump( [ $order ], [ 'order' ] ) );
+    
+    like( $order->{'budgetdate'}, qr(^2\d\d\d-07-01$), "the budget date ($order->{'budgetdate'}) is a July 1st." );
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/AuthoritiesMarc.pm b/t/db_dependent/lib/KohaTest/AuthoritiesMarc.pm
new file mode 100644 (file)
index 0000000..6114843
--- /dev/null
@@ -0,0 +1,41 @@
+package KohaTest::AuthoritiesMarc;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::AuthoritiesMarc;
+sub testing_class { 'C4::AuthoritiesMarc' };
+
+
+sub methods : Test( 1 ) {
+    my $self = shift;
+    my @methods = qw( GetAuthMARCFromKohaField 
+                      SearchAuthorities 
+                      CountUsage 
+                      CountUsageChildren 
+                      GetAuthTypeCode 
+                      GetTagsLabels 
+                      AddAuthority 
+                      DelAuthority 
+                      ModAuthority 
+                      GetAuthorityXML 
+                      GetAuthority 
+                      GetAuthType 
+                      AUTHhtml2marc 
+                      FindDuplicateAuthority 
+                      BuildSummary
+                      BuildUnimarcHierarchies
+                      BuildUnimarcHierarchy
+                      GetHeaderAuthority
+                      AddAuthorityTrees
+                      merge 
+                      get_auth_type_location 
+                );
+    
+    can_ok( $self->testing_class, @methods );    
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Biblio.pm b/t/db_dependent/lib/KohaTest/Biblio.pm
new file mode 100644 (file)
index 0000000..3e6634c
--- /dev/null
@@ -0,0 +1,73 @@
+package KohaTest::Biblio;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Biblio;
+sub testing_class { 'C4::Biblio' };
+
+
+sub methods : Test( 1 ) {
+    my $self = shift;
+    my @methods = qw(
+                       AddBiblio
+                       ModBiblio
+                       ModBiblioframework
+                       DelBiblio
+                       LinkBibHeadingsToAuthorities
+                       GetBiblioData
+                       GetBiblioItemData
+                       GetBiblioItemByBiblioNumber
+                       GetBiblioFromItemNumber
+                       GetBiblio
+                       GetBiblioItemInfosOf
+                       GetMarcStructure
+                       GetUsedMarcStructure
+                       GetMarcFromKohaField
+                       GetMarcBiblio
+                       GetXmlBiblio
+                       GetAuthorisedValueDesc
+                       GetMarcNotes
+                       GetMarcSubjects
+                       GetMarcAuthors
+                       GetMarcUrls
+                       GetMarcSeries
+                       GetFrameworkCode
+                       GetPublisherNameFromIsbn
+                       TransformKohaToMarc
+                       TransformKohaToMarcOneField
+                       TransformHtmlToXml
+                       TransformHtmlToMarc
+                       TransformMarcToKoha
+                       _get_inverted_marc_field_map
+                       _disambiguate
+                       get_koha_field_from_marc
+                       TransformMarcToKohaOneField
+                       PrepareItemrecordDisplay
+                       ModZebra
+                       GetNoZebraIndexes
+                       _DelBiblioNoZebra
+                       _AddBiblioNoZebra
+                       _find_value
+                       _koha_marc_update_bib_ids
+                       _koha_marc_update_biblioitem_cn_sort
+                       _koha_add_biblio
+                       _koha_modify_biblio
+                       _koha_modify_biblioitem_nonmarc
+                       _koha_add_biblioitem
+                       _koha_delete_biblio
+                       _koha_delete_biblioitems
+                       ModBiblioMarc
+                       z3950_extended_services
+                       set_service_options
+                       get_biblio_authorised_values
+                );
+    
+    can_ok( $self->testing_class, @methods );    
+}
+
+1;
+
diff --git a/t/db_dependent/lib/KohaTest/Biblio/GetNoZebraIndexes.pm b/t/db_dependent/lib/KohaTest/Biblio/GetNoZebraIndexes.pm
new file mode 100644 (file)
index 0000000..11dffbe
--- /dev/null
@@ -0,0 +1,72 @@
+package KohaTest::Biblio::GetNoZebraIndexes;
+use base qw( KohaTest::Biblio );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Biblio;
+
+=head2 STARTUP METHODS
+
+These get run once, before the main test methods in this module
+
+=cut
+
+
+=head2 TEST METHODS
+
+standard test methods
+
+=head3 
+
+=cut
+    
+sub returns_expected_hashref : Test(2) {
+    my $self = shift;
+
+    my %nzi = C4::Biblio::GetNoZebraIndexes();
+    ok( scalar keys %nzi, 'got some keys from GetNoZebraIndexes' );
+
+    my %expected = (
+        'title'        => '130a,210a,222a,240a,243a,245a,245b,246a,246b,247a,247b,250a,250b,440a,830a',
+        'author'       => '100a,100b,100c,100d,110a,111a,111b,111c,111d,245c,700a,710a,711a,800a,810a,811a',
+        'isbn'         => '020a',
+        'issn'         => '022a',
+        'lccn'         => '010a',
+        'biblionumber' => '999c',
+        'itemtype'     => '942c',
+        'publisher'    => '260b',
+        'date'         => '260c',
+        'note'         => '500a,501a,504a,505a,508a,511a,518a,520a,521a,522a,524a,526a,530a,533a,538a,541a,546a,555a,556a,562a,563a,583a,585a,582a',
+        'subject'      => '600*,610*,611*,630*,650*,651*,653*,654*,655*,662*,690*',
+        'dewey'        => '082',
+        'bc'           => '952p',
+        'callnum'      => '952o',
+        'an'           => '6009,6109,6119',
+        'homebranch'   => '952a,952c'
+    );
+    is_deeply( \%nzi, \%expected, 'GetNoZebraIndexes returns the expected hashref' );
+}
+
+=head2 HELPER METHODS
+
+These methods are used by other test methods, but
+are not meant to be called directly.
+
+=cut
+
+=cut
+
+
+=head2 SHUTDOWN METHODS
+
+These get run once, after the main test methods in this module
+
+=head3 
+
+=cut
+
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Biblio/ModBiblio.pm b/t/db_dependent/lib/KohaTest/Biblio/ModBiblio.pm
new file mode 100644 (file)
index 0000000..5b29ea8
--- /dev/null
@@ -0,0 +1,154 @@
+package KohaTest::Biblio::ModBiblio;
+use base qw( KohaTest::Biblio );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Biblio;
+use C4::Items;
+
+=head2 STARTUP METHODS
+
+These get run once, before the main test methods in this module
+
+=head3 add_bib_to_modify
+
+=cut
+
+sub add_bib_to_modify : Test( startup => 3 ) {
+    my $self = shift;
+
+    my $bib = MARC::Record->new();
+    $bib->leader('     ngm a22     7a 4500');   
+    $bib->append_fields(
+        MARC::Field->new('100', ' ', ' ', a => 'Moffat, Steven'),
+        MARC::Field->new('245', ' ', ' ', a => 'Silence in the library'),
+    );
+    
+    my ($bibnum, $bibitemnum) = AddBiblio($bib, '');
+    $self->{'bib_to_modify'} = $bibnum;
+
+    # add an item
+    my ($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => 'CPL', holdingbranch => 'CPL' } , $bibnum);
+
+    cmp_ok($item_bibnum, '==', $bibnum, "new item is linked to correct biblionumber"); 
+    cmp_ok($item_bibitemnum, '==', $bibitemnum, "new item is linked to correct biblioitemnumber"); 
+
+    $self->reindex_marc(); 
+
+    my $marc = $self->fetch_bib($bibnum);
+    $self->sort_item_and_bibnumber_fields($marc);
+    $self->{'bib_to_modify_formatted'} = $marc->as_formatted(); # simple way to compare later
+}
+
+=head2 TEST METHODS
+
+standard test methods
+
+=head3 bug_2297
+
+Regression test for bug 2297 (saving a subscription duplicates MARC  item fields)
+
+=cut
+
+sub bug_2297 : Test( 5 ) {
+    my $self = shift;
+
+    my $bibnum = $self->{'bib_to_modify'};
+    my $marc = $self->fetch_bib($bibnum);
+    $self->check_item_count($marc, 1);
+
+    ModBiblio($marc, $bibnum, ''); # no change made to bib
+
+    my $modified_marc = $self->fetch_bib($bibnum);
+    diag "checking item field count after null modification";
+    $self->check_item_count($modified_marc, 1);
+
+    $self->sort_item_and_bibnumber_fields($modified_marc);
+    is($modified_marc->as_formatted(), $self->{'bib_to_modify_formatted'}, "no change to bib after null modification");
+}
+
+=head2 HELPER METHODS
+
+These methods are used by other test methods, but
+are not meant to be called directly.
+
+=cut
+
+=head3 fetch_bib
+
+=cut
+
+sub fetch_bib { # +1 to test count per call
+    my $self = shift;
+    my $bibnum = shift;
+
+    my $marc = GetMarcBiblio($bibnum);
+    ok(defined($marc), "retrieved bib record $bibnum");
+
+    return $marc;
+}
+
+=head3 check_item_count
+
+=cut
+
+sub check_item_count { # +1 to test count per call
+    my $self = shift;
+    my $marc = shift;
+    my $expected_items = shift;
+
+    my ($itemtag, $itemsubfield) = GetMarcFromKohaField("items.itemnumber", '');
+    my @item_fields = $marc->field($itemtag);
+    cmp_ok(scalar(@item_fields), "==", $expected_items, "exactly one item field");
+}
+
+=head3 sort_item_and_bibnumber_fields
+
+This method sorts the field containing the embedded item data
+and the bibnumber - ModBiblio(), AddBiblio(), and ModItem() do
+not guarantee that these fields will be sorted in tag order.
+
+=cut
+
+sub sort_item_and_bibnumber_fields {
+    my $self = shift;
+    my $marc = shift;
+
+    my ($itemtag, $itemsubfield)     = GetMarcFromKohaField("items.itemnumber", '');
+    my ($bibnumtag, $bibnumsubfield) = GetMarcFromKohaField("biblio.biblionumber", '');
+
+    my @item_fields = ();
+    foreach my $field ($marc->field($itemtag)) {
+        push @item_fields, $field;
+        $marc->delete_field($field);
+    }
+    $marc->insert_fields_ordered(@item_fields) if scalar(@item_fields);;
+   
+    my @bibnum_fields = (); 
+    foreach my $field ($marc->field($bibnumtag)) {
+        push @bibnum_fields, $field;
+        $marc->delete_field($field);
+    }
+    $marc->insert_fields_ordered(@bibnum_fields) if scalar(@bibnum_fields);
+
+}
+
+=head2 SHUTDOWN METHODS
+
+These get run once, after the main test methods in this module
+
+=head3 shutdown_clean_object
+
+=cut
+
+sub shutdown_clean_object : Test( shutdown => 0 ) {
+    my $self = shift;
+
+    delete $self->{'bib_to_modify'};
+    delete $self->{'bib_to_modify_formatted'};
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Biblio/get_biblio_authorised_values.pm b/t/db_dependent/lib/KohaTest/Biblio/get_biblio_authorised_values.pm
new file mode 100644 (file)
index 0000000..aab03a0
--- /dev/null
@@ -0,0 +1,48 @@
+package KohaTest::Biblio::get_biblio_authorised_values;
+use base qw( KohaTest::Biblio );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Biblio;
+
+=head2 STARTUP METHODS
+
+These get run once, before the main test methods in this module
+
+=head3 insert_test_data
+
+=cut
+
+sub insert_test_data : Test( startup => 71 ) {
+    my $self = shift;
+    
+    # I'm going to add a bunch of biblios so that I can search for them.
+    $self->add_biblios( count     => 10,
+                        add_items => 1 );
+    
+
+}
+
+=head2 TEST METHODS
+
+standard test methods
+
+=head3 basic_test
+
+basic usage.
+
+=cut
+
+sub basic_test : Test( 1 ) {
+    my $self = shift;
+
+    ok( $self->{'biblios'}[0], 'we have a biblionumber' );
+    my $authorised_values = C4::Biblio::get_biblio_authorised_values( $self->{'biblios'}[0] );
+    diag( Data::Dumper->Dump( [ $authorised_values ], [ 'authorised_values' ] ) );
+    
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Branch.pm b/t/db_dependent/lib/KohaTest/Branch.pm
new file mode 100644 (file)
index 0000000..ce7ff60
--- /dev/null
@@ -0,0 +1,36 @@
+package KohaTest::Branch;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Branch;
+sub testing_class { 'C4::Branch' };
+
+
+sub methods : Test( 1 ) {
+    my $self = shift;
+    my @methods = qw( GetBranches
+                      GetBranchName
+                      ModBranch
+                      GetBranchCategory
+                      GetBranchCategories
+                      GetCategoryTypes
+                      GetBranch
+                      GetBranchDetail
+                      get_branchinfos_of
+                      GetBranchesInCategory
+                      GetBranchInfo
+                      DelBranch
+                      ModBranchCategoryInfo
+                      DelBranchCategory
+                      CheckBranchCategorycode
+                );
+    
+    can_ok( $self->testing_class, @methods );    
+}
+
+1;
+
diff --git a/t/db_dependent/lib/KohaTest/Branch/GetBranches.pm b/t/db_dependent/lib/KohaTest/Branch/GetBranches.pm
new file mode 100644 (file)
index 0000000..1dc5d0f
--- /dev/null
@@ -0,0 +1,41 @@
+package KohaTest::Branch::GetBranches;
+use base qw( KohaTest::Branch );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Branch;
+
+=head2 STARTUP METHODS
+
+These get run once, before the main test methods in this module
+
+=cut
+
+=head2 TEST METHODS
+
+standard test methods
+
+=head3 onlymine
+
+    When you pass in something true to GetBranches, it limits the
+    response to only your branch.
+
+=cut
+
+sub onlymine : Test( 4 ) {
+    my $self = shift;
+
+    # C4::Branch::GetBranches uses this variable, so make sure it exists.
+    ok( C4::Context->userenv->{'branch'}, 'we have a branch' );
+    my $branches = C4::Branch::GetBranches( 'onlymine' );
+    # diag( Data::Dumper->Dump( [ $branches ], [ 'branches' ] ) );
+    is( scalar( keys %$branches ), 1, 'one key for our branch only' );
+    ok( exists $branches->{ C4::Context->userenv->{'branch'} }, 'my branch was returned' );
+    is( $branches->{ C4::Context->userenv->{'branch'} }->{'branchcode'}, C4::Context->userenv->{'branch'}, 'branchcode' );
+    
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Breeding.pm b/t/db_dependent/lib/KohaTest/Breeding.pm
new file mode 100644 (file)
index 0000000..d098ae5
--- /dev/null
@@ -0,0 +1,23 @@
+package KohaTest::Breeding;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Breeding;
+sub testing_class { 'C4::Breeding' };
+
+
+sub methods : Test( 1 ) {
+    my $self = shift;
+    my @methods = qw( ImportBreeding 
+                      BreedingSearch 
+                );
+    
+    can_ok( $self->testing_class, @methods );    
+}
+
+1;
+
diff --git a/t/db_dependent/lib/KohaTest/Calendar.pm b/t/db_dependent/lib/KohaTest/Calendar.pm
new file mode 100644 (file)
index 0000000..8b1cda7
--- /dev/null
@@ -0,0 +1,34 @@
+package KohaTest::Calendar;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Calendar;
+sub testing_class { 'C4::Calendar' };
+
+
+sub methods : Test( 1 ) {
+    my $self = shift;
+    my @methods = qw( new
+                      get_week_days_holidays
+                      get_day_month_holidays
+                      get_exception_holidays
+                      get_single_holidays
+                      insert_week_day_holiday
+                      insert_day_month_holiday
+                      insert_single_holiday
+                      insert_exception_holiday
+                      delete_holiday
+                      isHoliday
+                      addDate
+                      daysBetween
+                );
+    
+    can_ok( $self->testing_class, @methods );    
+}
+
+1;
+
diff --git a/t/db_dependent/lib/KohaTest/Calendar/New.pm b/t/db_dependent/lib/KohaTest/Calendar/New.pm
new file mode 100644 (file)
index 0000000..745366b
--- /dev/null
@@ -0,0 +1,186 @@
+package KohaTest::Calendar::New;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Calendar;
+sub testing_class { 'C4::Calendar' };
+
+
+=head2 STARTUP METHODS
+
+These get run once, before the main test methods in this module
+
+=cut
+
+=head2 TEST METHODS
+
+standard test methods
+
+=head3 instantiation
+
+  just test to see if I can instantiate an object
+
+=cut
+
+sub instantiation : Test( 14 ) {
+    my $self = shift;
+
+    my $calendar = C4::Calendar->new( branchcode => '' );
+    isa_ok( $calendar, 'C4::Calendar' );
+    # diag( Data::Dumper->Dump( [ $calendar ], [ 'calendar' ] ) );
+
+    ok( exists $calendar->{'day_month_holidays'}, 'day_month_holidays' );
+    ok( exists $calendar->{'single_holidays'},    'single_holidays' );
+    ok( exists $calendar->{'week_days_holidays'}, 'week_days_holidays' );
+    ok( exists $calendar->{'exception_holidays'}, 'exception_holidays' );
+
+    # sample data has Sundays as a holiday
+    ok( exists $calendar->{'week_days_holidays'}->{'0'} );
+    is( $calendar->{'week_days_holidays'}->{'0'}->{'title'},       '',        'Sunday title' );
+    is( $calendar->{'week_days_holidays'}->{'0'}->{'description'}, 'Sundays', 'Sunday description' );
+    
+    # sample data has Christmas as a holiday
+    ok( exists $calendar->{'day_month_holidays'}->{'12/25'} );
+    is( $calendar->{'day_month_holidays'}->{'12/25'}->{'title'},       '',          'Christmas title' );
+    is( $calendar->{'day_month_holidays'}->{'12/25'}->{'description'}, 'Christmas', 'Christmas description' );
+    
+    # sample data has New Year's Day as a holiday
+    ok( exists $calendar->{'day_month_holidays'}->{'1/1'} );
+    is( $calendar->{'day_month_holidays'}->{'1/1'}->{'title'},       '',                'New Year title' );
+    is( $calendar->{'day_month_holidays'}->{'1/1'}->{'description'}, q(New Year's Day), 'New Year description' );
+    
+}
+
+sub week_day_holidays : Test( 8 ) {
+    my $self = shift;
+
+    my $calendar = C4::Calendar->new( branchcode => '' );
+    isa_ok( $calendar, 'C4::Calendar' );
+    # diag( Data::Dumper->Dump( [ $calendar ], [ 'calendar' ] ) );
+
+    ok( exists $calendar->{'week_days_holidays'}, 'week_days_holidays' );
+
+    my %new_holiday = ( weekday     => 1,
+                        title       => 'example week_day_holiday',
+                        description => 'This is an example week_day_holiday used for testing' );
+    my $new_calendar = $calendar->insert_week_day_holiday( %new_holiday );
+
+    # the calendar object returned from insert_week_day_holiday should be updated
+    isa_ok( $new_calendar, 'C4::Calendar' );
+    is( $new_calendar->{'week_days_holidays'}->{ $new_holiday{'weekday'} }->{'title'}, $new_holiday{'title'}, 'title' );
+    is( $new_calendar->{'week_days_holidays'}->{ $new_holiday{'weekday'} }->{'description'}, $new_holiday{'description'}, 'description' );
+
+    # new calendar objects should have the newly inserted holiday.
+    my $refreshed_calendar = C4::Calendar->new( branchcode => '' );
+    isa_ok( $refreshed_calendar, 'C4::Calendar' );
+    # diag( Data::Dumper->Dump( [ $calendar ], [ 'calendar' ] ) );
+    is( $new_calendar->{'week_days_holidays'}->{ $new_holiday{'weekday'} }->{'title'}, $new_holiday{'title'}, 'title' );
+    is( $new_calendar->{'week_days_holidays'}->{ $new_holiday{'weekday'} }->{'description'}, $new_holiday{'description'}, 'description' );
+
+}
+  
+
+sub day_month_holidays : Test( 8 ) {
+    my $self = shift;
+
+    my $calendar = C4::Calendar->new( branchcode => '' );
+    isa_ok( $calendar, 'C4::Calendar' );
+    # diag( Data::Dumper->Dump( [ $calendar ], [ 'calendar' ] ) );
+
+    ok( exists $calendar->{'day_month_holidays'}, 'day_month_holidays' );
+
+    my %new_holiday = ( day        => 4,
+                        month       => 5,
+                        title       => 'example day_month_holiday',
+                        description => 'This is an example day_month_holiday used for testing' );
+    my $new_calendar = $calendar->insert_day_month_holiday( %new_holiday );
+
+    # the calendar object returned from insert_week_day_holiday should be updated
+    isa_ok( $new_calendar, 'C4::Calendar' );
+    my $mmdd = sprintf('%s/%s', $new_holiday{'month'}, $new_holiday{'day'} ) ;
+    is( $new_calendar->{'day_month_holidays'}->{ $mmdd }->{'title'}, $new_holiday{'title'}, 'title' );
+    is( $new_calendar->{'day_month_holidays'}->{ $mmdd }->{'description'}, $new_holiday{'description'}, 'description' );
+
+    # new calendar objects should have the newly inserted holiday.
+    my $refreshed_calendar = C4::Calendar->new( branchcode => '' );
+    isa_ok( $refreshed_calendar, 'C4::Calendar' );
+    # diag( Data::Dumper->Dump( [ $calendar ], [ 'calendar' ] ) );
+    is( $new_calendar->{'day_month_holidays'}->{ $mmdd }->{'title'}, $new_holiday{'title'}, 'title' );
+    is( $new_calendar->{'day_month_holidays'}->{ $mmdd }->{'description'}, $new_holiday{'description'}, 'description' );
+
+}
+  
+
+
+sub exception_holidays : Test( 8 ) {
+    my $self = shift;
+
+    my $calendar = C4::Calendar->new( branchcode => '' );
+    isa_ok( $calendar, 'C4::Calendar' );
+    # diag( Data::Dumper->Dump( [ $calendar ], [ 'calendar' ] ) );
+
+    ok( exists $calendar->{'exception_holidays'}, 'exception_holidays' );
+
+    my %new_holiday = ( day        => 4,
+                        month       => 5,
+                        year        => 2010,
+                        title       => 'example exception_holiday',
+                        description => 'This is an example exception_holiday used for testing' );
+    my $new_calendar = $calendar->insert_exception_holiday( %new_holiday );
+    # diag( Data::Dumper->Dump( [ $new_calendar ], [ 'newcalendar' ] ) );
+
+    # the calendar object returned from insert_week_day_holiday should be updated
+    isa_ok( $new_calendar, 'C4::Calendar' );
+    my $yyyymmdd = sprintf('%s/%s/%s', $new_holiday{'year'}, $new_holiday{'month'}, $new_holiday{'day'} ) ;
+    is( $new_calendar->{'exception_holidays'}->{ $yyyymmdd }->{'title'}, $new_holiday{'title'}, 'title' );
+    is( $new_calendar->{'exception_holidays'}->{ $yyyymmdd }->{'description'}, $new_holiday{'description'}, 'description' );
+
+    # new calendar objects should have the newly inserted holiday.
+    my $refreshed_calendar = C4::Calendar->new( branchcode => '' );
+    isa_ok( $refreshed_calendar, 'C4::Calendar' );
+    # diag( Data::Dumper->Dump( [ $calendar ], [ 'calendar' ] ) );
+    is( $new_calendar->{'exception_holidays'}->{ $yyyymmdd }->{'title'}, $new_holiday{'title'}, 'title' );
+    is( $new_calendar->{'exception_holidays'}->{ $yyyymmdd }->{'description'}, $new_holiday{'description'}, 'description' );
+
+}
+
+
+sub single_holidays : Test( 8 ) {
+    my $self = shift;
+
+    my $calendar = C4::Calendar->new( branchcode => '' );
+    isa_ok( $calendar, 'C4::Calendar' );
+    # diag( Data::Dumper->Dump( [ $calendar ], [ 'calendar' ] ) );
+
+    ok( exists $calendar->{'single_holidays'}, 'single_holidays' );
+
+    my %new_holiday = ( day        => 4,
+                        month       => 5,
+                        year        => 2011,
+                        title       => 'example single_holiday',
+                        description => 'This is an example single_holiday used for testing' );
+    my $new_calendar = $calendar->insert_single_holiday( %new_holiday );
+    # diag( Data::Dumper->Dump( [ $new_calendar ], [ 'newcalendar' ] ) );
+
+    # the calendar object returned from insert_week_day_holiday should be updated
+    isa_ok( $new_calendar, 'C4::Calendar' );
+    my $yyyymmdd = sprintf('%s/%s/%s', $new_holiday{'year'}, $new_holiday{'month'}, $new_holiday{'day'} ) ;
+    is( $new_calendar->{'single_holidays'}->{ $yyyymmdd }->{'title'}, $new_holiday{'title'}, 'title' );
+    is( $new_calendar->{'single_holidays'}->{ $yyyymmdd }->{'description'}, $new_holiday{'description'}, 'description' );
+
+    # new calendar objects should have the newly inserted holiday.
+    my $refreshed_calendar = C4::Calendar->new( branchcode => '' );
+    isa_ok( $refreshed_calendar, 'C4::Calendar' );
+    # diag( Data::Dumper->Dump( [ $calendar ], [ 'calendar' ] ) );
+    is( $new_calendar->{'single_holidays'}->{ $yyyymmdd }->{'title'}, $new_holiday{'title'}, 'title' );
+    is( $new_calendar->{'single_holidays'}->{ $yyyymmdd }->{'description'}, $new_holiday{'description'}, 'description' );
+
+}
+  
+
+1;
+
diff --git a/t/db_dependent/lib/KohaTest/Category.pm b/t/db_dependent/lib/KohaTest/Category.pm
new file mode 100644 (file)
index 0000000..3febfda
--- /dev/null
@@ -0,0 +1,23 @@
+package KohaTest::Category;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Category;
+sub testing_class { 'C4::Category' };
+
+
+sub methods : Test( 1 ) {
+    my $self = shift;
+    my @methods = qw( 
+                    new
+                    all
+                );
+    
+    can_ok( $self->testing_class, @methods );    
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Circulation.pm b/t/db_dependent/lib/KohaTest/Circulation.pm
new file mode 100644 (file)
index 0000000..7d5e69d
--- /dev/null
@@ -0,0 +1,142 @@
+package KohaTest::Circulation;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Circulation;
+sub testing_class { 'C4::Circulation' };
+
+
+sub methods : Test( 1 ) {
+    my $self = shift;
+    my @methods = qw( barcodedecode 
+                      decode 
+                      transferbook 
+                      TooMany 
+                      itemissues 
+                      CanBookBeIssued 
+                      AddIssue 
+                      GetLoanLength 
+                      GetIssuingRule 
+                      GetBranchBorrowerCircRule
+                      AddReturn 
+                      MarkIssueReturned 
+                      _FixOverduesOnReturn
+                      _FixAccountForLostAndReturned
+                      GetItemIssue 
+                      GetItemIssues 
+                      GetBiblioIssues 
+                      GetUpcomingDueIssues
+                      CanBookBeRenewed 
+                      AddRenewal 
+                      GetRenewCount 
+                      GetIssuingCharges 
+                      AddIssuingCharge 
+                      GetTransfers 
+                      GetTransfersFromTo 
+                      DeleteTransfer 
+                      AnonymiseIssueHistory 
+                      updateWrongTransfer 
+                      UpdateHoldingbranch 
+                      CalcDateDue  
+                      CheckValidDatedue 
+                      CheckRepeatableHolidays
+                      CheckSpecialHolidays
+                      CheckRepeatableSpecialHolidays
+                      CheckValidBarcode
+                );
+    
+    can_ok( $self->testing_class, @methods );    
+}
+
+=head3 setup_add_biblios
+
+everything in the C4::Circulation really requires items, so let's do this in the setup phase.
+
+=cut
+
+sub setup_add_biblios : Tests( setup => 8 ) {
+    my $self = shift;
+
+    # we want to use a fresh batch of items, so clear these lists:
+    delete $self->{'items'};
+    delete $self->{'biblios'};
+
+    $self->add_biblios( add_items => 1 );
+}
+
+
+=head3 checkout_first_item
+
+named parameters:
+  borrower  => borrower hashref, computed from $self->{'memberid'} if not given
+  barcode   => item barcode, barcode of $self->{'items'}[0] if not given
+  issuedate => YYYY-MM-DD of date to mark issue checked out. defaults to today.
+
+=cut
+
+sub checkout_first_item {
+    my $self   = shift;
+    my $params = shift;
+
+    # get passed in borrower, or default to the one in $self.
+    my $borrower = $params->{'borrower'};
+    if ( ! defined $borrower ) {
+        my $borrowernumber = $self->{'memberid'};
+        $borrower = C4::Members::GetMemberDetails( $borrowernumber );
+    }
+
+    # get the barcode passed in, or default to the first one in the items list
+    my $barcode = $params->{'barcode'};
+    if ( ! defined $barcode ) {
+        return unless $self->{'items'}[0]{'itemnumber'};
+        $barcode = $self->get_barcode_from_itemnumber( $self->{'items'}[0]{'itemnumber'} );
+    }
+
+    # get issuedate from parameters. Default to undef, which will be interpreted as today
+    my $issuedate = $params->{'issuedate'};
+
+    my ( $issuingimpossible, $needsconfirmation ) = C4::Circulation::CanBookBeIssued( $borrower, $barcode );
+
+    my $datedue = C4::Circulation::AddIssue(
+        $borrower,    # borrower
+        $barcode,     # barcode
+        undef,        # datedue
+        undef,        # cancelreserve
+        $issuedate    # issuedate
+    );
+
+    my $issues = C4::Circulation::GetItemIssue( $self->{'items'}[0]{'itemnumber'} );
+
+    return $issues->{'date_due'};
+}
+
+=head3 get_barcode_from_itemnumber
+
+pass in an itemnumber, returns a barcode.
+
+Should this get moved up to KohaTest.pm? Or, is there a better alternative in C4?
+
+=cut
+
+sub get_barcode_from_itemnumber {
+    my $self       = shift;
+    my $itemnumber = shift;
+
+    my $sql = <<END_SQL;
+SELECT barcode
+  FROM items
+  WHERE itemnumber = ?
+END_SQL
+    my $dbh = C4::Context->dbh()  or return;
+    my $sth = $dbh->prepare($sql) or return;
+    $sth->execute($itemnumber) or return;
+    my ($barcode) = $sth->fetchrow_array;
+    return $barcode;
+}
+
+1;
+
diff --git a/t/db_dependent/lib/KohaTest/Circulation/AddIssue.pm b/t/db_dependent/lib/KohaTest/Circulation/AddIssue.pm
new file mode 100644 (file)
index 0000000..2c3e393
--- /dev/null
@@ -0,0 +1,132 @@
+package KohaTest::Circulation::AddIssue;
+use base qw(KohaTest::Circulation);
+
+use strict;
+use warnings;
+
+use Test::More;
+
+=head2 basic_usage
+
+basic usage of C4::Circulation::AddIssue
+
+Note: This logic is repeated in
+KohaTest::Circulation::checkout_first_item, but without tests. This
+includes tests at each step to make it easier to track down what's
+broken as we go along.
+
+=cut
+
+sub basic_usage : Test( 13 ) {
+    my $self = shift;
+
+    my $borrowernumber = $self->{'memberid'};
+    ok( $borrowernumber, "we're going to work with borrower: $borrowernumber" );
+
+    my $borrower = C4::Members::GetMemberDetails( $borrowernumber );
+    ok( $borrower, '...and we were able to look up that borrower' );
+    is( $borrower->{'borrowernumber'}, $borrowernumber, '...and they have the right borrowernumber' );
+
+    my $itemnumber = $self->{'items'}[0]{'itemnumber'};
+    ok( $itemnumber, "We're going to checkout itemnumber $itemnumber" );
+    my $barcode = $self->get_barcode_from_itemnumber($itemnumber);
+    ok( $barcode, "...which has barcode $barcode" );
+
+    my $before_issues = C4::Circulation::GetItemIssue( $self->{'items'}[0]{'itemnumber'} );
+    # Note that we can't check for $before_issues as undef because GetItemIssue always returns a populated hashref
+    ok( ! defined $before_issues->{'borrowernumber'}, '...and is not currently checked out' )
+      or diag( Data::Dumper->Dump( [ $before_issues ], [ 'before_issues' ] ) );
+
+    my ( $issuingimpossible, $needsconfirmation ) = C4::Circulation::CanBookBeIssued( $borrower, $barcode );
+    is( scalar keys %$issuingimpossible, 0, 'the item CanBookBeIssued' )
+      or diag( Data::Dumper->Dump( [ $issuingimpossible, $needsconfirmation ], [ qw( issuingimpossible needsconfirmation ) ] ) );
+    is( scalar keys %$needsconfirmation, 0, '...and the transaction does not needsconfirmation' )
+      or diag( Data::Dumper->Dump( [ $issuingimpossible, $needsconfirmation ], [ qw( issuingimpossible needsconfirmation ) ] ) );
+
+    # bug 2758 don't ask for confirmation if patron has $0.00 account balance
+    # and IssuingInProcess is on
+    my $orig_issuing_in_process = C4::Context->preference('IssuingInProcess');
+    my $dbh = C4::Context->dbh;
+    $dbh->do("UPDATE systempreferences SET value = 1 WHERE variable = 'IssuingInProcess'");
+    C4::Context->clear_syspref_cache(); # FIXME not needed after a syspref mutator is written
+    ( $issuingimpossible, $needsconfirmation ) = C4::Circulation::CanBookBeIssued( $borrower, $barcode );
+    is( scalar keys %$issuingimpossible, 0, 'the item CanBookBeIssued with IssuingInProcess ON (bug 2758)' )
+      or diag( Data::Dumper->Dump( [ $issuingimpossible, $needsconfirmation ], [ qw( issuingimpossible needsconfirmation ) ] ) );
+    is( scalar keys %$needsconfirmation, 0, 
+        '...and the transaction does not needsconfirmation with IssuingInProcess ON (bug 2758)' )
+      or diag( Data::Dumper->Dump( [ $issuingimpossible, $needsconfirmation ], [ qw( issuingimpossible needsconfirmation ) ] ) );
+    $dbh->do("UPDATE systempreferences SET value = ? WHERE variable = 'IssuingInProcess'", {}, $orig_issuing_in_process);
+    C4::Context->clear_syspref_cache(); # FIXME not needed after a syspref mutator is written
+
+    my $datedue = C4::Circulation::AddIssue( $borrower, $barcode );
+    ok( $datedue, "the item has been issued and it is due: $datedue" );
+    
+    my $after_issues = C4::Circulation::GetItemIssue( $self->{'items'}[0]{'itemnumber'} );
+    is( $after_issues->{'borrowernumber'}, $borrowernumber, '...and now it is checked out to our borrower' )
+      or diag( Data::Dumper->Dump( [ $after_issues ], [ 'after_issues' ] ) );
+
+    my $loanlength = Date::Calc::Delta_Days( split( /-/, $after_issues->{'issuedate'} ), split( /-/, $after_issues->{'date_due'} ) );
+    ok( $loanlength, "the loanlength is $loanlength days" );
+
+    # save this here since we refer to it in set_issuedate.
+    $self->{'loanlength'} = $loanlength;
+
+}
+
+=head2 set_issuedate
+
+Make sure that we can set the issuedate of an issue.
+
+Also, since we are specifying an issuedate and not a due date, the due
+date should be calculated from the issuedate, not today.
+
+=cut
+
+sub set_issuedate : Test( 7 ) {
+    my $self = shift;
+
+    my $before_issues = C4::Circulation::GetItemIssue( $self->{'items'}[0]{'itemnumber'} );
+    ok( ! defined $before_issues->{'borrowernumber'}, 'At this beginning, this item was not checked out.' )
+      or diag( Data::Dumper->Dump( [ $before_issues ], [ 'before_issues' ] ) );
+
+    my $issuedate = $self->random_date();
+    ok( $issuedate, "Check out an item on $issuedate" );
+    my $datedue = $self->checkout_first_item( { issuedate => $issuedate } );
+    ok( $datedue, "...and it's due on $datedue" );
+
+    my $after_issues = C4::Circulation::GetItemIssue( $self->{'items'}[0]{'itemnumber'} );
+    is( $after_issues->{'borrowernumber'}, $self->{'memberid'}, 'We found this item checked out to our member.' )
+      or diag( Data::Dumper->Dump( [ $after_issues ], [ 'issues' ] ) );
+    is( $after_issues->{'issuedate'}, $issuedate, "...and it was issued on $issuedate" )
+      or diag( Data::Dumper->Dump( [ $after_issues ], [ 'after_issues' ] ) );
+    
+    my $loanlength = Date::Calc::Delta_Days( split( /-/, $after_issues->{'issuedate'} ), split( /-/, $after_issues->{'date_due'} ) );
+    ok( $loanlength, "the loanlength is $loanlength days" );
+    is( $loanlength, $self->{'loanlength'} );
+}
+
+sub set_lastreneweddate_on_renewal : Test( 6 ) {
+    my $self = shift;
+
+    my $before_issues = C4::Circulation::GetItemIssue( $self->{'items'}[0]{'itemnumber'} );
+    ok( ! defined $before_issues->{'borrowernumber'}, 'At this beginning, this item was not checked out.' )
+      or diag( Data::Dumper->Dump( [ $before_issues ], [ 'before_issues' ] ) );
+
+    my $datedue = $self->checkout_first_item( { issuedate => $self->yesterday() } );
+    ok( $datedue, "The item is checked out and it's due on $datedue" );
+
+    my $issuedate = $self->random_date();
+    ok( $issuedate, "Check out an item again on $issuedate" );
+    # This will actually be a renewal
+    $datedue = $self->checkout_first_item( { issuedate => $issuedate } );
+    ok( $datedue, "...and it's due on $datedue" );
+
+    my $after_issues = C4::Circulation::GetItemIssue( $self->{'items'}[0]{'itemnumber'} );
+    is( $after_issues->{'borrowernumber'}, $self->{'memberid'}, 'We found this item checked out to our member.' )
+      or diag( Data::Dumper->Dump( [ $after_issues ], [ 'issues' ] ) );
+    is( $after_issues->{'lastreneweddate'}, $issuedate, "...and it was renewed on $issuedate" )
+      or diag( Data::Dumper->Dump( [ $after_issues ], [ 'after_issues' ] ) );
+    
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Circulation/GetUpcomingDueIssues.pm b/t/db_dependent/lib/KohaTest/Circulation/GetUpcomingDueIssues.pm
new file mode 100644 (file)
index 0000000..95dd1af
--- /dev/null
@@ -0,0 +1,26 @@
+package KohaTest::Circulation::GetUpcomingDueIssues;
+use base qw(KohaTest::Circulation);
+
+use strict;
+use warnings;
+
+use Test::More;
+
+=head2 basic_usage
+
+basic usage of C4::Circulation::GetUpcomingDueIssues()
+
+=cut
+
+sub basic_usage : Test(2) {
+    my $self = shift;
+
+    my $upcoming = C4::Circulation::GetUpcomingDueIssues();
+    isa_ok( $upcoming, 'ARRAY' );
+
+    is( scalar @$upcoming, 0, 'no issues yet' )
+      or diag( Data::Dumper->Dump( [$upcoming], ['upcoming'] ) );
+}
+
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Circulation/MarkIssueReturned.pm b/t/db_dependent/lib/KohaTest/Circulation/MarkIssueReturned.pm
new file mode 100644 (file)
index 0000000..5722bcf
--- /dev/null
@@ -0,0 +1,85 @@
+package KohaTest::Circulation::MarkIssueReturned;
+use base qw(KohaTest::Circulation);
+
+use strict;
+use warnings;
+
+use Test::More;
+
+=head2 basic_usage
+
+basic usage of C4::Circulation::MarkIssueReturned
+
+=cut
+
+sub basic_usage : Test( 4 ) {
+    my $self = shift;
+
+    my $before_issues = C4::Circulation::GetItemIssue( $self->{'items'}[0]{'itemnumber'} );
+    ok( ! defined $before_issues->{'borrowernumber'}, 'our item is not checked out' )
+      or diag( Data::Dumper->Dump( [ $before_issues ], [ 'before_issues' ] ) );
+
+    my $datedue = $self->checkout_first_item();
+    ok( $datedue, "Now it is checked out and due on $datedue" );
+
+    my $after_issues = C4::Circulation::GetItemIssue( $self->{'items'}[0]{'itemnumber'} );
+    is( $after_issues->{'borrowernumber'}, $self->{'memberid'}, 'Our item is checked out to our borrower' )
+      or diag( Data::Dumper->Dump( [ $after_issues ], [ 'after_issues' ] ) );
+
+    C4::Circulation::MarkIssueReturned( $self->{'memberid'}, $self->{'items'}[0]{'itemnumber'} );
+
+    my $after_return = C4::Circulation::GetItemIssue( $self->{'items'}[0]{'itemnumber'} );
+    ok( ! defined $after_return->{'borrowernumber'}, 'The item is no longer checked out' )
+      or diag( Data::Dumper->Dump( [ $after_return ], [ 'after_return' ] ) );
+
+}
+
+=head2 set_returndate
+
+check an item out, then, check it back in, specifying the returndate.
+
+verify that it's checked back in and the returndate is correct.
+
+=cut
+
+sub set_retundate : Test( 7 ) {
+    my $self = shift;
+
+    # It's not checked out to start with
+    my $before_issues = C4::Circulation::GetItemIssue( $self->{'items'}[0]{'itemnumber'} );
+    ok( ! defined $before_issues->{'borrowernumber'}, 'our item is not checked out' )
+      or diag( Data::Dumper->Dump( [ $before_issues ], [ 'before_issues' ] ) );
+
+    # check it out
+    my $datedue = $self->checkout_first_item();
+    ok( $datedue, "Now it is checked out and due on $datedue" );
+
+    # verify that it has been checked out
+    my $after_issues = C4::Circulation::GetItemIssue( $self->{'items'}[0]{'itemnumber'} );
+    is( $after_issues->{'borrowernumber'}, $self->{'memberid'}, 'Our item is checked out to our borrower' )
+      or diag( Data::Dumper->Dump( [ $after_issues ], [ 'after_issues' ] ) );
+
+    # mark it as returned on some date
+    my $returndate = $self->random_date();
+    ok( $returndate, "return this item on $returndate" );
+
+    C4::Circulation::MarkIssueReturned( $self->{'memberid'},
+                                        $self->{'items'}[0]{'itemnumber'},
+                                        undef,
+                                        $returndate );
+
+    # validate that it is no longer checked out.
+    my $after_return = C4::Circulation::GetItemIssue( $self->{'items'}[0]{'itemnumber'} );
+    ok( ! defined $after_return->{'borrowernumber'}, 'The item is no longer checked out' )
+      or diag( Data::Dumper->Dump( [ $after_return ], [ 'after_return' ] ) );
+
+    # grab the history for this item and make sure it looks right
+    my $history = C4::Circulation::GetItemIssues( $self->{'items'}[0]{'itemnumber'}, 1 );
+    is( scalar @$history, 1, 'this item has been checked out one time.' )
+      or diag( Data::Dumper->Dump( [ $history ], [ 'history' ] ) );
+    is( $history->[0]{'returndate'}, $returndate, "...and it was returned on $returndate" );
+    
+}
+
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Context.pm b/t/db_dependent/lib/KohaTest/Context.pm
new file mode 100644 (file)
index 0000000..bba7f88
--- /dev/null
@@ -0,0 +1,54 @@
+package KohaTest::Context;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Context;
+sub testing_class { 'C4::Context' };
+
+
+sub methods : Test( 1 ) {
+    my $self = shift;
+    my @methods = qw(
+                        AUTOLOAD
+                        boolean_preference
+                        config
+                        dbh
+                        db_scheme2dbi
+                        get_shelves_userenv
+                        get_versions
+                        import
+                        KOHAVERSION
+                        marcfromkohafield
+                        ModZebrations
+                        new
+                        new_dbh
+                        preference
+                        read_config_file
+                        restore_context
+                        restore_dbh
+                        set_context
+                        set_dbh
+                        set_shelves_userenv
+                        set_userenv
+                        stopwords
+                        userenv
+                        Zconn
+                        zebraconfig
+                        _common_config
+                        _new_dbh
+                        _new_marcfromkohafield
+                        _new_stopwords
+                        _new_userenv
+                        _new_Zconn
+                        _unset_userenv
+                );
+    
+    can_ok( $self->testing_class, @methods );    
+}
+
+1;
+
diff --git a/t/db_dependent/lib/KohaTest/Context/preference.pm b/t/db_dependent/lib/KohaTest/Context/preference.pm
new file mode 100644 (file)
index 0000000..2ad73d1
--- /dev/null
@@ -0,0 +1,54 @@
+package KohaTest::Context::preference;
+use base qw( KohaTest::Context );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Context;
+sub testing_class { 'C4::Context' };
+
+
+=head2 STARTUP METHODS
+
+These get run once, before the main test methods in this module
+
+=cut
+
+=head2 TEST METHODS
+
+standard test methods
+
+=head3 preference_does_not_exist
+
+=cut
+
+sub preference_does_not_exist : Test( 1 ) {
+    my $self = shift;
+
+    my $missing = C4::Context->preference( 'doesnotexist' );
+
+    is( $missing, undef, 'a query for a missing syspref returns undef' )
+      or diag( Data::Dumper->Dump( [ $missing ], [ 'missing' ] ) );
+    
+}
+
+
+=head3 version_preference
+
+=cut
+
+sub version_preference : Test( 1 ) {
+    my $self = shift;
+
+    my $version = C4::Context->preference( 'version' );
+
+    ok( $version, 'C4::Context->preference returns a good version number' )
+      or diag( Data::Dumper->Dump( [ $version ], [ 'version' ] ) );
+    
+}
+
+
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Dates.pm b/t/db_dependent/lib/KohaTest/Dates.pm
new file mode 100644 (file)
index 0000000..19a309d
--- /dev/null
@@ -0,0 +1,37 @@
+package KohaTest::Dates;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Dates;
+sub testing_class { 'C4::Dates' };
+
+
+sub methods : Test( 1 ) {
+    my $self = shift;
+    my @methods = qw( _prefformat
+                      regexp
+                      dmy_map
+                      _check_date_and_time
+                      _chron_to_ymd
+                      _chron_to_hms
+                      new
+                      init
+                      output
+                      today
+                      _recognize_format
+                      DHTMLcalendar
+                      format
+                      visual
+                      format_date
+                      format_date_in_iso
+                );
+    
+    can_ok( $self->testing_class, @methods );    
+}
+
+1;
+
diff --git a/t/db_dependent/lib/KohaTest/Dates/Usage.pm b/t/db_dependent/lib/KohaTest/Dates/Usage.pm
new file mode 100644 (file)
index 0000000..8815c89
--- /dev/null
@@ -0,0 +1,103 @@
+package KohaTest::Dates::Usage;
+use base qw( KohaTest::Dates );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Dates qw(format_date format_date_in_iso);
+
+
+sub startup_init_constants : Tests(startup => 0) {
+    my $self = shift;
+    $self->{thash} = {
+        iso    => [ '2001-01-01',         '1989-09-21',         '1952-01-00' ],
+        metric => [ "01-01-2001",         '21-09-1989',         '00-01-1952' ],
+        us     => [ "01-01-2001",         '09-21-1989',         '01-00-1952' ],
+        sql    => [ '20010101    010101', '19890921    143907', '19520100    000000' ],
+    };
+    $self->{formats} = [ sort keys %{ $self->{thash} } ];
+}
+
+sub check_formats : Test( 8 ) {
+    my $self = shift;
+
+    my $syspref = C4::Dates->new->format();
+    ok( $syspref, "Your system preference is: $syspref" );
+
+    foreach ( @{ $self->{thash}->{'iso'} } ) {
+        ok( format_date($_), "able to format_date() on $_" );
+    }
+
+    foreach ( @{ $self->{thash}->{$syspref} } ) {
+        ok( format_date_in_iso($_), "able to format_date_in_iso() on $_" );
+    }
+    ok( C4::Dates->today(), "(default) CLASS ->today : " . C4::Dates->today() );
+}
+
+sub defaults : Test( 24 ) {
+    my $self = shift;
+
+    foreach (@{ $self->{formats} }) {
+        my $pre = sprintf '(%-6s)', $_;
+        my $date = C4::Dates->new();
+        ok( $date, "$pre Date Creation   : new()" );
+        isa_ok( $date, 'C4::Dates' );
+        ok( $_ eq $date->format($_),   "$pre format($_)      : " );
+        ok( $date->visual(), "$pre visual()" );
+        ok( $date->output(), "$pre output()" );
+        ok( $date->today(),  "$pre object->today" );
+
+    }
+}
+
+sub valid_inputs : Test( 108 ) {
+    my $self = shift;
+
+    foreach my $format (@{ $self->{formats} }) {
+        my $pre = sprintf '(%-6s)', $format;
+        foreach my $testval ( @{ $self->{thash}->{$format} } ) {
+            my ( $val, $today );
+            my $date = C4::Dates->new( $testval, $format );
+            ok( $date, "$pre Date Creation   : new('$testval','$format')" );
+            isa_ok( $date, 'C4::Dates' );
+            ok( $date->regexp, "$pre has regexp()" );
+            ok( $val = $date->output(), describe( "$pre output()", $val ) );
+            foreach ( grep { !/$format/ } @{ $self->{formats} } ) {
+                ok( $today = $date->output($_), describe( sprintf( "$pre output(%8s)", "'$_'" ), $today ) );
+            }
+            ok( $today = $date->today(), describe( "$pre object->today", $today ) );
+            ok( $val = $date->output(), describe( "$pre output()", $val ) );
+        }
+    }
+}
+
+sub independence_from_class : Test( 1 ) {
+    my $self = shift;
+
+    my $in1  = '12/25/1952';                       # us
+    my $in2  = '13/01/2001';                       # metric
+    my $d1   = C4::Dates->new( $in1, 'us' );
+    my $d2   = C4::Dates->new( $in2, 'metric' );
+    my $out1 = $d1->output('iso');
+    my $out2 = $d2->output('iso');
+    ok( $out1 ne $out2, "subsequent constructors get different dataspace ($out1 != $out2)" );
+
+}
+
+
+
+sub describe {
+    my $front = sprintf( "%-25s", shift );
+    my $tail = shift || 'FAILED';
+    return "$front : $tail";
+}
+
+sub shutdown_clear_constants : Tests( shutdown => 0 ) {
+    my $self = shift;
+    delete $self->{thash};
+    delete $self->{formats};
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Heading.pm b/t/db_dependent/lib/KohaTest/Heading.pm
new file mode 100644 (file)
index 0000000..4f781a2
--- /dev/null
@@ -0,0 +1,27 @@
+package KohaTest::Heading;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Heading;
+sub testing_class { 'C4::Heading' };
+
+
+sub methods : Test( 1 ) {
+    my $self = shift;
+    my @methods = qw( 
+                    new_from_bib_field
+                    display_form
+                    authorities
+                    preferred_authorities
+                    _query_limiters
+                    _marc_format_handler
+                );
+    
+    can_ok( $self->testing_class, @methods );    
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Heading/MARC21.pm b/t/db_dependent/lib/KohaTest/Heading/MARC21.pm
new file mode 100644 (file)
index 0000000..41cd4d3
--- /dev/null
@@ -0,0 +1,41 @@
+package KohaTest::Heading::MARC21;
+use base qw( KohaTest::Heading );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Heading;
+use C4::Heading::MARC21;
+
+use MARC::Field;
+
+sub testing_class { 'C4::Heading::MARC21' };
+
+sub methods : Test( 1 ) {
+    my $self = shift;
+    my @methods = qw( 
+                    new
+                    valid_bib_heading_tag
+                    parse_heading
+                    _get_subject_thesaurus
+                    _get_search_heading
+                    _get_display_heading
+                );
+    
+    can_ok( $self->testing_class, @methods );    
+}
+
+sub bug2315 : Test( 1 ) {
+
+    my $subject_heading = MARC::Field->new(650, ' ', '0', 
+                                                a   => "Dalziel, Andrew (Fictitious character",
+                                                ')' => "Fiction."
+                                           );
+    my $display_form = C4::Heading::MARC21::_get_display_heading($subject_heading, 'a');
+    is($display_form, "Dalziel, Andrew (Fictitious character", "bug 2315: no crash if heading subfield has metacharacter");
+
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/ImportBatch.pm b/t/db_dependent/lib/KohaTest/ImportBatch.pm
new file mode 100644 (file)
index 0000000..a8fefaa
--- /dev/null
@@ -0,0 +1,130 @@
+package KohaTest::ImportBatch;
+use base qw(KohaTest);
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::ImportBatch;
+use C4::Matcher;
+sub testing_class { 'C4::ImportBatch' };
+
+
+sub routines : Test( 1 ) {
+    my $self = shift;
+    my @routines = qw(
+                        GetZ3950BatchId
+                        GetImportRecordMarc
+                        AddImportBatch
+                        GetImportBatch
+                        AddBiblioToBatch
+                        ModBiblioInBatch
+                        BatchStageMarcRecords
+                        AddItemsToImportBiblio
+                        BatchFindBibDuplicates
+                        BatchCommitBibRecords
+                        BatchCommitItems
+                        BatchRevertBibRecords
+                        BatchRevertItems
+                        CleanBatch
+                        GetAllImportBatches
+                        GetImportBatchRangeDesc
+                        GetItemNumbersFromImportBatch
+                        GetNumberOfNonZ3950ImportBatches
+                        GetImportBibliosRange
+                        GetBestRecordMatch
+                        GetImportBatchStatus
+                        SetImportBatchStatus
+                        GetImportBatchOverlayAction
+                        SetImportBatchOverlayAction
+                        GetImportBatchNoMatchAction
+                        SetImportBatchNoMatchAction
+                        GetImportBatchItemAction
+                        SetImportBatchItemAction
+                        GetImportBatchItemAction
+                        SetImportBatchItemAction
+                        GetImportBatchMatcher
+                        SetImportBatchMatcher
+                        GetImportRecordOverlayStatus
+                        SetImportRecordOverlayStatus
+                        GetImportRecordStatus
+                        SetImportRecordStatus
+                        GetImportRecordMatches
+                        SetImportRecordMatches
+                        _create_import_record
+                        _update_import_record_marc
+                        _add_biblio_fields
+                        _update_biblio_fields
+                        _parse_biblio_fields
+                        _update_batch_record_counts
+                        _get_commit_action
+                        _get_revert_action
+                );
+    
+    can_ok($self->testing_class, @routines);
+}
+
+sub startup_50_add_matcher : Test( startup => 1 ) {
+    my $self = shift;
+    # create test MARC21 ISBN matcher
+    my $matcher = C4::Matcher->new('biblio');
+    $matcher->threshold(1000);
+    $matcher->code('TESTISBN');
+    $matcher->description('test MARC21 ISBN matcher');
+    $matcher->add_simple_matchpoint('isbn', 1000, '020', 'a', -1, 0, '');
+    my $matcher_id = $matcher->store();
+    like($matcher_id, qr/^\d+$/, "store new matcher and get back ID");
+
+    $self->{'matcher_id'} = $matcher_id;
+}
+
+sub shutdown_50_remove_matcher : Test( shutdown => 6) {
+    my $self = shift;
+    my @matchers = C4::Matcher::GetMatcherList();
+    cmp_ok(scalar(@matchers), ">=", 1, "at least one matcher present");
+    my $matcher_id;
+    my $testisbn_count = 0;
+    # look for TESTISBN
+    foreach my $matcher (@matchers) {
+        if ($matcher->{'code'} eq 'TESTISBN') {
+            $testisbn_count++;
+            $matcher_id = $matcher->{'matcher_id'};
+        }
+    }
+    ok($testisbn_count == 1, "only one TESTISBN matcher");
+    like($matcher_id, qr/^\d+$/, "matcher ID is valid");
+    my $matcher = C4::Matcher->fetch($matcher_id);
+    ok(defined($matcher), "got back a matcher");
+    ok($matcher_id == $matcher->{'id'}, "got back the correct matcher");
+    C4::Matcher->delete($matcher_id);
+    my $matcher2 = C4::Matcher->fetch($matcher_id);
+    ok(not(defined($matcher2)), "matcher removed");
+
+    delete $self->{'matcher_id'};
+}
+
+=head2 UTILITY METHODS
+
+=cut
+
+sub add_import_batch {
+    my $self       = shift;
+    my $test_batch = shift
+      || {
+        overlay_action => 'create_new',
+        import_status  => 'staging',
+        batch_type     => 'batch',
+        file_name      => 'foo',
+        comments       => 'inserted during automated testing',
+      };
+    my $batch_id = AddImportBatch( $test_batch->{'overlay_action'},
+                                   $test_batch->{'import_status'},
+                                   $test_batch->{'batch_type'},
+                                   $test_batch->{'file_name'},
+                                   $test_batch->{'comments'}, );
+    return $batch_id;
+}
+
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/ImportBatch/AddImportBatch.pm b/t/db_dependent/lib/KohaTest/ImportBatch/AddImportBatch.pm
new file mode 100644 (file)
index 0000000..7b97e72
--- /dev/null
@@ -0,0 +1,31 @@
+package KohaTest::ImportBatch::AddImportBatch;
+use base qw( KohaTest::ImportBatch );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::ImportBatch;
+use C4::Matcher;
+use C4::Biblio;
+
+
+=head3 add_one
+
+=cut
+
+sub add_one : Test( 1 ) {
+    my $self = shift;
+
+    my $batch_id = AddImportBatch(
+        'create_new',                           #overlay_action
+        'staging',                              # import_status
+        'batch',                                # batc_type
+        'foo',                                  # file_name
+        'inserted during automated testing',    # comments
+    );
+    ok( $batch_id, "successfully inserted batch: $batch_id" );
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/ImportBatch/AddItemsToImportBiblio.pm b/t/db_dependent/lib/KohaTest/ImportBatch/AddItemsToImportBiblio.pm
new file mode 100644 (file)
index 0000000..39d36df
--- /dev/null
@@ -0,0 +1,29 @@
+package KohaTest::ImportBatch::getImportBatch;
+use base qw( KohaTest::ImportBatch );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::ImportBatch;
+use C4::Matcher;
+use C4::Biblio;
+
+
+sub something : Test( 2 ) {
+    my $self = shift;
+
+    my $batch_id = $self->add_import_batch();
+    ok( $batch_id, 'we have a batch_id' );
+
+    my $import_record_id = 0;
+
+    my $marc_record = MARC::Record->new();
+    
+    my @import_item_ids = C4::ImportBatch::AddItemsToImportBiblio( $batch_id, $import_record_id, $marc_record );
+    is( scalar( @import_item_ids ), 0, 'none inserted' );
+
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/ImportBatch/BatchStageCommitRevert.pm b/t/db_dependent/lib/KohaTest/ImportBatch/BatchStageCommitRevert.pm
new file mode 100644 (file)
index 0000000..94f8115
--- /dev/null
@@ -0,0 +1,252 @@
+package KohaTest::ImportBatch::BatchStageCommitRevert;
+use base qw( KohaTest::ImportBatch );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::ImportBatch;
+use C4::Matcher;
+use C4::Biblio;
+
+# define test records for various batches
+sub startup_60_make_test_records : Test( startup ) {
+    my $self = shift;
+    $self->{'batches'} = {
+        'batch1' => { 
+                        marc => _make_marc_batch([
+                            ['isbn001', 'title 1', ['batch-item-1'] ],
+                            ['isbn002', 'title 2', [] ],
+                            ['isbn003', 'title 3', ['batch-item-2','batch-item-3'] ],
+                            ['isbn004', 'title 4', [ 'batch-item-4' ] ],
+                            ['isbn005', 'title 5', [ 'batch-item-5', 'batch-item-6', 'batch-item-7' ] ],
+                        ]),
+                        args => {
+                            parse_items => 1,
+                            overlay_action => 'create_new',
+                            nomatch_action => 'create_new',
+                            item_action => 'always_add',
+                        },
+                        results => {
+                            num_bibs  => 5,
+                            num_items => 7,
+                            num_invalid => 0,
+                            num_matches => 0,
+                            num_added => 5,
+                            num_updated => 0,
+                            num_items_added => 7,
+                            num_items_errored => 0,
+                            num_ignored => 0,
+                        },
+                    },
+        'batch2' => {
+                        marc => _make_marc_batch([
+                            ['isbn001', 'overlay title 1', ['batch-item-8'] ],
+                            ['isbn002', 'overlay title 2', ['batch-item-9'] ],
+                            ['isbn006', 'title 6', ['batch-item-10'] ],
+                        ]),
+                        args => {
+                            parse_items => 1,
+                            overlay_action => 'replace',
+                            nomatch_action => 'create_new',
+                            item_action => 'always_add',
+                        },
+                        results => {
+                            num_bibs  => 3,
+                            num_items => 3,
+                            num_invalid => 0,
+                            num_matches => 2,
+                            num_added => 1,
+                            num_updated => 2,
+                            num_items_added => 3,
+                            num_items_errored => 0,
+                            num_ignored => 0,
+                        },
+                    },
+        'batch3' => {
+                        marc => _make_marc_batch([ 
+                            ['isbn007', 'title 7', ['batch-item-11'] ],
+                            ['isbn006', 'overlay title 6', ['batch-item-12'] ],
+                        ]),
+                        args => {
+                            parse_items => 1,
+                            overlay_action => 'ignore',
+                            nomatch_action => 'ignore',
+                            item_action => 'always_add',
+                        },
+                        results => {
+                            num_bibs  => 2,
+                            num_items => 2,
+                            num_invalid => 0,
+                            num_matches => 1,
+                            num_added => 0,
+                            num_updated => 0,
+                            num_items_added => 1,
+                            num_items_errored => 0,
+                            num_ignored => 2,
+                        },
+                    },
+        'batch4' => {
+                        marc => _make_marc_batch([ 
+                            ['isbn008', 'title 8', ['batch-item-13'] ], # not loading this item
+                        ]),
+                        args => {
+                            parse_items => 0,
+                            overlay_action => undef,
+                            nomatch_action => 'create_new',
+                            item_action => 'ignore',
+                        },
+                        results => {
+                            num_bibs  => 1,
+                            num_items => 0,
+                            num_invalid => 0,
+                            num_matches => 0,
+                            num_added => 1,
+                            num_updated => 0,
+                            num_items_added => 0,
+                            num_items_errored => 0,
+                            num_ignored => 0,
+                        },
+                    },
+        'batch5' => {
+                        marc => _make_marc_batch([ 
+                            ['isbn009', 'title 9', ['batch-item-1'] ], # trigger dup barcode error
+                            'junkjunkjunkjunk', # trigger invalid bib
+                        ]),
+                        args => {
+                            parse_items => 1,
+                            overlay_action => undef,
+                            nomatch_action => undef,
+                            item_action => undef,
+                        },
+                        results => {
+                            num_bibs  => 1,
+                            num_items => 1,
+                            num_invalid => 1,
+                            num_matches => 0,
+                            num_added => 1,
+                            num_updated => 0,
+                            num_items_added => 0,
+                            num_items_errored => 1,
+                            num_ignored => 0,
+                        },
+                    },
+        'batch6' => {
+                        marc => _make_marc_batch([ 
+                            ['isbn001', 'match title 1', ['batch-item-14', 'batch-item-15'] ],
+                            ['isbn010', 'title 10', ['batch-item-16', 'batch-item-17'] ],
+                        ]),
+                        args => {
+                            parse_items => 1,
+                            overlay_action => 'ignore',
+                            nomatch_action => 'create_new',
+                            item_action => 'always_add',
+                        },
+                        results => {
+                            num_bibs  => 2,
+                            num_items => 4,
+                            num_invalid => 0,
+                            num_matches => 1,
+                            num_added => 1,
+                            num_updated => 0,
+                            num_items_added => 4,
+                            num_items_errored => 0,
+                            num_ignored => 1,
+                        },
+                    },
+    };
+    
+}
+
+sub _make_marc_batch {
+    my $defs = shift;
+    my @marc = ();
+    foreach my $rec (@$defs) {
+        if (ref($rec) eq 'ARRAY') {
+            my $isbn = $rec->[0];
+            my $title = $rec->[1];
+            my $items = $rec->[2];
+            my $bib = MARC::Record->new();
+            $bib->leader('     nam a22     7a 4500');
+            $bib->append_fields(MARC::Field->new('020', ' ', ' ', a => $isbn),
+                                MARC::Field->new('245', ' ', ' ', a => $title));
+            foreach my $barcode (@$items) {
+                my ($itemtag, $toss, $barcodesf, $branchsf);
+                ($itemtag, $toss)   = GetMarcFromKohaField('items.itemnumber', '');
+                ($toss, $barcodesf) = GetMarcFromKohaField('items.barcode', '');
+                ($toss, $branchsf)  = GetMarcFromKohaField('items.homebranch', '');
+                $bib->append_fields(MARC::Field->new($itemtag, ' ', ' ', $barcodesf => $barcode, $branchsf => 'CPL')); 
+                        # FIXME: define branch in KohaTest
+            }
+            push @marc, $bib->as_usmarc();
+        } else {
+            push @marc, $rec;
+        }
+    }
+    return join('', @marc);
+}
+
+sub stage_commit_batches : Test( 75 ) {
+    my $self = shift;
+
+    my $matcher = C4::Matcher->fetch($self->{'matcher_id'});
+    ok(ref($matcher) eq 'C4::Matcher', "retrieved matcher");
+
+    for my $batch_key (sort keys %{ $self->{'batches'} }) {
+        my $batch = $self->{'batches'}->{$batch_key};
+        my $args = $batch->{'args'};
+        my $results = $batch->{'results'};
+        my ($batch_id, $num_bibs, $num_items, @invalid) =
+            BatchStageMarcRecords('MARC21', $batch->{marc}, "$batch_key.mrc", "$batch_key comments", 
+                                  '', $args->{'parse_items'}, 0);
+        like($batch_id, qr/^\d+$/, "staged $batch_key");
+        cmp_ok($num_bibs, "==", $results->{'num_bibs'}, "$batch_key: correct number of bibs");
+        cmp_ok($num_items, "==", $results->{'num_items'}, "$batch_key: correct number of items");
+        cmp_ok(scalar(@invalid), "==", $results->{'num_invalid'}, "$batch_key: correct number of invalid bibs");
+
+        my $num_matches = BatchFindBibDuplicates($batch_id, $matcher, 10);
+        cmp_ok($num_matches, "==", $results->{'num_matches'}, "$batch_key: correct number of bib matches");
+
+        if (defined $args->{'overlay_action'}) {
+            if ($args->{'overlay_action'} eq 'create_new') {
+                cmp_ok(GetImportBatchOverlayAction($batch_id), "eq", 'create_new', "$batch_key: verify default overlay action");
+            } else {
+                SetImportBatchOverlayAction($batch_id, $args->{'overlay_action'});
+                cmp_ok(GetImportBatchOverlayAction($batch_id), "eq", $args->{'overlay_action'}, 
+                                                   "$batch_key: changed overlay action");
+            }
+        }
+        if (defined $args->{'nomatch_action'}) {
+            if ($args->{'nomatch_action'} eq 'create_new') {
+                cmp_ok(GetImportBatchNoMatchAction($batch_id), "eq", 'create_new', "$batch_key: verify default nomatch action");
+            } else {
+                SetImportBatchNoMatchAction($batch_id, $args->{'nomatch_action'});
+                cmp_ok(GetImportBatchNoMatchAction($batch_id), "eq", $args->{'nomatch_action'}, 
+                                                   "$batch_key: changed nomatch action");
+            }
+        }
+        if (defined $args->{'item_action'}) {
+            if ($args->{'item_action'} eq 'create_new') {
+                cmp_ok(GetImportBatchItemAction($batch_id), "eq", 'always_add', "$batch_key: verify default item action");
+            } else {
+                SetImportBatchItemAction($batch_id, $args->{'item_action'});
+                cmp_ok(GetImportBatchItemAction($batch_id), "eq", $args->{'item_action'}, 
+                                                   "$batch_key: changed item action");
+            }
+        }
+
+        my ($num_added, $num_updated, $num_items_added, 
+            $num_items_errored, $num_ignored) = BatchCommitBibRecords($batch_id);
+        cmp_ok($num_added,         "==", $results->{'num_added'},         "$batch_key: added correct number of bibs");
+        cmp_ok($num_updated,       "==", $results->{'num_updated'},       "$batch_key: updated correct number of bibs");
+        cmp_ok($num_items_added,   "==", $results->{'num_items_added'},   "$batch_key: added correct number of items");
+        cmp_ok($num_items_errored, "==", $results->{'num_items_errored'}, "$batch_key: correct number of item add errors");
+        cmp_ok($num_ignored,       "==", $results->{'num_ignored'},       "$batch_key: ignored correct number of bibs");
+
+        $self->reindex_marc();
+    }
+     
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/ImportBatch/GetImportBatch.pm b/t/db_dependent/lib/KohaTest/ImportBatch/GetImportBatch.pm
new file mode 100644 (file)
index 0000000..0b01707
--- /dev/null
@@ -0,0 +1,45 @@
+package KohaTest::ImportBatch::getImportBatch;
+use base qw( KohaTest::ImportBatch );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::ImportBatch;
+use C4::Matcher;
+use C4::Biblio;
+
+
+=head3 add_one_and_find_it
+
+=cut
+
+sub add_one_and_find_it : Test( 7 ) {
+    my $self = shift;
+
+    my $batch = {
+        overlay_action => 'create_new',
+        import_status  => 'staging',
+        batch_type     => 'batch',
+        file_name      => 'foo',
+        comments       => 'inserted during automated testing',
+    };
+    my $batch_id = AddImportBatch(
+      $batch->{'overlay_action'},
+      $batch->{'import_status'},
+      $batch->{'batch_type'},
+      $batch->{'file_name'},
+      $batch->{'comments'},
+    );
+    ok( $batch_id, "successfully inserted batch: $batch_id" );
+
+    my $retrieved = GetImportBatch( $batch_id );
+
+    foreach my $key ( keys %$batch ) {
+        is( $retrieved->{$key}, $batch->{$key}, "both objects agree on $key" );
+    }
+    is( $retrieved->{'import_batch_id'}, $batch_id, 'batch_id' );
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/ImportBatch/GetImportRecordMarc.pm b/t/db_dependent/lib/KohaTest/ImportBatch/GetImportRecordMarc.pm
new file mode 100644 (file)
index 0000000..b933b35
--- /dev/null
@@ -0,0 +1,51 @@
+package KohaTest::ImportBatch::GetImportRecordMarc;
+use base qw( KohaTest::ImportBatch );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::ImportBatch;
+use C4::Matcher;
+use C4::Biblio;
+
+
+=head3 record_does_not_exist
+
+=cut
+
+sub record_does_not_exist : Test( 1 ) {
+    my $self = shift;
+
+    my $id = '999999999999';
+    my $marc = GetImportRecordMarc( $id );
+    ok( ! defined( $marc ), 'this marc is undefined' );
+
+}
+
+sub record_does_exist : Test( 4 ) {
+    my $self = shift;
+
+    # we need an import_batch, so let GetZ3950BatchId create one:
+    my $new_batch_id = GetZ3950BatchId('foo');
+    ok( $new_batch_id, "got a new batch ID: $new_batch_id" );
+
+    my $sth = C4::Context->dbh->prepare(
+        "INSERT INTO import_records (import_batch_id, marc, marcxml)
+                                    VALUES (?, ?, ?)"
+    );
+    my $execute = $sth->execute(
+        $new_batch_id,    # batch_id
+        'marc',           # marc
+        'marcxml',        # marcxml
+    );
+    ok( $execute, 'succesfully executed' );
+    my $import_record_id = C4::Context->dbh->{'mysql_insertid'};
+    ok( $import_record_id, 'we got an import_record_id' );
+
+    my $marc = GetImportRecordMarc($import_record_id);
+    ok( defined($marc), 'this marc is defined' );
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/ImportBatch/GetZ3950BatchId.pm b/t/db_dependent/lib/KohaTest/ImportBatch/GetZ3950BatchId.pm
new file mode 100644 (file)
index 0000000..f3f5d9c
--- /dev/null
@@ -0,0 +1,42 @@
+package KohaTest::ImportBatch::GetZ3950BatchId;
+use base qw( KohaTest::ImportBatch );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::ImportBatch;
+use C4::Matcher;
+use C4::Biblio;
+
+
+=head3 batch_does_not_exist
+
+=cut
+
+sub batch_does_not_exist : Test( 5 ) {
+    my $self = shift;
+
+    my $file_name = 'testing batch';
+
+    # lets make sure it doesn't exist first
+    my $sth = C4::Context->dbh->prepare('SELECT import_batch_id FROM import_batches
+                                         WHERE  batch_type = ?
+                                         AND    file_name = ?');
+    ok( $sth->execute( 'z3950', $file_name, ), 'execute' );
+    my $rowref = $sth->fetchrow_arrayref();
+    ok( !defined( $rowref ), 'this batch does not exist' );
+
+    # now let GetZ3950BatchId create one
+    my $new_batch_id = GetZ3950BatchId( $file_name );
+    ok( $new_batch_id, "got a new batch ID: $new_batch_id" );
+
+    # now search for the one that was just created
+    my $second_batch_id = GetZ3950BatchId( $file_name );
+    ok( $second_batch_id, "got a second batch ID: $second_batch_id" );
+    is( $second_batch_id, $new_batch_id, 'we got the same batch both times.' );
+}
+
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Installer.pm b/t/db_dependent/lib/KohaTest/Installer.pm
new file mode 100644 (file)
index 0000000..2a0f9f9
--- /dev/null
@@ -0,0 +1,42 @@
+package KohaTest::Installer;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+use C4::Languages;
+use C4::Installer;
+
+sub SKIP_CLASS : Expensive { }
+
+sub testing_class { 'C4::Installer' };
+
+sub methods : Test( 1 ) {
+    my $self = shift;
+    my @methods = qw(
+                       new 
+                       marcflavour_list 
+                       marc_framework_sql_list 
+                       sample_data_sql_list 
+                       sql_file_list 
+                       load_db_schema 
+                       load_sql_in_order 
+                       set_marcflavour_syspref 
+                       set_indexing_engine 
+                       set_version_syspref 
+                       load_sql 
+    );
+    can_ok( $self->testing_class, @methods );
+}
+
+# ensure that we have a fresh, empty database
+# after running through the installer tests
+sub shutdown_50_init_db : Tests( shutdown )  {
+    my $self = shift;
+
+    KohaTest::clear_test_database();
+    KohaTest::create_test_database();
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Installer/SqlScripts.pm b/t/db_dependent/lib/KohaTest/Installer/SqlScripts.pm
new file mode 100644 (file)
index 0000000..510c574
--- /dev/null
@@ -0,0 +1,83 @@
+package KohaTest::Installer::SqlScripts;
+use base qw( KohaTest::Installer );
+
+use strict;
+use warnings;
+
+use Test::More;
+use C4::Languages;
+use C4::Installer;
+
+sub startup_50_get_installer : Test( startup => 1 ) {
+    my $self = shift;
+    my $installer = C4::Installer->new();
+    is(ref($installer), "C4::Installer", "created installer");
+    $self->{installer} = $installer;
+}
+
+sub installer_all_sample_data : Tests {
+    my $self = shift;
+
+    skip "did not create installer" unless ref($self->{installer}) eq 'C4::Installer';
+
+    my $all_languages = getAllLanguages();
+    # find the available directory names
+    my $dir=C4::Context->config('intranetdir')."/installer/data/" . 
+            (C4::Context->config("db_scheme") ? C4::Context->config("db_scheme") : "mysql") . "/";
+    opendir (MYDIR,$dir);
+    my @languages = grep { !/^\.|CVS/ && -d "$dir/$_"} readdir(MYDIR);    
+    closedir MYDIR;
+    
+    cmp_ok(scalar(@languages), '>', 0, "at least one framework language defined");
+    
+    foreach my $lang_code (@languages) {
+        SKIP: {
+            my $marc_flavours = $self->{installer}->marcflavour_list($lang_code);
+            ok(defined($marc_flavours), "at least one MARC flavour for $lang_code");
+            skip "no MARC flavours for $lang_code" unless defined($marc_flavours);
+
+            foreach my $flavour (@$marc_flavours) {
+                SKIP: {
+                    $self->clear_test_database();
+                    my $schema_error = $self->{installer}->load_db_schema();
+                    is($schema_error, "", "no errors during schema load");
+                    skip "error during schema load" if $schema_error ne "";
+        
+                    my $list = $self->{installer}->sql_file_list($lang_code, $flavour, { optional => 1, mandatory => 1 });
+                    my $sql_count = scalar(@$list);
+                    cmp_ok($sql_count, '>', 0, "at least one SQL init file for $lang_code, $flavour");
+                    skip "no SQL init files defined for $lang_code, $flavour" unless $sql_count > 0;
+
+                    my ($fwk_language, $installed_list) = $self->{installer}->load_sql_in_order($all_languages, @$list);
+
+                    # extract list of files
+                    my $level;
+                    my @file_list = map { 
+                                            map { $_->{level} = $level; $_ } @{ $level = $_->{level}; $_->{fwklist} } 
+                                        } @$installed_list; 
+                    my $num_processed = scalar(@file_list);
+                    cmp_ok($num_processed, '==', $sql_count, "processed all sql scripts for $lang_code, $flavour");
+
+                    my %sql_to_load = map { my $file = $_; 
+                                            my @file = split qr(\/|\\), $file; 
+                                            join("\t", $file[-2], $file[-1]) => 1 
+                                           } @$list;
+                    foreach my $sql (@file_list) {
+                        ok(exists($sql_to_load{ "$sql->{level}\t$sql->{fwkname}" }), 
+                            "SQL script $sql->{level}/$sql->{fwkname} is on list");
+                        delete $sql_to_load{ "$sql->{level}\t$sql->{fwkname}" };
+                        is($sql->{error}, "", "no errors when loading $sql->{fwkname}");
+                    }
+                    ok(not(%sql_to_load), "no SQL scripts for $lang_code, $flavour left unloaded");
+                }
+            }
+        }
+    }
+}
+
+sub shutdown_50_clear_installer : Tests( shutdown ) {
+    my $self = shift;
+    delete $self->{installer};
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Installer/get_file_path_from_name.pm b/t/db_dependent/lib/KohaTest/Installer/get_file_path_from_name.pm
new file mode 100644 (file)
index 0000000..40962a7
--- /dev/null
@@ -0,0 +1,36 @@
+package KohaTest::Installer::get_file_path_from_name;
+use base qw( KohaTest::Installer );
+
+use strict;
+use warnings;
+
+use Test::More;
+use C4::Languages;
+use C4::Installer;
+
+sub startup_50_get_installer : Test( startup => 1 ) {
+    my $self = shift;
+    my $installer = C4::Installer->new();
+    is(ref($installer), "C4::Installer", "created installer");
+    $self->{installer} = $installer;
+}
+
+sub search_for_known_scripts : Tests( 2 ) {
+    my $self = shift;
+
+    skip "did not create installer" unless ref($self->{installer}) eq 'C4::Installer';
+
+    foreach my $script ( 'installer/data/mysql/en/mandatory/message_transport_types.sql',
+                         'installer/data/mysql/en/optional/sample_notices_message_attributes.sql', ) {
+
+        ok( $self->{'installer'}->get_file_path_from_name( $script ), "found $script" );
+    }
+    
+}
+
+sub shutdown_50_clear_installer : Tests( shutdown ) {
+    my $self = shift;
+    delete $self->{installer};
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/ItemCirculationAlertPreference.pm b/t/db_dependent/lib/KohaTest/ItemCirculationAlertPreference.pm
new file mode 100644 (file)
index 0000000..3094b33
--- /dev/null
@@ -0,0 +1,27 @@
+package KohaTest::ItemCirculationAlertPreference;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::ItemCirculationAlertPreference;
+sub testing_class { 'C4::ItemCirculationAlertPreference' };
+
+
+sub methods : Test( 1 ) {
+    my $self = shift;
+    my @methods = qw( 
+                    new
+                    create
+                    delete
+                    is_enabled_for
+                    find
+                    grid
+                );
+    
+    can_ok( $self->testing_class, @methods );    
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/ItemType.pm b/t/db_dependent/lib/KohaTest/ItemType.pm
new file mode 100644 (file)
index 0000000..2474ce3
--- /dev/null
@@ -0,0 +1,23 @@
+package KohaTest::ItemType;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::ItemType;
+sub testing_class { 'C4::ItemType' };
+
+
+sub methods : Test( 1 ) {
+    my $self = shift;
+    my @methods = qw( 
+                    new
+                    all
+                );
+    
+    can_ok( $self->testing_class, @methods );    
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Items.pm b/t/db_dependent/lib/KohaTest/Items.pm
new file mode 100644 (file)
index 0000000..7dcd9ab
--- /dev/null
@@ -0,0 +1,60 @@
+package KohaTest::Items;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Items;
+sub testing_class { 'C4::Items' }
+
+sub methods : Test( 1 ) {
+    my $self    = shift;
+    my @methods = qw(
+
+      GetItem
+      AddItemFromMarc
+      AddItem
+      AddItemBatchFromMarc
+      ModItemFromMarc
+      ModItem
+      ModItemTransfer
+      ModDateLastSeen
+      DelItem
+      CheckItemPreSave
+      GetItemStatus
+      GetItemLocation
+      GetLostItems
+      GetItemsForInventory
+      GetItemsCount
+      GetItemInfosOf
+      GetItemsByBiblioitemnumber
+      GetItemsInfo
+      get_itemnumbers_of
+      GetItemnumberFromBarcode
+      get_item_authorised_values
+      get_authorised_value_images
+      GetMarcItem
+      _set_derived_columns_for_add
+      _set_derived_columns_for_mod
+      _do_column_fixes_for_mod
+      _get_single_item_column
+      _calc_items_cn_sort
+      _set_defaults_for_add
+      _koha_new_item
+      _koha_modify_item
+      _koha_delete_item
+      _marc_from_item_hash
+      _add_item_field_to_biblio
+      _replace_item_field_in_biblio
+      _repack_item_errors
+      _get_unlinked_item_subfields
+      _get_unlinked_subfields_xml
+      _parse_unlinked_item_subfields_from_xml
+    );
+
+    can_ok( $self->testing_class, @methods );
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Items/ColumnFixes.pm b/t/db_dependent/lib/KohaTest/Items/ColumnFixes.pm
new file mode 100644 (file)
index 0000000..aca4f73
--- /dev/null
@@ -0,0 +1,77 @@
+package KohaTest::Items::ColumnFixes;
+use base qw( KohaTest::Items );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Items;
+
+=head2 STARTUP METHODS
+
+These get run once, before the main test methods in this module
+
+=cut
+
+=head2 TEST METHODS
+
+standard test methods
+
+=head3 not_defined
+
+
+=cut
+
+sub not_defined : Test( 4 ) {
+
+    my $item_mod_fixes_1 = {
+        notforloan => undef,
+        damaged    => undef,
+        wthdrawn   => undef,
+        itemlost   => undef,
+    };
+
+    C4::Items::_do_column_fixes_for_mod($item_mod_fixes_1);
+    is( $item_mod_fixes_1->{'notforloan'}, 0, 'null notforloan fixed during mod' );
+    is( $item_mod_fixes_1->{'damaged'},    0, 'null damaged fixed during mod' );
+    is( $item_mod_fixes_1->{'wthdrawn'},   0, 'null wthdrawn fixed during mod' );
+    is( $item_mod_fixes_1->{'itemlost'},   0, 'null itemlost fixed during mod' );
+
+}
+
+sub empty : Test( 4 ) {
+
+    my $item_mod_fixes_2 = {
+        notforloan => '',
+        damaged    => '',
+        wthdrawn   => '',
+        itemlost   => '',
+    };
+
+    C4::Items::_do_column_fixes_for_mod($item_mod_fixes_2);
+    is( $item_mod_fixes_2->{'notforloan'}, 0, 'empty notforloan fixed during mod' );
+    is( $item_mod_fixes_2->{'damaged'},    0, 'empty damaged fixed during mod' );
+    is( $item_mod_fixes_2->{'wthdrawn'},   0, 'empty wthdrawn fixed during mod' );
+    is( $item_mod_fixes_2->{'itemlost'},   0, 'empty itemlost fixed during mod' );
+
+}
+
+sub not_clobbered : Test( 4 ) {
+
+    my $item_mod_fixes_3 = {
+        notforloan => 1,
+        damaged    => 2,
+        wthdrawn   => 3,
+        itemlost   => 4,
+    };
+
+    C4::Items::_do_column_fixes_for_mod($item_mod_fixes_3);
+    is( $item_mod_fixes_3->{'notforloan'}, 1, 'do not clobber notforloan during mod' );
+    is( $item_mod_fixes_3->{'damaged'},    2, 'do not clobber damaged during mod' );
+    is( $item_mod_fixes_3->{'wthdrawn'},   3, 'do not clobber wthdrawn during mod' );
+    is( $item_mod_fixes_3->{'itemlost'},   4, 'do not clobber itemlost during mod' );
+
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Items/GetItemsForInventory.pm b/t/db_dependent/lib/KohaTest/Items/GetItemsForInventory.pm
new file mode 100644 (file)
index 0000000..a56057e
--- /dev/null
@@ -0,0 +1,123 @@
+package KohaTest::Items::GetItemsForInventory;
+use base qw( KohaTest::Items );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Items;
+
+=head2 STARTUP METHODS
+
+These get run once, before the main test methods in this module
+
+=cut
+
+=head2 startup_90_add_item_get_callnumber
+
+=cut
+
+sub startup_90_add_item_get_callnumber : Test( startup => 13 ) {
+    my $self = shift;
+
+    $self->add_biblios( add_items => 1 );
+
+    ok( $self->{'items'}, 'An item has been aded' )
+      or diag( Data::Dumper->Dump( [ $self->{'items'} ], ['items'] ) );
+
+    my @biblioitems = C4::Biblio::GetBiblioItemByBiblioNumber( $self->{'items'}[0]{'biblionumber'} );
+    ok( $biblioitems[0]->{'biblioitemnumber'}, '...and it has a biblioitemnumber' )
+      or diag( Data::Dumper->Dump( [ \@biblioitems ], ['biblioitems'] ) );
+
+    my $items_info = GetItemsByBiblioitemnumber( $biblioitems[0]->{'biblioitemnumber'} );
+    isa_ok( $items_info, 'ARRAY', '...and we can search with that biblioitemnumber' )
+      or diag( Data::Dumper->Dump( [$items_info], ['items_info'] ) );
+    cmp_ok( scalar @$items_info, '>', 0, '...and we can find at least one item with that biblioitemnumber' );
+
+    my $item_info = $items_info->[0];
+    ok( $item_info->{'itemcallnumber'}, '...and the item we found has a call number: ' . $item_info->{'itemcallnumber'} )
+      or diag( Data::Dumper->Dump( [$item_info], ['item_info'] ) );
+
+    $self->{'callnumber'} = $item_info->{'itemcallnumber'};
+}
+
+
+=head2 TEST METHODS
+
+standard test methods
+
+=head3 missing_parameters
+
+the minlocation and maxlocation parameters are required. If they are
+not provided, this method should somehow complain, such as returning
+undef or emitina warning or something.
+
+=cut
+
+sub missing_parameters : Test( 1 ) {
+    my $self = shift;
+    local $TODO = 'GetItemsForInventory should fail when missing required parameters';
+
+    my $items = C4::Items::GetItemsForInventory();
+    ok( ! defined $items, 'GetItemsForInventory fails when parameters are missing' )
+      or diag( Data::Dumper->Dump( [ $items ], [ 'items' ] ) );
+}
+
+=head3 basic_usage
+
+
+=cut
+
+sub basic_usage : Test( 4 ) {
+    my $self = shift;
+
+    ok( $self->{'callnumber'}, 'we have a call number to search for: ' . $self->{'callnumber'} );
+    my $items = C4::Items::GetItemsForInventory( $self->{'callnumber'}, $self->{'callnumber'} );
+    isa_ok( $items, 'ARRAY', 'We were able to call GetItemsForInventory with our call number' );
+    is( scalar @$items, 1, '...and we found only one item' );
+    my $our_item = $items->[0];
+    is( $our_item->{'itemnumber'},     $self->{'items'}[0]{'itemnumber'},                 '...and the item we found has the right itemnumber' );
+
+    # diag( Data::Dumper->Dump( [$items], ['items'] ) );
+}
+
+=head3 date_last_seen
+
+
+=cut
+
+sub date_last_seen : Test( 6 ) {
+    my $self = shift;
+
+    ok( $self->{'callnumber'}, 'we have a call number to search for: ' . $self->{'callnumber'} );
+
+    my $items = C4::Items::GetItemsForInventory(
+        $self->{'callnumber'},    # minlocation
+        $self->{'callnumber'},    # maxlocation
+        undef,                    # location
+        undef,                    # itemtype
+        C4::Dates->new( $self->tomorrow(), 'iso' )->output,    # datelastseen
+    );
+
+    isa_ok( $items, 'ARRAY', 'We were able to call GetItemsForInventory with our call number' );
+    is( scalar @$items, 1, '...and we found only one item' );
+    my $our_item = $items->[0];
+    is( $our_item->{'itemnumber'}, $self->{'items'}[0]{'itemnumber'}, '...and the item we found has the right itemnumber' );
+
+    # give a datelastseen of yesterday, and we should not get our item.
+    $items = C4::Items::GetItemsForInventory(
+        $self->{'callnumber'},    # minlocation
+        $self->{'callnumber'},    # maxlocation
+        undef,                    # location
+        undef,                    # itemtype
+        C4::Dates->new( $self->yesterday(), 'iso' )->output,    # datelastseen
+    );
+
+    isa_ok( $items, 'ARRAY', 'We were able to call GetItemsForInventory with our call number' );
+    is( scalar @$items, 0, '...and we found no items' );
+
+}
+
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Items/ModItemsFromMarc.pm b/t/db_dependent/lib/KohaTest/Items/ModItemsFromMarc.pm
new file mode 100644 (file)
index 0000000..d0522ee
--- /dev/null
@@ -0,0 +1,91 @@
+package KohaTest::Items::ModItemsFromMarc;
+use base qw( KohaTest::Items );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Context;
+use C4::Biblio;
+use C4::Items;
+
+=head2 STARTUP METHODS
+
+These get run once, before the main test methods in this module
+
+=cut
+
+=head2 startup_90_add_item_get_callnumber
+
+=cut
+
+sub startup_90_add_item_get_callnumber : Test( startup => 13 ) {
+    my $self = shift;
+
+    $self->add_biblios( count => 1, add_items => 1 );
+
+    ok( $self->{'items'}, 'An item has been aded' )
+      or diag( Data::Dumper->Dump( [ $self->{'items'} ], ['items'] ) );
+
+    my @biblioitems = C4::Biblio::GetBiblioItemByBiblioNumber( $self->{'items'}[0]{'biblionumber'} );
+    ok( $biblioitems[0]->{'biblioitemnumber'}, '...and it has a biblioitemnumber' )
+      or diag( Data::Dumper->Dump( [ \@biblioitems ], ['biblioitems'] ) );
+
+    my $items_info = GetItemsByBiblioitemnumber( $biblioitems[0]->{'biblioitemnumber'} );
+    isa_ok( $items_info, 'ARRAY', '...and we can search with that biblioitemnumber' )
+      or diag( Data::Dumper->Dump( [$items_info], ['items_info'] ) );
+    cmp_ok( scalar @$items_info, '>', 0, '...and we can find at least one item with that biblioitemnumber' );
+
+    my $item_info = $items_info->[0];
+    ok( $item_info->{'itemcallnumber'}, '...and the item we found has a call number: ' . $item_info->{'itemcallnumber'} )
+      or diag( Data::Dumper->Dump( [$item_info], ['item_info'] ) );
+
+    $self->{itemnumber} = $item_info->{itemnumber};
+}
+
+
+=head2 TEST METHODS
+
+standard test methods
+
+=head3 bug2466
+
+Regression test for bug 2466 (when clearing an item field
+via the cataloging or serials item editor, corresponding
+column is not cleared).
+
+=cut
+
+sub bug2466 : Test( 8 ) {
+    my $self = shift;
+
+    my $item = C4::Items::GetItem($self->{itemnumber});
+    isa_ok($item, 'HASH', "item $self->{itemnumber} exists");
+   
+    my $item_marc = C4::Items::GetMarcItem($item->{biblionumber}, $self->{itemnumber});
+    isa_ok($item_marc, 'MARC::Record', "retrieved item MARC");
+
+    cmp_ok($item->{itemcallnumber}, 'ne', '', "item call number is not blank");
+
+    my ($callnum_tag, $callnum_subfield) = C4::Biblio::GetMarcFromKohaField('items.itemcallnumber', '');
+    cmp_ok($callnum_tag, '>', 0, "found tag for itemcallnumber");
+
+    my $item_field = $item_marc->field($callnum_tag);
+    ok(defined($item_field), "retrieved MARC field for item");
+
+    $item_field->delete_subfield(code => $callnum_subfield);
+
+    my $dbh = C4::Context->dbh;
+    my $item_from_marc = C4::Biblio::TransformMarcToKoha($dbh, $item_marc, '', 'items');
+    ok(not(exists($item_from_marc->{itemcallnumber})), "itemcallnumber subfield removed");
+
+    C4::Items::ModItemFromMarc($item_marc, $item->{biblionumber}, $self->{itemnumber});
+
+    my $modified_item = C4::Items::GetItem($self->{itemnumber});
+    isa_ok($modified_item, 'HASH', "retrieved modified item");
+
+    ok(not(defined($modified_item->{itemcallnumber})), "itemcallnumber is now undef");
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Items/SetDefaults.pm b/t/db_dependent/lib/KohaTest/Items/SetDefaults.pm
new file mode 100644 (file)
index 0000000..fd622a7
--- /dev/null
@@ -0,0 +1,86 @@
+package KohaTest::Items::SetDefaults;
+use base qw( KohaTest::Items );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Items;
+
+=head2 STARTUP METHODS
+
+These get run once, before the main test methods in this module
+
+=cut
+
+=head2 TEST METHODS
+
+standard test methods
+
+=head3 
+
+
+=cut
+
+sub add_some_items : Test( 3 ) {
+
+    my $item_to_add_1 = { itemnotes => 'newitem', };
+
+    C4::Items::_set_defaults_for_add($item_to_add_1);
+    ok( exists $item_to_add_1->{'dateaccessioned'}, 'dateaccessioned added to new item' );
+    like( $item_to_add_1->{'dateaccessioned'}, qr/^\d\d\d\d-\d\d-\d\d$/, 'new dateaccessioned is dddd-dd-dd' );
+    is( $item_to_add_1->{'itemnotes'}, 'newitem', 'itemnotes not clobbered' );
+
+}
+
+sub undefined : Test( 4 ) {
+    my $item_add_fixes_1 = {
+        notforloan => undef,
+        damaged    => undef,
+        wthdrawn   => undef,
+        itemlost   => undef,
+    };
+
+    C4::Items::_set_defaults_for_add($item_add_fixes_1);
+    is( $item_add_fixes_1->{'notforloan'}, 0, 'null notforloan fixed during add' );
+    is( $item_add_fixes_1->{'damaged'},    0, 'null damaged fixed during add' );
+    is( $item_add_fixes_1->{'wthdrawn'},   0, 'null wthdrawn fixed during add' );
+    is( $item_add_fixes_1->{'itemlost'},   0, 'null itemlost fixed during add' );
+}
+
+sub empty_gets_fixed : Test( 4 ) {
+
+    my $item_add_fixes_2 = {
+        notforloan => '',
+        damaged    => '',
+        wthdrawn   => '',
+        itemlost   => '',
+    };
+
+    C4::Items::_set_defaults_for_add($item_add_fixes_2);
+    is( $item_add_fixes_2->{'notforloan'}, 0, 'empty notforloan fixed during add' );
+    is( $item_add_fixes_2->{'damaged'},    0, 'empty damaged fixed during add' );
+    is( $item_add_fixes_2->{'wthdrawn'},   0, 'empty wthdrawn fixed during add' );
+    is( $item_add_fixes_2->{'itemlost'},   0, 'empty itemlost fixed during add' );
+
+}
+
+sub do_not_clobber : Test( 4 ) {
+
+    my $item_add_fixes_3 = {
+        notforloan => 1,
+        damaged    => 2,
+        wthdrawn   => 3,
+        itemlost   => 4,
+    };
+
+    C4::Items::_set_defaults_for_add($item_add_fixes_3);
+    is( $item_add_fixes_3->{'notforloan'}, 1, 'do not clobber notforloan during mod' );
+    is( $item_add_fixes_3->{'damaged'},    2, 'do not clobber damaged during mod' );
+    is( $item_add_fixes_3->{'wthdrawn'},   3, 'do not clobber wthdrawn during mod' );
+    is( $item_add_fixes_3->{'itemlost'},   4, 'do not clobber itemlost during mod' );
+
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Koha.pm b/t/db_dependent/lib/KohaTest/Koha.pm
new file mode 100644 (file)
index 0000000..13a145a
--- /dev/null
@@ -0,0 +1,49 @@
+package KohaTest::Koha;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Koha;
+sub testing_class { 'C4::Koha' }
+
+sub methods : Test( 1 ) {
+    my $self    = shift;
+    my @methods = qw( slashifyDate
+      DisplayISBN
+      subfield_is_koha_internal_p
+      GetItemTypes
+      get_itemtypeinfos_of
+      GetCcodes
+      getauthtypes
+      getauthtype
+      getframeworks
+      getframeworkinfo
+      getitemtypeinfo
+      getitemtypeimagedir
+      getitemtypeimagesrc
+      getitemtypeimagelocation
+      _getImagesFromDirectory
+      _getSubdirectoryNames
+      getImageSets
+      GetPrinters
+      GetPrinter
+      getnbpages
+      getallthemes
+      getFacets
+      get_infos_of
+      get_notforloan_label_of
+      displayServers
+      GetAuthValCode
+      GetAuthorisedValues
+      GetAuthorisedValueCategories
+      GetKohaAuthorisedValues
+      display_marc_indicators
+    );
+
+    can_ok( $self->testing_class, @methods );
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Koha/displayServers.pm b/t/db_dependent/lib/KohaTest/Koha/displayServers.pm
new file mode 100644 (file)
index 0000000..7794268
--- /dev/null
@@ -0,0 +1,192 @@
+package KohaTest::Koha::displayServers;
+use base qw( KohaTest::Koha );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Koha;
+
+=head2 basic_usage
+
+call displayServers with no parameters and investigate the things that
+it returns. This depends on there being at least one server defined,
+as do some other tests in this module.
+
+=cut
+
+sub basic_usage : Test( 12 ) {
+    my $self = shift;
+
+    my $servers = C4::Koha::displayServers();
+    isa_ok( $servers, 'ARRAY' );
+    my $firstserver = $servers->[0];
+    isa_ok( $firstserver, 'HASH' );
+
+    my @keys = qw( opensearch icon value name checked zed label id encoding );
+    is( scalar keys %$firstserver, scalar @keys, 'the hash has the right number of keys' );
+    foreach my $key ( @keys ) {
+        ok( exists $firstserver->{$key}, "There is a $key key" );
+    }
+
+    # diag( Data::Dumper->Dump( [ $servers ], [ 'servers' ] ) );
+}
+
+=head2 position_does_not_exist
+
+call displayServers with a position that does not exist and make sure
+that we get none back.
+
+=cut
+
+sub position_does_not_exist : Test( 2 ) {
+    my $self = shift;
+
+    my $servers = C4::Koha::displayServers( 'this does not exist' );
+    isa_ok( $servers, 'ARRAY' );
+    is( scalar @$servers, 0, 'received no servers' );
+
+    # diag( Data::Dumper->Dump( [ $servers ], [ 'servers' ] ) );
+}
+
+=head2 position_does_exist
+
+call displayServers with a position that does exist and make sure that
+we get at least one back.
+
+=cut
+
+sub position_does_exist : Test( 3 ) {
+    my $self = shift;
+
+    my $position = $self->_get_a_position();
+    ok( $position, 'We have a position that exists' );
+    
+    my $servers = C4::Koha::displayServers( $position );
+    isa_ok( $servers, 'ARRAY' );
+    ok( scalar @$servers, 'received at least one server' );
+
+    # diag( Data::Dumper->Dump( [ $servers ], [ 'servers' ] ) );
+}
+
+=head2 type_does_not_exist
+
+call displayServers with a type that does not exist and make sure
+that we get none back.
+
+=cut
+
+sub type_does_not_exist : Test( 2 ) {
+    my $self = shift;
+
+    my $servers = C4::Koha::displayServers( undef, 'this does not exist' );
+    isa_ok( $servers, 'ARRAY' );
+    is( scalar @$servers, 0, 'received no servers' );
+
+    # diag( Data::Dumper->Dump( [ $servers ], [ 'servers' ] ) );
+}
+
+=head2 type_does_exist
+
+call displayServers with a type that does exist and make sure
+that we get at least one back.
+
+=cut
+
+sub type_does_exist : Test( 3 ) {
+    my $self = shift;
+
+    my $type = $self->_get_a_type();
+    ok( $type, 'We have a type that exists' );
+    
+    my $servers = C4::Koha::displayServers( undef, $type );
+    isa_ok( $servers, 'ARRAY' );
+    ok( scalar @$servers, 'received at least one server' );
+
+    # diag( Data::Dumper->Dump( [ $servers ], [ 'servers' ] ) );
+}
+
+=head2 position_and_type
+
+call displayServers with a variety of both positions and types and
+verify that we get either something or nothing back.
+
+
+=cut
+
+sub position_and_type : Test( 8 ) {
+    my $self = shift;
+
+    my ( $position, $type ) = $self->_get_a_position_and_type();
+    ok( $position, 'We have a type that exists' );
+    ok( $type, 'We have a type that exists' );
+    
+    my $servers = C4::Koha::displayServers( $position, 'type does not exist' );
+    isa_ok( $servers, 'ARRAY' );
+    is( scalar @$servers, 0, 'received no servers' );
+
+    $servers = C4::Koha::displayServers( 'position does not exist', $type );
+    isa_ok( $servers, 'ARRAY' );
+    is( scalar @$servers, 0, 'received no servers' );
+
+    $servers = C4::Koha::displayServers( $position, $type );
+    isa_ok( $servers, 'ARRAY' );
+    ok( scalar @$servers, 'received at least one server' );
+
+    # diag( Data::Dumper->Dump( [ $servers ], [ 'servers' ] ) );
+}
+
+=head1 INTERNAL METHODS
+
+these are not test methods, but they help me write them.
+
+=head2 _get_a_position
+
+returns a position value for which at least one server exists
+
+=cut
+
+sub _get_a_position {
+    my $self = shift;
+
+    my ( $position, $type ) = $self->_get_a_position_and_type();
+    return $position;
+
+}
+
+=head2 _get_a_type
+
+returns a type value for which at least one server exists
+
+=cut
+
+sub _get_a_type {
+    my $self = shift;
+
+    my ( $position, $type ) = $self->_get_a_position_and_type();
+    return $type;
+
+}
+
+=head2 _get_a_position_and_type
+
+returns a position and type for a server
+
+=cut
+
+sub _get_a_position_and_type {
+    my $self = shift;
+
+    my $dbh    = C4::Context->dbh;
+    my $sql = 'SELECT position, type FROM z3950servers';
+    my $sth = $dbh->prepare($sql) or return;
+    $sth->execute or return;
+
+    my @row = $sth->fetchrow_array;
+    return ( $row[0], $row[1] );
+
+}
+
+  
+1;
diff --git a/t/db_dependent/lib/KohaTest/Koha/get_itemtypeinfos_of.pm b/t/db_dependent/lib/KohaTest/Koha/get_itemtypeinfos_of.pm
new file mode 100644 (file)
index 0000000..9845e90
--- /dev/null
@@ -0,0 +1,59 @@
+package KohaTest::Koha::get_itemtypeinfos_of;
+use base qw( KohaTest::Koha );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Koha;
+
+=head2 get_one
+
+calls get_itemtypeinfos_of on one item type and checks that it gets
+back something sane.
+
+=cut
+
+sub get_one : Test( 8 ) {
+    my $self = shift;
+
+    my $itemtype_info = C4::Koha::get_itemtypeinfos_of( 'BK' );
+    ok( $itemtype_info, 'we got back something from get_itemtypeinfos_of' );
+    isa_ok( $itemtype_info, 'HASH', '...and it' );
+    ok( exists $itemtype_info->{'BK'}, '...and it has a BK key' )
+      or diag( Data::Dumper->Dump( [ $itemtype_info ], [ 'itemtype_info' ] ) );
+    is( scalar keys %$itemtype_info, 1, '...and it has 1 key' );
+    foreach my $key ( qw( imageurl itemtype notforloan description ) ) {
+        ok( exists $itemtype_info->{'BK'}{$key}, "...and the BK info has a $key key" );
+    }
+    
+}
+
+=head2 get_two
+
+calls get_itemtypeinfos_of on a list of item types and verifies the
+results.
+
+=cut
+
+sub get_two : Test( 13 ) {
+    my $self = shift;
+
+    my @itemtypes = qw( BK MU );
+    my $itemtype_info = C4::Koha::get_itemtypeinfos_of( @itemtypes );
+    ok( $itemtype_info, 'we got back something from get_itemtypeinfos_of' );
+    isa_ok( $itemtype_info, 'HASH', '...and it' );
+    is( scalar keys %$itemtype_info, scalar @itemtypes, '...and it has ' . scalar @itemtypes . ' keys' );
+    foreach my $it ( @itemtypes ) {
+        ok( exists $itemtype_info->{$it}, "...and it has a $it key" )
+          or diag( Data::Dumper->Dump( [ $itemtype_info ], [ 'itemtype_info' ] ) );
+        foreach my $key ( qw( imageurl itemtype notforloan description ) ) {
+            ok( exists $itemtype_info->{$it}{$key}, "...and the $it info has a $key key" );
+        }
+    }
+    
+}
+
+  
+1;
diff --git a/t/db_dependent/lib/KohaTest/Koha/getitemtypeimagedir.pm b/t/db_dependent/lib/KohaTest/Koha/getitemtypeimagedir.pm
new file mode 100644 (file)
index 0000000..ea8b034
--- /dev/null
@@ -0,0 +1,27 @@
+package KohaTest::Koha::getitemtypeimagedir;
+use base qw( KohaTest::Koha );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Koha;
+
+sub check_default : Test( 5 ) {
+    my $self = shift;
+
+    my $opac_directory     = C4::Koha::getitemtypeimagedir('opac');
+    my $default_directory  = C4::Koha::getitemtypeimagedir('opac');
+    my $intranet_directory = C4::Koha::getitemtypeimagedir('intranet');
+
+    ok( $opac_directory,     'the opac directory is defined' );
+    ok( $default_directory,  'the default directory is defined' );
+    ok( $intranet_directory, 'the intranet directory is defined' );
+
+    is( $opac_directory, $default_directory, 'the opac directory is returned as the default' );
+    isnt( $intranet_directory, $default_directory, 'the intranet directory is not the same as the default' );
+
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Letters.pm b/t/db_dependent/lib/KohaTest/Letters.pm
new file mode 100644 (file)
index 0000000..97d58fb
--- /dev/null
@@ -0,0 +1,28 @@
+package KohaTest::Letters;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Members;
+sub testing_class { 'C4::Letters' };
+
+
+sub methods : Test( 1 ) {
+    my $self = shift;
+    my @methods = qw( getletter
+                      addalert
+                      delalert
+                      getalert
+                      findrelatedto
+                      SendAlerts
+                      parseletter
+                );
+    
+    can_ok( $self->testing_class, @methods );    
+}
+
+1;
+
diff --git a/t/db_dependent/lib/KohaTest/Letters/GetLetter.pm b/t/db_dependent/lib/KohaTest/Letters/GetLetter.pm
new file mode 100644 (file)
index 0000000..76b6ab4
--- /dev/null
@@ -0,0 +1,33 @@
+package KohaTest::Letters::GetLetter;
+use base qw( KohaTest::Letters );
+
+use strict;
+use warnings;
+
+use C4::Letters;
+use Test::More;
+
+sub GetLetter : Test( 6 ) {
+    my $self = shift;
+
+    my $letter = getletter( 'circulation', 'ODUE' );
+
+    isa_ok( $letter, 'HASH' )
+      or diag( Data::Dumper->Dump( [ $letter ], [ 'letter' ] ) );
+
+    is( $letter->{'code'},   'ODUE',        'code' );
+    is( $letter->{'module'}, 'circulation', 'module' );
+    ok( exists $letter->{'content'}, 'content' );
+    ok( exists $letter->{'name'}, 'name' );
+    ok( exists $letter->{'title'}, 'title' );
+
+
+}
+
+1;
+
+
+
+
+
+
diff --git a/t/db_dependent/lib/KohaTest/Letters/GetLetters.pm b/t/db_dependent/lib/KohaTest/Letters/GetLetters.pm
new file mode 100644 (file)
index 0000000..576b3bf
--- /dev/null
@@ -0,0 +1,30 @@
+package KohaTest::Letters::GetLetters;
+use base qw( KohaTest::Letters );
+
+use strict;
+use warnings;
+
+use C4::Letters;
+use Test::More;
+
+sub GetDefaultLetters : Test( 2 ) {
+    my $self = shift;
+
+    my $letters = GetLetters();
+
+    # the default install includes several entries in the letter table.
+    isa_ok( $letters, 'HASH' )
+      or diag( Data::Dumper->Dump( [ $letters ], [ 'letters' ] ) );
+
+  ok( scalar keys( %$letters ) > 0, 'we got some letters' );
+
+
+}
+
+1;
+
+
+
+
+
+
diff --git a/t/db_dependent/lib/KohaTest/Log.pm b/t/db_dependent/lib/KohaTest/Log.pm
new file mode 100644 (file)
index 0000000..dc7b26e
--- /dev/null
@@ -0,0 +1,25 @@
+package KohaTest::Log;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Log;
+sub testing_class { 'C4::Log' };
+
+
+sub methods : Test( 1 ) {
+    my $self = shift;
+    my @methods = qw( logaction 
+                       GetLogStatus 
+                       displaylog 
+                       GetLogs 
+                );
+    
+    can_ok( $self->testing_class, @methods );    
+}
+
+1;
+
diff --git a/t/db_dependent/lib/KohaTest/Members.pm b/t/db_dependent/lib/KohaTest/Members.pm
new file mode 100644 (file)
index 0000000..ff18869
--- /dev/null
@@ -0,0 +1,61 @@
+package KohaTest::Members;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Members;
+sub testing_class { 'C4::Members' };
+
+
+sub methods : Test( 1 ) {
+    my $self = shift;
+    my @methods = qw( SearchMember 
+                      GetMemberDetails 
+                      patronflags 
+                      GetMember 
+                      GetMemberIssuesAndFines 
+                      ModMember 
+                      AddMember 
+                      Check_Userid 
+                      changepassword 
+                      fixup_cardnumber
+                      GetGuarantees 
+                      UpdateGuarantees 
+                      GetPendingIssues 
+                      GetAllIssues 
+                      GetMemberAccountRecords 
+                      GetBorNotifyAcctRecord 
+                      checkuniquemember 
+                      checkcardnumber 
+                      getzipnamecity 
+                      getidcity 
+                      GetExpiryDate 
+                      checkuserpassword 
+                      GetborCatFromCatType 
+                      GetBorrowercategory 
+                      ethnicitycategories 
+                      fixEthnicity 
+                      GetAge
+                      get_institutions 
+                      add_member_orgs 
+                      MoveMemberToDeleted 
+                      DelMember 
+                      ExtendMemberSubscriptionTo 
+                      GetTitles 
+                      GetPatronImage 
+                      PutPatronImage 
+                      RmPatronImage 
+                      GetBorrowersWhoHaveNotBorrowedSince 
+                      GetBorrowersWhoHaveNeverBorrowed 
+                      GetBorrowersWithIssuesHistoryOlderThan 
+                      GetBorrowersNamesAndLatestIssue 
+                );
+    
+    can_ok( $self->testing_class, @methods );    
+}
+
+1;
+
diff --git a/t/db_dependent/lib/KohaTest/Members/AttributeTypes.pm b/t/db_dependent/lib/KohaTest/Members/AttributeTypes.pm
new file mode 100644 (file)
index 0000000..6525267
--- /dev/null
@@ -0,0 +1,119 @@
+package KohaTest::Members::AttributeTypes;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Members::AttributeTypes;
+sub testing_class { 'C4::Members::AttributeTypes' };
+
+sub methods : Test( 1 ) {
+    my $self = shift;
+    my @methods = qw( 
+                    new
+                    fetch
+                    GetAttributeTypes
+                    code
+                    description
+                    repeatable
+                    unique_id
+                    opac_display
+                    password_allowed
+                    staff_searchable
+                    authorised_value_category
+                    store
+                    delete
+                );
+    
+    can_ok( $self->testing_class, @methods );    
+}
+
+sub startup_50_create_types : Test( startup => 28 ) {
+    my $self = shift;
+
+    my $type1 = C4::Members::AttributeTypes->new('CAMPUSID', 'institution ID');
+    isa_ok($type1,  'C4::Members::AttributeTypes');
+    is($type1->code(), 'CAMPUSID', "set code in constructor");
+    is($type1->description(), 'institution ID', "set description in constructor");
+    ok(!$type1->repeatable(), "repeatable defaults to false");
+    ok(!$type1->unique_id(), "unique_id defaults to false");
+    ok(!$type1->opac_display(), "opac_display defaults to false");
+    ok(!$type1->password_allowed(), "password_allowed defaults to false");
+    ok(!$type1->staff_searchable(), "staff_searchable defaults to false");
+    is($type1->authorised_value_category(), '', "authorised_value_category defaults to ''");
+
+    $type1->repeatable('foobar');
+    ok($type1->repeatable(), "repeatable now true");
+    cmp_ok($type1->repeatable(), '==', 1, "repeatable not set to 'foobar'");
+    $type1->repeatable(0);
+    ok(!$type1->repeatable(), "repeatable now false");
+    
+    $type1->unique_id('foobar');
+    ok($type1->unique_id(), "unique_id now true");
+    cmp_ok($type1->unique_id(), '==', 1, "unique_id not set to 'foobar'");
+    $type1->unique_id(0);
+    ok(!$type1->unique_id(), "unique_id now false");
+    
+    $type1->opac_display('foobar');
+    ok($type1->opac_display(), "opac_display now true");
+    cmp_ok($type1->opac_display(), '==', 1, "opac_display not set to 'foobar'");
+    $type1->opac_display(0);
+    ok(!$type1->opac_display(), "opac_display now false");
+    
+    $type1->password_allowed('foobar');
+    ok($type1->password_allowed(), "password_allowed now true");
+    cmp_ok($type1->password_allowed(), '==', 1, "password_allowed not set to 'foobar'");
+    $type1->password_allowed(0);
+    ok(!$type1->password_allowed(), "password_allowed now false");
+    
+    $type1->staff_searchable('foobar');
+    ok($type1->staff_searchable(), "staff_searchable now true");
+    cmp_ok($type1->staff_searchable(), '==', 1, "staff_searchable not set to 'foobar'");
+    $type1->staff_searchable(0);
+    ok(!$type1->staff_searchable(), "staff_searchable now false");
+
+    $type1->code('INSTID');
+    is($type1->code(), 'CAMPUSID', 'code() allows retrieving but not setting');    
+    $type1->description('student ID');
+    is($type1->description(), 'student ID', 'set description');    
+    $type1->authorised_value_category('CAT');
+    is($type1->authorised_value_category(), 'CAT', 'set authorised_value_category');    
+    
+    $type1->repeatable(1);
+    $type1->staff_searchable(1);
+    $type1->store();
+    is($type1->num_patrons(), 0, 'no patrons using the new attribute type yet');
+
+    my $type2 = C4::Members::AttributeTypes->new('ABC', 'ABC ID');
+    $type2->store();
+}
+
+sub shutdown_50_list_and_remove_types : Test( shutdown => 11 ) {
+    my $self = shift;
+
+    my @list = C4::Members::AttributeTypes::GetAttributeTypes();    
+    is_deeply(\@list, [ { code => 'ABC', description => 'ABC ID' },
+                        { code => 'CAMPUSID', description => 'student ID' } ], "retrieved list of types");
+
+    my $type1 = C4::Members::AttributeTypes->fetch($list[1]->{code}); 
+    isa_ok($type1, 'C4::Members::AttributeTypes');
+    is($type1->code(), 'CAMPUSID', 'fetched code');    
+    is($type1->description(), 'student ID', 'fetched description');    
+    is($type1->authorised_value_category(), 'CAT', 'fetched authorised_value_category');    
+    ok($type1->repeatable(), "fetched repeatable");
+    ok(!$type1->unique_id(), "fetched unique_id");
+    ok(!$type1->opac_display(), "fetched opac_display");
+    ok(!$type1->password_allowed(), "fetched password_allowed");
+    ok($type1->staff_searchable(), "fetched staff_searchable");
+
+    $type1->delete();
+    C4::Members::AttributeTypes->delete('ABC');
+
+    my @newlist = C4::Members::AttributeTypes::GetAttributeTypes();    
+    is(scalar(@newlist), 0, "no types left after deletion");   
+    
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Members/DebarMember.pm b/t/db_dependent/lib/KohaTest/Members/DebarMember.pm
new file mode 100644 (file)
index 0000000..9e27d66
--- /dev/null
@@ -0,0 +1,44 @@
+package KohaTest::Members::DebarMember;
+use base qw( KohaTest::Members );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Members;
+sub testing_class { 'C4::Members' };
+
+
+sub simple_usage : Test( 6 ) {
+    my $self = shift;
+
+    ok( $self->{'memberid'}, 'we have a valid memberid to test with' );
+
+    my $details = C4::Members::GetMemberDetails( $self->{'memberid'} );
+    ok(     exists $details->{'flags'},                  'member details has a "flags" attribute');
+    isa_ok( $details->{'flags'},                 'HASH', 'the "flags" attribute is a hashref');
+    ok(     ! $details->{'flags'}->{'DBARRED'},          'this member is NOT debarred' );
+
+    # Now, let's debar this member and see what happens
+    my $success = C4::Members::DebarMember( $self->{'memberid'} );
+
+    ok( $success, 'we were able to debar the member' );
+    
+    $details = C4::Members::GetMemberDetails( $self->{'memberid'} );
+    ok( $details->{'flags'}->{'DBARRED'},         'this member is debarred now' )
+      or diag( Data::Dumper->Dump( [ $details->{'flags'} ], [ 'flags' ] ) );
+}
+
+sub incorrect_usage : Test( 2 ) {
+    my $self = shift;
+
+    my $result = C4::Members::DebarMember();
+    ok( ! defined $result, 'DebarMember returns undef when passed no parameters' );
+
+    $result = C4::Members::DebarMember( 'this is not a borrowernumber' );
+    ok( ! defined $result, 'DebarMember returns undef when not passed a numeric argument' );
+
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Members/GetMember.pm b/t/db_dependent/lib/KohaTest/Members/GetMember.pm
new file mode 100644 (file)
index 0000000..51870ad
--- /dev/null
@@ -0,0 +1,197 @@
+package KohaTest::Members::GetMember;
+use base qw( KohaTest::Members );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Members;
+
+sub testing_class { 'C4::Members' }
+
+=head2 STARTUP METHODS
+
+These get run once, before the main test methods in this module
+
+=head3 startup_create_borrower
+
+Creates a new borrower to use for these tests.  Class variables that are
+used to search by are stored for easy access by the methods.
+
+=cut
+
+sub startup_create_borrower : Test( startup => 1 ) {
+    my $self = shift;
+
+    my $memberinfo = {
+        surname      => 'surname'   . $self->random_string(),
+        firstname    => 'firstname' . $self->random_string(),
+        address      => 'address'   . $self->random_string(),
+        city         => 'city'      . $self->random_string(),
+        cardnumber   => 'card'      . $self->random_string(),
+        branchcode   => 'U1BCG',
+        categorycode => 'D',    # B  => Board
+        dateexpiry   => '2020-01-01',
+        password     => 'testpassword',
+        userid       => 'testuser',
+        dateofbirth  => $self->random_date(),
+    };
+
+    my $borrowernumber = AddMember( %$memberinfo );
+    ok( $borrowernumber, "created member: $borrowernumber" );
+    $self->{get_new_borrowernumber} = $borrowernumber;
+    $self->{get_new_cardnumber}     = $memberinfo->{cardnumber};
+    $self->{get_new_firstname}      = $memberinfo->{firstname};
+    $self->{get_new_userid}         = $memberinfo->{userid};
+
+    return;
+}
+
+=head2 TESTING METHODS
+
+Standard test methods
+
+=head3 borrowernumber_get
+
+Validates that GetMember can search by borrowernumber
+
+=cut
+
+sub borrowernumber_get : Test( 6 ) {
+    my $self = shift;
+
+    ok( $self->{get_new_borrowernumber},
+        "we have a valid memberid $self->{get_new_borrowernumber} to test with" );
+
+    #search by borrowernumber
+    my $results =
+      C4::Members::GetMember( borrowernumber=>$self->{get_new_borrowernumber});
+    ok( $results, 'we successfully called GetMember searching by borrowernumber' );
+
+    ok( exists $results->{borrowernumber},
+        'member details has a "borrowernumber" attribute' );
+    is( $results->{borrowernumber},
+        $self->{get_new_borrowernumber},
+        '...and it matches the created borrowernumber'
+    );
+
+    ok( exists $results->{'category_type'}, "categories in the join returned values" );
+    ok( $results->{description}, "...and description is valid: $results->{description}" );
+}
+
+=head3 cardnumber_get
+
+Validates that GetMember can search by cardnumber
+
+=cut
+
+sub cardnumber_get : Test( 6 ) {
+    my $self = shift;
+
+    ok( $self->{get_new_cardnumber},
+        "we have a valid cardnumber $self->{get_new_cardnumber} to test with" );
+
+    #search by cardnumber
+    my $results = C4::Members::GetMember( 'cardnumber'=>$self->{get_new_cardnumber} );
+    ok( $results, 'we successfully called GetMember searching by cardnumber' );
+
+    ok( exists $results->{cardnumber}, 'member details has a "cardnumber" attribute' );
+    is( $results->{cardnumber},
+        $self->{get_new_cardnumber},
+        '..and it matches the created cardnumber'
+    );
+
+    ok( exists $results->{'category_type'}, "categories in the join returned values" );
+    ok( $results->{description}, "...and description is valid: $results->{description}" );
+}
+
+=head3 firstname_get
+
+Validates that GetMember can search by firstname.
+Note that only the first result is used.
+
+=cut
+
+sub firstname_get : Test( 6 ) {
+    my $self = shift;
+
+    ok( $self->{get_new_firstname},
+        "we have a valid firstname $self->{get_new_firstname} to test with" );
+
+    ##search by firstname
+    my $results = C4::Members::GetMember( 'firstname'=>$self->{get_new_firstname} );
+    ok( $results, 'we successfully called GetMember searching by firstname' );
+
+    ok( exists $results->{firstname}, 'member details has a "firstname" attribute' );
+    is( $results->{'firstname'},
+        $self->{get_new_firstname},
+        '..and it matches the created firstname'
+    );
+
+    ok( exists $results->{'category_type'}, "categories in the join returned values" );
+    ok( $results->{description}, "...and description is valid: $results->{description}" );
+}
+
+=head3 userid_get
+
+Validates that GetMember can search by userid.
+
+=cut
+
+sub userid_get : Test( 6 ) {
+    my $self = shift;
+
+    ok( $self->{get_new_userid},
+        "we have a valid userid $self->{get_new_userid} to test with" );
+
+    #search by userid
+    my $results = C4::Members::GetMember( 'userid'=>$self->{get_new_userid} );
+    ok( $results, 'we successfully called GetMember searching by userid' );
+
+    ok( exists $results->{'userid'}, 'member details has a "userid" attribute' );
+    is( $results->{userid},
+        $self->{get_new_userid},
+        '..and it matches the created userid'
+    );
+
+    ok( exists $results->{'category_type'}, "categories in the join returned values" );
+    ok( $results->{description}, "...and description is valid: $results->{description}" );
+}
+
+=head3 missing_params
+
+Validates that GetMember returns undef when no parameters are passed to it
+
+=cut
+
+sub missing_params : Test( 1 ) {
+    my $self = shift;
+
+    my $results = C4::Members::GetMember();
+
+    ok( !defined $results, 'returned undef when no parameters passed' );
+
+}
+
+=head2 SHUTDOWN METHODS
+
+These get run once, after the main test methods in this module
+
+=head3 shutdown_remove_borrower
+
+Remove the new borrower information that was created in the startup method
+
+=cut
+
+sub shutdown_remove_borrower : Test( shutdown => 0 ) {
+    my $self = shift;
+
+    delete $self->{get_new_borrowernumber};
+    delete $self->{get_new_cardnumber};
+    delete $self->{get_new_firstname};
+    delete $self->{get_new_userid};
+
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Members/GetMemberDetails.pm b/t/db_dependent/lib/KohaTest/Members/GetMemberDetails.pm
new file mode 100644 (file)
index 0000000..e93742b
--- /dev/null
@@ -0,0 +1,150 @@
+package KohaTest::Members::GetMemberDetails;
+use base qw( KohaTest::Members );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Members;
+
+sub testing_class { 'C4::Members' }
+
+=head3 STARTUP METHODS
+
+These are run once, before the main test methods in this module.
+
+=head2 startup_create_detailed_borrower
+
+Creates a new borrower to be used by the testing methods.  Also
+populates the class hash with values to be compared from the database
+retrieval.
+
+=cut
+
+sub startup_create_detailed_borrower : Test( startup => 2 ) {
+    my $self = shift;
+    my ( $description, $type, $amount, $user );
+
+    my $memberinfo = {
+        surname      => 'surname' . $self->random_string(),
+        firstname    => 'firstname' . $self->random_string(),
+        address      => 'address' . $self->random_string(),
+        city         => 'city' . $self->random_string(),
+        cardnumber   => 'card' . $self->random_string(),
+        branchcode   => 'CPL',
+        categorycode => 'B',
+        dateexpiry   => '2020-01-01',
+        password     => 'testpassword',
+        userid       => 'testuser',
+        flags        => '0',
+        dateofbirth  => $self->random_date(),
+    };
+
+    my $borrowernumber = AddMember( %$memberinfo );
+    ok( $borrowernumber, "created member: $borrowernumber" );
+    $self->{detail_borrowernumber} = $borrowernumber;
+    $self->{detail_cardnumber}     = $memberinfo->{cardnumber};
+
+    #values for adding a record to accounts
+    $description = 'Test account';
+    $type        = 'M';
+    $amount      = 5.00;
+    $user        = '';
+
+    my $acct_added =
+      C4::Accounts::manualinvoice( $borrowernumber, undef, $description, $type, $amount,
+        $user );
+
+    ok( $acct_added == 0, 'added account for borrower' );
+
+    $self->{amountoutstanding} = $amount;
+
+    return;
+}
+
+=head2 TESTING METHODS
+
+=head3 borrower_detail_get
+
+Tests the functionality of the GetMemberDetails method in C4::Members.
+Validates the join on categories table works as well as the extra fields
+the method gets from outside of either the borrowers and categories table like
+amountoutstanding and user flags.
+
+=cut
+
+sub borrower_detail_get : Test( 8 ) {
+    my $self = shift;
+
+    ok( $self->{detail_borrowernumber},
+        'we have a valid detailed borrower to test with' );
+
+    my $details = C4::Members::GetMemberDetails( $self->{detail_borrowernumber} );
+    ok( $details, 'we successfully called GetMemberDetails' );
+    ok( exists $details->{categorycode},
+        'member details has a "categorycode" attribute' );
+    ok( $details->{categorycode}, '...and it is set to something' );
+
+    ok( exists $details->{category_type}, "categories in the join returned values" );
+
+    ok( $details->{category_type}, '...and category_type is valid' );
+
+    ok( $details->{amountoutstanding}, 'an amountoutstanding exists' );
+    is( $details->{amountoutstanding},
+        $self->{amountoutstanding},
+        '...and matches inserted account record'
+    );
+
+}
+
+=head3 cardnumber_detail_get
+
+This method tests the capability of GetMemberDetails to search on cardnumber.  There doesn't seem to be any
+current calls to GetMemberDetail using cardnumber though, so this test may not be necessary.
+
+=cut
+
+sub cardnumber_detail_get : Test( 8 ) {
+    my $self = shift;
+
+    ok( $self->{detail_cardnumber},
+        "we have a valid detailed borrower to test with $self->{detail_cardnumber}" );
+
+    my $details = C4::Members::GetMemberDetails( undef, $self->{detail_cardnumber} );
+    ok( $details, 'we successfully called GetMemberDetails' );
+    ok( exists $details->{categorycode},
+        "member details has a 'categorycode' attribute $details->{categorycode}" );
+    ok( $details->{categorycode}, '...and it is set to something' );
+
+    ok( exists $details->{category_type}, "categories in the join returned values" );
+
+    ok( $details->{category_type}, '...and category_type is valid' );
+
+#FIXME These 2 methods will fail as borrowernumber is not set in GetMemberDetails when cardnumber is used instead.
+#ok( $details->{amountoutstanding}, 'an amountoutstanding exists' );
+#is( $details->{amountoutstanding}, $self->{amountoutstanding}, '...and matches inserted account record' );
+}
+
+=head2 SHUTDOWN METHDOS
+
+These get run once, after the main test methods in this module.
+
+=head3 shutdown_remove_new_borrower
+
+Removes references in the Class to the new borrower created
+in the startup methods.
+
+=cut
+
+sub shutdown_remove_new_borrower : Test( shutdown => 0 ) {
+    my $self = shift;
+
+    delete $self->{detail_borrowernumber};
+    delete $self->{detail_cardnumber};
+    delete $self->{amountoutstanding};
+
+    return;
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Members/ModMember.pm b/t/db_dependent/lib/KohaTest/Members/ModMember.pm
new file mode 100644 (file)
index 0000000..876677f
--- /dev/null
@@ -0,0 +1,103 @@
+package KohaTest::Members::ModMember;
+use base qw( KohaTest::Members );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Members;
+sub testing_class { 'C4::Members' };
+
+
+sub a_simple_usage : Test( 7 ) {
+    my $self = shift;
+
+    ok( $self->{'memberid'}, 'we have a valid memberid to test with' );
+
+    my $details = C4::Members::GetMemberDetails( $self->{'memberid'} );
+    ok( exists $details->{'dateofbirth'}, 'member details has a "dateofbirth" attribute');
+    ok( $details->{'dateofbirth'},        '...and it is set to something' );
+
+    my $new_date_of_birth = $self->random_date();
+    like( $new_date_of_birth, qr(^\d\d\d\d-\d\d-\d\d$), 'The new date of birth is a yyyy-mm-dd' );
+
+    my $success = C4::Members::ModMember(
+        borrowernumber => $self->{'memberid'},
+        dateofbirth    => $new_date_of_birth
+    );
+
+    ok( $success, 'we successfully called ModMember' );
+
+    $details = C4::Members::GetMemberDetails( $self->{'memberid'} );
+    ok( exists $details->{'dateofbirth'},              'member details still has a "dateofbirth" attribute');
+    is( $details->{'dateofbirth'}, $new_date_of_birth, '...and it is set to the new_date_of_birth' );
+
+}
+
+sub incorrect_usage : Test( 1 ) {
+    my $self = shift;
+
+    local $TODO = 'ModMember does not fail gracefully yet';
+    
+    my $result = C4::Members::ModMember();
+    ok( ! defined $result, 'ModMember returns false when passed no parameters' );
+
+}
+
+=head2 preserve_dates
+
+In bug 2284, it was determined that a Member's dateofbirth could be
+erased by a call to ModMember if no date_of_birth was passed in. Three
+date fields (dateofbirth, dateexpiry ,and dateenrolled) are treated
+differently than other fields by ModMember. This test method calls
+ModMember with none of the date fields set to ensure that they are not
+overwritten.
+
+=cut
+
+
+sub preserve_dates : Test( 18 ) {
+    my $self = shift;
+
+    ok( $self->{'memberid'}, 'we have a valid memberid to test with' );
+
+    my %date_fields = (
+        dateofbirth  => $self->random_date(),
+        dateexpiry   => $self->random_date(),
+        dateenrolled => $self->random_date(),
+    );
+
+    # stage our member with valid dates in all of the date fields
+    my $success = C4::Members::ModMember(
+        borrowernumber => $self->{'memberid'},
+        %date_fields,
+    );
+    ok( $success, 'succefully set the date fields.' );
+    
+    # make sure that we successfully set the date fields. They're not undef.
+    my $details = C4::Members::GetMemberDetails( $self->{'memberid'} );
+    foreach my $date_field ( keys %date_fields ) {
+        ok( exists $details->{$date_field},                     qq(member details has a "$date_field" attribute) );
+        ok( $details->{$date_field},                            '...and it is set to something true' );
+        is( $details->{$date_field}, $date_fields{$date_field}, '...and it is set to what we set it' );
+    }
+
+    # call ModMember to update the firstname. Notice that we're not
+    # updating any date fields.
+    $success = C4::Members::ModMember(
+        borrowernumber => $self->{'memberid'},
+        firstname      => $self->random_string,
+    );
+    ok( $success, 'we successfully called ModMember' );
+
+    # make sure that none of the date fields have been molested by our call to ModMember.
+    $details = C4::Members::GetMemberDetails( $self->{'memberid'} );
+    foreach my $date_field ( keys %date_fields ) {
+        ok( exists $details->{$date_field}, qq(member details still has a "$date_field" attribute) );
+        is( $details->{$date_field}, $date_fields{$date_field}, '...and it is set to the expected value' );
+    }
+
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Message.pm b/t/db_dependent/lib/KohaTest/Message.pm
new file mode 100644 (file)
index 0000000..d1d822f
--- /dev/null
@@ -0,0 +1,52 @@
+package KohaTest::Message;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Message;
+sub testing_class { 'C4::Message' };
+
+
+sub methods : Test( 1 ) {
+    my $self = shift;
+    my @methods = qw( 
+                    new
+                    find
+                    find_last_message
+                    enqueue
+                    update
+                    metadata
+                    render_metadata
+                    append
+                );
+    
+    can_ok( $self->testing_class, @methods );    
+}
+
+sub test_metadata : Test( 1 ) {
+    my $self = shift;
+    my $message = C4::Message->new;
+    $message->metadata({
+        header => "Header",
+        body   => [],
+        footer => "Footer",
+    });
+    like($message->{metadata}, qr{^---}, "The metadata attribute should be serialized as YAML.");
+}
+
+sub test_append : Test( 1 ) {
+    my $self = shift;
+    my $message = C4::Message->new;
+    $message->metadata({
+        header => "Header",
+        body   => [],
+        footer => "Footer",
+    });
+    $message->append("foo");
+    is($message->metadata->{body}->[0], "foo", "Appending a string should add an element to metadata.body.");
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/NewsChannels.pm b/t/db_dependent/lib/KohaTest/NewsChannels.pm
new file mode 100644 (file)
index 0000000..507677e
--- /dev/null
@@ -0,0 +1,28 @@
+package KohaTest::NewsChannels;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::NewsChannels;
+sub testing_class { 'C4::NewsChannels' };
+
+
+sub methods : Test( 1 ) {
+    my $self = shift;
+    my @methods = qw(
+                      add_opac_new 
+                      upd_opac_new 
+                      del_opac_new 
+                      get_opac_new 
+                      get_opac_news 
+                      GetNewsToDisplay 
+                );
+    
+    can_ok( $self->testing_class, @methods );    
+}
+
+1;
+
diff --git a/t/db_dependent/lib/KohaTest/Overdues.pm b/t/db_dependent/lib/KohaTest/Overdues.pm
new file mode 100644 (file)
index 0000000..949c670
--- /dev/null
@@ -0,0 +1,50 @@
+package KohaTest::Overdues;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Overdues;
+sub testing_class { 'C4::Overdues' };
+
+
+sub methods : Test( 1 ) {
+    my $self = shift;
+    my @methods = qw( Getoverdues 
+                       checkoverdues 
+                       CalcFine 
+                       GetSpecialHolidays 
+                       GetRepeatableHolidays
+                       GetWdayFromItemnumber
+                       GetIssuesIteminfo
+                       UpdateFine 
+                       BorType 
+                       ReplacementCost 
+                       GetFine 
+                       GetIssuingRules 
+                       ReplacementCost2 
+                       GetNextIdNotify 
+                       NumberNotifyId
+                       AmountNotify
+                       UpdateAccountLines 
+                       GetItems 
+                       GetOverdueDelays 
+                       CheckAccountLineLevelInfo 
+                       GetOverduerules
+                       CheckBorrowerDebarred
+                       UpdateBorrowerDebarred
+                       CheckExistantNotifyid 
+                       CheckAccountLineItemInfo 
+                       CheckItemNotify 
+                       GetOverduesForBranch 
+                       AddNotifyLine 
+                       RemoveNotifyLine 
+                );
+    
+    can_ok( $self->testing_class, @methods );    
+}
+
+1;
+
diff --git a/t/db_dependent/lib/KohaTest/Overdues/GetBranchcodesWithOverdueRules.pm b/t/db_dependent/lib/KohaTest/Overdues/GetBranchcodesWithOverdueRules.pm
new file mode 100644 (file)
index 0000000..4ff8db4
--- /dev/null
@@ -0,0 +1,59 @@
+package KohaTest::Overdues::GetBranchcodesWithOverdueRules;
+use base qw( KohaTest::Overdues );
+
+use strict;
+use warnings;
+
+use C4::Overdues;
+use Test::More;
+
+sub my_branch_has_no_rules : Tests( 2 ) {
+    my $self = shift;
+
+    ok( $self->{'branchcode'}, "we're looking for branch $self->{'branchcode'}" );
+
+    my @branches = C4::Overdues::GetBranchcodesWithOverdueRules;
+    my @found_branches = grep { $_ eq $self->{'branchcode'} } @branches;
+    is( scalar @found_branches, 0, '...and it is not in the list of branches')
+    
+}
+
+sub my_branch_has_overdue_rules : Tests( 3 ) {
+    my $self = shift;
+
+    ok( $self->{'branchcode'}, "we're looking for branch $self->{'branchcode'}" );
+
+    my $dbh = C4::Context->dbh();
+    my $sql = <<'END_SQL';
+INSERT INTO overduerules
+(branchcode,    categorycode,
+delay1,        letter1,       debarred1,
+delay2,        letter2,       debarred2,
+delay3,        letter3,       debarred3)
+VALUES
+( ?, ?,
+?, ?, ?,
+?, ?, ?,
+?, ?, ?)
+END_SQL
+
+    my $sth = $dbh->prepare($sql);
+    my $success = $sth->execute( $self->{'branchcode'}, $self->random_string(2),
+                                 1, $self->random_string(), 0,
+                                 5, $self->random_string(), 0,
+                                 9, $self->random_string(), 1, );
+    ok( $success, '...and we have successfully given it an overdue rule' );
+
+    my @branches = C4::Overdues::GetBranchcodesWithOverdueRules;
+    my @found_branches = grep { $_ eq $self->{'branchcode'} } @branches;
+    is( scalar @found_branches, 1, '...and it IS in the list of branches.')
+    
+}
+
+1;
+
+
+
+
+
+
diff --git a/t/db_dependent/lib/KohaTest/Overdues/GetOverdues.pm b/t/db_dependent/lib/KohaTest/Overdues/GetOverdues.pm
new file mode 100644 (file)
index 0000000..3cfc438
--- /dev/null
@@ -0,0 +1,126 @@
+package KohaTest::Overdues::GetOverdues;
+use base qw( KohaTest::Overdues );
+
+use strict;
+use warnings;
+
+use C4::Overdues;
+use Test::More;
+
+=head3 create_overdue_item
+
+=cut
+
+sub startup_60_create_overdue_item : Test( startup => 17 ) {
+    my $self = shift;
+    
+    $self->add_biblios( add_items => 1 );
+    
+    my $biblionumber = $self->{'biblios'}[0];
+    ok( $biblionumber, 'biblionumber' );
+    my @biblioitems = C4::Biblio::GetBiblioItemByBiblioNumber( $biblionumber );
+    ok( scalar @biblioitems > 0, 'there is at least one biblioitem' );
+    my $biblioitemnumber = $biblioitems[0]->{'biblioitemnumber'};
+    ok( $biblioitemnumber, 'got a biblioitemnumber' );
+
+    my $items = C4::Items::GetItemsByBiblioitemnumber( $biblioitemnumber);
+                           
+    my $item = $items->[0];
+    ok( $item->{'itemnumber'}, 'item number' );
+    $self->{'overdueitemnumber'} = $item->{'itemnumber'};
+    
+    # let's use the database to do date math for us.
+    # This is a US date, but that's how C4::Dates likes it, apparently.
+    my $dbh = C4::Context->dbh();
+    my $date_list = $dbh->selectcol_arrayref( q( select DATE_FORMAT( FROM_DAYS( TO_DAYS( NOW() ) - 6 ), '%m/%d/%Y' ) ) );
+    my $six_days_ago = shift( @$date_list );
+    
+    my $duedate = C4::Dates->new( $six_days_ago );
+    # diag( Data::Dumper->Dump( [ $duedate ], [ 'duedate' ] ) );
+    
+    ok( $item->{'barcode'}, 'barcode' )
+      or diag( Data::Dumper->Dump( [ $item ], [ 'item' ] ) );
+    # my $item_from_barcode = C4::Items::GetItem( undef, $item->{'barcode'} );
+    # diag( Data::Dumper->Dump( [ $item_from_barcode ], [ 'item_from_barcode' ] ) );
+
+    ok( $self->{'memberid'}, 'memberid' );
+    my $borrower = C4::Members::GetMember( borrowernumber=>$self->{'memberid'} );
+    ok( $borrower->{'borrowernumber'}, 'borrowernumber' );
+    
+    my ( $issuingimpossible, $needsconfirmation ) = C4::Circulation::CanBookBeIssued( $borrower, $item->{'barcode'}, $duedate, 0 );
+    # diag( Data::Dumper->Dump( [ $issuingimpossible, $needsconfirmation ], [ qw( issuingimpossible needsconfirmation ) ] ) );
+    is( keys %$issuingimpossible, 0, 'issuing is not impossible' );
+    is( keys %$needsconfirmation, 0, 'issuing needs no confirmation' );
+
+    C4::Circulation::AddIssue( $borrower, $item->{'barcode'}, $duedate );
+}
+
+sub basic_usage : Test( 2 ) {
+    my $self = shift;
+
+    my $overdues = C4::Overdues::Getoverdues();
+    isa_ok( $overdues, 'ARRAY' );
+    is( scalar @$overdues, 1, 'found our one overdue book' );
+}
+
+sub limit_minimum_and_maximum : Test( 2 ) {
+    my $self = shift;
+
+    my $overdues = C4::Overdues::Getoverdues( { minimumdays => 1, maximumdays => 100 } );
+    isa_ok( $overdues, 'ARRAY' );
+    is( scalar @$overdues, 1, 'found our one overdue book' );
+}
+
+sub limit_and_do_not_find_it : Test( 2 ) {
+    my $self = shift;
+
+    my $overdues = C4::Overdues::Getoverdues( { minimumdays => 1, maximumdays => 2 } );
+    isa_ok( $overdues, 'ARRAY' );
+    is( scalar @$overdues, 0, 'there are no overdue books in that range.' );
+}
+
+=pod
+
+sub run_overduenotices_script : Test( 1 ) {
+    my $self = shift;
+
+    # make sure member wants alerts
+    C4::Members::Attributes::UpdateBorrowerAttribute($self->{'memberid'},
+                                                     { code  => 'PREDEmail',
+                                                       value => '1' } );
+    
+    # we're screwing with C4::Circulation::GetUpcomingIssues by passing in a negative number.
+    C4::Members::Attributes::UpdateBorrowerAttribute($self->{'memberid'},
+                                                     { code  => 'PREDDAYS',
+                                                       value => '-6' } );
+    
+    
+    my $before_count = $self->count_message_queue();
+
+    my $output = qx( ../misc/cronjobs/advance_notices.pl -c );
+    
+    my $after_count = $self->count_message_queue();
+    is( $after_count, $before_count + 1, 'there is one more message in the queue than there used to be.' )
+      or diag $output;
+    
+}
+
+
+=cut
+
+sub count_message_queue {
+    my $self = shift;
+
+    my $dbh = C4::Context->dbh();
+    my $statement = q( select count(0) from message_queue where status = 'pending' );
+    my $countlist = $dbh->selectcol_arrayref( $statement );
+    return $countlist->[0];
+}
+
+1;
+
+
+
+
+
+
diff --git a/t/db_dependent/lib/KohaTest/Print.pm b/t/db_dependent/lib/KohaTest/Print.pm
new file mode 100644 (file)
index 0000000..02fd5fb
--- /dev/null
@@ -0,0 +1,24 @@
+package KohaTest::Print;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Print;
+sub testing_class { 'C4::Print' };
+
+
+sub methods : Test( 1 ) {
+    my $self = shift;
+    my @methods = qw( remoteprint
+                      printreserve 
+                      printslip
+                );
+    
+    can_ok( $self->testing_class, @methods );    
+}
+
+1;
+
diff --git a/t/db_dependent/lib/KohaTest/Reserves.pm b/t/db_dependent/lib/KohaTest/Reserves.pm
new file mode 100644 (file)
index 0000000..5317029
--- /dev/null
@@ -0,0 +1,41 @@
+package KohaTest::Reserves;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Reserves;
+sub testing_class { 'C4::Reserves' };
+
+
+sub methods : Test( 1 ) {
+    my $self = shift;
+    my @methods = qw(  AddReserve 
+                       GetReservesFromBiblionumber 
+                       GetReservesFromItemnumber 
+                       GetReservesFromBorrowernumber 
+                       GetReserveCount 
+                       GetOtherReserves 
+                       GetReserveFee 
+                       GetReservesToBranch 
+                       GetReservesForBranch 
+                       CheckReserves 
+                       CancelReserve 
+                       ModReserve 
+                       ModReserveFill 
+                       ModReserveStatus 
+                       ModReserveAffect 
+                       ModReserveCancelAll 
+                       ModReserveMinusPriority 
+                       GetReserveInfo 
+                       _FixPriority 
+                       _Findgroupreserve 
+                );
+    
+    can_ok( $self->testing_class, @methods );    
+}
+
+1;
+
diff --git a/t/db_dependent/lib/KohaTest/SMS.pm b/t/db_dependent/lib/KohaTest/SMS.pm
new file mode 100644 (file)
index 0000000..00af101
--- /dev/null
@@ -0,0 +1,23 @@
+package KohaTest::SMS;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::SMS;
+sub testing_class { 'C4::SMS' };
+
+
+sub methods : Test( 1 ) {
+    my $self = shift;
+    my @methods = qw( send_sms
+                      driver
+                );
+    
+    can_ok( $self->testing_class, @methods );    
+}
+
+1;
+
diff --git a/t/db_dependent/lib/KohaTest/SMS/send_sms.pm b/t/db_dependent/lib/KohaTest/SMS/send_sms.pm
new file mode 100644 (file)
index 0000000..d6bbb64
--- /dev/null
@@ -0,0 +1,25 @@
+package KohaTest::SMS::send_sms;
+use base qw( KohaTest::SMS );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::SMS;
+sub testing_class { 'C4::SMS' };
+
+
+sub send_a_message : Test( 1 ) {
+    my $self = shift;
+
+    my $success = C4::SMS->send_sms( { destination => '+1 212-555-1111',
+                                       message     => 'This is the message',
+                                       driver      => 'Test' } );
+
+    ok( $success, "send_sms returned a true: $success" );
+    
+}
+
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Scripts.pm b/t/db_dependent/lib/KohaTest/Scripts.pm
new file mode 100644 (file)
index 0000000..f44274d
--- /dev/null
@@ -0,0 +1,18 @@
+package KohaTest::Scripts;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Search;
+sub testing_class { return; };
+
+# Since this is an abstract base class, this prevents these tests from
+# being run directly unless we're testing a subclass. It just makes
+# things faster.
+__PACKAGE__->SKIP_CLASS( 1 );
+
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Scripts/longoverdue.pm b/t/db_dependent/lib/KohaTest/Scripts/longoverdue.pm
new file mode 100644 (file)
index 0000000..e00fb0c
--- /dev/null
@@ -0,0 +1,97 @@
+package KohaTest::Scripts::longoverdue;
+use base qw( KohaTest::Scripts );
+
+use strict;
+use warnings;
+
+use Test::More;
+use Time::localtime;
+
+
+=head2 STARTUP METHODS
+
+These get run once, before the main test methods in this module
+
+=head3 create_overdue_item
+
+=cut
+
+sub create_overdue_item : Test( startup => 12 ) {
+    my $self = shift;
+    
+    $self->add_biblios( add_items => 1 );
+    
+    my $biblionumber = $self->{'biblios'}[0];
+    ok( $biblionumber, 'biblionumber' );
+    my @biblioitems = C4::Biblio::GetBiblioItemByBiblioNumber( $biblionumber );
+    ok( scalar @biblioitems > 0, 'there is at least one biblioitem' );
+    my $biblioitemnumber = $biblioitems[0]->{'biblioitemnumber'};
+    ok( $biblioitemnumber, 'got a biblioitemnumber' );
+
+    my $items = C4::Items::GetItemsByBiblioitemnumber( $biblioitemnumber);
+                           
+    my $itemnumber = $items->[0]->{'itemnumber'};
+    ok( $items->[0]->{'itemnumber'}, 'item number' );
+
+    $self->{'overdueitemnumber'} = $itemnumber;
+    
+}
+
+sub set_overdue_item_lost : Test( 13 ) {
+    my $self = shift;
+
+    my $item = C4::Items::GetItem( $self->{'overdueitemnumber'} );
+    is( $item->{'itemnumber'}, $self->{'overdueitemnumber'}, 'itemnumber' );
+
+    ok( exists $item->{'itemlost'}, 'itemlost exists' );
+    ok( ! $item->{'itemlost'}, 'item is not lost' );
+
+    # This is a US date, but that's how C4::Dates likes it, apparently.
+    my $duedatestring = sprintf( '%02d/%02d/%04d',
+                                 localtime->mon() + 1,
+                                 localtime->mday(),
+                                 localtime->year() + 1900 - 1, # it was due a year ago.
+                            );
+    my $duedate = C4::Dates->new( $duedatestring );
+    # diag( Data::Dumper->Dump( [ $duedate ], [ 'duedate' ] ) );
+    
+    ok( $item->{'barcode'}, 'barcode' )
+      or diag( Data::Dumper->Dump( [ $item ], [ 'item' ] ) );
+    # my $item_from_barcode = C4::Items::GetItem( undef, $item->{'barcode'} );
+    # diag( Data::Dumper->Dump( [ $item_from_barcode ], [ 'item_from_barcode' ] ) );
+
+    my $borrower = C4::Members::GetMember( borrowernumber => $self->{'memberid'} );
+    ok( $borrower->{'borrowernumber'}, 'borrowernumber' );
+    
+    my ( $issuingimpossible, $needsconfirmation ) = C4::Circulation::CanBookBeIssued( $borrower, $item->{'barcode'}, $duedate, 0 );
+    # diag( Data::Dumper->Dump( [ $issuingimpossible, $needsconfirmation ], [ qw( issuingimpossible needsconfirmation ) ] ) );
+    is( keys %$issuingimpossible, 0, 'issuing is not impossible' );
+    is( keys %$needsconfirmation, 0, 'issuing needs no confirmation' );
+
+    my $issue_due_date = C4::Circulation::AddIssue( $borrower, $item->{'barcode'}, $duedate );
+    ok( $issue_due_date, 'due date' );
+    is( $issue_due_date, $duedate, 'AddIssue returned the same date we passed to it' );
+    
+    # I have to make this in a different format since that's how the database holds it.
+    my $duedateyyyymmdd = sprintf( '%04d-%02d-%02d',
+                                   localtime->year() + 1900 - 1, # it was due a year ago.
+                                   localtime->mon() + 1,
+                                   localtime->mday(),
+                              );
+
+    my $issued_item = C4::Items::GetItem( $self->{'overdueitemnumber'} );
+    is( $issued_item->{'onloan'}, $duedateyyyymmdd, "the item is checked out and due $duedatestring" );
+    is( $issued_item->{'itemlost'}, 0, 'the item is not lost' );
+    # diag( Data::Dumper->Dump( [ $issued_item ], [ 'issued_item' ] ) );
+
+    qx( ../misc/cronjobs/longoverdue.pl --lost 90=2 --confirm );
+
+    my $lost_item = C4::Items::GetItem( $self->{'overdueitemnumber'} );
+    is( $lost_item->{'onloan'}, $duedateyyyymmdd, "the item is checked out and due $duedatestring" );
+    is( $lost_item->{'itemlost'}, 2, 'the item is lost' );
+    # diag( Data::Dumper->Dump( [ $lost_item ], [ 'lost_item' ] ) );
+
+}
+
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Search.pm b/t/db_dependent/lib/KohaTest/Search.pm
new file mode 100644 (file)
index 0000000..4ad190b
--- /dev/null
@@ -0,0 +1,37 @@
+package KohaTest::Search;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Search;
+sub testing_class { 'C4::Search' };
+
+
+sub methods : Test( 1 ) {
+    my $self = shift;
+    my @methods = qw(
+                      FindDuplicate
+                      SimpleSearch
+                      getRecords
+                      pazGetRecords
+                      _remove_stopwords
+                      _detect_truncation
+                      _build_stemmed_operand
+                      _build_weighted_query
+                      buildQuery
+                      searchResults
+                      NZgetRecords
+                      NZanalyse
+                      NZoperatorAND
+                      NZoperatorOR
+                      NZoperatorNOT
+                      NZorder
+                );
+    
+    can_ok( $self->testing_class, @methods );    
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Search/NoZebra.pm b/t/db_dependent/lib/KohaTest/Search/NoZebra.pm
new file mode 100644 (file)
index 0000000..ade916a
--- /dev/null
@@ -0,0 +1,235 @@
+package KohaTest::Search::NoZebra;
+use base qw( KohaTest::Search );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use MARC::Record;
+
+use C4::Search;
+use C4::Biblio;
+use C4::Context;
+
+=head2 STARTUP METHODS
+
+These get run once, before the main test methods in this module
+
+=cut
+
+=head3 startup_50_init_nozebra
+
+Turn on NoZebra mode, for now, assumes and requires
+that the test database has started out using Zebra.
+
+=cut
+
+sub startup_50_init_nozebra : Test( startup => 3 ) {
+    my $using_nozebra = C4::Context->preference('NoZebra');
+    ok(!$using_nozebra, "starting out using Zebra");
+    my $dbh = C4::Context->dbh;
+    $dbh->do("UPDATE systempreferences SET value=1 WHERE variable='NoZebra'");
+    $dbh->do("UPDATE systempreferences SET value=0 WHERE variable in ('QueryFuzzy','QueryWeightFields','QueryStemming')");
+    C4::Context->clear_syspref_cache();
+    $using_nozebra = C4::Context->preference('NoZebra');
+    ok($using_nozebra, "switched to NoZebra");
+
+    my $sth = $dbh->prepare("SELECT COUNT(*) FROM nozebra");
+    $sth->execute;
+    my ($count) = $sth->fetchrow_array;
+    $sth->finish;
+    cmp_ok($count, '==', 0, "NoZebra index starts off empty");
+}
+
+sub startup_51_add_bibs : Test( startup => 2 ) {
+    my $self = shift;
+
+    my $bib1 = MARC::Record->new();
+    $bib1->leader('     nam a22     7a 4500');
+    $bib1->append_fields(
+        MARC::Field->new('010', ' ', ' ', a => 'lccn001'), 
+        MARC::Field->new('020', ' ', ' ', a => 'isbn001'), 
+        MARC::Field->new('022', ' ', ' ', a => 'issn001'), 
+        MARC::Field->new('100', ' ', ' ', a => 'Cat, Felix T.'),
+        MARC::Field->new('245', ' ', ' ', a => 'Of mice and men :', b=> 'a history'),
+    );
+    my $bib2 = MARC::Record->new();
+    $bib2->leader('     nam a22     7a 4500');
+    $bib2->append_fields(
+        MARC::Field->new('010', ' ', ' ', a => 'lccn002'), 
+        MARC::Field->new('020', ' ', ' ', a => 'isbn002'), 
+        MARC::Field->new('022', ' ', ' ', a => 'issn002'), 
+        MARC::Field->new('100', ' ', ' ', a => 'Dog, Rover T.'),
+        MARC::Field->new('245', ' ', ' ', a => 'Of mice and men :', b=> 'a digression'),
+    );
+
+    my $dbh = C4::Context->dbh;
+    my $count_sth = $dbh->prepare("SELECT COUNT(*) FROM nozebra");
+    my $count;
+    my ($bib1_bibnum, $bib1_bibitemnum) = AddBiblio($bib1, '');
+    $count_sth->execute;
+    ($count) = $count_sth->fetchrow_array;
+    cmp_ok($count, '==', 14, "correct number of new words indexed"); # tokens + biblionumber + __RAW__
+
+    my ($bib2_bibnum, $bib2_bibitemnum) = AddBiblio($bib2, '');
+    $count_sth->execute;
+    ($count) = $count_sth->fetchrow_array;
+    cmp_ok($count, '==', 22, "correct number of new words indexed"); # tokens + biblionumber + __RAW__
+
+    push @{ $self->{nozebra_test_bibs} }, $bib1_bibnum, $bib2_bibnum;
+}
+
+=head2 TEST METHODS
+
+Standard test methods
+
+=cut
+
+sub basic_searches_via_nzanalyze : Test( 28 ) {
+    my $self = shift;
+    my ($bib1_bibnum, $bib2_bibnum) = @{ $self->{nozebra_test_bibs} };
+    
+    my $results = C4::Search::NZanalyse('foobar');
+    ok(!defined($results), "no hits on 'foobar'");
+
+    $results = C4::Search::NZanalyse('dog');
+    my ($hits, @bibnumbers) = parse_nzanalyse($results);
+    cmp_ok($hits, '==', 1, "one hit on 'dog'");
+    is($bib2_bibnum, $bibnumbers[0], "correct hit on 'dog'");
+
+    $results = C4::Search::NZanalyse('au=dog');
+    ($hits, @bibnumbers) = parse_nzanalyse($results);
+    cmp_ok($hits, '==', 1, "one hit on 'au=dog'");
+    is($bib2_bibnum, $bibnumbers[0], "correct hit on 'au=dog'");
+
+    $results = C4::Search::NZanalyse('isbn=dog');
+    ($hits, @bibnumbers) = parse_nzanalyse($results);
+    cmp_ok($hits, '==', 0, "zero hits on 'isbn=dog'");
+
+    $results = C4::Search::NZanalyse('cat');
+    ($hits, @bibnumbers) = parse_nzanalyse($results);
+    cmp_ok($hits, '==', 1, "one hit on 'cat'");
+    is($bib1_bibnum, $bibnumbers[0], "correct hit on 'cat'");
+
+    $results = C4::Search::NZanalyse('cat and dog');
+    ($hits, @bibnumbers) = parse_nzanalyse($results);
+    cmp_ok($hits, '==', 0, "zero hits on 'cat and dog'");
+
+    $results = C4::Search::NZanalyse('cat or dog');
+    ($hits, @bibnumbers) = parse_nzanalyse($results);
+    cmp_ok($hits, '==', 2, "two hits on 'cat or dog'");
+    is_deeply([ sort @bibnumbers ], [ sort($bib1_bibnum, $bib2_bibnum) ], "correct hits on 'cat or dog'");
+
+    $results = C4::Search::NZanalyse('mice and men');
+    ($hits, @bibnumbers) = parse_nzanalyse($results);
+    cmp_ok($hits, '==', 2, "two hits on 'mice and men'");
+    is_deeply([ sort @bibnumbers ], [ sort($bib1_bibnum, $bib2_bibnum) ], "correct hits on 'mice and men'");
+
+    $results = C4::Search::NZanalyse('title=digression or issn=issn001');
+    ($hits, @bibnumbers) = parse_nzanalyse($results);
+    cmp_ok($hits, '==', 2, "two hits on 'title=digression or issn=issn001'");
+    is_deeply([ sort @bibnumbers ], [ sort($bib1_bibnum, $bib2_bibnum) ], "correct hits on 'title=digression or issn=issn001'");
+
+    $results = C4::Search::NZanalyse('title=digression and issn=issn002');
+    ($hits, @bibnumbers) = parse_nzanalyse($results);
+    cmp_ok($hits, '==', 1, "two hits on 'title=digression and issn=issn002'");
+    is($bib2_bibnum, $bibnumbers[0], "correct hit on 'title=digression and issn=issn002'");
+
+    $results = C4::Search::NZanalyse('mice not men');
+    ($hits, @bibnumbers) = parse_nzanalyse($results);
+    cmp_ok($hits, '==', 0, "zero hits on 'mice not men'");
+
+    $results = C4::Search::NZanalyse('mice not dog');
+    ($hits, @bibnumbers) = parse_nzanalyse($results);
+    cmp_ok($hits, '==', 1, "one hit on 'mice not dog'");
+    is($bib1_bibnum, $bibnumbers[0], "correct hit on 'mice not dog'");
+
+    $results = C4::Search::NZanalyse('isbn > a');
+    ($hits, @bibnumbers) = parse_nzanalyse($results);
+    cmp_ok($hits, '==', 2, "two hits on 'isbn > a'");
+    is_deeply([ sort @bibnumbers ], [ sort($bib1_bibnum, $bib2_bibnum) ], "correct hits on 'isbn > a'");
+
+    $results = C4::Search::NZanalyse('isbn < z');
+    ($hits, @bibnumbers) = parse_nzanalyse($results);
+    cmp_ok($hits, '==', 2, "two hits on 'isbn < z'");
+    is_deeply([ sort @bibnumbers ], [ sort($bib1_bibnum, $bib2_bibnum) ], "correct hits on 'isbn < z'");
+
+    $results = C4::Search::NZanalyse('isbn > isbn001');
+    ($hits, @bibnumbers) = parse_nzanalyse($results);
+    cmp_ok($hits, '==', 1, "one hit on 'isbn > isbn001'");
+    is($bib2_bibnum, $bibnumbers[0], "correct hit on 'isbn > isbn001'");
+
+    $results = C4::Search::NZanalyse('isbn>=isbn001');
+    ($hits, @bibnumbers) = parse_nzanalyse($results);
+    cmp_ok($hits, '==', 2, "two hits on 'isbn>=isbn001'");
+    is_deeply([ sort @bibnumbers ], [ sort($bib1_bibnum, $bib2_bibnum) ], "correct hits on 'isbn>=isbn001'");
+}
+
+sub parse_nzanalyse {
+    my $results = shift;
+    my @bibnumbers = ();
+    if (defined $results) {
+        # NZanalyze currently has a funky way of returning results -
+        # it does not guarantee that a biblionumber occurs only
+        # once in the results string.  Hence we must remove
+        # duplicates, like NZorder (inefficently) does
+        my %hash;
+        @bibnumbers = grep { ++$hash{$_} == 1 }  map { my @f = split /,/, $_; $f[0]; } split /;/, $results;
+    }
+    return scalar(@bibnumbers), @bibnumbers;
+}
+
+=head2 SHUTDOWN METHODS
+
+These get run once, after all of the main tests methods in this module
+
+=cut
+
+sub shutdown_49_remove_bibs : Test( shutdown => 4 ) {
+    my $self = shift;
+    my ($bib1_bibnum, $bib2_bibnum) = @{ $self->{nozebra_test_bibs} };
+
+    my $dbh = C4::Context->dbh;
+    my $count_sth = $dbh->prepare("SELECT COUNT(*) FROM nozebra");
+    my $count;
+
+    my $error = DelBiblio($bib2_bibnum);
+    ok(!defined($error), "deleted bib $bib2_bibnum");
+    $count_sth->execute;
+    ($count) = $count_sth->fetchrow_array;
+    TODO: { local $TODO = 'nothing actually gets deleted from nozebra currently';
+    cmp_ok($count, '==', 14, "correct number of words indexed after bib $bib2_bibnum deleted"); 
+    }
+
+    $error = DelBiblio($bib1_bibnum);
+    ok(!defined($error), "deleted bib $bib1_bibnum");
+    $count_sth->execute;
+    ($count) = $count_sth->fetchrow_array;
+    TODO: { local $TODO = 'nothing actually gets deleted from nozebra currently';
+    cmp_ok($count, '==', 0, "no entries left in nozebra after bib $bib1_bibnum deleted"); 
+    }
+
+    delete $self->{nozebra_test_bibs};
+}
+
+sub shutdown_50_init_nozebra : Test( shutdown => 3 ) {
+    my $using_nozebra = C4::Context->preference('NoZebra');
+    ok($using_nozebra, "still in NoZebra mode");
+    my $dbh = C4::Context->dbh;
+    $dbh->do("UPDATE systempreferences SET value=0 WHERE variable='NoZebra'");
+    $dbh->do("UPDATE systempreferences SET value=1 WHERE variable in ('QueryFuzzy','QueryWeightFields','QueryStemming')");
+    C4::Context->clear_syspref_cache();
+    $using_nozebra = C4::Context->preference('NoZebra');
+    ok(!$using_nozebra, "switched to Zebra");
+
+    # FIXME
+    $dbh->do("DELETE FROM nozebra");
+    my $sth = $dbh->prepare("SELECT COUNT(*) FROM nozebra");
+    $sth->execute;
+    my ($count) = $sth->fetchrow_array;
+    $sth->finish;
+    cmp_ok($count, '==', 0, "NoZebra index finishes up empty");
+}
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Search/SimpleSearch.pm b/t/db_dependent/lib/KohaTest/Search/SimpleSearch.pm
new file mode 100644 (file)
index 0000000..95324f2
--- /dev/null
@@ -0,0 +1,140 @@
+package KohaTest::Search::SimpleSearch;
+use base qw( KohaTest::Search );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Search;
+use C4::Biblio;
+
+=head2 STARTUP METHODS
+
+These get run once, before the main test methods in this module
+
+=head3 insert_test_data
+
+=cut
+
+sub insert_test_data : Test( startup => 71 ) {
+    my $self = shift;
+    
+    # get original 'Finn Test' count
+    my $query = 'Finn Test';
+    my ( $error, $results ) = SimpleSearch( $query );
+    $self->{'orig_finn_test_hits'} = scalar(@$results);
+
+    # I'm going to add a bunch of biblios so that I can search for them.
+    $self->add_biblios( count     => 10,
+                        add_items => 1 );
+
+}
+
+=head2 STARTUP METHODS
+
+standard test methods
+
+=head3 basic_test
+
+basic usage.
+
+=cut
+
+sub basic_test : Test( 2 ) {
+    my $self = shift;
+
+    my $query = 'test';
+
+    my ( $error, $results ) = SimpleSearch( $query );
+    ok( ! defined $error, 'no error found during search' );
+    like( $results->[0], qr/$query/i, 'the result seems to match the query' )
+      or diag( Data::Dumper->Dump( [ $results ], [ 'results' ] ) );
+    
+}
+
+=head3 basic_test_with_server
+
+Test the usage where we specify no limits, but we do specify a server.
+
+=cut
+
+sub basic_test_with_server : Test( 2 ) {
+    my $self = shift;
+
+    my $query = 'test';
+
+    my ( $error, $results ) = SimpleSearch( $query, undef, undef, [ 'biblioserver' ] );
+    ok( ! defined $error, 'no error found during search' );
+    like( $results->[0], qr/$query/i, 'the result seems to match the query' )
+      or diag( Data::Dumper->Dump( [ $results ], [ 'results' ] ) );
+    
+}
+
+
+=head3 basic_test_no_results
+
+Make sure we get back an empty listref when there are no results.
+
+=cut
+
+sub basic_test_no_results : Test( 3 ) {
+    my $self = shift;
+
+    my $query = 'This string is almost guaranteed to not match anything.';
+
+    my ( $error, $results ) = SimpleSearch( $query );
+    ok( ! defined $error, 'no error found during search' );
+    isa_ok( $results, 'ARRAY' );
+    is( scalar( @$results ), 0, 'an empty list was returned.' )
+      or diag( Data::Dumper->Dump( [ $results ], [ 'results' ] ) );
+}
+
+=head3 limits
+
+check that the SimpleTest method limits the number of results returned.
+
+=cut
+
+sub limits : Test( 8 ) {
+    my $self = shift;
+
+    my $query = 'Finn Test';
+
+    {
+        my ( $error, $results ) = SimpleSearch( $query );
+        ok( ! defined $error, 'no error found during search' );
+        my $expected_hits = 10 + $self->{'orig_finn_test_hits'};
+        is( scalar @$results, $expected_hits, "found all $expected_hits results." )
+          or diag( Data::Dumper->Dump( [ $results ], [ 'results' ] ) );
+    }
+    
+    my $offset = 4;
+    {
+        my ( $error, $results ) = SimpleSearch( $query, $offset );
+        ok( ! defined $error, 'no error found during search' );
+        my $expected_hits = 6 + $self->{'orig_finn_test_hits'};
+        is( scalar @$results, $expected_hits, "found $expected_hits results." )
+          or diag( Data::Dumper->Dump( [ $results ], [ 'results' ] ) );
+    }
+
+    my $max_results = 2;
+    {
+        my ( $error, $results ) = SimpleSearch( $query, $offset, $max_results );
+        ok( ! defined $error, 'no error found during search' );
+        is( scalar @$results, $max_results, "found $max_results results." )
+          or diag( Data::Dumper->Dump( [ $results ], [ 'results' ] ) );
+    }
+    
+    {
+        my ( $error, $results ) = SimpleSearch( $query, 0, $max_results );
+        ok( ! defined $error, 'no error found during search' );
+        is( scalar @$results, $max_results, "found $max_results results." )
+          or diag( Data::Dumper->Dump( [ $results ], [ 'results' ] ) );
+    }
+    
+       
+}
+
+
+1;
diff --git a/t/db_dependent/lib/KohaTest/Serials.pm b/t/db_dependent/lib/KohaTest/Serials.pm
new file mode 100644 (file)
index 0000000..e7bb249
--- /dev/null
@@ -0,0 +1,65 @@
+package KohaTest::Serials;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Serials;
+sub testing_class { 'C4::Serials' };
+
+
+sub methods : Test( 1 ) {
+    my $self = shift;
+    my @methods = qw( GetSuppliersWithLateIssues
+                      GetLateIssues
+                      GetSubscriptionHistoryFromSubscriptionId
+                      GetSerialStatusFromSerialId
+                      GetSerialInformation
+                      AddItem2Serial
+                      UpdateClaimdateIssues
+                      GetSubscription
+                      GetFullSubscription
+                      PrepareSerialsData
+                      GetSubscriptionsFromBiblionumber
+                      GetFullSubscriptionsFromBiblionumber
+                      GetSubscriptions
+                      GetSerials
+                      GetSerials2
+                      GetLatestSerials
+                      GetNextSeq
+                      GetSeq
+                      GetExpirationDate
+                      CountSubscriptionFromBiblionumber
+                      ModSubscriptionHistory
+                      ModSerialStatus
+                      ModSubscription
+                      NewSubscription
+                      ReNewSubscription
+                      NewIssue
+                      ItemizeSerials
+                      HasSubscriptionExpired
+                      DelSubscription
+                      DelIssue
+                      GetLateOrMissingIssues
+                      removeMissingIssue
+                      updateClaim
+                      getsupplierbyserialid
+                      check_routing
+                      addroutingmember
+                      reorder_members
+                      delroutingmember
+                      getroutinglist
+                      countissuesfrom
+                      abouttoexpire
+                      in_array
+                      GetNextDate
+                      itemdata
+                );
+    
+    can_ok( $self->testing_class, @methods );    
+}
+
+1;
+
diff --git a/t/db_dependent/lib/KohaTest/Suggestions.pm b/t/db_dependent/lib/KohaTest/Suggestions.pm
new file mode 100644 (file)
index 0000000..0c74717
--- /dev/null
@@ -0,0 +1,30 @@
+package KohaTest::Suggestions;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Suggestions;
+sub testing_class { 'C4::Suggestions' };
+
+
+sub methods : Test( 1 ) {
+    my $self = shift;
+    my @methods = qw( SearchSuggestion
+                      GetSuggestion
+                      GetSuggestionFromBiblionumber
+                      GetSuggestionByStatus
+                      CountSuggestion
+                      NewSuggestion
+                      ModStatus
+                      ConnectSuggestionAndBiblio
+                      DelSuggestion
+                );
+    
+    can_ok( $self->testing_class, @methods );    
+}
+
+1;
+
diff --git a/t/db_dependent/lib/KohaTest/Z3950.pm b/t/db_dependent/lib/KohaTest/Z3950.pm
new file mode 100644 (file)
index 0000000..3d94cff
--- /dev/null
@@ -0,0 +1,25 @@
+package KohaTest::Z3950;
+use base qw( KohaTest );
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use C4::Z3950;
+sub testing_class { 'C4::Z3950' };
+
+
+sub methods : Test( 1 ) {
+    my $self = shift;
+    my @methods = qw( getz3950servers
+                      z3950servername
+                      addz3950queue
+                      checkz3950searchdone
+                );
+    
+    can_ok( $self->testing_class, @methods );    
+}
+
+1;
+
diff --git a/t/lib/KohaTest.pm b/t/lib/KohaTest.pm
deleted file mode 100644 (file)
index 323b55a..0000000
+++ /dev/null
@@ -1,844 +0,0 @@
-package KohaTest;
-use base qw(Test::Class);
-
-use Test::More;
-use Data::Dumper;
-
-eval "use Test::Class";
-plan skip_all => "Test::Class required for performing database tests" if $@;
-# Or, maybe I should just die there.
-
-use C4::Auth;
-use C4::Biblio;
-use C4::Bookseller;
-use C4::Context;
-use C4::Items;
-use C4::Members;
-use C4::Search;
-use C4::Installer;
-use C4::Languages;
-use File::Temp qw/ tempdir /;
-use CGI;
-use Time::localtime;
-
-# Since this is an abstract base class, this prevents these tests from
-# being run directly unless we're testing a subclass. It just makes
-# things faster.
-__PACKAGE__->SKIP_CLASS( 1 );
-
-INIT {
-    if ($ENV{SINGLE_TEST}) {
-        # if we're running the tests in one
-        # or more test files specified via
-        #
-        #   make test-single TEST_FILES=lib/KohaTest/Foo.pm
-        #
-        # use this INIT trick taken from the POD for
-        # Test::Class::Load.
-        start_zebrasrv();
-        Test::Class->runtests;
-        stop_zebrasrv();
-    }
-}
-
-use Attribute::Handlers;
-
-=head2 Expensive test method attribute
-
-If a test method is decorated with an Expensive
-attribute, it is skipped unless the RUN_EXPENSIVE_TESTS
-environment variable is defined.
-
-To declare an entire test class and its subclasses expensive,
-define a SKIP_CLASS with the Expensive attribute:
-
-    sub SKIP_CLASS : Expensive { }
-
-=cut
-
-sub Expensive : ATTR(CODE) {
-    my ($package, $symbol, $sub, $attr, $data, $phase) = @_;
-    my $name = *{$symbol}{NAME};
-    if ($name eq 'SKIP_CLASS') {
-        if ($ENV{'RUN_EXPENSIVE_TESTS'}) {
-            *{$symbol} = sub { 0; }
-        } else {
-            *{$symbol} = sub { "Skipping expensive test classes $package (and subclasses)"; }
-        }
-    } else {
-        unless ($ENV{'RUN_EXPENSIVE_TESTS'}) {
-            # a test method that runs no tests and just returns a scalar is viewed by Test::Class as a skip
-            *{$symbol} = sub { "Skipping expensive test $package\:\:$name"; }
-        }
-    }
-}
-
-=head2 startup methods
-
-these are run once, at the beginning of the whole test suite
-
-=cut
-
-sub startup_15_truncate_tables : Test( startup => 1 ) {
-    my $self = shift;
-
-#     my @truncate_tables = qw( accountlines
-#                               accountoffsets
-#                               action_logs
-#                               alert
-#                               aqbasket
-#                               aqbookfund
-#                               aqbooksellers
-#                               aqbudget
-#                               aqorderdelivery
-#                               aqorders
-#                               auth_header
-#                               auth_subfield_structure
-#                               auth_tag_structure
-#                               auth_types
-#                               authorised_values
-#                               biblio
-#                               biblio_framework
-#                               biblioitems
-#                               borrowers
-#                               branchcategories
-#                               branches
-#                               branchrelations
-#                               branchtransfers
-#                               browser
-#                               categories
-#                               cities
-#                               class_sort_rules
-#                               class_sources
-#                               currency
-#                               deletedbiblio
-#                               deletedbiblioitems
-#                               deletedborrowers
-#                               deleteditems
-#                               ethnicity
-#                               import_batches
-#                               import_biblios
-#                               import_items
-#                               import_record_matches
-#                               import_records
-#                               issues
-#                               issuingrules
-#                               items
-#                               itemtypes
-#                               labels
-#                               labels_conf
-#                               labels_profile
-#                               labels_templates
-#                               language_descriptions
-#                               language_rfc4646_to_iso639
-#                               language_script_bidi
-#                               language_script_mapping
-#                               language_subtag_registry
-#                               letter
-#                               marc_matchers
-#                               marc_subfield_structure
-#                               marc_tag_structure
-#                               matchchecks
-#                               matcher_matchpoints
-#                               matchpoint_component_norms
-#                               matchpoint_components
-#                               matchpoints
-#                               notifys
-#                               nozebra
-#                               old_issues
-#                               old_reserves
-#                               opac_news
-#                               overduerules
-#                               patroncards
-#                               patronimage
-#                               printers
-#                               printers_profile
-#                               repeatable_holidays
-#                               reports_dictionary
-#                               reserveconstraints
-#                               reserves
-#                               reviews
-#                               roadtype
-#                               saved_reports
-#                               saved_sql
-#                               serial
-#                               serialitems
-#                               services_throttle
-#                               sessions
-#                               special_holidays
-#                               statistics
-#                               stopwords
-#                               subscription
-#                               subscriptionhistory
-#                               subscriptionroutinglist
-#                               suggestions
-#                               systempreferences
-#                               tags
-#                               userflags
-#                               virtualshelfcontents
-#                               virtualshelves
-#                               z3950servers
-#                               zebraqueue
-#                         );
-
-    my @truncate_tables = qw( accountlines
-                              accountoffsets
-                              alert
-                              aqbasket
-                              aqbooksellers
-                              aqorderdelivery
-                              aqorders
-                              auth_header
-                              branchcategories
-                              branchrelations
-                              branchtransfers
-                              browser
-                              cities
-                              deletedbiblio
-                              deletedbiblioitems
-                              deletedborrowers
-                              deleteditems
-                              ethnicity
-                              issues
-                              issuingrules
-                              labels
-                              labels_profile
-                              matchchecks
-                              notifys
-                              nozebra
-                              old_issues
-                              old_reserves
-                              overduerules
-                              patroncards
-                              patronimage
-                              printers
-                              printers_profile
-                              reports_dictionary
-                              reserveconstraints
-                              reserves
-                              reviews
-                              roadtype
-                              saved_reports
-                              saved_sql
-                              serial
-                              serialitems
-                              services_throttle
-                              special_holidays
-                              statistics
-                              subscription
-                              subscriptionhistory
-                              subscriptionroutinglist
-                              suggestions
-                              tags
-                              virtualshelfcontents
-                        );
-
-    my $failed_to_truncate = 0;
-    foreach my $table ( @truncate_tables ) {
-        my $dbh = C4::Context->dbh();
-        $dbh->do( "truncate $table" )
-          or $failed_to_truncate = 1;
-    }
-    is( $failed_to_truncate, 0, 'truncated tables' );
-}
-
-=head2 startup_20_add_bookseller
-
-we need a bookseller for many of the tests, so let's insert one. Feel
-free to use this one, or insert your own.
-
-=cut
-
-sub startup_20_add_bookseller : Test(startup => 1) {
-    my $self = shift;
-
-    my $booksellerinfo = { name => 'bookseller ' . $self->random_string(),
-                      };
-
-    my $id = AddBookseller( $booksellerinfo );
-    ok( $id, "created bookseller: $id" );
-    $self->{'booksellerid'} = $id;
-
-    return;
-}
-
-=head2 startup_22_add_bookfund
-
-we need a bookfund for many of the tests. This currently uses one that
-is in the skeleton database.  free to use this one, or insert your
-own.
-
-=cut
-
-sub startup_22_add_bookfund : Test(startup => 2) {
-    my $self = shift;
-
-    my $bookfundid = 'GEN';
-    my $bookfund = GetBookFund( $bookfundid, undef );
-    # diag( Data::Dumper->Dump( [ $bookfund ], qw( bookfund  ) ) );
-    is( $bookfund->{'bookfundid'},   $bookfundid,      "found bookfund: '$bookfundid'" );
-    is( $bookfund->{'bookfundname'}, 'General Stacks', "found bookfund: '$bookfundid'" );
-
-    $self->{'bookfundid'} = $bookfundid;
-    return;
-}
-
-=head2 startup_24_add_branch
-
-=cut
-
-sub startup_24_add_branch : Test(startup => 1) {
-    my $self = shift;
-
-    my $branch_info = {
-        add            => 1,
-        branchcode     => $self->random_string(3),
-        branchname     => $self->random_string(),
-        branchaddress1 => $self->random_string(),
-        branchaddress2 => $self->random_string(),
-        branchaddress3 => $self->random_string(),
-        branchphone    => $self->random_phone(),
-        branchfax      => $self->random_phone(),
-        brancemail     => $self->random_email(),
-        branchip       => $self->random_ip(),
-        branchprinter  => $self->random_string(),
-      };
-    C4::Branch::ModBranch($branch_info);
-    $self->{'branchcode'} = $branch_info->{'branchcode'};
-    ok( $self->{'branchcode'}, "created branch: $self->{'branchcode'}" );
-
-}
-
-=head2 startup_24_add_member
-
-Add a patron/member for the tests to use
-
-=cut
-
-sub startup_24_add_member : Test(startup => 1) {
-    my $self = shift;
-
-    my $memberinfo = { surname      => 'surname '  . $self->random_string(),
-                       firstname    => 'firstname' . $self->random_string(),
-                       address      => 'address'   . $self->random_string(),
-                       city         => 'city'      . $self->random_string(),
-                       cardnumber   => 'card'      . $self->random_string(),
-                       branchcode   => 'CPL', # CPL => Centerville
-                       categorycode => 'PT',  # PT  => PaTron
-                       dateexpiry   => '2010-01-01',
-                       password     => 'testpassword',
-                       dateofbirth  => $self->random_date(),
-                  };
-
-    my $borrowernumber = AddMember( %$memberinfo );
-    ok( $borrowernumber, "created member: $borrowernumber" );
-    $self->{'memberid'} = $borrowernumber;
-
-    return;
-}
-
-=head2 startup_30_login
-
-=cut
-
-sub startup_30_login : Test( startup => 2 ) {
-    my $self = shift;
-
-    $self->{'sessionid'} = '12345678'; # does this value matter?
-    my $borrower_details = C4::Members::GetMemberDetails( $self->{'memberid'} );
-    ok( $borrower_details->{'cardnumber'}, 'cardnumber' );
-
-    # make a cookie and force it into $cgi.
-    # This would be a lot easier with Test::MockObject::Extends.
-    my $cgi = CGI->new( { userid   => $borrower_details->{'cardnumber'},
-                          password => 'testpassword' } );
-    my $setcookie = $cgi->cookie( -name  => 'CGISESSID',
-                                  -value => $self->{'sessionid'} );
-    $cgi->{'.cookies'} = { CGISESSID => $setcookie };
-    is( $cgi->cookie('CGISESSID'), $self->{'sessionid'}, 'the CGISESSID cookie is set' );
-    # diag( Data::Dumper->Dump( [ $cgi->cookie('CGISESSID') ], [ qw( cookie ) ] ) );
-
-    # C4::Auth::checkauth sometimes emits a warning about unable to append to sessionlog. That's OK.
-    my ( $userid, $cookie, $sessionID ) = C4::Auth::checkauth( $cgi, 'noauth', {}, 'intranet' );
-    # diag( Data::Dumper->Dump( [ $userid, $cookie, $sessionID ], [ qw( userid cookie sessionID ) ] ) );
-
-    # my $session = C4::Auth::get_session( $sessionID );
-    # diag( Data::Dumper->Dump( [ $session ], [ qw( session ) ] ) );
-
-
-}
-
-=head2 setup methods
-
-setup methods are run before every test method
-
-=cut
-
-=head2 teardown methods
-
-teardown methods are many time, once at the end of each test method.
-
-=cut
-
-=head2 shutdown methods
-
-shutdown methods are run once, at the end of the test suite
-
-=cut
-
-=head2 utility methods
-
-These are not test methods, but they're handy
-
-=cut
-
-=head3 random_string
-
-Nice for generating names and such. It's not actually random, more
-like arbitrary.
-
-=cut
-
-sub random_string {
-    my $self = shift;
-
-    my $wordsize = shift || 6;  # how many letters in your string?
-
-    # leave out these characters: "oOlL10". They're too confusing.
-    my @alphabet = ( 'a'..'k','m','n','p'..'z', 'A'..'K','M','N','P'..'Z', 2..9 );
-
-    my $randomstring;
-    foreach ( 0..$wordsize ) {
-        $randomstring .= $alphabet[ rand( scalar( @alphabet ) ) ];
-    }
-    return $randomstring;
-
-}
-
-=head3 random_phone
-
-generates a random phone number. Currently, it's not actually random. It's an unusable US phone number
-
-=cut
-
-sub random_phone {
-    my $self = shift;
-
-    return '212-555-5555';
-
-}
-
-=head3 random_email
-
-generates a random email address. They're all in the unusable
-'example.com' domain that is designed for this purpose.
-
-=cut
-
-sub random_email {
-    my $self = shift;
-
-    return $self->random_string() . '@example.com';
-
-}
-
-=head3 random_ip
-
-returns an IP address suitable for testing purposes.
-
-=cut
-
-sub random_ip {
-    my $self = shift;
-
-    return '127.0.0.2';
-
-}
-
-=head3 random_date
-
-returns a somewhat random date in the iso (yyyy-mm-dd) format.
-
-=cut
-
-sub random_date {
-    my $self = shift;
-
-    my $year  = 1800 + int( rand(300) );    # 1800 - 2199
-    my $month = 1 + int( rand(12) );        # 1 - 12
-    my $day   = 1 + int( rand(28) );        # 1 - 28
-                                            # stop at the 28th to keep us from generating February 31st and such.
-
-    return sprintf( '%04d-%02d-%02d', $year, $month, $day );
-
-}
-
-=head3 tomorrow
-
-returns tomorrow's date as YYYY-MM-DD.
-
-=cut
-
-sub tomorrow {
-    my $self = shift;
-
-    return $self->days_from_now( 1 );
-
-}
-
-=head3 yesterday
-
-returns yesterday's date as YYYY-MM-DD.
-
-=cut
-
-sub yesterday {
-    my $self = shift;
-
-    return $self->days_from_now( -1 );
-}
-
-
-=head3 days_from_now
-
-returns an arbitrary date based on today in YYYY-MM-DD format.
-
-=cut
-
-sub days_from_now {
-    my $self = shift;
-    my $days = shift or return;
-
-    my $seconds = time + $days * 60*60*24;
-    my $yyyymmdd = sprintf( '%04d-%02d-%02d',
-                            localtime( $seconds )->year() + 1900,
-                            localtime( $seconds )->mon() + 1,
-                            localtime( $seconds )->mday() );
-    return $yyyymmdd;
-}
-
-=head3 add_biblios
-
-  $self->add_biblios( count     => 10,
-                      add_items => 1, );
-
-  named parameters:
-     count: number of biblios to add
-     add_items: should you add items for each one?
-
-  returns:
-    I don't know yet.
-
-  side effects:
-    adds the biblionumbers to the $self->{'biblios'} listref
-
-  Notes:
-    Should I allow you to pass in biblio information, like title?
-    Since this method is in the KohaTest class, all tests in it will be ignored, unless you call this from your own namespace.
-    This runs 10 tests, plus 4 for each "count", plus 3 more for each item added.
-
-=cut
-
-sub add_biblios {
-    my $self = shift;
-    my %param = @_;
-
-    $param{'count'}     = 1 unless defined( $param{'count'} );
-    $param{'add_items'} = 0 unless defined( $param{'add_items'} );
-
-    foreach my $counter ( 1..$param{'count'} ) {
-        my $marcrecord  = MARC::Record->new();
-        isa_ok( $marcrecord, 'MARC::Record' );
-        my @marc_fields = ( MARC::Field->new( '100', '1', '0',
-                                              a => 'Twain, Mark',
-                                              d => "1835-1910." ),
-                            MARC::Field->new( '245', '1', '4',
-                                              a => sprintf( 'The Adventures of Huckleberry Finn Test %s', $counter ),
-                                              c => "Mark Twain ; illustrated by E.W. Kemble." ),
-                            MARC::Field->new( '952', '0', '0',
-                                              p => '12345678' . $self->random_string() ),   # barcode
-                            MARC::Field->new( '952', '0', '0',
-                                              o => $self->random_string() ),   # callnumber
-                            MARC::Field->new( '952', '0', '0',
-                                              a => 'CPL',
-                                              b => 'CPL' ),
-                       );
-
-        my $appendedfieldscount = $marcrecord->append_fields( @marc_fields );
-
-        diag $MARC::Record::ERROR if ( $MARC::Record::ERROR );
-        is( $appendedfieldscount, scalar @marc_fields, 'added correct number of MARC fields' );
-
-        my $frameworkcode = ''; # XXX I'd like to put something reasonable here.
-        my ( $biblionumber, $biblioitemnumber ) = AddBiblio( $marcrecord, $frameworkcode );
-        ok( $biblionumber, "the biblionumber is $biblionumber" );
-        ok( $biblioitemnumber, "the biblioitemnumber is $biblioitemnumber" );
-        if ( $param{'add_items'} ) {
-            # my @iteminfo = AddItem( {}, $biblionumber );
-            my @iteminfo = AddItemFromMarc( $marcrecord, $biblionumber );
-            is( $iteminfo[0], $biblionumber,     "biblionumber is $biblionumber" );
-            is( $iteminfo[1], $biblioitemnumber, "biblioitemnumber is $biblioitemnumber" );
-            ok( $iteminfo[2], "itemnumber is $iteminfo[2]" );
-        push @{ $self->{'items'} },
-          { biblionumber     => $iteminfo[0],
-            biblioitemnumber => $iteminfo[1],
-            itemnumber       => $iteminfo[2],
-          };
-        }
-        push @{$self->{'biblios'}}, $biblionumber;
-    }
-
-    $self->reindex_marc();
-    my $query = 'Finn Test';
-    my ( $error, $results ) = SimpleSearch( $query );
-    if ( $param{'count'} <= scalar( @$results ) ) {
-        pass( "found all $param{'count'} titles" );
-    } else {
-        fail( "we never found all $param{'count'} titles" );
-    }
-
-}
-
-=head3 reindex_marc
-
-Do a fast reindexing of all of the bib and authority
-records and mark all zebraqueue entries done.
-
-Useful for test routines that need to do a
-lot of indexing without having to wait for
-zebraqueue.
-
-In NoZebra model, this only marks zebraqueue
-done - the records should already be indexed.
-
-=cut
-
-sub reindex_marc {
-    my $self = shift;
-
-    # mark zebraqueue done regardless of the indexing mode
-    my $dbh = C4::Context->dbh();
-    $dbh->do("UPDATE zebraqueue SET done = 1 WHERE done = 0");
-
-    return if C4::Context->preference('NoZebra');
-
-    my $directory = tempdir(CLEANUP => 1);
-    foreach my $record_type qw(biblio authority) {
-        mkdir "$directory/$record_type";
-        my $sth = $dbh->prepare($record_type eq "biblio" ? "SELECT marc FROM biblioitems" : "SELECT marc FROM auth_header");
-        $sth->execute();
-        open OUT, ">:utf8", "$directory/$record_type/records";
-        while (my ($blob) = $sth->fetchrow_array) {
-            print OUT $blob;
-        }
-        close OUT;
-        my $zebra_server = "${record_type}server";
-        my $zebra_config  = C4::Context->zebraconfig($zebra_server)->{'config'};
-        my $zebra_db_dir  = C4::Context->zebraconfig($zebra_server)->{'directory'};
-        my $zebra_db = $record_type eq 'biblio' ? 'biblios' : 'authorities';
-        system "zebraidx -c $zebra_config -d $zebra_db -g iso2709 init > /dev/null 2>\&1";
-        system "zebraidx -c $zebra_config -d $zebra_db -g iso2709 update $directory/${record_type} > /dev/null 2>\&1";
-        system "zebraidx -c $zebra_config -d $zebra_db -g iso2709 commit > /dev/null 2>\&1";
-    }
-
-}
-
-
-=head3 clear_test_database
-
-  removes all tables from test database so that install starts with a clean slate
-
-=cut
-
-sub clear_test_database {
-
-    diag "removing tables from test database";
-
-    my $dbh = C4::Context->dbh;
-    my $schema = C4::Context->config("database");
-
-    my @tables = get_all_tables($dbh, $schema);
-    foreach my $table (@tables) {
-        drop_all_foreign_keys($dbh, $table);
-    }
-
-    foreach my $table (@tables) {
-        drop_table($dbh, $table);
-    }
-}
-
-sub get_all_tables {
-  my ($dbh, $schema) = @_;
-  my $sth = $dbh->prepare("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = ?");
-  my @tables = ();
-  $sth->execute($schema);
-  while (my ($table) = $sth->fetchrow_array) {
-    push @tables, $table;
-  }
-  $sth->finish;
-  return @tables;
-}
-
-sub drop_all_foreign_keys {
-    my ($dbh, $table) = @_;
-    # get the table description
-    my $sth = $dbh->prepare("SHOW CREATE TABLE $table");
-    $sth->execute;
-    my $vsc_structure = $sth->fetchrow;
-    # split on CONSTRAINT keyword
-    my @fks = split /CONSTRAINT /,$vsc_structure;
-    # parse each entry
-    foreach (@fks) {
-        # isolate what is before FOREIGN KEY, if there is something, it's a foreign key to drop
-        $_ = /(.*) FOREIGN KEY.*/;
-        my $id = $1;
-        if ($id) {
-            # we have found 1 foreign, drop it
-            $dbh->do("ALTER TABLE $table DROP FOREIGN KEY $id");
-            if ( $dbh->err ) {
-                diag "unable to DROP FOREIGN KEY '$id' on TABLE '$table' due to: " . $dbh->errstr();
-            }
-            undef $id;
-        }
-    }
-}
-
-sub drop_table {
-    my ($dbh, $table) = @_;
-    $dbh->do("DROP TABLE $table");
-    if ( $dbh->err ) {
-        diag "unable to drop table: '$table' due to: " . $dbh->errstr();
-    }
-}
-
-=head3 create_test_database
-
-  sets up the test database.
-
-=cut
-
-sub create_test_database {
-
-    diag 'creating testing database...';
-    my $installer = C4::Installer->new() or die 'unable to create new installer';
-    # warn Data::Dumper->Dump( [ $installer ], [ 'installer' ] );
-    my $all_languages = getAllLanguages();
-    my $error = $installer->load_db_schema();
-    die "unable to load_db_schema: $error" if ( $error );
-    my $list = $installer->sql_file_list('en', 'marc21', { optional  => 1,
-                                                           mandatory => 1 } );
-    my ($fwk_language, $installed_list) = $installer->load_sql_in_order($all_languages, @$list);
-    $installer->set_version_syspref();
-    $installer->set_marcflavour_syspref('MARC21');
-    $installer->set_indexing_engine(0);
-    diag 'database created.'
-}
-
-
-=head3 start_zebrasrv
-
-  This method deletes and reinitializes the zebra database directory,
-  and then spans off a zebra server.
-
-=cut
-
-sub start_zebrasrv {
-
-    stop_zebrasrv();
-    diag 'cleaning zebrasrv...';
-
-    foreach my $zebra_server ( qw( biblioserver authorityserver ) ) {
-        my $zebra_config  = C4::Context->zebraconfig($zebra_server)->{'config'};
-        my $zebra_db_dir  = C4::Context->zebraconfig($zebra_server)->{'directory'};
-        foreach my $zebra_db_name ( qw( biblios authorities ) ) {
-            my $command = "zebraidx -c $zebra_config -d $zebra_db_name init";
-            my $return = system( $command . ' > /dev/null 2>&1' );
-            if ( $return != 0 ) {
-                diag( "command '$command' died with value: " . $? >> 8 );
-            }
-
-            $command = "zebraidx -c $zebra_config -d $zebra_db_name create $zebra_db_name";
-            diag $command;
-            $return = system( $command . ' > /dev/null 2>&1' );
-            if ( $return != 0 ) {
-                diag( "command '$command' died with value: " . $? >> 8 );
-            }
-        }
-    }
-
-    diag 'starting zebrasrv...';
-
-    my $pidfile = File::Spec->catdir( C4::Context->config("logdir"), 'zebra.pid' );
-    my $command = sprintf( 'zebrasrv -f %s -D -l %s -p %s',
-                           $ENV{'KOHA_CONF'},
-                           File::Spec->catdir( C4::Context->config("logdir"), 'zebra.log' ),
-                           $pidfile,
-                      );
-    diag $command;
-    my $output = qx( $command );
-    if ( $output ) {
-        diag $output;
-    }
-    if ( -e $pidfile, 'pidfile exists' ) {
-        diag 'zebrasrv started.';
-    } else {
-        die 'unable to start zebrasrv';
-    }
-    return $output;
-}
-
-=head3 stop_zebrasrv
-
-  using the PID file for the zebra server, send it a TERM signal with
-  "kill". We can't tell if the process actually dies or not.
-
-=cut
-
-sub stop_zebrasrv {
-
-    my $pidfile = File::Spec->catdir( C4::Context->config("logdir"), 'zebra.pid' );
-    if ( -e $pidfile ) {
-        open( my $pidh, '<', $pidfile )
-          or return;
-        if ( defined $pidh ) {
-            my ( $pid ) = <$pidh> or return;
-            close $pidh;
-            my $killed = kill 15, $pid; # 15 is TERM
-            if ( $killed != 1 ) {
-                warn "unable to kill zebrasrv with pid: $pid";
-            }
-        }
-    }
-}
-
-
-=head3 start_zebraqueue_daemon
-
-  kick off a zebraqueue_daemon.pl process.
-
-=cut
-
-sub start_zebraqueue_daemon {
-
-    my $command = q(run/bin/koha-zebraqueue-ctl.sh start);
-    diag $command;
-    my $started = system( $command );
-    diag "started: $started";
-
-}
-
-=head3 stop_zebraqueue_daemon
-
-
-=cut
-
-sub stop_zebraqueue_daemon {
-
-    my $command = q(run/bin/koha-zebraqueue-ctl.sh stop);
-    diag $command;
-    my $started = system( $command );
-    diag "started: $started";
-
-}
-
-1;
diff --git a/t/lib/KohaTest/Accounts.pm b/t/lib/KohaTest/Accounts.pm
deleted file mode 100644 (file)
index 703d478..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-package KohaTest::Accounts;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Accounts;
-sub testing_class { 'C4::Accounts' };
-
-
-sub methods : Test( 1 ) {
-    my $self = shift;
-    my @methods = qw( recordpayment
-                      makepayment
-                      getnextacctno
-                      returnlost
-                      manualinvoice
-                      fixcredit
-                      refund
-                      getcharges
-                      getcredits
-                      getrefunds
-                );     # removed fixaccounts (unused by codebase)
-    
-    can_ok( $self->testing_class, @methods );    
-}
-
-1;
diff --git a/t/lib/KohaTest/Acquisition.pm b/t/lib/KohaTest/Acquisition.pm
deleted file mode 100644 (file)
index eca0b16..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-package KohaTest::Acquisition;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Acquisition;
-use C4::Context;
-use C4::Members;
-use Time::localtime;
-
-sub testing_class { 'C4::Acquisition' };
-
-
-sub methods : Test( 1 ) {
-    my $self = shift;
-    my @methods = qw(  GetBasket 
-                       NewBasket 
-                       CloseBasket 
-                       GetPendingOrders 
-                       GetOrders 
-                       GetOrderNumber 
-                       GetOrder 
-                       NewOrder 
-                       ModOrder 
-                       ModOrderBiblioNumber 
-                       ModReceiveOrder 
-                       SearchOrder 
-                       DelOrder 
-                       GetParcel 
-                       GetParcels 
-                       GetLateOrders 
-                       GetHistory 
-                       GetRecentAcqui 
-                );
-    
-    can_ok( $self->testing_class, @methods );    
-}
-
-=head3 create_new_basket
-
-  creates a baseket by creating an order with no baseket number.
-
-  named parameters:
-    authorizedby
-    invoice
-    date
-
-  returns: baseket number, order number
-
-  runs 4 tests
-
-=cut
-
-sub create_new_basket {
-    my $self = shift;
-    my %param = @_;
-    $param{'authorizedby'} = $self->{'memberid'} unless exists $param{'authorizedby'};
-    $param{'invoice'}      = 123                 unless exists $param{'invoice'};
-    
-    my $today = sprintf( '%04d-%02d-%02d',
-                         localtime->year() + 1900,
-                         localtime->mon() + 1,
-                         localtime->mday() );
-    
-    # I actually think that this parameter is unused.
-    $param{'date'}         = $today              unless exists $param{'date'};
-
-    $self->add_biblios( add_items => 1 );
-    ok( scalar @{$self->{'biblios'}} > 0, 'we have added at least one biblio' );
-
-    my ( $basketno, $ordernumber ) = NewOrder( undef, # $basketno,
-                                          $self->{'biblios'}[0], # $bibnum,
-                                          undef, # $title,
-                                          1, # $quantity,
-                                          undef, # $listprice,
-                                          $self->{'booksellerid'}, # $booksellerid,
-                                          $param{'authorizedby'}, # $authorisedby,
-                                          undef, # $notes,
-                                          $self->{'bookfundid'},     # $bookfund,
-                                          undef, # $bibitemnum,
-                                          1, # $rrp,
-                                          1, # $ecost,
-                                          undef, # $gst,
-                                          undef, # $budget,
-                                          undef, # $cost,
-                                          undef, # $sub,
-                                          $param{'invoice'}, # $invoice,
-                                          undef, # $sort1,
-                                          undef, # $sort2,
-                                          undef, # $purchaseorder
-                                     );
-    ok( $basketno, "my basket number is $basketno" );
-    ok( $ordernumber,   "my order number is $ordernumber" );
-    
-    my $order = GetOrder( $ordernumber );
-    is( $order->{'ordernumber'}, $ordernumber, 'got the right order' )
-      or diag( Data::Dumper->Dump( [ $order ], [ 'order' ] ) );
-    
-    is( $order->{'budgetdate'}, $today, "the budget date is $today" );
-
-    # XXX should I stuff these in $self?
-    return ( $basketno, $ordernumber );
-    
-}
-
-
-sub enable_independant_branches {
-    my $self = shift;
-    
-    my $member = GetMember( 'borrowernumber' =>$self->{'memberid'} );
-    
-    C4::Context::set_userenv( 0, # usernum
-                              $self->{'memberid'}, # userid
-                              undef, # usercnum
-                              undef, # userfirstname
-                              undef, # usersurname
-                              $member->{'branchcode'}, # userbranch
-                              undef, # branchname
-                              0, # userflags
-                              undef, # emailaddress
-                              undef, # branchprinter
-                         );
-
-    # set a preference. There's surely a method for this, but I can't find it.
-    my $retval = C4::Context->dbh->do( q(update systempreferences set value = '1' where variable = 'IndependantBranches') );
-    ok( $retval, 'set the preference' );
-    
-    ok( C4::Context->userenv, 'usernev' );
-    isnt( C4::Context->userenv->{flags}, 1, 'flag != 1' )
-      or diag( Data::Dumper->Dump( [ C4::Context->userenv ], [ 'userenv' ] ) );
-
-    is( C4::Context->userenv->{branch}, $member->{'branchcode'}, 'we have set the right branch in C4::Context: ' . $member->{'branchcode'} );
-    
-}
-
-sub disable_independant_branches {
-    my $self = shift;
-
-    my $retval = C4::Context->dbh->do( q(update systempreferences set value = '0' where variable = 'IndependantBranches') );
-    ok( $retval, 'set the preference back' );
-
-    
-}
-1;
diff --git a/t/lib/KohaTest/Acquisition/GetHistory.pm b/t/lib/KohaTest/Acquisition/GetHistory.pm
deleted file mode 100644 (file)
index 8c7c475..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-package KohaTest::Acquisition::GetHistory;
-use base qw( KohaTest::Acquisition );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Acquisition;
-use C4::Context;
-use C4::Members;
-use C4::Biblio;
-use C4::Bookseller;
-
-=head3 no_history
-
-
-
-=cut
-
-sub no_history : Test( 4 ) {
-    my $self = shift;
-
-    # my ( $order_loop, $total_qty, $total_price, $total_qtyreceived) = GetHistory( $title, $author, $name, $from_placed_on, $to_placed_on )
-
-    my ( $order_loop, $total_qty, $total_price, $total_qtyreceived) = GetHistory();
-    # diag( Data::Dumper->Dump( [ $order_loop, $total_qty, $total_price, $total_qtyreceived ], [ qw( order_loop total_qty total_price total_qtyreceived ) ] ) );
-
-    is( scalar @$order_loop, 0, 'order_loop is empty' );
-    is( $total_qty,          0, 'total_qty' );
-    is( $total_price,        0, 'total_price' );
-    is( $total_qtyreceived,  0, 'total_qtyreceived' );
-
-    
-}
-
-=head3 one_order
-
-=cut
-
-sub one_order : Test( 50 ) {
-    my $self = shift;
-    
-    my ( $basketno, $ordernumber ) = $self->create_new_basket();
-    ok( $basketno, "basketno is $basketno" );
-    ok( $ordernumber, "ordernumber is $ordernumber" );
-
-    # No arguments fetches no history.
-    {
-        my ( $order_loop, $total_qty, $total_price, $total_qtyreceived) = GetHistory();
-        # diag( Data::Dumper->Dump( [ $order_loop, $total_qty, $total_price, $total_qtyreceived ], [ qw( order_loop total_qty total_price total_qtyreceived ) ] ) );
-        
-        is( scalar @$order_loop, 0, 'order_loop is empty' );
-        is( $total_qty,          0, 'total_qty' );
-        is( $total_price,        0, 'total_price' );
-        is( $total_qtyreceived,  0, 'total_qtyreceived' );
-    }
-
-    my $bibliodata = GetBiblioData( $self->{'biblios'}[0] );
-    ok( $bibliodata->{'title'}, 'the biblio has a title' )
-      or diag( Data::Dumper->Dump( [ $bibliodata ], [ 'bibliodata' ] ) );
-    
-    # searching by title should find it.
-    {
-        my ( $order_loop, $total_qty, $total_price, $total_qtyreceived) = GetHistory( $bibliodata->{'title'} );
-        # diag( Data::Dumper->Dump( [ $order_loop, $total_qty, $total_price, $total_qtyreceived ], [ qw( order_loop total_qty total_price total_qtyreceived ) ] ) );
-    
-        is( scalar @$order_loop, 1, 'order_loop searched by title' );
-        is( $total_qty,          1, 'total_qty searched by title' );
-        is( $total_price,        1, 'total_price searched by title' );
-        is( $total_qtyreceived,  0, 'total_qtyreceived searched by title' );
-
-        # diag( Data::Dumper->Dump( [ $order_loop ], [ 'order_loop' ] ) );
-    }
-
-    # searching by author
-    {
-        my ( $order_loop, $total_qty, $total_price, $total_qtyreceived) = GetHistory( undef, $bibliodata->{'author'} );
-        # diag( Data::Dumper->Dump( [ $order_loop, $total_qty, $total_price, $total_qtyreceived ], [ qw( order_loop total_qty total_price total_qtyreceived ) ] ) );
-    
-        is( scalar @$order_loop, 1, 'order_loop searched by author' );
-        is( $total_qty,          1, 'total_qty searched by author' );
-        is( $total_price,        1, 'total_price searched by author' );
-        is( $total_qtyreceived,  0, 'total_qtyreceived searched by author' );
-    }
-
-    # searching by name
-    {
-        # diag( Data::Dumper->Dump( [ $bibliodata ], [ 'bibliodata' ] ) );
-
-        my $bookseller = GetBookSellerFromId( $self->{'booksellerid'} );
-        ok( $bookseller->{'name'}, 'bookseller name' )
-          or diag( Data::Dumper->Dump( [ $bookseller ], [ 'bookseller' ] ) );
-        
-        my ( $order_loop, $total_qty, $total_price, $total_qtyreceived) = GetHistory( undef, undef, $bookseller->{'name'} );
-        # diag( Data::Dumper->Dump( [ $order_loop, $total_qty, $total_price, $total_qtyreceived ], [ qw( order_loop total_qty total_price total_qtyreceived ) ] ) );
-    
-        is( scalar @$order_loop, 1, 'order_loop searched by name' );
-        is( $total_qty,          1, 'total_qty searched by name' );
-        is( $total_price,        1, 'total_price searched by name' );
-        is( $total_qtyreceived,  0, 'total_qtyreceived searched by name' );
-    }
-
-    # searching by from_date
-    {
-        my $tomorrow = $self->tomorrow();
-        # diag( "tomorrow is $tomorrow" );
-
-        my ( $order_loop, $total_qty, $total_price, $total_qtyreceived) = GetHistory( undef, undef, undef, undef, $tomorrow );
-        # diag( Data::Dumper->Dump( [ $order_loop, $total_qty, $total_price, $total_qtyreceived ], [ qw( order_loop total_qty total_price total_qtyreceived ) ] ) );
-    
-        is( scalar @$order_loop, 1, 'order_loop searched by to_date' );
-        is( $total_qty,          1, 'total_qty searched by to_date' );
-        is( $total_price,        1, 'total_price searched by to_date' );
-        is( $total_qtyreceived,  0, 'total_qtyreceived searched by to_date' );
-    }
-
-    # searching by from_date
-    {
-        my $yesterday = $self->yesterday();
-        # diag( "yesterday was $yesterday" );
-    
-        my ( $order_loop, $total_qty, $total_price, $total_qtyreceived) = GetHistory( undef, undef, undef, $yesterday );
-        # diag( Data::Dumper->Dump( [ $order_loop, $total_qty, $total_price, $total_qtyreceived ], [ qw( order_loop total_qty total_price total_qtyreceived ) ] ) );
-    
-        is( scalar @$order_loop, 1, 'order_loop searched by from_date' );
-        is( $total_qty,          1, 'total_qty searched by from_date' );
-        is( $total_price,        1, 'total_price searched by from_date' );
-        is( $total_qtyreceived,  0, 'total_qtyreceived searched by from_date' );
-    }
-
-    # set up some things necessary to make GetHistory use the IndependantBranches
-    $self->enable_independant_branches();    
-
-    # just search by title here, we need to search by something.
-    {
-        my ( $order_loop, $total_qty, $total_price, $total_qtyreceived) = GetHistory( $bibliodata->{'title'} );
-        # diag( Data::Dumper->Dump( [ $order_loop, $total_qty, $total_price, $total_qtyreceived ], [ qw( order_loop total_qty total_price total_qtyreceived ) ] ) );
-    
-        is( scalar @$order_loop, 1, 'order_loop searched by title' );
-        is( $total_qty,          1, 'total_qty searched by title' );
-        is( $total_price,        1, 'total_price searched by title' );
-        is( $total_qtyreceived,  0, 'total_qtyreceived searched by title' );
-
-        # diag( Data::Dumper->Dump( [ $order_loop ], [ 'order_loop' ] ) );
-    }
-    
-    # reset that.
-    $self->disable_independant_branches();    
-
-    
-
-    
-}
-
-
-1;
diff --git a/t/lib/KohaTest/Acquisition/GetLateOrders.pm b/t/lib/KohaTest/Acquisition/GetLateOrders.pm
deleted file mode 100644 (file)
index a2f95ea..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-package KohaTest::Acquisition::GetLateOrders;
-use base qw( KohaTest::Acquisition );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Acquisition;
-use C4::Context;
-use C4::Members;
-
-=head3 no_orders
-
-=cut
-
-sub no_orders : Test( 1 ) {
-    my $self = shift;
-
-    my @orders = GetLateOrders( 1 );
-    is( scalar @orders, 0, 'There are no orders, so we found 0.' ) 
-      or diag( Data::Dumper->Dump( [ \@orders ], [ 'orders' ] ) );
-
-}
-
-=head3 one_order
-
-=cut
-
-sub one_order : Test( 29 ) {
-    my $self = shift;
-
-    my ( $basketid, $ordernumber ) = $self->create_new_basket();
-    ok( $basketid, 'a new basket was created' );
-    ok( $ordernumber, 'the basket has an order in it.' );
-    # we need this basket to be closed.
-    CloseBasket( $basketid );
-    
-    my @orders = GetLateOrders( 0 );
-
-    {
-        my @orders = GetLateOrders( 0 );
-        is( scalar @orders, 1, 'An order closed today is 0 days late.' ) 
-          or diag( Data::Dumper->Dump( [ \@orders ], [ 'orders' ] ) );
-    }
-    {
-        my @orders = GetLateOrders( 1 );
-        is( scalar @orders, 0, 'An order closed today is not 1 day late.' ) 
-          or diag( Data::Dumper->Dump( [ \@orders ], [ 'orders' ] ) );
-    }
-    {
-        my @orders = GetLateOrders( -1 );
-        is( scalar @orders, 1, 'an order closed today is -1 day late.' ) 
-          or diag( Data::Dumper->Dump( [ \@orders ], [ 'orders' ] ) );
-    }
-
-    # provide some vendor information
-    {
-        my @orders = GetLateOrders( 0, $self->{'booksellerid'} );
-        is( scalar @orders, 1, 'We found this late order with the right supplierid.' ) 
-          or diag( Data::Dumper->Dump( [ \@orders ], [ 'orders' ] ) );
-    }
-    {
-        my @orders = GetLateOrders( 0, $self->{'booksellerid'} + 1 );
-        is( scalar @orders, 0, 'We found no late orders with the wrong supplierid.' ) 
-          or diag( Data::Dumper->Dump( [ \@orders ], [ 'orders' ] ) );
-    }
-
-    # provide some branch information
-    my $member = GetMember( borrowernumber=>$self->{'memberid'} );
-    # diag( Data::Dumper->Dump( [ $member ], [ 'member' ] ) );
-    {
-        my @orders = GetLateOrders( 0, $self->{'booksellerid'}, $member->{'branchcode'} );
-        is( scalar @orders, 1, 'We found this late order with the right branchcode.' ) 
-          or diag( Data::Dumper->Dump( [ \@orders ], [ 'orders' ] ) );
-    }
-    {
-        my @orders = GetLateOrders( 0, $self->{'booksellerid'}, 'This is not the branch' );
-        is( scalar @orders, 0, 'We found no late orders with the wrong branchcode.' ) 
-          or diag( Data::Dumper->Dump( [ \@orders ], [ 'orders' ] ) );
-    }
-
-    # set up some things necessary to make GetLateOrders use the IndependantBranches
-    $self->enable_independant_branches();    
-
-    {
-        my @orders = GetLateOrders( 0, $self->{'booksellerid'}, $member->{'branchcode'} );
-        is( scalar @orders, 1, 'We found this late order with the right branchcode.' ) 
-          or diag( Data::Dumper->Dump( [ \@orders ], [ 'orders' ] ) );
-    }
-    {
-        my @orders = GetLateOrders( 0, $self->{'booksellerid'}, 'This is not the branch' );
-        is( scalar @orders, 0, 'We found no late orders with the wrong branchcode.' ) 
-          or diag( Data::Dumper->Dump( [ \@orders ], [ 'orders' ] ) );
-    }
-
-    # reset that.
-    $self->disable_independant_branches();    
-
-}
-
-
-
-
-
-1;
diff --git a/t/lib/KohaTest/Acquisition/GetParcel.pm b/t/lib/KohaTest/Acquisition/GetParcel.pm
deleted file mode 100644 (file)
index c26e5f2..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-package KohaTest::Acquisition::GetParcel;
-use base qw( KohaTest::Acquisition );
-
-use strict;
-use warnings;
-
-use Test::More;
-use Time::localtime;
-
-use C4::Acquisition;
-
-=head3 no_parcel
-
-at first, there should be no parcels for our bookseller.
-
-=cut
-
-sub no_parcel : Test( 1 ) {
-    my $self = shift;
-
-    my @parcel = GetParcel( $self->{'booksellerid'}, undef, undef );
-    is( scalar @parcel, 0, 'our new bookseller has no parcels' )
-      or diag( Data::Dumper->Dump( [ \@parcel ], [ 'parcel' ] ) );
-}
-
-=head3 one_parcel
-
-we create an order, mark it as received, and then see if we can find
-it with GetParcel.
-
-=cut
-
-sub one_parcel : Test( 17 ) {
-    my $self = shift;
-
-    my $invoice = 123;    # XXX what should this be?
-
-    my $today = sprintf( '%04d-%02d-%02d',
-                         localtime->year() + 1900,
-                         localtime->mon() + 1,
-                         localtime->mday() );
-    my ( $basketno, $ordernumber ) = $self->create_new_basket();
-    
-    ok( $basketno, "my basket number is $basketno" );
-    ok( $ordernumber,   "my order number is $ordernumber" );
-    my $datereceived = ModReceiveOrder( $self->{'biblios'}[0],             # biblionumber
-                                        $ordernumber,       # $ordernumber,
-                                        undef,         # $quantrec,
-                                        undef,         # $user,
-                                        undef,         # $cost,
-                                        $invoice,         # $invoiceno,
-                                        undef,         # $freight,
-                                        undef,         # $rrp,
-                                        $self->{'bookfundid'},         # $bookfund,
-                                        $today,         # $datereceived
-                                   );
-    is( $datereceived, $today, "the parcel was received on $datereceived" );
-
-    my @parcel = GetParcel( $self->{'booksellerid'}, $invoice, $today );
-    is( scalar @parcel, 1, 'we found one (1) parcel.' )
-      or diag( Data::Dumper->Dump( [ \@parcel ], [ 'parcel' ] ) );
-
-}
-
-1;
diff --git a/t/lib/KohaTest/Acquisition/GetParcels.pm b/t/lib/KohaTest/Acquisition/GetParcels.pm
deleted file mode 100644 (file)
index fd3ad0f..0000000
+++ /dev/null
@@ -1,289 +0,0 @@
-package KohaTest::Acquisition::GetParcels;
-use base qw( KohaTest::Acquisition );
-
-use strict;
-use warnings;
-
-use Test::More;
-use Time::localtime;
-
-use C4::Acquisition;
-
-=head2 NOTE
-
-Please do not confuse this with the test suite for C4::Acquisition::GetParcel.
-
-=head3 no_parcels
-
-at first, there should be no parcels for our bookseller.
-
-=cut
-
-sub no_parcels : Test( 1 ) {
-    my $self = shift;
-
-    my @parcels = GetParcels( $self->{'booksellerid'},  # bookseller
-                             # order
-                             # code ( aqorders.booksellerinvoicenumber )
-                             # datefrom
-                             # date to
-                        );
-                            
-    is( scalar @parcels, 0, 'our new bookseller has no parcels' )
-      or diag( Data::Dumper->Dump( [ \@parcels ], [ 'parcels' ] ) );
-}
-
-=head3 one_parcel
-
-we create an order, mark it as received, and then see if we can find
-it with GetParcels.
-
-=cut
-
-sub one_parcel : Test( 19 ) {
-    my $self = shift;
-
-    my $invoice = 123;    # XXX what should this be?
-    my $today = sprintf( '%04d-%02d-%02d',
-                         localtime->year() + 1900,
-                         localtime->mon() + 1,
-                         localtime->mday() );
-
-    $self->create_order( authorizedby => 1,   # XXX what should this be?
-                         invoice      => $invoice,
-                         date         => $today );
-    
-    my @parcels = GetParcels( $self->{'booksellerid'},  # bookseller
-                             # order
-                             # code ( aqorders.booksellerinvoicenumber )
-                             # datefrom
-                             # date to
-                        );
-    is( scalar @parcels, 1, 'we found one (1) parcel.' )
-      or diag( Data::Dumper->Dump( [ \@parcels ], [ 'parcels' ] ) );
-
-    my $thisparcel = shift( @parcels );
-    is( scalar ( keys( %$thisparcel ) ), 6, 'my parcel hashref has 6 keys' )
-      or diag( Data::Dumper->Dump( [ $thisparcel ], [ 'thisparcel' ] ) );
-      
-    is( $thisparcel->{'datereceived'},             $today,   'datereceived' );
-    is( $thisparcel->{'biblio'},                   1,        'biblio' );
-    is( $thisparcel->{'booksellerinvoicenumber'}, $invoice, 'booksellerinvoicenumber' );
-
-    # diag( Data::Dumper->Dump( [ $thisparcel ], [ 'thisparcel' ] ) );
-
-}
-
-=head3 two_parcels
-
-we create another order, mark it as received, and then see if we can find
-them all with GetParcels.
-
-=cut
-
-sub two_parcels : Test( 31 ) {
-    my $self = shift;
-
-    my $invoice = 1234;    # XXX what should this be?
-    my $today = sprintf( '%04d-%02d-%02d',
-                         localtime->year() + 1900,
-                         localtime->mon() + 1,
-                         localtime->mday() );
-    $self->create_order( authorizedby => 1,   # XXX what should this be?
-                         invoice      => $invoice,
-                         date         => $today );
-
-    {
-        # fetch them all and check that this one is last
-        my @parcels = GetParcels( $self->{'booksellerid'},  # bookseller
-                                  # order
-                                  # code ( aqorders.booksellerinvoicenumber )
-                                  # datefrom
-                                  # date to
-                             );
-        is( scalar @parcels, 2, 'we found two (2) parcels.' )
-          or diag( Data::Dumper->Dump( [ \@parcels ], [ 'parcels' ] ) );
-        
-        my $thisparcel = pop( @parcels );
-        is( scalar ( keys( %$thisparcel ) ), 6, 'my parcel hashref has 6 keys' )
-          or diag( Data::Dumper->Dump( [ $thisparcel ], [ 'thisparcel' ] ) );
-        
-        is( $thisparcel->{'datereceived'},             $today,   'datereceived' );
-        is( $thisparcel->{'biblio'},                   1,        'biblio' );
-        is( $thisparcel->{'booksellerinvoicenumber'}, $invoice, 'booksellerinvoicenumber' );
-    }
-
-    {
-        # fetch just one, by using the exact code
-        my @parcels = GetParcels( $self->{'booksellerid'},  # bookseller
-                                  undef,    # order
-                                  $invoice, # code ( aqorders.booksellerinvoicenumber )
-                                  undef,    # datefrom
-                                  undef,    # date to
-                             );
-        is( scalar @parcels, 1, 'we found one (1) parcels.' )
-          or diag( Data::Dumper->Dump( [ \@parcels ], [ 'parcels' ] ) );
-        
-        my $thisparcel = pop( @parcels );
-        is( scalar ( keys( %$thisparcel ) ), 6, 'my parcel hashref has 6 keys' )
-          or diag( Data::Dumper->Dump( [ $thisparcel ], [ 'thisparcel' ] ) );
-        
-        is( $thisparcel->{'datereceived'},             $today,   'datereceived' );
-        is( $thisparcel->{'biblio'},                   1,        'biblio' );
-        is( $thisparcel->{'booksellerinvoicenumber'}, $invoice, 'booksellerinvoicenumber' );
-    }
-    
-    {
-        # fetch them both by using code 123, which gets 123 and 1234
-        my @parcels = GetParcels( $self->{'booksellerid'},  # bookseller
-                                  undef,    # order
-                                  '123', # code ( aqorders.booksellerinvoicenumber )
-                                  undef,    # datefrom
-                                  undef,    # date to
-                             );
-        is( scalar @parcels, 2, 'we found 2 parcels.' )
-          or diag( Data::Dumper->Dump( [ \@parcels ], [ 'parcels' ] ) );
-        
-    }
-    
-    {
-        # fetch them both, and try to order them
-        my @parcels = GetParcels( $self->{'booksellerid'},  # bookseller
-                                  'aqorders.booksellerinvoicenumber',    # order
-                                  undef, # code ( aqorders.booksellerinvoicenumber )
-                                  undef,    # datefrom
-                                  undef,    # date to
-                             );
-        is( scalar @parcels, 2, 'we found 2 parcels.' )
-          or diag( Data::Dumper->Dump( [ \@parcels ], [ 'parcels' ] ) );
-        is( $parcels[0]->{'booksellerinvoicenumber'}, 123 );
-        is( $parcels[1]->{'booksellerinvoicenumber'}, 1234 );
-        
-    }
-    
-    {
-        # fetch them both, and try to order them, descending
-        my @parcels = GetParcels( $self->{'booksellerid'},  # bookseller
-                                  'aqorders.booksellerinvoicenumber desc',    # order
-                                  undef, # code ( aqorders.booksellerinvoicenumber )
-                                  undef,    # datefrom
-                                  undef,    # date to
-                             );
-        is( scalar @parcels, 2, 'we found 2 parcels.' )
-          or diag( Data::Dumper->Dump( [ \@parcels ], [ 'parcels' ] ) );
-        is( $parcels[0]->{'booksellerinvoicenumber'}, 1234 );
-        is( $parcels[1]->{'booksellerinvoicenumber'}, 123 );
-        
-    }
-    
-    
-    
-
-    # diag( Data::Dumper->Dump( [ $thisparcel ], [ 'thisparcel' ] ) );
-
-}
-
-
-=head3 z_several_parcels_with_different_dates
-
-we create an order, mark it as received, and then see if we can find
-it with GetParcels.
-
-=cut
-
-sub z_several_parcels_with_different_dates : Test( 44 ) {
-    my $self = shift;
-
-    my $authorizedby = 1; # XXX what should this be?
-
-    my @inputs = ( { invoice => 10,
-                      date     => sprintf( '%04d-%02d-%02d',
-                                           1950,
-                                           localtime->mon() + 1,
-                                           10 ), # I'm using the invoice number as the day.
-                 },
-                    { invoice => 15,
-                      date     => sprintf( '%04d-%02d-%02d',
-                                           1950,
-                                           localtime->mon() + 1,
-                                           15 ), # I'm using the invoice number as the day.
-                 },
-                    { invoice => 20,
-                      date     => sprintf( '%04d-%02d-%02d',
-                                           1950,
-                                           localtime->mon() + 1,
-                                           20 ), # I'm using the invoice number as the day.
-                 },
-               );
-
-    foreach my $input ( @inputs ) {
-        $self->create_order( authorizedby => $authorizedby,
-                             invoice      => $input->{'invoice'},
-                             date         => $input->{'date'},
-                        );
-    }
-                         
-    my @parcels = GetParcels( $self->{'booksellerid'},  # bookseller
-                              undef, # order
-                              undef, # code ( aqorders.booksellerinvoicenumber )
-                              sprintf( '%04d-%02d-%02d',
-                                       1950,
-                                       localtime->mon() + 1,
-                                       10 ), # datefrom
-                              sprintf( '%04d-%02d-%02d',
-                                       1950,
-                                       localtime->mon() + 1,
-                                       20 ), # dateto
-                        );
-    is( scalar @parcels, scalar @inputs, 'we found all of the parcels.' )
-      or diag( Data::Dumper->Dump( [ \@parcels ], [ 'parcels' ] ) );
-
-    @parcels = GetParcels( $self->{'booksellerid'},  # bookseller
-                           undef, # order
-                           undef, # code ( aqorders.booksellerinvoicenumber )
-                           sprintf( '%04d-%02d-%02d',
-                                    1950,
-                                    localtime->mon() + 1,
-                                    10 ), # datefrom
-                           sprintf( '%04d-%02d-%02d',
-                                    1950,
-                                    localtime->mon() + 1,
-                                    16 ), # dateto
-                        );
-    is( scalar @parcels, scalar @inputs - 1, 'we found all of the parcels except one' )
-      or diag( Data::Dumper->Dump( [ \@parcels ], [ 'parcels' ] ) );
-
-
-
-    # diag( Data::Dumper->Dump( [ $thisparcel ], [ 'thisparcel' ] ) );
-
-}
-
-sub create_order {
-    my $self = shift;
-    my %param = @_;
-    $param{'authorizedby'} = 1 unless exists $param{'authorizedby'};
-    $param{'invoice'}      = 1 unless exists $param{'invoice'};
-    $param{'date'} = sprintf( '%04d-%02d-%02d',
-                              localtime->year() + 1900,
-                              localtime->mon() + 1,
-                              localtime->mday() ) unless exists $param{'date'};
-
-    my ( $basketno, $ordernumber ) = $self->create_new_basket( %param );
-
-    my $datereceived = ModReceiveOrder( $self->{'biblios'}[0],             # biblionumber
-                                        $ordernumber,       # $ordernumber,
-                                        undef,         # $quantrec,
-                                        undef,         # $user,
-                                        undef,         # $cost,
-                                        $param{'invoice'},         # $invoiceno,
-                                        undef,         # $freight,
-                                        undef,         # $rrp,
-                                        $self->{'bookfundid'},         # $bookfund,
-                                        $param{'date'},         # $datereceived
-                                   );
-    is( $datereceived, $param{'date'}, "the parcel was received on $datereceived" );
-
-}
-
-1;
diff --git a/t/lib/KohaTest/Acquisition/GetPendingOrders.pm b/t/lib/KohaTest/Acquisition/GetPendingOrders.pm
deleted file mode 100644 (file)
index cf4bb15..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-package KohaTest::Acquisition::GetPendingOrders;
-use base qw( KohaTest::Acquisition );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Acquisition;
-
-=head3 no_orders
-
-at first, there should be no orders for our bookseller.
-
-=cut
-
-sub no_orders : Test( 1 ) {
-    my $self = shift;
-
-    my $orders = GetPendingOrders( $self->{'booksellerid'} );
-    is( scalar @$orders, 0, 'our new bookseller has no pending orders' )
-      or diag( Data::Dumper->Dump( [ $orders ], [ 'orders' ] ) );
-}
-
-=head3 new_order
-
-we make an order, then see if it shows up in the pending orders
-
-=cut
-
-sub one_new_order : Test( 49 ) {
-    my $self = shift;
-
-    my ( $basketno, $ordernumber ) = $self->create_new_basket();
-
-    ok( $basketno, "basketno is $basketno" );
-    ok( $ordernumber, "ordernumber is $ordernumber" );
-    
-    my $orders = GetPendingOrders( $self->{'booksellerid'} );
-    is( scalar @$orders, 1, 'we successfully entered one order.' );
-
-    my @expectedfields = qw( basketno
-                             biblioitemnumber
-                             biblionumber
-                             booksellerinvoicenumber
-                             budgetdate
-                             cancelledby
-                             closedate
-                             creationdate
-                             currency
-                             datecancellationprinted
-                             datereceived
-                             ecost
-                             entrydate
-                             firstname
-                             freight
-                             gst
-                             listprice
-                             notes
-                             ordernumber
-                             purchaseordernumber
-                             quantity
-                             quantityreceived
-                             rrp
-                             serialid
-                             sort1
-                             sort2
-                             subscription
-                             supplierreference
-                             surname
-                             timestamp
-                             title
-                             totalamount
-                             unitprice );
-    my $firstorder = $orders->[0];
-    for my $field ( @expectedfields ) {
-        ok( exists( $firstorder->{ $field } ), "This order has a $field field" );
-    }
-    
-}
-
-1;
diff --git a/t/lib/KohaTest/Acquisition/NewOrder.pm b/t/lib/KohaTest/Acquisition/NewOrder.pm
deleted file mode 100644 (file)
index 972cde2..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-package KohaTest::Acquisition::NewOrder;
-use base qw( KohaTest::Acquisition );
-
-use strict;
-use warnings;
-
-use Test::More;
-use Time::localtime;
-
-use C4::Acquisition;
-
-=head3 new_order_no_budget
-
-If we make a new order and don't pass in a budget date, it defaults to
-today.
-
-=cut
-
-sub new_order_no_budget : Test( 4 ) {
-    my $self = shift;
-
-    my $authorizedby = 1; # XXX what should this be?
-    my $invoice = 123;    # XXX what should this be?
-    my $today = sprintf( '%04d-%02d-%02d',
-                         localtime->year() + 1900,
-                         localtime->mon() + 1,
-                         localtime->mday() );
-    my ( $basketno, $ordernumber ) = NewOrder( undef, # $basketno,
-                                          1, # $bibnum,
-                                          undef, # $title,
-                                          undef, # $quantity,
-                                          undef, # $listprice,
-                                          $self->{'booksellerid'}, # $booksellerid,
-                                          $authorizedby, # $authorisedby,
-                                          undef, # $notes,
-                                          $self->{'bookfundid'},     # $bookfund,
-                                          undef, # $bibitemnum,
-                                          undef, # $rrp,
-                                          undef, # $ecost,
-                                          undef, # $gst,
-                                          undef, # $budget,
-                                          undef, # $cost,
-                                          undef, # $sub,
-                                          $invoice, # $invoice,
-                                          undef, # $sort1,
-                                          undef, # $sort2,
-                                          undef, # $purchaseorder,
-                                                                                 undef, # $branchcode
-                                     );
-    ok( $basketno, "my basket number is $basketno" );
-    ok( $ordernumber,   "my order number is $ordernumber" );
-
-    my $order = GetOrder( $ordernumber );
-    is( $order->{'ordernumber'}, $ordernumber, 'got the right order' )
-      or diag( Data::Dumper->Dump( [ $order ], [ 'order' ] ) );
-    
-    is( $order->{'budgetdate'}, $today, "the budget date is $today" );
-}
-
-=head3 new_order_set_budget
-
-Let's set the budget date of this new order. It actually pretty much
-only pays attention to the current month and year.
-
-=cut
-
-sub new_order_set_budget : Test( 4 ) {
-    my $self = shift;
-
-    my $authorizedby = 1; # XXX what should this be?
-    my $invoice = 123;    # XXX what should this be?
-    my $today = sprintf( '%04d-%02d-%02d',
-                         localtime->year() + 1900,
-                         localtime->mon() + 1,
-                         localtime->mday() );
-    my ( $basketno, $ordernumber ) = NewOrder( undef, # $basketno,
-                                          1, # $bibnum,
-                                          undef, # $title,
-                                          undef, # $quantity,
-                                          undef, # $listprice,
-                                          $self->{'booksellerid'}, # $booksellerid,
-                                          $authorizedby, # $authorisedby,
-                                          undef, # $notes,
-                                          $self->{'bookfundid'},     # $bookfund,
-                                          undef, # $bibitemnum,
-                                          undef, # $rrp,
-                                          undef, # $ecost,
-                                          undef, # $gst,
-                                          'does not matter, just not undef', # $budget,
-                                          undef, # $cost,
-                                          undef, # $sub,
-                                          $invoice, # $invoice,
-                                          undef, # $sort1,
-                                          undef, # $sort2,
-                                          undef, # $purchaseorder,
-                                                                                 undef, # $branchcode
-                                     );
-    ok( $basketno, "my basket number is $basketno" );
-    ok( $ordernumber,   "my order number is $ordernumber" );
-
-    my $order = GetOrder( $ordernumber );
-    is( $order->{'ordernumber'}, $ordernumber, 'got the right order' )
-      or diag( Data::Dumper->Dump( [ $order ], [ 'order' ] ) );
-    
-    like( $order->{'budgetdate'}, qr(^2\d\d\d-07-01$), "the budget date ($order->{'budgetdate'}) is a July 1st." );
-}
-
-1;
diff --git a/t/lib/KohaTest/AuthoritiesMarc.pm b/t/lib/KohaTest/AuthoritiesMarc.pm
deleted file mode 100644 (file)
index 6114843..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-package KohaTest::AuthoritiesMarc;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::AuthoritiesMarc;
-sub testing_class { 'C4::AuthoritiesMarc' };
-
-
-sub methods : Test( 1 ) {
-    my $self = shift;
-    my @methods = qw( GetAuthMARCFromKohaField 
-                      SearchAuthorities 
-                      CountUsage 
-                      CountUsageChildren 
-                      GetAuthTypeCode 
-                      GetTagsLabels 
-                      AddAuthority 
-                      DelAuthority 
-                      ModAuthority 
-                      GetAuthorityXML 
-                      GetAuthority 
-                      GetAuthType 
-                      AUTHhtml2marc 
-                      FindDuplicateAuthority 
-                      BuildSummary
-                      BuildUnimarcHierarchies
-                      BuildUnimarcHierarchy
-                      GetHeaderAuthority
-                      AddAuthorityTrees
-                      merge 
-                      get_auth_type_location 
-                );
-    
-    can_ok( $self->testing_class, @methods );    
-}
-
-1;
diff --git a/t/lib/KohaTest/Biblio.pm b/t/lib/KohaTest/Biblio.pm
deleted file mode 100644 (file)
index 3e6634c..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-package KohaTest::Biblio;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Biblio;
-sub testing_class { 'C4::Biblio' };
-
-
-sub methods : Test( 1 ) {
-    my $self = shift;
-    my @methods = qw(
-                       AddBiblio
-                       ModBiblio
-                       ModBiblioframework
-                       DelBiblio
-                       LinkBibHeadingsToAuthorities
-                       GetBiblioData
-                       GetBiblioItemData
-                       GetBiblioItemByBiblioNumber
-                       GetBiblioFromItemNumber
-                       GetBiblio
-                       GetBiblioItemInfosOf
-                       GetMarcStructure
-                       GetUsedMarcStructure
-                       GetMarcFromKohaField
-                       GetMarcBiblio
-                       GetXmlBiblio
-                       GetAuthorisedValueDesc
-                       GetMarcNotes
-                       GetMarcSubjects
-                       GetMarcAuthors
-                       GetMarcUrls
-                       GetMarcSeries
-                       GetFrameworkCode
-                       GetPublisherNameFromIsbn
-                       TransformKohaToMarc
-                       TransformKohaToMarcOneField
-                       TransformHtmlToXml
-                       TransformHtmlToMarc
-                       TransformMarcToKoha
-                       _get_inverted_marc_field_map
-                       _disambiguate
-                       get_koha_field_from_marc
-                       TransformMarcToKohaOneField
-                       PrepareItemrecordDisplay
-                       ModZebra
-                       GetNoZebraIndexes
-                       _DelBiblioNoZebra
-                       _AddBiblioNoZebra
-                       _find_value
-                       _koha_marc_update_bib_ids
-                       _koha_marc_update_biblioitem_cn_sort
-                       _koha_add_biblio
-                       _koha_modify_biblio
-                       _koha_modify_biblioitem_nonmarc
-                       _koha_add_biblioitem
-                       _koha_delete_biblio
-                       _koha_delete_biblioitems
-                       ModBiblioMarc
-                       z3950_extended_services
-                       set_service_options
-                       get_biblio_authorised_values
-                );
-    
-    can_ok( $self->testing_class, @methods );    
-}
-
-1;
-
diff --git a/t/lib/KohaTest/Biblio/GetNoZebraIndexes.pm b/t/lib/KohaTest/Biblio/GetNoZebraIndexes.pm
deleted file mode 100644 (file)
index 11dffbe..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-package KohaTest::Biblio::GetNoZebraIndexes;
-use base qw( KohaTest::Biblio );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Biblio;
-
-=head2 STARTUP METHODS
-
-These get run once, before the main test methods in this module
-
-=cut
-
-
-=head2 TEST METHODS
-
-standard test methods
-
-=head3 
-
-=cut
-    
-sub returns_expected_hashref : Test(2) {
-    my $self = shift;
-
-    my %nzi = C4::Biblio::GetNoZebraIndexes();
-    ok( scalar keys %nzi, 'got some keys from GetNoZebraIndexes' );
-
-    my %expected = (
-        'title'        => '130a,210a,222a,240a,243a,245a,245b,246a,246b,247a,247b,250a,250b,440a,830a',
-        'author'       => '100a,100b,100c,100d,110a,111a,111b,111c,111d,245c,700a,710a,711a,800a,810a,811a',
-        'isbn'         => '020a',
-        'issn'         => '022a',
-        'lccn'         => '010a',
-        'biblionumber' => '999c',
-        'itemtype'     => '942c',
-        'publisher'    => '260b',
-        'date'         => '260c',
-        'note'         => '500a,501a,504a,505a,508a,511a,518a,520a,521a,522a,524a,526a,530a,533a,538a,541a,546a,555a,556a,562a,563a,583a,585a,582a',
-        'subject'      => '600*,610*,611*,630*,650*,651*,653*,654*,655*,662*,690*',
-        'dewey'        => '082',
-        'bc'           => '952p',
-        'callnum'      => '952o',
-        'an'           => '6009,6109,6119',
-        'homebranch'   => '952a,952c'
-    );
-    is_deeply( \%nzi, \%expected, 'GetNoZebraIndexes returns the expected hashref' );
-}
-
-=head2 HELPER METHODS
-
-These methods are used by other test methods, but
-are not meant to be called directly.
-
-=cut
-
-=cut
-
-
-=head2 SHUTDOWN METHODS
-
-These get run once, after the main test methods in this module
-
-=head3 
-
-=cut
-
-
-1;
diff --git a/t/lib/KohaTest/Biblio/ModBiblio.pm b/t/lib/KohaTest/Biblio/ModBiblio.pm
deleted file mode 100644 (file)
index 5b29ea8..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-package KohaTest::Biblio::ModBiblio;
-use base qw( KohaTest::Biblio );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Biblio;
-use C4::Items;
-
-=head2 STARTUP METHODS
-
-These get run once, before the main test methods in this module
-
-=head3 add_bib_to_modify
-
-=cut
-
-sub add_bib_to_modify : Test( startup => 3 ) {
-    my $self = shift;
-
-    my $bib = MARC::Record->new();
-    $bib->leader('     ngm a22     7a 4500');   
-    $bib->append_fields(
-        MARC::Field->new('100', ' ', ' ', a => 'Moffat, Steven'),
-        MARC::Field->new('245', ' ', ' ', a => 'Silence in the library'),
-    );
-    
-    my ($bibnum, $bibitemnum) = AddBiblio($bib, '');
-    $self->{'bib_to_modify'} = $bibnum;
-
-    # add an item
-    my ($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => 'CPL', holdingbranch => 'CPL' } , $bibnum);
-
-    cmp_ok($item_bibnum, '==', $bibnum, "new item is linked to correct biblionumber"); 
-    cmp_ok($item_bibitemnum, '==', $bibitemnum, "new item is linked to correct biblioitemnumber"); 
-
-    $self->reindex_marc(); 
-
-    my $marc = $self->fetch_bib($bibnum);
-    $self->sort_item_and_bibnumber_fields($marc);
-    $self->{'bib_to_modify_formatted'} = $marc->as_formatted(); # simple way to compare later
-}
-
-=head2 TEST METHODS
-
-standard test methods
-
-=head3 bug_2297
-
-Regression test for bug 2297 (saving a subscription duplicates MARC  item fields)
-
-=cut
-
-sub bug_2297 : Test( 5 ) {
-    my $self = shift;
-
-    my $bibnum = $self->{'bib_to_modify'};
-    my $marc = $self->fetch_bib($bibnum);
-    $self->check_item_count($marc, 1);
-
-    ModBiblio($marc, $bibnum, ''); # no change made to bib
-
-    my $modified_marc = $self->fetch_bib($bibnum);
-    diag "checking item field count after null modification";
-    $self->check_item_count($modified_marc, 1);
-
-    $self->sort_item_and_bibnumber_fields($modified_marc);
-    is($modified_marc->as_formatted(), $self->{'bib_to_modify_formatted'}, "no change to bib after null modification");
-}
-
-=head2 HELPER METHODS
-
-These methods are used by other test methods, but
-are not meant to be called directly.
-
-=cut
-
-=head3 fetch_bib
-
-=cut
-
-sub fetch_bib { # +1 to test count per call
-    my $self = shift;
-    my $bibnum = shift;
-
-    my $marc = GetMarcBiblio($bibnum);
-    ok(defined($marc), "retrieved bib record $bibnum");
-
-    return $marc;
-}
-
-=head3 check_item_count
-
-=cut
-
-sub check_item_count { # +1 to test count per call
-    my $self = shift;
-    my $marc = shift;
-    my $expected_items = shift;
-
-    my ($itemtag, $itemsubfield) = GetMarcFromKohaField("items.itemnumber", '');
-    my @item_fields = $marc->field($itemtag);
-    cmp_ok(scalar(@item_fields), "==", $expected_items, "exactly one item field");
-}
-
-=head3 sort_item_and_bibnumber_fields
-
-This method sorts the field containing the embedded item data
-and the bibnumber - ModBiblio(), AddBiblio(), and ModItem() do
-not guarantee that these fields will be sorted in tag order.
-
-=cut
-
-sub sort_item_and_bibnumber_fields {
-    my $self = shift;
-    my $marc = shift;
-
-    my ($itemtag, $itemsubfield)     = GetMarcFromKohaField("items.itemnumber", '');
-    my ($bibnumtag, $bibnumsubfield) = GetMarcFromKohaField("biblio.biblionumber", '');
-
-    my @item_fields = ();
-    foreach my $field ($marc->field($itemtag)) {
-        push @item_fields, $field;
-        $marc->delete_field($field);
-    }
-    $marc->insert_fields_ordered(@item_fields) if scalar(@item_fields);;
-   
-    my @bibnum_fields = (); 
-    foreach my $field ($marc->field($bibnumtag)) {
-        push @bibnum_fields, $field;
-        $marc->delete_field($field);
-    }
-    $marc->insert_fields_ordered(@bibnum_fields) if scalar(@bibnum_fields);
-
-}
-
-=head2 SHUTDOWN METHODS
-
-These get run once, after the main test methods in this module
-
-=head3 shutdown_clean_object
-
-=cut
-
-sub shutdown_clean_object : Test( shutdown => 0 ) {
-    my $self = shift;
-
-    delete $self->{'bib_to_modify'};
-    delete $self->{'bib_to_modify_formatted'};
-}
-
-1;
diff --git a/t/lib/KohaTest/Biblio/get_biblio_authorised_values.pm b/t/lib/KohaTest/Biblio/get_biblio_authorised_values.pm
deleted file mode 100644 (file)
index aab03a0..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-package KohaTest::Biblio::get_biblio_authorised_values;
-use base qw( KohaTest::Biblio );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Biblio;
-
-=head2 STARTUP METHODS
-
-These get run once, before the main test methods in this module
-
-=head3 insert_test_data
-
-=cut
-
-sub insert_test_data : Test( startup => 71 ) {
-    my $self = shift;
-    
-    # I'm going to add a bunch of biblios so that I can search for them.
-    $self->add_biblios( count     => 10,
-                        add_items => 1 );
-    
-
-}
-
-=head2 TEST METHODS
-
-standard test methods
-
-=head3 basic_test
-
-basic usage.
-
-=cut
-
-sub basic_test : Test( 1 ) {
-    my $self = shift;
-
-    ok( $self->{'biblios'}[0], 'we have a biblionumber' );
-    my $authorised_values = C4::Biblio::get_biblio_authorised_values( $self->{'biblios'}[0] );
-    diag( Data::Dumper->Dump( [ $authorised_values ], [ 'authorised_values' ] ) );
-    
-}
-
-1;
diff --git a/t/lib/KohaTest/Branch.pm b/t/lib/KohaTest/Branch.pm
deleted file mode 100644 (file)
index ce7ff60..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-package KohaTest::Branch;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Branch;
-sub testing_class { 'C4::Branch' };
-
-
-sub methods : Test( 1 ) {
-    my $self = shift;
-    my @methods = qw( GetBranches
-                      GetBranchName
-                      ModBranch
-                      GetBranchCategory
-                      GetBranchCategories
-                      GetCategoryTypes
-                      GetBranch
-                      GetBranchDetail
-                      get_branchinfos_of
-                      GetBranchesInCategory
-                      GetBranchInfo
-                      DelBranch
-                      ModBranchCategoryInfo
-                      DelBranchCategory
-                      CheckBranchCategorycode
-                );
-    
-    can_ok( $self->testing_class, @methods );    
-}
-
-1;
-
diff --git a/t/lib/KohaTest/Branch/GetBranches.pm b/t/lib/KohaTest/Branch/GetBranches.pm
deleted file mode 100644 (file)
index 1dc5d0f..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-package KohaTest::Branch::GetBranches;
-use base qw( KohaTest::Branch );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Branch;
-
-=head2 STARTUP METHODS
-
-These get run once, before the main test methods in this module
-
-=cut
-
-=head2 TEST METHODS
-
-standard test methods
-
-=head3 onlymine
-
-    When you pass in something true to GetBranches, it limits the
-    response to only your branch.
-
-=cut
-
-sub onlymine : Test( 4 ) {
-    my $self = shift;
-
-    # C4::Branch::GetBranches uses this variable, so make sure it exists.
-    ok( C4::Context->userenv->{'branch'}, 'we have a branch' );
-    my $branches = C4::Branch::GetBranches( 'onlymine' );
-    # diag( Data::Dumper->Dump( [ $branches ], [ 'branches' ] ) );
-    is( scalar( keys %$branches ), 1, 'one key for our branch only' );
-    ok( exists $branches->{ C4::Context->userenv->{'branch'} }, 'my branch was returned' );
-    is( $branches->{ C4::Context->userenv->{'branch'} }->{'branchcode'}, C4::Context->userenv->{'branch'}, 'branchcode' );
-    
-}
-
-1;
diff --git a/t/lib/KohaTest/Breeding.pm b/t/lib/KohaTest/Breeding.pm
deleted file mode 100644 (file)
index d098ae5..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-package KohaTest::Breeding;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Breeding;
-sub testing_class { 'C4::Breeding' };
-
-
-sub methods : Test( 1 ) {
-    my $self = shift;
-    my @methods = qw( ImportBreeding 
-                      BreedingSearch 
-                );
-    
-    can_ok( $self->testing_class, @methods );    
-}
-
-1;
-
diff --git a/t/lib/KohaTest/Calendar.pm b/t/lib/KohaTest/Calendar.pm
deleted file mode 100644 (file)
index 8b1cda7..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-package KohaTest::Calendar;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Calendar;
-sub testing_class { 'C4::Calendar' };
-
-
-sub methods : Test( 1 ) {
-    my $self = shift;
-    my @methods = qw( new
-                      get_week_days_holidays
-                      get_day_month_holidays
-                      get_exception_holidays
-                      get_single_holidays
-                      insert_week_day_holiday
-                      insert_day_month_holiday
-                      insert_single_holiday
-                      insert_exception_holiday
-                      delete_holiday
-                      isHoliday
-                      addDate
-                      daysBetween
-                );
-    
-    can_ok( $self->testing_class, @methods );    
-}
-
-1;
-
diff --git a/t/lib/KohaTest/Calendar/New.pm b/t/lib/KohaTest/Calendar/New.pm
deleted file mode 100644 (file)
index 745366b..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-package KohaTest::Calendar::New;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Calendar;
-sub testing_class { 'C4::Calendar' };
-
-
-=head2 STARTUP METHODS
-
-These get run once, before the main test methods in this module
-
-=cut
-
-=head2 TEST METHODS
-
-standard test methods
-
-=head3 instantiation
-
-  just test to see if I can instantiate an object
-
-=cut
-
-sub instantiation : Test( 14 ) {
-    my $self = shift;
-
-    my $calendar = C4::Calendar->new( branchcode => '' );
-    isa_ok( $calendar, 'C4::Calendar' );
-    # diag( Data::Dumper->Dump( [ $calendar ], [ 'calendar' ] ) );
-
-    ok( exists $calendar->{'day_month_holidays'}, 'day_month_holidays' );
-    ok( exists $calendar->{'single_holidays'},    'single_holidays' );
-    ok( exists $calendar->{'week_days_holidays'}, 'week_days_holidays' );
-    ok( exists $calendar->{'exception_holidays'}, 'exception_holidays' );
-
-    # sample data has Sundays as a holiday
-    ok( exists $calendar->{'week_days_holidays'}->{'0'} );
-    is( $calendar->{'week_days_holidays'}->{'0'}->{'title'},       '',        'Sunday title' );
-    is( $calendar->{'week_days_holidays'}->{'0'}->{'description'}, 'Sundays', 'Sunday description' );
-    
-    # sample data has Christmas as a holiday
-    ok( exists $calendar->{'day_month_holidays'}->{'12/25'} );
-    is( $calendar->{'day_month_holidays'}->{'12/25'}->{'title'},       '',          'Christmas title' );
-    is( $calendar->{'day_month_holidays'}->{'12/25'}->{'description'}, 'Christmas', 'Christmas description' );
-    
-    # sample data has New Year's Day as a holiday
-    ok( exists $calendar->{'day_month_holidays'}->{'1/1'} );
-    is( $calendar->{'day_month_holidays'}->{'1/1'}->{'title'},       '',                'New Year title' );
-    is( $calendar->{'day_month_holidays'}->{'1/1'}->{'description'}, q(New Year's Day), 'New Year description' );
-    
-}
-
-sub week_day_holidays : Test( 8 ) {
-    my $self = shift;
-
-    my $calendar = C4::Calendar->new( branchcode => '' );
-    isa_ok( $calendar, 'C4::Calendar' );
-    # diag( Data::Dumper->Dump( [ $calendar ], [ 'calendar' ] ) );
-
-    ok( exists $calendar->{'week_days_holidays'}, 'week_days_holidays' );
-
-    my %new_holiday = ( weekday     => 1,
-                        title       => 'example week_day_holiday',
-                        description => 'This is an example week_day_holiday used for testing' );
-    my $new_calendar = $calendar->insert_week_day_holiday( %new_holiday );
-
-    # the calendar object returned from insert_week_day_holiday should be updated
-    isa_ok( $new_calendar, 'C4::Calendar' );
-    is( $new_calendar->{'week_days_holidays'}->{ $new_holiday{'weekday'} }->{'title'}, $new_holiday{'title'}, 'title' );
-    is( $new_calendar->{'week_days_holidays'}->{ $new_holiday{'weekday'} }->{'description'}, $new_holiday{'description'}, 'description' );
-
-    # new calendar objects should have the newly inserted holiday.
-    my $refreshed_calendar = C4::Calendar->new( branchcode => '' );
-    isa_ok( $refreshed_calendar, 'C4::Calendar' );
-    # diag( Data::Dumper->Dump( [ $calendar ], [ 'calendar' ] ) );
-    is( $new_calendar->{'week_days_holidays'}->{ $new_holiday{'weekday'} }->{'title'}, $new_holiday{'title'}, 'title' );
-    is( $new_calendar->{'week_days_holidays'}->{ $new_holiday{'weekday'} }->{'description'}, $new_holiday{'description'}, 'description' );
-
-}
-  
-
-sub day_month_holidays : Test( 8 ) {
-    my $self = shift;
-
-    my $calendar = C4::Calendar->new( branchcode => '' );
-    isa_ok( $calendar, 'C4::Calendar' );
-    # diag( Data::Dumper->Dump( [ $calendar ], [ 'calendar' ] ) );
-
-    ok( exists $calendar->{'day_month_holidays'}, 'day_month_holidays' );
-
-    my %new_holiday = ( day        => 4,
-                        month       => 5,
-                        title       => 'example day_month_holiday',
-                        description => 'This is an example day_month_holiday used for testing' );
-    my $new_calendar = $calendar->insert_day_month_holiday( %new_holiday );
-
-    # the calendar object returned from insert_week_day_holiday should be updated
-    isa_ok( $new_calendar, 'C4::Calendar' );
-    my $mmdd = sprintf('%s/%s', $new_holiday{'month'}, $new_holiday{'day'} ) ;
-    is( $new_calendar->{'day_month_holidays'}->{ $mmdd }->{'title'}, $new_holiday{'title'}, 'title' );
-    is( $new_calendar->{'day_month_holidays'}->{ $mmdd }->{'description'}, $new_holiday{'description'}, 'description' );
-
-    # new calendar objects should have the newly inserted holiday.
-    my $refreshed_calendar = C4::Calendar->new( branchcode => '' );
-    isa_ok( $refreshed_calendar, 'C4::Calendar' );
-    # diag( Data::Dumper->Dump( [ $calendar ], [ 'calendar' ] ) );
-    is( $new_calendar->{'day_month_holidays'}->{ $mmdd }->{'title'}, $new_holiday{'title'}, 'title' );
-    is( $new_calendar->{'day_month_holidays'}->{ $mmdd }->{'description'}, $new_holiday{'description'}, 'description' );
-
-}
-  
-
-
-sub exception_holidays : Test( 8 ) {
-    my $self = shift;
-
-    my $calendar = C4::Calendar->new( branchcode => '' );
-    isa_ok( $calendar, 'C4::Calendar' );
-    # diag( Data::Dumper->Dump( [ $calendar ], [ 'calendar' ] ) );
-
-    ok( exists $calendar->{'exception_holidays'}, 'exception_holidays' );
-
-    my %new_holiday = ( day        => 4,
-                        month       => 5,
-                        year        => 2010,
-                        title       => 'example exception_holiday',
-                        description => 'This is an example exception_holiday used for testing' );
-    my $new_calendar = $calendar->insert_exception_holiday( %new_holiday );
-    # diag( Data::Dumper->Dump( [ $new_calendar ], [ 'newcalendar' ] ) );
-
-    # the calendar object returned from insert_week_day_holiday should be updated
-    isa_ok( $new_calendar, 'C4::Calendar' );
-    my $yyyymmdd = sprintf('%s/%s/%s', $new_holiday{'year'}, $new_holiday{'month'}, $new_holiday{'day'} ) ;
-    is( $new_calendar->{'exception_holidays'}->{ $yyyymmdd }->{'title'}, $new_holiday{'title'}, 'title' );
-    is( $new_calendar->{'exception_holidays'}->{ $yyyymmdd }->{'description'}, $new_holiday{'description'}, 'description' );
-
-    # new calendar objects should have the newly inserted holiday.
-    my $refreshed_calendar = C4::Calendar->new( branchcode => '' );
-    isa_ok( $refreshed_calendar, 'C4::Calendar' );
-    # diag( Data::Dumper->Dump( [ $calendar ], [ 'calendar' ] ) );
-    is( $new_calendar->{'exception_holidays'}->{ $yyyymmdd }->{'title'}, $new_holiday{'title'}, 'title' );
-    is( $new_calendar->{'exception_holidays'}->{ $yyyymmdd }->{'description'}, $new_holiday{'description'}, 'description' );
-
-}
-
-
-sub single_holidays : Test( 8 ) {
-    my $self = shift;
-
-    my $calendar = C4::Calendar->new( branchcode => '' );
-    isa_ok( $calendar, 'C4::Calendar' );
-    # diag( Data::Dumper->Dump( [ $calendar ], [ 'calendar' ] ) );
-
-    ok( exists $calendar->{'single_holidays'}, 'single_holidays' );
-
-    my %new_holiday = ( day        => 4,
-                        month       => 5,
-                        year        => 2011,
-                        title       => 'example single_holiday',
-                        description => 'This is an example single_holiday used for testing' );
-    my $new_calendar = $calendar->insert_single_holiday( %new_holiday );
-    # diag( Data::Dumper->Dump( [ $new_calendar ], [ 'newcalendar' ] ) );
-
-    # the calendar object returned from insert_week_day_holiday should be updated
-    isa_ok( $new_calendar, 'C4::Calendar' );
-    my $yyyymmdd = sprintf('%s/%s/%s', $new_holiday{'year'}, $new_holiday{'month'}, $new_holiday{'day'} ) ;
-    is( $new_calendar->{'single_holidays'}->{ $yyyymmdd }->{'title'}, $new_holiday{'title'}, 'title' );
-    is( $new_calendar->{'single_holidays'}->{ $yyyymmdd }->{'description'}, $new_holiday{'description'}, 'description' );
-
-    # new calendar objects should have the newly inserted holiday.
-    my $refreshed_calendar = C4::Calendar->new( branchcode => '' );
-    isa_ok( $refreshed_calendar, 'C4::Calendar' );
-    # diag( Data::Dumper->Dump( [ $calendar ], [ 'calendar' ] ) );
-    is( $new_calendar->{'single_holidays'}->{ $yyyymmdd }->{'title'}, $new_holiday{'title'}, 'title' );
-    is( $new_calendar->{'single_holidays'}->{ $yyyymmdd }->{'description'}, $new_holiday{'description'}, 'description' );
-
-}
-  
-
-1;
-
diff --git a/t/lib/KohaTest/Category.pm b/t/lib/KohaTest/Category.pm
deleted file mode 100644 (file)
index 3febfda..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-package KohaTest::Category;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Category;
-sub testing_class { 'C4::Category' };
-
-
-sub methods : Test( 1 ) {
-    my $self = shift;
-    my @methods = qw( 
-                    new
-                    all
-                );
-    
-    can_ok( $self->testing_class, @methods );    
-}
-
-1;
diff --git a/t/lib/KohaTest/Circulation.pm b/t/lib/KohaTest/Circulation.pm
deleted file mode 100644 (file)
index 7d5e69d..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-package KohaTest::Circulation;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Circulation;
-sub testing_class { 'C4::Circulation' };
-
-
-sub methods : Test( 1 ) {
-    my $self = shift;
-    my @methods = qw( barcodedecode 
-                      decode 
-                      transferbook 
-                      TooMany 
-                      itemissues 
-                      CanBookBeIssued 
-                      AddIssue 
-                      GetLoanLength 
-                      GetIssuingRule 
-                      GetBranchBorrowerCircRule
-                      AddReturn 
-                      MarkIssueReturned 
-                      _FixOverduesOnReturn
-                      _FixAccountForLostAndReturned
-                      GetItemIssue 
-                      GetItemIssues 
-                      GetBiblioIssues 
-                      GetUpcomingDueIssues
-                      CanBookBeRenewed 
-                      AddRenewal 
-                      GetRenewCount 
-                      GetIssuingCharges 
-                      AddIssuingCharge 
-                      GetTransfers 
-                      GetTransfersFromTo 
-                      DeleteTransfer 
-                      AnonymiseIssueHistory 
-                      updateWrongTransfer 
-                      UpdateHoldingbranch 
-                      CalcDateDue  
-                      CheckValidDatedue 
-                      CheckRepeatableHolidays
-                      CheckSpecialHolidays
-                      CheckRepeatableSpecialHolidays
-                      CheckValidBarcode
-                );
-    
-    can_ok( $self->testing_class, @methods );    
-}
-
-=head3 setup_add_biblios
-
-everything in the C4::Circulation really requires items, so let's do this in the setup phase.
-
-=cut
-
-sub setup_add_biblios : Tests( setup => 8 ) {
-    my $self = shift;
-
-    # we want to use a fresh batch of items, so clear these lists:
-    delete $self->{'items'};
-    delete $self->{'biblios'};
-
-    $self->add_biblios( add_items => 1 );
-}
-
-
-=head3 checkout_first_item
-
-named parameters:
-  borrower  => borrower hashref, computed from $self->{'memberid'} if not given
-  barcode   => item barcode, barcode of $self->{'items'}[0] if not given
-  issuedate => YYYY-MM-DD of date to mark issue checked out. defaults to today.
-
-=cut
-
-sub checkout_first_item {
-    my $self   = shift;
-    my $params = shift;
-
-    # get passed in borrower, or default to the one in $self.
-    my $borrower = $params->{'borrower'};
-    if ( ! defined $borrower ) {
-        my $borrowernumber = $self->{'memberid'};
-        $borrower = C4::Members::GetMemberDetails( $borrowernumber );
-    }
-
-    # get the barcode passed in, or default to the first one in the items list
-    my $barcode = $params->{'barcode'};
-    if ( ! defined $barcode ) {
-        return unless $self->{'items'}[0]{'itemnumber'};
-        $barcode = $self->get_barcode_from_itemnumber( $self->{'items'}[0]{'itemnumber'} );
-    }
-
-    # get issuedate from parameters. Default to undef, which will be interpreted as today
-    my $issuedate = $params->{'issuedate'};
-
-    my ( $issuingimpossible, $needsconfirmation ) = C4::Circulation::CanBookBeIssued( $borrower, $barcode );
-
-    my $datedue = C4::Circulation::AddIssue(
-        $borrower,    # borrower
-        $barcode,     # barcode
-        undef,        # datedue
-        undef,        # cancelreserve
-        $issuedate    # issuedate
-    );
-
-    my $issues = C4::Circulation::GetItemIssue( $self->{'items'}[0]{'itemnumber'} );
-
-    return $issues->{'date_due'};
-}
-
-=head3 get_barcode_from_itemnumber
-
-pass in an itemnumber, returns a barcode.
-
-Should this get moved up to KohaTest.pm? Or, is there a better alternative in C4?
-
-=cut
-
-sub get_barcode_from_itemnumber {
-    my $self       = shift;
-    my $itemnumber = shift;
-
-    my $sql = <<END_SQL;
-SELECT barcode
-  FROM items
-  WHERE itemnumber = ?
-END_SQL
-    my $dbh = C4::Context->dbh()  or return;
-    my $sth = $dbh->prepare($sql) or return;
-    $sth->execute($itemnumber) or return;
-    my ($barcode) = $sth->fetchrow_array;
-    return $barcode;
-}
-
-1;
-
diff --git a/t/lib/KohaTest/Circulation/AddIssue.pm b/t/lib/KohaTest/Circulation/AddIssue.pm
deleted file mode 100644 (file)
index 2c3e393..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-package KohaTest::Circulation::AddIssue;
-use base qw(KohaTest::Circulation);
-
-use strict;
-use warnings;
-
-use Test::More;
-
-=head2 basic_usage
-
-basic usage of C4::Circulation::AddIssue
-
-Note: This logic is repeated in
-KohaTest::Circulation::checkout_first_item, but without tests. This
-includes tests at each step to make it easier to track down what's
-broken as we go along.
-
-=cut
-
-sub basic_usage : Test( 13 ) {
-    my $self = shift;
-
-    my $borrowernumber = $self->{'memberid'};
-    ok( $borrowernumber, "we're going to work with borrower: $borrowernumber" );
-
-    my $borrower = C4::Members::GetMemberDetails( $borrowernumber );
-    ok( $borrower, '...and we were able to look up that borrower' );
-    is( $borrower->{'borrowernumber'}, $borrowernumber, '...and they have the right borrowernumber' );
-
-    my $itemnumber = $self->{'items'}[0]{'itemnumber'};
-    ok( $itemnumber, "We're going to checkout itemnumber $itemnumber" );
-    my $barcode = $self->get_barcode_from_itemnumber($itemnumber);
-    ok( $barcode, "...which has barcode $barcode" );
-
-    my $before_issues = C4::Circulation::GetItemIssue( $self->{'items'}[0]{'itemnumber'} );
-    # Note that we can't check for $before_issues as undef because GetItemIssue always returns a populated hashref
-    ok( ! defined $before_issues->{'borrowernumber'}, '...and is not currently checked out' )
-      or diag( Data::Dumper->Dump( [ $before_issues ], [ 'before_issues' ] ) );
-
-    my ( $issuingimpossible, $needsconfirmation ) = C4::Circulation::CanBookBeIssued( $borrower, $barcode );
-    is( scalar keys %$issuingimpossible, 0, 'the item CanBookBeIssued' )
-      or diag( Data::Dumper->Dump( [ $issuingimpossible, $needsconfirmation ], [ qw( issuingimpossible needsconfirmation ) ] ) );
-    is( scalar keys %$needsconfirmation, 0, '...and the transaction does not needsconfirmation' )
-      or diag( Data::Dumper->Dump( [ $issuingimpossible, $needsconfirmation ], [ qw( issuingimpossible needsconfirmation ) ] ) );
-
-    # bug 2758 don't ask for confirmation if patron has $0.00 account balance
-    # and IssuingInProcess is on
-    my $orig_issuing_in_process = C4::Context->preference('IssuingInProcess');
-    my $dbh = C4::Context->dbh;
-    $dbh->do("UPDATE systempreferences SET value = 1 WHERE variable = 'IssuingInProcess'");
-    C4::Context->clear_syspref_cache(); # FIXME not needed after a syspref mutator is written
-    ( $issuingimpossible, $needsconfirmation ) = C4::Circulation::CanBookBeIssued( $borrower, $barcode );
-    is( scalar keys %$issuingimpossible, 0, 'the item CanBookBeIssued with IssuingInProcess ON (bug 2758)' )
-      or diag( Data::Dumper->Dump( [ $issuingimpossible, $needsconfirmation ], [ qw( issuingimpossible needsconfirmation ) ] ) );
-    is( scalar keys %$needsconfirmation, 0, 
-        '...and the transaction does not needsconfirmation with IssuingInProcess ON (bug 2758)' )
-      or diag( Data::Dumper->Dump( [ $issuingimpossible, $needsconfirmation ], [ qw( issuingimpossible needsconfirmation ) ] ) );
-    $dbh->do("UPDATE systempreferences SET value = ? WHERE variable = 'IssuingInProcess'", {}, $orig_issuing_in_process);
-    C4::Context->clear_syspref_cache(); # FIXME not needed after a syspref mutator is written
-
-    my $datedue = C4::Circulation::AddIssue( $borrower, $barcode );
-    ok( $datedue, "the item has been issued and it is due: $datedue" );
-    
-    my $after_issues = C4::Circulation::GetItemIssue( $self->{'items'}[0]{'itemnumber'} );
-    is( $after_issues->{'borrowernumber'}, $borrowernumber, '...and now it is checked out to our borrower' )
-      or diag( Data::Dumper->Dump( [ $after_issues ], [ 'after_issues' ] ) );
-
-    my $loanlength = Date::Calc::Delta_Days( split( /-/, $after_issues->{'issuedate'} ), split( /-/, $after_issues->{'date_due'} ) );
-    ok( $loanlength, "the loanlength is $loanlength days" );
-
-    # save this here since we refer to it in set_issuedate.
-    $self->{'loanlength'} = $loanlength;
-
-}
-
-=head2 set_issuedate
-
-Make sure that we can set the issuedate of an issue.
-
-Also, since we are specifying an issuedate and not a due date, the due
-date should be calculated from the issuedate, not today.
-
-=cut
-
-sub set_issuedate : Test( 7 ) {
-    my $self = shift;
-
-    my $before_issues = C4::Circulation::GetItemIssue( $self->{'items'}[0]{'itemnumber'} );
-    ok( ! defined $before_issues->{'borrowernumber'}, 'At this beginning, this item was not checked out.' )
-      or diag( Data::Dumper->Dump( [ $before_issues ], [ 'before_issues' ] ) );
-
-    my $issuedate = $self->random_date();
-    ok( $issuedate, "Check out an item on $issuedate" );
-    my $datedue = $self->checkout_first_item( { issuedate => $issuedate } );
-    ok( $datedue, "...and it's due on $datedue" );
-
-    my $after_issues = C4::Circulation::GetItemIssue( $self->{'items'}[0]{'itemnumber'} );
-    is( $after_issues->{'borrowernumber'}, $self->{'memberid'}, 'We found this item checked out to our member.' )
-      or diag( Data::Dumper->Dump( [ $after_issues ], [ 'issues' ] ) );
-    is( $after_issues->{'issuedate'}, $issuedate, "...and it was issued on $issuedate" )
-      or diag( Data::Dumper->Dump( [ $after_issues ], [ 'after_issues' ] ) );
-    
-    my $loanlength = Date::Calc::Delta_Days( split( /-/, $after_issues->{'issuedate'} ), split( /-/, $after_issues->{'date_due'} ) );
-    ok( $loanlength, "the loanlength is $loanlength days" );
-    is( $loanlength, $self->{'loanlength'} );
-}
-
-sub set_lastreneweddate_on_renewal : Test( 6 ) {
-    my $self = shift;
-
-    my $before_issues = C4::Circulation::GetItemIssue( $self->{'items'}[0]{'itemnumber'} );
-    ok( ! defined $before_issues->{'borrowernumber'}, 'At this beginning, this item was not checked out.' )
-      or diag( Data::Dumper->Dump( [ $before_issues ], [ 'before_issues' ] ) );
-
-    my $datedue = $self->checkout_first_item( { issuedate => $self->yesterday() } );
-    ok( $datedue, "The item is checked out and it's due on $datedue" );
-
-    my $issuedate = $self->random_date();
-    ok( $issuedate, "Check out an item again on $issuedate" );
-    # This will actually be a renewal
-    $datedue = $self->checkout_first_item( { issuedate => $issuedate } );
-    ok( $datedue, "...and it's due on $datedue" );
-
-    my $after_issues = C4::Circulation::GetItemIssue( $self->{'items'}[0]{'itemnumber'} );
-    is( $after_issues->{'borrowernumber'}, $self->{'memberid'}, 'We found this item checked out to our member.' )
-      or diag( Data::Dumper->Dump( [ $after_issues ], [ 'issues' ] ) );
-    is( $after_issues->{'lastreneweddate'}, $issuedate, "...and it was renewed on $issuedate" )
-      or diag( Data::Dumper->Dump( [ $after_issues ], [ 'after_issues' ] ) );
-    
-}
-
-1;
diff --git a/t/lib/KohaTest/Circulation/GetUpcomingDueIssues.pm b/t/lib/KohaTest/Circulation/GetUpcomingDueIssues.pm
deleted file mode 100644 (file)
index 95dd1af..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-package KohaTest::Circulation::GetUpcomingDueIssues;
-use base qw(KohaTest::Circulation);
-
-use strict;
-use warnings;
-
-use Test::More;
-
-=head2 basic_usage
-
-basic usage of C4::Circulation::GetUpcomingDueIssues()
-
-=cut
-
-sub basic_usage : Test(2) {
-    my $self = shift;
-
-    my $upcoming = C4::Circulation::GetUpcomingDueIssues();
-    isa_ok( $upcoming, 'ARRAY' );
-
-    is( scalar @$upcoming, 0, 'no issues yet' )
-      or diag( Data::Dumper->Dump( [$upcoming], ['upcoming'] ) );
-}
-
-
-1;
diff --git a/t/lib/KohaTest/Circulation/MarkIssueReturned.pm b/t/lib/KohaTest/Circulation/MarkIssueReturned.pm
deleted file mode 100644 (file)
index 5722bcf..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-package KohaTest::Circulation::MarkIssueReturned;
-use base qw(KohaTest::Circulation);
-
-use strict;
-use warnings;
-
-use Test::More;
-
-=head2 basic_usage
-
-basic usage of C4::Circulation::MarkIssueReturned
-
-=cut
-
-sub basic_usage : Test( 4 ) {
-    my $self = shift;
-
-    my $before_issues = C4::Circulation::GetItemIssue( $self->{'items'}[0]{'itemnumber'} );
-    ok( ! defined $before_issues->{'borrowernumber'}, 'our item is not checked out' )
-      or diag( Data::Dumper->Dump( [ $before_issues ], [ 'before_issues' ] ) );
-
-    my $datedue = $self->checkout_first_item();
-    ok( $datedue, "Now it is checked out and due on $datedue" );
-
-    my $after_issues = C4::Circulation::GetItemIssue( $self->{'items'}[0]{'itemnumber'} );
-    is( $after_issues->{'borrowernumber'}, $self->{'memberid'}, 'Our item is checked out to our borrower' )
-      or diag( Data::Dumper->Dump( [ $after_issues ], [ 'after_issues' ] ) );
-
-    C4::Circulation::MarkIssueReturned( $self->{'memberid'}, $self->{'items'}[0]{'itemnumber'} );
-
-    my $after_return = C4::Circulation::GetItemIssue( $self->{'items'}[0]{'itemnumber'} );
-    ok( ! defined $after_return->{'borrowernumber'}, 'The item is no longer checked out' )
-      or diag( Data::Dumper->Dump( [ $after_return ], [ 'after_return' ] ) );
-
-}
-
-=head2 set_returndate
-
-check an item out, then, check it back in, specifying the returndate.
-
-verify that it's checked back in and the returndate is correct.
-
-=cut
-
-sub set_retundate : Test( 7 ) {
-    my $self = shift;
-
-    # It's not checked out to start with
-    my $before_issues = C4::Circulation::GetItemIssue( $self->{'items'}[0]{'itemnumber'} );
-    ok( ! defined $before_issues->{'borrowernumber'}, 'our item is not checked out' )
-      or diag( Data::Dumper->Dump( [ $before_issues ], [ 'before_issues' ] ) );
-
-    # check it out
-    my $datedue = $self->checkout_first_item();
-    ok( $datedue, "Now it is checked out and due on $datedue" );
-
-    # verify that it has been checked out
-    my $after_issues = C4::Circulation::GetItemIssue( $self->{'items'}[0]{'itemnumber'} );
-    is( $after_issues->{'borrowernumber'}, $self->{'memberid'}, 'Our item is checked out to our borrower' )
-      or diag( Data::Dumper->Dump( [ $after_issues ], [ 'after_issues' ] ) );
-
-    # mark it as returned on some date
-    my $returndate = $self->random_date();
-    ok( $returndate, "return this item on $returndate" );
-
-    C4::Circulation::MarkIssueReturned( $self->{'memberid'},
-                                        $self->{'items'}[0]{'itemnumber'},
-                                        undef,
-                                        $returndate );
-
-    # validate that it is no longer checked out.
-    my $after_return = C4::Circulation::GetItemIssue( $self->{'items'}[0]{'itemnumber'} );
-    ok( ! defined $after_return->{'borrowernumber'}, 'The item is no longer checked out' )
-      or diag( Data::Dumper->Dump( [ $after_return ], [ 'after_return' ] ) );
-
-    # grab the history for this item and make sure it looks right
-    my $history = C4::Circulation::GetItemIssues( $self->{'items'}[0]{'itemnumber'}, 1 );
-    is( scalar @$history, 1, 'this item has been checked out one time.' )
-      or diag( Data::Dumper->Dump( [ $history ], [ 'history' ] ) );
-    is( $history->[0]{'returndate'}, $returndate, "...and it was returned on $returndate" );
-    
-}
-
-
-1;
diff --git a/t/lib/KohaTest/Context.pm b/t/lib/KohaTest/Context.pm
deleted file mode 100644 (file)
index bba7f88..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-package KohaTest::Context;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Context;
-sub testing_class { 'C4::Context' };
-
-
-sub methods : Test( 1 ) {
-    my $self = shift;
-    my @methods = qw(
-                        AUTOLOAD
-                        boolean_preference
-                        config
-                        dbh
-                        db_scheme2dbi
-                        get_shelves_userenv
-                        get_versions
-                        import
-                        KOHAVERSION
-                        marcfromkohafield
-                        ModZebrations
-                        new
-                        new_dbh
-                        preference
-                        read_config_file
-                        restore_context
-                        restore_dbh
-                        set_context
-                        set_dbh
-                        set_shelves_userenv
-                        set_userenv
-                        stopwords
-                        userenv
-                        Zconn
-                        zebraconfig
-                        _common_config
-                        _new_dbh
-                        _new_marcfromkohafield
-                        _new_stopwords
-                        _new_userenv
-                        _new_Zconn
-                        _unset_userenv
-                );
-    
-    can_ok( $self->testing_class, @methods );    
-}
-
-1;
-
diff --git a/t/lib/KohaTest/Context/preference.pm b/t/lib/KohaTest/Context/preference.pm
deleted file mode 100644 (file)
index 2ad73d1..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-package KohaTest::Context::preference;
-use base qw( KohaTest::Context );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Context;
-sub testing_class { 'C4::Context' };
-
-
-=head2 STARTUP METHODS
-
-These get run once, before the main test methods in this module
-
-=cut
-
-=head2 TEST METHODS
-
-standard test methods
-
-=head3 preference_does_not_exist
-
-=cut
-
-sub preference_does_not_exist : Test( 1 ) {
-    my $self = shift;
-
-    my $missing = C4::Context->preference( 'doesnotexist' );
-
-    is( $missing, undef, 'a query for a missing syspref returns undef' )
-      or diag( Data::Dumper->Dump( [ $missing ], [ 'missing' ] ) );
-    
-}
-
-
-=head3 version_preference
-
-=cut
-
-sub version_preference : Test( 1 ) {
-    my $self = shift;
-
-    my $version = C4::Context->preference( 'version' );
-
-    ok( $version, 'C4::Context->preference returns a good version number' )
-      or diag( Data::Dumper->Dump( [ $version ], [ 'version' ] ) );
-    
-}
-
-
-
-1;
diff --git a/t/lib/KohaTest/Dates.pm b/t/lib/KohaTest/Dates.pm
deleted file mode 100644 (file)
index 19a309d..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-package KohaTest::Dates;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Dates;
-sub testing_class { 'C4::Dates' };
-
-
-sub methods : Test( 1 ) {
-    my $self = shift;
-    my @methods = qw( _prefformat
-                      regexp
-                      dmy_map
-                      _check_date_and_time
-                      _chron_to_ymd
-                      _chron_to_hms
-                      new
-                      init
-                      output
-                      today
-                      _recognize_format
-                      DHTMLcalendar
-                      format
-                      visual
-                      format_date
-                      format_date_in_iso
-                );
-    
-    can_ok( $self->testing_class, @methods );    
-}
-
-1;
-
diff --git a/t/lib/KohaTest/Dates/Usage.pm b/t/lib/KohaTest/Dates/Usage.pm
deleted file mode 100644 (file)
index 8815c89..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-package KohaTest::Dates::Usage;
-use base qw( KohaTest::Dates );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Dates qw(format_date format_date_in_iso);
-
-
-sub startup_init_constants : Tests(startup => 0) {
-    my $self = shift;
-    $self->{thash} = {
-        iso    => [ '2001-01-01',         '1989-09-21',         '1952-01-00' ],
-        metric => [ "01-01-2001",         '21-09-1989',         '00-01-1952' ],
-        us     => [ "01-01-2001",         '09-21-1989',         '01-00-1952' ],
-        sql    => [ '20010101    010101', '19890921    143907', '19520100    000000' ],
-    };
-    $self->{formats} = [ sort keys %{ $self->{thash} } ];
-}
-
-sub check_formats : Test( 8 ) {
-    my $self = shift;
-
-    my $syspref = C4::Dates->new->format();
-    ok( $syspref, "Your system preference is: $syspref" );
-
-    foreach ( @{ $self->{thash}->{'iso'} } ) {
-        ok( format_date($_), "able to format_date() on $_" );
-    }
-
-    foreach ( @{ $self->{thash}->{$syspref} } ) {
-        ok( format_date_in_iso($_), "able to format_date_in_iso() on $_" );
-    }
-    ok( C4::Dates->today(), "(default) CLASS ->today : " . C4::Dates->today() );
-}
-
-sub defaults : Test( 24 ) {
-    my $self = shift;
-
-    foreach (@{ $self->{formats} }) {
-        my $pre = sprintf '(%-6s)', $_;
-        my $date = C4::Dates->new();
-        ok( $date, "$pre Date Creation   : new()" );
-        isa_ok( $date, 'C4::Dates' );
-        ok( $_ eq $date->format($_),   "$pre format($_)      : " );
-        ok( $date->visual(), "$pre visual()" );
-        ok( $date->output(), "$pre output()" );
-        ok( $date->today(),  "$pre object->today" );
-
-    }
-}
-
-sub valid_inputs : Test( 108 ) {
-    my $self = shift;
-
-    foreach my $format (@{ $self->{formats} }) {
-        my $pre = sprintf '(%-6s)', $format;
-        foreach my $testval ( @{ $self->{thash}->{$format} } ) {
-            my ( $val, $today );
-            my $date = C4::Dates->new( $testval, $format );
-            ok( $date, "$pre Date Creation   : new('$testval','$format')" );
-            isa_ok( $date, 'C4::Dates' );
-            ok( $date->regexp, "$pre has regexp()" );
-            ok( $val = $date->output(), describe( "$pre output()", $val ) );
-            foreach ( grep { !/$format/ } @{ $self->{formats} } ) {
-                ok( $today = $date->output($_), describe( sprintf( "$pre output(%8s)", "'$_'" ), $today ) );
-            }
-            ok( $today = $date->today(), describe( "$pre object->today", $today ) );
-            ok( $val = $date->output(), describe( "$pre output()", $val ) );
-        }
-    }
-}
-
-sub independence_from_class : Test( 1 ) {
-    my $self = shift;
-
-    my $in1  = '12/25/1952';                       # us
-    my $in2  = '13/01/2001';                       # metric
-    my $d1   = C4::Dates->new( $in1, 'us' );
-    my $d2   = C4::Dates->new( $in2, 'metric' );
-    my $out1 = $d1->output('iso');
-    my $out2 = $d2->output('iso');
-    ok( $out1 ne $out2, "subsequent constructors get different dataspace ($out1 != $out2)" );
-
-}
-
-
-
-sub describe {
-    my $front = sprintf( "%-25s", shift );
-    my $tail = shift || 'FAILED';
-    return "$front : $tail";
-}
-
-sub shutdown_clear_constants : Tests( shutdown => 0 ) {
-    my $self = shift;
-    delete $self->{thash};
-    delete $self->{formats};
-}
-
-1;
diff --git a/t/lib/KohaTest/Heading.pm b/t/lib/KohaTest/Heading.pm
deleted file mode 100644 (file)
index 4f781a2..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-package KohaTest::Heading;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Heading;
-sub testing_class { 'C4::Heading' };
-
-
-sub methods : Test( 1 ) {
-    my $self = shift;
-    my @methods = qw( 
-                    new_from_bib_field
-                    display_form
-                    authorities
-                    preferred_authorities
-                    _query_limiters
-                    _marc_format_handler
-                );
-    
-    can_ok( $self->testing_class, @methods );    
-}
-
-1;
diff --git a/t/lib/KohaTest/Heading/MARC21.pm b/t/lib/KohaTest/Heading/MARC21.pm
deleted file mode 100644 (file)
index 41cd4d3..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-package KohaTest::Heading::MARC21;
-use base qw( KohaTest::Heading );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Heading;
-use C4::Heading::MARC21;
-
-use MARC::Field;
-
-sub testing_class { 'C4::Heading::MARC21' };
-
-sub methods : Test( 1 ) {
-    my $self = shift;
-    my @methods = qw( 
-                    new
-                    valid_bib_heading_tag
-                    parse_heading
-                    _get_subject_thesaurus
-                    _get_search_heading
-                    _get_display_heading
-                );
-    
-    can_ok( $self->testing_class, @methods );    
-}
-
-sub bug2315 : Test( 1 ) {
-
-    my $subject_heading = MARC::Field->new(650, ' ', '0', 
-                                                a   => "Dalziel, Andrew (Fictitious character",
-                                                ')' => "Fiction."
-                                           );
-    my $display_form = C4::Heading::MARC21::_get_display_heading($subject_heading, 'a');
-    is($display_form, "Dalziel, Andrew (Fictitious character", "bug 2315: no crash if heading subfield has metacharacter");
-
-}
-
-1;
diff --git a/t/lib/KohaTest/ImportBatch.pm b/t/lib/KohaTest/ImportBatch.pm
deleted file mode 100644 (file)
index a8fefaa..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-package KohaTest::ImportBatch;
-use base qw(KohaTest);
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::ImportBatch;
-use C4::Matcher;
-sub testing_class { 'C4::ImportBatch' };
-
-
-sub routines : Test( 1 ) {
-    my $self = shift;
-    my @routines = qw(
-                        GetZ3950BatchId
-                        GetImportRecordMarc
-                        AddImportBatch
-                        GetImportBatch
-                        AddBiblioToBatch
-                        ModBiblioInBatch
-                        BatchStageMarcRecords
-                        AddItemsToImportBiblio
-                        BatchFindBibDuplicates
-                        BatchCommitBibRecords
-                        BatchCommitItems
-                        BatchRevertBibRecords
-                        BatchRevertItems
-                        CleanBatch
-                        GetAllImportBatches
-                        GetImportBatchRangeDesc
-                        GetItemNumbersFromImportBatch
-                        GetNumberOfNonZ3950ImportBatches
-                        GetImportBibliosRange
-                        GetBestRecordMatch
-                        GetImportBatchStatus
-                        SetImportBatchStatus
-                        GetImportBatchOverlayAction
-                        SetImportBatchOverlayAction
-                        GetImportBatchNoMatchAction
-                        SetImportBatchNoMatchAction
-                        GetImportBatchItemAction
-                        SetImportBatchItemAction
-                        GetImportBatchItemAction
-                        SetImportBatchItemAction
-                        GetImportBatchMatcher
-                        SetImportBatchMatcher
-                        GetImportRecordOverlayStatus
-                        SetImportRecordOverlayStatus
-                        GetImportRecordStatus
-                        SetImportRecordStatus
-                        GetImportRecordMatches
-                        SetImportRecordMatches
-                        _create_import_record
-                        _update_import_record_marc
-                        _add_biblio_fields
-                        _update_biblio_fields
-                        _parse_biblio_fields
-                        _update_batch_record_counts
-                        _get_commit_action
-                        _get_revert_action
-                );
-    
-    can_ok($self->testing_class, @routines);
-}
-
-sub startup_50_add_matcher : Test( startup => 1 ) {
-    my $self = shift;
-    # create test MARC21 ISBN matcher
-    my $matcher = C4::Matcher->new('biblio');
-    $matcher->threshold(1000);
-    $matcher->code('TESTISBN');
-    $matcher->description('test MARC21 ISBN matcher');
-    $matcher->add_simple_matchpoint('isbn', 1000, '020', 'a', -1, 0, '');
-    my $matcher_id = $matcher->store();
-    like($matcher_id, qr/^\d+$/, "store new matcher and get back ID");
-
-    $self->{'matcher_id'} = $matcher_id;
-}
-
-sub shutdown_50_remove_matcher : Test( shutdown => 6) {
-    my $self = shift;
-    my @matchers = C4::Matcher::GetMatcherList();
-    cmp_ok(scalar(@matchers), ">=", 1, "at least one matcher present");
-    my $matcher_id;
-    my $testisbn_count = 0;
-    # look for TESTISBN
-    foreach my $matcher (@matchers) {
-        if ($matcher->{'code'} eq 'TESTISBN') {
-            $testisbn_count++;
-            $matcher_id = $matcher->{'matcher_id'};
-        }
-    }
-    ok($testisbn_count == 1, "only one TESTISBN matcher");
-    like($matcher_id, qr/^\d+$/, "matcher ID is valid");
-    my $matcher = C4::Matcher->fetch($matcher_id);
-    ok(defined($matcher), "got back a matcher");
-    ok($matcher_id == $matcher->{'id'}, "got back the correct matcher");
-    C4::Matcher->delete($matcher_id);
-    my $matcher2 = C4::Matcher->fetch($matcher_id);
-    ok(not(defined($matcher2)), "matcher removed");
-
-    delete $self->{'matcher_id'};
-}
-
-=head2 UTILITY METHODS
-
-=cut
-
-sub add_import_batch {
-    my $self       = shift;
-    my $test_batch = shift
-      || {
-        overlay_action => 'create_new',
-        import_status  => 'staging',
-        batch_type     => 'batch',
-        file_name      => 'foo',
-        comments       => 'inserted during automated testing',
-      };
-    my $batch_id = AddImportBatch( $test_batch->{'overlay_action'},
-                                   $test_batch->{'import_status'},
-                                   $test_batch->{'batch_type'},
-                                   $test_batch->{'file_name'},
-                                   $test_batch->{'comments'}, );
-    return $batch_id;
-}
-
-
-1;
diff --git a/t/lib/KohaTest/ImportBatch/AddImportBatch.pm b/t/lib/KohaTest/ImportBatch/AddImportBatch.pm
deleted file mode 100644 (file)
index 7b97e72..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-package KohaTest::ImportBatch::AddImportBatch;
-use base qw( KohaTest::ImportBatch );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::ImportBatch;
-use C4::Matcher;
-use C4::Biblio;
-
-
-=head3 add_one
-
-=cut
-
-sub add_one : Test( 1 ) {
-    my $self = shift;
-
-    my $batch_id = AddImportBatch(
-        'create_new',                           #overlay_action
-        'staging',                              # import_status
-        'batch',                                # batc_type
-        'foo',                                  # file_name
-        'inserted during automated testing',    # comments
-    );
-    ok( $batch_id, "successfully inserted batch: $batch_id" );
-}
-
-1;
diff --git a/t/lib/KohaTest/ImportBatch/AddItemsToImportBiblio.pm b/t/lib/KohaTest/ImportBatch/AddItemsToImportBiblio.pm
deleted file mode 100644 (file)
index 39d36df..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-package KohaTest::ImportBatch::getImportBatch;
-use base qw( KohaTest::ImportBatch );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::ImportBatch;
-use C4::Matcher;
-use C4::Biblio;
-
-
-sub something : Test( 2 ) {
-    my $self = shift;
-
-    my $batch_id = $self->add_import_batch();
-    ok( $batch_id, 'we have a batch_id' );
-
-    my $import_record_id = 0;
-
-    my $marc_record = MARC::Record->new();
-    
-    my @import_item_ids = C4::ImportBatch::AddItemsToImportBiblio( $batch_id, $import_record_id, $marc_record );
-    is( scalar( @import_item_ids ), 0, 'none inserted' );
-
-}
-
-1;
diff --git a/t/lib/KohaTest/ImportBatch/BatchStageCommitRevert.pm b/t/lib/KohaTest/ImportBatch/BatchStageCommitRevert.pm
deleted file mode 100644 (file)
index 94f8115..0000000
+++ /dev/null
@@ -1,252 +0,0 @@
-package KohaTest::ImportBatch::BatchStageCommitRevert;
-use base qw( KohaTest::ImportBatch );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::ImportBatch;
-use C4::Matcher;
-use C4::Biblio;
-
-# define test records for various batches
-sub startup_60_make_test_records : Test( startup ) {
-    my $self = shift;
-    $self->{'batches'} = {
-        'batch1' => { 
-                        marc => _make_marc_batch([
-                            ['isbn001', 'title 1', ['batch-item-1'] ],
-                            ['isbn002', 'title 2', [] ],
-                            ['isbn003', 'title 3', ['batch-item-2','batch-item-3'] ],
-                            ['isbn004', 'title 4', [ 'batch-item-4' ] ],
-                            ['isbn005', 'title 5', [ 'batch-item-5', 'batch-item-6', 'batch-item-7' ] ],
-                        ]),
-                        args => {
-                            parse_items => 1,
-                            overlay_action => 'create_new',
-                            nomatch_action => 'create_new',
-                            item_action => 'always_add',
-                        },
-                        results => {
-                            num_bibs  => 5,
-                            num_items => 7,
-                            num_invalid => 0,
-                            num_matches => 0,
-                            num_added => 5,
-                            num_updated => 0,
-                            num_items_added => 7,
-                            num_items_errored => 0,
-                            num_ignored => 0,
-                        },
-                    },
-        'batch2' => {
-                        marc => _make_marc_batch([
-                            ['isbn001', 'overlay title 1', ['batch-item-8'] ],
-                            ['isbn002', 'overlay title 2', ['batch-item-9'] ],
-                            ['isbn006', 'title 6', ['batch-item-10'] ],
-                        ]),
-                        args => {
-                            parse_items => 1,
-                            overlay_action => 'replace',
-                            nomatch_action => 'create_new',
-                            item_action => 'always_add',
-                        },
-                        results => {
-                            num_bibs  => 3,
-                            num_items => 3,
-                            num_invalid => 0,
-                            num_matches => 2,
-                            num_added => 1,
-                            num_updated => 2,
-                            num_items_added => 3,
-                            num_items_errored => 0,
-                            num_ignored => 0,
-                        },
-                    },
-        'batch3' => {
-                        marc => _make_marc_batch([ 
-                            ['isbn007', 'title 7', ['batch-item-11'] ],
-                            ['isbn006', 'overlay title 6', ['batch-item-12'] ],
-                        ]),
-                        args => {
-                            parse_items => 1,
-                            overlay_action => 'ignore',
-                            nomatch_action => 'ignore',
-                            item_action => 'always_add',
-                        },
-                        results => {
-                            num_bibs  => 2,
-                            num_items => 2,
-                            num_invalid => 0,
-                            num_matches => 1,
-                            num_added => 0,
-                            num_updated => 0,
-                            num_items_added => 1,
-                            num_items_errored => 0,
-                            num_ignored => 2,
-                        },
-                    },
-        'batch4' => {
-                        marc => _make_marc_batch([ 
-                            ['isbn008', 'title 8', ['batch-item-13'] ], # not loading this item
-                        ]),
-                        args => {
-                            parse_items => 0,
-                            overlay_action => undef,
-                            nomatch_action => 'create_new',
-                            item_action => 'ignore',
-                        },
-                        results => {
-                            num_bibs  => 1,
-                            num_items => 0,
-                            num_invalid => 0,
-                            num_matches => 0,
-                            num_added => 1,
-                            num_updated => 0,
-                            num_items_added => 0,
-                            num_items_errored => 0,
-                            num_ignored => 0,
-                        },
-                    },
-        'batch5' => {
-                        marc => _make_marc_batch([ 
-                            ['isbn009', 'title 9', ['batch-item-1'] ], # trigger dup barcode error
-                            'junkjunkjunkjunk', # trigger invalid bib
-                        ]),
-                        args => {
-                            parse_items => 1,
-                            overlay_action => undef,
-                            nomatch_action => undef,
-                            item_action => undef,
-                        },
-                        results => {
-                            num_bibs  => 1,
-                            num_items => 1,
-                            num_invalid => 1,
-                            num_matches => 0,
-                            num_added => 1,
-                            num_updated => 0,
-                            num_items_added => 0,
-                            num_items_errored => 1,
-                            num_ignored => 0,
-                        },
-                    },
-        'batch6' => {
-                        marc => _make_marc_batch([ 
-                            ['isbn001', 'match title 1', ['batch-item-14', 'batch-item-15'] ],
-                            ['isbn010', 'title 10', ['batch-item-16', 'batch-item-17'] ],
-                        ]),
-                        args => {
-                            parse_items => 1,
-                            overlay_action => 'ignore',
-                            nomatch_action => 'create_new',
-                            item_action => 'always_add',
-                        },
-                        results => {
-                            num_bibs  => 2,
-                            num_items => 4,
-                            num_invalid => 0,
-                            num_matches => 1,
-                            num_added => 1,
-                            num_updated => 0,
-                            num_items_added => 4,
-                            num_items_errored => 0,
-                            num_ignored => 1,
-                        },
-                    },
-    };
-    
-}
-
-sub _make_marc_batch {
-    my $defs = shift;
-    my @marc = ();
-    foreach my $rec (@$defs) {
-        if (ref($rec) eq 'ARRAY') {
-            my $isbn = $rec->[0];
-            my $title = $rec->[1];
-            my $items = $rec->[2];
-            my $bib = MARC::Record->new();
-            $bib->leader('     nam a22     7a 4500');
-            $bib->append_fields(MARC::Field->new('020', ' ', ' ', a => $isbn),
-                                MARC::Field->new('245', ' ', ' ', a => $title));
-            foreach my $barcode (@$items) {
-                my ($itemtag, $toss, $barcodesf, $branchsf);
-                ($itemtag, $toss)   = GetMarcFromKohaField('items.itemnumber', '');
-                ($toss, $barcodesf) = GetMarcFromKohaField('items.barcode', '');
-                ($toss, $branchsf)  = GetMarcFromKohaField('items.homebranch', '');
-                $bib->append_fields(MARC::Field->new($itemtag, ' ', ' ', $barcodesf => $barcode, $branchsf => 'CPL')); 
-                        # FIXME: define branch in KohaTest
-            }
-            push @marc, $bib->as_usmarc();
-        } else {
-            push @marc, $rec;
-        }
-    }
-    return join('', @marc);
-}
-
-sub stage_commit_batches : Test( 75 ) {
-    my $self = shift;
-
-    my $matcher = C4::Matcher->fetch($self->{'matcher_id'});
-    ok(ref($matcher) eq 'C4::Matcher', "retrieved matcher");
-
-    for my $batch_key (sort keys %{ $self->{'batches'} }) {
-        my $batch = $self->{'batches'}->{$batch_key};
-        my $args = $batch->{'args'};
-        my $results = $batch->{'results'};
-        my ($batch_id, $num_bibs, $num_items, @invalid) =
-            BatchStageMarcRecords('MARC21', $batch->{marc}, "$batch_key.mrc", "$batch_key comments", 
-                                  '', $args->{'parse_items'}, 0);
-        like($batch_id, qr/^\d+$/, "staged $batch_key");
-        cmp_ok($num_bibs, "==", $results->{'num_bibs'}, "$batch_key: correct number of bibs");
-        cmp_ok($num_items, "==", $results->{'num_items'}, "$batch_key: correct number of items");
-        cmp_ok(scalar(@invalid), "==", $results->{'num_invalid'}, "$batch_key: correct number of invalid bibs");
-
-        my $num_matches = BatchFindBibDuplicates($batch_id, $matcher, 10);
-        cmp_ok($num_matches, "==", $results->{'num_matches'}, "$batch_key: correct number of bib matches");
-
-        if (defined $args->{'overlay_action'}) {
-            if ($args->{'overlay_action'} eq 'create_new') {
-                cmp_ok(GetImportBatchOverlayAction($batch_id), "eq", 'create_new', "$batch_key: verify default overlay action");
-            } else {
-                SetImportBatchOverlayAction($batch_id, $args->{'overlay_action'});
-                cmp_ok(GetImportBatchOverlayAction($batch_id), "eq", $args->{'overlay_action'}, 
-                                                   "$batch_key: changed overlay action");
-            }
-        }
-        if (defined $args->{'nomatch_action'}) {
-            if ($args->{'nomatch_action'} eq 'create_new') {
-                cmp_ok(GetImportBatchNoMatchAction($batch_id), "eq", 'create_new', "$batch_key: verify default nomatch action");
-            } else {
-                SetImportBatchNoMatchAction($batch_id, $args->{'nomatch_action'});
-                cmp_ok(GetImportBatchNoMatchAction($batch_id), "eq", $args->{'nomatch_action'}, 
-                                                   "$batch_key: changed nomatch action");
-            }
-        }
-        if (defined $args->{'item_action'}) {
-            if ($args->{'item_action'} eq 'create_new') {
-                cmp_ok(GetImportBatchItemAction($batch_id), "eq", 'always_add', "$batch_key: verify default item action");
-            } else {
-                SetImportBatchItemAction($batch_id, $args->{'item_action'});
-                cmp_ok(GetImportBatchItemAction($batch_id), "eq", $args->{'item_action'}, 
-                                                   "$batch_key: changed item action");
-            }
-        }
-
-        my ($num_added, $num_updated, $num_items_added, 
-            $num_items_errored, $num_ignored) = BatchCommitBibRecords($batch_id);
-        cmp_ok($num_added,         "==", $results->{'num_added'},         "$batch_key: added correct number of bibs");
-        cmp_ok($num_updated,       "==", $results->{'num_updated'},       "$batch_key: updated correct number of bibs");
-        cmp_ok($num_items_added,   "==", $results->{'num_items_added'},   "$batch_key: added correct number of items");
-        cmp_ok($num_items_errored, "==", $results->{'num_items_errored'}, "$batch_key: correct number of item add errors");
-        cmp_ok($num_ignored,       "==", $results->{'num_ignored'},       "$batch_key: ignored correct number of bibs");
-
-        $self->reindex_marc();
-    }
-     
-}
-
-1;
diff --git a/t/lib/KohaTest/ImportBatch/GetImportBatch.pm b/t/lib/KohaTest/ImportBatch/GetImportBatch.pm
deleted file mode 100644 (file)
index 0b01707..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-package KohaTest::ImportBatch::getImportBatch;
-use base qw( KohaTest::ImportBatch );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::ImportBatch;
-use C4::Matcher;
-use C4::Biblio;
-
-
-=head3 add_one_and_find_it
-
-=cut
-
-sub add_one_and_find_it : Test( 7 ) {
-    my $self = shift;
-
-    my $batch = {
-        overlay_action => 'create_new',
-        import_status  => 'staging',
-        batch_type     => 'batch',
-        file_name      => 'foo',
-        comments       => 'inserted during automated testing',
-    };
-    my $batch_id = AddImportBatch(
-      $batch->{'overlay_action'},
-      $batch->{'import_status'},
-      $batch->{'batch_type'},
-      $batch->{'file_name'},
-      $batch->{'comments'},
-    );
-    ok( $batch_id, "successfully inserted batch: $batch_id" );
-
-    my $retrieved = GetImportBatch( $batch_id );
-
-    foreach my $key ( keys %$batch ) {
-        is( $retrieved->{$key}, $batch->{$key}, "both objects agree on $key" );
-    }
-    is( $retrieved->{'import_batch_id'}, $batch_id, 'batch_id' );
-}
-
-1;
diff --git a/t/lib/KohaTest/ImportBatch/GetImportRecordMarc.pm b/t/lib/KohaTest/ImportBatch/GetImportRecordMarc.pm
deleted file mode 100644 (file)
index b933b35..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-package KohaTest::ImportBatch::GetImportRecordMarc;
-use base qw( KohaTest::ImportBatch );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::ImportBatch;
-use C4::Matcher;
-use C4::Biblio;
-
-
-=head3 record_does_not_exist
-
-=cut
-
-sub record_does_not_exist : Test( 1 ) {
-    my $self = shift;
-
-    my $id = '999999999999';
-    my $marc = GetImportRecordMarc( $id );
-    ok( ! defined( $marc ), 'this marc is undefined' );
-
-}
-
-sub record_does_exist : Test( 4 ) {
-    my $self = shift;
-
-    # we need an import_batch, so let GetZ3950BatchId create one:
-    my $new_batch_id = GetZ3950BatchId('foo');
-    ok( $new_batch_id, "got a new batch ID: $new_batch_id" );
-
-    my $sth = C4::Context->dbh->prepare(
-        "INSERT INTO import_records (import_batch_id, marc, marcxml)
-                                    VALUES (?, ?, ?)"
-    );
-    my $execute = $sth->execute(
-        $new_batch_id,    # batch_id
-        'marc',           # marc
-        'marcxml',        # marcxml
-    );
-    ok( $execute, 'succesfully executed' );
-    my $import_record_id = C4::Context->dbh->{'mysql_insertid'};
-    ok( $import_record_id, 'we got an import_record_id' );
-
-    my $marc = GetImportRecordMarc($import_record_id);
-    ok( defined($marc), 'this marc is defined' );
-}
-
-1;
diff --git a/t/lib/KohaTest/ImportBatch/GetZ3950BatchId.pm b/t/lib/KohaTest/ImportBatch/GetZ3950BatchId.pm
deleted file mode 100644 (file)
index f3f5d9c..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-package KohaTest::ImportBatch::GetZ3950BatchId;
-use base qw( KohaTest::ImportBatch );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::ImportBatch;
-use C4::Matcher;
-use C4::Biblio;
-
-
-=head3 batch_does_not_exist
-
-=cut
-
-sub batch_does_not_exist : Test( 5 ) {
-    my $self = shift;
-
-    my $file_name = 'testing batch';
-
-    # lets make sure it doesn't exist first
-    my $sth = C4::Context->dbh->prepare('SELECT import_batch_id FROM import_batches
-                                         WHERE  batch_type = ?
-                                         AND    file_name = ?');
-    ok( $sth->execute( 'z3950', $file_name, ), 'execute' );
-    my $rowref = $sth->fetchrow_arrayref();
-    ok( !defined( $rowref ), 'this batch does not exist' );
-
-    # now let GetZ3950BatchId create one
-    my $new_batch_id = GetZ3950BatchId( $file_name );
-    ok( $new_batch_id, "got a new batch ID: $new_batch_id" );
-
-    # now search for the one that was just created
-    my $second_batch_id = GetZ3950BatchId( $file_name );
-    ok( $second_batch_id, "got a second batch ID: $second_batch_id" );
-    is( $second_batch_id, $new_batch_id, 'we got the same batch both times.' );
-}
-
-
-1;
diff --git a/t/lib/KohaTest/Installer.pm b/t/lib/KohaTest/Installer.pm
deleted file mode 100644 (file)
index 2a0f9f9..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-package KohaTest::Installer;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-use C4::Languages;
-use C4::Installer;
-
-sub SKIP_CLASS : Expensive { }
-
-sub testing_class { 'C4::Installer' };
-
-sub methods : Test( 1 ) {
-    my $self = shift;
-    my @methods = qw(
-                       new 
-                       marcflavour_list 
-                       marc_framework_sql_list 
-                       sample_data_sql_list 
-                       sql_file_list 
-                       load_db_schema 
-                       load_sql_in_order 
-                       set_marcflavour_syspref 
-                       set_indexing_engine 
-                       set_version_syspref 
-                       load_sql 
-    );
-    can_ok( $self->testing_class, @methods );
-}
-
-# ensure that we have a fresh, empty database
-# after running through the installer tests
-sub shutdown_50_init_db : Tests( shutdown )  {
-    my $self = shift;
-
-    KohaTest::clear_test_database();
-    KohaTest::create_test_database();
-}
-
-1;
diff --git a/t/lib/KohaTest/Installer/SqlScripts.pm b/t/lib/KohaTest/Installer/SqlScripts.pm
deleted file mode 100644 (file)
index 510c574..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-package KohaTest::Installer::SqlScripts;
-use base qw( KohaTest::Installer );
-
-use strict;
-use warnings;
-
-use Test::More;
-use C4::Languages;
-use C4::Installer;
-
-sub startup_50_get_installer : Test( startup => 1 ) {
-    my $self = shift;
-    my $installer = C4::Installer->new();
-    is(ref($installer), "C4::Installer", "created installer");
-    $self->{installer} = $installer;
-}
-
-sub installer_all_sample_data : Tests {
-    my $self = shift;
-
-    skip "did not create installer" unless ref($self->{installer}) eq 'C4::Installer';
-
-    my $all_languages = getAllLanguages();
-    # find the available directory names
-    my $dir=C4::Context->config('intranetdir')."/installer/data/" . 
-            (C4::Context->config("db_scheme") ? C4::Context->config("db_scheme") : "mysql") . "/";
-    opendir (MYDIR,$dir);
-    my @languages = grep { !/^\.|CVS/ && -d "$dir/$_"} readdir(MYDIR);    
-    closedir MYDIR;
-    
-    cmp_ok(scalar(@languages), '>', 0, "at least one framework language defined");
-    
-    foreach my $lang_code (@languages) {
-        SKIP: {
-            my $marc_flavours = $self->{installer}->marcflavour_list($lang_code);
-            ok(defined($marc_flavours), "at least one MARC flavour for $lang_code");
-            skip "no MARC flavours for $lang_code" unless defined($marc_flavours);
-
-            foreach my $flavour (@$marc_flavours) {
-                SKIP: {
-                    $self->clear_test_database();
-                    my $schema_error = $self->{installer}->load_db_schema();
-                    is($schema_error, "", "no errors during schema load");
-                    skip "error during schema load" if $schema_error ne "";
-        
-                    my $list = $self->{installer}->sql_file_list($lang_code, $flavour, { optional => 1, mandatory => 1 });
-                    my $sql_count = scalar(@$list);
-                    cmp_ok($sql_count, '>', 0, "at least one SQL init file for $lang_code, $flavour");
-                    skip "no SQL init files defined for $lang_code, $flavour" unless $sql_count > 0;
-
-                    my ($fwk_language, $installed_list) = $self->{installer}->load_sql_in_order($all_languages, @$list);
-
-                    # extract list of files
-                    my $level;
-                    my @file_list = map { 
-                                            map { $_->{level} = $level; $_ } @{ $level = $_->{level}; $_->{fwklist} } 
-                                        } @$installed_list; 
-                    my $num_processed = scalar(@file_list);
-                    cmp_ok($num_processed, '==', $sql_count, "processed all sql scripts for $lang_code, $flavour");
-
-                    my %sql_to_load = map { my $file = $_; 
-                                            my @file = split qr(\/|\\), $file; 
-                                            join("\t", $file[-2], $file[-1]) => 1 
-                                           } @$list;
-                    foreach my $sql (@file_list) {
-                        ok(exists($sql_to_load{ "$sql->{level}\t$sql->{fwkname}" }), 
-                            "SQL script $sql->{level}/$sql->{fwkname} is on list");
-                        delete $sql_to_load{ "$sql->{level}\t$sql->{fwkname}" };
-                        is($sql->{error}, "", "no errors when loading $sql->{fwkname}");
-                    }
-                    ok(not(%sql_to_load), "no SQL scripts for $lang_code, $flavour left unloaded");
-                }
-            }
-        }
-    }
-}
-
-sub shutdown_50_clear_installer : Tests( shutdown ) {
-    my $self = shift;
-    delete $self->{installer};
-}
-
-1;
diff --git a/t/lib/KohaTest/Installer/get_file_path_from_name.pm b/t/lib/KohaTest/Installer/get_file_path_from_name.pm
deleted file mode 100644 (file)
index 40962a7..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-package KohaTest::Installer::get_file_path_from_name;
-use base qw( KohaTest::Installer );
-
-use strict;
-use warnings;
-
-use Test::More;
-use C4::Languages;
-use C4::Installer;
-
-sub startup_50_get_installer : Test( startup => 1 ) {
-    my $self = shift;
-    my $installer = C4::Installer->new();
-    is(ref($installer), "C4::Installer", "created installer");
-    $self->{installer} = $installer;
-}
-
-sub search_for_known_scripts : Tests( 2 ) {
-    my $self = shift;
-
-    skip "did not create installer" unless ref($self->{installer}) eq 'C4::Installer';
-
-    foreach my $script ( 'installer/data/mysql/en/mandatory/message_transport_types.sql',
-                         'installer/data/mysql/en/optional/sample_notices_message_attributes.sql', ) {
-
-        ok( $self->{'installer'}->get_file_path_from_name( $script ), "found $script" );
-    }
-    
-}
-
-sub shutdown_50_clear_installer : Tests( shutdown ) {
-    my $self = shift;
-    delete $self->{installer};
-}
-
-1;
diff --git a/t/lib/KohaTest/ItemCirculationAlertPreference.pm b/t/lib/KohaTest/ItemCirculationAlertPreference.pm
deleted file mode 100644 (file)
index 3094b33..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-package KohaTest::ItemCirculationAlertPreference;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::ItemCirculationAlertPreference;
-sub testing_class { 'C4::ItemCirculationAlertPreference' };
-
-
-sub methods : Test( 1 ) {
-    my $self = shift;
-    my @methods = qw( 
-                    new
-                    create
-                    delete
-                    is_enabled_for
-                    find
-                    grid
-                );
-    
-    can_ok( $self->testing_class, @methods );    
-}
-
-1;
diff --git a/t/lib/KohaTest/ItemType.pm b/t/lib/KohaTest/ItemType.pm
deleted file mode 100644 (file)
index 2474ce3..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-package KohaTest::ItemType;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::ItemType;
-sub testing_class { 'C4::ItemType' };
-
-
-sub methods : Test( 1 ) {
-    my $self = shift;
-    my @methods = qw( 
-                    new
-                    all
-                );
-    
-    can_ok( $self->testing_class, @methods );    
-}
-
-1;
diff --git a/t/lib/KohaTest/Items.pm b/t/lib/KohaTest/Items.pm
deleted file mode 100644 (file)
index 7dcd9ab..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-package KohaTest::Items;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Items;
-sub testing_class { 'C4::Items' }
-
-sub methods : Test( 1 ) {
-    my $self    = shift;
-    my @methods = qw(
-
-      GetItem
-      AddItemFromMarc
-      AddItem
-      AddItemBatchFromMarc
-      ModItemFromMarc
-      ModItem
-      ModItemTransfer
-      ModDateLastSeen
-      DelItem
-      CheckItemPreSave
-      GetItemStatus
-      GetItemLocation
-      GetLostItems
-      GetItemsForInventory
-      GetItemsCount
-      GetItemInfosOf
-      GetItemsByBiblioitemnumber
-      GetItemsInfo
-      get_itemnumbers_of
-      GetItemnumberFromBarcode
-      get_item_authorised_values
-      get_authorised_value_images
-      GetMarcItem
-      _set_derived_columns_for_add
-      _set_derived_columns_for_mod
-      _do_column_fixes_for_mod
-      _get_single_item_column
-      _calc_items_cn_sort
-      _set_defaults_for_add
-      _koha_new_item
-      _koha_modify_item
-      _koha_delete_item
-      _marc_from_item_hash
-      _add_item_field_to_biblio
-      _replace_item_field_in_biblio
-      _repack_item_errors
-      _get_unlinked_item_subfields
-      _get_unlinked_subfields_xml
-      _parse_unlinked_item_subfields_from_xml
-    );
-
-    can_ok( $self->testing_class, @methods );
-}
-
-1;
diff --git a/t/lib/KohaTest/Items/ColumnFixes.pm b/t/lib/KohaTest/Items/ColumnFixes.pm
deleted file mode 100644 (file)
index aca4f73..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-package KohaTest::Items::ColumnFixes;
-use base qw( KohaTest::Items );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Items;
-
-=head2 STARTUP METHODS
-
-These get run once, before the main test methods in this module
-
-=cut
-
-=head2 TEST METHODS
-
-standard test methods
-
-=head3 not_defined
-
-
-=cut
-
-sub not_defined : Test( 4 ) {
-
-    my $item_mod_fixes_1 = {
-        notforloan => undef,
-        damaged    => undef,
-        wthdrawn   => undef,
-        itemlost   => undef,
-    };
-
-    C4::Items::_do_column_fixes_for_mod($item_mod_fixes_1);
-    is( $item_mod_fixes_1->{'notforloan'}, 0, 'null notforloan fixed during mod' );
-    is( $item_mod_fixes_1->{'damaged'},    0, 'null damaged fixed during mod' );
-    is( $item_mod_fixes_1->{'wthdrawn'},   0, 'null wthdrawn fixed during mod' );
-    is( $item_mod_fixes_1->{'itemlost'},   0, 'null itemlost fixed during mod' );
-
-}
-
-sub empty : Test( 4 ) {
-
-    my $item_mod_fixes_2 = {
-        notforloan => '',
-        damaged    => '',
-        wthdrawn   => '',
-        itemlost   => '',
-    };
-
-    C4::Items::_do_column_fixes_for_mod($item_mod_fixes_2);
-    is( $item_mod_fixes_2->{'notforloan'}, 0, 'empty notforloan fixed during mod' );
-    is( $item_mod_fixes_2->{'damaged'},    0, 'empty damaged fixed during mod' );
-    is( $item_mod_fixes_2->{'wthdrawn'},   0, 'empty wthdrawn fixed during mod' );
-    is( $item_mod_fixes_2->{'itemlost'},   0, 'empty itemlost fixed during mod' );
-
-}
-
-sub not_clobbered : Test( 4 ) {
-
-    my $item_mod_fixes_3 = {
-        notforloan => 1,
-        damaged    => 2,
-        wthdrawn   => 3,
-        itemlost   => 4,
-    };
-
-    C4::Items::_do_column_fixes_for_mod($item_mod_fixes_3);
-    is( $item_mod_fixes_3->{'notforloan'}, 1, 'do not clobber notforloan during mod' );
-    is( $item_mod_fixes_3->{'damaged'},    2, 'do not clobber damaged during mod' );
-    is( $item_mod_fixes_3->{'wthdrawn'},   3, 'do not clobber wthdrawn during mod' );
-    is( $item_mod_fixes_3->{'itemlost'},   4, 'do not clobber itemlost during mod' );
-
-}
-
-1;
diff --git a/t/lib/KohaTest/Items/GetItemsForInventory.pm b/t/lib/KohaTest/Items/GetItemsForInventory.pm
deleted file mode 100644 (file)
index a56057e..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-package KohaTest::Items::GetItemsForInventory;
-use base qw( KohaTest::Items );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Items;
-
-=head2 STARTUP METHODS
-
-These get run once, before the main test methods in this module
-
-=cut
-
-=head2 startup_90_add_item_get_callnumber
-
-=cut
-
-sub startup_90_add_item_get_callnumber : Test( startup => 13 ) {
-    my $self = shift;
-
-    $self->add_biblios( add_items => 1 );
-
-    ok( $self->{'items'}, 'An item has been aded' )
-      or diag( Data::Dumper->Dump( [ $self->{'items'} ], ['items'] ) );
-
-    my @biblioitems = C4::Biblio::GetBiblioItemByBiblioNumber( $self->{'items'}[0]{'biblionumber'} );
-    ok( $biblioitems[0]->{'biblioitemnumber'}, '...and it has a biblioitemnumber' )
-      or diag( Data::Dumper->Dump( [ \@biblioitems ], ['biblioitems'] ) );
-
-    my $items_info = GetItemsByBiblioitemnumber( $biblioitems[0]->{'biblioitemnumber'} );
-    isa_ok( $items_info, 'ARRAY', '...and we can search with that biblioitemnumber' )
-      or diag( Data::Dumper->Dump( [$items_info], ['items_info'] ) );
-    cmp_ok( scalar @$items_info, '>', 0, '...and we can find at least one item with that biblioitemnumber' );
-
-    my $item_info = $items_info->[0];
-    ok( $item_info->{'itemcallnumber'}, '...and the item we found has a call number: ' . $item_info->{'itemcallnumber'} )
-      or diag( Data::Dumper->Dump( [$item_info], ['item_info'] ) );
-
-    $self->{'callnumber'} = $item_info->{'itemcallnumber'};
-}
-
-
-=head2 TEST METHODS
-
-standard test methods
-
-=head3 missing_parameters
-
-the minlocation and maxlocation parameters are required. If they are
-not provided, this method should somehow complain, such as returning
-undef or emitina warning or something.
-
-=cut
-
-sub missing_parameters : Test( 1 ) {
-    my $self = shift;
-    local $TODO = 'GetItemsForInventory should fail when missing required parameters';
-
-    my $items = C4::Items::GetItemsForInventory();
-    ok( ! defined $items, 'GetItemsForInventory fails when parameters are missing' )
-      or diag( Data::Dumper->Dump( [ $items ], [ 'items' ] ) );
-}
-
-=head3 basic_usage
-
-
-=cut
-
-sub basic_usage : Test( 4 ) {
-    my $self = shift;
-
-    ok( $self->{'callnumber'}, 'we have a call number to search for: ' . $self->{'callnumber'} );
-    my $items = C4::Items::GetItemsForInventory( $self->{'callnumber'}, $self->{'callnumber'} );
-    isa_ok( $items, 'ARRAY', 'We were able to call GetItemsForInventory with our call number' );
-    is( scalar @$items, 1, '...and we found only one item' );
-    my $our_item = $items->[0];
-    is( $our_item->{'itemnumber'},     $self->{'items'}[0]{'itemnumber'},                 '...and the item we found has the right itemnumber' );
-
-    # diag( Data::Dumper->Dump( [$items], ['items'] ) );
-}
-
-=head3 date_last_seen
-
-
-=cut
-
-sub date_last_seen : Test( 6 ) {
-    my $self = shift;
-
-    ok( $self->{'callnumber'}, 'we have a call number to search for: ' . $self->{'callnumber'} );
-
-    my $items = C4::Items::GetItemsForInventory(
-        $self->{'callnumber'},    # minlocation
-        $self->{'callnumber'},    # maxlocation
-        undef,                    # location
-        undef,                    # itemtype
-        C4::Dates->new( $self->tomorrow(), 'iso' )->output,    # datelastseen
-    );
-
-    isa_ok( $items, 'ARRAY', 'We were able to call GetItemsForInventory with our call number' );
-    is( scalar @$items, 1, '...and we found only one item' );
-    my $our_item = $items->[0];
-    is( $our_item->{'itemnumber'}, $self->{'items'}[0]{'itemnumber'}, '...and the item we found has the right itemnumber' );
-
-    # give a datelastseen of yesterday, and we should not get our item.
-    $items = C4::Items::GetItemsForInventory(
-        $self->{'callnumber'},    # minlocation
-        $self->{'callnumber'},    # maxlocation
-        undef,                    # location
-        undef,                    # itemtype
-        C4::Dates->new( $self->yesterday(), 'iso' )->output,    # datelastseen
-    );
-
-    isa_ok( $items, 'ARRAY', 'We were able to call GetItemsForInventory with our call number' );
-    is( scalar @$items, 0, '...and we found no items' );
-
-}
-
-
-1;
diff --git a/t/lib/KohaTest/Items/ModItemsFromMarc.pm b/t/lib/KohaTest/Items/ModItemsFromMarc.pm
deleted file mode 100644 (file)
index d0522ee..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-package KohaTest::Items::ModItemsFromMarc;
-use base qw( KohaTest::Items );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Context;
-use C4::Biblio;
-use C4::Items;
-
-=head2 STARTUP METHODS
-
-These get run once, before the main test methods in this module
-
-=cut
-
-=head2 startup_90_add_item_get_callnumber
-
-=cut
-
-sub startup_90_add_item_get_callnumber : Test( startup => 13 ) {
-    my $self = shift;
-
-    $self->add_biblios( count => 1, add_items => 1 );
-
-    ok( $self->{'items'}, 'An item has been aded' )
-      or diag( Data::Dumper->Dump( [ $self->{'items'} ], ['items'] ) );
-
-    my @biblioitems = C4::Biblio::GetBiblioItemByBiblioNumber( $self->{'items'}[0]{'biblionumber'} );
-    ok( $biblioitems[0]->{'biblioitemnumber'}, '...and it has a biblioitemnumber' )
-      or diag( Data::Dumper->Dump( [ \@biblioitems ], ['biblioitems'] ) );
-
-    my $items_info = GetItemsByBiblioitemnumber( $biblioitems[0]->{'biblioitemnumber'} );
-    isa_ok( $items_info, 'ARRAY', '...and we can search with that biblioitemnumber' )
-      or diag( Data::Dumper->Dump( [$items_info], ['items_info'] ) );
-    cmp_ok( scalar @$items_info, '>', 0, '...and we can find at least one item with that biblioitemnumber' );
-
-    my $item_info = $items_info->[0];
-    ok( $item_info->{'itemcallnumber'}, '...and the item we found has a call number: ' . $item_info->{'itemcallnumber'} )
-      or diag( Data::Dumper->Dump( [$item_info], ['item_info'] ) );
-
-    $self->{itemnumber} = $item_info->{itemnumber};
-}
-
-
-=head2 TEST METHODS
-
-standard test methods
-
-=head3 bug2466
-
-Regression test for bug 2466 (when clearing an item field
-via the cataloging or serials item editor, corresponding
-column is not cleared).
-
-=cut
-
-sub bug2466 : Test( 8 ) {
-    my $self = shift;
-
-    my $item = C4::Items::GetItem($self->{itemnumber});
-    isa_ok($item, 'HASH', "item $self->{itemnumber} exists");
-   
-    my $item_marc = C4::Items::GetMarcItem($item->{biblionumber}, $self->{itemnumber});
-    isa_ok($item_marc, 'MARC::Record', "retrieved item MARC");
-
-    cmp_ok($item->{itemcallnumber}, 'ne', '', "item call number is not blank");
-
-    my ($callnum_tag, $callnum_subfield) = C4::Biblio::GetMarcFromKohaField('items.itemcallnumber', '');
-    cmp_ok($callnum_tag, '>', 0, "found tag for itemcallnumber");
-
-    my $item_field = $item_marc->field($callnum_tag);
-    ok(defined($item_field), "retrieved MARC field for item");
-
-    $item_field->delete_subfield(code => $callnum_subfield);
-
-    my $dbh = C4::Context->dbh;
-    my $item_from_marc = C4::Biblio::TransformMarcToKoha($dbh, $item_marc, '', 'items');
-    ok(not(exists($item_from_marc->{itemcallnumber})), "itemcallnumber subfield removed");
-
-    C4::Items::ModItemFromMarc($item_marc, $item->{biblionumber}, $self->{itemnumber});
-
-    my $modified_item = C4::Items::GetItem($self->{itemnumber});
-    isa_ok($modified_item, 'HASH', "retrieved modified item");
-
-    ok(not(defined($modified_item->{itemcallnumber})), "itemcallnumber is now undef");
-}
-
-1;
diff --git a/t/lib/KohaTest/Items/SetDefaults.pm b/t/lib/KohaTest/Items/SetDefaults.pm
deleted file mode 100644 (file)
index fd622a7..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-package KohaTest::Items::SetDefaults;
-use base qw( KohaTest::Items );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Items;
-
-=head2 STARTUP METHODS
-
-These get run once, before the main test methods in this module
-
-=cut
-
-=head2 TEST METHODS
-
-standard test methods
-
-=head3 
-
-
-=cut
-
-sub add_some_items : Test( 3 ) {
-
-    my $item_to_add_1 = { itemnotes => 'newitem', };
-
-    C4::Items::_set_defaults_for_add($item_to_add_1);
-    ok( exists $item_to_add_1->{'dateaccessioned'}, 'dateaccessioned added to new item' );
-    like( $item_to_add_1->{'dateaccessioned'}, qr/^\d\d\d\d-\d\d-\d\d$/, 'new dateaccessioned is dddd-dd-dd' );
-    is( $item_to_add_1->{'itemnotes'}, 'newitem', 'itemnotes not clobbered' );
-
-}
-
-sub undefined : Test( 4 ) {
-    my $item_add_fixes_1 = {
-        notforloan => undef,
-        damaged    => undef,
-        wthdrawn   => undef,
-        itemlost   => undef,
-    };
-
-    C4::Items::_set_defaults_for_add($item_add_fixes_1);
-    is( $item_add_fixes_1->{'notforloan'}, 0, 'null notforloan fixed during add' );
-    is( $item_add_fixes_1->{'damaged'},    0, 'null damaged fixed during add' );
-    is( $item_add_fixes_1->{'wthdrawn'},   0, 'null wthdrawn fixed during add' );
-    is( $item_add_fixes_1->{'itemlost'},   0, 'null itemlost fixed during add' );
-}
-
-sub empty_gets_fixed : Test( 4 ) {
-
-    my $item_add_fixes_2 = {
-        notforloan => '',
-        damaged    => '',
-        wthdrawn   => '',
-        itemlost   => '',
-    };
-
-    C4::Items::_set_defaults_for_add($item_add_fixes_2);
-    is( $item_add_fixes_2->{'notforloan'}, 0, 'empty notforloan fixed during add' );
-    is( $item_add_fixes_2->{'damaged'},    0, 'empty damaged fixed during add' );
-    is( $item_add_fixes_2->{'wthdrawn'},   0, 'empty wthdrawn fixed during add' );
-    is( $item_add_fixes_2->{'itemlost'},   0, 'empty itemlost fixed during add' );
-
-}
-
-sub do_not_clobber : Test( 4 ) {
-
-    my $item_add_fixes_3 = {
-        notforloan => 1,
-        damaged    => 2,
-        wthdrawn   => 3,
-        itemlost   => 4,
-    };
-
-    C4::Items::_set_defaults_for_add($item_add_fixes_3);
-    is( $item_add_fixes_3->{'notforloan'}, 1, 'do not clobber notforloan during mod' );
-    is( $item_add_fixes_3->{'damaged'},    2, 'do not clobber damaged during mod' );
-    is( $item_add_fixes_3->{'wthdrawn'},   3, 'do not clobber wthdrawn during mod' );
-    is( $item_add_fixes_3->{'itemlost'},   4, 'do not clobber itemlost during mod' );
-
-}
-
-1;
diff --git a/t/lib/KohaTest/Koha.pm b/t/lib/KohaTest/Koha.pm
deleted file mode 100644 (file)
index 13a145a..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-package KohaTest::Koha;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Koha;
-sub testing_class { 'C4::Koha' }
-
-sub methods : Test( 1 ) {
-    my $self    = shift;
-    my @methods = qw( slashifyDate
-      DisplayISBN
-      subfield_is_koha_internal_p
-      GetItemTypes
-      get_itemtypeinfos_of
-      GetCcodes
-      getauthtypes
-      getauthtype
-      getframeworks
-      getframeworkinfo
-      getitemtypeinfo
-      getitemtypeimagedir
-      getitemtypeimagesrc
-      getitemtypeimagelocation
-      _getImagesFromDirectory
-      _getSubdirectoryNames
-      getImageSets
-      GetPrinters
-      GetPrinter
-      getnbpages
-      getallthemes
-      getFacets
-      get_infos_of
-      get_notforloan_label_of
-      displayServers
-      GetAuthValCode
-      GetAuthorisedValues
-      GetAuthorisedValueCategories
-      GetKohaAuthorisedValues
-      display_marc_indicators
-    );
-
-    can_ok( $self->testing_class, @methods );
-}
-
-1;
diff --git a/t/lib/KohaTest/Koha/displayServers.pm b/t/lib/KohaTest/Koha/displayServers.pm
deleted file mode 100644 (file)
index 7794268..0000000
+++ /dev/null
@@ -1,192 +0,0 @@
-package KohaTest::Koha::displayServers;
-use base qw( KohaTest::Koha );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Koha;
-
-=head2 basic_usage
-
-call displayServers with no parameters and investigate the things that
-it returns. This depends on there being at least one server defined,
-as do some other tests in this module.
-
-=cut
-
-sub basic_usage : Test( 12 ) {
-    my $self = shift;
-
-    my $servers = C4::Koha::displayServers();
-    isa_ok( $servers, 'ARRAY' );
-    my $firstserver = $servers->[0];
-    isa_ok( $firstserver, 'HASH' );
-
-    my @keys = qw( opensearch icon value name checked zed label id encoding );
-    is( scalar keys %$firstserver, scalar @keys, 'the hash has the right number of keys' );
-    foreach my $key ( @keys ) {
-        ok( exists $firstserver->{$key}, "There is a $key key" );
-    }
-
-    # diag( Data::Dumper->Dump( [ $servers ], [ 'servers' ] ) );
-}
-
-=head2 position_does_not_exist
-
-call displayServers with a position that does not exist and make sure
-that we get none back.
-
-=cut
-
-sub position_does_not_exist : Test( 2 ) {
-    my $self = shift;
-
-    my $servers = C4::Koha::displayServers( 'this does not exist' );
-    isa_ok( $servers, 'ARRAY' );
-    is( scalar @$servers, 0, 'received no servers' );
-
-    # diag( Data::Dumper->Dump( [ $servers ], [ 'servers' ] ) );
-}
-
-=head2 position_does_exist
-
-call displayServers with a position that does exist and make sure that
-we get at least one back.
-
-=cut
-
-sub position_does_exist : Test( 3 ) {
-    my $self = shift;
-
-    my $position = $self->_get_a_position();
-    ok( $position, 'We have a position that exists' );
-    
-    my $servers = C4::Koha::displayServers( $position );
-    isa_ok( $servers, 'ARRAY' );
-    ok( scalar @$servers, 'received at least one server' );
-
-    # diag( Data::Dumper->Dump( [ $servers ], [ 'servers' ] ) );
-}
-
-=head2 type_does_not_exist
-
-call displayServers with a type that does not exist and make sure
-that we get none back.
-
-=cut
-
-sub type_does_not_exist : Test( 2 ) {
-    my $self = shift;
-
-    my $servers = C4::Koha::displayServers( undef, 'this does not exist' );
-    isa_ok( $servers, 'ARRAY' );
-    is( scalar @$servers, 0, 'received no servers' );
-
-    # diag( Data::Dumper->Dump( [ $servers ], [ 'servers' ] ) );
-}
-
-=head2 type_does_exist
-
-call displayServers with a type that does exist and make sure
-that we get at least one back.
-
-=cut
-
-sub type_does_exist : Test( 3 ) {
-    my $self = shift;
-
-    my $type = $self->_get_a_type();
-    ok( $type, 'We have a type that exists' );
-    
-    my $servers = C4::Koha::displayServers( undef, $type );
-    isa_ok( $servers, 'ARRAY' );
-    ok( scalar @$servers, 'received at least one server' );
-
-    # diag( Data::Dumper->Dump( [ $servers ], [ 'servers' ] ) );
-}
-
-=head2 position_and_type
-
-call displayServers with a variety of both positions and types and
-verify that we get either something or nothing back.
-
-
-=cut
-
-sub position_and_type : Test( 8 ) {
-    my $self = shift;
-
-    my ( $position, $type ) = $self->_get_a_position_and_type();
-    ok( $position, 'We have a type that exists' );
-    ok( $type, 'We have a type that exists' );
-    
-    my $servers = C4::Koha::displayServers( $position, 'type does not exist' );
-    isa_ok( $servers, 'ARRAY' );
-    is( scalar @$servers, 0, 'received no servers' );
-
-    $servers = C4::Koha::displayServers( 'position does not exist', $type );
-    isa_ok( $servers, 'ARRAY' );
-    is( scalar @$servers, 0, 'received no servers' );
-
-    $servers = C4::Koha::displayServers( $position, $type );
-    isa_ok( $servers, 'ARRAY' );
-    ok( scalar @$servers, 'received at least one server' );
-
-    # diag( Data::Dumper->Dump( [ $servers ], [ 'servers' ] ) );
-}
-
-=head1 INTERNAL METHODS
-
-these are not test methods, but they help me write them.
-
-=head2 _get_a_position
-
-returns a position value for which at least one server exists
-
-=cut
-
-sub _get_a_position {
-    my $self = shift;
-
-    my ( $position, $type ) = $self->_get_a_position_and_type();
-    return $position;
-
-}
-
-=head2 _get_a_type
-
-returns a type value for which at least one server exists
-
-=cut
-
-sub _get_a_type {
-    my $self = shift;
-
-    my ( $position, $type ) = $self->_get_a_position_and_type();
-    return $type;
-
-}
-
-=head2 _get_a_position_and_type
-
-returns a position and type for a server
-
-=cut
-
-sub _get_a_position_and_type {
-    my $self = shift;
-
-    my $dbh    = C4::Context->dbh;
-    my $sql = 'SELECT position, type FROM z3950servers';
-    my $sth = $dbh->prepare($sql) or return;
-    $sth->execute or return;
-
-    my @row = $sth->fetchrow_array;
-    return ( $row[0], $row[1] );
-
-}
-
-  
-1;
diff --git a/t/lib/KohaTest/Koha/get_itemtypeinfos_of.pm b/t/lib/KohaTest/Koha/get_itemtypeinfos_of.pm
deleted file mode 100644 (file)
index 9845e90..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-package KohaTest::Koha::get_itemtypeinfos_of;
-use base qw( KohaTest::Koha );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Koha;
-
-=head2 get_one
-
-calls get_itemtypeinfos_of on one item type and checks that it gets
-back something sane.
-
-=cut
-
-sub get_one : Test( 8 ) {
-    my $self = shift;
-
-    my $itemtype_info = C4::Koha::get_itemtypeinfos_of( 'BK' );
-    ok( $itemtype_info, 'we got back something from get_itemtypeinfos_of' );
-    isa_ok( $itemtype_info, 'HASH', '...and it' );
-    ok( exists $itemtype_info->{'BK'}, '...and it has a BK key' )
-      or diag( Data::Dumper->Dump( [ $itemtype_info ], [ 'itemtype_info' ] ) );
-    is( scalar keys %$itemtype_info, 1, '...and it has 1 key' );
-    foreach my $key ( qw( imageurl itemtype notforloan description ) ) {
-        ok( exists $itemtype_info->{'BK'}{$key}, "...and the BK info has a $key key" );
-    }
-    
-}
-
-=head2 get_two
-
-calls get_itemtypeinfos_of on a list of item types and verifies the
-results.
-
-=cut
-
-sub get_two : Test( 13 ) {
-    my $self = shift;
-
-    my @itemtypes = qw( BK MU );
-    my $itemtype_info = C4::Koha::get_itemtypeinfos_of( @itemtypes );
-    ok( $itemtype_info, 'we got back something from get_itemtypeinfos_of' );
-    isa_ok( $itemtype_info, 'HASH', '...and it' );
-    is( scalar keys %$itemtype_info, scalar @itemtypes, '...and it has ' . scalar @itemtypes . ' keys' );
-    foreach my $it ( @itemtypes ) {
-        ok( exists $itemtype_info->{$it}, "...and it has a $it key" )
-          or diag( Data::Dumper->Dump( [ $itemtype_info ], [ 'itemtype_info' ] ) );
-        foreach my $key ( qw( imageurl itemtype notforloan description ) ) {
-            ok( exists $itemtype_info->{$it}{$key}, "...and the $it info has a $key key" );
-        }
-    }
-    
-}
-
-  
-1;
diff --git a/t/lib/KohaTest/Koha/getitemtypeimagedir.pm b/t/lib/KohaTest/Koha/getitemtypeimagedir.pm
deleted file mode 100644 (file)
index ea8b034..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-package KohaTest::Koha::getitemtypeimagedir;
-use base qw( KohaTest::Koha );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Koha;
-
-sub check_default : Test( 5 ) {
-    my $self = shift;
-
-    my $opac_directory     = C4::Koha::getitemtypeimagedir('opac');
-    my $default_directory  = C4::Koha::getitemtypeimagedir('opac');
-    my $intranet_directory = C4::Koha::getitemtypeimagedir('intranet');
-
-    ok( $opac_directory,     'the opac directory is defined' );
-    ok( $default_directory,  'the default directory is defined' );
-    ok( $intranet_directory, 'the intranet directory is defined' );
-
-    is( $opac_directory, $default_directory, 'the opac directory is returned as the default' );
-    isnt( $intranet_directory, $default_directory, 'the intranet directory is not the same as the default' );
-
-}
-
-1;
diff --git a/t/lib/KohaTest/Letters.pm b/t/lib/KohaTest/Letters.pm
deleted file mode 100644 (file)
index 97d58fb..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-package KohaTest::Letters;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Members;
-sub testing_class { 'C4::Letters' };
-
-
-sub methods : Test( 1 ) {
-    my $self = shift;
-    my @methods = qw( getletter
-                      addalert
-                      delalert
-                      getalert
-                      findrelatedto
-                      SendAlerts
-                      parseletter
-                );
-    
-    can_ok( $self->testing_class, @methods );    
-}
-
-1;
-
diff --git a/t/lib/KohaTest/Letters/GetLetter.pm b/t/lib/KohaTest/Letters/GetLetter.pm
deleted file mode 100644 (file)
index 76b6ab4..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-package KohaTest::Letters::GetLetter;
-use base qw( KohaTest::Letters );
-
-use strict;
-use warnings;
-
-use C4::Letters;
-use Test::More;
-
-sub GetLetter : Test( 6 ) {
-    my $self = shift;
-
-    my $letter = getletter( 'circulation', 'ODUE' );
-
-    isa_ok( $letter, 'HASH' )
-      or diag( Data::Dumper->Dump( [ $letter ], [ 'letter' ] ) );
-
-    is( $letter->{'code'},   'ODUE',        'code' );
-    is( $letter->{'module'}, 'circulation', 'module' );
-    ok( exists $letter->{'content'}, 'content' );
-    ok( exists $letter->{'name'}, 'name' );
-    ok( exists $letter->{'title'}, 'title' );
-
-
-}
-
-1;
-
-
-
-
-
-
diff --git a/t/lib/KohaTest/Letters/GetLetters.pm b/t/lib/KohaTest/Letters/GetLetters.pm
deleted file mode 100644 (file)
index 576b3bf..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-package KohaTest::Letters::GetLetters;
-use base qw( KohaTest::Letters );
-
-use strict;
-use warnings;
-
-use C4::Letters;
-use Test::More;
-
-sub GetDefaultLetters : Test( 2 ) {
-    my $self = shift;
-
-    my $letters = GetLetters();
-
-    # the default install includes several entries in the letter table.
-    isa_ok( $letters, 'HASH' )
-      or diag( Data::Dumper->Dump( [ $letters ], [ 'letters' ] ) );
-
-  ok( scalar keys( %$letters ) > 0, 'we got some letters' );
-
-
-}
-
-1;
-
-
-
-
-
-
diff --git a/t/lib/KohaTest/Log.pm b/t/lib/KohaTest/Log.pm
deleted file mode 100644 (file)
index dc7b26e..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-package KohaTest::Log;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Log;
-sub testing_class { 'C4::Log' };
-
-
-sub methods : Test( 1 ) {
-    my $self = shift;
-    my @methods = qw( logaction 
-                       GetLogStatus 
-                       displaylog 
-                       GetLogs 
-                );
-    
-    can_ok( $self->testing_class, @methods );    
-}
-
-1;
-
diff --git a/t/lib/KohaTest/Members.pm b/t/lib/KohaTest/Members.pm
deleted file mode 100644 (file)
index ff18869..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-package KohaTest::Members;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Members;
-sub testing_class { 'C4::Members' };
-
-
-sub methods : Test( 1 ) {
-    my $self = shift;
-    my @methods = qw( SearchMember 
-                      GetMemberDetails 
-                      patronflags 
-                      GetMember 
-                      GetMemberIssuesAndFines 
-                      ModMember 
-                      AddMember 
-                      Check_Userid 
-                      changepassword 
-                      fixup_cardnumber
-                      GetGuarantees 
-                      UpdateGuarantees 
-                      GetPendingIssues 
-                      GetAllIssues 
-                      GetMemberAccountRecords 
-                      GetBorNotifyAcctRecord 
-                      checkuniquemember 
-                      checkcardnumber 
-                      getzipnamecity 
-                      getidcity 
-                      GetExpiryDate 
-                      checkuserpassword 
-                      GetborCatFromCatType 
-                      GetBorrowercategory 
-                      ethnicitycategories 
-                      fixEthnicity 
-                      GetAge
-                      get_institutions 
-                      add_member_orgs 
-                      MoveMemberToDeleted 
-                      DelMember 
-                      ExtendMemberSubscriptionTo 
-                      GetTitles 
-                      GetPatronImage 
-                      PutPatronImage 
-                      RmPatronImage 
-                      GetBorrowersWhoHaveNotBorrowedSince 
-                      GetBorrowersWhoHaveNeverBorrowed 
-                      GetBorrowersWithIssuesHistoryOlderThan 
-                      GetBorrowersNamesAndLatestIssue 
-                );
-    
-    can_ok( $self->testing_class, @methods );    
-}
-
-1;
-
diff --git a/t/lib/KohaTest/Members/AttributeTypes.pm b/t/lib/KohaTest/Members/AttributeTypes.pm
deleted file mode 100644 (file)
index 6525267..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-package KohaTest::Members::AttributeTypes;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Members::AttributeTypes;
-sub testing_class { 'C4::Members::AttributeTypes' };
-
-sub methods : Test( 1 ) {
-    my $self = shift;
-    my @methods = qw( 
-                    new
-                    fetch
-                    GetAttributeTypes
-                    code
-                    description
-                    repeatable
-                    unique_id
-                    opac_display
-                    password_allowed
-                    staff_searchable
-                    authorised_value_category
-                    store
-                    delete
-                );
-    
-    can_ok( $self->testing_class, @methods );    
-}
-
-sub startup_50_create_types : Test( startup => 28 ) {
-    my $self = shift;
-
-    my $type1 = C4::Members::AttributeTypes->new('CAMPUSID', 'institution ID');
-    isa_ok($type1,  'C4::Members::AttributeTypes');
-    is($type1->code(), 'CAMPUSID', "set code in constructor");
-    is($type1->description(), 'institution ID', "set description in constructor");
-    ok(!$type1->repeatable(), "repeatable defaults to false");
-    ok(!$type1->unique_id(), "unique_id defaults to false");
-    ok(!$type1->opac_display(), "opac_display defaults to false");
-    ok(!$type1->password_allowed(), "password_allowed defaults to false");
-    ok(!$type1->staff_searchable(), "staff_searchable defaults to false");
-    is($type1->authorised_value_category(), '', "authorised_value_category defaults to ''");
-
-    $type1->repeatable('foobar');
-    ok($type1->repeatable(), "repeatable now true");
-    cmp_ok($type1->repeatable(), '==', 1, "repeatable not set to 'foobar'");
-    $type1->repeatable(0);
-    ok(!$type1->repeatable(), "repeatable now false");
-    
-    $type1->unique_id('foobar');
-    ok($type1->unique_id(), "unique_id now true");
-    cmp_ok($type1->unique_id(), '==', 1, "unique_id not set to 'foobar'");
-    $type1->unique_id(0);
-    ok(!$type1->unique_id(), "unique_id now false");
-    
-    $type1->opac_display('foobar');
-    ok($type1->opac_display(), "opac_display now true");
-    cmp_ok($type1->opac_display(), '==', 1, "opac_display not set to 'foobar'");
-    $type1->opac_display(0);
-    ok(!$type1->opac_display(), "opac_display now false");
-    
-    $type1->password_allowed('foobar');
-    ok($type1->password_allowed(), "password_allowed now true");
-    cmp_ok($type1->password_allowed(), '==', 1, "password_allowed not set to 'foobar'");
-    $type1->password_allowed(0);
-    ok(!$type1->password_allowed(), "password_allowed now false");
-    
-    $type1->staff_searchable('foobar');
-    ok($type1->staff_searchable(), "staff_searchable now true");
-    cmp_ok($type1->staff_searchable(), '==', 1, "staff_searchable not set to 'foobar'");
-    $type1->staff_searchable(0);
-    ok(!$type1->staff_searchable(), "staff_searchable now false");
-
-    $type1->code('INSTID');
-    is($type1->code(), 'CAMPUSID', 'code() allows retrieving but not setting');    
-    $type1->description('student ID');
-    is($type1->description(), 'student ID', 'set description');    
-    $type1->authorised_value_category('CAT');
-    is($type1->authorised_value_category(), 'CAT', 'set authorised_value_category');    
-    
-    $type1->repeatable(1);
-    $type1->staff_searchable(1);
-    $type1->store();
-    is($type1->num_patrons(), 0, 'no patrons using the new attribute type yet');
-
-    my $type2 = C4::Members::AttributeTypes->new('ABC', 'ABC ID');
-    $type2->store();
-}
-
-sub shutdown_50_list_and_remove_types : Test( shutdown => 11 ) {
-    my $self = shift;
-
-    my @list = C4::Members::AttributeTypes::GetAttributeTypes();    
-    is_deeply(\@list, [ { code => 'ABC', description => 'ABC ID' },
-                        { code => 'CAMPUSID', description => 'student ID' } ], "retrieved list of types");
-
-    my $type1 = C4::Members::AttributeTypes->fetch($list[1]->{code}); 
-    isa_ok($type1, 'C4::Members::AttributeTypes');
-    is($type1->code(), 'CAMPUSID', 'fetched code');    
-    is($type1->description(), 'student ID', 'fetched description');    
-    is($type1->authorised_value_category(), 'CAT', 'fetched authorised_value_category');    
-    ok($type1->repeatable(), "fetched repeatable");
-    ok(!$type1->unique_id(), "fetched unique_id");
-    ok(!$type1->opac_display(), "fetched opac_display");
-    ok(!$type1->password_allowed(), "fetched password_allowed");
-    ok($type1->staff_searchable(), "fetched staff_searchable");
-
-    $type1->delete();
-    C4::Members::AttributeTypes->delete('ABC');
-
-    my @newlist = C4::Members::AttributeTypes::GetAttributeTypes();    
-    is(scalar(@newlist), 0, "no types left after deletion");   
-    
-}
-
-1;
diff --git a/t/lib/KohaTest/Members/DebarMember.pm b/t/lib/KohaTest/Members/DebarMember.pm
deleted file mode 100644 (file)
index 9e27d66..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-package KohaTest::Members::DebarMember;
-use base qw( KohaTest::Members );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Members;
-sub testing_class { 'C4::Members' };
-
-
-sub simple_usage : Test( 6 ) {
-    my $self = shift;
-
-    ok( $self->{'memberid'}, 'we have a valid memberid to test with' );
-
-    my $details = C4::Members::GetMemberDetails( $self->{'memberid'} );
-    ok(     exists $details->{'flags'},                  'member details has a "flags" attribute');
-    isa_ok( $details->{'flags'},                 'HASH', 'the "flags" attribute is a hashref');
-    ok(     ! $details->{'flags'}->{'DBARRED'},          'this member is NOT debarred' );
-
-    # Now, let's debar this member and see what happens
-    my $success = C4::Members::DebarMember( $self->{'memberid'} );
-
-    ok( $success, 'we were able to debar the member' );
-    
-    $details = C4::Members::GetMemberDetails( $self->{'memberid'} );
-    ok( $details->{'flags'}->{'DBARRED'},         'this member is debarred now' )
-      or diag( Data::Dumper->Dump( [ $details->{'flags'} ], [ 'flags' ] ) );
-}
-
-sub incorrect_usage : Test( 2 ) {
-    my $self = shift;
-
-    my $result = C4::Members::DebarMember();
-    ok( ! defined $result, 'DebarMember returns undef when passed no parameters' );
-
-    $result = C4::Members::DebarMember( 'this is not a borrowernumber' );
-    ok( ! defined $result, 'DebarMember returns undef when not passed a numeric argument' );
-
-}
-
-1;
diff --git a/t/lib/KohaTest/Members/GetMember.pm b/t/lib/KohaTest/Members/GetMember.pm
deleted file mode 100644 (file)
index 51870ad..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-package KohaTest::Members::GetMember;
-use base qw( KohaTest::Members );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Members;
-
-sub testing_class { 'C4::Members' }
-
-=head2 STARTUP METHODS
-
-These get run once, before the main test methods in this module
-
-=head3 startup_create_borrower
-
-Creates a new borrower to use for these tests.  Class variables that are
-used to search by are stored for easy access by the methods.
-
-=cut
-
-sub startup_create_borrower : Test( startup => 1 ) {
-    my $self = shift;
-
-    my $memberinfo = {
-        surname      => 'surname'   . $self->random_string(),
-        firstname    => 'firstname' . $self->random_string(),
-        address      => 'address'   . $self->random_string(),
-        city         => 'city'      . $self->random_string(),
-        cardnumber   => 'card'      . $self->random_string(),
-        branchcode   => 'U1BCG',
-        categorycode => 'D',    # B  => Board
-        dateexpiry   => '2020-01-01',
-        password     => 'testpassword',
-        userid       => 'testuser',
-        dateofbirth  => $self->random_date(),
-    };
-
-    my $borrowernumber = AddMember( %$memberinfo );
-    ok( $borrowernumber, "created member: $borrowernumber" );
-    $self->{get_new_borrowernumber} = $borrowernumber;
-    $self->{get_new_cardnumber}     = $memberinfo->{cardnumber};
-    $self->{get_new_firstname}      = $memberinfo->{firstname};
-    $self->{get_new_userid}         = $memberinfo->{userid};
-
-    return;
-}
-
-=head2 TESTING METHODS
-
-Standard test methods
-
-=head3 borrowernumber_get
-
-Validates that GetMember can search by borrowernumber
-
-=cut
-
-sub borrowernumber_get : Test( 6 ) {
-    my $self = shift;
-
-    ok( $self->{get_new_borrowernumber},
-        "we have a valid memberid $self->{get_new_borrowernumber} to test with" );
-
-    #search by borrowernumber
-    my $results =
-      C4::Members::GetMember( borrowernumber=>$self->{get_new_borrowernumber});
-    ok( $results, 'we successfully called GetMember searching by borrowernumber' );
-
-    ok( exists $results->{borrowernumber},
-        'member details has a "borrowernumber" attribute' );
-    is( $results->{borrowernumber},
-        $self->{get_new_borrowernumber},
-        '...and it matches the created borrowernumber'
-    );
-
-    ok( exists $results->{'category_type'}, "categories in the join returned values" );
-    ok( $results->{description}, "...and description is valid: $results->{description}" );
-}
-
-=head3 cardnumber_get
-
-Validates that GetMember can search by cardnumber
-
-=cut
-
-sub cardnumber_get : Test( 6 ) {
-    my $self = shift;
-
-    ok( $self->{get_new_cardnumber},
-        "we have a valid cardnumber $self->{get_new_cardnumber} to test with" );
-
-    #search by cardnumber
-    my $results = C4::Members::GetMember( 'cardnumber'=>$self->{get_new_cardnumber} );
-    ok( $results, 'we successfully called GetMember searching by cardnumber' );
-
-    ok( exists $results->{cardnumber}, 'member details has a "cardnumber" attribute' );
-    is( $results->{cardnumber},
-        $self->{get_new_cardnumber},
-        '..and it matches the created cardnumber'
-    );
-
-    ok( exists $results->{'category_type'}, "categories in the join returned values" );
-    ok( $results->{description}, "...and description is valid: $results->{description}" );
-}
-
-=head3 firstname_get
-
-Validates that GetMember can search by firstname.
-Note that only the first result is used.
-
-=cut
-
-sub firstname_get : Test( 6 ) {
-    my $self = shift;
-
-    ok( $self->{get_new_firstname},
-        "we have a valid firstname $self->{get_new_firstname} to test with" );
-
-    ##search by firstname
-    my $results = C4::Members::GetMember( 'firstname'=>$self->{get_new_firstname} );
-    ok( $results, 'we successfully called GetMember searching by firstname' );
-
-    ok( exists $results->{firstname}, 'member details has a "firstname" attribute' );
-    is( $results->{'firstname'},
-        $self->{get_new_firstname},
-        '..and it matches the created firstname'
-    );
-
-    ok( exists $results->{'category_type'}, "categories in the join returned values" );
-    ok( $results->{description}, "...and description is valid: $results->{description}" );
-}
-
-=head3 userid_get
-
-Validates that GetMember can search by userid.
-
-=cut
-
-sub userid_get : Test( 6 ) {
-    my $self = shift;
-
-    ok( $self->{get_new_userid},
-        "we have a valid userid $self->{get_new_userid} to test with" );
-
-    #search by userid
-    my $results = C4::Members::GetMember( 'userid'=>$self->{get_new_userid} );
-    ok( $results, 'we successfully called GetMember searching by userid' );
-
-    ok( exists $results->{'userid'}, 'member details has a "userid" attribute' );
-    is( $results->{userid},
-        $self->{get_new_userid},
-        '..and it matches the created userid'
-    );
-
-    ok( exists $results->{'category_type'}, "categories in the join returned values" );
-    ok( $results->{description}, "...and description is valid: $results->{description}" );
-}
-
-=head3 missing_params
-
-Validates that GetMember returns undef when no parameters are passed to it
-
-=cut
-
-sub missing_params : Test( 1 ) {
-    my $self = shift;
-
-    my $results = C4::Members::GetMember();
-
-    ok( !defined $results, 'returned undef when no parameters passed' );
-
-}
-
-=head2 SHUTDOWN METHODS
-
-These get run once, after the main test methods in this module
-
-=head3 shutdown_remove_borrower
-
-Remove the new borrower information that was created in the startup method
-
-=cut
-
-sub shutdown_remove_borrower : Test( shutdown => 0 ) {
-    my $self = shift;
-
-    delete $self->{get_new_borrowernumber};
-    delete $self->{get_new_cardnumber};
-    delete $self->{get_new_firstname};
-    delete $self->{get_new_userid};
-
-}
-
-1;
diff --git a/t/lib/KohaTest/Members/GetMemberDetails.pm b/t/lib/KohaTest/Members/GetMemberDetails.pm
deleted file mode 100644 (file)
index e93742b..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-package KohaTest::Members::GetMemberDetails;
-use base qw( KohaTest::Members );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Members;
-
-sub testing_class { 'C4::Members' }
-
-=head3 STARTUP METHODS
-
-These are run once, before the main test methods in this module.
-
-=head2 startup_create_detailed_borrower
-
-Creates a new borrower to be used by the testing methods.  Also
-populates the class hash with values to be compared from the database
-retrieval.
-
-=cut
-
-sub startup_create_detailed_borrower : Test( startup => 2 ) {
-    my $self = shift;
-    my ( $description, $type, $amount, $user );
-
-    my $memberinfo = {
-        surname      => 'surname' . $self->random_string(),
-        firstname    => 'firstname' . $self->random_string(),
-        address      => 'address' . $self->random_string(),
-        city         => 'city' . $self->random_string(),
-        cardnumber   => 'card' . $self->random_string(),
-        branchcode   => 'CPL',
-        categorycode => 'B',
-        dateexpiry   => '2020-01-01',
-        password     => 'testpassword',
-        userid       => 'testuser',
-        flags        => '0',
-        dateofbirth  => $self->random_date(),
-    };
-
-    my $borrowernumber = AddMember( %$memberinfo );
-    ok( $borrowernumber, "created member: $borrowernumber" );
-    $self->{detail_borrowernumber} = $borrowernumber;
-    $self->{detail_cardnumber}     = $memberinfo->{cardnumber};
-
-    #values for adding a record to accounts
-    $description = 'Test account';
-    $type        = 'M';
-    $amount      = 5.00;
-    $user        = '';
-
-    my $acct_added =
-      C4::Accounts::manualinvoice( $borrowernumber, undef, $description, $type, $amount,
-        $user );
-
-    ok( $acct_added == 0, 'added account for borrower' );
-
-    $self->{amountoutstanding} = $amount;
-
-    return;
-}
-
-=head2 TESTING METHODS
-
-=head3 borrower_detail_get
-
-Tests the functionality of the GetMemberDetails method in C4::Members.
-Validates the join on categories table works as well as the extra fields
-the method gets from outside of either the borrowers and categories table like
-amountoutstanding and user flags.
-
-=cut
-
-sub borrower_detail_get : Test( 8 ) {
-    my $self = shift;
-
-    ok( $self->{detail_borrowernumber},
-        'we have a valid detailed borrower to test with' );
-
-    my $details = C4::Members::GetMemberDetails( $self->{detail_borrowernumber} );
-    ok( $details, 'we successfully called GetMemberDetails' );
-    ok( exists $details->{categorycode},
-        'member details has a "categorycode" attribute' );
-    ok( $details->{categorycode}, '...and it is set to something' );
-
-    ok( exists $details->{category_type}, "categories in the join returned values" );
-
-    ok( $details->{category_type}, '...and category_type is valid' );
-
-    ok( $details->{amountoutstanding}, 'an amountoutstanding exists' );
-    is( $details->{amountoutstanding},
-        $self->{amountoutstanding},
-        '...and matches inserted account record'
-    );
-
-}
-
-=head3 cardnumber_detail_get
-
-This method tests the capability of GetMemberDetails to search on cardnumber.  There doesn't seem to be any
-current calls to GetMemberDetail using cardnumber though, so this test may not be necessary.
-
-=cut
-
-sub cardnumber_detail_get : Test( 8 ) {
-    my $self = shift;
-
-    ok( $self->{detail_cardnumber},
-        "we have a valid detailed borrower to test with $self->{detail_cardnumber}" );
-
-    my $details = C4::Members::GetMemberDetails( undef, $self->{detail_cardnumber} );
-    ok( $details, 'we successfully called GetMemberDetails' );
-    ok( exists $details->{categorycode},
-        "member details has a 'categorycode' attribute $details->{categorycode}" );
-    ok( $details->{categorycode}, '...and it is set to something' );
-
-    ok( exists $details->{category_type}, "categories in the join returned values" );
-
-    ok( $details->{category_type}, '...and category_type is valid' );
-
-#FIXME These 2 methods will fail as borrowernumber is not set in GetMemberDetails when cardnumber is used instead.
-#ok( $details->{amountoutstanding}, 'an amountoutstanding exists' );
-#is( $details->{amountoutstanding}, $self->{amountoutstanding}, '...and matches inserted account record' );
-}
-
-=head2 SHUTDOWN METHDOS
-
-These get run once, after the main test methods in this module.
-
-=head3 shutdown_remove_new_borrower
-
-Removes references in the Class to the new borrower created
-in the startup methods.
-
-=cut
-
-sub shutdown_remove_new_borrower : Test( shutdown => 0 ) {
-    my $self = shift;
-
-    delete $self->{detail_borrowernumber};
-    delete $self->{detail_cardnumber};
-    delete $self->{amountoutstanding};
-
-    return;
-}
-
-1;
diff --git a/t/lib/KohaTest/Members/ModMember.pm b/t/lib/KohaTest/Members/ModMember.pm
deleted file mode 100644 (file)
index 876677f..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-package KohaTest::Members::ModMember;
-use base qw( KohaTest::Members );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Members;
-sub testing_class { 'C4::Members' };
-
-
-sub a_simple_usage : Test( 7 ) {
-    my $self = shift;
-
-    ok( $self->{'memberid'}, 'we have a valid memberid to test with' );
-
-    my $details = C4::Members::GetMemberDetails( $self->{'memberid'} );
-    ok( exists $details->{'dateofbirth'}, 'member details has a "dateofbirth" attribute');
-    ok( $details->{'dateofbirth'},        '...and it is set to something' );
-
-    my $new_date_of_birth = $self->random_date();
-    like( $new_date_of_birth, qr(^\d\d\d\d-\d\d-\d\d$), 'The new date of birth is a yyyy-mm-dd' );
-
-    my $success = C4::Members::ModMember(
-        borrowernumber => $self->{'memberid'},
-        dateofbirth    => $new_date_of_birth
-    );
-
-    ok( $success, 'we successfully called ModMember' );
-
-    $details = C4::Members::GetMemberDetails( $self->{'memberid'} );
-    ok( exists $details->{'dateofbirth'},              'member details still has a "dateofbirth" attribute');
-    is( $details->{'dateofbirth'}, $new_date_of_birth, '...and it is set to the new_date_of_birth' );
-
-}
-
-sub incorrect_usage : Test( 1 ) {
-    my $self = shift;
-
-    local $TODO = 'ModMember does not fail gracefully yet';
-    
-    my $result = C4::Members::ModMember();
-    ok( ! defined $result, 'ModMember returns false when passed no parameters' );
-
-}
-
-=head2 preserve_dates
-
-In bug 2284, it was determined that a Member's dateofbirth could be
-erased by a call to ModMember if no date_of_birth was passed in. Three
-date fields (dateofbirth, dateexpiry ,and dateenrolled) are treated
-differently than other fields by ModMember. This test method calls
-ModMember with none of the date fields set to ensure that they are not
-overwritten.
-
-=cut
-
-
-sub preserve_dates : Test( 18 ) {
-    my $self = shift;
-
-    ok( $self->{'memberid'}, 'we have a valid memberid to test with' );
-
-    my %date_fields = (
-        dateofbirth  => $self->random_date(),
-        dateexpiry   => $self->random_date(),
-        dateenrolled => $self->random_date(),
-    );
-
-    # stage our member with valid dates in all of the date fields
-    my $success = C4::Members::ModMember(
-        borrowernumber => $self->{'memberid'},
-        %date_fields,
-    );
-    ok( $success, 'succefully set the date fields.' );
-    
-    # make sure that we successfully set the date fields. They're not undef.
-    my $details = C4::Members::GetMemberDetails( $self->{'memberid'} );
-    foreach my $date_field ( keys %date_fields ) {
-        ok( exists $details->{$date_field},                     qq(member details has a "$date_field" attribute) );
-        ok( $details->{$date_field},                            '...and it is set to something true' );
-        is( $details->{$date_field}, $date_fields{$date_field}, '...and it is set to what we set it' );
-    }
-
-    # call ModMember to update the firstname. Notice that we're not
-    # updating any date fields.
-    $success = C4::Members::ModMember(
-        borrowernumber => $self->{'memberid'},
-        firstname      => $self->random_string,
-    );
-    ok( $success, 'we successfully called ModMember' );
-
-    # make sure that none of the date fields have been molested by our call to ModMember.
-    $details = C4::Members::GetMemberDetails( $self->{'memberid'} );
-    foreach my $date_field ( keys %date_fields ) {
-        ok( exists $details->{$date_field}, qq(member details still has a "$date_field" attribute) );
-        is( $details->{$date_field}, $date_fields{$date_field}, '...and it is set to the expected value' );
-    }
-
-}
-
-1;
diff --git a/t/lib/KohaTest/Message.pm b/t/lib/KohaTest/Message.pm
deleted file mode 100644 (file)
index d1d822f..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-package KohaTest::Message;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Message;
-sub testing_class { 'C4::Message' };
-
-
-sub methods : Test( 1 ) {
-    my $self = shift;
-    my @methods = qw( 
-                    new
-                    find
-                    find_last_message
-                    enqueue
-                    update
-                    metadata
-                    render_metadata
-                    append
-                );
-    
-    can_ok( $self->testing_class, @methods );    
-}
-
-sub test_metadata : Test( 1 ) {
-    my $self = shift;
-    my $message = C4::Message->new;
-    $message->metadata({
-        header => "Header",
-        body   => [],
-        footer => "Footer",
-    });
-    like($message->{metadata}, qr{^---}, "The metadata attribute should be serialized as YAML.");
-}
-
-sub test_append : Test( 1 ) {
-    my $self = shift;
-    my $message = C4::Message->new;
-    $message->metadata({
-        header => "Header",
-        body   => [],
-        footer => "Footer",
-    });
-    $message->append("foo");
-    is($message->metadata->{body}->[0], "foo", "Appending a string should add an element to metadata.body.");
-}
-
-1;
diff --git a/t/lib/KohaTest/NewsChannels.pm b/t/lib/KohaTest/NewsChannels.pm
deleted file mode 100644 (file)
index 507677e..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-package KohaTest::NewsChannels;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::NewsChannels;
-sub testing_class { 'C4::NewsChannels' };
-
-
-sub methods : Test( 1 ) {
-    my $self = shift;
-    my @methods = qw(
-                      add_opac_new 
-                      upd_opac_new 
-                      del_opac_new 
-                      get_opac_new 
-                      get_opac_news 
-                      GetNewsToDisplay 
-                );
-    
-    can_ok( $self->testing_class, @methods );    
-}
-
-1;
-
diff --git a/t/lib/KohaTest/Overdues.pm b/t/lib/KohaTest/Overdues.pm
deleted file mode 100644 (file)
index 949c670..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-package KohaTest::Overdues;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Overdues;
-sub testing_class { 'C4::Overdues' };
-
-
-sub methods : Test( 1 ) {
-    my $self = shift;
-    my @methods = qw( Getoverdues 
-                       checkoverdues 
-                       CalcFine 
-                       GetSpecialHolidays 
-                       GetRepeatableHolidays
-                       GetWdayFromItemnumber
-                       GetIssuesIteminfo
-                       UpdateFine 
-                       BorType 
-                       ReplacementCost 
-                       GetFine 
-                       GetIssuingRules 
-                       ReplacementCost2 
-                       GetNextIdNotify 
-                       NumberNotifyId
-                       AmountNotify
-                       UpdateAccountLines 
-                       GetItems 
-                       GetOverdueDelays 
-                       CheckAccountLineLevelInfo 
-                       GetOverduerules
-                       CheckBorrowerDebarred
-                       UpdateBorrowerDebarred
-                       CheckExistantNotifyid 
-                       CheckAccountLineItemInfo 
-                       CheckItemNotify 
-                       GetOverduesForBranch 
-                       AddNotifyLine 
-                       RemoveNotifyLine 
-                );
-    
-    can_ok( $self->testing_class, @methods );    
-}
-
-1;
-
diff --git a/t/lib/KohaTest/Overdues/GetBranchcodesWithOverdueRules.pm b/t/lib/KohaTest/Overdues/GetBranchcodesWithOverdueRules.pm
deleted file mode 100644 (file)
index 4ff8db4..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-package KohaTest::Overdues::GetBranchcodesWithOverdueRules;
-use base qw( KohaTest::Overdues );
-
-use strict;
-use warnings;
-
-use C4::Overdues;
-use Test::More;
-
-sub my_branch_has_no_rules : Tests( 2 ) {
-    my $self = shift;
-
-    ok( $self->{'branchcode'}, "we're looking for branch $self->{'branchcode'}" );
-
-    my @branches = C4::Overdues::GetBranchcodesWithOverdueRules;
-    my @found_branches = grep { $_ eq $self->{'branchcode'} } @branches;
-    is( scalar @found_branches, 0, '...and it is not in the list of branches')
-    
-}
-
-sub my_branch_has_overdue_rules : Tests( 3 ) {
-    my $self = shift;
-
-    ok( $self->{'branchcode'}, "we're looking for branch $self->{'branchcode'}" );
-
-    my $dbh = C4::Context->dbh();
-    my $sql = <<'END_SQL';
-INSERT INTO overduerules
-(branchcode,    categorycode,
-delay1,        letter1,       debarred1,
-delay2,        letter2,       debarred2,
-delay3,        letter3,       debarred3)
-VALUES
-( ?, ?,
-?, ?, ?,
-?, ?, ?,
-?, ?, ?)
-END_SQL
-
-    my $sth = $dbh->prepare($sql);
-    my $success = $sth->execute( $self->{'branchcode'}, $self->random_string(2),
-                                 1, $self->random_string(), 0,
-                                 5, $self->random_string(), 0,
-                                 9, $self->random_string(), 1, );
-    ok( $success, '...and we have successfully given it an overdue rule' );
-
-    my @branches = C4::Overdues::GetBranchcodesWithOverdueRules;
-    my @found_branches = grep { $_ eq $self->{'branchcode'} } @branches;
-    is( scalar @found_branches, 1, '...and it IS in the list of branches.')
-    
-}
-
-1;
-
-
-
-
-
-
diff --git a/t/lib/KohaTest/Overdues/GetOverdues.pm b/t/lib/KohaTest/Overdues/GetOverdues.pm
deleted file mode 100644 (file)
index 3cfc438..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-package KohaTest::Overdues::GetOverdues;
-use base qw( KohaTest::Overdues );
-
-use strict;
-use warnings;
-
-use C4::Overdues;
-use Test::More;
-
-=head3 create_overdue_item
-
-=cut
-
-sub startup_60_create_overdue_item : Test( startup => 17 ) {
-    my $self = shift;
-    
-    $self->add_biblios( add_items => 1 );
-    
-    my $biblionumber = $self->{'biblios'}[0];
-    ok( $biblionumber, 'biblionumber' );
-    my @biblioitems = C4::Biblio::GetBiblioItemByBiblioNumber( $biblionumber );
-    ok( scalar @biblioitems > 0, 'there is at least one biblioitem' );
-    my $biblioitemnumber = $biblioitems[0]->{'biblioitemnumber'};
-    ok( $biblioitemnumber, 'got a biblioitemnumber' );
-
-    my $items = C4::Items::GetItemsByBiblioitemnumber( $biblioitemnumber);
-                           
-    my $item = $items->[0];
-    ok( $item->{'itemnumber'}, 'item number' );
-    $self->{'overdueitemnumber'} = $item->{'itemnumber'};
-    
-    # let's use the database to do date math for us.
-    # This is a US date, but that's how C4::Dates likes it, apparently.
-    my $dbh = C4::Context->dbh();
-    my $date_list = $dbh->selectcol_arrayref( q( select DATE_FORMAT( FROM_DAYS( TO_DAYS( NOW() ) - 6 ), '%m/%d/%Y' ) ) );
-    my $six_days_ago = shift( @$date_list );
-    
-    my $duedate = C4::Dates->new( $six_days_ago );
-    # diag( Data::Dumper->Dump( [ $duedate ], [ 'duedate' ] ) );
-    
-    ok( $item->{'barcode'}, 'barcode' )
-      or diag( Data::Dumper->Dump( [ $item ], [ 'item' ] ) );
-    # my $item_from_barcode = C4::Items::GetItem( undef, $item->{'barcode'} );
-    # diag( Data::Dumper->Dump( [ $item_from_barcode ], [ 'item_from_barcode' ] ) );
-
-    ok( $self->{'memberid'}, 'memberid' );
-    my $borrower = C4::Members::GetMember( borrowernumber=>$self->{'memberid'} );
-    ok( $borrower->{'borrowernumber'}, 'borrowernumber' );
-    
-    my ( $issuingimpossible, $needsconfirmation ) = C4::Circulation::CanBookBeIssued( $borrower, $item->{'barcode'}, $duedate, 0 );
-    # diag( Data::Dumper->Dump( [ $issuingimpossible, $needsconfirmation ], [ qw( issuingimpossible needsconfirmation ) ] ) );
-    is( keys %$issuingimpossible, 0, 'issuing is not impossible' );
-    is( keys %$needsconfirmation, 0, 'issuing needs no confirmation' );
-
-    C4::Circulation::AddIssue( $borrower, $item->{'barcode'}, $duedate );
-}
-
-sub basic_usage : Test( 2 ) {
-    my $self = shift;
-
-    my $overdues = C4::Overdues::Getoverdues();
-    isa_ok( $overdues, 'ARRAY' );
-    is( scalar @$overdues, 1, 'found our one overdue book' );
-}
-
-sub limit_minimum_and_maximum : Test( 2 ) {
-    my $self = shift;
-
-    my $overdues = C4::Overdues::Getoverdues( { minimumdays => 1, maximumdays => 100 } );
-    isa_ok( $overdues, 'ARRAY' );
-    is( scalar @$overdues, 1, 'found our one overdue book' );
-}
-
-sub limit_and_do_not_find_it : Test( 2 ) {
-    my $self = shift;
-
-    my $overdues = C4::Overdues::Getoverdues( { minimumdays => 1, maximumdays => 2 } );
-    isa_ok( $overdues, 'ARRAY' );
-    is( scalar @$overdues, 0, 'there are no overdue books in that range.' );
-}
-
-=pod
-
-sub run_overduenotices_script : Test( 1 ) {
-    my $self = shift;
-
-    # make sure member wants alerts
-    C4::Members::Attributes::UpdateBorrowerAttribute($self->{'memberid'},
-                                                     { code  => 'PREDEmail',
-                                                       value => '1' } );
-    
-    # we're screwing with C4::Circulation::GetUpcomingIssues by passing in a negative number.
-    C4::Members::Attributes::UpdateBorrowerAttribute($self->{'memberid'},
-                                                     { code  => 'PREDDAYS',
-                                                       value => '-6' } );
-    
-    
-    my $before_count = $self->count_message_queue();
-
-    my $output = qx( ../misc/cronjobs/advance_notices.pl -c );
-    
-    my $after_count = $self->count_message_queue();
-    is( $after_count, $before_count + 1, 'there is one more message in the queue than there used to be.' )
-      or diag $output;
-    
-}
-
-
-=cut
-
-sub count_message_queue {
-    my $self = shift;
-
-    my $dbh = C4::Context->dbh();
-    my $statement = q( select count(0) from message_queue where status = 'pending' );
-    my $countlist = $dbh->selectcol_arrayref( $statement );
-    return $countlist->[0];
-}
-
-1;
-
-
-
-
-
-
diff --git a/t/lib/KohaTest/Print.pm b/t/lib/KohaTest/Print.pm
deleted file mode 100644 (file)
index 02fd5fb..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-package KohaTest::Print;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Print;
-sub testing_class { 'C4::Print' };
-
-
-sub methods : Test( 1 ) {
-    my $self = shift;
-    my @methods = qw( remoteprint
-                      printreserve 
-                      printslip
-                );
-    
-    can_ok( $self->testing_class, @methods );    
-}
-
-1;
-
diff --git a/t/lib/KohaTest/Reserves.pm b/t/lib/KohaTest/Reserves.pm
deleted file mode 100644 (file)
index 5317029..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-package KohaTest::Reserves;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Reserves;
-sub testing_class { 'C4::Reserves' };
-
-
-sub methods : Test( 1 ) {
-    my $self = shift;
-    my @methods = qw(  AddReserve 
-                       GetReservesFromBiblionumber 
-                       GetReservesFromItemnumber 
-                       GetReservesFromBorrowernumber 
-                       GetReserveCount 
-                       GetOtherReserves 
-                       GetReserveFee 
-                       GetReservesToBranch 
-                       GetReservesForBranch 
-                       CheckReserves 
-                       CancelReserve 
-                       ModReserve 
-                       ModReserveFill 
-                       ModReserveStatus 
-                       ModReserveAffect 
-                       ModReserveCancelAll 
-                       ModReserveMinusPriority 
-                       GetReserveInfo 
-                       _FixPriority 
-                       _Findgroupreserve 
-                );
-    
-    can_ok( $self->testing_class, @methods );    
-}
-
-1;
-
diff --git a/t/lib/KohaTest/SMS.pm b/t/lib/KohaTest/SMS.pm
deleted file mode 100644 (file)
index 00af101..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-package KohaTest::SMS;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::SMS;
-sub testing_class { 'C4::SMS' };
-
-
-sub methods : Test( 1 ) {
-    my $self = shift;
-    my @methods = qw( send_sms
-                      driver
-                );
-    
-    can_ok( $self->testing_class, @methods );    
-}
-
-1;
-
diff --git a/t/lib/KohaTest/SMS/send_sms.pm b/t/lib/KohaTest/SMS/send_sms.pm
deleted file mode 100644 (file)
index d6bbb64..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-package KohaTest::SMS::send_sms;
-use base qw( KohaTest::SMS );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::SMS;
-sub testing_class { 'C4::SMS' };
-
-
-sub send_a_message : Test( 1 ) {
-    my $self = shift;
-
-    my $success = C4::SMS->send_sms( { destination => '+1 212-555-1111',
-                                       message     => 'This is the message',
-                                       driver      => 'Test' } );
-
-    ok( $success, "send_sms returned a true: $success" );
-    
-}
-
-
-1;
diff --git a/t/lib/KohaTest/Scripts.pm b/t/lib/KohaTest/Scripts.pm
deleted file mode 100644 (file)
index f44274d..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-package KohaTest::Scripts;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Search;
-sub testing_class { return; };
-
-# Since this is an abstract base class, this prevents these tests from
-# being run directly unless we're testing a subclass. It just makes
-# things faster.
-__PACKAGE__->SKIP_CLASS( 1 );
-
-
-1;
diff --git a/t/lib/KohaTest/Scripts/longoverdue.pm b/t/lib/KohaTest/Scripts/longoverdue.pm
deleted file mode 100644 (file)
index e00fb0c..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-package KohaTest::Scripts::longoverdue;
-use base qw( KohaTest::Scripts );
-
-use strict;
-use warnings;
-
-use Test::More;
-use Time::localtime;
-
-
-=head2 STARTUP METHODS
-
-These get run once, before the main test methods in this module
-
-=head3 create_overdue_item
-
-=cut
-
-sub create_overdue_item : Test( startup => 12 ) {
-    my $self = shift;
-    
-    $self->add_biblios( add_items => 1 );
-    
-    my $biblionumber = $self->{'biblios'}[0];
-    ok( $biblionumber, 'biblionumber' );
-    my @biblioitems = C4::Biblio::GetBiblioItemByBiblioNumber( $biblionumber );
-    ok( scalar @biblioitems > 0, 'there is at least one biblioitem' );
-    my $biblioitemnumber = $biblioitems[0]->{'biblioitemnumber'};
-    ok( $biblioitemnumber, 'got a biblioitemnumber' );
-
-    my $items = C4::Items::GetItemsByBiblioitemnumber( $biblioitemnumber);
-                           
-    my $itemnumber = $items->[0]->{'itemnumber'};
-    ok( $items->[0]->{'itemnumber'}, 'item number' );
-
-    $self->{'overdueitemnumber'} = $itemnumber;
-    
-}
-
-sub set_overdue_item_lost : Test( 13 ) {
-    my $self = shift;
-
-    my $item = C4::Items::GetItem( $self->{'overdueitemnumber'} );
-    is( $item->{'itemnumber'}, $self->{'overdueitemnumber'}, 'itemnumber' );
-
-    ok( exists $item->{'itemlost'}, 'itemlost exists' );
-    ok( ! $item->{'itemlost'}, 'item is not lost' );
-
-    # This is a US date, but that's how C4::Dates likes it, apparently.
-    my $duedatestring = sprintf( '%02d/%02d/%04d',
-                                 localtime->mon() + 1,
-                                 localtime->mday(),
-                                 localtime->year() + 1900 - 1, # it was due a year ago.
-                            );
-    my $duedate = C4::Dates->new( $duedatestring );
-    # diag( Data::Dumper->Dump( [ $duedate ], [ 'duedate' ] ) );
-    
-    ok( $item->{'barcode'}, 'barcode' )
-      or diag( Data::Dumper->Dump( [ $item ], [ 'item' ] ) );
-    # my $item_from_barcode = C4::Items::GetItem( undef, $item->{'barcode'} );
-    # diag( Data::Dumper->Dump( [ $item_from_barcode ], [ 'item_from_barcode' ] ) );
-
-    my $borrower = C4::Members::GetMember( borrowernumber => $self->{'memberid'} );
-    ok( $borrower->{'borrowernumber'}, 'borrowernumber' );
-    
-    my ( $issuingimpossible, $needsconfirmation ) = C4::Circulation::CanBookBeIssued( $borrower, $item->{'barcode'}, $duedate, 0 );
-    # diag( Data::Dumper->Dump( [ $issuingimpossible, $needsconfirmation ], [ qw( issuingimpossible needsconfirmation ) ] ) );
-    is( keys %$issuingimpossible, 0, 'issuing is not impossible' );
-    is( keys %$needsconfirmation, 0, 'issuing needs no confirmation' );
-
-    my $issue_due_date = C4::Circulation::AddIssue( $borrower, $item->{'barcode'}, $duedate );
-    ok( $issue_due_date, 'due date' );
-    is( $issue_due_date, $duedate, 'AddIssue returned the same date we passed to it' );
-    
-    # I have to make this in a different format since that's how the database holds it.
-    my $duedateyyyymmdd = sprintf( '%04d-%02d-%02d',
-                                   localtime->year() + 1900 - 1, # it was due a year ago.
-                                   localtime->mon() + 1,
-                                   localtime->mday(),
-                              );
-
-    my $issued_item = C4::Items::GetItem( $self->{'overdueitemnumber'} );
-    is( $issued_item->{'onloan'}, $duedateyyyymmdd, "the item is checked out and due $duedatestring" );
-    is( $issued_item->{'itemlost'}, 0, 'the item is not lost' );
-    # diag( Data::Dumper->Dump( [ $issued_item ], [ 'issued_item' ] ) );
-
-    qx( ../misc/cronjobs/longoverdue.pl --lost 90=2 --confirm );
-
-    my $lost_item = C4::Items::GetItem( $self->{'overdueitemnumber'} );
-    is( $lost_item->{'onloan'}, $duedateyyyymmdd, "the item is checked out and due $duedatestring" );
-    is( $lost_item->{'itemlost'}, 2, 'the item is lost' );
-    # diag( Data::Dumper->Dump( [ $lost_item ], [ 'lost_item' ] ) );
-
-}
-
-
-1;
diff --git a/t/lib/KohaTest/Search.pm b/t/lib/KohaTest/Search.pm
deleted file mode 100644 (file)
index 4ad190b..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-package KohaTest::Search;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Search;
-sub testing_class { 'C4::Search' };
-
-
-sub methods : Test( 1 ) {
-    my $self = shift;
-    my @methods = qw(
-                      FindDuplicate
-                      SimpleSearch
-                      getRecords
-                      pazGetRecords
-                      _remove_stopwords
-                      _detect_truncation
-                      _build_stemmed_operand
-                      _build_weighted_query
-                      buildQuery
-                      searchResults
-                      NZgetRecords
-                      NZanalyse
-                      NZoperatorAND
-                      NZoperatorOR
-                      NZoperatorNOT
-                      NZorder
-                );
-    
-    can_ok( $self->testing_class, @methods );    
-}
-
-1;
diff --git a/t/lib/KohaTest/Search/NoZebra.pm b/t/lib/KohaTest/Search/NoZebra.pm
deleted file mode 100644 (file)
index ade916a..0000000
+++ /dev/null
@@ -1,235 +0,0 @@
-package KohaTest::Search::NoZebra;
-use base qw( KohaTest::Search );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use MARC::Record;
-
-use C4::Search;
-use C4::Biblio;
-use C4::Context;
-
-=head2 STARTUP METHODS
-
-These get run once, before the main test methods in this module
-
-=cut
-
-=head3 startup_50_init_nozebra
-
-Turn on NoZebra mode, for now, assumes and requires
-that the test database has started out using Zebra.
-
-=cut
-
-sub startup_50_init_nozebra : Test( startup => 3 ) {
-    my $using_nozebra = C4::Context->preference('NoZebra');
-    ok(!$using_nozebra, "starting out using Zebra");
-    my $dbh = C4::Context->dbh;
-    $dbh->do("UPDATE systempreferences SET value=1 WHERE variable='NoZebra'");
-    $dbh->do("UPDATE systempreferences SET value=0 WHERE variable in ('QueryFuzzy','QueryWeightFields','QueryStemming')");
-    C4::Context->clear_syspref_cache();
-    $using_nozebra = C4::Context->preference('NoZebra');
-    ok($using_nozebra, "switched to NoZebra");
-
-    my $sth = $dbh->prepare("SELECT COUNT(*) FROM nozebra");
-    $sth->execute;
-    my ($count) = $sth->fetchrow_array;
-    $sth->finish;
-    cmp_ok($count, '==', 0, "NoZebra index starts off empty");
-}
-
-sub startup_51_add_bibs : Test( startup => 2 ) {
-    my $self = shift;
-
-    my $bib1 = MARC::Record->new();
-    $bib1->leader('     nam a22     7a 4500');
-    $bib1->append_fields(
-        MARC::Field->new('010', ' ', ' ', a => 'lccn001'), 
-        MARC::Field->new('020', ' ', ' ', a => 'isbn001'), 
-        MARC::Field->new('022', ' ', ' ', a => 'issn001'), 
-        MARC::Field->new('100', ' ', ' ', a => 'Cat, Felix T.'),
-        MARC::Field->new('245', ' ', ' ', a => 'Of mice and men :', b=> 'a history'),
-    );
-    my $bib2 = MARC::Record->new();
-    $bib2->leader('     nam a22     7a 4500');
-    $bib2->append_fields(
-        MARC::Field->new('010', ' ', ' ', a => 'lccn002'), 
-        MARC::Field->new('020', ' ', ' ', a => 'isbn002'), 
-        MARC::Field->new('022', ' ', ' ', a => 'issn002'), 
-        MARC::Field->new('100', ' ', ' ', a => 'Dog, Rover T.'),
-        MARC::Field->new('245', ' ', ' ', a => 'Of mice and men :', b=> 'a digression'),
-    );
-
-    my $dbh = C4::Context->dbh;
-    my $count_sth = $dbh->prepare("SELECT COUNT(*) FROM nozebra");
-    my $count;
-    my ($bib1_bibnum, $bib1_bibitemnum) = AddBiblio($bib1, '');
-    $count_sth->execute;
-    ($count) = $count_sth->fetchrow_array;
-    cmp_ok($count, '==', 14, "correct number of new words indexed"); # tokens + biblionumber + __RAW__
-
-    my ($bib2_bibnum, $bib2_bibitemnum) = AddBiblio($bib2, '');
-    $count_sth->execute;
-    ($count) = $count_sth->fetchrow_array;
-    cmp_ok($count, '==', 22, "correct number of new words indexed"); # tokens + biblionumber + __RAW__
-
-    push @{ $self->{nozebra_test_bibs} }, $bib1_bibnum, $bib2_bibnum;
-}
-
-=head2 TEST METHODS
-
-Standard test methods
-
-=cut
-
-sub basic_searches_via_nzanalyze : Test( 28 ) {
-    my $self = shift;
-    my ($bib1_bibnum, $bib2_bibnum) = @{ $self->{nozebra_test_bibs} };
-    
-    my $results = C4::Search::NZanalyse('foobar');
-    ok(!defined($results), "no hits on 'foobar'");
-
-    $results = C4::Search::NZanalyse('dog');
-    my ($hits, @bibnumbers) = parse_nzanalyse($results);
-    cmp_ok($hits, '==', 1, "one hit on 'dog'");
-    is($bib2_bibnum, $bibnumbers[0], "correct hit on 'dog'");
-
-    $results = C4::Search::NZanalyse('au=dog');
-    ($hits, @bibnumbers) = parse_nzanalyse($results);
-    cmp_ok($hits, '==', 1, "one hit on 'au=dog'");
-    is($bib2_bibnum, $bibnumbers[0], "correct hit on 'au=dog'");
-
-    $results = C4::Search::NZanalyse('isbn=dog');
-    ($hits, @bibnumbers) = parse_nzanalyse($results);
-    cmp_ok($hits, '==', 0, "zero hits on 'isbn=dog'");
-
-    $results = C4::Search::NZanalyse('cat');
-    ($hits, @bibnumbers) = parse_nzanalyse($results);
-    cmp_ok($hits, '==', 1, "one hit on 'cat'");
-    is($bib1_bibnum, $bibnumbers[0], "correct hit on 'cat'");
-
-    $results = C4::Search::NZanalyse('cat and dog');
-    ($hits, @bibnumbers) = parse_nzanalyse($results);
-    cmp_ok($hits, '==', 0, "zero hits on 'cat and dog'");
-
-    $results = C4::Search::NZanalyse('cat or dog');
-    ($hits, @bibnumbers) = parse_nzanalyse($results);
-    cmp_ok($hits, '==', 2, "two hits on 'cat or dog'");
-    is_deeply([ sort @bibnumbers ], [ sort($bib1_bibnum, $bib2_bibnum) ], "correct hits on 'cat or dog'");
-
-    $results = C4::Search::NZanalyse('mice and men');
-    ($hits, @bibnumbers) = parse_nzanalyse($results);
-    cmp_ok($hits, '==', 2, "two hits on 'mice and men'");
-    is_deeply([ sort @bibnumbers ], [ sort($bib1_bibnum, $bib2_bibnum) ], "correct hits on 'mice and men'");
-
-    $results = C4::Search::NZanalyse('title=digression or issn=issn001');
-    ($hits, @bibnumbers) = parse_nzanalyse($results);
-    cmp_ok($hits, '==', 2, "two hits on 'title=digression or issn=issn001'");
-    is_deeply([ sort @bibnumbers ], [ sort($bib1_bibnum, $bib2_bibnum) ], "correct hits on 'title=digression or issn=issn001'");
-
-    $results = C4::Search::NZanalyse('title=digression and issn=issn002');
-    ($hits, @bibnumbers) = parse_nzanalyse($results);
-    cmp_ok($hits, '==', 1, "two hits on 'title=digression and issn=issn002'");
-    is($bib2_bibnum, $bibnumbers[0], "correct hit on 'title=digression and issn=issn002'");
-
-    $results = C4::Search::NZanalyse('mice not men');
-    ($hits, @bibnumbers) = parse_nzanalyse($results);
-    cmp_ok($hits, '==', 0, "zero hits on 'mice not men'");
-
-    $results = C4::Search::NZanalyse('mice not dog');
-    ($hits, @bibnumbers) = parse_nzanalyse($results);
-    cmp_ok($hits, '==', 1, "one hit on 'mice not dog'");
-    is($bib1_bibnum, $bibnumbers[0], "correct hit on 'mice not dog'");
-
-    $results = C4::Search::NZanalyse('isbn > a');
-    ($hits, @bibnumbers) = parse_nzanalyse($results);
-    cmp_ok($hits, '==', 2, "two hits on 'isbn > a'");
-    is_deeply([ sort @bibnumbers ], [ sort($bib1_bibnum, $bib2_bibnum) ], "correct hits on 'isbn > a'");
-
-    $results = C4::Search::NZanalyse('isbn < z');
-    ($hits, @bibnumbers) = parse_nzanalyse($results);
-    cmp_ok($hits, '==', 2, "two hits on 'isbn < z'");
-    is_deeply([ sort @bibnumbers ], [ sort($bib1_bibnum, $bib2_bibnum) ], "correct hits on 'isbn < z'");
-
-    $results = C4::Search::NZanalyse('isbn > isbn001');
-    ($hits, @bibnumbers) = parse_nzanalyse($results);
-    cmp_ok($hits, '==', 1, "one hit on 'isbn > isbn001'");
-    is($bib2_bibnum, $bibnumbers[0], "correct hit on 'isbn > isbn001'");
-
-    $results = C4::Search::NZanalyse('isbn>=isbn001');
-    ($hits, @bibnumbers) = parse_nzanalyse($results);
-    cmp_ok($hits, '==', 2, "two hits on 'isbn>=isbn001'");
-    is_deeply([ sort @bibnumbers ], [ sort($bib1_bibnum, $bib2_bibnum) ], "correct hits on 'isbn>=isbn001'");
-}
-
-sub parse_nzanalyse {
-    my $results = shift;
-    my @bibnumbers = ();
-    if (defined $results) {
-        # NZanalyze currently has a funky way of returning results -
-        # it does not guarantee that a biblionumber occurs only
-        # once in the results string.  Hence we must remove
-        # duplicates, like NZorder (inefficently) does
-        my %hash;
-        @bibnumbers = grep { ++$hash{$_} == 1 }  map { my @f = split /,/, $_; $f[0]; } split /;/, $results;
-    }
-    return scalar(@bibnumbers), @bibnumbers;
-}
-
-=head2 SHUTDOWN METHODS
-
-These get run once, after all of the main tests methods in this module
-
-=cut
-
-sub shutdown_49_remove_bibs : Test( shutdown => 4 ) {
-    my $self = shift;
-    my ($bib1_bibnum, $bib2_bibnum) = @{ $self->{nozebra_test_bibs} };
-
-    my $dbh = C4::Context->dbh;
-    my $count_sth = $dbh->prepare("SELECT COUNT(*) FROM nozebra");
-    my $count;
-
-    my $error = DelBiblio($bib2_bibnum);
-    ok(!defined($error), "deleted bib $bib2_bibnum");
-    $count_sth->execute;
-    ($count) = $count_sth->fetchrow_array;
-    TODO: { local $TODO = 'nothing actually gets deleted from nozebra currently';
-    cmp_ok($count, '==', 14, "correct number of words indexed after bib $bib2_bibnum deleted"); 
-    }
-
-    $error = DelBiblio($bib1_bibnum);
-    ok(!defined($error), "deleted bib $bib1_bibnum");
-    $count_sth->execute;
-    ($count) = $count_sth->fetchrow_array;
-    TODO: { local $TODO = 'nothing actually gets deleted from nozebra currently';
-    cmp_ok($count, '==', 0, "no entries left in nozebra after bib $bib1_bibnum deleted"); 
-    }
-
-    delete $self->{nozebra_test_bibs};
-}
-
-sub shutdown_50_init_nozebra : Test( shutdown => 3 ) {
-    my $using_nozebra = C4::Context->preference('NoZebra');
-    ok($using_nozebra, "still in NoZebra mode");
-    my $dbh = C4::Context->dbh;
-    $dbh->do("UPDATE systempreferences SET value=0 WHERE variable='NoZebra'");
-    $dbh->do("UPDATE systempreferences SET value=1 WHERE variable in ('QueryFuzzy','QueryWeightFields','QueryStemming')");
-    C4::Context->clear_syspref_cache();
-    $using_nozebra = C4::Context->preference('NoZebra');
-    ok(!$using_nozebra, "switched to Zebra");
-
-    # FIXME
-    $dbh->do("DELETE FROM nozebra");
-    my $sth = $dbh->prepare("SELECT COUNT(*) FROM nozebra");
-    $sth->execute;
-    my ($count) = $sth->fetchrow_array;
-    $sth->finish;
-    cmp_ok($count, '==', 0, "NoZebra index finishes up empty");
-}
-
-1;
diff --git a/t/lib/KohaTest/Search/SimpleSearch.pm b/t/lib/KohaTest/Search/SimpleSearch.pm
deleted file mode 100644 (file)
index 95324f2..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-package KohaTest::Search::SimpleSearch;
-use base qw( KohaTest::Search );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Search;
-use C4::Biblio;
-
-=head2 STARTUP METHODS
-
-These get run once, before the main test methods in this module
-
-=head3 insert_test_data
-
-=cut
-
-sub insert_test_data : Test( startup => 71 ) {
-    my $self = shift;
-    
-    # get original 'Finn Test' count
-    my $query = 'Finn Test';
-    my ( $error, $results ) = SimpleSearch( $query );
-    $self->{'orig_finn_test_hits'} = scalar(@$results);
-
-    # I'm going to add a bunch of biblios so that I can search for them.
-    $self->add_biblios( count     => 10,
-                        add_items => 1 );
-
-}
-
-=head2 STARTUP METHODS
-
-standard test methods
-
-=head3 basic_test
-
-basic usage.
-
-=cut
-
-sub basic_test : Test( 2 ) {
-    my $self = shift;
-
-    my $query = 'test';
-
-    my ( $error, $results ) = SimpleSearch( $query );
-    ok( ! defined $error, 'no error found during search' );
-    like( $results->[0], qr/$query/i, 'the result seems to match the query' )
-      or diag( Data::Dumper->Dump( [ $results ], [ 'results' ] ) );
-    
-}
-
-=head3 basic_test_with_server
-
-Test the usage where we specify no limits, but we do specify a server.
-
-=cut
-
-sub basic_test_with_server : Test( 2 ) {
-    my $self = shift;
-
-    my $query = 'test';
-
-    my ( $error, $results ) = SimpleSearch( $query, undef, undef, [ 'biblioserver' ] );
-    ok( ! defined $error, 'no error found during search' );
-    like( $results->[0], qr/$query/i, 'the result seems to match the query' )
-      or diag( Data::Dumper->Dump( [ $results ], [ 'results' ] ) );
-    
-}
-
-
-=head3 basic_test_no_results
-
-Make sure we get back an empty listref when there are no results.
-
-=cut
-
-sub basic_test_no_results : Test( 3 ) {
-    my $self = shift;
-
-    my $query = 'This string is almost guaranteed to not match anything.';
-
-    my ( $error, $results ) = SimpleSearch( $query );
-    ok( ! defined $error, 'no error found during search' );
-    isa_ok( $results, 'ARRAY' );
-    is( scalar( @$results ), 0, 'an empty list was returned.' )
-      or diag( Data::Dumper->Dump( [ $results ], [ 'results' ] ) );
-}
-
-=head3 limits
-
-check that the SimpleTest method limits the number of results returned.
-
-=cut
-
-sub limits : Test( 8 ) {
-    my $self = shift;
-
-    my $query = 'Finn Test';
-
-    {
-        my ( $error, $results ) = SimpleSearch( $query );
-        ok( ! defined $error, 'no error found during search' );
-        my $expected_hits = 10 + $self->{'orig_finn_test_hits'};
-        is( scalar @$results, $expected_hits, "found all $expected_hits results." )
-          or diag( Data::Dumper->Dump( [ $results ], [ 'results' ] ) );
-    }
-    
-    my $offset = 4;
-    {
-        my ( $error, $results ) = SimpleSearch( $query, $offset );
-        ok( ! defined $error, 'no error found during search' );
-        my $expected_hits = 6 + $self->{'orig_finn_test_hits'};
-        is( scalar @$results, $expected_hits, "found $expected_hits results." )
-          or diag( Data::Dumper->Dump( [ $results ], [ 'results' ] ) );
-    }
-
-    my $max_results = 2;
-    {
-        my ( $error, $results ) = SimpleSearch( $query, $offset, $max_results );
-        ok( ! defined $error, 'no error found during search' );
-        is( scalar @$results, $max_results, "found $max_results results." )
-          or diag( Data::Dumper->Dump( [ $results ], [ 'results' ] ) );
-    }
-    
-    {
-        my ( $error, $results ) = SimpleSearch( $query, 0, $max_results );
-        ok( ! defined $error, 'no error found during search' );
-        is( scalar @$results, $max_results, "found $max_results results." )
-          or diag( Data::Dumper->Dump( [ $results ], [ 'results' ] ) );
-    }
-    
-       
-}
-
-
-1;
diff --git a/t/lib/KohaTest/Serials.pm b/t/lib/KohaTest/Serials.pm
deleted file mode 100644 (file)
index e7bb249..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-package KohaTest::Serials;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Serials;
-sub testing_class { 'C4::Serials' };
-
-
-sub methods : Test( 1 ) {
-    my $self = shift;
-    my @methods = qw( GetSuppliersWithLateIssues
-                      GetLateIssues
-                      GetSubscriptionHistoryFromSubscriptionId
-                      GetSerialStatusFromSerialId
-                      GetSerialInformation
-                      AddItem2Serial
-                      UpdateClaimdateIssues
-                      GetSubscription
-                      GetFullSubscription
-                      PrepareSerialsData
-                      GetSubscriptionsFromBiblionumber
-                      GetFullSubscriptionsFromBiblionumber
-                      GetSubscriptions
-                      GetSerials
-                      GetSerials2
-                      GetLatestSerials
-                      GetNextSeq
-                      GetSeq
-                      GetExpirationDate
-                      CountSubscriptionFromBiblionumber
-                      ModSubscriptionHistory
-                      ModSerialStatus
-                      ModSubscription
-                      NewSubscription
-                      ReNewSubscription
-                      NewIssue
-                      ItemizeSerials
-                      HasSubscriptionExpired
-                      DelSubscription
-                      DelIssue
-                      GetLateOrMissingIssues
-                      removeMissingIssue
-                      updateClaim
-                      getsupplierbyserialid
-                      check_routing
-                      addroutingmember
-                      reorder_members
-                      delroutingmember
-                      getroutinglist
-                      countissuesfrom
-                      abouttoexpire
-                      in_array
-                      GetNextDate
-                      itemdata
-                );
-    
-    can_ok( $self->testing_class, @methods );    
-}
-
-1;
-
diff --git a/t/lib/KohaTest/Suggestions.pm b/t/lib/KohaTest/Suggestions.pm
deleted file mode 100644 (file)
index 0c74717..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-package KohaTest::Suggestions;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Suggestions;
-sub testing_class { 'C4::Suggestions' };
-
-
-sub methods : Test( 1 ) {
-    my $self = shift;
-    my @methods = qw( SearchSuggestion
-                      GetSuggestion
-                      GetSuggestionFromBiblionumber
-                      GetSuggestionByStatus
-                      CountSuggestion
-                      NewSuggestion
-                      ModStatus
-                      ConnectSuggestionAndBiblio
-                      DelSuggestion
-                );
-    
-    can_ok( $self->testing_class, @methods );    
-}
-
-1;
-
diff --git a/t/lib/KohaTest/Z3950.pm b/t/lib/KohaTest/Z3950.pm
deleted file mode 100644 (file)
index 3d94cff..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-package KohaTest::Z3950;
-use base qw( KohaTest );
-
-use strict;
-use warnings;
-
-use Test::More;
-
-use C4::Z3950;
-sub testing_class { 'C4::Z3950' };
-
-
-sub methods : Test( 1 ) {
-    my $self = shift;
-    my @methods = qw( getz3950servers
-                      z3950servername
-                      addz3950queue
-                      checkz3950searchdone
-                );
-    
-    can_ok( $self->testing_class, @methods );    
-}
-
-1;
-
index 921c4d6..d9a0b76 100755 (executable)
@@ -429,7 +429,8 @@ sub BuildItemsData{
                        my %this_row;
                        foreach my $field (grep {$_->tag() eq $itemtagfield} $itemmarc->fields()) {
                                # loop through each subfield
-                               if (my $itembranchcode=$field->subfield($branchtagsubfield) && C4::Context->preference("IndependantBranches")) {
+                               my $itembranchcode=$field->subfield($branchtagsubfield);
+                               if ($itembranchcode && C4::Context->preference("IndependantBranches")) {
                                                #verifying rights
                                                my $userenv = C4::Context->userenv();
                                                unless (($userenv->{'flags'} == 1) or (($userenv->{'branch'} eq $itembranchcode))){
index a1e9a22..4d23d08 100755 (executable)
@@ -101,12 +101,12 @@ if ($op eq "export") {
     }
     
     if ( $start_callnumber ) {
-        $query .= " AND biblioitems.biblionumber = items.biblionumber AND itemcallnumber <= ? ";
+        $query .= " AND biblioitems.biblionumber = items.biblionumber AND itemcallnumber >= ? ";
         push @sql_params, $start_callnumber;
     }
     
     if ( $end_callnumber ) {
-        $query .= " AND biblioitems.biblionumber = items.biblionumber AND itemcallnumber >= ? ";
+        $query .= " AND biblioitems.biblionumber = items.biblionumber AND itemcallnumber <= ? ";
         push @sql_params, $end_callnumber;
     }
     if ( $start_accession ) {
index c87a7e9..f8903e5 100755 (executable)
@@ -49,6 +49,7 @@ $offset=0 unless $offset;
 my $pagesize = $input->param('pagesize');
 $pagesize=50 unless $pagesize;
 my $branchcode = $input->param('branchcode');
+my $branch     = $input->param('branch');
 my $op = $input->param('op');
 my $res;    #contains the results loop
 # warn "uploadbarcodes : ".$uploadbarcodes;
@@ -129,6 +130,7 @@ $template->param(branchloop => \@branch_loop,
                 location=>$location,
                 ignoreissued=>$ignoreissued,
                 branchcode=>$branchcode,      
+                branch    => $branch,
                 offset => $offset,
                 pagesize => $pagesize,
                 datelastseen => $datelastseen,
@@ -183,7 +185,7 @@ if ( ! ($uploadbarcodes && length($uploadbarcodes)>0 ) || ( $input->param('compa
         }
     }
     if ($markseen or $op) {
-        $res = GetItemsForInventory($minlocation,$maxlocation,$location, $ignoreissued,$itemtype,$datelastseen,$branchcode,$offset,$pagesize,$staton);
+        $res = GetItemsForInventory( $minlocation, $maxlocation, $location, $ignoreissued, $itemtype, $datelastseen, $branchcode, $branch, $offset, $pagesize, $staton );
         $template->param(loop =>$res,
                         nextoffset => ($offset+$pagesize),
                         prevoffset => ($offset?$offset-$pagesize:0),