Merge branch 'bug_8117' into 3.12-master
authorJared Camins-Esakov <jcamins@cpbibliography.com>
Sun, 2 Dec 2012 14:21:50 +0000 (09:21 -0500)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Sun, 2 Dec 2012 14:21:50 +0000 (09:21 -0500)
628 files changed:
C4/Accounts.pm
C4/Acquisition.pm
C4/Auth.pm
C4/Auth_with_ldap.pm
C4/AuthoritiesMarc.pm
C4/BackgroundJob.pm
C4/Barcodes.pm
C4/Barcodes/hbyymmincr.pm
C4/Biblio.pm
C4/Bookseller.pm
C4/Branch.pm
C4/Breeding.pm
C4/Calendar.pm
C4/Circulation.pm
C4/Context.pm
C4/Creators/PDF.pm
C4/External/BakerTaylor.pm
C4/HoldsQueue.pm
C4/ILSDI/Services.pm
C4/Images.pm
C4/ImportBatch.pm
C4/ImportExportFramework.pm
C4/Installer.pm
C4/Installer/PerlDependencies.pm
C4/ItemCirculationAlertPreference.pm
C4/Items.pm
C4/Koha.pm
C4/Languages.pm
C4/Letters.pm
C4/Matcher.pm
C4/Message.pm
C4/Output.pm
C4/Overdues.pm
C4/Print.pm
C4/Reserves.pm
C4/SIP/ILS/Item.pm
C4/SIP/ILS/Patron.pm
C4/SIP/ILS/Transaction/Checkin.pm
C4/SIP/ILS/Transaction/Checkout.pm
C4/SIP/ILS/Transaction/FeePayment.pm
C4/SIP/ILS/Transaction/Hold.pm
C4/SIP/ILS/Transaction/Renew.pm
C4/SIP/ILS/Transaction/RenewAll.pm
C4/SQLHelper.pm
C4/Search.pm
C4/Serials.pm
C4/ShelfBrowser.pm
C4/Tags.pm
C4/Utils.pm
C4/VirtualShelves.pm
C4/VirtualShelves/Page.pm
C4/XSLT.pm
Koha/Borrower/Files.pm
Koha/Calendar.pm
Koha/DateUtils.pm
Koha/SuggestionEngine.pm
Koha/SuggestionEngine/Base.pm
Koha/SuggestionEngine/Plugin/AuthorityFile.pm
Koha/SuggestionEngine/Plugin/ExplodedTerms.pm [new file with mode: 0644]
Koha/SuggestionEngine/Plugin/Null.pm
Makefile.PL
about.pl
acqui/addorder.pl
acqui/addorderiso2709.pl
acqui/basket.pl
acqui/basketgroup.pl
acqui/basketheader.pl
acqui/finishreceive.pl
acqui/invoice.pl
acqui/lateorders.pl
acqui/neworderempty.pl
acqui/orderreceive.pl
acqui/parcel.pl
acqui/pdfformat/layout3pages.pm
acqui/supplier.pl
acqui/updatesupplier.pl
acqui/z3950_search.pl
admin/currency.pl
admin/didyoumean.pl [new file with mode: 0755]
admin/marc_subfields_structure.pl
admin/marctagstructure.pl
admin/matching-rules.pl
admin/preferences.pl
admin/smart-rules.pl
admin/systempreferences.pl
admin/z3950servers.pl
authorities/authorities-home.pl
authorities/authorities.pl
authorities/detail.pl
basket/basket.pl
catalogue/MARCdetail.pl
catalogue/detail.pl
catalogue/search.pl
catalogue/showmarc.pl
cataloguing/addbiblio.pl
cataloguing/additem.pl
cataloguing/merge.pl
cataloguing/merge_ajax.pl
cataloguing/value_builder/marc21_linking_section.pl
cataloguing/value_builder/stocknumberAV.pl [new file with mode: 0755]
cataloguing/z3950_search.pl
circ/circulation.pl
circ/pendingreserves.pl
circ/returns.pl
circ/waitingreserves.pl
debian/control
debian/docs/koha-common.xml
debian/docs/koha-foreach.xml
debian/docs/koha-run-backups.xml [new file with mode: 0644]
debian/rules
debian/scripts/koha-create
docs/history.txt
etc/koha-conf.xml
etc/zebradb/authorities/etc/bib1.att
etc/zebradb/etc/usmarc.mar
etc/zebradb/marc_defs/marc21/authorities/authority-koha-indexdefs.xml
etc/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl
etc/zebradb/marc_defs/marc21/authorities/record.abs
etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml
etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl
etc/zebradb/marc_defs/normarc/biblios/biblio-zebra-indexdefs.xml [new file with mode: 0644]
etc/zebradb/marc_defs/normarc/biblios/biblio-zebra-indexdefs.xsl [new file with mode: 0644]
etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml
etc/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl
etc/zebradb/retrieval-info-auth-dom.xml
etc/zebradb/retrieval-info-auth-grs1.xml
etc/zebradb/retrieval-info-bib-dom.xml
etc/zebradb/retrieval-info-bib-grs1.xml
etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl
help.pl
install_misc/debian.packages
install_misc/install_koha_on_fresh_debian
install_misc/ubuntu.10.04.packages
install_misc/ubuntu.10.10.packages
install_misc/ubuntu.12.04.packages
install_misc/ubuntu.packages
installer/data/mysql/atomicupdate/importauthorities.pl [new file with mode: 0755]
installer/data/mysql/de-DE/mandatory/sample_notices.sql
installer/data/mysql/de-DE/mandatory/userpermissions.sql
installer/data/mysql/de-DE/optional/auth_val.sql
installer/data/mysql/de-DE/optional/patron_atributes.sql [new file with mode: 0644]
installer/data/mysql/de-DE/optional/patron_atributes.txt [new file with mode: 0644]
installer/data/mysql/de-DE/optional/sample_z3950_servers.txt
installer/data/mysql/en/mandatory/message_transport_types.txt
installer/data/mysql/en/mandatory/sample_notices.txt
installer/data/mysql/en/mandatory/sample_notices_message_attributes.txt
installer/data/mysql/en/mandatory/sample_notices_message_transports.txt
installer/data/mysql/en/mandatory/subtag_registry.txt
installer/data/mysql/en/optional/auth_val.txt
installer/data/mysql/en/optional/marc21_holdings_coded_values.txt
installer/data/mysql/en/optional/marc21_relatorterms.txt
installer/data/mysql/en/optional/patron_categories.txt
installer/data/mysql/en/optional/sample_creator_data.txt
installer/data/mysql/en/optional/sample_holidays.sql
installer/data/mysql/en/optional/sample_holidays.txt
installer/data/mysql/en/optional/sample_itemtypes.txt
installer/data/mysql/en/optional/sample_libraries.txt
installer/data/mysql/en/optional/sample_news.txt
installer/data/mysql/en/optional/sample_quotes.txt
installer/data/mysql/en/optional/sample_z3950_servers.txt
installer/data/mysql/es-ES/optional/sample_z3950_servers.txt
installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_system_preferences.sql
installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql
installer/data/mysql/kohastructure.sql
installer/data/mysql/nb-NO/1-Obligatorisk/system_preferences.sql
installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql
installer/data/mysql/pl-PL/optional/sample_z3950_servers.txt
installer/data/mysql/sysprefs.sql
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.jstree.js [new file with mode: 0644]
koha-tmpl/intranet-tmpl/lib/jquery/plugins/themes/classic/d.gif [new file with mode: 0644]
koha-tmpl/intranet-tmpl/lib/jquery/plugins/themes/classic/d.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/lib/jquery/plugins/themes/classic/dot_for_ie.gif [new file with mode: 0644]
koha-tmpl/intranet-tmpl/lib/jquery/plugins/themes/classic/style.css [new file with mode: 0644]
koha-tmpl/intranet-tmpl/lib/jquery/plugins/themes/classic/throbber.gif [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/css/addbiblio.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/additem-menu.inc [deleted file]
koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc
koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc
koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search.inc
koha-tmpl/intranet-tmpl/prog/en/includes/authorities.inc [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc
koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc
koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc
koha-tmpl/intranet-tmpl/prog/en/includes/hold-menu.inc [deleted file]
koha-tmpl/intranet-tmpl/prog/en/includes/mainmenu.inc [deleted file]
koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc
koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc
koha-tmpl/intranet-tmpl/prog/en/includes/prefs-admin-search.inc
koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc
koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc
koha-tmpl/intranet-tmpl/prog/en/includes/serials-menu.inc
koha-tmpl/intranet-tmpl/prog/en/includes/serials-toolbar.inc
koha-tmpl/intranet-tmpl/prog/en/includes/subtypes_unimarc.inc
koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc
koha-tmpl/intranet-tmpl/prog/en/js/acq.js
koha-tmpl/intranet-tmpl/prog/en/js/basket.js
koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js
koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_flat_0_aaaaaa_40x100.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_flat_75_ffffff_40x100.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_glass_55_fbf9ee_1x400.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_glass_65_ffffff_1x400.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_glass_75_dadada_1x400.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_glass_75_e6e6e6_1x400.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_glass_95_fef1ec_1x400.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_highlight-soft_75_cccccc_1x100.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-icons_2e83ff_256x240.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-icons_888888_256x240.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-icons_cd0a0a_256x240.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/lib/jquery/jquery-ui.css
koha-tmpl/intranet-tmpl/prog/en/lib/jquery/jquery-ui.js
koha-tmpl/intranet-tmpl/prog/en/modules/about.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketheader.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_tag_structure.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/didyoumean.tt [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/admin/fieldmapping.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/matching-rules.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/authorities.pref
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/tools.pref [deleted file]
koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/transport-cost-matrix.tt
koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt
koha-tmpl/intranet-tmpl/prog/en/modules/authorities/blinddetail-biblio-search.tt
koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt
koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt
koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/showmarc.tt
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt
koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt
koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt
koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt
koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/about.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/acqcontract.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/acqui-home.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/addorderiso2709.tt [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/basket.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/basketgroup.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/basketheader.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/booksellers.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/histsearch.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/invoice.tt [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/invoices.tt [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/lateorders.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/neworderbiblio.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/neworderempty.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/newordersuggestion.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/orderreceive.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/parcel.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/parcels.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/supplier.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/uncertainprice.tt [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/z3950_search.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/admin-home.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/aqbudgetperiods.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/aqbudgets.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/aqplan.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/auth_subfields_structure.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/auth_tag_structure.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/authorised_values.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/authtypes.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/biblio_framework.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/branch_transfer_limits.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/branches.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/categorie.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/checkmarc.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/cities.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/classsources.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/currency.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/fieldmapping.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/item_circulation_alerts.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/itemtypes.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/koha2marclinks.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/marc_subfields_structure.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/marctagstructure.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/matching-rules.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/oai_set_mappings.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/oai_sets.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/patron-attr-types.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/preferences.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/roadtype.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/smart-rules.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/stopwords.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/transport-cost-matrix.tt [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/z3950servers.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/authorities/authorities-home.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/authorities/authorities.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/authorities/detail.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/catalogue/detail.tt [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/help/catalogue/issuehistory.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/catalogue/moredetail.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/catalogue/search.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/cataloguing/addbiblio.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/cataloguing/addbooks.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/cataloguing/additem.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/cataloguing/linkitem.tt [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/help/cataloguing/merge.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/cataloguing/moveitem.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/branchoverdues.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/branchtransfers.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/circulation-home.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/circulation.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/overdue.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/pendingreserves.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/reserveratios.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/returns.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/selectbranchprinter.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/transferstoreceive.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/view_holdsqueue.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/waitingreserves.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/labels/label-edit-batch.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/labels/label-edit-layout.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/labels/label-edit-profile.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/labels/label-edit-template.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/labels/label-home.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/labels/spinelabel-home.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/mainpage.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/boraccount.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/files.tt [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/mancredit.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/maninvoice.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/member-flags.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/member-password.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/member.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/memberentry.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/members-home.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/moremember.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/notices.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/pay.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/paycollect.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/readingrec.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/routing-lists.tt [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/statistics.tt [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/help/nohelp.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/offline_circ/list.tt [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/help/offline_circ/process_koc.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/patroncards/edit-batch.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/patroncards/edit-layout.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/patroncards/edit-profile.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/patroncards/edit-template.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/patroncards/home.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/patroncards/image-manage.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/patroncards/manage.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/reports/acquisitions_stats.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/reports/bor_issues_top.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/reports/borrowers_out.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/reports/borrowers_stats.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/reports/cat_issues_top.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/reports/catalogue_out.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/reports/catalogue_stats.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/reports/dictionary.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/reports/guided_reports.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/reports/issues_avg_stats.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/reports/issues_stats.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/reports/itemslost.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/reports/manager.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/reports/reports-home.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/reports/reserves_stats.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/reports/serials_stats.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/reserve/request.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/reviews/reviewswaiting.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/checkexpiration.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/claims.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/routing.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/serials-collection.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/serials-edit.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/serials-home.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/subscription-add.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/serials/subscription-detail.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/suggestion/suggestion.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/tags/review.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/batchMod.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/cleanborrowers.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/csv-profiles.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/export.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/holidays.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/import_borrowers.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/inventory.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/koha-news.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/letter.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/manage-marc-import.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/modborrowers.tt [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/overduerules.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/picture-upload.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/quotes-upload.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/quotes.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/scheduler.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/stage-marc-import.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/tools-home.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/upload-cover-image.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/viewlog.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/virtualshelves/shelves.tt
koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt
koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-print.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt
koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt
koha-tmpl/intranet-tmpl/prog/en/modules/reports/serials_stats.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serial-issues-full.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-recieve.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt
koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt
koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt
koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt
koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt
koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt
koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt
koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes.tt
koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt
koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt
koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2ATOM.xsl
koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2DC.xsl
koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2MODS.xsl
koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2OAIDC.xsl
koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2RDFDC.xsl
koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2RDFDC.xsl.1
koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2RSS2.xsl
koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl
koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl
koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim9522852.xsl
koha-tmpl/intranet-tmpl/prog/en/xslt/NORMARCslim2OAIDC.xsl
koha-tmpl/intranet-tmpl/prog/en/xslt/NORMARCslim2intranetDetail.xsl
koha-tmpl/intranet-tmpl/prog/en/xslt/NORMARCslim2intranetResults.xsl
koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARC_compact.xsl
koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2OAIDC.xsl
koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetDetail.xsl
koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetResults.xsl
koha-tmpl/intranet-tmpl/prog/en/xslt/oilsMARC21slim2HTML.xsl
koha-tmpl/intranet-tmpl/prog/img/famfamfam/GR.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/famfamfam/TD.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/article_b.gif [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/audiovisual_b.gif [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/binary_b.gif [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/book_b.gif [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/handwriting_b.gif [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/map_b.gif [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/periodical_b.gif [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/picture_b.gif [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/score_b.gif [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/sons_b.gif [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/sound_b.gif [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/thesis_b.gif [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/unknown_b.gif [new file with mode: 0644]
koha-tmpl/opac-tmpl/ccsr/en/css/opac.css
koha-tmpl/opac-tmpl/ccsr/en/css/sco.css
koha-tmpl/opac-tmpl/ccsr/en/includes/doc-head-close.inc
koha-tmpl/opac-tmpl/ccsr/en/js/basket.js
koha-tmpl/opac-tmpl/ccsr/en/js/tags.js
koha-tmpl/opac-tmpl/lib/famfamfam/GR.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/lib/famfamfam/PR.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/lib/famfamfam/TD.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/lib/jquery/plugins/jquery.jstree.js [new file with mode: 0644]
koha-tmpl/opac-tmpl/lib/jquery/plugins/themes/classic/d.gif [new file with mode: 0644]
koha-tmpl/opac-tmpl/lib/jquery/plugins/themes/classic/d.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/lib/jquery/plugins/themes/classic/dot_for_ie.gif [new file with mode: 0644]
koha-tmpl/opac-tmpl/lib/jquery/plugins/themes/classic/style.css [new file with mode: 0644]
koha-tmpl/opac-tmpl/lib/jquery/plugins/themes/classic/throbber.gif [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/en/css/opac.css
koha-tmpl/opac-tmpl/prog/en/includes/authorities-search-results.inc
koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc
koha-tmpl/opac-tmpl/prog/en/includes/item-status.inc
koha-tmpl/opac-tmpl/prog/en/includes/opac-authorities.inc [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc
koha-tmpl/opac-tmpl/prog/en/includes/page-numbers.inc
koha-tmpl/opac-tmpl/prog/en/includes/subtypes_unimarc.inc
koha-tmpl/opac-tmpl/prog/en/js/basket.js
koha-tmpl/opac-tmpl/prog/en/js/tags.js
koha-tmpl/opac-tmpl/prog/en/lib/jquery/jquery-ui.css
koha-tmpl/opac-tmpl/prog/en/lib/jquery/jquery-ui.js
koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-auth-MARCdetail.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-auth-detail.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-authorities-home.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-authoritiessearchresultlist.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-basket.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-downloadcart.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-downloadshelf.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-full-serial-issues.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-opensearch.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-passwd.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-results-grouped.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-review.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-showmarc.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-tags.tt
koha-tmpl/opac-tmpl/prog/en/modules/search/results.tt
koha-tmpl/opac-tmpl/prog/en/modules/text/explodedterms.tt [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl
koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACMARCdetail.xsl
koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl
koha-tmpl/opac-tmpl/prog/en/xslt/NORMARCslim2OPACDetail.xsl
koha-tmpl/opac-tmpl/prog/en/xslt/NORMARCslim2OPACResults.xsl
koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACDetail.xsl
koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACResults.xsl
koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslimUtils.xsl
koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/article_b.gif [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/audiovisual_b.gif [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/binary_b.gif [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/book_b.gif [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/handwriting_b.gif [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/map_b.gif [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/periodical_b.gif [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/picture_b.gif [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/score_b.gif [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/sons_b.gif [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/sound_b.gif [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/thesis_b.gif [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/unknown_b.gif [new file with mode: 0644]
kohaversion.pl
labels/label-edit-layout.pl
mainpage.pl
members/member.pl
members/members-home.pl
misc/batchdeletebiblios.pl [new file with mode: 0755]
misc/bin/koha-zebraqueue-ctl.sh [deleted file]
misc/bin/zebraqueue_daemon.pl [deleted file]
misc/commit_biblios_file.pl [deleted file]
misc/commit_file.pl [new file with mode: 0755]
misc/cronjobs/check-url-quick.pl [new file with mode: 0755]
misc/cronjobs/check-url.pl
misc/cronjobs/crontab.example
misc/cronjobs/import_webservice_batch.pl
misc/cronjobs/serialsUpdate.pl
misc/cronjobs/smsoverdues.pl [deleted file]
misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl
misc/cronjobs/zebraqueue_start.pl [deleted file]
misc/link_bibs_to_authorities.pl
misc/maintenance/UNIMARC_sync_date_created_with_marc_biblio.pl
misc/maintenance/fix_accountlines_rmdupfines_bug8253.pl [new file with mode: 0755]
misc/maintenance/fix_mysql_constraints.pl [new file with mode: 0755]
misc/migration_tools/rebuild_zebra.pl
misc/release_notes/release_notes_3_10_0.txt [new file with mode: 0644]
misc/stage_biblios_file.pl [deleted file]
misc/stage_file.pl [new file with mode: 0755]
misc/translator/LangInstaller.pm
opac/opac-ISBDdetail.pl
opac/opac-MARCdetail.pl
opac/opac-authorities-home.pl
opac/opac-authoritiesdetail.pl
opac/opac-detail.pl
opac/opac-export.pl
opac/opac-passwd.pl
opac/opac-reserve.pl
opac/opac-search.pl
opac/opac-showmarc.pl
opac/opac-tags.pl
opac/opac-user.pl
opac/opac-userupdate.pl
opac/svc/suggestion
reports/dictionary.pl
reports/guided_reports.pl
reports/serials_stats.pl
serials/checkexpiration.pl
serials/serials-collection.pl
serials/serials-edit.pl
serials/serials-search.pl
serials/subscription-detail.pl
svc/import_bib
t/00-load.t
t/Acquisition/Invoice.t [new file with mode: 0755]
t/AuthoritiesMarc.t [deleted file]
t/Cache_Memcached.t [deleted file]
t/Calendar.t
t/DateUtils.t
t/Makefile
t/SuggestionEngine.t
t/SuggestionEngine_AuthorityFile.t
t/db_dependent/Acquisition.t
t/db_dependent/AuthoritiesMarc.t [new file with mode: 0755]
t/db_dependent/Context.t
t/db_dependent/Holidays.t [new file with mode: 0755]
t/db_dependent/Reserves.t
t/db_dependent/SuggestionEngine_ExplodedTerms.t [new file with mode: 0755]
t/db_dependent/Tags.t
t/db_dependent/lib/KohaTest.pm
t/db_dependent/lib/KohaTest/Acquisition/GetParcel.pm
t/db_dependent/lib/KohaTest/Acquisition/GetParcels.pm
t/optional/Cache_Memcached.t [new file with mode: 0755]
tools/batchMod.pl
tools/exceptionHolidays.pl
tools/export.pl
tools/manage-marc-import.pl
tools/modborrowers.pl
tools/newHolidays.pl
tools/overduerules.pl
tools/picture-upload.pl
tools/quotes/quotes_ajax.pl
tools/stage-marc-import.pl

index f7adca1..5aa4fef 100644 (file)
@@ -243,13 +243,13 @@ borrower number.
 
 #'
 # FIXME - Okay, so what does the above actually _mean_?
-sub getnextacctno ($) {
-    my ($borrowernumber) = shift or return undef;
+sub getnextacctno {
+    my ($borrowernumber) = shift or return;
     my $sth = C4::Context->dbh->prepare(
         "SELECT accountno+1 FROM accountlines
-         WHERE    (borrowernumber = ?)
-         ORDER BY accountno DESC
-                LIMIT 1"
+            WHERE    (borrowernumber = ?)
+            ORDER BY accountno DESC
+            LIMIT 1"
     );
     $sth->execute($borrowernumber);
     return ($sth->fetchrow || 1);
@@ -760,7 +760,7 @@ sub makepartialpayment {
     .  'description, accounttype, amountoutstanding, itemnumber, manager_id) '
     . ' VALUES (?, ?, now(), ?, ?, ?, 0, ?, ?)';
 
-    $dbh->do(  $insert, undef, $borrowernumber, $nextaccntno, $amount,
+    $dbh->do(  $insert, undef, $borrowernumber, $nextaccntno, 0 - $amount,
         "Payment, thanks - $user", 'Pay', $data->{'itemnumber'}, $manager_id);
 
     UpdateStats( $user, 'payment', $amount, '', '', '', $borrowernumber, $accountno );
@@ -768,13 +768,13 @@ sub makepartialpayment {
     return;
 }
 
-=head2 WriteOff
+=head2 WriteOffFee
 
-  WriteOff( $borrowernumber, $accountnum, $itemnum, $accounttype, $amount, $branch );
+  WriteOff( $borrowernumber, $accountline_id, $itemnum, $accounttype, $amount, $branch );
 
 Write off a fine for a patron.
 C<$borrowernumber> is the patron's borrower number.
-C<$accountnum> is the accountnumber of the fee to write off.
+C<$accountline_id> is the accountline_id of the fee to write off.
 C<$itemnum> is the itemnumber of of item whose fine is being written off.
 C<$accounttype> is the account type of the fine being written off.
 C<$amount> is a floating-point number, giving the amount that is being written off.
@@ -783,7 +783,7 @@ C<$branch> is the branchcode of the library where the writeoff occurred.
 =cut
 
 sub WriteOffFee {
-    my ( $borrowernumber, $accountnum, $itemnum, $accounttype, $amount, $branch ) = @_;
+    my ( $borrowernumber, $accountline_id, $itemnum, $accounttype, $amount, $branch ) = @_;
     $branch ||= C4::Context->userenv->{branch};
     my $manager_id = 0;
     $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv;
@@ -796,10 +796,10 @@ sub WriteOffFee {
 
     $query = "
         UPDATE accountlines SET amountoutstanding = 0
-        WHERE accountno = ? AND borrowernumber = ?
+        WHERE accountlines_id = ? AND borrowernumber = ?
     ";
     $sth = $dbh->prepare( $query );
-    $sth->execute( $accountnum, $borrowernumber );
+    $sth->execute( $accountline_id, $borrowernumber );
 
     $query ="
         INSERT INTO accountlines
index 03a55cc..17330e5 100644 (file)
@@ -173,7 +173,7 @@ sub GetBasket {
 =head3 NewBasket
 
   $basket = &NewBasket( $booksellerid, $authorizedby, $basketname, 
-      $basketnote, $basketbooksellernote, $basketcontractnumber );
+      $basketnote, $basketbooksellernote, $basketcontractnumber, $deliveryplace, $billingplace );
 
 Create a new basket in aqbasket table
 
@@ -189,10 +189,8 @@ The other parameters are optional, see ModBasketHeader for more info on them.
 
 =cut
 
-# FIXME : this function seems to be unused.
-
 sub NewBasket {
-    my ( $booksellerid, $authorisedby, $basketname, $basketnote, $basketbooksellernote, $basketcontractnumber ) = @_;
+    my ( $booksellerid, $authorisedby, $basketname, $basketnote, $basketbooksellernote, $basketcontractnumber, $deliveryplace, $billingplace ) = @_;
     my $dbh = C4::Context->dbh;
     my $query = "
         INSERT INTO aqbasket
@@ -203,7 +201,7 @@ sub NewBasket {
     $dbh->do($query);
 #find & return basketno MYSQL dependant, but $dbh->last_insert_id always returns null :-(
     my $basket = $dbh->{'mysql_insertid'};
-    ModBasketHeader($basket, $basketname || '', $basketnote || '', $basketbooksellernote || '', $basketcontractnumber || undef, $booksellerid);
+    ModBasketHeader($basket, $basketname || '', $basketnote || '', $basketbooksellernote || '', $basketcontractnumber || undef, $booksellerid, $deliveryplace || undef, $billingplace || undef );
     return $basket;
 }
 
@@ -265,8 +263,8 @@ sub GetBasketAsCSV {
             notes => $order->{'notes'},
             quantity => $order->{'quantity'},
             rrp => $order->{'rrp'},
-            deliveryplace => $basket->{'deliveryplace'},
-            billingplace => $basket->{'billingplace'}
+            deliveryplace => C4::Branch::GetBranchName( $basket->{'deliveryplace'} ),
+            billingplace => C4::Branch::GetBranchName( $basket->{'billingplace'} ),
         };
         foreach(qw(
             contractname author title publishercode collectiontitle notes
@@ -315,6 +313,7 @@ sub GetBasketGroupAsCSV {
         my @orders     = GetOrders( $$basket{basketno} );
         my $contract   = GetContract( $$basket{contractnumber} );
         my $bookseller = GetBookSellerFromId( $$basket{booksellerid} );
+        my $basketgroup = GetBasketgroup( $$basket{basketgroupid} );
 
         foreach my $order (@orders) {
             my $bd = GetBiblioData( $order->{'biblionumber'} );
@@ -339,6 +338,10 @@ sub GetBasketGroupAsCSV {
                 booksellerpostal => $bookseller->{postal},
                 contractnumber => $contract->{contractnumber},
                 contractname => $contract->{contractname},
+                basketgroupdeliveryplace => C4::Branch::GetBranchName( $basketgroup->{deliveryplace} ),
+                basketgroupbillingplace => C4::Branch::GetBranchName( $basketgroup->{billingplace} ),
+                basketdeliveryplace => C4::Branch::GetBranchName( $basket->{deliveryplace} ),
+                basketbillingplace => C4::Branch::GetBranchName( $basket->{billingplace} ),
             };
             foreach(qw(
                 basketname author title publishercode collectiontitle notes
@@ -486,17 +489,25 @@ Modifies a basket's header.
 
 =item C<$booksellerid> is the id (foreign) key in the "aqbooksellers" table for the vendor.
 
+=item C<$deliveryplace> is the "deliveryplace" field in the aqbasket table.
+
+=item C<$billingplace> is the "billingplace" field in the aqbasket table.
+
 =back
 
 =cut
 
 sub ModBasketHeader {
-    my ($basketno, $basketname, $note, $booksellernote, $contractnumber, $booksellerid) = @_;
+    my ($basketno, $basketname, $note, $booksellernote, $contractnumber, $booksellerid, $deliveryplace, $billingplace) = @_;
+    my $query = qq{
+        UPDATE aqbasket
+        SET basketname=?, note=?, booksellernote=?, booksellerid=?, deliveryplace=?, billingplace=?
+        WHERE basketno=?
+    };
 
-    my $query = "UPDATE aqbasket SET basketname=?, note=?, booksellernote=?, booksellerid=? WHERE basketno=?";
     my $dbh = C4::Context->dbh;
     my $sth = $dbh->prepare($query);
-    $sth->execute($basketname,$note,$booksellernote,$booksellerid,$basketno);
+    $sth->execute($basketname, $note, $booksellernote, $booksellerid, $deliveryplace, $billingplace, $basketno);
 
     if ( $contractnumber ) {
         my $query2 ="UPDATE aqbasket SET contractnumber=? WHERE basketno=?";
@@ -1021,7 +1032,7 @@ Else, the upcoming July 1st is used.
 
 =item defaults entrydate to Now
 
-The following keys are used: "biblionumber", "title", "basketno", "quantity", "notes", "biblioitemnumber", "rrp", "ecost", "gst", "unitprice", "subscription", "sort1", "sort2", "booksellerinvoicenumber", "listprice", "budgetdate", "purchaseordernumber", "branchcode", "booksellerinvoicenumber", "bookfundid".
+The following keys are used: "biblionumber", "title", "basketno", "quantity", "notes", "biblioitemnumber", "rrp", "ecost", "gstrate", "unitprice", "subscription", "sort1", "sort2", "booksellerinvoicenumber", "listprice", "budgetdate", "purchaseordernumber", "branchcode", "booksellerinvoicenumber", "bookfundid".
 
 =back
 
@@ -1270,7 +1281,7 @@ C<$ordernumber>.
 
 sub ModReceiveOrder {
     my (
-        $biblionumber,    $ordernumber,  $quantrec, $user, $cost,
+        $biblionumber,    $ordernumber,  $quantrec, $user, $cost, $ecost,
         $invoiceid, $rrp, $budget_id, $datereceived, $received_items
     )
     = @_;
@@ -1306,6 +1317,7 @@ sub ModReceiveOrder {
         ");
 
         $sth->execute($order->{quantity} - $quantrec, $ordernumber);
+
         $sth->finish;
 
         delete $order->{'ordernumber'};
@@ -1315,6 +1327,7 @@ sub ModReceiveOrder {
         $order->{'invoiceid'} = $invoiceid;
         $order->{'unitprice'} = $cost;
         $order->{'rrp'} = $rrp;
+        $order->{ecost} = $ecost;
         $order->{'orderstatus'} = 3;    # totally received
         $new_ordernumber = NewOrder($order);
 
@@ -1326,9 +1339,9 @@ sub ModReceiveOrder {
     } else {
         $sth=$dbh->prepare("update aqorders
                             set quantityreceived=?,datereceived=?,invoiceid=?,
-                                unitprice=?,rrp=?
+                                unitprice=?,rrp=?,ecost=?
                             where biblionumber=? and ordernumber=?");
-        $sth->execute($quantrec,$datereceived,$invoiceid,$cost,$rrp,$biblionumber,$ordernumber);
+        $sth->execute($quantrec,$datereceived,$invoiceid,$cost,$rrp,$ecost,$biblionumber,$ordernumber);
         $sth->finish;
     }
     return ($datereceived, $new_ordernumber);
@@ -1598,6 +1611,7 @@ sub GetParcel {
                 aqorders.listprice,
                 aqorders.rrp,
                 aqorders.ecost,
+                aqorders.gstrate,
                 biblio.title
         FROM aqorders
         LEFT JOIN aqbasket ON aqbasket.basketno=aqorders.basketno
@@ -1781,8 +1795,8 @@ sub GetLateOrders {
     my $having = "";
     if ($dbdriver eq "mysql") {
         $select .= "
-        aqorders.quantity - IFNULL(aqorders.quantityreceived,0)                 AS quantity,
-        (aqorders.quantity - IFNULL(aqorders.quantityreceived,0)) * aqorders.rrp AS subtotal,
+        aqorders.quantity - COALESCE(aqorders.quantityreceived,0)                 AS quantity,
+        (aqorders.quantity - COALESCE(aqorders.quantityreceived,0)) * aqorders.rrp AS subtotal,
         DATEDIFF(CAST(now() AS date),closedate) AS latesince
         ";
         if ( defined $delay ) {
@@ -1814,16 +1828,19 @@ sub GetLateOrders {
         $from .= ' AND borrowers.branchcode LIKE ? ';
         push @query_params, $branch;
     }
+
+    if ( defined $estimateddeliverydatefrom or defined $estimateddeliverydateto ) {
+        $from .= ' AND aqbooksellers.deliverytime IS NOT NULL ';
+    }
     if ( defined $estimateddeliverydatefrom ) {
-        $from .= '
-            AND aqbooksellers.deliverytime IS NOT NULL
-            AND ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) >= ?';
+        $from .= ' AND ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) >= ?';
         push @query_params, $estimateddeliverydatefrom;
     }
-    if ( defined $estimateddeliverydatefrom and defined $estimateddeliverydateto ) {
+    if ( defined $estimateddeliverydateto ) {
         $from .= ' AND ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) <= ?';
         push @query_params, $estimateddeliverydateto;
-    } elsif ( defined $estimateddeliverydatefrom ) {
+    }
+    if ( defined $estimateddeliverydatefrom and not defined $estimateddeliverydateto ) {
         $from .= ' AND ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) <= CAST(now() AS date)';
     }
     if (C4::Context->preference("IndependantBranches")
@@ -2204,11 +2221,11 @@ sub GetInvoices {
     }
     if($args{shipmentdatefrom}) {
         push @bind_strs, " aqinvoices.shipementdate >= ? ";
-        push @bind_args, $args{shipementdatefrom};
+        push @bind_args, $args{shipmentdatefrom};
     }
     if($args{shipmentdateto}) {
         push @bind_strs, " aqinvoices.shipementdate <= ? ";
-        push @bind_args, $args{shipementdateto};
+        push @bind_args, $args{shipmentdateto};
     }
     if($args{billingdatefrom}) {
         push @bind_strs, " aqinvoices.billingdate >= ? ";
index d4ad292..705eda0 100644 (file)
@@ -18,7 +18,7 @@ package C4::Auth;
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 use strict;
-#use warnings; FIXME - Bug 2505
+use warnings;
 use Digest::MD5 qw(md5_base64);
 use Storable qw(thaw freeze);
 use URI::Escape;
@@ -129,6 +129,7 @@ my $SEARCH_HISTORY_INSERT_SQL =<<EOQ;
 INSERT INTO search_history(userid, sessionid, query_desc, query_cgi, total, time            )
 VALUES                    (     ?,         ?,          ?,         ?,          ?, FROM_UNIXTIME(?))
 EOQ
+
 sub get_template_and_user {
     my $in       = shift;
     my $template =
@@ -380,7 +381,7 @@ sub get_template_and_user {
         my $opac_search_limit = $ENV{'OPAC_SEARCH_LIMIT'};
         my $opac_limit_override = $ENV{'OPAC_LIMIT_OVERRIDE'};
         my $opac_name = '';
-        if (($opac_search_limit =~ /branch:(\w+)/ && $opac_limit_override) || $in->{'query'}->param('limit') =~ /branch:(\w+)/){
+        if (($opac_search_limit && $opac_search_limit =~ /branch:(\w+)/ && $opac_limit_override) || ($in->{'query'}->param('limit') && $in->{'query'}->param('limit') =~ /branch:(\w+)/)){
             $opac_name = $1;   # opac_search_limit is a branch, so we use it.
         } elsif (C4::Context->preference("SearchMyLibraryFirst") && C4::Context->userenv && C4::Context->userenv->{'branch'}) {
             $opac_name = C4::Context->userenv->{'branch'};
@@ -546,7 +547,7 @@ has authenticated.
 
 =cut
 
-sub _version_check ($$) {
+sub _version_check {
     my $type = shift;
     my $query = shift;
     my $version;
@@ -556,6 +557,7 @@ sub _version_check ($$) {
        if (C4::Context->preference('OpacMaintenance') && $type eq 'opac') {
         warn "OPAC Install required, redirecting to maintenance";
         print $query->redirect("/cgi-bin/koha/maintenance.pl");
+        safe_exit;
     }
     unless ( $version = C4::Context->preference('Version') ) {    # assignment, not comparison
         if ( $type ne 'opac' ) {
@@ -591,9 +593,18 @@ sub _version_check ($$) {
 
 sub _session_log {
     (@_) or return 0;
-    open L, ">>/tmp/sessionlog" or warn "ERROR: Cannot append to /tmp/sessionlog";
-    printf L join("\n",@_);
-    close L;
+    open my $fh, '>>', "/tmp/sessionlog" or warn "ERROR: Cannot append to /tmp/sessionlog";
+    printf $fh join("\n",@_);
+    close $fh;
+}
+
+sub _timeout_syspref {
+    my $timeout = C4::Context->preference('timeout') || 600;
+    # value in days, convert in seconds
+    if ($timeout =~ /(\d+)[dD]/) {
+        $timeout = $1 * 86400;
+    };
+    return $timeout;
 }
 
 sub checkauth {
@@ -606,12 +617,7 @@ sub checkauth {
     $type = 'opac' unless $type;
 
     my $dbh     = C4::Context->dbh;
-    my $timeout = C4::Context->preference('timeout');
-    # days
-    if ($timeout =~ /(\d+)[dD]/) {
-        $timeout = $1 * 86400;
-    };
-    $timeout = 600 unless $timeout;
+    my $timeout = _timeout_syspref();
 
     _version_check($type,$query);
     # state variables
@@ -652,7 +658,7 @@ sub checkauth {
             $ip       = $session->param('ip');
             $lasttime = $session->param('lasttime');
             $userid   = $session->param('id');
-                       $sessiontype = $session->param('sessiontype');
+            $sessiontype = $session->param('sessiontype') || '';
         }
         if ( ( ($query->param('koha_login_context')) && ($query->param('userid') ne $session->param('id')) )
           || ( $cas && $query->param('ticket') ) ) {
@@ -701,7 +707,7 @@ sub checkauth {
         else {
             $cookie = $query->cookie( CGISESSID => $session->id );
             $session->param('lasttime',time());
-            unless ( $sessiontype eq 'anon' ) { #if this is an anonymous session, we want to update the session, but not behave as if they are logged in...
+            unless ( $sessiontype && $sessiontype eq 'anon' ) { #if this is an anonymous session, we want to update the session, but not behave as if they are logged in...
                 $flags = haspermission($userid, $flagsrequired);
                 if ($flags) {
                     $loggedin = 1;
@@ -968,6 +974,7 @@ sub checkauth {
         intranetstylesheet => C4::Context->preference("intranetstylesheet"),
         intranetbookbag    => C4::Context->preference("intranetbookbag"),
         IntranetNav        => C4::Context->preference("IntranetNav"),
+        IntranetFavicon    => C4::Context->preference("IntranetFavicon"),
         intranetuserjs     => C4::Context->preference("intranetuserjs"),
         IndependantBranches=> C4::Context->preference("IndependantBranches"),
         AutoLocation       => C4::Context->preference("AutoLocation"),
@@ -1057,8 +1064,7 @@ sub check_api_auth {
     my $flagsrequired = shift;
 
     my $dbh     = C4::Context->dbh;
-    my $timeout = C4::Context->preference('timeout');
-    $timeout = 600 unless $timeout;
+    my $timeout = _timeout_syspref();
 
     unless (C4::Context->preference('Version')) {
         # database has not been installed yet
@@ -1290,8 +1296,7 @@ sub check_cookie_auth {
     my $flagsrequired = shift;
 
     my $dbh     = C4::Context->dbh;
-    my $timeout = C4::Context->preference('timeout');
-    $timeout = 600 unless $timeout;
+    my $timeout = _timeout_syspref();
 
     unless (C4::Context->preference('Version')) {
         # database has not been installed yet
@@ -1491,7 +1496,13 @@ sub getuserflags {
     my $userid  = shift;
     my $dbh     = @_ ? shift : C4::Context->dbh;
     my $userflags;
-    $flags = 0 unless $flags;
+    {
+        # I don't want to do this, but if someone logs in as the database
+        # user, it would be preferable not to spam them to death with
+        # numeric warnings. So, we make $flags numeric.
+        no warnings 'numeric';
+        $flags += 0;
+    }
     my $sth = $dbh->prepare("SELECT bit, flag, defaulton FROM userflags");
     $sth->execute;
 
index 0d00218..f3c1f7f 100644 (file)
@@ -47,7 +47,7 @@ BEGIN {
 # ~ then gets the LDAP entry
 # ~ and calls the memberadd if necessary
 
-sub ldapserver_error ($) {
+sub ldapserver_error {
        return sprintf('No ldapserver "%s" defined in KOHA_CONF: ' . $ENV{KOHA_CONF}, shift);
 }
 
@@ -70,8 +70,8 @@ my %config = (
        update => defined($ldap->{update}   ) ? $ldap->{update}    : 1,  # update from LDAP to Koha database for existing user
 );
 
-sub description ($) {
-       my $result = shift or return undef;
+sub description {
+       my $result = shift or return;
        return "LDAP error #" . $result->code
                        . ": " . $result->error_name . "\n"
                        . "# " . $result->error_text . "\n";
@@ -169,11 +169,13 @@ sub checkpw_ldap {
         return 0;   # B2, D2
     }
        if (C4::Context->preference('ExtendedPatronAttributes') && $borrowernumber && ($config{update} ||$config{replicate})) {
-               my @types = C4::Members::AttributeTypes::GetAttributeTypes();
-               my @attributes = grep{my $key=$_; any{$_ eq $key}@types;} keys %borrower;
         my $extended_patron_attributes;
-        @{$extended_patron_attributes} =
-          map { { code => $_, value => $borrower{$_} } } @attributes;
+        foreach my $attribute_type ( C4::Members::AttributeTypes::GetAttributeTypes() ) {
+                my $code = $attribute_type->{code};
+                if ( exists($borrower{$code}) && $borrower{$code} !~ m/^\s*$/ ) { # skip empty values
+                        push @$extended_patron_attributes, { code => $code, value => $borrower{$code} };
+                }
+        }
                my @errors;
                #Check before add
                for (my $i; $i< scalar(@$extended_patron_attributes)-1;$i++) {
@@ -197,7 +199,7 @@ return(1, $cardnumber, $userid);
 # Edit KOHA_CONF so $memberhash{'xxx'} fits your ldap structure.
 # Ensure that mandatory fields are correctly filled!
 #
-sub ldap_entry_2_hash ($$) {
+sub ldap_entry_2_hash {
        my $userldapentry = shift;
        my %borrower = ( cardnumber => shift );
        my %memberhash;
@@ -209,7 +211,7 @@ sub ldap_entry_2_hash ($$) {
                        hashdump("LDAP key: ",$userldapentry->{$_});
                }
        }
-       my $x = $userldapentry->{attrs} or return undef;
+       my $x = $userldapentry->{attrs} or return;
        foreach (keys %$x) {
                $memberhash{$_} = join ' ', @{$x->{$_}};        
                $debug and print STDERR sprintf("building \$memberhash{%s} = ", $_, join(' ', @{$x->{$_}})), "\n";
@@ -242,7 +244,7 @@ sub ldap_entry_2_hash ($$) {
        return %borrower;
 }
 
-sub exists_local($) {
+sub exists_local {
        my $arg = shift;
        my $dbh = C4::Context->dbh;
        my $select = "SELECT borrowernumber,cardnumber,userid,password FROM borrowers ";
@@ -271,16 +273,16 @@ sub _do_changepassword {
                my ($md5password, $cardnum) = $sth->fetchrow;
         ($digest eq $md5password) and return $cardnum;
                warn "Password mismatch after update to cardnumber=$cardnum (borrowernumber=$borrowerid)";
-               return undef;
+               return;
        }
        die "Unexpected error after password update to userid/borrowernumber: $userid / $borrowerid.";
 }
 
-sub update_local($$$$) {
-       my   $userid   = shift             or return undef;
-       my   $digest   = md5_base64(shift) or return undef;
-       my $borrowerid = shift             or return undef;
-       my $borrower   = shift             or return undef;
+sub update_local {
+       my   $userid   = shift             or return;
+       my   $digest   = md5_base64(shift) or return;
+       my $borrowerid = shift             or return;
+       my $borrower   = shift             or return;
        my @keys = keys %$borrower;
        my $dbh = C4::Context->dbh;
        my $query = "UPDATE  borrowers\nSET     " . 
index 79f3956..c8183c1 100644 (file)
@@ -53,8 +53,9 @@ BEGIN {
        &SearchAuthorities
     
         &BuildSummary
-       &BuildUnimarcHierarchies
-       &BuildUnimarcHierarchy
+        &BuildAuthHierarchies
+        &BuildAuthHierarchy
+        &GenerateHierarchy
     
        &merge
        &FindDuplicateAuthority
@@ -206,16 +207,18 @@ sub SearchAuthorities {
             # also store main entry MARC tag, to extract it at end of search
         my $mainentrytag;
         ##first set the authtype search and may be multiple authorities
-        my $n=0;
-        my @authtypecode;
-        my @auths=split / /,$authtypecode ;
-        foreach my  $auth (@auths){
-            $query .=" \@attr 1=authtype \@attr 5=100 ".$auth; ##No truncation on authtype
-            push @authtypecode ,$auth;
-            $n++;
-        }
-        if ($n>1){
-            while ($n>1){$query= "\@or ".$query;$n--;}
+        if ($authtypecode) {
+            my $n=0;
+            my @authtypecode;
+            my @auths=split / /,$authtypecode ;
+            foreach my  $auth (@auths){
+                $query .=" \@attr 1=authtype \@attr 5=100 ".$auth; ##No truncation on authtype
+                    push @authtypecode ,$auth;
+                $n++;
+            }
+            if ($n>1){
+                while ($n>1){$query= "\@or ".$query;$n--;}
+            }
         }
         
         my $dosearch;
@@ -356,9 +359,11 @@ sub SearchAuthorities {
                     }
                 }
                 my $thisauthtype = GetAuthType(GetAuthTypeCode($authid));
-                $newline{authtype}     = defined ($thisauthtype) ?
-                                            $thisauthtype->{'authtypetext'} :
-                                            (GetAuthType($authtypecode) ? $_->{'authtypetext'} : '');
+                unless (defined $thisauthtype) {
+                    $thisauthtype = GetAuthType($authtypecode) if $authtypecode;
+                }
+                $newline{authtype}     = defined($thisauthtype) ?
+                                            $thisauthtype->{'authtypetext'} : '';
                 $newline{summary}      = $summary;
                 $newline{even}         = $counter % 2;
                 $newline{reported_tag} = $reported_tag;
@@ -853,6 +858,7 @@ Returns MARC::Record of the authority passed in parameter.
 sub GetAuthority {
     my ($authid)=@_;
     my $authority = Koha::Authority->get_from_authid($authid);
+    return unless $authority;
     return ($authority->record);
 }
 
@@ -956,6 +962,11 @@ sub BuildSummary {
         'i' => 'subfi',
         't' => 'parent'
     );
+    my %unimarc_relation_from_code = (
+        g => 'broader',
+        h => 'narrower',
+        a => 'seealso',
+    );
     my %thesaurus;
     $thesaurus{'1'}="Peuples";
     $thesaurus{'2'}="Anthroponymes";
@@ -1020,39 +1031,28 @@ sub BuildSummary {
             my $thesaurus = $field->subfield('2') ? "thes. : ".$thesaurus{"$field->subfield('2')"}." : " : '';
             push @seefrom, { heading => $thesaurus . $field->as_string('abcdefghijlmnopqrstuvwxyz'), type => 'seefrom', field => $field->tag() };
         }
-# see :
-        foreach my $field ($record->field('5..')) {
-            if (($field->subfield('5')) && ($field->subfield('a')) && ($field->subfield('5') eq 'g')) {
-                push @seealso, {
-                    heading => $field->as_string('abcdefgjxyz'),
-                    type => 'broader',
-                    field => $field->tag(),
-                    search => $field->as_string('abcdefgjxyz'),
-                    authid => $field->subfield('9')
-                };
-            } elsif (($field->subfield('5')) && ($field->as_string) && ($field->subfield('5') eq 'h')){
-                push @seealso, {
-                    heading => $field->as_string('abcdefgjxyz'),
-                    type => 'narrower',
-                    field => $field->tag(),
-                    search => $field->as_string('abcdefgjxyz'),
-                    authid => $field->subfield('9')
-                };
-            } elsif ($field->subfield('a')) {
-                push @seealso, {
-                    heading => $field->as_string('abcdefgxyz'),
-                    type => 'seealso',
-                    field => $field->tag(),
-                    search => $field->as_string('abcdefgjxyz'),
-                    authid => $field->subfield('9')
-                };
+
+        # see :
+        @seealso = map {
+            my $type = $unimarc_relation_from_code{$_->subfield('5') || 'a'};
+            my $heading = $_->as_string('abcdefgjxyz');
+            {
+                field   => $_->tag,
+                type    => $type,
+                heading => $heading,
+                search  => $heading,
+                authid  => $_->subfield('9'),
             }
-        }
-# // form
-        foreach my $field ($record->field('7..')) {
-            my $lang = substr($field->subfield('8'),3,3);
-            push @otherscript, { lang => $lang, term => $field->subfield('a'), direction => 'ltr', field => $field->tag() };
-        }
+        } $record->field('5..');
+
+        # Other forms
+        @otherscript = map { {
+            lang      => $_->subfield('8') || '',
+            term      => $_->subfield('a'),
+            direction => 'ltr',
+            field     => $_->tag,
+        } } $record->field('7..');
+
     } else {
 # construct MARC21 summary
 # FIXME - looping over 1XX is questionable
@@ -1165,9 +1165,72 @@ sub BuildSummary {
     return \%summary;
 }
 
-=head2 BuildUnimarcHierarchies
+=head2 GetAuthorizedHeading
+
+  $heading = &GetAuthorizedHeading({ record => $record, authid => $authid })
+
+Takes a MARC::Record object describing an authority record or an authid, and
+returns a string representation of the first authorized heading. This routine
+should be considered a temporary shim to ease the future migration of authority
+data from C4::AuthoritiesMarc to the object-oriented Koha::*::Authority.
+
+=cut
+
+sub GetAuthorizedHeading {
+    my $args = shift;
+    my $record;
+    unless ($record = $args->{record}) {
+        return unless $args->{authid};
+        $record = GetAuthority($args->{authid});
+    }
+    if (C4::Context->preference('marcflavour') eq 'UNIMARC') {
+# construct UNIMARC summary, that is quite different from MARC21 one
+# accepted form
+        foreach my $field ($record->field('2..')) {
+            return $field->as_string('abcdefghijlmnopqrstuvwxyz');
+        }
+    } else {
+        foreach my $field ($record->field('1..')) {
+            my $tag = $field->tag();
+            next if "152" eq $tag;
+# FIXME - 152 is not a good tag to use
+# in MARC21 -- purely local tags really ought to be
+# 9XX
+            if ($tag eq '100') {
+                return $field->as_string('abcdefghjklmnopqrstvxyz68');
+            } elsif ($tag eq '110') {
+                return $field->as_string('abcdefghklmnoprstvxyz68');
+            } elsif ($tag eq '111') {
+                return $field->as_string('acdefghklnpqstvxyz68');
+            } elsif ($tag eq '130') {
+                return $field->as_string('adfghklmnoprstvxyz68');
+            } elsif ($tag eq '148') {
+                return $field->as_string('abvxyz68');
+            } elsif ($tag eq '150') {
+                return $field->as_string('abvxyz68');
+            } elsif ($tag eq '151') {
+                return $field->as_string('avxyz68');
+            } elsif ($tag eq '155') {
+                return $field->as_string('abvxyz68');
+            } elsif ($tag eq '180') {
+                return $field->as_string('vxyz68');
+            } elsif ($tag eq '181') {
+                return $field->as_string('vxyz68');
+            } elsif ($tag eq '182') {
+                return $field->as_string('vxyz68');
+            } elsif ($tag eq '185') {
+                return $field->as_string('vxyz68');
+            } else {
+                return $field->as_string();
+            }
+        }
+    }
+    return;
+}
+
+=head2 BuildAuthHierarchies
 
-  $text= &BuildUnimarcHierarchies( $authid, $force)
+  $text= &BuildAuthHierarchies( $authid, $force)
 
 return text containing trees for hierarchies
 for them to be stored in auth_header
@@ -1177,54 +1240,59 @@ Example of text:
 
 =cut
 
-sub BuildUnimarcHierarchies{
-  my $authid = shift @_;
+sub BuildAuthHierarchies{
+    my $authid = shift @_;
 #   warn "authid : $authid";
-  my $force = shift @_;
-  my @globalresult;
-  my $dbh=C4::Context->dbh;
-  my $hierarchies;
-  my $data = GetHeaderAuthority($authid);
-  if ($data->{'authtrees'} and not $force){
-    return $data->{'authtrees'};
+    my $force = shift @_ || (C4::Context->preference('marcflavour') eq 'UNIMARC' ? 0 : 1);
+    my @globalresult;
+    my $dbh=C4::Context->dbh;
+    my $hierarchies;
+    my $data = GetHeaderAuthority($authid);
+    if ($data->{'authtrees'} and not $force){
+        return $data->{'authtrees'};
 #  } elsif ($data->{'authtrees'}){
 #    $hierarchies=$data->{'authtrees'};
-  } else {
-    my $record = GetAuthority($authid);
-    my $found;
-    return unless $record;
-    foreach my $field ($record->field('5..')){
-      if ($field->subfield('5') && $field->subfield('5') eq 'g'){
-               my $subfauthid=_get_authid_subfield($field);
-        next if ($subfauthid eq $authid);
-        my $parentrecord = GetAuthority($subfauthid);
-        my $localresult=$hierarchies;
-        my $trees;
-        $trees = BuildUnimarcHierarchies($subfauthid);
-        my @trees;
-        if ($trees=~/;/){
-           @trees = split(/;/,$trees);
-        } else {
-           push @trees, $trees;
-        }
-        foreach (@trees){
-          $_.= ",$authid";
+    } else {
+        my $record = GetAuthority($authid);
+        my $found;
+        return unless $record;
+        foreach my $field ($record->field('5..')){
+            my $broader = 0;
+            $broader = 1 if (
+                    (C4::Context->preference('marcflavour') eq 'UNIMARC' && $field->subfield('5') && $field->subfield('5') eq 'g') ||
+                    (C4::Context->preference('marcflavour') ne 'UNIMARC' && $field->subfield('w') && substr($field->subfield('w'), 0, 1) eq 'g'));
+            if ($broader) {
+                my $subfauthid=_get_authid_subfield($field) || '';
+                next if ($subfauthid eq $authid);
+                my $parentrecord = GetAuthority($subfauthid);
+                next unless $parentrecord;
+                my $localresult=$hierarchies;
+                my $trees;
+                $trees = BuildAuthHierarchies($subfauthid);
+                my @trees;
+                if ($trees=~/;/){
+                    @trees = split(/;/,$trees);
+                } else {
+                    push @trees, $trees;
+                }
+                foreach (@trees){
+                    $_.= ",$authid";
+                }
+                @globalresult = (@globalresult,@trees);
+                $found=1;
+            }
+            $hierarchies=join(";",@globalresult);
         }
-        @globalresult = (@globalresult,@trees);
-        $found=1;
-      }
-      $hierarchies=join(";",@globalresult);
+#Unless there is no ancestor, I am alone.
+        $hierarchies="$authid" unless ($hierarchies);
     }
-    #Unless there is no ancestor, I am alone.
-    $hierarchies="$authid" unless ($hierarchies);
-  }
-  AddAuthorityTrees($authid,$hierarchies);
-  return $hierarchies;
+    AddAuthorityTrees($authid,$hierarchies);
+    return $hierarchies;
 }
 
-=head2 BuildUnimarcHierarchy
+=head2 BuildAuthHierarchy
 
-  $ref= &BuildUnimarcHierarchy( $record, $class,$authid)
+  $ref= &BuildAuthHierarchy( $record, $class,$authid)
 
 return a hashref in order to display hierarchy for record and final Authid $authid
 
@@ -1235,42 +1303,101 @@ return a hashref in order to display hierarchy for record and final Authid $auth
 "current_value"
 "value"
 
-"ifparents"  
-"ifchildren" 
-Those two latest ones should disappear soon.
+=cut
+
+sub BuildAuthHierarchy{
+    my $record = shift @_;
+    my $class = shift @_;
+    my $authid_constructed = shift @_;
+    return unless ($record && $record->field('001'));
+    my $authid=$record->field('001')->data();
+    my %cell;
+    my $parents=""; my $children="";
+    my (@loopparents,@loopchildren);
+    my $marcflavour = C4::Context->preference('marcflavour');
+    my $relationshipsf = $marcflavour eq 'UNIMARC' ? '5' : 'w';
+    foreach my $field ($record->field('5..')){
+        my $subfauthid=_get_authid_subfield($field);
+        if ($subfauthid && $field->subfield($relationshipsf) && $field->subfield('a')){
+            my $relationship = substr($field->subfield($relationshipsf), 0, 1);
+            if ($relationship eq 'h'){
+                push @loopchildren, { "authid"=>$subfauthid,"value"=>$field->subfield('a')};
+            }
+            elsif ($relationship eq 'g'){
+                push @loopparents, { "authid"=>$subfauthid,"value"=>$field->subfield('a')};
+            }
+# brothers could get in there with an else
+        }
+    }
+    $cell{"parents"}=\@loopparents;
+    $cell{"children"}=\@loopchildren;
+    $cell{"class"}=$class;
+    $cell{"authid"}=$authid;
+    $cell{"current_value"} =1 if ($authid eq $authid_constructed);
+    $cell{"value"}=C4::Context->preference('marcflavour') eq 'UNIMARC' ? $record->subfield('2..',"a") : $record->subfield('1..', 'a');
+    return \%cell;
+}
+
+=head2 BuildAuthHierarchyBranch
+
+  $branch = &BuildAuthHierarchyBranch( $tree, $authid[, $cnt])
+
+Return a data structure representing an authority hierarchy
+given a list of authorities representing a single branch in
+an authority hierarchy tree. $authid is the current node in
+the tree (which may or may not be somewhere in the middle).
+$cnt represents the level of the upper-most item, and is only
+used when BuildAuthHierarchyBranch is called recursively (i.e.,
+don't ever pass in anything but zero to it).
 
 =cut
 
-sub BuildUnimarcHierarchy{
-  my $record = shift @_;
-  my $class = shift @_;
-  my $authid_constructed = shift @_;
-  return undef unless ($record);
-  my $authid=$record->field('001')->data();
-  my %cell;
-  my $parents=""; my $children="";
-  my (@loopparents,@loopchildren);
-  foreach my $field ($record->field('5..')){
-      my $subfauthid=_get_authid_subfield($field);
-      if ($subfauthid && $field->subfield('5') && $field->subfield('a')){
-          if ($field->subfield('5') eq 'h'){
-              push @loopchildren, { "childauthid"=>$field->subfield('3'),"childvalue"=>$field->subfield('a')};
-         }
-         elsif ($field->subfield('5') eq 'g'){
-             push @loopparents, { "parentauthid"=>$field->subfield('3'),"parentvalue"=>$field->subfield('a')};
-         }
-          # brothers could get in there with an else
-      }
-  }
-  $cell{"ifparents"}=1 if (scalar(@loopparents)>0);
-  $cell{"ifchildren"}=1 if (scalar(@loopchildren)>0);
-  $cell{"loopparents"}=\@loopparents if (scalar(@loopparents)>0);
-  $cell{"loopchildren"}=\@loopchildren if (scalar(@loopchildren)>0);
-  $cell{"class"}=$class;
-  $cell{"loopauthid"}=$authid;
-  $cell{"current_value"} =1 if $authid eq $authid_constructed;
-  $cell{"value"}=$record->subfield('2..',"a");
-  return \%cell;
+sub BuildAuthHierarchyBranch {
+    my ($tree, $authid, $cnt) = @_;
+    $cnt |= 0;
+    my $elementdata = GetAuthority(shift @$tree);
+    my $branch = BuildAuthHierarchy($elementdata,"child".$cnt, $authid);
+    if (scalar @$tree > 0) {
+        my $nextBranch = BuildAuthHierarchyBranch($tree, $authid, ++$cnt);
+        my $nextAuthid = $nextBranch->{authid};
+        my $found;
+        # If we already have the next branch listed as a child, let's
+        # replace the old listing with the new one. If not, we will add
+        # the branch at the end.
+        foreach my $cell (@{$branch->{children}}) {
+            if ($cell->{authid} eq $nextAuthid) {
+                $cell = $nextBranch;
+                $found = 1;
+                last;
+            }
+        }
+        push @{$branch->{children}}, $nextBranch unless $found;
+    }
+    return $branch;
+}
+
+=head2 GenerateHierarchy
+
+  $hierarchy = &GenerateHierarchy($authid);
+
+Return an arrayref holding one or more "trees" representing
+authority hierarchies.
+
+=cut
+
+sub GenerateHierarchy {
+    my ($authid) = @_;
+    my $trees    = BuildAuthHierarchies($authid);
+    my @trees    = split /;/,$trees ;
+    push @trees,$trees unless (@trees);
+    my @loophierarchies;
+    foreach my $tree (@trees){
+        my @tree=split /,/,$tree;
+        push @tree, $tree unless (@tree);
+        my $branch = BuildAuthHierarchyBranch(\@tree, $authid);
+        push @loophierarchies, [ $branch ];
+    }
+    return \@loophierarchies;
 }
 
 sub _get_authid_subfield{
index efea3f5..6830565 100644 (file)
@@ -231,7 +231,7 @@ if the job status is not 'completed'.
 
 sub results {
     my $self = shift;
-    return undef unless $self->{'status'} eq 'completed';
+    return unless $self->{'status'} eq 'completed';
     return $self->{'results'};
 }
 
@@ -253,7 +253,7 @@ sub fetch {
     my $session = get_session($sessionID);
     my $prefix = "job_$jobID";
     unless (defined $session->param($prefix)) {
-        return undef;
+        return;
     }
     my $self = $session->param($prefix);
     bless $self, $class;
index 2e81da6..b08d660 100644 (file)
@@ -55,7 +55,7 @@ sub initial {
        return '0000001';
 }
 sub width {
-       return undef;
+       return;
 }
 sub process_head {     # (self,head,whole,specific)
        my $self = shift;
@@ -129,7 +129,7 @@ sub next_value {
        my ($head,$incr,$tail) = $self->parse($max);    # for incremental, you'd get ('',the_whole_barcode,'')
        unless (defined $incr) {
                warn "No incrementing part of barcode ($max) returned by parse.";
-               return undef;
+               return;
        }
        my $x = length($incr);          # number of digits
        $incr =~ /^9+$/ and $x++;       # if they're all 9's, we need an extra.
@@ -145,17 +145,17 @@ sub next_value {
        return $next_value;
 }
 sub next {
-       my $self = shift or return undef;
+       my $self = shift or return;
        (@_) and $self->{next} = shift;
        return $self->{next};
 }
 sub previous {
-       my $self = shift or return undef;
+       my $self = shift or return;
        (@_) and $self->{previous} = shift;
        return $self->{previous};
 }
 sub serial {
-       my $self = shift or return undef;
+       my $self = shift or return;
        (@_) and $self->{serial} = shift;
        return $self->{serial};
 }
@@ -192,11 +192,11 @@ sub new {
        $autoBarcodeType =~ s/^.*:://;  # in case we get C4::Barcodes::incremental, we just want 'incremental'
        unless ($autoBarcodeType) {
                carp "No autoBarcode format found.";
-               return undef;
+               return;
        }
        unless (defined $types->{$autoBarcodeType}) {
                carp "The autoBarcode format '$autoBarcodeType' is unrecognized.";
-               return undef;
+               return;
        }
        carp "autoBarcode format = $autoBarcodeType" if $debug;
        my $self;
@@ -227,7 +227,7 @@ sub new {
                return $self;
        }
        carp "Failed new C4::Barcodes::$autoBarcodeType";
-       return undef;
+       return;
 }
 
 sub new_object {
index ca3149f..258a1a5 100644 (file)
@@ -42,7 +42,7 @@ INIT {
 # Generates barcode where hb = home branch Code, yymm = year/month catalogued, incr = incremental number,
 #      increment resets yearly -fbcit
 
-sub db_max ($;$) {
+sub db_max {
        my $self = shift;
        my $query = "SELECT MAX(SUBSTRING(barcode,-$width)), barcode FROM items WHERE barcode REGEXP ? GROUP BY barcode";
        $debug and print STDERR "(hbyymmincr) db_max query: $query\n";
@@ -71,14 +71,14 @@ sub db_max ($;$) {
        return ($max || 0);
 }
 
-sub initial () {
+sub initial {
        my $self = shift;
        # FIXME: populated branch?
        my $iso = C4::Dates->new->output('iso');        # like "2008-07-02"
        return $self->branch . substr($iso,2,2) . substr($iso,5,2) . sprintf('%' . "$width.$width" . 'd',1);
 }
 
-sub parse ($;$) {   # return 3 parts of barcode: non-incrementing, incrementing, non-incrementing
+sub parse {   # return 3 parts of barcode: non-incrementing, incrementing, non-incrementing
        my $self = shift;
        my $barcode = (@_) ? shift : $self->value;
        my $branch = $self->branch;
@@ -90,17 +90,17 @@ sub parse ($;$) {   # return 3 parts of barcode: non-incrementing, incrementing,
        return ($1,$2,'');  # the third part is in anticipation of barcodes that include checkdigits
 }
 
-sub branch ($;$) {
+sub branch {
        my $self = shift;
        (@_) and $self->{branch} = shift;
        return $self->{branch};
 }
-sub width ($;$) {
+sub width {
        my $self = shift;
        (@_) and $width = shift;        # hitting the class variable.
        return $width;
 }
-sub process_head($$;$$) {      # (self,head,whole,specific)
+sub process_head {     # (self,head,whole,specific)
        my ($self,$head,$whole,$specific) = @_;
        $specific and return $head;     # if this is built off an existing barcode, just return the head unchanged.
        $head =~ s/\d{4}$//;            # else strip the old yymm
index ab4cc36..832da69 100644 (file)
@@ -28,6 +28,7 @@ use MARC::Record;
 use MARC::File::USMARC;
 use MARC::File::XML;
 use POSIX qw(strftime);
+use Module::Load::Conditional qw(can_load);
 
 use C4::Koha;
 use C4::Dates qw/format_date/;
@@ -491,13 +492,11 @@ sub BiblioAutoLink {
 
     my $linker_module =
       "C4::Linker::" . ( C4::Context->preference("LinkerModule") || 'Default' );
-    eval { eval "require $linker_module"; };
-    if ($@) {
+    unless ( can_load( modules => { $linker_module => undef } ) ) {
         $linker_module = 'C4::Linker::Default';
-        eval "require $linker_module";
-    }
-    if ($@) {
-        return 0, 0;
+        unless ( can_load( modules => { $linker_module => undef } ) ) {
+            return 0, 0;
+        }
     }
 
     my $linker = $linker_module->new(
@@ -568,21 +567,27 @@ sub LinkBibHeadingsToAuthorities {
                 $results{'fuzzy'}->{ $heading->display_form() }++;
             }
             elsif ( C4::Context->preference('AutoCreateAuthorities') ) {
-                my $authtypedata =
-                  C4::AuthoritiesMarc::GetAuthType( $heading->auth_type() );
-                my $marcrecordauth = MARC::Record->new();
-                if ( C4::Context->preference('marcflavour') eq 'MARC21' ) {
-                    $marcrecordauth->leader('     nz  a22     o  4500');
-                    SetMarcUnicodeFlag( $marcrecordauth, 'MARC21' );
+                if ( _check_valid_auth_link( $current_link, $field ) ) {
+                    $results{'linked'}->{ $heading->display_form() }++;
                 }
-                my $authfield =
-                  MARC::Field->new( $authtypedata->{auth_tag_to_report},
-                    '', '', "a" => "" . $field->subfield('a') );
-                map {
-                    $authfield->add_subfields( $_->[0] => $_->[1] )
-                      if ( $_->[0] =~ /[A-z]/ && $_->[0] ne "a" )
-                } $field->subfields();
-                $marcrecordauth->insert_fields_ordered($authfield);
+                else {
+                    my $authtypedata =
+                      C4::AuthoritiesMarc::GetAuthType( $heading->auth_type() );
+                    my $marcrecordauth = MARC::Record->new();
+                    if ( C4::Context->preference('marcflavour') eq 'MARC21' ) {
+                        $marcrecordauth->leader('     nz  a22     o  4500');
+                        SetMarcUnicodeFlag( $marcrecordauth, 'MARC21' );
+                    }
+                    $field->delete_subfield( code => '9' )
+                      if defined $current_link;
+                    my $authfield =
+                      MARC::Field->new( $authtypedata->{auth_tag_to_report},
+                        '', '', "a" => "" . $field->subfield('a') );
+                    map {
+                        $authfield->add_subfields( $_->[0] => $_->[1] )
+                          if ( $_->[0] =~ /[A-z]/ && $_->[0] ne "a" )
+                    } $field->subfields();
+                    $marcrecordauth->insert_fields_ordered($authfield);
 
 # bug 2317: ensure new authority knows it's using UTF-8; currently
 # only need to do this for MARC21, as MARC::Record->as_xml_record() handles
@@ -591,41 +596,47 @@ sub LinkBibHeadingsToAuthorities {
 # use UTF-8, but as of 2008-08-05, did not want to introduce that kind
 # of change to a core API just before the 3.0 release.
 
-                if ( C4::Context->preference('marcflavour') eq 'MARC21' ) {
-                    $marcrecordauth->insert_fields_ordered(
-                        MARC::Field->new(
-                            '667', '', '',
-                            'a' => "Machine generated authority record."
-                        )
-                    );
-                    my $cite =
-                        $bib->author() . ", "
-                      . $bib->title_proper() . ", "
-                      . $bib->publication_date() . " ";
-                    $cite =~ s/^[\s\,]*//;
-                    $cite =~ s/[\s\,]*$//;
-                    $cite =
-                        "Work cat.: ("
-                      . C4::Context->preference('MARCOrgCode') . ")"
-                      . $bib->subfield( '999', 'c' ) . ": "
-                      . $cite;
-                    $marcrecordauth->insert_fields_ordered(
-                        MARC::Field->new( '670', '', '', 'a' => $cite ) );
-                }
+                    if ( C4::Context->preference('marcflavour') eq 'MARC21' ) {
+                        $marcrecordauth->insert_fields_ordered(
+                            MARC::Field->new(
+                                '667', '', '',
+                                'a' => "Machine generated authority record."
+                            )
+                        );
+                        my $cite =
+                            $bib->author() . ", "
+                          . $bib->title_proper() . ", "
+                          . $bib->publication_date() . " ";
+                        $cite =~ s/^[\s\,]*//;
+                        $cite =~ s/[\s\,]*$//;
+                        $cite =
+                            "Work cat.: ("
+                          . C4::Context->preference('MARCOrgCode') . ")"
+                          . $bib->subfield( '999', 'c' ) . ": "
+                          . $cite;
+                        $marcrecordauth->insert_fields_ordered(
+                            MARC::Field->new( '670', '', '', 'a' => $cite ) );
+                    }
 
            #          warn "AUTH RECORD ADDED : ".$marcrecordauth->as_formatted;
 
-                $authid =
-                  C4::AuthoritiesMarc::AddAuthority( $marcrecordauth, '',
-                    $heading->auth_type() );
-                $field->add_subfields( '9', $authid );
-                $num_headings_changed++;
-                $results{'added'}->{ $heading->display_form() }++;
+                    $authid =
+                      C4::AuthoritiesMarc::AddAuthority( $marcrecordauth, '',
+                        $heading->auth_type() );
+                    $field->add_subfields( '9', $authid );
+                    $num_headings_changed++;
+                    $results{'added'}->{ $heading->display_form() }++;
+                }
             }
             elsif ( defined $current_link ) {
-                $field->delete_subfield( code => '9' );
-                $num_headings_changed++;
-                $results{'unlinked'}->{ $heading->display_form() }++;
+                if ( _check_valid_auth_link( $current_link, $field ) ) {
+                    $results{'linked'}->{ $heading->display_form() }++;
+                }
+                else {
+                    $field->delete_subfield( code => '9' );
+                    $num_headings_changed++;
+                    $results{'unlinked'}->{ $heading->display_form() }++;
+                }
             }
             else {
                 $results{'unlinked'}->{ $heading->display_form() }++;
@@ -636,6 +647,30 @@ sub LinkBibHeadingsToAuthorities {
     return $num_headings_changed, \%results;
 }
 
+=head2 _check_valid_auth_link
+
+    if ( _check_valid_auth_link($authid, $field) ) {
+        ...
+    }
+
+Check whether the specified heading-auth link is valid without reference
+to Zebra/Solr. Ideally this code would be in C4::Heading, but that won't be
+possible until we have de-cycled C4::AuthoritiesMarc, so this is the
+safest place.
+
+=cut
+
+sub _check_valid_auth_link {
+    my ( $authid, $field ) = @_;
+
+    require C4::AuthoritiesMarc;
+
+    my $authorized_heading =
+      C4::AuthoritiesMarc::GetAuthorizedHeading( { 'authid' => $authid } );
+
+   return ($field->as_string('abcdefghijklmnopqrstuvwxyz') eq $authorized_heading);
+}
+
 =head2 GetRecordValue
 
   my $values = GetRecordValue($field, $record, $frameworkcode);
@@ -890,7 +925,7 @@ Return the ISBD view which can be included in opac and intranet
 sub GetISBDView {
     my ( $biblionumber, $template ) = @_;
     my $record   = GetMarcBiblio($biblionumber, 1);
-    return undef unless defined $record;
+    return unless defined $record;
     my $itemtype = &GetFrameworkCode($biblionumber);
     my ( $holdingbrtagf, $holdingbrtagsubf ) = &GetMarcFromKohaField( "items.holdingbranch", $itemtype );
     my $tagslib = &GetMarcStructure( 1, $itemtype );
@@ -1145,7 +1180,7 @@ C<$frameworkcode> is the framework code.
 
 =cut
 
-sub GetUsedMarcStructure($) {
+sub GetUsedMarcStructure {
     my $frameworkcode = shift || '';
     my $query = qq/
         SELECT *
@@ -1164,13 +1199,14 @@ sub GetUsedMarcStructure($) {
   ($MARCfield,$MARCsubfield)=GetMarcFromKohaField($kohafield,$frameworkcode);
 
 Returns the MARC fields & subfields mapped to the koha field 
-for the given frameworkcode
+for the given frameworkcode or default framework if $frameworkcode is missing
 
 =cut
 
 sub GetMarcFromKohaField {
-    my ( $kohafield, $frameworkcode ) = @_;
-    return (0, undef) unless $kohafield and defined $frameworkcode;
+    my $kohafield = shift;
+    my $frameworkcode = shift || '';
+    return (0, undef) unless $kohafield;
     my $relations = C4::Context->marcfromkohafield;
     if ( my $mf = $relations->{$frameworkcode}->{$kohafield} ) {
         return @$mf;
@@ -1210,7 +1246,7 @@ sub GetMarcBiblio {
 
         return $record;
     } else {
-        return undef;
+        return;
     }
 }
 
@@ -2805,6 +2841,8 @@ sub EmbedItemsInMarcBiblio {
     my ($marc, $biblionumber, $itemnumbers) = @_;
     croak "No MARC record" unless $marc;
 
+    $itemnumbers = [] unless defined $itemnumbers;
+
     my $frameworkcode = GetFrameworkCode($biblionumber);
     _strip_item_fields($marc, $frameworkcode);
 
@@ -2815,7 +2853,7 @@ sub EmbedItemsInMarcBiblio {
     my @item_fields;
     my ( $itemtag, $itemsubfield ) = GetMarcFromKohaField( "items.itemnumber", $frameworkcode );
     while (my ($itemnumber) = $sth->fetchrow_array) {
-        next if $itemnumbers and not grep { $_ == $itemnumber } @$itemnumbers;
+        next if @$itemnumbers and not grep { $_ == $itemnumber } @$itemnumbers;
         require C4::Items;
         my $item_marc = C4::Items::GetMarcItem($biblionumber, $itemnumber);
         push @item_fields, $item_marc->field($itemtag);
@@ -3458,7 +3496,7 @@ sub _koha_delete_biblio {
         $sth2->finish;
     }
     $sth->finish;
-    return undef;
+    return;
 }
 
 =head2 _koha_delete_biblioitems
@@ -3507,7 +3545,7 @@ sub _koha_delete_biblioitems {
         $sth2->finish;
     }
     $sth->finish;
-    return undef;
+    return;
 }
 
 =head1 UNEXPORTED FUNCTIONS
index 5874a93..c8389a3 100644 (file)
@@ -125,7 +125,7 @@ sub GetBooksellersWithLateOrders {
             )
             AND aqorders.rrp <> 0
             AND aqorders.ecost <> 0
-            AND aqorders.quantity - IFNULL(aqorders.quantityreceived,0) <> 0
+            AND aqorders.quantity - COALESCE(aqorders.quantityreceived,0) <> 0
             AND aqbasket.closedate IS NOT NULL
     ";
     if ( defined $delay ) {
index dcd4ef7..d765c99 100644 (file)
@@ -155,7 +155,7 @@ sub mybranch {
     return C4::Context->userenv->{branch} || '';
 }
 
-sub GetBranchesLoop (;$$) {  # since this is what most pages want anyway
+sub GetBranchesLoop {  # since this is what most pages want anyway
     my $branch   = @_ ? shift : mybranch();     # optional first argument is branchcode of "my branch", if preselection is wanted.
     my $onlymine = @_ ? shift : onlymine();
     my $branches = GetBranches($onlymine);
@@ -373,7 +373,7 @@ the categories were already here, and minimally used.
 =cut
 
        #TODO  manage category types.  rename possibly to 'agency domains' ? as borrowergroups are called categories.
-sub GetCategoryTypes() {
+sub GetCategoryTypes {
        return ( 'searchdomain','properties');
 }
 
@@ -383,7 +383,7 @@ $branch = GetBranch( $query, $branches );
 
 =cut
 
-sub GetBranch ($$) {
+sub GetBranch {
     my ( $query, $branches ) = @_;    # get branch for this query from branches
     my $branch = $query->param('branch');
     my %cookie = $query->cookie('userenv');
@@ -416,7 +416,7 @@ Returns a href:  keys %$branches eq (branchcode,branchname) .
 
 =cut
 
-sub GetBranchesInCategory($) {
+sub GetBranchesInCategory {
     my ($categorycode) = @_;
        my @branches;
        my $dbh = C4::Context->dbh();
index 19bb7e2..9dedc4d 100644 (file)
@@ -94,6 +94,9 @@ sub ImportBreeding {
         ($marcrecord, $charset_result, $charset_errors) = 
             MarcToUTF8Record($marcarray[$i]."\x1D", C4::Context->preference("marcflavour"), $encoding);
         
+        # Normalize the record so it doesn't have separated diacritics
+        SetUTF8Flag($marcrecord);
+
 #         warn "$i : $marcarray[$i]";
         # FIXME - currently this does nothing 
         my @warnings = $marcrecord->warnings();
@@ -179,16 +182,16 @@ sub BreedingSearch {
         $query .= "z3950random = ?";
         @bind=($z3950random);
     } else {
-        $search =~ s/(\s+)/\%/g;
         @bind=();
-    if ($search) {
+        if (defined($search) && length($search)>0) {
+            $search =~ s/(\s+)/\%/g;
             $query .= "title like ? OR author like ?";
             push(@bind,"%$search%", "%$search%");
         }
-        if ($search && $isbn) {
+        if ($#bind!=-1 && defined($isbn) && length($isbn)>0) {
             $query .= " and ";
         }
-        if ($isbn) {
+        if (defined($isbn) && length($isbn)>0) {
             $query .= "isbn like ?";
             push(@bind,"$isbn%");
         }
index a9d39dc..1e687db 100644 (file)
@@ -514,6 +514,78 @@ sub delete_holiday {
     }
     return $self;
 }
+=head2 delete_holiday_range
+
+    delete_holiday_range(day => $day,
+                   month => $month,
+                   year => $year);
+
+Delete a holiday range of dates for $self->{branchcode}.
+
+C<$day> Is the day month to make the date to delete.
+
+C<$month> Is month to make the date to delete.
+
+C<$year> Is year to make the date to delete.
+
+=cut
+
+sub delete_holiday_range {
+    my $self = shift;
+    my %options = @_;
+
+    my $dbh = C4::Context->dbh();
+    my $sth = $dbh->prepare("DELETE FROM special_holidays WHERE (branchcode = ?) AND (day = ?) AND (month = ?) AND (year = ?)");
+    $sth->execute($self->{branchcode}, $options{day}, $options{month}, $options{year});
+}
+
+=head2 delete_holiday_range_repeatable
+
+    delete_holiday_range_repeatable(day => $day,
+                   month => $month);
+
+Delete a holiday for $self->{branchcode}.
+
+C<$day> Is the day month to make the date to delete.
+
+C<$month> Is month to make the date to delete.
+
+=cut
+
+sub delete_holiday_range_repeatable {
+    my $self = shift;
+    my %options = @_;
+
+    my $dbh = C4::Context->dbh();
+    my $sth = $dbh->prepare("DELETE FROM repeatable_holidays WHERE (branchcode = ?) AND (day = ?) AND (month = ?)");
+    $sth->execute($self->{branchcode}, $options{day}, $options{month});
+}
+
+=head2 delete_exception_holiday_range
+
+    delete_exception_holiday_range(weekday => $weekday
+                   day => $day,
+                   month => $month,
+                   year => $year);
+
+Delete a holiday for $self->{branchcode}.
+
+C<$day> Is the day month to make the date to delete.
+
+C<$month> Is month to make the date to delete.
+
+C<$year> Is year to make the date to delete.
+
+=cut
+
+sub delete_exception_holiday_range {
+    my $self = shift;
+    my %options = @_;
+
+    my $dbh = C4::Context->dbh();
+    my $sth = $dbh->prepare("DELETE FROM special_holidays WHERE (branchcode = ?) AND (isexception = 1) AND (day = ?) AND (month = ?) AND (year = ?)");
+    $sth->execute($self->{branchcode}, $options{day}, $options{month}, $options{year});
+}
 
 =head2 isHoliday
 
index 8f60d80..afe7a6a 100644 (file)
@@ -1174,7 +1174,7 @@ sub AddIssue {
     }
        if ($borrower and $barcode and $barcodecheck ne '0'){#??? wtf
                # find which item we issue
-               my $item = GetItem('', $barcode) or return undef;       # if we don't get an Item, abort.
+               my $item = GetItem('', $barcode) or return;     # if we don't get an Item, abort.
                my $branch = _GetCircControlBranch($item,$borrower);
                
                # get actual issuing if there is one
@@ -1252,7 +1252,9 @@ sub AddIssue {
 
         ## If item was lost, it has now been found, reverse any list item charges if neccessary.
         if ( $item->{'itemlost'} ) {
-            _FixAccountForLostAndReturned( $item->{'itemnumber'}, undef, $item->{'barcode'} );
+            if ( C4::Context->preference('RefundLostItemFeeOnReturn' ) ) {
+                _FixAccountForLostAndReturned( $item->{'itemnumber'}, undef, $item->{'barcode'} );
+            }
         }
 
         ModItem({ issues           => $item->{'issues'},
@@ -1449,7 +1451,7 @@ sub GetIssuingRule {
     return $irule if defined($irule) ;
 
     # if no rule matches,
-    return undef;
+    return;
 }
 
 =head2 GetBranchBorrowerCircRule
@@ -1745,7 +1747,7 @@ sub AddReturn {
 
     if ( $item->{'wthdrawn'} ) { # book has been cancelled
         $messages->{'wthdrawn'} = 1;
-        $doreturn = 0;
+        $doreturn = 0 if C4::Context->preference("BlockReturnOfWithdrawnItems");
     }
 
     # case of a return of document (deal with issues and holdingbranch)
@@ -1813,9 +1815,13 @@ sub AddReturn {
     }
 
     # fix up the accounts.....
-    if ($item->{'itemlost'}) {
-        _FixAccountForLostAndReturned($item->{'itemnumber'}, $borrowernumber, $barcode);    # can tolerate undef $borrowernumber
+    if ( $item->{'itemlost'} ) {
         $messages->{'WasLost'} = 1;
+
+        if ( C4::Context->preference('RefundLostItemFeeOnReturn' ) ) {
+            _FixAccountForLostAndReturned($item->{'itemnumber'}, $borrowernumber, $barcode);    # can tolerate undef $borrowernumber
+            $messages->{'LostItemFeeRefunded'} = 1;
+        }
     }
 
     # fix up the overdues in accounts...
@@ -1833,7 +1839,8 @@ sub AddReturn {
 
     # find reserves.....
     # if we don't have a reserve with the status W, we launch the Checkreserves routine
-    my ($resfound, $resrec, undef) = C4::Reserves::CheckReserves( $item->{'itemnumber'} );
+    my ($resfound, $resrec);
+    ($resfound, $resrec, undef) = C4::Reserves::CheckReserves( $item->{'itemnumber'} ) unless ( $item->{'wthdrawn'} );
     if ($resfound) {
           $resrec->{'ResFound'} = $resfound;
         $messages->{'ResFound'} = $resrec;
@@ -1981,7 +1988,7 @@ sub _debar_user_on_return {
     # $deltadays is a DateTime::Duration object
     my $deltadays = $calendar->days_between( $dt_due, $dt_today );
 
-    my $circcontrol = C4::Context::preference('CircControl');
+    my $circcontrol = C4::Context->preference('CircControl');
     my $issuingrule =
       GetIssuingRule( $borrower->{categorycode}, $item->{itype}, $branchcode );
     my $finedays = $issuingrule->{finedays};
@@ -2328,7 +2335,7 @@ tables issues and the firstname,surname & cardnumber from borrowers.
 
 sub GetBiblioIssues {
     my $biblionumber = shift;
-    return undef unless $biblionumber;
+    return unless $biblionumber;
     my $dbh   = C4::Context->dbh;
     my $query = "
         SELECT issues.*,items.barcode,biblio.biblionumber,biblio.title, biblio.author,borrowers.cardnumber,borrowers.surname,borrowers.firstname
@@ -2506,13 +2513,13 @@ from the book's item type.
 =cut
 
 sub AddRenewal {
-    my $borrowernumber  = shift or return undef;
-    my $itemnumber      = shift or return undef;
+    my $borrowernumber  = shift or return;
+    my $itemnumber      = shift or return;
     my $branch          = shift;
     my $datedue         = shift;
     my $lastreneweddate = shift || DateTime->now(time_zone => C4::Context->tz)->ymd();
-    my $item   = GetItem($itemnumber) or return undef;
-    my $biblio = GetBiblioFromItemNumber($itemnumber) or return undef;
+    my $item   = GetItem($itemnumber) or return;
+    my $biblio = GetBiblioFromItemNumber($itemnumber) or return;
 
     my $dbh = C4::Context->dbh;
     # Find the issues record for this book
@@ -2533,7 +2540,7 @@ sub AddRenewal {
     # based on the value of the RenewalPeriodBase syspref.
     unless ($datedue) {
 
-        my $borrower = C4::Members::GetMember( borrowernumber => $borrowernumber ) or return undef;
+        my $borrower = C4::Members::GetMember( borrowernumber => $borrowernumber ) or return;
         my $itemtype = (C4::Context->preference('item-level_itypes')) ? $biblio->{'itype'} : $biblio->{'itemtype'};
 
         $datedue = (C4::Context->preference('RenewalPeriodBase') eq 'date_due') ?
@@ -3013,13 +3020,14 @@ sub CalcDateDue {
               ->truncate( to => 'minute' );
             if ( $loanlength->{lengthunit} eq 'hours' ) {
                 $dt->add( hours => $loanlength->{issuelength} );
-                return $dt;
             } else {    # days
                 $dt->add( days => $loanlength->{issuelength} );
                 $dt->set_hour(23);
                 $dt->set_minute(59);
-                return $dt;
             }
+            # break
+            return $dt;
+
         } else {
             my $dur;
             if ($loanlength->{lengthunit} eq 'hours') {
@@ -3062,6 +3070,7 @@ sub CalcDateDue {
     # if ReturnBeforeExpiry ON the datedue can't be after borrower expirydate
     if ( C4::Context->preference('ReturnBeforeExpiry') ) {
         my $expiry_dt = dt_from_string( $borrower->{dateexpiry}, 'iso' );
+        $expiry_dt->set( hour => 23, minute => 59);
         if ( DateTime->compare( $datedue, $expiry_dt ) == 1 ) {
             $datedue = $expiry_dt->clone;
         }
index 9ce6c74..bd1f235 100644 (file)
@@ -276,7 +276,7 @@ sub memcached {
     if ($ismemcached) {
       return $memcached;
     } else {
-      return undef;
+      return;
     }
 }
 
@@ -293,7 +293,7 @@ sub db_scheme2dbi {
         if (/Postgres|Pg|PostgresSQL/) { return("Pg"); }
         if (/oracle/) { return("Oracle"); }
     }
-    return undef;         # Just in case
+    return;         # Just in case
 }
 
 sub import {
@@ -358,7 +358,7 @@ sub new {
             $conf_fname = CONFIG_FNAME;
         } else {
             warn "unable to locate Koha configuration file koha-conf.xml";
-            return undef;
+            return;
         }
     }
     
@@ -376,7 +376,7 @@ sub new {
 
     $self->{"config_file"} = $conf_fname;
     warn "read_config_file($conf_fname) returned undef" if !defined($self->{"config"});
-    return undef if !defined($self->{"config"});
+    return if !defined($self->{"config"});
 
     $self->{"dbh"} = undef;        # Database handle
     $self->{"Zconn"} = undef;    # Zebra Connections
@@ -480,10 +480,10 @@ C<C4::Config-E<gt>new> will not return it.
 
 =cut
 
-sub _common_config ($$) {
+sub _common_config {
        my $var = shift;
        my $term = shift;
-    return undef if !defined($context->{$term});
+    return if !defined($context->{$term});
        # Presumably $self->{$term} might be
        # undefined if the config file given to &new
        # didn't exist, and the caller didn't bother
@@ -523,12 +523,13 @@ with this method.
 # flushing the caching mechanism.
 
 my %sysprefs;
+my $use_syspref_cache = 1;
 
 sub preference {
     my $self = shift;
     my $var  = lc(shift);                          # The system preference to return
 
-    if (exists $sysprefs{$var}) {
+    if ($use_syspref_cache && exists $sysprefs{$var}) {
         return $sysprefs{$var};
     }
 
@@ -545,13 +546,42 @@ END_SQL
     return $sysprefs{$var};
 }
 
-sub boolean_preference ($) {
+sub boolean_preference {
     my $self = shift;
     my $var = shift;        # The system preference to return
     my $it = preference($self, $var);
     return defined($it)? C4::Boolean::true_p($it): undef;
 }
 
+=head2 enable_syspref_cache
+
+  C4::Context->enable_syspref_cache();
+
+Enable the in-memory syspref cache used by C4::Context. This is the
+default behavior.
+
+=cut
+
+sub enable_syspref_cache {
+    my ($self) = @_;
+    $use_syspref_cache = 1;
+}
+
+=head2 disable_syspref_cache
+
+  C4::Context->disable_syspref_cache();
+
+Disable the in-memory syspref cache used by C4::Context. This should be
+used with Plack and other persistent environments.
+
+=cut
+
+sub disable_syspref_cache {
+    my ($self) = @_;
+    $use_syspref_cache = 0;
+    $self->clear_syspref_cache();
+}
+
 =head2 clear_syspref_cache
 
   C4::Context->clear_syspref_cache();
@@ -656,6 +686,8 @@ sub Zconn {
         $context->{"Zconn"}->{$server}->destroy() if defined($context->{"Zconn"}->{$server});
 
         $context->{"Zconn"}->{$server} = &_new_Zconn($server,$async,$auth,$piggyback,$syntax);
+        $context->{ Zconn }->{ $server }->option(
+            preferredRecordSyntax => C4::Context->preference("marcflavour") );
         return $context->{"Zconn"}->{$server};
     }
 }
@@ -755,8 +787,23 @@ sub _new_dbh
     my $db_user   = $context->config("user");
     my $db_passwd = $context->config("pass");
     # MJR added or die here, as we can't work without dbh
-    my $dbh= DBI->connect("DBI:$db_driver:dbname=$db_name;host=$db_host;port=$db_port",
+    my $dbh = DBI->connect("DBI:$db_driver:dbname=$db_name;host=$db_host;port=$db_port",
     $db_user, $db_passwd, {'RaiseError' => $ENV{DEBUG}?1:0 }) or die $DBI::errstr;
+
+    # Check for the existence of a systempreference table; if we don't have this, we don't
+    # have a valid database and should not set RaiseError in order to allow the installer
+    # to run; installer will not run otherwise since we raise all db errors
+
+    eval {
+                local $dbh->{PrintError} = 0;
+                local $dbh->{RaiseError} = 1;
+                $dbh->do(qq{SELECT * FROM systempreferences WHERE 1 = 0 });
+    };
+
+    if ($@) {
+        $dbh->{RaiseError} = 0;
+    }
+
        my $tz = $ENV{TZ};
     if ( $db_driver eq 'mysql' ) { 
         # Koha 3.0 is utf-8, so force utf8 communication between mySQL and koha, whatever the mysql default config.
@@ -1009,7 +1056,7 @@ set_userenv is called in Auth.pm
 #'
 sub set_userenv {
     my ($usernum, $userid, $usercnum, $userfirstname, $usersurname, $userbranch, $branchname, $userflags, $emailaddress, $branchprinter)= @_;
-    my $var=$context->{"activeuser"};
+    my $var=$context->{"activeuser"} || '';
     my $cell = {
         "number"     => $usernum,
         "id"         => $userid,
@@ -1027,19 +1074,19 @@ sub set_userenv {
     return $cell;
 }
 
-sub set_shelves_userenv ($$) {
-       my ($type, $shelves) = @_ or return undef;
-       my $activeuser = $context->{activeuser} or return undef;
+sub set_shelves_userenv {
+       my ($type, $shelves) = @_ or return;
+       my $activeuser = $context->{activeuser} or return;
        $context->{userenv}->{$activeuser}->{barshelves} = $shelves if $type eq 'bar';
        $context->{userenv}->{$activeuser}->{pubshelves} = $shelves if $type eq 'pub';
        $context->{userenv}->{$activeuser}->{totshelves} = $shelves if $type eq 'tot';
 }
 
-sub get_shelves_userenv () {
+sub get_shelves_userenv {
        my $active;
        unless ($active = $context->{userenv}->{$context->{activeuser}}) {
                $debug and warn "get_shelves_userenv cannot retrieve context->{userenv}->{context->{activeuser}}";
-               return undef;
+               return;
        }
        my $totshelves = $active->{totshelves} or undef;
        my $pubshelves = $active->{pubshelves} or undef;
index 41ff548..871e32b 100644 (file)
@@ -168,7 +168,7 @@ sub prAltJpeg
 {  my ($iData, $iWidth, $iHeight, $iFormat,$aiData, $aiWidth, $aiHeight, $aiFormat) = @_;
    my ($namnet, $utrad);
    if (! $PDF::Reuse::pos)                    # If no output is active, it is no use to continue
-   {   return undef;
+   {   return;
    }
    prJpegBlob($aiData, $aiWidth, $aiHeight, $aiFormat);
    my $altObjNr = $PDF::Reuse::objNr;
@@ -198,7 +198,7 @@ sub prJpegBlob
 {  my ($iData, $iWidth, $iHeight, $iFormat, $altArrayObjNr) = @_;
    my ($iLangd, $namnet, $utrad);
    if (! $PDF::Reuse::pos)                    # If no output is active, it is no use to continue
-   {   return undef;
+   {   return;
    }
    my $checkidOld = $PDF::Reuse::checkId;
    if (!$iFormat)
@@ -209,16 +209,16 @@ sub prJpegBlob
           $namnet = 'Ig' . $PDF::Reuse::imageNr;
           $PDF::Reuse::objNr++;
           $PDF::Reuse::objekt[$PDF::Reuse::objNr] = $PDF::Reuse::pos;
-          open (BILDFIL, "<$iFile") || errLog("Couldn't open $iFile, $!, aborts");
-          binmode BILDFIL;
+          open (my $fh, '<', "$iFile") || errLog("Couldn't open $iFile, $!, aborts");
+          binmode $fh;
           my $iStream;
-          sysread BILDFIL, $iStream, $iLangd;
+          sysread $fh, $iStream, $iLangd;
           $utrad = "$PDF::Reuse::objNr 0 obj\n<</Type/XObject/Subtype/Image/Name/$namnet" .
                     "/Width $iWidth /Height $iHeight /BitsPerComponent 8 " .
                     ($altArrayObjNr ? "/Alternates $altArrayObjNr 0 R " : "") .
                     "/Filter/DCTDecode/ColorSpace/DeviceRGB"
                     . "/Length $iLangd >>stream\n$iStream\nendstream\nendobj\n";
-          close BILDFIL;
+          close $fh;
           $PDF::Reuse::pos += syswrite $PDF::Reuse::UTFIL, $utrad;
           if ($PDF::Reuse::runfil)
           {  $PDF::Reuse::log .= "Cid~$PDF::Reuse::checkId\n";
index d752677..d49aa8d 100644 (file)
@@ -50,26 +50,26 @@ sub initialize {
                        #"Mozilla/4.76 [en] (Win98; U)",        #  if for some reason you want to go stealth, you might prefer this
 }
 
-sub image_url (;$) {
-       ($user and $pass) or return undef;
+sub image_url {
+       ($user and $pass) or return;
        my $isbn = (@_ ? shift : '');
        $isbn =~ s/(p|-)//g;    # sanitize
        return $image_url . $isbn;
 }
-sub link_url (;$) {
+sub link_url {
        my $isbn = (@_ ? shift : '');
        $isbn =~ s/(p|-)//g;    # sanitize
-       $link_url or return undef;
+       $link_url or return;
        return $link_url . $isbn;
 }
-sub content_cafe_url ($) {
-       ($user and $pass) or return undef;
+sub content_cafe_url {
+       ($user and $pass) or return;
        my $isbn = (@_ ? shift : '');
        $isbn =~ s/(p|-)//g;    # sanitize
        return "http://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=$user&Password=$pass&Options=Y&ItemKey=$isbn";
 }
-sub http_jacket_link ($) {
-       my $isbn = shift or return undef;
+sub http_jacket_link {
+       my $isbn = shift or return;
        $isbn =~ s/(p|-)//g;    # sanitize
        my $image = availability($isbn);
        my $alt = "Buy this book";
@@ -79,9 +79,9 @@ sub http_jacket_link ($) {
        return sprintf qq(<a class="btlink" href="%s">%s</a>),$link,($image||$alt);
 }
 
-sub availability ($) {
-       my $isbn = shift or return undef;
-       ($user and $pass) or return undef;
+sub availability {
+       my $isbn = shift or return;
+       ($user and $pass) or return;
        $isbn =~ s/(p|-)//g;    # sanitize
        my $url = "http://contentcafe2.btol.com/ContentCafe/InventoryAvailability.asmx/CheckInventory?UserID=$user&Password=$pass&Value=$isbn";
        $debug and warn __PACKAGE__ . " request:\n$url\n";
index 608732f..7d38963 100755 (executable)
@@ -48,8 +48,6 @@ BEGIN {
      );
 }
 
-# XXX This is not safe in a persistant environment
-my $dbh   = C4::Context->dbh;
 
 =head1 FUNCTIONS
 
@@ -62,6 +60,7 @@ Returns Transport Cost Matrix as a hashref <to branch code> => <from branch code
 =cut
 
 sub TransportCostMatrix {
+    my $dbh   = C4::Context->dbh;
     my $transport_costs = $dbh->selectall_arrayref("SELECT * FROM transport_cost",{ Slice => {} });
 
     my %transport_cost_matrix;
@@ -86,6 +85,7 @@ Records: { frombranch => <code>, tobranch => <code>, cost => <figure>, disable_t
 
 sub UpdateTransportCostMatrix {
     my ($records) = @_;
+    my $dbh   = C4::Context->dbh;
 
     my $sth = $dbh->prepare("INSERT INTO transport_cost (frombranch, tobranch, cost, disable_transfer) VALUES (?, ?, ?, ?)");
 
@@ -116,6 +116,7 @@ Returns hold queue for a holding branch. If branch is omitted, then whole queue
 
 sub GetHoldsQueueItems {
     my ($branchlimit) = @_;
+    my $dbh   = C4::Context->dbh;
 
     my @bind_params = ();
     my $query = q/SELECT tmp_holdsqueue.*, biblio.author, items.ccode, items.location, items.enumchron, items.cn_sort, biblioitems.publishercode,biblio.copyrightdate,biblioitems.publicationyear,biblioitems.pages,biblioitems.size,biblioitems.publicationyear,biblioitems.isbn,items.copynumber
@@ -154,6 +155,7 @@ Top level function that turns reserves into tmp_holdsqueue and hold_fill_targets
 =cut
 
 sub CreateQueue {
+    my $dbh   = C4::Context->dbh;
 
     $dbh->do("DELETE FROM tmp_holdsqueue");  # clear the old table for new info
     $dbh->do("DELETE FROM hold_fill_targets");
index d685e6c..5a62954 100644 (file)
@@ -26,7 +26,7 @@ use C4::Circulation;
 use C4::Branch;
 use C4::Accounts;
 use C4::Biblio;
-use C4::Reserves qw(AddReserve CancelReserve GetReservesFromBiblionumber GetReservesFromBorrowernumber);
+use C4::Reserves qw(AddReserve CancelReserve GetReservesFromBiblionumber GetReservesFromBorrowernumber CanBookBeReserved CanItemBeReserved);
 use C4::Context;
 use C4::AuthoritiesMarc;
 use C4::ILSDI::Utility;
index 8b17f1c..4bae00c 100644 (file)
@@ -131,16 +131,10 @@ sub ListImagesForBiblio {
     my $query = 'SELECT imagenumber FROM biblioimages WHERE biblionumber = ?';
     my $sth   = $dbh->prepare($query);
     $sth->execute($biblionumber);
-    warn "Database error!" if $sth->errstr;
-    if ( !$sth->errstr && $sth->rows > 0 ) {
-        while ( my $row = $sth->fetchrow_hashref ) {
-            push @imagenumbers, $row->{'imagenumber'};
-        }
-        return @imagenumbers;
-    }
-    else {
-        return undef;
+    while ( my $row = $sth->fetchrow_hashref ) {
+        push @imagenumbers, $row->{'imagenumber'};
     }
+    return @imagenumbers;
 }
 
 =head2 DelImage
index 8cfb3e6..15f1acb 100644 (file)
@@ -1,6 +1,6 @@
 package C4::ImportBatch;
 
-# Copyright (C) 2007 LibLime
+# Copyright (C) 2007 LibLime, 2012 C & P Bibliography Services
 #
 # This file is part of Koha.
 #
@@ -25,6 +25,7 @@ use C4::Koha;
 use C4::Biblio;
 use C4::Items;
 use C4::Charset;
+use C4::AuthoritiesMarc;
 
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
 
@@ -40,21 +41,23 @@ BEGIN {
     GetImportRecordMarcXML
     AddImportBatch
     GetImportBatch
+    AddAuthToBatch
     AddBiblioToBatch
     AddItemsToImportBiblio
+    ModAuthorityInBatch
     ModBiblioInBatch
 
     BatchStageMarcRecords
-    BatchFindBibDuplicates
-    BatchCommitBibRecords
-    BatchRevertBibRecords
+    BatchFindDuplicates
+    BatchCommitRecords
+    BatchRevertRecords
     CleanBatch
 
     GetAllImportBatches
     GetStagedWebserviceBatches
     GetImportBatchRangeDesc
     GetNumberOfNonZ3950ImportBatches
-    GetImportBibliosRange
+    GetImportRecordsRange
        GetItemNumbersFromImportBatch
     
     GetImportBatchStatus
@@ -202,7 +205,7 @@ sub AddImportBatch {
     my (@fields, @vals);
     foreach (qw( matcher_id template_id branchcode
                  overlay_action nomatch_action item_action
-                 import_status batch_type file_name comments )) {
+                 import_status batch_type file_name comments record_type )) {
         if (exists $params->{$_}) {
             push @fields, $_;
             push @vals, $params->{$_};
@@ -252,7 +255,7 @@ sub AddBiblioToBatch {
     my $z3950random = shift;
     my $update_counts = @_ ? shift : 1;
 
-    my $import_record_id = _create_import_record($batch_id, $record_sequence, $marc_record, 'biblio', $encoding, $z3950random);
+    my $import_record_id = _create_import_record($batch_id, $record_sequence, $marc_record, 'biblio', $encoding, $z3950random, C4::Context->preference('marcflavour'));
     _add_biblio_fields($import_record_id, $marc_record);
     _update_batch_record_counts($batch_id) if $update_counts;
     return $import_record_id;
@@ -267,15 +270,53 @@ sub AddBiblioToBatch {
 sub ModBiblioInBatch {
     my ($import_record_id, $marc_record) = @_;
 
-    _update_import_record_marc($import_record_id, $marc_record);
+    _update_import_record_marc($import_record_id, $marc_record, C4::Context->preference('marcflavour'));
     _update_biblio_fields($import_record_id, $marc_record);
 
 }
 
+=head2 AddAuthToBatch
+
+  my $import_record_id = AddAuthToBatch($batch_id, $record_sequence,
+                $marc_record, $encoding, $z3950random, $update_counts, [$marc_type]);
+
+=cut
+
+sub AddAuthToBatch {
+    my $batch_id = shift;
+    my $record_sequence = shift;
+    my $marc_record = shift;
+    my $encoding = shift;
+    my $z3950random = shift;
+    my $update_counts = @_ ? shift : 1;
+    my $marc_type = shift || C4::Context->preference('marcflavour');
+
+    $marc_type = 'UNIMARCAUTH' if $marc_type eq 'UNIMARC';
+
+    my $import_record_id = _create_import_record($batch_id, $record_sequence, $marc_record, 'auth', $encoding, $z3950random, $marc_type);
+    _add_auth_fields($import_record_id, $marc_record);
+    _update_batch_record_counts($batch_id) if $update_counts;
+    return $import_record_id;
+}
+
+=head2 ModAuthInBatch
+
+  ModAuthInBatch($import_record_id, $marc_record);
+
+=cut
+
+sub ModAuthInBatch {
+    my ($import_record_id, $marc_record) = @_;
+
+    my $marcflavour = C4::Context->preference('marcflavour');
+    _update_import_record_marc($import_record_id, $marc_record, $marcflavour eq 'UNIMARC' ? 'UNIMARCAUTH' : 'USMARC');
+
+}
+
 =head2 BatchStageMarcRecords
 
   ($batch_id, $num_records, $num_items, @invalid_records) = 
-    BatchStageMarcRecords($encoding, $marc_records, $file_name, 
+    BatchStageMarcRecords($record_type, $encoding, $marc_records, $file_name,
                           $comments, $branch_code, $parse_items,
                           $leave_as_staging, 
                           $progress_interval, $progress_callback);
@@ -283,6 +324,7 @@ sub ModBiblioInBatch {
 =cut
 
 sub  BatchStageMarcRecords {
+    my $record_type = shift;
     my $encoding = shift;
     my $marc_records = shift;
     my $file_name = shift;
@@ -290,7 +332,7 @@ sub  BatchStageMarcRecords {
     my $branch_code = shift;
     my $parse_items = shift;
     my $leave_as_staging = shift;
-   
+
     # optional callback to monitor status 
     # of job
     my $progress_interval = 0;
@@ -308,6 +350,7 @@ sub  BatchStageMarcRecords {
             batch_type => 'batch',
             file_name => $file_name,
             comments => $comments,
+            record_type => $record_type,
         } );
     if ($parse_items) {
         SetImportBatchItemAction($batch_id, 'always_add');
@@ -315,6 +358,8 @@ sub  BatchStageMarcRecords {
         SetImportBatchItemAction($batch_id, 'ignore');
     }
 
+    my $marc_type = C4::Context->preference('marcflavour');
+    $marc_type .= 'AUTH' if ($marc_type eq 'UNIMARC' && $record_type eq 'auth');
     my @invalid_records = ();
     my $num_valid = 0;
     my $num_items = 0;
@@ -329,7 +374,7 @@ sub  BatchStageMarcRecords {
             &$progress_callback($rec_num);
         }
         my ($marc_record, $charset_guessed, $char_errors) =
-            MarcToUTF8Record($marc_blob, C4::Context->preference("marcflavour"), $encoding);
+            MarcToUTF8Record($marc_blob, $marc_type, $encoding);
 
         $encoding = $charset_guessed unless $encoding;
 
@@ -337,11 +382,19 @@ sub  BatchStageMarcRecords {
         if (scalar($marc_record->fields()) == 0) {
             push @invalid_records, $marc_blob;
         } else {
+
+            # Normalize the record so it doesn't have separated diacritics
+            SetUTF8Flag($marc_record);
+
             $num_valid++;
-            $import_record_id = AddBiblioToBatch($batch_id, $rec_num, $marc_record, $encoding, int(rand(99999)), 0);
-            if ($parse_items) {
-                my @import_items_ids = AddItemsToImportBiblio($batch_id, $import_record_id, $marc_record, 0);
-                $num_items += scalar(@import_items_ids);
+            if ($record_type eq 'biblio') {
+                $import_record_id = AddBiblioToBatch($batch_id, $rec_num, $marc_record, $encoding, int(rand(99999)), 0);
+                if ($parse_items) {
+                    my @import_items_ids = AddItemsToImportBiblio($batch_id, $import_record_id, $marc_record, 0);
+                    $num_items += scalar(@import_items_ids);
+                }
+            } elsif ($record_type eq 'auth') {
+                $import_record_id = AddAuthToBatch($batch_id, $rec_num, $marc_record, $encoding, int(rand(99999)), 0, $marc_type);
             }
         }
     }
@@ -387,14 +440,14 @@ sub AddItemsToImportBiblio {
 
     if ($#import_items_ids > -1) {
         _update_batch_record_counts($batch_id) if $update_counts;
-        _update_import_record_marc($import_record_id, $marc_record);
+        _update_import_record_marc($import_record_id, $marc_record, C4::Context->preference('marcflavour'));
     }
     return @import_items_ids;
 }
 
-=head2 BatchFindBibDuplicates
+=head2 BatchFindDuplicates
 
-  my $num_with_matches = BatchFindBibDuplicates($batch_id, $matcher, 
+  my $num_with_matches = BatchFindDuplicates($batch_id, $matcher,
              $max_matches, $progress_interval, $progress_callback);
 
 Goes through the records loaded in the batch and attempts to 
@@ -412,7 +465,7 @@ singular argument.
 
 =cut
 
-sub BatchFindBibDuplicates {
+sub BatchFindDuplicates {
     my $batch_id = shift;
     my $matcher = shift;
     my $max_matches = @_ ? shift : 10;
@@ -430,9 +483,8 @@ sub BatchFindBibDuplicates {
 
     my $dbh = C4::Context->dbh;
 
-    my $sth = $dbh->prepare("SELECT import_record_id, marc
+    my $sth = $dbh->prepare("SELECT import_record_id, record_type, marc
                              FROM import_records
-                             JOIN import_biblios USING (import_record_id)
                              WHERE import_batch_id = ?");
     $sth->execute($batch_id);
     my $num_with_matches = 0;
@@ -460,15 +512,15 @@ sub BatchFindBibDuplicates {
     return $num_with_matches;
 }
 
-=head2 BatchCommitBibRecords
+=head2 BatchCommitRecords
 
-  my ($num_added, $num_updated, $num_items_added, $num_items_errored, 
-      $num_ignored) = BatchCommitBibRecords($batch_id, $framework,
-                      $progress_interval, $progress_callback);
+  my ($num_added, $num_updated, $num_items_added, $num_items_errored, $num_ignored) =
+        BatchCommitRecords($batch_id, $framework,
+        $progress_interval, $progress_callback);
 
 =cut
 
-sub BatchCommitBibRecords {
+sub BatchCommitRecords {
     my $batch_id = shift;
     my $framework = shift;
 
@@ -483,25 +535,30 @@ sub BatchCommitBibRecords {
         $progress_interval = 0 unless 'CODE' eq ref $progress_callback;
     }
 
+    my $record_type;
     my $num_added = 0;
     my $num_updated = 0;
     my $num_items_added = 0;
     my $num_items_errored = 0;
     my $num_ignored = 0;
     # commit (i.e., save, all records in the batch)
-    # FIXME biblio only at the moment
     SetImportBatchStatus('importing');
     my $overlay_action = GetImportBatchOverlayAction($batch_id);
     my $nomatch_action = GetImportBatchNoMatchAction($batch_id);
     my $item_action = GetImportBatchItemAction($batch_id);
+    my $item_tag;
+    my $item_subfield;
     my $dbh = C4::Context->dbh;
-    my $sth = $dbh->prepare("SELECT import_record_id, status, overlay_status, marc, encoding
+    my $sth = $dbh->prepare("SELECT import_records.import_record_id, record_type, status, overlay_status, marc, encoding
                              FROM import_records
-                             JOIN import_biblios USING (import_record_id)
+                             LEFT JOIN import_auths ON (import_records.import_record_id=import_auths.import_record_id)
+                             LEFT JOIN import_biblios ON (import_records.import_record_id=import_biblios.import_record_id)
                              WHERE import_batch_id = ?");
     $sth->execute($batch_id);
+    my $marcflavour = C4::Context->preference('marcflavour');
     my $rec_num = 0;
     while (my $rowref = $sth->fetchrow_hashref) {
+        $record_type = $rowref->{'record_type'};
         $rec_num++;
         if ($progress_interval and (0 == ($rec_num % $progress_interval))) {
             &$progress_callback($rec_num);
@@ -511,69 +568,97 @@ sub BatchCommitBibRecords {
             next;
         }
 
+        my $marc_type;
+        if ($marcflavour eq 'UNIMARC' && $record_type eq 'auth') {
+            $marc_type = 'UNIMARCAUTH';
+        } elsif ($marcflavour eq 'UNIMARC') {
+            $marc_type = 'UNIMARC';
+        } else {
+            $marc_type = 'USMARC';
+        }
         my $marc_record = MARC::Record->new_from_usmarc($rowref->{'marc'});
 
-        # remove any item tags - rely on BatchCommitItems
-        my ($item_tag,$item_subfield) = &GetMarcFromKohaField("items.itemnumber",'');
-        foreach my $item_field ($marc_record->field($item_tag)) {
-            $marc_record->delete_field($item_field);
+        if ($record_type eq 'biblio') {
+            # remove any item tags - rely on BatchCommitItems
+            ($item_tag,$item_subfield) = &GetMarcFromKohaField("items.itemnumber",'');
+            foreach my $item_field ($marc_record->field($item_tag)) {
+                $marc_record->delete_field($item_field);
+            }
         }
 
-        # decide what what to do with the bib and item records
-        my ($bib_result, $item_result, $bib_match) = 
+        my ($record_result, $item_result, $record_match) =
             _get_commit_action($overlay_action, $nomatch_action, $item_action, 
-                               $rowref->{'overlay_status'}, $rowref->{'import_record_id'});
+                               $rowref->{'overlay_status'}, $rowref->{'import_record_id'}, $record_type);
 
-        if ($bib_result eq 'create_new') {
+        my $recordid;
+        my $query;
+        if ($record_result eq 'create_new') {
             $num_added++;
-            my ($biblionumber, $biblioitemnumber) = AddBiblio($marc_record, $framework);
-            my $sth = $dbh->prepare_cached("UPDATE import_biblios SET matched_biblionumber = ? WHERE import_record_id = ?");
-            $sth->execute($biblionumber, $rowref->{'import_record_id'});
-            $sth->finish();
-            if ($item_result eq 'create_new') {
-                my ($bib_items_added, $bib_items_errored) = BatchCommitItems($rowref->{'import_record_id'}, $biblionumber);
-                $num_items_added += $bib_items_added;
-                $num_items_errored += $bib_items_errored;
+            if ($record_type eq 'biblio') {
+                my $biblioitemnumber;
+                ($recordid, $biblioitemnumber) = AddBiblio($marc_record, $framework);
+                $query = "UPDATE import_biblios SET matched_biblionumber = ? WHERE import_record_id = ?";
+                if ($item_result eq 'create_new') {
+                    my ($bib_items_added, $bib_items_errored) = BatchCommitItems($rowref->{'import_record_id'}, $recordid);
+                    $num_items_added += $bib_items_added;
+                    $num_items_errored += $bib_items_errored;
+                }
+            } else {
+                $recordid = AddAuthority($marc_record, undef, GuessAuthTypeCode($marc_record));
+                $query = "UPDATE import_auths SET matched_authid = ? WHERE import_record_id = ?";
             }
+            my $sth = $dbh->prepare_cached($query);
+            $sth->execute($recordid, $rowref->{'import_record_id'});
+            $sth->finish();
             SetImportRecordStatus($rowref->{'import_record_id'}, 'imported');
-        } elsif ($bib_result eq 'replace') {
+        } elsif ($record_result eq 'replace') {
             $num_updated++;
-            my $biblionumber = $bib_match;
-            my $oldbiblio = GetBiblio($biblionumber);
-            my $oldxml = GetXmlBiblio($biblionumber);
-
-            # remove item fields so that they don't get
-            # added again if record is reverted
-            my $old_marc = MARC::Record->new_from_xml(StripNonXmlChars($oldxml), 'UTF-8', $rowref->{'encoding'});
-            foreach my $item_field ($old_marc->field($item_tag)) {
-                $old_marc->delete_field($item_field);
-            }
+            $recordid = $record_match;
+            my $oldxml;
+            if ($record_type eq 'biblio') {
+                my ($count, $oldbiblio) = GetBiblio($recordid);
+                $oldxml = GetXmlBiblio($recordid);
+
+                # remove item fields so that they don't get
+                # added again if record is reverted
+                my $old_marc = MARC::Record->new_from_xml(StripNonXmlChars($oldxml), 'UTF-8', $rowref->{'encoding'}, $marc_type);
+                foreach my $item_field ($old_marc->field($item_tag)) {
+                    $old_marc->delete_field($item_field);
+                }
+                $oldxml = $old_marc->as_xml($marc_type);
+
+                ModBiblio($marc_record, $recordid, $oldbiblio->{'frameworkcode'});
+                $query = "UPDATE import_biblios SET matched_biblionumber = ? WHERE import_record_id = ?";
+
+                if ($item_result eq 'create_new') {
+                    my ($bib_items_added, $bib_items_errored) = BatchCommitItems($rowref->{'import_record_id'}, $recordid);
+                    $num_items_added += $bib_items_added;
+                    $num_items_errored += $bib_items_errored;
+                }
+            } else {
+                $oldxml = GetAuthorityXML($recordid);
 
-            ModBiblio($marc_record, $biblionumber, $oldbiblio->{'frameworkcode'});
+                ModAuthority($recordid, $marc_record, GuessAuthTypeCode($marc_record));
+                $query = "UPDATE import_auths SET matched_authid = ? WHERE import_record_id = ?";
+            }
             my $sth = $dbh->prepare_cached("UPDATE import_records SET marcxml_old = ? WHERE import_record_id = ?");
-            $sth->execute($old_marc->as_xml(), $rowref->{'import_record_id'});
+            $sth->execute($oldxml, $rowref->{'import_record_id'});
             $sth->finish();
-            my $sth2 = $dbh->prepare_cached("UPDATE import_biblios SET matched_biblionumber = ? WHERE import_record_id = ?");
-            $sth2->execute($biblionumber, $rowref->{'import_record_id'});
+            my $sth2 = $dbh->prepare_cached($query);
+            $sth2->execute($recordid, $rowref->{'import_record_id'});
             $sth2->finish();
-            if ($item_result eq 'create_new') {
-                my ($bib_items_added, $bib_items_errored) = BatchCommitItems($rowref->{'import_record_id'}, $biblionumber);
-                $num_items_added += $bib_items_added;
-                $num_items_errored += $bib_items_errored;
-            }
             SetImportRecordOverlayStatus($rowref->{'import_record_id'}, 'match_applied');
             SetImportRecordStatus($rowref->{'import_record_id'}, 'imported');
-        } elsif ($bib_result eq 'ignore') {
+        } elsif ($record_result eq 'ignore') {
             $num_ignored++;
-            my $biblionumber = $bib_match;
-            if (defined $biblionumber and $item_result eq 'create_new') {
-                my ($bib_items_added, $bib_items_errored) = BatchCommitItems($rowref->{'import_record_id'}, $biblionumber);
+            if ($record_type eq 'biblio' and defined $recordid and $item_result eq 'create_new') {
+                my ($bib_items_added, $bib_items_errored) = BatchCommitItems($rowref->{'import_record_id'}, $recordid);
                 $num_items_added += $bib_items_added;
                 $num_items_errored += $bib_items_errored;
                 # still need to record the matched biblionumber so that the
                 # items can be reverted
                 my $sth2 = $dbh->prepare_cached("UPDATE import_biblios SET matched_biblionumber = ? WHERE import_record_id = ?");
-                $sth2->execute($biblionumber, $rowref->{'import_record_id'});
+                $sth2->execute($recordid, $rowref->{'import_record_id'});
                 SetImportRecordOverlayStatus($rowref->{'import_record_id'}, 'match_applied');
             }
             SetImportRecordStatus($rowref->{'import_record_id'}, 'ignored');
@@ -632,63 +717,93 @@ sub BatchCommitItems {
     return ($num_items_added, $num_items_errored);
 }
 
-=head2 BatchRevertBibRecords
+=head2 BatchRevertRecords
 
   my ($num_deleted, $num_errors, $num_reverted, $num_items_deleted, 
-      $num_ignored) = BatchRevertBibRecords($batch_id);
+      $num_ignored) = BatchRevertRecords($batch_id);
 
 =cut
 
-sub BatchRevertBibRecords {
+sub BatchRevertRecords {
     my $batch_id = shift;
 
+    my $record_type;
     my $num_deleted = 0;
     my $num_errors = 0;
     my $num_reverted = 0;
-    my $num_items_deleted = 0;
     my $num_ignored = 0;
+    my $num_items_deleted = 0;
     # commit (i.e., save, all records in the batch)
-    # FIXME biblio only at the moment
     SetImportBatchStatus('reverting');
     my $overlay_action = GetImportBatchOverlayAction($batch_id);
     my $nomatch_action = GetImportBatchNoMatchAction($batch_id);
     my $dbh = C4::Context->dbh;
-    my $sth = $dbh->prepare("SELECT import_record_id, status, overlay_status, marcxml_old, encoding, matched_biblionumber
+    my $sth = $dbh->prepare("SELECT import_records.import_record_id, record_type, status, overlay_status, marcxml_old, encoding, matched_biblionumber, matched_authid
                              FROM import_records
-                             JOIN import_biblios USING (import_record_id)
+                             LEFT JOIN import_auths ON (import_records.import_record_id=import_auths.import_record_id)
+                             LEFT JOIN import_biblios ON (import_records.import_record_id=import_biblios.import_record_id)
                              WHERE import_batch_id = ?");
     $sth->execute($batch_id);
+    my $marc_type;
+    my $marcflavour = C4::Context->preference('marcflavour');
     while (my $rowref = $sth->fetchrow_hashref) {
+        $record_type = $rowref->{'record_type'};
         if ($rowref->{'status'} eq 'error' or $rowref->{'status'} eq 'reverted') {
             $num_ignored++;
             next;
         }
+        if ($marcflavour eq 'UNIMARC' && $record_type eq 'auth') {
+            $marc_type = 'UNIMARCAUTH';
+        } elsif ($marcflavour eq 'UNIMARC') {
+            $marc_type = 'UNIMARC';
+        } else {
+            $marc_type = 'USMARC';
+        }
 
-        my $bib_result = _get_revert_action($overlay_action, $rowref->{'overlay_status'}, $rowref->{'status'});
+        my $record_result = _get_revert_action($overlay_action, $rowref->{'overlay_status'}, $rowref->{'status'});
 
-        if ($bib_result eq 'delete') {
-            $num_items_deleted += BatchRevertItems($rowref->{'import_record_id'}, $rowref->{'matched_biblionumber'});
-            my $error = DelBiblio($rowref->{'matched_biblionumber'});
+        if ($record_result eq 'delete') {
+            my $error = undef;
+            if  ($record_type eq 'biblio') {
+                $num_items_deleted += BatchRevertItems($rowref->{'import_record_id'}, $rowref->{'matched_biblionumber'});
+                $error = DelBiblio($rowref->{'matched_biblionumber'});
+            } else {
+                my $deletedauthid = DelAuthority($rowref->{'matched_authid'});
+            }
             if (defined $error) {
                 $num_errors++;
             } else {
                 $num_deleted++;
                 SetImportRecordStatus($rowref->{'import_record_id'}, 'reverted');
             }
-        } elsif ($bib_result eq 'restore') {
+        } elsif ($record_result eq 'restore') {
             $num_reverted++;
-            my $old_record = MARC::Record->new_from_xml(StripNonXmlChars($rowref->{'marcxml_old'}), 'UTF-8', $rowref->{'encoding'});
-            my $biblionumber = $rowref->{'matched_biblionumber'};
-            my $oldbiblio = GetBiblio($biblionumber);
-            $num_items_deleted += BatchRevertItems($rowref->{'import_record_id'}, $rowref->{'matched_biblionumber'});
-            ModBiblio($old_record, $biblionumber, $oldbiblio->{'frameworkcode'});
+            my $old_record = MARC::Record->new_from_xml(StripNonXmlChars($rowref->{'marcxml_old'}), 'UTF-8', $rowref->{'encoding'}, $marc_type);
+            if ($record_type eq 'biblio') {
+                my $biblionumber = $rowref->{'matched_biblionumber'};
+                my ($count, $oldbiblio) = GetBiblio($biblionumber);
+                $num_items_deleted += BatchRevertItems($rowref->{'import_record_id'}, $rowref->{'matched_biblionumber'});
+                ModBiblio($old_record, $biblionumber, $oldbiblio->{'frameworkcode'});
+            } else {
+                my $authid = $rowref->{'matched_authid'};
+                ModAuthority($authid, $old_record, GuessAuthTypeCode($old_record));
+            }
             SetImportRecordStatus($rowref->{'import_record_id'}, 'reverted');
-        } elsif ($bib_result eq 'ignore') {
-            $num_items_deleted += BatchRevertItems($rowref->{'import_record_id'}, $rowref->{'matched_biblionumber'});
+        } elsif ($record_result eq 'ignore') {
+            if ($record_type eq 'biblio') {
+                $num_items_deleted += BatchRevertItems($rowref->{'import_record_id'}, $rowref->{'matched_biblionumber'});
+            }
             SetImportRecordStatus($rowref->{'import_record_id'}, 'reverted');
         }
-        # remove matched_biblionumber only if there is no 'imported' item left
-        my $sth2 = $dbh->prepare_cached("UPDATE import_biblios SET matched_biblionumber = NULL WHERE import_record_id = ?  AND NOT EXISTS (SELECT * FROM import_items WHERE import_items.import_record_id=import_biblios.import_record_id and status='imported')" );
+        my $query;
+        if ($record_type eq 'biblio') {
+            # remove matched_biblionumber only if there is no 'imported' item left
+            $query = "UPDATE import_biblios SET matched_biblionumber = NULL WHERE import_record_id = ?";
+            $query = "UPDATE import_biblios SET matched_biblionumber = NULL WHERE import_record_id = ?  AND NOT EXISTS (SELECT * FROM import_items WHERE import_items.import_record_id=import_biblios.import_record_id and status='imported')";
+        } else {
+            $query = "UPDATE import_auths SET matched_authid = NULL WHERE import_record_id = ?";
+        }
+        my $sth2 = $dbh->prepare_cached($query);
         $sth2->execute($rowref->{'import_record_id'});
     }
 
@@ -862,24 +977,26 @@ sub GetNumberOfNonZ3950ImportBatches {
     return $count;
 }
 
-=head2 GetImportBibliosRange
+=head2 GetImportRecordsRange
 
-  my $results = GetImportBibliosRange($batch_id, $offset, $results_per_group);
+  my $results = GetImportRecordsRange($batch_id, $offset, $results_per_group);
 
 Returns a reference to an array of hash references corresponding to
-import_biblios/import_records rows for a given batch
+import_biblios/import_auths/import_records rows for a given batch
 starting at the given offset.
 
 =cut
 
-sub GetImportBibliosRange {
+sub GetImportRecordsRange {
     my ($batch_id, $offset, $results_per_group, $status) = @_;
 
     my $dbh = C4::Context->dbh;
-    my $query = "SELECT title, author, isbn, issn, import_record_id, record_sequence,
-                                           status, overlay_status, matched_biblionumber
+    my $query = "SELECT title, author, isbn, issn, authorized_heading, import_records.import_record_id,
+                                           record_sequence, status, overlay_status,
+                                           matched_biblionumber, matched_authid, record_type
                                     FROM   import_records
-                                    JOIN   import_biblios USING (import_record_id)
+                                    LEFT JOIN import_auths ON (import_records.import_record_id=import_auths.import_record_id)
+                                    LEFT JOIN import_biblios ON (import_records.import_record_id=import_biblios.import_record_id)
                                     WHERE  import_batch_id = ?";
     my @params;
     push(@params, $batch_id);
@@ -1181,16 +1298,21 @@ sub GetImportRecordMatches {
 
     my $dbh = C4::Context->dbh;
     # FIXME currently biblio only
-    my $sth = $dbh->prepare_cached("SELECT title, author, biblionumber, score
+    my $sth = $dbh->prepare_cached("SELECT title, author, biblionumber,
+                                    candidate_match_id, score, record_type
                                     FROM import_records
                                     JOIN import_record_matches USING (import_record_id)
-                                    JOIN biblio ON (biblionumber = candidate_match_id)
+                                    LEFT JOIN biblio ON (biblionumber = candidate_match_id)
                                     WHERE import_record_id = ?
                                     ORDER BY score DESC, biblionumber DESC");
     $sth->bind_param(1, $import_record_id);
     my $results = [];
     $sth->execute();
     while (my $row = $sth->fetchrow_hashref) {
+        if ($row->{'record_type'} eq 'auth') {
+            $row->{'authorized_heading'} = C4::AuthoritiesMarc::GetAuthorizedHeading( { authid => $row->{'candidate_match_id'} } );
+        }
+        next if ($row->{'record_type'} eq 'biblio' && not $row->{'biblionumber'});
         push @$results, $row;
         last if $best_only;
     }
@@ -1227,13 +1349,13 @@ sub SetImportRecordMatches {
 # internal functions
 
 sub _create_import_record {
-    my ($batch_id, $record_sequence, $marc_record, $record_type, $encoding, $z3950random) = @_;
+    my ($batch_id, $record_sequence, $marc_record, $record_type, $encoding, $z3950random, $marc_type) = @_;
 
     my $dbh = C4::Context->dbh;
     my $sth = $dbh->prepare("INSERT INTO import_records (import_batch_id, record_sequence, marc, marcxml, 
                                                          record_type, encoding, z3950random)
                                     VALUES (?, ?, ?, ?, ?, ?, ?)");
-    $sth->execute($batch_id, $record_sequence, $marc_record->as_usmarc(), $marc_record->as_xml(),
+    $sth->execute($batch_id, $record_sequence, $marc_record->as_usmarc(), $marc_record->as_xml($marc_type),
                   $record_type, $encoding, $z3950random);
     my $import_record_id = $dbh->{'mysql_insertid'};
     $sth->finish();
@@ -1241,12 +1363,26 @@ sub _create_import_record {
 }
 
 sub _update_import_record_marc {
-    my ($import_record_id, $marc_record) = @_;
+    my ($import_record_id, $marc_record, $marc_type) = @_;
 
     my $dbh = C4::Context->dbh;
     my $sth = $dbh->prepare("UPDATE import_records SET marc = ?, marcxml = ?
                              WHERE  import_record_id = ?");
-    $sth->execute($marc_record->as_usmarc(), $marc_record->as_xml(C4::Context->preference('marcflavour')), $import_record_id);
+    $sth->execute($marc_record->as_usmarc(), $marc_record->as_xml($marc_type), $import_record_id);
+    $sth->finish();
+}
+
+sub _add_auth_fields {
+    my ($import_record_id, $marc_record) = @_;
+
+    my $controlnumber;
+    if ($marc_record->field('001')) {
+        $controlnumber = $marc_record->field('001')->data();
+    }
+    my $authorized_heading = C4::AuthoritiesMarc::GetAuthorizedHeading({ record => $marc_record });
+    my $dbh = C4::Context->dbh;
+    my $sth = $dbh->prepare("INSERT INTO import_auths (import_record_id, control_number, authorized_heading) VALUES (?, ?, ?)");
+    $sth->execute($import_record_id, $controlnumber, $authorized_heading);
     $sth->finish();
 }
 
@@ -1293,11 +1429,10 @@ sub _update_batch_record_counts {
 
     my $dbh = C4::Context->dbh;
     my $sth = $dbh->prepare_cached("UPDATE import_batches SET
-                                        num_biblios = (
+                                        num_records = (
                                             SELECT COUNT(*)
                                             FROM import_records
-                                            WHERE import_batch_id = import_batches.import_batch_id
-                                            AND record_type = 'biblio'),
+                                            WHERE import_batch_id = import_batches.import_batch_id),
                                         num_items = (
                                             SELECT COUNT(*)
                                             FROM import_records
@@ -1311,26 +1446,45 @@ sub _update_batch_record_counts {
 }
 
 sub _get_commit_action {
-    my ($overlay_action, $nomatch_action, $item_action, $overlay_status, $import_record_id) = @_;
+    my ($overlay_action, $nomatch_action, $item_action, $overlay_status, $import_record_id, $record_type) = @_;
     
-    my ($bib_result, $bib_match, $item_result);
-
-    if ($overlay_status ne 'no_match') {
-        $bib_match = GetBestRecordMatch($import_record_id);
-        if ($overlay_action eq 'replace') {
-            $bib_result  = defined($bib_match) ? 'replace' : 'create_new';
-        } elsif ($overlay_action eq 'create_new') {
-            $bib_result  = 'create_new';
-        } elsif ($overlay_action eq 'ignore') {
-            $bib_result  = 'ignore';
-        } 
-        $item_result = ($item_action eq 'always_add' or $item_action eq 'add_only_for_matches') ? 'create_new' : 'ignore';
-    } else {
-        $bib_result = $nomatch_action;
-        $item_result = ($item_action eq 'always_add' or $item_action eq 'add_only_for_new')     ? 'create_new' : 'ignore';
-    }
+    if ($record_type eq 'biblio') {
+        my ($bib_result, $bib_match, $item_result);
+
+        if ($overlay_status ne 'no_match') {
+            $bib_match = GetBestRecordMatch($import_record_id);
+            if ($overlay_action eq 'replace') {
+                $bib_result  = defined($bib_match) ? 'replace' : 'create_new';
+            } elsif ($overlay_action eq 'create_new') {
+                $bib_result  = 'create_new';
+            } elsif ($overlay_action eq 'ignore') {
+                $bib_result  = 'ignore';
+            }
+            $item_result = ($item_action eq 'always_add' or $item_action eq 'add_only_for_matches') ? 'create_new' : 'ignore';
+        } else {
+            $bib_result = $nomatch_action;
+            $item_result = ($item_action eq 'always_add' or $item_action eq 'add_only_for_new')     ? 'create_new' : 'ignore';
+        }
+        return ($bib_result, $item_result, $bib_match);
+    } else { # must be auths
+        my ($auth_result, $auth_match);
+
+        if ($overlay_status ne 'no_match') {
+            $auth_match = GetBestRecordMatch($import_record_id);
+            if ($overlay_action eq 'replace') {
+                $auth_result  = defined($auth_match) ? 'replace' : 'create_new';
+            } elsif ($overlay_action eq 'create_new') {
+                $auth_result  = 'create_new';
+            } elsif ($overlay_action eq 'ignore') {
+                $auth_result  = 'ignore';
+            }
+        } else {
+            $auth_result = $nomatch_action;
+        }
 
-    return ($bib_result, $item_result, $bib_match);
+        return ($auth_result, undef, $auth_match);
+
+    }
 }
 
 sub _get_revert_action {
index b81b393..72873f2 100644 (file)
@@ -515,7 +515,7 @@ sub _createTmpDir
         mkdir $tempdir;
     };
     if ($@) {
-        return undef;
+        return;
     } else {
         return $tempdir;
     }
@@ -547,27 +547,28 @@ sub createODS
         $tempdir = _createTmpDir($tmp);
     }
     if ($tempdir) {
+        my $fh;
         # populate tempdir directory with the ods elements
         eval {
-            if (open(OUT, "> $tempdir/content.xml")) {
-                print OUT $strContent;
-                close(OUT);
+            if (open($fh, '>',  "$tempdir/content.xml")) {
+                print {$fh} $strContent;
+                close($fh);
             }
-            if (open(OUT, "> $tempdir/mimetype")) {
-                print OUT 'application/vnd.oasis.opendocument.spreadsheet';
-                close(OUT);
+            if (open($fh, '>', "$tempdir/mimetype")) {
+                print {$fh} 'application/vnd.oasis.opendocument.spreadsheet';
+                close($fh);
             }
-            if (open(OUT, "> $tempdir/meta.xml")) {
-                print OUT _getMeta($lang);
-                close(OUT);
+            if (open($fh, '>', "$tempdir/meta.xml")) {
+                print {$fh} _getMeta($lang);
+                close($fh);
             }
-            if (open(OUT, "> $tempdir/styles.xml")) {
-                print OUT ODS_STYLES_STR;
-                close(OUT);
+            if (open($fh, '>', "$tempdir/styles.xml")) {
+                print {$fh} ODS_STYLES_STR;
+                close($fh);
             }
-            if (open(OUT, "> $tempdir/settings.xml")) {
-                print OUT ODS_SETTINGS_STR;
-                close(OUT);
+            if (open($fh, '>', "$tempdir/settings.xml")) {
+                print {$fh} ODS_SETTINGS_STR;
+                close($fh);
             }
             mkdir($tempdir.'/META-INF/');
             mkdir($tempdir.'/Configurations2/');
@@ -579,9 +580,10 @@ sub createODS
             mkdir($tempdir.'/Configurations2/menubar/');
             mkdir($tempdir.'/Configurations2/progressbar/');
             mkdir($tempdir.'/Configurations2/toolbar/');
-            if (open(OUT, "> $tempdir/META-INF/manifest.xml")) {
-                print OUT ODS_MANIFEST_STR;
-                close(OUT);
+
+            if (open($fh, '>', "$tempdir/META-INF/manifest.xml")) {
+                print {$fh} ODS_MANIFEST_STR;
+                close($fh);
             }
         };
         if ($@) {
@@ -604,13 +606,13 @@ sub createODS
             my $ok = 0;
             # read ods file and return as a string
             if (-f "$tempdir/new.ods") {
-                if (open (MYFILE, "$tempdir/new.ods")) {
-                    binmode MYFILE;
+                if (open ($fh, '<', "$tempdir/new.ods")) {
+                    binmode $fh;
                     my $buffer;
-                    while (read (MYFILE, $buffer, 65536)) {
+                    while (read ($fh, $buffer, 65536)) {
                         $$strODSRef .= $buffer;
                     }
-                    close(MYFILE);
+                    close($fh);
                     $ok = 1;
                 }
             }
index c1f356f..304698e 100644 (file)
@@ -154,8 +154,8 @@ sub marc_framework_sql_list {
         my @frameworklist;
         map {
             my $name = substr( $_, 0, -4 );
-            open FILE, "<:utf8","$dir/$requirelevel/$name.txt";
-            my $lines = <FILE>;
+            open my $fh, "<:encoding(UTF-8)", "$dir/$requirelevel/$name.txt";
+            my $lines = <$fh>;
             $lines =~ s/\n|\r/<br \/>/g;
             use utf8;
             utf8::encode($lines) unless ( utf8::is_utf8($lines) );
@@ -232,8 +232,8 @@ sub sample_data_sql_list {
         my @frameworklist;
         map {
             my $name = substr( $_, 0, -4 );
-            open FILE, "<:utf8","$dir/$requirelevel/$name.txt";
-            my $lines = <FILE>;
+            open my $fh , "<:encoding(UTF-8)", "$dir/$requirelevel/$name.txt";
+            my $lines = <$fh>;
             $lines =~ s/\n|\r/<br \/>/g;
             use utf8;
             utf8::encode($lines) unless ( utf8::is_utf8($lines) );
index 263ae40..71f35d4 100644 (file)
@@ -202,7 +202,7 @@ our $PERL_DEPS = {
     'DateTime::TimeZone' => {
         'usage'    => 'Core',
         'required' => '1',
-        'min_ver'  => '1.26'
+        'min_ver'  => '1.20'
     },
     'DateTime::Format::DateParse' => {
         'usage'    => 'Core',
@@ -576,12 +576,12 @@ our $PERL_DEPS = {
     },
     'DBD::Mock' => {
         'usage'    => 'Core',
-        'required' => '0',
+        'required' => '1',
         'min_ver'  => '1.39'
     },
     'Test::MockModule' => {
         'usage'    => 'Core',
-        'required' => '0',
+        'required' => '1',
         'min_ver'  => '0.05',
     },
     'Test::Warn' => {
@@ -593,7 +593,11 @@ our $PERL_DEPS = {
         'usage'    => 'Core',
         'required' => '0',
         'min_ver'  => '0.14',
-
+    },
+    'Test::Deep' => {
+        'usage'    => 'Core',
+        'required' => '0',
+        'min_ver'  => '0.106',
     },
     'Test::YAML::Valid' => {
         'usage'    => 'Core',
@@ -610,6 +614,21 @@ our $PERL_DEPS = {
         'required' => '1',
         'min_ver'  => '1.23',
     },
+    'AnyEvent' => {
+        'usage'    => 'Command line scripts',
+        'required' => '0',
+        'min_ver'  => '5.0',
+    },
+    'AnyEvent::HTTP' => {
+        'usage'    => 'Command line scripts',
+        'required' => '0',
+        'min_ver'  => '2.13',
+    },
+    'Moose' => {
+        'usage'    => 'Core',
+        'required' => '0',
+        'min_ver'  => '1.09',
+      },
 };
 
 1;
index 3d8bed4..4d88fec 100644 (file)
@@ -167,7 +167,7 @@ sub create {
             return $class->new($self);
         } else {
             carp $dbh->errstr;
-            return undef;
+            return;
         }
     }
 }
@@ -404,7 +404,7 @@ sub AUTOLOAD {
     if (exists $self->{$attr}) {
         return $self->{$attr};
     } else {
-        return undef;
+        return;
     }
 }
 
index e9af3dd..253078d 100644 (file)
@@ -440,6 +440,7 @@ my %default_values_for_mod_from_marc = (
     booksellerid         => undef, 
     ccode                => undef, 
     'items.cn_source'    => undef, 
+    coded_location_qualifier => undef,
     copynumber           => undef, 
     damaged              => 0,
 #    dateaccessioned      => undef,
@@ -530,7 +531,7 @@ sub ModItem {
         $item->{'more_subfields_xml'} = _get_unlinked_subfields_xml($unlinked_item_subfields);
     };
 
-    $item->{'itemnumber'} = $itemnumber or return undef;
+    $item->{'itemnumber'} = $itemnumber or return;
 
     $item->{onloan} = undef if $item->{itemlost};
 
@@ -1277,13 +1278,14 @@ sub GetItemsInfo {
 
         # get notforloan complete status if applicable
         if ( my $code = C4::Koha::GetAuthValCode( 'items.notforloan', $data->{frameworkcode} ) ) {
-            $data->{notforloanvalue} = C4::Koha::GetAuthorisedValueByCode( $code, $data->{itemnotforloan} );
+            $data->{notforloanvalue}     = C4::Koha::GetKohaAuthorisedValueLib( $code, $data->{itemnotforloan} );
+            $data->{notforloanvalueopac} = C4::Koha::GetKohaAuthorisedValueLib( $code, $data->{itemnotforloan}, 1 );
         }
 
         # get restricted status and description if applicable
         if ( my $code = C4::Koha::GetAuthValCode( 'items.restricted', $data->{frameworkcode} ) ) {
             $data->{restricted}     = C4::Koha::GetKohaAuthorisedValueLib( $code, $data->{restricted} );
-            $data->{restrictedopac} = C4::Koha::GetKohaAuthorisedValueLib( $code, $data->{restricted}, 'opac' );
+            $data->{restrictedopac} = C4::Koha::GetKohaAuthorisedValueLib( $code, $data->{restricted}, 1 );
         }
 
         # my stack procedures
@@ -2076,6 +2078,7 @@ sub _koha_new_item {
             itemlost            = ?,
             wthdrawn            = ?,
             itemcallnumber      = ?,
+            coded_location_qualifier = ?,
             restricted          = ?,
             itemnotes           = ?,
             holdingbranch       = ?,
@@ -2117,6 +2120,7 @@ sub _koha_new_item {
             $item->{'itemlost'},
             $item->{'wthdrawn'},
             $item->{'itemcallnumber'},
+            $item->{'coded_location_qualifier'},
             $item->{'restricted'},
             $item->{'itemnotes'},
             $item->{'holdingbranch'},
@@ -2293,7 +2297,7 @@ sub _koha_delete_item {
     # delete from items table
     $sth = $dbh->prepare("DELETE FROM items WHERE itemnumber=?");
     $sth->execute($itemnum);
-    return undef;
+    return;
 }
 
 =head2 _marc_from_item_hash
@@ -2668,7 +2672,10 @@ sub PrepareItemrecordDisplay {
                 if (   ( $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.location' )
                     && $defaultvalues
                     && $defaultvalues->{'location'} ) {
-                    my $temp = $itemrecord->field($subfield) if ($itemrecord);
+
+                    my $temp; # make perlcritic happy :)
+                    $temp = $itemrecord->field($subfield) if ($itemrecord);
+
                     unless ($temp) {
                         $defaultvalue = $defaultvalues->{location} if $defaultvalues;
                     }
index 4d98fd5..d38729a 100644 (file)
@@ -112,7 +112,7 @@ sub slashifyDate {
 }
 
 # FIXME.. this should be moved to a MARC-specific module
-sub subfield_is_koha_internal_p ($) {
+sub subfield_is_koha_internal_p {
     my ($subfield) = @_;
 
     # We could match on 'lib' and 'tab' (and 'mandatory', & more to come!)
@@ -471,7 +471,7 @@ sub getitemtypeimagesrc {
        }
 }
 
-sub getitemtypeimagelocation($$) {
+sub getitemtypeimagelocation {
        my ( $src, $image ) = @_;
 
        return '' if ( !$image );
@@ -630,7 +630,7 @@ sub GetPrinters {
 
 =cut
 
-sub GetPrinter ($$) {
+sub GetPrinter {
     my ( $query, $printers ) = @_;    # get printer for this query from printers
     my $printer = $query->param('printer');
     my %cookie = $query->cookie('userenv');
@@ -687,19 +687,19 @@ sub getFacets {
             {
                 idx   => 'su-to',
                 label => 'Topics',
-                tags  => [ qw/ 600a 601a 602a 603a 604a 605a 606ax 610a/ ],
+                tags  => [ qw/ 600ab 601ab 602a 604at 605a 606ax 610a / ],
                 sep   => ' - ',
             },
             {
                 idx   => 'su-geo',
                 label => 'Places',
-                tags  => [ qw/ 651a / ],
+                tags  => [ qw/ 607a / ],
                 sep   => ' - ',
             },
             {
                 idx   => 'su-ut',
                 label => 'Titles',
-                tags  => [ qw/ 500a 501a 502a 503a 504a / ],
+                tags  => [ qw/ 500a 501a 503a / ],
                 sep   => ', ',
             },
             {
@@ -1127,7 +1127,7 @@ sub GetKohaAuthorisedValues {
        }
        return \%values;
   } else {
-       return undef;
+       return;
   }
 }
 
@@ -1158,7 +1158,7 @@ sub GetKohaAuthorisedValuesFromField {
        }
        return \%values;
   } else {
-       return undef;
+       return;
   }
 }
 
@@ -1260,7 +1260,7 @@ sub GetNormalizedISBN {
         $isbn =~ s/(.*)( \| )(.*)/$1/;
         return _isbn_cleanup($isbn);
     }
-    return undef unless $record;
+    return unless $record;
 
     if ($marcflavour eq 'UNIMARC') {
         @fields = $record->field('010');
@@ -1269,7 +1269,7 @@ sub GetNormalizedISBN {
             if ($isbn) {
                 return _isbn_cleanup($isbn);
             } else {
-                return undef;
+                return;
             }
         }
     }
@@ -1280,7 +1280,7 @@ sub GetNormalizedISBN {
             if ($isbn) {
                 return _isbn_cleanup($isbn);
             } else {
-                return undef;
+                return;
             }
         }
     }
@@ -1325,7 +1325,7 @@ sub GetNormalizedOCLCNumber {
                 $oclc =~ s/\(OCoLC\)//;
                 return $oclc;
             } else {
-                return undef;
+                return;
             }
         }
     }
index d0eed69..3a5ee2a 100644 (file)
@@ -119,7 +119,6 @@ Returns a reference to an array of hashes:
 sub getTranslatedLanguages {
     my ($interface, $theme, $current_language, $which) = @_;
     my $htdocs;
-    my $all_languages = getAllLanguages();
     my @languages;
     my @enabled_languages;
  
@@ -161,7 +160,7 @@ sub getTranslatedLanguages {
         $seen{$_}++ for @languages;
         @languages = keys %seen;
     }
-    return _build_languages_arrayref($all_languages,\@languages,$current_language,\@enabled_languages);
+    return _build_languages_arrayref(\@languages,$current_language,\@enabled_languages);
 }
 
 =head2 getAllLanguages
@@ -179,19 +178,35 @@ Returns a reference to an array of hashes:
 =cut
 
 sub getAllLanguages {
+    my $lang = shift;
+# if no parameter is passed to the function, it returns english languages names
+# if a $lang parameter conforming to RFC4646 syntax is passed, the function returns languages names translated in $lang
+# if a language name is not translated in $lang in database, the function returns english language name
     my @languages_loop;
     my $dbh=C4::Context->dbh;
-    my $current_language = shift || 'en';
+    my $default_language = 'en';
+    my $current_language = $default_language;
+    if ($lang) {
+        $current_language = regex_lang_subtags($lang)->{'language'};
+    }
     my $sth = $dbh->prepare('SELECT * FROM language_subtag_registry WHERE type=\'language\'');
     $sth->execute();
     while (my $language_subtag_registry = $sth->fetchrow_hashref) {
-
-        # pull out all the script descriptions for each language
+        my $desc;
+        # check if language name is stored in current language
+        my $sth4= $dbh->prepare("SELECT description FROM language_descriptions WHERE type='language' AND subtag =? AND lang = ?");
+        $sth4->execute($language_subtag_registry->{subtag},$current_language);
+        while (my $language_desc = $sth4->fetchrow_hashref) {
+             $desc=$language_desc->{description};
+        }
         my $sth2= $dbh->prepare("SELECT * FROM language_descriptions LEFT JOIN language_rfc4646_to_iso639 on language_rfc4646_to_iso639.rfc4646_subtag = language_descriptions.subtag WHERE type='language' AND subtag =? AND language_descriptions.lang = ?");
-        $sth2->execute($language_subtag_registry->{subtag},$current_language);
-
+        if ($desc) {
+            $sth2->execute($language_subtag_registry->{subtag},$current_language);
+        }
+        else {
+            $sth2->execute($language_subtag_registry->{subtag},$default_language);
+        }
         my $sth3 = $dbh->prepare("SELECT description FROM language_descriptions WHERE type='language' AND subtag=? AND lang=?");
-
         # add the correct description info
         while (my $language_descriptions = $sth2->fetchrow_hashref) {
             $sth3->execute($language_subtag_registry->{subtag},$language_subtag_registry->{subtag});
@@ -276,7 +291,7 @@ FIXME: this could be rewritten and simplified using map
 =cut
 
 sub _build_languages_arrayref {
-        my ($all_languages,$translated_languages,$current_language,$enabled_languages) = @_;
+        my ($translated_languages,$current_language,$enabled_languages) = @_;
         my @translated_languages = @$translated_languages;
         my @languages_loop; # the final reference to an array of hashrefs
         my @enabled_languages = @$enabled_languages;
index 0b6a9be..f646241 100644 (file)
@@ -148,9 +148,12 @@ my %letter;
 sub getletter {
     my ( $module, $code, $branchcode ) = @_;
 
+    $branchcode ||= '';
+
     if ( C4::Context->preference('IndependantBranches')
             and $branchcode
             and C4::Context->userenv ) {
+
         $branchcode = C4::Context->userenv->{'branch'};
     }
 
index 59b5876..c0634ec 100644 (file)
@@ -1,6 +1,6 @@
 package C4::Matcher;
 
-# Copyright (C) 2007 LibLime
+# Copyright (C) 2007 LibLime, 2012 C & P Bibliography Services
 #
 # This file is part of Koha.
 #
@@ -22,8 +22,6 @@ use warnings;
 
 use C4::Context;
 use MARC::Record;
-use C4::Search;
-use C4::Biblio;
 
 use vars qw($VERSION);
 
@@ -384,6 +382,20 @@ sub delete {
     $sth->execute($matcher_id); # relying on cascading deletes to clean up everything
 }
 
+=head2 record_type
+
+  $matcher->record_type('biblio');
+  my $record_type = $matcher->record_type();
+
+Accessor method.
+
+=cut
+
+sub record_type {
+    my $self = shift;
+    @_ ? $self->{'record_type'} = shift : $self->{'record_type'};
+}
+
 =head2 threshold
 
   $matcher->threshold(1000);
@@ -582,7 +594,7 @@ sub add_simple_required_check {
     );
 }
 
-=head2 find_matches
+=head2 get_matches
 
   my @matches = $matcher->get_matches($marc_record, $max_matches);
   foreach $match (@matches) {
@@ -618,9 +630,37 @@ sub get_matches {
         my @source_keys = _get_match_keys($source_record, $matchpoint);
         next if scalar(@source_keys) == 0;
         # build query
-        my $query = join(" or ", map { "$matchpoint->{'index'}=$_" } @source_keys);
-        # FIXME only searching biblio index at the moment
-        my ($error, $searchresults, $total_hits) = SimpleSearch($query, 0, $max_matches);
+        my $query;
+        my $error;
+        my $searchresults;
+        my $total_hits;
+        if ($self->{'record_type'} eq 'biblio') {
+            $query = join(" or ", map { "$matchpoint->{'index'}=$_" } @source_keys);
+# FIXME only searching biblio index at the moment
+            require C4::Search;
+            ($error, $searchresults, $total_hits) = C4::Search::SimpleSearch($query, 0, $max_matches);
+        } elsif ($self->{'record_type'} eq 'authority') {
+            my $authresults;
+            my @marclist;
+            my @and_or;
+            my @excluding = [];
+            my @operator;
+            my @value;
+            foreach my $key (@source_keys) {
+                push @marclist, $matchpoint->{'index'};
+                push @and_or, 'or';
+                push @operator, 'exact';
+                push @value, $key;
+            }
+            require C4::AuthoritiesMarc;
+            ($authresults, $total_hits) = C4::AuthoritiesMarc::SearchAuthorities(
+                    \@marclist, \@and_or, \@excluding, \@operator,
+                    \@value, 0, 20, undef, 'AuthidAsc', 1
+            );
+            foreach my $result (@$authresults) {
+                push @$searchresults, $result->{'authid'};
+            }
+        }
 
         if (defined $error ) {
             warn "search failed ($query) $error";
@@ -636,16 +676,23 @@ sub get_matches {
 
     # get rid of any that don't meet the required checks
     %matches = map { _passes_required_checks($source_record, $_, $self->{'required_checks'}) ?  ($_ => $matches{$_}) : () } 
-                keys %matches;
+                keys %matches unless ($self->{'record_type'} eq 'auth');
 
     my @results = ();
-    foreach my $marcblob (keys %matches) {
-        my $target_record = MARC::Record->new_from_usmarc($marcblob);
-        my $result = TransformMarcToKoha(C4::Context->dbh, $target_record, '');
-        # FIXME - again, bibliospecific
-        # also, can search engine be induced to give just the number in the first place?
-        my $record_number = $result->{'biblionumber'};
-        push @results, { 'record_id' => $record_number, 'score' => $matches{$marcblob} };
+    if ($self->{'record_type'} eq 'biblio') {
+        require C4::Biblio;
+        foreach my $marcblob (keys %matches) {
+            my $target_record = MARC::Record->new_from_usmarc($marcblob);
+            my $record_number;
+            my $result = C4::Biblio::TransformMarcToKoha(C4::Context->dbh, $target_record, '');
+            $record_number = $result->{'biblionumber'};
+            push @results, { 'record_id' => $record_number, 'score' => $matches{$marcblob} };
+        }
+    } elsif ($self->{'record_type'} eq 'authority') {
+        require C4::AuthoritiesMarc;
+        foreach my $authid (keys %matches) {
+            push @results, { 'record_id' => $authid, 'score' => $matches{$authid} };
+        }
     }
     @results = sort { $b->{'score'} cmp $a->{'score'} } @results;
     if (scalar(@results) > $max_matches) {
@@ -673,6 +720,7 @@ sub dump {
     $result->{'matcher_id'} = $self->{'id'};
     $result->{'code'} = $self->{'code'};
     $result->{'description'} = $self->{'description'};
+    $result->{'record_type'} = $self->{'record_type'};
 
     $result->{'matchpoints'} = [];
     foreach my $matchpoint (@{ $self->{'matchpoints'} }) {
index 5386968..a63b3ca 100644 (file)
@@ -106,7 +106,7 @@ sub find {
     if (@$msgs) {
         return $class->new($msgs->[0]);
     } else {
-        return undef;
+        return;
     }
 }
 
@@ -142,7 +142,7 @@ sub find_last_message {
     if (@$msgs) {
         return $class->new($msgs->[0]);
     } else {
-        return undef;
+        return;
     }
 }
 
@@ -316,7 +316,7 @@ sub append {
     }
     if (not $self->metadata) {
         carp "Can't append to messages that don't have metadata.";
-        return undef;
+        return;
     }
     my $metadata = $self->metadata;
     push @{$metadata->{body}}, $item;
index 57faa00..e1be3e7 100644 (file)
@@ -125,7 +125,7 @@ This function returns HTML, without any language dependency.
 =cut
 
 sub pagination_bar {
-       my $base_url = (@_ ? shift : $ENV{SCRIPT_NAME} . $ENV{QUERY_STRING}) or return undef;
+       my $base_url = (@_ ? shift : $ENV{SCRIPT_NAME} . $ENV{QUERY_STRING}) or return;
     my $nb_pages       = (@_) ? shift : 1;
     my $current_page   = (@_) ? shift : undef; # delay default until later
     my $startfrom_name = (@_) ? shift : 'page';
@@ -267,7 +267,7 @@ $status is an HTTP status message, like '403 Authentication Required'. It defaul
 
 =cut
 
-sub output_with_http_headers($$$$;$) {
+sub output_with_http_headers {
     my ( $query, $cookie, $data, $content_type, $status ) = @_;
     $status ||= '200 OK';
 
@@ -305,7 +305,7 @@ sub output_with_http_headers($$$$;$) {
     print $query->header($options), $data;
 }
 
-sub output_html_with_http_headers ($$$;$) {
+sub output_html_with_http_headers {
     my ( $query, $cookie, $data, $status ) = @_;
     output_with_http_headers( $query, $cookie, $data, 'html', $status );
 }
index d17f445..ac66c36 100644 (file)
@@ -263,10 +263,10 @@ sub CalcFine {
     my $chargeable_units = _get_chargeable_units($fine_unit, $start_date, $end_date, $branchcode);
     my $units_minus_grace = $chargeable_units - $data->{firstremind};
     my $amount = 0;
-    if ($data->{'chargeperiod'}  && $units_minus_grace  ) {
+    if ($data->{'chargeperiod'}  && ($units_minus_grace > 0)  ) {
         $amount = int($chargeable_units / $data->{'chargeperiod'}) * $data->{'fine'};# TODO fine calc should be in cents
     } else {
-        # a zero (or null)  chargeperiod means no charge.
+        # a zero (or null) chargeperiod or negative units_minus_grace value means no charge.
     }
     $amount = $data->{overduefinescap} if $data->{overduefinescap} && $amount > $data->{overduefinescap};
     $debug and warn sprintf("CalcFine returning (%s, %s, %s, %s)", $amount, $data->{'chargename'}, $units_minus_grace, $chargeable_units);
index 12aa107..6683119 100644 (file)
@@ -67,9 +67,11 @@ sub NetworkPrint {
     # set the queue to "file" (or " file", if real queues aren't allowed
     # to have spaces in them). Or perhaps if $queue eq "" and
     # $env->{file} ne "", then that should mean "print to $env->{file}".
+
+    my $fh;
     if ( $queue eq "" || $queue eq 'nulllp' ) {
         return;
-       #open( PRINTER, ">/tmp/kohaiss" );
+       #open( $fh, ">/tmp/kohaiss" );
     }
     else {
 
@@ -77,15 +79,15 @@ sub NetworkPrint {
         # This is a reasonable assumption, but only because every other
         # printing package has a wrapper script called 'lpr'. It'd still
         # be better to be able to customize this.
-        open( PRINTER, "| lpr -P $queue > /dev/null" )
+        open( $fh, "-|", "lpr -P $queue > /dev/null" )
           or die "Couldn't write to queue:$queue!\n";
     }
 
     #  print $queue;
     #open (FILE,">/tmp/$file");
-    print PRINTER $text;
-    print PRINTER "\r\n" x 7 ;
-    close PRINTER;
+    print $fh $text;
+    print $fh "\r\n" x 7 ;
+    close $fh;
 
     #system("lpr /tmp/$file");
 }
index 585d1e5..a380bf0 100644 (file)
@@ -2007,7 +2007,10 @@ sub MoveReserve {
             ModReserveFill($borr_res);
         }
 
-        if ($cancelreserve) { # cancel reserves on this item
+        if ( $cancelreserve eq 'revert' ) { ## Revert waiting reserve to priority 1
+            RevertWaitingStatus({ itemnumber => $itemnumber });
+        }
+        elsif ( $cancelreserve eq 'cancel' || $cancelreserve ) { # cancel reserves on this item
             CancelReserve(0, $res->{'itemnumber'}, $res->{'borrowernumber'});
             CancelReserve($res->{'biblionumber'}, 0, $res->{'borrowernumber'});
         }
@@ -2058,6 +2061,66 @@ sub MergeHolds {
     }
 }
 
+=head2 RevertWaitingStatus
+
+  $success = RevertWaitingStatus({ itemnumber => $itemnumber });
+
+  Reverts a 'waiting' hold back to a regular hold with a priority of 1.
+
+  Caveat: Any waiting hold fixed with RevertWaitingStatus will be an
+          item level hold, even if it was only a bibliolevel hold to
+          begin with. This is because we can no longer know if a hold
+          was item-level or bib-level after a hold has been set to
+          waiting status.
+
+=cut
+
+sub RevertWaitingStatus {
+    my ( $params ) = @_;
+    my $itemnumber = $params->{'itemnumber'};
+
+    return unless ( $itemnumber );
+
+    my $dbh = C4::Context->dbh;
+
+    ## Get the waiting reserve we want to revert
+    my $query = "
+        SELECT * FROM reserves
+        WHERE itemnumber = ?
+        AND found IS NOT NULL
+    ";
+    my $sth = $dbh->prepare( $query );
+    $sth->execute( $itemnumber );
+    my $reserve = $sth->fetchrow_hashref();
+
+    ## Increment the priority of all other non-waiting
+    ## reserves for this bib record
+    $query = "
+        UPDATE reserves
+        SET
+          priority = priority + 1
+        WHERE
+          biblionumber =  ?
+        AND
+          priority > 0
+    ";
+    $sth = $dbh->prepare( $query );
+    $sth->execute( $reserve->{'biblionumber'} );
+
+    ## Fix up the currently waiting reserve
+    $query = "
+    UPDATE reserves
+    SET
+      priority = 1,
+      found = NULL,
+      waitingdate = NULL
+    WHERE
+      reserve_id = ?
+    ";
+    $sth = $dbh->prepare( $query );
+    return $sth->execute( $reserve->{'reserve_id'} );
+}
+
 =head2 ReserveSlip
 
   ReserveSlip($branchcode, $borrowernumber, $biblionumber)
@@ -2081,9 +2144,9 @@ sub ReserveSlip {
         tables => {
             'reserves'    => $reserve,
             'branches'    => $reserve->{branchcode},
-            'borrowers'   => $reserve,
-            'biblio'      => $reserve,
-            'items'       => $reserve,
+            'borrowers'   => $reserve->{borrowernumber},
+            'biblio'      => $reserve->{biblionumber},
+            'items'       => $reserve->{itemnumber},
         },
     );
 }
index 6bf7192..ba85cd7 100644 (file)
@@ -22,14 +22,7 @@ use C4::Circulation;
 use C4::Members;
 use C4::Reserves;
 
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
-
-BEGIN {
-    $VERSION = 3.07.00.049;
-       require Exporter;
-       @ISA = qw(Exporter);
-       @EXPORT_OK = qw();
-}
+our $VERSION = 3.07.00.049;
 
 =head1 EXAMPLE
 
@@ -140,7 +133,7 @@ my %fields = (
 );
 
 sub next_hold {
-    my $self = shift or return;
+    my $self = shift;
     # use Data::Dumper; warn "next_hold() hold_shelf: " . Dumper($self->{hold_shelf}); warn "next_hold() pending_queue: " . $self->{pending_queue};
     foreach (@{$self->hold_shelf}) {    # If this item was taken from the hold shelf, then that reserve still governs
         next unless ($_->{itemnumber} and $_->{itemnumber} == $self->{itemnumber});
@@ -168,7 +161,7 @@ sub hold_patron_id {
 
 }
 sub hold_patron_name {
-    my $self = shift or return;
+    my $self = shift;
     my $borrowernumber = (@_ ? shift: $self->hold_patron_id()) or return;
     my $holder = GetMember(borrowernumber=>$borrowernumber);
     unless ($holder) {
@@ -186,7 +179,7 @@ sub hold_patron_name {
 }
 
 sub hold_patron_bcode {
-    my $self = shift or return;
+    my $self = shift;
     my $borrowernumber = (@_ ? shift: $self->hold_patron_id()) or return;
     my $holder = GetMember(borrowernumber => $borrowernumber);
     if ($holder) {
@@ -257,9 +250,11 @@ sub sip_circulation_status {
 }
 
 sub sip_security_marker {
+    my $self = shift;
     return '02';       # FIXME? 00-other; 01-None; 02-Tattle-Tape Security Strip (3M); 03-Whisper Tape (3M)
 }
 sub sip_fee_type {
+    my $self = shift;
     return '01';    # FIXME? 01-09 enumerated in spec.  We just use O1-other/unknown.
 }
 
@@ -354,7 +349,7 @@ sub _barcode_to_borrowernumber {
     return $member->{borrowernumber};
 }
 sub barcode_is_borrowernumber {    # because hold_queue only has borrowernumber...
-    my $self = shift;   # not really used
+    my $self = shift;
     my $barcode = shift;
     my $number  = shift or return;    # can't be zero
     return unless defined $barcode; # might be 0 or 000 or 000000
index d3a9762..69389eb 100644 (file)
@@ -23,13 +23,7 @@ use C4::Reserves;
 use C4::Branch qw(GetBranchName);
 use Digest::MD5 qw(md5_base64);
 
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
-
-BEGIN {
-    $VERSION = 3.07.00.049;
-       @ISA = qw(Exporter);
-       @EXPORT_OK = qw(invalid_patron);
-}
+our $VERSION = 3.07.00.049;
 
 our $kp;       # koha patron
 
@@ -253,7 +247,7 @@ sub drop_hold {
 # from the SIP request.  Note those incoming values are 1-indexed, not 0-indexed.
 #
 sub x_items {
-    my $self      = shift or return;
+    my $self      = shift;
     my $array_var = shift or return;
     my ($start, $end) = @_;
        $self->{$array_var} or return [];
@@ -268,28 +262,28 @@ sub x_items {
 # List of outstanding holds placed
 #
 sub hold_items {
-    my $self = shift or return;
+    my $self = shift;
     return $self->x_items('hold_items', @_);
 }
 
 sub overdue_items {
-    my $self = shift or return;
+    my $self = shift;
     return $self->x_items('overdue_items', @_);
 }
 sub charged_items {
-    my $self = shift or return;
+    my $self = shift;
     return $self->x_items('items', @_);
 }
 sub fine_items {
-    my $self = shift or return;
+    my $self = shift;
     return $self->x_items('fine_items', @_);
 }
 sub recall_items {
-    my $self = shift or return;
+    my $self = shift;
     return $self->x_items('recall_items', @_);
 }
 sub unavail_holds {
-    my $self = shift or return;
+    my $self = shift;
     return $self->x_items('unavail_holds', @_);
 }
 
@@ -321,16 +315,16 @@ sub inet_privileges {
 }
 
 sub fee_limit {
-    my $self = shift;
+    my $self = shift;
     return C4::Context->preference("noissuescharge") || 5;
 }
 
 sub excessive_fees {
-    my $self = shift or return;
+    my $self = shift;
     return ($self->fee_amount and $self->fee_amount > $self->fee_limit);
 }
 sub excessive_fines {
-    my $self = shift or return;
+    my $self = shift;
     return $self->excessive_fees;   # excessive_fines is the same thing as excessive_fees for Koha
 }
     
@@ -346,10 +340,12 @@ sub library_name {
 #
 
 sub invalid_patron {
+    my $self = shift;
     return "Please contact library staff";
 }
 
 sub charge_denied {
+    my $self = shift;
     return "Please contact library staff";
 }
 
index 47bd85d..49ce926 100644 (file)
@@ -17,7 +17,7 @@ use C4::Reserves qw( ModReserveAffect );
 use C4::Items qw( ModItemTransfer );
 use C4::Debug;
 
-our @ISA = qw(ILS::Transaction);
+use parent qw(ILS::Transaction);
 
 my %fields = (
     magnetic => 0,
index da7a1b0..c61eca6 100644 (file)
@@ -20,13 +20,11 @@ use C4::Circulation;
 use C4::Members;
 use C4::Reserves qw(ModReserveFill);
 use C4::Debug;
+use parent qw(ILS::Transaction);
 
-use vars qw($VERSION @ISA $debug);
+our $debug;
 
-BEGIN {
-    $VERSION = 3.07.00.049;
-       @ISA = qw(ILS::Transaction);
-}
+our $VERSION = 3.07.00.049;
 
 # Most fields are handled by the Transaction superclass
 my %fields = (
index 19bdd04..52619f4 100644 (file)
@@ -22,9 +22,8 @@ use strict;
 
 use C4::Accounts qw(recordpayment);
 use ILS;
-use base qw(ILS::Transaction);
+use parent qw(ILS::Transaction);
 
-use vars qw($VERSION @ISA $debug);
 
 our $debug   = 0;
 our $VERSION = 3.07.00.049;
index 3352c1c..a2ca13e 100644 (file)
@@ -12,13 +12,10 @@ use ILS::Transaction;
 use C4::Reserves;      # AddReserve
 use C4::Members;       # GetMember
 use C4::Biblio;                # GetBiblioFromItemNumber GetBiblioItemByBiblioNumber
+use parent qw(ILS::Transaction);
 
-use vars qw($VERSION @ISA);
 
-BEGIN {
-    $VERSION = 3.07.00.049;
-           @ISA = qw(ILS::Transaction);
-}
+our $VERSION = 3.07.00.049;
 
 my %fields = (
        expiration_date => 0,
index 1f0f567..aa300d4 100644 (file)
@@ -12,7 +12,7 @@ use ILS;
 use C4::Circulation;
 use C4::Members;
 
-use base qw(ILS::Transaction);
+use parent qw(ILS::Transaction);
 
 my %fields = (
     renewal_ok => 0,
index c7be96b..7cdb4bb 100644 (file)
@@ -12,7 +12,7 @@ use ILS::Item;
 
 use C4::Members qw( GetMember );
 
-use base qw(ILS::Transaction::Renew);
+use parent qw(ILS::Transaction::Renew);
 
 my %fields = (
     renewed   => [],
index 703c28d..21f5fa1 100644 (file)
@@ -248,7 +248,7 @@ Get the Primary Key field names of the table
 
 =cut
 
-sub GetPrimaryKeys($) {
+sub GetPrimaryKeys {
        my $tablename=shift;
        my $hash_columns=_get_columns($tablename);
        return  grep { $hash_columns->{$_}->{'Key'} =~/PRI/i}  keys %$hash_columns;
@@ -284,7 +284,7 @@ With
 
 =cut
 
-sub _get_columns($) {
+sub _get_columns {
     my ($tablename) = @_;
     unless ( exists( $hashref->{$tablename} ) ) {
         my $dbh = C4::Context->dbh;
@@ -314,7 +314,7 @@ If it is not for research purpose, filter primary keys
 
 =cut
 
-sub _filter_columns ($$;$) {
+sub _filter_columns {
        my ($tablename,$research, $filtercolumns)=@_;
        if ($filtercolumns){
                return (@$filtercolumns);
index 7c20780..1e850d9 100644 (file)
@@ -532,9 +532,9 @@ sub getRecords {
                             || ( $facets_info->{$link_value}->{'expanded'} ) )
                         {
 
-                      # Sanitize the link value ), ( will cause errors with CCL,
+                      # Sanitize the link value : parenthesis, question and exclamation mark will cause errors with CCL
                             my $facet_link_value = $one_facet;
-                            $facet_link_value =~ s/(\(|\))/ /g;
+                            $facet_link_value =~ s/[()!?¡¿؟]/ /g;
 
                             # fix the length that will display in the label,
                             my $facet_label_value = $one_facet;
@@ -1799,7 +1799,7 @@ sub searchResults {
             else {
 
                 # item is on order
-                if ( $item->{notforloan} == -1 ) {
+                if ( $item->{notforloan} < 0 ) {
                     $ordered_count++;
                 }
 
@@ -1837,7 +1837,7 @@ sub searchResults {
                 if (   $item->{wthdrawn}
                     || $item->{itemlost}
                     || $item->{damaged}
-                    || $item->{notforloan} > 0
+                    || $item->{notforloan}
                    || $reservestatus eq 'Waiting'
                     || ($transfertwhen ne ''))
                 {
@@ -1849,13 +1849,23 @@ sub searchResults {
                     $item->{status} = $item->{wthdrawn} . "-" . $item->{itemlost} . "-" . $item->{damaged} . "-" . $item->{notforloan};
 
                     # can place hold on item ?
-                    if ((!$item->{damaged} || C4::Context->preference('AllowHoldsOnDamagedItems'))
-                      && !$item->{itemlost}
-                      && !$item->{withdrawn}
-                    ) {
-                        $can_place_holds = 1;
+                    if ( !$item->{itemlost} ) {
+                        if ( !$item->{wthdrawn} ){
+                            if ( $item->{damaged} ){
+                                if ( C4::Context->preference('AllowHoldsOnDamagedItems') ){
+                                    # can place a hold on a damaged item if AllowHoldsOnDamagedItems is true
+                                    if ( ( !$item->{notforloan} || $item->{notforloan} < 0 ) ){
+                                        # item is either for loan or has notforloan < 0
+                                        $can_place_holds = 1;
+                                    }
+                                }
+                            } elsif ( $item->{notforloan} < 0 ) {
+                                # item is not damaged and notforloan is < 0
+                                $can_place_holds = 1;
+                            }
+                        }
                     }
-                    
+
                     $other_count++;
 
                     my $key = $prefix . $item->{status};
index eb620cc..0c4b60e 100644 (file)
@@ -93,7 +93,13 @@ sub GetSuppliersWithLateIssues {
     FROM            subscription
     LEFT JOIN       serial ON serial.subscriptionid=subscription.subscriptionid
     LEFT JOIN aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id
-    WHERE id > 0 AND ((planneddate < now() AND serial.status=1) OR serial.STATUS = 3 OR serial.STATUS = 4) ORDER BY name|;
+    WHERE id > 0
+        AND (
+            (planneddate < now() AND serial.status=1)
+            OR serial.STATUS = 3 OR serial.STATUS = 4
+        )
+        AND subscription.closed = 0
+    ORDER BY name|;
     return $dbh->selectall_arrayref($query, { Slice => {} });
 }
 
@@ -122,6 +128,7 @@ sub GetLateIssues {
             LEFT JOIN  aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id
             WHERE      ((planneddate < now() AND serial.STATUS =1) OR serial.STATUS = 3)
             AND        subscription.aqbooksellerid=?
+            AND        subscription.closed = 0
             ORDER BY   title
         |;
         $sth = $dbh->prepare($query);
@@ -134,6 +141,7 @@ 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.closed = 0
             ORDER BY   title
         |;
         $sth = $dbh->prepare($query);
@@ -160,7 +168,7 @@ After this function, don't forget to execute it by using $sth->execute($subscrip
 
 =cut
 
-sub GetSubscriptionHistoryFromSubscriptionId() {
+sub GetSubscriptionHistoryFromSubscriptionId {
     my $dbh   = C4::Context->dbh;
     my $query = qq|
         SELECT *
@@ -180,7 +188,7 @@ $sth = $dbh->prepare($query).
 
 =cut
 
-sub GetSerialStatusFromSerialId() {
+sub GetSerialStatusFromSerialId {
     my $dbh   = C4::Context->dbh;
     my $query = qq|
         SELECT status
@@ -662,8 +670,16 @@ sub SearchSubscriptions {
         push @where_args, $args->{biblionumber};
     }
     if( $args->{title} ){
-        push @where_strs, "biblio.title LIKE ?";
-        push @where_args, "%$args->{title}%";
+        my @words = split / /, $args->{title};
+        my (@strs, @args);
+        foreach my $word (@words) {
+            push @strs, "biblio.title LIKE ?";
+            push @args, "%$word%";
+        }
+        if (@strs) {
+            push @where_strs, '(' . join (' AND ', @strs) . ')';
+            push @where_args, @args;
+        }
     }
     if( $args->{issn} ){
         push @where_strs, "biblioitems.issn LIKE ?";
@@ -685,7 +701,10 @@ sub SearchSubscriptions {
         push @where_strs, "subscription.branchcode = ?";
         push @where_args, "$args->{branch}";
     }
-
+    if( defined $args->{closed} ){
+        push @where_strs, "subscription.closed = ?";
+        push @where_args, "$args->{closed}";
+    }
     if(@where_strs){
         $query .= " WHERE " . join(" AND ", @where_strs);
     }
@@ -1179,7 +1198,7 @@ $nextexepected = {
 
 =cut
 
-sub GetNextExpected($) {
+sub GetNextExpected {
     my ($subscriptionid) = @_;
     my $dbh              = C4::Context->dbh;
     my $sth              = $dbh->prepare('SELECT serialid, planneddate FROM serial WHERE subscriptionid=? AND status=?');
@@ -1214,7 +1233,7 @@ returns 0
 
 =cut
 
-sub ModNextExpected($$) {
+sub ModNextExpected {
     my ( $subscriptionid, $date ) = @_;
     my $dbh = C4::Context->dbh;
 
@@ -2295,7 +2314,7 @@ Return 0 if periodicity==0
 
 =cut
 
-sub GetNextDate(@) {
+sub GetNextDate {
     my ( $planneddate, $subscription ) = @_;
     my @irreg = split( /\,/, $subscription->{irregularity} );
 
@@ -2465,6 +2484,54 @@ sub is_barcode_in_use {
     return @{$occurences};
 }
 
+=head2 CloseSubscription
+Close a subscription given a subscriptionid
+=cut
+sub CloseSubscription {
+    my ( $subscriptionid ) = @_;
+    return unless $subscriptionid;
+    my $dbh = C4::Context->dbh;
+    my $sth = $dbh->prepare( qq{
+        UPDATE subscription
+        SET closed = 1
+        WHERE subscriptionid = ?
+    } );
+    $sth->execute( $subscriptionid );
+
+    # Set status = missing when status = stopped
+    $sth = $dbh->prepare( qq{
+        UPDATE serial
+        SET status = 8
+        WHERE subscriptionid = ?
+        AND status = 1
+    } );
+    $sth->execute( $subscriptionid );
+}
+
+=head2 ReopenSubscription
+Reopen a subscription given a subscriptionid
+=cut
+sub ReopenSubscription {
+    my ( $subscriptionid ) = @_;
+    return unless $subscriptionid;
+    my $dbh = C4::Context->dbh;
+    my $sth = $dbh->prepare( qq{
+        UPDATE subscription
+        SET closed = 0
+        WHERE subscriptionid = ?
+    } );
+    $sth->execute( $subscriptionid );
+
+    # Set status = expected when status = stopped
+    $sth = $dbh->prepare( qq{
+        UPDATE serial
+        SET status = 1
+        WHERE subscriptionid = ?
+        AND status = 8
+    } );
+    $sth->execute( $subscriptionid );
+}
+
 1;
 __END__
 
index 449190f..c885d90 100644 (file)
@@ -180,11 +180,16 @@ sub GetNearbyItems {
     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 (
+        $next_itemnumber, $next_biblionumber,
+        $prev_itemnumber, $prev_biblionumber
+    );
+
+    $next_itemnumber = $next_items[-1]->{itemnumber} if @next_items;
+    $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;
+    $prev_itemnumber = $prev_items[0]->{itemnumber} if @prev_items;
+    $prev_biblionumber = $prev_items[0]->{biblionumber} if @prev_items;
 
     my %result = (
         next                => \@next_items,
index 4786b2c..d74dbf8 100644 (file)
@@ -33,21 +33,21 @@ use vars qw($ext_dict $select_all @fields);
 BEGIN {
     $VERSION = 3.07.00.049;
        @ISA = qw(Exporter);
-       @EXPORT_OK = qw(
-               &get_tag &get_tags &get_tag_rows
-               &add_tags &add_tag
-               &delete_tag_row_by_id
-               &remove_tag
-               &delete_tag_rows_by_ids
-               &rectify_weights
-               &get_approval_rows
-               &blacklist
-               &whitelist
-               &is_approved
-               &approval_counts
-               &get_count_by_tag_status
-               &get_filters
-       );
+    @EXPORT_OK = qw(
+      &get_tag &get_tags &get_tag_rows
+      &add_tags &add_tag
+      &delete_tag_row_by_id
+      &remove_tag
+      &delete_tag_rows_by_ids
+      &get_approval_rows
+      &blacklist
+      &whitelist
+      &is_approved
+      &approval_counts
+      &get_count_by_tag_status
+      &get_filters
+      stratify_tags
+    );
        # %EXPORT_TAGS = ();
        $ext_dict = C4::Context->preference('TagsExternalDictionary');
        if ($debug) {
@@ -61,6 +61,12 @@ BEGIN {
        }
 }
 
+=head1 C4::Tags.pm - Support for user tagging of biblios.
+
+More verose debugging messages are sent in the presence of non-zero $ENV{"DEBUG"}.
+
+=cut
+
 INIT {
     $ext_dict and $Lingua::Ispell::path = $ext_dict;
     $debug and print STDERR "\$Lingua::Ispell::path = $Lingua::Ispell::path\n";
@@ -117,13 +123,13 @@ sub get_count_by_tag_status  {
 }
 
 sub remove_tag {
-       my $tag_id  = shift or return undef;
+       my $tag_id  = shift or return;
        my $user_id = (@_) ? shift : undef;
        my $rows = (defined $user_id) ?
                        get_tag_rows({tag_id=>$tag_id, borrowernumber=>$user_id}) :
                        get_tag_rows({tag_id=>$tag_id}) ;
        $rows or return 0;
-       (scalar(@$rows) == 1) or return undef;  # should never happen (duplicate ids)
+       (scalar(@$rows) == 1) or return;        # should never happen (duplicate ids)
        my $row = shift(@$rows);
        ($tag_id == $row->{tag_id}) or return 0;
        my $tags = get_tags({term=>$row->{term}, biblionumber=>$row->{biblionumber}});
@@ -145,25 +151,25 @@ sub remove_tag {
 }
 
 sub delete_tag_index {
-       (@_) or return undef;
+       (@_) or return;
        my $sth = C4::Context->dbh->prepare("DELETE FROM tags_index WHERE term = ? AND biblionumber = ? LIMIT 1");
        $sth->execute(@_);
        return $sth->rows || 0;
 }
 sub delete_tag_approval {
-       (@_) or return undef;
+       (@_) or return;
        my $sth = C4::Context->dbh->prepare("DELETE FROM tags_approval WHERE term = ? LIMIT 1");
        $sth->execute(shift);
        return $sth->rows || 0;
 }
 sub delete_tag_row_by_id {
-       (@_) or return undef;
+       (@_) or return;
        my $sth = C4::Context->dbh->prepare("DELETE FROM tags_all WHERE tag_id = ? LIMIT 1");
        $sth->execute(shift);
        return $sth->rows || 0;
 }
 sub delete_tag_rows_by_ids {
-       (@_) or return undef;
+       (@_) or return;
        my $i=0;
        foreach(@_) {
                $i += delete_tag_row_by_id($_);
@@ -359,7 +365,7 @@ sub get_approval_rows {             # i.e., from tags_approval
 }
 
 sub is_approved {
-       my $term = shift or return undef;
+       my $term = shift or return;
        my $sth = C4::Context->dbh->prepare("SELECT approved FROM tags_approval WHERE term = ?");
        $sth->execute($term);
        unless ($sth->rows) {
@@ -370,7 +376,7 @@ sub is_approved {
 }
 
 sub get_tag_index {
-       my $term = shift or return undef;
+       my $term = shift or return;
        my $sth;
        if (@_) {
                $sth = C4::Context->dbh->prepare("SELECT * FROM tags_index WHERE term = ? AND biblionumber = ?");
@@ -384,7 +390,7 @@ sub get_tag_index {
 
 sub whitelist {
        my $operator = shift;
-       defined $operator or return undef; # have to test defined to allow =0 (kohaadmin)
+       defined $operator or return; # have to test defined to allow =0 (kohaadmin)
        if ($ext_dict) {
                foreach (@_) {
                        spellcheck($_) or next;
@@ -406,7 +412,7 @@ sub whitelist {
 # a term mistakenly, you can still reverse it. But there is no going back to "neutral".
 sub blacklist {
        my $operator = shift;
-       defined $operator or return undef; # have to test defined to allow =0 (kohaadmin)
+       defined $operator or return; # have to test defined to allow =0 (kohaadmin)
        foreach (@_) {
                my $aref = get_approval_rows({term=>$_});
                if ($aref and scalar @$aref) {
@@ -419,14 +425,14 @@ sub blacklist {
 }
 sub add_filter {
        my $operator = shift;
-       defined $operator or return undef; # have to test defined to allow =0 (kohaadmin)
+       defined $operator or return; # have to test defined to allow =0 (kohaadmin)
        my $query = "INSERT INTO tags_blacklist (regexp,y,z) VALUES (?,?,?)";
        # my $sth = C4::Context->dbh->prepare($query);
        return scalar @_;
 }
 sub remove_filter {
        my $operator = shift;
-       defined $operator or return undef; # have to test defined to allow =0 (kohaadmin)
+       defined $operator or return; # have to test defined to allow =0 (kohaadmin)
        my $query = "REMOVE FROM tags_blacklist WHERE blacklist_id = ?";
        # my $sth = C4::Context->dbh->prepare($query);
        # $sth->execute($term);
@@ -435,7 +441,7 @@ sub remove_filter {
 
 sub add_tag_approval { # or disapproval
        $debug and warn "add_tag_approval(" . join(", ",map {defined($_) ? $_ : 'UNDEF'} @_) . ")";
-       my $term = shift or return undef;
+       my $term = shift or return;
        my $query = "SELECT * FROM tags_approval WHERE term = ?";
        my $sth = C4::Context->dbh->prepare($query);
        $sth->execute($term);
@@ -460,8 +466,8 @@ sub add_tag_approval {      # or disapproval
 
 sub mod_tag_approval {
        my $operator = shift;
-       defined $operator or return undef; # have to test defined to allow =0 (kohaadmin)
-       my $term     = shift or return undef;
+       defined $operator or return; # have to test defined to allow =0 (kohaadmin)
+       my $term     = shift or return;
        my $approval = (scalar @_ ? shift : 1); # default is to approve
        my $query = "UPDATE tags_approval SET approved_by=?, approved=?, date_approved=NOW() WHERE term = ?";
        $debug and print STDERR "mod_tag_approval query: $query\nmod_tag_approval args: ($operator,$approval,$term)\n";
@@ -470,8 +476,8 @@ sub mod_tag_approval {
 }
 
 sub add_tag_index {
-       my $term         = shift or return undef;
-       my $biblionumber = shift or return undef;
+       my $term         = shift or return;
+       my $biblionumber = shift or return;
        my $query = "SELECT * FROM tags_index WHERE term = ? AND biblionumber = ?";
        my $sth = C4::Context->dbh->prepare($query);
        $sth->execute($term,$biblionumber);
@@ -484,39 +490,12 @@ sub add_tag_index {
 }
 
 sub get_tag {          # by tag_id
-       (@_) or return undef;
+       (@_) or return;
        my $sth = C4::Context->dbh->prepare("$select_all WHERE tag_id = ?");
        $sth->execute(shift);
        return $sth->fetchrow_hashref;
 }
 
-sub rectify_weights {
-       my $dbh = C4::Context->dbh;
-       my $sth;
-       my $query = "
-       SELECT term,biblionumber,count(*) as count
-       FROM   tags_all
-       ";
-       (@_) and $query .= " WHERE term =? ";
-       $query .= " GROUP BY term,biblionumber ";
-       $sth = $dbh->prepare($query);
-       if (@_) {
-               $sth->execute(shift);
-       } else {
-               $sth->execute();
-       }
-       my $results = $sth->fetchall_arrayref({}) or return undef;
-       my %tally = ();
-       foreach (@$results) {
-               _set_weight($_->{count},$_->{term},$_->{biblionumber});
-               $tally{$_->{term}} += $_->{count};
-       }
-       foreach (keys %tally) {
-               _set_weight_total($tally{$_},$_);
-       }
-       return ($results,\%tally);
-}
-
 sub increment_weights {
        increment_weight(@_);
        increment_weight_total(shift);
@@ -557,12 +536,12 @@ sub _set_weight {
 }
 
 sub add_tag {  # biblionumber,term,[borrowernumber,approvernumber]
-       my $biblionumber = shift or return undef;
-       my $term         = shift or return undef;
+       my $biblionumber = shift or return;
+       my $term         = shift or return;
        my $borrowernumber = (@_) ? shift : 0;          # the user, default to kohaadmin
        $term =~ s/^\s+//;
        $term =~ s/\s+$//;
-       ($term) or return undef;        # must be more than whitespace
+       ($term) or return;      # must be more than whitespace
        my $rows = get_tag_rows({biblionumber=>$biblionumber, borrowernumber=>$borrowernumber, term=>$term, limit=>1});
        my $query = "INSERT INTO tags_all
        (borrowernumber,biblionumber,term,date_created)
@@ -571,7 +550,7 @@ sub add_tag {       # biblionumber,term,[borrowernumber,approvernumber]
                                                        "add_tag query args: ($borrowernumber,$biblionumber,$term)\n";
        if (scalar @$rows) {
                $debug and carp "Duplicate tag detected.  Tag not added.";      
-               return undef;
+               return;
        }
        # add to tags_all regardless of approaval
        my $sth = C4::Context->dbh->prepare($query);
@@ -594,13 +573,46 @@ sub add_tag {     # biblionumber,term,[borrowernumber,approvernumber]
        }
 }
 
+# This takes a set of tags, as returned by C<get_approval_rows> and divides
+# them up into a number of "strata" based on their weight. This is useful
+# to display them in a number of different sizes.
+#
+# Usage:
+#   ($min, $max) = stratify_tags($strata, $tags);
+# $stratum: the number of divisions you want
+# $tags: the tags, as provided by get_approval_rows
+# $min: the minumum stratum value
+# $max: the maximum stratum value. This may be the same as $min if there
+# is only one weight. Beware of divide by zeros.
+# This will add a field to the tag called "stratum" containing the calculated
+# value.
+sub stratify_tags {
+    my ( $strata, $tags ) = @_;
+
+    my ( $min, $max );
+    foreach (@$tags) {
+        my $w = $_->{weight_total};
+        $min = $w if ( !defined($min) || $min > $w );
+        $max = $w if ( !defined($max) || $max < $w );
+    }
+
+    # normalise min to zero
+    $max = $max - $min;
+    my $orig_min = $min;
+    $min = 0;
+
+    # if min and max are the same, just make it 1
+    my $span = ( $strata - 1 ) / ( $max || 1 );
+    foreach (@$tags) {
+        my $w = $_->{weight_total};
+        $_->{stratum} = int( ( $w - $orig_min ) * $span );
+    }
+    return ( $min, $max );
+}
+
 1;
 __END__
 
-=head1 C4::Tags.pm - Support for user tagging of biblios.
-
-More verose debugging messages are sent in the presence of non-zero $ENV{"DEBUG"}.
-
 =head2 add_tag(biblionumber,term[,borrowernumber])
 
 =head3 TO DO: Add real perldoc
index 31d50eb..dac9423 100644 (file)
@@ -35,12 +35,12 @@ BEGIN {
 }
 
 
-sub maxwidth (@) {
+sub maxwidth {
        (@_) or return 0;
        return (sort {$a <=> $b} map {length} @_)[-1];
 }
 
-sub hashdump ($$) {
+sub hashdump {
        my $pre = shift;
        my $val  = shift;
        if (ref($val) =~ /HASH/) {
index 8c0b15e..0bb4b56 100644 (file)
@@ -50,8 +50,6 @@ BEGIN {
 }
 
 
-my $dbh = C4::Context->dbh;
-
 =head1 NAME
 
 C4::VirtualShelves - Functions for manipulating Koha virtual shelves
@@ -101,6 +99,7 @@ sub GetShelves {
     my ($category, $row_count, $offset, $owner) = @_;
     my @params;
     my $total = _shelf_count($owner, $category);
+    my $dbh = C4::Context->dbh;
     my $query = qq{
         SELECT vs.shelfnumber, vs.shelfname,vs.owner,
         bo.surname,bo.firstname,vs.category,vs.sortfield,
@@ -155,6 +154,7 @@ the submitted parameters.
 sub GetAllShelves {
     my ($category,$owner,$adding_allowed) = @_;
     my @params;
+    my $dbh = C4::Context->dbh;
     my $query = 'SELECT vs.* FROM virtualshelves vs ';
     if($category==1) {
         $query.= qq{
@@ -184,6 +184,7 @@ Returns shelf names and numbers for Add to combo of search results and Lists but
 sub GetSomeShelfNames {
     my ($owner, $purpose, $adding_allowed)= @_;
     my ($bar, $pub, @params);
+    my $dbh = C4::Context->dbh;
 
     my $bquery = 'SELECT vs.shelfnumber, vs.shelfname FROM virtualshelves vs ';
     my $limit= ShelvesMax($purpose);
@@ -223,6 +224,7 @@ Returns the above-mentioned fields for passed virtual shelf number.
 
 sub GetShelf {
     my ($shelfnumber) = @_;
+    my $dbh = C4::Context->dbh;
     my $query = qq(
         SELECT shelfnumber, shelfname, owner, category, sortfield,
             allow_add, allow_delete_own, allow_delete_other
@@ -264,11 +266,12 @@ sub GetShelfContents {
         ($sortfield) = $sth2->fetchrow_array;
     }
     my $query =
-       " SELECT vc.biblionumber, vc.shelfnumber, vc.dateadded, itemtypes.*,
+       " SELECT DISTINCT vc.biblionumber, vc.shelfnumber, vc.dateadded, itemtypes.*,
             biblio.*, biblioitems.itemtype, biblioitems.publicationyear as year, biblioitems.publishercode, biblioitems.place, biblioitems.size, biblioitems.pages
          FROM   virtualshelfcontents vc
-         LEFT JOIN biblio      ON      vc.biblionumber =      biblio.biblionumber
+         JOIN biblio      ON      vc.biblionumber =      biblio.biblionumber
          LEFT JOIN biblioitems ON  biblio.biblionumber = biblioitems.biblionumber
+         LEFT JOIN items ON items.biblionumber=vc.biblionumber
          LEFT JOIN itemtypes   ON biblioitems.itemtype = itemtypes.itemtype
          WHERE  vc.shelfnumber=? ";
     my @params = ($shelfnumber);
@@ -306,6 +309,7 @@ Returns a code to know what's happen.
 
 sub AddShelf {
     my ($hashref, $owner)= @_;
+    my $dbh = C4::Context->dbh;
 
     #initialize missing hash values to silence warnings
     foreach('shelfname','category', 'sortfield', 'allow_add', 'allow_delete_own', 'allow_delete_other' ) {
@@ -343,6 +347,7 @@ C<$shelfnumber>, unless that bib is already on that shelf.
 sub AddToShelf {
     my ($biblionumber, $shelfnumber, $borrowernumber) = @_;
     return unless $biblionumber;
+    my $dbh = C4::Context->dbh;
     my $query = qq(
         SELECT *
         FROM   virtualshelfcontents
@@ -382,6 +387,7 @@ Returns 1 if the action seemed to be successful.
 
 sub ModShelf {
     my ($shelfnumber,$hashref) = @_;
+    my $dbh = C4::Context->dbh;
 
     my $query= "SELECT * FROM virtualshelves WHERE shelfnumber=?";
     my $sth = $dbh->prepare($query);
@@ -453,8 +459,9 @@ sub ShelfPossibleAction {
 
     return 0 unless defined($shelfnumber);
 
+    my $dbh = C4::Context->dbh;
     my $query = qq/
-        SELECT IFNULL(owner,0) AS owner, category, allow_add, allow_delete_own, allow_delete_other, IFNULL(sh.borrowernumber,0) AS borrowernumber
+        SELECT COALESCE(owner,0) AS owner, category, allow_add, allow_delete_own, allow_delete_other, COALESCE(sh.borrowernumber,0) AS borrowernumber
         FROM virtualshelves vs
         LEFT JOIN virtualshelfshares sh ON sh.shelfnumber=vs.shelfnumber
         AND sh.borrowernumber=?
@@ -500,6 +507,7 @@ Returns 0 if no items have been deleted.
 
 sub DelFromShelf {
     my ($bibref, $shelfnumber, $user) = @_;
+    my $dbh = C4::Context->dbh;
     my $query = qq(SELECT allow_delete_own, allow_delete_other FROM virtualshelves WHERE shelfnumber=?);
     my $sth= $dbh->prepare($query);
     $sth->execute($shelfnumber);
@@ -544,6 +552,7 @@ ShelfPossibleAction with manage parameter.
 sub DelShelf {
     my ($shelfnumber)= @_;
     return unless $shelfnumber && $shelfnumber =~ /^\d+$/;
+    my $dbh = C4::Context->dbh;
     my $sth = $dbh->prepare("DELETE FROM virtualshelves WHERE shelfnumber=?");
     return $sth->execute($shelfnumber);
 }
@@ -629,6 +638,7 @@ sub _shelf_count {
     my @params;
     # Find out how many shelves total meet the submitted criteria...
 
+    my $dbh = C4::Context->dbh;
     my $query = "SELECT count(*) FROM virtualshelves vs ";
     if($category==1) {
         $query.= qq{
@@ -661,6 +671,7 @@ sub _biblionumber_sth { #only used in obsolete sub below
 sub _CheckShelfName {
     my ($name, $cat, $owner, $number)= @_;
 
+    my $dbh = C4::Context->dbh;
     my $query = qq(
         SELECT DISTINCT shelfnumber
         FROM   virtualshelves
index 988244c..bf53563 100644 (file)
@@ -304,6 +304,7 @@ sub shelfpage {
                     viewshelf           => $shelfnumber,
                     authorsort          => $authorsort,
                     yearsort            => $yearsort,
+                    itemcallnumbersort  => $sortfield eq 'itemcallnumber',
                     manageshelf         => $manageshelf,
                     allowremovingitems  => ShelfPossibleAction( $loggedinuser, $shelfnumber, 'delete'),
                     allowaddingitem     => ShelfPossibleAction( $loggedinuser, $shelfnumber, 'add'),
@@ -418,6 +419,8 @@ sub shelfpage {
                 $shelflist->{$element}->{"authorsort"} = 'author';
             } elsif ( $sortfield eq 'year' ) {
                 $shelflist->{$element}->{"yearsort"} = 'year';
+            } elsif ( $sortfield eq 'itemcallnumber' ) {
+                $shelflist->{$element}->{"itemcallnumbersort"} = 'itemcallnumber';
             }
         }
         $shelflist->{$element}->{"viewcategory$category"} = 1;
index d17b828..19ec162 100644 (file)
@@ -166,9 +166,9 @@ sub XSLTParse4Display {
                        "slim2OPACResults.xsl";
         }
         $xslfilename = "$htdocs/$theme/$lang/xslt/$xslfile";
-        $xslfilename = "$htdocs/$theme/en/xslt/$xslfile" unless ( $lang ne 'en' && !-f $xslfilename );
-        $xslfilename = "$htdocs/prog/$lang/xslt/$xslfile" unless ( !-f $xslfilename );
-        $xslfilename = "$htdocs/prog/en/xslt/$xslfile" unless ( $lang ne 'en' && !-f $xslfilename );
+        $xslfilename = "$htdocs/$theme/en/xslt/$xslfile" unless ( $lang ne 'en' && -f $xslfilename );
+        $xslfilename = "$htdocs/prog/$lang/xslt/$xslfile" unless ( -f $xslfilename );
+        $xslfilename = "$htdocs/prog/en/xslt/$xslfile" unless ( $lang ne 'en' && -f $xslfilename );
     }
 
     if ( $xslfilename =~ m/\{langcode\}/ ) {
index 91a5463..d1660bb 100644 (file)
@@ -19,7 +19,7 @@ package Koha::Borrower::Files;
 
 use Modern::Perl;
 
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
+use vars qw($VERSION);
 
 use C4::Context;
 use C4::Output;
@@ -30,13 +30,6 @@ BEGIN {
 
     # set the version for version checking
     $VERSION = 0.01;
-    require Exporter;
-    @ISA    = qw(Exporter);
-    @EXPORT = qw(
-
-    );
-
-    my $debug = C4::Context->preference("DebugLevel");
 }
 
 =head1 NAME
index 2a2e062..90069b6 100644 (file)
@@ -85,78 +85,124 @@ sub _init {
 
 sub addDate {
     my ( $self, $startdate, $add_duration, $unit ) = @_;
-    my $base_date = $startdate->clone();
+
+    # Default to days duration (legacy support I guess)
     if ( ref $add_duration ne 'DateTime::Duration' ) {
         $add_duration = DateTime::Duration->new( days => $add_duration );
     }
-    $unit ||= q{};    # default days ?
-    my $days_mode = $self->{days_mode};
-    Readonly::Scalar my $return_by_hour => 10;
-    my $day_dur = DateTime::Duration->new( days => 1 );
-    if ( $add_duration->is_negative() ) {
-        $day_dur = DateTime::Duration->new( days => -1 );
+
+    $unit ||= 'days'; # default days ?
+    my $dt;
+
+    if ( $unit eq 'hours' ) {
+        # Fixed for legacy support. Should be set as a branch parameter
+        Readonly::Scalar my $return_by_hour => 10;
+
+        $dt = $self->addHours($startdate, $add_duration, $return_by_hour);
+    } else {
+        # days
+        $dt = $self->addDays($startdate, $add_duration);
     }
-    if ( $days_mode eq 'Datedue' ) {
 
-        my $dt = $base_date + $add_duration;
-        while ( $self->is_holiday($dt) ) {
+    return $dt;
+}
 
-            $dt->add_duration($day_dur);
-            if ( $unit eq 'hours' ) {
-                $dt->set_hour($return_by_hour);    # Staffs specific
-            }
+sub addHours {
+    my ( $self, $startdate, $hours_duration, $return_by_hour ) = @_;
+    my $base_date = $startdate->clone();
+
+    $base_date->add_duration($hours_duration);
+
+    # If we are using the calendar behave for now as if Datedue
+    # was the chosen option (current intended behaviour)
+
+    if ( $self->{days_mode} ne 'Days' &&
+          $self->is_holiday($base_date) ) {
+
+        if ( $hours_duration->is_negative() ) {
+            $base_date = $self->prev_open_day($base_date);
+        } else {
+            $base_date = $self->next_open_day($base_date);
         }
-        return $dt;
-    } elsif ( $days_mode eq 'Calendar' ) {
-        if ( $unit eq 'hours' ) {
-            $base_date->add_duration($add_duration);
-            while ( $self->is_holiday($base_date) ) {
-                $base_date->add_duration($day_dur);
 
-            }
+        $base_date->set_hour($return_by_hour);
+
+    }
+
+    return $base_date;
+}
+
+sub addDays {
+    my ( $self, $startdate, $days_duration ) = @_;
+    my $base_date = $startdate->clone();
+
+    if ( $self->{days_mode} eq 'Calendar' ) {
+        # use the calendar to skip all days the library is closed
+        # when adding
+        my $days = abs $days_duration->in_units('days');
 
+        if ( $days_duration->is_negative() ) {
+            while ($days) {
+                $base_date = $self->prev_open_day($base_date);
+                --$days;
+            }
         } else {
-            my $days = abs $add_duration->in_units('days');
             while ($days) {
-                $base_date->add_duration($day_dur);
-                if ( $self->is_holiday($base_date) ) {
-                    next;
-                } else {
-                    --$days;
-                }
+                $base_date = $self->next_open_day($base_date);
+                --$days;
             }
         }
-        if ( $unit eq 'hours' ) {
-            my $dt = $base_date->clone()->subtract( days => 1 );
-            if ( $self->is_holiday($dt) ) {
-                $base_date->set_hour($return_by_hour);    # Staffs specific
+
+    } else { # Days or Datedue
+        # use straight days, then use calendar to push
+        # the date to the next open day if Datedue
+        $base_date->add_duration($days_duration);
+
+        if ( $self->{days_mode} eq 'Datedue' ) {
+            # Datedue, then use the calendar to push
+            # the date to the next open day if holiday
+            if ( $self->is_holiday($base_date) ) {
+                if ( $days_duration->is_negative() ) {
+                    $base_date = $self->prev_open_day($base_date);
+                } else {
+                    $base_date = $self->next_open_day($base_date);
+                }
             }
         }
-        return $base_date;
-    } else {    # Days
-        return $base_date + $add_duration;
     }
+
+    return $base_date;
 }
 
 sub is_holiday {
     my ( $self, $dt ) = @_;
-    my $dow = $dt->day_of_week;
+    my $localdt = $dt->clone();
+    my $day   = $localdt->day;
+    my $month = $localdt->month;
+
+    $localdt->truncate( to => 'day' );
+
+    if ( $self->{exception_holidays}->contains($localdt) ) {
+        # exceptions are not holidays
+        return 0;
+    }
+
+    my $dow = $localdt->day_of_week;
+    # Representation fix
+    # TODO: Shouldn't we shift the rest of the $dow also?
     if ( $dow == 7 ) {
         $dow = 0;
     }
+
     if ( $self->{weekly_closed_days}->[$dow] == 1 ) {
         return 1;
     }
-    $dt->truncate( to => 'day' );
-    my $day   = $dt->day;
-    my $month = $dt->month;
+
     if ( exists $self->{day_month_closed_days}->{$month}->{$day} ) {
         return 1;
     }
-    if ( $self->{exception_holidays}->contains($dt) ) {
-        return 1;
-    }
-    if ( $self->{single_holidays}->contains($dt) ) {
+
+    if ( $self->{single_holidays}->contains($localdt) ) {
         return 1;
     }
 
@@ -164,6 +210,32 @@ sub is_holiday {
     return 0;
 }
 
+sub next_open_day {
+    my ( $self, $dt ) = @_;
+    my $base_date = $dt->clone();
+
+    $base_date->add(days => 1);
+
+    while ($self->is_holiday($base_date)) {
+        $base_date->add(days => 1);
+    }
+
+    return $base_date;
+}
+
+sub prev_open_day {
+    my ( $self, $dt ) = @_;
+    my $base_date = $dt->clone();
+
+    $base_date->add(days => -1);
+
+    while ($self->is_holiday($base_date)) {
+        $base_date->add(days => -1);
+    }
+
+    return $base_date;
+}
+
 sub days_between {
     my $self     = shift;
     my $start_dt = shift;
@@ -227,7 +299,12 @@ sub _mockinit {
     );
     push @{$dates}, $special;
     $self->{single_holidays} = DateTime::Set->from_datetimes( dates => $dates );
-    $self->{days_mode} = 'Calendar';
+
+    # if not defined, days_mode defaults to 'Calendar'
+    if ( !defined($self->{days_mode}) ) {
+        $self->{days_mode} = 'Calendar';
+    }
+
     $self->{test} = 1;
     return;
 }
@@ -252,9 +329,9 @@ sub clear_weekly_closed_days {
 sub add_holiday {
     my $self = shift;
     my $new_dt = shift;
-    my @dt = $self->{exception_holidays}->as_list;
+    my @dt = $self->{single_holidays}->as_list;
     push @dt, $new_dt;
-    $self->{exception_holidays} =
+    $self->{single_holidays} =
       DateTime::Set->from_datetimes( dates => \@dt );
 
     return;
@@ -273,9 +350,9 @@ This documentation refers to Koha::Calendar version 0.0.1
 
 =head1 SYNOPSIS
 
-  use Koha::Calendat
+  use Koha::Calendar
 
-  my $c = Koha::Calender->new( branchcode => 'MAIN' );
+  my $c = Koha::Calendar->new( branchcode => 'MAIN' );
   my $dt = DateTime->now();
 
   # are we open
@@ -311,11 +388,36 @@ Currently unit is only used to invoke Staffs return Monday at 10 am rule this
 parameter will be removed when issuingrules properly cope with that
 
 
+=head2 addHours
+
+    my $dt = $calendar->addHours($date, $dur, $return_by_hour )
+
+C<$date> is a DateTime object representing the starting date of the interval.
+
+C<$offset> is a DateTime::Duration to add to it
+
+C<$return_by_hour> is an integer value representing the opening hour for the branch
+
+
+=head2 addDays
+
+    my $dt = $calendar->addDays($date, $dur)
+
+C<$date> is a DateTime object representing the starting date of the interval.
+
+C<$offset> is a DateTime::Duration to add to it
+
+C<$unit> is a string value 'days' or 'hours' toflag granularity of duration
+
+Currently unit is only used to invoke Staffs return Monday at 10 am rule this
+parameter will be removed when issuingrules properly cope with that
+
+
 =head2 is_holiday
 
 $yesno = $calendar->is_holiday($dt);
 
-passed at DateTime object returns 1 if it is a closed day
+passed a DateTime object returns 1 if it is a closed day
 0 if not according to the calendar
 
 =head2 days_between
@@ -326,6 +428,22 @@ Passed two dates returns a DateTime::Duration object measuring the length betwee
 ignoring closed days. Always returns a positive number irrespective of the
 relative order of the parameters
 
+=head2 next_open_day
+
+$datetime = $calendar->next_open_day($duedate_dt)
+
+Passed a Datetime returns another Datetime representing the next open day. It is
+intended for use to calculate the due date when useDaysMode syspref is set to either
+'Datedue' or 'Calendar'.
+
+=head2 prev_open_day
+
+$datetime = $calendar->prev_open_day($duedate_dt)
+
+Passed a Datetime returns another Datetime representing the previous open day. It is
+intended for use to calculate the due date when useDaysMode syspref is set to either
+'Datedue' or 'Calendar'.
+
 =head2 set_daysmode
 
 For testing only allows the calling script to change days mode
index b2c1df8..4ffc160 100644 (file)
@@ -101,11 +101,15 @@ or C<undef> if C<undef> was provided.
 A second parameter allows overriding of the syspref value. This is for testing only
 In usage use the DateTime objects own methods for non standard formatting
 
+A third parameter allows to specify if the output format contains the hours and minutes.
+If it is not defined, the default value is 0;
+
 =cut
 
 sub output_pref {
     my $dt         = shift;
-    my $force_pref = shift;    # if testing we want to override Context
+    my $force_pref = shift;         # if testing we want to override Context
+    my $dateonly   = shift || 0;    # if you don't want the hours and minutes
 
     return unless defined $dt;
 
@@ -113,16 +117,24 @@ sub output_pref {
       defined $force_pref ? $force_pref : C4::Context->preference('dateformat');
     given ($pref) {
         when (/^iso/) {
-            return $dt->strftime('%Y-%m-%d %H:%M');
+            return $dateonly
+                ? $dt->strftime('%Y-%m-%d')
+                : $dt->strftime('%Y-%m-%d %H:%M');
         }
         when (/^metric/) {
-            return $dt->strftime('%d/%m/%Y %H:%M');
+            return $dateonly
+                ? $dt->strftime('%d/%m/%Y')
+                : $dt->strftime('%d/%m/%Y %H:%M');
         }
         when (/^us/) {
-            return $dt->strftime('%m/%d/%Y %H:%M');
+            return $dateonly
+                ? $dt->strftime('%m/%d/%Y')
+                : $dt->strftime('%m/%d/%Y %H:%M');
         }
         default {
-            return $dt->strftime('%Y-%m-%d %H:%M');
+            return $dateonly
+                ? $dt->strftime('%Y-%m-%d')
+                : $dt->strftime('%Y-%m-%d %H:%M');
         }
 
     }
index 0d977c1..e3ee1c9 100644 (file)
@@ -87,7 +87,7 @@ sub new {
     my $options = $param->{options} || '';
     my @plugins = ();
 
-    foreach my $plugin ( $param->{plugins} ) {
+    foreach my $plugin ( @{$param->{plugins}} ) {
         next unless $plugin;
         my $plugin_module =
             $plugin =~ m/:/
@@ -141,15 +141,18 @@ sub get_suggestions {
 
     my %suggestions;
 
+    my $index = scalar @{ $self->plugins };
+
     foreach my $pluginobj ( @{ $self->plugins } ) {
         next unless $pluginobj;
         my $pluginres = $pluginobj->get_suggestions($param);
         foreach my $suggestion (@$pluginres) {
             $suggestions{ $suggestion->{'search'} }->{'relevance'} +=
-              $suggestion->{'relevance'};
+              $suggestion->{'relevance'} * $index;
             $suggestions{ $suggestion->{'search'} }->{'label'} |=
               $suggestion->{'label'};
         }
+        $index--;
     }
 
     my @results = ();
index 95c6622..9565a7e 100644 (file)
@@ -34,9 +34,9 @@ B<get_suggestions (\%param)> - get suggestions for the search described
 in $param->{'search'}, and return them in a hashref with the suggestions
 as keys and relevance as values.
 
-The following variables must be defined in each filter:
-  our $NAME ='Filter';
-  our $VERSION = '1.0';
+B<NAME> - return a string with the name of the plugin.
+
+B<VERSION> - return a string with the version of the plugin.
 
 These methods may be overriden:
 
@@ -60,8 +60,6 @@ use base qw(Class::Accessor);
 
 __PACKAGE__->mk_ro_accessors(qw( name version ));
 __PACKAGE__->mk_accessors(qw( params ));
-our $NAME    = 'Base';
-our $VERSION = '1.0';
 
 =head2 new
 
index 54a7248..fdc41c5 100644 (file)
@@ -35,8 +35,24 @@ use warnings;
 use Carp;
 
 use base qw(Koha::SuggestionEngine::Base);
-our $NAME    = 'AuthorityFile';
-our $VERSION = '1.0';
+
+=head2 NAME
+    my $name = $plugin->NAME;
+
+=cut
+
+sub NAME {
+    return 'AuthorityFile';
+}
+
+=head2 VERSION
+    my $version = $plugin->VERSION;
+
+=cut
+
+sub VERSION {
+    return '1.1';
+}
 
 =head2 get_suggestions
 
@@ -80,8 +96,10 @@ sub get_suggestions {
           {
             'search'  => "an=$auth->{'authid'}",
             relevance => $count--,
-            label     => $auth->{summary}->{authorized}->[0]
+            label     => $auth->{summary}->{authorized}->[0]->{heading}
           };
     }
     return \@results;
 }
+
+1;
diff --git a/Koha/SuggestionEngine/Plugin/ExplodedTerms.pm b/Koha/SuggestionEngine/Plugin/ExplodedTerms.pm
new file mode 100644 (file)
index 0000000..c0c6166
--- /dev/null
@@ -0,0 +1,105 @@
+package Koha::SuggestionEngine::Plugin::ExplodedTerms;
+
+# Copyright 2012 C & P Bibliography Services
+#
+# 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.
+
+=head1 NAME
+
+Koha::SuggestionEngine::Plugin::ExplodedTerms - suggest searches for broader/narrower/related subjects
+
+=head1 SYNOPSIS
+
+
+=head1 DESCRIPTION
+
+Plugin to suggest expanding the search by adding broader/narrower/related
+subjects to subject searches.
+
+=cut
+
+use strict;
+use warnings;
+use Carp;
+use C4::Templates qw(gettemplate); # This is necessary for translatability
+
+use base qw(Koha::SuggestionEngine::Base);
+
+=head2 NAME
+    my $name = $plugin->NAME;
+
+=cut
+
+sub NAME {
+    return 'ExplodedTerms';
+}
+
+=head2 VERSION
+    my $version = $plugin->VERSION;
+
+=cut
+
+sub VERSION {
+    return '1.0';
+}
+
+=head2 get_suggestions
+
+    my $suggestions = $plugin->get_suggestions(\%param);
+
+Return suggestions for the specified search that add broader/narrower/related
+terms to the search.
+
+=cut
+
+sub get_suggestions {
+    my $self  = shift;
+    my $param = shift;
+
+    my $search = $param->{'search'};
+
+    return if ( $search =~ m/^(ccl=|cql=|pqf=)/ );
+    $search =~ s/(su|su-br|su-na|su-rl)[:=](\w*)/OP!$2/g;
+    return if ( $search =~ m/\w+[:=]\w+/ );
+
+    my @indexes = (
+        'su-na',
+        'su-br',
+        'su-rl'
+    );
+    my $cgi = new CGI;
+    my $template = C4::Templates::gettemplate('text/explodedterms.tt', 'opac', $cgi);
+    my @results;
+    foreach my $index (@indexes) {
+        my $thissearch = $search;
+        $thissearch = "$index=$thissearch"
+          unless ( $thissearch =~ s/OP!/$index=/g );
+        $template->{VARS}->{index} = $index;
+        my $label = pack("U0a*", $template->output); #FIXME: C4::Templates is
+        # returning incorrectly-marked UTF-8. This fixes the problem, but is
+        # an annoying workaround.
+        push @results,
+        {
+            'search'  => $thissearch,
+            relevance => 100,
+                # FIXME: it'd be nice to have some empirical measure of
+                #        "relevance" in this case, but we don't.
+            label => $label
+        };
+    } return \@results;
+}
+
+1;
index 307e035..bc1134d 100644 (file)
@@ -36,8 +36,24 @@ use warnings;
 use Carp;
 
 use base qw(Koha::SuggestionEngine::Base);
-our $NAME    = 'Null';
-our $VERSION = '1.0';
+
+=head2 NAME
+    my $name = $plugin->NAME;
+
+=cut
+
+sub NAME {
+    return 'Null';
+}
+
+=head2 VERSION
+    my $version = $plugin->VERSION;
+
+=cut
+
+sub VERSION {
+    return '1.1';
+}
 
 =head2 get_suggestions
 
@@ -58,3 +74,5 @@ sub get_suggestions {
 
     return \@result;
 }
+
+1;
index 46a3524..ca9e4f0 100644 (file)
@@ -508,6 +508,7 @@ my $pl_files = {
 if ($config{'INSTALL_ZEBRA'} eq "yes") {
     push @{ $pl_files->{'rewrite-config.PL'} }, (
         'blib/ZEBRA_CONF_DIR/etc/passwd',
+        'blib/ZEBRA_CONF_DIR/etc/usmarc.mar',
         'blib/ZEBRA_CONF_DIR/zebra-biblios.cfg',
         'blib/ZEBRA_CONF_DIR/zebra-biblios-dom.cfg',
         'blib/ZEBRA_CONF_DIR/zebra-authorities.cfg',
@@ -522,7 +523,6 @@ if ($config{'INSTALL_ZEBRA'} eq "yes") {
     push @{ $pl_files->{'rewrite-config.PL'} }, (
         'blib/SCRIPT_DIR/koha-zebra-ctl.sh',
         'blib/SCRIPT_DIR/koha-pazpar2-ctl.sh',
-        'blib/SCRIPT_DIR/koha-zebraqueue-ctl.sh',
     );
     if ($config{'INSTALL_PAZPAR2'} eq 'yes') {
         push @{ $pl_files->{'rewrite-config.PL'} }, (
@@ -1358,6 +1358,8 @@ sub _add_destdir {
 sub display_configuration {
     my $config = shift;
     my $dirmap = shift;
+    my @version = grep /\/usr\/share\/perl\//, @INC;
+    push @version, ('/usr/share/perl/5.10') if !$version[0];
     print "\n\nKoha will be installed with the following configuration parameters:\n\n";
     foreach my $key (sort keys %$config) {
         print sprintf("%-25.25s%s\n", $key, $config->{$key});
@@ -1370,7 +1372,7 @@ sub display_configuration {
     print "\n\nTo change any configuration setting, please run\n";
     print "perl Makefile.PL again.  To override one of the target\n";
     print "directories, you can do so on the command line like this:\n";
-    print "\nperl Makefile.PL PERL_MODULE_DIR=/usr/share/perl/5.8\n\n";
+    print "\nperl Makefile.PL PERL_MODULE_DIR=$version[0]\n\n";
     print "You can also set different default values for parameters\n";
     print "or override directory locations by using environment variables.\n";
     print "\nFor example:\n\n";
index 3296182..3c641b3 100755 (executable)
--- a/about.pl
+++ b/about.pl
@@ -55,8 +55,8 @@ if ($^O ne 'VMS') {
 }
 my $perlVersion   = $];
 my $mysqlVersion  = `mysql -V`;
-my $apacheVersion = `httpd -v`;
-$apacheVersion = `httpd2 -v` unless $apacheVersion;
+my $apacheVersion = `httpd -v 2> /dev/null`;
+$apacheVersion = `httpd2 -v 2> /dev/null` unless $apacheVersion;
 $apacheVersion = (`/usr/sbin/apache2 -V`)[0] unless $apacheVersion;
 my $zebraVersion = `zebraidx -V`;
 
index 01febba..1dfa0b1 100755 (executable)
@@ -153,39 +153,9 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
 my $orderinfo                                  = $input->Vars;
 $orderinfo->{'list_price'}    ||=  0;
 $orderinfo->{'uncertainprice'} ||= 0;
-#my $ordernumber        = $input->param('ordernumber');
-#my $basketno      = $input->param('basketno');
-#my $booksellerid  = $input->param('booksellerid');
-#my $existing      = $input->param('existing');    # existing biblio, (not basket or order)
-#my $title         = $input->param('title');
-#my $author        = $input->param('author');
-#my $publicationyear= $input->param('publicationyear');
-#my $isbn          = $input->param('ISBN');
-#my $itemtype      = $input->param('format');
-#my $quantity      = $input->param('quantity');                # FIXME: else ERROR!
-#my $branch        = $input->param('branch');
-#my $series        = $input->param('series');
-#my $notes         = $input->param('notes');
-#my $budget_id     = $input->param('budget_id');
-#my $sort1         = $input->param('sort1');
-#my $sort2         = $input->param('sort2');
-#my $rrp           = $input->param('rrp');
-#my $ecost         = $input->param('ecost');
-#my $gst           = $input->param('GST');
-#my $budget        = $input->param('budget');
-#my $cost          = $input->param('cost');
-#my $sub           = $input->param('sub');
-#my $purchaseorder = $input->param('purchaseordernumber');
-#my $invoice       = $input->param('invoice');
-#my $publishercode = $input->param('publishercode');
-#my $suggestionid  = $input->param('suggestionid');
-#my $biblionumber  = $input->param('biblionumber');
-#my $uncertainprice = $input->param('uncertainprice');
-#my $import_batch_id= $input->param('import_batch_id');
-#
-#my $createbibitem = $input->param('createbibitem');
-#
-my $user          = $input->remote_user;
+
+my $user = $input->remote_user;
+
 # create, modify or delete biblio
 # create if $quantity>=0 and $existing='no'
 # modify if $quantity>=0 and $existing='yes'
@@ -208,6 +178,13 @@ if ( $orderinfo->{quantity} ne '0' ) {
                 "biblio.copyrightdate"        => $$orderinfo{publicationyear} ? $$orderinfo{publicationyear}: "",
                 "biblioitems.itemtype"        => $$orderinfo{itemtype} ? $$orderinfo{itemtype} : "",
                 "biblioitems.editionstatement"=> $$orderinfo{editionstatement} ? $$orderinfo{editionstatement} : "",
+                "aqorders.branchcode"         => $$orderinfo{branchcode} ? $$orderinfo{branchcode} : "",
+                "aqorders.quantity"           => $$orderinfo{quantity} ? $$orderinfo{quantity} : "",
+                "aqorders.listprice"          => $$orderinfo{listprice} ? $$orderinfo{listprice} : "",
+                "aqorders.uncertainprice"     => $$orderinfo{uncertainprice} ? $$orderinfo{uncertainprice} : "",
+                "aqorders.rrp"                => $$orderinfo{rrp} ? $$orderinfo{rrp} : "",
+                "aqorders.ecost"              => $$orderinfo{ecost} ? $$orderinfo{ecost} : "",
+                "aqorders.discount"           => $$orderinfo{discount} ? $$orderinfo{discount} : "",
             });
 
         # create the record in catalogue, with framework ''
@@ -220,6 +197,8 @@ if ( $orderinfo->{quantity} ne '0' ) {
                $orderinfo->{biblionumber}=$biblionumber;
     }
 
+    $orderinfo->{unitprice} = $orderinfo->{ecost} if not defined $orderinfo->{unitprice} or $orderinfo->{unitprice} eq '';
+
     # if we already have $ordernumber, then it's an ordermodif
     if ($$orderinfo{ordernumber}) {
         ModOrder( $orderinfo);
index 22001f1..4942571 100755 (executable)
@@ -156,7 +156,7 @@ if ($op eq ""){
 
     # retrieve the file you want to import
     my $import_batch_id = $cgiparams->{'import_batch_id'};
-    my $biblios = GetImportBibliosRange($import_batch_id);
+    my $biblios = GetImportRecordsRange($import_batch_id);
     for my $biblio (@$biblios){
         # 1st insert the biblio, or find it through matcher
         my ( $marcblob, $encoding ) = GetImportRecordMarc( $biblio->{'import_record_id'} );
@@ -205,7 +205,6 @@ if ($op eq ""){
         my $price = GetMarcPrice($marcrecord, C4::Context->preference('marcflavour'));
 
         if ($price){
-            $orderinfo{'listprice'} = $price;
             eval {
                require C4::Acquisition;
                import C4::Acquisition qw/GetBasket/;
@@ -222,13 +221,19 @@ if ($op eq ""){
            }
             my $basket     = GetBasket( $orderinfo{basketno} );
             my $bookseller = GetBookSellerFromId( $basket->{booksellerid} );
-            my $gst        = $bookseller->{gstrate} || C4::Context->preference("gist") || 0;
-            $orderinfo{'unitprice'} = $orderinfo{listprice} - ( $orderinfo{listprice} * ( $bookseller->{discount} / 100 ) );
-            $orderinfo{'ecost'} = $orderinfo{unitprice};
+            $orderinfo{gstrate} = $bookseller->{gstrate};
+            if ( $bookseller->{listincgst} ) {
+                $orderinfo{ecost} = $price;
+            } else {
+                $orderinfo{ecost} = $price * ( 1 + $orderinfo{gstrate} );
+            }
+            $orderinfo{rrp} = ( $orderinfo{ecost} * 100 ) / ( 100 - $bookseller->{discount} );
+            $orderinfo{listprice} = $orderinfo{rrp};
+            $orderinfo{unitprice} = $orderinfo{ecost};
+            $orderinfo{total} = $orderinfo{ecost};
         } else {
             $orderinfo{'listprice'} = 0;
         }
-        $orderinfo{'rrp'} = $orderinfo{'listprice'};
 
         # remove uncertainprice flag if we have found a price in the MARC record
         $orderinfo{uncertainprice} = 0 if $orderinfo{listprice};
@@ -330,7 +335,7 @@ sub import_batches_list {
     foreach my $batch (@$batches) {
         if ($batch->{'import_status'} eq "staged") {
             # check if there is at least 1 line still staged
-            my $stagedList=GetImportBibliosRange($batch->{'import_batch_id'}, undef, undef, 'staged');
+            my $stagedList=GetImportRecordsRange($batch->{'import_batch_id'}, undef, undef, 'staged');
             if (scalar @$stagedList) {
                 my ($staged_date, $staged_hour) = split (/ /, $batch->{'upload_timestamp'});
                 push @list, {
@@ -357,7 +362,7 @@ sub import_batches_list {
 sub import_biblios_list {
     my ($template, $import_batch_id) = @_;
     my $batch = GetImportBatch($import_batch_id,'staged');
-    my $biblios = GetImportBibliosRange($import_batch_id,'','','staged');
+    my $biblios = GetImportRecordsRange($import_batch_id,'','','staged');
     my @list = ();
 
     foreach my $biblio (@$biblios) {
index 9b36c14..f203af2 100755 (executable)
@@ -65,7 +65,7 @@ the supplier this script have to display the basket.
 =cut
 
 my $query        = new CGI;
-my $basketno     = $query->param('basketno');
+our $basketno     = $query->param('basketno');
 my $booksellerid = $query->param('booksellerid');
 
 my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user(
@@ -130,6 +130,8 @@ if ( $op eq 'delete_confirm' ) {
         authorisedby         => $basket->{authorisedby},
         authorisedbyname     => $basket->{authorisedbyname},
         closedate            => $basket->{closedate},
+        deliveryplace        => $basket->{deliveryplace},
+        billingplace         => $basket->{billingplace},
         active               => $bookseller->{'active'},
         booksellerid         => $bookseller->{'id'},
         name                 => $bookseller->{'name'},
@@ -204,13 +206,14 @@ if ( $op eq 'delete_confirm' ) {
         }
     }
 #if the basket is closed,and the user has the permission to edit basketgroups, display a list of basketgroups
-    my $basketgroups;
+    my ($basketgroup, $basketgroups);
     my $member = GetMember(borrowernumber => $loggedinuser);
     if ($basket->{closedate} && haspermission({ acquisition => 'group_manage'} )) {
         $basketgroups = GetBasketgroups($basket->{booksellerid});
         for my $bg ( @{$basketgroups} ) {
             if ($basket->{basketgroupid} && $basket->{basketgroupid} == $bg->{id}){
                 $bg->{default} = 1;
+                $basketgroup = $bg;
             }
         }
         my %emptygroup = ( id   =>   undef,
@@ -238,125 +241,60 @@ if ( $op eq 'delete_confirm' ) {
       "loggedinuser: $loggedinuser; creationdate: %s; authorisedby: %s",
       $basket->{creationdate}, $basket->{authorisedby};
 
-       #to get active currency
-       my $cur = GetCurrency();
+    #to get active currency
+    my $cur = GetCurrency();
 
 
     my @results = GetOrders( $basketno );
-    
-       my $gist = $bookseller->{gstrate} // C4::Context->preference("gist") // 0;
-       $gist = 0 if $gist == 0.0000;
-       my $discount = $bookseller->{'discount'} / 100;
-    my $total_rrp = 0;      # RRP Total, its value will be assigned to $total_rrp_gsti or $total_rrp_gste depending of $bookseller->{'listincgst'}
-    my $total_rrp_gsti = 0; # RRP Total, GST included
-    my $total_rrp_gste = 0; # RRP Total, GST excluded
-    my $gist_rrp = 0;
-    my $total_rrp_est = 0;
-
-    my $qty_total;
     my @books_loop;
-    my $suggestion;
 
-    for my $order ( @results ) {
-        my $rrp = $order->{'listprice'} || 0;
-               my $qty = $order->{'quantity'} || 0;
-        if (!defined $order->{quantityreceived}) {
-            $order->{quantityreceived} = 0;
-        }
-        for ( qw(rrp ecost quantityreceived)) {
-            if (!defined $order->{$_}) {
-                $order->{$_} = 0;
-            }
-        }
-
-        my $budget = GetBudget(  $order->{'budget_id'} );
-        $rrp = ConvertCurrency( $order->{'currency'}, $rrp );
-
-        $total_rrp += $qty * $order->{'rrp'};
-        my $line_total = $qty * $order->{'ecost'};
-        $total_rrp_est += $qty * $order->{'ecost'};
-               # FIXME: what about the "actual cost" field?
-        $qty_total += $qty;
-        my %line = %{ $order };
-        my $biblionumber = $order->{'biblionumber'};
-        my $countbiblio = CountBiblioInOrders($biblionumber);
-        my $ordernumber = $order->{'ordernumber'};
-        my @subscriptions = GetSubscriptionsId ($biblionumber);
-        my $itemcount = GetItemsCount($biblionumber);
-        my $holds  = GetHolds ($biblionumber);
-        my @items = GetItemnumbersFromOrder( $ordernumber );
-        my $itemholds;
-        foreach my $item (@items){
-            my $nb = GetItemHolds($biblionumber, $item);
-            if ($nb){
-                $itemholds += $nb;
-            }
-        }
-        # if the biblio is not in other orders and if there is no items elsewhere and no subscriptions and no holds we can then show the link "Delete order and Biblio" see bug 5680
-        $line{can_del_bib}          = 1 if $countbiblio <= 1 && $itemcount == scalar @items && !(@subscriptions) && !($holds);
-        $line{items}                = ($itemcount) - (scalar @items);
-        $line{left_item}            = 1 if $line{items} >= 1;
-        $line{left_biblio}          = 1 if $countbiblio > 1;
-        $line{biblios}              = $countbiblio - 1;
-        $line{left_subscription}    = 1 if scalar @subscriptions >= 1;
-        $line{subscriptions}        = scalar @subscriptions;
-        ($holds >= 1) ? $line{left_holds} = 1 : $line{left_holds} = 0;
-        $line{left_holds_on_order}  = 1 if $line{left_holds}==1 && ($line{items} == 0 || $itemholds );
-        $line{holds}                = $holds;
-        $line{holds_on_order}       = $itemholds?$itemholds:$holds if $line{left_holds_on_order};
-        $line{order_received}       = ( $qty == $order->{'quantityreceived'} );
-        $line{basketno}             = $basketno;
-        $line{budget_name}          = $budget->{budget_name};
-        $line{rrp}                  = sprintf( "%.2f", $line{'rrp'} );
-        $line{ecost}                = sprintf( "%.2f", $line{'ecost'} );
-        $line{line_total}           = sprintf( "%.2f", $line_total );
-        if ($line{uncertainprice}) {
+    my @book_foot_loop;
+    my %foot;
+    my $total_quantity = 0;
+    my $total_gste = 0;
+    my $total_gsti = 0;
+    my $total_gstvalue = 0;
+    for my $order (@results) {
+        my $line = get_order_infos( $order, $bookseller);
+        if ( $line->{uncertainprice} ) {
             $template->param( uncertainprices => 1 );
-            $line{rrp} .= ' (Uncertain)';
         }
-       if ($line{'title'}){
-           my $volume = $order->{'volume'};
-           my $seriestitle = $order->{'seriestitle'};
-           $line{'title'} .= " / $seriestitle" if $seriestitle;
-           $line{'title'} .= " / $volume" if $volume;
-       } else {
-           $line{'title'} = "Deleted bibliographic notice, can't find title.";
-       }
-
-        $suggestion = GetSuggestionInfoFromBiblionumber($line{biblionumber});
-        $line{suggestionid}         = $suggestion->{suggestionid};
-        $line{surnamesuggestedby}   = $suggestion->{surnamesuggestedby};
-        $line{firstnamesuggestedby} = $suggestion->{firstnamesuggestedby};
-
-        push @books_loop, \%line;
+
+        push @books_loop, $line;
+
+        $foot{$$line{gstgsti}}{gstgsti} = $$line{gstgsti};
+        $foot{$$line{gstgsti}}{gstvalue} += $$line{gstvalue};
+        $total_gstvalue += $$line{gstvalue};
+        $foot{$$line{gstgsti}}{quantity}  += $$line{quantity};
+        $total_quantity += $$line{quantity};
+        $foot{$$line{gstgsti}}{totalgste} += $$line{totalgste};
+        $total_gste += $$line{totalgste};
+        $foot{$$line{gstgsti}}{totalgsti} += $$line{totalgsti};
+        $total_gsti += $$line{totalgsti};
     }
 
-my $total_est_gste;
-    my $total_est_gsti;
-    my $gist_est;
-    if ($gist){                                                    # if we have GST
-       if ( $bookseller->{'listincgst'} ) {                        # if prices already includes GST
-           $total_rrp_gsti = $total_rrp;                           # we know $total_rrp_gsti
-           $total_rrp_gste = $total_rrp_gsti / ( $gist + 1 );      # and can reverse compute other values
-           $gist_rrp       = $total_rrp_gsti - $total_rrp_gste;    #
-           $total_est_gste = $total_rrp_gste - ( $total_rrp_gste * $discount );
-           $total_est_gsti = $total_rrp_est;
-        } else {                                                    # if prices does not include GST
-           $total_rrp_gste = $total_rrp;                           # then we use the common way to compute other values
-           $gist_rrp       = $total_rrp_gste * $gist;              #
-           $total_rrp_gsti = $total_rrp_gste + $gist_rrp;          #
-           $total_est_gste = $total_rrp_est;
-           $total_est_gsti = $total_rrp_gsti - ( $total_rrp_gsti * $discount );
-       }
-       $gist_est = $gist_rrp - ( $gist_rrp * $discount );
-    } else {
-    $total_rrp_gsti = $total_rrp;
-    $total_est_gsti = $total_rrp_est;
-}
+    push @book_foot_loop, map {$_} values %foot;
+
+    # Get cancelled orders
+    @results = GetCancelledOrders($basketno);
+    my @cancelledorders_loop;
+    for my $order (@results) {
+        my $line = get_order_infos( $order, $bookseller);
+        push @cancelledorders_loop, $line;
+    }
 
     my $contract = &GetContract($basket->{contractnumber});
     my @orders = GetOrders($basketno);
 
+    if ($basket->{basketgroupid}){
+        my $basketgroup = GetBasketgroup($basket->{basketgroupid});
+        for my $key (keys %$basketgroup ){
+            $basketgroup->{"basketgroup$key"} = delete $basketgroup->{$key};
+        }
+        $basketgroup->{basketgroupdeliveryplace} = C4::Branch::GetBranchName( $basketgroup->{basketgroupdeliveryplace} );
+        $basketgroup->{basketgroupbillingplace} = C4::Branch::GetBranchName( $basketgroup->{basketgroupbillingplace} );
+        $template->param(%$basketgroup);
+    }
     my $borrower= GetMember('borrowernumber' => $loggedinuser);
     my $budgets = GetBudgetHierarchy;
     my $has_budgets = 0;
@@ -387,27 +325,110 @@ my $total_est_gste;
         authorisedbyname     => $basket->{authorisedbyname},
         closedate            => $basket->{closedate},
         estimateddeliverydate=> $estimateddeliverydate,
+        deliveryplace        => C4::Branch::GetBranchName( $basket->{deliveryplace} ),
+        billingplace         => C4::Branch::GetBranchName( $basket->{billingplace} ),
         active               => $bookseller->{'active'},
         booksellerid         => $bookseller->{'id'},
         name                 => $bookseller->{'name'},
         books_loop           => \@books_loop,
+        book_foot_loop       => \@book_foot_loop,
         cancelledorders_loop => \@cancelledorders,
-        gist_rate            => sprintf( "%.2f", $gist * 100 ) . '%',
-        total_rrp_gste       => sprintf( "%.2f", $total_rrp_gste ),
-        total_est_gste       => sprintf( "%.2f", $total_est_gste ),
-        gist_est             => sprintf( "%.2f", $gist_est ),
-        gist_rrp             => sprintf( "%.2f", $gist_rrp ),        
-        total_rrp_gsti       => sprintf( "%.2f", $total_rrp_gsti ),
-        total_est_gsti       => sprintf( "%.2f", $total_est_gsti ),
-#        currency             => $bookseller->{'listprice'},
-       currency                => $cur->{'currency'},
-        qty_total            => $qty_total,
-        GST                  => $gist,
+        total_quantity       => $total_quantity,
+        total_gste           => sprintf( "%.2f", $total_gste ),
+        total_gsti           => sprintf( "%.2f", $total_gsti ),
+        total_gstvalue       => sprintf( "%.2f", $total_gstvalue ),
+        currency             => $cur->{'currency'},
+        listincgst           => $bookseller->{listincgst},
         basketgroups         => $basketgroups,
+        basketgroup          => $basketgroup,
         grouped              => $basket->{basketgroupid},
         unclosable           => @orders ? 0 : 1, 
         has_budgets          => $has_budgets,
     );
 }
 
+sub get_order_infos {
+    my $order = shift;
+    my $bookseller = shift;
+    my $qty = $order->{'quantity'} || 0;
+    if ( !defined $order->{quantityreceived} ) {
+        $order->{quantityreceived} = 0;
+    }
+    my $budget = GetBudget( $order->{'budget_id'} );
+
+    my %line = %{ $order };
+    $line{order_received} = ( $qty == $order->{'quantityreceived'} );
+    $line{basketno}       = $basketno;
+    $line{budget_name}    = $budget->{budget_name};
+    $line{rrp} = ConvertCurrency( $order->{'currency'}, $line{rrp} ); # FIXME from comm
+    if ( $bookseller->{'listincgst'} ) {
+        $line{rrpgsti} = sprintf( "%.2f", $line{rrp} );
+        $line{gstgsti} = sprintf( "%.2f", $line{gstrate} * 100 );
+        $line{rrpgste} = sprintf( "%.2f", $line{rrp} / ( 1 + ( $line{gstgsti} / 100 ) ) );
+        $line{gstgste} = sprintf( "%.2f", $line{gstgsti} / ( 1 + ( $line{gstgsti} / 100 ) ) );
+        $line{ecostgsti} = sprintf( "%.2f", $line{ecost} );
+        $line{ecostgste} = sprintf( "%.2f", $line{ecost} / ( 1 + ( $line{gstgsti} / 100 ) ) );
+        $line{gstvalue} = sprintf( "%.2f", ( $line{ecostgsti} - $line{ecostgste} ) * $line{quantity});
+        $line{totalgste} = sprintf( "%.2f", $order->{quantity} * $line{ecostgste} );
+        $line{totalgsti} = sprintf( "%.2f", $order->{quantity} * $line{ecostgsti} );
+    } else {
+        $line{rrpgsti} = sprintf( "%.2f", $line{rrp} * ( 1 + ( $line{gstrate} ) ) );
+        $line{rrpgste} = sprintf( "%.2f", $line{rrp} );
+        $line{gstgsti} = sprintf( "%.2f", $line{gstrate} * 100 );
+        $line{gstgste} = sprintf( "%.2f", $line{gstrate} * 100 );
+        $line{ecostgsti} = sprintf( "%.2f", $line{ecost} * ( 1 + ( $line{gstrate} ) ) );
+        $line{ecostgste} = sprintf( "%.2f", $line{ecost} );
+        $line{gstvalue} = sprintf( "%.2f", ( $line{ecostgsti} - $line{ecostgste} ) * $line{quantity});
+        $line{totalgste} = sprintf( "%.2f", $order->{quantity} * $line{ecostgste} );
+        $line{totalgsti} = sprintf( "%.2f", $order->{quantity} * $line{ecostgsti} );
+    }
+
+    if ( $line{uncertainprice} ) {
+        $line{rrpgste} .= ' (Uncertain)';
+    }
+    if ( $line{'title'} ) {
+        my $volume      = $order->{'volume'};
+        my $seriestitle = $order->{'seriestitle'};
+        $line{'title'} .= " / $seriestitle" if $seriestitle;
+        $line{'title'} .= " / $volume"      if $volume;
+    } else {
+        $line{'title'} = "Deleted bibliographic notice, can't find title.";
+    }
+
+    my $biblionumber = $order->{'biblionumber'};
+    my $countbiblio = CountBiblioInOrders($biblionumber);
+    my $ordernumber = $order->{'ordernumber'};
+    my @subscriptions = GetSubscriptionsId ($biblionumber);
+    my $itemcount = GetItemsCount($biblionumber);
+    my $holds  = GetHolds ($biblionumber);
+    my @items = GetItemnumbersFromOrder( $ordernumber );
+    my $itemholds;
+    foreach my $item (@items){
+        my $nb = GetItemHolds($biblionumber, $item);
+        if ($nb){
+            $itemholds += $nb;
+        }
+    }
+    # if the biblio is not in other orders and if there is no items elsewhere and no subscriptions and no holds we can then show the link "Delete order and Biblio" see bug 5680
+    $line{can_del_bib}          = 1 if $countbiblio <= 1 && $itemcount == scalar @items && !(@subscriptions) && !($holds);
+    $line{items}                = ($itemcount) - (scalar @items);
+    $line{left_item}            = 1 if $line{items} >= 1;
+    $line{left_biblio}          = 1 if $countbiblio > 1;
+    $line{biblios}              = $countbiblio - 1;
+    $line{left_subscription}    = 1 if scalar @subscriptions >= 1;
+    $line{subscriptions}        = scalar @subscriptions;
+    ($holds >= 1) ? $line{left_holds} = 1 : $line{left_holds} = 0;
+    $line{left_holds_on_order}  = 1 if $line{left_holds}==1 && ($line{items} == 0 || $itemholds );
+    $line{holds}                = $holds;
+    $line{holds_on_order}       = $itemholds?$itemholds:$holds if $line{left_holds_on_order};
+
+
+    my $suggestion   = GetSuggestionInfoFromBiblionumber($line{biblionumber});
+    $line{suggestionid}         = $$suggestion{suggestionid};
+    $line{surnamesuggestedby}   = $$suggestion{surnamesuggestedby};
+    $line{firstnamesuggestedby} = $$suggestion{firstnamesuggestedby};
+
+    return \%line;
+}
+
 output_html_with_http_headers $query, $cookie, $template->output;
index ac0672c..6b7e5bf 100755 (executable)
@@ -328,30 +328,11 @@ if ( $op eq "add" ) {
         my $borrower = GetMember( ( 'borrowernumber' => $loggedinuser ) );
         $billingplace  = $billingplace  || $borrower->{'branchcode'};
         $deliveryplace = $deliveryplace || $borrower->{'branchcode'};
-        
-        my $branches = GetBranches;
-        
-        # Build the combobox to select the billing place
-        my @billingplaceloop;
-        for (sort keys %$branches) {
-            push @billingplaceloop, {
-                value      => $_,
-                selected   => $_ eq $billingplace,
-                branchname => $branches->{$_}->{branchname},
-            };
-        }
-        $template->param( billingplaceloop => \@billingplaceloop );
-        
-        # Build the combobox to select the delivery place
-        my @deliveryplaceloop;
-        for (sort keys %$branches) {
-            push @deliveryplaceloop, {
-                value      => $_,
-                selected   => $_ eq $deliveryplace,
-                branchname => $branches->{$_}->{branchname},
-            };
-        }
-        $template->param( deliveryplaceloop => \@deliveryplaceloop );
+
+        my $branches = C4::Branch::GetBranchesLoop( $billingplace );
+        $template->param( billingplaceloop => $branches );
+        $branches = C4::Branch::GetBranchesLoop( $deliveryplace );
+        $template->param( deliveryplaceloop => $branches );
 
         $template->param( booksellerid => $booksellerid );
     }
index 08b38eb..8f75f40 100755 (executable)
@@ -50,6 +50,7 @@ use warnings;
 use CGI;
 use C4::Context;
 use C4::Auth;
+use C4::Branch;
 use C4::Output;
 use C4::Acquisition qw/GetBasket NewBasket GetContracts ModBasketHeader/;
 use C4::Bookseller qw/GetBookSellerFromId GetBookSeller/;
@@ -70,6 +71,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
 #parameters:
 my $booksellerid = $input->param('booksellerid');
 my $basketno = $input->param('basketno');
+my $branches = GetBranches;
 my $basket;
 my $op = $input ->param('op');
 my $is_an_edit= $input ->param('is_an_edit');
@@ -100,7 +102,7 @@ if ( $op eq 'add_form' ) {
         $template->param(contractloop => \@contractloop,
                          basketcontractnumber => $basket->{'contractnumber'});
     }
-    my @booksellers = GetBookSeller();
+    my @booksellers = C4::Bookseller::GetBookSeller();
     $template->param( add_form => 1,
                     basketname => $basket->{'basketname'},
                     basketnote => $basket->{'note'},
@@ -109,16 +111,47 @@ if ( $op eq 'add_form' ) {
                     booksellerid => $booksellerid,
                     basketno => $basketno,
                     booksellers => \@booksellers,
-       );
+                    deliveryplace => $basket->{deliveryplace},
+                    billingplace => $basket->{billingplace},
+    );
+
+    my $billingplace = $basket->{'billingplace'} || C4::Context->userenv->{"branch"};
+    my $deliveryplace = $basket->{'deliveryplace'} || C4::Context->userenv->{"branch"};
+
+    # Build the combobox to select the billing place
+    my @billingplaceloop;
+
+    my $branches = C4::Branch::GetBranchesLoop( $billingplace );
+    $template->param( billingplaceloop => $branches );
+    $branches = C4::Branch::GetBranchesLoop( $deliveryplace );
+    $template->param( deliveryplaceloop => $branches );
+
 #End Edit
 } elsif ( $op eq 'add_validate' ) {
 #we are confirming the changes, save the basket
-    my $basketno;
     if ( $is_an_edit ) {
-        $basketno = $input->param('basketno');
-        ModBasketHeader( $input->param('basketno'), $input->param('basketname'), $input->param('basketnote'), $input->param('basketbooksellernote'), $input->param('basketcontractnumber') || undef, $input->param('basketbooksellerid') );
+        ModBasketHeader(
+            $basketno,
+            $input->param('basketname'),
+            $input->param('basketnote'),
+            $input->param('basketbooksellernote'),
+            $input->param('basketcontractnumber') || undef,
+            $input->param('basketbooksellerid'),
+            $input->param('deliveryplace'),
+            $input->param('billingplace'),
+        );
     } else { #New basket
-        $basketno = NewBasket($booksellerid, $loggedinuser, $input->param('basketname'), $input->param('basketnote'), $input->param('basketbooksellernote'), $input->param('basketcontractnumber'));
+        $basketno = NewBasket(
+            $booksellerid,
+            $loggedinuser,
+            $input->param('basketname'),
+            $input->param('basketnote'),
+            $input->param('basketbooksellernote'),
+            $input->param('basketcontractnumber') || undef,
+            undef,
+            $input->param('deliveryplace'),
+            $input->param('billingplace'),
+        );
     }
     print $input->redirect('basket.pl?basketno='.$basketno);
     exit 0;
index bb4818d..0ea16ca 100755 (executable)
@@ -28,6 +28,7 @@ use C4::Output;
 use C4::Context;
 use C4::Acquisition;
 use C4::Biblio;
+use C4::Bookseller;
 use C4::Items;
 use C4::Search;
 use List::MoreUtils qw/any/;
@@ -37,24 +38,25 @@ my $flagsrequired = {acquisition => 'order_receive'};
 
 checkauth($input, 0, $flagsrequired, 'intranet');
 
-my $user=$input->remote_user;
-my $biblionumber = $input->param('biblionumber');
-my $biblioitemnumber=$input->param('biblioitemnumber');
-my $ordernumber=$input->param('ordernumber');
-my $origquantityrec=$input->param('origquantityrec');
-my $quantityrec=$input->param('quantityrec');
-my $quantity=$input->param('quantity');
-my $unitprice=$input->param('cost');
-my $invoiceid = $input->param('invoiceid');
-my $invoice = GetInvoice($invoiceid);
-my $invoiceno = $invoice->{invoicenumber};
-my $datereceived= $invoice->{shipmentdate};
-my $replacement=$input->param('rrp');
-my $gst=$input->param('gst');
-my $booksellerid = $input->param('booksellerid');
-my $cnt=0;
-my $ecost = $input->param('ecost');
-my $note = $input->param("note");
+my $user             = $input->remote_user;
+my $biblionumber     = $input->param('biblionumber');
+my $biblioitemnumber = $input->param('biblioitemnumber');
+my $ordernumber      = $input->param('ordernumber');
+my $origquantityrec  = $input->param('origquantityrec');
+my $quantityrec      = $input->param('quantityrec');
+my $quantity         = $input->param('quantity');
+my $unitprice        = $input->param('cost');
+my $invoiceid        = $input->param('invoiceid');
+my $invoice          = GetInvoice($invoiceid);
+my $invoiceno        = $invoice->{invoicenumber};
+my $datereceived     = $invoice->{shipmentdate};
+my $booksellerid     = $input->param('booksellerid');
+my $cnt              = 0;
+my $error_url_str;
+my $ecost            = $input->param('ecost');
+my $rrp              = $input->param('rrp');
+my $note             = $input->param("note");
+my $order            = GetOrder($ordernumber);
 
 #need old recievedate if we update the order, parcel.pl only shows the right parcel this way FIXME
 if ($quantityrec > $origquantityrec ) {
@@ -63,12 +65,40 @@ if ($quantityrec > $origquantityrec ) {
         @received_items = $input->param('items_to_receive');
     }
 
+    $order->{rrp} = $rrp;
+    $order->{ecost} = $ecost;
+    $order->{unitprice} = $unitprice;
+    my $bookseller = C4::Bookseller::GetBookSellerFromId($booksellerid);
+    if ( $bookseller->{listincgst} ) {
+        if ( not $bookseller->{invoiceincgst} ) {
+            $order->{rrp} = $order->{rrp} * ( 1 + $order->{gstrate} );
+            $order->{ecost} = $order->{ecost} * ( 1 + $order->{gstrate} );
+            $order->{unitprice} = $order->{unitprice} * ( 1 + $order->{gstrate} );
+        }
+    } else {
+        if ( $bookseller->{invoiceincgst} ) {
+            $order->{rrp} = $order->{rrp} / ( 1 + $order->{gstrate} );
+            $order->{ecost} = $order->{ecost} / ( 1 + $order->{gstrate} );
+            $order->{unitprice} = $order->{unitprice} / ( 1 + $order->{gstrate} );
+        }
+    }
+
     my $new_ordernumber = $ordernumber;
     # save the quantity received.
     if ( $quantityrec > 0 ) {
         ($datereceived, $new_ordernumber) = ModReceiveOrder(
-            $biblionumber, $ordernumber, $quantityrec, $user, $unitprice,
-            $invoiceid, $replacement, undef, $datereceived, \@received_items);
+            $biblionumber,
+            $ordernumber,
+            $quantityrec,
+            $user,
+            $order->{unitprice},
+            $order->{ecost},
+            $invoiceid,
+            $order->{rrp},
+            undef,
+            $datereceived,
+            \@received_items,
+        );
     }
 
     # now, add items if applicable
@@ -107,6 +137,7 @@ if ($quantityrec > $origquantityrec ) {
             NewOrderItem($itemnumber, $new_ordernumber);
         }
     }
+
 }
 
 update_item( $_ ) foreach GetItemnumbersFromOrder( $ordernumber );
@@ -122,7 +153,7 @@ sub update_item {
         booksellerid         => $booksellerid,
         dateaccessioned      => $datereceived,
         price                => $unitprice,
-        replacementprice     => $replacement,
+        replacementprice     => $rrp,
         replacementpricedate => $datereceived,
     }, $biblionumber, $itemnumber );
 }
index 1dc97ee..7c51ebc 100755 (executable)
@@ -79,6 +79,11 @@ elsif ( $op && $op eq 'mod' ) {
         shipmentcost          => $shipmentcost,
         shipmentcost_budgetid => $shipment_budget_id
     );
+    if ($input->param('reopen')) {
+        ReopenInvoice($invoiceid);
+    } elsif ($input->param('close')) {
+        CloseInvoice($invoiceid);
+    }
     $template->param( modified => 1 );
 }
 
index 3c66eb8..544370d 100755 (executable)
@@ -43,8 +43,7 @@ To know on which branch this script have to display late order.
 
 =cut
 
-use strict;
-use warnings;
+use Modern::Perl;
 use CGI;
 use C4::Bookseller qw( GetBooksellersWithLateOrders );
 use C4::Auth;
@@ -54,6 +53,7 @@ use C4::Context;
 use C4::Acquisition;
 use C4::Letters;
 use C4::Branch; # GetBranches
+use Koha::DateUtils;
 
 my $input = new CGI;
 my ($template, $loggedinuser, $cookie) = get_template_and_user({
@@ -66,9 +66,32 @@ my ($template, $loggedinuser, $cookie) = get_template_and_user({
 });
 
 my $booksellerid = $input->param('booksellerid') || undef; # we don't want "" or 0
-my $delay      = $input->param('delay');
+my $delay        = $input->param('delay');
+
+# Get the "date from" param if !defined is today
 my $estimateddeliverydatefrom = $input->param('estimateddeliverydatefrom');
 my $estimateddeliverydateto   = $input->param('estimateddeliverydateto');
+
+my $estimateddeliverydatefrom_dt =
+  $estimateddeliverydatefrom
+  ? dt_from_string($estimateddeliverydatefrom)
+  : undef;
+
+# Get the "date to" param. If it is not defined and $delay is not defined too, it is the today's date.
+my $estimateddeliverydateto_dt = $estimateddeliverydateto
+    ? dt_from_string($estimateddeliverydateto)
+    : ( not defined $delay and not defined $estimateddeliverydatefrom)
+        ? dt_from_string()
+        : undef;
+
+# Format the output of "date from" and "date to"
+if ($estimateddeliverydatefrom_dt) {
+    $estimateddeliverydatefrom = output_pref($estimateddeliverydatefrom_dt, undef, 1);
+}
+if ($estimateddeliverydateto_dt) {
+    $estimateddeliverydateto = output_pref($estimateddeliverydateto_dt, undef, 1);
+}
+
 my $branch     = $input->param('branch');
 my $op         = $input->param('op');
 
@@ -95,12 +118,16 @@ if ($op and $op eq "send_alert"){
     }
 }
 
-my %supplierlist = GetBooksellersWithLateOrders(
-    $delay,
-    $branch,
-    C4::Dates->new($estimateddeliverydatefrom)->output("iso"),
-    C4::Dates->new($estimateddeliverydateto)->output("iso")
-);
+my @parameters = ( $delay, $branch );
+push @parameters, $estimateddeliverydatefrom_dt
+    ? $estimateddeliverydatefrom_dt->ymd()
+    : undef;
+
+push @parameters, $estimateddeliverydateto_dt
+    ? $estimateddeliverydateto_dt->ymd()
+    : undef;
+
+my %supplierlist = GetBooksellersWithLateOrders(@parameters);
 
 my (@sloopy);  # supplier loop
 foreach (keys %supplierlist){
@@ -113,13 +140,18 @@ $template->param(SUPPLIER_LOOP => \@sloopy);
 $template->param(Supplier=>$supplierlist{$booksellerid}) if ($booksellerid);
 $template->param(booksellerid=>$booksellerid) if ($booksellerid);
 
-my @lateorders = GetLateOrders(
-    $delay,
-    $booksellerid,
-    $branch,
-    C4::Dates->new($estimateddeliverydatefrom)->output("iso"),
-    C4::Dates->new($estimateddeliverydateto)->output("iso")
-);
+@parameters =
+  ( $delay, $booksellerid, $branch );
+if ($estimateddeliverydatefrom_dt) {
+    push @parameters, $estimateddeliverydatefrom_dt->ymd();
+}
+else {
+    push @parameters, undef;
+}
+if ($estimateddeliverydateto_dt) {
+    push @parameters, $estimateddeliverydateto_dt->ymd();
+}
+my @lateorders = GetLateOrders( @parameters );
 
 my $total;
 foreach (@lateorders){
index 4a3eb49..90b4732 100755 (executable)
@@ -91,7 +91,7 @@ use C4::Search qw/FindDuplicate/;
 #needed for z3950 import:
 use C4::ImportBatch qw/GetImportRecordMarc SetImportRecordStatus/;
 
-my $input           = new CGI;
+our $input           = new CGI;
 my $booksellerid    = $input->param('booksellerid');   # FIXME: else ERROR!
 my $budget_id       = $input->param('budget_id') || 0;
 my $title           = $input->param('title');
@@ -99,8 +99,8 @@ my $author          = $input->param('author');
 my $publicationyear = $input->param('publicationyear');
 my $bookseller      = GetBookSellerFromId($booksellerid);      # FIXME: else ERROR!
 my $ordernumber          = $input->param('ordernumber') || '';
-my $biblionumber    = $input->param('biblionumber');
-my $basketno        = $input->param('basketno');
+our $biblionumber    = $input->param('biblionumber');
+our $basketno        = $input->param('basketno');
 my $suggestionid    = $input->param('suggestionid');
 my $close           = $input->param('close');
 my $uncertainprice  = $input->param('uncertainprice');
@@ -110,7 +110,7 @@ my $new = 'no';
 
 my $budget_name;
 
-my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user(
+our ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user(
     {
         template_name   => "acqui/neworderempty.tmpl",
         query           => $input,
@@ -121,18 +121,18 @@ my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user(
     }
 );
 
-my $marcflavour = C4::Context->preference('marcflavour');
+our $marcflavour = C4::Context->preference('marcflavour');
 
 if(!$basketno) {
     my $order = GetOrder($ordernumber);
     $basketno = $order->{'basketno'};
 }
 
-my $basket = GetBasket($basketno);
+our $basket = GetBasket($basketno);
 my $contract = &GetContract($basket->{contractnumber});
 
 #simple parameters reading (all in one :-)
-my $params = $input->Vars;
+our $params = $input->Vars;
 my $listprice=0; # the price, that can be in MARC record if we have one
 if ( $ordernumber eq '' and defined $params->{'breedingid'}){
 #we want to import from the breeding reservoir (from a z3950 search)
@@ -331,6 +331,13 @@ $template->param(
     budget_name  => $budget_name
 ) if ($close);
 
+# get option values for gist syspref
+my @gst_values = map {
+    option => $_
+}, split( '\|', C4::Context->preference("gist") );
+
+my $cur = GetCurrency();
+
 $template->param(
     existing         => $biblionumber,
     ordernumber           => $ordernumber,
@@ -350,18 +357,21 @@ $template->param(
     suggestionid         => $suggestion->{suggestionid},
     surnamesuggestedby   => $suggestion->{surnamesuggestedby},
     firstnamesuggestedby => $suggestion->{firstnamesuggestedby},
-    biblionumber     => $biblionumber,
-    uncertainprice   => $data->{'uncertainprice'},
-    authorisedbyname => $borrower->{'firstname'} . " " . $borrower->{'surname'},
-    biblioitemnumber => $data->{'biblioitemnumber'},
-    discount_2dp     => sprintf( "%.2f",  $bookseller->{'discount'}) ,   # for display
-    discount         => $bookseller->{'discount'},
+    biblionumber         => $biblionumber,
+    uncertainprice       => $data->{'uncertainprice'},
+    authorisedbyname     => $borrower->{'firstname'} . " " . $borrower->{'surname'},
+    biblioitemnumber     => $data->{'biblioitemnumber'},
+    discount_2dp         => sprintf( "%.2f",  $bookseller->{'discount'} ) ,   # for display
+    discount             => $bookseller->{'discount'},
+    orderdiscount_2dp    => sprintf( "%.2f", $data->{'discount'} || 0 ),
+    orderdiscount        => $data->{'discount'},
     listincgst       => $bookseller->{'listincgst'},
     invoiceincgst    => $bookseller->{'invoiceincgst'},
     name             => $bookseller->{'name'},
     cur_active_sym   => $active_currency->{'symbol'},
     cur_active       => $active_currency->{'currency'},
     loop_currencies  => \@loop_currency,
+    currency_rate    => $cur->{rate},
     orderexists      => ( $new eq 'yes' ) ? 0 : 1,
     title            => $data->{'title'},
     author           => $data->{'author'},
@@ -375,19 +385,17 @@ $template->param(
     quantity         => $data->{'quantity'},
     quantityrec      => $data->{'quantity'},
     rrp              => $data->{'rrp'},
-    listprice        => sprintf("%.2f", $data->{'listprice'}||$data->{'price'}||$listprice),
-    total            => sprintf("%.2f", ($data->{'ecost'}||0)*($data->{'quantity'}||0) ),
-    ecost            => $data->{'ecost'},
-    unitprice        => sprintf("%.2f", $data->{'unitprice'}||0),
+    gst_values       => \@gst_values,
+    gstrate          => $data->{gstrate} ? $data->{gstrate}+0.0 : $bookseller->{gstrate} ? $bookseller->{gstrate}+0.0 : 0,
+    gstreg           => $bookseller->{'gstreg'},
+    listprice        => sprintf( "%.2f", $data->{listprice} || $data->{price} || $listprice),
+    total            => sprintf( "%.2f", ($data->{ecost} || 0) * ($data->{'quantity'} || 0) ),
+    ecost            => sprintf( "%.2f", $data->{ecost} || 0),
+    unitprice        => sprintf( "%.2f", $data->{unitprice} || 0),
     notes            => $data->{'notes'},
     publishercode    => $data->{'publishercode'},
     barcode_subfield => $barcode_subfield,
-    
     import_batch_id  => $import_batch_id,
-
-# CHECKME: gst-stuff needs verifing, mason.
-    gstrate          => $bookseller->{'gstrate'} // C4::Context->preference("gist") // 0,
-    gstreg           => $bookseller->{'gstreg'},
     (uc(C4::Context->preference("marcflavour"))) => 1
 );
 
@@ -443,7 +451,7 @@ sub MARCfindbreeding {
             if (    C4::Context->preference("z3950NormalizeAuthor")
                 and C4::Context->preference("z3950AuthorAuthFields") )
             {
-                my ( $tag, $subfield ) = GetMarcFromKohaField("biblio.author");
+                my ( $tag, $subfield ) = GetMarcFromKohaField("biblio.author", '');
 
 #                 my $summary = C4::Context->preference("z3950authortemplate");
                 my $auth_fields =
index a0b933b..17c2d5e 100755 (executable)
@@ -93,7 +93,6 @@ my $search       = $input->param('receive');
 $datereceived = $datereceived ? C4::Dates->new($datereceived, 'iso') : C4::Dates->new();
 
 my $bookseller = GetBookSellerFromId($booksellerid);
-my $gst = $bookseller->{gstrate} // C4::Context->preference("gist") // 0;
 my $results = SearchOrder($ordernumber,$search);
 
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
@@ -158,16 +157,40 @@ if ( $count == 1 ) {
         $template->param(items => \@items);
     }
 
-    if ( $order->{'unitprice'} == 0 ) {
-        $order->{'unitprice'} = '';
-    }
+    $order->{quantityreceived} = '' if $order->{quantityreceived} == 0;
+    $order->{unitprice} = '' if $order->{unitprice} == 0;
+
+    my $rrp;
+    my $ecost;
+    my $unitprice;
+    if ( $bookseller->{listincgst} ) {
+        if ( $bookseller->{invoiceincgst} ) {
+            $rrp = $order->{rrp};
+            $ecost = $order->{ecost};
+            $unitprice = $order->{unitprice};
+        } else {
+            $rrp = $order->{rrp} / ( 1 + $order->{gstrate} );
+            $ecost = $order->{ecost} / ( 1 + $order->{gstrate} );
+            $unitprice = $order->{unitprice} / ( 1 + $order->{gstrate} );
+        }
+    } else {
+        if ( $bookseller->{invoiceincgst} ) {
+            $rrp = $order->{rrp} * ( 1 + $order->{gstrate} );
+            $ecost = $order->{ecost} * ( 1 + $order->{gstrate} );
+            $unitprice = $order->{unitprice} * ( 1 + $order->{gstrate} );
+        } else {
+            $rrp = $order->{rrp};
+            $ecost = $order->{ecost};
+            $unitprice = $order->{unitprice};
+        }
+     }
 
-    my $suggestion   = GetSuggestionInfoFromBiblionumber($order->{'biblionumber'});
+    my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber});
 
-    my $authorisedby = $order->{'authorisedby'};
+    my $authorisedby = $order->{authorisedby};
     my $member = GetMember( borrowernumber => $authorisedby );
 
-    my $budget = GetBudget( $order->{'budget_id'} );
+    my $budget = GetBudget( $order->{budget_id} );
 
     $template->param(
         AcqCreateItem         => $AcqCreateItem,
@@ -177,7 +200,7 @@ if ( $count == 1 ) {
         biblioitemnumber      => $order->{'biblioitemnumber'},
         booksellerid          => $order->{'booksellerid'},
         freight               => $freight,
-        gst                   => $gst,
+        gstrate               => $order->{gstrate} || $bookseller->{gstrate} || C4::Context->preference("gist") || 0,
         name                  => $bookseller->{'name'},
         date                  => format_date($order->{entrydate}),
         title                 => $order->{'title'},
@@ -189,9 +212,9 @@ if ( $count == 1 ) {
         quantity              => $order->{'quantity'},
         quantityreceivedplus1 => $order->{'quantityreceived'} + 1,
         quantityreceived      => $order->{'quantityreceived'},
-        rrp                   => $order->{'rrp'},
-        ecost                 => sprintf( "%.2f",$order->{'ecost'}),
-        unitprice             => sprintf( "%.2f",$order->{'unitprice'}),
+        rrp                   => sprintf( "%.2f", $rrp ),
+        ecost                 => sprintf( "%.2f", $ecost ),
+        unitprice             => sprintf( "%.2f", $unitprice),
         memberfirstname       => $member->{firstname} || "",
         membersurname         => $member->{surname} || "",
         invoiceid             => $invoice->{invoiceid},
@@ -212,10 +235,10 @@ else {
         $line{invoice}      = $invoice->{invoicenumber};
         $line{datereceived} = $datereceived->output();
         $line{freight}      = $freight;
-        $line{gst}          = $gst;
+        $line{gstrate}      = @$results[$i]->{'gstrate'} || $bookseller->{gstrate} || C4::Context->preference("gist") || 0;
         $line{title}        = @$results[$i]->{'title'};
         $line{author}       = @$results[$i]->{'author'};
-        $line{booksellerid}   = $booksellerid;
+        $line{booksellerid} = $booksellerid;
         push @loop, \%line;
     }
 
index 7f50f0b..15578a9 100755 (executable)
@@ -71,6 +71,43 @@ use JSON;
 
 my $input=new CGI;
 
+sub get_value_with_gst_params {
+    my $value = shift;
+    my $gstrate = shift;
+    my $bookseller = shift;
+    if ( $bookseller->{listincgst} ) {
+        if ( $bookseller->{invoiceincgst} ) {
+            return $value;
+        } else {
+            return $value / ( 1 + $gstrate );
+        }
+    } else {
+        if ( $bookseller->{invoiceincgst} ) {
+            return $value * ( 1 + $gstrate );
+        } else {
+            return $value;
+        }
+    }
+}
+
+sub get_gste {
+    my $value = shift;
+    my $gstrate = shift;
+    my $bookseller = shift;
+    return $bookseller->{invoiceincgst}
+        ? $value / ( 1 + $gstrate )
+        : $value;
+}
+
+sub get_gst {
+    my $value = shift;
+    my $gstrate = shift;
+    my $bookseller = shift;
+    return $bookseller->{invoiceincgst}
+        ? $value / ( 1 + $gstrate ) * $gstrate
+        : $value * ( 1 + $gstrate ) - $value;
+}
+
 my ($template, $loggedinuser, $cookie)
     = get_template_and_user({template_name => "acqui/parcel.tmpl",
                  query => $input,
@@ -125,21 +162,33 @@ my $countlines    = scalar @parcelitems;
 my $totalprice    = 0;
 my $totalquantity = 0;
 my $total;
-my $tototal;
 my @loop_received = ();
-
-for (my $i = 0 ; $i < $countlines ; $i++) {
-
-    $total = ($parcelitems[$i]->{'unitprice'}) * $parcelitems[$i]->{'quantityreceived'};
-    $parcelitems[$i]->{'unitprice'} += 0;
+my @book_foot_loop;
+my %foot;
+my $total_quantity = 0;
+my $total_gste = 0;
+my $total_gsti = 0;
+
+for my $item ( @parcelitems ) {
+    $item->{unitprice} = get_value_with_gst_params( $item->{unitprice}, $item->{gstrate}, $bookseller );
+    $total = ( $item->{'unitprice'} ) * $item->{'quantityreceived'};
+    $item->{'unitprice'} += 0;
     my %line;
-    %line          = %{ $parcelitems[$i] };
+    %line          = %{ $item };
+    my $ecost = get_value_with_gst_params( $line{ecost}, $line{gstrate}, $bookseller );
+    $line{ecost} = sprintf( "%.2f", $ecost );
     $line{invoice} = $invoice->{invoicenumber};
-    $line{gst}     = $gst;
     $line{total} = sprintf($cfstr, $total);
     $line{booksellerid} = $invoice->{booksellerid};
-    $totalprice += $parcelitems[$i]->{'unitprice'};
-    $line{unitprice} = sprintf($cfstr, $parcelitems[$i]->{'unitprice'});
+    $totalprice += $item->{'unitprice'};
+    $line{unitprice} = sprintf( $cfstr, $item->{'unitprice'} );
+    my $gste = get_gste( $line{total}, $line{gstrate}, $bookseller );
+    my $gst = get_gst( $line{total}, $line{gstrate}, $bookseller );
+    $foot{$line{gstrate}}{gstrate} = $line{gstrate};
+    $foot{$line{gstrate}}{value} += sprintf( "%.2f", $gst );
+    $total_quantity += $line{quantity};
+    $total_gste += $gste;
+    $total_gsti += $gste + $gst;
 
     my $suggestion   = GetSuggestionInfoFromBiblionumber($line{biblionumber});
     $line{suggestionid}         = $suggestion->{suggestionid};
@@ -154,11 +203,16 @@ for (my $i = 0 ; $i < $countlines ; $i++) {
         }
     }
 
+    my $budget = GetBudget( $line{budget_id} );
+    $line{budget_name} = $budget->{'budget_name'};
+
     push @loop_received, \%line;
-    $totalquantity += $parcelitems[$i]->{'quantityreceived'};
-    $tototal       += $total;
+    $totalquantity += $item->{'quantityreceived'};
+
 }
+push @book_foot_loop, map { $_ } values %foot;
 
+my @loop_orders = ();
 if(!defined $invoice->{closedate}) {
     my $pendingorders;
     if($input->param('op') eq "search"){
@@ -174,29 +228,22 @@ if(!defined $invoice->{closedate}) {
     }
     my $countpendings = scalar @$pendingorders;
 
-    # pending orders totals
-    my ($totalPunitprice, $totalPquantity, $totalPecost, $totalPqtyrcvd);
-    my $ordergrandtotal;
-    my @loop_orders = ();
     for (my $i = 0 ; $i < $countpendings ; $i++) {
         my %line;
         %line = %{$pendingorders->[$i]};
 
-        $line{quantity}+=0;
-        $line{quantityreceived}+=0;
+        my $ecost = get_value_with_gst_params( $line{ecost}, $line{gstrate}, $bookseller );
+        $line{unitprice} = get_value_with_gst_params( $line{unitprice}, $line{gstrate}, $bookseller );
+        $line{quantity} += 0;
+        $line{quantityreceived} += 0;
         $line{unitprice}+=0;
-        $totalPunitprice += $line{unitprice};
-        $totalPquantity +=$line{quantity};
-        $totalPqtyrcvd +=$line{quantityreceived};
-        $totalPecost += $line{ecost};
-        $line{ecost} = sprintf("%.2f",$line{ecost});
-        $line{ordertotal} = sprintf("%.2f",$line{ecost}*$line{quantity});
+        $line{ecost} = sprintf( "%.2f", $ecost );
+        $line{ordertotal} = sprintf( "%.2f", $ecost * $line{quantity} );
         $line{unitprice} = sprintf("%.2f",$line{unitprice});
         $line{invoice} = $invoice;
-        $line{gst} = $gst;
-        $line{total} = $total;
         $line{booksellerid} = $booksellerid;
-        $ordergrandtotal += $line{ecost} * $line{quantity};
+
+
 
         my $biblionumber = $line{'biblionumber'};
         my $countbiblio = CountBiblioInOrders($biblionumber);
@@ -231,6 +278,8 @@ if(!defined $invoice->{closedate}) {
         $line{holds}                = $holds;
         $line{holds_on_order}       = $itemholds?$itemholds:$holds if $line{left_holds_on_order};
 
+        my $budget = GetBudget( $line{budget_id} );
+        $line{budget_name} = $budget->{'budget_name'};
 
         push @loop_orders, \%line if ($i >= $startfrom and $i < $startfrom + $resultsperpage);
     }
@@ -269,17 +318,10 @@ if(!defined $invoice->{closedate}) {
     }
 
     $template->param(
-        countpending => $countpendings,
         loop_orders  => \@loop_orders,
-        ordergrandtotal => sprintf($cfstr, $ordergrandtotal),
-        totalPunitprice => sprintf("%.2f", $totalPunitprice),
-        totalPquantity  => $totalPquantity,
-        totalPqtyrcvd   => $totalPqtyrcvd,
-        totalPecost     => sprintf("%.2f", $totalPecost),
     );
 }
 
-
 $template->param(
     invoiceid             => $invoice->{invoiceid},
     invoice               => $invoice->{invoicenumber},
@@ -289,15 +331,16 @@ $template->param(
     formatteddatereceived => $datereceived->output(),
     name                  => $bookseller->{'name'},
     booksellerid          => $bookseller->{id},
-    gst                   => $gst,
     countreceived         => $countlines,
     loop_received         => \@loop_received,
+    loop_orders           => \@loop_orders,
+    book_foot_loop        => \@book_foot_loop,
     totalprice            => sprintf($cfstr, $totalprice),
     totalquantity         => $totalquantity,
-    tototal               => sprintf($cfstr, $tototal),
-    gst                   => $gst,
-    grandtot              => sprintf($cfstr, $tototal + $gst),
     resultsperpage        => $resultsperpage,
-    (uc(C4::Context->preference("marcflavour"))) => 1
+    (uc(C4::Context->preference("marcflavour"))) => 1,
+    total_quantity       => $total_quantity,
+    total_gste           => sprintf( "%.2f", $total_gste ),
+    total_gsti           => sprintf( "%.2f", $total_gsti ),
 );
 output_html_with_http_headers $input, $cookie, $template->output;
index 324b88e..1c5a68c 100644 (file)
@@ -29,7 +29,7 @@ use strict;
 use warnings;
 use utf8;
 
-use C4::Branch qw(GetBranchDetail);
+use C4::Branch qw(GetBranchDetail GetBranchName);
 
 BEGIN {
          use Exporter   ();
@@ -92,7 +92,13 @@ sub printorders {
         $text->font( $pdf->corefont("Times", -encoding => "utf8"), 6/mm );
         $text->translate(20/mm,  ($height-15)/mm);
         $text->text("Order N°".$basketgroup->{'id'}.". Basket N° ".$basket->{basketno}.". ".$basket->{booksellernote});
-        
+        $text->translate(20/mm,  ($height-20)/mm);
+        $text->font( $pdf->corefont("Times", -encoding => "utf8"), 4/mm );
+        $text->text( ( $basket->{billingplace} ? "Billing at " . C4::Branch::GetBranchName( $basket->{billingplace} ) : "" )
+            . ( $basket->{billingplace} and $basket->{deliveryplace} ? " and " : "" )
+            . ( $basket->{deliveryplace} ? "delivery at " . C4::Branch::GetBranchName( $basket->{deliveryplace}) : "" )
+        );
+
         my $pdftable = new PDF::Table();
         my $abaskets;
         my $arrbasket;
index 0387d35..d113de2 100755 (executable)
@@ -67,12 +67,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
         debug           => 1,
     }
 );
-my $seller_gstrate = $supplier->{'gstrate'};
 
-# ensure the scalar isn't flagged as a string
-$seller_gstrate = ( defined $seller_gstrate ) ? $seller_gstrate + 0 : undef;
-my $tax_rate = $seller_gstrate // C4::Context->preference('gist') // 0;
-$tax_rate *= 100;
 #build array for currencies
 if ( $op eq 'display' ) {
 
@@ -102,12 +97,11 @@ if ( $op eq 'display' ) {
         gstreg        => $supplier->{'gstreg'},
         listincgst    => $supplier->{'listincgst'},
         invoiceincgst => $supplier->{'invoiceincgst'},
+        gstrate       => $supplier->{'gstrate'} + 0.0,
         discount      => $supplier->{'discount'},
         deliverytime  => $supplier->{deliverytime},
         invoiceprice  => $supplier->{'invoiceprice'},
         listprice     => $supplier->{'listprice'},
-        GST           => $tax_rate,
-        default_tax   => defined($seller_gstrate),
         basketcount   => $supplier->{'basketcount'},
         subscriptioncount   => $supplier->{'subscriptioncount'},
         contracts     => $contracts,
@@ -142,9 +136,11 @@ if ( $op eq 'display' ) {
             };
     }
 
-    my $default_gst_rate = (C4::Context->preference('gist') * 100) || '0.0';
+    # get option values from gist syspref
+    my @gst_values = map {
+        option => $_
+    }, split( '\|', C4::Context->preference("gist") );
 
-    my $gstrate = defined $supplier->{gstrate} ? $supplier->{gstrate} * 100 : '';
     $template->param(
         booksellerid => $booksellerid,
         name         => $supplier->{'name'},
@@ -170,13 +166,12 @@ if ( $op eq 'display' ) {
         gstreg        => $supplier->{'gstreg'},
         listincgst    => $supplier->{'listincgst'},
         invoiceincgst => $supplier->{'invoiceincgst'},
-        gstrate       => $gstrate,
+        gstrate       => $supplier->{gstrate} ? $supplier->{'gstrate'}+0.0 : 0,
+        gst_values    => \@gst_values,
         discount      => $supplier->{'discount'},
         deliverytime  => $supplier->{deliverytime},
         loop_currency => $loop_currency,
-        GST           => $tax_rate,
         enter         => 1,
-        default_gst_rate => $default_gst_rate,
     );
 }
 
index 3dc6964..7b3bf9d 100755 (executable)
@@ -100,13 +100,8 @@ $data{'gstreg'}=$input->param('gst');
 $data{'listincgst'}=$input->param('list_gst');
 $data{'invoiceincgst'}=$input->param('invoice_gst');
 #have to transform this into fraction so it's easier to use
-my $gstrate = $input->param('gstrate');
-if ($gstrate eq '') {
-    $data{'gstrate'} = undef;
-} else {
-    $data{'gstrate'} = $input->param('gstrate')/100;
-}
-$data{'discount'}=$input->param('discount');
+$data{'gstrate'} = $input->param('gstrate');
+$data{'discount'} = $input->param('discount');
 $data{deliverytime} = $input->param('deliverytime');
 $data{'active'}=$input->param('status');
 if($data{'name'}) {
index 9dc8b6e..68cd0d6 100755 (executable)
@@ -46,23 +46,29 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
 );
 
 
-my $dbh          = C4::Context->dbh;
-my $error        = $input->param('error');
-my $biblionumber = $input->param('biblionumber');
-$biblionumber = 0 unless $biblionumber;
-my $frameworkcode = $input->param('frameworkcode');
-my $title         = $input->param('title');
-my $author        = $input->param('author');
-my $isbn          = $input->param('isbn');
-my $issn          = $input->param('issn');
-my $lccn          = $input->param('lccn');
+my $dbh             = C4::Context->dbh;
+my $error           = $input->param('error');
+my $biblionumber    = $input->param('biblionumber');
+$biblionumber       = 0 unless $biblionumber;
+my $frameworkcode   = $input->param('frameworkcode');
+my $title           = $input->param('title');
+my $author          = $input->param('author');
+my $isbn            = $input->param('isbn');
+my $issn            = $input->param('issn');
+my $lccn            = $input->param('lccn');
 my $lccall          = $input->param('lccall');
-my $subject= $input->param('subject');
-my $dewey = $input->param('dewey');
-my $controlnumber      = $input->param('controlnumber');
-my $op            = $input->param('op');
-my $booksellerid = $input->param('booksellerid');
-my $basketno = $input->param('basketno');
+my $subject         = $input->param('subject');
+my $dewey           = $input->param('dewey');
+my $controlnumber   = $input->param('controlnumber');
+my $op              = $input->param('op');
+my $booksellerid    = $input->param('booksellerid');
+my $basketno        = $input->param('basketno');
+
+my $page            = $input->param('current_page') || 1;
+$page               = $input->param('goto_page') if $input->param('changepage_goto');
+my $show_next       = 0;
+my $total_pages     = 0;
+
 my $noconnection;
 my $attr = '';
 my $term;
@@ -112,22 +118,26 @@ $template->param( frameworkcode => $frameworkcode,
                                     );
                                     
 
+$template->param(
+    isbn         => $isbn,
+    issn         => $issn,
+    lccn         => $lccn,
+    lccall       => $lccall,
+    title        => $title,
+    author       => $author,
+    controlnumber=> $controlnumber,
+    biblionumber => $biblionumber,
+    dewey        => $dewey,
+    subject      => $subject,
+);
 
 if ( $op ne "do_search" ) {
     my $sth = $dbh->prepare("select id,host,name,checked from z3950servers  order by host");
     $sth->execute();
     my $serverloop = $sth->fetchall_arrayref( {} );
     $template->param(
-        isbn         => $isbn,
-        issn         => $issn,
-        lccn         => $lccn,
-        lccall       => $lccall,
-        title        => $title,
-        author       => $author,
-        controlnumber=> $controlnumber,
         serverloop   => $serverloop,
         opsearch     => "search",
-        biblionumber => $biblionumber,
     );
     output_html_with_http_headers $input, $cookie, $template->output;
     exit;
@@ -148,10 +158,14 @@ if ( $op ne "do_search" ) {
     my $s = 0;
     my $query;
     my $nterms;
-    if ($isbn || $issn) {
-        $term=$isbn if ($isbn);
-        $term=$issn if ($issn);
-        $query .= " \@or \@attr 1=8 \"$term\" \@attr 1=7 \"$term\" ";
+    if ($isbn) {
+        $term=$isbn;
+        $query .= " \@attr 1=7 \@attr 5=1 \"$term\" ";
+        $nterms++;
+    }
+    if ($issn) {
+        $term=$issn;
+        $query .= " \@attr 1=8 \@attr 5=1 \"$term\" ";
         $nterms++;
     }
     if ($title) {
@@ -258,13 +272,10 @@ warn "query ".$query  if $DEBUG;
             warn "numresults = $numresults" if $DEBUG;
             my $i;
             my $result = '';
-            if ( $numresults > 0 ) {
-                for (
-                    $i = 0 ;
-                    $i < ( ( $numresults < 20 ) ? ($numresults) : (20) ) ;
-                    $i++
-                  )
-                {
+            if ( $numresults > 0  and $numresults >= (($page-1)*20)) {
+                $show_next = 1 if $numresults >= ($page*20);
+                $total_pages = int($numresults/20)+1 if $total_pages < ($numresults/20);
+                for ($i = ($page-1)*20; $i < (($numresults < ($page*20)) ? $numresults : ($page*20)); $i++) {
                     my $rec = $oResult[$k]->record($i);
                     if ($rec) {
                         my $marcrecord;
@@ -277,6 +288,10 @@ warn "query ".$query  if $DEBUG;
 ## In HEAD i change everything to UTF-8
 # In rel2_2 i am not sure what encoding is so no character conversion is done here
 ##Add necessary encoding changes to here -TG
+
+                        # Normalize the record so it doesn't have separated diacritics
+                        SetUTF8Flag($marcrecord);
+
                         my $oldbiblio = TransformMarcToKoha( $dbh, $marcrecord, "" );
                         $oldbiblio->{isbn}   =~ s/ |-|\.//g if $oldbiblio->{isbn};
                         # pad | and ( with spaces to allow line breaks in the HTML
@@ -309,7 +324,25 @@ warn "query ".$query  if $DEBUG;
             }    #$numresults
         }
     }    # if $k !=0
-    #   print  $template->output  if $firstresult !=1;
+    my $numberpending = $nremaining - 1;
+
+    my @servers = ();
+    foreach my $id (@id) {
+        push(@servers,{id => $id});
+    }
+
+    $template->param(
+        breeding_loop => \@breeding_loop,
+        server        => $servername[$k],
+        numberpending => $numberpending,
+        current_page => $page,
+        servers => \@servers,
+        total_pages => $total_pages,
+    );
+    $template->param(show_nextbutton=>1) if $show_next;
+    $template->param(show_prevbutton=>1) if $page != 1;
+
+    #  print  $template->output  if $firstresult !=1;
     $firstresult++;
 
   } # while nremaining
index aa878fd..ea22431 100755 (executable)
@@ -162,15 +162,16 @@ sub add_form {
     $template->param( add_form => 1 );
 
     #---- if primkey exists, it's a modify action, so read values to modify...
+    my $date;
     if ($curr) {
         my $curr_rec =
           $dbh->selectrow_hashref( 'select * from currency where currency=?',
             {}, $curr );
         for ( keys %{$curr_rec} ) {
+            if($_ eq "timestamp"){ $date = $curr_rec->{$_}; }
             $template->param( $_ => $curr_rec->{$_} );
         }
     }
-    my $date = $template->param('timestamp');
     if ($date) {
         $template->param( 'timestamp' => format_date($date) );
     }
diff --git a/admin/didyoumean.pl b/admin/didyoumean.pl
new file mode 100755 (executable)
index 0000000..434d0e9
--- /dev/null
@@ -0,0 +1,37 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use CGI;
+use C4::Context;
+use C4::Auth;
+use C4::Output;
+use Koha::SuggestionEngine;
+use Module::Load::Conditional qw(can_load);
+use JSON;
+
+my $input = new CGI;
+
+my ($template, $loggedinuser, $cookie)
+    = get_template_and_user({template_name => "admin/didyoumean.tt",
+            query => $input,
+            type => "intranet",
+            authnotrequired => 0,
+            flagsrequired => {parameters => 'parameters_remaining_permissions'},
+            debug => 1,
+            });
+
+my $opacplugins = from_json(C4::Context->preference('OPACdidyoumean') || '[]');
+
+my $intraplugins = from_json(C4::Context->preference('INTRAdidyoumean') || '[]');
+
+my @pluginlist = Koha::SuggestionEngine::AvailablePlugins();
+foreach my $plugin (@pluginlist) {
+    next if $plugin eq 'Koha::SuggestionEngine::Plugin::Null';
+    next unless (can_load( modules => { "$plugin" => undef } ));
+    push @$opacplugins, { name => $plugin->NAME } unless grep { $_->{name} eq $plugin->NAME } @$opacplugins;
+    push @$intraplugins, { name => $plugin->NAME } unless grep { $_->{name} eq $plugin->NAME } @$intraplugins;
+}
+$template->{VARS}->{OPACpluginlist} = $opacplugins;
+$template->{VARS}->{INTRApluginlist} = $intraplugins;
+output_html_with_http_headers $input, $cookie, $template->output;
index 365a861..615fbcf 100755 (executable)
@@ -46,7 +46,6 @@ sub string_search {
         $u++;
     }
     $sth->finish;
-    $dbh->disconnect;
     return ( $cnt, \@results );
 }
 
index fd8d7c2..0326b93 100755 (executable)
@@ -149,7 +149,7 @@ if ($op eq 'add_form') {
        my $repeatable       = $input->param('repeatable') ? 1 : 0;
        my $mandatory        = $input->param('mandatory')  ? 1 : 0;
        my $authorised_value = $input->param('authorised_value');
-    unless (C4::Context->config('demo') == 1) {
+    unless (C4::Context->config('demo')) {
         if ($input->param('modif')) {
             $sth = $dbh->prepare(
             "UPDATE marc_tag_structure SET liblibrarian=? ,libopac=? ,repeatable=? ,mandatory=? ,authorised_value=? WHERE frameworkcode=? AND tagfield=?"
@@ -194,7 +194,7 @@ if ($op eq 'add_form') {
 ################## DELETE_CONFIRMED ##################################
 # called by delete_confirm, used to effectively confirm deletion of data in DB
 } elsif ($op eq 'delete_confirmed') {
-       unless (C4::Context->config('demo') == 1) {
+       unless (C4::Context->config('demo')) {
         my $sth1 = $dbh->prepare("DELETE FROM marc_tag_structure      WHERE tagfield=? AND frameworkcode=?");
         my $sth2 = $dbh->prepare("DELETE FROM marc_subfield_structure WHERE tagfield=? AND frameworkcode=?");
         $sth1->execute($searchfield, $frameworkcode);
index 2fa2ac6..ea86c48 100755 (executable)
@@ -92,9 +92,10 @@ sub add_matching_rule_form {
 sub add_update_matching_rule {
     my $template = shift;
     my $matcher_id = shift;
+    my $record_type = $input->param('record_type') || 'biblio';
 
     # do parsing
-    my $matcher = C4::Matcher->new('biblio', 1000); # FIXME biblio only for now
+    my $matcher = C4::Matcher->new($record_type, 1000);
     $matcher->code($input->param('code'));
     $matcher->description($input->param('description'));
     $matcher->threshold($input->param('threshold'));
@@ -203,10 +204,11 @@ sub edit_matching_rule_form {
 
     my $matcher = C4::Matcher->fetch($matcher_id);
 
-    $template->param(matcher_id => $matcher_id);
-    $template->param(code => $matcher->code());
-    $template->param(description => $matcher->description());
-    $template->param(threshold => $matcher->threshold());
+    $template->{VARS}->{'matcher_id'} = $matcher_id;
+    $template->{VARS}->{'code'} = $matcher->code();
+    $template->{VARS}->{'description'} = $matcher->description();
+    $template->{VARS}->{'threshold'} = $matcher->threshold();
+    $template->{VARS}->{'record_type'} = $matcher->record_type();
 
     my $matcher_info = $matcher->dump();
     my @matchpoints = ();
index b1ad005..db91e76 100755 (executable)
@@ -297,7 +297,10 @@ my @TABS;
 if ( $op eq 'search' ) {
     my $searchfield = $input->param( 'searchfield' );
 
-    $searchfield =~ s/[^a-zA-Z0-9_ -]//g;
+    $searchfield =~ s/\p{IsC}//g;
+    $searchfield =~ s/\s+/ /;
+    $searchfield =~ s/^\s+//;
+    $searchfield =~ s/\s+$//;
 
     $template->param( searchfield => $searchfield );
 
index f45ea43..c221d71 100755 (executable)
@@ -44,7 +44,7 @@ my ($template, $loggedinuser, $cookie)
 
 my $type=$input->param('type');
 my $branch = $input->param('branch') || ( C4::Branch::onlymine() ? ( C4::Branch::mybranch() || '*' ) : '*' );
-my $op = $input->param('op');
+my $op = $input->param('op') || q{};
 
 if ($op eq 'delete') {
     my $itemtype     = $input->param('itemtype');
index 175f6a0..af91041 100755 (executable)
@@ -420,8 +420,9 @@ sub StringSearch {
                 my $sth = $dbh->prepare("Select variable,value,explanation,type,options from systempreferences where (variable like ?) order by variable");
                 $sth->execute($syspref);
                 while ( my $data = $sth->fetchrow_hashref ) {
+                    unless (defined $data->{value}) { $data->{value} = "";}
                     $data->{shortvalue} = $data->{value};
-                    $data->{shortvalue} = substr( $data->{value}, 0, 60 ) . "..." if defined( $data->{value} ) and length( $data->{value} ) > 60;
+                    $data->{shortvalue} = substr( $data->{value}, 0, 60 ) . "..." if length( $data->{value} ) > 60;
                     push( @results, $data );
                     $cnt++;
                 }
@@ -452,6 +453,7 @@ sub StringSearch {
         }
 
         while ( my $data = $sth->fetchrow_hashref ) {
+            unless (defined $data->{value}) { $data->{value} = "";}
             $data->{shortvalue} = $data->{value};
             $data->{shortvalue} = substr( $data->{value}, 0, 60 ) . "..." if length( $data->{value} ) > 60;
             push( @results, $data );
index d6044fc..fc9e2ed 100755 (executable)
@@ -53,13 +53,12 @@ sub StringSearch  {
         $sth->execute;
     }
 
-       my @results;
-       while (my $data=$sth->fetchrow_hashref) {
-           push(@results,$data);
-       }
-       $sth->finish;
-       $dbh->disconnect;
-       return (scalar(@results),\@results);
+    my @results;
+    while (my $data=$sth->fetchrow_hashref) {
+        push(@results,$data);
+    }
+    $sth->finish;
+    return (scalar(@results),\@results);
 }
 
 my $input = new CGI;
index bc565d1..f67f5c9 100755 (executable)
@@ -21,6 +21,7 @@ use strict;
 use warnings;
 
 use CGI;
+use URI::Escape;
 use C4::Auth;
 
 use C4::Context;
@@ -32,13 +33,11 @@ use C4::Koha;    # XXX subfield_is_koha_internal_p
 use C4::Biblio;
 
 my $query = new CGI;
-my $op    = $query->param('op');
-$op ||= q{};
-my $authtypecode = $query->param('authtypecode');
-$authtypecode ||= q{};
-my $dbh = C4::Context->dbh;
+my $dbh   = C4::Context->dbh;
+my $op           = $query->param('op')           || '';
+my $authtypecode = $query->param('authtypecode') || '';
+my $authid       = $query->param('authid')       || '';
 
-my $authid = $query->param('authid');
 my ( $template, $loggedinuser, $cookie );
 
 my $authtypes = getauthtypes;
@@ -71,23 +70,32 @@ if ( $op eq "delete" ) {
     );
     &DelAuthority( $authid, 1 );
 
-    $op = "do_search";
+    if ( $query->param('operator') ) {
+        # query contains search params so perform search
+        $op = "do_search";
+    }
+    else {
+        $op = '';
+    }
 }
 if ( $op eq "do_search" ) {
-    my @marclist  = $query->param('marclist');
-    my @and_or    = $query->param('and_or');
-    my @excluding = $query->param('excluding');
-    my @operator  = $query->param('operator');
-    my $orderby   = $query->param('orderby');
-    my @value     = $query->param('value');
+    my $marclist  = $query->param('marclist')  || '';
+    my $and_or    = $query->param('and_or')    || '';
+    my $excluding = $query->param('excluding') || '';
+    my $operator  = $query->param('operator')  || '';
+    my $orderby   = $query->param('orderby')   || '';
+    my $value     = $query->param('value')     || '';
 
     my $startfrom      = $query->param('startfrom')      || 1;
     my $resultsperpage = $query->param('resultsperpage') || 20;
 
-    my ( $results, $total ) =
-      SearchAuthorities( \@marclist, \@and_or, \@excluding, \@operator, \@value,
-        ( $startfrom - 1 ) * $resultsperpage,
-        $resultsperpage, $authtypecode, $orderby );
+    my ( $results, $total ) = SearchAuthorities(
+        [$marclist],  [$and_or],
+        [$excluding], [$operator],
+        [$value], ( $startfrom - 1 ) * $resultsperpage,
+        $resultsperpage, $authtypecode,
+        $orderby
+    );
 
     ( $template, $loggedinuser, $cookie ) = get_template_and_user(
         {
@@ -101,54 +109,34 @@ if ( $op eq "do_search" ) {
     );
 
     $template->param(
-        marclist       => $query->param('marclist'),
-        and_or         => $query->param('and_or'),
-        excluding      => $query->param('excluding'),
-        operator       => $query->param('operator'),
-        orderby        => $query->param('orderby'),
-        value          => $query->param('value'),
-        authtypecode   => $query->param('authtypecode'),
+        marclist       => $marclist,
+        and_or         => $and_or,
+        excluding      => $excluding,
+        operator       => $operator,
+        orderby        => $orderby,
+        value          => $value,
+        authtypecode   => $authtypecode,
         startfrom      => $startfrom,
         resultsperpage => $resultsperpage,
     );
 
-    my @field_data = ();
-
     # we must get parameters once again. Because if there is a mainentry, it
     # has been replaced by something else during the search, thus the links
     # next/previous would not work anymore
-    my @marclist_ini = $query->param('marclist');
-    for ( my $i = 0 ; $i <= $#marclist ; $i++ ) {
-        if ( $value[$i] ) {
-            push @field_data, { term => "marclist", val => $marclist_ini[$i] };
-            if ( !defined $and_or[$i] ) {
-                $and_or[$i] = q{};
-            }
-            push @field_data, { term => "and_or", val => $and_or[$i] };
-            if ( !defined $excluding[$i] ) {
-                $excluding[$i] = q{};
-            }
-            push @field_data, { term => "excluding", val => $excluding[$i] };
-            push @field_data, { term => "operator",  val => $operator[$i] };
-            push @field_data, { term => "value",     val => $value[$i] };
-        }
-    }
 
     # construction of the url of each page
-    my $base_url =
-        'authorities-home.pl?'
-      . join( '&amp;', map { $_->{term} . '=' . $_->{val} } @field_data )
-      . '&amp;'
-      . join(
-        '&amp;',
-        map { $_->{term} . '=' . $_->{val} } (
-            { term => 'resultsperpage', val => $resultsperpage },
-            { term => 'type',           val => 'intranet' },
-            { term => 'op',             val => 'do_search' },
-            { term => 'authtypecode',   val => $authtypecode },
-            { term => 'orderby',        val => $orderby },
-        )
-      );
+    my $value_url = uri_escape($value);
+    my $base_url = "authorities-home.pl?"
+      ."marclist=$marclist"
+      ."&amp;and_or=$and_or"
+      ."&amp;excluding=$excluding"
+      ."&amp;operator=$operator"
+      ."&amp;value=$value_url"
+      ."&amp;resultsperpage=$resultsperpage"
+      ."&amp;type=intranet"
+      ."&amp;op=do_search"
+      ."&amp;authtypecode=$authtypecode"
+      ."&amp;orderby=$orderby";
 
     my $from = ( $startfrom - 1 ) * $resultsperpage + 1;
     my $to;
@@ -191,7 +179,10 @@ if ( $op eq '' ) {
 
 }
 
-$template->param( authtypesloop => \@authtypesloop, );
+$template->param(
+    authtypesloop => \@authtypesloop,
+    op            => $op,
+);
 
 $template->{VARS}->{marcflavour} = C4::Context->preference("marcflavour");
 
index f6263d9..ee842e0 100755 (executable)
@@ -152,9 +152,15 @@ sub create_input {
         $value =~ s/DD/$day/g;
     }
     my $dbh = C4::Context->dbh;
+
+    # map '@' as "subfield" label for fixed fields
+    # to something that's allowed in a div id.
+    my $id_subfield = $subfield;
+    $id_subfield = "00" if $id_subfield eq "@";
+
     my %subfield_data = (
         tag        => $tag,
-        subfield   => $subfield,
+        subfield   => $id_subfield,
         marc_lib   => substr( $tagslib->{$tag}->{$subfield}->{lib}, 0, 22 ),
         marc_lib_plain => $tagslib->{$tag}->{$subfield}->{lib}, 
         tag_mandatory  => $tagslib->{$tag}->{mandatory},
@@ -162,14 +168,10 @@ sub create_input {
         repeatable     => $tagslib->{$tag}->{$subfield}->{repeatable},
         kohafield      => $tagslib->{$tag}->{$subfield}->{kohafield},
         index          => $index_tag,
-        id             => "tag_".$tag."_subfield_".$subfield."_".$index_tag."_".$index_subfield,
+        id             => "tag_".$tag."_subfield_".$id_subfield."_".$index_tag."_".$index_subfield,
         value          => $value,
+        random         => CreateKey(),
     );
-    if($subfield eq '@'){
-        $subfield_data{id} = "tag_".$tag."_subfield_00_".$index_tag."_".$index_subfield;
-    } else {
-        $subfield_data{id} = "tag_".$tag."_subfield_".$subfield."_".$index_tag."_".$index_subfield;
-    }
 
     if(exists $mandatory_z3950->{$tag.$subfield}){
         $subfield_data{z3950_mandatory} = $mandatory_z3950->{$tag.$subfield};
@@ -194,11 +196,10 @@ sub create_input {
             id=\"".$subfield_data{id}."\"
             name=\"".$subfield_data{id}."\"
             value=\"$value\"
-            class=\"input_marceditor readonly\"
-            tabindex=\"1\"
-            readonly=\"readonly\" \/>
+            class=\"input_marceditor\"
+            tabindex=\"1\" \/>
         <a href=\"#\" class=\"buttonDot\"
-        onclick=\"openAuth(this.parentNode.getElementsByTagName('input')[1].id,'".$tagslib->{$tag}->{$subfield}->{authtypecode}."'); return false;\" tabindex=\"1\" title=\"Tag Editor\">...</a>
+        onclick=\"openAuth(this.parentNode.getElementsByTagName('input')[1].id,'".$tagslib->{$tag}->{$subfield}->{authtypecode}."','auth'); return false;\" tabindex=\"1\" title=\"Tag Editor\">...</a>
     ";
     # it's a plugin field
     }
index 4c96434..6402961 100755 (executable)
@@ -199,27 +199,8 @@ if (not defined $record) {
 }
 
 if (C4::Context->preference("AuthDisplayHierarchy")){
-  my $trees=BuildUnimarcHierarchies($authid);
-  my @trees = split /;/,$trees ;
-  push @trees,$trees unless (@trees);
-  my @loophierarchies;
-  foreach my $tree (@trees){
-    my @tree=split /,/,$tree;
-    push @tree,$tree unless (@tree);
-    my $cnt=0;
-    my @loophierarchy;
-    foreach my $element (@tree){
-      my $elementdata = GetAuthority($element);
-      $record= $elementdata if ($authid==$element);
-      push @loophierarchy, BuildUnimarcHierarchy($elementdata,"child".$cnt, $authid);
-      $cnt++;
-    }
-    push @loophierarchies, { 'loopelement' =>\@loophierarchy};
-  }
-  $template->param(
-    'displayhierarchy' =>C4::Context->preference("AuthDisplayHierarchy"),
-    'loophierarchies' =>\@loophierarchies,
-  );
+    $template->{VARS}->{'displayhierarchy'} = C4::Context->preference("AuthDisplayHierarchy");
+    $template->{VARS}->{'loophierarchies'} = GenerateHierarchy($authid);
 }
 
 my $count = CountUsage($authid);
index 8fc15e4..d33216c 100755 (executable)
@@ -24,6 +24,7 @@ use C4::Biblio;
 use C4::Items;
 use C4::Auth;
 use C4::Output;
+use C4::Csv;
 
 my $query = new CGI;
 
@@ -120,6 +121,8 @@ my $resultsarray = \@results;
 
 $template->param(
     BIBLIO_RESULTS => $resultsarray,
+    csv_profiles => GetCsvProfilesLoop(),
+    bib_list => $bib_list,
 );
 
 output_html_with_http_headers $query, $cookie, $template->output;
index 72e6709..2b967df 100755 (executable)
@@ -82,7 +82,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     }
 );
 
-my $record = GetMarcBiblio($biblionumber);
+my $record = GetMarcBiblio($biblionumber, 1);
 $template->param( ocoins => GetCOinSBiblio($record) );
 
 if ( not defined $record ) {
index 7126257..162530f 100755 (executable)
@@ -150,9 +150,13 @@ foreach my $subscription (@subscriptions) {
        my $serials_to_display;
     $cell{subscriptionid}    = $subscription->{subscriptionid};
     $cell{subscriptionnotes} = $subscription->{internalnotes};
+    $cell{missinglist}       = $subscription->{missinglist};
+    $cell{librariannote}     = $subscription->{librariannote};
     $cell{branchcode}        = $subscription->{branchcode};
     $cell{branchname}        = GetBranchName($subscription->{branchcode});
     $cell{hasalert}          = $subscription->{hasalert};
+    $cell{callnumber}        = $subscription->{callnumber};
+    $cell{closed}            = $subscription->{closed};
     #get the three latest serials.
        $serials_to_display = $subscription->{staffdisplaycount};
        $serials_to_display = C4::Context->preference('StaffSerialIssueDisplayCount') unless $serials_to_display;
@@ -261,7 +265,7 @@ foreach my $item (@items) {
                $analytics_flag=1;
                $item->{countanalytics} = $countanalytics;
        }
-    if ($item->{'materials'} ne ''){
+    if (defined($item->{'materials'}) && $item->{'materials'} =~ /\S/){
        $materials_flag = 1;
     }
     push @itemloop, $item;
index 8b1234b..d1a3ca2 100755 (executable)
@@ -158,7 +158,7 @@ use CGI qw('-no_undef_params');
 my $cgi = new CGI;
 
 my ($template,$borrowernumber,$cookie);
-
+my $lang = C4::Templates::getlanguage($cgi, 'intranet');
 # decide which template to use
 my $template_name;
 my $template_type;
@@ -334,7 +334,7 @@ if ( $template_type eq 'advsearch' ) {
                       search_boxes_loop => \@search_boxes_array);
 
     # load the language limits (for search)
-    my $languages_limit_loop = getAllLanguages();
+    my $languages_limit_loop = getAllLanguages($lang);
     $template->param(search_languages_loop => $languages_limit_loop,);
 
     # Expanded search options in advanced search:
@@ -472,7 +472,6 @@ my ( $error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit
 my @results;
 
 ## I. BUILD THE QUERY
-my $lang = C4::Templates::getlanguage($cgi, 'intranet');
 ( $error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$stopwords_removed,$query_type) = buildQuery(\@operators,\@operands,\@indexes,\@limits,\@sort_by,$scan,$lang);
 
 ## parse the query_cgi string and put it into a form suitable for <input>s
index 32ea2f6..1c453c4 100755 (executable)
@@ -21,9 +21,7 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 use strict;
-#use warnings; FIXME - Bug 2505
-
-use open OUT=>":encoding(UTF-8)", ':std';
+use warnings;
 
 # standard or CPAN modules used
 use CGI qw(:standard);
@@ -39,35 +37,23 @@ use C4::ImportBatch;
 use XML::LibXSLT;
 use XML::LibXML;
 
-my $input       = new CGI;
-my $biblionumber = $input->param('id');
-my $importid           =       $input->param('importid');
-my $view               = $input->param('viewas');
+my $input= new CGI;
+my $biblionumber= $input->param('id');
+my $importid= $input->param('importid');
+my $view= $input->param('viewas')||'';
 
-my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
-    {
-        template_name   => "catalogue/showmarc.tmpl",
-        query           => $input,
-        type            => "intranet",
-        authnotrequired => 0,
-        flagsrequired   => { catalogue => 1  },
-        debug           => 1,
-    }
-);
-
-$template->param( SCRIPT_NAME => $ENV{'SCRIPT_NAME'}, );
-my ($record, $xmlrecord);
-if($importid) {
-       my ($marc,$encoding) = GetImportRecordMarc($importid);
-               $record = MARC::Record->new_from_usmarc($marc) ;
-       if($view eq 'card') {
-               $xmlrecord = $record->as_xml();
-       } 
+my $record;
+if ($importid) {
+    my ($marc) = GetImportRecordMarc($importid);
+    $record = MARC::Record->new_from_usmarc($marc);
+}
+else {
+    $record =GetMarcBiblio($biblionumber);
 }
 
 if($view eq 'card') {
     my $themelang = '/' . C4::Context->preference("opacthemes") .  '/' . C4::Templates::_current_language();
-    $xmlrecord = GetXmlBiblio($biblionumber) unless $xmlrecord;
+    my $xmlrecord= $importid? $record->as_xml(): GetXmlBiblio($biblionumber);
     my $xslfile =
       C4::Context->config('intrahtdocs') . $themelang . "/xslt/compact.xsl";
     my $parser       = XML::LibXML->new();
@@ -77,18 +63,19 @@ if($view eq 'card') {
     my $stylesheet   = $xslt->parse_stylesheet($style_doc);
     my $results      = $stylesheet->transform($source);
     my $newxmlrecord = $stylesheet->output_string($results);
-    $newxmlrecord = Encode::decode_utf8($newxmlrecord)
-      unless utf8::is_utf8($newxmlrecord)
-    ;    #decode only if not in perl internal format
-    print $input->header( -charset => 'UTF-8' ), $newxmlrecord;
+    print $input->header(-charset => 'UTF-8'), Encode::encode_utf8($newxmlrecord);
 }
 else {
-    $record =GetMarcBiblio($biblionumber) unless $record;
-
-    my $formatted = $record->as_formatted;
-    $template->param( MARC_FORMATTED => $formatted );
-
-    my $output= $template->output;
-    $output=Encode::decode_utf8($output) unless utf8::is_utf8($output);
-    output_html_with_http_headers $input, $cookie, $output;
+    my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+      {
+        template_name   => "catalogue/showmarc.tmpl",
+        query           => $input,
+        type            => "intranet",
+        authnotrequired => 0,
+        flagsrequired   => { catalogue => 1  },
+        debug           => 1,
+      }
+    );
+    $template->param( MARC_FORMATTED => $record->as_formatted );
+    output_html_with_http_headers $input, $cookie, $template->output;
 }
index 3db1a65..2d591c6 100755 (executable)
@@ -372,7 +372,8 @@ sub create_input {
     # it's a thesaurus / authority field
     }
     elsif ( $tagslib->{$tag}->{$subfield}->{authtypecode} ) {
-     if (C4::Context->preference("BiblioAddsAuthorities")) {
+        # when authorities auto-creation is allowed, do not set readonly
+        my $is_readonly = !C4::Context->preference("BiblioAddsAuthorities");
         $subfield_data{marc_value} =
             "<input type=\"text\"
                     id=\"".$subfield_data{id}."\"
@@ -381,26 +382,12 @@ sub create_input {
                     class=\"input_marceditor readonly\"
                     tabindex=\"1\"
                     size=\"67\"
-                    maxlength=\"".$subfield_data{maxlength}."\"
-                    \/>
+                    maxlength=\"".$subfield_data{maxlength}."\"".
+                    ($is_readonly ? "readonly=\"readonly\"" : "").
+                    "\/>
                     <span class=\"subfield_controls\"><a href=\"#\" class=\"buttonDot\"
-                       onclick=\"openAuth(this.parentNode.parentNode.getElementsByTagName('input')[1].id,'".$tagslib->{$tag}->{$subfield}->{authtypecode}."'); return false;\" tabindex=\"1\" title=\"Tag Editor\"><img src=\"/intranet-tmpl/prog/img/edit-tag.png\" alt=\"Tag Editor\" /></a></span>
-            ";
-      } else {
-        $subfield_data{marc_value} =
-            "<input type=\"text\"
-                    id=\"".$subfield_data{id}."\"
-                    name=\"".$subfield_data{id}."\"
-                    value=\"$value\"
-                    class=\"input_marceditor readonly\"
-                    tabindex=\"1\"
-                    size=\"67\"
-                    maxlength=\"".$subfield_data{maxlength}."\"
-                    readonly=\"readonly\"
-                    \/><span class=\"subfield_controls\"><a href=\"#\" class=\"buttonDot\"
-                        onclick=\"openAuth(this.parentNode.parentNode.getElementsByTagName('input')[1].id,'".$tagslib->{$tag}->{$subfield}->{authtypecode}."'); return false;\" tabindex=\"1\" title=\"Tag Editor\"><img src=\"/intranet-tmpl/prog/img/edit-tag.png\" alt=\"Tag Editor\" /></a></span>
+                       onclick=\"openAuth(this.parentNode.parentNode.getElementsByTagName('input')[1].id,'".$tagslib->{$tag}->{$subfield}->{authtypecode}."','biblio'); return false;\" tabindex=\"1\" title=\"Tag Editor\"><img src=\"/intranet-tmpl/prog/img/edit-tag.png\" alt=\"Tag Editor\" /></a></span>
             ";
-      }
     # it's a plugin field
     }
     elsif ( $tagslib->{$tag}->{$subfield}->{'value_builder'} ) {
index 7b7dbac..79a717c 100755 (executable)
@@ -247,7 +247,7 @@ sub generate_subfield_form {
                    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
+                    $subfield_data{marc_value} = qq[<input type="text" $attributes
                         onfocus="Focus$function_name($subfield_data{random}, '$subfield_data{id}');"
                        onchange=" $change"
                          onblur=" Blur$function_name($subfield_data{random}, '$subfield_data{id}');" />
@@ -255,7 +255,7 @@ sub generate_subfield_form {
                         $javascript];
                 } else {
                     warn "Plugin Failed: $plugin";
-                    $subfield_data{marc_value} = "<input $attributes />"; # supply default input form
+                    $subfield_data{marc_value} = "<input type=\"text\" $attributes />"; # supply default input form
                 }
         }
         elsif ( $tag eq '' ) {       # it's an hidden field
@@ -274,7 +274,7 @@ sub generate_subfield_form {
             $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\" $attributes />";
         }
         
         return \%subfield_data;
index 020001d..6a46d2f 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl 
+#!/usr/bin/perl
 
 
 # Copyright 2009 BibLibre
@@ -71,27 +71,27 @@ if ($merge) {
     # Moving items from the other record to the reference record
     my $itemnumbers = get_itemnumbers_of($frombiblio);
     foreach my $itloop ($itemnumbers->{$frombiblio}) {
-       foreach my $itemnumber (@$itloop) {
-           my $res = MoveItemFromBiblio($itemnumber, $frombiblio, $tobiblio);
-           if (not defined $res) {
-               push @notmoveditems, $itemnumber;
-           }
-       }
+    foreach my $itemnumber (@$itloop) {
+        my $res = MoveItemFromBiblio($itemnumber, $frombiblio, $tobiblio);
+        if (not defined $res) {
+            push @notmoveditems, $itemnumber;
+        }
+    }
     }
     # If some items could not be moved :
     if (scalar(@notmoveditems) > 0) {
-               my $itemlist = join(' ',@notmoveditems);
-               push @errors, "The following items could not be moved from the old record to the new one: $itemlist";
+        my $itemlist = join(' ',@notmoveditems);
+        push @errors, { code => "CANNOT_MOVE", value => $itemlist };
     }
 
     # Moving subscriptions from the other record to the reference record
     my $subcount = CountSubscriptionFromBiblionumber($frombiblio);
     if ($subcount > 0) {
-       $sth = $dbh->prepare("UPDATE subscription SET biblionumber = ? WHERE biblionumber = ?");
-       $sth->execute($tobiblio, $frombiblio);
+    $sth = $dbh->prepare("UPDATE subscription SET biblionumber = ? WHERE biblionumber = ?");
+    $sth->execute($tobiblio, $frombiblio);
 
-       $sth = $dbh->prepare("UPDATE subscriptionhistory SET biblionumber = ? WHERE biblionumber = ?");
-       $sth->execute($tobiblio, $frombiblio);
+    $sth = $dbh->prepare("UPDATE subscriptionhistory SET biblionumber = ? WHERE biblionumber = ?");
+    $sth->execute($tobiblio, $frombiblio);
 
     }
 
@@ -103,16 +103,16 @@ if ($merge) {
 
     # Deleting the other record
     if (scalar(@errors) == 0) {
-       # Move holds
-       MergeHolds($dbh,$tobiblio,$frombiblio);
-       my $error = DelBiblio($frombiblio);
-       push @errors, $error if ($error); 
+    # Move holds
+    MergeHolds($dbh,$tobiblio,$frombiblio);
+    my $error = DelBiblio($frombiblio);
+    push @errors, $error if ($error);
     }
 
     # Parameters
     $template->param(
-       result => 1,
-       biblio1 => $input->param('biblio1')
+    result => 1,
+    biblio1 => $input->param('biblio1')
     );
 
 #-------------------------
@@ -123,7 +123,7 @@ if ($merge) {
     my $biblionumber = $input->param('biblionumber');
 
     if (scalar(@biblionumber) != 2) {
-        push @errors, "An unexpected number of records was provided for merging. Currently only two records at a time can be merged.";
+        push @errors, { code => "WRONG_COUNT", value => scalar(@biblionumber) };
     }
     else {
         my $data1 = GetBiblioData($biblionumber[0]);
@@ -206,8 +206,7 @@ if ($merge) {
 
 if (@errors) {
     # Errors
-    my @errors_loop  = map{{error => $_}}@errors;
-    $template->param( errors  => \@errors_loop );
+    $template->param( errors  => \@errors );
 }
 
 output_html_with_http_headers $input, $cookie, $template->output;
@@ -228,48 +227,48 @@ sub _createMarcHash {
 
 
     foreach my $field (@fields) {
-       my $fieldtag = $field->tag();
-       if ($fieldtag < 10) {
-           if ($tagslib->{$fieldtag}->{'@'}->{'tab'} >= 0) {
-               push @array, { 
-                       field => [ 
-                                   {
-                                       tag => $fieldtag, 
-                                       key => createKey(), 
-                                       value => $field->data(),
-                                   }
-                               ]
-                           };    
-           }
-       } else {
-           my @subfields = $field->subfields();
-           my @subfield_array;
-           foreach my $subfield (@subfields) {
-               if ($tagslib->{$fieldtag}->{@$subfield[0]}->{'tab'} >= 0) {
-                   push @subfield_array, {  
-                                        subtag => @$subfield[0],
-                                       subkey => createKey(), 
-                                        value => @$subfield[1],
-                                      };
-               }
-
-           }
-
-           if ($tagslib->{$fieldtag}->{'tab'} >= 0 && $fieldtag ne '995') {
-               push @array, {
-                       field => [  
-                                   {
-                                       tag => $fieldtag, 
-                                       key => createKey(), 
-                                       indicator1 => $field->indicator(1), 
-                                       indicator2 => $field->indicator(2), 
-                                       subfield   => [@subfield_array], 
-                                   }
-                               ]
-                           };  
-           }
-
-       }
+    my $fieldtag = $field->tag();
+    if ($fieldtag < 10) {
+        if ($tagslib->{$fieldtag}->{'@'}->{'tab'} >= 0) {
+        push @array, {
+            field => [
+                    {
+                    tag => $fieldtag,
+                    key => createKey(),
+                    value => $field->data(),
+                    }
+                ]
+                };
+        }
+    } else {
+        my @subfields = $field->subfields();
+        my @subfield_array;
+        foreach my $subfield (@subfields) {
+        if ($tagslib->{$fieldtag}->{@$subfield[0]}->{'tab'} >= 0) {
+            push @subfield_array, {
+                                    subtag => @$subfield[0],
+                                    subkey => createKey(),
+                                    value => @$subfield[1],
+                                  };
+        }
+
+        }
+
+        if ($tagslib->{$fieldtag}->{'tab'} >= 0 && $fieldtag ne '995') {
+        push @array, {
+            field => [
+                {
+                    tag => $fieldtag,
+                    key => createKey(),
+                    indicator1 => $field->indicator(1),
+                    indicator2 => $field->indicator(2),
+                    subfield   => [@subfield_array],
+                }
+            ]
+            };
+        }
+
+    }
     }
     return [@array];
 
@@ -285,5 +284,3 @@ sub createKey {
     return int(rand(1000000));
 }
 
-
-    
index 6bad3e9..26f0800 100755 (executable)
@@ -16,7 +16,7 @@ use CGI::Cookie; # need to check cookies before
                  # having CGI parse the POST request
 
 my %cookies = fetch CGI::Cookie;
-my ($auth_status, $sessionID) = check_cookie_auth($cookies{'CGISESSID'}->value, { editcatalogue => '1' });
+my ($auth_status, $sessionID) = check_cookie_auth($cookies{'CGISESSID'}->value, { editcatalogue => 'edit_catalogue' });
 if ($auth_status ne "ok") {
     my $reply = CGI->new("");
     print $reply->header(-type => 'text/html');
index 275d3a5..f317f8b 100644 (file)
@@ -226,7 +226,7 @@ sub plugin {
                       my $record = MARC::Record::new_from_usmarc( $results->[$i] );
                   my $rechash = TransformMarcToKoha( $dbh, $record );
                     my $pos;
-                       my $countitems = 1 if ( $rechash->{itemnumber} );
+                       my $countitems = $rechash->{itembumber} ? 1 : 0;
                       while ( index( $rechash->{itemnumber}, '|', $pos ) > 0 ) {
                              $countitems += 1;
                               $pos = index( $rechash->{itemnumber}, '|', $pos ) + 1;
@@ -406,4 +406,4 @@ sub plugin {
       output_html_with_http_headers $query, $cookie, $template->output;
 }
 
-1;
\ No newline at end of file
+1;
diff --git a/cataloguing/value_builder/stocknumberAV.pl b/cataloguing/value_builder/stocknumberAV.pl
new file mode 100755 (executable)
index 0000000..0578d44
--- /dev/null
@@ -0,0 +1,113 @@
+#!/usr/bin/perl
+
+# Copyright 2012 BibLibre SARL
+#
+# 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 Modern::Perl;
+use C4::Auth;
+use CGI;
+use C4::Context;
+
+=head1 DESCRIPTION
+
+This plugin is based on authorised values INVENTORY.
+It is used for stocknumber computation.
+
+If the user send an empty string, we return a simple incremented stocknumber.
+If a prefix is submited, we look for the highest stocknumber with this prefix, and return it incremented.
+In this case, a stocknumber has this form : "PREFIX 0009678570".
+ - PREFIX is an upercase word
+ - a space separator
+ - 10 digits, with leading 0s if needed
+
+=cut
+
+sub plugin_parameters {
+}
+
+sub plugin_javascript {
+    my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+    my $res = qq{
+    <script type='text/javascript'>
+        function Focus$field_number() {
+            return 1;
+        }
+
+        function Blur$field_number() {
+                return 1;
+        }
+
+        function Clic$field_number() {
+                var code = document.getElementById('$field_number');
+                \$.ajax({
+                    url: '/cgi-bin/koha/cataloguing/plugin_launcher.pl',
+                    type: 'POST',
+                    data: {
+                        'plugin_name': 'stocknumberAV.pl',
+                        'code'    : code.value,
+                    },
+                    success: function(data){
+                        var field = document.getElementById('$field_number');
+                        field.value = data;
+                        return 1;
+                    }
+                });
+        }
+    </script>
+    };
+
+    return ($field_number,$res);
+}
+
+sub plugin {
+    my ($input) = @_;
+    my $code = $input->param('code');
+
+    my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+        {   template_name   => "cataloguing/value_builder/ajax.tmpl",
+            query           => $input,
+            type            => "intranet",
+            authnotrequired => 0,
+            flagsrequired   => { editcatalogue => '*' },
+            debug           => 1,
+        }
+    );
+
+    my $dbh = C4::Context->dbh;
+
+    # If a prefix is submited, we look for the highest stocknumber with this prefix, and return it incremented
+    $code =~ s/ *$//g;
+    if ( $code =~ m/^[A-Z]+$/ ) {
+        my $sth = $dbh->prepare("SELECT lib FROM authorised_values WHERE category='INVENTORY' AND authorised_value=?");
+        $sth->execute( $code);
+
+        if ( my $valeur = $sth->fetchrow ) {
+            $template->param( return => $code . ' ' . sprintf( '%010s', ( $valeur + 1 ) ), );
+            my $sth2 = $dbh->prepare("UPDATE authorised_values SET lib=? WHERE category='INVENTORY' AND authorised_value=?");
+            $sth2->execute($valeur+1,$code);
+        } else {
+                $template->param( return => "There is no defined value for $code");
+        }
+        # The user entered a custom value, we don't touch it, this could be handled in js
+    } else {
+        $template->param( return => $code, );
+    }
+
+    output_html_with_http_headers $input, $cookie, $template->output;
+}
+
+1;
index 5e22636..fd4eff9 100755 (executable)
@@ -49,6 +49,12 @@ my $stdid                    = $input->param('stdid');
 my $srchany                    = $input->param('srchany');
 my $random        = $input->param('random') || rand(1000000000); # this var is not useful anymore just kept for rel2_2 compatibility
 my $op            = $input->param('op');
+
+my $page            = $input->param('current_page') || 1;
+$page = $input->param('goto_page') if $input->param('changepage_goto');
+my $show_next = 0;
+my $total_pages = 0;
+
 my $numberpending;
 my $attr = '';
 my $term;
@@ -80,24 +86,28 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
 });
 
 $template->param( frameworkcode => $frameworkcode, );
+$template->param(
+    isbn         => $isbn,
+    issn         => $issn,
+    lccn         => $lccn,
+    lccall       => $lccall,
+    title        => $title,
+    author       => $author,
+    controlnumber=> $controlnumber,
+    stdid        => $stdid,
+    srchany      => $srchany,
+    biblionumber => $biblionumber,
+    dewey        => $dewey,
+    subject      => $subject,
+);
 
 if ( $op ne "do_search" ) {
     my $sth = $dbh->prepare("SELECT id,host,name,checked FROM z3950servers ORDER BY rank, name");
     $sth->execute();
     my $serverloop = $sth->fetchall_arrayref( {} );
     $template->param(
-        isbn         => $isbn,
-        issn         => $issn,
-        lccn         => $lccn,
-        lccall       => $lccall,
-        title        => $title,
-        author       => $author,
-        controlnumber=> $controlnumber,
-        stdid                  => $stdid,
-        srchany                => $srchany,
         serverloop   => $serverloop,
         opsearch     => "search",
-        biblionumber => $biblionumber,
     );
     output_html_with_http_headers $input, $cookie, $template->output;
 }
@@ -235,8 +245,10 @@ warn "query ".$query  if $DEBUG;
             my $numresults = $oResult[$k]->size();
             my $i;
             my $result = '';
-            if ( $numresults > 0 ) {
-                for ($i = 0; $i < (($numresults < 20) ? $numresults : 20); $i++) {
+            if ( $numresults > 0  and $numresults >= (($page-1)*20)) {
+                $show_next = 1 if $numresults >= ($page*20);
+                $total_pages = int($numresults/20)+1 if $total_pages < ($numresults/20);
+                for ($i = ($page-1)*20; $i < (($numresults < ($page*20)) ? $numresults : ($page*20)); $i++) {
                     my $rec = $oResult[$k]->record($i);
                     if ($rec) {
                         my $marcrecord;
@@ -249,6 +261,10 @@ warn "query ".$query  if $DEBUG;
 ## In HEAD i change everything to UTF-8
 # In rel2_2 i am not sure what encoding is so no character conversion is done here
 ##Add necessary encoding changes to here -TG
+
+                        # Normalize the record so it doesn't have separated diacritics
+                        SetUTF8Flag($marcrecord);
+
                         my $oldbiblio = TransformMarcToKoha( $dbh, $marcrecord, "" );
                         $oldbiblio->{isbn}   =~ s/ |-|\.//g if $oldbiblio->{isbn};
                         # pad | and ( with spaces to allow line breaks in the HTML
@@ -284,13 +300,24 @@ warn "query ".$query  if $DEBUG;
         }
     }    # if $k !=0
     $numberpending = $nremaining - 1;
+
+    my @servers = ();
+    foreach my $id (@id) {
+        push(@servers,{id => $id});
+    }
+
     $template->param(
         breeding_loop => \@breeding_loop,
         server        => $servername[$k],
         numberpending => $numberpending,
         biblionumber  => $biblionumber,
-        errconn       => \@errconn
+        errconn       => \@errconn,
+        current_page => $page,
+        servers => \@servers,
+        total_pages => $total_pages,
     );
+    $template->param(show_nextbutton=>1) if $show_next;
+    $template->param(show_prevbutton=>1) if $page != 1;
     
     output_html_with_http_headers $input, $cookie, $template->output if $numberpending == 0;
 
index f15d4ce..91fd1a2 100755 (executable)
@@ -94,14 +94,14 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user (
 my $branches = GetBranches();
 
 my @failedrenews = $query->param('failedrenew');    # expected to be itemnumbers 
-our %renew_failed = {};
+our %renew_failed = ();
 for (@failedrenews) { $renew_failed{$_} = 1; }
 
 my @failedreturns = $query->param('failedreturn');
-our %return_failed = {};
+our %return_failed = ();
 for (@failedreturns) { $return_failed{$_} = 1; }
 
-my $findborrower = $query->param('findborrower');
+my $findborrower = $query->param('findborrower') || q{};
 $findborrower =~ s|,| |g;
 my $borrowernumber = $query->param('borrowernumber');
 
@@ -122,7 +122,7 @@ if (C4::Context->preference("UseTablesortForCirc")) {
     $template->param(UseTablesortForCirc => 1);
 }
 
-my $barcode        = $query->param('barcode') || '';
+my $barcode        = $query->param('barcode') || q{};
 $barcode =~  s/^\s*|\s*$//g; # remove leading/trailing whitespace
 
 $barcode = barcodedecode($barcode) if( $barcode && C4::Context->preference('itemBarcodeInputFilter'));
@@ -131,7 +131,7 @@ my $duedatespec    = $query->param('duedatespec')   || $session->param('stickydu
 my $issueconfirmed = $query->param('issueconfirmed');
 my $cancelreserve  = $query->param('cancelreserve');
 my $organisation   = $query->param('organisations');
-my $print          = $query->param('print');
+my $print          = $query->param('print') || q{};
 my $newexpiry      = $query->param('dateexpiry');
 my $debt_confirmed = $query->param('debt_confirmed') || 0; # Don't show the debt error dialog twice
 
@@ -466,7 +466,7 @@ sub build_issue_data {
         $it->{'renew_failed'} = $renew_failed{$it->{'itemnumber'}};
         $it->{'return_failed'} = $return_failed{$it->{'barcode'}};
 
-        if ( $it->{'issuedate'} gt $todaysdate or $it->{'lastreneweddate'} gt $todaysdate ) {
+        if ( $it->{'issuedate'}."" gt $todaysdate or $it->{'lastreneweddate'} gt $todaysdate ) {
             (!$relatives) ? push @todaysissues, $it : push @relissues, $it;
         } else {
             (!$relatives) ? push @previousissues, $it : push @relprevissues, $it;
index 61bace9..e532faf 100755 (executable)
@@ -36,7 +36,7 @@ use Date::Calc qw/Today Add_Delta_YMD/;
 my $input = new CGI;
 my $startdate=$input->param('from');
 my $enddate=$input->param('to');
-my $run_report=$input->param('run_report');
+my $run_report = ( not defined $input->param('run_report') ) ? 1 : $input->param('run_report');
 
 my $theme = $input->param('theme');    # only used if allowthemeoverride is set
 
@@ -68,8 +68,9 @@ my ( $year, $month, $day ) = Today();
 my $todaysdate     = sprintf("%-04.4d-%-02.2d-%02.2d", $year, $month, $day);
 my $yesterdaysdate = sprintf("%-04.4d-%-02.2d-%02.2d", Add_Delta_YMD($year, $month, $day,   0, 0, -1));
 # changed from delivered range of 10 years-yesterday to 2 days ago-today
-# Find two days ago for the default shelf pull start and end dates
-my $pastdate       = sprintf("%-04.4d-%-02.2d-%02.2d", Add_Delta_YMD($year, $month, $day, 0, 0, -2));
+# Find two days ago for the default shelf pull start and end dates, unless HoldsToPullStartDate sys pref is set.
+my $defaultstartdate = ( C4::Context->preference('HoldsToPullStartDate') ) ? "-".C4::Context->preference('HoldsToPullStartDate') : -2;
+my $pastdate       = sprintf("%-04.4d-%-02.2d-%02.2d", Add_Delta_YMD($year, $month, $day, 0, 0, $defaultstartdate));
 
 # Predefine the start and end dates if they are not already defined
 $startdate =~ s/^\s+//;
@@ -162,31 +163,31 @@ if ( $run_report ) {
         push(
             @reservedata,
             {
-                reservedate            => format_date( $data->{l_reservedate} ),
-                priority               => $data->{priority},
-                name                   => $data->{l_patron},
-                title                  => $data->{title},
-                author                 => $data->{author},
-                borrowernumber         => $data->{borrowernumber},
-                itemnum                => $data->{itemnumber},
-                phone                  => $data->{phone},
-                email                  => $data->{email},
-                biblionumber           => $data->{biblionumber},
-                statusw                => ( $data->{found} eq "W" ),
-                statusf                => ( $data->{found} eq "F" ),
-                holdingbranch          => $data->{l_holdingbranch},
-                branch                 => $data->{l_branch},
-                itemcallnumber         => $data->{l_itemcallnumber},
-                enumchron              => $data->{l_enumchron},
-               copyno                  => $data->{l_copynumber},
-                notes                  => $data->{notes},
-                notificationdate       => $data->{notificationdate},
-                reminderdate           => $data->{reminderdate},
-                count                  => $data->{icount},
-                rcount                 => $data->{rcount},
-                pullcount              => $data->{icount} <= $data->{rcount} ? $data->{icount} : $data->{rcount},
-                itype                  => $data->{l_itype},
-                location               => $data->{l_location}
+                reservedate     => format_date( $data->{l_reservedate} ),
+                priority        => $data->{priority},
+                name            => $data->{l_patron},
+                title           => $data->{title},
+                author          => $data->{author},
+                borrowernumber  => $data->{borrowernumber},
+                itemnum         => $data->{itemnumber},
+                phone           => $data->{phone},
+                email           => $data->{email},
+                biblionumber    => $data->{biblionumber},
+                statusw         => ( $data->{found} eq "W" ),
+                statusf         => ( $data->{found} eq "F" ),
+                holdingbranch   => $data->{l_holdingbranch},
+                branch          => $data->{l_branch},
+                itemcallnumber  => $data->{l_itemcallnumber},
+                enumchron       => $data->{l_enumchron},
+                copyno          => $data->{l_copynumber},
+                notes           => $data->{notes},
+                notificationdate=> $data->{notificationdate},
+                reminderdate    => $data->{reminderdate},
+                count           => $data->{icount},
+                rcount          => $data->{rcount},
+                pullcount       => $data->{icount} <= $data->{rcount} ? $data->{icount} : $data->{rcount},
+                itype           => $data->{l_itype},
+                location        => $data->{l_location},
             }
         );
     }
@@ -194,14 +195,15 @@ if ( $run_report ) {
 }
 
 $template->param(
-    todaysdate         => format_date($todaysdate),
+    todaysdate          => format_date($todaysdate),
     from                => $startdate,
-    to                 => $enddate,
+    to                  => $enddate,
     run_report          => $run_report,
-    reserveloop        => \@reservedata,
+    reserveloop         => \@reservedata,
     "BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1,
-    DHTMLcalendar_dateformat =>  C4::Dates->DHTMLcalendar(),
-    dateformat    => C4::Context->preference("dateformat"),
+    DHTMLcalendar_dateformat    =>  C4::Dates->DHTMLcalendar(),
+    dateformat                  => C4::Context->preference("dateformat"),
+    HoldsToPullStartDate        => (C4::Context->preference('HoldsToPullStartDate')?C4::Context->preference('HoldsToPullStartDate'):2),
 );
 
 output_html_with_http_headers $input, $cookie, $template->output;
index 743bf18..9472797 100755 (executable)
@@ -285,15 +285,6 @@ if ($barcode) {
         $input{duedate}   = 0;
         $returneditems{0} = $barcode;
         $riduedate{0}     = 0;
-        if ( $messages->{'wthdrawn'} ) {
-            $input{withdrawn}      = 1;
-            $input{borrowernumber} = 'Item Cancelled';  # FIXME: should be in display layer ?
-            $riborrowernumber{0}   = 'Item Cancelled';
-        }
-        else {
-            $input{borrowernumber} = '&nbsp;';  # This seems clearly bogus.
-            $riborrowernumber{0}   = '&nbsp;';
-        }
         push( @inputloop, \%input );
     }
 }
@@ -427,6 +418,9 @@ foreach my $code ( keys %$messages ) {
     elsif ( $code eq 'WasLost' ) {
         $err{waslost} = 1;
     }
+    elsif ( $code eq 'LostItemFeeRefunded' ) {
+        $template->param( LostItemFeeRefunded => 1 );
+    }
     elsif ( $code eq 'ResFound' ) {
         ;    # FIXME... anything to do here?
     }
@@ -438,7 +432,7 @@ foreach my $code ( keys %$messages ) {
     }
     elsif ( $code eq 'wthdrawn' ) {
         $err{withdrawn} = 1;
-        $exit_required_p = 1;
+        $exit_required_p = 1 if C4::Context->preference("BlockReturnOfWithdrawnItems");
     }
     elsif ( ( $code eq 'IsPermanent' ) && ( not $messages->{'ResFound'} ) ) {
         if ( $messages->{'IsPermanent'} ne $userenv_branch ) {
@@ -474,72 +468,6 @@ foreach my $code ( keys %$messages ) {
 }
 $template->param( errmsgloop => \@errmsgloop );
 
-# patrontable ....
-if ($borrower) {
-    my $flags = $borrower->{'flags'};
-    my @flagloop;
-    my $flagset;
-    foreach my $flag ( sort keys %$flags ) {
-        my %flaginfo;
-        unless ($flagset) { $flagset = 1; }
-        $flaginfo{redfont} = ( $flags->{$flag}->{'noissues'} );
-        $flaginfo{flag}    = $flag;
-        if ( $flag eq 'CHARGES' ) {
-            $flaginfo{msg}            = $flag;
-            $flaginfo{charges}        = 1;
-            $flaginfo{chargeamount}   = $flags->{$flag}->{amount};
-            $flaginfo{borrowernumber} = $borrower->{borrowernumber};
-        }
-        elsif ( $flag eq 'WAITING' ) {
-            $flaginfo{msg}     = $flag;
-            $flaginfo{waiting} = 1;
-            my @waitingitemloop;
-            my $items = $flags->{$flag}->{'itemlist'};
-            foreach my $item (@$items) {
-                my $biblio = GetBiblioFromItemNumber( $item->{'itemnumber'});
-                push @waitingitemloop, {
-                    biblionum => $biblio->{'biblionumber'},
-                    barcode   => $biblio->{'barcode'},
-                    title     => $biblio->{'title'},
-                    brname    => $branches->{ $biblio->{'holdingbranch'} }->{'branchname'},
-                };
-            }
-            $flaginfo{itemloop} = \@waitingitemloop;
-        }
-        elsif ( $flag eq 'ODUES' ) {
-            my $items = $flags->{$flag}->{'itemlist'};
-            my @itemloop;
-            foreach my $item ( sort { $a->{'date_due'} cmp $b->{'date_due'} }
-                @$items )
-            {
-                my $biblio = GetBiblioFromItemNumber( $item->{'itemnumber'});
-                push @itemloop, {
-                    duedate   => format_sqldatetime($item->{date_due}),
-                    biblionum => $biblio->{'biblionumber'},
-                    barcode   => $biblio->{'barcode'},
-                    title     => $biblio->{'title'},
-                    brname    => $branches->{ $biblio->{'holdingbranch'} }->{'branchname'},
-                };
-            }
-            $flaginfo{itemloop} = \@itemloop;
-            $flaginfo{overdue}  = 1;
-        }
-        else {
-            $flaginfo{other} = 1;
-            $flaginfo{msg}   = $flags->{$flag}->{'message'};
-        }
-        push( @flagloop, \%flaginfo );
-    }
-    $template->param(
-        flagset          => $flagset,
-        flagloop         => \@flagloop,
-        riborrowernumber => $borrower->{'borrowernumber'},
-        riborcnum        => $borrower->{'cardnumber'},
-        riborsurname     => $borrower->{'surname'},
-        ribortitle       => $borrower->{'title'},
-        riborfirstname   => $borrower->{'firstname'}
-    );
-}
 #set up so only the last 8 returned items display (make for faster loading pages)
 my $returned_counter = ( C4::Context->preference('numReturnedItemsToShow') ) ? C4::Context->preference('numReturnedItemsToShow') : 8;
 my $count = 0;
@@ -610,6 +538,7 @@ $template->param(
     dropboxdate    => output_pref($dropboxdate),
     overduecharges => $overduecharges,
     soundon        => C4::Context->preference("SoundOn"),
+    BlockReturnOfWithdrawnItems => C4::Context->preference("BlockReturnOfWithdrawnItems"),
 );
 
 ### Comment out rotating collections for now to allow it a little more time to bake
index c9c9f0e..ec3feb5 100755 (executable)
@@ -96,12 +96,6 @@ foreach my $num (@getreserves) {
     my $holdingbranch = $gettitle->{'holdingbranch'};
     my $homebranch = $gettitle->{'homebranch'};
 
-    if ($cancelall) {
-        my $res = cancel( $itemnumber, $borrowernum, $holdingbranch, $homebranch, !$transfer_when_cancel_all );
-        push @cancel_result, $res if $res;
-        next;
-    }
-
     my %getreserv = (
         itemnumber => $itemnumber,
         borrowernum => $borrowernum,
@@ -139,8 +133,14 @@ foreach my $num (@getreserves) {
     }
  
     if ($today > $calcDate) {
-        push @overloop,   \%getreserv;
-        $overcount++;
+        if ($cancelall) {
+            my $res = cancel( $itemnumber, $borrowernum, $holdingbranch, $homebranch, !$transfer_when_cancel_all );
+            push @cancel_result, $res if $res;
+            next;
+        } else {
+            push @overloop,   \%getreserv;
+            $overcount++;
+        }
     }else{
         push @reservloop, \%getreserv;
         $reservcount++;
index 334b63a..4447f10 100644 (file)
@@ -6,17 +6,23 @@ Standards-Version: 3.8.4
 # NOTA BENE: Build dependencies end up as runtime dependencies as well.
 # See debian/rules, the override_dh_gencontrol rules. 
 # There are some exceptions.
-Build-Depends: libcgi-session-driver-memcached-perl,
- libalgorithm-checkdigits-perl,
+Build-Depends: libalgorithm-checkdigits-perl,
+ libanyevent-http-perl,
+ libanyevent-perl,
  libauthen-cas-client-perl,
  libbiblio-endnotestyle-perl,
  libbusiness-isbn-perl,
+ libcache-memcached-fast-perl,
  libcgi-pm-perl | perl-modules,
+ libcgi-session-driver-memcached-perl,
  libcgi-session-perl,
  libcgi-session-serialize-yaml-perl,
+ libchi-driver-memcached-perl,
+ libchi-perl,
  libclass-accessor-perl,
  libclass-factory-util-perl,
  libdata-ical-perl,
+ libdata-paginator-perl,
  libdate-calc-perl,
  libdate-manip-perl,
  libdatetime-event-ical-perl,
@@ -26,6 +32,7 @@ Build-Depends: libcgi-session-driver-memcached-perl,
  libdatetime-perl,
  libdatetime-set-perl,
  libdatetime-timezone-perl,
+ libdbd-mock-perl,
  libdbd-mysql-perl,
  libdbd-sqlite2-perl,
  libdbi-perl,
@@ -35,8 +42,10 @@ Build-Depends: libcgi-session-driver-memcached-perl,
  libgd-gd2-noxpm-perl | libgd-gd2-perl,
  libgraphics-magick-perl,
  libgravatar-url-perl,
+ libhtml-format-perl,
  libhtml-scrubber-perl,
  libhttp-oai-perl,
+ libjson-any-perl,
  libjson-perl,
  liblingua-stem-perl,
  liblingua-stem-snowball-perl,
@@ -51,6 +60,9 @@ Build-Depends: libcgi-session-driver-memcached-perl,
  libmemoize-memcached-perl,
  libmime-lite-perl,
  libmodern-perl-perl,
+ libmoose-perl,
+ libmoosex-storage-perl,
+ libmoosex-types-perl,
  libnet-ldap-perl,
  libnet-server-perl,
  libnet-z3950-zoom-perl,
@@ -66,14 +78,21 @@ Build-Depends: libcgi-session-driver-memcached-perl,
  libscalar-list-utils-perl,
  libschedule-at-perl,
  libsms-send-perl,
+ libstring-rewriteprefix-perl,
  libtemplate-perl,
+ libtemplate-plugin-htmltotext-perl,
+ libtest-deep-perl,
+ libtest-mockmodule-perl,
  libtest-simple-perl | perl-modules,
  libtest-strict-perl,
+ libtest-warn-perl,
+ libtest-yaml-valid-perl,
  libtext-csv-encoded-perl,
  libtext-csv-perl,
  libtext-csv-xs-perl,
  libtext-iconv-perl,
  libtext-unaccent-perl,
+ libtime-progress-perl,
  libuniversal-require-perl,
  liburi-perl,
  libwww-perl,
@@ -135,3 +154,140 @@ Description: integrated (physical) library management system
  .
  Please see /usr/share/doc/koha/README.Debian for instructions on how to
  configure things after installing this package.
+
+Package: koha-deps
+Depends: ${misc:Depends},
+ apache2,
+ apache2-mpm-itk,
+ at,
+ daemon,
+ debconf,
+ idzebra-2.0,
+ libjs-jquery,
+ libjs-yui,
+ mysql-client,
+ mysql-server,
+ perl-doc,
+ pwgen,
+ sudo,
+ tinymce2,
+ unzip,
+ xmlstarlet,
+ yaz
+Architecture: all
+Description: Other dep. for koha
+ Koha is an Integrated Library Managment system for real-world libraries
+ (the kinds with books).
+ .
+ This meta-package contains general dependencies packages for koha (apache2,
+ daemon, debconf, etc.).
+
+Package: koha-perldeps
+Depends: libalgorithm-checkdigits-perl,
+ libanyevent-http-perl,
+ libanyevent-perl,
+ libauthen-cas-client-perl,
+ libbiblio-endnotestyle-perl,
+ libbusiness-isbn-perl,
+ libcache-memcached-fast-perl,
+ libcgi-pm-perl | perl-modules,
+ libcgi-session-driver-memcached-perl,
+ libcgi-session-perl,
+ libcgi-session-serialize-yaml-perl,
+ libchi-driver-memcached-perl,
+ libchi-perl,
+ libclass-accessor-perl,
+ libclass-factory-util-perl,
+ libdata-ical-perl,
+ libdata-paginator-perl,
+ libdate-calc-perl,
+ libdate-manip-perl,
+ libdatetime-event-ical-perl,
+ libdatetime-format-dateparse-perl,
+ libdatetime-format-ical-perl,
+ libdatetime-format-mysql-perl,
+ libdatetime-perl,
+ libdatetime-set-perl,
+ libdatetime-timezone-perl,
+ libdbd-mock-perl,
+ libdbd-mysql-perl,
+ libdbd-sqlite2-perl,
+ libdbi-perl,
+ libdigest-sha-perl | perl,
+ libemail-date-perl,
+ libgd-barcode-perl,
+ libgd-gd2-noxpm-perl | libgd-gd2-perl,
+ libgraphics-magick-perl,
+ libgravatar-url-perl,
+ libhtml-format-perl,
+ libhtml-scrubber-perl,
+ libhttp-oai-perl,
+ libjson-any-perl,
+ libjson-perl,
+ liblingua-stem-perl,
+ liblingua-stem-snowball-perl,
+ liblist-moreutils-perl,
+ liblocale-currency-format-perl,
+ liblocale-po-perl,
+ libmail-sendmail-perl,
+ libmarc-charset-perl,
+ libmarc-crosswalk-dublincore-perl,
+ libmarc-record-perl,
+ libmarc-xml-perl,
+ libmemoize-memcached-perl,
+ libmime-lite-perl,
+ libmodern-perl-perl,
+ libmoose-perl,
+ libmoosex-storage-perl,
+ libmoosex-types-perl,
+ libnet-ldap-perl,
+ libnet-server-perl,
+ libnet-z3950-zoom-perl,
+ libnumber-format-perl,
+ libpdf-api2-perl,
+ libpdf-api2-simple-perl,
+ libpdf-reuse-barcode-perl,
+ libpdf-reuse-perl,
+ libpdf-table-perl,
+ libpoe-perl,
+ libreadonly-perl,
+ libreadonly-xs-perl,
+ libscalar-list-utils-perl,
+ libschedule-at-perl,
+ libsms-send-perl,
+ libstring-rewriteprefix-perl,
+ libtemplate-perl,
+ libtemplate-plugin-htmltotext-perl,
+ libtest-deep-perl,
+ libtest-mockmodule-perl,
+ libtest-simple-perl | perl-modules,
+ libtest-strict-perl,
+ libtest-warn-perl,
+ libtest-yaml-valid-perl,
+ libtext-csv-encoded-perl,
+ libtext-csv-perl,
+ libtext-csv-xs-perl,
+ libtext-iconv-perl,
+ libtext-unaccent-perl,
+ libtime-progress-perl,
+ libuniversal-require-perl,
+ liburi-perl,
+ libwww-perl,
+ libxml-dumper-perl,
+ libxml-libxml-perl,
+ libxml-libxslt-perl,
+ libxml-rss-perl,
+ libxml-sax-perl,
+ libxml-sax-writer-perl,
+ libxml-simple-perl,
+ libyaml-perl,
+ libyaml-syck-perl,
+ perl,
+ perl-modules
+Architecture: all
+Description: Perl dep. for koha
+ Koha is an Integrated Library Managment system for real-world libraries
+ (the kinds with books).
+ .
+ This meta-package contains perl dependencies packages for koha (all
+ perl lib).
index 0e70595..bbef4f2 100644 (file)
     <variablelist>
 
       <varlistentry>
+        <term><option>koha-create</option></term>
+        <listitem>
+          <para>Create new Koha instances.</para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
         <term><option>koha-disable</option></term>
         <listitem>
           <para>Disable a Koha instance.</para>
       </varlistentry>
 
       <varlistentry>
+        <term><option>koha-run-backups</option></term>
+        <listitem>
+          <para>Performs backups of the koha installations on the system, except an instance called 'demo'.</para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
         <term><option>koha-remove</option></term>
         <listitem>
           <para>Remove a Koha instance.</para>
index 869e9c7..733ddd9 100644 (file)
@@ -23,7 +23,7 @@
 
   <refsynopsisdiv>
     <cmdsynopsis>
-      <command>koha-list</command> <arg><option>--enabled</option></arg> <arg><option>--email</option>|<option>--noemail</option></arg> <arg><option>command</option></arg>
+      <command>koha-foreach</command> <arg><option>--enabled</option></arg> <arg><option>--email</option>|<option>--noemail</option></arg> <arg><option>command</option></arg>
     </cmdsynopsis>
   </refsynopsisdiv>
 
diff --git a/debian/docs/koha-run-backups.xml b/debian/docs/koha-run-backups.xml
new file mode 100644 (file)
index 0000000..1538817
--- /dev/null
@@ -0,0 +1,69 @@
+<article xmlns='http://docbook.org/ns/docbook'>
+<title>koha-run-backups</title>
+<info>
+<productname>Koha</productname> is the first free software library automation package.
+<author>
+  <orgname>The Koha Communnity</orgname>
+  <uri>http://koha-community.org/</uri>
+</author>
+</info>
+
+<refentry xml:id="koha-run-backups">
+
+  <refmeta>
+    <refentrytitle>koha-run-backups</refentrytitle>
+    <manvolnum>8</manvolnum>
+  </refmeta>
+
+  <refnamediv>
+    <refname>koha-run-backups</refname>
+    <refpurpose>Performs backups of the koha installations on the system, except an instance called 'demo'.</refpurpose>
+    <refclass>UNIX/Linux</refclass>
+  </refnamediv>
+
+  <refsynopsisdiv>
+    <cmdsynopsis>
+      <command>koha-run-backups</command>
+      <arg><option>--output</option> /some/path</arg>
+      <arg><option>--days</option> 2</arg>
+    </cmdsynopsis>
+  </refsynopsisdiv>
+
+  <refsect1><title>Options</title>
+  <variablelist>
+
+    <varlistentry>
+      <term><option>--output</option></term>
+      <listitem>
+        <para>The directory that the resulting files will be placed into (default: /var/spool/koha).</para>
+      </listitem>
+    </varlistentry>
+
+    <varlistentry>
+      <term><option>--days</option></term>
+      <listitem>
+        <para>The number of days to keep backups around for (default: 2).</para>
+      </listitem>
+    </varlistentry>
+
+  </variablelist>
+  </refsect1>
+
+  <refsect1><title>Description</title>
+    <para><command>koha-run-backups</command> allows automation of backing up the koha data and configuration to the filesystem. It will keep the past so many backups, discarding older ones. This script uses <command>koha-dump</command> to do the actual backup.</para>
+    <para>If there is an instance called 'demo', it will be skipped by this script.</para>
+    <para>Note: backups produced using this tool can be restored using <command>koha-restore</command>.</para>
+  </refsect1>
+
+  <refsect1><title>See also</title>
+
+  <simplelist type="inline">
+    <member><command>koha-dump(8)</command></member>
+    <member><command>koha-restore(8)</command></member>
+  </simplelist>
+
+  </refsect1>
+
+</refentry>
+
+</article>
index 7fed07e..cb2eee3 100755 (executable)
@@ -20,6 +20,9 @@ override_dh_auto_install:
        rm -r $(TMP)/var/run
        rm -r $(TMP)/var/lock
        rm $(TMP)/var/log/koha/README
+       rm $(TMP)/etc/koha/searchengine/solr/config.yaml
+       rm $(TMP)/etc/koha/searchengine/solr/indexes.yaml
+       rm $(TMP)/etc/koha/solr/indexes.yaml
 #      rm $(TMP)/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/lib/jquery/jquery.js
 #      ln -s /usr/share/javascript/jquery/jquery.js \
 #         $(TMP)/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/lib/jquery/jquery.js
@@ -28,16 +31,17 @@ override_dh_auto_install:
 #         $(TMP)/usr/share/koha/opac/htdocs/opac-tmpl/prog/en/lib/jquery/jquery.js
        rm -r \
                $(TMP)/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/js/tinymce
+               mkdir -p $(TMP)/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/js/tinymce/jscripts
        ln -s /usr/share/tinymce2/www \
-               $(TMP)/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/js/tinymce
+              $(TMP)/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/js/tinymce/jscripts/tiny_mce
        rm -r \
                $(TMP)/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/lib/yui
        ln -s /usr/share/javascript/yui \
                $(TMP)/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/lib/yui
        rm -r \
-               $(TMP)/usr/share/koha/opac/htdocs/opac-tmpl/prog/en/lib/yui
+              $(TMP)/usr/share/koha/opac/htdocs/opac-tmpl/lib/yui
        ln -s /usr/share/javascript/yui \
-               $(TMP)/usr/share/koha/opac/htdocs/opac-tmpl/prog/en/lib/yui
+         $(TMP)/usr/share/koha/opac/htdocs/opac-tmpl/lib/yui
        install -d $(TMP)/etc/apache2/sites-available
        install -d $(TMP)/etc/apache2/sites-enabled
        install -d $(TMP)/etc/apache2/conf.d
@@ -50,11 +54,11 @@ override_dh_auto_install:
        sed -i $(TMP)/usr/share/koha/koha-conf.xml.in \
                -e '/^ <user>/s/>.*</>_DBC_DBUSER_</' \
                -e '/^ <pass>/s/>.*</>_DBC_DBPASS_</'
-       install -m 0644 koha-tmpl/opac-tmpl/prog/en/lib/yui/skin.css \
-               koha-tmpl/opac-tmpl/prog/en/lib/yui/reset-fonts-grids.css \
+       install -m 0644 koha-tmpl/opac-tmpl/lib/yui/skin.css \
+         koha-tmpl/opac-tmpl/lib/yui/reset-fonts-grids.css \
                $(TMP)/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/css
-       install -m 0644 koha-tmpl/opac-tmpl/prog/en/lib/yui/skin.css \
-               koha-tmpl/opac-tmpl/prog/en/lib/yui/reset-fonts-grids.css \
+       install -m 0644 koha-tmpl/opac-tmpl/lib/yui/skin.css \
+         koha-tmpl/opac-tmpl/lib/yui/reset-fonts-grids.css \
                $(TMP)/usr/share/koha/opac/htdocs/opac-tmpl/prog/en/css
        install -m 0644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/menu-button-arrow-disabled.png \
                $(TMP)/usr/share/koha/opac/htdocs/opac-tmpl/prog/en/css
index b0c418c..66f2016 100755 (executable)
@@ -94,7 +94,7 @@ fi
 
 [ $# -ge 2 ] && [ $# -le 16 ] || die $usage
 
-TEMP=`getopt -o crpm:l:d:f:a: -l create-db,request-db,populate-db,use-db,marcflavor:,zebralang:,defaultsql:,configfile:,passwdfile:,adminuser: \
+TEMP=`getopt -o crpm:l:d:f:b:a: -l create-db,request-db,populate-db,use-db,marcflavor:,zebralang:,defaultsql:,configfile:,passwdfile:,database:,adminuser: \
      -n "$0" -- "$@"`
 
 # Note the quotes around `$TEMP': they are essential!
index eb06f03..204e402 100644 (file)
@@ -628,4 +628,18 @@ July 7 2012        Stacey Walker becomes the 187th developer to have a patch pushed
 July 7 2012    Mirko Tietgen becomes the 188th developer to have a patch pushed
 July 22 2012   Koha 3.8.3 released     releases
 July 22 2012   Koha 3.6.7 released     releases
-September 3 2012    Kathryn Tyree becomes the 189th developer to have a patch pushed
+August 22 2012 Koha 3.8.4 released     releases
+August 22 2012 Koha 3.6.8 released     releases
+September 3 2012       Kathryn Tyree becomes the 189th developer to have a patch pushed
+September 11 2012      Melia Meggs becomes the 190th developer to have a patch pushed
+September 20 2012      Joseph Alway beomes the 191st developer to have a patch pushed
+September 22 2012      Koha 3.8.5 released     releases
+September 22 2012      Koha 3.6.9 released     releases
+October 13 2012        Ivan Brown becomes the 192nd developer to have a patch pushed
+October 22 2012        Mathieu Saby becomes the 193rd developer to have a patch pushed
+October 22 2012        Koha 3.8.6 released     releases
+October 23 2012        Koha 3.6.10 released    releases
+October 26 2012        Robert Williams becomes the 194th developer to have a patch pushed
+November 22 2012       Koha 3.8.7 released     releases
+November 23 2012       Koha 3.10.0 released    releases
+
index a54c173..53d7ce8 100644 (file)
@@ -44,47 +44,47 @@ __PAZPAR2_TOGGLE_XML_POST__
                 xmlns:xi="http://www.w3.org/2001/XInclude">
       <xi:fallback>
      <retrievalinfo>
-       <retrieval syntax="usmarc" name="F"/>
-       <retrieval syntax="usmarc" name="B"/>
+       <retrieval syntax="__ZEBRA_MARC_FORMAT__" name="F"/>
+       <retrieval syntax="__ZEBRA_MARC_FORMAT__" name="B"/>
        <retrieval syntax="xml" name="F"/>
        <retrieval syntax="xml" name="B"/>
        <retrieval syntax="xml" name="marcxml"
                   identifier="info:srw/schema/1/marcxml-v1.1">
-         <backend syntax="usmarc" name="F">
+         <backend syntax="__ZEBRA_MARC_FORMAT__" name="F">
            <marc inputformat="marc" outputformat="marcxml"
                  inputcharset="utf-8"/>
          </backend>
        </retrieval>
        <retrieval syntax="xml" name="dc">
-         <backend syntax="usmarc" name="F">
+         <backend syntax="__ZEBRA_MARC_FORMAT__" name="F">
            <marc inputformat="marc" outputformat="marcxml"
                  inputcharset="utf-8"/>
            <xslt stylesheet="__INTRANET_TMPL_DIR__/prog/en/xslt/MARC21slim2DC.xsl"/>
          </backend>
        </retrieval>
        <retrieval syntax="xml" name="mods">
-         <backend syntax="usmarc" name="F">
+         <backend syntax="__ZEBRA_MARC_FORMAT__" name="F">
            <marc inputformat="marc" outputformat="marcxml"
                  inputcharset="utf-8"/>
            <xslt stylesheet="__INTRANET_TMPL_DIR__/prog/en/xslt/MARC21slim2MODS.xsl"/>
          </backend>
        </retrieval>
        <retrieval syntax="xml" name="rdfdc">
-         <backend syntax="usmarc" name="F">
+         <backend syntax="__ZEBRA_MARC_FORMAT__" name="F">
            <marc inputformat="marc" outputformat="marcxml"
                  inputcharset="utf-8"/>
            <xslt stylesheet="__INTRANET_TMPL_DIR__/prog/en/xslt/MARC21slim2RDFDC.xsl"/>
          </backend>
        </retrieval>
        <retrieval syntax="xml" name="rss2">
-         <backend syntax="usmarc" name="F">
+         <backend syntax="__ZEBRA_MARC_FORMAT__" name="F">
            <marc inputformat="marc" outputformat="marcxml"
                  inputcharset="utf-8"/>
            <xslt stylesheet="__INTRANET_TMPL_DIR__/prog/en/xslt/MARC21slim2RSS2.xsl"/>
          </backend>
        </retrieval>
        <retrieval syntax="xml" name="utils">
-         <backend syntax="usmarc" name="F">
+         <backend syntax="__ZEBRA_MARC_FORMAT__" name="F">
            <marc inputformat="marc" outputformat="marcxml"
                  inputcharset="utf-8"/>
            <xslt stylesheet="__INTRANET_TMPL_DIR__/prog/en/xslt/MARC21slimUtils.xsl"/>
@@ -124,38 +124,38 @@ __PAZPAR2_TOGGLE_XML_POST__
                 xmlns:xi="http://www.w3.org/2001/XInclude">
       <xi:fallback>
      <retrievalinfo>
-       <retrieval syntax="usmarc" name="F"/>
-       <retrieval syntax="usmarc" name="B"/>
+       <retrieval syntax="__ZEBRA_MARC_FORMAT__" name="F"/>
+       <retrieval syntax="__ZEBRA_MARC_FORMAT__" name="B"/>
        <retrieval syntax="xml" name="marcxml"
                   identifier="info:srw/schema/1/marcxml-v1.1">
-         <backend syntax="usmarc" name="F">
+         <backend syntax="__ZEBRA_MARC_FORMAT__" name="F">
            <marc inputformat="marc" outputformat="marcxml"
                  inputcharset="utf-8"/>
          </backend>
        </retrieval>
        <retrieval syntax="xml" name="dc">
-         <backend syntax="usmarc" name="F">
+         <backend syntax="__ZEBRA_MARC_FORMAT__" name="F">
            <marc inputformat="marc" outputformat="marcxml"
                  inputcharset="utf-8"/>
            <xslt stylesheet="__INTRANET_TMPL_DIR__/prog/en/xslt/MARC21slim2DC.xsl"/>
          </backend>
        </retrieval>
        <retrieval syntax="xml" name="mods">
-         <backend syntax="usmarc" name="F">
+         <backend syntax="__ZEBRA_MARC_FORMAT__" name="F">
            <marc inputformat="marc" outputformat="marcxml"
                  inputcharset="utf-8"/>
            <xslt stylesheet="__INTRANET_TMPL_DIR__/prog/en/xslt/MARC21slim2MODS.xsl"/>
          </backend>
        </retrieval>
        <retrieval syntax="xml" name="rdfdc">
-         <backend syntax="usmarc" name="F">
+         <backend syntax="__ZEBRA_MARC_FORMAT__" name="F">
            <marc inputformat="marc" outputformat="marcxml"
                  inputcharset="utf-8"/>
            <xslt stylesheet="__INTRANET_TMPL_DIR__/prog/en/xslt/MARC21slim2RDFDC.xsl"/>
          </backend>
        </retrieval>
        <retrieval syntax="xml" name="utils">
-         <backend syntax="usmarc" name="F">
+         <backend syntax="__ZEBRA_MARC_FORMAT__" name="F">
            <marc inputformat="marc" outputformat="marcxml"
                  inputcharset="utf-8"/>
            <xslt stylesheet="__INTRANET_TMPL_DIR__/prog/en/xslt/MARC21slimUtils.xsl"/>
@@ -193,47 +193,47 @@ __PAZPAR2_TOGGLE_XML_POST__
                 xmlns:xi="http://www.w3.org/2001/XInclude">
       <xi:fallback>
      <retrievalinfo>
-       <retrieval syntax="usmarc" name="F"/>
-       <retrieval syntax="usmarc" name="B"/>
+       <retrieval syntax="__ZEBRA_MARC_FORMAT__" name="F"/>
+       <retrieval syntax="__ZEBRA_MARC_FORMAT__" name="B"/>
        <retrieval syntax="xml" name="F"/>
        <retrieval syntax="xml" name="B"/>
        <retrieval syntax="xml" name="marcxml"
                   identifier="info:srw/schema/1/marcxml-v1.1">
-         <backend syntax="usmarc" name="F">
+         <backend syntax="__ZEBRA_MARC_FORMAT__" name="F">
            <marc inputformat="marc" outputformat="marcxml"
                  inputcharset="utf-8"/>
          </backend>
        </retrieval>
        <retrieval syntax="xml" name="dc">
-         <backend syntax="usmarc" name="F">
+         <backend syntax="__ZEBRA_MARC_FORMAT__" name="F">
            <marc inputformat="marc" outputformat="marcxml"
                  inputcharset="utf-8"/>
            <xslt stylesheet="__INTRANET_TMPL_DIR__/prog/en/xslt/MARC21slim2DC.xsl"/>
          </backend>
        </retrieval>
        <retrieval syntax="xml" name="mods">
-         <backend syntax="usmarc" name="F">
+         <backend syntax="__ZEBRA_MARC_FORMAT__" name="F">
            <marc inputformat="marc" outputformat="marcxml"
                  inputcharset="utf-8"/>
            <xslt stylesheet="__INTRANET_TMPL_DIR__/prog/en/xslt/MARC21slim2MODS.xsl"/>
          </backend>
        </retrieval>
        <retrieval syntax="xml" name="rdfdc">
-         <backend syntax="usmarc" name="F">
+         <backend syntax="__ZEBRA_MARC_FORMAT__" name="F">
            <marc inputformat="marc" outputformat="marcxml"
                  inputcharset="utf-8"/>
            <xslt stylesheet="__INTRANET_TMPL_DIR__/prog/en/xslt/MARC21slim2RDFDC.xsl"/>
          </backend>
        </retrieval>
        <retrieval syntax="xml" name="rss2">
-         <backend syntax="usmarc" name="F">
+         <backend syntax="__ZEBRA_MARC_FORMAT__" name="F">
            <marc inputformat="marc" outputformat="marcxml"
                  inputcharset="utf-8"/>
            <xslt stylesheet="__INTRANET_TMPL_DIR__/prog/en/xslt/MARC21slim2RSS2.xsl"/>
          </backend>
        </retrieval>
        <retrieval syntax="xml" name="utils">
-         <backend syntax="usmarc" name="F">
+         <backend syntax="__ZEBRA_MARC_FORMAT__" name="F">
            <marc inputformat="marc" outputformat="marcxml"
                  inputcharset="utf-8"/>
            <xslt stylesheet="__INTRANET_TMPL_DIR__/prog/en/xslt/MARC21slimUtils.xsl"/>
index ef462f3..3e0f5fb 100644 (file)
@@ -13,6 +13,7 @@ att 9042    Heading-use-subject-added-entry
 att 9043    Kind-of-record
 att 9046    Record-status
 att 9050    Subject-heading-thesaurus
+att 9051    Previous-heading-see-from
 
 # Personal Name
 att 1       Personal-name
index 99920f9..a977ae5 100644 (file)
@@ -1,3 +1,3 @@
 # $Id: usmarc.mar,v 1.1 2002/10/22 12:51:09 adam Exp $
-name usmarc
-reference USmarc
+name __ZEBRA_MARC_FORMAT__
+reference __ZEBRA_MARC_FORMAT__
index f1013e1..5a34eb2 100644 (file)
@@ -6,6 +6,7 @@ run the following command:
 authority-zebra-indexdefs.xsl`
 -->
 <kohaidx:index_defs xmlns:kohaidx="http://www.koha-community.org/schemas/index-defs">
+  <id>marc:controlfield[@tag='001']</id>
   <!-- variables -->
   <kohaidx:var name="form_subdivision_subfield">v</kohaidx:var>
   <kohaidx:var name="general_subdivision_subfield">x</kohaidx:var>
@@ -45,6 +46,19 @@ authority-zebra-indexdefs.xsl`
   <kohaidx:index_control_field tag="008" offset="16" length="1">
     <kohaidx:target_index>Heading-use-series-added-entry:w</kohaidx:target_index>
   </kohaidx:index_control_field>
+
+  <!-- 010 LC Number -->
+  <kohaidx:index_subfields tag="010" subfields="az">
+    <kohaidx:target_index>LC-card-number:w</kohaidx:target_index>
+    <kohaidx:target_index>LC-card-number:p</kohaidx:target_index>
+  </kohaidx:index_subfields>
+
+  <!-- 040 cataloging agencies -->
+  <kohaidx:index_subfields tag="040" subfields="acd">
+    <kohaidx:target_index>Record-source:w</kohaidx:target_index>
+    <kohaidx:target_index>Record-source:p</kohaidx:target_index>
+  </kohaidx:index_subfields>
+
   
   <!-- Personal name headings -->
   <kohaidx:index_subfields tag="100" subfields="abcdefghjklmnopqrstvxyz">
@@ -346,6 +360,9 @@ authority-zebra-indexdefs.xsl`
     <kohaidx:target_index>See-from:p</kohaidx:target_index>
     <kohaidx:target_index>See-from:s</kohaidx:target_index>
   </kohaidx:index_heading>
+  <kohaidx:index_heading_conditional tag="450" test="substring(marc:subfield[@code='w']/text(), 2, 1)" subfields="abvxyz" subdivisions="vxyz">
+    <kohaidx:target_index>Previous-heading-see-from:p</kohaidx:target_index>
+  </kohaidx:index_heading_conditional>
   <kohaidx:index_match_heading tag="450" subfields="abvxyz" subdivisions="vxyz">
     <kohaidx:target_index>Match:w</kohaidx:target_index>
     <kohaidx:target_index>Match:p</kohaidx:target_index>
index 6315316..02509b3 100644 (file)
@@ -13,6 +13,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml)
   <xslo:template match="text()" mode="index_subfields"/>
   <xslo:template match="text()" mode="index_data_field"/>
   <xslo:template match="text()" mode="index_heading"/>
+  <xslo:template match="text()" mode="index_heading_conditional"/>
   <xslo:template match="text()" mode="index_match_heading"/>
   <xslo:template match="text()" mode="index_subject_thesaurus"/>
   <xslo:template match="/">
@@ -26,15 +27,16 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml)
     </xslo:if>
   </xslo:template>
   <xslo:template match="marc:record">
-    <xslo:variable name="controlField001" select="normalize-space(marc:controlfield[@tag='001'])"/>
+    <xslo:variable name="idfield" select="normalize-space(marc:controlfield[@tag='001'])"/>
     <z:record type="update">
       <xslo:attribute name="z:id">
-        <xslo:value-of select="$controlField001"/>
+        <xslo:value-of select="$idfield"/>
       </xslo:attribute>
       <xslo:apply-templates/>
       <xslo:apply-templates mode="index_subfields"/>
       <xslo:apply-templates mode="index_data_field"/>
       <xslo:apply-templates mode="index_heading"/>
+      <xslo:apply-templates mode="index_heading_conditional"/>
       <xslo:apply-templates mode="index_match_heading"/>
       <xslo:apply-templates mode="index_subject_thesaurus"/>
     </z:record>
@@ -69,6 +71,24 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml)
       <xslo:value-of select="substring(., 17, 1)"/>
     </z:index>
   </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='010']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('az', @code)">
+        <z:index name="LC-card-number:w LC-card-number:p">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='040']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('acd', @code)">
+        <z:index name="Record-source:w Record-source:p">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
   <xslo:template mode="index_subfields" match="marc:datafield[@tag='100']">
     <xslo:for-each select="marc:subfield">
       <xslo:if test="contains('abcdefghjklmnopqrstvxyz', @code)">
@@ -1102,6 +1122,30 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml)
       <xslo:value-of select="normalize-space($raw_heading)"/>
     </z:index>
   </xslo:template>
+  <xslo:template mode="index_heading_conditional" match="marc:datafield[@tag='450']">
+    <xslo:if test="substring(marc:subfield[@code='w']/text(), 2, 1)">
+      <z:index name="Previous-heading-see-from:p">
+        <xslo:variable name="raw_heading">
+          <xslo:for-each select="marc:subfield">
+            <xslo:if test="contains('abvxyz', @code)" name="Previous-heading-see-from:p">
+              <xslo:if test="position() &gt; 1">
+                <xslo:choose>
+                  <xslo:when test="contains('vxyz', @code)">
+                    <xslo:text>--</xslo:text>
+                  </xslo:when>
+                  <xslo:otherwise>
+                    <xslo:value-of select="substring(' ', 1, 1)"/>
+                  </xslo:otherwise>
+                </xslo:choose>
+              </xslo:if>
+              <xslo:value-of select="."/>
+            </xslo:if>
+          </xslo:for-each>
+        </xslo:variable>
+        <xslo:value-of select="normalize-space($raw_heading)"/>
+      </z:index>
+    </xslo:if>
+  </xslo:template>
   <xslo:template mode="index_match_heading" match="marc:datafield[@tag='100']">
     <z:index name="Match:w Match:p Match-heading:p Match-heading:s">
       <xslo:variable name="raw_heading">
index dcd2c24..e76107c 100644 (file)
@@ -46,6 +46,12 @@ melm 130 Title-uniform:w,Title-uniform:p,Title-uniform:s,Heading:w,Heading:p,Hea
 melm 431 Title-uniform-see-from:w,Title-uniform-see-from:p,Title-uniform-see-from:s,See-from:w,See-from:p,See-from:s,Match:w,Match:p
 melm 531 Title-uniform-see-also-from:w,Title-uniform-see-also-from:p,Title-uniform-see-also-from:s,See-also-from:w,See-also-from:p,See-also-from:s,Match:w,Match:p
 
+# Chronological Term
+melm 148$a Chronological-term-heading:w,Chronological-term-heading:p,Chronological-term-heading:s,Chronological-term:w,Chronological-term:p,Heading:w,Heading:p,Heading:s,Heading-Main:w,Heading-Main:p,Heading-Main:s
+melm 148 Chronological-term:w,Chronological-term:p,Chronological-term:s,Heading:w,Heading:p,Heading:s
+melm 448 Chronological-term-see-from:w,Chronological-term-see-from:p,Chronological-term-see-from:s,See-from:w,See-from:p,See-from:s
+melm 548 Chronological-term-see-also-from:w,Chronological-term-see-also-from:p,Chronological-term-see-also-from:s,See-also-from:w,See-also-from:p,See-also-from:s
+
 # Topical Term
 melm 150$a Subject-topical-heading:w,Subject-topical-heading:p,Subject-topical-heading:s,Subject-topical:w,Subject-topical:p,Heading:w,Heading:p,Heading:s,Heading-Main:w,Heading-Main:p,Heading-Main:s,Match:w,Match:p,Match-heading:w,Match-heading:p
 melm 150 Subject-topical:w,Subject-topical:p,Subject-topical:s,Heading:w,Heading:p,Heading:s,Match:w,Match:p,Match-heading:w,Match-heading:p
index 9219000..14443d6 100644 (file)
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <kohaidx:index_defs xmlns:kohaidx="http://www.koha-community.org/schemas/index-defs">
   <!--record.abs line 40: xelm /record/leader llength:w:range(data,0,5),rtype:w:range(data,6,1),Bib-level:w:range(data,7,1)-->
+  <id>marc:datafield[@tag='999']/marc:subfield[@code='c']</id>
   <index_leader xmlns="http://www.koha-community.org/schemas/index-defs" offset="0" length="5">
     <target_index>llength:w</target_index>
   </index_leader>
   </index_subfields>
   <!--record.abs line 286: melm 952$3      materials-specified -->
   <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="3">
-    <target_index>materials-specified :w</target_index>
+    <target_index>materials-specified:w</target_index>
   </index_subfields>
   <!--record.abs line 287: melm 952$4      damaged:n,damaged:w-->
   <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="4">
index 06b7882..14f299e 100644 (file)
@@ -13,6 +13,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml)
   <xslo:template match="text()" mode="index_subfields"/>
   <xslo:template match="text()" mode="index_data_field"/>
   <xslo:template match="text()" mode="index_heading"/>
+  <xslo:template match="text()" mode="index_heading_conditional"/>
   <xslo:template match="text()" mode="index_match_heading"/>
   <xslo:template match="text()" mode="index_subject_thesaurus"/>
   <xslo:template match="/">
@@ -26,15 +27,16 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml)
     </xslo:if>
   </xslo:template>
   <xslo:template match="marc:record">
-    <xslo:variable name="controlField001" select="normalize-space(marc:controlfield[@tag='001'])"/>
+    <xslo:variable name="idfield" select="normalize-space(marc:datafield[@tag='999']/marc:subfield[@code='c'])"/>
     <z:record type="update">
       <xslo:attribute name="z:id">
-        <xslo:value-of select="$controlField001"/>
+        <xslo:value-of select="$idfield"/>
       </xslo:attribute>
       <xslo:apply-templates/>
       <xslo:apply-templates mode="index_subfields"/>
       <xslo:apply-templates mode="index_data_field"/>
       <xslo:apply-templates mode="index_heading"/>
+      <xslo:apply-templates mode="index_heading_conditional"/>
       <xslo:apply-templates mode="index_match_heading"/>
       <xslo:apply-templates mode="index_subject_thesaurus"/>
     </z:record>
diff --git a/etc/zebradb/marc_defs/normarc/biblios/biblio-zebra-indexdefs.xml b/etc/zebradb/marc_defs/normarc/biblios/biblio-zebra-indexdefs.xml
new file mode 100644 (file)
index 0000000..fd012c9
--- /dev/null
@@ -0,0 +1,954 @@
+<?xml version="1.0" encoding="utf-8"?>
+<kohaidx:index_defs xmlns:kohaidx="http://www.koha-community.org/schemas/index-defs">
+  <!--record.abs line 64: xelm /record/leader llength:w:range(data,0,5),rtype:w:range(data,6,1),Bib-level:w:range(data,7,1)-->
+  <index_leader xmlns="http://www.koha-community.org/schemas/index-defs" offset="0" length="5">
+    <target_index>llength:w</target_index>
+  </index_leader>
+  <index_leader xmlns="http://www.koha-community.org/schemas/index-defs" offset="6" length="1">
+    <target_index>rtype:w</target_index>
+  </index_leader>
+  <index_leader xmlns="http://www.koha-community.org/schemas/index-defs" offset="7" length="1">
+    <target_index>Bib-level:w</target_index>
+  </index_leader>
+  <!--record.abs line 67: melm 001        Control-number-->
+  <index_control_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="001">
+    <target_index>Control-number:w</target_index>
+  </index_control_field>
+  <!--record.abs line 71: melm 007        Microform-generation:n:range(data,11,1),Material-type,ff7-00:w:range(data,0,1),ff7-01:w:range(data,1,1),ff7-02:w:range(data,2,1),ff7-01-02:w:range(data,0,2)-->
+  <index_control_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="007" offset="11" length="1">
+    <target_index>Microform-generation:n</target_index>
+  </index_control_field>
+  <index_control_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="007">
+    <target_index>Material-type:w</target_index>
+  </index_control_field>
+  <index_control_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="007" offset="0" length="1">
+    <target_index>ff7-00:w</target_index>
+  </index_control_field>
+  <index_control_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="007" offset="1" length="1">
+    <target_index>ff7-01:w</target_index>
+  </index_control_field>
+  <index_control_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="007" offset="2" length="1">
+    <target_index>ff7-02:w</target_index>
+  </index_control_field>
+  <index_control_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="007" offset="0" length="2">
+    <target_index>ff7-01-02:w</target_index>
+  </index_control_field>
+  <!--record.abs line 74: melm 008        date-entered-on-file:n:range(data,0,5),date-entered-on-file:s:range(data,0,5),pubdate:w:range(data,7,4),pubdate:n:range(data,7,4),pubdate:y:range(data,7,4),pubdate:s:range(data,7,4),pl:w:range(data,15,3),ta:w:range(data,22,1),ff8-23:w:range(data,23,1),ff8-29:w:range(data,29,1),lf:w:range(data,33,1),bio:w:range(data,34,1),ln:n:range(data,35,3),ctype:w:range(data,24,4),Record-source:w:range(data,39,0)-->
+  <index_control_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="008" offset="0" length="5">
+    <target_index>date-entered-on-file:n</target_index>
+  </index_control_field>
+  <index_control_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="008" offset="0" length="5">
+    <target_index>date-entered-on-file:s</target_index>
+  </index_control_field>
+  <index_control_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="008" offset="7" length="4">
+    <target_index>pubdate:w</target_index>
+  </index_control_field>
+  <index_control_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="008" offset="7" length="4">
+    <target_index>pubdate:n</target_index>
+  </index_control_field>
+  <index_control_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="008" offset="7" length="4">
+    <target_index>pubdate:y</target_index>
+  </index_control_field>
+  <index_control_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="008" offset="7" length="4">
+    <target_index>pubdate:s</target_index>
+  </index_control_field>
+  <index_control_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="008" offset="15" length="3">
+    <target_index>pl:w</target_index>
+  </index_control_field>
+  <index_control_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="008" offset="22" length="1">
+    <target_index>ta:w</target_index>
+  </index_control_field>
+  <index_control_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="008" offset="23" length="1">
+    <target_index>ff8-23:w</target_index>
+  </index_control_field>
+  <index_control_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="008" offset="29" length="1">
+    <target_index>ff8-29:w</target_index>
+  </index_control_field>
+  <index_control_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="008" offset="33" length="1">
+    <target_index>lf:w</target_index>
+  </index_control_field>
+  <index_control_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="008" offset="34" length="1">
+    <target_index>bio:w</target_index>
+  </index_control_field>
+  <index_control_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="008" offset="35" length="3">
+    <target_index>ln:n</target_index>
+  </index_control_field>
+  <index_control_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="008" offset="24" length="4">
+    <target_index>ctype:w</target_index>
+  </index_control_field>
+  <index_control_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="008" offset="39" length="0">
+    <target_index>Record-source:w</target_index>
+  </index_control_field>
+  <!--record.abs line 76: melm 010        LC-card-number,Identifier-standard-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="010">
+    <target_index>LC-card-number:w</target_index>
+    <target_index>Identifier-standard:w</target_index>
+  </index_data_field>
+  <!--record.abs line 78: melm 015        BNB-card-number,BGF-number,Number-db,Number-natl-biblio,Identifier-standard-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="015">
+    <target_index>BNB-card-number:w</target_index>
+    <target_index>BGF-number:w</target_index>
+    <target_index>Number-db:w</target_index>
+    <target_index>Number-natl-biblio:w</target_index>
+    <target_index>Identifier-standard:w</target_index>
+  </index_data_field>
+  <!--record.abs line 81: melm 020$a      ISBN:w,Identifier-standard:w-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="020" subfields="a">
+    <target_index>ISBN:w</target_index>
+    <target_index>Identifier-standard:w</target_index>
+  </index_subfields>
+  <!--record.abs line 82: melm 020        ISBN,Identifier-standard-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="020">
+    <target_index>ISBN:w</target_index>
+    <target_index>Identifier-standard:w</target_index>
+  </index_data_field>
+  <!--record.abs line 83: melm 022$a      ISSN:w,ISBN:w-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="022" subfields="a">
+    <target_index>ISSN:w</target_index>
+    <target_index>ISBN:w</target_index>
+  </index_subfields>
+  <!--record.abs line 84: melm 022        ISSN,Identifier-standard-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="022">
+    <target_index>ISSN:w</target_index>
+    <target_index>Identifier-standard:w</target_index>
+  </index_data_field>
+  <!--record.abs line 86: melm 024        Identifier-standard-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="024">
+    <target_index>Identifier-standard:w</target_index>
+  </index_data_field>
+  <!--record.abs line 87: melm 025        Identifier-standard-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="025">
+    <target_index>Identifier-standard:w</target_index>
+  </index_data_field>
+  <!--record.abs line 88: melm 027        Report-number,Identifier-standard-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="027">
+    <target_index>Report-number:w</target_index>
+    <target_index>Identifier-standard:w</target_index>
+  </index_data_field>
+  <!--record.abs line 89: melm 028        Number-music-publisher,Identifier-standard-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="028">
+    <target_index>Number-music-publisher:w</target_index>
+    <target_index>Identifier-standard:w</target_index>
+  </index_data_field>
+  <!--record.abs line 90: melm 030        CODEN,Identifier-standard-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="030">
+    <target_index>CODEN:w</target_index>
+    <target_index>Identifier-standard:w</target_index>
+  </index_data_field>
+  <!--record.abs line 95: melm 040        Code-institution,Record-source-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="040">
+    <target_index>Code-institution:w</target_index>
+    <target_index>Record-source:w</target_index>
+  </index_data_field>
+  <!--record.abs line 96: melm 041        ln-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="041">
+    <target_index>ln:w</target_index>
+  </index_data_field>
+  <!--record.abs line 97: melm 043        Code-geographic-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="043">
+    <target_index>Code-geographic:w</target_index>
+  </index_data_field>
+  <!--record.abs line 102: melm 060        NLM-call-number-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="060">
+    <target_index>NLM-call-number:w</target_index>
+  </index_data_field>
+  <!--record.abs line 104: melm 080        UDC-classification-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="080">
+    <target_index>UDC-classification:w</target_index>
+  </index_data_field>
+  <!--record.abs line 105: melm 082        Dewey-classification:w,Dewey-classification:s-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="082">
+    <target_index>Dewey-classification:w</target_index>
+    <target_index>Dewey-classification:s</target_index>
+  </index_data_field>
+  <!--record.abs line 113: melm 100$9      Cross-Reference:w,Koha-Auth-Number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="100" subfields="9">
+    <target_index>Cross-Reference:w</target_index>
+    <target_index>Koha-Auth-Number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 114: melm 100$a      Author,Author:p,Author:s,Editor,Author-personal-bibliography,Author-personal-bibliography:p,Author-personal-bibliography:s-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="100" subfields="a">
+    <target_index>Author:w</target_index>
+    <target_index>Author:p</target_index>
+    <target_index>Author:s</target_index>
+    <target_index>Editor:w</target_index>
+    <target_index>Author-personal-bibliography:w</target_index>
+    <target_index>Author-personal-bibliography:p</target_index>
+    <target_index>Author-personal-bibliography:s</target_index>
+  </index_subfields>
+  <!--record.abs line 115: melm 100        Author,Author-title,Author-name-personal,Name,Name-and-title,Personal-name-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="100">
+    <target_index>Author:w</target_index>
+    <target_index>Author-title:w</target_index>
+    <target_index>Author-name-personal:w</target_index>
+    <target_index>Name:w</target_index>
+    <target_index>Name-and-title:w</target_index>
+    <target_index>Personal-name:w</target_index>
+  </index_data_field>
+  <!--record.abs line 116: melm 110$9      Koha-Auth-Number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="110" subfields="9">
+    <target_index>Koha-Auth-Number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 117: melm 110        Author,Author-title,Author-name-corporate,Name,Name-and-title,Corporate-name-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="110">
+    <target_index>Author:w</target_index>
+    <target_index>Author-title:w</target_index>
+    <target_index>Author-name-corporate:w</target_index>
+    <target_index>Name:w</target_index>
+    <target_index>Name-and-title:w</target_index>
+    <target_index>Corporate-name:w</target_index>
+  </index_data_field>
+  <!--record.abs line 118: melm 111$9      Koha-Auth-Number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="111" subfields="9">
+    <target_index>Koha-Auth-Number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 119: melm 111        Author,Author-title,Author-name-corporate,Name,Name-and-title,Conference-name-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="111">
+    <target_index>Author:w</target_index>
+    <target_index>Author-title:w</target_index>
+    <target_index>Author-name-corporate:w</target_index>
+    <target_index>Name:w</target_index>
+    <target_index>Name-and-title:w</target_index>
+    <target_index>Conference-name:w</target_index>
+  </index_data_field>
+  <!--record.abs line 120: melm 130$i      Thematic-number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="130" subfields="i">
+    <target_index>Thematic-number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 121: melm 130$n      Thematic-number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="130" subfields="n">
+    <target_index>Thematic-number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 122: melm 130$r      Music-key-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="130" subfields="r">
+    <target_index>Music-key:w</target_index>
+  </index_subfields>
+  <!--record.abs line 123: melm 130$9      Koha-Auth-Number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="130" subfields="9">
+    <target_index>Koha-Auth-Number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 124: melm 130        Title,Title-uniform-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="130">
+    <target_index>Title:w</target_index>
+    <target_index>Title-uniform:w</target_index>
+  </index_data_field>
+  <!--record.abs line 126: melm 210        Title,Title-abbreviated-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="210">
+    <target_index>Title:w</target_index>
+    <target_index>Title-abbreviated:w</target_index>
+  </index_data_field>
+  <!--record.abs line 130: melm 222        Title,Title-key-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="222">
+    <target_index>Title:w</target_index>
+    <target_index>Title-key:w</target_index>
+  </index_data_field>
+  <!--record.abs line 131: melm 240$i      Thematic-number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="240" subfields="i">
+    <target_index>Thematic-number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 132: melm 240$r      Music-key-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="240" subfields="r">
+    <target_index>Music-key:w</target_index>
+  </index_subfields>
+  <!--record.abs line 133: melm 240$n      Thematic-number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="240" subfields="n">
+    <target_index>Thematic-number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 134: melm 240        Title:w,Title:p,Title-uniform-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="240">
+    <target_index>Title:w</target_index>
+    <target_index>Title:p</target_index>
+    <target_index>Title-uniform:w</target_index>
+  </index_data_field>
+  <!--record.abs line 138: melm 245$a      Title-cover:w,Title-cover:p,Title-cover:s,Title:w,Title:p,Title:s-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="245" subfields="a">
+    <target_index>Title-cover:w</target_index>
+    <target_index>Title-cover:p</target_index>
+    <target_index>Title-cover:s</target_index>
+    <target_index>Title:w</target_index>
+    <target_index>Title:p</target_index>
+    <target_index>Title:s</target_index>
+  </index_subfields>
+  <!--record.abs line 139: melm 245$c      Author,Author-in-order:w,Author-in-order:p,Author-in-order:s-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="245" subfields="c">
+    <target_index>Author:w</target_index>
+    <target_index>Author-in-order:w</target_index>
+    <target_index>Author-in-order:p</target_index>
+    <target_index>Author-in-order:s</target_index>
+  </index_subfields>
+  <!--record.abs line 140: melm 245$9      Cross-Reference:w,Koha-Auth-Number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="245" subfields="9">
+    <target_index>Cross-Reference:w</target_index>
+    <target_index>Koha-Auth-Number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 141: melm 245        Title:w,Title:p-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="245">
+    <target_index>Title:w</target_index>
+    <target_index>Title:p</target_index>
+  </index_data_field>
+  <!--record.abs line 142: melm 246        Title,Title:p,Title-abbreviated,Title-expanded,Title-former-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="246">
+    <target_index>Title:w</target_index>
+    <target_index>Title:p</target_index>
+    <target_index>Title-abbreviated:w</target_index>
+    <target_index>Title-expanded:w</target_index>
+    <target_index>Title-former:w</target_index>
+  </index_data_field>
+  <!--record.abs line 144: melm 260$a      pl:w,pl:p-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="260" subfields="a">
+    <target_index>pl:w</target_index>
+    <target_index>pl:p</target_index>
+  </index_subfields>
+  <!--record.abs line 145: melm 260$b      Publisher:w,Publisher:p-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="260" subfields="b">
+    <target_index>Publisher:w</target_index>
+    <target_index>Publisher:p</target_index>
+  </index_subfields>
+  <!--record.abs line 146: melm 260$c      copydate,copydate:s-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="260" subfields="c">
+    <target_index>copydate:w</target_index>
+    <target_index>copydate:s</target_index>
+  </index_subfields>
+  <!--record.abs line 147: melm 260        pl-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="260">
+    <target_index>pl:w</target_index>
+  </index_data_field>
+  <!--record.abs line 148: melm 300        Extent:w,Extent:p-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="300">
+    <target_index>Extent:w</target_index>
+    <target_index>Extent:p</target_index>
+  </index_data_field>
+  <!--record.abs line 164: melm 440$a      Title-series:w,Title-series:p-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="440" subfields="a">
+    <target_index>Title-series:w</target_index>
+    <target_index>Title-series:p</target_index>
+  </index_subfields>
+  <!--record.abs line 165: melm 440$9      Koha-Auth-Number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="440" subfields="9">
+    <target_index>Koha-Auth-Number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 166: melm 440        Title-series:w,Title-series:p,Title,Title-series-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="440">
+    <target_index>Title-series:w</target_index>
+    <target_index>Title-series:p</target_index>
+    <target_index>Title:w</target_index>
+    <target_index>Title-series:w</target_index>
+  </index_data_field>
+  <!--record.abs line 167: melm 490$a      Title-series:w,Title-series:p-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="490" subfields="a">
+    <target_index>Title-series:w</target_index>
+    <target_index>Title-series:p</target_index>
+  </index_subfields>
+  <!--record.abs line 168: melm 490        Title,Title-series-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="490">
+    <target_index>Title:w</target_index>
+    <target_index>Title-series:w</target_index>
+  </index_data_field>
+  <!--record.abs line 169: melm 490$9      Koha-Auth-Number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="490" subfields="9">
+    <target_index>Koha-Auth-Number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 171: melm 502        Material-type-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="502">
+    <target_index>Material-type:w</target_index>
+  </index_data_field>
+  <!--record.abs line 174: melm 505        Note:w,Note:p-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="505">
+    <target_index>Note:w</target_index>
+    <target_index>Note:p</target_index>
+  </index_data_field>
+  <!--record.abs line 175: melm 510        Indexed-by-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="510">
+    <target_index>Indexed-by:w</target_index>
+  </index_data_field>
+  <!--record.abs line 176: melm 520        Abstract:w,Abstract:p-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="520">
+    <target_index>Abstract:w</target_index>
+    <target_index>Abstract:p</target_index>
+  </index_data_field>
+  <!--record.abs line 180: melm 600$a      Name-and-title,Name,Personal-name,Subject-name-personal,Subject,Subject:p-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="600" subfields="a">
+    <target_index>Name-and-title:w</target_index>
+    <target_index>Name:w</target_index>
+    <target_index>Personal-name:w</target_index>
+    <target_index>Subject-name-personal:w</target_index>
+    <target_index>Subject:w</target_index>
+    <target_index>Subject:p</target_index>
+  </index_subfields>
+  <!--record.abs line 181: melm 600$t      Name-and-title,Title,Subject,Subject:p-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="600" subfields="t">
+    <target_index>Name-and-title:w</target_index>
+    <target_index>Title:w</target_index>
+    <target_index>Subject:w</target_index>
+    <target_index>Subject:p</target_index>
+  </index_subfields>
+  <!--record.abs line 182: melm 600$9      Koha-Auth-Number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="600" subfields="9">
+    <target_index>Koha-Auth-Number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 184: melm 600        Name,Personal-name,Subject-name-personal,Subject,Subject:p-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="600">
+    <target_index>Name:w</target_index>
+    <target_index>Personal-name:w</target_index>
+    <target_index>Subject-name-personal:w</target_index>
+    <target_index>Subject:w</target_index>
+    <target_index>Subject:p</target_index>
+  </index_data_field>
+  <!--record.abs line 185: melm 610$a      Name-and-title,Subject,Subject:p-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="610" subfields="a">
+    <target_index>Name-and-title:w</target_index>
+    <target_index>Subject:w</target_index>
+    <target_index>Subject:p</target_index>
+  </index_subfields>
+  <!--record.abs line 186: melm 610$t      Name-and-title,Title,Subject,Subject:p-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="610" subfields="t">
+    <target_index>Name-and-title:w</target_index>
+    <target_index>Title:w</target_index>
+    <target_index>Subject:w</target_index>
+    <target_index>Subject:p</target_index>
+  </index_subfields>
+  <!--record.abs line 187: melm 610$9      Koha-Auth-Number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="610" subfields="9">
+    <target_index>Koha-Auth-Number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 188: melm 610        Name,Subject,Corporate-name,Subject,Subject:p-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="610">
+    <target_index>Name:w</target_index>
+    <target_index>Subject:w</target_index>
+    <target_index>Corporate-name:w</target_index>
+    <target_index>Subject:w</target_index>
+    <target_index>Subject:p</target_index>
+  </index_data_field>
+  <!--record.abs line 189: melm 611        Conference-name,Subject,Subject:p-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="611">
+    <target_index>Conference-name:w</target_index>
+    <target_index>Subject:w</target_index>
+    <target_index>Subject:p</target_index>
+  </index_data_field>
+  <!--record.abs line 190: melm 611$a      Name-and-title,Subject,Subject:p-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="611" subfields="a">
+    <target_index>Name-and-title:w</target_index>
+    <target_index>Subject:w</target_index>
+    <target_index>Subject:p</target_index>
+  </index_subfields>
+  <!--record.abs line 191: melm 611$t      Name-and-title,Title,Subject,Subject:p-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="611" subfields="t">
+    <target_index>Name-and-title:w</target_index>
+    <target_index>Title:w</target_index>
+    <target_index>Subject:w</target_index>
+    <target_index>Subject:p</target_index>
+  </index_subfields>
+  <!--record.abs line 192: melm 611$9      Koha-Auth-Number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="611" subfields="9">
+    <target_index>Koha-Auth-Number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 193: melm 611        Name,Subject,Subject:p-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="611">
+    <target_index>Name:w</target_index>
+    <target_index>Subject:w</target_index>
+    <target_index>Subject:p</target_index>
+  </index_data_field>
+  <!--record.abs line 194: melm 630$i      Thematic-number,Subject,Subject:p-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="630" subfields="i">
+    <target_index>Thematic-number:w</target_index>
+    <target_index>Subject:w</target_index>
+    <target_index>Subject:p</target_index>
+  </index_subfields>
+  <!--record.abs line 195: melm 630$n      Thematic-number,Subject,Subject:p-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="630" subfields="n">
+    <target_index>Thematic-number:w</target_index>
+    <target_index>Subject:w</target_index>
+    <target_index>Subject:p</target_index>
+  </index_subfields>
+  <!--record.abs line 196: melm 630$r      Music-key,Subject,Subject:p-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="630" subfields="r">
+    <target_index>Music-key:w</target_index>
+    <target_index>Subject:w</target_index>
+    <target_index>Subject:p</target_index>
+  </index_subfields>
+  <!--record.abs line 197: melm 630$9      Koha-Auth-Number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="630" subfields="9">
+    <target_index>Koha-Auth-Number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 198: melm 630        Subject,Subject:p-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="630">
+    <target_index>Subject:w</target_index>
+    <target_index>Subject:p</target_index>
+  </index_data_field>
+  <!--record.abs line 199: melm 650$9      Koha-Auth-Number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="650" subfields="9">
+    <target_index>Koha-Auth-Number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 200: melm 650        Subject,Subject:p-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="650">
+    <target_index>Subject:w</target_index>
+    <target_index>Subject:p</target_index>
+  </index_data_field>
+  <!--record.abs line 201: melm 651$9      Koha-Auth-Number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="651" subfields="9">
+    <target_index>Koha-Auth-Number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 202: melm 651        Name-geographic,Subject,Subject:p-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="651">
+    <target_index>Name-geographic:w</target_index>
+    <target_index>Subject:w</target_index>
+    <target_index>Subject:p</target_index>
+  </index_data_field>
+  <!--record.abs line 203: melm 652$9      Koha-Auth-Number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="652" subfields="9">
+    <target_index>Koha-Auth-Number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 205: melm 653$9      Koha-Auth-Number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="653" subfields="9">
+    <target_index>Koha-Auth-Number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 206: melm 653        Subject,Subject:p-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="653">
+    <target_index>Subject:w</target_index>
+    <target_index>Subject:p</target_index>
+  </index_data_field>
+  <!--record.abs line 207: melm 654$9      Koha-Auth-Number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="654" subfields="9">
+    <target_index>Koha-Auth-Number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 208: melm 654        Subject,Subject:p-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="654">
+    <target_index>Subject:w</target_index>
+    <target_index>Subject:p</target_index>
+  </index_data_field>
+  <!--record.abs line 209: melm 655$9      Koha-Auth-Number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="655" subfields="9">
+    <target_index>Koha-Auth-Number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 210: melm 655        Subject,Subject:p-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="655">
+    <target_index>Subject:w</target_index>
+    <target_index>Subject:p</target_index>
+  </index_data_field>
+  <!--record.abs line 211: melm 656$9      Koha-Auth-Number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="656" subfields="9">
+    <target_index>Koha-Auth-Number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 212: melm 656        Subject,Subject:p-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="656">
+    <target_index>Subject:w</target_index>
+    <target_index>Subject:p</target_index>
+  </index_data_field>
+  <!--record.abs line 213: melm 657$9      Koha-Auth-Number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="657" subfields="9">
+    <target_index>Koha-Auth-Number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 214: melm 657        Subject,Subject:p-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="657">
+    <target_index>Subject:w</target_index>
+    <target_index>Subject:p</target_index>
+  </index_data_field>
+  <!--record.abs line 215: melm 690$9      Koha-Auth-Number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="690" subfields="9">
+    <target_index>Koha-Auth-Number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 216: melm 690        Subject,Subject:p-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="690">
+    <target_index>Subject:w</target_index>
+    <target_index>Subject:p</target_index>
+  </index_data_field>
+  <!--record.abs line 218: melm 700$9      Cross-Reference,Koha-Auth-Number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="700" subfields="9">
+    <target_index>Cross-Reference:w</target_index>
+    <target_index>Koha-Auth-Number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 219: melm 700$a      Author,Author:p-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="700" subfields="a">
+    <target_index>Author:w</target_index>
+    <target_index>Author:p</target_index>
+  </index_subfields>
+  <!--record.abs line 220: melm 700$i      Thematic-number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="700" subfields="i">
+    <target_index>Thematic-number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 221: melm 700$n      Thematic-number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="700" subfields="n">
+    <target_index>Thematic-number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 222: melm 700$r      Music-key-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="700" subfields="r">
+    <target_index>Music-key:w</target_index>
+  </index_subfields>
+  <!--record.abs line 224: melm 700$t      Author-title,Name-and-title,Title,Title-uniform-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="700" subfields="t">
+    <target_index>Author-title:w</target_index>
+    <target_index>Name-and-title:w</target_index>
+    <target_index>Title:w</target_index>
+    <target_index>Title-uniform:w</target_index>
+  </index_subfields>
+  <!--record.abs line 225: melm 700        Author,Author-name-corporate,Author-name-personal,Name,Editor,Personal-name-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="700">
+    <target_index>Author:w</target_index>
+    <target_index>Author-name-corporate:w</target_index>
+    <target_index>Author-name-personal:w</target_index>
+    <target_index>Name:w</target_index>
+    <target_index>Editor:w</target_index>
+    <target_index>Personal-name:w</target_index>
+  </index_data_field>
+  <!--record.abs line 226: melm 710        Author,Corporate-name-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="710">
+    <target_index>Author:w</target_index>
+    <target_index>Corporate-name:w</target_index>
+  </index_data_field>
+  <!--record.abs line 228: melm 710$t      Author-title,Name-and-title,Title,Title-uniform-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="710" subfields="t">
+    <target_index>Author-title:w</target_index>
+    <target_index>Name-and-title:w</target_index>
+    <target_index>Title:w</target_index>
+    <target_index>Title-uniform:w</target_index>
+  </index_subfields>
+  <!--record.abs line 230: melm 710$a      Name-and-title-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="710" subfields="a">
+    <target_index>Name-and-title:w</target_index>
+  </index_subfields>
+  <!--record.abs line 231: melm 710$i      Thematic-number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="710" subfields="i">
+    <target_index>Thematic-number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 232: melm 710$9      Koha-Auth-Number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="710" subfields="9">
+    <target_index>Koha-Auth-Number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 234: melm 710        Author,Name-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="710">
+    <target_index>Author:w</target_index>
+    <target_index>Name:w</target_index>
+  </index_data_field>
+  <!--record.abs line 235: melm 711$a      Name-and-title-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="711" subfields="a">
+    <target_index>Name-and-title:w</target_index>
+  </index_subfields>
+  <!--record.abs line 237: melm 711$t      Author-title,Title,Title-uniform-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="711" subfields="t">
+    <target_index>Author-title:w</target_index>
+    <target_index>Title:w</target_index>
+    <target_index>Title-uniform:w</target_index>
+  </index_subfields>
+  <!--record.abs line 238: melm 711$9      Koha-Auth-Number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="711" subfields="9">
+    <target_index>Koha-Auth-Number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 240: melm 711        Author-name-corporate,Name,Conference-name-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="711">
+    <target_index>Author-name-corporate:w</target_index>
+    <target_index>Name:w</target_index>
+    <target_index>Conference-name:w</target_index>
+  </index_data_field>
+  <!--record.abs line 241: melm 730$i      Thematic-number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="730" subfields="i">
+    <target_index>Thematic-number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 242: melm 730$n      Thematic-number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="730" subfields="n">
+    <target_index>Thematic-number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 243: melm 730$r      Music-key-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="730" subfields="r">
+    <target_index>Music-key:w</target_index>
+  </index_subfields>
+  <!--record.abs line 244: melm 730$9      Koha-Auth-Number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="730" subfields="9">
+    <target_index>Koha-Auth-Number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 245: melm 730        Title,Title-uniform-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="730">
+    <target_index>Title:w</target_index>
+    <target_index>Title-uniform:w</target_index>
+  </index_data_field>
+  <!--record.abs line 246: melm 740        Title,Title-other-variant-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="740">
+    <target_index>Title:w</target_index>
+    <target_index>Title-other-variant:w</target_index>
+  </index_data_field>
+  <!--record.abs line 247: melm 773$t      Host-item-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="773" subfields="t">
+    <target_index>Host-item:w</target_index>
+  </index_subfields>
+  <!--record.abs line 248: melm 780$t      Title-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="780" subfields="t">
+    <target_index>Title:w</target_index>
+  </index_subfields>
+  <!--record.abs line 249: melm 780        Title,Title-former,Related-periodical-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="780">
+    <target_index>Title:w</target_index>
+    <target_index>Title-former:w</target_index>
+    <target_index>Related-periodical:w</target_index>
+  </index_data_field>
+  <!--record.abs line 250: melm 785        Related-periodical-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="785">
+    <target_index>Related-periodical:w</target_index>
+  </index_data_field>
+  <!--record.abs line 252: melm 800$a      Name-and-title-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="800" subfields="a">
+    <target_index>Name-and-title:w</target_index>
+  </index_subfields>
+  <!--record.abs line 254: melm 800$t      Author-title,Name-and-title,Title,Title-series-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="800" subfields="t">
+    <target_index>Author-title:w</target_index>
+    <target_index>Name-and-title:w</target_index>
+    <target_index>Title:w</target_index>
+    <target_index>Title-series:w</target_index>
+  </index_subfields>
+  <!--record.abs line 255: melm 800$9      Koha-Auth-Number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="800" subfields="9">
+    <target_index>Koha-Auth-Number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 256: melm 800        Author,Author-name-personal,Name,Personal-name-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="800">
+    <target_index>Author:w</target_index>
+    <target_index>Author-name-personal:w</target_index>
+    <target_index>Name:w</target_index>
+    <target_index>Personal-name:w</target_index>
+  </index_data_field>
+  <!--record.abs line 257: melm 810$a      Name-and-title-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="810" subfields="a">
+    <target_index>Name-and-title:w</target_index>
+  </index_subfields>
+  <!--record.abs line 258: melm 810$t      Author-title,Name-and-title,Title,Title-series-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="810" subfields="t">
+    <target_index>Author-title:w</target_index>
+    <target_index>Name-and-title:w</target_index>
+    <target_index>Title:w</target_index>
+    <target_index>Title-series:w</target_index>
+  </index_subfields>
+  <!--record.abs line 259: melm 810$9      Koha-Auth-Number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="810" subfields="9">
+    <target_index>Koha-Auth-Number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 260: melm 810        Author,Corporate-name,Author-name-corporate,Name-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="810">
+    <target_index>Author:w</target_index>
+    <target_index>Corporate-name:w</target_index>
+    <target_index>Author-name-corporate:w</target_index>
+    <target_index>Name:w</target_index>
+  </index_data_field>
+  <!--record.abs line 261: melm 811$a      Name-and-title-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="811" subfields="a">
+    <target_index>Name-and-title:w</target_index>
+  </index_subfields>
+  <!--record.abs line 262: melm 811$9      Koha-Auth-Number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="811" subfields="9">
+    <target_index>Koha-Auth-Number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 264: melm 811$t      Author-title,Name-and-title,Title,Title-series-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="811" subfields="t">
+    <target_index>Author-title:w</target_index>
+    <target_index>Name-and-title:w</target_index>
+    <target_index>Title:w</target_index>
+    <target_index>Title-series:w</target_index>
+  </index_subfields>
+  <!--record.abs line 265: melm 811        Author,Author-name-corporate,Name,Conference-name-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="811">
+    <target_index>Author:w</target_index>
+    <target_index>Author-name-corporate:w</target_index>
+    <target_index>Name:w</target_index>
+    <target_index>Conference-name:w</target_index>
+  </index_data_field>
+  <!--record.abs line 266: melm 830$9      Koha-Auth-Number-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="830" subfields="9">
+    <target_index>Koha-Auth-Number:w</target_index>
+  </index_subfields>
+  <!--record.abs line 267: melm 830        Title,Title-series-->
+  <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="830">
+    <target_index>Title:w</target_index>
+    <target_index>Title-series:w</target_index>
+  </index_data_field>
+  <!--record.abs line 272: melm 999$c      Local-Number:n,Local-Number:w,Local-Number:s-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="999" subfields="c">
+    <target_index>Local-Number:n</target_index>
+    <target_index>Local-Number:w</target_index>
+    <target_index>Local-Number:s</target_index>
+  </index_subfields>
+  <!--record.abs line 273: melm 999$d      biblioitemnumber:n,biblioitemnumber:w,biblioitemnumber:s-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="999" subfields="d">
+    <target_index>biblioitemnumber:n</target_index>
+    <target_index>biblioitemnumber:w</target_index>
+    <target_index>biblioitemnumber:s</target_index>
+  </index_subfields>
+  <!--record.abs line 274: melm 942$0      totalissues:n,totalissues:s-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="942" subfields="0">
+    <target_index>totalissues:n</target_index>
+    <target_index>totalissues:s</target_index>
+  </index_subfields>
+  <!--record.abs line 275: melm 942$2      cn-bib-source-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="942" subfields="2">
+    <target_index>cn-bib-source:w</target_index>
+  </index_subfields>
+  <!--record.abs line 276: melm 942$6      cn-bib-sort:n,cn-bib-sort:s-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="942" subfields="6">
+    <target_index>cn-bib-sort:n</target_index>
+    <target_index>cn-bib-sort:s</target_index>
+  </index_subfields>
+  <!--record.abs line 277: melm 942$c      itemtype:w-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="942" subfields="c">
+    <target_index>itemtype:w</target_index>
+  </index_subfields>
+  <!--record.abs line 278: melm 942$n      Suppress:w,Suppress:n-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="942" subfields="n">
+    <target_index>Suppress:w</target_index>
+    <target_index>Suppress:n</target_index>
+  </index_subfields>
+  <!--record.abs line 281: melm 942$h      cn-class-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="942" subfields="h">
+    <target_index>cn-class:w</target_index>
+  </index_subfields>
+  <!--record.abs line 282: melm 942$i      cn-item-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="942" subfields="i">
+    <target_index>cn-item:w</target_index>
+  </index_subfields>
+  <!--record.abs line 283: melm 942$k      cn-prefix-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="942" subfields="k">
+    <target_index>cn-prefix:w</target_index>
+  </index_subfields>
+  <!--record.abs line 284: melm 942$m      cn-suffix-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="942" subfields="m">
+    <target_index>cn-suffix:w</target_index>
+  </index_subfields>
+  <!--record.abs line 287: melm 952$0      withdrawn:n,withdrawn:w-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="0">
+    <target_index>withdrawn:n</target_index>
+    <target_index>withdrawn:w</target_index>
+  </index_subfields>
+  <!--record.abs line 288: melm 952$1      lost,lost:n-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="1">
+    <target_index>lost:w</target_index>
+    <target_index>lost:n</target_index>
+  </index_subfields>
+  <!--record.abs line 289: melm 952$2      classification-source-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="2">
+    <target_index>classification-source:w</target_index>
+  </index_subfields>
+  <!--record.abs line 290: melm 952$3      materials-specified-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="3">
+    <target_index>materials-specified:w</target_index>
+  </index_subfields>
+  <!--record.abs line 291: melm 952$4      damaged:n,damaged:w-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="4">
+    <target_index>damaged:n</target_index>
+    <target_index>damaged:w</target_index>
+  </index_subfields>
+  <!--record.abs line 292: melm 952$5      restricted:n,restricted:w-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="5">
+    <target_index>restricted:n</target_index>
+    <target_index>restricted:w</target_index>
+  </index_subfields>
+  <!--record.abs line 293: melm 952$6      cn-sort:n,cn-sort:s-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="6">
+    <target_index>cn-sort:n</target_index>
+    <target_index>cn-sort:s</target_index>
+  </index_subfields>
+  <!--record.abs line 294: melm 952$7      notforloan:n,notforloan:w-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="7">
+    <target_index>notforloan:n</target_index>
+    <target_index>notforloan:w</target_index>
+  </index_subfields>
+  <!--record.abs line 295: melm 952$8      ccode-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="8">
+    <target_index>ccode:w</target_index>
+  </index_subfields>
+  <!--record.abs line 296: melm 952$9      itemnumber:n,itemnumber:s-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="9">
+    <target_index>itemnumber:n</target_index>
+    <target_index>itemnumber:s</target_index>
+  </index_subfields>
+  <!--record.abs line 297: melm 952$a      homebranch-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="a">
+    <target_index>homebranch:w</target_index>
+  </index_subfields>
+  <!--record.abs line 298: melm 952$b      holdingbranch-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="b">
+    <target_index>holdingbranch:w</target_index>
+  </index_subfields>
+  <!--record.abs line 299: melm 952$c      location-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="c">
+    <target_index>location:w</target_index>
+  </index_subfields>
+  <!--record.abs line 302: melm 952$d      Date-of-acquisition,Date-of-acquisition:d,Date-of-acquisition:s-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="d">
+    <target_index>Date-of-acquisition:w</target_index>
+    <target_index>Date-of-acquisition:d</target_index>
+    <target_index>Date-of-acquisition:s</target_index>
+  </index_subfields>
+  <!--record.abs line 303: melm 952$e      acqsource-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="e">
+    <target_index>acqsource:w</target_index>
+  </index_subfields>
+  <!--record.abs line 304: melm 952$f      coded-location-qualifier-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="f">
+    <target_index>coded-location-qualifier:w</target_index>
+  </index_subfields>
+  <!--record.abs line 305: melm 952$g      price-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="g">
+    <target_index>price:w</target_index>
+  </index_subfields>
+  <!--record.abs line 308: melm 952$j      stack:n,stack:w-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="j">
+    <target_index>stack:n</target_index>
+    <target_index>stack:w</target_index>
+  </index_subfields>
+  <!--record.abs line 310: melm 952$l      issues:n,issues:w,issues:s-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="l">
+    <target_index>issues:n</target_index>
+    <target_index>issues:w</target_index>
+    <target_index>issues:s</target_index>
+  </index_subfields>
+  <!--record.abs line 311: melm 952$m      renewals:n,renewals:w-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="m">
+    <target_index>renewals:n</target_index>
+    <target_index>renewals:w</target_index>
+  </index_subfields>
+  <!--record.abs line 312: melm 952$n      reserves:n,reserves:w-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="n">
+    <target_index>reserves:n</target_index>
+    <target_index>reserves:w</target_index>
+  </index_subfields>
+  <!--record.abs line 313: melm 952$o      Local-classification:w,Local-classification:p,Local-classification:s-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="o">
+    <target_index>Local-classification:w</target_index>
+    <target_index>Local-classification:p</target_index>
+    <target_index>Local-classification:s</target_index>
+  </index_subfields>
+  <!--record.abs line 314: melm 952$p      barcode,barcode:n-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="p">
+    <target_index>barcode:w</target_index>
+    <target_index>barcode:n</target_index>
+  </index_subfields>
+  <!--record.abs line 315: melm 952$q      onloan:n,onloan:w-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="q">
+    <target_index>onloan:n</target_index>
+    <target_index>onloan:w</target_index>
+  </index_subfields>
+  <!--record.abs line 316: melm 952$r      datelastseen-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="r">
+    <target_index>datelastseen:w</target_index>
+  </index_subfields>
+  <!--record.abs line 317: melm 952$s      datelastborrowed-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="s">
+    <target_index>datelastborrowed:w</target_index>
+  </index_subfields>
+  <!--record.abs line 318: melm 952$t      copynumber-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="t">
+    <target_index>copynumber:w</target_index>
+  </index_subfields>
+  <!--record.abs line 319: melm 952$u      uri:u-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="u">
+    <target_index>uri:u</target_index>
+  </index_subfields>
+  <!--record.abs line 320: melm 952$v      replacementprice-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="v">
+    <target_index>replacementprice:w</target_index>
+  </index_subfields>
+  <!--record.abs line 321: melm 952$w      replacementpricedate-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="w">
+    <target_index>replacementpricedate:w</target_index>
+  </index_subfields>
+  <!--record.abs line 323: melm 952$y      itype:w-->
+  <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="y">
+    <target_index>itype:w</target_index>
+  </index_subfields>
+</kohaidx:index_defs>
diff --git a/etc/zebradb/marc_defs/normarc/biblios/biblio-zebra-indexdefs.xsl b/etc/zebradb/marc_defs/normarc/biblios/biblio-zebra-indexdefs.xsl
new file mode 100644 (file)
index 0000000..7a8dcea
--- /dev/null
@@ -0,0 +1,1772 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+This file has been automatically generated from a Koha index definition file
+with the stylesheet koha-indexdefs-to-zebra.xsl. Do not manually edit this file,
+as it may be overwritten. To regenerate, edit the appropriate Koha index
+definition file (probably something like {biblio,authority}-koha-indexdefs.xml) and run:
+`xsltproc koha-indexdefs-to-zebra.xsl {biblio,authority}-koha-indexdefs.xml >
+{biblio,authority}-zebra-indexdefs.xsl` (substituting the appropriate file names).
+-->
+<xslo:stylesheet xmlns:xslo="http://www.w3.org/1999/XSL/Transform" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:z="http://indexdata.com/zebra-2.0" xmlns:kohaidx="http://www.koha-community.org/schemas/index-defs" version="1.0">
+  <xslo:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
+  <xslo:template match="text()"/>
+  <xslo:template match="text()" mode="index_subfields"/>
+  <xslo:template match="text()" mode="index_data_field"/>
+  <xslo:template match="text()" mode="index_heading"/>
+  <xslo:template match="text()" mode="index_heading_conditional"/>
+  <xslo:template match="text()" mode="index_match_heading"/>
+  <xslo:template match="text()" mode="index_subject_thesaurus"/>
+  <xslo:template match="/">
+    <xslo:if test="marc:collection">
+      <collection>
+        <xslo:apply-templates select="marc:collection/marc:record"/>
+      </collection>
+    </xslo:if>
+    <xslo:if test="marc:record">
+      <xslo:apply-templates select="marc:record"/>
+    </xslo:if>
+  </xslo:template>
+  <xslo:template match="marc:record">
+    <xslo:variable name="idfield" select="normalize-space()"/>
+    <z:record type="update">
+      <xslo:attribute name="z:id">
+        <xslo:value-of select="$idfield"/>
+      </xslo:attribute>
+      <xslo:apply-templates/>
+      <xslo:apply-templates mode="index_subfields"/>
+      <xslo:apply-templates mode="index_data_field"/>
+      <xslo:apply-templates mode="index_heading"/>
+      <xslo:apply-templates mode="index_heading_conditional"/>
+      <xslo:apply-templates mode="index_match_heading"/>
+      <xslo:apply-templates mode="index_subject_thesaurus"/>
+    </z:record>
+  </xslo:template>
+  <xslo:template match="marc:leader">
+    <z:index name="llength:w">
+      <xslo:value-of select="substring(., 1, 5)"/>
+    </z:index>
+    <z:index name="rtype:w">
+      <xslo:value-of select="substring(., 7, 1)"/>
+    </z:index>
+    <z:index name="Bib-level:w">
+      <xslo:value-of select="substring(., 8, 1)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template match="marc:controlfield[@tag='001']">
+    <z:index name="Control-number:w">
+      <xslo:value-of select="."/>
+    </z:index>
+  </xslo:template>
+  <xslo:template match="marc:controlfield[@tag='007']">
+    <z:index name="Microform-generation:n">
+      <xslo:value-of select="substring(., 12, 1)"/>
+    </z:index>
+    <z:index name="Material-type:w">
+      <xslo:value-of select="."/>
+    </z:index>
+    <z:index name="ff7-00:w">
+      <xslo:value-of select="substring(., 1, 1)"/>
+    </z:index>
+    <z:index name="ff7-01:w">
+      <xslo:value-of select="substring(., 2, 1)"/>
+    </z:index>
+    <z:index name="ff7-02:w">
+      <xslo:value-of select="substring(., 3, 1)"/>
+    </z:index>
+    <z:index name="ff7-01-02:w">
+      <xslo:value-of select="substring(., 1, 2)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template match="marc:controlfield[@tag='008']">
+    <z:index name="date-entered-on-file:n">
+      <xslo:value-of select="substring(., 1, 5)"/>
+    </z:index>
+    <z:index name="date-entered-on-file:s">
+      <xslo:value-of select="substring(., 1, 5)"/>
+    </z:index>
+    <z:index name="pubdate:w">
+      <xslo:value-of select="substring(., 8, 4)"/>
+    </z:index>
+    <z:index name="pubdate:n">
+      <xslo:value-of select="substring(., 8, 4)"/>
+    </z:index>
+    <z:index name="pubdate:y">
+      <xslo:value-of select="substring(., 8, 4)"/>
+    </z:index>
+    <z:index name="pubdate:s">
+      <xslo:value-of select="substring(., 8, 4)"/>
+    </z:index>
+    <z:index name="pl:w">
+      <xslo:value-of select="substring(., 16, 3)"/>
+    </z:index>
+    <z:index name="ta:w">
+      <xslo:value-of select="substring(., 23, 1)"/>
+    </z:index>
+    <z:index name="ff8-23:w">
+      <xslo:value-of select="substring(., 24, 1)"/>
+    </z:index>
+    <z:index name="ff8-29:w">
+      <xslo:value-of select="substring(., 30, 1)"/>
+    </z:index>
+    <z:index name="lf:w">
+      <xslo:value-of select="substring(., 34, 1)"/>
+    </z:index>
+    <z:index name="bio:w">
+      <xslo:value-of select="substring(., 35, 1)"/>
+    </z:index>
+    <z:index name="ln:n">
+      <xslo:value-of select="substring(., 36, 3)"/>
+    </z:index>
+    <z:index name="ctype:w">
+      <xslo:value-of select="substring(., 25, 4)"/>
+    </z:index>
+    <z:index name="Record-source:w">
+      <xslo:value-of select="substring(., 40, 0)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='020']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('a', @code)">
+        <z:index name="ISBN:w Identifier-standard:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='022']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('a', @code)">
+        <z:index name="ISSN:w ISBN:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='100']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('9', @code)">
+        <z:index name="Cross-Reference:w Koha-Auth-Number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('a', @code)">
+        <z:index name="Author:w Author:p Author:s Editor:w Author-personal-bibliography:w Author-personal-bibliography:p Author-personal-bibliography:s">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='110']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('9', @code)">
+        <z:index name="Koha-Auth-Number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='111']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('9', @code)">
+        <z:index name="Koha-Auth-Number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='130']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('i', @code)">
+        <z:index name="Thematic-number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('n', @code)">
+        <z:index name="Thematic-number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('r', @code)">
+        <z:index name="Music-key:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('9', @code)">
+        <z:index name="Koha-Auth-Number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='240']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('i', @code)">
+        <z:index name="Thematic-number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('r', @code)">
+        <z:index name="Music-key:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('n', @code)">
+        <z:index name="Thematic-number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='245']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('a', @code)">
+        <z:index name="Title-cover:w Title-cover:p Title-cover:s Title:w Title:p Title:s">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('c', @code)">
+        <z:index name="Author:w Author-in-order:w Author-in-order:p Author-in-order:s">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('9', @code)">
+        <z:index name="Cross-Reference:w Koha-Auth-Number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='260']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('a', @code)">
+        <z:index name="pl:w pl:p">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('b', @code)">
+        <z:index name="Publisher:w Publisher:p">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('c', @code)">
+        <z:index name="copydate:w copydate:s">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='440']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('a', @code)">
+        <z:index name="Title-series:w Title-series:p">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('9', @code)">
+        <z:index name="Koha-Auth-Number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='490']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('a', @code)">
+        <z:index name="Title-series:w Title-series:p">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('9', @code)">
+        <z:index name="Koha-Auth-Number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='600']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('a', @code)">
+        <z:index name="Name-and-title:w Name:w Personal-name:w Subject-name-personal:w Subject:w Subject:p">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('t', @code)">
+        <z:index name="Name-and-title:w Title:w Subject:w Subject:p">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('9', @code)">
+        <z:index name="Koha-Auth-Number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='610']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('a', @code)">
+        <z:index name="Name-and-title:w Subject:w Subject:p">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('t', @code)">
+        <z:index name="Name-and-title:w Title:w Subject:w Subject:p">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('9', @code)">
+        <z:index name="Koha-Auth-Number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='611']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('a', @code)">
+        <z:index name="Name-and-title:w Subject:w Subject:p">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('t', @code)">
+        <z:index name="Name-and-title:w Title:w Subject:w Subject:p">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('9', @code)">
+        <z:index name="Koha-Auth-Number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='630']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('i', @code)">
+        <z:index name="Thematic-number:w Subject:w Subject:p">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('n', @code)">
+        <z:index name="Thematic-number:w Subject:w Subject:p">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('r', @code)">
+        <z:index name="Music-key:w Subject:w Subject:p">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('9', @code)">
+        <z:index name="Koha-Auth-Number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='650']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('9', @code)">
+        <z:index name="Koha-Auth-Number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='651']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('9', @code)">
+        <z:index name="Koha-Auth-Number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='652']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('9', @code)">
+        <z:index name="Koha-Auth-Number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='653']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('9', @code)">
+        <z:index name="Koha-Auth-Number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='654']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('9', @code)">
+        <z:index name="Koha-Auth-Number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='655']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('9', @code)">
+        <z:index name="Koha-Auth-Number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='656']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('9', @code)">
+        <z:index name="Koha-Auth-Number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='657']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('9', @code)">
+        <z:index name="Koha-Auth-Number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='690']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('9', @code)">
+        <z:index name="Koha-Auth-Number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='700']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('9', @code)">
+        <z:index name="Cross-Reference:w Koha-Auth-Number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('a', @code)">
+        <z:index name="Author:w Author:p">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('i', @code)">
+        <z:index name="Thematic-number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('n', @code)">
+        <z:index name="Thematic-number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('r', @code)">
+        <z:index name="Music-key:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('t', @code)">
+        <z:index name="Author-title:w Name-and-title:w Title:w Title-uniform:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='710']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('t', @code)">
+        <z:index name="Author-title:w Name-and-title:w Title:w Title-uniform:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('a', @code)">
+        <z:index name="Name-and-title:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('i', @code)">
+        <z:index name="Thematic-number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('9', @code)">
+        <z:index name="Koha-Auth-Number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='711']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('a', @code)">
+        <z:index name="Name-and-title:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('t', @code)">
+        <z:index name="Author-title:w Title:w Title-uniform:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('9', @code)">
+        <z:index name="Koha-Auth-Number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='730']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('i', @code)">
+        <z:index name="Thematic-number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('n', @code)">
+        <z:index name="Thematic-number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('r', @code)">
+        <z:index name="Music-key:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('9', @code)">
+        <z:index name="Koha-Auth-Number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='773']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('t', @code)">
+        <z:index name="Host-item:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='780']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('t', @code)">
+        <z:index name="Title:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='800']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('a', @code)">
+        <z:index name="Name-and-title:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('t', @code)">
+        <z:index name="Author-title:w Name-and-title:w Title:w Title-series:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('9', @code)">
+        <z:index name="Koha-Auth-Number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='810']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('a', @code)">
+        <z:index name="Name-and-title:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('t', @code)">
+        <z:index name="Author-title:w Name-and-title:w Title:w Title-series:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('9', @code)">
+        <z:index name="Koha-Auth-Number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='811']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('a', @code)">
+        <z:index name="Name-and-title:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('9', @code)">
+        <z:index name="Koha-Auth-Number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('t', @code)">
+        <z:index name="Author-title:w Name-and-title:w Title:w Title-series:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='830']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('9', @code)">
+        <z:index name="Koha-Auth-Number:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='999']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('c', @code)">
+        <z:index name="Local-Number:n Local-Number:w Local-Number:s">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('d', @code)">
+        <z:index name="biblioitemnumber:n biblioitemnumber:w biblioitemnumber:s">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='942']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('0', @code)">
+        <z:index name="totalissues:n totalissues:s">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('2', @code)">
+        <z:index name="cn-bib-source:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('6', @code)">
+        <z:index name="cn-bib-sort:n cn-bib-sort:s">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('c', @code)">
+        <z:index name="itemtype:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('n', @code)">
+        <z:index name="Suppress:w Suppress:n">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('h', @code)">
+        <z:index name="cn-class:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('i', @code)">
+        <z:index name="cn-item:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('k', @code)">
+        <z:index name="cn-prefix:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('m', @code)">
+        <z:index name="cn-suffix:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_subfields" match="marc:datafield[@tag='952']">
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('0', @code)">
+        <z:index name="withdrawn:n withdrawn:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('1', @code)">
+        <z:index name="lost:w lost:n">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('2', @code)">
+        <z:index name="classification-source:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('3', @code)">
+        <z:index name="materials-specified:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('4', @code)">
+        <z:index name="damaged:n damaged:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('5', @code)">
+        <z:index name="restricted:n restricted:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('6', @code)">
+        <z:index name="cn-sort:n cn-sort:s">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('7', @code)">
+        <z:index name="notforloan:n notforloan:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('8', @code)">
+        <z:index name="ccode:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('9', @code)">
+        <z:index name="itemnumber:n itemnumber:s">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('a', @code)">
+        <z:index name="homebranch:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('b', @code)">
+        <z:index name="holdingbranch:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('c', @code)">
+        <z:index name="location:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('d', @code)">
+        <z:index name="Date-of-acquisition:w Date-of-acquisition:d Date-of-acquisition:s">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('e', @code)">
+        <z:index name="acqsource:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('f', @code)">
+        <z:index name="coded-location-qualifier:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('g', @code)">
+        <z:index name="price:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('j', @code)">
+        <z:index name="stack:n stack:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('l', @code)">
+        <z:index name="issues:n issues:w issues:s">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('m', @code)">
+        <z:index name="renewals:n renewals:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('n', @code)">
+        <z:index name="reserves:n reserves:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('o', @code)">
+        <z:index name="Local-classification:w Local-classification:p Local-classification:s">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('p', @code)">
+        <z:index name="barcode:w barcode:n">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('q', @code)">
+        <z:index name="onloan:n onloan:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('r', @code)">
+        <z:index name="datelastseen:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('s', @code)">
+        <z:index name="datelastborrowed:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('t', @code)">
+        <z:index name="copynumber:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('u', @code)">
+        <z:index name="uri:u">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('v', @code)">
+        <z:index name="replacementprice:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('w', @code)">
+        <z:index name="replacementpricedate:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+    <xslo:for-each select="marc:subfield">
+      <xslo:if test="contains('y', @code)">
+        <z:index name="itype:w">
+          <xslo:value-of select="."/>
+        </z:index>
+      </xslo:if>
+    </xslo:for-each>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='010']">
+    <z:index name="LC-card-number:w Identifier-standard:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='015']">
+    <z:index name="BNB-card-number:w BGF-number:w Number-db:w Number-natl-biblio:w Identifier-standard:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='020']">
+    <z:index name="ISBN:w Identifier-standard:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='022']">
+    <z:index name="ISSN:w Identifier-standard:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='024']">
+    <z:index name="Identifier-standard:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='025']">
+    <z:index name="Identifier-standard:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='027']">
+    <z:index name="Report-number:w Identifier-standard:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='028']">
+    <z:index name="Number-music-publisher:w Identifier-standard:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='030']">
+    <z:index name="CODEN:w Identifier-standard:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='040']">
+    <z:index name="Code-institution:w Record-source:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='041']">
+    <z:index name="ln:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='043']">
+    <z:index name="Code-geographic:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='060']">
+    <z:index name="NLM-call-number:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='080']">
+    <z:index name="UDC-classification:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='082']">
+    <z:index name="Dewey-classification:w Dewey-classification:s">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='100']">
+    <z:index name="Author:w Author-title:w Author-name-personal:w Name:w Name-and-title:w Personal-name:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='110']">
+    <z:index name="Author:w Author-title:w Author-name-corporate:w Name:w Name-and-title:w Corporate-name:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='111']">
+    <z:index name="Author:w Author-title:w Author-name-corporate:w Name:w Name-and-title:w Conference-name:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='130']">
+    <z:index name="Title:w Title-uniform:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='210']">
+    <z:index name="Title:w Title-abbreviated:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='222']">
+    <z:index name="Title:w Title-key:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='240']">
+    <z:index name="Title:w Title:p Title-uniform:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='245']">
+    <z:index name="Title:w Title:p">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='246']">
+    <z:index name="Title:w Title:p Title-abbreviated:w Title-expanded:w Title-former:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='260']">
+    <z:index name="pl:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='300']">
+    <z:index name="Extent:w Extent:p">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='440']">
+    <z:index name="Title-series:w Title-series:p Title:w Title-series:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='490']">
+    <z:index name="Title:w Title-series:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='502']">
+    <z:index name="Material-type:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='505']">
+    <z:index name="Note:w Note:p">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='510']">
+    <z:index name="Indexed-by:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='520']">
+    <z:index name="Abstract:w Abstract:p">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='600']">
+    <z:index name="Name:w Personal-name:w Subject-name-personal:w Subject:w Subject:p">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='610']">
+    <z:index name="Name:w Subject:w Corporate-name:w Subject:w Subject:p">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='611']">
+    <z:index name="Conference-name:w Subject:w Subject:p">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+    <z:index name="Name:w Subject:w Subject:p">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='630']">
+    <z:index name="Subject:w Subject:p">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='650']">
+    <z:index name="Subject:w Subject:p">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='651']">
+    <z:index name="Name-geographic:w Subject:w Subject:p">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='653']">
+    <z:index name="Subject:w Subject:p">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='654']">
+    <z:index name="Subject:w Subject:p">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='655']">
+    <z:index name="Subject:w Subject:p">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='656']">
+    <z:index name="Subject:w Subject:p">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='657']">
+    <z:index name="Subject:w Subject:p">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='690']">
+    <z:index name="Subject:w Subject:p">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='700']">
+    <z:index name="Author:w Author-name-corporate:w Author-name-personal:w Name:w Editor:w Personal-name:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='710']">
+    <z:index name="Author:w Corporate-name:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+    <z:index name="Author:w Name:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='711']">
+    <z:index name="Author-name-corporate:w Name:w Conference-name:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='730']">
+    <z:index name="Title:w Title-uniform:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='740']">
+    <z:index name="Title:w Title-other-variant:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='780']">
+    <z:index name="Title:w Title-former:w Related-periodical:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='785']">
+    <z:index name="Related-periodical:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='800']">
+    <z:index name="Author:w Author-name-personal:w Name:w Personal-name:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='810']">
+    <z:index name="Author:w Corporate-name:w Author-name-corporate:w Name:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='811']">
+    <z:index name="Author:w Author-name-corporate:w Name:w Conference-name:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template mode="index_data_field" match="marc:datafield[@tag='830']">
+    <z:index name="Title:w Title-series:w">
+      <xslo:variable name="raw_heading">
+        <xslo:for-each select="marc:subfield">
+          <xslo:if test="position() &gt; 1">
+            <xslo:value-of select="substring(' ', 1, 1)"/>
+          </xslo:if>
+          <xslo:value-of select="."/>
+        </xslo:for-each>
+      </xslo:variable>
+      <xslo:value-of select="normalize-space($raw_heading)"/>
+    </z:index>
+  </xslo:template>
+  <xslo:template match="*">
+    <z:index name="Any:w Any:p">
+      <xslo:value-of select="."/>
+    </z:index>
+  </xslo:template>
+  <xslo:template name="chopPunctuation">
+    <xslo:param name="chopString"/>
+    <xslo:variable name="length" select="string-length($chopString)"/>
+    <xslo:choose>
+      <xslo:when test="$length=0"/>
+      <xslo:when test="contains('-,.:=;!%/', substring($chopString,$length,1))">
+        <xslo:call-template name="chopPunctuation">
+          <xslo:with-param name="chopString" select="substring($chopString,1,$length - 1)"/>
+        </xslo:call-template>
+      </xslo:when>
+      <xslo:when test="not($chopString)"/>
+      <xslo:otherwise>
+        <xslo:value-of select="$chopString"/>
+      </xslo:otherwise>
+    </xslo:choose>
+    <xslo:text/>
+  </xslo:template>
+</xslo:stylesheet>
index 6870469..8eecf1c 100644 (file)
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <kohaidx:index_defs xmlns:kohaidx="http://www.koha-community.org/schemas/index-defs">
+  <id>marc:controlfield[@tag='001']</id>
   <!--record.abs line 24: melm 001        Local-number,Local-number:n-->
   <index_control_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="001">
     <target_index>Local-number:w</target_index>
index feeda35..46e190f 100644 (file)
@@ -13,6 +13,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml)
   <xslo:template match="text()" mode="index_subfields"/>
   <xslo:template match="text()" mode="index_data_field"/>
   <xslo:template match="text()" mode="index_heading"/>
+  <xslo:template match="text()" mode="index_heading_conditional"/>
   <xslo:template match="text()" mode="index_match_heading"/>
   <xslo:template match="text()" mode="index_subject_thesaurus"/>
   <xslo:template match="/">
@@ -26,15 +27,16 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml)
     </xslo:if>
   </xslo:template>
   <xslo:template match="marc:record">
-    <xslo:variable name="controlField001" select="normalize-space(marc:controlfield[@tag='001'])"/>
+    <xslo:variable name="idfield" select="normalize-space(marc:controlfield[@tag='001'])"/>
     <z:record type="update">
       <xslo:attribute name="z:id">
-        <xslo:value-of select="$controlField001"/>
+        <xslo:value-of select="$idfield"/>
       </xslo:attribute>
       <xslo:apply-templates/>
       <xslo:apply-templates mode="index_subfields"/>
       <xslo:apply-templates mode="index_data_field"/>
       <xslo:apply-templates mode="index_heading"/>
+      <xslo:apply-templates mode="index_heading_conditional"/>
       <xslo:apply-templates mode="index_match_heading"/>
       <xslo:apply-templates mode="index_subject_thesaurus"/>
     </z:record>
index 3093c72..f848012 100644 (file)
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <retrievalinfo xmlns="http://indexdata.com/yaz">
-  <retrieval syntax="usmarc" name="F">
+  <retrieval syntax="__ZEBRA_MARC_FORMAT__" name="F">
     <backend syntax="xml" name="marc">
       <marc inputformat="xml" outputformat="marc"
             inputcharset="utf-8"
             outputcharset="utf-8"/>
     </backend>
   </retrieval>
-  <retrieval syntax="usmarc" name="B">
+  <retrieval syntax="__ZEBRA_MARC_FORMAT__" name="B">
     <backend syntax="xml" name="marc">
       <marc inputformat="xml" outputformat="marc"
             inputcharset="utf-8"
index 58f319d..f1f8898 100644 (file)
@@ -1,37 +1,37 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <retrievalinfo xmlns="http://indexdata.com/yaz">
-  <retrieval syntax="usmarc" name="F"/>
-  <retrieval syntax="usmarc" name="B"/>
+  <retrieval syntax="__ZEBRA_MARC_FORMAT__" name="F"/>
+  <retrieval syntax="__ZEBRA_MARC_FORMAT__" name="B"/>
   <retrieval syntax="xml" name="marcxml"
              identifier="info:srw/schema/1/marcxml-v1.1">
-    <backend syntax="usmarc" name="F">
+    <backend syntax="__ZEBRA_MARC_FORMAT__" name="F">
       <marc inputformat="marc" outputformat="marcxml"
             inputcharset="utf-8"/>
     </backend>
   </retrieval>
   <retrieval syntax="xml" name="dc">
-    <backend syntax="usmarc" name="F">
+    <backend syntax="__ZEBRA_MARC_FORMAT__" name="F">
       <marc inputformat="marc" outputformat="marcxml"
             inputcharset="utf-8"/>
       <xslt stylesheet="__INTRANET_TMPL_DIR__/prog/en/xslt/MARC21slim2DC.xsl"/>
     </backend>
   </retrieval>
   <retrieval syntax="xml" name="mods">
-    <backend syntax="usmarc" name="F">
+    <backend syntax="__ZEBRA_MARC_FORMAT__" name="F">
       <marc inputformat="marc" outputformat="marcxml"
             inputcharset="utf-8"/>
       <xslt stylesheet="__INTRANET_TMPL_DIR__/prog/en/xslt/MARC21slim2MODS.xsl"/>
     </backend>
   </retrieval>
   <retrieval syntax="xml" name="rdfdc">
-    <backend syntax="usmarc" name="F">
+    <backend syntax="__ZEBRA_MARC_FORMAT__" name="F">
       <marc inputformat="marc" outputformat="marcxml"
             inputcharset="utf-8"/>
       <xslt stylesheet="__INTRANET_TMPL_DIR__/prog/en/xslt/MARC21slim2RDFDC.xsl"/>
     </backend>
   </retrieval>
   <retrieval syntax="xml" name="utils">
-    <backend syntax="usmarc" name="F">
+    <backend syntax="__ZEBRA_MARC_FORMAT__" name="F">
       <marc inputformat="marc" outputformat="marcxml"
             inputcharset="utf-8"/>
       <xslt stylesheet="__INTRANET_TMPL_DIR__/prog/en/xslt/MARC21slimUtils.xsl"/>
index 3093c72..f848012 100644 (file)
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <retrievalinfo xmlns="http://indexdata.com/yaz">
-  <retrieval syntax="usmarc" name="F">
+  <retrieval syntax="__ZEBRA_MARC_FORMAT__" name="F">
     <backend syntax="xml" name="marc">
       <marc inputformat="xml" outputformat="marc"
             inputcharset="utf-8"
             outputcharset="utf-8"/>
     </backend>
   </retrieval>
-  <retrieval syntax="usmarc" name="B">
+  <retrieval syntax="__ZEBRA_MARC_FORMAT__" name="B">
     <backend syntax="xml" name="marc">
       <marc inputformat="xml" outputformat="marc"
             inputcharset="utf-8"
index 58f319d..f1f8898 100644 (file)
@@ -1,37 +1,37 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <retrievalinfo xmlns="http://indexdata.com/yaz">
-  <retrieval syntax="usmarc" name="F"/>
-  <retrieval syntax="usmarc" name="B"/>
+  <retrieval syntax="__ZEBRA_MARC_FORMAT__" name="F"/>
+  <retrieval syntax="__ZEBRA_MARC_FORMAT__" name="B"/>
   <retrieval syntax="xml" name="marcxml"
              identifier="info:srw/schema/1/marcxml-v1.1">
-    <backend syntax="usmarc" name="F">
+    <backend syntax="__ZEBRA_MARC_FORMAT__" name="F">
       <marc inputformat="marc" outputformat="marcxml"
             inputcharset="utf-8"/>
     </backend>
   </retrieval>
   <retrieval syntax="xml" name="dc">
-    <backend syntax="usmarc" name="F">
+    <backend syntax="__ZEBRA_MARC_FORMAT__" name="F">
       <marc inputformat="marc" outputformat="marcxml"
             inputcharset="utf-8"/>
       <xslt stylesheet="__INTRANET_TMPL_DIR__/prog/en/xslt/MARC21slim2DC.xsl"/>
     </backend>
   </retrieval>
   <retrieval syntax="xml" name="mods">
-    <backend syntax="usmarc" name="F">
+    <backend syntax="__ZEBRA_MARC_FORMAT__" name="F">
       <marc inputformat="marc" outputformat="marcxml"
             inputcharset="utf-8"/>
       <xslt stylesheet="__INTRANET_TMPL_DIR__/prog/en/xslt/MARC21slim2MODS.xsl"/>
     </backend>
   </retrieval>
   <retrieval syntax="xml" name="rdfdc">
-    <backend syntax="usmarc" name="F">
+    <backend syntax="__ZEBRA_MARC_FORMAT__" name="F">
       <marc inputformat="marc" outputformat="marcxml"
             inputcharset="utf-8"/>
       <xslt stylesheet="__INTRANET_TMPL_DIR__/prog/en/xslt/MARC21slim2RDFDC.xsl"/>
     </backend>
   </retrieval>
   <retrieval syntax="xml" name="utils">
-    <backend syntax="usmarc" name="F">
+    <backend syntax="__ZEBRA_MARC_FORMAT__" name="F">
       <marc inputformat="marc" outputformat="marcxml"
             inputcharset="utf-8"/>
       <xslt stylesheet="__INTRANET_TMPL_DIR__/prog/en/xslt/MARC21slimUtils.xsl"/>
index 59cae26..42b334f 100644 (file)
@@ -16,6 +16,7 @@
     <xsl:key name="index_subfields_tag" match="kohaidx:index_subfields" use="@tag"/>
     <xsl:key name="index_heading_tag"   match="kohaidx:index_heading"   use="@tag"/>
     <xsl:key name="index_data_field_tag"   match="kohaidx:index_data_field"   use="@tag"/>
+    <xsl:key name="index_heading_conditional_tag" match="kohaidx:index_heading_conditional" use="@tag"/>
     <xsl:key name="index_match_heading_tag" match="kohaidx:index_match_heading" use="@tag"/>
 
     <xsl:template match="kohaidx:index_defs">
@@ -33,6 +34,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml)
             <xslo:template match="text()" mode="index_subfields"/>
             <xslo:template match="text()" mode="index_data_field"/>
             <xslo:template match="text()" mode="index_heading"/>
+            <xslo:template match="text()" mode="index_heading_conditional"/>
             <xslo:template match="text()" mode="index_match_heading"/>
             <xslo:template match="text()" mode="index_subject_thesaurus"/>
             <xslo:template match="/">
@@ -47,13 +49,16 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml)
             </xslo:template>
 
             <xslo:template match="marc:record">
-                <xslo:variable name="controlField001" select="normalize-space(marc:controlfield[@tag='001'])"/>
+                <xslo:variable name="idfield">
+                    <xsl:attribute name="select">normalize-space(<xsl:value-of select="//id"/>)</xsl:attribute>
+                </xslo:variable>
                 <z:record type="update">
-                    <xslo:attribute name="z:id"><xslo:value-of select="$controlField001"/></xslo:attribute>
+                    <xslo:attribute name="z:id"><xslo:value-of select="$idfield"/></xslo:attribute>
                     <xslo:apply-templates/>
                     <xslo:apply-templates mode="index_subfields"/>
                     <xslo:apply-templates mode="index_data_field"/>
                     <xslo:apply-templates mode="index_heading"/>
+                    <xslo:apply-templates mode="index_heading_conditional"/>
                     <xslo:apply-templates mode="index_match_heading"/>
                     <xslo:apply-templates mode="index_subject_thesaurus"/>
                 </z:record>
@@ -64,6 +69,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml)
             <xsl:call-template name="handle-index-subfields"/>
             <xsl:call-template name="handle-index-data-field"/>
             <xsl:call-template name="handle-index-heading"/>
+            <xsl:call-template name="handle-index-heading-conditional"/>
             <xsl:call-template name="handle-index-match-heading"/>
             <xsl:apply-templates/>
             <xslo:template match="*">
@@ -279,6 +285,20 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml)
         </xsl:for-each>
     </xsl:template>
 
+    <xsl:template name="handle-index-heading-conditional">
+        <xsl:for-each select="//kohaidx:index_heading_conditional[generate-id() = generate-id(key('index_heading_conditional_tag', @tag)[1])]">
+            <xslo:template mode="index_heading_conditional">
+                <xsl:attribute name="match">marc:datafield[@tag='<xsl:value-of select="@tag"/>']</xsl:attribute>
+                <xslo:if>
+                    <xsl:attribute name="test"><xsl:value-of select="@test"/></xsl:attribute>
+                    <xsl:for-each select="key('index_heading_conditional_tag', @tag)">
+                        <xsl:call-template name="handle-one-index-heading"/>
+                    </xsl:for-each>
+                </xslo:if>
+            </xslo:template>
+        </xsl:for-each>
+    </xsl:template>
+
     <xsl:template name="handle-one-data-field">
         <xsl:variable name="indexes">
             <xsl:call-template name="get-target-indexes"/>
diff --git a/help.pl b/help.pl
index 78f225b..f641fe6 100755 (executable)
--- a/help.pl
+++ b/help.pl
@@ -43,6 +43,16 @@ my $query = new CGI;
 our $refer = $query->param('url');
 $refer = $query->referer()  if !$refer || $refer eq 'undefined';
 my $from = _help_template_file_of_url($refer);
+my $htdocs = C4::Context->config('intrahtdocs');
+
+#
+# checking that the help file exist, otherwise, display nohelp.tt page
+#
+my ( $theme, $lang ) = C4::Templates::themelanguage( $htdocs, $from, "intranet", $query );
+unless ( -e "$htdocs/$theme/$lang/modules/$from" ) {
+    $from = "help/nohelp.tt";
+    ( $theme, $lang ) = C4::Templates::themelanguage( $htdocs, $from, "intranet", $query );
+}
 
 my $template = C4::Templates::gettemplate($from, 'intranet', $query);
 $template->param( referer => $refer );
index 153bcb7..2460555 100644 (file)
@@ -12,21 +12,27 @@ libalgorithm-checkdigits-perl       install
 libauthen-cas-client-perl install
 libbiblio-endnotestyle-perl install
 libbusiness-isbn-perl install
+libcache-memcached-fast-perl           install
 libcgi-session-perl    install
+libcgi-session-driver-memcached-perl           install
 libcgi-session-serialize-yaml-perl install
+libclass-accessor-perl         install
 libclass-factory-util-perl     install
 libdata-ical-perl      install
 libdate-calc-perl install
 libdate-manip-perl install
+libdatetime-event-ical-perl            install
 libdatetime-format-dateparse-perl    install
 libdatetime-format-ical-perl    install
 libdatetime-format-mail-perl install
+libdatetime-format-mysql-perl          install
 libdatetime-format-strptime-perl       install
 libdatetime-format-w3cdtf-perl install
 libdatetime-locale-perl        install
 libdatetime-perl       install
 libdatetime-set-perl install
 libdatetime-timezone-perl      install
+libdbd-mock-perl               install
 libdbd-mysql-perl install
 libdbd-sqlite2-perl install
 libdbi-perl    install
@@ -36,6 +42,7 @@ libgcrypt11 install
 libgd2-noxpm-dev install
 libgd-barcode-perl     install
 libgravatar-url-perl   install
+libhtml-format-perl            install
 libhtml-scrubber-perl  install
 libidzebra-2.0-dev     install
 libidzebra-2.0 install
@@ -48,6 +55,7 @@ libidzebra-2.0-modules        install
 libgraphics-magick-perl install
 libhtml-template-pro-perl install
 libhttp-oai-perl install
+libjson-any-perl               install
 libjson-perl   install
 liblingua-ispell-perl  install
 liblingua-stem-perl install
@@ -59,10 +67,13 @@ liblocale-po-perl   install
 libmail-sendmail-perl install
 libmarc-charset-perl install
 libmarc-crosswalk-dublincore-perl install
+libmarc-record-perl            install
 libmarc-xml-perl install
 libmemoize-memcached-perl install
-libmodern-perl-perl    install
 libmime-lite-perl       install
+libmodern-perl-perl    install
+libmoosex-storage-perl         install
+libmoosex-types-perl           install
 libmysqlclient15-dev install
 libnet-ldap-perl       install
 libnet-server-perl install
@@ -78,18 +89,28 @@ libreadonly-perl    install
 libreadonly-xs-perl    install
 libschedule-at-perl install
 libsms-send-perl install
+libstring-rewriteprefix-perl           install
 libtemplate-perl install
+libtemplate-plugin-htmltotext-perl             install
+libtest-mockmodule-perl                install
+libtest-strict-perl            install
+libtest-warn-perl              install
+libtest-yaml-valid-perl                install
 libtext-charwidth-perl install
 libtext-csv-encoded-perl install
 libtext-csv-perl       install
+libtext-csv-xs-perl            install
 libtext-iconv-perl     install
 libtext-unaccent-perl  install
 libtext-wrapi18n-perl  install
 libtimedate-perl       install
 libtime-duration-perl  install
 libtime-format-perl    install
+libtime-progress-perl          install
 libuniversal-require-perl      install
 libunix-syslog-perl    install
+liburi-perl            install
+libwww-perl            install
 libxml2-dev    install
 libxml2        install
 libxml2-utils  install
@@ -102,6 +123,7 @@ libxml-parser-perl  install
 libxml-perl    install
 libxml-regexp-perl     install
 libxml-rss-perl install
+libxml-sax-perl                install
 libxml-sax-writer-perl  install
 libxml-simple-perl install
 libxml-xslt-perl       install
index 6954277..50e2728 100644 (file)
@@ -523,8 +523,6 @@ a2ensite koha
 invoke-rc.d apache2 reload
 
 koha_script=`makefile_value KOHA_DEST_SCRIPT_DIR`
-ln -s "$koha_script"/koha-zebraqueue-ctl.sh  /etc/init.d/koha-zebraqueue-daemon
-update-rc.d koha-zebraqueue-daemon defaults
 
 # TODO:
 # - add translator
index 61fbebf..5b55070 100644 (file)
@@ -108,6 +108,7 @@ libpoe-perl                         install
 libschedule-at-perl                    install
 libsms-send-perl                       install
 libtemplate-perl                       install
+libtemplate-plugin-htmltotext-perl     install
 libtext-charwidth-perl                 install
 libtext-csv-encoded-perl                       install
 libtext-csv-perl                       install
index 9b806bb..3f6cb81 100644 (file)
@@ -103,6 +103,7 @@ libpoe-perl                         install
 libschedule-at-perl                    install
 libsms-send-perl                       install
 libtemplate-perl                       install
+libtemplate-plugin-htmltotext-perl     install
 libtext-charwidth-perl                 install
 libtext-csv-encoded-perl               install
 libtext-csv-perl                       install
index 340ce82..c8e8d5f 100644 (file)
@@ -123,6 +123,7 @@ libschedule-at-perl                 install
 libsms-send-perl                       install
 libstring-rewriteprefix-perl           install
 libtemplate-perl                       install
+libtemplate-plugin-htmltotext-perl     install
 libtest-mockmodule-perl                        install
 libtest-strict-perl                    install
 libtext-charwidth-perl                 install
index 340ce82..c8e8d5f 100644 (file)
@@ -123,6 +123,7 @@ libschedule-at-perl                 install
 libsms-send-perl                       install
 libstring-rewriteprefix-perl           install
 libtemplate-perl                       install
+libtemplate-plugin-htmltotext-perl     install
 libtest-mockmodule-perl                        install
 libtest-strict-perl                    install
 libtext-charwidth-perl                 install
diff --git a/installer/data/mysql/atomicupdate/importauthorities.pl b/installer/data/mysql/atomicupdate/importauthorities.pl
new file mode 100755 (executable)
index 0000000..679235e
--- /dev/null
@@ -0,0 +1,26 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use C4::Context;
+my $dbh = C4::Context->dbh;
+
+$dbh->do(
+q|CREATE TABLE `import_auths` (
+    import_record_id int(11) NOT NULL,
+    matched_authid int(11) default NULL,
+    control_number varchar(25) default NULL,
+    authorized_heading varchar(128) default NULL,
+    original_source varchar(25) default NULL,
+    CONSTRAINT import_auths_ibfk_1 FOREIGN KEY (import_record_id)
+    REFERENCES import_records (import_record_id) ON DELETE CASCADE ON UPDATE CASCADE,
+    KEY matched_authid (matched_authid)
+    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;|
+);
+$dbh->do("ALTER TABLE import_batches
+            CHANGE COLUMN num_biblios num_records int(11) NOT NULL default 0,
+            ADD COLUMN record_type enum('biblio', 'auth', 'holdings') NOT NULL default 'biblio'");
+$dbh->do("UPDATE import_batches SET record_type='auth' WHERE import_batch_id IN
+            (SELECT import_batch_id FROM import_records WHERE record_type='auth')");
+
+print "Upgrade done (Added support for staging authorities)\n";
index f668d99..5bd39a2 100644 (file)
@@ -16,3 +16,93 @@ VALUES ('circulation','ODUE','Mahnung','Mahnung','Liebe/r <<borrowers.firstname>
 ('suggestions','AVAILABLE','Vorgeschlagenes Medium verfügbar', 'Das vorgeschlagene Medium ist jetzt verfügbar','Liebe(r) <<borrowers.firstname>> <<borrowers.surname>>,\n\nSie haben der Bibliothek folgendes Medium zur Anschaffung vorgeschlagen: <<suggestions.title>> von <<suggestions.author>>.\n\nWir freuen uns Ihnen mitteilen zu können, dass dieser Titel jetzt im Bestand der Bibliothek verfügbar ist.\n\nWenn Sie Fragen haben, richten Sie Ihre Mail bitte an: <<branches.branchemail>>.\n\nVielen Dank,\n\n<<branches.branchname>>'),
 ('suggestions','ORDERED','Vorgeschlagenes Medium bestellt', 'Das vorgeschlagene Medium wurde im Buchhandel bestellt','Liebe(r) <<borrowers.firstname>> <<borrowers.surname>>,\n\nSie haben der Bibliothek folgendes Medium zur Anschaffung vorgeschlaten: <<suggestions.title>> von <<suggestions.author>>.\n\nWir freuen uns Ihnen mitteilen zu können, dass dieser Titel jetzt im Buchhandel bestellt wurde. Nach Eintreffen wird er in unseren Bestand eingearbeitet.\n\nSie erhalten Nachricht, sobald das Medium verfügbar ist.\n\nBei Nachfragen erreichen Sie uns unter der Emailadresse <<branches.branchemail>>.\n\nVielen Dank,\n\n<<branches.branchname>>'),
 ('suggestions','REJECTED','Anschaffungsvorschlag nicht angenommen', 'Ihr Anschaffungsvorschlag wurde nicht angenommen','Liebe(r) <<borrowers.firstname>> <<borrowers.surname>>,\n\nSie haven der Bibliothek folgendes Medium zur Anschaffung vorgeschlagen: <<suggestions.title>> von <<suggestions.author>>.\n\nDie Bibliothek hat diesen Titel heute recherchiert und sich gegen eine Anschaffung entschieden.\n\nBegründung: <<suggestions.reason>>\n\nWenn Sie Fragen haben, richten Sie Ihre Mail bitte an: <<branches.branchemail>>.\n\nVielen Dank,\n\n<<branches.branchname>>');
+
+INSERT INTO `letter` (module, code, name, title, content, is_html)
+VALUES ('circulation','ISSUESLIP','Ausleihquittung (Quittungsdruck)','Ausleihquittung (Quittungsdruck)', '<h3><<branches.branchname>></h3>
+Ausleihe an: <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />
+(<<borrowers.cardnumber>>) <br />
+
+<<today>><br />
+
+<h4>Ausleihen</h4>
+<checkedout>
+<p>
+<<biblio.title>> <br />
+Barcode: <<items.barcode>><br />
+Fällig am: <<issues.date_due>><br />
+</p>
+</checkedout>
+
+<h4>Überfällig</h4>
+<overdue>
+<p>
+<<biblio.title>> <br />
+Barcode: <<items.barcode>><br />
+Fällig am: <<issues.date_due>><br />
+</p>
+</overdue>
+
+<hr>
+
+<h4 style="text-align: center; font-style:italic;">News</h4>
+<news>
+<div class="newsitem">
+<h5 style="margin-bottom: 1px; margin-top: 1px"><b><<opac_news.title>></b></h5>
+<p style="margin-bottom: 1px; margin-top: 1px"><<opac_news.new>></p>
+<p class="newsfooter" style="font-size: 8pt; font-style:italic; margin-bottom: 1px; margin-top: 1px">Posted on <<opac_news.timestamp>></p>
+<hr />
+</div>
+</news>', 1),
+('circulation','ISSUEQSLIP','Kurzquittung','Kurzquittung', '<h3><<branches.branchname>></h3>
+Ausleihe an: <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />
+(<<borrowers.cardnumber>>) <br />
+
+<<today>><br />
+
+<h4>Heutige Ausleihen</h4>
+<checkedout>
+<p>
+<<biblio.title>> <br />
+Barcode: <<items.barcode>><br />
+Fällig am: <<issues.date_due>><br />
+</p>
+</checkedout>', 1),
+('circulation','RESERVESLIP','Vormerkquittung','Vormerkquittung', '<h5>Datum: <<today>></h5>
+
+<h3> Bereitstellung in <<branches.branchname>></h3>
+
+<h3><<borrowers.surname>>, <<borrowers.firstname>></h3>
+
+<ul>
+    <li><<borrowers.cardnumber>></li>
+    <li><<borrowers.phone>></li>
+    <li> <<borrowers.address>><br />
+         <<borrowers.address2>><br />
+         <<borrowers.city >>  <<borrowers.zipcode>>
+    </li>
+    <li><<borrowers.email>></li>
+</ul>
+<br />
+<h3>VORMERKUNG</h3>
+<h4><<biblio.title>></h4>
+<h5><<biblio.author>></h5>
+<ul>
+   <li><<items.barcode>></li>
+   <li><<items.itemcallnumber>></li>
+   <li><<reserves.waitingdate>></li>
+</ul>
+<p>Notiz:
+<pre><<reserves.reservenotes>></pre>
+</p>
+', 1),
+('circulation','TRANSFERSLIP','Transportquittung','Transportquittung', '<h5>Datum: <<today>></h5>
+
+<h3>Transport nach <<branches.branchname>></h3>
+
+<h3>EXEMPLAR</h3>
+<h4><<biblio.title>></h4>
+<h5><<biblio.author>></h5>
+<ul>
+   <li><<items.barcode>></li>
+   <li><<items.itemcallnumber>></li>
+</ul>', 1);
index 7282cce..ec5a22a 100644 (file)
@@ -1,8 +1,8 @@
 INSERT INTO permissions (module_bit, code, description) VALUES
    ( 1, 'circulate_remaining_permissions', 'Übrige Ausleihberechtigungen'),
    ( 1, 'override_renewals', 'Gesperrte Verlängerungen überschreiben'),
-   ( 3, 'parameters_remaining_permissions', 'Remaining system parameters permissions'),
-   ( 3, 'manage_circ_rules', 'manage circulation rules'),
+   ( 3, 'parameters_remaining_permissions', 'Übrige Administrationsberechtigungen'),
+   ( 3, 'manage_circ_rules', 'Ausleihkonditionen verwalten'),
    ( 6, 'place_holds', 'Vormerkungen für Benutzer setzen'),
    ( 6, 'modify_holds_priority', 'Vormerkungspriorität verändern'),
    ( 9, 'edit_catalogue', 'Katalogdaten bearbeiten (Titel- und Exemplardaten ändern)'),
@@ -18,21 +18,21 @@ INSERT INTO permissions (module_bit, code, description) VALUES
    (11, 'group_manage', 'Bestellgruppen vewalten'),
    (11, 'order_receive', 'Lieferungen verwalten'),
    (11, 'budget_add_del', 'Konten hinzufügen/ändern, aber bestehende nicht ändern'),
-   (11, 'budget_manage_all', 'Manage all budgets'),
+   (11, 'budget_manage_all', 'Alle Konten verwalten'),
    (13, 'edit_news', 'Nachrichten für OPAC und Dienstoberfläche verfassen'),
    (13, 'label_creator', 'Etiketten und Barcodes aus Katalog- und Benutzerdaten erstellen'),
    (13, 'edit_calendar', 'Schließtage eintragen'),
    (13, 'moderate_comments', 'Benutzerkommentare moderieren'),
    (13, 'edit_notices', 'Benachrichtigungen verwalten'),
    (13, 'edit_notice_status_triggers', 'Mahntrigger für überfällige Medien verwalten'),
-   (13, 'edit_quotes', 'Edit quotes for quote-of-the-day feature'),
+   (13, 'edit_quotes', '"Zitat des Tages" konfigurieren'),
    (13, 'view_system_logs', 'Logs durchsuchen/einsehen'),
    (13, 'inventory', 'Inventur durchführen'),
    (13, 'stage_marc_import', 'MARC-Datensätze zwischenspeichern'),
    (13, 'manage_staged_marc', 'MARC-Importe verwalten, auch Übernahme in Katalog und Import rückgängig machen'),
    (13, 'export_catalog', 'Titel- und Exemplardaten exportieren'),
    (13, 'import_patrons', 'Benutzerdaten importieren'),
-   (13, 'edit_patrons', 'Perform batch modification of patrons'),
+   (13, 'edit_patrons', 'Stapelbearbeitung von Benutzerdaten durchführen'),
    (13, 'delete_anonymize_patrons', 'Inaktive Benutzer löschen und Ausleihhistorie anonymisieren (Benutzerausleihhistorie löschen)'),
    (13, 'batch_upload_patron_images', 'Benutzerfotos einzeln oder im Stapel hochladen'),
    (13, 'schedule_tasks', 'Aufgabenplaner verwenden'),
index 5832f61..ed45274 100644 (file)
@@ -46,3 +46,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','Adresse kontrollieren');
+
+-- OPAC Suggestions reasons
+INSERT INTO authorised_values (category,authorised_value,lib,lib_opac) VALUES ('OPAC_SUG','damaged','Vorhandenes Exemplar ist beschädigt','Vorhandenes Exemplar ist beschädigt');
+INSERT INTO authorised_values (category,authorised_value,lib,lib_opac) VALUES ('OPAC_SUG','bestseller','Neuerscheinung von bekanntem Verfasser','Neuerscheinung von bekanntem Verfasser');
diff --git a/installer/data/mysql/de-DE/optional/patron_atributes.sql b/installer/data/mysql/de-DE/optional/patron_atributes.sql
new file mode 100644 (file)
index 0000000..35d61cb
--- /dev/null
@@ -0,0 +1,2 @@
+INSERT INTO `borrower_attribute_types` (`code`, `description`, `repeatable`, `unique_id`, `opac_display`, `password_allowed`, `staff_searchable`, `authorised_value_category`)
+VALUES ('SHOW_BCODE',  'Zeige den Barcode in der Exemplarübersicht', 0, 0, 1, 0, 0, 'YES_NO');
diff --git a/installer/data/mysql/de-DE/optional/patron_atributes.txt b/installer/data/mysql/de-DE/optional/patron_atributes.txt
new file mode 100644 (file)
index 0000000..39abf2e
--- /dev/null
@@ -0,0 +1,2 @@
+Nützliche Benutzerattribute:
+* SHOW_BCODE - Zeige den Barcode in der Exemplarübersicht.
index 83ce059..4cba418 100644 (file)
@@ -1,6 +1,4 @@
-Einige vorkonfigurierte Z39.50-Server
+Vorkonfigurierte Z39.50-Server:
 LIBRARY OF CONGRESS
-NEW YORK UNIVERSITY LIBRARIES
 COLUMBIA UNIVERSITY
-NEW YORK PUBLIC LIBRARY
 SMITHSONIAN INSTITUTION LIBRARIES
index 3a8926a..bbbb3d5 100644 (file)
@@ -1,2 +1,2 @@
-defines default message tranports for email, and sms.
+Defines default message tranports for email and sms.
 
index 770bcac..5a326f4 100644 (file)
@@ -1,2 +1 @@
-defines default messages for items due, advance notices, and upcoming library events.
-
+Defines default messages for the enhanced messaging configuration.
index 18e3431..74cea36 100644 (file)
@@ -1,3 +1,2 @@
-Defines default message transports for sending item due messages,
-advance notice messages, and library event messages through email
-and SMS.
+Defines default message transports for sending item due messages and
+advance notice messages through email and SMS.
index 5648982..107bfd7 100644 (file)
@@ -1,5 +1,5 @@
-Koha I18N Support
+Koha I18N support
 
 BIDI Stuff, Arabic and Hebrew
 Default mappings between script and language subcodes
-Language Extensions
+Language extensions
index c234c3f..bc23678 100644 (file)
@@ -1 +1 @@
-Some basic default authorised values for Library Departments, Item Lost status, etc. You can change these at any time after installation.
+Some basic default authorised values for library locations, item lost status, etc. You can change these at any time after installation.
index ce1b6f4..7fa02cc 100644 (file)
@@ -1,2 +1,2 @@
-Coded values conforming to the Z39.71-2006 Holdings Statements for Bibliographic Items
+Coded values conforming to the Z39.71-2006 holdings statements for bibliographic items.
 Refer to http://www.niso.org/standards/index.html for details.
index ef8264b..5cbf709 100644 (file)
@@ -1 +1 @@
-MARC Code List for Relators, as of http://www.loc.gov/marc/relators/relaterm.html
+MARC code list for relators, as of http://www.loc.gov/marc/relators/relaterm.html
index ccb7f40..b94941a 100644 (file)
@@ -1,25 +1,25 @@
 Sample patron types and categories: 
 
-Type:                  Categories:
+Type:           Categories:
 
-Adult Patron - default patron type
-                               PT      - Patron
-                               ST      - Student
-                               BH      - Homebound
+Adult patron - default patron type
+                PT  - Patron
+                ST  - Student
+                BH  - Homebound
 
 Child - patron with a guarantor
-                               K       - Kid
-                               J       - Juvenile
-                               YA      - Young Adult
+                K   - Kid
+                J   - Juvenile
+                YA  - Young Adult
 
 Organization - patron is an institution, not a person
-                               ILL - Inter-library Loan
-                               SC      - School
-                               L       - Library
+                ILL - Inter-library Loan
+                SC  - School
+                L   - Library
 
 Professional - a member of an organization (organization is guarantor)
-                               T       - Teacher
-                               S       - Staff
-                               B       - Board
+                T   - Teacher
+                S   - Staff
+                B   - Board
 
 Types are currently hardcoded, but you can add/edit/delete categories after installation from the administration module.
index e323317..33b6ff6 100644 (file)
@@ -1,4 +1,4 @@
 INSERT INTO `repeatable_holidays` VALUES 
-(2,'',0,NULL,NULL,'','Sundays'),
-(3,'',NULL,1,1,'','New Year\'s Day'),
-(4,'',NULL,25,12,'','Christmas');
+(2,'MPL',0,NULL,NULL,'','Sundays'),
+(3,'MPL',NULL,1,1,'','New Year\'s Day'),
+(4,'MPL',NULL,25,12,'','Christmas');
index dacc9b3..a2d2de9 100644 (file)
@@ -1,4 +1,4 @@
-Sample Holidays:
+Sample holidays:
        Sundays
        Christmas
        New Year's
index f2b0bcc..1af4c51 100644 (file)
@@ -1 +1 @@
-A set of default item types (material types and collection codes).
+A set of default item types.
index 97953d0..cbaf05c 100644 (file)
@@ -1 +1 @@
-A few sample libraries, and library categories, including examples of the hardcoded types, CU, IS, PE.
+A few sample libraries.
index 121badd..89d7250 100644 (file)
@@ -1,5 +1,3 @@
 LIBRARY OF CONGRESS
-NEW YORK UNIVERSITY LIBRARIES
 COLUMBIA UNIVERSITY
-NEW YORK PUBLIC LIBRARY
 SMITHSONIAN INSTITUTION LIBRARIES
index 121badd..89d7250 100644 (file)
@@ -1,5 +1,3 @@
 LIBRARY OF CONGRESS
-NEW YORK UNIVERSITY LIBRARIES
 COLUMBIA UNIVERSITY
-NEW YORK PUBLIC LIBRARY
 SMITHSONIAN INSTITUTION LIBRARIES
index 7d43607..065c6b3 100644 (file)
@@ -24,3 +24,4 @@ UPDATE systempreferences SET value = 'Ma bibliothèque' WHERE variable = 'Librar
 UPDATE systempreferences SET value = 'fr-FR' WHERE variable = 'opaclanguages';
 UPDATE systempreferences SET value = 1 WHERE variable = 'opaclanguagesdisplay';
 UPDATE systempreferences SET value = 'Bienvenue dans Koha...\r\n<hr>' WHERE variable = 'OpacMainUserBlock';
+UPDATE systempreferences SET value = 'bibtex|dc|marcxml|marc8|utf8|marcstd|ris' WHERE variable = 'OpacExportOptions';
index 4b8c66e..3147bed 100644 (file)
@@ -1,8 +1,8 @@
 INSERT INTO permissions (module_bit, code, description) VALUES
    ( 1, 'circulate_remaining_permissions', 'Fonctions de circulation restantes'),
    ( 1, 'override_renewals', 'Outrepasser les limites de renouvellement'),
-   ( 3, 'parameters_remaining_permissions', 'Remaining system parameters permissions'),
-   ( 3, 'manage_circ_rules', 'manage circulation rules'),
+   ( 3, 'parameters_remaining_permissions', 'Paramètres du système restants'),
+   ( 3, 'manage_circ_rules', 'Gestion des règles de circulation'),
    ( 6, 'place_holds', 'Réserver pour des adhérents'),
    ( 6, 'modify_holds_priority', 'Modifier la priorité des réservations'),
    ( 9, 'edit_catalogue', 'Ajouter et modifier des notices au catalogue'),
@@ -14,7 +14,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES
    (13, 'moderate_comments', 'Modérer les commentaires des adhérents'),
    (13, 'edit_notices', 'Définir les notifications'),
    (13, 'edit_notice_status_triggers', 'Définir les déclencheurs de notification de retard'),
-   (13, 'edit_quotes', 'Edit quotes for quote-of-the-day feature'),
+   (13, 'edit_quotes', 'Gérer les citations pour la fonctionnalité citation du jour'),
    (13, 'view_system_logs', 'Parcourir les journaux de l''activité du système'),
    (13, 'inventory', 'Réaliser les tâches de récolement'),
    (13, 'stage_marc_import', 'Importer des notices MARC dans le réservoir'),
index a514d99..a814eab 100644 (file)
@@ -177,8 +177,8 @@ CREATE TABLE `biblioitems` ( -- information related to bibliographic records in
   `cn_class` varchar(30) default NULL,
   `cn_item` varchar(10) default NULL,
   `cn_suffix` varchar(10) default NULL,
-  `cn_sort` varchar(30) default NULL,
-  `agerestriction` varchar(255) default NULL,
+  `cn_sort` varchar(30) default NULL, -- normalized version of the call number used for sorting
+  `agerestriction` varchar(255) default NULL, -- target audience/age restriction from the bib record (MARC21 521$a)
   `totalissues` int(10),
   `marcxml` longtext NOT NULL, -- full bibliographic MARC record in MARCXML
   PRIMARY KEY  (`biblioitemnumber`),
@@ -256,8 +256,8 @@ CREATE TABLE `borrowers` ( -- this table includes information about your patrons
   `altcontactsurname` varchar(255) default NULL, -- surname or last name of the alternate contact for the patron/borrower
   `altcontactaddress1` varchar(255) default NULL, -- the first address line for the alternate contact for the patron/borrower
   `altcontactaddress2` varchar(255) default NULL, -- the second address line for the alternate contact for the patron/borrower
-  `altcontactaddress3` varchar(255) default NULL, -- the third address line for the alternate contact for the patron/borrower
-  `altcontactstate` text default NULL, -- the city and state for the alternate contact for the patron/borrower
+  `altcontactaddress3` varchar(255) default NULL, -- the city for the alternate contact for the patron/borrower
+  `altcontactstate` text default NULL, -- the state for the alternate contact for the patron/borrower
   `altcontactzipcode` varchar(50) default NULL, -- the zipcode for the alternate contact for the patron/borrower
   `altcontactcountry` text default NULL, -- the country for the alternate contact for the patron/borrower
   `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
@@ -650,8 +650,8 @@ CREATE TABLE `deletedbiblioitems` ( -- information about bibliographic records t
   `cn_class` varchar(30) default NULL,
   `cn_item` varchar(10) default NULL,
   `cn_suffix` varchar(10) default NULL,
-  `cn_sort` varchar(30) default NULL,
-  `agerestriction` varchar(255) default NULL,
+  `cn_sort` varchar(30) default NULL, -- normalized version of the call number used for sorting
+  `agerestriction` varchar(255) default NULL, -- target audience/age restriction from the bib record (MARC21 521$a)
   `totalissues` int(10),
   `marcxml` longtext NOT NULL, -- full bibliographic MARC record in MARCXML
   PRIMARY KEY  (`biblioitemnumber`),
@@ -727,8 +727,8 @@ CREATE TABLE `deletedborrowers` ( -- stores data related to the patrons/borrower
   `altcontactsurname` varchar(255) default NULL, -- surname or last name of the alternate contact for the patron/borrower
   `altcontactaddress1` varchar(255) default NULL, -- the first address line for the alternate contact for the patron/borrower
   `altcontactaddress2` varchar(255) default NULL, -- the second address line for the alternate contact for the patron/borrower
-  `altcontactaddress3` varchar(255) default NULL, -- the third address line for the alternate contact for the patron/borrower
-  `altcontactstate` text default NULL, -- the city and state for the alternate contact for the patron/borrower
+  `altcontactaddress3` varchar(255) default NULL, -- the city for the alternate contact for the patron/borrower
+  `altcontactstate` text default NULL, -- the state for the alternate contact for the patron/borrower
   `altcontactzipcode` varchar(50) default NULL, -- the zipcode for the alternate contact for the patron/borrower
   `altcontactcountry` text default NULL, -- the country for the alternate contact for the patron/borrower
   `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
@@ -762,6 +762,7 @@ CREATE TABLE `deleteditems` (
   `itemlost` tinyint(1) NOT NULL default 0, -- authorized value defining this item as lost (MARC21 952$1)
   `wthdrawn` tinyint(1) NOT NULL default 0, -- authorized value defining this item as withdrawn (MARC21 952$0)
   `itemcallnumber` varchar(255) default NULL, -- call number for this item (MARC21 952$o)
+  `coded_location_qualifier` varchar(10) default NULL, -- coded location qualifier(MARC21 952$f)
   `issues` smallint(6) default NULL, -- number of times this item has been checked out
   `renewals` smallint(6) default NULL, -- number of times this item has been renewed
   `reserves` smallint(6) default NULL, -- number of times this item has been placed on hold/reserved
@@ -855,7 +856,7 @@ CREATE TABLE `import_batches` ( -- information about batches of marc records tha
   `matcher_id` int(11) default NULL, -- the id of the match rule used (matchpoints.matcher_id)
   `template_id` int(11) default NULL,
   `branchcode` varchar(10) default NULL,
-  `num_biblios` int(11) NOT NULL default 0, -- number of bib records in the file
+  `num_records` int(11) NOT NULL default 0, -- number of records in the file
   `num_items` int(11) NOT NULL default 0, -- number of items in the file
   `upload_timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP, -- date and time the file was uploaded
   `overlay_action` enum('replace', 'create_new', 'use_template', 'ignore') NOT NULL default 'create_new', -- how to handle duplicate records
@@ -863,6 +864,7 @@ CREATE TABLE `import_batches` ( -- information about batches of marc records tha
   `item_action` enum('always_add', 'add_only_for_matches', 'add_only_for_new', 'ignore') NOT NULL default 'always_add', -- what to do with item records
   `import_status` enum('staging', 'staged', 'importing', 'imported', 'reverting', 'reverted', 'cleaned') NOT NULL default 'staging', -- the status of the imported file
   `batch_type` enum('batch', 'z3950', 'webservice') NOT NULL default 'batch', -- where this batch has come from
+  `record_type` enum('biblio', 'auth', 'holdings') NOT NULL default 'biblio', -- type of record in the batch
   `file_name` varchar(100), -- the name of the file uploaded
   `comments` mediumtext, -- any comments added when the file was uploaded
   PRIMARY KEY (`import_batch_id`),
@@ -911,6 +913,22 @@ CREATE TABLE `import_record_matches` ( -- matches found when importing a batch o
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 --
+-- Table structure for table `import_auths`
+--
+
+DROP TABLE IF EXISTS `import_auths`;
+CREATE TABLE `import_auths` (
+  `import_record_id` int(11) NOT NULL,
+  `matched_authid` int(11) default NULL,
+  `control_number` varchar(25) default NULL,
+  `authorized_heading` varchar(128) default NULL,
+  `original_source` varchar(25) default NULL,
+  CONSTRAINT `import_auths_ibfk_1` FOREIGN KEY (`import_record_id`)
+             REFERENCES `import_records` (`import_record_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+  KEY `matched_authid` (`matched_authid`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+--
 -- Table structure for table `import_biblios`
 --
 
@@ -1030,6 +1048,7 @@ CREATE TABLE `items` ( -- holdings/item information
   `itemlost` tinyint(1) NOT NULL default 0, -- authorized value defining this item as lost (MARC21 952$1)
   `wthdrawn` tinyint(1) NOT NULL default 0, -- authorized value defining this item as withdrawn (MARC21 952$0)
   `itemcallnumber` varchar(255) default NULL, -- call number for this item (MARC21 952$o)
+  `coded_location_qualifier` varchar(10) default NULL, -- coded location qualifier(MARC21 952$f)
   `issues` smallint(6) default NULL, -- number of times this item has been checked out/issued
   `renewals` smallint(6) default NULL, -- number of times this item has been renewed
   `reserves` smallint(6) default NULL, -- number of times this item has been placed on hold/reserved
@@ -1831,6 +1850,7 @@ CREATE TABLE `statistics` ( -- information related to transactions (circulation
   `itemtype` varchar(10) default NULL, -- foreign key from the itemtypes table, links transaction to a specific item type
   `borrowernumber` int(11) default NULL, -- foreign key from the borrowers table, links transaction to a specific borrower
   `associatedborrower` int(11) default NULL,
+  `ccode` varchar(10) default NULL, -- foreign key from the items table, links transaction to a specific collection code
   KEY `timeidx` (`datetime`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
@@ -1900,6 +1920,7 @@ CREATE TABLE `subscription` (
   `opacdisplaycount` VARCHAR(10) NULL,
   `graceperiod` int(11) NOT NULL default '0',
   `enddate` date default NULL,
+  `closed ` INT(1) NOT NULL DEFAULT 0,
   PRIMARY KEY  (`subscriptionid`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
@@ -2577,6 +2598,8 @@ CREATE TABLE `aqbasket` ( -- stores data about baskets in acquisitions
   `authorisedby` varchar(10) default NULL, -- the borrowernumber of the person who created the basket
   `booksellerinvoicenumber` mediumtext, -- appears to always be NULL
   `basketgroupid` int(11), -- links this basket to its group (aqbasketgroups.id)
+  `deliveryplace` varchar(10) default NULL, -- basket delivery place
+  `billingplace` varchar(10) default NULL, -- basket billing place
   PRIMARY KEY  (`basketno`),
   KEY `booksellerid` (`booksellerid`),
   KEY `basketgroupid` (`basketgroupid`),
@@ -2769,7 +2792,8 @@ CREATE TABLE `aqorders` ( -- information related to the basket line items
   `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this order line was last modified
   `rrp` decimal(13,2) default NULL, -- the replacement cost for this line item
   `ecost` decimal(13,2) default NULL, -- the estimated cost for this line item
-  `gst` decimal(13,2) default NULL, -- the tax rate for this line item
+  `gstrate` decimal(6,4) default NULL, -- the tax rate for this line item
+  `discount` float(6,4) default NULL, -- the discount for this line item
   `budget_id` int(11) NOT NULL, -- the fund this order goes against (aqbudgets.budget_id)
   `budgetgroup_id` int(11) NOT NULL, -- not used? always zero
   `budgetdate` date default NULL, -- not used? always NULL
@@ -2801,7 +2825,8 @@ CREATE TABLE `aqorders_items` ( -- information on items entered in the acquisiti
   `itemnumber` int(11) NOT NULL, -- the item number for this item (items.itemnumber)
   `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this order item was last touched
   PRIMARY KEY  (`itemnumber`),
-  KEY `ordernumber` (`ordernumber`)
+  KEY `ordernumber` (`ordernumber`),
+  CONSTRAINT aqorders_items_ibfk_1 FOREIGN KEY (ordernumber) REFERENCES aqorders (ordernumber) ON DELETE CASCADE ON UPDATE CASCADE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 
index 0ab90c3..c605944 100644 (file)
@@ -25,5 +25,6 @@ UPDATE systempreferences SET value = 'nb-NO' WHERE variable = 'language';
 UPDATE systempreferences SET value = 'nb-NO' WHERE variable = 'opaclanguages';
 UPDATE systempreferences SET value = '<p>Velkommen til Koha...</p><hr />' WHERE variable = 'OpacMainUserBlock';
 UPDATE systempreferences SET value = '<p>Viktige lenker kan plasseres her</p>' WHERE variable = 'OpacNav';
-
 UPDATE systempreferences SET value = '<li><a href="http://worldcat.org/search?q={TITLE}" target="_blank">Andre bibliotek (WorldCat)</a></li><li><a href="http://www.scholar.google.com/scholar?q={TITLE}" target="_blank">Andre databaser (Google Scholar)</a></li><li><a href="http://www.bookfinder.com/search/?author={AUTHOR}&amp;title={TITLE}&amp;st=xl&amp;ac=qr" target="_blank">Nettbutikker (Bookfinder.com)</a></li>' WHERE variable = 'OPACSearchForTitleIn';
+UPDATE systempreferences SET value = 'Monday' WHERE variable = 'CalendarFirstDayOfWeek';
+UPDATE systempreferences SET value = 'A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Æ Ø Å' WHERE variable = 'alphabet';
index a00535f..36c03f3 100644 (file)
@@ -1,6 +1,5 @@
 -- 
--- Default classification sources and filing rules
--- for Koha.
+-- Permissions for Koha.
 --
 -- Copyright (C) 2011 Magnus Enger Libriotech
 --
@@ -22,8 +21,8 @@
 INSERT INTO permissions (module_bit, code, description) VALUES
    ( 1, 'circulate_remaining_permissions', 'Øvrige rettigheter for sirkulasjon'),
    ( 1, 'override_renewals', 'Overstyre blokkerte fornyinger'),
-   ( 3, 'parameters_remaining_permissions', 'Remaining system parameters permissions'),
-   ( 3, 'manage_circ_rules', 'manage circulation rules'),
+   ( 3, 'parameters_remaining_permissions', 'Øvrige rettigheter knyttet til systempreferanser'),
+   ( 3, 'manage_circ_rules', 'Endre sirkulasjonsregler'),
    ( 6, 'place_holds', 'Foreta reservering for lånere'),
    ( 6, 'modify_holds_priority', 'Endre rekkefølge på reserveringer'),
    ( 9, 'edit_catalogue', 'Endre katalogen (Endre bibliografiske poster og eksemplaropplysninger)'),
@@ -39,21 +38,21 @@ INSERT INTO permissions (module_bit, code, description) VALUES
    (11, 'group_manage', 'Administrere bestillinger og kurv-grupper'),
    (11, 'order_receive', 'Administrere bestillinger og kurver'),
    (11, 'budget_add_del', 'Legge til og slette budsjetter (men ikke endre budsjetter)'),
-   (11, 'budget_manage_all', 'Manage all budgets'),
+   (11, 'budget_manage_all', 'Administrere alle budsjetter'),
    (13, 'edit_news', 'Legge ut nyhter i OPACen og det interne grensesnittet'),
    (13, 'label_creator', 'Lage etiketter og strekkoder basert på bibliografiske poster og lånerdata'),
    (13, 'edit_calendar', 'Definere dager da biblioteket er stengt'),
    (13, 'moderate_comments', 'Behandle kommentarer fra lånere'),
    (13, 'edit_notices', 'Definere meldinger'),
    (13, 'edit_notice_status_triggers', 'Definere utløsere for meldinger og statusenderinger for for sent leverte dokumenter'),
-   (13, 'edit_quotes', 'Edit quotes for quote-of-the-day feature'),
+   (13, 'edit_quotes', 'Endre sitater for dagens sitat-funksjonen'),
    (13, 'view_system_logs', 'Se Koha sine logger'),
    (13, 'inventory', 'Foreta varetelling'),
    (13, 'stage_marc_import', 'Importere MARC-poster til brønnen'),
    (13, 'manage_staged_marc', 'Behandle lagrede MARC-poster, inkludert ferdigstilling og reversering av importer'),
    (13, 'export_catalog', 'Eksportere bibliografiske data og beholdningsdata'),
    (13, 'import_patrons', 'Importere låneropplysninger'),
-   (13, 'edit_patrons', 'Perform batch modification of patrons'),
+   (13, 'edit_patrons', 'Utføre satsvise endringer av lånere'),
    (13, 'delete_anonymize_patrons', 'Slette utgåtte lånere og anonymisere lånehistorikk'),
    (13, 'batch_upload_patron_images', 'Laste opp bilder av lånere enkeltvis eller en masse'),
    (13, 'schedule_tasks', 'Planlegge oppgaver som skal kjøres'),
index 6bbd894..47ba7ae 100644 (file)
@@ -1,5 +1,3 @@
 BIBLIOTEKA NARODOWA
 BIBLIOTEKA PUBLICZNA DZIELNICY BEMOWO
 LIBRARY OF CONGRESS
-NEW YORK UNIVERSITY LIBRARIES
-NEW YORK PUBLIC LIBRARY
index 7b33ce6..0cc5a54 100644 (file)
@@ -115,7 +115,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('z3950NormalizeAuthor',0,'If ON, Personal Name Authorities will replace authors in biblio.author','','YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ReservesNeedReturns',1,'If ON, a hold placed on an item available in this library must be checked-in, otherwise, a hold on a specific item, that is in the library & available is considered available','','YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type)  VALUES ('DebugLevel',2,'Define the level of debugging information sent to the browser when errors are encountered (set to 0 in production). 0=none, 1=some, 2=most','0|1|2','Choice');
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('NoZebra',1,'If ON, Zebra indexing is turned off, simpler setup, but slower searches. WARNING: using NoZebra on even modest sized collections is very slow.','','YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('NoZebra',0,'If ON, Zebra indexing is turned off, simpler setup, but slower searches. WARNING: using NoZebra on even modest sized collections is very slow.','','YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('SessionStorage','mysql','Use database or a temporary file for storing session data','mysql|Pg|tmp','Choice');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('CircAutocompl',1,'If ON, autocompletion is enabled for the Circulation input',NULL,'YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('RoutingSerials',1,'If ON, serials routing is enabled',NULL,'YesNo');
@@ -165,7 +165,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACViewOthersSuggestions',0,'If ON, allows all suggestions to be displayed in the OPAC',NULL,'YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACURLOpenInNewWindow',0,'If ON, URLs in the OPAC open in a new window',NULL,'YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACUserCSS','','Add CSS to be included in the OPAC in an embedded <style> tag.',NULL,'free');
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACItemsResultsDisplay',"statuses",'statuses : show only the status of items in result list. itemdisplay : show full location of items (branch+location+callnumber) as in staff interface',"statuses|itemdetails",'Choice');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACItemsResultsDisplay',0,'If OFF : show only the status of items in result list.If ON : show full location of items (branch+location+callnumber) as in staff interface','','YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('uppercasesurnames',0,'If ON, surnames are converted to upper case in patron entry form',NULL,'YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('CircControl',"ItemHomeLibrary",'Specify the agency that controls the circulation and fines policy',"PickupLibrary|PatronLibrary|ItemHomeLibrary",'Choice');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('finesCalendar',"noFinesWhenClosed",'Specify whether to use the Calendar in calculating duedates and fines',"ignoreCalendar|noFinesWhenClosed",'Choice');
@@ -376,9 +376,15 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('SubfieldsToUseWhenPrefill','','Define a list of subfields to use when prefilling items (separated by space)','','Free');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AgeRestrictionMarker','','Markers for age restriction indication, e.g. FSK|PEGI|Age|',NULL,'free');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AgeRestrictionOverride',0,'Allow staff to check out an item with age restriction.',NULL,'YesNo');
-INSERT INTO systempreferences (variable,value,explanation,type) VALUES('DidYouMeanFromAuthorities','0','Suggest searches based on authority file.','YesNo');
 INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('IncludeSeeFromInSearches','0','','Include see-from references in searches.','YesNo');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OPACMobileUserCSS','','Include the following CSS for the mobile view on all pages in the OPAC:',NULL,'free');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacMainUserBlockMobile','','Show the following HTML in its own column on the main page of the OPAC (mobile version):',NULL,'free');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowLibrariesPulldownMobile','1','Show the libraries pulldown on the mobile version of the OPAC.',NULL,'YesNo');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowFiltersPulldownMobile','1','Show the search filters pulldown on the mobile version of the OPAC.',NULL,'YesNo');
+INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('AuthDisplayHierarchy','0','Display authority hierarchies','','YesNo');
+INSERT INTO systempreferences (variable,value,explanation,type) VALUES('OPACdidyoumean',NULL,'Did you mean? configuration for the OPAC. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free');
+INSERT INTO systempreferences (variable,value,explanation,type) VALUES('INTRAdidyoumean',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free');
+INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('BlockReturnOfWithdrawnItems', '1', '0', 'If enabled, items that are marked as withdrawn cannot be returned.', 'YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HoldsToPullStartDate','2','Set the default start date for the Holds to pull list to this many days ago',NULL,'Integer');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z','Alphabet than can be expanded into browse links, e.g. on Home > Patrons',NULL,'free');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RefundLostItemFeeOnReturn', '1', 'If enabled, the lost item fee charged to a borrower will be refunded when the lost item is returned.', NULL, 'YesNo');
index f28995e..f24d8b4 100755 (executable)
@@ -5026,7 +5026,8 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
     $dbh->do("ALTER TABLE old_issues CHANGE returndate returndate datetime");
     $dbh->do("ALTER TABLE old_issues CHANGE lastreneweddate lastreneweddate datetime");
     $dbh->do("ALTER TABLE old_issues CHANGE issuedate issuedate datetime");
-    print "Upgrade to $DBversion done (Setting up issues tables for hourly loans)\n";
+    $dbh->do("UPDATE accountlines SET description = CONCAT(description,' 23:59') WHERE accounttype='F' OR accounttype='FU'"); #BUG-8253
+    print "Upgrade to $DBversion done (Setting up issues and accountlines tables for hourly loans)\n";
     SetVersion($DBversion);
 }
 
@@ -5617,7 +5618,6 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
 
     $dbh->do("UPDATE systempreferences SET options = concat(options,'|EAN13'), explanation = concat(explanation,'; EAN13 - incremental') WHERE variable = 'autoBarcode' AND options NOT LIKE '%EAN13%'");
     print "Upgrade to $DBversion done ( Added EAN13 barcode autogeneration sequence )\n";
-
     SetVersion($DBversion);
 }
 
@@ -5769,7 +5769,6 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
     SetVersion($DBversion);
 }
 
-
 $DBversion = '3.09.00.044';
 if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     $dbh->do("ALTER TABLE statistics ADD COLUMN ccode VARCHAR ( 10 ) NULL AFTER associatedborrower");
@@ -5928,6 +5927,192 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
 }
 
 
+$DBversion = "3.09.00.053";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do(
+    q|CREATE TABLE `import_auths` (
+        import_record_id int(11) NOT NULL,
+        matched_authid int(11) default NULL,
+        control_number varchar(25) default NULL,
+        authorized_heading varchar(128) default NULL,
+        original_source varchar(25) default NULL,
+        CONSTRAINT import_auths_ibfk_1 FOREIGN KEY (import_record_id)
+        REFERENCES import_records (import_record_id) ON DELETE CASCADE ON UPDATE CASCADE,
+        KEY matched_authid (matched_authid)
+        ) ENGINE=InnoDB DEFAULT CHARSET=utf8;|
+    );
+    $dbh->do("ALTER TABLE import_batches
+                CHANGE COLUMN num_biblios num_records int(11) NOT NULL default 0,
+                ADD COLUMN record_type enum('biblio', 'auth', 'holdings') NOT NULL default 'biblio'");
+    $dbh->do("UPDATE import_batches SET record_type='auth' WHERE import_batch_id IN
+                (SELECT import_batch_id FROM import_records WHERE record_type='auth')");
+    
+    print "Upgrade to $DBversion done (Added support for staging authorities)\n";
+    SetVersion ($DBversion);
+}
+
+$DBversion = "3.09.00.054";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+    $dbh->do("ALTER TABLE aqorders CHANGE COLUMN gst gstrate DECIMAL(6,4)  DEFAULT NULL");
+    print "Upgrade to $DBversion done (Change column name in aqorders gst --> gstrate)\n";
+    SetVersion($DBversion);
+}
+
+$DBversion = "3.09.00.055";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+    $dbh->do("ALTER TABLE aqorders ADD discount float(6,4) DEFAULT NULL AFTER gstrate");
+    print "Upgrade to $DBversion done (Add discount field in aqorders table)\n";
+    SetVersion($DBversion);
+}
+
+$DBversion ="3.09.00.056";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+    $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('AuthDisplayHierarchy','0','Display authority hierarchies','','YesNo')");
+    print "Upgrade to $DBversion done (Add system preference AuthDisplayHierarchy)\n";
+    SetVersion($DBversion);
+}
+
+
+$DBversion = "3.09.00.057";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+    $dbh->do("ALTER TABLE aqbasket ADD deliveryplace VARCHAR(10) default NULL AFTER basketgroupid;");
+    $dbh->do("ALTER TABLE aqbasket ADD billingplace VARCHAR(10) default NULL AFTER deliveryplace;");
+    print "Upgrade to $DBversion done (Bug 5356: Added billingplace, deliveryplace to the aqbasket table)\n";
+    SetVersion($DBversion);
+}
+
+$DBversion ="3.09.00.058";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,type) VALUES('OPACdidyoumean',NULL,'Did you mean? configuration for the OPAC. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free');");
+    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,type) VALUES('INTRAdidyoumean',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free');");
+    print "Upgrade to $DBversion done (Add Did You Mean? configuration)\n";
+    SetVersion($DBversion);
+}
+
+$DBversion ="3.09.00.059";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+    $dbh->do("INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('BlockReturnOfWithdrawnItems', '1', '0', 'If enabled, items that are marked as withdrawn cannot be returned.', 'YesNo');");
+    print "Upgrade to $DBversion done (Add system preference BlockReturnOfWithdrawnItems)\n";
+    SetVersion($DBversion);
+}
+
+$DBversion = "3.09.00.060";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HoldsToPullStartDate','2','Set the default start date for the Holds to pull list to this many days ago',NULL,'Integer')");
+    print "Upgrade to $DBversion done (Added HoldsToPullStartDate syspref)\n";
+    SetVersion($DBversion);
+}
+
+$DBversion = "3.09.00.061";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("UPDATE systempreferences set value=0 WHERE variable='OPACItemsResultsDisplay' AND value='statuses'");
+    $dbh->do("UPDATE systempreferences set value=1 WHERE variable='OPACItemsResultsDisplay' AND value='itemdetails'");
+    $dbh->do("UPDATE systempreferences SET explanation='If No, show only the status of items in result list. If Yes, show full location of items (branchlocation+callnumber) as in staff interface',options=NULL,type='YesNo' WHERE variable='OPACItemsResultsDisplay'");
+    print "Upgrade to $DBversion done (Fixes Bug 5409, Set the syspref value to 1 if it is itemdetails and 0 if it is statuses, leaving it alone if it is already 1 or 0 and change the type of the syspref to YesNo.)\n";
+    SetVersion ($DBversion);
+}
+
+$DBversion = "3.09.00.062";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+   $dbh->do("UPDATE systempreferences SET value=0 WHERE variable='NoZebra'");
+   $dbh->do("UPDATE systempreferences SET value=0 WHERE variable='QueryRemoveStopwords'");
+   print "Upgrade to $DBversion done (Disable obsolete NoZebra and QueryRemoveStopwords sysprefs)\n";
+   SetVersion ($DBversion);
+}
+
+$DBversion = "3.09.00.063";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    my $gst_booksellers = $dbh->selectcol_arrayref("SELECT DISTINCT(gstrate) FROM aqbooksellers");
+    my $gist_syspref = C4::Context->preference("gist");
+    # remove the undef values and construct and array with the syspref and the supplier values
+    my @gstrates = map { defined $_ ? $_ : () } @$gst_booksellers;
+    push @gstrates, split ('\|', $gist_syspref);
+    # we want to compare integer (or float)
+    $_ = $_ + 0 for @gstrates;
+    use List::MoreUtils qw/uniq/;
+    # remove duplicate values
+    @gstrates = uniq sort @gstrates;
+    my $new_syspref_value = join '|', @gstrates;
+    # update the syspref with the new values
+    my $sth = $dbh->prepare("UPDATE systempreferences set value=? WHERE variable='gist'");
+    $sth->execute( $new_syspref_value );
+
+    print "Upgrade to $DBversion done (Bug 8832, Set the syspref gist with the existing values)\n";
+    SetVersion ($DBversion);
+}
+
+$DBversion = "3.09.00.064";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+   $dbh->do('ALTER TABLE items ADD coded_location_qualifier varchar(10) default NULL AFTER itemcallnumber');
+   print "Upgrade to $DBversion done (Bug 6428: Added coded_location_qualifier to the items table)\n";
+   SetVersion ($DBversion);
+}
+
+$DBversion = "3.09.00.065";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+   $dbh->do('ALTER TABLE deleteditems ADD coded_location_qualifier varchar(10) default NULL AFTER itemcallnumber');
+   print "Upgrade to $DBversion done (Bug 6428: Added coded_location_qualifier to the deleteditems table)\n";
+   SetVersion ($DBversion);
+}
+
+$DBversion = "3.09.00.066";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+   $dbh->do("DELETE FROM systempreferences WHERE variable='DidYouMeanFromAuthorities'");
+   print "Upgrade to $DBversion done (Bug 9107: remove DidYouMeanFromAuthorities syspref)\n";
+   SetVersion ($DBversion);
+}
+
+$DBversion = "3.09.00.067";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+   $dbh->do("ALTER TABLE statistics CHANGE COLUMN ccode ccode varchar(10) NULL");
+   print "Upgrade to $DBversion done (Bug 9064: statistics.ccode potentially wrongly defined)\n";
+   SetVersion ($DBversion);
+}
+
+$DBversion = "3.10.00.00";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+   print "Upgrade to $DBversion done (release tag)\n";
+   SetVersion ($DBversion);
+}
+
+$DBversion = "3.11.00.001";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z','Alphabet that can be expanded into browse links, e.g. on Home > Patrons',NULL,'free')");
+    print "Upgrade to $DBversion done (Bug 2832 - Add alphabet syspref)\n";
+    SetVersion($DBversion);
+}
+
+$DBversion = "3.11.00.002";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do(q{
+        DELETE from aqorders_items where ordernumber NOT IN (SELECT ordernumber FROM aqorders);
+    });
+    $dbh->do(q{
+        ALTER TABLE aqorders_items
+        ADD CONSTRAINT aqorders_items_ibfk_1 FOREIGN KEY (ordernumber) REFERENCES aqorders (ordernumber)
+        ON DELETE CASCADE ON UPDATE CASCADE;
+    });
+    print "Upgrade to $DBversion done (Bug 9030: Add constraint on aqorders_items.ordernumber)\n";
+    SetVersion ($DBversion);
+}
+
+$DBversion = "3.11.00.003";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RefundLostItemFeeOnReturn', '1', 'If enabled, the lost item fee charged to a borrower will be refunded when the lost item is returned.', NULL, 'YesNo')");
+    print "Upgrade to $DBversion done (Bug 7189: Add system preference RefundLostItemFeeOnReturn)\n";
+    SetVersion($DBversion);
+}
+
+$DBversion = "3.11.00.004";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+    $dbh->do(qq{
+        ALTER TABLE subscription ADD COLUMN closed INT(1) NOT NULL DEFAULT 0 AFTER enddate;
+    });
+
+    print "Upgrade to $DBversion done (Bug 8782: Add field subscription.closed)\n";
+    SetVersion($DBversion);
+}
+
 =head1 FUNCTIONS
 
 =head2 TableExists($table)
diff --git a/koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.jstree.js b/koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.jstree.js
new file mode 100644 (file)
index 0000000..c94e61f
--- /dev/null
@@ -0,0 +1,4551 @@
+/*
+ * jsTree 1.0-rc3
+ * http://jstree.com/
+ *
+ * Copyright (c) 2010 Ivan Bozhanov (vakata.com)
+ *
+ * Licensed same as jquery - under the terms of either the MIT License or the GPL Version 2 License
+ *   http://www.opensource.org/licenses/mit-license.php
+ *   http://www.gnu.org/licenses/gpl.html
+ *
+ * $Date: 2011-02-09 01:17:14 +0200 (ср, 09 февр 2011) $
+ * $Revision: 236 $
+ */
+
+/*jslint browser: true, onevar: true, undef: true, bitwise: true, strict: true */
+/*global window : false, clearInterval: false, clearTimeout: false, document: false, setInterval: false, setTimeout: false, jQuery: false, navigator: false, XSLTProcessor: false, DOMParser: false, XMLSerializer: false*/
+
+"use strict";
+
+// top wrapper to prevent multiple inclusion (is this OK?)
+(function () { if(jQuery && jQuery.jstree) { return; }
+     var is_ie6 = false, is_ie7 = false, is_ff2 = false;
+
+/*
+ * jsTree core
+ */
+(function ($) {
+     // Common functions not related to jsTree
+      // decided to move them to a `vakata` "namespace"
+      $.vakata = {};
+ // CSS related functions
+       $.vakata.css = {
+               get_css : function(rule_name, delete_flag, sheet) {
+                    rule_name = rule_name.toLowerCase();
+                   var css_rules = sheet.cssRules || sheet.rules,
+                         j = 0;
+                 do {
+                           if(css_rules.length && j > css_rules.length + 5) { return false; }
+                             if(css_rules[j].selectorText && css_rules[j].selectorText.toLowerCase() == rule_name) {
+                                        if(delete_flag === true) {
+                                             if(sheet.removeRule) { sheet.removeRule(j); }
+                                          if(sheet.deleteRule) { sheet.deleteRule(j); }
+                                          return true;
+                                   }
+                                      else { return css_rules[j]; }
+                          }
+                      }
+                      while (css_rules[++j]);
+                        return false;
+          },
+             add_css : function(rule_name, sheet) {
+                 if($.jstree.css.get_css(rule_name, false, sheet)) { return false; }
+                    if(sheet.insertRule) { sheet.insertRule(rule_name + ' { }', 0); } else { sheet.addRule(rule_name, null, 0); }
+                  return $.vakata.css.get_css(rule_name);
+                },
+             remove_css : function(rule_name, sheet) {
+                      return $.vakata.css.get_css(rule_name, true, sheet);
+           },
+             add_sheet : function(opts) {
+                   var tmp = false, is_new = true;
+                        if(opts.str) {
+                         if(opts.title) { tmp = $("style[id='" + opts.title + "-stylesheet']")[0]; }
+                            if(tmp) { is_new = false; }
+                            else {
+                                 tmp = document.createElement("style");
+                                 tmp.setAttribute('type',"text/css");
+                                   if(opts.title) { tmp.setAttribute("id", opts.title + "-stylesheet"); }
+                         }
+                              if(tmp.styleSheet) {
+                                   if(is_new) {
+                                           document.getElementsByTagName("head")[0].appendChild(tmp);
+                                             tmp.styleSheet.cssText = opts.str;
+                                     }
+                                      else {
+                                         tmp.styleSheet.cssText = tmp.styleSheet.cssText + " " + opts.str;
+                                      }
+                              }
+                              else {
+                                 tmp.appendChild(document.createTextNode(opts.str));
+                                    document.getElementsByTagName("head")[0].appendChild(tmp);
+                             }
+                              return tmp.sheet || tmp.styleSheet;
+                    }
+                      if(opts.url) {
+                         if(document.createStyleSheet) {
+                                        try { tmp = document.createStyleSheet(opts.url); } catch (e) { }
+                               }
+                              else {
+                                 tmp                   = document.createElement('link');
+                                        tmp.rel                = 'stylesheet';
+                                       tmp.type        = 'text/css';
+                                 tmp.media     = "all";
+                                     tmp.href  = opts.url;
+                                   document.getElementsByTagName("head")[0].appendChild(tmp);
+                                     return tmp.styleSheet;
+                         }
+                      }
+              }
+      };
+
+    // private variables
+   var instances = [],                 // instance array (used by $.jstree.reference/create/focused)
+            focused_instance = -1,     // the index in the instance array of the currently focused instance
+            plugins = {},                      // list of included plugins
+            prepared_move = {};                // for the move_node function
+
+    // jQuery plugin wrapper (thanks to jquery UI widget function)
+ $.fn.jstree = function (settings) {
+            var isMethodCall = (typeof settings == 'string'), // is this a method call like $().jstree("open_node")
+                        args = Array.prototype.slice.call(arguments, 1),
+                       returnValue = this;
+
+           // if a method call execute the method on all selected instances
+               if(isMethodCall) {
+                     if(settings.substring(0, 1) == '_') { return returnValue; }
+                    this.each(function() {
+                         var instance = instances[$.data(this, "jstree_instance_id")],
+                                  methodValue = (instance && $.isFunction(instance[settings])) ? instance[settings].apply(instance, args) : instance;
+                                    if(typeof methodValue !== "undefined" && (settings.indexOf("is_") === 0 || (methodValue !== true && methodValue !== false))) { returnValue = methodValue; return false; }
+                      });
+            }
+              else {
+                 this.each(function() {
+                         // extend settings and allow for multiple hashes and $.data
+                            var instance_id = $.data(this, "jstree_instance_id"),
+                                  a = [],
+                                        b = settings ? $.extend({}, true, settings) : {},
+                                      c = $(this),
+                                   s = false,
+                                     t = [];
+                                a = a.concat(args);
+                            if(c.data("jstree")) { a.push(c.data("jstree")); }
+                             b = a.length ? $.extend.apply(null, [true, b].concat(a)) : b;
+
+                         // if an instance already exists, destroy it first
+                             if(typeof instance_id !== "undefined" && instances[instance_id]) { instances[instance_id].destroy(); }
+                         // push a new empty object to the instances array
+                              instance_id = parseInt(instances.push({}),10) - 1;
+                             // store the jstree instance id to the container element
+                               $.data(this, "jstree_instance_id", instance_id);
+                               // clean up all plugins
+                                b.plugins = $.isArray(b.plugins) ? b.plugins : $.jstree.defaults.plugins.slice();
+                              b.plugins.unshift("core");
+                             // only unique plugins
+                         b.plugins = b.plugins.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");
+
+                                // extend defaults with passed data
+                            s = $.extend(true, {}, $.jstree.defaults, b);
+                          s.plugins = b.plugins;
+                         $.each(plugins, function (i, val) {
+                                    if($.inArray(i, s.plugins) === -1) { s[i] = null; delete s[i]; }
+                                       else { t.push(i); }
+                            });
+                            s.plugins = t;
+
+                                // push the new object to the instances array (at the same time set the default classes to the container) and init
+                             instances[instance_id] = new $.jstree._instance(instance_id, $(this).addClass("jstree jstree-" + instance_id), s);
+                             // init all activated plugins for this instance
+                                $.each(instances[instance_id]._get_settings().plugins, function (i, val) { instances[instance_id].data[val] = {}; });
+                          $.each(instances[instance_id]._get_settings().plugins, function (i, val) { if(plugins[val]) { plugins[val].__init.apply(instances[instance_id]); } });
+                         // initialize the instance
+                             setTimeout(function() { if(instances[instance_id]) { instances[instance_id].init(); } }, 0);
+                   });
+            }
+              // return the jquery selection (or if it was a method call that returned a value - the returned value)
+         return returnValue;
+    };
+     // object to store exposed functions and objects
+       $.jstree = {
+           defaults : {
+                   plugins : []
+           },
+             _focused : function () { return instances[focused_instance] || null; },
+                _reference : function (needle) {
+                       // get by instance id
+                  if(instances[needle]) { return instances[needle]; }
+                    // get by DOM (if still no luck - return null
+                  var o = $(needle);
+                     if(!o.length && typeof needle === "string") { o = $("#" + needle); }
+                   if(!o.length) { return null; }
+                 return instances[o.closest(".jstree").data("jstree_instance_id")] || null;
+             },
+             _instance : function (index, container, settings) {
+                    // for plugins to store data in
+                        this.data = { core : {} };
+                     this.get_settings = function () { return $.extend(true, {}, settings); };
+                      this._get_settings       = function () { return settings; };
+                 this.get_index                = function () { return index; };
+                       this.get_container      = function () { return container; };
+                        this.get_container_ul = function () { return container.children("ul:eq(0)"); };
+                        this._set_settings     = function (s) {
+                            settings = $.extend(true, {}, settings, s);
+                    };
+             },
+             _fn : { },
+             plugin : function (pname, pdata) {
+                     pdata = $.extend({}, {
+                         __init                : $.noop,
+                              __destroy        : $.noop,
+                            _fn                        : {},
+                            defaults   : false
+                       }, pdata);
+                     plugins[pname] = pdata;
+
+                       $.jstree.defaults[pname] = pdata.defaults;
+                     $.each(pdata._fn, function (i, val) {
+                          val.plugin           = pname;
+                           val.old                     = $.jstree._fn[i];
+                           $.jstree._fn[i] = function () {
+                                        var rslt,
+                                              func = val,
+                                            args = Array.prototype.slice.call(arguments),
+                                          evnt = new $.Event("before.jstree"),
+                                           rlbk = false;
+
+                                 if(this.data.core.locked === true && i !== "unlock" && i !== "is_locked") { return; }
+
+                                 // Check if function belongs to the included plugins of this instance
+                                  do {
+                                           if(func && func.plugin && $.inArray(func.plugin, this._get_settings().plugins) !== -1) { break; }
+                                              func = func.old;
+                                       } while(func);
+                                 if(!func) { return; }
+
+                                 // context and function to trigger events, then finally call the function
+                                      if(i.indexOf("_") === 0) {
+                                             rslt = func.apply(this, args);
+                                 }
+                                      else {
+                                         rslt = this.get_container().triggerHandler(evnt, { "func" : i, "inst" : this, "args" : args, "plugin" : func.plugin });
+                                                if(rslt === false) { return; }
+                                         if(typeof rslt !== "undefined") { args = rslt; }
+
+                                              rslt = func.apply(
+                                                     $.extend({}, this, {
+                                                           __callback : function (data) {
+                                                                 this.get_container().triggerHandler( i + '.jstree', { "inst" : this, "args" : args, "rslt" : data, "rlbk" : rlbk });
+                                                           },
+                                                             __rollback : function () {
+                                                                     rlbk = this.get_rollback();
+                                                                    return rlbk;
+                                                           },
+                                                             __call_old : function (replace_arguments) {
+                                                                    return func.old.apply(this, (replace_arguments ? Array.prototype.slice.call(arguments, 1) : args ) );
+                                                          }
+                                                      }), args);
+                                     }
+
+                                     // return the result
+                                   return rslt;
+                           };
+                             $.jstree._fn[i].old = val.old;
+                         $.jstree._fn[i].plugin = pname;
+                        });
+            },
+             rollback : function (rb) {
+                     if(rb) {
+                               if(!$.isArray(rb)) { rb = [ rb ]; }
+                            $.each(rb, function (i, val) {
+                                 instances[val.i].set_rollback(val.h, val.d);
+                           });
+                    }
+              }
+      };
+     // set the prototype for all instances
+ $.jstree._fn = $.jstree._instance.prototype = {};
+
+     // load the css when DOM is ready
+      $(function() {
+         // code is copied from jQuery ($.browser is deprecated + there is a bug in IE)
+         var u = navigator.userAgent.toLowerCase(),
+                     v = (u.match( /.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
+                     css_string = '' +
+                              '.jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; } ' +
+                          '.jstree li { display:block; min-height:18px; line-height:18px; white-space:nowrap; margin-left:18px; min-width:18px; } ' +
+                            '.jstree-rtl li { margin-left:0; margin-right:18px; } ' +
+                              '.jstree > ul > li { margin-left:0px; } ' +
+                            '.jstree-rtl > ul > li { margin-right:0px; } ' +
+                               '.jstree ins { display:inline-block; text-decoration:none; width:18px; height:18px; margin:0 0 0 0; padding:0; } ' +
+                           '.jstree a { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; text-decoration:none; padding:1px 2px; margin:0; } ' +
+                              '.jstree a:focus { outline: none; } ' +
+                                '.jstree a > ins { height:16px; width:16px; } ' +
+                              '.jstree a > .jstree-icon { margin-right:3px; } ' +
+                            '.jstree-rtl a > .jstree-icon { margin-left:3px; margin-right:0; } ' +
+                         'li.jstree-open > ul { display:block; } ' +
+                            'li.jstree-closed > ul { display:none; } ';
+            // Correct IE 6 (does not support the > CSS selector)
+          if(/msie/.test(u) && parseInt(v, 10) == 6) {
+                   is_ie6 = true;
+
+                        // fix image flicker and lack of caching
+                       try {
+                          document.execCommand("BackgroundImageCache", false, true);
+                     } catch (err) { }
+
+                     css_string += '' +
+                             '.jstree li { height:18px; margin-left:0; margin-right:0; } ' +
+                                '.jstree li li { margin-left:18px; } ' +
+                               '.jstree-rtl li li { margin-left:0px; margin-right:18px; } ' +
+                         'li.jstree-open ul { display:block; } ' +
+                              'li.jstree-closed ul { display:none !important; } ' +
+                          '.jstree li a { display:inline; border-width:0 !important; padding:0px 2px !important; } ' +
+                           '.jstree li a ins { height:16px; width:16px; margin-right:3px; } ' +
+                           '.jstree-rtl li a ins { margin-right:0px; margin-left:3px; } ';
+                }
+              // Correct IE 7 (shifts anchor nodes onhover)
+          if(/msie/.test(u) && parseInt(v, 10) == 7) {
+                   is_ie7 = true;
+                 css_string += '.jstree li a { border-width:0 !important; padding:0px 2px !important; } ';
+              }
+              // correct ff2 lack of display:inline-block
+            if(!/compatible/.test(u) && /mozilla/.test(u) && parseFloat(v, 10) < 1.9) {
+                    is_ff2 = true;
+                 css_string += '' +
+                             '.jstree ins { display:-moz-inline-box; } ' +
+                          '.jstree li { line-height:12px; } ' + // WHY??
+                         '.jstree a { display:-moz-inline-box; } ' +
+                            '.jstree .jstree-no-icons .jstree-checkbox { display:-moz-inline-stack !important; } ';
+                                /* this shouldn't be here as it is theme specific */
+           }
+              // the default stylesheet
+              $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
+        });
+
+   // core functions (open, close, create, update, delete)
+        $.jstree.plugin("core", {
+              __init : function () {
+                 this.data.core.locked = false;
+                 this.data.core.to_open = this.get_settings().core.initially_open;
+                      this.data.core.to_load = this.get_settings().core.initially_load;
+              },
+             defaults : {
+                   html_titles : false,
+                   animation   : 500,
+                       initially_open : [],
+                   initially_load : [],
+                   open_parents : true,
+                   notify_plugins : true,
+                 rtl                   : false,
+                 load_open     : false,
+                     strings           : {
+                           loading             : "Loading ...",
+                              new_node : "New node",
+                         multiple_selection : "Multiple selection"
+                      }
+              },
+             _fn : {
+                        init   : function () {
+                           this.set_focus();
+                              if(this._get_settings().core.rtl) {
+                                    this.get_container().addClass("jstree-rtl").css("direction", "rtl");
+                           }
+                              this.get_container().html("<ul><li class='jstree-last jstree-leaf'><ins>&#160;</ins><a class='jstree-loading' href='#'><ins class='jstree-icon'>&#160;</ins>" + this._get_string("loading") + "</a></li></ul>");
+                               this.data.core.li_height = this.get_container_ul().find("li.jstree-closed, li.jstree-leaf").eq(0).height() || 18;
+
+                             this.get_container()
+                                   .delegate("li > ins", "click.jstree", $.proxy(function (event) {
+                                                       var trgt = $(event.target);
+                                                    // if(trgt.is("ins") && event.pageY - trgt.offset().top < this.data.core.li_height) { this.toggle_node(trgt); }
+                                                        this.toggle_node(trgt);
+                                                }, this))
+                                      .bind("mousedown.jstree", $.proxy(function () {
+                                                        this.set_focus(); // This used to be setTimeout(set_focus,0) - why?
+                                            }, this))
+                                      .bind("dblclick.jstree", function (event) {
+                                            var sel;
+                                               if(document.selection && document.selection.empty) { document.selection.empty(); }
+                                             else {
+                                                 if(window.getSelection) {
+                                                              sel = window.getSelection();
+                                                           try {
+                                                                  sel.removeAllRanges();
+                                                                 sel.collapse();
+                                                                } catch (err) { }
+                                                      }
+                                              }
+                                      });
+                            if(this._get_settings().core.notify_plugins) {
+                                 this.get_container()
+                                           .bind("load_node.jstree", $.proxy(function (e, data) {
+                                                         var o = this._get_node(data.rslt.obj),
+                                                                 t = this;
+                                                              if(o === -1) { o = this.get_container_ul(); }
+                                                          if(!o.length) { return; }
+                                                              o.find("li").each(function () {
+                                                                        var th = $(this);
+                                                                      if(th.data("jstree")) {
+                                                                                $.each(th.data("jstree"), function (plugin, values) {
+                                                                                  if(t.data[plugin] && $.isFunction(t["_" + plugin + "_notify"])) {
+                                                                                              t["_" + plugin + "_notify"].call(t, th, values);
+                                                                                       }
+                                                                              });
+                                                                    }
+                                                              });
+                                                    }, this));
+                             }
+                              if(this._get_settings().core.load_open) {
+                                      this.get_container()
+                                           .bind("load_node.jstree", $.proxy(function (e, data) {
+                                                         var o = this._get_node(data.rslt.obj),
+                                                                 t = this;
+                                                              if(o === -1) { o = this.get_container_ul(); }
+                                                          if(!o.length) { return; }
+                                                              o.find("li.jstree-open:not(:has(ul))").each(function () {
+                                                                      t.load_node(this, $.noop, $.noop);
+                                                             });
+                                                    }, this));
+                             }
+                              this.__callback();
+                             this.load_node(-1, function () { this.loaded(); this.reload_nodes(); });
+                       },
+                     destroy   : function () {
+                                var i,
+                                 n = this.get_index(),
+                                  s = this._get_settings(),
+                                      _this = this;
+
+                         $.each(s.plugins, function (i, val) {
+                                  try { plugins[val].__destroy.apply(_this); } catch(err) { }
+                            });
+                            this.__callback();
+                             // set focus to another instance if this one is focused
+                                if(this.is_focused()) {
+                                        for(i in instances) {
+                                          if(instances.hasOwnProperty(i) && i != n) {
+                                                    instances[i].set_focus();
+                                                      break;
+                                         }
+                                      }
+                              }
+                              // if no other instance found
+                          if(n === focused_instance) { focused_instance = -1; }
+                          // remove all traces of jstree in the DOM (only the ones set using jstree*) and cleans all events
+                              this.get_container()
+                                   .unbind(".jstree")
+                                     .undelegate(".jstree")
+                                 .removeData("jstree_instance_id")
+                                      .find("[class^='jstree']")
+                                             .andSelf()
+                                             .attr("class", function () { return this.className.replace(/jstree[^ ]*|$/ig,''); });
+                          $(document)
+                                    .unbind(".jstree-" + n)
+                                        .undelegate(".jstree-" + n);
+                           // remove the actual data
+                              instances[n] = null;
+                           delete instances[n];
+                   },
+
+                    _core_notify : function (n, data) {
+                            if(data.opened) {
+                                      this.open_node(n, false, true);
+                                }
+                      },
+
+                    lock : function () {
+                           this.data.core.locked = true;
+                          this.get_container().children("ul").addClass("jstree-locked").css("opacity","0.7");
+                            this.__callback({});
+                   },
+                     unlock : function () {
+                         this.data.core.locked = false;
+                         this.get_container().children("ul").removeClass("jstree-locked").css("opacity","1");
+                           this.__callback({});
+                   },
+                     is_locked : function () { return this.data.core.locked; },
+                     save_opened : function () {
+                            var _this = this;
+                              this.data.core.to_open = [];
+                           this.get_container_ul().find("li.jstree-open").each(function () {
+                                      if(this.id) { _this.data.core.to_open.push("#" + this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")); }
+                             });
+                            this.__callback(_this.data.core.to_open);
+                      },
+                     save_loaded : function () { },
+                 reload_nodes : function (is_callback) {
+                                var _this = this,
+                                      done = true,
+                                   current = [],
+                                  remaining = [];
+                                if(!is_callback) {
+                                     this.data.core.reopen = false;
+                                 this.data.core.refreshing = true;
+                                      this.data.core.to_open = $.map($.makeArray(this.data.core.to_open), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
+                                   this.data.core.to_load = $.map($.makeArray(this.data.core.to_load), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
+                                   if(this.data.core.to_open.length) {
+                                            this.data.core.to_load = this.data.core.to_load.concat(this.data.core.to_open);
+                                        }
+                              }
+                              if(this.data.core.to_load.length) {
+                                    $.each(this.data.core.to_load, function (i, val) {
+                                             if(val == "#") { return true; }
+                                                if($(val).length) { current.push(val); }
+                                               else { remaining.push(val); }
+                                  });
+                                    if(current.length) {
+                                           this.data.core.to_load = remaining;
+                                            $.each(current, function (i, val) {
+                                                    if(!_this._is_loaded(val)) {
+                                                           _this.load_node(val, function () { _this.reload_nodes(true); }, function () { _this.reload_nodes(true); });
+                                                            done = false;
+                                                  }
+                                              });
+                                    }
+                              }
+                              if(this.data.core.to_open.length) {
+                                    $.each(this.data.core.to_open, function (i, val) {
+                                             _this.open_node(val, false, true);
+                                     });
+                            }
+                              if(done) {
+                                     // TODO: find a more elegant approach to syncronizing returning requests
+                                       if(this.data.core.reopen) { clearTimeout(this.data.core.reopen); }
+                                     this.data.core.reopen = setTimeout(function () { _this.__callback({}, _this); }, 50);
+                                  this.data.core.refreshing = false;
+                                     this.reopen();
+                         }
+                      },
+                     reopen : function () {
+                         var _this = this;
+                              if(this.data.core.to_open.length) {
+                                    $.each(this.data.core.to_open, function (i, val) {
+                                             _this.open_node(val, false, true);
+                                     });
+                            }
+                              this.__callback({});
+                   },
+                     refresh : function (obj) {
+                             var _this = this;
+                              this.save_opened();
+                            if(!obj) { obj = -1; }
+                         obj = this._get_node(obj);
+                             if(!obj) { obj = -1; }
+                         if(obj !== -1) { obj.children("UL").remove(); }
+                                else { this.get_container_ul().empty(); }
+                              this.load_node(obj, function () { _this.__callback({ "obj" : obj}); _this.reload_nodes(); });
+                  },
+                     // Dummy function to fire after the first load (so that there is a jstree.loaded event)
+                        loaded : function () {
+                         this.__callback();
+                     },
+                     // deal with focus
+                     set_focus : function () {
+                              if(this.is_focused()) { return; }
+                              var f = $.jstree._focused();
+                           if(f) { f.unset_focus(); }
+
+                            this.get_container().addClass("jstree-focused");
+                               focused_instance = this.get_index();
+                           this.__callback();
+                     },
+                     is_focused        : function () {
+                             return focused_instance == this.get_index();
+                   },
+                     unset_focus       : function () {
+                            if(this.is_focused()) {
+                                        this.get_container().removeClass("jstree-focused");
+                                    focused_instance = -1;
+                         }
+                              this.__callback();
+                     },
+
+                    // traverse
+                    _get_node          : function (obj) {
+                          var $obj = $(obj, this.get_container());
+                               if($obj.is(".jstree") || obj == -1) { return -1; }
+                             $obj = $obj.closest("li", this.get_container());
+                               return $obj.length ? $obj : false;
+                     },
+                     _get_next         : function (obj, strict) {
+                          obj = this._get_node(obj);
+                             if(obj === -1) { return this.get_container().find("> ul > li:first-child"); }
+                          if(!obj.length) { return false; }
+                              if(strict) { return (obj.nextAll("li").size() > 0) ? obj.nextAll("li:eq(0)") : false; }
+
+                               if(obj.hasClass("jstree-open")) { return obj.find("li:eq(0)"); }
+                               else if(obj.nextAll("li").size() > 0) { return obj.nextAll("li:eq(0)"); }
+                              else { return obj.parentsUntil(".jstree","li").next("li").eq(0); }
+                     },
+                     _get_prev         : function (obj, strict) {
+                          obj = this._get_node(obj);
+                             if(obj === -1) { return this.get_container().find("> ul > li:last-child"); }
+                           if(!obj.length) { return false; }
+                              if(strict) { return (obj.prevAll("li").length > 0) ? obj.prevAll("li:eq(0)") : false; }
+
+                               if(obj.prev("li").length) {
+                                    obj = obj.prev("li").eq(0);
+                                    while(obj.hasClass("jstree-open")) { obj = obj.children("ul:eq(0)").children("li:last"); }
+                                     return obj;
+                            }
+                              else { var o = obj.parentsUntil(".jstree","li:eq(0)"); return o.length ? o : false; }
+                  },
+                     _get_parent               : function (obj) {
+                                obj = this._get_node(obj);
+                             if(obj == -1 || !obj.length) { return false; }
+                         var o = obj.parentsUntil(".jstree", "li:eq(0)");
+                               return o.length ? o : -1;
+                      },
+                     _get_children     : function (obj) {
+                               obj = this._get_node(obj);
+                             if(obj === -1) { return this.get_container().children("ul:eq(0)").children("li"); }
+                            if(!obj.length) { return false; }
+                              return obj.children("ul:eq(0)").children("li");
+                        },
+                     get_path          : function (obj, id_mode) {
+                          var p = [],
+                                    _this = this;
+                          obj = this._get_node(obj);
+                             if(obj === -1 || !obj || !obj.length) { return false; }
+                                obj.parentsUntil(".jstree", "li").each(function () {
+                                   p.push( id_mode ? this.id : _this.get_text(this) );
+                            });
+                            p.reverse();
+                           p.push( id_mode ? obj.attr("id") : this.get_text(obj) );
+                               return p;
+                      },
+
+                    // string functions
+                    _get_string : function (key) {
+                         return this._get_settings().core.strings[key] || key;
+                  },
+
+                    is_open            : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-open"); },
+                     is_closed : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-closed"); },
+                  is_leaf              : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-leaf"); },
+                     correct_state     : function (obj) {
+                               obj = this._get_node(obj);
+                             if(!obj || obj === -1) { return false; }
+                               obj.removeClass("jstree-closed jstree-open").addClass("jstree-leaf").children("ul").remove();
+                          this.__callback({ "obj" : obj });
+                      },
+                     // open/close
+                  open_node    : function (obj, callback, skip_animation) {
+                         obj = this._get_node(obj);
+                             if(!obj.length) { return false; }
+                              if(!obj.hasClass("jstree-closed")) { if(callback) { callback.call(); } return false; }
+                         var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation,
+                                    t = this;
+                              if(!this._is_loaded(obj)) {
+                                    obj.children("a").addClass("jstree-loading");
+                                  this.load_node(obj, function () { t.open_node(obj, callback, skip_animation); }, callback);
+                            }
+                              else {
+                                 if(this._get_settings().core.open_parents) {
+                                           obj.parentsUntil(".jstree",".jstree-closed").each(function () {
+                                                        t.open_node(this, false, true);
+                                                });
+                                    }
+                                      if(s) { obj.children("ul").css("display","none"); }
+                                    obj.removeClass("jstree-closed").addClass("jstree-open").children("a").removeClass("jstree-loading");
+                                  if(s) { obj.children("ul").stop(true, true).slideDown(s, function () { this.style.display = ""; t.after_open(obj); }); }
+                                       else { t.after_open(obj); }
+                                    this.__callback({ "obj" : obj });
+                                      if(callback) { callback.call(); }
+                              }
+                      },
+                     after_open        : function (obj) { this.__callback({ "obj" : obj }); },
+                     close_node        : function (obj, skip_animation) {
+                          obj = this._get_node(obj);
+                             var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation,
+                                    t = this;
+                              if(!obj.length || !obj.hasClass("jstree-open")) { return false; }
+                              if(s) { obj.children("ul").attr("style","display:block !important"); }
+                         obj.removeClass("jstree-open").addClass("jstree-closed");
+                              if(s) { obj.children("ul").stop(true, true).slideUp(s, function () { this.style.display = ""; t.after_close(obj); }); }
+                                else { t.after_close(obj); }
+                           this.__callback({ "obj" : obj });
+                      },
+                     after_close       : function (obj) { this.__callback({ "obj" : obj }); },
+                    toggle_node        : function (obj) {
+                         obj = this._get_node(obj);
+                             if(obj.hasClass("jstree-closed")) { return this.open_node(obj); }
+                              if(obj.hasClass("jstree-open")) { return this.close_node(obj); }
+                       },
+                     open_all  : function (obj, do_animation, original_obj) {
+                                obj = obj ? this._get_node(obj) : -1;
+                          if(!obj || obj === -1) { obj = this.get_container_ul(); }
+                              if(original_obj) {
+                                     obj = obj.find("li.jstree-closed");
+                            }
+                              else {
+                                 original_obj = obj;
+                                    if(obj.is(".jstree-closed")) { obj = obj.find("li.jstree-closed").andSelf(); }
+                                 else { obj = obj.find("li.jstree-closed"); }
+                           }
+                              var _this = this;
+                              obj.each(function () {
+                                 var __this = this;
+                                     if(!_this._is_loaded(this)) { _this.open_node(this, function() { _this.open_all(__this, do_animation, original_obj); }, !do_animation); }
+                                      else { _this.open_node(this, false, !do_animation); }
+                          });
+                            // so that callback is fired AFTER all nodes are open
+                          if(original_obj.find('li.jstree-closed').length === 0) { this.__callback({ "obj" : original_obj }); }
+                  },
+                     close_all : function (obj, do_animation) {
+                             var _this = this;
+                              obj = obj ? this._get_node(obj) : this.get_container();
+                                if(!obj || obj === -1) { obj = this.get_container_ul(); }
+                              obj.find("li.jstree-open").andSelf().each(function () { _this.close_node(this, !do_animation); });
+                             this.__callback({ "obj" : obj });
+                      },
+                     clean_node        : function (obj) {
+                          obj = obj && obj != -1 ? $(obj) : this.get_container_ul();
+                             obj = obj.is("li") ? obj.find("li").andSelf() : obj.find("li");
+                                obj.removeClass("jstree-last")
+                                 .filter("li:last-child").addClass("jstree-last").end()
+                                 .filter(":has(li)")
+                                            .not(".jstree-open").removeClass("jstree-leaf").addClass("jstree-closed");
+                             obj.not(".jstree-open, .jstree-closed").addClass("jstree-leaf").children("ul").remove();
+                               this.__callback({ "obj" : obj });
+                      },
+                     // rollback
+                    get_rollback : function () {
+                           this.__callback();
+                             return { i : this.get_index(), h : this.get_container().children("ul").clone(true), d : this.data };
+                   },
+                     set_rollback : function (html, data) {
+                         this.get_container().empty().append(html);
+                             this.data = data;
+                              this.__callback();
+                     },
+                     // Dummy functions to be overwritten by any datastore plugin included
+                  load_node    : function (obj, s_call, e_call) { this.__callback({ "obj" : obj }); },
+                      _is_loaded       : function (obj) { return true; },
+
+                 // Basic operations: create
+                    create_node        : function (obj, position, js, callback, is_loaded) {
+                              obj = this._get_node(obj);
+                             position = typeof position === "undefined" ? "last" : position;
+                                var d = $("<li />"),
+                                   s = this._get_settings().core,
+                                 tmp;
+
+                          if(obj !== -1 && !obj.length) { return false; }
+                                if(!is_loaded && !this._is_loaded(obj)) { this.load_node(obj, function () { this.create_node(obj, position, js, callback, true); }); return false; }
+
+                          this.__rollback();
+
+                            if(typeof js === "string") { js = { "data" : js }; }
+                           if(!js) { js = {}; }
+                           if(js.attr) { d.attr(js.attr); }
+                               if(js.metadata) { d.data(js.metadata); }
+                               if(js.state) { d.addClass("jstree-" + js.state); }
+                             if(!js.data) { js.data = this._get_string("new_node"); }
+                               if(!$.isArray(js.data)) { tmp = js.data; js.data = []; js.data.push(tmp); }
+                            $.each(js.data, function (i, m) {
+                                      tmp = $("<a />");
+                                      if($.isFunction(m)) { m = m.call(this, js); }
+                                  if(typeof m == "string") { tmp.attr('href','#')[ s.html_titles ? "html" : "text" ](m); }
+                                       else {
+                                         if(!m.attr) { m.attr = {}; }
+                                           if(!m.attr.href) { m.attr.href = '#'; }
+                                                tmp.attr(m.attr)[ s.html_titles ? "html" : "text" ](m.title);
+                                          if(m.language) { tmp.addClass(m.language); }
+                                   }
+                                      tmp.prepend("<ins class='jstree-icon'>&#160;</ins>");
+                                  if(!m.icon && js.icon) { m.icon = js.icon; }
+                                   if(m.icon) {
+                                           if(m.icon.indexOf("/") === -1) { tmp.children("ins").addClass(m.icon); }
+                                               else { tmp.children("ins").css("background","url('" + m.icon + "') center center no-repeat"); }
+                                        }
+                                      d.append(tmp);
+                         });
+                            d.prepend("<ins class='jstree-icon'>&#160;</ins>");
+                            if(obj === -1) {
+                                       obj = this.get_container();
+                                    if(position === "before") { position = "first"; }
+                                      if(position === "after") { position = "last"; }
+                                }
+                              switch(position) {
+                                     case "before": obj.before(d); tmp = this._get_parent(obj); break;
+                                      case "after" : obj.after(d);  tmp = this._get_parent(obj); break;
+                                      case "inside":
+                                 case "first" :
+                                         if(!obj.children("ul").length) { obj.append("<ul />"); }
+                                               obj.children("ul").prepend(d);
+                                         tmp = obj;
+                                             break;
+                                 case "last":
+                                           if(!obj.children("ul").length) { obj.append("<ul />"); }
+                                               obj.children("ul").append(d);
+                                          tmp = obj;
+                                             break;
+                                 default:
+                                               if(!obj.children("ul").length) { obj.append("<ul />"); }
+                                               if(!position) { position = 0; }
+                                                tmp = obj.children("ul").children("li").eq(position);
+                                          if(tmp.length) { tmp.before(d); }
+                                              else { obj.children("ul").append(d); }
+                                         tmp = obj;
+                                             break;
+                         }
+                              if(tmp === -1 || tmp.get(0) === this.get_container().get(0)) { tmp = -1; }
+                             this.clean_node(tmp);
+                          this.__callback({ "obj" : d, "parent" : tmp });
+                                if(callback) { callback.call(this, d); }
+                               return d;
+                      },
+                     // Basic operations: rename (deal with text)
+                   get_text    : function (obj) {
+                            obj = this._get_node(obj);
+                             if(!obj.length) { return false; }
+                              var s = this._get_settings().core.html_titles;
+                         obj = obj.children("a:eq(0)");
+                         if(s) {
+                                        obj = obj.clone();
+                                     obj.children("INS").remove();
+                                  return obj.html();
+                             }
+                              else {
+                                 obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
+                                     return obj.nodeValue;
+                          }
+                      },
+                     set_text  : function (obj, val) {
+                               obj = this._get_node(obj);
+                             if(!obj.length) { return false; }
+                              obj = obj.children("a:eq(0)");
+                         if(this._get_settings().core.html_titles) {
+                                    var tmp = obj.children("INS").clone();
+                                 obj.html(val).prepend(tmp);
+                                    this.__callback({ "obj" : obj, "name" : val });
+                                        return true;
+                           }
+                              else {
+                                 obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
+                                     this.__callback({ "obj" : obj, "name" : val });
+                                        return (obj.nodeValue = val);
+                          }
+                      },
+                     rename_node : function (obj, val) {
+                            obj = this._get_node(obj);
+                             this.__rollback();
+                             if(obj && obj.length && this.set_text.apply(this, Array.prototype.slice.call(arguments))) { this.__callback({ "obj" : obj, "name" : val }); }
+                  },
+                     // Basic operations: deleting nodes
+                    delete_node : function (obj) {
+                         obj = this._get_node(obj);
+                             if(!obj.length) { return false; }
+                              this.__rollback();
+                             var p = this._get_parent(obj), prev = $([]), t = this;
+                         obj.each(function () {
+                                 prev = prev.add(t._get_prev(this));
+                            });
+                            obj = obj.detach();
+                            if(p !== -1 && p.find("> ul > li").length === 0) {
+                                     p.removeClass("jstree-open jstree-closed").addClass("jstree-leaf");
+                            }
+                              this.clean_node(p);
+                            this.__callback({ "obj" : obj, "prev" : prev, "parent" : p });
+                         return obj;
+                    },
+                     prepare_move : function (o, r, pos, cb, is_cb) {
+                               var p = {};
+
+                           p.ot = $.jstree._reference(o) || this;
+                         p.o = p.ot._get_node(o);
+                               p.r = r === - 1 ? -1 : this._get_node(r);
+                              p.p = (typeof pos === "undefined" || pos === false) ? "last" : pos; // TODO: move to a setting
+                         if(!is_cb && prepared_move.o && prepared_move.o[0] === p.o[0] && prepared_move.r[0] === p.r[0] && prepared_move.p === p.p) {
+                                   this.__callback(prepared_move);
+                                        if(cb) { cb.call(this, prepared_move); }
+                                       return;
+                                }
+                              p.ot = $.jstree._reference(p.o) || this;
+                               p.rt = $.jstree._reference(p.r) || this; // r === -1 ? p.ot : $.jstree._reference(p.r) || this
+                         if(p.r === -1 || !p.r) {
+                                       p.cr = -1;
+                                     switch(p.p) {
+                                          case "first":
+                                          case "before":
+                                         case "inside":
+                                                 p.cp = 0;
+                                                      break;
+                                         case "after":
+                                          case "last":
+                                                   p.cp = p.rt.get_container().find(" > ul > li").length;
+                                                 break;
+                                         default:
+                                                       p.cp = p.p;
+                                                    break;
+                                 }
+                              }
+                              else {
+                                 if(!/^(before|after)$/.test(p.p) && !this._is_loaded(p.r)) {
+                                           return this.load_node(p.r, function () { this.prepare_move(o, r, pos, cb, true); });
+                                   }
+                                      switch(p.p) {
+                                          case "before":
+                                                 p.cp = p.r.index();
+                                                    p.cr = p.rt._get_parent(p.r);
+                                                  break;
+                                         case "after":
+                                                  p.cp = p.r.index() + 1;
+                                                        p.cr = p.rt._get_parent(p.r);
+                                                  break;
+                                         case "inside":
+                                         case "first":
+                                                  p.cp = 0;
+                                                      p.cr = p.r;
+                                                    break;
+                                         case "last":
+                                                   p.cp = p.r.find(" > ul > li").length;
+                                                  p.cr = p.r;
+                                                    break;
+                                         default:
+                                                       p.cp = p.p;
+                                                    p.cr = p.r;
+                                                    break;
+                                 }
+                              }
+                              p.np = p.cr == -1 ? p.rt.get_container() : p.cr;
+                               p.op = p.ot._get_parent(p.o);
+                          p.cop = p.o.index();
+                           if(p.op === -1) { p.op = p.ot ? p.ot.get_container() : this.get_container(); }
+                         if(!/^(before|after)$/.test(p.p) && p.op && p.np && p.op[0] === p.np[0] && p.o.index() < p.cp) { p.cp++; }
+                             //if(p.p === "before" && p.op && p.np && p.op[0] === p.np[0] && p.o.index() < p.cp) { p.cp--; }
+                                p.or = p.np.find(" > ul > li:nth-child(" + (p.cp + 1) + ")");
+                          prepared_move = p;
+                             this.__callback(prepared_move);
+                                if(cb) { cb.call(this, prepared_move); }
+                       },
+                     check_move : function () {
+                             var obj = prepared_move, ret = true, r = obj.r === -1 ? this.get_container() : obj.r;
+                          if(!obj || !obj.o || obj.or[0] === obj.o[0]) { return false; }
+                         if(obj.op && obj.np && obj.op[0] === obj.np[0] && obj.cp - 1 === obj.o.index()) { return false; }
+                              obj.o.each(function () {
+                                       if(r.parentsUntil(".jstree", "li").andSelf().index(this) !== -1) { ret = false; return false; }
+                                });
+                            return ret;
+                    },
+                     move_node : function (obj, ref, position, is_copy, is_prepared, skip_check) {
+                          if(!is_prepared) {
+                                     return this.prepare_move(obj, ref, position, function (p) {
+                                            this.move_node(p, false, false, is_copy, true, skip_check);
+                                    });
+                            }
+                              if(is_copy) {
+                                  prepared_move.cy = true;
+                               }
+                              if(!skip_check && !this.check_move()) { return false; }
+
+                               this.__rollback();
+                             var o = false;
+                         if(is_copy) {
+                                  o = obj.o.clone(true);
+                                 o.find("*[id]").andSelf().each(function () {
+                                           if(this.id) { this.id = "copy_" + this.id; }
+                                   });
+                            }
+                              else { o = obj.o; }
+
+                           if(obj.or.length) { obj.or.before(o); }
+                                else {
+                                 if(!obj.np.children("ul").length) { $("<ul />").appendTo(obj.np); }
+                                    obj.np.children("ul:eq(0)").append(o);
+                         }
+
+                             try {
+                                  obj.ot.clean_node(obj.op);
+                                     obj.rt.clean_node(obj.np);
+                                     if(!obj.op.find("> ul > li").length) {
+                                         obj.op.removeClass("jstree-open jstree-closed").addClass("jstree-leaf").children("ul").remove();
+                                       }
+                              } catch (e) { }
+
+                               if(is_copy) {
+                                  prepared_move.cy = true;
+                                       prepared_move.oc = o;
+                          }
+                              this.__callback(prepared_move);
+                                return prepared_move;
+                  },
+                     _get_move : function () { return prepared_move; }
+              }
+      });
+})(jQuery);
+//*/
+
+/*
+ * jsTree ui plugin
+ * This plugins handles selecting/deselecting/hovering/dehovering nodes
+ */
+(function ($) {
+       var scrollbar_width, e1, e2;
+   $(function() {
+         if (/msie/.test(navigator.userAgent.toLowerCase())) {
+                  e1 = $('<textarea cols="10" rows="2"></textarea>').css({ position: 'absolute', top: -1000, left: 0 }).appendTo('body');
+                        e2 = $('<textarea cols="10" rows="2" style="overflow: hidden;"></textarea>').css({ position: 'absolute', top: -1000, left: 0 }).appendTo('body');
+                      scrollbar_width = e1.width() - e2.width();
+                     e1.add(e2).remove();
+           }
+              else {
+                 e1 = $('<div />').css({ width: 100, height: 100, overflow: 'auto', position: 'absolute', top: -1000, left: 0 })
+                                        .prependTo('body').append('<div />').find('div').css({ width: '100%', height: 200 });
+                  scrollbar_width = 100 - e1.width();
+                    e1.parent().remove();
+          }
+      });
+    $.jstree.plugin("ui", {
+                __init : function () {
+                 this.data.ui.selected = $();
+                   this.data.ui.last_selected = false;
+                    this.data.ui.hovered = null;
+                   this.data.ui.to_select = this.get_settings().ui.initially_select;
+
+                     this.get_container()
+                           .delegate("a", "click.jstree", $.proxy(function (event) {
+                                              event.preventDefault();
+                                                event.currentTarget.blur();
+                                            if(!$(event.currentTarget).hasClass("jstree-loading")) {
+                                                       this.select_node(event.currentTarget, true, event);
+                                            }
+                                      }, this))
+                              .delegate("a", "mouseenter.jstree", $.proxy(function (event) {
+                                         if(!$(event.currentTarget).hasClass("jstree-loading")) {
+                                                       this.hover_node(event.target);
+                                         }
+                                      }, this))
+                              .delegate("a", "mouseleave.jstree", $.proxy(function (event) {
+                                         if(!$(event.currentTarget).hasClass("jstree-loading")) {
+                                                       this.dehover_node(event.target);
+                                               }
+                                      }, this))
+                              .bind("reopen.jstree", $.proxy(function () {
+                                           this.reselect();
+                                       }, this))
+                              .bind("get_rollback.jstree", $.proxy(function () {
+                                             this.dehover_node();
+                                           this.save_selected();
+                                  }, this))
+                              .bind("set_rollback.jstree", $.proxy(function () {
+                                             this.reselect();
+                                       }, this))
+                              .bind("close_node.jstree", $.proxy(function (event, data) {
+                                            var s = this._get_settings().ui,
+                                                       obj = this._get_node(data.rslt.obj),
+                                                   clk = (obj && obj.length) ? obj.children("ul").find("a.jstree-clicked") : $(),
+                                                 _this = this;
+                                          if(s.selected_parent_close === false || !clk.length) { return; }
+                                               clk.each(function () {
+                                                 _this.deselect_node(this);
+                                                     if(s.selected_parent_close === "select_parent") { _this.select_node(obj); }
+                                            });
+                                    }, this))
+                              .bind("delete_node.jstree", $.proxy(function (event, data) {
+                                           var s = this._get_settings().ui.select_prev_on_delete,
+                                                 obj = this._get_node(data.rslt.obj),
+                                                   clk = (obj && obj.length) ? obj.find("a.jstree-clicked") : [],
+                                                 _this = this;
+                                          clk.each(function () { _this.deselect_node(this); });
+                                          if(s && clk.length) {
+                                                  data.rslt.prev.each(function () {
+                                                              if(this.parentNode) { _this.select_node(this); return false; /* if return false is removed all prev nodes will be selected */}
+                                                 });
+                                            }
+                                      }, this))
+                              .bind("move_node.jstree", $.proxy(function (event, data) {
+                                             if(data.rslt.cy) {
+                                                     data.rslt.oc.find("a.jstree-clicked").removeClass("jstree-clicked");
+                                           }
+                                      }, this));
+             },
+             defaults : {
+                   select_limit : -1, // 0, 1, 2 ... or -1 for unlimited
+                  select_multiple_modifier : "ctrl", // on, or ctrl, shift, alt
+                  select_range_modifier : "shift",
+                       selected_parent_close : "select_parent", // false, "deselect", "select_parent"
+                 selected_parent_open : true,
+                   select_prev_on_delete : true,
+                  disable_selecting_children : false,
+                    initially_select : []
+          },
+             _fn : {
+                        _get_node : function (obj, allow_multiple) {
+                           if(typeof obj === "undefined" || obj === null) { return allow_multiple ? this.data.ui.selected : this.data.ui.last_selected; }
+                         var $obj = $(obj, this.get_container());
+                               if($obj.is(".jstree") || obj == -1) { return -1; }
+                             $obj = $obj.closest("li", this.get_container());
+                               return $obj.length ? $obj : false;
+                     },
+                     _ui_notify : function (n, data) {
+                              if(data.selected) {
+                                    this.select_node(n, false);
+                            }
+                      },
+                     save_selected : function () {
+                          var _this = this;
+                              this.data.ui.to_select = [];
+                           this.data.ui.selected.each(function () { if(this.id) { _this.data.ui.to_select.push("#" + this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")); } });
+                                this.__callback(this.data.ui.to_select);
+                       },
+                     reselect : function () {
+                               var _this = this,
+                                      s = this.data.ui.to_select;
+                            s = $.map($.makeArray(s), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
+                             // this.deselect_all(); WHY deselect, breaks plugin state notifier?
+                            $.each(s, function (i, val) { if(val && val !== "#") { _this.select_node(val); } });
+                           this.data.ui.selected = this.data.ui.selected.filter(function () { return this.parentNode; });
+                         this.__callback();
+                     },
+                     refresh : function (obj) {
+                             this.save_selected();
+                          return this.__call_old();
+                      },
+                     hover_node : function (obj) {
+                          obj = this._get_node(obj);
+                             if(!obj.length) { return false; }
+                              //if(this.data.ui.hovered && obj.get(0) === this.data.ui.hovered.get(0)) { return; }
+                           if(!obj.hasClass("jstree-hovered")) { this.dehover_node(); }
+                           this.data.ui.hovered = obj.children("a").addClass("jstree-hovered").parent();
+                          this._fix_scroll(obj);
+                         this.__callback({ "obj" : obj });
+                      },
+                     dehover_node : function () {
+                           var obj = this.data.ui.hovered, p;
+                             if(!obj || !obj.length) { return false; }
+                              p = obj.children("a").removeClass("jstree-hovered").parent();
+                          if(this.data.ui.hovered[0] === p[0]) { this.data.ui.hovered = null; }
+                          this.__callback({ "obj" : obj });
+                      },
+                     select_node : function (obj, check, e) {
+                               obj = this._get_node(obj);
+                             if(obj == -1 || !obj || !obj.length) { return false; }
+                         var s = this._get_settings().ui,
+                                       is_multiple = (s.select_multiple_modifier == "on" || (s.select_multiple_modifier !== false && e && e[s.select_multiple_modifier + "Key"])),
+                                    is_range = (s.select_range_modifier !== false && e && e[s.select_range_modifier + "Key"] && this.data.ui.last_selected && this.data.ui.last_selected[0] !== obj[0] && this.data.ui.last_selected.parent()[0] === obj.parent()[0]),
+                                     is_selected = this.is_selected(obj),
+                                   proceed = true,
+                                        t = this;
+                              if(check) {
+                                    if(s.disable_selecting_children && is_multiple &&
+                                              (
+                                                      (obj.parentsUntil(".jstree","li").children("a.jstree-clicked").length) ||
+                                                      (obj.children("ul").find("a.jstree-clicked:eq(0)").length)
+                                             )
+                                      ) {
+                                            return false;
+                                  }
+                                      proceed = false;
+                                       switch(!0) {
+                                           case (is_range):
+                                                       this.data.ui.last_selected.addClass("jstree-last-selected");
+                                                   obj = obj[ obj.index() < this.data.ui.last_selected.index() ? "nextUntil" : "prevUntil" ](".jstree-last-selected").andSelf();
+                                                  if(s.select_limit == -1 || obj.length < s.select_limit) {
+                                                              this.data.ui.last_selected.removeClass("jstree-last-selected");
+                                                                this.data.ui.selected.each(function () {
+                                                                       if(this !== t.data.ui.last_selected[0]) { t.deselect_node(this); }
+                                                             });
+                                                            is_selected = false;
+                                                           proceed = true;
+                                                        }
+                                                      else {
+                                                         proceed = false;
+                                                       }
+                                                      break;
+                                         case (is_selected && !is_multiple):
+                                                    this.deselect_all();
+                                                   is_selected = false;
+                                                   proceed = true;
+                                                        break;
+                                         case (!is_selected && !is_multiple):
+                                                   if(s.select_limit == -1 || s.select_limit > 0) {
+                                                               this.deselect_all();
+                                                           proceed = true;
+                                                        }
+                                                      break;
+                                         case (is_selected && is_multiple):
+                                                     this.deselect_node(obj);
+                                                       break;
+                                         case (!is_selected && is_multiple):
+                                                    if(s.select_limit == -1 || this.data.ui.selected.length + 1 <= s.select_limit) {
+                                                               proceed = true;
+                                                        }
+                                                      break;
+                                 }
+                              }
+                              if(proceed && !is_selected) {
+                                  if(!is_range) { this.data.ui.last_selected = obj; }
+                                    obj.children("a").addClass("jstree-clicked");
+                                  if(s.selected_parent_open) {
+                                           obj.parents(".jstree-closed").each(function () { t.open_node(this, false, true); });
+                                   }
+                                      this.data.ui.selected = this.data.ui.selected.add(obj);
+                                        this._fix_scroll(obj.eq(0));
+                                   this.__callback({ "obj" : obj, "e" : e });
+                             }
+                      },
+                     _fix_scroll : function (obj) {
+                         var c = this.get_container()[0], t;
+                            if(c.scrollHeight > c.offsetHeight) {
+                                  obj = this._get_node(obj);
+                                     if(!obj || obj === -1 || !obj.length || !obj.is(":visible")) { return; }
+                                       t = obj.offset().top - this.get_container().offset().top;
+                                      if(t < 0) {
+                                            c.scrollTop = c.scrollTop + t - 1;
+                                     }
+                                      if(t + this.data.core.li_height + (c.scrollWidth > c.offsetWidth ? scrollbar_width : 0) > c.offsetHeight) {
+                                            c.scrollTop = c.scrollTop + (t - c.offsetHeight + this.data.core.li_height + 1 + (c.scrollWidth > c.offsetWidth ? scrollbar_width : 0));
+                                       }
+                              }
+                      },
+                     deselect_node : function (obj) {
+                               obj = this._get_node(obj);
+                             if(!obj.length) { return false; }
+                              if(this.is_selected(obj)) {
+                                    obj.children("a").removeClass("jstree-clicked");
+                                       this.data.ui.selected = this.data.ui.selected.not(obj);
+                                        if(this.data.ui.last_selected.get(0) === obj.get(0)) { this.data.ui.last_selected = this.data.ui.selected.eq(0); }
+                                     this.__callback({ "obj" : obj });
+                              }
+                      },
+                     toggle_select : function (obj) {
+                               obj = this._get_node(obj);
+                             if(!obj.length) { return false; }
+                              if(this.is_selected(obj)) { this.deselect_node(obj); }
+                         else { this.select_node(obj); }
+                        },
+                     is_selected : function (obj) { return this.data.ui.selected.index(this._get_node(obj)) >= 0; },
+                        get_selected : function (context) {
+                            return context ? $(context).find("a.jstree-clicked").parent() : this.data.ui.selected;
+                 },
+                     deselect_all : function (context) {
+                            var ret = context ? $(context).find("a.jstree-clicked").parent() : this.get_container().find("a.jstree-clicked").parent();
+                             ret.children("a.jstree-clicked").removeClass("jstree-clicked");
+                                this.data.ui.selected = $([]);
+                         this.data.ui.last_selected = false;
+                            this.__callback({ "obj" : ret });
+                      }
+              }
+      });
+    // include the selection plugin by default
+     $.jstree.defaults.plugins.push("ui");
+})(jQuery);
+//*/
+
+/*
+ * jsTree CRRM plugin
+ * Handles creating/renaming/removing/moving nodes by user interaction.
+ */
+(function ($) {
+   $.jstree.plugin("crrm", {
+              __init : function () {
+                 this.get_container()
+                           .bind("move_node.jstree", $.proxy(function (e, data) {
+                                 if(this._get_settings().crrm.move.open_onmove) {
+                                               var t = this;
+                                          data.rslt.np.parentsUntil(".jstree").andSelf().filter(".jstree-closed").each(function () {
+                                                     t.open_node(this, false, true);
+                                                });
+                                    }
+                              }, this));
+             },
+             defaults : {
+                   input_width_limit : 200,
+                       move : {
+                               always_copy                     : false, // false, true or "multitree"
+                           open_onmove                 : true,
+                          default_position     : "last",
+                             check_move                        : function (m) { return true; }
+                   }
+              },
+             _fn : {
+                        _show_input : function (obj, callback) {
+                               obj = this._get_node(obj);
+                             var rtl = this._get_settings().core.rtl,
+                                       w = this._get_settings().crrm.input_width_limit,
+                                       w1 = obj.children("ins").width(),
+                                      w2 = obj.find("> a:visible > ins").width() * obj.find("> a:visible > ins").length,
+                                     t = this.get_text(obj),
+                                        h1 = $("<div />", { css : { "position" : "absolute", "top" : "-200px", "left" : (rtl ? "0px" : "-1000px"), "visibility" : "hidden" } }).appendTo("body"),
+                                      h2 = obj.css("position","relative").append(
+                                    $("<input />", {
+                                               "value" : t,
+                                           "class" : "jstree-rename-input",
+                                               // "size" : t.length,
+                                          "css" : {
+                                                      "padding" : "0",
+                                                       "border" : "1px solid silver",
+                                                 "position" : "absolute",
+                                                       "left"  : (rtl ? "auto" : (w1 + w2 + 4) + "px"),
+                                                       "right" : (rtl ? (w1 + w2 + 4) + "px" : "auto"),
+                                                       "top" : "0px",
+                                                 "height" : (this.data.core.li_height - 2) + "px",
+                                                      "lineHeight" : (this.data.core.li_height - 2) + "px",
+                                                  "width" : "150px" // will be set a bit further down
+                                            },
+                                             "blur" : $.proxy(function () {
+                                                 var i = obj.children(".jstree-rename-input"),
+                                                          v = i.val();
+                                                   if(v === "") { v = t; }
+                                                        h1.remove();
+                                                   i.remove(); // rollback purposes
+                                                       this.set_text(obj,t); // rollback purposes
+                                                     this.rename_node(obj, v);
+                                                      callback.call(this, obj, v, t);
+                                                        obj.css("position","");
+                                                }, this),
+                                              "keyup" : function (event) {
+                                                   var key = event.keyCode || event.which;
+                                                        if(key == 27) { this.value = t; this.blur(); return; }
+                                                 else if(key == 13) { this.blur(); return; }
+                                                    else {
+                                                         h2.width(Math.min(h1.text("pW" + this.value).width(),w));
+                                                      }
+                                              },
+                                             "keypress" : function(event) {
+                                                 var key = event.keyCode || event.which;
+                                                        if(key == 13) { return false; }
+                                                }
+                                      })
+                             ).children(".jstree-rename-input");
+                            this.set_text(obj, "");
+                                h1.css({
+                                               fontFamily              : h2.css('fontFamily')          || '',
+                                             fontSize          : h2.css('fontSize')            || '',
+                                         fontWeight            : h2.css('fontWeight')          || '',
+                                             fontStyle         : h2.css('fontStyle')           || '',
+                                               fontStretch             : h2.css('fontStretch')         || '',
+                                           fontVariant         : h2.css('fontVariant')         || '',
+                                           letterSpacing       : h2.css('letterSpacing')       || '',
+                                         wordSpacing           : h2.css('wordSpacing')         || ''
+                            });
+                            h2.width(Math.min(h1.text("pW" + h2[0].value).width(),w))[0].select();
+                 },
+                     rename : function (obj) {
+                              obj = this._get_node(obj);
+                             this.__rollback();
+                             var f = this.__callback;
+                               this._show_input(obj, function (obj, new_name, old_name) {
+                                     f.call(this, { "obj" : obj, "new_name" : new_name, "old_name" : old_name });
+                           });
+                    },
+                     create : function (obj, position, js, callback, skip_rename) {
+                         var t, _this = this;
+                           obj = this._get_node(obj);
+                             if(!obj) { obj = -1; }
+                         this.__rollback();
+                             t = this.create_node(obj, position, js, function (t) {
+                                 var p = this._get_parent(t),
+                                           pos = $(t).index();
+                                    if(callback) { callback.call(this, t); }
+                                       if(p.length && p.hasClass("jstree-closed")) { this.open_node(p, false, true); }
+                                        if(!skip_rename) {
+                                             this._show_input(t, function (obj, new_name, old_name) {
+                                                       _this.__callback({ "obj" : obj, "name" : new_name, "parent" : p, "position" : pos });
+                                          });
+                                    }
+                                      else { _this.__callback({ "obj" : t, "name" : this.get_text(t), "parent" : p, "position" : pos }); }
+                           });
+                            return t;
+                      },
+                     remove : function (obj) {
+                              obj = this._get_node(obj, true);
+                               var p = this._get_parent(obj), prev = this._get_prev(obj);
+                             this.__rollback();
+                             obj = this.delete_node(obj);
+                           if(obj !== false) { this.__callback({ "obj" : obj, "prev" : prev, "parent" : p }); }
+                   },
+                     check_move : function () {
+                             if(!this.__call_old()) { return false; }
+                               var s = this._get_settings().crrm.move;
+                                if(!s.check_move.call(this, this._get_move())) { return false; }
+                               return true;
+                   },
+                     move_node : function (obj, ref, position, is_copy, is_prepared, skip_check) {
+                          var s = this._get_settings().crrm.move;
+                                if(!is_prepared) {
+                                     if(typeof position === "undefined") { position = s.default_position; }
+                                 if(position === "inside" && !s.default_position.match(/^(before|after)$/)) { position = s.default_position; }
+                                  return this.__call_old(true, obj, ref, position, is_copy, false, skip_check);
+                          }
+                              // if the move is already prepared
+                             if(s.always_copy === true || (s.always_copy === "multitree" && obj.rt.get_index() !== obj.ot.get_index() )) {
+                                  is_copy = true;
+                                }
+                              this.__call_old(true, obj, ref, position, is_copy, true, skip_check);
+                  },
+
+                    cut : function (obj) {
+                         obj = this._get_node(obj, true);
+                               if(!obj || !obj.length) { return false; }
+                              this.data.crrm.cp_nodes = false;
+                               this.data.crrm.ct_nodes = obj;
+                         this.__callback({ "obj" : obj });
+                      },
+                     copy : function (obj) {
+                                obj = this._get_node(obj, true);
+                               if(!obj || !obj.length) { return false; }
+                              this.data.crrm.ct_nodes = false;
+                               this.data.crrm.cp_nodes = obj;
+                         this.__callback({ "obj" : obj });
+                      },
+                     paste : function (obj) {
+                               obj = this._get_node(obj);
+                             if(!obj || !obj.length) { return false; }
+                              var nodes = this.data.crrm.ct_nodes ? this.data.crrm.ct_nodes : this.data.crrm.cp_nodes;
+                               if(!this.data.crrm.ct_nodes && !this.data.crrm.cp_nodes) { return false; }
+                             if(this.data.crrm.ct_nodes) { this.move_node(this.data.crrm.ct_nodes, obj); this.data.crrm.ct_nodes = false; }
+                         if(this.data.crrm.cp_nodes) { this.move_node(this.data.crrm.cp_nodes, obj, false, true); }
+                             this.__callback({ "obj" : obj, "nodes" : nodes });
+                     }
+              }
+      });
+    // include the crr plugin by default
+   // $.jstree.defaults.plugins.push("crrm");
+})(jQuery);
+//*/
+
+/*
+ * jsTree themes plugin
+ * Handles loading and setting themes, as well as detecting path to themes, etc.
+ */
+(function ($) {
+   var themes_loaded = [];
+        // this variable stores the path to the themes folder - if left as false - it will be autodetected
+     $.jstree._themes = false;
+      $.jstree.plugin("themes", {
+            __init : function () {
+                 this.get_container()
+                           .bind("init.jstree", $.proxy(function () {
+                                             var s = this._get_settings().themes;
+                                           this.data.themes.dots = s.dots;
+                                                this.data.themes.icons = s.icons;
+                                              this.set_theme(s.theme, s.url);
+                                        }, this))
+                              .bind("loaded.jstree", $.proxy(function () {
+                                           // bound here too, as simple HTML tree's won't honor dots & icons otherwise
+                                            if(!this.data.themes.dots) { this.hide_dots(); }
+                                               else { this.show_dots(); }
+                                             if(!this.data.themes.icons) { this.hide_icons(); }
+                                             else { this.show_icons(); }
+                                    }, this));
+             },
+             defaults : {
+                   theme : "default",
+                     url : false,
+                   dots : true,
+                   icons : true
+           },
+             _fn : {
+                        set_theme : function (theme_name, theme_url) {
+                         if(!theme_name) { return false; }
+                              if(!theme_url) { theme_url = $.jstree._themes + theme_name + '/style.css'; }
+                           if($.inArray(theme_url, themes_loaded) == -1) {
+                                        $.vakata.css.add_sheet({ "url" : theme_url });
+                                 themes_loaded.push(theme_url);
+                         }
+                              if(this.data.themes.theme != theme_name) {
+                                     this.get_container().removeClass('jstree-' + this.data.themes.theme);
+                                  this.data.themes.theme = theme_name;
+                           }
+                              this.get_container().addClass('jstree-' + theme_name);
+                         if(!this.data.themes.dots) { this.hide_dots(); }
+                               else { this.show_dots(); }
+                             if(!this.data.themes.icons) { this.hide_icons(); }
+                             else { this.show_icons(); }
+                            this.__callback();
+                     },
+                     get_theme : function () { return this.data.themes.theme; },
+
+                   show_dots   : function () { this.data.themes.dots = true; this.get_container().children("ul").removeClass("jstree-no-dots"); },
+                  hide_dots    : function () { this.data.themes.dots = false; this.get_container().children("ul").addClass("jstree-no-dots"); },
+                    toggle_dots        : function () { if(this.data.themes.dots) { this.hide_dots(); } else { this.show_dots(); } },
+
+                     show_icons        : function () { this.data.themes.icons = true; this.get_container().children("ul").removeClass("jstree-no-icons"); },
+                       hide_icons      : function () { this.data.themes.icons = false; this.get_container().children("ul").addClass("jstree-no-icons"); },
+                 toggle_icons: function () { if(this.data.themes.icons) { this.hide_icons(); } else { this.show_icons(); } }
+            }
+      });
+    // autodetect themes path
+      $(function () {
+                if($.jstree._themes === false) {
+                       $("script").each(function () {
+                         if(this.src.toString().match(/jquery\.jstree[^\/]*?\.js(\?.*)?$/)) {
+                                   $.jstree._themes = this.src.toString().replace(/jquery\.jstree[^\/]*?\.js(\?.*)?$/, "") + 'themes/';
+                                   return false;
+                          }
+                      });
+            }
+              if($.jstree._themes === false) { $.jstree._themes = "themes/"; }
+       });
+    // include the themes plugin by default
+        $.jstree.defaults.plugins.push("themes");
+})(jQuery);
+//*/
+
+/*
+ * jsTree hotkeys plugin
+ * Enables keyboard navigation for all tree instances
+ * Depends on the jstree ui & jquery hotkeys plugins
+ */
+(function ($) {
+ var bound = [];
+        function exec(i, event) {
+              var f = $.jstree._focused(), tmp;
+              if(f && f.data && f.data.hotkeys && f.data.hotkeys.enabled) {
+                  tmp = f._get_settings().hotkeys[i];
+                    if(tmp) { return tmp.call(f, event); }
+         }
+      }
+      $.jstree.plugin("hotkeys", {
+           __init : function () {
+                 if(typeof $.hotkeys === "undefined") { throw "jsTree hotkeys: jQuery hotkeys plugin not included."; }
+                  if(!this.data.ui) { throw "jsTree hotkeys: jsTree UI plugin not included."; }
+                  $.each(this._get_settings().hotkeys, function (i, v) {
+                         if(v !== false && $.inArray(i, bound) == -1) {
+                                 $(document).bind("keydown", i, function (event) { return exec(i, event); });
+                                   bound.push(i);
+                         }
+                      });
+                    this.get_container()
+                           .bind("lock.jstree", $.proxy(function () {
+                                             if(this.data.hotkeys.enabled) { this.data.hotkeys.enabled = false; this.data.hotkeys.revert = true; }
+                                  }, this))
+                              .bind("unlock.jstree", $.proxy(function () {
+                                           if(this.data.hotkeys.revert) { this.data.hotkeys.enabled = true; }
+                                     }, this));
+                     this.enable_hotkeys();
+         },
+             defaults : {
+                   "up" : function () {
+                           var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+                              this.hover_node(this._get_prev(o));
+                            return false;
+                  },
+                     "ctrl+up" : function () {
+                              var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+                              this.hover_node(this._get_prev(o));
+                            return false;
+                  },
+                     "shift+up" : function () {
+                             var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+                              this.hover_node(this._get_prev(o));
+                            return false;
+                  },
+                     "down" : function () {
+                         var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+                              this.hover_node(this._get_next(o));
+                            return false;
+                  },
+                     "ctrl+down" : function () {
+                            var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+                              this.hover_node(this._get_next(o));
+                            return false;
+                  },
+                     "shift+down" : function () {
+                           var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+                              this.hover_node(this._get_next(o));
+                            return false;
+                  },
+                     "left" : function () {
+                         var o = this.data.ui.hovered || this.data.ui.last_selected;
+                            if(o) {
+                                        if(o.hasClass("jstree-open")) { this.close_node(o); }
+                                  else { this.hover_node(this._get_prev(o)); }
+                           }
+                              return false;
+                  },
+                     "ctrl+left" : function () {
+                            var o = this.data.ui.hovered || this.data.ui.last_selected;
+                            if(o) {
+                                        if(o.hasClass("jstree-open")) { this.close_node(o); }
+                                  else { this.hover_node(this._get_prev(o)); }
+                           }
+                              return false;
+                  },
+                     "shift+left" : function () {
+                           var o = this.data.ui.hovered || this.data.ui.last_selected;
+                            if(o) {
+                                        if(o.hasClass("jstree-open")) { this.close_node(o); }
+                                  else { this.hover_node(this._get_prev(o)); }
+                           }
+                              return false;
+                  },
+                     "right" : function () {
+                                var o = this.data.ui.hovered || this.data.ui.last_selected;
+                            if(o && o.length) {
+                                    if(o.hasClass("jstree-closed")) { this.open_node(o); }
+                                 else { this.hover_node(this._get_next(o)); }
+                           }
+                              return false;
+                  },
+                     "ctrl+right" : function () {
+                           var o = this.data.ui.hovered || this.data.ui.last_selected;
+                            if(o && o.length) {
+                                    if(o.hasClass("jstree-closed")) { this.open_node(o); }
+                                 else { this.hover_node(this._get_next(o)); }
+                           }
+                              return false;
+                  },
+                     "shift+right" : function () {
+                          var o = this.data.ui.hovered || this.data.ui.last_selected;
+                            if(o && o.length) {
+                                    if(o.hasClass("jstree-closed")) { this.open_node(o); }
+                                 else { this.hover_node(this._get_next(o)); }
+                           }
+                              return false;
+                  },
+                     "space" : function () {
+                                if(this.data.ui.hovered) { this.data.ui.hovered.children("a:eq(0)").click(); }
+                         return false;
+                  },
+                     "ctrl+space" : function (event) {
+                              event.type = "click";
+                          if(this.data.ui.hovered) { this.data.ui.hovered.children("a:eq(0)").trigger(event); }
+                          return false;
+                  },
+                     "shift+space" : function (event) {
+                             event.type = "click";
+                          if(this.data.ui.hovered) { this.data.ui.hovered.children("a:eq(0)").trigger(event); }
+                          return false;
+                  },
+                     "f2" : function () { this.rename(this.data.ui.hovered || this.data.ui.last_selected); },
+                       "del" : function () { this.remove(this.data.ui.hovered || this._get_node(null)); }
+             },
+             _fn : {
+                        enable_hotkeys : function () {
+                         this.data.hotkeys.enabled = true;
+                      },
+                     disable_hotkeys : function () {
+                                this.data.hotkeys.enabled = false;
+                     }
+              }
+      });
+})(jQuery);
+//*/
+
+/*
+ * jsTree JSON plugin
+ * The JSON data store. Datastores are build by overriding the `load_node` and `_is_loaded` functions.
+ */
+(function ($) {
+      $.jstree.plugin("json_data", {
+         __init : function() {
+                  var s = this._get_settings().json_data;
+                        if(s.progressive_unload) {
+                             this.get_container().bind("after_close.jstree", function (e, data) {
+                                   data.rslt.obj.children("ul").remove();
+                         });
+                    }
+              },
+             defaults : {
+                   // `data` can be a function:
+                   //  * accepts two arguments - node being loaded and a callback to pass the result to
+                   //  * will be executed in the current tree's scope & ajax won't be supported
+                   data : false,
+                  ajax : false,
+                  correct_state : true,
+                  progressive_render : false,
+                    progressive_unload : false
+             },
+             _fn : {
+                        load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_json(obj, function () { _this.__callback({ "obj" : _this._get_node(obj) }); s_call.call(this); }, e_call); },
+                    _is_loaded : function (obj) {
+                          var s = this._get_settings().json_data;
+                                obj = this._get_node(obj);
+                             return obj == -1 || !obj || (!s.ajax && !s.progressive_render && !$.isFunction(s.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").length > 0;
+                       },
+                     refresh : function (obj) {
+                             obj = this._get_node(obj);
+                             var s = this._get_settings().json_data;
+                                if(obj && obj !== -1 && s.progressive_unload && ($.isFunction(s.data) || !!s.ajax)) {
+                                  obj.removeData("jstree_children");
+                             }
+                              return this.__call_old();
+                      },
+                     load_node_json : function (obj, s_call, e_call) {
+                              var s = this.get_settings().json_data, d,
+                                      error_func = function () {},
+                                   success_func = function () {};
+                         obj = this._get_node(obj);
+
+                            if(obj && obj !== -1 && (s.progressive_render || s.progressive_unload) && !obj.is(".jstree-open, .jstree-leaf") && obj.children("ul").children("li").length === 0 && obj.data("jstree_children")) {
+                                    d = this._parse_json(obj.data("jstree_children"), obj);
+                                        if(d) {
+                                                obj.append(d);
+                                         if(!s.progressive_unload) { obj.removeData("jstree_children"); }
+                                       }
+                                      this.clean_node(obj);
+                                  if(s_call) { s_call.call(this); }
+                                      return;
+                                }
+
+                             if(obj && obj !== -1) {
+                                        if(obj.data("jstree_is_loading")) { return; }
+                                  else { obj.data("jstree_is_loading",true); }
+                           }
+                              switch(!0) {
+                                   case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";
+                                   // function option added here for easier model integration (also supporting async - see callback)
+                                      case ($.isFunction(s.data)):
+                                           s.data.call(this, obj, $.proxy(function (d) {
+                                                  d = this._parse_json(d, obj);
+                                                  if(!d) {
+                                                               if(obj === -1 || !obj) {
+                                                                       if(s.correct_state) { this.get_container().children("ul").empty(); }
+                                                           }
+                                                              else {
+                                                                 obj.children("a.jstree-loading").removeClass("jstree-loading");
+                                                                        obj.removeData("jstree_is_loading");
+                                                                   if(s.correct_state) { this.correct_state(obj); }
+                                                               }
+                                                              if(e_call) { e_call.call(this); }
+                                                      }
+                                                      else {
+                                                         if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
+                                                           else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree_is_loading"); }
+                                                                this.clean_node(obj);
+                                                          if(s_call) { s_call.call(this); }
+                                                      }
+                                              }, this));
+                                             break;
+                                 case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):
+                                          if(!obj || obj == -1) {
+                                                        d = this._parse_json(s.data, obj);
+                                                     if(d) {
+                                                                this.get_container().children("ul").empty().append(d.children());
+                                                              this.clean_node();
+                                                     }
+                                                      else {
+                                                         if(s.correct_state) { this.get_container().children("ul").empty(); }
+                                                   }
+                                              }
+                                              if(s_call) { s_call.call(this); }
+                                              break;
+                                 case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):
+                                             error_func = function (x, t, e) {
+                                                      var ef = this.get_settings().json_data.ajax.error;
+                                                     if(ef) { ef.call(this, x, t, e); }
+                                                     if(obj != -1 && obj.length) {
+                                                          obj.children("a.jstree-loading").removeClass("jstree-loading");
+                                                                obj.removeData("jstree_is_loading");
+                                                           if(t === "success" && s.correct_state) { this.correct_state(obj); }
+                                                    }
+                                                      else {
+                                                         if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }
+                                                        }
+                                                      if(e_call) { e_call.call(this); }
+                                              };
+                                             success_func = function (d, t, x) {
+                                                    var sf = this.get_settings().json_data.ajax.success;
+                                                   if(sf) { d = sf.call(this,d,t,x) || d; }
+                                                       if(d === "" || (d && d.toString && d.toString().replace(/^[\s\n]+$/,"") === "") || (!$.isArray(d) && !$.isPlainObject(d))) {
+                                                           return error_func.call(this, x, t, "");
+                                                        }
+                                                      d = this._parse_json(d, obj);
+                                                  if(d) {
+                                                                if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
+                                                           else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree_is_loading"); }
+                                                                this.clean_node(obj);
+                                                          if(s_call) { s_call.call(this); }
+                                                      }
+                                                      else {
+                                                         if(obj === -1 || !obj) {
+                                                                       if(s.correct_state) {
+                                                                          this.get_container().children("ul").empty();
+                                                                           if(s_call) { s_call.call(this); }
+                                                                      }
+                                                              }
+                                                              else {
+                                                                 obj.children("a.jstree-loading").removeClass("jstree-loading");
+                                                                        obj.removeData("jstree_is_loading");
+                                                                   if(s.correct_state) {
+                                                                          this.correct_state(obj);
+                                                                               if(s_call) { s_call.call(this); }
+                                                                      }
+                                                              }
+                                                      }
+                                              };
+                                             s.ajax.context = this;
+                                         s.ajax.error = error_func;
+                                             s.ajax.success = success_func;
+                                         if(!s.ajax.dataType) { s.ajax.dataType = "json"; }
+                                             if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
+                                              if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
+                                           $.ajax(s.ajax);
+                                                break;
+                         }
+                      },
+                     _parse_json : function (js, obj, is_callback) {
+                                var d = false,
+                                 p = this._get_settings(),
+                                      s = p.json_data,
+                                       t = p.core.html_titles,
+                                        tmp, i, j, ul1, ul2;
+
+                          if(!js) { return d; }
+                          if(s.progressive_unload && obj && obj !== -1) {
+                                        obj.data("jstree_children", d);
+                                }
+                              if($.isArray(js)) {
+                                    d = $();
+                                       if(!js.length) { return false; }
+                                       for(i = 0, j = js.length; i < j; i++) {
+                                                tmp = this._parse_json(js[i], obj, true);
+                                              if(tmp.length) { d = d.add(tmp); }
+                                     }
+                              }
+                              else {
+                                 if(typeof js == "string") { js = { data : js }; }
+                                      if(!js.data && js.data !== "") { return d; }
+                                   d = $("<li />");
+                                       if(js.attr) { d.attr(js.attr); }
+                                       if(js.metadata) { d.data(js.metadata); }
+                                       if(js.state) { d.addClass("jstree-" + js.state); }
+                                     if(!$.isArray(js.data)) { tmp = js.data; js.data = []; js.data.push(tmp); }
+                                    $.each(js.data, function (i, m) {
+                                              tmp = $("<a />");
+                                              if($.isFunction(m)) { m = m.call(this, js); }
+                                          if(typeof m == "string") { tmp.attr('href','#')[ t ? "html" : "text" ](m); }
+                                           else {
+                                                 if(!m.attr) { m.attr = {}; }
+                                                   if(!m.attr.href) { m.attr.href = '#'; }
+                                                        tmp.attr(m.attr)[ t ? "html" : "text" ](m.title);
+                                                      if(m.language) { tmp.addClass(m.language); }
+                                           }
+                                              tmp.prepend("<ins class='jstree-icon'>&#160;</ins>");
+                                          if(!m.icon && js.icon) { m.icon = js.icon; }
+                                           if(m.icon) {
+                                                   if(m.icon.indexOf("/") === -1) { tmp.children("ins").addClass(m.icon); }
+                                                       else { tmp.children("ins").css("background","url('" + m.icon + "') center center no-repeat"); }
+                                                }
+                                              d.append(tmp);
+                                 });
+                                    d.prepend("<ins class='jstree-icon'>&#160;</ins>");
+                                    if(js.children) {
+                                              if(s.progressive_render && js.state !== "open") {
+                                                      d.addClass("jstree-closed").data("jstree_children", js.children);
+                                              }
+                                              else {
+                                                 if(s.progressive_unload) { d.data("jstree_children", js.children); }
+                                                   if($.isArray(js.children) && js.children.length) {
+                                                             tmp = this._parse_json(js.children, obj, true);
+                                                                if(tmp.length) {
+                                                                       ul2 = $("<ul />");
+                                                                     ul2.append(tmp);
+                                                                       d.append(ul2);
+                                                         }
+                                                      }
+                                              }
+                                      }
+                              }
+                              if(!is_callback) {
+                                     ul1 = $("<ul />");
+                                     ul1.append(d);
+                                 d = ul1;
+                               }
+                              return d;
+                      },
+                     get_json : function (obj, li_attr, a_attr, is_callback) {
+                              var result = [],
+                                       s = this._get_settings(),
+                                      _this = this,
+                                  tmp1, tmp2, li, a, t, lang;
+                            obj = this._get_node(obj);
+                             if(!obj || obj === -1) { obj = this.get_container().find("> ul > li"); }
+                               li_attr = $.isArray(li_attr) ? li_attr : [ "id", "class" ];
+                            if(!is_callback && this.data.types) { li_attr.push(s.types.type_attr); }
+                               a_attr = $.isArray(a_attr) ? a_attr : [ ];
+
+                            obj.each(function () {
+                                 li = $(this);
+                                  tmp1 = { data : [] };
+                                  if(li_attr.length) { tmp1.attr = { }; }
+                                        $.each(li_attr, function (i, v) {
+                                              tmp2 = li.attr(v);
+                                             if(tmp2 && tmp2.length && tmp2.replace(/jstree[^ ]*/ig,'').length) {
+                                                   tmp1.attr[v] = (" " + tmp2).replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"");
+                                              }
+                                      });
+                                    if(li.hasClass("jstree-open")) { tmp1.state = "open"; }
+                                        if(li.hasClass("jstree-closed")) { tmp1.state = "closed"; }
+                                    if(li.data()) { tmp1.metadata = li.data(); }
+                                   a = li.children("a");
+                                  a.each(function () {
+                                           t = $(this);
+                                           if(
+                                                    a_attr.length ||
+                                                       $.inArray("languages", s.plugins) !== -1 ||
+                                                    t.children("ins").get(0).style.backgroundImage.length ||
+                                                       (t.children("ins").get(0).className && t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').length)
+                                                ) {
+                                                    lang = false;
+                                                  if($.inArray("languages", s.plugins) !== -1 && $.isArray(s.languages) && s.languages.length) {
+                                                         $.each(s.languages, function (l, lv) {
+                                                                 if(t.hasClass(lv)) {
+                                                                           lang = lv;
+                                                                             return false;
+                                                                  }
+                                                              });
+                                                    }
+                                                      tmp2 = { attr : { }, title : _this.get_text(t, lang) };
+                                                        $.each(a_attr, function (k, z) {
+                                                               tmp2.attr[z] = (" " + (t.attr(z) || "")).replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"");
+                                                 });
+                                                    if($.inArray("languages", s.plugins) !== -1 && $.isArray(s.languages) && s.languages.length) {
+                                                         $.each(s.languages, function (k, z) {
+                                                                  if(t.hasClass(z)) { tmp2.language = z; return true; }
+                                                          });
+                                                    }
+                                                      if(t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/^\s+$/ig,"").length) {
+                                                            tmp2.icon = t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"");
+                                                  }
+                                                      if(t.children("ins").get(0).style.backgroundImage.length) {
+                                                            tmp2.icon = t.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","");
+                                                 }
+                                              }
+                                              else {
+                                                 tmp2 = _this.get_text(t);
+                                              }
+                                              if(a.length > 1) { tmp1.data.push(tmp2); }
+                                             else { tmp1.data = tmp2; }
+                                     });
+                                    li = li.find("> ul > li");
+                                     if(li.length) { tmp1.children = _this.get_json(li, li_attr, a_attr, true); }
+                                   result.push(tmp1);
+                             });
+                            return result;
+                 }
+              }
+      });
+})(jQuery);
+//*/
+
+/*
+ * jsTree languages plugin
+ * Adds support for multiple language versions in one tree
+ * This basically allows for many titles coexisting in one node, but only one of them being visible at any given time
+ * This is useful for maintaining the same structure in many languages (hence the name of the plugin)
+ */
+(function ($) {
+ $.jstree.plugin("languages", {
+         __init : function () { this._load_css();  },
+           defaults : [],
+         _fn : {
+                        set_lang : function (i) {
+                              var langs = this._get_settings().languages,
+                                    st = false,
+                                    selector = ".jstree-" + this.get_index() + ' a';
+                               if(!$.isArray(langs) || langs.length === 0) { return false; }
+                          if($.inArray(i,langs) == -1) {
+                                 if(!!langs[i]) { i = langs[i]; }
+                                       else { return false; }
+                         }
+                              if(i == this.data.languages.current_language) { return true; }
+                         st = $.vakata.css.get_css(selector + "." + this.data.languages.current_language, false, this.data.languages.language_css);
+                             if(st !== false) { st.style.display = "none"; }
+                                st = $.vakata.css.get_css(selector + "." + i, false, this.data.languages.language_css);
+                                if(st !== false) { st.style.display = ""; }
+                            this.data.languages.current_language = i;
+                              this.__callback(i);
+                            return true;
+                   },
+                     get_lang : function () {
+                               return this.data.languages.current_language;
+                   },
+                     _get_string : function (key, lang) {
+                           var langs = this._get_settings().languages,
+                                    s = this._get_settings().core.strings;
+                         if($.isArray(langs) && langs.length) {
+                                 lang = (lang && $.inArray(lang,langs) != -1) ? lang : this.data.languages.current_language;
+                            }
+                              if(s[lang] && s[lang][key]) { return s[lang][key]; }
+                           if(s[key]) { return s[key]; }
+                          return key;
+                    },
+                     get_text : function (obj, lang) {
+                              obj = this._get_node(obj) || this.data.ui.last_selected;
+                               if(!obj.size()) { return false; }
+                              var langs = this._get_settings().languages,
+                                    s = this._get_settings().core.html_titles;
+                             if($.isArray(langs) && langs.length) {
+                                 lang = (lang && $.inArray(lang,langs) != -1) ? lang : this.data.languages.current_language;
+                                    obj = obj.children("a." + lang);
+                               }
+                              else { obj = obj.children("a:eq(0)"); }
+                                if(s) {
+                                        obj = obj.clone();
+                                     obj.children("INS").remove();
+                                  return obj.html();
+                             }
+                              else {
+                                 obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
+                                     return obj.nodeValue;
+                          }
+                      },
+                     set_text : function (obj, val, lang) {
+                         obj = this._get_node(obj) || this.data.ui.last_selected;
+                               if(!obj.size()) { return false; }
+                              var langs = this._get_settings().languages,
+                                    s = this._get_settings().core.html_titles,
+                                     tmp;
+                           if($.isArray(langs) && langs.length) {
+                                 lang = (lang && $.inArray(lang,langs) != -1) ? lang : this.data.languages.current_language;
+                                    obj = obj.children("a." + lang);
+                               }
+                              else { obj = obj.children("a:eq(0)"); }
+                                if(s) {
+                                        tmp = obj.children("INS").clone();
+                                     obj.html(val).prepend(tmp);
+                                    this.__callback({ "obj" : obj, "name" : val, "lang" : lang });
+                                 return true;
+                           }
+                              else {
+                                 obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
+                                     this.__callback({ "obj" : obj, "name" : val, "lang" : lang });
+                                 return (obj.nodeValue = val);
+                          }
+                      },
+                     _load_css : function () {
+                              var langs = this._get_settings().languages,
+                                    str = "/* languages css */",
+                                   selector = ".jstree-" + this.get_index() + ' a',
+                                       ln;
+                            if($.isArray(langs) && langs.length) {
+                                 this.data.languages.current_language = langs[0];
+                                       for(ln = 0; ln < langs.length; ln++) {
+                                         str += selector + "." + langs[ln] + " {";
+                                              if(langs[ln] != this.data.languages.current_language) { str += " display:none; "; }
+                                            str += " } ";
+                                  }
+                                      this.data.languages.language_css = $.vakata.css.add_sheet({ 'str' : str, 'title' : "jstree-languages" });
+                              }
+                      },
+                     create_node : function (obj, position, js, callback) {
+                         var t = this.__call_old(true, obj, position, js, function (t) {
+                                        var langs = this._get_settings().languages,
+                                            a = t.children("a"),
+                                           ln;
+                                    if($.isArray(langs) && langs.length) {
+                                         for(ln = 0; ln < langs.length; ln++) {
+                                                 if(!a.is("." + langs[ln])) {
+                                                           t.append(a.eq(0).clone().removeClass(langs.join(" ")).addClass(langs[ln]));
+                                                    }
+                                              }
+                                              a.not("." + langs.join(", .")).remove();
+                                       }
+                                      if(callback) { callback.call(this, t); }
+                               });
+                            return t;
+                      }
+              }
+      });
+})(jQuery);
+//*/
+
+/*
+ * jsTree cookies plugin
+ * Stores the currently opened/selected nodes in a cookie and then restores them
+ * Depends on the jquery.cookie plugin
+ */
+(function ($) {
+  $.jstree.plugin("cookies", {
+           __init : function () {
+                 if(typeof $.cookie === "undefined") { throw "jsTree cookie: jQuery cookie plugin not included."; }
+
+                    var s = this._get_settings().cookies,
+                          tmp;
+                   if(!!s.save_loaded) {
+                          tmp = $.cookie(s.save_loaded);
+                         if(tmp && tmp.length) { this.data.core.to_load = tmp.split(","); }
+                     }
+                      if(!!s.save_opened) {
+                          tmp = $.cookie(s.save_opened);
+                         if(tmp && tmp.length) { this.data.core.to_open = tmp.split(","); }
+                     }
+                      if(!!s.save_selected) {
+                                tmp = $.cookie(s.save_selected);
+                               if(tmp && tmp.length && this.data.ui) { this.data.ui.to_select = tmp.split(","); }
+                     }
+                      this.get_container()
+                           .one( ( this.data.ui ? "reselect" : "reopen" ) + ".jstree", $.proxy(function () {
+                                      this.get_container()
+                                           .bind("open_node.jstree close_node.jstree select_node.jstree deselect_node.jstree", $.proxy(function (e) {
+                                                             if(this._get_settings().cookies.auto_save) { this.save_cookie((e.handleObj.namespace + e.handleObj.type).replace("jstree","")); }
+                                                      }, this));
+                             }, this));
+             },
+             defaults : {
+                   save_loaded         : "jstree_load",
+                  save_opened          : "jstree_open",
+                  save_selected        : "jstree_select",
+                       auto_save               : true,
+                     cookie_options    : {}
+            },
+             _fn : {
+                        save_cookie : function (c) {
+                           if(this.data.core.refreshing) { return; }
+                              var s = this._get_settings().cookies;
+                          if(!c) { // if called manually and not by event
+                                        if(s.save_loaded) {
+                                            this.save_loaded();
+                                            $.cookie(s.save_loaded, this.data.core.to_load.join(","), s.cookie_options);
+                                   }
+                                      if(s.save_opened) {
+                                            this.save_opened();
+                                            $.cookie(s.save_opened, this.data.core.to_open.join(","), s.cookie_options);
+                                   }
+                                      if(s.save_selected && this.data.ui) {
+                                          this.save_selected();
+                                          $.cookie(s.save_selected, this.data.ui.to_select.join(","), s.cookie_options);
+                                 }
+                                      return;
+                                }
+                              switch(c) {
+                                    case "open_node":
+                                      case "close_node":
+                                             if(!!s.save_opened) {
+                                                  this.save_opened();
+                                                    $.cookie(s.save_opened, this.data.core.to_open.join(","), s.cookie_options);
+                                           }
+                                              if(!!s.save_loaded) {
+                                                  this.save_loaded();
+                                                    $.cookie(s.save_loaded, this.data.core.to_load.join(","), s.cookie_options);
+                                           }
+                                              break;
+                                 case "select_node":
+                                    case "deselect_node":
+                                          if(!!s.save_selected && this.data.ui) {
+                                                        this.save_selected();
+                                                  $.cookie(s.save_selected, this.data.ui.to_select.join(","), s.cookie_options);
+                                         }
+                                              break;
+                         }
+                      }
+              }
+      });
+    // include cookies by default
+  // $.jstree.defaults.plugins.push("cookies");
+})(jQuery);
+//*/
+
+/*
+ * jsTree sort plugin
+ * Sorts items alphabetically (or using any other function)
+ */
+(function ($) {
+       $.jstree.plugin("sort", {
+              __init : function () {
+                 this.get_container()
+                           .bind("load_node.jstree", $.proxy(function (e, data) {
+                                         var obj = this._get_node(data.rslt.obj);
+                                               obj = obj === -1 ? this.get_container().children("ul") : obj.children("ul");
+                                           this.sort(obj);
+                                        }, this))
+                              .bind("rename_node.jstree create_node.jstree create.jstree", $.proxy(function (e, data) {
+                                              this.sort(data.rslt.obj.parent());
+                                     }, this))
+                              .bind("move_node.jstree", $.proxy(function (e, data) {
+                                         var m = data.rslt.np == -1 ? this.get_container() : data.rslt.np;
+                                              this.sort(m.children("ul"));
+                                   }, this));
+             },
+             defaults : function (a, b) { return this.get_text(a) > this.get_text(b) ? 1 : -1; },
+           _fn : {
+                        sort : function (obj) {
+                                var s = this._get_settings().sort,
+                                     t = this;
+                              obj.append($.makeArray(obj.children("li")).sort($.proxy(s, t)));
+                               obj.find("> li > ul").each(function() { t.sort($(this)); });
+                           this.clean_node(obj);
+                  }
+              }
+      });
+})(jQuery);
+//*/
+
+/*
+ * jsTree DND plugin
+ * Drag and drop plugin for moving/copying nodes
+ */
+(function ($) {
+     var o = false,
+         r = false,
+             m = false,
+             ml = false,
+            sli = false,
+           sti = false,
+           dir1 = false,
+          dir2 = false,
+          last_pos = false;
+      $.vakata.dnd = {
+               is_down : false,
+               is_drag : false,
+               helper : false,
+                scroll_spd : 10,
+               init_x : 0,
+            init_y : 0,
+            threshold : 5,
+         helper_left : 5,
+               helper_top : 10,
+               user_data : {},
+
+               drag_start : function (e, data, html) {
+                        if($.vakata.dnd.is_drag) { $.vakata.drag_stop({}); }
+                   try {
+                          e.currentTarget.unselectable = "on";
+                           e.currentTarget.onselectstart = function() { return false; };
+                          if(e.currentTarget.style) { e.currentTarget.style.MozUserSelect = "none"; }
+                    } catch(err) { }
+                       $.vakata.dnd.init_x = e.pageX;
+                 $.vakata.dnd.init_y = e.pageY;
+                 $.vakata.dnd.user_data = data;
+                 $.vakata.dnd.is_down = true;
+                   $.vakata.dnd.helper = $("<div id='vakata-dragged' />").html(html); //.fadeTo(10,0.25);
+                 $(document).bind("mousemove", $.vakata.dnd.drag);
+                      $(document).bind("mouseup", $.vakata.dnd.drag_stop);
+                   return false;
+          },
+             drag : function (e) {
+                  if(!$.vakata.dnd.is_down) { return; }
+                  if(!$.vakata.dnd.is_drag) {
+                            if(Math.abs(e.pageX - $.vakata.dnd.init_x) > 5 || Math.abs(e.pageY - $.vakata.dnd.init_y) > 5) {
+                                       $.vakata.dnd.helper.appendTo("body");
+                                  $.vakata.dnd.is_drag = true;
+                                   $(document).triggerHandler("drag_start.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });
+                             }
+                              else { return; }
+                       }
+
+                     // maybe use a scrolling parent element instead of document?
+                   if(e.type === "mousemove") { // thought of adding scroll in order to move the helper, but mouse poisition is n/a
+                               var d = $(document), t = d.scrollTop(), l = d.scrollLeft();
+                            if(e.pageY - t < 20) {
+                                 if(sti && dir1 === "down") { clearInterval(sti); sti = false; }
+                                        if(!sti) { dir1 = "up"; sti = setInterval(function () { $(document).scrollTop($(document).scrollTop() - $.vakata.dnd.scroll_spd); }, 150); }
+                           }
+                              else {
+                                 if(sti && dir1 === "up") { clearInterval(sti); sti = false; }
+                          }
+                              if($(window).height() - (e.pageY - t) < 20) {
+                                  if(sti && dir1 === "up") { clearInterval(sti); sti = false; }
+                                  if(!sti) { dir1 = "down"; sti = setInterval(function () { $(document).scrollTop($(document).scrollTop() + $.vakata.dnd.scroll_spd); }, 150); }
+                         }
+                              else {
+                                 if(sti && dir1 === "down") { clearInterval(sti); sti = false; }
+                                }
+
+                             if(e.pageX - l < 20) {
+                                 if(sli && dir2 === "right") { clearInterval(sli); sli = false; }
+                                       if(!sli) { dir2 = "left"; sli = setInterval(function () { $(document).scrollLeft($(document).scrollLeft() - $.vakata.dnd.scroll_spd); }, 150); }
+                               }
+                              else {
+                                 if(sli && dir2 === "left") { clearInterval(sli); sli = false; }
+                                }
+                              if($(window).width() - (e.pageX - l) < 20) {
+                                   if(sli && dir2 === "left") { clearInterval(sli); sli = false; }
+                                        if(!sli) { dir2 = "right"; sli = setInterval(function () { $(document).scrollLeft($(document).scrollLeft() + $.vakata.dnd.scroll_spd); }, 150); }
+                              }
+                              else {
+                                 if(sli && dir2 === "right") { clearInterval(sli); sli = false; }
+                               }
+                      }
+
+                     $.vakata.dnd.helper.css({ left : (e.pageX + $.vakata.dnd.helper_left) + "px", top : (e.pageY + $.vakata.dnd.helper_top) + "px" });
+                     $(document).triggerHandler("drag.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });
+           },
+             drag_stop : function (e) {
+                     if(sli) { clearInterval(sli); }
+                        if(sti) { clearInterval(sti); }
+                        $(document).unbind("mousemove", $.vakata.dnd.drag);
+                    $(document).unbind("mouseup", $.vakata.dnd.drag_stop);
+                 $(document).triggerHandler("drag_stop.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });
+                      $.vakata.dnd.helper.remove();
+                  $.vakata.dnd.init_x = 0;
+                       $.vakata.dnd.init_y = 0;
+                       $.vakata.dnd.user_data = {};
+                   $.vakata.dnd.is_down = false;
+                  $.vakata.dnd.is_drag = false;
+          }
+      };
+     $(function() {
+         var css_string = '#vakata-dragged { display:block; margin:0 0 0 0; padding:4px 4px 4px 24px; position:absolute; top:-2000px; line-height:16px; z-index:10000; } ';
+             $.vakata.css.add_sheet({ str : css_string, title : "vakata" });
+        });
+
+   $.jstree.plugin("dnd", {
+               __init : function () {
+                 this.data.dnd = {
+                              active : false,
+                                after : false,
+                         inside : false,
+                                before : false,
+                                off : false,
+                           prepared : false,
+                              w : 0,
+                         to1 : false,
+                           to2 : false,
+                           cof : false,
+                           cw : false,
+                            ch : false,
+                            i1 : false,
+                            i2 : false,
+                            mto : false
+                    };
+                     this.get_container()
+                           .bind("mouseenter.jstree", $.proxy(function (e) {
+                                              if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+                                                    if(this.data.themes) {
+                                                         m.attr("class", "jstree-" + this.data.themes.theme);
+                                                           if(ml) { ml.attr("class", "jstree-" + this.data.themes.theme); }
+                                                               $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme);
+                                                       }
+                                                      //if($(e.currentTarget).find("> ul > li").length === 0) {
+                                                      if(e.currentTarget === e.target && $.vakata.dnd.user_data.obj && $($.vakata.dnd.user_data.obj).length && $($.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0] !== e.target) { // node should not be from the same tree
+                                                            var tr = $.jstree._reference(e.target), dc;
+                                                            if(tr.data.dnd.foreign) {
+                                                                      dc = tr._get_settings().dnd.drag_check.call(this, { "o" : o, "r" : tr.get_container(), is_root : true });
+                                                                      if(dc === true || dc.inside === true || dc.before === true || dc.after === true) {
+                                                                             $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
+                                                                 }
+                                                              }
+                                                              else {
+                                                                 tr.prepare_move(o, tr.get_container(), "last");
+                                                                        if(tr.check_move()) {
+                                                                          $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
+                                                                 }
+                                                              }
+                                                      }
+                                              }
+                                      }, this))
+                              .bind("mouseup.jstree", $.proxy(function (e) {
+                                         //if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && $(e.currentTarget).find("> ul > li").length === 0) {
+                                             if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && e.currentTarget === e.target && $.vakata.dnd.user_data.obj && $($.vakata.dnd.user_data.obj).length && $($.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0] !== e.target) { // node should not be from the same tree
+                                                   var tr = $.jstree._reference(e.currentTarget), dc;
+                                                     if(tr.data.dnd.foreign) {
+                                                              dc = tr._get_settings().dnd.drag_check.call(this, { "o" : o, "r" : tr.get_container(), is_root : true });
+                                                              if(dc === true || dc.inside === true || dc.before === true || dc.after === true) {
+                                                                     tr._get_settings().dnd.drag_finish.call(this, { "o" : o, "r" : tr.get_container(), is_root : true });
+                                                          }
+                                                      }
+                                                      else {
+                                                         tr.move_node(o, tr.get_container(), "last", e[tr._get_settings().dnd.copy_modifier + "Key"]);
+                                                  }
+                                              }
+                                      }, this))
+                              .bind("mouseleave.jstree", $.proxy(function (e) {
+                                              if(e.relatedTarget && e.relatedTarget.id && e.relatedTarget.id === "jstree-marker-line") {
+                                                     return false;
+                                          }
+                                              if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+                                                    if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
+                                                      if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
+                                                      if(this.data.dnd.to1) { clearTimeout(this.data.dnd.to1); }
+                                                     if(this.data.dnd.to2) { clearTimeout(this.data.dnd.to2); }
+                                                     if($.vakata.dnd.helper.children("ins").hasClass("jstree-ok")) {
+                                                                $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
+                                                    }
+                                              }
+                                      }, this))
+                              .bind("mousemove.jstree", $.proxy(function (e) {
+                                               if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+                                                    var cnt = this.get_container()[0];
+
+                                                    // Horizontal scroll
+                                                   if(e.pageX + 24 > this.data.dnd.cof.left + this.data.dnd.cw) {
+                                                         if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
+                                                              this.data.dnd.i1 = setInterval($.proxy(function () { this.scrollLeft += $.vakata.dnd.scroll_spd; }, cnt), 100);
+                                                        }
+                                                      else if(e.pageX - 24 < this.data.dnd.cof.left) {
+                                                               if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
+                                                              this.data.dnd.i1 = setInterval($.proxy(function () { this.scrollLeft -= $.vakata.dnd.scroll_spd; }, cnt), 100);
+                                                        }
+                                                      else {
+                                                         if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
+                                                      }
+
+                                                     // Vertical scroll
+                                                     if(e.pageY + 24 > this.data.dnd.cof.top + this.data.dnd.ch) {
+                                                          if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
+                                                              this.data.dnd.i2 = setInterval($.proxy(function () { this.scrollTop += $.vakata.dnd.scroll_spd; }, cnt), 100);
+                                                 }
+                                                      else if(e.pageY - 24 < this.data.dnd.cof.top) {
+                                                                if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
+                                                              this.data.dnd.i2 = setInterval($.proxy(function () { this.scrollTop -= $.vakata.dnd.scroll_spd; }, cnt), 100);
+                                                 }
+                                                      else {
+                                                         if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
+                                                      }
+
+                                             }
+                                      }, this))
+                              .bind("scroll.jstree", $.proxy(function (e) {
+                                          if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && m && ml) {
+                                                 m.hide();
+                                                      ml.hide();
+                                             }
+                                      }, this))
+                              .delegate("a", "mousedown.jstree", $.proxy(function (e) {
+                                              if(e.which === 1) {
+                                                    this.start_drag(e.currentTarget, e);
+                                                   return false;
+                                          }
+                                      }, this))
+                              .delegate("a", "mouseenter.jstree", $.proxy(function (e) {
+                                             if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+                                                    this.dnd_enter(e.currentTarget);
+                                               }
+                                      }, this))
+                              .delegate("a", "mousemove.jstree", $.proxy(function (e) {
+                                              if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+                                                    if(!r || !r.length || r.children("a")[0] !== e.currentTarget) {
+                                                                this.dnd_enter(e.currentTarget);
+                                                       }
+                                                      if(typeof this.data.dnd.off.top === "undefined") { this.data.dnd.off = $(e.target).offset(); }
+                                                 this.data.dnd.w = (e.pageY - (this.data.dnd.off.top || 0)) % this.data.core.li_height;
+                                                 if(this.data.dnd.w < 0) { this.data.dnd.w += this.data.core.li_height; }
+                                                       this.dnd_show();
+                                               }
+                                      }, this))
+                              .delegate("a", "mouseleave.jstree", $.proxy(function (e) {
+                                             if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+                                                    if(e.relatedTarget && e.relatedTarget.id && e.relatedTarget.id === "jstree-marker-line") {
+                                                             return false;
+                                                  }
+                                                              if(m) { m.hide(); }
+                                                            if(ml) { ml.hide(); }
+                                                  /*
+                                                     var ec = $(e.currentTarget).closest("li"),
+                                                             er = $(e.relatedTarget).closest("li");
+                                                 if(er[0] !== ec.prev()[0] && er[0] !== ec.next()[0]) {
+                                                         if(m) { m.hide(); }
+                                                            if(ml) { ml.hide(); }
+                                                  }
+                                                      */
+                                                     this.data.dnd.mto = setTimeout(
+                                                                (function (t) { return function () { t.dnd_leave(e); }; })(this),
+                                                      0);
+                                            }
+                                      }, this))
+                              .delegate("a", "mouseup.jstree", $.proxy(function (e) {
+                                                if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+                                                    this.dnd_finish(e);
+                                            }
+                                      }, this));
+
+                    $(document)
+                            .bind("drag_stop.vakata", $.proxy(function () {
+                                                if(this.data.dnd.to1) { clearTimeout(this.data.dnd.to1); }
+                                             if(this.data.dnd.to2) { clearTimeout(this.data.dnd.to2); }
+                                             if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
+                                              if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
+                                              this.data.dnd.after              = false;
+                                          this.data.dnd.before = false;
+                                          this.data.dnd.inside = false;
+                                          this.data.dnd.off            = false;
+                                            this.data.dnd.prepared     = false;
+                                                this.data.dnd.w                        = false;
+                                             this.data.dnd.to1         = false;
+                                            this.data.dnd.to2          = false;
+                                            this.data.dnd.i1           = false;
+                                             this.data.dnd.i2          = false;
+                                             this.data.dnd.active      = false;
+                                          this.data.dnd.foreign        = false;
+                                         if(m) { m.css({ "top" : "-2000px" }); }
+                                                if(ml) { ml.css({ "top" : "-2000px" }); }
+                                      }, this))
+                              .bind("drag_start.vakata", $.proxy(function (e, data) {
+                                                if(data.data.jstree) {
+                                                 var et = $(data.event.target);
+                                                 if(et.closest(".jstree").hasClass("jstree-" + this.get_index())) {
+                                                             this.dnd_enter(et);
+                                                    }
+                                              }
+                                      }, this));
+                             /*
+                             .bind("keydown.jstree-" + this.get_index() + " keyup.jstree-" + this.get_index(), $.proxy(function(e) {
+                                                if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && !this.data.dnd.foreign) {
+                                                  var h = $.vakata.dnd.helper.children("ins");
+                                                   if(e[this._get_settings().dnd.copy_modifier + "Key"] && h.hasClass("jstree-ok")) {
+                                                             h.parent().html(h.parent().html().replace(/ \(Copy\)$/, "") + " (Copy)");
+                                                      }
+                                                      else {
+                                                         h.parent().html(h.parent().html().replace(/ \(Copy\)$/, ""));
+                                                  }
+                                              }
+                                      }, this)); */
+
+
+
+                       var s = this._get_settings().dnd;
+                      if(s.drag_target) {
+                            $(document)
+                                    .delegate(s.drag_target, "mousedown.jstree-" + this.get_index(), $.proxy(function (e) {
+                                                o = e.target;
+                                          $.vakata.dnd.drag_start(e, { jstree : true, obj : e.target }, "<ins class='jstree-icon'></ins>" + $(e.target).text() );
+                                                if(this.data.themes) {
+                                                 if(m) { m.attr("class", "jstree-" + this.data.themes.theme); }
+                                                 if(ml) { ml.attr("class", "jstree-" + this.data.themes.theme); }
+                                                       $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme);
+                                               }
+                                              $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
+                                            var cnt = this.get_container();
+                                                this.data.dnd.cof = cnt.offset();
+                                              this.data.dnd.cw = parseInt(cnt.width(),10);
+                                           this.data.dnd.ch = parseInt(cnt.height(),10);
+                                          this.data.dnd.foreign = true;
+                                          e.preventDefault();
+                                    }, this));
+                     }
+                      if(s.drop_target) {
+                            $(document)
+                                    .delegate(s.drop_target, "mouseenter.jstree-" + this.get_index(), $.proxy(function (e) {
+                                                       if(this.data.dnd.active && this._get_settings().dnd.drop_check.call(this, { "o" : o, "r" : $(e.target), "e" : e })) {
+                                                          $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
+                                                 }
+                                              }, this))
+                                      .delegate(s.drop_target, "mouseleave.jstree-" + this.get_index(), $.proxy(function (e) {
+                                                       if(this.data.dnd.active) {
+                                                             $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
+                                                    }
+                                              }, this))
+                                      .delegate(s.drop_target, "mouseup.jstree-" + this.get_index(), $.proxy(function (e) {
+                                                  if(this.data.dnd.active && $.vakata.dnd.helper.children("ins").hasClass("jstree-ok")) {
+                                                                this._get_settings().dnd.drop_finish.call(this, { "o" : o, "r" : $(e.target), "e" : e });
+                                                      }
+                                              }, this));
+                     }
+              },
+             defaults : {
+                   copy_modifier       : "ctrl",
+                        check_timeout  : 100,
+                   open_timeout        : 500,
+                    drop_target                : ".jstree-drop",
+                 drop_check            : function (data) { return true; },
+                        drop_finish            : $.noop,
+                 drag_target           : ".jstree-draggable",
+                    drag_finish                : $.noop,
+                 drag_check            : function (data) { return { after : false, before : false, inside : true }; }
+             },
+             _fn : {
+                        dnd_prepare : function () {
+                            if(!r || !r.length) { return; }
+                                this.data.dnd.off = r.offset();
+                                if(this._get_settings().core.rtl) {
+                                    this.data.dnd.off.right = this.data.dnd.off.left + r.width();
+                          }
+                              if(this.data.dnd.foreign) {
+                                    var a = this._get_settings().dnd.drag_check.call(this, { "o" : o, "r" : r });
+                                  this.data.dnd.after = a.after;
+                                 this.data.dnd.before = a.before;
+                                       this.data.dnd.inside = a.inside;
+                                       this.data.dnd.prepared = true;
+                                 return this.dnd_show();
+                                }
+                              this.prepare_move(o, r, "before");
+                             this.data.dnd.before = this.check_move();
+                              this.prepare_move(o, r, "after");
+                              this.data.dnd.after = this.check_move();
+                               if(this._is_loaded(r)) {
+                                       this.prepare_move(o, r, "inside");
+                                     this.data.dnd.inside = this.check_move();
+                              }
+                              else {
+                                 this.data.dnd.inside = false;
+                          }
+                              this.data.dnd.prepared = true;
+                         return this.dnd_show();
+                        },
+                     dnd_show : function () {
+                               if(!this.data.dnd.prepared) { return; }
+                                var o = ["before","inside","after"],
+                                   r = false,
+                                     rtl = this._get_settings().core.rtl,
+                                   pos;
+                           if(this.data.dnd.w < this.data.core.li_height/3) { o = ["before","inside","after"]; }
+                          else if(this.data.dnd.w <= this.data.core.li_height*2/3) {
+                                     o = this.data.dnd.w < this.data.core.li_height/2 ? ["inside","before","after"] : ["inside","after","before"];
+                          }
+                              else { o = ["after","inside","before"]; }
+                              $.each(o, $.proxy(function (i, val) {
+                                  if(this.data.dnd[val]) {
+                                               $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
+                                         r = val;
+                                               return false;
+                                  }
+                              }, this));
+                             if(r === false) { $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid"); }
+
+                               pos = rtl ? (this.data.dnd.off.right - 18) : (this.data.dnd.off.left + 10);
+                            switch(r) {
+                                    case "before":
+                                         m.css({ "left" : pos + "px", "top" : (this.data.dnd.off.top - 6) + "px" }).show();
+                                             if(ml) { ml.css({ "left" : (pos + 8) + "px", "top" : (this.data.dnd.off.top - 1) + "px" }).show(); }
+                                           break;
+                                 case "after":
+                                          m.css({ "left" : pos + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height - 6) + "px" }).show();
+                                          if(ml) { ml.css({ "left" : (pos + 8) + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height - 1) + "px" }).show(); }
+                                                break;
+                                 case "inside":
+                                         m.css({ "left" : pos + ( rtl ? -4 : 4) + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height/2 - 5) + "px" }).show();
+                                              if(ml) { ml.hide(); }
+                                          break;
+                                 default:
+                                               m.hide();
+                                              if(ml) { ml.hide(); }
+                                          break;
+                         }
+                              last_pos = r;
+                          return r;
+                      },
+                     dnd_open : function () {
+                               this.data.dnd.to2 = false;
+                             this.open_node(r, $.proxy(this.dnd_prepare,this), true);
+                       },
+                     dnd_finish : function (e) {
+                            if(this.data.dnd.foreign) {
+                                    if(this.data.dnd.after || this.data.dnd.before || this.data.dnd.inside) {
+                                              this._get_settings().dnd.drag_finish.call(this, { "o" : o, "r" : r, "p" : last_pos });
+                                 }
+                              }
+                              else {
+                                 this.dnd_prepare();
+                                    this.move_node(o, r, last_pos, e[this._get_settings().dnd.copy_modifier + "Key"]);
+                             }
+                              o = false;
+                             r = false;
+                             m.hide();
+                              if(ml) { ml.hide(); }
+                  },
+                     dnd_enter : function (obj) {
+                           if(this.data.dnd.mto) {
+                                        clearTimeout(this.data.dnd.mto);
+                                       this.data.dnd.mto = false;
+                             }
+                              var s = this._get_settings().dnd;
+                              this.data.dnd.prepared = false;
+                                r = this._get_node(obj);
+                               if(s.check_timeout) {
+                                  // do the calculations after a minimal timeout (users tend to drag quickly to the desired location)
+                                    if(this.data.dnd.to1) { clearTimeout(this.data.dnd.to1); }
+                                     this.data.dnd.to1 = setTimeout($.proxy(this.dnd_prepare, this), s.check_timeout);
+                              }
+                              else {
+                                 this.dnd_prepare();
+                            }
+                              if(s.open_timeout) {
+                                   if(this.data.dnd.to2) { clearTimeout(this.data.dnd.to2); }
+                                     if(r && r.length && r.hasClass("jstree-closed")) {
+                                             // if the node is closed - open it, then recalculate
+                                           this.data.dnd.to2 = setTimeout($.proxy(this.dnd_open, this), s.open_timeout);
+                                  }
+                              }
+                              else {
+                                 if(r && r.length && r.hasClass("jstree-closed")) {
+                                             this.dnd_open();
+                                       }
+                              }
+                      },
+                     dnd_leave : function (e) {
+                             this.data.dnd.after               = false;
+                          this.data.dnd.before = false;
+                          this.data.dnd.inside = false;
+                          $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
+                            m.hide();
+                              if(ml) { ml.hide(); }
+                          if(r && r[0] === e.target.parentNode) {
+                                        if(this.data.dnd.to1) {
+                                                clearTimeout(this.data.dnd.to1);
+                                               this.data.dnd.to1 = false;
+                                     }
+                                      if(this.data.dnd.to2) {
+                                                clearTimeout(this.data.dnd.to2);
+                                               this.data.dnd.to2 = false;
+                                     }
+                              }
+                      },
+                     start_drag : function (obj, e) {
+                               o = this._get_node(obj);
+                               if(this.data.ui && this.is_selected(o)) { o = this._get_node(null, true); }
+                            var dt = o.length > 1 ? this._get_string("multiple_selection") : this.get_text(o),
+                                     cnt = this.get_container();
+                            if(!this._get_settings().core.html_titles) { dt = dt.replace(/</ig,"&lt;").replace(/>/ig,"&gt;"); }
+                            $.vakata.dnd.drag_start(e, { jstree : true, obj : o }, "<ins class='jstree-icon'></ins>" + dt );
+                               if(this.data.themes) {
+                                 if(m) { m.attr("class", "jstree-" + this.data.themes.theme); }
+                                 if(ml) { ml.attr("class", "jstree-" + this.data.themes.theme); }
+                                       $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme);
+                               }
+                              this.data.dnd.cof = cnt.offset();
+                              this.data.dnd.cw = parseInt(cnt.width(),10);
+                           this.data.dnd.ch = parseInt(cnt.height(),10);
+                          this.data.dnd.active = true;
+                   }
+              }
+      });
+    $(function() {
+         var css_string = '' +
+                  '#vakata-dragged ins { display:block; text-decoration:none; width:16px; height:16px; margin:0 0 0 0; padding:0; position:absolute; top:4px; left:4px; ' +
+                      ' -moz-border-radius:4px; border-radius:4px; -webkit-border-radius:4px; ' +
+                    '} ' +
+                 '#vakata-dragged .jstree-ok { background:green; } ' +
+                  '#vakata-dragged .jstree-invalid { background:red; } ' +
+                       '#jstree-marker { padding:0; margin:0; font-size:12px; overflow:hidden; height:12px; width:8px; position:absolute; top:-30px; z-index:10001; background-repeat:no-repeat; display:none; background-color:transparent; text-shadow:1px 1px 1px white; color:black; line-height:10px; } ' +
+                      '#jstree-marker-line { padding:0; margin:0; line-height:0%; font-size:1px; overflow:hidden; height:1px; width:100px; position:absolute; top:-30px; z-index:10000; background-repeat:no-repeat; display:none; background-color:#456c43; ' +
+                     ' cursor:pointer; border:1px solid #eeeeee; border-left:0; -moz-box-shadow: 0px 0px 2px #666; -webkit-box-shadow: 0px 0px 2px #666; box-shadow: 0px 0px 2px #666; ' +
+                  ' -moz-border-radius:1px; border-radius:1px; -webkit-border-radius:1px; ' +
+                    '}' +
+                  '';
+            $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
+                m = $("<div />").attr({ id : "jstree-marker" }).hide().html("&raquo;")
+                 .bind("mouseleave mouseenter", function (e) {
+                          m.hide();
+                              ml.hide();
+                             e.preventDefault();
+                            e.stopImmediatePropagation();
+                          return false;
+                  })
+                     .appendTo("body");
+             ml = $("<div />").attr({ id : "jstree-marker-line" }).hide()
+                   .bind("mouseup", function (e) {
+                                if(r && r.length) {
+                                    r.children("a").trigger(e);
+                                    e.preventDefault();
+                                    e.stopImmediatePropagation();
+                                  return false;
+                          }
+                      })
+                     .bind("mouseleave", function (e) {
+                             var rt = $(e.relatedTarget);
+                           if(rt.is(".jstree") || rt.closest(".jstree").length === 0) {
+                                   if(r && r.length) {
+                                            r.children("a").trigger(e);
+                                            m.hide();
+                                              ml.hide();
+                                             e.preventDefault();
+                                            e.stopImmediatePropagation();
+                                          return false;
+                                  }
+                              }
+                      })
+                     .appendTo("body");
+             $(document).bind("drag_start.vakata", function (e, data) {
+                     if(data.data.jstree) { m.show(); if(ml) { ml.show(); } }
+               });
+            $(document).bind("drag_stop.vakata", function (e, data) {
+                      if(data.data.jstree) { m.hide(); if(ml) { ml.hide(); } }
+               });
+    });
+})(jQuery);
+//*/
+
+/*
+ * jsTree checkbox plugin
+ * Inserts checkboxes in front of every node
+ * Depends on the ui plugin
+ * DOES NOT WORK NICELY WITH MULTITREE DRAG'N'DROP
+ */
+(function ($) {
+     $.jstree.plugin("checkbox", {
+          __init : function () {
+                 this.data.checkbox.noui = this._get_settings().checkbox.override_ui;
+                   if(this.data.ui && this.data.checkbox.noui) {
+                          this.select_node = this.deselect_node = this.deselect_all = $.noop;
+                            this.get_selected = this.get_checked;
+                  }
+
+                     this.get_container()
+                           .bind("open_node.jstree create_node.jstree clean_node.jstree refresh.jstree", $.proxy(function (e, data) {
+                                             this._prepare_checkboxes(data.rslt.obj);
+                                       }, this))
+                              .bind("loaded.jstree", $.proxy(function (e) {
+                                          this._prepare_checkboxes();
+                                    }, this))
+                              .delegate( (this.data.ui && this.data.checkbox.noui ? "a" : "ins.jstree-checkbox") , "click.jstree", $.proxy(function (e) {
+                                            e.preventDefault();
+                                            if(this._get_node(e.target).hasClass("jstree-checked")) { this.uncheck_node(e.target); }
+                                               else { this.check_node(e.target); }
+                                            if(this.data.ui && this.data.checkbox.noui) {
+                                                  this.save_selected();
+                                                  if(this.data.cookies) { this.save_cookie("select_node"); }
+                                             }
+                                              else {
+                                                 e.stopImmediatePropagation();
+                                                  return false;
+                                          }
+                                      }, this));
+             },
+             defaults : {
+                   override_ui : false,
+                   two_state : false,
+                     real_checkboxes : false,
+                       checked_parent_open : true,
+                    real_checkboxes_names : function (n) { return [ ("check_" + (n[0].id || Math.ceil(Math.random() * 10000))) , 1]; }
+             },
+             __destroy : function () {
+                      this.get_container()
+                           .find("input.jstree-real-checkbox").removeClass("jstree-real-checkbox").end()
+                          .find("ins.jstree-checkbox").remove();
+         },
+             _fn : {
+                        _checkbox_notify : function (n, data) {
+                                if(data.checked) {
+                                     this.check_node(n, false);
+                             }
+                      },
+                     _prepare_checkboxes : function (obj) {
+                         obj = !obj || obj == -1 ? this.get_container().find("> ul > li") : this._get_node(obj);
+                                if(obj === false) { return; } // added for removing root nodes
+                         var c, _this = this, t, ts = this._get_settings().checkbox.two_state, rc = this._get_settings().checkbox.real_checkboxes, rcn = this._get_settings().checkbox.real_checkboxes_names;
+                           obj.each(function () {
+                                 t = $(this);
+                                   c = t.is("li") && (t.hasClass("jstree-checked") || (rc && t.children(":checked").length)) ? "jstree-checked" : "jstree-unchecked";
+                                     t.find("li").andSelf().each(function () {
+                                              var $t = $(this), nm;
+                                          $t.children("a" + (_this.data.languages ? "" : ":eq(0)") ).not(":has(.jstree-checkbox)").prepend("<ins class='jstree-checkbox'>&#160;</ins>").parent().not(".jstree-checked, .jstree-unchecked").addClass( ts ? "jstree-unchecked" : c );
+                                              if(rc) {
+                                                       if(!$t.children(":checkbox").length) {
+                                                         nm = rcn.call(_this, $t);
+                                                              $t.prepend("<input type='checkbox' class='jstree-real-checkbox' id='" + nm[0] + "' name='" + nm[0] + "' value='" + nm[1] + "' />");
+                                                    }
+                                                      else {
+                                                         $t.children(":checkbox").addClass("jstree-real-checkbox");
+                                                     }
+                                              }
+                                              if(!ts) {
+                                                      if(c === "jstree-checked" || $t.hasClass("jstree-checked") || $t.children(':checked').length) {
+                                                                $t.find("li").andSelf().addClass("jstree-checked").children(":checkbox").prop("checked", true);
+                                                        }
+                                              }
+                                              else {
+                                                 if($t.hasClass("jstree-checked") || $t.children(':checked').length) {
+                                                          $t.addClass("jstree-checked").children(":checkbox").prop("checked", true);
+                                                     }
+                                              }
+                                      });
+                            });
+                            if(!ts) {
+                                      obj.find(".jstree-checked").parent().parent().each(function () { _this._repair_state(this); });
+                                }
+                      },
+                     change_state : function (obj, state) {
+                         obj = this._get_node(obj);
+                             var coll = false, rc = this._get_settings().checkbox.real_checkboxes;
+                          if(!obj || obj === -1) { return false; }
+                               state = (state === false || state === true) ? state : obj.hasClass("jstree-checked");
+                          if(this._get_settings().checkbox.two_state) {
+                                  if(state) {
+                                            obj.removeClass("jstree-checked").addClass("jstree-unchecked");
+                                                if(rc) { obj.children(":checkbox").prop("checked", false); }
+                                   }
+                                      else {
+                                         obj.removeClass("jstree-unchecked").addClass("jstree-checked");
+                                                if(rc) { obj.children(":checkbox").prop("checked", true); }
+                                    }
+                              }
+                              else {
+                                 if(state) {
+                                            coll = obj.find("li").andSelf();
+                                               if(!coll.filter(".jstree-checked, .jstree-undetermined").length) { return false; }
+                                             coll.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
+                                           if(rc) { coll.children(":checkbox").prop("checked", false); }
+                                  }
+                                      else {
+                                         coll = obj.find("li").andSelf();
+                                               if(!coll.filter(".jstree-unchecked, .jstree-undetermined").length) { return false; }
+                                           coll.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
+                                           if(rc) { coll.children(":checkbox").prop("checked", true); }
+                                           if(this.data.ui) { this.data.ui.last_selected = obj; }
+                                         this.data.checkbox.last_selected = obj;
+                                        }
+                                      obj.parentsUntil(".jstree", "li").each(function () {
+                                           var $this = $(this);
+                                           if(state) {
+                                                    if($this.children("ul").children("li.jstree-checked, li.jstree-undetermined").length) {
+                                                                $this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
+                                                          if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").prop("checked", false); }
+                                                         return false;
+                                                  }
+                                                      else {
+                                                         $this.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
+                                                          if(rc) { $this.children(":checkbox").prop("checked", false); }
+                                                 }
+                                              }
+                                              else {
+                                                 if($this.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length) {
+                                                              $this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
+                                                          if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").prop("checked", false); }
+                                                         return false;
+                                                  }
+                                                      else {
+                                                         $this.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
+                                                          if(rc) { $this.children(":checkbox").prop("checked", true); }
+                                                  }
+                                              }
+                                      });
+                            }
+                              if(this.data.ui && this.data.checkbox.noui) { this.data.ui.selected = this.get_checked(); }
+                            this.__callback(obj);
+                          return true;
+                   },
+                     check_node : function (obj) {
+                          if(this.change_state(obj, false)) {
+                                    obj = this._get_node(obj);
+                                     if(this._get_settings().checkbox.checked_parent_open) {
+                                                var t = this;
+                                          obj.parents(".jstree-closed").each(function () { t.open_node(this, false, true); });
+                                   }
+                                      this.__callback({ "obj" : obj });
+                              }
+                      },
+                     uncheck_node : function (obj) {
+                                if(this.change_state(obj, true)) { this.__callback({ "obj" : this._get_node(obj) }); }
+                 },
+                     check_all : function () {
+                              var _this = this,
+                                      coll = this._get_settings().checkbox.two_state ? this.get_container_ul().find("li") : this.get_container_ul().children("li");
+                          coll.each(function () {
+                                        _this.change_state(this, false);
+                               });
+                            this.__callback();
+                     },
+                     uncheck_all : function () {
+                            var _this = this,
+                                      coll = this._get_settings().checkbox.two_state ? this.get_container_ul().find("li") : this.get_container_ul().children("li");
+                          coll.each(function () {
+                                        _this.change_state(this, true);
+                                });
+                            this.__callback();
+                     },
+
+                    is_checked : function(obj) {
+                           obj = this._get_node(obj);
+                             return obj.length ? obj.is(".jstree-checked") : false;
+                 },
+                     get_checked : function (obj, get_all) {
+                                obj = !obj || obj === -1 ? this.get_container() : this._get_node(obj);
+                         return get_all || this._get_settings().checkbox.two_state ? obj.find(".jstree-checked") : obj.find("> ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked");
+                     },
+                     get_unchecked : function (obj, get_all) {
+                              obj = !obj || obj === -1 ? this.get_container() : this._get_node(obj);
+                         return get_all || this._get_settings().checkbox.two_state ? obj.find(".jstree-unchecked") : obj.find("> ul > .jstree-unchecked, .jstree-undetermined > ul > .jstree-unchecked");
+                       },
+
+                    show_checkboxes : function () { this.get_container().children("ul").removeClass("jstree-no-checkboxes"); },
+                    hide_checkboxes : function () { this.get_container().children("ul").addClass("jstree-no-checkboxes"); },
+
+                      _repair_state : function (obj) {
+                               obj = this._get_node(obj);
+                             if(!obj.length) { return; }
+                            if(this._get_settings().checkbox.two_state) {
+                                  obj.find('li').andSelf().not('.jstree-checked').removeClass('jstree-undetermined').addClass('jstree-unchecked').children(':checkbox').prop('checked', true);
+                                   return;
+                                }
+                              var rc = this._get_settings().checkbox.real_checkboxes,
+                                        a = obj.find("> ul > .jstree-checked").length,
+                                 b = obj.find("> ul > .jstree-undetermined").length,
+                                    c = obj.find("> ul > li").length;
+                              if(c === 0) { if(obj.hasClass("jstree-undetermined")) { this.change_state(obj, false); } }
+                             else if(a === 0 && b === 0) { this.change_state(obj, true); }
+                          else if(a === c) { this.change_state(obj, false); }
+                            else {
+                                 obj.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
+                                     if(rc) { obj.parentsUntil(".jstree", "li").andSelf().children(":checkbox").prop("checked", false); }
+                           }
+                      },
+                     reselect : function () {
+                               if(this.data.ui && this.data.checkbox.noui) {
+                                  var _this = this,
+                                              s = this.data.ui.to_select;
+                                    s = $.map($.makeArray(s), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
+                                     this.deselect_all();
+                                   $.each(s, function (i, val) { _this.check_node(val); });
+                                       this.__callback();
+                             }
+                              else {
+                                 this.__call_old();
+                             }
+                      },
+                     save_loaded : function () {
+                            var _this = this;
+                              this.data.core.to_load = [];
+                           this.get_container_ul().find("li.jstree-closed.jstree-undetermined").each(function () {
+                                        if(this.id) { _this.data.core.to_load.push("#" + this.id); }
+                           });
+                    }
+              }
+      });
+    $(function() {
+         var css_string = '.jstree .jstree-real-checkbox { display:none; } ';
+           $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
+        });
+})(jQuery);
+//*/
+
+/*
+ * jsTree XML plugin
+ * The XML data store. Datastores are build by overriding the `load_node` and `_is_loaded` functions.
+ */
+(function ($) {
+        $.vakata.xslt = function (xml, xsl, callback) {
+                var rs = "", xm, xs, processor, support;
+               // TODO: IE9 no XSLTProcessor, no document.recalc
+              if(document.recalc) {
+                  xm = document.createElement('xml');
+                    xs = document.createElement('xml');
+                    xm.innerHTML = xml;
+                    xs.innerHTML = xsl;
+                    $("body").append(xm).append(xs);
+                       setTimeout( (function (xm, xs, callback) {
+                             return function () {
+                                   callback.call(null, xm.transformNode(xs.XMLDocument));
+                                 setTimeout( (function (xm, xs) { return function () { $(xm).remove(); $(xs).remove(); }; })(xm, xs), 200);
+                             };
+                     })(xm, xs, callback), 100);
+                    return true;
+           }
+              if(typeof window.DOMParser !== "undefined" && typeof window.XMLHttpRequest !== "undefined" && typeof window.XSLTProcessor === "undefined") {
+                   xml = new DOMParser().parseFromString(xml, "text/xml");
+                        xsl = new DOMParser().parseFromString(xsl, "text/xml");
+                        // alert(xml.transformNode());
+                 // callback.call(null, new XMLSerializer().serializeToString(rs));
+
+            }
+              if(typeof window.DOMParser !== "undefined" && typeof window.XMLHttpRequest !== "undefined" && typeof window.XSLTProcessor !== "undefined") {
+                   processor = new XSLTProcessor();
+                       support = $.isFunction(processor.transformDocument) ? (typeof window.XMLSerializer !== "undefined") : true;
+                    if(!support) { return false; }
+                 xml = new DOMParser().parseFromString(xml, "text/xml");
+                        xsl = new DOMParser().parseFromString(xsl, "text/xml");
+                        if($.isFunction(processor.transformDocument)) {
+                                rs = document.implementation.createDocument("", "", null);
+                             processor.transformDocument(xml, xsl, rs, null);
+                               callback.call(null, new XMLSerializer().serializeToString(rs));
+                                return true;
+                   }
+                      else {
+                         processor.importStylesheet(xsl);
+                               rs = processor.transformToFragment(xml, document);
+                             callback.call(null, $("<div />").append(rs).html());
+                           return true;
+                   }
+              }
+              return false;
+  };
+     var xsl = {
+            'nest' : '<' + '?xml version="1.0" encoding="utf-8" ?>' +
+                      '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >' +
+                   '<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/html" />' +
+                        '<xsl:template match="/">' +
+                   '   <xsl:call-template name="nodes">' +
+                  '            <xsl:with-param name="node" select="/root" />' +
+                    '  </xsl:call-template>' +
+                      '</xsl:template>' +
+                    '<xsl:template name="nodes">' +
+                        '      <xsl:param name="node" />' +
+                 '     <ul>' +
+                      '        <xsl:for-each select="$node/item">' +
+                        '              <xsl:variable name="children" select="count(./item) &gt; 0" />' +
+                   '           <li>' +
+                     '                 <xsl:attribute name="class">' +
+                    '                          <xsl:if test="position() = last()">jstree-last </xsl:if>' +
+                       '                               <xsl:choose>' +
+                   '                                   <xsl:when test="@state = \'open\'">jstree-open </xsl:when>' +
+                    '                                  <xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>' +
+                   '                                   <xsl:otherwise>jstree-leaf </xsl:otherwise>' +
+                   '                           </xsl:choose>' +
+                  '                            <xsl:value-of select="@class" />' +
+                       '                       </xsl:attribute>' +
+                        '                      <xsl:for-each select="@*">' +
+                      '                                <xsl:if test="name() != \'class\' and name() != \'state\' and name() != \'hasChildren\'">' +
+                      '                                        <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
+                    '                          </xsl:if>' +
+                      '                        </xsl:for-each>' +
+                 '     <ins class="jstree-icon"><xsl:text>&#xa0;</xsl:text></ins>' +
+                        '                      <xsl:for-each select="content/name">' +
+                    '                          <a>' +
+                    '                          <xsl:attribute name="href">' +
+                    '                                  <xsl:choose>' +
+                  '                                    <xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>' +
+                     '                                 <xsl:otherwise>#</xsl:otherwise>' +
+                      '                                        </xsl:choose>' +
+                 '                             </xsl:attribute>' +
+                       '                               <xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>' +
+                   '                           <xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>' +
+                   '                           <xsl:for-each select="@*">' +
+                     '                                 <xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">' +
+                    '                                          <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
+                   '                                   </xsl:if>' +
+                     '                         </xsl:for-each>' +
+                        '                                      <ins>' +
+                 '                                             <xsl:attribute name="class">jstree-icon ' +
+                     '                                                 <xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>' +
+                   '                                           </xsl:attribute>' +
+                     '                                         <xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>' +
+                    '                                          <xsl:text>&#xa0;</xsl:text>' +
+                  '                                    </ins>' +
+                        '                                      <xsl:copy-of select="./child::node()" />' +
+                      '                                </a>' +
+                   '                   </xsl:for-each>' +
+                 '                     <xsl:if test="$children or @hasChildren"><xsl:call-template name="nodes"><xsl:with-param name="node" select="current()" /></xsl:call-template></xsl:if>' +
+                 '             </li>' +
+                    '  </xsl:for-each>' +
+                   '   </ul>' +
+                     '</xsl:template>' +
+                    '</xsl:stylesheet>',
+
+          'flat' : '<' + '?xml version="1.0" encoding="utf-8" ?>' +
+                      '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >' +
+                   '<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/xml" />' +
+                 '<xsl:template match="/">' +
+                   '   <ul>' +
+                      '        <xsl:for-each select="//item[not(@parent_id) or @parent_id=0 or not(@parent_id = //item/@id)]">' + /* the last `or` may be removed */
+                        '              <xsl:call-template name="nodes">' +
+                 '                     <xsl:with-param name="node" select="." />' +
+                       '                       <xsl:with-param name="is_last" select="number(position() = last())" />' +
+                  '            </xsl:call-template>' +
+                     ' </xsl:for-each>' +
+                   '   </ul>' +
+                     '</xsl:template>' +
+                    '<xsl:template name="nodes">' +
+                        '      <xsl:param name="node" />' +
+                 '     <xsl:param name="is_last" />' +
+                      '        <xsl:variable name="children" select="count(//item[@parent_id=$node/attribute::id]) &gt; 0" />' +
+                    '  <li>' +
+                      '        <xsl:attribute name="class">' +
+                      '                <xsl:if test="$is_last = true()">jstree-last </xsl:if>' +
+                   '           <xsl:choose>' +
+                     '                 <xsl:when test="@state = \'open\'">jstree-open </xsl:when>' +
+                      '                        <xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>' +
+                     '                 <xsl:otherwise>jstree-leaf </xsl:otherwise>' +
+                     '         </xsl:choose>' +
+                    '          <xsl:value-of select="@class" />' +
+                 '     </xsl:attribute>' +
+                  '    <xsl:for-each select="@*">' +
+                        '              <xsl:if test="name() != \'parent_id\' and name() != \'hasChildren\' and name() != \'class\' and name() != \'state\'">' +
+                    '          <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
+                       '               </xsl:if>' +
+                        '      </xsl:for-each>' +
+                   '   <ins class="jstree-icon"><xsl:text>&#xa0;</xsl:text></ins>' +
+                        '      <xsl:for-each select="content/name">' +
+                      '                <a>' +
+                      '                <xsl:attribute name="href">' +
+                      '                        <xsl:choose>' +
+                    '                  <xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>' +
+                       '                       <xsl:otherwise>#</xsl:otherwise>' +
+                        '                      </xsl:choose>' +
+                   '           </xsl:attribute>' +
+                 '             <xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>' +
+                     '         <xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>' +
+                     '         <xsl:for-each select="@*">' +
+                       '                       <xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">' +
+                      '                                <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
+                     '                 </xsl:if>' +
+                       '               </xsl:for-each>' +
+                  '                    <ins>' +
+                   '                           <xsl:attribute name="class">jstree-icon ' +
+                       '                                       <xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>' +
+                     '                         </xsl:attribute>' +
+                       '                               <xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>' +
+                      '                                <xsl:text>&#xa0;</xsl:text>' +
+                    '                  </ins>' +
+                  '                    <xsl:copy-of select="./child::node()" />' +
+                        '              </a>' +
+                     ' </xsl:for-each>' +
+                   '   <xsl:if test="$children">' +
+                 '             <ul>' +
+                     '         <xsl:for-each select="//item[@parent_id=$node/attribute::id]">' +
+                   '                   <xsl:call-template name="nodes">' +
+                        '                              <xsl:with-param name="node" select="." />' +
+                      '                                <xsl:with-param name="is_last" select="number(position() = last())" />' +
+                 '                     </xsl:call-template>' +
+                    '          </xsl:for-each>' +
+                  '            </ul>' +
+                    '  </xsl:if>' +
+                 '     </li>' +
+                     '</xsl:template>' +
+                    '</xsl:stylesheet>'
+    },
+     escape_xml = function(string) {
+                return string
+                  .toString()
+                    .replace(/&/g, '&amp;')
+                        .replace(/</g, '&lt;')
+                 .replace(/>/g, '&gt;')
+                 .replace(/"/g, '&quot;')
+                       .replace(/'/g, '&apos;');
+      };
+     $.jstree.plugin("xml_data", {
+          defaults : {
+                   data : false,
+                  ajax : false,
+                  xsl : "flat",
+                  clean_node : false,
+                    correct_state : true,
+                  get_skip_empty : false,
+                        get_include_preamble : true
+            },
+             _fn : {
+                        load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_xml(obj, function () { _this.__callback({ "obj" : _this._get_node(obj) }); s_call.call(this); }, e_call); },
+                     _is_loaded : function (obj) {
+                          var s = this._get_settings().xml_data;
+                         obj = this._get_node(obj);
+                             return obj == -1 || !obj || (!s.ajax && !$.isFunction(s.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").size() > 0;
+                        },
+                     load_node_xml : function (obj, s_call, e_call) {
+                               var s = this.get_settings().xml_data,
+                                  error_func = function () {},
+                                   success_func = function () {};
+
+                                obj = this._get_node(obj);
+                             if(obj && obj !== -1) {
+                                        if(obj.data("jstree_is_loading")) { return; }
+                                  else { obj.data("jstree_is_loading",true); }
+                           }
+                              switch(!0) {
+                                   case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";
+                                   case ($.isFunction(s.data)):
+                                           s.data.call(this, obj, $.proxy(function (d) {
+                                                  this.parse_xml(d, $.proxy(function (d) {
+                                                               if(d) {
+                                                                        d = d.replace(/ ?xmlns="[^"]*"/ig, "");
+                                                                        if(d.length > 10) {
+                                                                            d = $(d);
+                                                                              if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
+                                                                           else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree_is_loading"); }
+                                                                           if(s.clean_node) { this.clean_node(obj); }
+                                                                             if(s_call) { s_call.call(this); }
+                                                                      }
+                                                                      else {
+                                                                         if(obj && obj !== -1) {
+                                                                                        obj.children("a.jstree-loading").removeClass("jstree-loading");
+                                                                                        obj.removeData("jstree_is_loading");
+                                                                                   if(s.correct_state) {
+                                                                                          this.correct_state(obj);
+                                                                                               if(s_call) { s_call.call(this); }
+                                                                                      }
+                                                                              }
+                                                                              else {
+                                                                                 if(s.correct_state) {
+                                                                                          this.get_container().children("ul").empty();
+                                                                                           if(s_call) { s_call.call(this); }
+                                                                                      }
+                                                                              }
+                                                                      }
+                                                              }
+                                                      }, this));
+                                             }, this));
+                                             break;
+                                 case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):
+                                          if(!obj || obj == -1) {
+                                                        this.parse_xml(s.data, $.proxy(function (d) {
+                                                          if(d) {
+                                                                        d = d.replace(/ ?xmlns="[^"]*"/ig, "");
+                                                                        if(d.length > 10) {
+                                                                            d = $(d);
+                                                                              this.get_container().children("ul").empty().append(d.children());
+                                                                              if(s.clean_node) { this.clean_node(obj); }
+                                                                             if(s_call) { s_call.call(this); }
+                                                                      }
+                                                              }
+                                                              else {
+                                                                 if(s.correct_state) {
+                                                                          this.get_container().children("ul").empty();
+                                                                           if(s_call) { s_call.call(this); }
+                                                                      }
+                                                              }
+                                                      }, this));
+                                             }
+                                              break;
+                                 case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):
+                                             error_func = function (x, t, e) {
+                                                      var ef = this.get_settings().xml_data.ajax.error;
+                                                      if(ef) { ef.call(this, x, t, e); }
+                                                     if(obj !== -1 && obj.length) {
+                                                         obj.children("a.jstree-loading").removeClass("jstree-loading");
+                                                                obj.removeData("jstree_is_loading");
+                                                           if(t === "success" && s.correct_state) { this.correct_state(obj); }
+                                                    }
+                                                      else {
+                                                         if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }
+                                                        }
+                                                      if(e_call) { e_call.call(this); }
+                                              };
+                                             success_func = function (d, t, x) {
+                                                    d = x.responseText;
+                                                    var sf = this.get_settings().xml_data.ajax.success;
+                                                    if(sf) { d = sf.call(this,d,t,x) || d; }
+                                                       if(d === "" || (d && d.toString && d.toString().replace(/^[\s\n]+$/,"") === "")) {
+                                                             return error_func.call(this, x, t, "");
+                                                        }
+                                                      this.parse_xml(d, $.proxy(function (d) {
+                                                               if(d) {
+                                                                        d = d.replace(/ ?xmlns="[^"]*"/ig, "");
+                                                                        if(d.length > 10) {
+                                                                            d = $(d);
+                                                                              if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
+                                                                           else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree_is_loading"); }
+                                                                           if(s.clean_node) { this.clean_node(obj); }
+                                                                             if(s_call) { s_call.call(this); }
+                                                                      }
+                                                                      else {
+                                                                         if(obj && obj !== -1) {
+                                                                                        obj.children("a.jstree-loading").removeClass("jstree-loading");
+                                                                                        obj.removeData("jstree_is_loading");
+                                                                                   if(s.correct_state) {
+                                                                                          this.correct_state(obj);
+                                                                                               if(s_call) { s_call.call(this); }
+                                                                                      }
+                                                                              }
+                                                                              else {
+                                                                                 if(s.correct_state) {
+                                                                                          this.get_container().children("ul").empty();
+                                                                                           if(s_call) { s_call.call(this); }
+                                                                                      }
+                                                                              }
+                                                                      }
+                                                              }
+                                                      }, this));
+                                             };
+                                             s.ajax.context = this;
+                                         s.ajax.error = error_func;
+                                             s.ajax.success = success_func;
+                                         if(!s.ajax.dataType) { s.ajax.dataType = "xml"; }
+                                              if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
+                                              if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
+                                           $.ajax(s.ajax);
+                                                break;
+                         }
+                      },
+                     parse_xml : function (xml, callback) {
+                         var s = this._get_settings().xml_data;
+                         $.vakata.xslt(xml, xsl[s.xsl], callback);
+                      },
+                     get_xml : function (tp, obj, li_attr, a_attr, is_callback) {
+                           var result = "",
+                                       s = this._get_settings(),
+                                      _this = this,
+                                  tmp1, tmp2, li, a, lang;
+                               if(!tp) { tp = "flat"; }
+                               if(!is_callback) { is_callback = 0; }
+                          obj = this._get_node(obj);
+                             if(!obj || obj === -1) { obj = this.get_container().find("> ul > li"); }
+                               li_attr = $.isArray(li_attr) ? li_attr : [ "id", "class" ];
+                            if(!is_callback && this.data.types && $.inArray(s.types.type_attr, li_attr) === -1) { li_attr.push(s.types.type_attr); }
+
+                              a_attr = $.isArray(a_attr) ? a_attr : [ ];
+
+                            if(!is_callback) {
+                                     if(s.xml_data.get_include_preamble) {
+                                          result += '<' + '?xml version="1.0" encoding="UTF-8"?' + '>';
+                                  }
+                                      result += "<root>";
+                            }
+                              obj.each(function () {
+                                 result += "<item";
+                                     li = $(this);
+                                  $.each(li_attr, function (i, v) {
+                                              var t = li.attr(v);
+                                            if(!s.xml_data.get_skip_empty || typeof t !== "undefined") {
+                                                   result += " " + v + "=\"" + escape_xml((" " + (t || "")).replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")) + "\"";
+                                         }
+                                      });
+                                    if(li.hasClass("jstree-open")) { result += " state=\"open\""; }
+                                        if(li.hasClass("jstree-closed")) { result += " state=\"closed\""; }
+                                    if(tp === "flat") { result += " parent_id=\"" + escape_xml(is_callback) + "\""; }
+                                      result += ">";
+                                 result += "<content>";
+                                 a = li.children("a");
+                                  a.each(function () {
+                                           tmp1 = $(this);
+                                                lang = false;
+                                          result += "<name";
+                                             if($.inArray("languages", s.plugins) !== -1) {
+                                                 $.each(s.languages, function (k, z) {
+                                                          if(tmp1.hasClass(z)) { result += " lang=\"" + escape_xml(z) + "\""; lang = z; return false; }
+                                                  });
+                                            }
+                                              if(a_attr.length) {
+                                                    $.each(a_attr, function (k, z) {
+                                                               var t = tmp1.attr(z);
+                                                          if(!s.xml_data.get_skip_empty || typeof t !== "undefined") {
+                                                                   result += " " + z + "=\"" + escape_xml((" " + t || "").replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")) + "\"";
+                                                           }
+                                                      });
+                                            }
+                                              if(tmp1.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/^\s+$/ig,"").length) {
+                                                 result += ' icon="' + escape_xml(tmp1.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")) + '"';
+                                           }
+                                              if(tmp1.children("ins").get(0).style.backgroundImage.length) {
+                                                 result += ' icon="' + escape_xml(tmp1.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","").replace(/'/ig,"").replace(/"/ig,"")) + '"';
+                                              }
+                                              result += ">";
+                                         result += "<![CDATA[" + _this.get_text(tmp1, lang) + "]]>";
+                                            result += "</name>";
+                                   });
+                                    result += "</content>";
+                                        tmp2 = li[0].id || true;
+                                       li = li.find("> ul > li");
+                                     if(li.length) { tmp2 = _this.get_xml(tp, li, li_attr, a_attr, tmp2); }
+                                 else { tmp2 = ""; }
+                                    if(tp == "nest") { result += tmp2; }
+                                   result += "</item>";
+                                   if(tp == "flat") { result += tmp2; }
+                           });
+                            if(!is_callback) { result += "</root>"; }
+                              return result;
+                 }
+              }
+      });
+})(jQuery);
+//*/
+
+/*
+ * jsTree search plugin
+ * Enables both sync and async search on the tree
+ * DOES NOT WORK WITH JSON PROGRESSIVE RENDER
+ */
+(function ($) {
+   $.expr[':'].jstree_contains = function(a,i,m){
+         return (a.textContent || a.innerText || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;
+      };
+     $.expr[':'].jstree_title_contains = function(a,i,m) {
+          return (a.getAttribute("title") || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;
+   };
+     $.jstree.plugin("search", {
+            __init : function () {
+                 this.data.search.str = "";
+                     this.data.search.result = $();
+                 if(this._get_settings().search.show_only_matches) {
+                            this.get_container()
+                                   .bind("search.jstree", function (e, data) {
+                                            $(this).children("ul").find("li").hide().removeClass("jstree-last");
+                                           data.rslt.nodes.parentsUntil(".jstree").andSelf().show()
+                                                       .filter("ul").each(function () { $(this).children("li:visible").eq(-1).addClass("jstree-last"); });
+                                    })
+                                     .bind("clear_search.jstree", function () {
+                                             $(this).children("ul").find("li").css("display","").end().end().jstree("clean_node", -1);
+                                      });
+                    }
+              },
+             defaults : {
+                   ajax : false,
+                  search_method : "jstree_contains", // for case insensitive - jstree_contains
+                   show_only_matches : false
+              },
+             _fn : {
+                        search : function (str, skip_async) {
+                          if($.trim(str) === "") { this.clear_search(); return; }
+                                var s = this.get_settings().search,
+                                    t = this,
+                                      error_func = function () { },
+                                  success_func = function () { };
+                                this.data.search.str = str;
+
+                           if(!skip_async && s.ajax !== false && this.get_container_ul().find("li.jstree-closed:not(:has(ul)):eq(0)").length > 0) {
+                                       this.search.supress_callback = true;
+                                   error_func = function () { };
+                                  success_func = function (d, t, x) {
+                                            var sf = this.get_settings().search.ajax.success;
+                                              if(sf) { d = sf.call(this,d,t,x) || d; }
+                                               this.data.search.to_open = d;
+                                          this._search_open();
+                                   };
+                                     s.ajax.context = this;
+                                 s.ajax.error = error_func;
+                                     s.ajax.success = success_func;
+                                 if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, str); }
+                                      if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, str); }
+                                   if(!s.ajax.data) { s.ajax.data = { "search_string" : str }; }
+                                  if(!s.ajax.dataType || /^json/.exec(s.ajax.dataType)) { s.ajax.dataType = "json"; }
+                                    $.ajax(s.ajax);
+                                        return;
+                                }
+                              if(this.data.search.result.length) { this.clear_search(); }
+                            this.data.search.result = this.get_container().find("a" + (this.data.languages ? "." + this.get_lang() : "" ) + ":" + (s.search_method) + "(" + this.data.search.str + ")");
+                           this.data.search.result.addClass("jstree-search").parent().parents(".jstree-closed").each(function () {
+                                        t.open_node(this, false, true);
+                                });
+                            this.__callback({ nodes : this.data.search.result, str : str });
+                       },
+                     clear_search : function (str) {
+                                this.data.search.result.removeClass("jstree-search");
+                          this.__callback(this.data.search.result);
+                              this.data.search.result = $();
+                 },
+                     _search_open : function (is_callback) {
+                                var _this = this,
+                                      done = true,
+                                   current = [],
+                                  remaining = [];
+                                if(this.data.search.to_open.length) {
+                                  $.each(this.data.search.to_open, function (i, val) {
+                                           if(val == "#") { return true; }
+                                                if($(val).length && $(val).is(".jstree-closed")) { current.push(val); }
+                                                else { remaining.push(val); }
+                                  });
+                                    if(current.length) {
+                                           this.data.search.to_open = remaining;
+                                          $.each(current, function (i, val) {
+                                                    _this.open_node(val, function () { _this._search_open(true); });
+                                               });
+                                            done = false;
+                                  }
+                              }
+                              if(done) { this.search(this.data.search.str, true); }
+                  }
+              }
+      });
+})(jQuery);
+//*/
+
+/*
+ * jsTree contextmenu plugin
+ */
+(function ($) {
+      $.vakata.context = {
+           hide_on_mouseleave : false,
+
+           cnt         : $("<div id='vakata-contextmenu' />"),
+           vis         : false,
+          tgt          : false,
+          par          : false,
+          func : false,
+          data : false,
+          rtl          : false,
+          show : function (s, t, x, y, d, p, rtl) {
+                      $.vakata.context.rtl = !!rtl;
+                  var html = $.vakata.context.parse(s), h, w;
+                    if(!html) { return; }
+                  $.vakata.context.vis = true;
+                   $.vakata.context.tgt = t;
+                      $.vakata.context.par = p || t || null;
+                 $.vakata.context.data = d || null;
+                     $.vakata.context.cnt
+                           .html(html)
+                            .css({ "visibility" : "hidden", "display" : "block", "left" : 0, "top" : 0 });
+
+                        if($.vakata.context.hide_on_mouseleave) {
+                              $.vakata.context.cnt
+                                   .one("mouseleave", function(e) { $.vakata.context.hide(); });
+                  }
+
+                     h = $.vakata.context.cnt.height();
+                     w = $.vakata.context.cnt.width();
+                      if(x + w > $(document).width()) {
+                              x = $(document).width() - (w + 5);
+                             $.vakata.context.cnt.find("li > ul").addClass("right");
+                        }
+                      if(y + h > $(document).height()) {
+                             y = y - (h + t[0].offsetHeight);
+                               $.vakata.context.cnt.find("li > ul").addClass("bottom");
+                       }
+
+                     $.vakata.context.cnt
+                           .css({ "left" : x, "top" : y })
+                                .find("li:has(ul)")
+                                    .bind("mouseenter", function (e) {
+                                             var w = $(document).width(),
+                                                   h = $(document).height(),
+                                                      ul = $(this).children("ul").show();
+                                            if(w !== $(document).width()) { ul.toggleClass("right"); }
+                                             if(h !== $(document).height()) { ul.toggleClass("bottom"); }
+                                   })
+                                     .bind("mouseleave", function (e) {
+                                             $(this).children("ul").hide();
+                                 })
+                                     .end()
+                         .css({ "visibility" : "visible" })
+                             .show();
+                       $(document).triggerHandler("context_show.vakata");
+             },
+             hide      : function () {
+                   $.vakata.context.vis = false;
+                  $.vakata.context.cnt.attr("class","").css({ "visibility" : "hidden" });
+                        $(document).triggerHandler("context_hide.vakata");
+             },
+             parse     : function (s, is_callback) {
+                    if(!s) { return false; }
+                       var str = "",
+                          tmp = false,
+                           was_sep = true;
+                        if(!is_callback) { $.vakata.context.func = {}; }
+                       str += "<ul>";
+                 $.each(s, function (i, val) {
+                          if(!val) { return true; }
+                              $.vakata.context.func[i] = val.action;
+                         if(!was_sep && val.separator_before) {
+                                 str += "<li class='vakata-separator vakata-separator-before'></li>";
+                           }
+                              was_sep = false;
+                               str += "<li class='" + (val._class || "") + (val._disabled ? " jstree-contextmenu-disabled " : "") + "'><ins ";
+                                if(val.icon && val.icon.indexOf("/") === -1) { str += " class='" + val.icon + "' "; }
+                          if(val.icon && val.icon.indexOf("/") !== -1) { str += " style='background:url(" + val.icon + ") center center no-repeat;' "; }
+                         str += ">&#160;</ins><a href='#' rel='" + i + "'>";
+                            if(val.submenu) {
+                                      str += "<span style='float:" + ($.vakata.context.rtl ? "left" : "right") + ";'>&raquo;</span>";
+                                }
+                              str += val.label + "</a>";
+                             if(val.submenu) {
+                                      tmp = $.vakata.context.parse(val.submenu, true);
+                                       if(tmp) { str += tmp; }
+                                }
+                              str += "</li>";
+                                if(val.separator_after) {
+                                      str += "<li class='vakata-separator vakata-separator-after'></li>";
+                                    was_sep = true;
+                                }
+                      });
+                    str = str.replace(/<li class\='vakata-separator vakata-separator-after'\><\/li\>$/,"");
+                        str += "</ul>";
+                        $(document).triggerHandler("context_parse.vakata");
+                    return str.length > 10 ? str : false;
+          },
+             exec      : function (i) {
+                  if($.isFunction($.vakata.context.func[i])) {
+                           // if is string - eval and call it!
+                            $.vakata.context.func[i].call($.vakata.context.data, $.vakata.context.par);
+                            return true;
+                   }
+                      else { return false; }
+         }
+      };
+     $(function () {
+                var css_string = '' +
+                  '#vakata-contextmenu { display:block; visibility:hidden; left:0; top:-200px; position:absolute; margin:0; padding:0; min-width:180px; background:#ebebeb; border:1px solid silver; z-index:10000; *width:180px; } ' +
+                  '#vakata-contextmenu ul { min-width:180px; *width:180px; } ' +
+                 '#vakata-contextmenu ul, #vakata-contextmenu li { margin:0; padding:0; list-style-type:none; display:block; } ' +
+                      '#vakata-contextmenu li { line-height:20px; min-height:20px; position:relative; padding:0px; } ' +
+                     '#vakata-contextmenu li a { padding:1px 6px; line-height:17px; display:block; text-decoration:none; margin:1px 1px 0 1px; } ' +
+                        '#vakata-contextmenu li ins { float:left; width:16px; height:16px; text-decoration:none; margin-right:2px; } ' +
+                       '#vakata-contextmenu li a:hover, #vakata-contextmenu li.vakata-hover > a { background:gray; color:white; } ' +
+                 '#vakata-contextmenu li ul { display:none; position:absolute; top:-2px; left:100%; background:#ebebeb; border:1px solid gray; } ' +
+                    '#vakata-contextmenu .right { right:100%; left:auto; } ' +
+                     '#vakata-contextmenu .bottom { bottom:-1px; top:auto; } ' +
+                    '#vakata-contextmenu li.vakata-separator { min-height:0; height:1px; line-height:1px; font-size:1px; overflow:hidden; margin:0 2px; background:silver; /* border-top:1px solid #fefefe; */ padding:0; } ';
+             $.vakata.css.add_sheet({ str : css_string, title : "vakata" });
+                $.vakata.context.cnt
+                   .delegate("a","click", function (e) { e.preventDefault(); })
+                   .delegate("a","mouseup", function (e) {
+                                if(!$(this).parent().hasClass("jstree-contextmenu-disabled") && $.vakata.context.exec($(this).attr("rel"))) {
+                                  $.vakata.context.hide();
+                               }
+                              else { $(this).blur(); }
+                       })
+                     .delegate("a","mouseover", function () {
+                               $.vakata.context.cnt.find(".vakata-hover").removeClass("vakata-hover");
+                        })
+                     .appendTo("body");
+             $(document).bind("mousedown", function (e) { if($.vakata.context.vis && !$.contains($.vakata.context.cnt[0], e.target)) { $.vakata.context.hide(); } });
+               if(typeof $.hotkeys !== "undefined") {
+                 $(document)
+                            .bind("keydown", "up", function (e) {
+                                  if($.vakata.context.vis) {
+                                             var o = $.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").prevAll("li:not(.vakata-separator)").first();
+                                             if(!o.length) { o = $.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").last(); }
+                                             o.addClass("vakata-hover");
+                                            e.stopImmediatePropagation();
+                                          e.preventDefault();
+                                    }
+                              })
+                             .bind("keydown", "down", function (e) {
+                                        if($.vakata.context.vis) {
+                                             var o = $.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").nextAll("li:not(.vakata-separator)").first();
+                                             if(!o.length) { o = $.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").first(); }
+                                            o.addClass("vakata-hover");
+                                            e.stopImmediatePropagation();
+                                          e.preventDefault();
+                                    }
+                              })
+                             .bind("keydown", "right", function (e) {
+                                       if($.vakata.context.vis) {
+                                             $.vakata.context.cnt.find(".vakata-hover").children("ul").show().children("li:not(.vakata-separator)").removeClass("vakata-hover").first().addClass("vakata-hover");
+                                           e.stopImmediatePropagation();
+                                          e.preventDefault();
+                                    }
+                              })
+                             .bind("keydown", "left", function (e) {
+                                        if($.vakata.context.vis) {
+                                             $.vakata.context.cnt.find(".vakata-hover").children("ul").hide().children(".vakata-separator").removeClass("vakata-hover");
+                                            e.stopImmediatePropagation();
+                                          e.preventDefault();
+                                    }
+                              })
+                             .bind("keydown", "esc", function (e) {
+                                 $.vakata.context.hide();
+                                       e.preventDefault();
+                            })
+                             .bind("keydown", "space", function (e) {
+                                       $.vakata.context.cnt.find(".vakata-hover").last().children("a").click();
+                                       e.preventDefault();
+                            });
+            }
+      });
+
+   $.jstree.plugin("contextmenu", {
+               __init : function () {
+                 this.get_container()
+                           .delegate("a", "contextmenu.jstree", $.proxy(function (e) {
+                                            e.preventDefault();
+                                            if(!$(e.currentTarget).hasClass("jstree-loading")) {
+                                                   this.show_contextmenu(e.currentTarget, e.pageX, e.pageY);
+                                              }
+                                      }, this))
+                              .delegate("a", "click.jstree", $.proxy(function (e) {
+                                          if(this.data.contextmenu) {
+                                                    $.vakata.context.hide();
+                                               }
+                                      }, this))
+                              .bind("destroy.jstree", $.proxy(function () {
+                                          // TODO: move this to descruct method
+                                          if(this.data.contextmenu) {
+                                                    $.vakata.context.hide();
+                                               }
+                                      }, this));
+                     $(document).bind("context_hide.vakata", $.proxy(function () { this.data.contextmenu = false; }, this));
+                },
+             defaults : {
+                   select_node : false, // requires UI plugin
+                     show_at_node : true,
+                   items : { // Could be a function that should return an object like this one
+                            "create" : {
+                                   "separator_before"  : false,
+                                    "separator_after"  : true,
+                                      "label"                          : "Create",
+                                 "action"                      : function (obj) { this.create(obj); }
+                              },
+                             "rename" : {
+                                   "separator_before"  : false,
+                                    "separator_after"  : false,
+                                     "label"                           : "Rename",
+                                 "action"                      : function (obj) { this.rename(obj); }
+                              },
+                             "remove" : {
+                                   "separator_before"  : false,
+                                    "icon"                             : false,
+                                     "separator_after" : false,
+                                     "label"                           : "Delete",
+                                 "action"                      : function (obj) { if(this.is_selected(obj)) { this.remove(); } else { this.remove(obj); } }
+                                },
+                             "ccp" : {
+                                      "separator_before"       : true,
+                                     "icon"                            : false,
+                                     "separator_after" : false,
+                                     "label"                           : "Edit",
+                                   "action"                    : false,
+                                    "submenu" : {
+                                          "cut" : {
+                                                      "separator_before"       : false,
+                                                    "separator_after"  : false,
+                                                     "label"                           : "Cut",
+                                                    "action"                   : function (obj) { this.cut(obj); }
+                                         },
+                                             "copy" : {
+                                                     "separator_before"        : false,
+                                                    "icon"                             : false,
+                                                     "separator_after" : false,
+                                                     "label"                           : "Copy",
+                                                   "action"                    : function (obj) { this.copy(obj); }
+                                                },
+                                             "paste" : {
+                                                    "separator_before" : false,
+                                                    "icon"                             : false,
+                                                     "separator_after" : false,
+                                                     "label"                           : "Paste",
+                                                  "action"                     : function (obj) { this.paste(obj); }
+                                               }
+                                      }
+                              }
+                      }
+              },
+             _fn : {
+                        show_contextmenu : function (obj, x, y) {
+                              obj = this._get_node(obj);
+                             var s = this.get_settings().contextmenu,
+                                       a = obj.children("a:visible:eq(0)"),
+                                   o = false,
+                                     i = false;
+                             if(s.select_node && this.data.ui && !this.is_selected(obj)) {
+                                  this.deselect_all();
+                                   this.select_node(obj, true);
+                           }
+                              if(s.show_at_node || typeof x === "undefined" || typeof y === "undefined") {
+                                   o = a.offset();
+                                        x = o.left;
+                                    y = o.top + this.data.core.li_height;
+                          }
+                              i = obj.data("jstree") && obj.data("jstree").contextmenu ? obj.data("jstree").contextmenu : s.items;
+                           if($.isFunction(i)) { i = i.call(this, obj); }
+                         this.data.contextmenu = true;
+                          $.vakata.context.show(i, a, x, y, this, obj, this._get_settings().core.rtl);
+                           if(this.data.themes) { $.vakata.context.cnt.attr("class", "jstree-" + this.data.themes.theme + "-context"); }
+                  }
+              }
+      });
+})(jQuery);
+//*/
+
+/*
+ * jsTree types plugin
+ * Adds support types of nodes
+ * You can set an attribute on each li node, that represents its type.
+ * According to the type setting the node may get custom icon/validation rules
+ */
+(function ($) {
+       $.jstree.plugin("types", {
+             __init : function () {
+                 var s = this._get_settings().types;
+                    this.data.types.attach_to = [];
+                        this.get_container()
+                           .bind("init.jstree", $.proxy(function () {
+                                             var types = s.types,
+                                                   attr  = s.type_attr,
+                                                   icons_css = "",
+                                                        _this = this;
+
+                                         $.each(types, function (i, tp) {
+                                                       $.each(tp, function (k, v) {
+                                                           if(!/^(max_depth|max_children|icon|valid_children)$/.test(k)) { _this.data.types.attach_to.push(k); }
+                                                  });
+                                                    if(!tp.icon) { return true; }
+                                                  if( tp.icon.image || tp.icon.position) {
+                                                               if(i == "default")      { icons_css += '.jstree-' + _this.get_index() + ' a > .jstree-icon { '; }
+                                                           else                                { icons_css += '.jstree-' + _this.get_index() + ' li[' + attr + '="' + i + '"] > a > .jstree-icon { '; }
+                                                               if(tp.icon.image)       { icons_css += ' background-image:url(' + tp.icon.image + '); '; }
+                                                           if(tp.icon.position){ icons_css += ' background-position:' + tp.icon.position + '; '; }
+                                                                else                           { icons_css += ' background-position:0 0; '; }
+                                                         icons_css += '} ';
+                                                     }
+                                              });
+                                            if(icons_css !== "") { $.vakata.css.add_sheet({ 'str' : icons_css, title : "jstree-types" }); }
+                                        }, this))
+                              .bind("before.jstree", $.proxy(function (e, data) {
+                                            var s, t,
+                                                      o = this._get_settings().types.use_data ? this._get_node(data.args[0]) : false,
+                                                        d = o && o !== -1 && o.length ? o.data("jstree") : false;
+                                              if(d && d.types && d.types[data.func] === false) { e.stopImmediatePropagation(); return false; }
+                                               if($.inArray(data.func, this.data.types.attach_to) !== -1) {
+                                                   if(!data.args[0] || (!data.args[0].tagName && !data.args[0].jquery)) { return; }
+                                                       s = this._get_settings().types.types;
+                                                  t = this._get_type(data.args[0]);
+                                                      if(
+                                                            (
+                                                                      (s[t] && typeof s[t][data.func] !== "undefined") ||
+                                                                    (s["default"] && typeof s["default"][data.func] !== "undefined")
+                                                               ) && this._check(data.func, data.args[0]) === false
+                                                    ) {
+                                                            e.stopImmediatePropagation();
+                                                          return false;
+                                                  }
+                                              }
+                                      }, this));
+                     if(is_ie6) {
+                           this.get_container()
+                                   .bind("load_node.jstree set_type.jstree", $.proxy(function (e, data) {
+                                                 var r = data && data.rslt && data.rslt.obj && data.rslt.obj !== -1 ? this._get_node(data.rslt.obj).parent() : this.get_container_ul(),
+                                                         c = false,
+                                                             s = this._get_settings().types;
+                                                        $.each(s.types, function (i, tp) {
+                                                             if(tp.icon && (tp.icon.image || tp.icon.position)) {
+                                                                   c = i === "default" ? r.find("li > a > .jstree-icon") : r.find("li[" + s.type_attr + "='" + i + "'] > a > .jstree-icon");
+                                                                      if(tp.icon.image) { c.css("backgroundImage","url(" + tp.icon.image + ")"); }
+                                                                   c.css("backgroundPosition", tp.icon.position || "0 0");
+                                                                }
+                                                      });
+                                            }, this));
+                     }
+              },
+             defaults : {
+                   // defines maximum number of root nodes (-1 means unlimited, -2 means disable max_children checking)
+                   max_children                : -1,
+                    // defines the maximum depth of the tree (-1 means unlimited, -2 means disable max_depth checking)
+                     max_depth                 : -1,
+                      // defines valid node types for the root nodes
+                 valid_children                : "all",
+
+                      // whether to use $.data
+                       use_data : false,
+                      // where is the type stores (the rel attribute of the LI element)
+                      type_attr : "rel",
+                     // a list of types
+                     types : {
+                              // the default type
+                            "default" : {
+                                  "max_children"       : -1,
+                                   "max_depth"         : -1,
+                                     "valid_children": "all"
+
+                                       // Bound functions - you can bind any other function here (using boolean or function)
+                                  //"select_node"      : true
+                         }
+                      }
+              },
+             _fn : {
+                        _types_notify : function (n, data) {
+                           if(data.type && this._get_settings().types.use_data) {
+                                 this.set_type(data.type, n);
+                           }
+                      },
+                     _get_type : function (obj) {
+                           obj = this._get_node(obj);
+                             return (!obj || !obj.length) ? false : obj.attr(this._get_settings().types.type_attr) || "default";
+                    },
+                     set_type : function (str, obj) {
+                               obj = this._get_node(obj);
+                             var ret = (!obj.length || !str) ? false : obj.attr(this._get_settings().types.type_attr, str);
+                         if(ret) { this.__callback({ obj : obj, type : str}); }
+                         return ret;
+                    },
+                     _check : function (rule, obj, opts) {
+                          obj = this._get_node(obj);
+                             var v = false, t = this._get_type(obj), d = 0, _this = this, s = this._get_settings().types, data = false;
+                             if(obj === -1) {
+                                       if(!!s[rule]) { v = s[rule]; }
+                                 else { return; }
+                               }
+                              else {
+                                 if(t === false) { return; }
+                                    data = s.use_data ? obj.data("jstree") : false;
+                                        if(data && data.types && typeof data.types[rule] !== "undefined") { v = data.types[rule]; }
+                                    else if(!!s.types[t] && typeof s.types[t][rule] !== "undefined") { v = s.types[t][rule]; }
+                                     else if(!!s.types["default"] && typeof s.types["default"][rule] !== "undefined") { v = s.types["default"][rule]; }
+                             }
+                              if($.isFunction(v)) { v = v.call(this, obj); }
+                         if(rule === "max_depth" && obj !== -1 && opts !== false && s.max_depth !== -2 && v !== 0) {
+                                    // also include the node itself - otherwise if root node it is not checked
+                                     obj.children("a:eq(0)").parentsUntil(".jstree","li").each(function (i) {
+                                               // check if current depth already exceeds global tree depth
+                                            if(s.max_depth !== -1 && s.max_depth - (i + 1) <= 0) { v = 0; return false; }
+                                          d = (i === 0) ? v : _this._check(rule, this, false);
+                                           // check if current node max depth is already matched or exceeded
+                                              if(d !== -1 && d - (i + 1) <= 0) { v = 0; return false; }
+                                              // otherwise - set the max depth to the current value minus current depth
+                                              if(d >= 0 && (d - (i + 1) < v || v < 0) ) { v = d - (i + 1); }
+                                         // if the global tree depth exists and it minus the nodes calculated so far is less than `v` or `v` is unlimited
+                                               if(s.max_depth >= 0 && (s.max_depth - (i + 1) < v || v < 0) ) { v = s.max_depth - (i + 1); }
+                                   });
+                            }
+                              return v;
+                      },
+                     check_move : function () {
+                             if(!this.__call_old()) { return false; }
+                               var m  = this._get_move(),
+                                     s  = m.rt._get_settings().types,
+                                       mc = m.rt._check("max_children", m.cr),
+                                        md = m.rt._check("max_depth", m.cr),
+                                   vc = m.rt._check("valid_children", m.cr),
+                                      ch = 0, d = 1, t;
+
+                             if(vc === "none") { return false; }
+                            if($.isArray(vc) && m.ot && m.ot._get_type) {
+                                  m.o.each(function () {
+                                         if($.inArray(m.ot._get_type(this), vc) === -1) { d = false; return false; }
+                                    });
+                                    if(d === false) { return false; }
+                              }
+                              if(s.max_children !== -2 && mc !== -1) {
+                                       ch = m.cr === -1 ? this.get_container().find("> ul > li").not(m.o).length : m.cr.find("> ul > li").not(m.o).length;
+                                    if(ch + m.o.length > mc) { return false; }
+                             }
+                              if(s.max_depth !== -2 && md !== -1) {
+                                  d = 0;
+                                 if(md === 0) { return false; }
+                                 if(typeof m.o.d === "undefined") {
+                                             // TODO: deal with progressive rendering and async when checking max_depth (how to know the depth of the moved node)
+                                           t = m.o;
+                                               while(t.length > 0) {
+                                                  t = t.find("> ul > li");
+                                                       d ++;
+                                          }
+                                              m.o.d = d;
+                                     }
+                                      if(md - m.o.d < 0) { return false; }
+                           }
+                              return true;
+                   },
+                     create_node : function (obj, position, js, callback, is_loaded, skip_check) {
+                          if(!skip_check && (is_loaded || this._is_loaded(obj))) {
+                                       var p  = (typeof position == "string" && position.match(/^before|after$/i) && obj !== -1) ? this._get_parent(obj) : this._get_node(obj),
+                                               s  = this._get_settings().types,
+                                               mc = this._check("max_children", p),
+                                           md = this._check("max_depth", p),
+                                              vc = this._check("valid_children", p),
+                                         ch;
+                                    if(typeof js === "string") { js = { data : js }; }
+                                     if(!js) { js = {}; }
+                                   if(vc === "none") { return false; }
+                                    if($.isArray(vc)) {
+                                            if(!js.attr || !js.attr[s.type_attr]) {
+                                                        if(!js.attr) { js.attr = {}; }
+                                                 js.attr[s.type_attr] = vc[0];
+                                          }
+                                              else {
+                                                 if($.inArray(js.attr[s.type_attr], vc) === -1) { return false; }
+                                               }
+                                      }
+                                      if(s.max_children !== -2 && mc !== -1) {
+                                               ch = p === -1 ? this.get_container().find("> ul > li").length : p.find("> ul > li").length;
+                                            if(ch + 1 > mc) { return false; }
+                                      }
+                                      if(s.max_depth !== -2 && md !== -1 && (md - 1) < 0) { return false; }
+                          }
+                              return this.__call_old(true, obj, position, js, callback, is_loaded, skip_check);
+                      }
+              }
+      });
+})(jQuery);
+//*/
+
+/*
+ * jsTree HTML plugin
+ * The HTML data store. Datastores are build by replacing the `load_node` and `_is_loaded` functions.
+ */
+(function ($) {
+       $.jstree.plugin("html_data", {
+         __init : function () {
+                 // this used to use html() and clean the whitespace, but this way any attached data was lost
+                   this.data.html_data.original_container_html = this.get_container().find(" > ul > li").clone(true);
+                     // remove white space from LI node - otherwise nodes appear a bit to the right
+                 this.data.html_data.original_container_html.find("li").andSelf().contents().filter(function() { return this.nodeType == 3; }).remove();
+                },
+             defaults : {
+                   data : false,
+                  ajax : false,
+                  correct_state : true
+           },
+             _fn : {
+                        load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_html(obj, function () { _this.__callback({ "obj" : _this._get_node(obj) }); s_call.call(this); }, e_call); },
+                    _is_loaded : function (obj) {
+                          obj = this._get_node(obj);
+                             return obj == -1 || !obj || (!this._get_settings().html_data.ajax && !$.isFunction(this._get_settings().html_data.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").size() > 0;
+                      },
+                     load_node_html : function (obj, s_call, e_call) {
+                              var d,
+                                 s = this.get_settings().html_data,
+                                     error_func = function () {},
+                                   success_func = function () {};
+                         obj = this._get_node(obj);
+                             if(obj && obj !== -1) {
+                                        if(obj.data("jstree_is_loading")) { return; }
+                                  else { obj.data("jstree_is_loading",true); }
+                           }
+                              switch(!0) {
+                                   case ($.isFunction(s.data)):
+                                           s.data.call(this, obj, $.proxy(function (d) {
+                                                  if(d && d !== "" && d.toString && d.toString().replace(/^[\s\n]+$/,"") !== "") {
+                                                               d = $(d);
+                                                              if(!d.is("ul")) { d = $("<ul />").append(d); }
+                                                         if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); }
+                                                         else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree_is_loading"); }
+                                                         this.clean_node(obj);
+                                                          if(s_call) { s_call.call(this); }
+                                                      }
+                                                      else {
+                                                         if(obj && obj !== -1) {
+                                                                        obj.children("a.jstree-loading").removeClass("jstree-loading");
+                                                                        obj.removeData("jstree_is_loading");
+                                                                   if(s.correct_state) {
+                                                                          this.correct_state(obj);
+                                                                               if(s_call) { s_call.call(this); }
+                                                                      }
+                                                              }
+                                                              else {
+                                                                 if(s.correct_state) {
+                                                                          this.get_container().children("ul").empty();
+                                                                           if(s_call) { s_call.call(this); }
+                                                                      }
+                                                              }
+                                                      }
+                                              }, this));
+                                             break;
+                                 case (!s.data && !s.ajax):
+                                             if(!obj || obj == -1) {
+                                                        this.get_container()
+                                                           .children("ul").empty()
+                                                                .append(this.data.html_data.original_container_html)
+                                                           .find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end()
+                                                                .filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");
+                                                  this.clean_node();
+                                             }
+                                              if(s_call) { s_call.call(this); }
+                                              break;
+                                 case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):
+                                          if(!obj || obj == -1) {
+                                                        d = $(s.data);
+                                                 if(!d.is("ul")) { d = $("<ul />").append(d); }
+                                                 this.get_container()
+                                                           .children("ul").empty().append(d.children())
+                                                           .find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end()
+                                                                .filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");
+                                                  this.clean_node();
+                                             }
+                                              if(s_call) { s_call.call(this); }
+                                              break;
+                                 case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):
+                                             obj = this._get_node(obj);
+                                             error_func = function (x, t, e) {
+                                                      var ef = this.get_settings().html_data.ajax.error;
+                                                     if(ef) { ef.call(this, x, t, e); }
+                                                     if(obj != -1 && obj.length) {
+                                                          obj.children("a.jstree-loading").removeClass("jstree-loading");
+                                                                obj.removeData("jstree_is_loading");
+                                                           if(t === "success" && s.correct_state) { this.correct_state(obj); }
+                                                    }
+                                                      else {
+                                                         if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }
+                                                        }
+                                                      if(e_call) { e_call.call(this); }
+                                              };
+                                             success_func = function (d, t, x) {
+                                                    var sf = this.get_settings().html_data.ajax.success;
+                                                   if(sf) { d = sf.call(this,d,t,x) || d; }
+                                                       if(d === "" || (d && d.toString && d.toString().replace(/^[\s\n]+$/,"") === "")) {
+                                                             return error_func.call(this, x, t, "");
+                                                        }
+                                                      if(d) {
+                                                                d = $(d);
+                                                              if(!d.is("ul")) { d = $("<ul />").append(d); }
+                                                         if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); }
+                                                         else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree_is_loading"); }
+                                                         this.clean_node(obj);
+                                                          if(s_call) { s_call.call(this); }
+                                                      }
+                                                      else {
+                                                         if(obj && obj !== -1) {
+                                                                        obj.children("a.jstree-loading").removeClass("jstree-loading");
+                                                                        obj.removeData("jstree_is_loading");
+                                                                   if(s.correct_state) {
+                                                                          this.correct_state(obj);
+                                                                               if(s_call) { s_call.call(this); }
+                                                                      }
+                                                              }
+                                                              else {
+                                                                 if(s.correct_state) {
+                                                                          this.get_container().children("ul").empty();
+                                                                           if(s_call) { s_call.call(this); }
+                                                                      }
+                                                              }
+                                                      }
+                                              };
+                                             s.ajax.context = this;
+                                         s.ajax.error = error_func;
+                                             s.ajax.success = success_func;
+                                         if(!s.ajax.dataType) { s.ajax.dataType = "html"; }
+                                             if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
+                                              if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
+                                           $.ajax(s.ajax);
+                                                break;
+                         }
+                      }
+              }
+      });
+    // include the HTML data plugin by default
+     $.jstree.defaults.plugins.push("html_data");
+})(jQuery);
+//*/
+
+/*
+ * jsTree themeroller plugin
+ * Adds support for jQuery UI themes. Include this at the end of your plugins list, also make sure "themes" is not included.
+ */
+(function ($) {
+        $.jstree.plugin("themeroller", {
+               __init : function () {
+                 var s = this._get_settings().themeroller;
+                      this.get_container()
+                           .addClass("ui-widget-content")
+                         .addClass("jstree-themeroller")
+                                .delegate("a","mouseenter.jstree", function (e) {
+                                      if(!$(e.currentTarget).hasClass("jstree-loading")) {
+                                           $(this).addClass(s.item_h);
+                                    }
+                              })
+                             .delegate("a","mouseleave.jstree", function () {
+                                       $(this).removeClass(s.item_h);
+                         })
+                             .bind("init.jstree", $.proxy(function (e, data) {
+                                              data.inst.get_container().find("> ul > li > .jstree-loading > ins").addClass("ui-icon-refresh");
+                                               this._themeroller(data.inst.get_container().find("> ul > li"));
+                                        }, this))
+                              .bind("open_node.jstree create_node.jstree", $.proxy(function (e, data) {
+                                              this._themeroller(data.rslt.obj);
+                                      }, this))
+                              .bind("loaded.jstree refresh.jstree", $.proxy(function (e) {
+                                           this._themeroller();
+                                   }, this))
+                              .bind("close_node.jstree", $.proxy(function (e, data) {
+                                                this._themeroller(data.rslt.obj);
+                                      }, this))
+                              .bind("delete_node.jstree", $.proxy(function (e, data) {
+                                               this._themeroller(data.rslt.parent);
+                                   }, this))
+                              .bind("correct_state.jstree", $.proxy(function (e, data) {
+                                             data.rslt.obj
+                                                  .children("ins.jstree-icon").removeClass(s.opened + " " + s.closed + " ui-icon").end()
+                                                 .find("> a > ins.ui-icon")
+                                                             .filter(function() {
+                                                                   return this.className.toString()
+                                                                               .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
+                                                                               .indexOf("ui-icon-") === -1;
+                                                           }).removeClass(s.item_open + " " + s.item_clsd).addClass(s.item_leaf || "jstree-no-icon");
+                                     }, this))
+                              .bind("select_node.jstree", $.proxy(function (e, data) {
+                                               data.rslt.obj.children("a").addClass(s.item_a);
+                                        }, this))
+                              .bind("deselect_node.jstree deselect_all.jstree", $.proxy(function (e, data) {
+                                         this.get_container()
+                                                   .find("a." + s.item_a).removeClass(s.item_a).end()
+                                                     .find("a.jstree-clicked").addClass(s.item_a);
+                                  }, this))
+                              .bind("dehover_node.jstree", $.proxy(function (e, data) {
+                                              data.rslt.obj.children("a").removeClass(s.item_h);
+                                     }, this))
+                              .bind("hover_node.jstree", $.proxy(function (e, data) {
+                                                this.get_container()
+                                                   .find("a." + s.item_h).not(data.rslt.obj).removeClass(s.item_h);
+                                               data.rslt.obj.children("a").addClass(s.item_h);
+                                        }, this))
+                              .bind("move_node.jstree", $.proxy(function (e, data) {
+                                         this._themeroller(data.rslt.o);
+                                                this._themeroller(data.rslt.op);
+                                       }, this));
+             },
+             __destroy : function () {
+                      var s = this._get_settings().themeroller,
+                              c = [ "ui-icon" ];
+                     $.each(s, function (i, v) {
+                            v = v.split(" ");
+                              if(v.length) { c = c.concat(v); }
+                      });
+                    this.get_container()
+                           .removeClass("ui-widget-content")
+                              .find("." + c.join(", .")).removeClass(c.join(" "));
+           },
+             _fn : {
+                        _themeroller : function (obj) {
+                                var s = this._get_settings().themeroller;
+                              obj = !obj || obj == -1 ? this.get_container_ul() : this._get_node(obj).parent();
+                              obj
+                                    .find("li.jstree-closed")
+                                              .children("ins.jstree-icon").removeClass(s.opened).addClass("ui-icon " + s.closed).end()
+                                               .children("a").addClass(s.item)
+                                                        .children("ins.jstree-icon").addClass("ui-icon")
+                                                               .filter(function() {
+                                                                   return this.className.toString()
+                                                                               .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
+                                                                               .indexOf("ui-icon-") === -1;
+                                                           }).removeClass(s.item_leaf + " " + s.item_open).addClass(s.item_clsd || "jstree-no-icon")
+                                                              .end()
+                                                 .end()
+                                         .end()
+                                 .end()
+                                 .find("li.jstree-open")
+                                                .children("ins.jstree-icon").removeClass(s.closed).addClass("ui-icon " + s.opened).end()
+                                               .children("a").addClass(s.item)
+                                                        .children("ins.jstree-icon").addClass("ui-icon")
+                                                               .filter(function() {
+                                                                   return this.className.toString()
+                                                                               .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
+                                                                               .indexOf("ui-icon-") === -1;
+                                                           }).removeClass(s.item_leaf + " " + s.item_clsd).addClass(s.item_open || "jstree-no-icon")
+                                                              .end()
+                                                 .end()
+                                         .end()
+                                 .end()
+                                 .find("li.jstree-leaf")
+                                                .children("ins.jstree-icon").removeClass(s.closed + " ui-icon " + s.opened).end()
+                                              .children("a").addClass(s.item)
+                                                        .children("ins.jstree-icon").addClass("ui-icon")
+                                                               .filter(function() {
+                                                                   return this.className.toString()
+                                                                               .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
+                                                                               .indexOf("ui-icon-") === -1;
+                                                           }).removeClass(s.item_clsd + " " + s.item_open).addClass(s.item_leaf || "jstree-no-icon");
+                     }
+              },
+             defaults : {
+                   "opened"    : "ui-icon-triangle-1-se",
+                    "closed"   : "ui-icon-triangle-1-e",
+                     "item"            : "ui-state-default",
+                  "item_h"     : "ui-state-hover",
+                   "item_a"    : "ui-state-active",
+                  "item_open"  : "ui-icon-folder-open",
+                   "item_clsd" : "ui-icon-folder-collapsed",
+                      "item_leaf"      : "ui-icon-document"
+               }
+      });
+    $(function() {
+         var css_string = '' +
+                  '.jstree-themeroller .ui-icon { overflow:visible; } ' +
+                        '.jstree-themeroller a { padding:0 2px; } ' +
+                  '.jstree-themeroller .jstree-no-icon { display:none; }';
+               $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
+        });
+})(jQuery);
+//*/
+
+/*
+ * jsTree unique plugin
+ * Forces different names amongst siblings (still a bit experimental)
+ * NOTE: does not check language versions (it will not be possible to have nodes with the same title, even in different languages)
+ */
+(function ($) {
+  $.jstree.plugin("unique", {
+            __init : function () {
+                 this.get_container()
+                           .bind("before.jstree", $.proxy(function (e, data) {
+                                            var nms = [], res = true, p, t;
+                                                if(data.func == "move_node") {
+                                                 // obj, ref, position, is_copy, is_prepared, skip_check
+                                                        if(data.args[4] === true) {
+                                                            if(data.args[0].o && data.args[0].o.length) {
+                                                                  data.args[0].o.children("a").each(function () { nms.push($(this).text().replace(/^\s+/g,"")); });
+                                                                      res = this._check_unique(nms, data.args[0].np.find("> ul > li").not(data.args[0].o), "move_node");
+                                                             }
+                                                      }
+                                              }
+                                              if(data.func == "create_node") {
+                                                       // obj, position, js, callback, is_loaded
+                                                      if(data.args[4] || this._is_loaded(data.args[0])) {
+                                                            p = this._get_node(data.args[0]);
+                                                              if(data.args[1] && (data.args[1] === "before" || data.args[1] === "after")) {
+                                                                  p = this._get_parent(data.args[0]);
+                                                                    if(!p || p === -1) { p = this.get_container(); }
+                                                               }
+                                                              if(typeof data.args[2] === "string") { nms.push(data.args[2]); }
+                                                               else if(!data.args[2] || !data.args[2].data) { nms.push(this._get_string("new_node")); }
+                                                               else { nms.push(data.args[2].data); }
+                                                          res = this._check_unique(nms, p.find("> ul > li"), "create_node");
+                                                     }
+                                              }
+                                              if(data.func == "rename_node") {
+                                                       // obj, val
+                                                    nms.push(data.args[1]);
+                                                        t = this._get_node(data.args[0]);
+                                                      p = this._get_parent(t);
+                                                       if(!p || p === -1) { p = this.get_container(); }
+                                                       res = this._check_unique(nms, p.find("> ul > li").not(t), "rename_node");
+                                              }
+                                              if(!res) {
+                                                     e.stopPropagation();
+                                                   return false;
+                                          }
+                                      }, this));
+             },
+             defaults : {
+                   error_callback : $.noop
+                },
+             _fn : {
+                        _check_unique : function (nms, p, func) {
+                              var cnms = [];
+                         p.children("a").each(function () { cnms.push($(this).text().replace(/^\s+/g,"")); });
+                          if(!cnms.length || !nms.length) { return true; }
+                               cnms = cnms.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");
+                           if((cnms.length + nms.length) != cnms.concat(nms).sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",").length) {
+                                    this._get_settings().unique.error_callback.call(null, nms, p, func);
+                                   return false;
+                          }
+                              return true;
+                   },
+                     check_move : function () {
+                             if(!this.__call_old()) { return false; }
+                               var p = this._get_move(), nms = [];
+                            if(p.o && p.o.length) {
+                                        p.o.children("a").each(function () { nms.push($(this).text().replace(/^\s+/g,"")); });
+                                 return this._check_unique(nms, p.np.find("> ul > li").not(p.o), "check_move");
+                         }
+                              return true;
+                   }
+              }
+      });
+})(jQuery);
+//*/
+
+/*
+ * jsTree wholerow plugin
+ * Makes select and hover work on the entire width of the node
+ * MAY BE HEAVY IN LARGE DOM
+ */
+(function ($) {
+     $.jstree.plugin("wholerow", {
+          __init : function () {
+                 if(!this.data.ui) { throw "jsTree wholerow: jsTree UI plugin not included."; }
+                 this.data.wholerow.html = false;
+                       this.data.wholerow.to = false;
+                 this.get_container()
+                           .bind("init.jstree", $.proxy(function (e, data) {
+                                              this._get_settings().core.animation = 0;
+                                       }, this))
+                              .bind("open_node.jstree create_node.jstree clean_node.jstree loaded.jstree", $.proxy(function (e, data) {
+                                              this._prepare_wholerow_span( data && data.rslt && data.rslt.obj ? data.rslt.obj : -1 );
+                                        }, this))
+                              .bind("search.jstree clear_search.jstree reopen.jstree after_open.jstree after_close.jstree create_node.jstree delete_node.jstree clean_node.jstree", $.proxy(function (e, data) {
+                                             if(this.data.to) { clearTimeout(this.data.to); }
+                                               this.data.to = setTimeout( (function (t, o) { return function() { t._prepare_wholerow_ul(o); }; })(this,  data && data.rslt && data.rslt.obj ? data.rslt.obj : -1), 0);
+                                        }, this))
+                              .bind("deselect_all.jstree", $.proxy(function (e, data) {
+                                              this.get_container().find(" > .jstree-wholerow .jstree-clicked").removeClass("jstree-clicked " + (this.data.themeroller ? this._get_settings().themeroller.item_a : "" ));
+                                     }, this))
+                              .bind("select_node.jstree deselect_node.jstree ", $.proxy(function (e, data) {
+                                         data.rslt.obj.each(function () {
+                                                       var ref = data.inst.get_container().find(" > .jstree-wholerow li:visible:eq(" + ( parseInt((($(this).offset().top - data.inst.get_container().offset().top + data.inst.get_container()[0].scrollTop) / data.inst.data.core.li_height),10)) + ")");
+                                                     // ref.children("a")[e.type === "select_node" ? "addClass" : "removeClass"]("jstree-clicked");
+                                                 ref.children("a").attr("class",data.rslt.obj.children("a").attr("class"));
+                                             });
+                                    }, this))
+                              .bind("hover_node.jstree dehover_node.jstree", $.proxy(function (e, data) {
+                                            this.get_container().find(" > .jstree-wholerow .jstree-hovered").removeClass("jstree-hovered " + (this.data.themeroller ? this._get_settings().themeroller.item_h : "" ));
+                                             if(e.type === "hover_node") {
+                                                  var ref = this.get_container().find(" > .jstree-wholerow li:visible:eq(" + ( parseInt(((data.rslt.obj.offset().top - this.get_container().offset().top + this.get_container()[0].scrollTop) / this.data.core.li_height),10)) + ")");
+                                                   // ref.children("a").addClass("jstree-hovered");
+                                                       ref.children("a").attr("class",data.rslt.obj.children(".jstree-hovered").attr("class"));
+                                               }
+                                      }, this))
+                              .delegate(".jstree-wholerow-span, ins.jstree-icon, li", "click.jstree", function (e) {
+                                         var n = $(e.currentTarget);
+                                            if(e.target.tagName === "A" || (e.target.tagName === "INS" && n.closest("li").is(".jstree-open, .jstree-closed"))) { return; }
+                                         n.closest("li").children("a:visible:eq(0)").click();
+                                           e.stopImmediatePropagation();
+                                  })
+                             .delegate("li", "mouseover.jstree", $.proxy(function (e) {
+                                             e.stopImmediatePropagation();
+                                          if($(e.currentTarget).children(".jstree-hovered, .jstree-clicked").length) { return false; }
+                                           this.hover_node(e.currentTarget);
+                                              return false;
+                                  }, this))
+                              .delegate("li", "mouseleave.jstree", $.proxy(function (e) {
+                                            if($(e.currentTarget).children("a").hasClass("jstree-hovered").length) { return; }
+                                             this.dehover_node(e.currentTarget);
+                                    }, this));
+                     if(is_ie7 || is_ie6) {
+                         $.vakata.css.add_sheet({ str : ".jstree-" + this.get_index() + " { position:relative; } ", title : "jstree" });
+                        }
+              },
+             defaults : {
+           },
+             __destroy : function () {
+                      this.get_container().children(".jstree-wholerow").remove();
+                    this.get_container().find(".jstree-wholerow-span").remove();
+           },
+             _fn : {
+                        _prepare_wholerow_span : function (obj) {
+                              obj = !obj || obj == -1 ? this.get_container().find("> ul > li") : this._get_node(obj);
+                                if(obj === false) { return; } // added for removing root nodes
+                         obj.each(function () {
+                                 $(this).find("li").andSelf().each(function () {
+                                                var $t = $(this);
+                                              if($t.children(".jstree-wholerow-span").length) { return true; }
+                                               $t.prepend("<span class='jstree-wholerow-span' style='width:" + ($t.parentsUntil(".jstree","li").length * 18) + "px;'>&#160;</span>");
+                                 });
+                            });
+                    },
+                     _prepare_wholerow_ul : function () {
+                           var o = this.get_container().children("ul").eq(0), h = o.html();
+                               o.addClass("jstree-wholerow-real");
+                            if(this.data.wholerow.last_html !== h) {
+                                       this.data.wholerow.last_html = h;
+                                      this.get_container().children(".jstree-wholerow").remove();
+                                    this.get_container().append(
+                                           o.clone().removeClass("jstree-wholerow-real")
+                                                  .wrapAll("<div class='jstree-wholerow' />").parent()
+                                                   .width(o.parent()[0].scrollWidth)
+                                                      .css("top", (o.height() + ( is_ie7 ? 5 : 0)) * -1 )
+                                                    .find("li[id]").each(function () { this.removeAttribute("id"); }).end()
+                                        );
+                             }
+                      }
+              }
+      });
+    $(function() {
+         var css_string = '' +
+                  '.jstree .jstree-wholerow-real { position:relative; z-index:1; } ' +
+                   '.jstree .jstree-wholerow-real li { cursor:pointer; } ' +
+                      '.jstree .jstree-wholerow-real a { border-left-color:transparent !important; border-right-color:transparent !important; } ' +
+                  '.jstree .jstree-wholerow { position:relative; z-index:0; height:0; } ' +
+                      '.jstree .jstree-wholerow ul, .jstree .jstree-wholerow li { width:100%; } ' +
+                  '.jstree .jstree-wholerow, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li, .jstree .jstree-wholerow a { margin:0 !important; padding:0 !important; } ' +
+                     '.jstree .jstree-wholerow, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li { background:transparent !important; }' +
+                  '.jstree .jstree-wholerow ins, .jstree .jstree-wholerow span, .jstree .jstree-wholerow input { display:none !important; }' +
+                   '.jstree .jstree-wholerow a, .jstree .jstree-wholerow a:hover { text-indent:-9999px; !important; width:100%; padding:0 !important; border-right-width:0px !important; border-left-width:0px !important; } ' +
+                  '.jstree .jstree-wholerow-span { position:absolute; left:0; margin:0px; padding:0; height:18px; border-width:0; padding:0; z-index:0; }';
+              if(is_ff2) {
+                   css_string += '' +
+                             '.jstree .jstree-wholerow a { display:block; height:18px; margin:0; padding:0; border:0; } ' +
+                         '.jstree .jstree-wholerow-real a { border-color:transparent !important; } ';
+           }
+              if(is_ie7 || is_ie6) {
+                 css_string += '' +
+                             '.jstree .jstree-wholerow, .jstree .jstree-wholerow li, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow a { margin:0; padding:0; line-height:18px; } ' +
+                         '.jstree .jstree-wholerow a { display:block; height:18px; line-height:18px; overflow:hidden; } ';
+              }
+              $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
+        });
+})(jQuery);
+//*/
+
+/*
+* jsTree model plugin
+* This plugin gets jstree to use a class model to retrieve data, creating great dynamism
+*/
+(function ($) {
+     var nodeInterface = ["getChildren","getChildrenCount","getAttr","getName","getProps"],
+         validateInterface = function(obj, inter) {
+                     var valid = true;
+                      obj = obj || {};
+                       inter = [].concat(inter);
+                      $.each(inter, function (i, v) {
+                                if(!$.isFunction(obj[v])) { valid = false; return false; }
+                     });
+                    return valid;
+          };
+     $.jstree.plugin("model", {
+             __init : function () {
+                 if(!this.data.json_data) { throw "jsTree model: jsTree json_data plugin not included."; }
+                      this._get_settings().json_data.data = function (n, b) {
+                                var obj = (n == -1) ? this._get_settings().model.object : n.data("jstree_model");
+                              if(!validateInterface(obj, nodeInterface)) { return b.call(null, false); }
+                             if(this._get_settings().model.async) {
+                                 obj.getChildren($.proxy(function (data) {
+                                              this.model_done(data, b);
+                                      }, this));
+                             }
+                              else {
+                                 this.model_done(obj.getChildren(), b);
+                         }
+                      };
+             },
+             defaults : {
+                   object : false,
+                        id_prefix : false,
+                     async : false
+          },
+             _fn : {
+                        model_done : function (data, callback) {
+                               var ret = [],
+                                  s = this._get_settings(),
+                                      _this = this;
+
+                         if(!$.isArray(data)) { data = [data]; }
+                                $.each(data, function (i, nd) {
+                                        var r = nd.getProps() || {};
+                                   r.attr = nd.getAttr() || {};
+                                   if(nd.getChildrenCount()) { r.state = "closed"; }
+                                      r.data = nd.getName();
+                                 if(!$.isArray(r.data)) { r.data = [r.data]; }
+                                  if(_this.data.types && $.isFunction(nd.getType)) {
+                                             r.attr[s.types.type_attr] = nd.getType();
+                                      }
+                                      if(r.attr.id && s.model.id_prefix) { r.attr.id = s.model.id_prefix + r.attr.id; }
+                                      if(!r.metadata) { r.metadata = { }; }
+                                  r.metadata.jstree_model = nd;
+                                  ret.push(r);
+                           });
+                            callback.call(null, ret);
+                      }
+              }
+      });
+})(jQuery);
+//*/
+
+})();
\ No newline at end of file
diff --git a/koha-tmpl/intranet-tmpl/lib/jquery/plugins/themes/classic/d.gif b/koha-tmpl/intranet-tmpl/lib/jquery/plugins/themes/classic/d.gif
new file mode 100644 (file)
index 0000000..6eb0004
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/lib/jquery/plugins/themes/classic/d.gif differ
diff --git a/koha-tmpl/intranet-tmpl/lib/jquery/plugins/themes/classic/d.png b/koha-tmpl/intranet-tmpl/lib/jquery/plugins/themes/classic/d.png
new file mode 100644 (file)
index 0000000..275daec
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/lib/jquery/plugins/themes/classic/d.png differ
diff --git a/koha-tmpl/intranet-tmpl/lib/jquery/plugins/themes/classic/dot_for_ie.gif b/koha-tmpl/intranet-tmpl/lib/jquery/plugins/themes/classic/dot_for_ie.gif
new file mode 100644 (file)
index 0000000..c0cc5fd
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/lib/jquery/plugins/themes/classic/dot_for_ie.gif differ
diff --git a/koha-tmpl/intranet-tmpl/lib/jquery/plugins/themes/classic/style.css b/koha-tmpl/intranet-tmpl/lib/jquery/plugins/themes/classic/style.css
new file mode 100644 (file)
index 0000000..9fbab0e
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * jsTree classic theme 1.0
+ * Supported features: dots/no-dots, icons/no-icons, focused, loading
+ * Supported plugins: ui (hovered, clicked), checkbox, contextmenu, search
+ */
+
+.jstree-classic li,
+.jstree-classic ins { background-image:url("d.png"); background-repeat:no-repeat; background-color:transparent; }
+.jstree-classic li { background-position:-90px 0; background-repeat:repeat-y;  }
+.jstree-classic li.jstree-last { background:transparent; }
+.jstree-classic .jstree-open > ins { background-position:-72px 0; }
+.jstree-classic .jstree-closed > ins { background-position:-54px 0; }
+.jstree-classic .jstree-leaf > ins { background-position:-36px 0; }
+
+.jstree-classic .jstree-hovered { background:#e7f4f9; border:1px solid #e7f4f9; padding:0 2px 0 1px; }
+.jstree-classic .jstree-clicked { background:navy; border:1px solid navy; padding:0 2px 0 1px; color:white; }
+.jstree-classic a .jstree-icon { background-position:-56px -19px; }
+.jstree-classic .jstree-open > a .jstree-icon { background-position:-56px -36px; }
+.jstree-classic a.jstree-loading .jstree-icon { background:url("throbber.gif") center center no-repeat !important; }
+
+.jstree-classic.jstree-focused { background:white; }
+
+.jstree-classic .jstree-no-dots li,
+.jstree-classic .jstree-no-dots .jstree-leaf > ins { background:transparent; }
+.jstree-classic .jstree-no-dots .jstree-open > ins { background-position:-18px 0; }
+.jstree-classic .jstree-no-dots .jstree-closed > ins { background-position:0 0; }
+
+.jstree-classic .jstree-no-icons a .jstree-icon { display:none; }
+
+.jstree-classic .jstree-search { font-style:italic; }
+
+.jstree-classic .jstree-no-icons .jstree-checkbox { display:inline-block; }
+.jstree-classic .jstree-no-checkboxes .jstree-checkbox { display:none !important; }
+.jstree-classic .jstree-checked > a > .jstree-checkbox { background-position:-38px -19px; }
+.jstree-classic .jstree-unchecked > a > .jstree-checkbox { background-position:-2px -19px; }
+.jstree-classic .jstree-undetermined > a > .jstree-checkbox { background-position:-20px -19px; }
+.jstree-classic .jstree-checked > a > .jstree-checkbox:hover { background-position:-38px -37px; }
+.jstree-classic .jstree-unchecked > a > .jstree-checkbox:hover { background-position:-2px -37px; }
+.jstree-classic .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; }
+
+#vakata-dragged.jstree-classic ins { background:transparent !important; }
+#vakata-dragged.jstree-classic .jstree-ok { background:url("d.png") -2px -53px no-repeat !important; }
+#vakata-dragged.jstree-classic .jstree-invalid { background:url("d.png") -18px -53px no-repeat !important; }
+#jstree-marker.jstree-classic { background:url("d.png") -41px -57px no-repeat !important; text-indent:-100px; }
+
+.jstree-classic a.jstree-search { color:aqua; }
+.jstree-classic .jstree-locked a { color:silver; cursor:default; }
+
+#vakata-contextmenu.jstree-classic-context,
+#vakata-contextmenu.jstree-classic-context li ul { background:#f0f0f0; border:1px solid #979797; -moz-box-shadow: 1px 1px 2px #999; -webkit-box-shadow: 1px 1px 2px #999; box-shadow: 1px 1px 2px #999; }
+#vakata-contextmenu.jstree-classic-context li { }
+#vakata-contextmenu.jstree-classic-context a { color:black; }
+#vakata-contextmenu.jstree-classic-context a:hover,
+#vakata-contextmenu.jstree-classic-context .vakata-hover > a { padding:0 5px; background:#e8eff7; border:1px solid #aecff7; color:black; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; }
+#vakata-contextmenu.jstree-classic-context li.jstree-contextmenu-disabled a,
+#vakata-contextmenu.jstree-classic-context li.jstree-contextmenu-disabled a:hover { color:silver; background:transparent; border:0; padding:1px 4px; }
+#vakata-contextmenu.jstree-classic-context li.vakata-separator { background:white; border-top:1px solid #e0e0e0; margin:0; }
+#vakata-contextmenu.jstree-classic-context li ul { margin-left:-4px; }
+
+/* IE6 BEGIN */
+.jstree-classic li,
+.jstree-classic ins,
+#vakata-dragged.jstree-classic .jstree-invalid,
+#vakata-dragged.jstree-classic .jstree-ok,
+#jstree-marker.jstree-classic { _background-image:url("d.gif"); }
+.jstree-classic .jstree-open ins { _background-position:-72px 0; }
+.jstree-classic .jstree-closed ins { _background-position:-54px 0; }
+.jstree-classic .jstree-leaf ins { _background-position:-36px 0; }
+.jstree-classic .jstree-open a ins.jstree-icon { _background-position:-56px -36px; }
+.jstree-classic .jstree-closed a ins.jstree-icon { _background-position:-56px -19px; }
+.jstree-classic .jstree-leaf a ins.jstree-icon { _background-position:-56px -19px; }
+#vakata-contextmenu.jstree-classic-context ins { _display:none; }
+#vakata-contextmenu.jstree-classic-context li { _zoom:1; }
+.jstree-classic .jstree-undetermined a .jstree-checkbox { _background-position:-20px -19px; }
+.jstree-classic .jstree-checked a .jstree-checkbox { _background-position:-38px -19px; }
+.jstree-classic .jstree-unchecked a .jstree-checkbox { _background-position:-2px -19px; }
+/* IE6 END */
\ No newline at end of file
diff --git a/koha-tmpl/intranet-tmpl/lib/jquery/plugins/themes/classic/throbber.gif b/koha-tmpl/intranet-tmpl/lib/jquery/plugins/themes/classic/throbber.gif
new file mode 100644 (file)
index 0000000..5b33f7e
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/lib/jquery/plugins/themes/classic/throbber.gif differ
index d2489b3..79ceb48 100644 (file)
@@ -50,8 +50,10 @@ div.tag {
 }
 
 div.subfield_line {
-       padding-bottom : .3em;
-    clear: both;
+    padding-bottom: .3em;
+    float: left;
+    clear: left;
+    width: 100%;
 }
 
 div.subfield_line label {
@@ -63,6 +65,10 @@ div.subfield_line label {
     clear:left;
 }
 
+.subfieldcode img {
+    cursor: pointer;
+}
+
 .tag_title {
        font-size : 90%;
        padding : .2em 0;
@@ -149,4 +155,12 @@ a.tagnum {
 .floating {
        -webkit-box-shadow: 0px 3px 2px 0px rgba(0, 0, 0, .5);
        box-shadow: 0px 3px 2px 0px rgba(0, 0, 0, .5);
+}
+
+tr.active td {
+    background-color: #FFFFCC;
+}
+
+tr.active.highlight td {
+    background-color: #FEF4B4;
 }
\ No newline at end of file
index 262fe11..c58e9a5 100644 (file)
@@ -69,4 +69,8 @@ h3.collapsed {
 
 #yui-main {
        margin-bottom:2em;
+}
+#toolbar.floating {
+    box-shadow: 0 3px 2px 0 rgba(0, 0, 0, 0.5);
+    border-radius: 0;
 }
\ No newline at end of file
index 9753f4f..a8897a0 100644 (file)
@@ -36,8 +36,6 @@ a.yuimenuitemlabel {
         color: #000000;
 }
 
-
-a.overdue,
 .overdue,
 .debit {
        color : #cc0000;
@@ -128,22 +126,6 @@ em strong {
     font-style : italic;
 }
 
-#navigation {
-       border-right : 1px solid #BCBCBC;
-}
-
-#navigation li {
-       font-weight : bold;
-}
-
-#navigation li li {
-       font-weight : normal;
-}
-
-#navigation input {
-       font-size : 85%;
-}
-
 #navmenulist li {
        padding : .2em 0;
        list-style-image : url("../../img/arrow-bullet.gif");
@@ -227,39 +209,6 @@ ol li {
 .clearfix {display: block;}
 /* End hide from IE-mac */
 
-#sitetitle {
-/*     background-image : url("../../img/koha-logo-black.png");
-       background-position : 5px 2px;
-       background-repeat : no-repeat;
-       float : left;
-       height : 54px;
-       padding-left : 50px;*/
-       border-bottom : 1px solid #E8E8E8;
-}
-
-#sitetitle h1 {
-       display : inline;
-       line-height : 54px;
-}
-
-#sitetitle h1 a {
-       text-decoration : none;
-}
-
-#submenu {
-       margin : 0 0 .5em 0;
-       padding : 0;
-}
-
-#submenu ul {
-       margin : 0;
-       padding : 0;    
-}
-
-#submenu ul li {
-       padding-left : 0;
-}
-
 table {
        border-collapse : collapse;
        border-top : 1px solid #BCBCBC;
@@ -394,10 +343,6 @@ legend {
        margin-top : 1em;
 }
 
-#commonsearch {
-       display : inline;
-}
-
 div.justify {
     text-align: justify;
 }
@@ -413,17 +358,6 @@ div#header_search input {
        font-size : 1.3em;
 }
 
-div#header_search ul.link-tabs {
-       font-family : Arial, Geneva, sans-serif;
-       margin-bottom : -4px;
-}
-
-div#header_search ul.link-tabs li.on a,
-div#header_search ul.link-tabs li a,
-div#header_search ul.link-tabs li.off a {
-       padding : 0.1em .5em .2em .5em;
-}
-
 div#header_search div.residentsearch {
        border : 0;
     border-bottom : 1px solid #85ca11;
@@ -532,7 +466,7 @@ div.patroninfo ul li {
        margin : 0;
 }
 
-div.patroninfo ul li, div.patronviews ul li {
+div.patroninfo ul li {
        list-style-type : none;
 }
 
@@ -542,6 +476,7 @@ div.patronviews {
        margin-bottom : .5em;
        padding : .5em 0 .5em 0;
 }
+}
 
 .column-tool {
        font-size: 80%;
@@ -634,7 +569,7 @@ fieldset.rows label, fieldset.rows span.label {
 }
 
 fieldset.rows fieldset {
-    background-color: #FFF;
+    background-color: transparent;
        border-width : 1px;
     margin : 1em;
        padding : .3em;
@@ -727,6 +662,7 @@ fieldset.rows label.yesno {
 }
 
 fieldset.action, div.action {
+    background-color: transparent;
        clear : both;
        float : none;
     border : 0px;
@@ -1009,10 +945,6 @@ tr.highlight th[scope=row] {
        border-color : #BCBCBC;
 }
 
-tr.confirm td, tr.highlight.confirm td {
-       background-color : #ffbfbf;
-}
-
 #circ_circulation_issue label {
        font-size: 105%;
        font-weight : bold;
@@ -1023,18 +955,19 @@ tr.confirm td, tr.highlight.confirm td {
        margin: .2em 0;
 }
 
-#circ_circulation_issue .date-select {
-       font-size : 85%;
-       padding-top : .3em;
+.date-select {
+    font-size : 85%;
+    padding-top : .3em;
 }
 
-#circ_circulation_issue .date-select label {
-       font-size : inherit;
-       font-weight: normal;
+#circ_circulation_issue .date-select label,
+.date-select label {
+    font-size : inherit;
+    font-weight: normal;
 }
 
-#circ_circulation_issue .date-select input {
-       padding : 1px;
+.date-select input {
+    padding : 1px;
 }
 
 tr.expired td {
@@ -1224,7 +1157,7 @@ div.message {
        background: -webkit-linear-gradient(top, #ffffff 0%,#f4f6fa 2%,#eaeef5 23%,#e8edf6 94%,#cddbf2 100%); /* Chrome10+,Safari5.1+ */
        background: -o-linear-gradient(top, #ffffff 0%,#f4f6fa 2%,#eaeef5 23%,#e8edf6 94%,#cddbf2 100%); /* Opera11.10+ */
        background: -ms-linear-gradient(top, #ffffff 0%,#f4f6fa 2%,#eaeef5 23%,#e8edf6 94%,#cddbf2 100%); /* IE10+ */
-       filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#cddbf2',GradientType=0 ); /* IE6-9 */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eaeef5', endColorstr='#cddbf2',GradientType=0 ); /* IE6-9 */
        background: linear-gradient(top, #ffffff 0%,#f4f6fa 2%,#eaeef5 23%,#e8edf6 94%,#cddbf2 100%); /* W3C */
        border : 1px solid #bcbcbc;
        text-align: center;
@@ -1319,7 +1252,6 @@ div#menu li a {
     background: -webkit-linear-gradient(left, #e8f0f6 0%,#e8f0f6 96%,#c1c1c1 100%); /* Chrome10+,Safari5.1+ */
      background: -o-linear-gradient(left, #e8f0f6 0%,#e8f0f6 96%,#c1c1c1 100%); /* Opera11.10+ */
    background: -ms-linear-gradient(left, #e8f0f6 0%,#e8f0f6 96%,#c1c1c1 100%); /* IE10+ */
-        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e8f0f6', endColorstr='#c1c1c1',GradientType=1 ); /* IE6-9 */
        background: linear-gradient(left, #e8f0f6 0%,#e8f0f6 96%,#c1c1c1 100%); /* W3C */
        -moz-border-top-left-radius: 5px;
        border-top-left-radius: 5px;
@@ -1333,15 +1265,12 @@ div#menu li a {
 }
 
 div#menu li a:hover {
-
-
      background: #fff; /* Old browsers */
    background: -moz-linear-gradient(left, #FAFAFA 0%, #FAFAFA 96%, #e6e6e6 97%, #cccccc 99%, #c1c1c1 100%); /* FF3.6+ */
   background: -webkit-gradient(linear, left top, right top, color-stop(0%,#FAFAFA), color-stop(96%,#FAFAFA), color-stop(97%,#e6e6e6), color-stop(99%,#cccccc), color-stop(100%,#c1c1c1)); /* Chrome,Safari4+ */
   background: -webkit-linear-gradient(left, #FAFAFA 0%,#FAFAFA 96%,#e6e6e6 97%,#cccccc 99%,#c1c1c1 100%); /* Chrome10+,Safari5.1+ */
      background: -o-linear-gradient(left, #FAFAFA 0%,#FAFAFA 96%,#e6e6e6 97%,#cccccc 99%,#c1c1c1 100%); /* Opera11.10+ */
    background: -ms-linear-gradient(left, #FAFAFA 0%,#FAFAFA 96%,#e6e6e6 97%,#cccccc 99%,#c1c1c1 100%); /* IE10+ */
-        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#c1c1c1',GradientType=1 ); /* IE6-9 */
        background: linear-gradient(left, #FAFAFA 0%,#fff 96%,#e6e6e6 97%,#cccccc 99%,#c1c1c1 100%); /* W3C */
     border-left: 1px solid #85CA11;
     border-top: 1px solid #85CA11;
@@ -1368,14 +1297,6 @@ div#menu li.active a:hover {
     border-right: 0;
 }
 
-ul.error {
-       background : #ffffcc;
-       border : 1px solid #ff9090;
-       margin : .5em;
-       padding : .5em .5em .5em 1.5em;
-       width : 75%
-}
-
 h1#logo {
        border:0pt none;
        float:left !important;
@@ -1725,14 +1646,14 @@ ul#toplevelmenu li.more ul li a.yuimenuitemlabel {
        padding: .2em 20px .2em 20px;
 }
                
-ul#menu li a, ul#toplevelmenu li a {
+ul#toplevelmenu li a {
        text-decoration : none;
 }
-ul#menu li ul li, ul#toplevelmenu li ul li {
+ul#toplevelmenu li ul li {
        display :block;
        padding :0;
 }
-ul#menu li ul li a, ul#toplevelmenu li ul li a {
+ul#toplevelmenu li ul li a {
        text-decoration : none;
 }
 
@@ -1907,20 +1828,6 @@ span.permissiondesc {
        color: black;
 }
 
-.hintsClass {
-    font-family: tahoma, verdana, arial;
-    font-size: 12px;
-    background-color: #f0f0f0;
-    color: #000000;
-    border: 1px solid #808080;
-    padding: 5px;
-}
-.hintSource {
-    color: green;
-    text-decoration: underline;
-    cursor: pointer;
-}
-
 #cartDetails {
        background-color : #FFF;
        border: 1px solid #739acf;
@@ -2068,26 +1975,6 @@ fieldset.rows+h3 {clear:both;padding-top:.5em;}
     margin: 0;
 }
 
-.advsearch fieldset {
-    border : 1px solid #EEE;
-    -moz-border-radius : 3px;
-    border-radius : 3px;
-}
-
-.advsearch fieldset.action {
-    border : 0;
-}
-
-.advsearch fieldset fieldset {
-    border : 1px solid #EEE;
-    margin : 0;
-    padding : .3em .5em;
-    -moz-border-radius : 0;
-    border-radius : 0;
-}
-.advsearch fieldset fieldset+fieldset {
-    border-top : 0;
-}
 .advsearch table {
     border-spacing : 5px;
     border-collapse : separate;
@@ -2396,6 +2283,16 @@ ul.ui-tabs-nav li {
 #authfinderops {
     float: right;
 }
+div.authorizedheading {
+  font-weight: bold;
+}
+.authres_notes, .authres_seealso, .authres_otherscript {
+  padding-top: 3px;
+}
+.authres_notes {
+  font-style: italic;
+}
+
 
 .contents {
     width: 75%;
@@ -2424,6 +2321,48 @@ ul.ui-tabs-nav li {
     display: inline;
 }
 
+#hierarchies a {
+    font-weight: normal;
+    text-decoration: underline;
+    color: #069;
+}
+
+#hierarchies a:hover {
+    color: #990033;
+}
+
+#didyoumeanopac, #didyoumeanintranet {
+    float: left;
+    width: 260px;
+}
+
+.pluginlist {
+    padding-bottom: 10px;
+}
+.plugin {
+    margin: 0 1em 1em 0;
+}
+.pluginname {
+    margin: 0.3em;
+    padding-bottom: 4px;
+    padding-left: 0.2em;
+    background-color: #E6F0F2;
+}
+.pluginname .ui-icon {
+    float: right;
+}
+.plugindesc {
+    padding: 0.4em;
+}
+.ui-sortable-placeholder {
+    border: 1px dotted black;
+    visibility: visible !important;
+    height: 80px !important;
+}
+.ui-sortable-placeholder * {
+    visibility: hidden;
+}
+
 /* jQuery UI Datepicker */
 .ui-datepicker table {
     width: 100%;
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/additem-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/additem-menu.inc
deleted file mode 100644 (file)
index c54e192..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<ul id="navigation">
-    <li>    <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]">Edit bibliographic record</a></li>
-       <li>    <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]">Normal view</a></li>
-    <li>    <a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblionumber %]">View MARC in catalog</a></li>
-    <li>    <a href="/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=[% biblionumber %]">View ISBD in catalog</a></li>
-</ul>
\ No newline at end of file
index 72162d3..b207da5 100644 (file)
@@ -30,6 +30,7 @@
     <li><a href="/cgi-bin/koha/admin/smart-rules.pl">Circulation and fines rules</a></li>
        <li><a href="/cgi-bin/koha/admin/patron-attr-types.pl">Patron attribute types</a></li>
        <li><a href="/cgi-bin/koha/admin/branch_transfer_limits.pl">Library transfer limits</a></li>
+       <li><a href="/cgi-bin/koha/admin/transport-cost-matrix.pl">Transport cost matrix</a></li>
        <li><a href="/cgi-bin/koha/admin/item_circulation_alerts.pl">Item circulation alerts</a></li>
     <li><a href="/cgi-bin/koha/admin/cities.pl">Cities and towns</a></li>
     <li><a href="/cgi-bin/koha/admin/roadtype.pl">Road types</a></li>
@@ -62,6 +63,7 @@
     [% IF ( NoZebra ) %]<li><a href="/cgi-bin/koha/admin/stopwords.pl">Stop words</a></li>[% END %]
        <!-- <li><a href="/cgi-bin/koha/admin/printers.pl">Network Printers</a></li> -->
     <li><a href="/cgi-bin/koha/admin/z3950servers.pl">Z39.50 client targets</a></li>
+    <li><a href="/cgi-bin/koha/admin/didyoumean.pl">Did you mean?</a></li>
 </ul>
 </div>
 </div>
index cd99443..366c695 100644 (file)
@@ -2,15 +2,13 @@
     [% IF marcflavour == 'UNIMARC' %]
         [% SWITCH type %]
         [% CASE 'broader' %]
-            <span class="BT">[% heading | html %]</span> --
+            <span class="BT">BT: [% heading | html %]</span>
         [% CASE 'narrower' %]
-            <span class="NT">[% heading | html %]</span> --
-        [% CASE 'narrower' %]
-            <span class="NT">[% heading | html %]</span> --
+            <span class="NT">NT: [% heading | html %]</span>
         [% CASE 'seefrom' %]
-            <span class="UF">[% heading | html %]</span> --
+            <span class="UF">UF: [% heading | html %]</span>
         [% CASE 'seealso' %]
-            <span class="RT">[% heading | html %]</span> --
+            <span class="RT">RT: [% heading | html %]</span>
         [% END %]
     [% ELSE %]
         [% IF ( label ) %]<span class="label">[% label | html %]</span>[% END %]
         [% CASE 'broader' %](Broader heading)
         [% CASE 'narrower' %](Narrower heading)
         [% CASE 'parent' %](Immediate parent body)
-        [% CASE %]([% type | html %])
+        [% CASE %][% IF type %]([% type | html %])[% END %]
         [% END %]</span>[% END %]
     [% END %]
 [% END %]
 [% BLOCK authresult %]
     [% IF ( summary.summary ) %][% summary.summary | html %]:[% END %]
     [% UNLESS ( summary.summaryonly ) %]
+        <div class="authorizedheading">
         [% FOREACH authorize IN summary.authorized %]
-            <span class="authorizedheading">[% authorize.heading | html %]</span>
+          <span class="authorizedheading">[% authorize.heading | html %]</span>
         [% END %]
+        </div>
         [% IF ( marcflavour == 'UNIMARC' ) %]
-            [% FOREACH note IN summary.notes %]
-                <span class="note">[% note | html %]</span>
+          [% IF summary.notes %]
+           <div class="authres_notes">
+           [% FOREACH note IN summary.notes %]
+             [% note.note | html %]</span>
+           [% END %]
+           </div>
+          [% END %]
+          [% IF summary.seealso %]
+            <div class="authres_seealso">
+            [% FOREACH see IN summary.seealso %]
+              [% PROCESS showreference heading=see.heading label="" type=see.type search='' %]
+              [% IF ! loop.last %] ; [% END %]
             [% END %]
-            [% FOREACH seefro IN summary.seefrom %]
-                [% PROCESS showreference heading=seefro.heading label="" type=seefro.type search='' %]
+            </div>
+          [% END %]
+          [% IF summary.otherscript %]
+            <div class="authres_otherscript">
+            [% FOREACH other IN summary.otherscript %]
+              [% PROCESS language lang=other.lang | trim %]:
+              [% other.term %]
+              [% IF ! loop.last %] ; [% END %]
             [% END %]
+            </div>
+          [% END %]
+
         [% ELSE %]
             [% IF ( summary.seefrom ) %]
                 [% FOREACH seefro IN summary.seefrom %]
         [% END %]
     [% END %]
 [% END %]
+[% BLOCK language %]
+  [% SWITCH lang %]
+   [% CASE ['en', 'eng'] %]English
+   [% CASE ['fr', 'fre'] %]French
+   [% CASE ['it', 'ita'] %]Italian
+   [% CASE ['de', 'ger', 'deu'] %]German
+   [% CASE ['es', 'spa'] %]Spanish
+   [% CASE %][% lang %]
+  [% END %]
+[% END %]
index 7c090eb..d0b13a7 100644 (file)
@@ -1,6 +1,22 @@
 <div class="gradient">
 <h1 id="logo"><a href="/cgi-bin/koha/mainpage.pl">[% LibraryName %]</a></h1>
 <!-- Begin Authorities Resident Search Box -->
+<script type="text/javascript">
+//<![CDATA[
+    $(document).ready(function() {
+        var searchType = '[% marclist %]';
+        if (searchType) {
+            if ('mainentry' == searchType) {
+                $("#header_search").tabs( "option", "selected", 0 );
+            } else if ('match' == searchType) {
+                $("#header_search").tabs( "option", "selected", 1 );
+            } else if ('all' == searchType) {
+                $("#header_search").tabs( "option", "selected", 2 );
+            }
+        }
+    });
+//]]>
+</script>
 <div id="header_search" class="residentsearch">
     <div id="main_heading" class="residentsearch">
     <p class="tip">Enter authorized heading:</p>
         <input type="hidden" name="and_or" value="and" />
         <input type="hidden" name="excluding" value="" />
         <select name="operator">
+            [% IF ( operator == 'contains' ) %]
+            <option value="contains" selected="selected">contains</option>
+            [% ELSE %]
             <option value="contains">contains</option>
+            [% END %]
+            [% IF ( operator == 'start' ) %]
+            <option value="start" selected="selected">starts with</option>
+            [% ELSE %]
             <option value="start">starts with</option>
+            [% END %]
+            [% IF ( operator == 'is' ) %]
+            <option value="is" selected="selected">is exactly</option>
+            [% ELSE %]
             <option value="is">is exactly</option>
+            [% END %]
         </select>
         <input id="value_mainentry" type="text" name="value" value="[% value %]" />
         <select name="orderby">
-            <option value="">None</option>
+            [% IF ( orderby == 'HeadingAsc' ) %]
             <option value="HeadingAsc" selected="selected">Heading A-Z</option>
+            [% ELSE %]
+            <option value="HeadingAsc">Heading A-Z</option>
+            [% END %]
+            [% IF ( orderby == 'HeadingDsc' ) %]
+            <option value="HeadingDsc" selected="selected">Heading Z-A</option>
+            [% ELSE %]
             <option value="HeadingDsc">Heading Z-A</option>
+            [% END %]
+            [% IF ( orderby == '' && op ) %]
+            <option value="" selected="selected">None</option>
+            [% ELSE %]
+            <option value="">None</option>
+            [% END %]
         </select>
         <input type="submit" class="submit" value="Submit" />
     </form>
         </select>
         <input type="hidden" name="marclist" value="match" />
         <select name="operator">
+            [% IF ( operator == 'contains' ) %]
+            <option value="contains" selected="selected">contains</option>
+            [% ELSE %]
             <option value="contains">contains</option>
+            [% END %]
+            [% IF ( operator == 'start' ) %]
+            <option value="start" selected="selected">starts with</option>
+            [% ELSE %]
             <option value="start">starts with</option>
+            [% END %]
+            [% IF ( operator == 'is' ) %]
+            <option value="is" selected="selected">is exactly</option>
+            [% ELSE %]
             <option value="is">is exactly</option>
+            [% END %]
         </select>
         <input id="value_matchheading" type="text" name="value" value="[% value %]" />
         <select name="orderby">
-            <option value="">None</option>
+            [% IF ( orderby == 'HeadingAsc' ) %]
             <option value="HeadingAsc" selected="selected">Heading A-Z</option>
+            [% ELSE %]
+            <option value="HeadingAsc">Heading A-Z</option>
+            [% END %]
+            [% IF ( orderby == 'HeadingDsc' ) %]
+            <option value="HeadingDsc" selected="selected">Heading Z-A</option>
+            [% ELSE %]
             <option value="HeadingDsc">Heading Z-A</option>
+            [% END %]
+            [% IF ( orderby == '' && op ) %]
+            <option value="" selected="selected">None</option>
+            [% ELSE %]
+            <option value="">None</option>
+            [% END %]
          </select>
          <input type="submit" class="submit" value="Submit" />
     </form>
         <input type="hidden" name="and_or" value="and" />
         <input type="hidden" name="excluding" value="" />
         <select name="operator">
+            [% IF ( operator == 'contains' ) %]
+            <option value="contains" selected="selected">contains</option>
+            [% ELSE %]
             <option value="contains">contains</option>
+            [% END %]
+            [% IF ( operator == 'start' ) %]
+            <option value="start" selected="selected">starts with</option>
+            [% ELSE %]
             <option value="start">starts with</option>
+            [% END %]
+            [% IF ( operator == 'is' ) %]
+            <option value="is" selected="selected">is exactly</option>
+            [% ELSE %]
             <option value="is">is exactly</option>
+            [% END %]
         </select>
         <input id="value_anywhere" type="text" name="value" value="[% value %]" />
         <select name="orderby">
-            <option value="">None</option>
+            [% IF ( orderby == 'HeadingAsc' ) %]
             <option value="HeadingAsc" selected="selected">Heading A-Z</option>
+            [% ELSE %]
+            <option value="HeadingAsc">Heading A-Z</option>
+            [% END %]
+            [% IF ( orderby == 'HeadingDsc' ) %]
+            <option value="HeadingDsc" selected="selected">Heading Z-A</option>
+            [% ELSE %]
             <option value="HeadingDsc">Heading Z-A</option>
+            [% END %]
+            [% IF ( orderby == '' && op ) %]
+            <option value="" selected="selected">None</option>
+            [% ELSE %]
+            <option value="">None</option>
+            [% END %]
         </select>
         <input type="submit" class="submit" value="Submit" />
     </form>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities.inc
new file mode 100644 (file)
index 0000000..9e173c9
--- /dev/null
@@ -0,0 +1,21 @@
+[% BLOCK showhierarchy %]
+    [% FOREACH tree IN trees %]
+        [% PROCESS showtree tree = tree %]
+    [% END %]
+[% END %]
+[% BLOCK showtree %]
+    <ul class="hierarchy">
+        [% FOREACH node IN tree %]
+            <li id="hier[% node.authid %]" class="[% node.class %] authnode">
+            [% IF ( node.current_value ) %]
+                <span class='currentauth'>[% node.value | html %]</span>
+            [% ELSE %]
+                <a href="detail.pl?authid=[% node.authid %]" title="Term">[% node.value | html %]</a>
+            [% END %]
+            [% IF ( node.children && node.children.size > 0 ) %]
+                [% PROCESS showtree tree = node.children %]
+            [% END %]
+            </li>
+        [% END %]
+    </ul>
+[% END %]
index 5371398..740a3b5 100644 (file)
@@ -111,6 +111,7 @@ function confirm_items_deletion() {
             [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Edit record"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]&amp;frameworkcode=&amp;op=" },[% END %]
             [% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Edit items"), url: "/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber %]" },[% END %]
             [% IF ( CAN_user_tools_items_batchmod ) %]{ text: _("Edit items in batch"), url: "/cgi-bin/koha/tools/batchMod.pl?op=show&biblionumber=[% biblionumber %]&src=CATALOGUING" },[% END %]
+            [% IF ( CAN_user_tools_items_batchdel ) %]{ text: _("Delete items in batch"), url: "/cgi-bin/koha/tools/batchMod.pl?del=1&op=show&biblionumber=[% biblionumber %]&src=CATALOGUING" },[% END %]
             [% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Attach item"), url: "/cgi-bin/koha/cataloguing/moveitem.pl?biblionumber=[% biblionumber %]" },[% END %]
             [% IF ( EasyAnalyticalRecords ) %][% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Link to host item"), url: "/cgi-bin/koha/cataloguing/linkitem.pl?biblionumber=[% biblionumber %]" },[% END %][% END %]
             [% IF ( LocalCoverImages || OPACLocalCoverImages) %][% IF ( CAN_user_tools_upload_local_cover_images ) %]{ text: _("Upload image"), url: "/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=[% biblionumber %]&filetype=image" },[% END %][% END %]
@@ -238,7 +239,7 @@ function confirm_items_deletion() {
        [% IF ( CAN_user_reserveforothers ) %]
     [% UNLESS ( norequests ) %]<li><a id="placehold" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber %]">Place hold</a></li>[% END %]
        [% END %]
-    [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]<li id="z3950searchc"><input type="button" id="z3950search" value="Z39.50 search" onclick="PopupZ3950(); return false;" /></li>[% END %]
+       [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]<li id="z3950searchc"><input type="button" id="z3950search" value="Z39.50 Search" onclick="if (confirm(_('Please note that this Z39.50 search could replace the current record.'))){ PopupZ3950(); } return false;" /></li>[% END %]
     </ul>
 </form>
 </div>
index f2edfd6..90c4cb2 100644 (file)
@@ -3,10 +3,10 @@
         <td colspan="6" style="text-align: right; font-weight:bold;">Totals:</td>
                <td>[% totaldue %]</td>
                <td>[% totalprice %]</td>
-                <td colspan="3">
-            <p>Renewal due date: <input type="text" size="8" id="newduedate" name="newduedate" value="[% newduedate %]" />
+                <td colspan="3"><div class="date-select">
+            <p><label for="newduedate">Renewal due date:</label> <input type="text" size="12" id="newduedate" name="newduedate" value="[% newduedate %]" readonly="readonly" />
 </p>
-                       <p><label>Forgive fines on return: <input type="checkbox" name="exemptfine" value="1" /></label></p>
+            <p><label for="exemptfine">Forgive fines on return: <input type="checkbox" id="exemptfine" name="exemptfine" value="1" /></label></p></div>
                </td>
        </tr>
 </tfoot>
index 1731bed..fd2302a 100644 (file)
@@ -3,7 +3,7 @@
 <div id="search-facets">
 <h4>Refine your search</h4>
 <ul>
-       <li>Availability<ul><li>[% IF ( available ) %]Showing only <strong>available</strong> items. <a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi_not_availablity %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by %][% END %]">Show all items</a>[% ELSE %]Limit to <a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by %][% END %]&amp;limit=available">currently available items.</a>[% END %]</li></ul>
+    <li id="availability_facet">Availability<ul><li>[% IF ( available ) %]Showing only <strong>available</strong> items. <a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi_not_availablity %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by %][% END %]">Show all items</a>[% ELSE %]Limit to <a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by %][% END %]&amp;limit=available">currently available items.</a>[% END %]</li></ul>
        [% IF ( related ) %] <li>(related searches: [% FOREACH relate IN related %][% relate.related_search %][% END %])</li>[% END %]
        </li>
 
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/hold-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/hold-menu.inc
deleted file mode 100644 (file)
index 9372275..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-[% IF ( borrowernumber ) %]
-<div class="patroninfo"><h5>[% borrowerfirstname %] [% borrowersurname %]</h5>
-<ul>
-               <li>[% IF ( borrowerstreetaddress ) %]
-            [% borrowerstreetaddress %],
-        [% ELSE %]
-            <span class="problem">No address stored for patron.</span>
-        [% END %]</li>
-       <li> [% IF ( borrowercity ) %]
-            [% borrowercity %]
-        [% ELSE %]
-            No city stored.
-        [% END %]</li>
-   <li> [% IF ( borrowerphone ) %]
-        [% borrowerphone %]
-    [% ELSE %]
-        <span class="problem">No phone stored.</span>    
-    [% END %]</li>
-       <li>[% borrowerphonepro %]</li>
-       <li>[% borrowermobile %]</li>
-           [% IF ( borroweremail ) %]
-   <li> <a href="mailto:[% email %]">[% borroweremail %]</a></li>
-    [% END %]
-                   [% IF ( borroweremailpro ) %]
-   <li> <a href="mailto:[% emailpro %]">[% borroweremailpro %]</a></li>
-    [% END %]
-    <li>Category: [% borrowercategorycode %]</li>
-</ul></div>
-<div class="patronviews">
-<ul><li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">Details</a></li>
-       <li><a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrowernumber %]">Fines</a></li>
-    [% IF ( intranetreadinghistory ) %]<li><a href="/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% borrowernumber %]">Reading record</a></li>[% END %]
-    [% IF ( CAN_user_parameters ) %]<li><a href="/cgi-bin/koha/tools/viewlog.pl?do_it=1&amp;modules=MEMBERS&amp;action=MODIFY&amp;object=[% borrowernumber %]">Modification log</a></li>[% END %]</ul>
-</div>
-[% END %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/mainmenu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/mainmenu.inc
deleted file mode 100644 (file)
index 46a412d..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-       <div class="yui-b">
-
-    <ul id="navigation">
-    [% IF ( CAN_user_circulate ) %]
-   <li> <a href="/cgi-bin/koha/circ/circulation.pl">Circulation</a><ul>
-       <li>
-       <form method="post" action="/cgi-bin/koha/circ/circulation.pl">
-        <label for="navfindborrower">Check out to:</label>
-            <input id="navfindborrower" name="findborrower" type="text" size="10" />
-            <input type="hidden" name="branch" value="[% branch %]" />
-            <input type="hidden" name="printer" value="[% printer %]" />
-            <input type="submit" class="submit" value="OK" />
-       </form>
-       </li>
-       <li><a accesskey="r" href="/cgi-bin/koha/circ/returns.pl">Check in</a></li>
-        <li><a href="/cgi-bin/koha/circ/branchtransfers.pl">Transfers</a></li>
-     </ul></li>
-     [% END %]
-
-    [% IF ( CAN_user_borrowers ) %]
-    <li><a href="/cgi-bin/koha/members/members-home.pl">Patrons</a><ul>
-        <li><form action="/cgi-bin/koha/members/member.pl" method="post">
-           <label for="navmember">Search:&nbsp;</label>
-           <input id="navmember" type="text" size="10" name="member" />
-           <input type="submit" value="OK" class="submit" />
-            </form>
-        </li>
-    </ul></li>
-    
-    [% END %]
-                [% IF ( CAN_user_catalogue ) %]
-                <li><a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a><ul>
-                    <li>
-                        <form name="searchform" method="get" action="/cgi-bin/koha/catalogue/search.pl" id="searchform">
-                        <input type="hidden" name="idx" value="" />
-                        <label for="navkeyword">
-                            Search:&nbsp;
-                        </label><input type="text" id="navkeyword" name="q" size="10" accesskey="s" />
-                        <input type="submit" value=" OK " class="submit" />
-                        </form>
-                     </li>
-                    <li><a href="/cgi-bin/koha/virtualshelves/shelves.pl">Lists</a></li>
-                </ul></li>
-                
-                [% END %]
-    [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
-    <li><a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a><ul>
-        <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl">Add MARC record</a></li>
-        <li><a href="/cgi-bin/koha/authorities/authorities-home.pl">Authorities</a></li>
-    [% END %]
-    [% IF ( CAN_user_serials ) %]
-        <li><a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a></li>
-    [% END %]
-    [% IF ( CAN_user_editcatalogue ) %]
-    </ul></li>
-    
-    <li><a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a></li>
-    [% END %]
-    [% IF ( CAN_user_reports ) %]
-          <li><a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a></li>
-    [% END %]
-    [% IF ( CAN_user_parameters ) %]
-   <li> <a href="/cgi-bin/koha/admin/admin-home.pl">Koha administration</a><ul>
-            <li><a href="/cgi-bin/koha/admin/systempreferences.pl">System preferences</a></li>
-        </ul></li>
-        
-    [% END %]
-    [% IF ( CAN_user_tools ) %]
-    <li><a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a></li>
-    [% END %]
-    <li><a href="/cgi-bin/koha/about.pl">About Koha</a></li>
-       </ul>
-    [% IF ( IntranetNav ) %]
-        [% IntranetNav %]
-    [% END %]
-       
-</div>
-</div>
index 6909e1c..a0f6abb 100644 (file)
@@ -1,6 +1,6 @@
 [% IF ( PAGE_NUMBERS ) %]<div class="pages">
     <!-- Row of numbers corresponding to search result pages -->
-        [% IF ( previous_page_offset ) %]<a class="nav" href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;offset=[% previous_page_offset %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by %][% END %]">&lt;&lt; Previous</a>[% END %]
+        [% IF ( previous_page_offset.defined ) %]<a class="nav" href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;offset=[% previous_page_offset %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by %][% END %]">&lt;&lt; Previous</a>[% END %]
     [% FOREACH PAGE_NUMBER IN PAGE_NUMBERS %][% IF ( PAGE_NUMBER.highlight ) %]<span class="current">[% PAGE_NUMBER.pg %]</span>[% ELSE %]        <a class="nav" href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;offset=[% PAGE_NUMBER.offset %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by %][% END %]">[% PAGE_NUMBER.pg %]</a>[% END %]
     [% END %]
         [% IF ( next_page_offset ) %]<a class="nav" href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;offset=[% next_page_offset %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by %][% END %]">Next &gt;&gt;</a>[% END %]
index c05c9be..ac2f388 100644 (file)
@@ -1,10 +1,23 @@
-[% IF category_type == 'I' %]
-    [% surname %] [% IF othernames %] ([% othernames %]) [% END %]
-[% ELSE %]
-    [% IF invert_name %]
-        [% surname %], [% firstname %]
+[% IF ( borrower.borrowernumber ) %]
+    [% IF borrower.category_type == 'I' %]
+        [% borrower.surname %] [% IF borrower.othernames %] ([% borrower.othernames %]) [% END %]
     [% ELSE %]
-        [% firstname %] [% surname %]
+        [% IF invert_name %]
+            [% borrower.surname %], [% borrower.firstname %] [% IF borrower.othernames %] ([% borrower.othernames %]) [% END %]
+        [% ELSE %]
+            [% borrower.firstname %] [% IF borrower.othernames %] ([% borrower.othernames %]) [% END %] [% borrower.surname %]
+        [% END %]
     [% END %]
-[% END %]
-([% cardnumber %])
+    ([% borrower.cardnumber %])
+[% ELSIF ( borrowernumber ) %]
+    [% IF category_type == 'I' %]
+        [% surname %] [% IF othernames %] ([% othernames %]) [% END %]
+    [% ELSE %]
+        [% IF invert_name %]
+            [% surname %], [% firstname %] [% IF othernames %] ([% othernames %]) [% END %]
+        [% ELSE %]
+            [% firstname %] [% IF othernames %] ([% othernames %]) [% END %] [% surname %]
+        [% END %]
+    [% END %]
+    ([% cardnumber %])
+[% END %]
\ No newline at end of file
index ad13bec..06b0752 100644 (file)
@@ -6,7 +6,7 @@
            <form action="/cgi-bin/koha/admin/preferences.pl">
         <input type="hidden" name="tab" value="[% last_tab %]" />
         <input type="hidden" name="op" value="search" />
-        <input type="text" size="40" name="searchfield" value="[% searchfield %]" />
+        <input type="text" size="40" name="searchfield" value="[% searchfield |html %]" />
         <input type="submit" class="submit" value="Search" />
     </form>
        </div>
index af23ab7..3ecaefc 100644 (file)
@@ -15,7 +15,6 @@
 [% IF ( searching ) %]<li class="active">[% ELSE %]<li>[% END %]<a title="Searching" href="/cgi-bin/koha/admin/preferences.pl?tab=searching">Searching</a></li>
 [% IF ( serials ) %]<li class="active">[% ELSE %]<li>[% END %]<a title="Serials" href="/cgi-bin/koha/admin/preferences.pl?tab=serials">Serials</a></li>
 [% IF ( staff_client ) %]<li class="active">[% ELSE %]<li>[% END %]<a title="Staff client" href="/cgi-bin/koha/admin/preferences.pl?tab=staff_client">Staff client</a></li>
-[% IF ( tools ) %]<li class="active">[% ELSE %]<li>[% END %]<a title="Tools" href="/cgi-bin/koha/admin/preferences.pl?tab=tools">Tools</a></li>
 [% IF ( web_services ) %]<li class="active">[% ELSE %]<li>[% END %]<a title="Web services" href="/cgi-bin/koha/admin/preferences.pl?tab=web_services">Web services</a></li>
 </ul>
 </div>
index 09e748b..8102201 100644 (file)
@@ -26,7 +26,9 @@
     <option value="callnum">&nbsp;&nbsp;&nbsp;&nbsp; Call number</option>
     <option value="ln,rtrn">Language</option>
     <option value="nt">Notes/Comments</option>
-    <option value="curriculum">Curriculum</option>
+    [% IF (marcflavour != 'UNIMARC' ) %]
+        <option value="curriculum">Curriculum</option>
+    [% END %]
     <option value="pb">Publisher</option>
     <option value="pl">Publisher location</option>
     <option value="yr">Publication date (yyyy)</option>
index 0feafda..8083192 100644 (file)
@@ -1,6 +1,7 @@
 [% IF ( subscriptionid ) %]
 <ul>
 <li><a href="serials-collection.pl?subscriptionid=[% subscriptionid %]">Serial collection</a></li>
+  [% UNLESS closed %]
     [% IF ( routing && CAN_user_serials_routing ) %]
         [% IF ( hasRouting ) %]
              <li><a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscriptionid %]">Edit routing list</a></li>
@@ -8,6 +9,7 @@
             <li><a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscriptionid %]&amp;op=new">Create routing list</a></li>
         [% END %]
     [% END %]
+  [% END %]
 </ul>
 [% END %]
 
index 00f76bc..0e7497d 100644 (file)
@@ -1,6 +1,18 @@
 <div id="toolbar"><script type="text/javascript">
        //<![CDATA[
 
+    function confirm_close() {
+        var is_confirmed = confirm(_("Are you sure you want to close this subscription?"));
+        if (is_confirmed) {
+            window.location="subscription-detail.pl?subscriptionid=[% subscriptionid %]&op=close";
+        }
+    }
+    function confirm_reopen() {
+        var is_confirmed = confirm(_("Are you sure you want to reopen this subscription?"));
+        if (is_confirmed) {
+            window.location="subscription-detail.pl?subscriptionid=[% subscriptionid %]&op=reopen";
+        }
+    }
        // prepare DOM for YUI Toolbar
 
         $(document).ready(function() {
@@ -50,6 +62,8 @@ onclick: {fn:function(){popup([% subscriptionid %])}}
                [% END %]
            new YAHOO.widget.Button("renew");
            new YAHOO.widget.Button("receive");
+        new YAHOO.widget.Button("close");
+        new YAHOO.widget.Button("reopen");
                [% END %]
        }
 
@@ -57,38 +71,49 @@ onclick: {fn:function(){popup([% subscriptionid %])}}
        </script>
 <ul class="toolbar">
     [% IF ( CAN_user_serials_create_subscription ) %]
-       [% IF ( biblionumber_for_new_subscription ) %]
-        <li><a id="newsubscription" href="/cgi-bin/koha/serials/subscription-add.pl?biblionumber_for_new_subscription=[% biblionumber_for_new_subscription %]">New subscription</a></li>
-       [% ELSE %]
-        <li><a id="newsubscription" href="/cgi-bin/koha/serials/subscription-add.pl">New subscription</a></li>
-       [% END %]
+        [% IF ( biblionumber_for_new_subscription ) %]
+            <li><a id="newsubscription" href="/cgi-bin/koha/serials/subscription-add.pl?biblionumber_for_new_subscription=[% biblionumber_for_new_subscription %]">New subscription</a></li>
+        [% ELSE %]
+            <li><a id="newsubscription" href="/cgi-bin/koha/serials/subscription-add.pl">New subscription</a></li>
+        [% END %]
     [% END %]
 
     [% IF ( CAN_user_serials_edit_subscription || CAN_user_serials_create_subscription || CAN_user_serials_delete_subscription ) %]
-       [% IF ( subscriptionid ) %]
+        [% IF ( subscriptionid ) %]
 
-           [% IF ( CAN_user_serials_edit_subscription || CAN_user_serials_create_subscription || CAN_user_serials_delete_subscription ) %]
-               [% UNLESS ( cannotedit ) %]
-                   <li id="editmenuc"><a id="edit" href="/cgi-bin/koha/serials/subscription-add.pl?op=modify&amp;subscriptionid=[% subscriptionid %]">Edit</a></li>
-               [% END %]
-           [% END %]
+            [% IF ( CAN_user_serials_edit_subscription || CAN_user_serials_create_subscription || CAN_user_serials_delete_subscription ) %]
+                [% UNLESS ( cannotedit ) %]
+                    <li id="editmenuc"><a id="edit" href="/cgi-bin/koha/serials/subscription-add.pl?op=modify&amp;subscriptionid=[% subscriptionid %]">Edit</a></li>
+                [% END %]
+            [% END %]
 
-           [% IF ( CAN_user_serials_create_subscription ) %]
-               <li><a id="duplicate" href="/cgi-bin/koha/serials/subscription-add.pl?op=dup&amp;subscriptionid=[% subscriptionid %]">Duplicate </a></li>
-           [% END %]
+            [% IF ( CAN_user_serials_create_subscription ) %]
+                <li><a id="duplicate" href="/cgi-bin/koha/serials/subscription-add.pl?op=dup&amp;subscriptionid=[% subscriptionid %]">Duplicate </a></li>
+            [% END %]
 
-           [% UNLESS ( cannotedit ) %]
-               [% IF ( CAN_user_serials_renew_subscription ) %]
-                   <li id="renewc"><a id="renew" href="#" onclick="popup([% subscriptionid %])">Renew </a></li>
-               [% END %]
-               [% IF ( CAN_user_serials_receive_serials ) %]
-                   <li><a id="receive" href="/cgi-bin/koha/serials/serials-edit.pl?subscriptionid=[% subscriptionid %]&amp;serstatus=1,3">Receive</a></li>
-               [% END %]
-               [% IF ( CAN_user_serials_delete_subscription ) %]
-                   <li><a id="delete" href="javascript:confirm_deletion()">Delete</a></li>
-               [% END %]
-           [% END %]
-       [% END %]
+            [% UNLESS ( cannotedit ) %]
+                [% UNLESS closed %]
+                    [% IF ( CAN_user_serials_renew_subscription ) %]
+                        <li id="renewc"><a id="renew" href="#" onclick="popup([% subscriptionid %])">Renew </a></li>
+                    [% END %]
+                [% END %]
+                [% IF ( CAN_user_serials_receive_serials ) %]
+                    [% UNLESS closed %]
+                        <li><a id="receive" href="/cgi-bin/koha/serials/serials-edit.pl?subscriptionid=[% subscriptionid %]&amp;serstatus=1,3">Receive</a></li>
+                    [% END %]
+                [% END %]
+                [% IF CAN_user_serials_edit_subscription %]
+                    [% IF closed %]
+                        <li><a id="reopen" href="javascript:confirm_reopen();">Reopen</a></li>
+                    [% ELSE %]
+                        <li><a id="close" href="javascript:confirm_close();">Close</a></li>
+                    [% END %]
+                [% END %]
+                [% IF ( CAN_user_serials_delete_subscription ) %]
+                    <li><a id="delete" href="javascript:confirm_deletion()">Delete</a></li>
+                [% END %]
+            [% END %]
+        [% END %]
     [% END %]
 </ul>
 </div>
index 896e59e..5e6bf63 100644 (file)
@@ -6,21 +6,21 @@
                <p>
                <label>Audience</label>
                <select name="limit" class="subtype">
-            <option value="" SELECTED="selected" >Any</option>
+            <option value="" selected="selected" >Any</option>
                        <option value="aud:a">juvenile, general</option>
                        <option value="aud:b">pre-primary (0-5)</option>
-                       <option value="aud:c">Primary (5-8)</option>
+            <option value="aud:c">primary (5-8)</option>
                        <option value="aud:d">children (9-14)</option>
-                       <option value="aud:e">Young Adult</option>
-                       <option value="aud:k">Adult, serious</option>
-                       <option value="aud:m">Adult, General</option>
-                       <option value="aud:u">Unknown</option>
+            <option value="aud:e">young Adult</option>
+            <option value="aud:k">adult, serious</option>
+            <option value="aud:m">adult, general</option>
+            <option value="aud:u">unknown</option>
                </select>
                </p>
                <p>
                <label>Print</label>
         <select name="limit" class="subtype">
-                       <option value="" selected="selected" >any</option>
+            <option value="" selected="selected" >Any</option>
                                <option value="Material-type:r">regular print</option>
                                <option value="Material-type:d">large print</option>
                                <option value="Material-type:e">newspaper format</option>
                                <option value="Material-type:h">hand-written</option>
                                <option value="Material-type:i">multimedia</option>
                                <option value="Material-type:j">mini-print</option>
+                <option value="Material-type:s">electronic ressource</option>
+                <option value="Material-type:t">microform</option>
                                <option value="Material-type:z">other form of textual material</option>
                </select>
                </p>
                <p>
-               <label>Feschrift Ind.</label>
+        <label>Literary genre</label>
                <select name="limit" class="subtype">
                        <option value="" selected="selected" >Any</option>
             <option value="Literature-Code:a">fiction</option>
             <option value="Literature-Code:f">short stories</option>
             <option value="Literature-Code:g">poetry</option>
             <option value="Literature-Code:h">speeches, oratory</option>
+            <option value="Literature-Code:i">libretto</option>
             <option value="Literature-Code:y">not a literary text</option>
-            <option value="Literature-Code:z">multiple/other lit. forms</option>
-               </select>
-               </p>
+            <option value="Literature-Code:z">multiple/other literary forms</option>
+    </select>
+    </p>
         <p>
                <label>Biography</label>
         <select name="limit" class="subtype" size="1">
             <option value="">Any</option>
-            <option value="Biography-code:y">Not a biography</option>
+            <option value="Biography-code:y">not a biography</option>
             <option value="Biography-code:a">autobiography</option>
             <option value="Biography-code:b">individual biography</option>
             <option value="Biography-code:c">collective biography</option>
-            <option value="Biography-code:d">contains biogr. data</option>
+            <option value="Biography-code:d">contains biographical data</option>
                </select>
         </p>
         <p>
             <option value="ctype:r" >literature surveys/reviews</option>
             <option value="ctype:s" >treaties</option>
             <option value="ctype:t" >cartoons or comic strips</option>
+            <option value="ctype:v" >dissertation or thesis (revised)</option>v
+            <option value="ctype:w" >religious text</option>
             <option value="ctype:z" >other</option>
                </select>
         </p>
                <select name="limit" class="subtype">
            <option value="">Any type</option>
            <option value="Type-Of-Serial:a">Periodical</option>
-                       <option value="Type-Of-Serial:b">Monographical series</option>
+                    <option value="Type-Of-Serial:b">Monographic series</option>
                        <option value="Type-Of-Serial:c">Newspaper</option>
+                    <option value="Type-Of-Serial:e">Updating loose-leaf</option>
+                    <option value="Type-Of-Serial:f">Database</option>
+                    <option value="Type-Of-Serial:g">Updating website</option>
                        <option value="Type-Of-Serial:z">Other</option>
                </select>
                </p>
                                <option value="Frequency-code:i">Three times a year</option>
                                <option value="Frequency-code:j">Semiannual</option>
                                <option value="Frequency-code:k">Annual</option>
-                               <option value="Frequency-code:l">Biannual</option>
+                <option value="Frequency-code:l">Biennial</option>
                                <option value="Frequency-code:m">Triennial</option>
                                <option value="Frequency-code:n">Three times a week</option>
                                <option value="Frequency-code:o">Three times a month</option>
-                               <option value="Frequency-code:u">Unknown</option>
                                <option value="Frequency-code:y">Without periodicity</option>
-                               <option value="Frequency-code:i">Other</option>
+                <option value="Frequency-code:u">Unknown</option>
+                <option value="Frequency-code:z">Other</option>
                </select>
                </p>
                <p>
                <label>Regularity</label>
                <select name="limit" class="subtype">
             <option value="">Any regularity</option>
-                               <option value="Regularity-code:u">Unknown</option>
-                               <option value="Regularity-code:a">Regular</option>
-                               <option value="Regularity-code:b">Normalised irregular</option>
+                <option value="Regularity-code:a">regular</option>
+                <option value="Regularity-code:b">normalised irregular</option>
                                <option value="Regularity-code:y">irregular</option>
+                <option value="Regularity-code:u">unknown</option>
                </select>
         </p>
 
                                <option value="Graphics-type:z">other non-projected graphic type</option>
                </select>
                <select name="limit" class="subtype">
-            <option value="">any</option>
+            <option value="">Any</option>
             <option value="Graphics-support:a">canvas</option>
             <option value="Graphics-support:b">bristol board</option>
             <option value="Graphics-support:c">cardboard/illustration board</option>
             <option value="Graphics-support:l">porcelaine</option>
             <option value="Graphics-support:m">stone</option>
             <option value="Graphics-support:n">wood</option>
-            <option value="Graphics-support:u">unknown</option>
             <option value="Graphics-support:v">mixed collection</option>
             <option value="Graphics-support:e">synthetics</option>
             <option value="Graphics-support:f">skin</option>
             <option value="Graphics-support:h">metal</option>
             <option value="Graphics-support:i">paper</option>
             <option value="Graphics-support:z">others</option>
-               </select>
+            <option value="Graphics-support:u">unknown</option>
+    </select>
         </p>
-
 </fieldset>
 </div>
index 7318fb6..b2bd544 100644 (file)
         });
         
        [% IF ( viewshelf ) %] function sendList(){
-               open(CGIBIN+'virtualshelves/sendshelf.pl?shelfid=[% shelfnumber %]','win_form','dependant=yes,scrollbars=no,resizable=no,height=300,width=450,top=50,left=100');
+        open(CGIBIN+'virtualshelves/sendshelf.pl?shelfid=[% shelfnumber %]','win_form','scrollbars=no,resizable=no,height=300,width=450,top=50,left=100');
         }
         
         function downloadList(){
-               open(CGIBIN+'virtualshelves/downloadshelf.pl?shelfid=[% shelfnumber %]','win_form','dependant=yes,scrollbars=no,resizable=no,height=300,width=450,top=50,left=100');
+        open(CGIBIN+'virtualshelves/downloadshelf.pl?shelfid=[% shelfnumber %]','win_form','scrollbars=no,resizable=no,height=300,width=450,top=50,left=100');
         }[% END %]
 
        // YUI Toolbar Functions
index 028dae4..d67b05b 100644 (file)
@@ -639,49 +639,25 @@ function messenger(X,Y,etc){    // FIXME: unused?
 
 //  NEXT BLOCK IS USED BY NEWORDERBEMPTY
 
-function calcNeworderTotal(){
-    //collect values
-    var f        = document.getElementById('Aform');
-    var quantity = new Number(f.quantity.value);
-    var discount = new Number(f.discount.value);
-    var listinc  = new Number (f.listinc.value);
-    //var currency = f.currency.value;
-    var applygst = new Number (f.applygst.value);
-    var listprice   =  new Number(f.listprice.value);
-    var invoiceingst =  new Number (f.invoiceincgst.value);
-//    var exchangerate =  new Number(f.elements[currency].value);      //get exchange rate
-        var currcode = new String(document.getElementById('currency').value);
-       var exchangerate =  new Number(document.getElementById(currcode).value);
-
-    var gst_on=(!listinc && invoiceingst);
-
-    //do real stuff
+function updateCosts(){
+    var quantity = new Number($("#quantity").val());
+    var discount = new Number($("#discount").val());
+    var applygst = new Number ($("#applygst").val());
+    var listprice   =  new Number($("#listprice").val());
+    var exchangerate =  new Number($("#currency_rate").val());
+    var gst_on=false;
+
     var rrp   = new Number(listprice*exchangerate);
     var ecost = rrp;
-    if (100-discount != 100) { //Prevent rounding issues if no discount
-        ecost = new Number(Math.floor(rrp * (100 - discount ))/100);
+    if ( 100-discount != 100 ) { //Prevent rounding issues if no discount
+        ecost = new Number(Math.floor(rrp * (100 - discount )) / 100);
     }
-    var GST   = new Number(0);
-    if (gst_on) {
-            rrp=rrp * (1+f.gstrate.value / 100);
-        GST=ecost * f.gstrate.value / 100;
-    }
-
-    var total =  new Number( (ecost + GST) * quantity);
+    var total =  new Number( ecost * quantity);
+    $("#rrp").val(rrp.toFixed(2));
+    $("#ecost").val(ecost.toFixed(2));
+    $("#total").val(total.toFixed(2));
+    $("listprice").val(listprice.toFixed(2));
 
-    f.rrp.value = rrp.toFixed(2);
-
-//     f.rrp.value = rrp
-//     f.rrp.value = 'moo'
-
-    f.ecost.value = ecost.toFixed(2);
-    f.total.value = total.toFixed(2);
-    f.listprice.value =  listprice.toFixed(2);
-
-//  gst-stuff needs verifing, mason.
-    if (f.GST) {
-        f.GST.value=GST;
-    }
     return true;
 }
 
index 2043cd6..cddddf7 100644 (file)
@@ -79,7 +79,7 @@ function openBasket() {
     if ( strCookie ) {
         var iW = 820;
         var iH = 450;
-        var optWin = "dependant=yes,status=yes,scrollbars=yes,resizable=yes,toolbar=no,location=yes,height="+iH+",width="+iW;
+        var optWin = "status=yes,scrollbars=yes,resizable=yes,toolbar=no,location=yes,height="+iH+",width="+iW;
         var loc = CGIBIN + "basket/basket.pl?" + strCookie;
         var basket = open(loc, "basket", optWin);
         if (window.focus) {basket.focus()}
@@ -335,7 +335,7 @@ function sendBasket() {
 
     var loc = CGIBIN + "basket/sendbasket.pl?" + strCookie;
 
-    var optWin="dependant=yes,scrollbars=no,resizable=no,height=300,width=450,top=50,left=100";
+    var optWin="scrollbars=no,resizable=no,height=300,width=450,top=50,left=100";
     var win_form = open(loc,"win_form",optWin);
 }
 
@@ -345,7 +345,7 @@ function downloadBasket() {
 
     var loc = CGIBIN + "basket/downloadcart.pl?" + strCookie;
 
-    open(loc,"win_form",'dependant=yes,scrollbars=no,resizable=no,height=300,width=450,top=50,left=100');
+    open(loc,"win_form",'scrollbars=no,resizable=no,height=300,width=450,top=50,left=100');
 }
 
 function printBasket() {
diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js b/koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js
new file mode 100644 (file)
index 0000000..e604bdc
--- /dev/null
@@ -0,0 +1,466 @@
+/*
+ * Unified file for catalogue edition
+ */
+
+/* Functions developed for addbiblio.tt and authorities.tt */
+
+// returns the fieldcode based upon tag div id
+function getFieldCode(tagDivId){
+    // format : tag_<tagnumber>_...
+    return tagDivId.substr(3+1,3);
+}
+
+//returns the field and subfieldcode based upon subfield div id
+function getFieldAndSubfieldCode(subfieldDivId){
+ // format : subfield<tagnumber><subfieldnumber>...
+    return subfieldDivId.substr(8,3+1);
+}
+
+//returns the subfieldcode based upon subfieldid writing
+function getSubfieldCode(tagsubfieldid){
+    // 3 : tag +3 : tagnumber +4 : number of _ +8 subfield -1 begins at 0
+    return tagsubfieldid.substr(3+3+4+8-1,1);
+}
+
+// Take the base of tagsubfield information (removing the subfieldcodes and subfieldindexes)
+// returns the filter
+function getTagInputnameFilter(tagsubfieldid){
+    var tagsubfield=tagsubfieldid.substr(0,tagsubfieldid.lastIndexOf("_"));
+    var tagcode=tagsubfield.substr(tagsubfield.lastIndexOf("_"));
+    tagsubfield=tagsubfield.substr(0,tagsubfield.lastIndexOf("_"));
+    tagsubfield=tagsubfield.substr(0,tagsubfield.lastIndexOf("_"));
+    tagsubfield=tagsubfield+"_."+tagcode;
+    return tagsubfield;
+}
+
+// if source is "auth", we are editing an authority otherwise it is a biblio
+function openAuth(tagsubfieldid,authtype,source) {
+    // let's take the base of tagsubfield information (removing the indexes and the codes
+    var element=document.getElementById(tagsubfieldid);
+    var tagsubfield=getTagInputnameFilter(tagsubfieldid);
+    var elementsubfcode=getSubfieldCode(element.name);
+    var mainmainstring=element.value;
+    var mainstring="";
+    var inputs = element.parentNode.parentNode.getElementsByTagName("input");
+
+    for (var myindex =0; myindex<inputs.length;myindex++){
+        if (inputs[myindex].name && inputs[myindex].name.match(tagsubfield)){
+            var subfieldcode=getSubfieldCode(inputs[myindex].name);
+            if (isNaN(parseInt(subfieldcode)) && inputs[myindex].value != "" && subfieldcode!=elementsubfcode){
+                mainstring=inputs[myindex].value+" "+mainstring;
+            }
+        }
+    }
+    newin=window.open("../authorities/auth_finder.pl?source="+source+"&authtypecode="+authtype+"&index="+tagsubfieldid+"&value_mainstr="+encodeURI(mainmainstring)+"&value_main="+encodeURI(mainstring), "_blank",'width=700,height=550,toolbar=false,scrollbars=yes');
+}
+
+function ExpandField(index) {
+    var original = document.getElementById(index); //original <div>
+    var divs = original.getElementsByTagName('div');
+    for(var i=0,divslen = divs.length ; i<divslen ; i++){   // foreach div
+        if(divs[i].getAttribute('id').match(/^subfield/)){  // if it s a subfield
+            if (!divs[i].style.display) {
+                // first time => show all subfields
+                divs[i].style.display = 'block';
+            } else if (divs[i].style.display == 'none') {
+                // show
+                divs[i].style.display = 'block';
+            } else {
+                // hide
+                divs[i].style.display = 'none';
+            }
+        }
+    }
+}
+/**
+ * To clone a field
+ * @param hideMarc '0' for false, '1' for true
+ * @param advancedMARCEditor '0' for false, '1' for true
+ */
+function CloneField(index, hideMarc, advancedMARCEditor) {
+    var original = document.getElementById(index); //original <div>
+    var clone = original.cloneNode(true);
+    var new_key = CreateKey();
+    var new_id  = original.getAttribute('id')+new_key;
+
+    clone.setAttribute('id',new_id); // setting a new id for the parent div
+
+    var divs = clone.getElementsByTagName('div');
+
+    // if hide_marc, indicators are hidden fields
+    // setting a new name for the new indicator
+    for(var i=0; i < 2; i++) {
+        var indicator = clone.getElementsByTagName('input')[i];
+        indicator.setAttribute('name',indicator.getAttribute('name')+new_key);
+    }
+
+    // settings all subfields
+    for(var i=0,divslen = divs.length ; i<divslen ; i++){      // foreach div
+        if(divs[i].getAttribute("id").match(/^subfield/)){  // if it s a subfield
+
+            // set the attribute for the new 'div' subfields
+            divs[i].setAttribute('id',divs[i].getAttribute('id')+new_key);
+
+            var inputs   = divs[i].getElementsByTagName('input');
+            var id_input = "";
+
+            for( j = 0 ; j < inputs.length ; j++ ) {
+                if(inputs[j].getAttribute("id") && inputs[j].getAttribute("id").match(/^tag_/) ){
+                    inputs[j].value = "";
+                }
+            }
+
+            inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key);
+            inputs[0].setAttribute('name',inputs[0].getAttribute('name')+new_key);
+            var id_input;
+            try {
+                id_input = inputs[1].getAttribute('id')+new_key;
+                inputs[1].setAttribute('id',id_input);
+                inputs[1].setAttribute('name',inputs[1].getAttribute('name')+new_key);
+            } catch(e) {
+                try{ // it s a select if it is not an input
+                    var selects = divs[i].getElementsByTagName('select');
+                    id_input = selects[0].getAttribute('id')+new_key;
+                    selects[0].setAttribute('id',id_input);
+                    selects[0].setAttribute('name',selects[0].getAttribute('name')+new_key);
+                }catch(e2){ // it is a textarea if it s not a select or an input
+                    var textaeras = divs[i].getElementsByTagName('textarea');
+                    id_input = textaeras[0].getAttribute('id')+new_key;
+                    textaeras[0].setAttribute('id',id_input);
+                    textaeras[0].setAttribute('name',textaeras[0].getAttribute('name')+new_key);
+                }
+            }
+
+            if (advancedMARCEditor == '0') {
+                // when cloning a subfield, re set its label too.
+                var labels = divs[i].getElementsByTagName('label');
+                labels[0].setAttribute('for',id_input);
+            }
+
+            if(hideMarc == '0') {
+                // updating javascript parameters on button up
+                var imgs = divs[i].getElementsByTagName('img');
+                imgs[0].setAttribute('onclick',"upSubfield(\'"+divs[i].getAttribute('id')+"\');");
+            }
+
+            // setting its '+' and '-' buttons
+            try {
+                var anchors = divs[i].getElementsByTagName('a');
+                for (var j = 0; j < anchors.length; j++) {
+                    if(anchors[j].getAttribute('class') == 'buttonPlus'){
+                        anchors[j].setAttribute('onclick',"CloneSubfield('" + divs[i].getAttribute('id') + "','" + advancedMARCEditor + "'); return false;");
+                    } else if (anchors[j].getAttribute('class') == 'buttonMinus') {
+                        anchors[j].setAttribute('onclick',"UnCloneField('" + divs[i].getAttribute('id') + "'); return false;");
+                    }
+                }
+            }
+            catch(e){
+                // do nothig if ButtonPlus & CloneButtonPlus don t exist.
+            }
+
+            // button ...
+            var spans=0;
+            try {
+                spans = divs[i].getElementsByTagName('a');
+            } catch(e) {
+                // no spans
+            }
+            if(spans){
+                var buttonDot;
+                if(!CloneButtonPlus){ // it s impossible to have  + ... (buttonDot AND buttonPlus)
+                    buttonDot = spans[0];
+                    if(buttonDot){
+                        // 2 possibilities :
+                        try{
+                            var buttonDotOnClick = buttonDot.getAttribute('onclick');
+                            if(buttonDotOnClick.match('Clictag')){   // -1- It s a plugin
+                                var re = /\('.*'\)/i;
+                                buttonDotOnClick = buttonDotOnClick.replace(re,"('"+inputs[1].getAttribute('id')+"')");
+                                if(buttonDotOnClick){
+                                    buttonDot.setAttribute('onclick',buttonDotOnClick);
+                                }
+                            } else {
+                                if(buttonDotOnClick.match('Dopop')) {  // -2- It's a auth value
+                                    var re1 = /&index=.*',/;
+                                    var re2 = /,.*\)/;
+
+                                    buttonDotOnClick = buttonDotOnClick.replace(re1,"&index="+inputs[1].getAttribute('id')+"',");
+                                    buttonDotOnClick = buttonDotOnClick.replace(re2,",'"+inputs[1].getAttribute('id')+"')");
+
+                                    if(buttonDotOnClick){
+                                            buttonDot.setAttribute('onclick',buttonDotOnClick);
+                                    }
+                                }
+                            }
+                            try {
+                                // do not copy the script section.
+                                var script = spans[0].getElementsByTagName('script')[0];
+                                spans[0].removeChild(script);
+                            } catch(e) {
+                                // do nothing if there is no script
+                            }
+                        }catch(e){}
+                    }
+                }
+            }
+            if(hideMarc == '0') {
+                var buttonUp = divs[i].getElementsByTagName('img')[0];
+                buttonUp.setAttribute('onclick',"upSubfield('" + divs[i].getAttribute('id') + "')");
+            }
+
+        } else { // it's a indicator div
+            if(divs[i].getAttribute('id').match(/^div_indicator/)){
+
+                // setting a new id for the indicator div
+                divs[i].setAttribute('id',divs[i].getAttribute('id')+new_key);
+
+                var inputs = divs[i].getElementsByTagName('input');
+                inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key);
+                inputs[1].setAttribute('id',inputs[1].getAttribute('id')+new_key);
+
+                var CloneButtonPlus;
+                try {
+                    var anchors = divs[i].getElementsByTagName('a');
+                    for (var j = 0; j < anchors.length; j++) {
+                        if (anchors[j].getAttribute('class') == 'buttonPlus') {
+                            anchors[j].setAttribute('onclick',"CloneField('" + new_id + "','" + hideMarc + "','" + advancedMARCEditor + "'); return false;");
+                        } else if (anchors[j].getAttribute('class') == 'buttonMinus') {
+                            anchors[j].setAttribute('onclick',"UnCloneField('" + new_id + "'); return false;");
+                        } else if (anchors[j].getAttribute('class') == 'expandfield') {
+                            anchors[j].setAttribute('onclick',"ExpandField('" + new_id + "'); return false;");
+                        }
+                    }
+                }
+                catch(e){
+                    // do nothig CloneButtonPlus doesn't exist.
+                }
+
+            }
+        }
+    }
+
+    // insert this line on the page
+    original.parentNode.insertBefore(clone,original.nextSibling);
+}
+
+/**
+ * To clone a subfield
+ * @param index
+ * @param advancedMARCEditor '0' for false, '1' for true
+ */
+function CloneSubfield(index, advancedMARCEditor){
+    var original = document.getElementById(index); //original <div>
+    var clone = original.cloneNode(true);
+    var new_key = CreateKey();
+
+    // set the attribute for the new 'div' subfields
+    var inputs     = clone.getElementsByTagName('input');
+    var selects    = clone.getElementsByTagName('select');
+    var textareas  = clone.getElementsByTagName('textarea');
+    var linkid;
+
+    // input
+    var id_input = "";
+    for(var i=0,len=inputs.length; i<len ; i++ ){
+        id_input = inputs[i].getAttribute('id')+new_key;
+        inputs[i].setAttribute('id',id_input);
+        inputs[i].setAttribute('name',inputs[i].getAttribute('name')+new_key);
+        linkid = id_input;
+    }
+
+    // select
+    for(var i=0,len=selects.length; i<len ; i++ ){
+        id_input = selects[i].getAttribute('id')+new_key;
+        selects[i].setAttribute('id',selects[i].getAttribute('id')+new_key);
+        selects[i].setAttribute('name',selects[i].getAttribute('name')+new_key);
+    }
+
+    // textarea
+    for(var i=0,len=textareas.length; i<len ; i++ ){
+        id_input = textareas[i].getAttribute('id')+new_key;
+        textareas[i].setAttribute('id',textareas[i].getAttribute('id')+new_key);
+        textareas[i].setAttribute('name',textareas[i].getAttribute('name')+new_key);
+    }
+
+    // Changing the "..." link's onclick attribute for plugin callback
+    var links  = clone.getElementsByTagName('a');
+    var link = links[0];
+    var buttonDotOnClick = link.getAttribute('onclick');
+    if(buttonDotOnClick.match('Clictag')){   // -1- It s a plugin
+    var re = /\('.*'\)/i;
+        buttonDotOnClick = buttonDotOnClick.replace(re,"('"+linkid+"')");
+        if(buttonDotOnClick){
+        link.setAttribute('onclick',buttonDotOnClick);
+        }
+    }
+
+    if(advancedMARCEditor == '0') {
+        // when cloning a subfield, reset its label too.
+        var label = clone.getElementsByTagName('label')[0];
+        label.setAttribute('for',id_input);
+    }
+
+    // setting a new id for the parent div
+    var new_id  = original.getAttribute('id')+new_key;
+    clone.setAttribute('id',new_id);
+
+    try {
+        var buttonUp = clone.getElementsByTagName('img')[0];
+        buttonUp.setAttribute('onclick',"upSubfield('" + new_id + "')");
+        var anchors = clone.getElementsByTagName('a');
+        if(anchors.length){
+            for(var i = 0 ,lenanchors = anchors.length ; i < lenanchors ; i++){
+                if(anchors[i].getAttribute('class') == 'buttonPlus'){
+                    anchors[i].setAttribute('onclick',"CloneSubfield('" + new_id + "','" + advancedMARCEditor + "'); return false;");
+                } else if (anchors[i].getAttribute('class') == 'buttonMinus') {
+                    anchors[i].setAttribute('onclick',"UnCloneField('" + new_id + "'); return false;");
+                }
+            }
+        }
+    }
+    catch(e){
+        // do nothig if ButtonPlus & CloneButtonPlus don't exist.
+    }
+    // insert this line on the page
+    original.parentNode.insertBefore(clone,original.nextSibling);
+}
+
+ /**
+ * This function removes or clears unwanted subfields
+ */
+function UnCloneField(index) {
+    var original = document.getElementById(index);
+    var canUnclone = false;
+    if ($(original).hasClass("tag")) {
+        // unclone a field, check if there will remain one field
+        var fieldCode = getFieldCode(index);
+        // tag divs with id begining with original field code
+        var cloneFields = $('.tag[id^="tag_'+fieldCode+'"]');
+        if (cloneFields.length > 1) {
+            canUnclone = true;
+        }
+    } else {
+        // unclone a subfield, check if there will remain one subfield
+        var subfieldCode = getFieldAndSubfieldCode(index);
+        // subfield divs with id begining with original field and subfield field code
+        var cloneSubfields = $('.subfield_line[id^="subfield'+subfieldCode+'"]');
+        if (cloneSubfields.length > 1) {
+            canUnclone = true;
+        }
+    }
+    if (canUnclone) {
+        // remove clone
+        original.parentNode.removeChild(original);
+    } else {
+        // clear inputs, but don't delete
+        $(":input.input_marceditor", original).each(function(){
+            // thanks to http://www.learningjquery.com/2007/08/clearing-form-data for
+            // hint about clearing selects correctly
+            var type = this.type;
+            var tag = this.tagName.toLowerCase();
+            if (type == 'text' || type == 'password' || tag == 'textarea') {
+                this.value = "";
+            } else if (type == 'checkbox' || type == 'radio') {
+                this.checked = false;
+            } else if (tag == 'select') {
+                this.selectedIndex = -1;
+            }
+        });
+        $(":input.indicator", original).val("");
+    }
+}
+
+/**
+ * This function create a random number
+ */
+function CreateKey(){
+    return parseInt(Math.random() * 100000);
+}
+
+/**
+ * This function allows to move a subfield up by clickink on the 'up' button .
+ */
+function upSubfield(index) {
+    try{
+        var line = document.getElementById(index); // get the line where the user has clicked.
+    } catch(e) {
+        return; // this line doesn't exist...
+    }
+    var tag = line.parentNode; // get the dad of this line. (should be "<div id='tag_...'>")
+
+    // getting all subfields for this tag
+    var subfields = tag.getElementsByTagName('div');
+    var subfieldsLength = subfields.length;
+
+    if(subfieldsLength<=1) return; // nothing to do if there is just one subfield.
+
+    // among all subfields
+    for(var i=0;i<subfieldsLength;i++){
+        if(subfields[i].getAttribute('id') == index){ //looking for the subfield which is clicked :
+            if(i==1){ // if the clicked subfield is on the top
+                tag.appendChild(subfields[1]);
+                return;
+            } else {
+                var lineAbove = subfields[i-1];
+                tag.insertBefore(line,lineAbove);
+                return;
+            }
+        }
+    }
+}
+
+// FIXME :: is it used ?
+function unHideSubfield(index,labelindex) {
+    subfield = document.getElementById(index);
+    subfield.style.display = 'block';
+    label = document.getElementById(labelindex);
+    label.style.display='none';
+}
+
+/* Functions developed for additem.tt */
+
+/**
+ * To clone a subfield.<br>
+ * @param original subfield div to clone
+ */
+function CloneItemSubfield(original){
+    var clone = original.cloneNode(true);
+    var new_key = CreateKey();
+
+    // set the attribute for the new 'div' subfields
+    var inputs     = clone.getElementsByTagName('input');
+    var selects    = clone.getElementsByTagName('select');
+    var textareas  = clone.getElementsByTagName('textarea');
+
+    // input (except hidden type)
+    var id_input = "";
+    for(var i=0,len=inputs.length; i<len ; i++ ){
+        if (inputs[i].getAttribute('type') != 'hidden') {
+            id_input = inputs[i].getAttribute('id')+new_key;
+            inputs[i].setAttribute('id',id_input);
+        }
+    }
+
+    // select
+    for(var i=0,len=selects.length; i<len ; i++ ){
+        id_input = selects[i].getAttribute('id')+new_key;
+        selects[i].setAttribute('id',selects[i].getAttribute('id')+new_key);
+    }
+
+    // textarea
+    for(var i=0,len=textareas.length; i<len ; i++ ){
+        id_input = textareas[i].getAttribute('id')+new_key;
+        textareas[i].setAttribute('id',textareas[i].getAttribute('id')+new_key);
+    }
+
+    // when cloning a subfield, reset its label too.
+    var label = clone.getElementsByTagName('label')[0];
+    label.setAttribute('for',id_input);
+
+    // setting a new if for the parent div
+    var new_id = original.getAttribute('id')+new_key;
+    clone.setAttribute('id',new_id);
+
+    // insert this line on the page
+    original.parentNode.insertBefore(clone,original.nextSibling);
+}
index 93dfaac..80b0fc6 100644 (file)
@@ -59,6 +59,16 @@ $( document ).ready( function () {
         mark_modified.call(this);
     } );
 
+    $(".set_syspref").click(function() {
+        var s = $(this).attr('data-syspref');
+        var v = $(this).attr('data-value');
+        // populate the input with the value in data-value
+        $("#pref_"+s).val(v);
+        // pass the DOM element to trigger "modified" to enable submit button
+        mark_modified.call($("#pref_"+s)[0]);
+        return false;
+    });
+
     window.onbeforeunload = function () {
         if ( KOHA.Preferences.Modified ) {
             return MSG_MADE_CHANGES;
diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_flat_0_aaaaaa_40x100.png b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_flat_0_aaaaaa_40x100.png
new file mode 100644 (file)
index 0000000..5b5dab2
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_flat_0_aaaaaa_40x100.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_flat_75_ffffff_40x100.png b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_flat_75_ffffff_40x100.png
new file mode 100644 (file)
index 0000000..ac8b229
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_flat_75_ffffff_40x100.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_glass_55_fbf9ee_1x400.png b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_glass_55_fbf9ee_1x400.png
new file mode 100644 (file)
index 0000000..ad3d634
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_glass_55_fbf9ee_1x400.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_glass_65_ffffff_1x400.png b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_glass_65_ffffff_1x400.png
new file mode 100644 (file)
index 0000000..42ccba2
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_glass_65_ffffff_1x400.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_glass_75_dadada_1x400.png b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_glass_75_dadada_1x400.png
new file mode 100644 (file)
index 0000000..5a46b47
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_glass_75_dadada_1x400.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_glass_75_e6e6e6_1x400.png b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_glass_75_e6e6e6_1x400.png
new file mode 100644 (file)
index 0000000..86c2baa
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_glass_75_e6e6e6_1x400.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_glass_95_fef1ec_1x400.png b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_glass_95_fef1ec_1x400.png
new file mode 100644 (file)
index 0000000..4443fdc
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_glass_95_fef1ec_1x400.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_highlight-soft_75_cccccc_1x100.png
new file mode 100644 (file)
index 0000000..7c9fa6c
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_highlight-soft_75_cccccc_1x100.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-icons_2e83ff_256x240.png b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-icons_2e83ff_256x240.png
new file mode 100644 (file)
index 0000000..09d1cdc
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-icons_2e83ff_256x240.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-icons_888888_256x240.png b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-icons_888888_256x240.png
new file mode 100644 (file)
index 0000000..6d02426
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-icons_888888_256x240.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-icons_cd0a0a_256x240.png b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-icons_cd0a0a_256x240.png
new file mode 100644 (file)
index 0000000..2ab019b
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-icons_cd0a0a_256x240.png differ
index f2deef2..fe76cd3 100644 (file)
  * http://docs.jquery.com/UI/Menu#theming
  */
 .ui-menu {
-       list-style:none;
-       padding: 2px;
-       margin: 0;
-       display:block;
      float: left;
+       list-style:none;
+       padding: 2px;
+  margin: 0;
+     display:block;
+ float: left;
 }
 .ui-menu .ui-menu {
-       margin-top: -3px;
+     margin-top: -3px;
 }
 .ui-menu .ui-menu-item {
-       margin:0;
-       padding: 0;
-       zoom: 1;
-       float: left;
-       clear: left;
-       width: 100%;
+   margin:0;
+      padding: 0;
+    zoom: 1;
+       float: left;
+   clear: left;
+   width: 100%;
 }
 .ui-menu .ui-menu-item a {
-       text-decoration:none;
-       display:block;
      padding:.2em .4em;
-       line-height:1.5;
-       zoom:1;
+      text-decoration:none;
+  display:block;
+ padding:.2em .4em;
+     line-height:1.5;
+       zoom:1;
 }
 .ui-menu .ui-menu-item a.ui-state-hover,
 .ui-menu .ui-menu-item a.ui-state-active {
-       font-weight: normal;
-       margin: -1px;
+  font-weight: normal;
+   margin: -1px;
 }
 /*!
  * jQuery UI Slider 1.8.23
index 2fca9c7..635f4c6 100644 (file)
 * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
 (function(a,b){a.ui=a.ui||{};var c=/left|center|right/,d=/top|center|bottom/,e="center",f={},g=a.fn.position,h=a.fn.offset;a.fn.position=function(b){if(!b||!b.of)return g.apply(this,arguments);b=a.extend({},b);var h=a(b.of),i=h[0],j=(b.collision||"flip").split(" "),k=b.offset?b.offset.split(" "):[0,0],l,m,n;return i.nodeType===9?(l=h.width(),m=h.height(),n={top:0,left:0}):i.setTimeout?(l=h.width(),m=h.height(),n={top:h.scrollTop(),left:h.scrollLeft()}):i.preventDefault?(b.at="left top",l=m=0,n={top:b.of.pageY,left:b.of.pageX}):(l=h.outerWidth(),m=h.outerHeight(),n=h.offset()),a.each(["my","at"],function(){var a=(b[this]||"").split(" ");a.length===1&&(a=c.test(a[0])?a.concat([e]):d.test(a[0])?[e].concat(a):[e,e]),a[0]=c.test(a[0])?a[0]:e,a[1]=d.test(a[1])?a[1]:e,b[this]=a}),j.length===1&&(j[1]=j[0]),k[0]=parseInt(k[0],10)||0,k.length===1&&(k[1]=k[0]),k[1]=parseInt(k[1],10)||0,b.at[0]==="right"?n.left+=l:b.at[0]===e&&(n.left+=l/2),b.at[1]==="bottom"?n.top+=m:b.at[1]===e&&(n.top+=m/2),n.left+=k[0],n.top+=k[1],this.each(function(){var c=a(this),d=c.outerWidth(),g=c.outerHeight(),h=parseInt(a.curCSS(this,"marginLeft",!0))||0,i=parseInt(a.curCSS(this,"marginTop",!0))||0,o=d+h+(parseInt(a.curCSS(this,"marginRight",!0))||0),p=g+i+(parseInt(a.curCSS(this,"marginBottom",!0))||0),q=a.extend({},n),r;b.my[0]==="right"?q.left-=d:b.my[0]===e&&(q.left-=d/2),b.my[1]==="bottom"?q.top-=g:b.my[1]===e&&(q.top-=g/2),f.fractions||(q.left=Math.round(q.left),q.top=Math.round(q.top)),r={left:q.left-h,top:q.top-i},a.each(["left","top"],function(c,e){a.ui.position[j[c]]&&a.ui.position[j[c]][e](q,{targetWidth:l,targetHeight:m,elemWidth:d,elemHeight:g,collisionPosition:r,collisionWidth:o,collisionHeight:p,offset:k,my:b.my,at:b.at})}),a.fn.bgiframe&&c.bgiframe(),c.offset(a.extend(q,{using:b.using}))})},a.ui.position={fit:{left:function(b,c){var d=a(window),e=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=e>0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]===e)return;var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0},top:function(b,c){if(c.at[1]===e)return;var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];return!c||!c.ownerDocument?null:b?a.isFunction(b)?this.each(function(c){a(this).offset(b.call(this,c,a(this).offset()))}):this.each(function(){a.offset.setOffset(this,b)}):h.call(this)}),a.curCSS||(a.curCSS=a.css),function(){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d,e,g,h,i;d=document.createElement(b?"div":"body"),g={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},b&&a.extend(g,{position:"absolute",left:"-1000px",top:"-1000px"});for(var j in g)d.style[j]=g[j];d.appendChild(c),e=b||document.documentElement,e.insertBefore(d,e.firstChild),c.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",h=a(c).offset(function(a,b){return b}).offset(),d.innerHTML="",e.removeChild(d),i=h.top+h.left+(b?2e3:0),f.fractions=i>21&&i<22}()})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
 * https://github.com/jquery/jquery-ui
+* Includes: jquery.ui.sortable.js
+* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
+(function(a,b){a.widget("ui.sortable",a.ui.mouse,{widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var a=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},destroy:function(){a.Widget.prototype.destroy.call(this),this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--)this.items[b].item.removeData(this.widgetName+"-item");return this},_setOption:function(b,c){b==="disabled"?(this.options[b]=c,this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")):a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(b,c){var d=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(b);var e=null,f=this,g=a(b.target).parents().each(function(){if(a.data(this,d.widgetName+"-item")==f)return e=a(this),!1});a.data(b.target,d.widgetName+"-item")==f&&(e=a(b.target));if(!e)return!1;if(this.options.handle&&!c){var h=!1;a(this.options.handle,e).find("*").andSelf().each(function(){this==b.target&&(h=!0)});if(!h)return!1}return this.currentItem=e,this._removeCurrentsFromItems(),!0},_mouseStart:function(b,c,d){var e=this.options,f=this;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(b),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),e.containment&&this._setContainment(),e.cursor&&(a("body").css("cursor")&&(this._storedCursor=a("body").css("cursor")),a("body").css("cursor",e.cursor)),e.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",e.opacity)),e.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",e.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",b,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!d)for(var g=this.containers.length-1;g>=0;g--)this.containers[g]._trigger("activate",b,f._uiHash(this));return a.ui.ddmanager&&(a.ui.ddmanager.current=this),a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(b),!0},_mouseDrag:function(b){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var c=this.options,d=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY<c.scrollSensitivity?this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop+c.scrollSpeed:b.pageY-this.overflowOffset.top<c.scrollSensitivity&&(this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop-c.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-b.pageX<c.scrollSensitivity?this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft+c.scrollSpeed:b.pageX-this.overflowOffset.left<c.scrollSensitivity&&(this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft-c.scrollSpeed)):(b.pageY-a(document).scrollTop()<c.scrollSensitivity?d=a(document).scrollTop(a(document).scrollTop()-c.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<c.scrollSensitivity&&(d=a(document).scrollTop(a(document).scrollTop()+c.scrollSpeed)),b.pageX-a(document).scrollLeft()<c.scrollSensitivity?d=a(document).scrollLeft(a(document).scrollLeft()-c.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<c.scrollSensitivity&&(d=a(document).scrollLeft(a(document).scrollLeft()+c.scrollSpeed))),d!==!1&&a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(var e=this.items.length-1;e>=0;e--){var f=this.items[e],g=f.item[0],h=this._intersectsWithPointer(f);if(!h)continue;if(g!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=g&&!a.ui.contains(this.placeholder[0],g)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],g):!0)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(f))this._rearrange(b,f);else break;this._trigger("change",b,this._uiHash());break}}return this._contactContainers(b),a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),this._trigger("sort",b,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(b,c){if(!b)return;a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,b);if(this.options.revert){var d=this,e=d.placeholder.offset();d.reverting=!0,a(this.helper).animate({left:e.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){d._clear(b)})}else this._clear(b,c);return!1},cancel:function(){var b=this;if(this.dragging){this._mouseUp({target:null}),this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("deactivate",null,b._uiHash(this)),this.containers[c].containerCache.over&&(this.containers[c]._trigger("out",null,b._uiHash(this)),this.containers[c].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),a.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];return b=b||{},a(c).each(function(){var c=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[-=_](.+)/);c&&d.push((b.key||c[1]+"[]")+"="+(b.key&&b.expression?c[1]:c[2]))}),!d.length&&b.key&&d.push(b.key+"="),d.join("&")},toArray:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];return b=b||{},c.each(function(){d.push(a(b.item||this).attr(b.attribute||"id")||"")}),d},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,d=this.positionAbs.top,e=d+this.helperProportions.height,f=a.left,g=f+a.width,h=a.top,i=h+a.height,j=this.offset.click.top,k=this.offset.click.left,l=d+j>h&&d+j<i&&b+k>f&&b+k<g;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?l:f<b+this.helperProportions.width/2&&c-this.helperProportions.width/2<g&&h<d+this.helperProportions.height/2&&e-this.helperProportions.height/2<i},_intersectsWithPointer:function(b){var c=this.options.axis==="x"||a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top,b.height),d=this.options.axis==="y"||a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left,b.width),e=c&&d,f=this._getDragVerticalDirection(),g=this._getDragHorizontalDirection();return e?this.floating?g&&g=="right"||f=="down"?2:1:f&&(f=="down"?2:1):!1},_intersectsWithSides:function(b){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top+b.height/2,b.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left+b.width/2,b.width),e=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();return this.floating&&f?f=="right"&&d||f=="left"&&!d:e&&(e=="down"&&c||e=="up"&&!c)},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){return this._refreshItems(a),this.refreshPositions(),this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(b){var c=this,d=[],e=[],f=this._connectWith();if(f&&b)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&e.push([a.isFunction(j.options.items)?j.options.items.call(j.element):a(j.options.items,j.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),j])}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var g=e.length-1;g>=0;g--)e[g][0].each(function(){d.push(this)});return a(d)},_removeCurrentsFromItems:function(){var a=this.currentItem.find(":data("+this.widgetName+"-item)");for(var b=0;b<this.items.length;b++)for(var c=0;c<a.length;c++)a[c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(b){this.items=[],this.containers=[this];var c=this.items,d=this,e=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],b,{item:this.currentItem}):a(this.options.items,this.element),this]],f=this._connectWith();if(f&&this.ready)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&(e.push([a.isFunction(j.options.items)?j.options.items.call(j.element[0],b,{item:this.currentItem}):a(j.options.items,j.element),j]),this.containers.push(j))}}for(var g=e.length-1;g>=0;g--){var k=e[g][1],l=e[g][0];for(var i=0,m=l.length;i<m;i++){var n=a(l[i]);n.data(this.widgetName+"-item",k),c.push({item:n,instance:k,width:0,height:0,left:0,top:0})}}},refreshPositions:function(b){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var c=this.items.length-1;c>=0;c--){var d=this.items[c];if(d.instance!=this.currentContainer&&this.currentContainer&&d.item[0]!=this.currentItem[0])continue;var e=this.options.toleranceElement?a(this.options.toleranceElement,d.item):d.item;b||(d.width=e.outerWidth(),d.height=e.outerHeight());var f=e.offset();d.left=f.left,d.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var c=this.containers.length-1;c>=0;c--){var f=this.containers[c].element.offset();this.containers[c].containerCache.left=f.left,this.containers[c].containerCache.top=f.top,this.containers[c].containerCache.width=this.containers[c].element.outerWidth(),this.containers[c].containerCache.height=this.containers[c].element.outerHeight()}return this},_createPlaceholder:function(b){var c=b||this,d=c.options;if(!d.placeholder||d.placeholder.constructor==String){var e=d.placeholder;d.placeholder={element:function(){var b=a(document.createElement(c.currentItem[0].nodeName)).addClass(e||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return e||(b.style.visibility="hidden"),b},update:function(a,b){if(e&&!d.forcePlaceholderSize)return;b.height()||b.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10)),b.width()||b.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10))}}}c.placeholder=a(d.placeholder.element.call(c.element,c.currentItem)),c.currentItem.after(c.placeholder),d.placeholder.update(c,c.placeholder)},_contactContainers:function(b){var c=null,d=null;for(var e=this.containers.length-1;e>=0;e--){if(a.ui.contains(this.currentItem[0],this.containers[e].element[0]))continue;if(this._intersectsWith(this.containers[e].containerCache)){if(c&&a.ui.contains(this.containers[e].element[0],c.element[0]))continue;c=this.containers[e],d=e}else this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",b,this._uiHash(this)),this.containers[e].containerCache.over=0)}if(!c)return;if(this.containers.length===1)this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1;else if(this.currentContainer!=this.containers[d]){var f=1e4,g=null,h=this.positionAbs[this.containers[d].floating?"left":"top"];for(var i=this.items.length-1;i>=0;i--){if(!a.ui.contains(this.containers[d].element[0],this.items[i].item[0]))continue;var j=this.containers[d].floating?this.items[i].item.offset().left:this.items[i].item.offset().top;Math.abs(j-h)<f&&(f=Math.abs(j-h),g=this.items[i],this.direction=j-h>0?"down":"up")}if(!g&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[d],g?this._rearrange(b,g,null,!0):this._rearrange(b,null,this.containers[d].element,!0),this._trigger("change",b,this._uiHash()),this.containers[d]._trigger("change",b,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1}},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b,this.currentItem])):c.helper=="clone"?this.currentItem.clone():this.currentItem;return d.parents("body").length||a(c.appendTo!="parent"?c.appendTo:this.currentItem[0].parentNode)[0].appendChild(d[0]),d[0]==this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(d[0].style.width==""||c.forceHelperSize)&&d.width(this.currentItem.width()),(d[0].style.height==""||c.forceHelperSize)&&d.height(this.currentItem.height()),d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)){var c=a(b.containment)[0],d=a(b.containment).offset(),e=a(c).css("overflow")!="hidden";this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(e?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(e?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName);this.cssPosition=="relative"&&(this.scrollParent[0]==document||this.scrollParent[0]==this.offsetParent[0])&&(this.offset.relative=this._getRelativeOffset());var f=b.pageX,g=b.pageY;if(this.originalPosition){this.containment&&(b.pageX-this.offset.click.left<this.containment[0]&&(f=this.containment[0]+this.offset.click.left),b.pageY-this.offset.click.top<this.containment[1]&&(g=this.containment[1]+this.offset.click.top),b.pageX-this.offset.click.left>this.containment[2]&&(f=this.containment[2]+this.offset.click.left),b.pageY-this.offset.click.top>this.containment[3]&&(g=this.containment[3]+this.offset.click.top));if(c.grid){var h=this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1];g=this.containment?h-this.offset.click.top<this.containment[1]||h-this.offset.click.top>this.containment[3]?h-this.offset.click.top<this.containment[1]?h+c.grid[1]:h-c.grid[1]:h:h;var i=this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0];f=this.containment?i-this.offset.click.left<this.containment[0]||i-this.offset.click.left>this.containment[2]?i-this.offset.click.left<this.containment[0]?i+c.grid[0]:i-c.grid[0]:i:i}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_rearrange:function(a,b,c,d){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?b.item[0]:b.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var e=this,f=this.counter;window.setTimeout(function(){f==e.counter&&e.refreshPositions(!d)},0)},_clear:function(b,c){this.reverting=!1;var d=[],e=this;!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var f in this._storedCSS)if(this._storedCSS[f]=="auto"||this._storedCSS[f]=="static")this._storedCSS[f]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!c&&d.push(function(a){this._trigger("receive",a,this._uiHash(this.fromOutside))}),(this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!c&&d.push(function(a){this._trigger("update",a,this._uiHash())});if(!a.ui.contains(this.element[0],this.currentItem[0])){c||d.push(function(a){this._trigger("remove",a,this._uiHash())});for(var f=this.containers.length-1;f>=0;f--)a.ui.contains(this.containers[f].element[0],this.currentItem[0])&&!c&&(d.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.containers[f])),d.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,this.containers[f])))}for(var f=this.containers.length-1;f>=0;f--)c||d.push(function(a){return function(b){a._trigger("deactivate",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over&&(d.push(function(a){return function(b){a._trigger("out",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over=0);this._storedCursor&&a("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop",b,this._uiHash());for(var f=0;f<d.length;f++)d[f].call(this,b);this._trigger("stop",b,this._uiHash())}return this.fromOutside=!1,!1}c||this._trigger("beforeStop",b,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!=this.currentItem[0]&&this.helper.remove(),this.helper=null;if(!c){for(var f=0;f<d.length;f++)d[f].call(this,b);this._trigger("stop",b,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){a.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(b){var c=b||this;return{helper:c.helper,placeholder:c.placeholder||a([]),position:c.position,originalPosition:c.originalPosition,offset:c.positionAbs,item:c.currentItem,sender:b?b.element:null}}}),a.extend(a.ui.sortable,{version:"1.8.23"})})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
+* https://github.com/jquery/jquery-ui
 * Includes: jquery.ui.autocomplete.js
 * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
 (function(a,b){var c=0;a.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var b=this,c=this.element[0].ownerDocument,d;this.isMultiLine=this.element.is("textarea"),this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(b.options.disabled||b.element.propAttr("readOnly"))return;d=!1;var e=a.ui.keyCode;switch(c.keyCode){case e.PAGE_UP:b._move("previousPage",c);break;case e.PAGE_DOWN:b._move("nextPage",c);break;case e.UP:b._keyEvent("previous",c);break;case e.DOWN:b._keyEvent("next",c);break;case e.ENTER:case e.NUMPAD_ENTER:b.menu.active&&(d=!0,c.preventDefault());case e.TAB:if(!b.menu.active)return;b.menu.select(c);break;case e.ESCAPE:b.element.val(b.term),b.close(c);break;default:clearTimeout(b.searching),b.searching=setTimeout(function(){b.term!=b.element.val()&&(b.selectedItem=null,b.search(null,c))},b.options.delay)}}).bind("keypress.autocomplete",function(a){d&&(d=!1,a.preventDefault())}).bind("focus.autocomplete",function(){if(b.options.disabled)return;b.selectedItem=null,b.previous=b.element.val()}).bind("blur.autocomplete",function(a){if(b.options.disabled)return;clearTimeout(b.searching),b.closing=setTimeout(function(){b.close(a),b._change(a)},150)}),this._initSource(),this.menu=a("<ul></ul>").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",c)[0]).mousedown(function(c){var d=b.menu.element[0];a(c.target).closest(".ui-menu-item").length||setTimeout(function(){a(document).one("mousedown",function(c){c.target!==b.element[0]&&c.target!==d&&!a.ui.contains(d,c.target)&&b.close()})},1),setTimeout(function(){clearTimeout(b.closing)},13)}).menu({focus:function(a,c){var d=c.item.data("item.autocomplete");!1!==b._trigger("focus",a,{item:d})&&/^key/.test(a.originalEvent.type)&&b.element.val(d.value)},selected:function(a,d){var e=d.item.data("item.autocomplete"),f=b.previous;b.element[0]!==c.activeElement&&(b.element.focus(),b.previous=f,setTimeout(function(){b.previous=f,b.selectedItem=e},1)),!1!==b._trigger("select",a,{item:e})&&b.element.val(e.value),b.term=b.element.val(),b.close(a),b.selectedItem=e},blur:function(a,c){b.menu.element.is(":visible")&&b.element.val()!==b.term&&b.element.val(b.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"),a.fn.bgiframe&&this.menu.element.bgiframe(),b.beforeunloadHandler=function(){b.element.removeAttr("autocomplete")},a(window).bind("beforeunload",b.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"),this.menu.element.remove(),a(window).unbind("beforeunload",this.beforeunloadHandler),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b==="source"&&this._initSource(),b==="appendTo"&&this.menu.element.appendTo(a(c||"body",this.element[0].ownerDocument)[0]),b==="disabled"&&c&&this.xhr&&this.xhr.abort()},_initSource:function(){var b=this,c,d;a.isArray(this.options.source)?(c=this.options.source,this.source=function(b,d){d(a.ui.autocomplete.filter(c,b.term))}):typeof this.options.source=="string"?(d=this.options.source,this.source=function(c,e){b.xhr&&b.xhr.abort(),b.xhr=a.ajax({url:d,data:c,dataType:"json",success:function(a,b){e(a)},error:function(){e([])}})}):this.source=this.options.source},search:function(a,b){a=a!=null?a:this.element.val(),this.term=this.element.val();if(a.length<this.options.minLength)return this.close(b);clearTimeout(this.closing);if(this._trigger("search",b)===!1)return;return this._search(a)},_search:function(a){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.source({term:a},this._response())},_response:function(){var a=this,b=++c;return function(d){b===c&&a.__response(d),a.pending--,a.pending||a.element.removeClass("ui-autocomplete-loading")}},__response:function(a){!this.options.disabled&&a&&a.length?(a=this._normalize(a),this._suggest(a),this._trigger("open")):this.close()},close:function(a){clearTimeout(this.closing),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.deactivate(),this._trigger("close",a))},_change:function(a){this.previous!==this.element.val()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(b){return b.length&&b[0].label&&b[0].value?b:a.map(b,function(b){return typeof b=="string"?{label:b,value:b}:a.extend({label:b.label||b.value,value:b.value||b.label},b)})},_suggest:function(b){var c=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(c,b),this.menu.deactivate(),this.menu.refresh(),c.show(),this._resizeMenu(),c.position(a.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(new a.Event("mouseover"))},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(b,c){var d=this;a.each(c,function(a,c){d._renderItem(b,c)})},_renderItem:function(b,c){return a("<li></li>").data("item.autocomplete",c).append(a("<a></a>").text(c.label)).appendTo(b)},_move:function(a,b){if(!this.menu.element.is(":visible")){this.search(null,b);return}if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term),this.menu.deactivate();return}this.menu[a](b)},widget:function(){return this.menu.element},_keyEvent:function(a,b){if(!this.isMultiLine||this.menu.element.is(":visible"))this._move(a,b),b.preventDefault()}}),a.extend(a.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(b,c){var d=new RegExp(a.ui.autocomplete.escapeRegex(c),"i");return a.grep(b,function(a){return d.test(a.label||a.value||a)})}})})(jQuery),function(a){a.widget("ui.menu",{_create:function(){var b=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){if(!a(c.target).closest(".ui-menu-item a").length)return;c.preventDefault(),b.select(c)}),this.refresh()},refresh:function(){var b=this,c=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");c.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(c){b.activate(c,a(this).parent())}).mouseleave(function(){b.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,d=this.element.scrollTop(),e=this.element.height();c<0?this.element.scrollTop(d+c):c>=e&&this.element.scrollTop(d+c-e+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end(),this._trigger("focus",a,{item:b})},deactivate:function(){if(!this.active)return;this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(a,b,c){if(!this.active){this.activate(c,this.element.children(b));return}var d=this.active[a+"All"](".ui-menu-item").eq(0);d.length?this.activate(c,d):this.activate(c,this.element.children(b))},nextPage:function(b){if(this.hasScroll()){if(!this.active||this.last()){this.activate(b,this.element.children(".ui-menu-item:first"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c-d+a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:last")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(b){if(this.hasScroll()){if(!this.active||this.first()){this.activate(b,this.element.children(".ui-menu-item:last"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c+d-a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:first")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element[a.fn.prop?"prop":"attr"]("scrollHeight")},select:function(a){this._trigger("selected",a,{item:this.active})}})}(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
index 32d87c5..1c34504 100644 (file)
                 <li><a href="http://www.ashs.school.nz/">Albany Senior High School</a>, Auckland, New Zealand (OPAC 'star-ratings' sponsorship)</li>
             </ul>
 
-            <h2>Koha release team</h2>
+            <h2>Release team for Koha 3.12</h2>
             <ul>
-               <li>Colin Campbell (Koha 3.4 QA Manager)</li>
-               <li><a href="https://www.ohloh.net/p/koha/contributors/6618544614260">Galen Charlton</a> (Koha 3.2 Release Manager)</li>
-               <li><a href="https://www.ohloh.net/p/koha/contributors/6618544609030">Chris Cormack</a> (Koha 1.x, 3.4, 3.6 Release Manager, Koha 3.2 Translation Manager)</li>
-               <li><a href="https://www.ohloh.net/p/koha/contributors/6620692210484">Frédéric Demians</a>(Koha 3.4, 3.6 Translation Manager)</li>
-               <li><a href="https://www.ohloh.net/p/koha/contributors/6618544646984">Nicole C. Engard</a> (Koha 3.x Documentation Manager)</li>
-               <li><a href="https://www.ohloh.net/p/koha/contributors/6618544609053">Joshua Ferraro</a> (Koha 3.0 Release Manager &amp; Translation Manager)</li>
+               <li>D Ruth Bavousett (Translation Manager)</li>
+               <li>Jared Camins-Esakov (Release Manager)</li>
+               <li><a href="https://www.ohloh.net/p/koha/contributors/6618544609030">Chris Cormack</a> (3.8, 3.10 Release Maintainer)</li>
+               <li><a href="https://www.ohloh.net/p/koha/contributors/6618544646984">Nicole C. Engard</a> (Documentation Manager)</li>
+               <li>Katrin Fischer (QA Manager)</li>
+               <li>Liz Rea (3.6 Release Maintainer)</li>
+            </ul>
+
+            <h2>Former Koha release team members</h2>
+            <ul>
+               <li>Jared Camins-Esakov (3.6 Release Maintainer)</li>
+               <li>Colin Campbell (3.4 QA Manager)</li>
+               <li><a href="https://www.ohloh.net/p/koha/contributors/6618544614260">Galen Charlton</a> (3.2 Release Manager)</li>
+               <li><a href="https://www.ohloh.net/p/koha/contributors/6618544609030">Chris Cormack</a> (1.x, 3.4, 3.6 Release Manager, 3.2 Translation Manager, 3.8 Release Maintainer)</li>
+               <li><a href="https://www.ohloh.net/p/koha/contributors/6620692210484">Frédéric Demians</a> (3.4, 3.6, 3.8, 3.10 Translation Manager)</li>
+               <li><a href="https://www.ohloh.net/p/koha/contributors/6618544646984">Nicole C. Engard</a> (3.x Documentation Manager)</li>
+               <li><a href="https://www.ohloh.net/p/koha/contributors/6618544609053">Joshua Ferraro</a> (3.0 Release Manager &amp; Translation Manager)</li>
                <li>Rachel Hamilton-Williams (Kaitiaki from 2004 to present)</li>
-               <li><a href="https://www.ohloh.net/p/koha/contributors/6618544614275">Henri-Damien Laurent</a> (Koha 3.0 Release Maintainer)</li>
-               <li><a href="https://www.ohloh.net/p/koha/contributors/6618544609147">Owen Leonard</a> (Koha 3.x Interface Design)</li>
-               <li><a href="https://www.ohloh.net/p/koha/contributors/6618544615991">Chris Nighswonger</a> (Koha 3.2, 3.4 Release Maintainer, Koha 3.6 Release Maintainer)</li>
-               <li><a href="https://www.ohloh.net/p/koha/contributors/6618544612249">Paul Poulain</a> (Koha 2.0 Release Manager, Koha 2.2 Release Manager/Maintainer, Koha 3.8 Release Manager, Koha 3.10 Release Manager)</li>
-               <li><a href="http://www.ohloh.net/p/koha/contributors/6620692116417">MJ Ray</a> (Koha 2.0 Release Maintainer)</li>
-                <li>Ian Walls Koha 3.6 QA Manager, Koha 3.8 QA Manager, Koha 3.10 QA Manager</li>
+               <li><a href="https://www.ohloh.net/p/koha/contributors/6618544614275">Henri-Damien Laurent</a> (3.0 Release Maintainer)</li>
+               <li><a href="https://www.ohloh.net/p/koha/contributors/6618544609147">Owen Leonard</a> (3.x Interface Design)</li>
+               <li><a href="https://www.ohloh.net/p/koha/contributors/6618544615991">Chris Nighswonger</a> (3.2, 3.4, 3.6 Release Maintainer)</li>
+               <li><a href="https://www.ohloh.net/p/koha/contributors/6618544612249">Paul Poulain</a> (2.0 Release Manager, 2.2 Release Manager/Maintainer, 3.8, 3.10 Release Manager)</li>
+               <li><a href="http://www.ohloh.net/p/koha/contributors/6620692116417">MJ Ray</a> (2.0 Release Maintainer)</li>
+                <li>Ian Walls (3.6, 3.8, 3.10 QA Manager)</li>
                 </ul>
+
             <h2>Koha development team</h2>
             <ul>
                 <li>Md. Aftabuddin</li>
                 <li>Jon Aker</li>
                 <li>Edward Allen</li>
                 <li>Francisco M. Marzoa Alonso</li>
+                <li>Joseph Alway</li>
                 <li>Cindy Murdock Ames</li>
                 <li>Richard Anderson</li>
                 <li><a href="https://www.ohloh.net/p/koha/contributors/6620692181851">Nahuel Angelinetti</a></li>
                 <li>Gaetan Boisson</li>
                 <li>Danny Bouman</li>
                 <li>Stan Brinkerhoff</li>
+                <li>Ivan Brown</li>
                 <li>Roger Buck</li>
                 <li>Steven Callender</li>
                 <li><a href="https://www.ohloh.net/p/koha/contributors/6620692376789">Jared Camins-Esakov</a></li>
                 <li>Brig C. McCoy</li>
                 <li>Dorian Meid (German translation)</li>
                 <li>Meenakshi. R</li>
+                <li>Melia Meggs</li>
                 <li>Matthias Meusburger</li>
                 <li>Sophie Meynieux</li>
                 <li>Alan Millar</li>
                 <li>Waylon Robertson</li>
                 <li>Marcel de Rooy</li>
                 <li>Salvador Zaragoza Rubio</li>
+                <li>Mathieu Saby</li>
                 <li>Brice Sanchez</li>
                 <li>Sam Sanders</li>
                 <li>Adrien Saurat</li>
                 <li>Ron Wickersham</li>
                 <li>Brett Wilkins</li>
                 <li><a href="https://www.ohloh.net/p/koha/contributors/6620692127299">Olwen Williams (Database design and data extraction for Koha 1.0)</a></li>
+                <li>Robert Williams</li>
                 <li>James Winter</li>
                 <li>Lars Wirzenius</li>
             </ul>
                   by the Bridge Consortium of Carleton College and St. Olaf College.</li>
               </ul>
 
+            <h2>The Sudoc Icon Set</h2>
+              <ul>
+                <li><a href="http://www.abes.fr/Sudoc/Boite-a-outils-Sudoc-public/Les-icones-Sudoc">Les icones Sudoc</a></li>
+                <li>The Sudoc Icon Set is licensed under a
+                  <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License</a>
+                  by Agence Bibliographique de l'Enseignement Supérieur</li>
+              </ul>
             <h2>The Noun Project icons</h2>
                 <ul>
                     <li>All images come from <a href="http://thenounproject.com/">The Noun Project</a> collection</li>
index 71ae462..98161b2 100644 (file)
                             [% ELSE %]
                             <li>
                             <label for="currency">Currency:</label>
-                            <select name="currency" id="currency" onchange="calcNeworderTotal();">
+                            <select name="currency" id="currency">
                             [% FOREACH loop_currencie IN loop_currencies %]
                                     [% IF ( loop_currencie.selected ) %]<option value="[% loop_currencie.currcode %]" selected="selected">[% loop_currencie.currcode %]</option>[% ELSE %]<option value="[% loop_currencie.currcode %]">[% loop_currencie.currcode %]</option>[% END %][% END %]
                             </select>
index dcd6ccb..3524ecd 100644 (file)
@@ -6,6 +6,32 @@
 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
 [% INCLUDE 'datatables-strings.inc' %]
 <script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
+
+<script type="text/javascript">
+//<![CDATA[
+    function updateColumnsVisibility(visible) {
+        if ( visible ) {
+            $("table .gste, .gsti").show();
+        } else {
+            [% IF ( listincgst ) %]
+                $("table .gste").hide();
+            [% ELSE %]
+                $("table .gsti").hide();
+            [% END %]
+        }
+    }
+
+    $(document).ready(function() {
+        $("#show_all_details").click(function(){
+            updateColumnsVisibility($(this+":checked").val());
+        });
+
+        $("#show_all_details").attr('checked', false);
+        updateColumnsVisibility(false);
+    });
+//]]>
+</script>
+
 [% UNLESS ( closedate ) %]
 <script type="text/javascript">
 //<![CDATA[
                         // YUI Toolbar Functions
                         function yuiToolbar() {
                             new YAHOO.widget.Button("reopenbutton");
+                            new YAHOO.widget.Button("exportbutton");
                         }
                         //]]>
                     </script>
                         <ul id="toolbar-list" class="toolbar">
                             <li><a href="javascript:confirm_reopen([% skip_confirm_reopen %]);" class="button" id="reopenbutton">Reopen this basket</a></li>
+                            <li><a href="[% script_name %]?op=export&amp;basketno=[% basketno %]&amp;booksellerid=[% booksellerid %]" class="button" id="exportbutton">Export this basket as CSV</a></li>
                         </ul>
                 </div>
                 [% END %]
                 [% IF ( basketcontractno ) %]
                     <li><span class="label">Contract name:</span> <a href="../admin/aqcontract.pl?op=add_form&amp;contractnumber=[% basketcontractno %]&amp;booksellerid=[% booksellerid %]">[% basketcontractname %]</a></li>
                 [% END %]
+                [% IF ( deliveryplace ) %]<li><span class="label">Delivery place:</span> [% deliveryplace %]</li>[% END %]
+                [% IF ( billingplace ) %]<li><span class="label">Billing place:</span> [% billingplace %]</li>[% END %]
                 [% IF ( authorisedbyname ) %]<li><span class="label">Managed by:</span>  [% authorisedbyname %]</li>[% END %]
                 [% IF ( creationdate ) %]<li><span class="label">Opened on:</span>  [% creationdate | $KohaDates %]</li>[% END %]
                 [% IF ( closedate ) %]<li><span class="label">Closed on:</span> [% closedate | $KohaDates %]</li>[% END %]
                 [% IF ( closedate ) %]
                 <div class="yui-u">
                     <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post">
+                        <p>
+                          <label for="basketgroupid"><strong>Basket group:</strong></label>
+                          [% IF basketgroup.closed %]
+                            [% basketgroup.name %] (closed)
+                          [% ELSE %]
+                            </p>
+                            <p>
+                            <select id="basketgroupid" name="basketgroupid">
+                              <option value="new">Add new group</option>
+                              [% FOREACH bg IN basketgroups %]
+                                [% IF ( bg.default ) %]
+                                    <option value="[% bg.id %]" selected="selected">[% bg.name %]</option>
+                                [% ELSE %]
+                                  [% UNLESS bg.closed %]
+                                    <option value="[% bg.id %]">[% bg.name %]</option>
+                                  [% ELSE %]
+                                    <option value="[% bg.id %]" disabled="disabled">[% bg.name %] (closed)</option>
+                                  [% END %]
+                                [% END %]
+                              [% END %]
+                            </select>
+                          [% END %]
+                        </p>
 
-                        <p><label for="basketgroupid"><strong>Basket group:</strong></label></p>
-                        <p><select id="basketgroupid" name="basketgroupid">
-                            <option value="new">Add new group</option>
-                                                    [% FOREACH basketgroup IN basketgroups %]
-                                                        [% IF ( basketgroup.default ) %]
-                            <option value="[% basketgroup.id %]" selected="selected">[% basketgroup.name %]</option>
-                                                        [% ELSE %]
-                            <option value="[% basketgroup.id %]">[% basketgroup.name %]</option>
-                                                        [% END %]
-                                                    [% END %]
-                        </select></p>
-
-                        <p><input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
-                        <input type="hidden" value="mod_basket" name="op" />
-                        <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
-                        <input type="submit" value="Change basket group" /></p>
-
+                        [% UNLESS basketgroup.closed %]
+                          <p>
+                            <input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
+                            <input type="hidden" value="mod_basket" name="op" />
+                            <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
+                            <input type="submit" value="Change basket group" />
+                          </p>
+                        [% END %]
                     </form>
+                    [% IF ( basketgroupdeliveryplace ) %]<p>Basket group delivery place: [% basketgroupdeliveryplace %]</p>[% END %]
+                    [% IF ( basketgroupbillingplace ) %]<p>Basket group billing place: [% basketgroupbillingplace %]</p>[% END %]
                 </div>
                 [% END %]
             </div>
 
         [% UNLESS ( delete_confirm ) %]
         <div id="acqui_basket_content" class="yui-g">
-        <h2>Order Details</h2>
         [% IF ( books_loop ) %]
+        <h2>Orders</h2>
+        <label for="show_all_details">
+            <input type="checkbox" style="vertical-align: middle;" id="show_all_details" />
+            Show all details
+        </label>
             <table id="orders">
                 <thead>
                     <tr>
                         <th>Order</th>
-                        <th>RRP</th>
-                        <th>Est.</th>
+                        <th class="gste">RRP tax exc.</th>
+                        <th class="gste">ecost tax exc.</th>
+                        <th class="gsti">RRP tax inc.</th>
+                        <th class="gsti">ecost tax inc.</th>
                         <th>Qty.</th>
-                        <th>Total</th>
+                        <th class="gste">Total tax exc. ([% currency %])</th>
+                        <th class="gsti">Total tax inc. ([% currency %])</th>
+                        <th>GST %</th>
+                        <th>GST</th>
                         <th>Fund</th>
                         [% IF ( active ) %]
                             [% UNLESS ( closedate ) %]
                     </tr>
                 </thead>
                 <tfoot>
-                [% IF ( GST ) %]
-                <tr>
-                    <th scope="row">Total tax exc.</th>
-                    <td>[% total_rrp_gste %]</td>
-                    <td>&nbsp;</td>
-                    <td>[% qty_total %]</td>
-                    <td>[% total_est_gste %]</td>
+                [% FOREACH foot_loo IN book_foot_loop %]
+                    <tr>
+                        <th>Total (GST [% foot_loo.gstgsti %])</th>
+                        <th class="gste"/><th class="gste"/><th class="gsti"/><th class="gsti"/>
+                        <th>[% foot_loo.quantity %]</th>
+                        <th class="gste">[% foot_loo.totalgste %]</th>
+                        <th class="gsti">[% foot_loo.totalgsti %]</th>
+                        <th/>
+                        <th>[% foot_loo.gstvalue %]</th>
+                        <th/>
                         [% IF ( active ) %]
-                            [% IF ( closedate ) %]
-                            <td colspan="1" rowspan="3">&nbsp;</td>
-                            [% ELSE %]
-                            <td colspan="3" rowspan="3">&nbsp;</td>
+                            [% UNLESS ( closedate ) %]
+                                <th>&nbsp;</th>
+                                <th>&nbsp;</th>
                             [% END %]
                         [% END %]
-                </tr>
-                <tr>
-                    <th scope="row">Tax ([% gist_rate %])</th>
-                    <td>[% gist_rrp %]</td>
-                    <td>&nbsp;</td>
-                    <td>&nbsp;</td>
-                    <td>[% gist_est %]</td>
-                </tr>
-                <tr>
-                    <th scope="row">Total tax inc. ([% currency %])</th>
-                    <td>[% total_rrp_gsti %]</td>
-                    <td>&nbsp;</td>
-                    <td>[% qty_total %]</td>
-                    <td>[% total_est_gsti %]</td>
-                </tr>
-                [% ELSE %]
+                    </tr>
+                [% END %]
                 <tr>
-                    <th scope="row">Total ([% currency %])</th>
-                    <td>[% total_rrp_gsti %]</td>
-                    <td>&nbsp;</td>
-                    <td>[% qty_total %]</td>
-                    <td>[% total_est_gsti %]</td>
-                    <td colspan="3">&nbsp;</td>
+                    <th>Total ([% currency %])</th>
+                    <th class="gste"/><th class="gste"/><th class="gsti"/><th class="gsti"/>
+                    <th>[% total_quantity %]</th>
+                    <th class="gste">[% total_gste %]</th>
+                    <th class="gsti">[% total_gsti %]</th>
+                    <th/>
+                    <th>[% total_gstvalue %]</th>
+                    <th/>
+                    [% IF ( active ) %]
+                        [% UNLESS ( closedate ) %]
+                            <th>&nbsp;</th>
+                            <th>&nbsp;</th>
+                        [% END %]
+                    [% END %]
                 </tr>
-                [% END %]
                 </tfoot>
                 <tbody>
                 [% FOREACH books_loo IN books_loop %]
                                 [% END %]
                             </p>
                         </td>
-                        <td class="number [% IF books_loo.rrp.search('^0') %]error[% END %]">[% books_loo.rrp %]</td>
-                        <td class="number [% IF books_loo.ecost.search('^0') %]error[% END %]">[% books_loo.ecost %]</td>
+                        <td class="number gste [% IF books_loo.rrpgste.search('^0') %]error[% END %]">[% books_loo.rrpgste %]</td>
+                        <td class="number gste [% IF books_loo.ecostgste.search('^0') %]error[% END %]">[% books_loo.ecostgste %]</td>
+                        <td class="number gsti [% IF books_loo.rrpgsti.search('^0') %]error[% END %]">[% books_loo.rrpgsti %]</td>
+                        <td class="number gsti [% IF books_loo.ecostgsti.search('^0') %]error[% END %]">[% books_loo.ecostgsti %]</td>
                         <td class="number [% IF books_loo.quantity.search('^0') %]error[% END %]">[% books_loo.quantity %]</td>
-                        <td class="number [% IF books_loo.line_total.search('^0') %]error[% END %]">[% books_loo.line_total %]</td>
+                        <td class="number gste [% IF books_loo.totalgste.search('^0') %]error[% END %]">[% books_loo.totalgste %]</td>
+                        <td class="number gsti [% IF books_loo.totalgsti.search('^0') %]error[% END %]">[% books_loo.totalgsti %]</td>
+                        <td class="number [% IF books_loo.gstgsti.search('^0') %]error[% END %]">[% books_loo.gstgsti %]</td>
+                        <td class="number [% IF books_loo.gstvalue.search('^0') %]error[% END %]">[% books_loo.gstvalue %]</td>
                         <td>[% books_loo.budget_name %]</td>
                         [% IF ( active ) %]
                             [% UNLESS ( closedate ) %]
                 [% END %]
                 </tbody>
             </table>
-        [% ELSE %]
-            <table>
-                <tr><td>Basket empty</td></tr>
-            </table>
         [% END %]
         [% IF ( listincgst ) %]<small class="highlight">** Vendor's listings already include tax.</small>
         [% END %]
               <thead>
                 <tr>
                   <th>Order</th>
-                  <th>RRP</th>
-                  <th>Est.</th>
+                  <th class="gste">RRP tax exc.</th>
+                  <th class="gste">ecost tax exc.</th>
+                  <th class="gsti">RRP tax inc.</th>
+                  <th class="gsti">ecost tax inc.</th>
                   <th>Qty.</th>
-                  <th>Total</th>
+                  <th class="gste">Total tax exc. ([% currency %])</th>
+                  <th class="gsti">Total tax inc. ([% currency %])</th>
+                  <th>GST %</th>
+                  <th>GST</th>
                   <th>Fund</th>
                 </tr>
               </thead>
                         [% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement %][% END %]
                       </p>
                     </td>
-                    <td><p>[% order.rrp %]</p></td>
-                    <td><p>[% order.ecost %]</p></td>
-                    <td><p>[% order.quantity %]</p></td>
-                    <td><p>[% order.line_total %]</p></td>
-                    <td><p>[% order.budget_name %]</p></td>
+                    <td class="number gste">[% order.rrpgste %]</td>
+                    <td class="number gste">[% order.ecostgste %]</td>
+                    <td class="number gsti">[% order.rrpgsti %]</td>
+                    <td class="number gsti">[% order.ecostgsti %]</td>
+                    <td class="number">[% order.quantity %]</td>
+                    <td class="number gste">[% order.totalgste %]</td>
+                    <td class="number gsti">[% order.totalgsti %]</td>
+                    <td class="number">[% order.gstgsti %]</td>
+                    <td class="number">[% order.gstvalue %]</td>
+                    <td>[% order.budget_name %]
                   </tr>
                 [% END %]
               </tbody>
             <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
             <input type="hidden" name="confirm" value="1" />
             <input type="hidden" name="basketgroupname" value="[% basketgroupname %]" />
-            <input type="submit" class="approve" value="Yes, Close (Y)" accesskey="y" />
-            <input type="submit" class="deny" value="No, Don't Close (N)" accesskey="n" onclick="javascript:window.location='/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]';return false;" />
+            <input type="submit" class="approve" value="Yes, close (Y)" accesskey="y" />
+            <input type="submit" class="deny" value="No, don't close (N)" accesskey="n" onclick="javascript:window.location='/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]';return false;" />
         </form>
         </div>
     [% END %]
index d02202c..65d3e6e 100644 (file)
@@ -203,6 +203,7 @@ function yuiToolbar() {
                                                        <input type="text" name="basketgroupname" id="basketgroupname" value="[% name %]" /></li>
                         <li><label for="billingplace">Billing place:</label>
                                                        <select name="billingplace" id="billingplace" style="width:13em;">
+                                <option value="">--</option>
                                                                [% FOREACH billingplaceloo IN billingplaceloop %]
                                        [% IF ( billingplaceloo.selected ) %]<option value="[% billingplaceloo.value %]" selected="selected">[% billingplaceloo.branchname %]</option>
                                        [% ELSE %]<option value="[% billingplaceloo.value %]">[% billingplaceloo.branchname %]</option>[% END%]
index 068171e..e1061da 100644 (file)
@@ -125,6 +125,36 @@ li.list2 {
                     <label for="basketname" class="required">Basket name</label> &nbsp;
                         <input type="text" name="basketname" id="basketname" size="40" maxlength="80" value="[% basketname %]" />
                 </li>
+                 <li>
+                    <label for="billingplace">Billing Place:</label>
+                    <select name="billingplace" id="billingplace">
+                        <option value="">--</option>
+                        [% FOREACH billingplace IN billingplaceloop %]
+                            [% IF ( billingplace.selected ) %]
+                                <option value="[% billingplace.value %]" selected="selected">
+                            [% ELSE %]
+                                <option value="[% billingplace.value %]">
+                            [% END %]
+                                [% billingplace.branchname %]
+                            </option>
+                        [% END %]
+                    </select>
+                </li>
+                <li>
+                    <label for="deliveryplace">Delivery  Place:</label>
+                    <select name="deliveryplace" id="deliveryplace">
+                        <option value="">--</option>
+                        [% FOREACH deliveryplace IN deliveryplaceloop %]
+                            [% IF ( deliveryplace.selected ) %]
+                                <option value="[% deliveryplace.value %]" selected="selected">
+                            [% ELSE %]
+                                <option value="[% deliveryplace.value %]">
+                            [% END %]
+                                [% deliveryplace.branchname %]
+                            </option>
+                        [% END %]
+                    </select>
+                </li>
                 <li>
                     <label for="basketbooksellerid">Vendor</label> &nbsp;
                     <select name="basketbooksellerid" id="basketbooksellerid">
index c03a4d7..7b28b87 100644 (file)
 
       <p>Supplier: [% suppliername %]</p>
       <form action="" method="post">
-        <label for="shipmentdate">Shipment date:</label>
-        <input type="text" size="10" id="shipmentdate" name="shipmentdate" value="[% shipmentdate | $KohaDates %]" readonly="readonly" class="datepicker" />
-        <p></p>
-        <label for="billingdate">Billing date:</label>
-        <input type="text" size="10" id="billingdate" name="billingdate" value="[% billingdate | $KohaDates %]" readonly="readonly" class="datepicker" />
-        <p></p>
-        <label for="shipmentcost">Shipment cost:</label>
-        <input type="text" size="10" id="shipmentcost" name="shipmentcost" value="[% shipmentcost %]" />
-        <label for="shipment_budget_id">Budget:</label>
-        <select id="shipment_budget_id" name="shipment_budget_id">
-            <option value="">No budget</option>
-          [% FOREACH budget IN budgets_loop %]
-            [% IF ( budget.selected ) %]
-              <option selected="selected" value="[% budget.budget_id %]">
-            [% ELSE %]
-              <option value="[% budget.budget_id %]">
+        <fieldset>
+          <label for="shipmentdate">Shipment date:</label>
+          <input type="text" size="10" id="shipmentdate" name="shipmentdate" value="[% shipmentdate | $KohaDates %]" readonly="readonly" class="datepicker" />
+          <p></p>
+          <label for="billingdate">Billing date:</label>
+          <input type="text" size="10" id="billingdate" name="billingdate" value="[% billingdate | $KohaDates %]" readonly="readonly" class="datepicker" />
+          <p></p>
+          <label for="shipmentcost">Shipment cost:</label>
+          <input type="text" size="10" id="shipmentcost" name="shipmentcost" value="[% shipmentcost %]" />
+          <label for="shipment_budget_id">Budget:</label>
+          <select id="shipment_budget_id" name="shipment_budget_id">
+              <option value="">No budget</option>
+            [% FOREACH budget IN budgets_loop %]
+              [% IF ( budget.selected ) %]
+                <option selected="selected" value="[% budget.budget_id %]">
+              [% ELSE %]
+                <option value="[% budget.budget_id %]">
+              [% END %]
+                [% budget.budget_name %]
+              </option>
             [% END %]
-              [% budget.budget_name %]
-            </option>
+          </select>
+          <p></p>
+          <label>Status:</label>
+          [% IF ( invoiceclosedate ) %]
+            Closed on [% invoiceclosedate | $KohaDates %].
+            <p></p>
+            <input type="checkbox" name="reopen" id="reopen" />
+            <label for="reopen">Reopen</label>
+          [% ELSE %]
+            Open.
+            <p></p>
+            <input type="checkbox" name="close" id="close" />
+            <label for="close">Close</label>
           [% END %]
-        </select>
-        <input type="hidden" name="op" value="mod" />
-        <input type="hidden" name="invoiceid" value="[% invoiceid %]" />
-        <fieldset class="action">
-            <input type="submit" value="Save">
+          <input type="hidden" name="op" value="mod" />
+          <input type="hidden" name="invoiceid" value="[% invoiceid %]" />
+          <fieldset class="action">
+              <input type="submit" value="Save">
+          </fieldset>
         </fieldset>
       </form>
-      <p>Status:
-        [% IF ( invoiceclosedate ) %]
-          Closed on [% invoiceclosedate | $KohaDates %].
-          <a href="/cgi-bin/koha/acqui/invoice.pl?op=reopen&invoiceid=[% invoiceid %]">
-            Reopen
-          </a>
-        [% ELSE %]
-          Open.
-          <a href="/cgi-bin/koha/acqui/invoice.pl?op=close&invoiceid=[% invoiceid %]">
-            Close
-          </a>
-        [% END %]
-      </p>
       <p>
           <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid %]">Go to receipt page</a>
       </p>
index c324882..8e9b1a3 100644 (file)
@@ -130,7 +130,7 @@ $(document).ready(function() {
           </p>
         [% END %]<!-- results_loop -->
       [% ELSE %]
-        <p>Please fill in the form to the left to make a search.</p>
+        <p>Use the search form on the left to find invoices.</p>
       [% END %]<!-- do_search -->
     </div>
   </div>
@@ -207,7 +207,7 @@ $(document).ready(function() {
             <input type="text" id="publicationyear" name="publicationyear" value="[% publicationyear %]" />
           </li>
           <li>
-            <label for="branch">Branch:</label>
+            <label for="branch">Library:</label>
             <select id="branch" name="branch">
               <option value="">All</option>
               [% FOREACH branch IN branches_loop %]
index 0195dd8..2631e3c 100644 (file)
@@ -106,7 +106,7 @@ $(document).ready(function()
         [% END %]
 
         $("#quantity").change(function() {
-            calcNeworderTotal();
+            updateCosts();
         });
 
         //We apply the fonction only for modify option
@@ -130,20 +130,23 @@ $(document).ready(function()
         });
         [% END %]
         
+        //keep a copy of all budgets before removing the inactives
+        disabledBudgetsCopy = $('#budget_id').html();
+        $('#budget_id .b_inactive').remove();
+
         $('#showallbudgets').click(function() {
-            if ( $('#budget_id .b_inactive').is(":visible") )
-            {
-            $('#budget_id .b_inactive').hide();
+            if ($(this).is(":checked")) {
+                $('#budget_id').html(disabledBudgetsCopy); //Puts back all the funds
             }
             else {
-            $('#budget_id .b_inactive').show();
+                $('#budget_id .b_inactive').remove();
             }
         });
     });
 //]]>
 </script>
 </head>
-<body id="acq_neworderempty" class="acq">
+<body id="acq_neworderempty" class="acq" onload="updateCosts()">
 
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'acquisitions-search.inc' %]
@@ -222,18 +225,13 @@ $(document).ready(function()
         <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
         <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
         <input type="hidden" name="biblioitemnumber" value="[% biblioitemnumber %]" />
-        <input type="hidden" name="discount" value="[% discount %]" />
-        <input type="hidden" name="listinc" value="[% listincgst %]" />
-<!--        <input type="hidden" name="currency" value="[% currency %]" />-->
-        <input type="hidden" name="applygst" value="[% gstreg %]" />
-        <input type="hidden" name="invoiceincgst" value="[% invoiceincgst %]" />
-        <input type="hidden" name="gstrate" value="[% gstrate %]" />
+        <input type="hidden" name="listinc" id="listinc" value="[% listincgst %]" />
+        <input type="hidden" name="applygst" id="applygst" value="[% gstreg %]" />
+        <input type="hidden" name="invoiceincgst" id="invoiceincgst" value="[% invoiceincgst %]" />
         <input type="hidden" name="suggestionid" value="[% suggestionid %]" />
         <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
+        <input type="hidden" name="currency_rate" id="currency_rate" value="[% currency_rate %]" />
 
-        [% FOREACH loop_currencie IN loop_currencies %]
-            <input type="hidden" id="[% loop_currencie.currcode %]"  name="[% loop_currencie.currcode %]" value="[% loop_currencie.rate %]" />
-        [% END %]
         <ol><li>
             [% IF ( biblionumber ) %]
             <span class="label">Title</span>
@@ -352,8 +350,8 @@ $(document).ready(function()
                         <th>&nbsp;</th>
                         <th>&nbsp;</th>
                         <th>Barcode</th>
-                        <th>Home branch</th>
-                        <th>Holding branch</th>
+                        <th>Home library</th>
+                        <th>Holding library</th>
                         <th>Not for loan</th>
                         <th>Restricted</th>
                         <th>Location</th>
@@ -394,7 +392,7 @@ $(document).ready(function()
                     [% IF (AcqCreateItemOrdering) %]
                         <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="0" />
                     [% ELSE %]
-                        <input type="text" size="20" id="quantity" name="quantity" value="[% quantityrec %]" />
+                        <input type="text" size="20" id="quantity" name="quantity" value="[% quantityrec %]" onchange="updateCosts();" />
                     [% END %]
                 [% END %]
                 <!-- origquantityrec only here for javascript compatibility (additem.js needs it, useless here, usefull when receiveing an order -->
@@ -413,7 +411,7 @@ $(document).ready(function()
                         <option value="[% budget_loo.b_id %]" selected="selected">[% budget_loo.b_txt %]</option>
                     [% ELSE %]
                         [% IF ( budget_loo.b_active ) %]<option value="[% budget_loo.b_id %]">[% budget_loo.b_txt %]</option>
-                        [% ELSE %]<option value="[% budget_loo.b_id %]" class="b_inactive" style="display : none;">[% budget_loo.b_txt %]</option>    
+                        [% ELSE %]<option value="[% budget_loo.b_id %]" class="b_inactive">[% budget_loo.b_txt %]</option>
                         [% END %]
                     [% END %]
                 [% END %]
@@ -428,7 +426,7 @@ $(document).ready(function()
                        <input type="hidden" size="10" name="currency" id="currency" value="[% currency %]" />[% currency %]
                 [% ELSE %]
                        <label for="currency">Currency:</label>
-                       <select name="currency" id="currency" onchange="calcNeworderTotal();">
+                       <select name="currency" id="currency" onchange="updateCosts();">
                        [% FOREACH loop_currencie IN loop_currencies %]
                        [% IF ( loop_currencie.selected ) %]<option value="[% loop_currencie.currcode %]" selected="selected">[% loop_currencie.currcode %]</option>[% ELSE %]<option value="[% loop_currencie.currcode %]">[% loop_currencie.currcode %]</option>[% END %][% END %]
                        </select>
@@ -436,11 +434,11 @@ $(document).ready(function()
                 </li>
             <li>
                 [% IF ( close ) %]
-            <span class="label">Vendor price: </span>
+                    <span class="label">Vendor price: </span>
                     <input type="hidden" size="20" name="listprice" id="listprice" value="[% listprice %]" />[% listprice %]
                 [% ELSE %]
                 <label for="listprice">Vendor price: </label>
-                    <input type="text" size="20" name="listprice" id="listprice" value="[% listprice %]" onchange="calcNeworderTotal()" />
+                    <input type="text" size="20" name="listprice" id="listprice" value="[% listprice %]" onchange="updateCosts()" />
                 [% END %]
             </li>
             [% UNLESS ( close ) %]
@@ -453,53 +451,77 @@ $(document).ready(function()
                 [% END %]
             </li>
             [% END %]
-                       <li>
+            [% IF ( gst_values ) %]
+                <li>
+                    [% IF ( close ) %]
+                        <span class="label">Tax rate: </span>
+                        <input type="hidden" size="20" name="gstrate" id="gstrate" value="[% gstrate %]" />[% gstrate %]%
+                    [% ELSE %]
+                        <label for="gst">Tax rate: </label>
+                        <select name="gstrate" id="gstrate" onchange="updateCosts();">
+                        [% FOREACH gst IN gst_values %]
+                          [% IF ( gst.option == gstrate ) %]
+                            <option value="[% gst.option %]" selected="selected">[% gst.option * 100 | format("%.1f") %]%</option>
+                          [% ELSE %]
+                            <option value="[% gst.option %]">[% gst.option * 100 | format("%.1f") %]%</option>
+                          [% END %]
+                        [% END %]
+                        </select>
+                    [% END %]
+                [% ELSE %]
+                    <input type="hidden" name="gstrate" value="0" />
+                </li>
+            [% END %]
+            <li>
+                <label for="discount">Discount: </label>
                 [% IF ( close ) %]
-            <span class="label">Replacement cost: </span>
-                    <input type="hidden" size="20" name="rrp" id="rrp" value="[% rrp %]" />[% rrp %]
+                    [% IF ( orderdiscount ) %]
+                        <input type="hidden" name="discount" id="discount" value="[% orderdiscount %]" />[% orderdiscount_2dp %]%
+                    [% ELSE %]
+                        <input type="hidden" name="discount" id="discount" value="[% discount %]" />[% discount_2dp %]%
+                    [% END %]
                 [% ELSE %]
-                <label for="rrp">Replacement cost: </label>
-                    <input type="text" size="20" name="rrp" id="rrp" value="[% rrp %]" /> (adjusted for [% cur_active %])
+                    [% IF ( orderdiscount ) %]
+                        <input type="text" size="6" name="discount" id="discount" value="[% orderdiscount %]" onchange="updateCosts();" />%
+                    [% ELSE %]
+                        <input type="text" size="6" name="discount" id="discount" value="[% discount %]" onchange="updateCosts();" />%
+                    [% END %]
                 [% END %]
             </li>
             <li>
                 [% IF ( close ) %]
-            <label for="ecost">Budgeted cost: </label>
-                    <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" readonly="readonly"  />
+                    <span class="label">Replacement cost: </span>
+                    <input type="hidden" size="20" name="rrp" id="rrp" value="[% rrp %]" />[% rrp %]
                 [% ELSE %]
-                <label for="ecost">Budgeted cost: </label>
-                    <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" />
+                    <label for="rrp">Replacement cost: </label>
+                    <input type="text" size="20" name="rrp" id="rrp" value="[% rrp %]" /> (adjusted for [% cur_active %])
                 [% END %]
-                [% IF ( discount_2dp ) %]  (adjusted for [% discount_2dp %]% discount)  [% END %]
-
             </li>
-            [% IF ( GST ) %]
             <li>
                 [% IF ( close ) %]
-            <label for="GST">Budgeted GST: </label>
-                <input type="text" id="" size="20" name="gst" value="" id="GST" readonly="readonly" />
+                    <label for="ecost">Budgeted cost: </label>
+                    <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" readonly="readonly"  />
                 [% ELSE %]
-                <label for="GST">Budgeted GST: </label>
-                <input type="text" size="20" name="gst" id="GST" value="" />
+                    <label for="ecost">Budgeted cost: </label>
+                    <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" />
                 [% END %]
             </li>
-            [% END %]
             <li>
                 [% IF ( close ) %]
-            <label for="total">Total: </label>
-                <input type="text" id="total" size="20" name="total" value="[% total %]" readonly="readonly" />
+                    <label for="total">Total: </label>
+                    <input type="text" id="total" size="20" name="total" value="[% total %]" readonly="readonly" />
                 [% ELSE %]
-                <label for="total">Total: </label>
-                <input type="text" id="total" size="20" name="total" value="[% total %]" /> (budgeted cost * quantity)
+                    <label for="total">Total: </label>
+                    <input type="text" id="total" size="20" name="total" value="[% total %]" /> (budgeted cost * quantity)
                 [% END %]
             </li>
             <li>
                 [% IF ( close ) %]
-            <label for="cost">Actual cost: </label>
-                <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" readonly="readonly" />
+                    <label for="unitprice">Actual cost: </label>
+                    <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" readonly="readonly" />
                 [% ELSE %]
-                <label for="cost">Actual cost: </label>
-                <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" />
+                    <label for="unitprice">Actual cost: </label>
+                    <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" />
                 [% END %]
             </li>
             <li>
index 612b5bc..07677db 100644 (file)
                             <th>&nbsp;</th>
                             <th>&nbsp;</th>
                             <th>Barcode</th>
-                            <th>Home branch</th>
-                            <th>Holding branch</th>
+                            <th>Home library</th>
+                            <th>Holding library</th>
                             <th>Not for loan</th>
                             <th>Restricted</th>
                             <th>Location</th>
     <input type="hidden" name="biblioitemnumber" value="[% biblioitemnumber %]" />
     <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
     <input type="hidden" name="datereceived" value="[% datereceived_iso %]" />
-    <input type="hidden" name="gst" value="[% gst %]" />
+    <input type="hidden" name="gstrate" value="[% gstrate %]" />
        </div>
        <div class="yui-u">
     <fieldset class="rows">
 
 </div>
 </div><div class="yui-g"><fieldset class="action">
-        <input type="submit"  value="Save" />
+        <input type="submit" onclick="return false;" style="display: none;" id="phony_submit" value="phony_submit" name="phony_submit" />
+        <input type="submit"  value="Save" class="button" accesskey="w" />
         <a class="cancel" href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid %]">Cancel</a>
 </fieldset></div>    </form>
 [% ELSE %]
index 554f0af..eade72f 100644 (file)
@@ -17,7 +17,7 @@
     $(document).ready(function(){
         var pendingt = $("#pendingt").dataTable($.extend(true, {}, dataTablesDefaults, {
             "aoColumnDefs": [
-                { "aTargets": [ 3, 7, 8 ], "bSortable": false, "bSearchable": false },
+                { "aTargets": [ 3, 8, 9 ], "bSortable": false, "bSearchable": false },
             ],
             "aoColumns": [
                 { "sType": "num-html" },
                 null,
                 null,
                 null,
+                null,
             ],
             "sPaginationType": "four_button"
         } ) );
         var receivedt = $("#receivedt").dataTable($.extend(true, {}, dataTablesDefaults, {
             "aoColumnDefs": [
-                { "aTargets": [ 3 ], "bSortable": false, "bSearchable": false },
+                { "aTargets": [ 3, -1 ], "bSortable": false, "bSearchable": false },
             ],
             "aoColumns": [
                 { "sType": "num-html" },
             ],
             "sPaginationType": "four_button"
         } ) );
+/*
+    $("#pendingt").tablesorter({
+               headers: { 2: { sorter: 'articles' },3: { sorter: false },8:{sorter:false}}
+    });
+*/
 
        rowCountPending  = $("#pendingt tbody.filterclass tr").length;
        rowCountReceived = $("#receivedt tbody.filterclass tr").length;
@@ -73,7 +79,7 @@
        $("#pendingcollapserow").remove();
     $("#pendingt tr").show();
        $("#pendingt tbody.filterclass tr:gt(" + (rowsToCollapse-1) + ")").hide();
-       $("#pendingt").before("<p id=\"pendingcollapserow\">" + _("Only the first ")  + rowsToCollapse +  _(" items are displayed.") + "<a href=\"javascript:pendingExpand();\">" + _("Click here to show all ")  + rowCountPending + _(" items") + "<\/a>.<\/p>");
+       $("#pendingt").before("<p id=\"pendingcollapserow\">" + _("Only the first ")  + rowsToCollapse +  _(" items are displayed.") + " <a href=\"javascript:pendingExpand();\">" + _("Click here to show all ")  + rowCountPending + _(" items") + "<\/a>.<\/p>");
 
     }
 
@@ -83,7 +89,7 @@
        $("#pendingcollapserow").remove();
        $("#pendingt tr").show();
     $("#pendingt tbody.filterclass tr.orderfound").remove();
-       $("#pendingt").before("<p id=\"pendingcollapserow\">" + rowCountPending + _(" items are displayed.") + "<a href=\"javascript:pendingCollapse();\">" + _("Click here to show only the first ") + rowsToCollapse + _(" items") + "<\/a>.<\/p>");
+       $("#pendingt").before("<p id=\"pendingcollapserow\">" + rowCountPending + _(" items are displayed.") + " <a href=\"javascript:pendingCollapse();\">" + _("Click here to show only the first ") + rowsToCollapse + _(" items") + "<\/a>.<\/p>");
     }
 
     // Collapse already received items table
@@ -91,7 +97,7 @@
         $.cookie("receivedKeepExpanded", 0, { path: "/", expires: 9999 });
        $("#receivedcollapserow").remove();
        $("#receivedt tbody.filterclass tr:gt(" + (rowsToCollapse-1) + ")").hide();
-       $("#receivedt").before("<p id=\"receivedcollapserow\">" + _("Only the first ") + rowsToCollapse + _(" items are displayed.") + "<a href=\"javascript:receivedExpand();\">" + _("Click here to show all ") + rowCountReceived + _(" items") + "<\/a>.<\/p>");
+       $("#receivedt").before("<p id=\"receivedcollapserow\">" + _("Only the first ") + rowsToCollapse + _(" items are displayed.") + " <a href=\"javascript:receivedExpand();\">" + _("Click here to show all ") + rowCountReceived + _(" items") + "<\/a>.<\/p>");
     }
 
     // Expand already received items table
         $.cookie("receivedKeepExpanded", 1, { path: "/", expires: 9999 });
        $("#receivedcollapserow").remove();
        $("#receivedt tr").show();
-       $("#receivedt").before("<p id=\"receivedcollapserow\">" + _("All ") + rowCountReceived + _(" items are displayed.") + "<a href=\"javascript:receivedCollapse();\">" + _("Click here to show only the first ") + rowsToCollapse + _(" items") + "<\/a>.<\/p>");
+       $("#receivedt").before("<p id=\"receivedcollapserow\">" + _("All ") + rowCountReceived + _(" items are displayed.") + " <a href=\"javascript:receivedCollapse();\">" + _("Click here to show only the first ") + rowsToCollapse + _(" items") + "<\/a>.<\/p>");
     }
 
 //]]>
 
 <div id="acqui_receive_summary">
 <p><strong>Invoice number:</strong> [% invoice %] <strong>Received by:</strong> [% loggedinusername %] <strong>On:</strong> [% formatteddatereceived %]</p>
-<p><a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoiceid %]">Go to invoice details</a></p>
 </div>
 [% UNLESS (invoiceclosedate) %]
 <div id="acqui_receive_search">
             <th>Quantity</th>
             <th>Unit cost</th>
             <th>Order cost</th>
+            <th>Fund</th>
             <th>&nbsp;</th>
             <th>&nbsp;</th>
         </tr>
     </thead>
-               <tfoot>
-            <tr><td colspan="4" class="total">TOTAL</td>
-                <td> [% totalPquantity %] </td>
-                               <td>&nbsp;</td>
-                <td>[% ordergrandtotal %]</td>
-                               <td>&nbsp;</td>
-                               <td>&nbsp;</td>
-            </tr>
-               </tfoot>
     <tbody class="filterclass">
         [% FOREACH loop_order IN loop_orders %]
             <tr>
                 <td>[% loop_order.quantity %]</td>
                 <td>[% loop_order.ecost %]</td>
                 <td>[% loop_order.ordertotal %]</td>
+                <td>[% loop_order.budget_name %]</td>
                                <td>
                               <a href="orderreceive.pl?ordernumber=[% loop_order.ordernumber %]&amp;invoiceid=[% invoiceid %]">Receive</a>
-                                   
                                </td>
                                <td>
                         [% IF ( loop_order.left_holds_on_order ) %]
     </div>
 [% ELSE %]
     <p>
-        Invoice is close, so you can't receive orders.
+        Invoice is closed, so you can't receive orders anymore.
         <a href="/cgi-bin/koha/acqui/invoice.pl?op=reopen&invoiceid=[% invoiceid %]&referer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid %]">Reopen it</a>.
     </p>
 [% END %]
            </tr>
     </thead>
     <tfoot>
-           <tr>
-               <td colspan="4" class="total">SUBTOTAL</td>
-               <td colspan="2">&nbsp;</td>
-               <td>[% totalprice %]</td>
-               <td>[% tototal %]</td>
-        <td></td>
-           </tr>
-             
-             [% IF ( totalfreight ) %]
-                   <tr>
-                       <td colspan="6">&nbsp;
-               </td>
-                           <td>Shipping</td>
-               <td>[% totalfreight %]</td>
-               </tr> 
-           [% END %]
-             [% IF ( gst ) %]
-                   <tr>
-                       <td colspan="6">
-               <p class="message">
-                           <b>HELP</b><br />
-                   The total at the bottom of the page should be within a few cents of the total for the invoice.
-               </p>
-               </td>
-                           <td><b>Tax rate</b></td>
-               <td>[% gst %]</td>
-               </tr> 
-           [% END %]
-           <tr>
-           <td colspan="4" class="total">TOTAL</td>
-               <td>[% totalquantity %]</td>
-               <td colspan="2">&nbsp;</td>
-               <td>[% grandtot %]</td>
-        <td></td>
-           </tr>
+        <tr>
+            <th colspan="7" class="total">Total tax exc.</th>
+            <th>[% total_gste %]</th>
+            <th></th>
+        </tr>
+        [% FOREACH book_foot IN book_foot_loop %]
+            <tr>
+                <th colspan="7">Total (GST [% book_foot.gstrate * 100 | format ("%.1f") %]%)</th>
+                <th>[% book_foot.value %]</th>
+                <th></th>
+            </tr>
+        [% END %]
+        <tr>
+            <th colspan="7" class="total">Total tax inc.</th>
+            <th>[% total_gsti %]</th>
+            <th></th>
+        </tr>
     </tfoot>
        <tbody class="filterclass">
            [% FOREACH loop_receive IN loop_received %]
 </div>
 
 <!--<form action="/cgi-bin/koha/acqui/parcels.pl?booksellerid=[% booksellerid %]" method="post">-->
-<form action="parcels.pl?booksellerid=[% booksellerid %]" method="post">
-    <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
-    <fieldset class="action">
-        <input type="submit" value="Finish receiving" />
-    </fieldset>
-</form>
+[% IF (invoiceclosedate) %]
+    <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoiceid %]">View invoice</a>
+[% ELSE %]
+    <form action="/cgi-bin/koha/acqui/invoice.pl" method="get">
+        <input type="hidden" name="invoiceid" value="[% invoiceid %]" />
+        <fieldset class="action">
+            <input type="submit" value="Finish receiving" />
+        </fieldset>
+    </form>
+[% END %]
 
 </div>
 </div>
            </ol>
                <fieldset class="action">
         <input type="hidden" value="search" name="op" />
-        <input type="hidden" value="[% booksellerid %]" name="booksellerid" />
-        <input type="hidden" value="[% invoice %]" name="invoice" />
-        <input type="hidden" value="[% invoicedatereceived %]" name="datereceived" />
+        <input type="hidden" value="[% invoiceid %]" name="invoiceid" />
         <input type="submit" value="Filter" />
-        <a href="/cgi-bin/koha/acqui/parcel.pl?booksellerid=[% booksellerid %]&invoice=[% invoice %]&op=new&datereceived=[% formatteddatereceived %]">Clear</a>
+        <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid %]">Clear</a>
                </fieldset>
 
 
index b5b9df2..201c080 100644 (file)
@@ -129,7 +129,7 @@ if (f.company.value == "") {
             </li>
             </ol>
             <ol class="radio">
-            <li><label for="gstyes" class="radio">Tax Number Registered:</label>
+            <li><label for="gstyes" class="radio">Tax number registered:</label>
                 [% IF ( gstreg ) %]
                     <label for="gstyes">Yes</label> <input type="radio" name="gst" id="gstyes" value="1" checked="checked" />
                     <label for="gstno">No</label> <input type="radio" name="gst" id="gstno" value="0" />
@@ -156,10 +156,27 @@ if (f.company.value == "") {
                     <label for="invoice_gstno">Don't include tax</label> <input type="radio" id="invoice_gstno" name="invoice_gst" value="0" checked="checked" />
                 [% END %]</li>
             </ol>
+            [% IF gst_values %]
+                <ol>
+                  <li>
+                    <label for="gst">Tax rate</label>
+                    <select name="gstrate" id="gstrate">
+                    [% FOREACH gst IN gst_values %]
+                      [% IF ( gstrate == gst.option ) %]
+                        <option value="[% gst.option %]" selected="selected">[% gst.option * 100 | format ("%.1f") %] %</option>
+                      [% ELSE %]
+                        <option value="[% gst.option %]">[% gst.option * 100 | format ("%.1f") %] %</option>
+                      [% END %]
+                    [% END %]
+                    </select>
+                  </li>
+                </ol>
+            [% ELSE %]
+                <input type="hidden" name="gstrate" value="0" />
+            [% END %]
             <ol>
             <li><label for="discount">Discount</label>
                 <input type="text" size="6" id="discount" name="discount" value="[% discount %]" />%</li>
-            <li><label for="gstrate">Tax rate</label><input type="text" name="gstrate" id="gstrate" size="6" value="[% gstrate %]"/>% (leave blank for default tax of [% default_gst_rate %]%)</li>
             <li>
                 <label for="deliverytime">Delivery time</label>
                 <input type="text" size="2" id="deliverytime" name="deliverytime" value="[% deliverytime %]" /> days
@@ -214,7 +231,7 @@ if (f.company.value == "") {
                     [% END %]</p>
             <p><strong>List prices are: </strong>[% listprice %]</p>
             <p><strong>Invoice prices are: </strong>[% invoiceprice %]</p>
-            [% IF ( GST ) %]<p><strong>Tax number registered: </strong>
+            [% IF ( gstrate ) %]<p><strong>Tax number registered: </strong>
                     [% IF ( gstreg ) %]Yes[% ELSE %]No[% END %]</p>
             <p><strong>List item price includes tax: </strong>
                     [% IF ( listincgst ) %]Yes[% ELSE %]No[% END %]</p>
@@ -223,7 +240,7 @@ if (f.company.value == "") {
             <p><strong>Discount: </strong>
                 [% discount %] %</p>
             <p><strong>Tax rate: </strong>
-                [% GST %]%[% UNLESS ( default_tax ) %] (default)[% END %]</p>
+                [% 0 + gstrate * 100 | format("%.1f") %]%</p>
             [% IF deliverytime.defined %]
                 <p><strong>Delivery time: </strong>
                     [% deliverytime %] days</p>
index 0902d07..1b1f070 100644 (file)
@@ -68,7 +68,6 @@ function check(form) {
         <h2>Orders with uncertain prices</h2>
         <form action="[% scriptname %]" method="post" name="uncertainprices">
         <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
-        <input type="hidden" name="op" value="validate" />
         Orders from:
         <select name="owner">
             [% IF ( owner ) %]
index 0d4ef2e..483bf65 100644 (file)
@@ -16,7 +16,7 @@
         "aoColumnDefs": [
             { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
         ],
-        "sPaginationType": "four_button"
+        "bPaginate": false
     } ) );
 
     $("#CheckAll").click(function(){
             row.addClass("selected");
         });
 });
+
+[% IF ( total_pages ) %]
+function validate_goto_page(){
+    var page = $('#goto_page').val();
+    if(isNaN(page)) {
+        alert(_("The page entered is not a number."));
+        return false;
+    }
+    else if(page < 1 || page > [% total_pages %] ) {
+        alert(_("The page should be a number between 1 and ") + [% total_pages %] + ".");
+        return false;
+    }
+    else {
+        return true;
+    }
+}
+[% END %]
+
 //]]>
 </script>
 <style type="text/css">
@@ -75,7 +93,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
     <div class="yui-u first">
            <fieldset class="rows">
                 <ol><li><label for="searchtitle">Title: </label> <input type="text" id="searchtitle"  name="title" value="[% title |html %]" /></li>
-                <li><label for="isbn">ISBN/ISSN: </label> <input type="text" id="isbn" name="isbn" value="[% isbn %]" /></li>
+                <li><label for="isbn">ISBN: </label> <input type="text" id="isbn" name="isbn" value="[% isbn %]" /></li>
          <li><label for="lccall">LC call number: </label> <input type="text" id="lccall" name="lccall" value="" /></li>
          <li><label for="controlnumber">Control no.: </label> <input type="text" id="controlnumber" name="controlnumber" value="" /></li>
 </ol>
@@ -83,6 +101,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
            </div>
     <div class="yui-u">
        <fieldset class="rows">          <ol><li><label for="author">Author: </label> <input type="text" id="author" name="author" value="[% author %]" /><!--  <label for="Keyword">Keyword</label> <input type="text" name="keyword" value="" /> --></li>
+         <li><label for="issn">ISSN: </label> <input type="text" id="issn" name="issn" value="[% issn %]" /></li>
          <li> <label for="subject">Subject heading: </label> <input type="text" id="subject" name="subject" value="" /></li>
                 <li><label for="dewey">Dewey: </label> <input type="text" id="dewey" name="dewey" value="" /></li></ol></fieldset>
             <fieldset class="rows" >
@@ -155,6 +174,36 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
         [% END %]
     [% END %]</tbody>
 </table>
+
+    <form method="post" action="z3950_search.pl" id="page_form" name="page_form" class="checkboxed">
+        <input type="hidden" name="op" id="op" value="do_search" />
+        <input type="hidden" name="current_page" id="current_page" value="[% current_page %]" />
+        <input type="hidden" id="searchtitle"  name="title" value="[% title |html %]" />
+        <input type="hidden" id="isbn" name="isbn" value="[% isbn %]" />
+        <input type="hidden" id="lccall" name="lccall" value="[% lccall %]" />
+        <input type="hidden" id="author" name="author" value="[% author %]" />
+        <input type="hidden" id="subject" name="subject" value="[% subject %]" />
+        <input type="hidden" id="dewey" name="dewey" value="[% dewey %]" />
+        <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
+        <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
+        <input type="hidden" name="controlnumber" value="[% controlnumber %]" />
+        <input type="hidden" name="basketno" value="[% basketno %]" />
+        <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
+
+        [% FOREACH server IN servers %]
+        <input type="hidden" name="id" id="z3950_[% server.id %]" value="[% server.id %]" />
+        [% END %]
+
+        [% IF ( show_prevbutton ) %]
+            <input type="button" name="changepage_prev" value="Previous Page" onclick="$('#current_page').val([% current_page %]-1);$('#page_form').submit();" />
+        [% END %]
+        Page [% current_page %] / [% total_pages %]
+        [% IF ( show_nextbutton ) %]
+            <input type="button" name="changepage_next" value="Next Page" onclick="$('#current_page').val([% current_page %]+1);$('#page_form').submit();" />
+        [% END %]
+        <br />Go to page : <input id="goto_page" name="goto_page" value="[% current_page %]" size="4" /><input type="submit" name="changepage_goto" onclick="return validate_goto_page();" value="Go" />
+    </form>
+
     [% ELSE %]
         [% IF ( emptyserverlist ) %]
             <div class="dialog alert">You didn't select any Z39.50 target.</div>
index 88fabe9..cbf3b92 100644 (file)
@@ -50,7 +50,7 @@
     <dd>Define extended attributes (identifiers and statistical categories) for patron records</dd>
     <dt><a href="/cgi-bin/koha/admin/branch_transfer_limits.pl">Library transfer limits</a></dt>
        <dd>Limit the ability to transfer items between libraries based on the library sending, the library receiving, and the item type involved. These rules only go into effect if the preference UseBranchTransferLimits is set to ON.</dd>
-    <dt><a href="/cgi-bin/koha/admin/transport-cost-matrix.pl">Transport Cost Matrix</a></dt>
+    <dt><a href="/cgi-bin/koha/admin/transport-cost-matrix.pl">Transport cost matrix</a></dt>
     <dd>Define transport costs between branches</dd>
     <dt><a href="/cgi-bin/koha/admin/item_circulation_alerts.pl">Item circulation alerts</a></dt>
        <dd>Define rules for check-in and checkout notifications for combinations of libraries, patron categories, and item types</dd>
        <dd>Printers (UNIX paths).</dd> -->
     <dt><a href="/cgi-bin/koha/admin/z3950servers.pl">Z39.50 client targets</a></dt>
        <dd>Define which servers to query for MARC data in the integrated Z39.50 client.</dd>
+    <dt><a href="/cgi-bin/koha/admin/didyoumean.pl">Did you mean?</a></dt>
+    <dd>Choose which plugins to use to suggest searches to patrons and staff.</dd>
 </dl>
 </div>
 
index a99e203..63c5b65 100644 (file)
@@ -4,9 +4,9 @@
 <script type="text/javascript">
 //<![CDATA[
 
-        $(document).ready(function() {
+     $(document).ready(function() {
         $('#subfieldtabs').tabs();
-        });
+     });
 
 function displayMoreConstraint(numlayer){
     var thisdiv = document.getElementById(numlayer);
@@ -26,8 +26,12 @@ function displayMoreConstraint(numlayer){
 [% INCLUDE 'header.inc' %]
 [% INCLUDE '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;
-  [% IF ( else ) %]Authority MARC subfield structure
-  [% ELSE %]<a href="/cgi-bin/koha/admin/auth_subfields_structure.pl?tagfield=[% tagfield %]&amp;tagsubfield=[% tagsubfield %]&amp;authtypecode=[% authtypecode %]">Authority MARC subfield structure</a> &rsaquo;
+  <a href="/cgi-bin/koha/admin/authtypes.pl">Authority types</a> &rsaquo;
+  [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode %]">[% authtypecode %] framework</a> &rsaquo;
+  [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a> &rsaquo;
+  [% END %]
+  [% IF ( else ) %]Authority MARC subfield structure for [% tagfield %]
+  [% ELSE %]<a href="/cgi-bin/koha/admin/auth_subfields_structure.pl?tagfield=[% tagfield %]&amp;tagsubfield=[% tagsubfield %]&amp;authtypecode=[% authtypecode %]">Authority MARC subfield structure for [% tagfield %]</a> &rsaquo;
   [% END %]
   [% IF ( delete_confirm ) %]Confirm deletion of subfield [% tagsubfield %]?[% END %]
   [% IF ( delete_confirmed ) %]Data deleted[% END %]
@@ -71,7 +75,7 @@ function displayMoreConstraint(numlayer){
 
         [% FOREACH loo IN loop %]
         <div id="sub[% loo.tagsubfield %]field">
-                       <fieldset class="rows"><ol>
+            <fieldset class="rows"><ol>
 
                     [% IF ( loo.new_subfield ) %]
                 <li><label for="tagsubfieldinput[% loo.row %]">Subfield code: </label>[% loo.tagsubfieldinput %]&nbsp;</li>
@@ -97,7 +101,7 @@ function displayMoreConstraint(numlayer){
                 </li>
                 <li><label for="isurl[% loo.row %]">Is a URL:</label>[% loo.isurl %] (if checked, it means that the subfield is a URL and can be clicked)</li>
                 <li>
-                    <fieldset><legend>Help input</legend>      
+                    <fieldset><legend>Help input</legend>    
                         <ol>
                             <li><label for="authorised_value[% loo.row %]">Authorized value:</label> [% loo.authorised_value %]</li>
                             <li><label for="frameworkcode[% loo.row %]">Thesaurus:</label> [% loo.frameworkcode %]</li>
@@ -123,14 +127,14 @@ function displayMoreConstraint(numlayer){
         <input type="hidden" name="tagsubfield" value="[% tagsubfield %]" />
         <input type="hidden" name="authtypecode" value="[% authtypecode %]" />
         <input type="submit" class="approve" value="Yes, Delete this Subfield" />
-               </form>
-               <form action="[% delete_link %]" method="get">
-                <input type="hidden" name="searchfield" value="[% searchfield %]" />
+        </form>
+        <form action="[% delete_link %]" method="get">
+         <input type="hidden" name="searchfield" value="[% searchfield %]" />
         <input type="hidden" name="tagfield" value="[% tagfield %]" />
         <input type="hidden" name="tagsubfield" value="[% tagsubfield %]" />
         <input type="hidden" name="authtypecode" value="[% authtypecode %]" />
         <input type="submit" class="deny" value="No, Do Not Delete" />
-               </form>
+        </form>
     </form></div>
 [% END %]
 
@@ -196,13 +200,13 @@ function displayMoreConstraint(numlayer){
     [% END %]
 </table>
 
-       <form action="[% script_name %]" method="get">
-       <fieldset class="action"><input type="hidden" name="op" value="add_form" />
-       <input type="hidden" name="tagfield" value="[% edit_tagfield %]" />
-       <input type="hidden" name="authtypecode" value="[% edit_authtypecode %]" />
-       <input type="submit" value="Edit subfields" />
-       <a class="cancel" href="auth_tag_structure.pl?searchfield=[% tagfield %]&amp;authtypecode=[% authtypecode %]">Cancel</a></fieldset>
-       </form>
+    <form action="[% script_name %]" method="get">
+    <fieldset class="action"><input type="hidden" name="op" value="add_form" />
+    <input type="hidden" name="tagfield" value="[% edit_tagfield %]" />
+    <input type="hidden" name="authtypecode" value="[% edit_authtypecode %]" />
+    <input type="submit" value="Edit subfields" />
+    <a class="cancel" href="auth_tag_structure.pl?searchfield=[% tagfield %]&amp;authtypecode=[% authtypecode %]">Cancel</a></fieldset>
+    </form>
 
     [% IF ( previous ) %]
     <input type="image" src="[% interface %]/[% theme %]/images/1leftarrow.png" title="previous" alt="previous" border="0" />
index c26f5b0..0ef4e06 100644 (file)
@@ -7,10 +7,10 @@
 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.pager.js"></script>
 <script type="text/javascript" id="js">$(document).ready(function() {
-       $("#table_authtagstructure").tablesorter({
-               sortList: [[0,0]],
-               headers: { 5: { sorter: false},6: { sorter: false},7: { sorter: false}}
-       }).tablesorterPager({container: $("#pagertable_authtagstructure"),positionFixed: false,size: 20});
+    $("#table_authtagstructure").tablesorter({
+        sortList: [[0,0]],
+        headers: { 5: { sorter: false},6: { sorter: false},7: { sorter: false}}
+    }).tablesorterPager({container: $("#pagertable_authtagstructure"),positionFixed: false,size: 20});
 }); </script>
 <script type="text/javascript">
 //<![CDATA[
@@ -69,29 +69,49 @@ return false;
 [% INCLUDE 'header.inc' %]
 [% INCLUDE '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; [% IF ( add_form ) %][% IF ( use_heading_flags_p ) %]
-    [% IF ( heading_modify_tag_p ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Authority MARC framework</a> &rsaquo; [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode %]">[% authtypecode %] Framework</a>[% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a>[% END %] &rsaquo; Modify tag[% END %]
-    [% IF ( heading_add_tag_p ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Authority MARC framework</a> &rsaquo; [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode %]">[% authtypecode %] framework</a>[% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a>[% END %] &rsaquo; New tag[% END %]
-    [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Authority MARC framework</a> &rsaquo; [% action %]
-    [% END %]
-    [% ELSE %]
-    [% IF ( delete_confirm ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Authority MARC framework</a> &rsaquo;
-    [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode %]">[% authtypecode %] framework</a>
-    [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a>[% END %] &rsaquo; Confirm deletion
+<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/authtypes.pl">Authority types</a> &rsaquo;
+    [% IF ( add_form ) %]
+        [% IF ( use_heading_flags_p ) %]
+            [% IF ( heading_modify_tag_p ) %]
+                [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode %]">[% authtypecode %] Framework</a>
+                [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a>
+                [% END %] &rsaquo; Modify tag
+            [% END %]
+            [% IF ( heading_add_tag_p ) %]
+                [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode %]">[% authtypecode %] framework</a>
+                [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a>
+                [% END %] &rsaquo; New tag
+            [% END %]
+        [% ELSE %]
+            [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode %]">[% authtypecode %] Framework</a>
+            [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a>
+            [% END %] &rsaquo; [% action %]
+        [% END %]
     [% ELSE %]
-    [% IF ( delete_confirmed ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Authority MARC framework</a> &rsaquo; Data deleted
-    [% ELSE %]Authority MARC framework: [% IF ( authtypecode ) %][% authtypecode %] framework
-    [% ELSE %]Default framework[% END %]
-    [% END %]
-    [% END %]
+        [% IF ( delete_confirm ) %]
+            [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode %]">[% authtypecode %] framework</a>
+            [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a>
+            [% END %] &rsaquo; Confirm deletion
+        [% ELSE %]
+            [% IF ( delete_confirmed ) %]
+                [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode %]">[% authtypecode %] framework</a>
+                [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a>
+                [% END %] &rsaquo; Data deleted
+            [% ELSE %]
+                [% IF ( authtypecode ) %][% authtypecode %] Framework</a>
+                [% ELSE %]Default framework
+                [% END %]
+            [% END %]
+        [% END %]
     [% END %]
 </div>
 
 <div id="doc3" class="yui-t2">
    
    <div id="bd">
-       <div id="yui-main">
-       <div class="yui-b">
+    <div id="yui-main">
+    <div class="yui-b">
 
 <h1>Authority MARC framework for [% IF ( authtypecode ) %][% authtypecode %][% ELSE %]default framework[% END %]</h1>
 
@@ -109,7 +129,7 @@ return false;
         [% IF ( heading_modify_tag_p ) %]<input type="hidden" name="modif" value="1" />[% END %]
         <input type="hidden" name="authtypecode" value="[% authtypecode %]" />
         <fieldset class="rows"><ol>
-               <li><span class="label">Tag</span>[% searchfield %]</li>
+        <li><span class="label">Tag</span>[% searchfield %]</li>
         <li><label for="liblibrarian">Text for librarians</label><input type="text" name="liblibrarian" id="liblibrarian" value="[% liblibrarian |html %]" size="40" maxlength="100" /></li>
         <li><label for="libopac">Text for opac</label><input type="text" name="libopac" id="libopac" value="[% libopac |html %]" size="40" maxlength="100" /></li>
         <li><label for="repeatable">Repeatable</label>
@@ -134,18 +154,18 @@ return false;
 
 
 [% IF ( delete_confirm ) %]
-               <div class="dialog alert">
+        <div class="dialog alert">
         <h3>Confirm deletion</h3>
-               <form action="[% script_name %]" method="post">
-               <table>
-                       <tr><th scope="row">Tag: </th><td>[% searchfield %] [% liblibrarian %]</td></tr>
-               </table>
+        <form action="[% script_name %]" method="post">
+        <table>
+            <tr><th scope="row">Tag: </th><td>[% searchfield %] [% liblibrarian %]</td></tr>
+        </table>
         <input type="hidden" name="op" value="delete_confirmed" />
         <input type="hidden" name="authtypecode" value="[% authtypecode %]" />
         <input type="hidden" name="searchfield" value="[% searchfield %]" />
         <input type="submit" value="Yes, delete" class="approve"></form>
         <form action="[% script_name %]" method="get"><input type="submit" class="deny" value="No, do not delete" /></form>
-               </div>
+        </div>
 [% END %]
 
 [% IF ( delete_confirmed ) %]
@@ -177,18 +197,18 @@ return false;
 [% IF ( else ) %]
 
 <div id="toolbar">
-       <script type="text/javascript">
-       //<![CDATA[
-       // prepare DOM for YUI Toolbar
-        $(document).ready(function() {
-           yuiToolbar();
-        });
-       // YUI Toolbar Functions
-       function yuiToolbar() {
-           new YAHOO.widget.Button("newtag");
-       }       //]]>
-       </script>
-       <ul class="toolbar">
+    <script type="text/javascript">
+    //<![CDATA[
+    // prepare DOM for YUI Toolbar
+     $(document).ready(function() {
+        yuiToolbar();
+     });
+    // YUI Toolbar Functions
+    function yuiToolbar() {
+        new YAHOO.widget.Button("newtag");
+    }    //]]>
+    </script>
+    <ul class="toolbar">
     <li><a id="newtag" href="/cgi-bin/koha/admin/auth_tag_structure.pl?op=add_form&amp;authtypecode=[% authtypecode %]">New tag</a></li>
 </ul></div>
 
@@ -197,11 +217,11 @@ return false;
     <select name="authtypecode">
         <option value="">Default</option>
     [% FOREACH authtypeloo IN authtypeloop %]
-               [% IF ( authtypeloo.selected ) %]
+        [% IF ( authtypeloo.selected ) %]
         <option value="[% authtypeloo.value %]" selected="selected">[% authtypeloo.authtypetext %]</option>
-               [% ELSE %]
+        [% ELSE %]
         <option value="[% authtypeloo.value %]">[% authtypeloo.authtypetext %]</option>
-               [% END %]
+        [% END %]
             
     [% END %]
     </select>
@@ -221,13 +241,13 @@ return false;
         <th>Subfields</th>
         <th>Edit</th>
         <th>Delete</th>
-       </thead>
+    </thead>
     [% FOREACH loo IN loop %]
-       [% UNLESS ( loop.odd ) %]
-       <tr class="highlight">
-       [% ELSE %]
-       <tr>
-       [% END %]
+    [% UNLESS ( loop.odd ) %]
+    <tr class="highlight">
+    [% ELSE %]
+    <tr>
+    [% END %]
         <td><b>[% loo.tagfield %]</b></td>
         <td>[% loo.liblibrarian %]</td>
         <td>[% IF ( loo.repeatable ) %]Yes[% ELSE %]No[% END %]</td>
index 4acaac3..8657ec8 100644 (file)
@@ -60,7 +60,7 @@
         <fieldset class="rows"><ol>
         <li>
                         [% IF ( action_add_category ) %]<label for="category">Category</label>
-               <input type="text" name="category"  id="category" size="10" maxlength="10" />
+            <input type="text" name="category"  id="category" size="10" maxlength="10" class="focus" />
                         [% ELSE %]<span class="label">Category</span>
                <input type="hidden" name="category" value="[% category %]" />   [% category %]
                         [% END %]
         <li>
             <label for="authorised_value">Authorized value</label>
      [% IF ( action_modify ) %]<input type="hidden" id="id" name="id" value="[% id %]" />[% END %]
+            [% IF ( action_add_category ) %]
             <input type="text" id="authorised_value" name="authorised_value" value="[% authorised_value %]" maxlength="80" />
+            [% ELSE %]
+            <input type="text" id="authorised_value" name="authorised_value" value="[% authorised_value %]" maxlength="80" class="focus" />
+            [% END %]
         </li>
         <li>
             <label for="lib">Description</label>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/didyoumean.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/didyoumean.tt
new file mode 100644 (file)
index 0000000..fd9dfe1
--- /dev/null
@@ -0,0 +1,105 @@
+[% BLOCK pluginlist %]
+<div class="pluginlist">
+[% FOREACH plugin IN plugins %]
+    <div class="plugin">
+        <div class="pluginname">
+            [% IF plugin.enabled %]<input type="checkbox" checked="checked" id="checkbox_[% type %][% plugin.name %]">[% ELSE %]<input type="checkbox" id="checkbox_[% type %][% plugin.name %]">[% END %]
+            <label class='pluginlabel' for="checkbox_[% type %][% plugin.name %]">[% plugin.name %]</label></div>
+        <div class="plugindesc">
+        [% SWITCH plugin.name %]
+        [% CASE 'AuthorityFile' %]
+            Suggest authorities which are relevant to the term the user searched for.
+        [% CASE 'ExplodedTerms' %]
+            Suggest that patrons expand their searches to include
+            broader/narrower/related terms.
+        [% END %]
+        </div>
+    </div>
+[% END %]
+</div>
+[% END %]
+[% INCLUDE 'doc-head-open.inc' %]
+<title>Koha &rsaquo; Administration &rsaquo; Did you mean?</title>
+[% INCLUDE 'doc-head-close.inc' %]
+<script>
+    $(document).ready(function() {
+        $( ".pluginlist" ).sortable();
+        $( ".plugin" ).addClass( "ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" )
+            .find( ".pluginname" )
+                    .addClass( "ui-widget-header ui-corner-all" )
+                    .end()
+            .find( ".plugindesc" );
+    });
+
+    function yesimeant() {
+        var OPACdidyoumean = serialize_plugins('opac');
+        var INTRAdidyoumean = serialize_plugins('intranet');
+
+        var data = "pref_OPACdidyoumean=" + encodeURIComponent(OPACdidyoumean) + "&pref_INTRAdidyoumean=" + encodeURIComponent(INTRAdidyoumean);
+
+        $.ajax({
+            data: data,
+            type: 'POST',
+            url: '/cgi-bin/koha/svc/config/systempreferences/',
+            success: function () { alert("Successfully saved configuration"); },
+        });
+        return false;
+    }
+
+    function serialize_plugins(interface) {
+        var serializedconfig = '[';
+        $('#didyoumean' + interface + ' .pluginlist .plugin').each(function(index) {
+            var name = $(this).find('.pluginlabel').text();
+            var enabled = $(this).find('input:checkbox:checked').length ?
+                          ', "enabled": 1' : '';
+            serializedconfig += '{ "name": "' + name + '"' + enabled + '}, ';
+            });
+            serializedconfig = serializedconfig.substring(0, serializedconfig.length - 2);
+            serializedconfig += ']';
+            return serializedconfig;
+    }
+</script>
+</head>
+<body id="admin_didyoumean" class="admin">
+[% INCLUDE 'header.inc' %]
+[% INCLUDE '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; Did you mean?</div>
+
+<div id="doc3" class="yui-t2">
+
+    <div id="bd">
+    <div id="yui-main">
+    <div class="yui-b">
+        <h3>Did you mean?</h3>
+        <noscript><div class="dialog alert"><strong>Please enable Javascript:</strong>
+            Configuring <em>Did you mean?</em> plugins requires Javascript. If
+            you are unable to use Javascript, you may be able to enter the
+            configuration (which is stored in JSON in the OPACdidyoumean and
+            INTRAdidyoumean system preferences) in the Local Preferences tab in
+            the system preference editor, but this is unsupported, not
+            recommended, and likely will not work.</div></noscript>
+        <div id="didyoumeanlegend">
+            Please put the <em>Did you mean?</em> plugins in order by significance, from
+            most significant to least significant, and check the box to enable those
+            plugins that you want to use. (NOTE: <em>Did you mean?</em> functionality
+            is not yet enabled on the staff client)
+        </div>
+        <form action="/cgi-bin/koha/admin/didyoumean.pl" method="post">
+            <fieldset id="didyoumeanopac">
+                <legend>OPAC</legend>
+                [% PROCESS pluginlist plugins=OPACpluginlist type='opac' %]
+            </fieldset>
+            <fieldset id="didyoumeanintranet">
+                <legend>Intranet</legend>
+                [% PROCESS pluginlist plugins=INTRApluginlist type='intranet' %]
+            </fieldset>
+            <fieldset class="action"><button class="save-all submit" onclick="yesimeant();return false;" type="submit">Save configuration</button> <a href="#" onclick="window.location.reload(true);" class="cancel">Cancel</a></fieldset>
+        </form>
+
+        </div>
+        </div>
+<div class="yui-b">
+[% INCLUDE 'admin-menu.inc' %]
+</div>
+</div>
+[% INCLUDE 'intranet-bottom.inc' %]
index e4fc007..295299b 100644 (file)
@@ -83,5 +83,5 @@ $(document).ready(function() {
        <div class="yui-b">
                [% INCLUDE 'admin-menu.inc' %]
        </div>
-</div>
+
 [% INCLUDE 'intranet-bottom.inc' %]
index cb3f9ba..30a3a85 100644 (file)
@@ -168,11 +168,15 @@ Item types administration
      </li>
   [% ELSE %]
       <li>
-          <label for="itemtype">Item type</label> <input type="text" id="itemtype" name="itemtype" size="10" maxlength="10" onblur="toUC(this)" />
+          <label for="itemtype">Item type</label> <input type="text" id="itemtype" name="itemtype" size="10" maxlength="10" onblur="toUC(this)" class="focus" />
       </li>
   [% END %]
       <li>
-          <label for="description">Description</label><input type="text" id="description" name="description" size="48" value="[% description |html %]" />      </li>
+      [% IF ( itemtype ) %]
+          <label for="description">Description</label><input type="text" id="description" name="description" size="48" value="[% description |html %]" class="focus" /></li>
+      [% ELSE %]
+          <label for="description">Description</label><input type="text" id="description" name="description" size="48" value="[% description |html %]" /></li>
+      [% END %]
      [% IF ( 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&amp;searchfield=noItemTypeImages">noItemTypeImages system preference</a></li></ol>
         [% ELSE %]</ol>
index 5835244..2bd8aaf 100644 (file)
@@ -220,6 +220,17 @@ function CheckRuleForm(f) {
            <input type="text" id="threshold" name="threshold" size="5" maxlength="5" 
                   value="[% threshold |html %]" /> <span class="required">Required</span>
        </li>
+       <li><label for="record_type" class="required">Record type: </label>
+           <select id="record_type" name="record_type">
+               [% IF ( record_type == "authority" ) %]
+                   <option value="biblio">Bibliographic record</option>
+                   <option value="authority" selected="selected">Authority record</option>
+               [% ELSE %]
+                   <option value="biblio" selected="selected">Bibliographic record</option>
+                   <option value="authority">Authority record</option>
+               [% END %]
+           </select><span class="required">Required</span>
+       </li>
     </ol>
   </fieldset>
 
index 875b863..823a825 100644 (file)
@@ -6,8 +6,12 @@
 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/humanmsg.css" />
 <script src="[% themelang %]/lib/jquery/plugins/humanmsg.js" type="text/javascript"></script>
 <script src="[% themelang %]/js/ajax.js" type="text/javascript"></script>
+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
 <script type="text/javascript">
 //<![CDATA[
+    [% UNLESS ( searchfield ) %]$(document).ready(function(){
+            $('#toolbar').fixFloat();
+        });[% END %]
     // This is here because of its dependence on template variables, everything else should go in js/pages/preferences.js - jpw
     var to_highlight = "[% searchfield |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]";
     var search_jumped = [% IF ( search_jumped ) %]true[% ELSE %]false[% END %];
     [% END %]
     [% IF ( search_not_found ) %]
     <div class="dialog alert">
-        No system preferences matched your search for <strong>[% searchfield %]</strong>. You can try a different search or <a href="/cgi-bin/koha/admin/preferences.pl?tab=[% last_tab %]">return to where you were before.</a>
+        No system preferences matched your search for <strong>[% searchfield |html %]</strong>. You can try a different search or <a href="/cgi-bin/koha/admin/preferences.pl?tab=[% last_tab %]">return to where you were before.</a>
     </div>
     [% END %]
     [% FOREACH TAB IN TABS %]
     <div class="prefs-tab">
     <h2>[% TAB.tab_title %] preferences</h2>
     <form action="/cgi-bin/koha/admin/preferences.pl" method="post">
+        [% UNLESS ( searchfield ) %]<div id="toolbar"><button class="save-all submit" type="submit">Save all [% TAB.tab_title %] preferences</button></div>[% END %]
         <input type="hidden" name="op" value="save" />
         <input type="hidden" name="tab" value="[% TAB.tab %]" />
 
index ebae997..1ec49ff 100644 (file)
@@ -32,9 +32,9 @@ Acquisitions:
                   US: 360,000.00 (US)
                   FR: 360 000,00 (FR)
         -
-            - The default tax rate is
+            - Default tax rates are
             - pref: gist
-            - (enter in numeric form, 0.12 for 12%)
+            - (enter in numeric form, 0.12 for 12%. First is the default. If you want more than 1 value, please separate with |)
 
     Printing:
         -
index 27dc9d5..f4cc9e3 100644 (file)
@@ -1,6 +1,13 @@
 Authorities:
     General:
         -
+            - pref: AuthDisplayHierarchy
+              default: no
+              choices:
+                  yes: Display
+                  no: "Don't display"
+            - broader term/narrower term hierarchies when viewing authorities.
+        -
             - When editing records,
             - pref: BiblioAddsAuthorities
               default: no
index 404a04e..91f15c3 100644 (file)
@@ -96,11 +96,11 @@ Cataloging:
                   EAN13: incremental EAN-13 barcodes
                   "OFF": not generated automatically.
         -
-            - When a new item is added, should it be prefilled with last created item values?
+            - When a new item is added,
             - pref: PrefillItem
               choices:
-                  yes: the new item is prefilled with last created item values
-                  no: the new item is not prefilled with last created item values
+                  yes: the new item is prefilled with last created item values.
+                  no: the new item is not prefilled with last created item values.
         -
             - Define a list of subfields to use when prefilling items (separated by space)
             - pref: SubfieldsToUseWhenPrefill
index 531b878..c188d80 100644 (file)
@@ -52,6 +52,11 @@ Circulation:
                   no: "Don't allow"
             - staff to specify a due date for a checkout.
         -
+            - Set the default start date for the Holds to pull list to
+            - pref: HoldsToPullStartDate
+              class: integer
+            - day(s) ago.
+        -
             - pref: AllowAllMessageDeletion
               choices:
                   yes: Allow
@@ -111,11 +116,14 @@ Circulation:
                   no: "Do not"
             - update a bibliographic record's total issues count whenever an item is issued (WARNING! This increases server load significantly; if performance is a concern, use the update_totalissues.pl cron job to update the total issues count).
         -
+            - Use the
+            - pref: ExportWithCsvProfile
+            - CSV profile when exporting patron checkout history (enter CSV Profile name)
+        -
+            - The following fields should be excluded from the patron checkout history CSV or iso2709 export
             - pref: ExportRemoveFields
-            - choices:
-                yes: Export
-                no: "Don't export"
-            - fields for csv or iso2709 export
+            - (separate fields with space, e.g. 100a 200b 300c)
+
     Checkout Policy:
         -
             - pref: AllowNotForLoanOverride
@@ -236,8 +244,9 @@ Circulation:
                   no: "Prevent"
             - patrons from checking out an item whose rental charge would take them over the limit.
         -
+            - "Restrict patrons with the following target audience values from checking out inappropriate materials:"
             - pref: AgeRestrictionMarker
-            - "E.g. FSK|PEGI|Age| (No white space near |). Entry in MARC field (e.g. 521a) as defined for agerestriction in Koha to MARC mapping. Entry in MARC field like FSK 12 or PEGI 12 would mean: Borrower must be 12 years old. (Empty: Do not apply age restriction.)"
+            - "E.g. enter target audience keyword(s) split by | (bar) FSK|PEGI|Age| (No white space near |). Be sure to map agerestriction in Koha to MARC mapping (e.g. 521$a). A MARC field value of FSK 12 or PEGI 12 would mean: Borrower must be 12 years old. Leave empty to not apply an age restriction."
         -
             - pref: AgeRestrictionOverride
               choices:
@@ -285,6 +294,13 @@ Circulation:
                   alert: "display a message"
                   nothing : "do nothing"
             - .
+    Checkin Policy:
+        -
+            - pref: BlockReturnOfWithdrawnItems
+              choices:
+                  yes: Block
+                  no: "Don't block"
+            - returning of items that have been withdrawn.
     Holds Policy:
         -
             - pref: AllowHoldPolicyOverride
@@ -412,17 +428,13 @@ Circulation:
               choices:
                   yes: Enable
                   no:  "Don't enable"
-            - the reduction of loan period for items with number of holds above the threshold specified in decreaseLoanHighHoldsValue
-        -
-            - A loan should be reduced by
+            - the reduction of loan period to
             - pref: decreaseLoanHighHoldsDuration
               class: integer
-            - days, when decreaseLoanHighHoldsValue threshold is reached (if decreaseLoanHighHolds is enabled)
-        -
-            - A loan should be reduced by decreaseLoanHighHoldsDuration when
+            - days for items with more than
             - pref: decreaseLoanHighHoldsValue
               class: integer
-            - holds have been places (if decreaseLoanHighHolds is enables)
+            - holds.
     Fines Policy:
         -
             - Calculate fines based on days overdue
@@ -440,6 +452,12 @@ Circulation:
                   test: Calculate (but only for mailing to the admin)
                   production: Calculate and charge
             - fines (when <code>misc/cronjobs/fines.pl</code> is being run).
+        -
+            - pref: RefundLostItemFeeOnReturn
+              choices:
+                  yes: Refund
+                  no: "Don't refund"
+            - lost item fees charged to a borrower when the lost item is returned.
     Self Checkout:
         -
             - pref: ShowPatronImageInWebBasedSelfCheck
index 02b8de6..cc6700b 100644 (file)
@@ -31,3 +31,8 @@ I18N/L10N:
         - "Enable the following languages on the OPAC:"
         - pref: opaclanguages
           type: opac-languages
+    -
+        - "Use the alphabet"
+        - pref: alphabet
+          class: long
+        - for lists of browsable letters. This should be a space separated list of uppercase letters.
index e645785..2866f8d 100644 (file)
@@ -59,12 +59,12 @@ OPAC:
             - 'Display OPAC results using XSLT stylesheet at: '
             - pref: OPACXSLTResultsDisplay
               class: file
-            - '<br />Options:<br />- leave empty for "no xslt"<br />- enter "default" for the default one<br />- put a path to define a xslt file<br />- put an URL for an external specific stylesheet.<br />{langcode} will be replaced with current interface language'
+            - '<br />Options:<ul><li><a href="#" class="set_syspref" data-syspref="OPACXSLTResultsDisplay" data-value="">Leave empty</a> for "no xslt"</li><li>enter "<a href="#" class="set_syspref" data-syspref="OPACXSLTResultsDisplay" data-value="default">default</a>" for the default one</li><li> put a path to define a xslt file</li><li>put an URL for an external specific stylesheet.</li></ul>{langcode} will be replaced with current interface language'
         -
             - 'Display OPAC details using XSLT stylesheet at: '
             - pref: OPACXSLTDetailsDisplay
               class: file
-            - '<br />Options:<br />- leave empty for "no xslt"<br />- enter "default" for the default one<br />- put a path to define a xslt file<br />- put an URL for an external specific stylesheet.<br />{langcode} will be replaced with current interface language'
+            - '<br />Options:<ul><li><a href="#" class="set_syspref" data-syspref="OPACXSLTDetailsDisplay" data-value="">Leave empty</a> for "no xslt"</li><li>enter "<a href="#" class="set_syspref" data-syspref="OPACXSLTDetailsDisplay" data-value="default">default</a>" for the default one</li><li>put a path to define a xslt file</li><li>put an URL for an external specific stylesheet.</li></ul>{langcode} will be replaced with current interface language'
         -
             - On pages displayed with XSLT stylesheets on the OPAC,
             - pref: DisplayOPACiconsXSLT
@@ -125,7 +125,7 @@ OPAC:
               choices:
                   yes: Highlight
                   no: "Don't highlight"
-            - words the patron searched for in their search results.
+            - words the patron searched for in their search results and detail pages.
         -
             - pref: AuthorisedValueImages
               choices:
@@ -296,6 +296,12 @@ OPAC:
                   no: "Don't allow"
             - patrons to browse subject authorities on OPAC (run misc/cronjobs/build_browser_and_cloud.pl to create the browser list)
         -
+            - pref: OpacCloud
+              choices:
+                  yes: Show
+                  no: "Don't show"
+            - a subject cloud on OPAC (run misc/cronjobs/build_browser_and_cloud.pl to build)
+        -
             - pref: OpacAuthorities
               choices:
                   yes: Allow
index 3128ad6..7b99173 100644 (file)
@@ -1,18 +1,6 @@
 Searching:
     Features:
         -
-            - pref: NoZebra
-              choices:
-                  yes: "Don't use"
-                  no: Use
-            - the Zebra search engine.  It is recommended to use Zebra; the option to not use Zebra is deprecated and is not guaranteed to work.
-        -
-            - When Zebra is not in use, translate the following MARC fields to the following indexes (each line should look something like <code>'indexname' =&gt; '100a,245a,500*',</code>)
-            - pref: NoZebraIndexes
-              type: textarea
-              class: list
-            -
-        -
             - Perform wildcard searching (where, for example, <cite>Har</cite> would match <cite>Harry</cite> and <cite>harp</cite>)
             - pref: QueryAutoTruncate
               type: boolean
@@ -28,13 +16,6 @@ Searching:
                   no: "Don't try"
             - to match similarly spelled words in a search (for example, a search for <cite>flang</cite> would also match <cite>flange</cite> and <cite>fang</cite>; REQUIRES ZEBRA).
         -
-            - pref: QueryRemoveStopwords
-              type: boolean
-              choices:
-                  yes: Ignore
-                  no: "Don't ignore"
-            - stopwords specified in Koha when searching. (Only applies when Zebra is off).
-        -
             - pref: QueryStemming
               type: boolean
               choices:
@@ -77,12 +58,6 @@ Searching:
                   no: "Not using"
             - 'ICU Zebra indexing. Please note: This setting will not affect Zebra indexing, it should only be used to tell Koha that you have activated ICU indexing if you have actually done so, since there is no way for Koha to figure this out on its own.'
         -
-            - pref: DidYouMeanFromAuthorities
-              default: 0
-              choices:
-                  yes: Suggest
-                  no: "Don't suggest"
-            - alternate searches based on data in the authority file.
             - pref: IncludeSeeFromInSearches
               default: 0
               choices:
index b6be289..d9fc21a 100644 (file)
@@ -59,12 +59,12 @@ Staff Client:
             - 'Display results in the staff client using XSLT stylesheet at: '
             - pref: XSLTResultsDisplay
               class: file
-            - '<br />Options:<br />- leave empty for "no xslt"<br />- enter "default" for the default one<br />- put a path to define a xslt file<br />- put an URL for an external specific stylesheet.<br />{langcode} will be replaced with current interface language'
+            - '<br />Options:<ul><li><a href="#" class="set_syspref" data-syspref="XSLTResultsDisplay" data-value="">Leave empty</a> for "no xslt"</li><li>enter "<a href="#" class="set_syspref" data-syspref="XSLTResultsDisplay" data-value="default">default</a>" for the default one</li><li> put a path to define a xslt file</li><li>put an URL for an external specific stylesheet.</li></ul>{langcode} will be replaced with current interface language'
         -
             - 'Display details in the staff client using XSLT stylesheet at: '
             - pref: XSLTDetailsDisplay
               class: file
-            - '<br />Options:<br />- leave empty for "no xslt"<br />- enter "default" for the default one<br />- put a path to define a xslt file<br />- put an URL for an external specific stylesheet.<br />{langcode} will be replaced with current interface language'
+            - '<br />Options:<ul><li><a href="#" class="set_syspref" data-syspref="XSLTDetailsDisplay" data-value="">Leave empty</a> for "no xslt"</li><li>enter "<a href="#" class="set_syspref" data-syspref="XSLTDetailsDisplay" data-value="default">default</a>" for the default one</li><li>put a path to define a xslt file</li><li>put an URL for an external specific stylesheet.</li></ul>{langcode} will be replaced with current interface language'
         -
             - Use the Yahoo UI libraries
             - pref: yuipath
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/tools.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/tools.pref
deleted file mode 100644 (file)
index 2891b0e..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-Tools:
-    -
-        - pref: ExportWithCsvProfile
-        - CSV profile for export
index b2f62f7..586d72f 100644 (file)
@@ -38,10 +38,10 @@ $(document).ready(function() {
             <li>same library, same patron type, all item types</li>
             <li>same library, all patron types, same item type</li>
             <li>same library, all patron types, all item types</li>
-            <li>all libraries, same patron type, same item type</li>
-            <li>all libraries, same patron type, all item types</li>
-            <li>all libraries, all patron types, same item type</li>
-            <li>all libraries, all patron types, all item types</li>
+            <li>default (all libraries), same patron type, same item type</li>
+            <li>default (all libraries), same patron type, all item types</li>
+            <li>default (all libraries), all patron types, same item type</li>
+            <li>default (all libraries), all patron types, all item types</li>
         </ul>
         <p>To modify a rule, create a new one with the same patron type and item type.</p>
     </div>
@@ -174,7 +174,7 @@ for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde
         </form>
     </div>
     <div id="defaults-for-this-library" class="container">
-    <h3>Default checkout, hold and return policy for [% IF ( humanbranch ) %][% humanbranch %][% ELSE %]all libraries[% END %]</h3>
+    <h3>Default checkout, hold and return policy[% IF ( humanbranch ) %] for [% humanbranch %][% END %]</h3>
         <p>You can set a default maximum number of checkouts, hold policy and return policy that will be used if none is defined below for a particular item type or category.</p>
         <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
             <input type="hidden" name="op" value="set-branch-defaults" />
@@ -230,7 +230,7 @@ for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde
                             [% ELSE %]
                             <option value="holdingbranch">
                             [% END %]
-                                Item returns to issuing branch
+                                Item returns to issuing library
                             </option>
                             [% IF ( default_returnbranch == 'noreturn' ) %]
                             <option value="noreturn" selected="selected">
@@ -251,7 +251,7 @@ for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde
     </div>
     [% IF ( show_branch_cat_rule_form ) %]
     <div id="holds-policy-by-patron-category" class="container">
-    <h3>Checkout limit by patron category for [% IF ( humanbranch ) %][% humanbranch %][% ELSE %]all libraries[% END %]</h3>
+    <h3>[% IF humanbranch %]Checkout limit by patron category for [% humanbranch %][% ELSE %]Default checkout limit by patron category[% END %]</h3>
         <p>For this library, you can specify the maximum number of loans that
             a patron of a given category can make, regardless of the item type.
         </p>
@@ -306,7 +306,7 @@ for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde
     </div>
     [% END %]
     <div id="holds-policy-by-item-type" class="container">
-    <h3>Holds policy by item type for [% IF ( humanbranch ) %][% humanbranch %][% ELSE %]all libraries[% END %]</h3>
+    <h3>[% IF humanbranch %]Holds policy by item type for [% humanbranch %][% ELSE %]Default holds policy by item type[% END %]</h3>
         <p>
             For this library, you can edit rules for given itemtypes, regardless
             of the patron's category.
@@ -390,7 +390,7 @@ for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde
                     <td>
                         <select name="returnbranch">
                             <option value="homebranch">Item returns home</option>
-                            <option value="holdingbranch">Item returns to issuing branch</option>
+                            <option value="holdingbranch">Item returns to issuing library</option>
                             <option value="noreturn">Item floats</option>
                         </select>
                     </td>
index 8d12419..4ec0710 100644 (file)
@@ -1,5 +1,5 @@
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Administration &rsaquo; Transport Cost Matrix</title>
+<title>Koha &rsaquo; Administration &rsaquo; Transport cost matrix</title>
 [% INCLUDE 'doc-head-close.inc' %]
 
 <script type="text/javascript">
@@ -38,18 +38,11 @@ function form_submit (f) {
     $(f).find('input:disabled').removeAttr("disabled");
     return true;
 }
-
-$(document).ready(function() {
-    show_transport_cost_matrix([% IF UseTransportCostMatrix %]true[% ELSE %]false[% END %]);
-});
 //]]>
 </script>
 <style type="text/css">
 .disabled-transfer {
-    background-color: red;
-}
-.errors {
-    color: red;
+    background-color: #FF8888;
 }
 </style>
 
@@ -58,7 +51,7 @@ $(document).ready(function() {
 [% INCLUDE 'header.inc' %]
 [% INCLUDE '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; Transport Cost Matrix</div>
+<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; Transport cost matrix</div>
 
 <div id="doc3" class="yui-t1">
 
@@ -69,30 +62,34 @@ $(document).ready(function() {
             Defining transport costs between libraries
     </h1>
 [% IF ( WARNING_transport_cost_matrix_off ) %]
-<div class="dialog message">Because the "UseTransportCostMatrix" system preference is currently not enabled, Transport Cost Matrix is not being used.  Go <a href="/cgi-bin/koha/admin/preferences.pl?op=search&amp;searchfield=UseTransportCostMatrix">here</a> if you wish to enable this feature.</div>
+<div class="dialog message">Because the "UseTransportCostMatrix" system preference is currently not enabled, the transport cost matrix is not being used.  Go <a href="/cgi-bin/koha/admin/preferences.pl?op=search&amp;searchfield=UseTransportCostMatrix">here</a> if you wish to enable this feature.</div>
 [% END %]
 
-    <div class="container">
-        <form method="post" action="?" onSubmit="return form_submit(this);">
+    [% IF ( errors ) %]<div class="dialog alert">
+        <h4>There were problems with your submission</h4>
+        <ul>
+            [% FOR e IN errors %]
+                <li>[% e %]</li>
+            [% END %]
+        </ul>
+    </div>[% END %]
+
+        <form method="post" action="?" onsubmit="return form_submit(this);">
             <input type="hidden" name="op" value="set-cost-matrix" />
-            <div id="transport-cost-matrix">
+            <fieldset id="transport-cost-matrix">
                 <div class="help">
-                    <p>Costs are decimal values 0 to some arbitrarymax value (1 or 100), 0 being minimum (no) cost.</p>
-                    <p>Red cells signify no transfer allowed</p>
-                    <p>Click on the cell to edit</p>
+                    <p>Costs are decimal values between some arbitrary maximum value (e.g. 1 or 100) and 0 which is the minimum (no) cost.</p>
+                    <p>Red cells signify no transfer allowed.</p>
+                    <p>Click on individual cells to edit.</p>
                 </div>
-                <ul class="errors" %]>
-                [% FOR e IN errors %]
-                    <li>[% e %]</li>
-                [% END %]
-                </ul>
+
                 <table>
                     <tr>
                         <th>From \ To</th>
-                [% FOR b IN branchloop %]
+                        [% FOR b IN branchloop %]
                         <th>[% b.name %]</th>
-                [% END %]
-                    <tr>
+                        [% END %]
+                    </tr>
                 [% FOR bf IN branchfromloop %]
                     <tr>
                         <th>[% bf.name %]</th>
@@ -118,12 +115,13 @@ $(document).ready(function() {
                     </tr>
                 [% END %]
                 </table>
-            </div>
-            <input type="submit" value="Save" class="submit" />
+            </fieldset>
+            <fieldset class="action">
+                <input type="submit" value="Save" class="submit" /> <a href="/cgi-bin/koha/admin/transport-cost-matrix.pl" class="cancel">Cancel</a>
+            </fieldset>
         </form>
     </div>
     </div>
-    </div>
 <div class="yui-b">
 [% INCLUDE 'admin-menu.inc' %]
 </div>
index d0c4329..5c3d566 100644 (file)
@@ -2,36 +2,21 @@
 <title>Koha &rsaquo; Authorities &rsaquo; [% IF ( authid ) %]Modify authority #[% authid %] ([% authtypetext %])[% ELSE %]Adding authority ([% authtypetext %])[% END %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
 <script type="text/javascript" src="[% themelang %]/lib/yui/plugins/bubbling-min.js"></script>
+<script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script>
 
 <script type="text/javascript">
 //<![CDATA[
 
-     var fields_in_use = {};
         $(document).ready(function() {
         $('#authoritytabs').tabs();
-        $('.tag').each(function() {
-            var field_id = this.getAttribute('id').substring(0, 7);
-            if (field_id in fields_in_use) {
-                fields_in_use[field_id]++;
-            } else {
-                fields_in_use[field_id] = 1;
-            }
-        });
-        $('.subfield_line').each(function() {
-            var field_id = this.getAttribute('id').substring(0, 12);
-            if (field_id in fields_in_use) {
-                fields_in_use[field_id]++;
-            } else {
-                fields_in_use[field_id] = 1;
-            }
-        });
+
                $("#f").submit(function(){
                        return $(this).Check();
                });
         });
 
 /**
- * check if mandatory subfields are writed
+ * check if mandatory subfields are written
  */
 function AreMandatoriesNotOk(){
     var mandatories = new Array();
@@ -75,7 +60,6 @@ function AreMandatoriesNotOk(){
                for(var j=0,len2=eleminputs.length; j<len2; j++){
        
                        if(eleminputs[j].name.match(varegexp) && eleminputs[j].value){
-                                       /* tag_801_subfield_c_841304_545657 */
                                        inputregexp = new RegExp("^tag_" + arr[0] + "_subfield_" + eleminputs[j].value + "_" + arr[2]);
                                        
                                        for( var k=0; k<len2; k++){
@@ -118,44 +102,6 @@ function Check(){
     }
 }
 
-
-// returns the subfieldcode based upon subfieldid writing
-function getSubfieldcode(tagsubfieldid){
-    // 3 : tag +3 : tagnumber +4 : number of _ +8 subfield -1 begins at 0  
-    return tagsubfieldid.substr(3+3+4+8-1,1);
-}
-
-// Take the base of tagsubfield information (removing the subfieldcodes and subfieldindexes)
-// returns the filter
-function getTagInputnameFilter(tagsubfieldid){
-    var tagsubfield=tagsubfieldid.substr(0,tagsubfieldid.lastIndexOf("_"));  
-    var tagcode=tagsubfield.substr(tagsubfield.lastIndexOf("_"));
-    tagsubfield=tagsubfield.substr(0,tagsubfield.lastIndexOf("_"));
-    tagsubfield=tagsubfield.substr(0,tagsubfield.lastIndexOf("_"));
-    tagsubfield=tagsubfield+"_."+tagcode;
-    return tagsubfield;  
-}
-
-function openAuth(tagsubfieldid,authtype) {
-    // let's take the base of tagsubfield information (removing the indexes and the codes
-    var element=document.getElementById(tagsubfieldid);
-    var tagsubfield=getTagInputnameFilter(tagsubfieldid);
-    var elementsubfcode=getSubfieldcode(element.name);
-    var mainmainstring=element.value;
-    var mainstring="";  
-    var inputs = element.parentNode.parentNode.getElementsByTagName("input");
-
-    for (var myindex =0; myindex<inputs.length;myindex++){
-        if (inputs[myindex].name && inputs[myindex].name.match(tagsubfield)){
-            var subfieldcode=getSubfieldcode(inputs[myindex].name);
-            if (isNaN(parseInt(subfieldcode)) && inputs[myindex].value != "" && subfieldcode!=elementsubfcode){
-                mainstring=inputs[myindex].value+" "+mainstring;
-            }      
-        }
-    }           
-    newin=window.open("../authorities/auth_finder.pl?source=auth&authtypecode="+  authtype+ "&index="+tagsubfieldid+"&value_mainstr="+encodeURI(mainmainstring)+"&value_main="+encodeURI(mainstring), "_blank",'width=700,height=550,toolbar=false,scrollbars=yes');
-}
-
 function AddField(field,cntrepeatfield) {
     document.forms['f'].op.value = "addfield";
     document.forms['f'].addfield_field.value=field;
@@ -163,335 +109,6 @@ function AddField(field,cntrepeatfield) {
     document.f.submit();
 }
 
-
-function ExpandField(index) {
-    var original = document.getElementById(index); //original <div>
-    var divs = original.getElementsByTagName('div');
-    for(var i=0,divslen = divs.length ; i<divslen ; i++){      // foreach div
-        if(divs[i].getAttribute("name") == 'line'){  // if it s a subfield
-            if (divs[i].style.display == 'block') {
-                divs[i].style.display = 'none';
-            } else {
-                divs[i].style.display = 'block';
-            }
-        }
-    }
-}
-
-/**
- * To clone a field or a subfield by clickink on '+' button
- */ 
-function CloneField(index) {
-    var original = document.getElementById(index); //original <div>
-    fields_in_use[index.substr(0, 7)]++;
-    var clone = original.cloneNode(true);
-    var new_key = CreateKey();
-    var new_id  = original.getAttribute('id')+new_key;
-    
-    clone.setAttribute('id',new_id); // setting a new id for the parent div
-    
-    var divs = clone.getElementsByTagName('div');
-    
-    [% UNLESS ( hide_marc ) %] // No indicator if hide_marc
-        // setting a new name for the new indicator
-        for(var i=0; i < 2; i++) {
-            var indicator = clone.getElementsByTagName('input')[i];
-            indicator.setAttribute('name',indicator.getAttribute('name')+new_key);
-        }
-    [% END %]
-        
-    // settings all subfields
-    for(var i=0,divslen = divs.length ; i<divslen ; i++){      // foreach div
-        if(divs[i].getAttribute("name") == 'line'){  // if it s a subfield
-            
-            // set the attribute for the new 'div' subfields
-            divs[i].setAttribute('id',divs[i].getAttribute('id')+new_key);
-            
-            var inputs   = divs[i].getElementsByTagName('input');
-            var id_input = "";
-            
-            inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key);
-            inputs[0].setAttribute('name',inputs[0].getAttribute('name')+new_key);
-            var id_input;
-            try {
-              id_input = inputs[1].getAttribute('id')+new_key;
-                inputs[1].setAttribute('id',id_input);
-                inputs[1].setAttribute('name',inputs[1].getAttribute('name')+new_key);
-            } catch(e) {
-              try{ // it s a select if it is not an input
-                    var selects = divs[i].getElementsByTagName('select');
-                    id_input = selects[0].getAttribute('id')+new_key;
-                    selects[0].setAttribute('id',id_input);
-                    selects[0].setAttribute('name',selects[0].getAttribute('name')+new_key);
-                }catch(e2){ // it is a textarea if it s not a select or an input
-                  var textaeras = divs[i].getElementsByTagName('textarea');
-                  id_input = textaeras[0].getAttribute('id')+new_key;
-                  textaeras[0].setAttribute('id',id_input);
-                    textaeras[0].setAttribute('name',textaeras[0].getAttribute('name')+new_key);
-                }
-            }
-            
-            [% UNLESS ( advancedMARCEditor ) %]
-            // when cloning a subfield, re set its label too.
-            var labels = divs[i].getElementsByTagName('label');
-            labels[0].setAttribute('for',id_input);
-            [% END %]
-            
-            [% UNLESS ( hide_marc ) %]
-                // updating javascript parameters on button up
-                var imgs = divs[i].getElementsByTagName('img');
-                imgs[0].setAttribute('onclick',"upSubfield(\'"+divs[i].getAttribute('id')+"\');");
-            [% END %]
-            
-            // setting its '+' and '-' buttons
-            try {
-                var spans = divs[i].getElementsByTagName('span');
-                for (var j = 0; j < spans.length; j++) {
-                    if(spans[j].getAttribute('class') == 'buttonPlus'){
-                        spans[j].setAttribute('onclick',"CloneSubfield('" + divs[i].getAttribute('id') + "')");
-                    } else if (spans[j].getAttribute('class') == 'buttonMinus') {
-                        spans[j].setAttribute('onclick',"UnCloneField('" + divs[i].getAttribute('id') + "')");
-                    }
-                }
-            }
-            catch(e){
-                // do nothig if ButtonPlus & CloneButtonPlus don t exist.
-            }
-            
-            // button ...
-            var spans=0;
-            try {
-                spans = divs[i].getElementsByTagName('span');
-            } catch(e) {
-                // no spans
-            }
-            if(spans){
-                var buttonDot;
-                if(!CloneButtonPlus){ // it s impossible to have  + ... (buttonDot AND buttonPlus)
-                    buttonDot = spans[0];
-                    if(buttonDot){
-                        // 2 possibilities :
-                        try{
-                            var buttonDotOnClick = buttonDot.getAttribute('onclick');
-                            if(buttonDotOnClick.match('Clictag')){   // -1- It s a plugin
-                                var re = /\('.*'\)/i;
-                                buttonDotOnClick = buttonDotOnClick.replace(re,"('"+inputs[1].getAttribute('id')+"')");
-                                if(buttonDotOnClick){
-                                    buttonDot.setAttribute('onclick',buttonDotOnClick);
-                                }
-                            } else {
-                                if(buttonDotOnClick.match('Dopop')) {  // -2- It's a auth value
-                                    
-                                    var re1 = /&index=.*',/;
-                                    var re2 = /,.*\)/;
-
-                                    buttonDotOnClick = buttonDotOnClick.replace(re1,"&index="+inputs[1].getAttribute('id')+"',");
-                                    buttonDotOnClick = buttonDotOnClick.replace(re2,",'"+inputs[1].getAttribute('id')+"')");
-                                    
-                                    if(buttonDotOnClick){
-                                            buttonDot.setAttribute('onclick',buttonDotOnClick);
-                                    }
-                                }
-                            }
-                            try {
-                              // do not copy the script section.
-                              var script = spans[0].getElementsByTagName('script')[0];
-                              spans[0].removeChild(script);
-                            } catch(e) {
-                              // do nothing if there is no script
-                            }
-                      }catch(e){}
-                  }
-                }
-            }
-            [% UNLESS ( hide_marc ) %]
-                var buttonUp = divs[i].getElementsByTagName('img')[0];
-                buttonUp.setAttribute('onclick',"upSubfield('" + divs[i].getAttribute('id') + "')");
-            [% END %]
-            
-        } else { // it's a indicator div
-            if(divs[i].getAttribute('name') == 'div_indicator'){
-                var inputs = divs[i].getElementsByTagName('input');
-                inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key);
-                inputs[1].setAttribute('id',inputs[1].getAttribute('id')+new_key);
-                
-                var CloneButtonPlus;
-                try {
-                    var anchors = divs[i].getElementsByTagName('span');
-                    for (var j = 0; j < anchors.length; j++) {
-                        if (anchors[j].getAttribute('class') == 'buttonPlus') {
-                            anchors[j].setAttribute('onclick',"CloneField('" + new_id + "')");
-                        } else if (anchors[j].getAttribute('class') == 'buttonMinus') {
-                            anchors[j].setAttribute('onclick',"UnCloneField('" + 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.
-                }
-                
-            }
-        }
-    }
-    
-    // insert this line on the page
-    original.parentNode.insertBefore(clone,original.nextSibling);
-}
-
-function CloneSubfield(index){
-    var original = document.getElementById(index); //original <div>
-    fields_in_use[index.substr(0, 12)]++;
-    var clone = original.cloneNode(true);
-    var new_key = CreateKey();
-    var new_id  = original.getAttribute('id')+new_key;
-    
-    // set the attribute for the new 'div' subfields
-    var inputs     = clone.getElementsByTagName('input');
-    var selects    = clone.getElementsByTagName('select');
-    var textareas  = clone.getElementsByTagName('textarea');
-        
-    // input
-    var id_input = "";
-    for(var i=0,len=inputs.length; i<len ; i++ ){
-        id_input = inputs[i].getAttribute('id')+new_key;
-        inputs[i].setAttribute('id',id_input);
-        inputs[i].setAttribute('name',inputs[i].getAttribute('name')+new_key);
-    }
-    
-    // select 
-    for(var i=0,len=selects.length; i<len ; i++ ){
-        id_input = selects[i].getAttribute('id')+new_key;
-        selects[i].setAttribute('id',selects[i].getAttribute('id')+new_key);
-        selects[i].setAttribute('name',selects[i].getAttribute('name')+new_key);
-    }
-    
-    // textarea
-    for(var i=0,len=textareas.length; i<len ; i++ ){
-        id_input = textareas[i].getAttribute('id')+new_key;
-        textareas[i].setAttribute('id',textareas[i].getAttribute('id')+new_key);
-        textareas[i].setAttribute('name',textareas[i].getAttribute('name')+new_key);
-    }
-    
-    [% UNLESS ( advancedMARCEditor ) %]
-    // when cloning a subfield, reset its label too.
-    var label = clone.getElementsByTagName('label')[0];
-    label.setAttribute('for',id_input);
-    [% END %]
-    
-    // setting a new if for the parent div
-    clone.setAttribute('id',new_id);
-    
-    try {
-      var buttonUp = clone.getElementsByTagName('img')[0];
-      buttonUp.setAttribute('onclick',"upSubfield('" + new_id + "')");
-      var spans = clone.getElementsByTagName('span');
-      if(spans.length){
-          for(var i = 0 ,lenspans = spans.length ; i < lenspans ; i++){
-            if(spans[i].getAttribute('class') == 'buttonPlus'){
-                    spans[i].setAttribute('onclick',"CloneSubfield('" + new_id + "')");
-                } else if (spans[i].getAttribute('class') == 'buttonMinus') {
-                    spans[i].setAttribute('onclick',"UnCloneField('" + new_id + "')");
-                }
-            }
-        }
-    }
-    catch(e){
-        // do nothig if ButtonPlus & CloneButtonPlus don't exist.
-    }
-    // insert this line on the page
-    original.parentNode.insertBefore(clone,original.nextSibling);
-}
-
- /**
- * This function removes or clears unwanted subfields
- */
-function UnCloneField(index) {
-    var original = document.getElementById(index);
-    var field_id;
-    if (index.match("tag")) {
-        field_id = index.substr(0, 7);
-    } else {
-        field_id = index.substr(0, 12);
-    }
-    if (1 == fields_in_use[field_id]) {
-        // clear inputs, but don't delete
-        $(":input.input_marceditor", original).each(function(){
-            // thanks to http://www.learningjquery.com/2007/08/clearing-form-data for
-            // hint about clearing selects correctly
-            var type = this.type;
-            var tag = this.tagName.toLowerCase();
-            if (type == 'text' || type == 'password' || tag == 'textarea') {
-                this.value = "";
-            } else if (type == 'checkbox' || type == 'radio') {
-                this.checked = false;
-            } else if (tag == 'select') {
-                this.selectedIndex = -1;
-            }
-        });
-        $(":input.indicator", original).val("");
-    } else {
-        original.parentNode.removeChild(original);
-        fields_in_use[field_id]--;
-    }
-}
-
-
-/**
- * This function create a random number
- */
-function CreateKey(){
-    return parseInt(Math.random() * 100000);
-}
-
-/**
- * This function allows to move a subfield up by clickink on the 'up' button .
- */
-function upSubfield(index) {
-    try{
-        var line = document.getElementById(index); // get the line where the user has clicked.
-    } catch(e) {
-        return; // this line doesn't exist...
-    }
-    var tag = line.parentNode; // get the dad of this line. (should be "<div id='tag_...'>")
-    
-    // getting all subfields for this tag
-    var subfields = tag.getElementsByTagName('div');
-    var subfieldsLength = subfields.length;
-    
-    if(subfieldsLength<=1) return; // nothing to do if there is just one subfield.
-    
-    // among all subfields 
-    for(var i=0;i<subfieldsLength;i++){ 
-        if(subfields[i].getAttribute('id') == index){ //looking for the subfield which is clicked :
-            if(i==1){ // if the clicked subfield is on the top
-                tag.appendChild(subfields[1]);
-                return;
-            } else {
-                var lineAbove = subfields[i-1];
-                tag.insertBefore(line,lineAbove);
-                return;
-            }
-        }
-    }
-}
-
-function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
-    subfield = document.getElementById(index);
-    subfield.style.display = 'block';
-    label = document.getElementById(labelindex);
-    label.style.display='none'; 
-}
-
 function addauthority() {
     X = document.forms[0].authtype.value;
     window.location="/cgi-bin/koha/authorities/authorities.pl?authtypecode="+X;
@@ -591,150 +208,161 @@ function searchauthority() {
        <ul class="toolbar"><li id="addauthc"><input id="addauth" type="submit" value="Save" accesskey="w" /></li></ul></div>
 
 <div id="authoritytabs" class="toptabs numbered">
-       <ul> [% FOREACH BIG_LOO IN BIG_LOOP %]
-            <li>[% IF ( BIG_LOO.number ) %]
-                <a href="#tab[% BIG_LOO.number %]XX">[% BIG_LOO.number %]</a>
-            [% ELSE %]
-                <a href="#tab[% BIG_LOO.number %]XX">[% BIG_LOO.number %]</a>
-            [% END %]</li>
-        [% END %]</ul>
+    <ul>
+        [% FOREACH BIG_LOO IN BIG_LOOP %]
+        <li><a href="#tab[% BIG_LOO.number %]XX">[% BIG_LOO.number %]</a></li>
+        [% END %]
+    </ul>
 
 [% FOREACH BIG_LOO IN BIG_LOOP %]
-    <!-- hide every tab except the 1st -->
-            [% IF ( BIG_LOO.number ) %]
-                <div id="tab[% BIG_LOO.number %]XX">
+    <div id="tab[% BIG_LOO.number %]XX">
+
+    [% FOREACH innerloo IN BIG_LOO.innerloop %]
+    [% IF ( innerloo.tag ) %]
+    <div class="tag" id="tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]">
+        <div class="tag_title" id="div_indicator_tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]">
+        [% UNLESS hide_marc %]
+            [% IF advancedMARCEditor %]
+                <a href="#" tabindex="1" class="tagnum" title="[% innerloo.tag_lib %] - Click to Expand this Tag" onclick="ExpandField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;">[% innerloo.tag %]</a>
             [% ELSE %]
-                <div id="tab[% BIG_LOO.number %]XX">
+                <span title="[% innerloo.tag_lib %]">[% innerloo.tag %]</span>
             [% END %]
-        
-        [% FOREACH innerloo IN BIG_LOO.innerloop %]
-            [% IF ( innerloo.tag ) %]
-                <div class="tag" id="tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]">
-                <div class="tag_title" name="div_indicator">
-                [% UNLESS ( innerloo.hide_marc ) %]
-                   [% IF ( innerloo.advancedMARCEditor ) %]
-                    <a class="tagnum" onclick="ExpandField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]')">[% innerloo.tag %]</a>
-                   [% ELSE %]
-                    <span title="[% innerloo.tag_lib %]">[% innerloo.tag %]</span>
-                   [% END %]
-                    [% IF ( innerloo.fixedfield ) %]
-                    <input class="indicator flat"
-                                type="text"
-                                style="display:none;"
-                                name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
-                                size="1"
-                                maxlength="1"
-                                value="[% innerloo.indicator1 %]" />
-                    <input class="indicator flat"
-                                type="text"
-                                style="display:none;"
-                                name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
-                                size="1"
-                                maxlength="1"
-                                value="[% innerloo.indicator2 %]" />
-                    [% ELSE %]
-                    <input class="indicator flat"
-                                type="text"
-                                name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
-                                size="1"
-                                maxlength="1"
-                                value="[% innerloo.indicator1 %]" />
-                    <input class="indicator flat"
-                                type="text"
-                                name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
-                                size="1"
-                                maxlength="1"
-                                value="[% innerloo.indicator2 %]" />
-                    [% END %] -
+                [% IF ( innerloo.fixedfield ) %]
+                    <input type="text"
+                        tabindex="1"
+                        class="indicator flat"
+                        style="display:none;"
+                        name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
+                        size="1"
+                        maxlength="1"
+                        value="[% innerloo.indicator1 %]" />
+                    <input type="text"
+                        tabindex="1"
+                        class="indicator flat"
+                        style="display:none;"
+                        name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
+                        size="1"
+                        maxlength="1"
+                        value="[% innerloo.indicator2 %]" />
                 [% ELSE %]
-                    [% IF ( innerloo.fixedfield ) %]
-                        <input type="hidden"
-                            name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %]"
-                            value="[% innerloo.indicator1 %][% innerloo.random %]" />
-                        <input type="hidden"
-                            name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %]"
-                            value="[% innerloo.indicator2 %][% innerloo.random %]" />
-                    [% ELSE %]
-                        <input type="hidden"
-                            name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %]"
-                            value="[% innerloo.indicator1 %][% innerloo.random %]" />
-                        <input type="hidden"
-                            name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %]"
-                            value="[% innerloo.indicator2 %][% innerloo.random %]" />
-                    [% END %]
-                [% END %]
-    
-                [% UNLESS ( innerloo.advancedMARCEditor ) %]
-                    <a onclick="ExpandField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]')">[% innerloo.tag_lib %]</a>
+                    <input type="text"
+                        tabindex="1"
+                        class="indicator flat"
+                        name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
+                        size="1"
+                        maxlength="1"
+                        value="[% innerloo.indicator1 %]" />
+                    <input type="text"
+                        tabindex="1"
+                        class="indicator flat"
+                        name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
+                        size="1"
+                        maxlength="1"
+                        value="[% innerloo.indicator2 %]" />
+                [% END %] -
+        [% ELSE %]
+                [% IF ( innerloo.fixedfield ) %]
+                    <input type="hidden"
+                        tabindex="1"
+                        name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
+                        value="[% innerloo.indicator1 %]" />
+                    <input type="hidden"
+                        tabindex="1"
+                        name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
+                        value="[% innerloo.indicator2 %]" />
+                [% ELSE %]
+                    <input type="hidden"
+                        tabindex="1"
+                        name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
+                        value="[% innerloo.indicator1 %]" />
+                    <input type="hidden"
+                        tabindex="1"
+                        name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
+                        value="[% innerloo.indicator2 %]" />
                 [% END %]
+        [% END %]
+
+            [% UNLESS advancedMARCEditor %]
+                <a href="#" tabindex="1" class="expandfield" onclick="ExpandField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;" title="Click to Expand this Tag">[% innerloo.tag_lib %]</a>
+            [% END %]
+                <span class="field_controls">
                 [% IF ( innerloo.repeatable ) %]
-                    <span class="buttonPlus" onclick="CloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]')">+</span>
+                    <a href="#" tabindex="1" class="buttonPlus" onclick="CloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]','[% hide_marc %]','[% advancedMARCEditor %]'); return false;" title="Repeat this Tag">
+                        <img src="/intranet-tmpl/prog/img/repeat-tag.png" alt="Repeat this Tag" />
+                    </a>
                 [% END %]
-                [% UNLESS ( innerloo.mandatory ) %]
-                    <span class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]')">&#8722;</span>
+                    <a href="#" tabindex="1" class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;" title="Delete this Tag">
+                        <img src="/intranet-tmpl/prog/img/delete-tag.png" alt="Delete this Tag" />
+                    </a>
+                </span>
+
+        </div>
+
+        [% FOREACH subfield_loo IN innerloo.subfield_loop %]
+            <!--  One line on the marc editor -->
+            <div class="subfield_line" style="[% subfield_loo.visibility %]" id="subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]">
+
+                [% UNLESS advancedMARCEditor %]
+                    [% IF ( subfield_loo.fixedfield ) %]<label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" style="display:none;" class="labelsubfield">
+                    [% ELSE %]<label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" class="labelsubfield">
+                    [% END %]
                 [% END %]
                 
-            </div>
-    
-            [% FOREACH subfield_loo IN innerloo.subfield_loop %]
-                <!--  One line on the marc editor -->
-                <div name="line" class="subfield_line" style="[% subfield_loo.visibility %];" id="subfield[% subfield_loo.tag %][% subfield_loo.subfield %]">
-                
-                    [% UNLESS ( subfield_loo.advancedMARCEditor ) %]
-                        [% IF ( subfield_loo.fixedfield ) %]<label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" style="display:none;" class="labelsubfield" >
-                        [% ELSE %] <label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" class="labelsubfield" >[% END %]
-                    [% END %] 
-                    
-                    [% UNLESS ( subfield_loo.hide_marc ) %]
+                [% UNLESS hide_marc %]
+                <span class="subfieldcode">
                     [% IF ( subfield_loo.fixedfield ) %]
-                        <img class="buttonUp" style="display:none;" src="[% themelang %]/../img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %]')" alt="Move Up" title="Move Up" />
-                    [% ELSE %]
-                        <img class="buttonUp"  src="[% themelang %]/../img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %]')" alt="Move Up" title="Move Up" />
-                        [% END %]
-                            <input title="[% subfield_loo.marc_lib_plain %]"
-                                style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;" type="text"
-                                name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]"
-                                value="[% subfield_loo.subfield %]"
-                                size="1"
-                                maxlength="1"
-                                class="flat"
-                                tabindex="0" />
+                        <img class="buttonUp" style="display:none;" src="/intranet-tmpl/prog/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]')" alt="Move Up" title="Move Up" />
                     [% ELSE %]
-                        <input type="hidden"
-                            name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]"
-                            value="[% subfield_loo.subfield %]"/>
+                        <img class="buttonUp" src="/intranet-tmpl/prog/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]')" alt="Move Up" title="Move Up" />
                     [% END %]
+                        <input type="text"
+                            title="[% subfield_loo.marc_lib_plain %]"
+                            style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;"
+                            name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]"
+                            value="[% subfield_loo.subfield %]"
+                            size="1"
+                            maxlength="1"
+                            class="flat"
+                            tabindex="0" />
+                </span>
+                [% ELSE %]
+                    <input type="hidden"
+                        name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]"
+                        value="[% subfield_loo.subfield %]" />
+                [% END %]
+
+                [% UNLESS advancedMARCEditor %]
+                    [% IF ( subfield_loo.mandatory ) %]<span class="subfield subfield_mandatory">[% ELSE %]<span class="subfield">[% END %]
+                        [% subfield_loo.marc_lib_plain %]
+                        [% IF ( subfield_loo.mandatory ) %]<span class="mandatory_marker" title="This field is mandatory">*</span>[% END %]
+                    </span>
+                    </label>
+                [% END %]
                 
-                    [% UNLESS ( subfield_loo.advancedMARCEditor ) %]
-                        [% IF ( subfield_loo.mandatory ) %]<span class="subfield_mandatory">[% END %]
-                            [% subfield_loo.marc_lib %]
-                        [% IF ( subfield_loo.mandatory ) %]</span>[% END %]
-                        </label>
-                    [% END %]
-                    
-                    [% subfield_loo.marc_value %]
-                    
-                    [% IF ( subfield_loo.repeatable ) %]
-                        <a href="#" onclick="CloneSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %]'); return false;"><img src="/intranet-tmpl/prog/img/clone-subfield.png" alt="Clone" title="Clone this subfield" /></a>
-                    [% END %]
-                    [% UNLESS ( subfield_loo.mandatory ) %]
-                        <a href="#" onclick="UnCloneField('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]'); return false;"><img src="/intranet-tmpl/prog/img/delete-subfield.png" alt="Delete" title="Delete this subfield" /></a>
-                    [% END %]
-                    
-                </div>
-                <!-- End of the line -->
+                [% subfield_loo.marc_value %]
+
+                <span class="subfield_controls">
+                [% IF ( subfield_loo.repeatable ) %]
+                    <a href="#" class="buttonPlus" tabindex="1" onclick="CloneSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]','[% advancedMARCEditor %]'); return false;">
+                        <img src="/intranet-tmpl/prog/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
+                    </a>
+                    <a href="#" class="buttonMinus" tabindex="1" onclick="UnCloneField('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]'); return false;">
+                        <img src="/intranet-tmpl/prog/img/delete-subfield.png" alt="Delete" title="Delete this subfield" />
+                    </a>
+                [% END %]
+                </span>
                 
-            [% END %]
             </div>
-            [% END %]<!-- tag -->
+            <!-- End of the line -->
         [% END %]
-        </div>
-[% END %]
 
-[% UNLESS ( singletab ) %]
-    </div>     
-[% END %]
-</div>
+    </div>
+    [% END %]<!-- if innerloo.tag -->
+    [% END %]<!-- BIG_LOO.innerloop -->
+    </div>
+[% END %]<!-- BIG_LOOP -->
+
+</div><!-- tabs -->
 
 <div name="hidden" id="hidden" class="tab">
 [% FOREACH hidden_loo IN hidden_loop %]
@@ -756,10 +384,14 @@ function searchauthority() {
     <input type="hidden" name="subfield" value="[% oldauthtypetagsubfield %]" />
     <input type="hidden" name="field_value" value="[% authtypecode %]" />
 [% END %]
+
 <fieldset class="action">
         <input type="button" id="addauth2" value="Save" onclick="Check(this.form)" accesskey="w" />
 </fieldset>
+
 </form>
+
+</div>
 </div>
 </div>
 
index 87a132f..4a3cb86 100644 (file)
@@ -31,7 +31,7 @@
             // Try to add as many clones as needed
             try {
                 for(var i=0; i<nb-subfields.length; i++) {
-                    window.opener.opener.CloneSubfield(subfields[0].getAttribute('id'));
+                    window.opener.opener.CloneSubfield(subfields[0].getAttribute('id'),'[% advancedMARCEditor %]');
                 }
             }
             catch(err) {
index e21f846..7a712c8 100644 (file)
@@ -1,3 +1,4 @@
+[% PROCESS 'authorities.inc' %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Authorities &rsaquo;
     [% IF ( unknownauthid ) %]
@@ -7,18 +8,33 @@
     [% END %]
 </title>
 [% INCLUDE 'doc-head-close.inc' %]
+[% IF ( displayhierarchy ) %]
+<script language="javascript" type="text/javascript" src="/intranet-tmpl/lib/jquery/plugins/jquery.jstree.js"></script>
+[% END %]
 <script type="text/javascript">
 
 //<![CDATA[
 
         $(document).ready(function() {
     $('#authoritiestabs').tabs();
+    [% IF ( displayhierarchy ) %]
+        var current_nodes = [];
+        $('.currentauth').each(function() {
+            current_nodes.push('#' + $(this).parent().parents('li:first').attr('id'));
+            });
+        $('#hierarchies').jstree({
+                "plugins": [ "themes", "html_data"],
+                "themes": { "theme": "classic",
+                            "icons": false },
+                "core": { "initially_open": current_nodes }
+            });
+    [% END %]
         });
 
 function confirm_deletion() {
        var is_confirmed = confirm('Are you sure you want to delete this authority?');
        if (is_confirmed) {
-               window.location="authorities-home.pl?op=delete&amp;authid=[% authid %]";
+               window.location="authorities-home.pl?op=delete&authid=[% authid %]";
        }
 }
 function Dopop(link) {
@@ -26,29 +42,7 @@ function Dopop(link) {
 }
 //]]>
 </script>
-[% IF ( displayhierarchy ) %]
-<link rel="stylesheet" type="text/css" href="[% themelang %]/css/hierarchy.css" />
 <script type="text/javascript">
-function showParents(mynumber) {
-  var parents=document.getElementsByName(mynumber+'p')
-  for(i=0;i<parents.length;i++){
-    if (parents[i].style.display == "none") {
-      parents[i].style.display ="block";
-    } else {
-      parents[i].style.display ="none";
-    }
-  } 
-}
-function showChildren(mynumber) {
-  var children=document.getElementsByName(mynumber+'c')
-  for(i=0;i<children.length;i++){
-    if (children[i].style.display == "none") {
-      children[i].style.display = "block";
-    } else {
-      children[i].style.display = "none";
-    }
-  }
-}
 function Help() {
     newin=window.open("/cgi-bin/koha/help.pl","KohaHelp",'width=600,height=600,toolbar=false,scrollbars=yes');
 }
@@ -63,7 +57,6 @@ function searchauthority() {
     window.location="/cgi-bin/koha/authorities/authorities-home.pl?op=do_search&type=intranet&authtypecode="+X+"&value="+Y+"&marclist=&and_or=and&excluding=&operator=contains";
 }
 </script>
- [% END %]
 </head>
 <body id="auth_detail" class="auth">
 [% INCLUDE 'header.inc' %]
@@ -85,33 +78,8 @@ function searchauthority() {
     [% INCLUDE 'authorities-toolbar.inc' %]
        
 [% IF ( displayhierarchy ) %]
-
-<div class="hierarchies">
-[% FOREACH loophierarchie IN loophierarchies %]
-  <div class="hierarchy">
-  [% FOREACH loopelemen IN loophierarchie.loopelement %]
-    <div id="[% loopelemen.loopauthid %]" class="[% loopelemen.class %]">
-    [% IF ( loopelemen.ifparents ) %]
-      [% FOREACH loopparent IN loopelemen.loopparents %]
-        <div name="[% loopparent.loopauthid %]p" class="parent"> <a href="detail.pl?authid=[% loopparent.parentauthid %]">[% loopparent.parentvalue %]</a></div>
-      [% END %]
-    [% END %]
-    [% IF ( loopelemen.current_value ) %]
-        [% loopelemen.value %]
-    [% ELSE %]
-        <a href="detail.pl?authid=[% loopelemen.loopauthid %]" title="Term">[% loopelemen.value %]</a>
-    [% END %]
-    [% IF ( loopelemen.ifchildren ) %]
-      <sub><a class="parents" title="Narrower terms" href="JavaScript:showChildren('[% loopelemen.loopauthid %]');">+</a></sub><br />
-      [% FOREACH loopchildre IN loopelemen.loopchildren %]
-        <div name="[% loopchildre.loopauthid %]c" class="child"> <a href="detail.pl?authid=[% loopchildre.childauthid %]">[% loopchildre.childvalue %]</a></div>
-      [% END %]
-    [% END %]
-    </div>
-  [% END %]
-    
-  </div>
-[% END %]
+<div id="hierarchies">
+[% PROCESS showhierarchy trees = loophierarchies %]
 </div>
 [% END %]
 
index c6035ef..445b541 100644 (file)
@@ -8,9 +8,18 @@ function confirm_deletion(id) {
     
     var is_confirmed = confirm('Are you sure you want to delete this authority?');
     if (is_confirmed) {
-      window.location="authorities-home.pl?op=delete&amp;authid="
-          + id
-          + "&amp;marclist=[% marclist %]&amp;and_or=[% and_or %]&amp;excluding=[% excluding %]&amp;operator=[%operator%]&amp;orderby=[% orderby %]&amp;value=[% value %]&amp;startfrom=[% startfrom %]&amp;resultsperpage=[% resultsperpage %]";
+      window.location="authorities-home.pl?op=delete"
+          + "&authid=" + id
+          + "&type=intranet"
+          + "&authtypecode=[% authtypecode %]"
+          + "&marclist=[% marclist %]"
+          + "&and_or=[% and_or %]"
+          + "&excluding=[% excluding %]"
+          + "&operator=[% operator %]"
+          + "&orderby=[% orderby %]"
+          + "&value=[% value |url %]"
+          + "&startfrom=[% startfrom %]"
+          + "&resultsperpage=[% resultsperpage %]";
     }
 }
 function Help() {
index 2fd8832..9989194 100644 (file)
        <script type="text/javascript">
        //<![CDATA[
 
-$(document).ready(function()
-    {
-        $("#itemst").tablesorter({
-                        headers: { 0: { sorter: false }}
-                });
-    }
-);
-
-
 function placeHold () {
     var checkedItems = $("input:checkbox:checked");
     if ($(checkedItems).size() == 0) {
@@ -72,9 +63,30 @@ function placeHold () {
            });
         $(".holdsep").text("| ");
         $(".hold").text(_("Place Hold"));
+        $("#downloadcartc").empty();
+        yuiToolbar();
+        $("#itemst").tablesorter({
+            headers: { 0: { sorter: false }}
+        });
        });
 
-
+function yuiToolbar() {
+    var downloadmenu = [
+    { text: _("iso2709"), url: "/cgi-bin/koha/basket/downloadcart.pl?format=iso2709&bib_list=[% bib_list %]" },
+    { text: _("RIS"), url: "/cgi-bin/koha/basket/downloadcart.pl?format=ris&bib_list=[% bib_list %]" },
+    { text: _("BibTex"), url: "/cgi-bin/koha/basket/downloadcart.pl?format=bibtex&bib_list=[% bib_list %]" },
+[% FOREACH csv_profile IN csv_profiles %]
+    { text: _("CSV - [% csv_profile.profile %]"), url: "/cgi-bin/koha/basket/downloadcart.pl?format=[% csv_profile.export_format_id %]&bib_list=[% bib_list %]" },
+[% END %]
+    ];
+    new YAHOO.widget.Button({
+        type: "menu",
+        label: _("Download"),
+        name: "downloadmenubutton",
+        menu: downloadmenu,
+        container: "downloadcartc"
+    });
+}
        //]]>
        </script>
        [% END %]
@@ -98,11 +110,9 @@ function placeHold () {
                <a class="send" href="basket.pl" onclick="sendBasket(); return false;">Send</a>
            </span></span>
        </li>
-       <li>
-           <span id="savemenuc" class="yui-button yui-link-button"><span class="first-child">
-               <a class="download" href="basket.pl" onclick="downloadBasket(); return false;">Download</a>
-           </span></span>
-       </li>
+    <li id="downloadcartc">
+        <a href="#" id="downloadcart">Download</a>
+    </li>
        <li>
            <span id="printmenuc" class="yui-button yui-link-button"><span class="first-child">
                <a class="print" href="basket.pl" onclick="printBasket(); return false;">Print</a>
index 22f7908..bf7ec07 100644 (file)
@@ -1,4 +1,5 @@
 [% INCLUDE 'doc-head-open.inc' %]
+[% INCLUDE 'greybox.inc' %]
 <title>Koha &rsaquo; Catalog &rsaquo;
   [% IF ( unknownbiblionumber ) %]
     Unknown record
@@ -115,6 +116,7 @@ function verify_images() {
                     [% END %]
                     </span>
         [% END %]
+        <span id="catalogue_detail_marc_preview" class="results_summary"><span class="label">MARC Preview:</span> <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Show</a></span>
         [% IF ( holdcount ) %]<span class="results_summary"><span class="label">Holds:</span> <span class="holdcount"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber %]">[% holdcount %]</a></span></span>[% ELSE %][% END %]
 
         [% IF ( AmazonCoverImages ) %]</div><div class="yui-u" id="bookcoverimg">
@@ -174,6 +176,10 @@ function verify_images() {
        <a href="http://[% OpacUrl %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]" target="_blank">Open in new window</a>
                </li>
        [% END %]
+        <li id="catalogue_detail_marc_preview">
+            <strong>MARC Preview:</strong>
+            <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Show</a>
+        </li>
         </ul>
         </div>
        
@@ -470,7 +476,11 @@ function verify_images() {
     [% FOREACH subscription IN subscriptions %]
            [% IF ( subscription.branchname ) %]<h3>At library: [% subscription.branchname %]</h3>[% ELSE %]
            [% IF ( subscription.branchcode ) %]<h3>At library: [% subscription.branchcode %]</h3>[% END %][% END %]
+            [% IF ( subscription.closed ) %]<p>This subscription is closed.</p>[% END %]
+            [% IF ( subscription.callnumber ) %]<p>Callnumber: [% subscription.callnumber %] </p>[% END %]
             [% IF ( subscription.subscriptionnotes ) %]<p>[% subscription.subscriptionnotes FILTER html_line_break %] </p>[% END %]
+            [% IF ( subscription.missinglist ) %]<p>Missing issues: [% subscription.missinglist %] </p>[% END %]
+            [% IF ( subscription.librariannote ) %]<p>([% subscription.librariannote %])</p>[% END %]
             [% IF ( subscription.latestserials ) %]
             <p> The [% subscription.staffdisplaycount %] latest issues related to this subscription:</p>
             <table>
@@ -484,20 +494,16 @@ function verify_images() {
                 <tr>
                     <td>[% latestserial.serialseq %]</td>
                     <td>[% latestserial.planneddate %]</td>
-                    <td>[% IF ( latestserial.status1 ) %]Expected
-                        [% ELSE %]
-                            [% IF ( latestserial.status2 ) %]Arrived
-                            [% ELSE %]
-                                [% IF ( latestserial.status3 ) %]Late
-                                [% ELSE %]
-                                    [% IF ( latestserial.status4 ) %]Missing
-                                    [% ELSE %]
-                                        [% IF ( latestserial.status5 ) %]Not issued
-                                        [% END %]
-                                    [% END %]
-                                [% END %]
-                            [% END %]
-                        [% END %]</td>
+                    <td>
+                      [% IF ( latestserial.status1 ) %]Expected[% END %]
+                      [% IF ( latestserial.status2 ) %]Arrived[% END %]
+                      [% IF ( latestserial.status3 ) %]Late[% END %]
+                      [% IF ( latestserial.status4 ) %]Missing[% END %]
+                      [% IF ( latestserial.status5 ) %]Not issued[% END %]
+                      [% IF ( latestserial.status6 ) %]Delete[% END %]
+                      [% IF ( latestserial.status7 ) %]Claimed[% END %]
+                      [% IF ( latestserial.status8 ) %]Stopped[% END %]
+                    </td>
                     <td>[% latestserial.notes %]</td>
                 </tr>
             [% END %]
index 932a50a..a15fae3 100644 (file)
@@ -5,4 +5,6 @@
 <body id="catalog_showmarc" class="catalog">
 <div id="main">
 <pre>[% MARC_FORMATTED %] </pre>
-[% INCLUDE 'intranet-bottom.inc' %]
+</div>
+</body>
+</html>
index f934fbe..7d54142 100644 (file)
@@ -3,30 +3,15 @@
 [% INCLUDE 'doc-head-close.inc' %]
 <script type="text/javascript" src="[% themelang %]/lib/yui/plugins/bubbling-min.js"></script>
 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
+<script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script>
 <script type="text/javascript">
 //<![CDATA[
 
-     var fields_in_use = {};
         $(document).ready(function() {
         $('#addbibliotabs').tabs().bind('show.ui-tabs', function(e, ui) {
                        $("#"+ui.panel.id+" input:eq(0)").focus();
                });
-        $('.tag').each(function() {
-            var field_id = this.getAttribute('id').substring(0, 7);
-            if (field_id in fields_in_use) {
-                fields_in_use[field_id]++;
-            } else {
-                fields_in_use[field_id] = 1;
-            }
-        });
-        $('.subfield_line').each(function() {
-            var field_id = this.getAttribute('id').substring(0, 12);
-            if (field_id in fields_in_use) {
-                fields_in_use[field_id]++;
-            } else {
-                fields_in_use[field_id] = 1;
-            }
-        });
+
                /* check cookie to hide/show marcdocs*/
                if($.cookie("marcdocs_[% borrowernumber %]") == 'false'){
                        hideMARCdocLinks();
@@ -48,21 +33,6 @@ function confirmnotdup(redirect){
        Check();
 }
 
-/**
- * 
- * 
- */
-function Check(){
-    var StrAlert = AreMandatoriesNotOk();
-    if( ! StrAlert ){
-        document.f.submit();
-        return true;
-    } else {
-        alert(StrAlert);
-        return false;
-    }
-}
-
 function Dopop(link,i) {
     defaultvalue = document.getElementById(i).value;
     window.open(link+"&result="+defaultvalue,"valuebuilder",'width=700,height=550,toolbar=false,scrollbars=yes');
@@ -235,6 +205,21 @@ function AreMandatoriesNotOk(){
        }
 }
 
+/**
+ *
+ *
+ */
+function Check(){
+    var StrAlert = AreMandatoriesNotOk();
+    if( ! StrAlert ){
+        document.f.submit();
+        return true;
+    } else {
+        alert(StrAlert);
+        return false;
+    }
+}
+
 /** 
  * check if z3950 mandatories are set or not
  */
@@ -260,381 +245,6 @@ function Changefwk(FwkList) {
     f.submit();
 }
 
-// returns the subfieldcode based upon subfieldid writing
-function getSubfieldcode(tagsubfieldid){
-    // 3 : tag +3 : tagnumber +4 : number of _ +8 subfield -1 begins at 0  
-    return tagsubfieldid.substr(3+3+4+8-1,1);
-}
-
-// Take the base of tagsubfield information (removing the subfieldcodes and subfieldindexes)
-// returns the filter
-function getTagInputnameFilter(tagsubfieldid){
-    var tagsubfield=tagsubfieldid.substr(0,tagsubfieldid.lastIndexOf("_"));  
-    var tagcode=tagsubfield.substr(tagsubfield.lastIndexOf("_"));
-    tagsubfield=tagsubfield.substr(0,tagsubfield.lastIndexOf("_"));
-    tagsubfield=tagsubfield.substr(0,tagsubfield.lastIndexOf("_"));
-    tagsubfield=tagsubfield+"_."+tagcode;
-    return tagsubfield;  
-}
-
-function openAuth(tagsubfieldid,authtype) {
-    // let's take the base of tagsubfield information (removing the indexes and the codes
-    var element=document.getElementById(tagsubfieldid);
-    var tagsubfield=getTagInputnameFilter(tagsubfieldid);
-    var elementsubfcode=getSubfieldcode(element.name);
-    var mainmainstring=element.value;
-    var mainstring="";  
-    var inputs = element.parentNode.parentNode.getElementsByTagName("input");
-
-    for (var myindex =0; myindex<inputs.length;myindex++){
-        if (inputs[myindex].name && inputs[myindex].name.match(tagsubfield)){
-            var subfieldcode=getSubfieldcode(inputs[myindex].name);
-            if (isNaN(parseInt(subfieldcode)) && inputs[myindex].value != "" && subfieldcode!=elementsubfcode){
-                mainstring=inputs[myindex].value+" "+mainstring;
-            }      
-        }
-    }           
-       newin=window.open("../authorities/auth_finder.pl?authtypecode="+  authtype+ "&index="+tagsubfieldid+"&value_mainstr="+encodeURI(mainmainstring)+"&value_main="+encodeURI(mainstring), "_blank",'width=700,height=550,toolbar=false,scrollbars=yes');
-}
-
-
-function ExpandField(index) {
-    var original = document.getElementById(index); //original <div>
-    var divs = original.getElementsByTagName('div');
-    for(var i=0,divslen = divs.length ; i<divslen ; i++){      // foreach div
-        if(divs[i].getAttribute('id').match(/^subfield/)){  // if it s a subfield
-            if (divs[i].style.display == 'block') {
-                divs[i].style.display = 'none';
-            } else {
-                divs[i].style.display = 'block';
-            }
-        }
-    }
-}
-
-/**
- * To clone a field or a subfield by clicking on '+' button
- */ 
-function CloneField(index) {
-    var original = document.getElementById(index); //original <div>
-    fields_in_use[index.substr(0, 7)]++;
-    var clone = original.cloneNode(true);
-    var new_key = CreateKey();
-    var new_id  = original.getAttribute('id')+new_key;
-    
-    clone.setAttribute('id',new_id); // setting a new id for the parent div
-    
-    var divs = clone.getElementsByTagName('div');
-    
-    [% UNLESS ( hide_marc ) %] // No indicator if hide_marc
-        // setting a new name for the new indicator
-        for(var i=0; i < 2; i++) {
-            var indicator = clone.getElementsByTagName('input')[i];
-            indicator.setAttribute('name',indicator.getAttribute('name')+new_key);
-        }
-    [% END %]
-        
-    // settings all subfields
-    for(var i=0,divslen = divs.length ; i<divslen ; i++){      // foreach div
-        if(divs[i].getAttribute("id").match(/^subfield/)){  // if it s a subfield
-            
-            // set the attribute for the new 'div' subfields
-            divs[i].setAttribute('id',divs[i].getAttribute('id')+new_key);
-            
-            var inputs   = divs[i].getElementsByTagName('input');
-            var id_input = "";
-            
-            for( j = 0 ; j < inputs.length ; j++ ) {
-               if(inputs[j].getAttribute("id") && inputs[j].getAttribute("id").match(/^tag_/) ){
-                       inputs[j].value = "";
-               }
-            }
-            
-            inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key);
-            inputs[0].setAttribute('name',inputs[0].getAttribute('name')+new_key);
-            var id_input;
-            try {
-               id_input = inputs[1].getAttribute('id')+new_key;
-                inputs[1].setAttribute('id',id_input);
-                inputs[1].setAttribute('name',inputs[1].getAttribute('name')+new_key);
-            } catch(e) {
-               try{ // it s a select if it is not an input
-                    var selects = divs[i].getElementsByTagName('select');
-                    id_input = selects[0].getAttribute('id')+new_key;
-                    selects[0].setAttribute('id',id_input);
-                    selects[0].setAttribute('name',selects[0].getAttribute('name')+new_key);
-                }catch(e2){ // it is a textarea if it s not a select or an input
-                       var textaeras = divs[i].getElementsByTagName('textarea');
-                       id_input = textaeras[0].getAttribute('id')+new_key;
-                       textaeras[0].setAttribute('id',id_input);
-                    textaeras[0].setAttribute('name',textaeras[0].getAttribute('name')+new_key);
-                }
-            }
-            
-            [% UNLESS ( advancedMARCEditor ) %]
-            // when cloning a subfield, re set its label too.
-            var labels = divs[i].getElementsByTagName('label');
-            labels[0].setAttribute('for',id_input);
-            [% END %]
-            
-            [% UNLESS ( hide_marc ) %]
-                // updating javascript parameters on button up
-                var imgs = divs[i].getElementsByTagName('img');
-                imgs[0].setAttribute('onclick',"upSubfield(\'"+divs[i].getAttribute('id')+"\');");
-            [% END %]
-            
-            // setting its '+' and '-' buttons
-            try {
-                var anchors = divs[i].getElementsByTagName('a');
-                for (var j = 0; j < anchors.length; j++) {
-                    if(anchors[j].getAttribute('class') == 'buttonPlus'){
-                        anchors[j].setAttribute('onclick',"CloneSubfield('" + divs[i].getAttribute('id') + "')");
-                    } else if (anchors[j].getAttribute('class') == 'buttonMinus') {
-                        anchors[j].setAttribute('onclick',"UnCloneField('" + divs[i].getAttribute('id') + "')");
-                    }
-                }
-            }
-            catch(e){
-                // do nothig if ButtonPlus & CloneButtonPlus don t exist.
-            }
-            
-            // button ...
-            var spans=0;
-            try {
-                spans = divs[i].getElementsByTagName('a');
-            } catch(e) {
-                // no spans
-            }
-            if(spans){
-                var buttonDot;
-                if(!CloneButtonPlus){ // it s impossible to have  + ... (buttonDot AND buttonPlus)
-                    buttonDot = spans[0];
-                    if(buttonDot){
-                        // 2 possibilities :
-                        try{
-                            var buttonDotOnClick = buttonDot.getAttribute('onclick');
-                            if(buttonDotOnClick.match('Clictag')){   // -1- It s a plugin
-                                var re = /\('.*'\)/i;
-                                buttonDotOnClick = buttonDotOnClick.replace(re,"('"+inputs[1].getAttribute('id')+"')");
-                                if(buttonDotOnClick){
-                                    buttonDot.setAttribute('onclick',buttonDotOnClick);
-                                }
-                            } else {
-                                if(buttonDotOnClick.match('Dopop')) {  // -2- It's a auth value
-                                    var re1 = /&index=.*',/;
-                                    var re2 = /,.*\)/;
-
-                                    buttonDotOnClick = buttonDotOnClick.replace(re1,"&index="+inputs[1].getAttribute('id')+"',");
-                                    buttonDotOnClick = buttonDotOnClick.replace(re2,",'"+inputs[1].getAttribute('id')+"')");
-                                    
-                                    if(buttonDotOnClick){
-                                            buttonDot.setAttribute('onclick',buttonDotOnClick);
-                                    }
-                                }
-                            }
-                            try {
-                               // do not copy the script section.
-                               var script = spans[0].getElementsByTagName('script')[0];
-                               spans[0].removeChild(script);
-                            } catch(e) {
-                               // do nothing if there is no script
-                            }
-                       }catch(e){}
-                       }
-                }
-            }
-            [% UNLESS ( hide_marc ) %]
-                var buttonUp = divs[i].getElementsByTagName('img')[0];
-                buttonUp.setAttribute('onclick',"upSubfield('" + divs[i].getAttribute('id') + "')");
-            [% END %]
-            
-        } else { // it's a indicator div
-            if(divs[i].getAttribute('id').match(/^div_indicator/)){
-                var inputs = divs[i].getElementsByTagName('input');
-                inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key);
-                inputs[1].setAttribute('id',inputs[1].getAttribute('id')+new_key);
-                
-                var CloneButtonPlus;
-                try {
-                    var anchors = divs[i].getElementsByTagName('a');
-                    for (var j = 0; j < anchors.length; j++) {
-                        if (anchors[j].getAttribute('class') == 'buttonPlus') {
-                            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.
-                }
-
-            }
-        }
-    }
-    
-    // insert this line on the page
-    original.parentNode.insertBefore(clone,original.nextSibling);
-}
-
-function CloneSubfield(index){
-    var original = document.getElementById(index); //original <div>
-    fields_in_use[index.substr(0, 12)]++;
-    var clone = original.cloneNode(true);
-    var new_key = CreateKey();
-    var new_id  = original.getAttribute('id')+new_key;
-    // set the attribute for the new 'div' subfields
-    var inputs     = clone.getElementsByTagName('input');
-    var selects    = clone.getElementsByTagName('select');
-    var textareas  = clone.getElementsByTagName('textarea');
-    var linkid;
-
-    // input
-    var id_input = "";
-    for(var i=0,len=inputs.length; i<len ; i++ ){
-        id_input = inputs[i].getAttribute('id')+new_key;
-        inputs[i].setAttribute('id',id_input);
-        inputs[i].setAttribute('name',inputs[i].getAttribute('name')+new_key);
-       linkid = id_input;
-    }
-    
-    // select 
-    for(var i=0,len=selects.length; i<len ; i++ ){
-        id_input = selects[i].getAttribute('id')+new_key;
-        selects[i].setAttribute('id',selects[i].getAttribute('id')+new_key);
-        selects[i].setAttribute('name',selects[i].getAttribute('name')+new_key);
-    }
-    
-    // textarea
-    for(var i=0,len=textareas.length; i<len ; i++ ){
-        id_input = textareas[i].getAttribute('id')+new_key;
-        textareas[i].setAttribute('id',textareas[i].getAttribute('id')+new_key);
-        textareas[i].setAttribute('name',textareas[i].getAttribute('name')+new_key);
-    }
-
-    // Changing the "..." link's onclick attribute for plugin callback
-    var links  = clone.getElementsByTagName('a');
-    var link = links[0];
-    var buttonDotOnClick = link.getAttribute('onclick');
-    if(buttonDotOnClick.match('Clictag')){   // -1- It s a plugin
-       var re = /\('.*'\)/i;
-        buttonDotOnClick = buttonDotOnClick.replace(re,"('"+linkid+"')");
-        if(buttonDotOnClick){
-           link.setAttribute('onclick',buttonDotOnClick);
-        }
-    }
-
-
-    [% UNLESS ( advancedMARCEditor ) %]
-    // when cloning a subfield, reset its label too.
-    var label = clone.getElementsByTagName('label')[0];
-    label.setAttribute('for',id_input);
-    [% END %]
-    
-    // setting a new id for the parent div
-    clone.setAttribute('id',new_id);
-    
-    try {
-        var buttonUp = clone.getElementsByTagName('img')[0];
-        buttonUp.setAttribute('onclick',"upSubfield('" + new_id + "')");
-        var anchors = clone.getElementsByTagName('a');
-        if(anchors.length){
-            for(var i = 0 ,lenanchors = anchors.length ; i < lenanchors ; i++){
-                if(anchors[i].getAttribute('class') == 'buttonPlus'){
-                    anchors[i].setAttribute('onclick',"CloneSubfield('" + new_id + "')");
-                } else if (anchors[i].getAttribute('class') == 'buttonMinus') {
-                    anchors[i].setAttribute('onclick',"UnCloneField('" + new_id + "')");
-                }
-            }
-        }
-    }
-    catch(e){
-        // do nothig if ButtonPlus & CloneButtonPlus don't exist.
-    }
-    // insert this line on the page
-    original.parentNode.insertBefore(clone,original.nextSibling);
-}
-
- /**
- * This function removes or clears unwanted subfields
- */
-function UnCloneField(index) {
-    var original = document.getElementById(index);
-    var field_id;
-    if (index.match("tag")) {
-        field_id = index.substr(0, 7);
-    } else {
-        field_id = index.substr(0, 12);
-    }
-    if (1 == fields_in_use[field_id]) {
-        // clear inputs, but don't delete
-        $(":input.input_marceditor", original).each(function(){
-            // thanks to http://www.learningjquery.com/2007/08/clearing-form-data for
-            // hint about clearing selects correctly
-            var type = this.type;
-            var tag = this.tagName.toLowerCase();
-            if (type == 'text' || type == 'password' || tag == 'textarea') {
-                this.value = "";
-            } else if (type == 'checkbox' || type == 'radio') {
-                this.checked = false;
-            } else if (tag == 'select') {
-                this.selectedIndex = -1;
-            }
-        });
-        $(":input.indicator", original).val("");
-    } else {
-        original.parentNode.removeChild(original);
-        fields_in_use[field_id]--;
-    }
-}
-
-/**
- * This function create a random number
- */
-function CreateKey(){
-    return parseInt(Math.random() * 100000);
-}
-
-/**
- * This function allows to move a subfield up by clickink on the 'up' button .
- */
-function upSubfield(index) {
-    try{
-        var line = document.getElementById(index); // get the line where the user has clicked.
-    } catch(e) {
-        return; // this line doesn't exist...
-    }
-    var tag = line.parentNode; // get the dad of this line. (should be "<div id='tag_...'>")
-    
-    // getting all subfields for this tag
-    var subfields = tag.getElementsByTagName('div');
-    var subfieldsLength = subfields.length;
-    
-    if(subfieldsLength<=1) return; // nothing to do if there is just one subfield.
-    
-    // among all subfields 
-    for(var i=0;i<subfieldsLength;i++){ 
-        if(subfields[i].getAttribute('id') == index){ //looking for the subfield which is clicked :
-            if(i==1){ // if the clicked subfield is on the top
-                tag.appendChild(subfields[1]);
-                return;
-            } else {
-                var lineAbove = subfields[i-1];
-                tag.insertBefore(line,lineAbove);
-                return;
-            }
-        }
-    }
-}
-
-function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
-    subfield = document.getElementById(index);
-    subfield.style.display = 'block';
-    label = document.getElementById(labelindex);
-    label.style.display='none';        
-}
 //]]>
 </script>
 <link type="text/css" rel="stylesheet" href="[% themelang %]/css/addbiblio.css" />
@@ -657,6 +267,7 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
 //]]>
 </script>
 [% INCLUDE 'header.inc' %]
+
 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a>  &rsaquo; [% IF ( biblionumber ) %]Editing <em>[% title |html %]</em> (Record number [% biblionumber %])[% ELSE %]Add MARC record[% END %]</div>
 
 <div id="doc" class="yui-t7">
@@ -767,7 +378,7 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
             type: "button",
             label: _("Z39.50 Search"),
             container: "z3950searchc",
-                       onclick: {fn:function(){PopupZ3950()}}
+            onclick: {fn:function(){if (confirm(_("Please note that this Z39.50 search could replace the current record."))) PopupZ3950()}}
         });
        }
 
@@ -802,83 +413,129 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
         <input type="hidden" name="breedingid" value="[% breedingid %]" />
 
 <div id="addbibliotabs" class="toptabs numbered">
-       <ul>[% FOREACH BIG_LOO IN BIG_LOOP %]
-          <li>  [% IF ( BIG_LOO.number ) %]
-                <a href="#tab[% BIG_LOO.number %]XX">[% BIG_LOO.number %]</a>
-            [% ELSE %]
-                <a href="#tab[% BIG_LOO.number %]XX">[% BIG_LOO.number %]</a>
-            [% END %]</li>
-        [% END %]</ul>
+    <ul>
+        [% FOREACH BIG_LOO IN BIG_LOOP %]
+        <li><a href="#tab[% BIG_LOO.number %]XX">[% BIG_LOO.number %]</a></li>
+        [% END %]
+    </ul>
 
 [% FOREACH BIG_LOO IN BIG_LOOP %]
-<!-- hide every tab except the 1st -->
-[% IF ( BIG_LOO.number ) %]
-    <div id="tab[% BIG_LOO.number %]XX">
-[% ELSE %]
     <div id="tab[% BIG_LOO.number %]XX">
-[% END %]
-
     
     [% FOREACH innerloo IN BIG_LOO.innerloop %]
-        [% IF ( innerloo.tag ) %]
-       <div class="tag" id="tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]">
+    [% IF ( innerloo.tag ) %]
+    <div class="tag" id="tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]">
         <div class="tag_title" id="div_indicator_tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]">
-            [% UNLESS hide_marc %]
-               [% IF advancedMARCEditor %]
-               <a href="#" tabindex="1" class="tagnum" title="[% innerloo.tag_lib %] - Click to Expand this Tag" onclick="ExpandField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;">[% innerloo.tag %]</a>
-               [% ELSE %]
-                 <span class="tagnum" title="[% innerloo.tag_lib %]">[% innerloo.tag %]
-                 [% IF marcflavour != 'NORMARC' %]<a class="marcdocs" onclick="PopupMARCFieldDoc('[% innerloo.tag %]', [% BIG_LOO.number %]); return false;">&nbsp;?</a>[% END %]
-                 </span>
-               [% END %]
+        [% UNLESS hide_marc %]
+            [% IF advancedMARCEditor %]
+                <a href="#" tabindex="1" class="tagnum" title="[% innerloo.tag_lib %] - Click to Expand this Tag" onclick="ExpandField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;">[% innerloo.tag %]</a>
+            [% ELSE %]
+                <span class="tagnum" title="[% innerloo.tag_lib %]">[% innerloo.tag %]
+                [% IF marcflavour != 'NORMARC' %]<a class="marcdocs" onclick="PopupMARCFieldDoc('[% innerloo.tag %]', [% BIG_LOO.number %]); return false;">&nbsp;?</a>[% END %]
+                </span>
+            [% END %]
                 [% IF ( innerloo.fixedfield ) %]
-                       <input tabindex="1" class="indicator flat" type="text" style="display:none;" name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]" size="1" maxlength="1" value="[% innerloo.indicator1 %]" />
-                       <input tabindex="1" class="indicator flat" type="text" style="display:none;" name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]" size="1" maxlength="1" value="[% innerloo.indicator2 %]" />
+                    <input type="text"
+                        tabindex="1"
+                        class="indicator flat"
+                        style="display:none;"
+                        name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
+                        size="1"
+                        maxlength="1"
+                        value="[% innerloo.indicator1 %]" />
+                    <input type="text"
+                        tabindex="1"
+                        class="indicator flat"
+                        style="display:none;"
+                        name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
+                        size="1"
+                        maxlength="1"
+                        value="[% innerloo.indicator2 %]" />
                 [% ELSE %]
-                       <input tabindex="1" class="indicator flat" type="text" name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]" size="1" maxlength="1" value="[% innerloo.indicator1 %]" />
-                       <input tabindex="1" class="indicator flat" type="text" name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]" size="1" maxlength="1" value="[% innerloo.indicator2 %]" />
+                    <input type="text"
+                        tabindex="1"
+                        class="indicator flat"
+                        name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
+                        size="1"
+                        maxlength="1"
+                        value="[% innerloo.indicator1 %]" />
+                    <input type="text"
+                        tabindex="1"
+                        class="indicator flat"
+                        name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
+                        size="1"
+                        maxlength="1"
+                        value="[% innerloo.indicator2 %]" />
                 [% END %] -
-            [% ELSE %]
+        [% ELSE %]
                 [% IF ( innerloo.fixedfield ) %]
-                    <input tabindex="1" type="hidden" name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]" value="[% innerloo.indicator1 %]" />
-                    <input tabindex="1" type="hidden" name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]" value="[% innerloo.indicator2 %]" />
+                    <input type="hidden"
+                        tabindex="1"
+                        name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
+                        value="[% innerloo.indicator1 %]" />
+                    <input type="hidden"
+                        tabindex="1"
+                        name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
+                        value="[% innerloo.indicator2 %]" />
                 [% ELSE %]
-                    <input tabindex="1" type="hidden" name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]" value="[% innerloo.indicator1 %]" />
-                    <input tabindex="1" type="hidden" name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]" value="[% innerloo.indicator2 %]" />
+                    <input type="hidden"
+                        tabindex="1"
+                        name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
+                        value="[% innerloo.indicator1 %]" />
+                    <input type="hidden"
+                        tabindex="1"
+                        name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
+                        value="[% innerloo.indicator2 %]" />
                 [% END %]
-            [% END %]
+        [% END %]
 
             [% UNLESS advancedMARCEditor %]
-                   <a href="#" tabindex="1" class="expandfield" onclick="ExpandField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;" title="Click to Expand this Tag">[% innerloo.tag_lib %]</a>
-            [% END %]
-            [% IF ( innerloo.repeatable ) %]
-                <span class="subfield_controls"><a href="#" tabindex="1" class="buttonPlus" onclick="CloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;" title="Repeat this Tag"><img src="/intranet-tmpl/prog/img/repeat-tag.png" alt="Repeat this Tag" /></a>
+                <a href="#" tabindex="1" class="expandfield" onclick="ExpandField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;" title="Click to Expand this Tag">[% innerloo.tag_lib %]</a>
             [% END %]
-                <a href="#" tabindex="1" class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;" title="Delete this Tag"><img src="/intranet-tmpl/prog/img/delete-tag.png" alt="Delete this Tag" /></a></span>
+                <span class="field_controls">
+                [% IF ( innerloo.repeatable ) %]
+                    <a href="#" tabindex="1" class="buttonPlus" onclick="CloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]','[% hide_marc %]','[% advancedMARCEditor %]'); return false;" title="Repeat this Tag">
+                        <img src="/intranet-tmpl/prog/img/repeat-tag.png" alt="Repeat this Tag" />
+                    </a>
+                [% END %]
+                    <a href="#" tabindex="1" class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;" title="Delete this Tag">
+                        <img src="/intranet-tmpl/prog/img/delete-tag.png" alt="Delete this Tag" />
+                    </a>
+                </span>
 
-            
         </div>
-       
+
         [% FOREACH subfield_loo IN innerloo.subfield_loop %]
             <!--  One line on the marc editor -->
-            <div class="subfield_line" style="[% subfield_loo.visibility %]; float: left; clear: left; width: 100%;" id="subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]">
+            <div class="subfield_line" style="[% subfield_loo.visibility %]" id="subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]">
             
                 [% UNLESS advancedMARCEditor %]
                     [% IF ( subfield_loo.fixedfield ) %]<label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" style="display:none;" class="labelsubfield">
-                    [% ELSE %]<label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" class="labelsubfield">[% END %]
-                [% END %] 
+                    [% ELSE %]<label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" class="labelsubfield">
+                    [% END %]
+                [% END %]
                 
                 [% UNLESS hide_marc %]
-                <span class="subfieldcode">[% IF ( subfield_loo.fixedfield ) %] 
-                        <img class="buttonUp" style="display:none;" src="[% themelang %]/../img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]')" alt="Move Up" title="Move Up" />
+                <span class="subfieldcode">
+                    [% IF ( subfield_loo.fixedfield ) %]
+                        <img class="buttonUp" style="display:none;" src="/intranet-tmpl/prog/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]')" alt="Move Up" title="Move Up" />
                     [% ELSE %]
-                        <img class="buttonUp" src="[% themelang %]/../img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]')" alt="Move Up" title="Move Up" />
+                        <img class="buttonUp" src="/intranet-tmpl/prog/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]')" alt="Move Up" title="Move Up" />
                     [% END %]
-                        <input title="[% subfield_loo.marc_lib_plain %]" style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;" type="text" tabindex="0" name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" value="[% subfield_loo.subfield %]" size="1" maxlength="1" class="flat" />
- </span>
+                        <input type="text"
+                            title="[% subfield_loo.marc_lib_plain %]"
+                            style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;"
+                            name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]"
+                            value="[% subfield_loo.subfield %]"
+                            size="1"
+                            maxlength="1"
+                            class="flat"
+                            tabindex="0" />
+                </span>
                 [% ELSE %]
-                    <input type="hidden" name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" value="[% subfield_loo.subfield %]" />
- </span>
+                    <input type="hidden"
+                        name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]"
+                        value="[% subfield_loo.subfield %]" />
                 [% END %]
             
                 [% UNLESS advancedMARCEditor %]
@@ -891,22 +548,29 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
                 
                 [% subfield_loo.marc_value %]
                 
+                <span class="subfield_controls">
                 [% IF ( subfield_loo.repeatable ) %]
-                    <span class="subfield_controls"><a href="#" class="buttonPlus" tabindex="1" onclick="CloneSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]'); return false;"><img src="/intranet-tmpl/prog/img/clone-subfield.png" alt="Clone" title="Clone this subfield" /></a>
-                                        <a href="#" class="buttonMinus" tabindex="1" onclick="UnCloneField('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]'); return false;"><img src="/intranet-tmpl/prog/img/delete-subfield.png" alt="Delete" title="Delete this subfield" /></a></span>
+                    <a href="#" class="buttonPlus" tabindex="1" onclick="CloneSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]','[% advancedMARCEditor %]'); return false;">
+                        <img src="/intranet-tmpl/prog/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
+                    </a>
+                    <a href="#" class="buttonMinus" tabindex="1" onclick="UnCloneField('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]'); return false;">
+                        <img src="/intranet-tmpl/prog/img/delete-subfield.png" alt="Delete" title="Delete this subfield" />
+                    </a>
                 [% END %]
-
+                </span>
                 
             </div>
             <!-- End of the line -->
-            
         [% END %]
-        </div>
-        [% END %]<!-- tag -->
-    [% END %]
+
     </div>
-[% END %]
-</div>
+    [% END %]<!-- if innerloo.tag -->
+    [% END %]<!-- BIG_LOO.innerloop -->
+    </div>
+[% END %]<!-- BIG_LOOP -->
+
+</div><!-- tabs -->
+
 <!-- Fields for fast add cataloguing -->
 <input type="hidden" name="barcode" value="[% barcode %]" />
 <input type="hidden" name="branch" value="[% branch %]" />
@@ -914,6 +578,7 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
 <input type="hidden" name="stickyduedate" value="[% stickyduedate %]" />
 <input type="hidden" name="duedatespec" value="[% duedatespec %]" />
 <!-- /End of fast add fields -->
+
 </form>
 
 </div>
index 05750b2..0222046 100644 (file)
@@ -1,6 +1,7 @@
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Cataloging &rsaquo; [% title |html %] [% IF ( author ) %] by [% author %][% END %] (Record #[% biblionumber %]) &rsaquo; Items</title>
 [% INCLUDE 'doc-head-close.inc' %]
+<script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script>
 <script type="text/javascript">
 //<![CDATA[
 $(document).ready(function(){
@@ -84,82 +85,10 @@ function confirm_deletion(biblionumber,itemnumber) {
     }
 }
 
-function CloneSubfield(index){
-    var original = document.getElementById(index); //original <div>
-    var clone = original.cloneNode(true);
-    var new_key = CreateKey();
-    var old_id =  original.getAttribute('id');
-    old_id=old_id.substr(12);
-    var new_id  = old_id+new_key;
-
-    // set the attribute for the new 'div' subfields
-    var inputs     = clone.getElementsByTagName('input');
-    var selects    = clone.getElementsByTagName('select');
-    var textareas  = clone.getElementsByTagName('textarea');
-
-    // input
-    var id_input = "";
-    for(var i=0,len=inputs.length; i<len ; i++ ){
-        id_input = inputs[i].getAttribute('id')+new_key;
-        inputs[i].setAttribute('id',id_input);
-        inputs[i].setAttribute('name',inputs[i].getAttribute('name'));
-    }
-
-    // select
-    for(var i=0,len=selects.length; i<len ; i++ ){
-        id_input = selects[i].getAttribute('id')+new_key;
-        selects[i].setAttribute('id',selects[i].getAttribute('id')+new_key);
-        selects[i].setAttribute('name',selects[i].getAttribute('name'));
-    }
-
-    // textarea
-    for(var i=0,len=textareas.length; i<len ; i++ ){
-        id_input = textareas[i].getAttribute('id')+new_key;
-        textareas[i].setAttribute('id',textareas[i].getAttribute('id')+new_key);
-        textareas[i].setAttribute('name',textareas[i].getAttribute('name'));
-    }
-
-    [% UNLESS ( advancedMARCEditor ) %]
-    // when cloning a subfield, reset its label too.
-    var label = clone.getElementsByTagName('label')[0];
-    label.setAttribute('for',id_input);
-    [% END %]
-
-    // setting a new if for the parent div
-    clone.setAttribute('id',new_id);
-
-    var CloneButtonPlus;
-    try {
-      var spans = clone.getElementsByTagName('span');
-      if(spans.length){
-          for(var i = 0 ,lenspans = spans.length ; i < lenspans ; i++){
-            if(spans[i].getAttribute('class') == 'buttonPlus'){
-                    CloneButtonPlus = spans[i];
-                    CloneButtonPlus.setAttribute('onclick',"CloneSubfield('" + new_id + "')");
-                    var buttonUp = clone.getElementsByTagName('img')[0];
-                    buttonUp.setAttribute('onclick',"upSubfield('" + new_id + "')");
-                }
-            }
-        }
-    }
-    catch(e){
-        // do nothing if ButtonPlus & CloneButtonPlus don't exist.
-    }
-    // insert this line on the page
-    original.parentNode.insertBefore(clone,original.nextSibling);
-}
-
-/**
- * This function creates a random number
- */
-function CreateKey(){
-    return parseInt(Math.random() * 100000);
-}
-
 $(document).ready(function() {
     $("#cataloguing_additem_itemlist  tr").hover(
-        function () {$(this).attr("class","highlight");},
-        function () {$(this).attr("class",""         );}
+        function () {$(this).addClass("highlight");},
+        function () {$(this).removeClass("highlight");}
     );
 });
 //]]>
@@ -202,7 +131,11 @@ $(document).ready(function() {
                 [% END %]
             </tr>
                 [% FOREACH item_loo IN item_loop %]
+                [% IF ( item_loo.itemnumber == itemnumber) %]
+                <tr id="row[% item_loo.itemnumber %]" class="active">
+                [% ELSE %]
                 <tr id="row[% item_loo.itemnumber %]">
+                [% END %]
                     [% IF ( item_loo.nomod ) %] <td colspan="2">&nbsp;</td>[% ELSE %][% IF ( item_loo.hostitemflag ) %]<td><a href="additem.pl?op=edititem&amp;biblionumber=[% item_loo.hostbiblionumber %]&amp;itemnumber=[% item_loo.itemnumber %]#edititem">Edit in host</a></td>
 <td><a class="delete" href="/cgi-bin/koha/cataloguing/additem.pl?op=delinkitem&amp;biblionumber=[% biblionumber %]&amp;hostitemnumber=[% item_loo.itemnumber %]">Delink</a></td>
 [% ELSE %]<td><a href="additem.pl?op=edititem&amp;biblionumber=[% biblionumber %]&amp;itemnumber=[% item_loo.itemnumber %]#edititem">Edit</a></td>
@@ -247,7 +180,9 @@ $(document).ready(function() {
                 <input type="hidden" name="subfield"  value="[% ite.subfield %]" />
                 <input type="hidden" name="mandatory" value="[% ite.mandatory %]" />
                 [% IF ( ite.repeatable ) %]
-                    <span class="buttonPlus" onclick="CloneSubfield('subfield[% ite.tag %][% ite.subfield %][% ite.random %]')">+</span>
+                    <a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode); return false;">
+                        <img src="/intranet-tmpl/prog/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
+                    </a>
                 [% END %]
                 [% IF ( ite.mandatory ) %] <span class="required">Required</span>[% END %]
             </div></li>
@@ -266,8 +201,8 @@ $(document).ready(function() {
     -->
 
     <input type="submit" name="add_submit" value="Add item" onclick="return Check(this.form)" />
-    <input type="submit" name="add_duplicate_submit" value="Add &amp; Duplicate" onclick="return Check(this.form)" />
-    <input type="submit" name="add_multiple_copies" value="Add Multiple Copies" onclick="javascript:this.nextSibling.style.visibility='visible';document.f.number_of_copies.focus(); return false;" /><span id="add_multiple_copies_span" style="visibility:hidden">
+    <input type="submit" name="add_duplicate_submit" value="Add &amp; duplicate" onclick="return Check(this.form)" />
+    <input type="submit" name="add_multiple_copies" value="Add multiple copies" onclick="javascript:this.nextSibling.style.visibility='visible';document.f.number_of_copies.focus(); return false;" /><span id="add_multiple_copies_span" style="visibility:hidden">
        <label for="number_of_copies">Number of copies to add : </label>
        <input type="text" id="number_of_copies" name="number_of_copies" value="" size="2" />
        <input type="submit" id="add_multiple_copies_submit" name="add_multiple_copies_submit" value="Add" onclick="javascript:return Check(this.form) &amp;&amp; CheckMultipleAdd(this.form.number_of_copies.value);" />
@@ -277,7 +212,7 @@ $(document).ready(function() {
     <input type="hidden" name="tag" value="[% itemtagfield %]" />
     <input type="hidden" name="subfield" value="[% itemtagsubfield %]" />
     <input type="hidden" name="field_value" value="[% itemnumber %]" />
-    <input type="submit" value="Save Changes" onclick="return Check(this.form)" />
+    <input type="submit" value="Save changes" onclick="return Check(this.form)" />
     [% END %]</fieldset>
     
     <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
index 911c2f0..a448534 100644 (file)
@@ -183,15 +183,24 @@ function changeFramework(fw) {
 <h1>Merging records</h1>
 [% IF ( result ) %]
     [% IF ( errors ) %]
+
        [% FOREACH error IN errors %]
-           <div class="dialog alert">[% error.error %].<br />Therefore, the record to be merged has not been deleted.</div>
-       [% END %]
+           <div class="dialog alert">
 
-       [% ELSE %]
-       <script type="text/javascript">window.location.href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblio1 %]"</script> 
-       <p>The merging was successful. <a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblio1 %]">Click here to see the merged record.</a></p>
+                [% IF error.code == 'CANNOT_MOVE' %]
+                    The following items could not be moved from the old record to the new one: [% error.value %]
+                [% ELSE %]
+                    [% error %]
+                [% END %]
+
+            <br />Therefore, the record to be merged has not been deleted.</div>
        [% END %]
 
+    [% ELSE %]
+        <script type="text/javascript">window.location.href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblio1 %]"</script>
+        <p>The merging was successful. <a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblio1 %]">Click here to see the merged record.</a></p>
+    [% END %]
+
 [% ELSE %]
 
 [% IF ( choosereference ) %]
@@ -228,9 +237,16 @@ function changeFramework(fw) {
 [% ELSE %]
 [% IF ( errors ) %]
     <div class="dialog alert">
-    [% FOREACH error IN errors %]
-        <p>[% error.error %]</p>
-    [% END %]
+       [% FOREACH error IN errors %]
+           <p>
+                [% IF error.code == 'WRONG_COUNT' %]
+                    Number of records provided for merging: [% error.value %]. Currently only 2 records can be merged at a time.
+                [% ELSE %]
+                    [% error %]
+                [% END %]
+
+            </p>
+       [% END %]
     </div>
 [% ELSE %]
 <form id="mergeform" action="/cgi-bin/koha/cataloguing/merge.pl" method="post" onsubmit="return mergeformsubmit()">
index ac473db..558f2ee 100644 (file)
@@ -62,6 +62,23 @@ $(document).ready(function(){
     });
 });
 
+[% IF ( total_pages ) %]
+function validate_goto_page(){
+    var page = $('#goto_page').val();
+    if(isNaN(page)) {
+        alert(_("The page entered is not a number."));
+        return false;
+    }
+    else if(page < 1 || page > [% total_pages %] ) {
+        alert(_("The page should be a number between 1 and ") + [% total_pages %] + ".");
+        return false;
+    }
+    else {
+        return true;
+    }
+}
+[% END %]
+
 //]]>
 </script>
 <style type="text/css">
@@ -161,6 +178,36 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
         [% END %]
     [% END %]</tbody>
 </table>
+
+    <form method="post" action="z3950_search.pl" id="page_form" name="page_form" class="checkboxed">
+        <input type="hidden" name="op" id="op" value="do_search" />
+        <input type="hidden" name="current_page" id="current_page" value="[% current_page %]" />
+        <input type="hidden" id="title"  name="title" value="[% title %]" />
+        <input type="hidden" id="isbn" name="isbn" value="[% isbn %]" />
+        <input type="hidden" id="lccall" name="lccall" value="[% lccall %]" />
+        <input type="hidden" id="controlnumber" name="controlnumber" value="[% controlnumber %]" />
+        <input type="hidden" id="srchany" name="srchany" value="[% srchany %]" />
+        <input type="hidden" id="author" name="author" value="[% author %]" />
+        <input type="hidden" id="subject" name="subject" value="[% subject %]" />
+        <input type="hidden" id="dewey" name="dewey" value="[% dewey %]" />
+        <input type="hidden" id="stdid" name="stdid" value="[% stdid %]" />
+        <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
+        <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
+
+        [% FOREACH server IN servers %]
+        <input type="hidden" name="id" id="z3950_[% server.id %]" value="[% server.id %]" />
+        [% END %]
+
+        [% IF ( show_prevbutton ) %]
+            <input type="button" name="changepage_prev" value="Previous Page" onclick="$('#current_page').val([% current_page %]-1);$('#page_form').submit();" />
+        [% END %]
+        Page [% current_page %] / [% total_pages %]
+        [% IF ( show_nextbutton ) %]
+            <input type="button" name="changepage_next" value="Next Page" onclick="$('#current_page').val([% current_page %]+1);$('#page_form').submit();" />
+        [% END %]
+        <br />Go to page : <input id="goto_page" name="goto_page" value="[% current_page %]" size="4" /><input type="submit" name="changepage_goto" onclick="return validate_goto_page();" value="Go" />
+    </form>
+
 <p><form method="get" action="/cgi-bin/koha/cataloguing/z3950_search.pl"><input type="hidden" name="biblionumber" value="[% biblionumber %]"/><input type="hidden" name="frameworkcode" value="[% frameworkcode %]"/><input type="submit" value="Try Another Search"/></form></p>
     [% ELSE %]
         [% IF ( errconn ) %]
index db17ced..c860ed6 100644 (file)
@@ -160,11 +160,15 @@ var allcheckboxes = $(".checkboxed");
     $("#exportmenuc").empty();
     initExportButton();
 
-    $("#newduedate").datepicker({ minDate: 1 }); // require that renewal date is after today
+    $("#newduedate").datetimepicker({
+        minDate: 1, // require that renewal date is after today
+        hour: 23,
+        minute: 59
+    });
     $("#duedatespec").datetimepicker({
-        onSelect: function(dateText, inst) { $("#barcode").focus(); },
+        onClose: function(dateText, inst) { $("#barcode").focus(); },
         hour: 23,
-        minute: 59,
+        minute: 59
     });
 
  });
@@ -381,16 +385,18 @@ function validate1(date) {
 
 [% IF ( RESERVED ) %]
     <p>
-    <input type="checkbox" id="cancelreserve" name="cancelreserve" value="1" />
+    <input type="checkbox" id="cancelreserve" name="cancelreserve" value="cancel" />
     <label for="cancelreserve">Cancel hold</label>
     </p>
 [% END %]
 
 [% IF ( RESERVE_WAITING ) %]
-    <p>
-    <input type="checkbox" id="cancelreserve" name="cancelreserve" value="1" />
+<p>
     <label for="cancelreserve">Cancel hold</label>
-    </p>
+    <input type="radio" value="cancel" name="cancelreserve" id="cancelreserve" /><br />
+    <label for="revertreserve">Revert waiting status</label>
+    <input type="radio" value="revert" name="cancelreserve" id="revertreserve" checked="checked"/>
+</p>
 [% END %]
 
     <input type="hidden" name="barcode" value="[% barcode %]" />
@@ -399,7 +405,7 @@ function validate1(date) {
     [% IF ( DEBT ) %]<input type="hidden" name="debt_confirmed" value="1" />[% END %]
     [% IF ( INVALID_DATE ) %]
     <p>
-    <input type="text" size="13" id="duedatespec" name="duedatespec" value="[% duedatespec %]" />
+    <input type="text" size="13" id="duedatespec" name="duedatespec" readonly="readonly" value="[% duedatespec %]" />
     <label for="duedatespec">Due date</label>
     </p>
     [% ELSE %]
@@ -577,7 +583,7 @@ No patron matched <span class="ex">[% message %]</span>
 
     [% IF ( SpecifyDueDate ) %]<div class="date-select">
         <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
-        [% IF ( duedatespec ) %]<input type="text" size="13" id="duedatespec" name="duedatespec" value="[% duedatespec %]" />[% ELSE %]<input type="text" size="13" id="duedatespec" name="duedatespec" value="" />
+        [% IF ( duedatespec ) %]<input type="text" size="13" id="duedatespec" name="duedatespec" value="[% duedatespec %]" readonly="readonly" />[% ELSE %]<input type="text" size="13" id="duedatespec" name="duedatespec" value="" readonly="readonly" />
 [% END %]
           <label for="stickyduedate"> Remember for session:</label>
 [% IF ( stickyduedate ) %]
@@ -774,7 +780,9 @@ No patron matched <span class="ex">[% message %]</span>
         <th scope="col">Price</th>
         <th scope="col">Renew <p class="column-tool"><a href="#" id="CheckAllitems">select all</a> | <a href="#" id="CheckNoitems">none</a></p></th>
         <th scope="col">Check in <p class="column-tool"><a href="#" id="CheckAllreturns">select all</a> | <a href="#" id="CheckNoreturns">none</a></p></th>
-        <th scope="col">Export <p class="column-tool"><a href="#" id="CheckAllexports">select all</a> | <a href="#" id="CheckNoexports">none</a></p></th>
+        [% IF export_remove_fields OR export_with_csv_profile %]
+          <th scope="col">Export <p class="column-tool"><a href="#" id="CheckAllexports">select all</a> | <a href="#" id="CheckNoexports">none</a></p></th>
+        [% END %]
     </tr>
 [% IF ( todayissues ) %]</thead>
 [% INCLUDE 'checkouts-table-footer.inc' %]
@@ -844,10 +852,12 @@ No patron matched <span class="ex">[% message %]</span>
             </td>
             [% END %]
         [% END %]
-        <td style="text-align:center;">
+        [% IF export_remove_fields OR export_with_csv_profile %]
+          <td style="text-align:center;">
             <input type="checkbox" id="export_[% todayissue.biblionumber %]" name="biblionumbers" value="[% todayissue.biblionumber %]" />
             <input type="checkbox" name="itemnumbers" value="[% todayissue.itemnumber %]" style="visibility:hidden;" />
-        </td>
+          </td>
+        [% END %]
     </tr>
     [% END %] <!-- /loop todayissues -->
     <!-- /if todayissues -->[% END %]
@@ -923,10 +933,12 @@ No patron matched <span class="ex">[% message %]</span>
             </td>
             [% END %]
         [% END %]
-        <td style="text-align:center;">
+        [% IF export_remove_fields OR export_with_csv_profile %]
+          <td style="text-align:center;">
             <input type="checkbox" id="export_[% previssue.biblionumber %]" name="biblionumbers" value="[% previssue.biblionumber %]" />
             <input type="checkbox" name="itemnumbers" value="[% previssue.itemnumber %]" style="visibility:hidden;" />
-        </td>
+          </td>
+        [% END %]
     </tr>
     <!-- /loop previssues -->[% END %]
 <!--/if previssues -->[% END %]
@@ -942,13 +954,15 @@ No patron matched <span class="ex">[% message %]</span>
         [% END %]
         <input type="submit" name="renew_checked" value="Renew or Return checked items" />
         <input type="submit" id="renew_all" name="renew_all" value="Renew all" />
-        <br/><br/>
-        Don't export fields : <input type="text" id="export_remove_fields" name="export_remove_fields" value="[% export_remove_fields %]" title="Use for iso2709 exports" />
-        <span id="exportmenuc">Export</span>
-        <input type="hidden" name="op" value="export" />
-        <input type="hidden" id="export_format" name="format" value="iso2709" />
-        <input type="hidden" id="dont_export_item" name="dont_export_item" value="0" />
-        <input type="hidden" id="record_type" name="record_type" value="bibs" />
+        [% IF export_remove_fields OR export_with_csv_profile %]
+            <br/><br/>
+            Don't export fields : <input type="text" id="export_remove_fields" name="export_remove_fields" value="[% export_remove_fields %]" title="Use for iso2709 exports" />
+            <span id="exportmenuc">Export</span>
+            <input type="hidden" name="op" value="export" />
+            <input type="hidden" id="export_format" name="format" value="iso2709" />
+            <input type="hidden" id="dont_export_item" name="dont_export_item" value="0" />
+            <input type="hidden" id="record_type" name="record_type" value="bibs" />
+        [% END %]
     </fieldset>
     [% END %]
     </form>
index 458316c..cdab69d 100644 (file)
@@ -153,7 +153,7 @@ $(document).ready(function() {
 <input type="text" size="10" id="to" name="to" value="[% to %]" class="datepickerto" />
 </li>
 </ol>
-<p><i>(Inclusive, default is two days ago to today, set other date ranges as needed. )</i></p>
+<p><i>(Inclusive, default is [% HoldsToPullStartDate %] days ago to today, set other date ranges as needed. )</i></p>
 <fieldset class="action"><input type="submit" name="run_report" value="Submit" class="submit"/></fieldset>
 </fieldset>
 </form>
@@ -161,4 +161,4 @@ $(document).ready(function() {
 </div>
 </div>
 </div>
-[% INCLUDE 'intranet-bottom.inc' %]
\ No newline at end of file
+[% INCLUDE 'intranet-bottom.inc' %]
index 917855d..7fd8d1d 100644 (file)
@@ -332,9 +332,19 @@ $(document).ready(function () {
                     [% END %]
                     [% IF ( errmsgloo.waslost ) %]
                         <p class="problem">Item was lost, now found.</p>
+                        [% IF ( LostItemFeeRefunded ) %]
+                            <p class="problem">A refund has been applied to the borrowing patron's account.</p>
+                        [% ELSE %]
+                            <p class="problem">Any lost item fees for this item will remain on the patron's account</p>
+                        [% END %]
                     [% END %]
                     [% IF ( errmsgloo.withdrawn ) %]
-                        <p class="problem">Item is withdrawn.</p>
+                        [% IF BlockReturnOfWithdrawnItems %]
+                           <h3>Cannot Check In</h3>
+                           <p class="problem">Item is withdrawn. <strong>NOT CHECKED IN</strong></p>
+                        [% ELSE %]
+                           <p class="problem">Item is withdrawn.</p>
+                        [% END %]
                     [% END %]
                     [% IF ( errmsgloo.debarred ) %]
                         <p class="problem"><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% errmsgloo.debarborrowernumber %]">[% errmsgloo.debarname %]([% errmsgloo.debarcardnumber %])</a> is now debarred until [% errmsgloo.debarred | $KohaDates %] </p>
@@ -407,28 +417,10 @@ $(document).ready(function () {
     </form>
 </div>
 
-[% IF ( returned ) %]
-<div class="yui-g">    <table>
-        <tr><th>Item information</th><th>Patron information</th></tr>
-        <tr>
-            <td>[% title |html %]</td>
-            <td>
-
-                <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% riborrowernumber %]">[% riborsurname %], [% ribortitle %] [% riborfirstname %]</a> ([% riborcnum %])
-                [% IF ( flagset ) %]
-                ([% FOREACH flagloo IN flagloop %]
-                [% flagloo.flag %]
-               [% IF ( flagloo.charges ) %] of [% flagloo.chargeamount %] [% END %]
-               ,
-                [% END %])[% END %]
-            </td>
-        </tr>
-    </table>
-[% END %]
 [% IF ( riloop ) %]
     <h2>Checked-in items</h2>
     <table>
-    <tr><th>Due date</th><th>Title</th>        <th>Author</th> <th>Barcode</th><th>Home branch</th><th>Holding branch</th><th>Shelving location</th><th>Call number</th><th>Type</th>  <th>Patron</th><th>Note</th></tr>
+    <tr><th>Due date</th><th>Title</th>        <th>Author</th> <th>Barcode</th><th>Home library</th><th>Holding library</th><th>Shelving location</th><th>Call number</th><th>Type</th>        <th>Patron</th><th>Note</th></tr>
 
         [% FOREACH riloo IN riloop %]
             <tr>
index dec516d..6542ac3 100644 (file)
@@ -13,7 +13,7 @@ $.tablesorter.addParser({
 $(document).ready(function() {
     [% FOREACH branchesloo IN branchesloop %]
     $.tablesorter.defaults.widgets = ['zebra'];
-    $("#transferst[% branchesloo.branchcode %]").tablesorter({[% IF ( branchesloo.dateformat_metric ) %]
+    $("#transferst[% branchesloo.branchcode %]").tablesorter({[% IF ( dateformat_metric ) %]
         dateFormat: 'uk',[% END %]
         sortList: [[0,0]],
         headers: { 1: { sorter: 'articles' }}
index d8d8536..aefd8d9 100644 (file)
@@ -6,13 +6,21 @@
 <body id="circ_view_holdsqueue" class="circ">
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'cat-search.inc' %]
-
-<script type="text/javascript" src="[% ( themelang ) %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
+<link rel="stylesheet" type="text/css" href="/intranet-tmpl/prog/en/css/datatables.css" />
+<script type="text/javascript" src="/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.dataTables.min.js"></script>
+[% INCLUDE 'datatables-strings.inc' %]
+<script type="text/javascript" src="/intranet-tmpl/prog/en/js/datatables.js"></script>
 <script type="text/javascript">//<![CDATA[
 $(document).ready(function() {
-        $("#holdst").tablesorter({
-                sortList: [[6,0]],
-        });
+    $("#holdst").dataTable({
+        "aaSorting": [[ 2, "asc" ]],
+        "bPaginate": false,
+        "bLengthChange": false,
+        "bFilter": false,
+        "bSort": true,
+        "bInfo": false,
+        "bAutoWidth": false
+    });
 });
 //]]>
 </script>
index f9d2258..cb18a4a 100644 (file)
@@ -47,23 +47,24 @@ $.tablesorter.addParser({
     [% IF ( cancel_result ) %]
         [% FOREACH cancel_result %]
             [% IF ( messagetransfert ) %]
-                <div>
-                    <h2>Hold find for ([% nextreservtitle %]), must be transferred</h2>
-                    <p>This hold placed by : <b> [% nextreservsurname %] [% nextreservfirstname %]</b> at the library : <b> [% branchname %] </b>, Please transfer this hold.
+                <div class="dialog message">
+                    <h2>This item is on hold for pick-up at [% branchname %]</h2>
+                    <p><strong>[% nextreservtitle %]</strong> is on hold for <strong> [% nextreservsurname %], [% nextreservfirstname %]</strong>.
+                    Please retain this item and check it in to process the hold.
                     </p>
                     <form name="cancelReservewithtransfert" action="waitingreserves.pl" method="post">
-                        <input type="submit" class="button" />
+                        <input type="submit" class="submit" value="OK" />
                     </form>
                 </div>
             [% END %]
             [% IF ( waiting ) %]
-                <div id="bloc25">
-                    <h2>This hold is waiting</h2>
-                    <p>This hold ([% nextreservtitle %]) was placed by <b> : [% nextreservsurname %] [% nextreservfirstname %]</b>,
-                    Please retain this hold.
+                <div class="dialog message">
+                    <h2>This item is on hold for pick-up at your library</h2>
+                    <p><strong>[% nextreservtitle %]</strong> is on hold for <strong>[% nextreservsurname %], [% nextreservfirstname %]</strong>.
+                    Please retain this item and check it in to process the hold.
                     </p>
                     <form name="cancelReservewithwaiting" action="waitingreserves.pl" method="post">
-                        <input type="submit" />
+                        <input type="submit" class="submit" value="OK"/>
                     </form>
                 </div>
             [% END %]
index 5912f97..210123b 100644 (file)
@@ -1,6 +1,8 @@
 [% INCLUDE 'help-top.inc' %]
 
-<h1>About Koha</h1><p>This section provides information about your Koha installation. It is useful for developers and if you wish to report bugs or issues to the Koha community.</p>
+<h1>About Koha</h1>
+
+<p>This section provides information about your Koha installation. It is useful for developers and if you wish to report bugs or issues to the Koha community.</p>
 
 <h2>Server information</h2>
 
 
 <p>This tab lists all the dependant Perl modules for Koha and whether or not you have them installed, and the version number. If you are reporting an issue, the developer may ask what is the state of the Perl modules you have installed.</p>
 
+<h2>System information</h2>
+
+<p>This tab will provide you with warnings if you are using system preferences that have since been deprecated or system preferences that you have set without other required preferences.</p>
+
 <h2>Koha team</h2>
 
 <p>Koha is developed and supported by a large number of developers around the world. Thanks to all the developers and libraries who support Koha</p>
 
-<p><strong>See the full documentation for the About page in the <a href="http://manual.koha-community.org/3.8/en/aboutkoha.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for the About page in the <a href="http://manual.koha-community.org/3.10/en/aboutkoha.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 4340b11..41d65e0 100644 (file)
@@ -16,6 +16,6 @@
 
 <p>It will also be an option when creating a basket.</p>
 
-<p><strong>See the full documentation for Vendor Contracts in the <a href="http://manual.koha-community.org/3.8/en/acqvendors.html#vendorcontracts">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Vendor Contracts in the <a href="http://manual.koha-community.org/3.10/en/acqvendors.html#vendorcontracts">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index 9d64838..55f9fcc 100644 (file)
@@ -10,6 +10,6 @@
 
 <p>First, set your Acquisitions System Preferences and Acquisitions Administration to match your library's workflow.</p>
 
-<p><strong>See the full documentation for Acquisitions in the <a href="http://manual.koha-community.org/3.8/en/acqmodule.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Acquisitions in the <a href="http://manual.koha-community.org/3.10/en/acqmodule.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/addorderiso2709.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/addorderiso2709.tt
new file mode 100644 (file)
index 0000000..71ef332
--- /dev/null
@@ -0,0 +1,24 @@
+[% INCLUDE 'help-top.inc' %]
+
+<h1>Order from a Staged File</h1>
+
+<ul>
+    <li>From the list of files you are presented with, choose the 'Add orders' link.
+<ul>
+    <li>From the list of records, click 'Add order' next to the item that you want to add to your order.
+<ul>
+    <li>From the order form, you will not be able to edit the catalog details.</li>
+</ul>
+</li>
+</ul>
+</li>
+    <li>The other option is to import all records from the staged file by scrolling below the list of records in the staged file and filling in the item information.
+<ul>
+    <li>If you choose this option the Koha will look in the 020$c and grab the pricing information from that field and put that on each order line.</li>
+</ul>
+</li>
+</ul>
+
+<p><strong>See the full documentation for Ordering in the <a href="http://manual.koha-community.org/3.10/en/placingacqorder.html#createacqbasket">manual</a> (online).</strong></p>
+
+[% INCLUDE 'help-bottom.inc' %]
index 2b457c4..f049dd9 100644 (file)
 </li>
 </ul>
 </li>
-    <li>If you allow patrons to make purchase suggestions (learn more in the Managing Suggestions section of this manual), then you can place orders from those suggestions.
+    <li>If you allow patrons to make purchase suggestions (learn more in the Managing Suggestions section of this manual), then you can place orders from those suggestions.</li>
+    <li>From the results, click 'Order' next to the item you want to order and you will be presented with the order form including a link to the suggestion
+<ul>
     <li>From this form you can make changes to the Catalog Details if necessary.</li>
-</ul>
-</li>
+    <li>When the item appears in your basket it will include a link to the suggestion.</li>
 </ul>
 </li>
     <li>To order from a record that can't be found anywhere else, choose the 'From a new (empty) record.'
 </li>
     <li>The final option for ordering is to order from a staged record (learn more about staging records).
 <ul>
-    <li>From the list of files with which you are presented, choose the 'Add orders' link.
+    <li>From the list of files you are presented with, choose the 'Add orders' link.
 <ul>
     <li>From the list of records, click 'Add order' next to the item that you want to add to your order.
 <ul>
     <li>From the order form, you will not be able to edit the catalog details.</li>
 </ul>
 </li>
+    <li>The other option is to import all records from the staged file by scrolling below the list of records in the staged file and filling in the item information.
+<ul>
+    <li>If you choose this option the Koha will look in the 020$c and grab the pricing information from that field and put that on each order line.</li>
 </ul>
 </li>
 </ul>
 </li>
 </ul>
+</li>
+</ul>
+
+<p>After bringing in the bib information, if your AcqCreateItem system preference is set to add an item when ordering you will enter the item info next. You need to fill out at least one item record and then click the 'Add' button at the bottom left of the item form.</p>
+
+<p>After clicking add the item will appear above the form and then you can enter your next item the same way (if ordering more than one item).</p>
 
-<p/>
 <p>Once you have entered the info about the item, you need to enter the Accounting information.</p>
 
 <ul>
     <li>Quantity is populated by the number of items you've added to the order above.</li>
        <li>The list of funds is populated by the funds you have assigned in the Acquisitions Administration area.</li>
-    <li>The vendor price will be used to calculate the rest of the amount fields below.</li>
+    <li>The currency pull down will have the currencies you set up in the Acquisitions Administration area.</li>
+    <li>The vendor price is the price before any taxes or discounts are applied.</li>
        <li>If the price is uncertain, check the uncertain price box.
 <ul>
     <li>A basket with at least one uncertain price can't be closed.</li>
 </ul>
 </li>
+    <li>If you are charged sales tax, choose that from the gstrate field</li>
+    <li>Enter the percentage discount you're receiving on this order, once you enter this, hit tab and Koha will populate the rest of the cost fields below.</li>
     <li>If you added Planning Values when creating the Fund, those values will appear in the two Planning Value fields.</li>
 </ul>
 
-<p/>
-<p>Once an item is added to the basket you will be presented with a basket summary. From here, you can edit or remove the items that you have added.</p>
+<p>Once an item is added to the basket you will be presented with a basket summary.</p>
+
+<p>If you would like to see more details you can check the 'Show all details' checkbox.</p>
+
+<p>From here, you can edit or remove the items that you have added.</p>
+
+<ul>
+    <li>Choosing to 'Delete the order' will delete the order line but leave the record in the catalog.</li>
+    <li>Choosing to 'Delete order and catalog record' removes both the order line and the record in the catalog.
+<ul>
+    <li>The catalog record cannot always be deleted. You might see notes explaining why.</li>
+</ul>
+</li>
+</ul>
+
 <p>On the summary page, you also have the option to edit the information that you entered about the basket by clicking the 'Edit basket header information' button, to delete the basket altogether by clicking the 'Delete this basket' button, or to export your basket as a CSV file by clicking the 'Export this basket as CSV' button.</p>
 
 <p>Once you're sure your basket is complete, you can click 'Close this basket' button to indicate that this basket is complete and has been sent to the vendor.</p>
 
 <p style="color: #ff0000">Important: A basket with at least one item marked as 'uncertain price' will not be able to be closed</p>
 
-
 <p>Clicking the 'Uncertain Prices' button will call up a list of items with uncertain prices to quick editing.</p>
 
 <p style="color: #ff0000">Important: The Uncertain Prices page is independent of the basket. It is linked to the vendor so you will see all items on order with uncertain prices for that vender.</p>
 
 <p>Clicking 'Print' below your order will generate a PDF for printing, which will have all of your library information followed by the items in your order.</p>
 
-<p><strong>See the full documentation for Ordering in the <a href="http://manual.koha-community.org/3.8/en/placingacqorder.html#createacqbasket">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Ordering in the <a href="http://manual.koha-community.org/3.10/en/placingacqorder.html#createacqbasket">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index 40255e9..5c69914 100644 (file)
@@ -8,7 +8,7 @@
 
 <p>A basket group is simply a group of baskets. In some libraries, you have several staff members who create baskets, and, at the end of a period of time, someone then groups them together to send to the vendor in bulk. That said, it is possible to have one basket in a basket group if that's the workflow used in your library.</p>
 
-<p><strong>See the full documentation for Basket Groups in the <a href="http://manual.koha-community.org/3.8/en/placingacqorder.html#acqbasketgroup">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Basket Groups in the <a href="http://manual.koha-community.org/3.10/en/placingacqorder.html#acqbasketgroup">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
 
index 9f8dddd..918ab98 100644 (file)
@@ -2,17 +2,23 @@
 
 <h2>Adding a Basket</h2>
 
-<p>When adding a basket, give it a name that will help you identify it later. The notes fields are optional and can contain any type of information.</p>
+<p>When adding a basket you want to give it a name that will help you identify it later</p>
 
-<p>If you have added contracts to the vendor from whom you are ordering, you will also have an option to choose which contract you are ordering those items under.</p>
+<p>Enter in the Billing Place and Delivery Place (this will default the library you're logged in at)</p>
 
-<p>When finished, click 'Save'.</p>
+<p>If you would like to change the vendor you're ordering from you can use the Vendor pull down menu</p>
+
+<p>The notes fields are optional and can contain any type of information</p>
+
+<p>If you have added contracts to the vendor you're ordering from, you will also have an option to choose which contract you're ordering these items under.</p>
+
+<p>When finished, click 'Save'
 
 <h2>Editing Basket Headers</h2>
 
-<p>After creating your basket, you can edit the name of the basket, the notes associated with it and the contract you're ordering against.</p>
+<p>After creating your basket, you can edit the name of the basket, the billing place, delivery place, the notes and the contract you're ordering against.</p>
 
-<p><strong>See the full documentation for Ordering in the <a href="http://manual.koha-community.org/3.8/en/placingacqorder.html#createacqbasket">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Ordering in the <a href="http://manual.koha-community.org/3.10/en/placingacqorder.html#createacqbasket">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
 
index 0ceca1e..830e1cc 100644 (file)
@@ -2,11 +2,11 @@
 
 <h1>Acquisitions Searching</h1>
 
-<p>At the top of the various Acquisition pages, there is a quick search box where you can perform either a Vendor Search or an Order Search.</p>
+<p>At the top of the various Acquisition pages there is a quick search box where you can perform either a Vendor Search or an Order Search.</p>
 
-<p>In the Vendor Search, you can enter any part of the vendor name to get results.</p>
+<p>In the Vendor Search you can enter any part of the vendor name to get results.</p>
 
-<p>Using the Orders Search, you can search for items that have been ordered with or without the vendor.</p>
+<p>Using the Orders Search you can search for items that have been ordered with or without the vendor.</p>
 
 <p>You can enter info in one or both fields and you can enter any part of the title and/or vendor name.</p>
 
@@ -14,6 +14,6 @@
 
 <p>Clicking Advanced Search to the right of the search button will give you all of the order search options available.</p>
 
-<p><strong>See the full documentation for Acquisitions Searching in the <a href="http://manual.koha-community.org/3.8/en/acqsearch.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Acquisitions Searching in the <a href="http://manual.koha-community.org/3.10/en/acqsearch.html">manual</a> (online).</strong></p>
        
 [% INCLUDE 'help-bottom.inc' %]
index 57bad58..830e1cc 100644 (file)
@@ -2,19 +2,18 @@
 
 <h1>Acquisitions Searching</h1>
 
-<p>At the top of the various Acquisition pages is a quick search box where you can perform either a Vendor Search or an Order Search.</p>
+<p>At the top of the various Acquisition pages there is a quick search box where you can perform either a Vendor Search or an Order Search.</p>
 
-<p>In the Vendor Search, you can enter any part of the vendor name to get results.</p>
+<p>In the Vendor Search you can enter any part of the vendor name to get results.</p>
 
-<p>Using the Orders Search, you can search for items that have been ordered with or without the vendor.</p>
+<p>Using the Orders Search you can search for items that have been ordered with or without the vendor.</p>
 
-<p>You can enter info in one or both fields, and you can enter any part of the title and/or vendor name.</p>
+<p>You can enter info in one or both fields and you can enter any part of the title and/or vendor name.</p>
 
 <p>Clicking the plus sign to the right of the Vendor search box will expand the search and allow you to search for additional fields.</p>
 
 <p>Clicking Advanced Search to the right of the search button will give you all of the order search options available.</p>
 
-<p><strong>See the full documentation for Acquisitions Searching in the <a href="http://manual.koha-community.org/3.8/en/acqsearch.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Acquisitions Searching in the <a href="http://manual.koha-community.org/3.10/en/acqsearch.html">manual</a> (online).</strong></p>
        
 [% INCLUDE 'help-bottom.inc' %]
-
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/invoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/invoice.tt
new file mode 100644 (file)
index 0000000..640878e
--- /dev/null
@@ -0,0 +1,13 @@
+[% INCLUDE 'help-top.inc' %]
+
+<h1>Invoices</h1>
+
+<p>When orders are received invoices are generated. Invoices can be searched by clicking on 'Invoices' in the left of the Acquisitions page.</p>
+
+<p>After searching, your results will appear to the right of the search options.</p>
+
+<p>From the results you can click the 'Details' link to see the full invoice or 'Close' to note that the invoice is closed/paid for.</p>
+
+<p><strong>See the full documentation for Invoices in the <a href="http://manual.koha-community.org/3.10/en/acqinvoices.html">manual</a> (online).</strong></p>
+
+[% INCLUDE 'help-bottom.inc' %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/invoices.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/invoices.tt
new file mode 100644 (file)
index 0000000..640878e
--- /dev/null
@@ -0,0 +1,13 @@
+[% INCLUDE 'help-top.inc' %]
+
+<h1>Invoices</h1>
+
+<p>When orders are received invoices are generated. Invoices can be searched by clicking on 'Invoices' in the left of the Acquisitions page.</p>
+
+<p>After searching, your results will appear to the right of the search options.</p>
+
+<p>From the results you can click the 'Details' link to see the full invoice or 'Close' to note that the invoice is closed/paid for.</p>
+
+<p><strong>See the full documentation for Invoices in the <a href="http://manual.koha-community.org/3.10/en/acqinvoices.html">manual</a> (online).</strong></p>
+
+[% INCLUDE 'help-bottom.inc' %]
index 20d93ef..a2d9bfc 100644 (file)
@@ -16,6 +16,6 @@
 
 <p>There is a default acquisitions cliam letter. If you would rather use a different one, you can create that in the notices module and choose it from the menu above the list of late items.</p>
 
-<p><strong>See the full documentation for Claims and Late Orders in the <a href="http://manual.koha-community.org/3.8/en/acqclaims.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Claims and Late Orders in the <a href="http://manual.koha-community.org/3.10/en/acqclaims.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index 7bdb253..b7df875 100644 (file)
@@ -9,6 +9,6 @@
        <li>All of the details associated with the item will already be listed under 'Catalog details'</li>
 </ul>
 
-<p><strong>See the full documentation for Ordering in the <a href="http://manual.koha-community.org/3.8/en/placingacqorder.html#createacqbasket">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Ordering in the <a href="http://manual.koha-community.org/3.10/en/placingacqorder.html#createacqbasket">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index e0b7801..a611262 100644 (file)
@@ -8,6 +8,6 @@
     <li>You will be presented with an empty form to fill in all of the necessary details about the item.</li>
 </ul>
 
-<p><strong>See the full documentation for Ordering in the <a href="http://manual.koha-community.org/3.8/en/placingacqorder.html#createacqbasket">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Ordering in the <a href="http://manual.koha-community.org/3.10/en/placingacqorder.html#createacqbasket">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index fd32094..d581d20 100644 (file)
@@ -6,8 +6,9 @@
 
 <ul>
     <li>From this form you, can make changes to the Catalog Details if necessary.</li>
+    <li>When the item appears in your basket it will include a link to the suggestion.</li>
 </ul>
 
-<p><strong>See the full documentation for Ordering in the <a href="http://manual.koha-community.org/3.8/en/placingacqorder.html#createacqbasket">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Ordering in the <a href="http://manual.koha-community.org/3.10/en/placingacqorder.html#createacqbasket">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index b961c36..3c41af9 100644 (file)
@@ -4,18 +4,20 @@
 
 <p>Orders can be received from the vendor information page or the vendor search results page.</p>
 
-<p>After clicking 'Receive shipment,' you will be asked to enter a vendor invoice number and a shipment received date.</p>
+<p>After clicking 'Receive shipment' you will be asked to enter a vendor invoice number, a shipment received date, a shipping cost and a budget to subtract that shipping amount from.</p>
 
-<p>The receive page will list all items still on order with the vendor, regardless of which basket contains the item.</p>
+<p>The receive page will list all items still on order with the vendor regardless of the basket the item is from.</p>
 
 <p>To receive a specific item, click the 'Receive' link to the right of the item.</p>
 
-<p>From this form, you can alter the cost information. You can also choose to only receive one of multiple items if only one arrived. Once you have made any necessary changes, click 'Save' to mark the item as received.</p>
+<p>From this form you can alter the cost information. You can also choose to mark only part of the order as received if the vendor didn't send your entire order by checking only the boxes next to the items on the left that you want to receive. The values you enter in the 'Replacement cost' and 'Actual cost' will automatically populate the item record by filling in subfield v (Cost, replacement price) and subfield g (Cost, normal purchase price) on the item record after saving.</p>
 
-<p>When you're finished receiving items, you can navigate away from this page or click the 'Finish receiving' button at the bottom of the screen.</p>
+<p>You can also make edits to the item record from this form by clicking the 'Edit' link next to each item. This will allow you to enter in accurate call numbers and barcodes if you'd like to do that at the point of receipt. Once you have made any changes necessary (to the order and/or items, click 'Save' to mark the item(s) as received.</p>
 
-<p>You will also see that the item is received if you view the basket.</p>
+<p>When you're finished receiving items you can navigate away from this page or click the 'Finish receiving' button at the bottom of the screen.</p>
 
-<p><strong>See the full documentation for Receiving Orders in the <a href="http://manual.koha-community.org/3.8/en/receiveacqorder.html">manual</a> (online).</strong></p>
+<p>You will also see that the item is received and/or cancelled if you view the basket.</p>
+
+<p><strong>See the full documentation for Receiving Orders in the <a href="http://manual.koha-community.org/3.10/en/receiveacqorder.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index f3426f3..3c41af9 100644 (file)
@@ -2,20 +2,22 @@
 
 <h1>Receiving Orders</h1>
 
-<p>Orders can be received from the Vendor Information page or the Vendor Search Results page.</p>
+<p>Orders can be received from the vendor information page or the vendor search results page.</p>
 
-<p>After clicking 'Receive shipment,' you will be asked to enter a vendor invoice number and a shipment received date.</p>
+<p>After clicking 'Receive shipment' you will be asked to enter a vendor invoice number, a shipment received date, a shipping cost and a budget to subtract that shipping amount from.</p>
 
-<p>The Receive page will list all items still on order with the vendor, no matter which basket the item is from.</p>
+<p>The receive page will list all items still on order with the vendor regardless of the basket the item is from.</p>
 
 <p>To receive a specific item, click the 'Receive' link to the right of the item.</p>
 
-<p>From this form, you can alter the cost information. You can also choose to only receive one of multiple items if only one arrived. Once you have made any necessary changes, click 'Save' to mark the item as received.</p>
+<p>From this form you can alter the cost information. You can also choose to mark only part of the order as received if the vendor didn't send your entire order by checking only the boxes next to the items on the left that you want to receive. The values you enter in the 'Replacement cost' and 'Actual cost' will automatically populate the item record by filling in subfield v (Cost, replacement price) and subfield g (Cost, normal purchase price) on the item record after saving.</p>
 
-<p>When you're finished receiving items, you can navigate away from this page or click the 'Finish receiving' button at the bottom of the screen.</p>
+<p>You can also make edits to the item record from this form by clicking the 'Edit' link next to each item. This will allow you to enter in accurate call numbers and barcodes if you'd like to do that at the point of receipt. Once you have made any changes necessary (to the order and/or items, click 'Save' to mark the item(s) as received.</p>
 
-<p>You will also see that the item is received if you view the basket.</p>
+<p>When you're finished receiving items you can navigate away from this page or click the 'Finish receiving' button at the bottom of the screen.</p>
 
-<p><strong>See the full documentation for Receiving Orders in the <a href="http://manual.koha-community.org/3.8/en/receiveacqorder.html">manual</a> (online).</strong></p>
+<p>You will also see that the item is received and/or cancelled if you view the basket.</p>
+
+<p><strong>See the full documentation for Receiving Orders in the <a href="http://manual.koha-community.org/3.10/en/receiveacqorder.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index 416fa19..3c41af9 100644 (file)
@@ -4,18 +4,20 @@
 
 <p>Orders can be received from the vendor information page or the vendor search results page.</p>
 
-<p>After clicking 'Receive shipment,' you will be asked to enter a vendor invoice number and a shipment received date.</p>
+<p>After clicking 'Receive shipment' you will be asked to enter a vendor invoice number, a shipment received date, a shipping cost and a budget to subtract that shipping amount from.</p>
 
-<p>The Receive Page will list all items still on order with the vendor regardless of the basket the item is from.</p>
+<p>The receive page will list all items still on order with the vendor regardless of the basket the item is from.</p>
 
 <p>To receive a specific item, click the 'Receive' link to the right of the item.</p>
 
-<p>From this form, you can alter the cost information. You can also choose to only receive one of multiple items if only one arrived. Once you have made any necessary changes, click 'Save' to mark the item as received.</p>
+<p>From this form you can alter the cost information. You can also choose to mark only part of the order as received if the vendor didn't send your entire order by checking only the boxes next to the items on the left that you want to receive. The values you enter in the 'Replacement cost' and 'Actual cost' will automatically populate the item record by filling in subfield v (Cost, replacement price) and subfield g (Cost, normal purchase price) on the item record after saving.</p>
 
-<p>When you're finished receiving items, you can navigate away from this page or click the 'Finish receiving' button at the bottom of the screen.</p>
+<p>You can also make edits to the item record from this form by clicking the 'Edit' link next to each item. This will allow you to enter in accurate call numbers and barcodes if you'd like to do that at the point of receipt. Once you have made any changes necessary (to the order and/or items, click 'Save' to mark the item(s) as received.</p>
 
-<p>You will also see that the item is received if you view the basket.</p>
+<p>When you're finished receiving items you can navigate away from this page or click the 'Finish receiving' button at the bottom of the screen.</p>
 
-<p><strong>See the full documentation for Receiving Orders in the <a href="http://manual.koha-community.org/3.8/en/receiveacqorder.html">manual</a> (online).</strong></p>
+<p>You will also see that the item is received and/or cancelled if you view the basket.</p>
+
+<p><strong>See the full documentation for Receiving Orders in the <a href="http://manual.koha-community.org/3.10/en/receiveacqorder.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index 00d6eb5..6dbe769 100644 (file)
@@ -51,6 +51,6 @@
 
 <p>If the vendor has no baskets attached to it, a 'Delete' button will also be visible, allowing the vendor to be deleted.</p>
 
-<p><strong>See the full documentation for managing Vendors in the <a href="http://manual.koha-community.org/3.8/en/acqvendors.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for managing Vendors in the <a href="http://manual.koha-community.org/3.10/en/acqvendors.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/uncertainprice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/uncertainprice.tt
new file mode 100644 (file)
index 0000000..2616d30
--- /dev/null
@@ -0,0 +1,9 @@
+[% INCLUDE 'help-top.inc' %]
+
+<h1>Uncertain prices</h1>
+
+<p>The Uncertain Prices page is independent of the basket. It is linked to the vendor so you will see all items on order with uncertain prices for that vendor.</p>
+
+<p><strong>See the full documentation for Uncertain prices in the <a href="http://manual.koha-community.org/3.10/en/placingacqorder.html#createacqbasket">manual</a> (online).</strong></p>
+
+[% INCLUDE 'help-bottom.inc' %]
index 9873e1a..1ebcbb6 100644 (file)
@@ -14,6 +14,6 @@
     <li>In the order form that pops up, you will not be able to edit the catalog details</li>
 </ul>
 
-<p><strong>See the full documentation for Ordering in the <a href="http://manual.koha-community.org/3.8/en/placingacqorder.html#createacqbasket">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Ordering in the <a href="http://manual.koha-community.org/3.10/en/placingacqorder.html#createacqbasket">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index 944ba79..47cbeab 100644 (file)
@@ -16,7 +16,7 @@
 
 <p>"Basic Parameters" is where library policies are set and governed. It is best to set your system preferences and then work through the basic parameters in the order that they appear on this page.</p>
 
-<p>Please note that it is not required to set all the basic parameters. For example, if you do not plan to use budget based acquisitions, then 'Funds,' 'Budgets,' and 'Currencies and Exchange Rates' can be ignored.</p>
+<p>Please note that it is not required to set all the basic parameters. For example, if you do not plan to use acquisitions, then 'Funds,' 'Budgets,' and 'Currencies and Exchange Rates' can be ignored.</p>
 
 <h3>Patrons and Circulation</h3>
 
@@ -30,6 +30,6 @@
 
 <p>This list of parameters includes functionalities that didn't fit in any other category.  These items are optional and may not need to be altered, depending on your library's needs.</p>
 
-<p><strong>See the full documentation for system Administration in the <a href="http://manual.koha-community.org/3.8/en/administration.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for system Administration in the <a href="http://manual.koha-community.org/3.10/en/administration.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index 44c6f26..9311221 100644 (file)
@@ -2,24 +2,38 @@
 
 <h1>Budgets</h1>
 
-<p>The 'Budgets' functionality is used for tracking accounting values related to acquisitions.</p>
+<p>Budgets are used for tracking accounting values related to acquisitions. For example you could create a Budget for the current year (ex. 2012) and then break that into Funds for different areas of the library (ex. Books, Audio, etc).</p>
 
-<p>'Budgets' can be used to create a budget for the current year and then break it into Funds for different areas of the library.</p>
+<p>When visiting the main budget administration you will see two tabs, one for active and one for inactive budgets.</p>
 
 <h2>Add a budget</h2>
 
-<p>To add a budget, click the 'New Budget' button.</p>
+<p>Budgets can either be created from scratch or by duplicating the previous year's budget.</p>
+
+<p>To duplicate a budget from a previous year, click on the link for the budget name from the list of budgets.</p>
+
+<p>On the screen listing the budget breakdown click the Edit button at the top and choose to Duplicate budget.</p>
+
+<p>You will be presented with a form where you simply need to enter the new start and end date and save the budget.</p>
+
+<p>This will not only duplicate your budget, but all of the funds associated with that budget so that you can reuse budgets and funds from year to year.</p>
+
+<p>If you haven't used Koha before for acquisitions then you'll need to start fresh with a new budget. To add a new budget click the 'New Budget' button.</p>
 
 <ul>
-    <li>Choose a time period for the budget, be it an academic year, a fiscal year, a quarter, or other unit of time.</li>
-    <li>The description should help you identify the budget when ordering.</li>
-    <li>Do not use any symbols other than the decimal separator in the amount box.</li>
-    <li>Marking a budget 'Active' makes it usable when placing orders in the acquisitions module, even if an order is placed after the budget end date. This will allow you to record orders that were placed in a previous budget period.</li>
-    <li>Locking a budget prevents other librarians from modifying that fund.</li>
+    <li>Choose the time period this budget is for, whether it's an academic year, a fiscal year, a quarter, etc.</li>
+
+    <li>The Description should be something that will help you identify the budget when ordering</li>
+
+    <li>In the amount box do not use any symbols, simply enter the amount of the budget with numbers and decimals.</li>
+
+    <li>Marking a budget active makes it usable when placing orders in the acquisitions module, even if the order is placed after the budget end date. This will allow you to record orders that were places in a previous budget period.</li>
+
+    <li>Locking a budget means that Funds will not be able to be modified by librarians</li>
 </ul>
 
 <p>Once you have made your edits, click the 'Save Changes' button. You will be brought to a list of your existing budgets.</p>
 
-<p><strong>See the full documentation for Budgets in the <a href="http://manual.koha-community.org/3.8/en/acqadmin.html#budgetplanning">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Budgets in the <a href="http://manual.koha-community.org/3.10/en/acqadmin.html#budgetplanning">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index f57bbc2..6575f47 100644 (file)
     <li>Choose which library will use the fund</li>
     <li>You can restrict who can order from a fund by selecting an owner or a library from the 'Restrict access to' menu.</li>
     <li>The 'Notes' field is for descriptions to detail when librarians should use the fund.</li>
-    li>Planning categories are used for statistical purposes. To learn more about planning categories, check out the Planning Category FAQ.</li>
+    <li>Planning categories are used for statistical purposes. To learn more about planning categories, check out the Planning Category FAQ.</li>
 </ul>
 
 <p>When complete, click 'Submit' and you will be brought to a list of all of the funds for the budget.</p>
 
 <p>To the right of each fund you will find the 'Edit,' 'Delete,' and 'Add Child Fund' options. A Child Fund a sub-fund of the parent fund. For example, one might have a parent fund for 'Fiction,' and Child Funds for 'New Releases' and 'Science Fiction.' It is an optional way to further organize your finances.</p>
 
-<p><strong>See the full documentation for Funds in the <a href="http://manual.koha-community.org/3.8/en/acqadmin.html#funds">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Funds in the <a href="http://manual.koha-community.org/3.10/en/acqadmin.html#funds">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index 4667748..64c03ca 100644 (file)
@@ -2,16 +2,16 @@
 
 <h1>Budget Planning</h1>
 
-<p>When viewing the list of funds, click the 'Budget Planning' button and choose how you would like to plan to spend your budget.</p>
+<p>When viewing the list of funds click the 'Planning' button and choose how you would like to plan to spend your budget.</p>
 
-<p>If you choose 'Plan by Months' you will see the budgeted amount broken down by months.</p>
+<p>If you choose 'Plan by MONTHS' you will see the budgeted amount broken down by months.</p>
 
-<p>To hide some of the columns, click the minus sign (-) to the right or below the dates. To add more columns, click the plus sign (+) found above the 'Auto-fill row' buttons.</p>
+<p>To hide some of the columns you can click the 'hide' link to the right the dates. To add more columns you can click the 'Show a column' link found below the 'Fund Remaining' heading.</p>
 
-<p>From here, you can plan your budget spending by manually entering values or by clicking the 'Auto-fill row' button. If you choose to auto-fill the form, the system will automatically divide the total. Therefore, you may have to adjust the allocations manually to better reflect your library's needs.</p>
+<p>From here you can plan your budget spending by manually entering values or by clicking the 'Auto-fill row' button. If you choose to auto-fill the form the system will try to divide the amount accordingly, you may have to make some edits to split things more accurately.</p>
 
-<p>Once your changes are made, click the 'Save' button. If you would like to export your data as a CSV file, enter a file name in the 'Output to a file named' field and click the 'Output' button.</p>
+<p>Once your changes are made, click the 'Save' button. If you would like to export your data as a CSV file you can do so by entering a file name in the 'Output to a file named' field and clicking the 'Output' button.</p>
 
-<p><strong>See the full documentation for Budget Planning in the <a href="http://manual.koha-community.org/3.8/en/acqadmin.html#fundsplanning">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Budget Planning in the <a href="http://manual.koha-community.org/3.10/en/acqadmin.html#fundsplanning">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index 8a4333c..9cfdf55 100644 (file)
@@ -63,7 +63,6 @@
     <li>To save your changes, click the 'Save Changes' button at the top of the screen.</li>
 </ul>
 
-<p><strong>See the full documentation for Authorities in the <a href="http://manual.koha-community.org/3.8/en/catadmin.html#authoritiesadmin">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Authorities in the <a href="http://manual.koha-community.org/3.10/en/catadmin.html#authoritiesadmin">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
-
index 77c7be1..8e7aaf9 100644 (file)
@@ -19,6 +19,6 @@
 
 <p>To the right of the new field is a link to 'Subfields.' You will need to add subfields before this tag will appear in your MARC editor.</p>
 
-<p><strong>See the full documentation for Authorities in the <a href="http://manual.koha-community.org/3.8/en/catadmin.html#authoritiesadmin">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Authorities in the <a href="http://manual.koha-community.org/3.10/en/catadmin.html#authoritiesadmin">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index e44d213..9d3bafe 100644 (file)
@@ -6,7 +6,10 @@
 
 <h2>Existing Values</h2>
 
-<p>Koha installs with pre-defined values that your library is likely to use, for instance, 'Lost.'</p> By default, this includes:
+<p>Koha installs with pre-defined values that your library is likely to use, for instance, 'Lost.'</p>
+
+<p>By default, this includes:</p>
+
 <ul>
     <li>'Asort1,' for acquisitions statistical purposes.</li>
     <li>'Asort2,' used for acquisitions statistical purposes.</li>
     <li>'HINGS_RD' is for General Holdings: Retention Designator, a data element that specifies the retention policy for the unit at the time of the holdings report.</li>
     <li>'HINGS_UT' is for General Holdings: Type of Unit Designator.</li>
     <li>'LOC' is for the shelving location and usually appears when adding or editing an item.</li>
-    <li>'LOST' is for descriptions for items marked as lost. It appears when adding or editing an item. Values given to lost statuses should be numeric (not alphabetical) in order for statuses to appear properly.</li>
+    <li>'LOST' is for descriptions for items marked as lost. It appears when adding or editing an item. Values given to lost statuses should be numeric (not alphabetical) in order for statuses to appear properly.
+<ul>
+    <li style="color: #990000;">Important: Values given to lost statuses should be numeric and not alphabetical in order for statuses to appear properly</li>
+</ul>
+</li>
     <li>'MANUAL_INV' includes values for manual invoicing.</li>
     <li>'NOT_LOAN' is used to list reasons why a title is not for loan.</li>
     <li>'PROC' is for the location to be used for NewItemsDefaultLocation (change description as desired), also the location expected by InProcessingToShelvingCart.</li>
+    <li>'REPORT_GROUP' provides a way to sort and filter your reports, the default values in this category include the Koha modules (Accounts, Acquitisions, Catalog, Circulation, Patrons)</li>
+    <li>'REPORT_SUBGROUP' can be used to further sort and filter your reports. This category is empty by default. Values here need to include the authorized value code from REPORT_GROUP in the Description (OPAC) field to link the subgroup to the appropriate group.</li>
     <li>'RESTRICTED' is used for the restricted status of an item</li>
     <li>'SUGGEST' is for a list of reasons to accept or reject patron suggestions. It appears when managing suggestions.</li>
     <li>'WITHDRAWN' is for a description of a withdrawn item. It appears when adding or editing an item.</li>
@@ -60,6 +69,6 @@
     <li>The new value will appear in the list along with existing values.</li>
 </ul>
 
-<p><strong>See the full documentation for Authorized Values in the <a href="http://manual.koha-community.org/3.8/en/basicparams.html#authorizedvalues">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Authorized Values in the <a href="http://manual.koha-community.org/3.10/en/basicparams.html#authorizedvalues">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index efe74a3..1163d1b 100644 (file)
@@ -6,6 +6,6 @@
 
 <p>Koha comes with many of the necessary Authority frameworks already installed.</p>
 
-<p><strong>See the full documentation for Authorities in the <a href="http://manual.koha-community.org/3.8/en/catadmin.html#authoritiesadmin">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Authorities in the <a href="http://manual.koha-community.org/3.10/en/catadmin.html#authoritiesadmin">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index faa53a4..45883b8 100644 (file)
@@ -34,6 +34,6 @@
 
 <p>To make edits to the fields associated with the Framework you must first click 'MARC Structure' and then follow the instructions for editing subfields</p>
 
-<p><strong>See the full documentation for Frameworks in the <a href="http://manual.koha-community.org/3.8/en/catadmin.html#marcbibframeworks">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Frameworks in the <a href="http://manual.koha-community.org/3.10/en/catadmin.html#marcbibframeworks">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index baac455..4037d92 100644 (file)
@@ -16,6 +16,6 @@
 
 <p>In the above example, Centerville library will allow patrons to return items from all libraries except Liberty and Franklin to their library.</p>
 
-<p><strong>See the full documentation for Library Transfer Limits in the <a href="http://manual.koha-community.org/3.8/en/patscirc.html#libtransferlimits">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Library Transfer Limits in the <a href="http://manual.koha-community.org/3.10/en/patscirc.html#libtransferlimits">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index da2d595..8404f8e 100644 (file)
@@ -47,6 +47,6 @@
 
 <p>Properties are then applied to libraries via the add or edit library form.</p>
 
-<p><strong>See the full documentation for Libraries &amp; Groups in the <a href="http://manual.koha-community.org/3.8/en/basicparams.html#libsgroups">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Libraries &amp; Groups in the <a href="http://manual.koha-community.org/3.10/en/basicparams.html#libsgroups">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index cd6b054..d788963 100644 (file)
@@ -44,7 +44,7 @@
 <p>To add a new patron category click 'New Category' at the top of the page</p>
 
 <ul>
-      <li>The 'Category Code' is an identifier for your new code.
+    <li>The 'Category Code' is an identifier for your new code.
 <ul>
        <li style="color: #990000;">Important: The category code is limited to 10 characters (numbers and letters)</li>
 </ul>
        <li style="color: #990000;">Important: You cannot enter both a month limit and a date until. Choose to enter either one or the other.</li>
 </ul>
 </li>
-       <li>Some patron categories can have a minimum age (in years) requirement associated with them, enter this age in the 'Age required'</li>
-       <li>Patron categories can also have a maximum age (in years) associated with them (such as children), enter this age in the 'Upperage limit'</li>
+    <li>Some patron categories can have a minimum age (in years) requirement associated with them, enter this age in the 'Age required'
+<ul>
+    <li style="color: #990000;">Important: This value will only be checked if BorrowerMandatoryField defines the dateofbirth as a required field on the patron record</li>
+</ul>
+</li>
+    <li>Patron categories can also have a maximum age (in years) associated with them (such as children), enter this age in the 'Upperage limit'
+<ul>
+    <li style="color: #990000;">Important: This value will only be checked if BorrowerMandatoryField defines the dateofbirth as a required field on the patron record</li>
+</ul>
+</li>
        <li>If you charge a membership fee for your patrons (such as those who live in another region) you can enter that in the 'Enrollment fee' field.
 <ul>
        <li style="color: #990000;">Important: Only enter numbers and decimals in this field</li>
@@ -77,6 +85,6 @@
 </li>
 </ul>
 
-<p><strong>See the full documentation for Patron Categories in the <a href="http://manual.koha-community.org/3.8/en/patscirc.html#patcats">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Patron Categories in the <a href="http://manual.koha-community.org/3.10/en/patscirc.html#patcats">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 1e43fb0..a6d0af6 100644 (file)
@@ -6,6 +6,6 @@
 
 <p>If you change your MARC Bibliographic framework it's recommended that you run this tool to test for errors in your definition.</p>
 
-<p><strong>See the full documentation for the MARC Bibliographic Framework Test in the <a href="http://manual.koha-community.org/3.8/en/catadmin.html#marcbibframeworkstest">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for the MARC Bibliographic Framework Test in the <a href="http://manual.koha-community.org/3.10/en/catadmin.html#marcbibframeworkstest">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 98b1b4d..3f89b19 100644 (file)
@@ -18,6 +18,6 @@
 
 <p>This will allow for easy entry of local cities into the patron record without risking the potential for typos or mistaken zip/postal codes.</p>
 
-<p><strong>See the full documentation for Cities and Towns in the <a href="http://manual.koha-community.org/3.8/en/patscirc.html#citytowns">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Cities and Towns in the <a href="http://manual.koha-community.org/3.10/en/patscirc.html#citytowns">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 3e4c79b..4892511 100644 (file)
@@ -7,7 +7,7 @@
 <p>Commonly used values of this field are:</p>
 
 <ul>
-        <li>ddc - Dewey Decimal Classification</li>
+    <li>ddc - Dewey Decimal Classification</li>
     <li>lcc - Library of Congress Classification</li>
 </ul>
 
@@ -16,8 +16,8 @@
 <ul>
        <li>ANSCR (sound recordings)</li>
        <li>SuDOC classification</li>
- <li>Universal Decimal Classification</li>
-      <li>Other/Generic Classification</li>
   <li>Universal Decimal Classification</li>
+    <li>Other/Generic Classification</li>
 </ul>
 
 <h2>Adding/Editing Classification Sources</h2>
@@ -53,6 +53,6 @@
        <li>Choose an appropriate filing routine - dewey, generic or lcc</li>
 </ul>
 
-<p><strong>See the full documentation for Classification Sources in the <a href="http://manual.koha-community.org/3.8/en/catadmin.html#classificationsources">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Classification Sources in the <a href="http://manual.koha-community.org/3.10/en/catadmin.html#classificationsources">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index ff4245c..0552f78 100644 (file)
@@ -8,6 +8,6 @@
 
 <p>The active currency is the main currency you use in your library. Your active currency will have a check mark in the 'Active' column. If you don't have an active currency you will see an error message telling you to choose an active currency.</p>
 
-<p><strong>See the full documentation for Currencies and Exchange Rates in the <a href="http://manual.koha-community.org/3.8/en/acqadmin.html#currexchangeadmin">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Currencies and Exchange Rates in the <a href="http://manual.koha-community.org/3.10/en/acqadmin.html#currexchangeadmin">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 9981403..3e8650b 100644 (file)
@@ -20,6 +20,6 @@
 
 <p>Future developments will include additional keyword assigned fields.</p>
 
-<p><strong>See the full documentation for Keyword to MARC Mapping in the <a href="http://manual.koha-community.org/3.8/en/catadmin.html#keywordmapping">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Keyword to MARC Mapping in the <a href="http://manual.koha-community.org/3.10/en/catadmin.html#keywordmapping">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index f9bafcc..655e516 100644 (file)
@@ -19,6 +19,6 @@
        <li>By default all item types and all patrons are notified of check ins and check outs. To change this, click on the item/patron type combo that you would like to stop notices for.</li>
 </ul>
 
-<p><strong>See the full documentation for Item Circulation Alerts in the <a href="http://manual.koha-community.org/3.8/en/patscirc.html#itemcircalerts">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Item Circulation Alerts in the <a href="http://manual.koha-community.org/3.10/en/patscirc.html#itemcircalerts">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 6759063..03dcfe6 100644 (file)
@@ -57,6 +57,6 @@
 
 <p>You will not be able to delete item types that are being used by items within your system.</p>
 
-<p><strong>See the full documentation for Item Types in the <a href="http://manual.koha-community.org/3.8/en/basicparams.html#itemtypeadmin">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Item Types in the <a href="http://manual.koha-community.org/3.10/en/basicparams.html#itemtypeadmin">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 6b7c75a..b5fc55f 100644 (file)
@@ -12,6 +12,6 @@
 
 <p style="color: #990000;">Important: At this time you can map only 1 MARC field to 1 Koha field. This means that you won't be able to map both the 100a and the 700a to the author field, you need to choose one or the other.</p>
 
-<p><strong>See the full documentation for Koha to MARC Mapping in the <a href="http://manual.koha-community.org/3.8/en/catadmin.html#kohamarcmapping">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Koha to MARC Mapping in the <a href="http://manual.koha-community.org/3.10/en/catadmin.html#kohamarcmapping">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 65b53b9..ca8f434 100644 (file)
@@ -144,6 +144,6 @@ To edit the subfields associated with the tag, click 'Subfields' to the right of
       <li>To save your changes simply click the 'Save Changes' button at the top of the screen</li>
 </ul>
 
-<p><strong>See the full documentation for MARC Frameworks in the <a href="http://manual.koha-community.org/3.8/en/catadmin.html#marcbibframeworks">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for MARC Frameworks in the <a href="http://manual.koha-community.org/3.10/en/catadmin.html#marcbibframeworks">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index 3ba7a39..0ee89b8 100644 (file)
@@ -21,6 +21,6 @@
 
 <p>To the right of the new field is a link to 'Subfields,' you will need to add subfields before this tag will appear in your MARC editor.</p>
 
-<p><strong>See the full documentation for MARC Frameworks in the <a href="http://manual.koha-community.org/3.8/en/catadmin.html#marcbibframeworks">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for MARC Frameworks in the <a href="http://manual.koha-community.org/3.10/en/catadmin.html#marcbibframeworks">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 4e51c56..77e301a 100644 (file)
@@ -46,6 +46,6 @@
    <li>Required Match checks: none (remove the blank one)</li>
 </ul>
 
-<p><strong>See the full documentation for Record Matching Rules in the <a href="http://manual.koha-community.org/3.8/en/catadmin.html#recordmatchingrules">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Record Matching Rules in the <a href="http://manual.koha-community.org/3.10/en/catadmin.html#recordmatchingrules">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index 7e59c5a..979ac12 100644 (file)
@@ -18,6 +18,6 @@
 
 <p>And it is case sensitive : a record having 999$9 = 'xxx' will not belong to a set where condition is 999$9 = 'XXX'.</p>
 
-<p><strong>See the full documentation for OAI Sets in the <a href="http://manual.koha-community.org/3.8/en/catadmin.html#oaisetsconfig">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for OAI Sets in the <a href="http://manual.koha-community.org/3.10/en/catadmin.html#oaisetsconfig">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index 9944c40..f345b75 100644 (file)
@@ -29,6 +29,6 @@
 
 <p>Once you have configured all your sets, you have to build the sets. This is done by calling the script misc/migration_tools/build_oai_sets.pl.</p>
 
-<p><strong>See the full documentation for OAI Sets in the <a href="http://manual.koha-community.org/3.8/en/catadmin.html#oaisetsconfig">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for OAI Sets in the <a href="http://manual.koha-community.org/3.10/en/catadmin.html#oaisetsconfig">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index c14ee80..b41947a 100644 (file)
 <p>To add a new Patron Attribute Type, click the 'New Patron Attribute Type' button at the top of the page</p>
 
 <ul>
-     <li>In the 'Patron attribute type code', enter a short code to identify this field
+    <li>In the 'Patron attribute type code', enter a short code to identify this field
 <ul>
-        <li style="color: #990000;">Important: This field is limited to 10 characters (numbers and letters only)</li>
-  <li style="color: #990000;">Important: This setting cannot be changed after an attribute is defined</li>
+    <li style="color: #990000;">Important: This field is limited to 10 characters (numbers and letters only)</li>
+    <li style="color: #990000;">Important: This setting cannot be changed after an attribute is defined</li>
 </ul>
 </li>
        <li>In the 'Description' field, enter a longer (plain text) explanation of what this field will contain</li>
        <li>Check the box next to 'Repeatable' to let a patron record have multiple values of this attribute.
 <ul>
- <li style="color: #990000;">Important: This setting cannot be changed after an attribute is defined</li>
   <li style="color: #990000;">Important: This setting cannot be changed after an attribute is defined</li>
 </ul>
 </li>
        <li>If 'Unique identifier' is checked, the attribute will be a unique identifier which means, if a value is given to a patron record, the same value cannot be given to a different record.
 <ul>
- <li style="color: #990000;">Important: This setting cannot be changed after an attribute is defined</li>
   <li style="color: #990000;">Important: This setting cannot be changed after an attribute is defined</li>
 </ul>
 </li>
        <li>Check 'Allow password' to make it possible to associate a password with this attribute.</li>
        <li>Check 'Display in check-out' to make this attribute visible in the patron's short detail display on the left of the checkout screen and other patron pages</li>
        <li>Authorized value category; if one is selected, the patron record input page will only allow values to be chosen from the authorized value list.
 <ul>
- <li>You will first need to add an authorized value list for it to appear in this menu
   <li>You will first need to add an authorized value list for it to appear in this menu
 <ul>
-     <li><em>Get there: </em>More &gt; Administration &gt; Basic Parameters &gt; Authorized Values</li>
+    <li><em>Get there: </em>More &gt; Administration &gt; Basic Parameters &gt; Authorized Values</li>
 </ul>
 </li>
<li style="color: #990000;"> Important: an authorized value list is not enforced during batch patron import.</li>
   <li style="color: #990000;">Important: an authorized value list is not enforced during batch patron import.</li>
 </ul>
 </li>
-  <li>If you'd like to only show this attribute on patrons of one type choose that patron type from the 'Category' pull down</li>
-        <li>If you have a lot of attributes it might be handy to group them so that you can easily find them for editing. If you create an Authorized Value for PA_CLASS it will show in the 'Class' pull down and you can then change your attributes page to have sections of attributes</li>
+    <li>If you'd like to only show this attribute on patrons of one type choose that patron type from the 'Category' pull down</li>
+    <li>If you have a lot of attributes it might be handy to group them so that you can easily find them for editing. If you create an Authorized Value for PA_CLASS it will show in the 'Class' pull down and you can then change your attributes page to have sections of attributes</li>
        <li>Click Save to save your new attribute</li>
 </ul>
 
@@ -69,6 +69,6 @@
 
 <p>You will be unable to delete an attribute if it's in use.</p>
 
-<p><strong>See the full documentation for Patron Attribute Types in the <a href="http://manual.koha-community.org/3.8/en/patscirc.html#patronattributetypes">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Patron Attribute Types in the <a href="http://manual.koha-community.org/3.10/en/patscirc.html#patronattributetypes">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 7e5ae7e..6cd0f0e 100644 (file)
 
 <p>Each of the tabs on the left holds several different preferences:</p>
 
-       <ul>
-               <li><strong>Acquisitions:</strong> holds preferences related to acquisitions such as handling patron suggestions and local taxes.</li>
-               <li><strong>Administration:</strong> holds administrative preferences such as admin email address, sessions and timout.</li>
-               <li><strong>Authorities:</strong> holds preference related to handling authority records.</li>
-               <li><strong>Cataloging:</strong> holds preferences that control the cataloging functions.  This is where you choose your MARC flavor, set up Z39.50 and barcoding.</li>
-               <li><strong>Circulation:</strong> holds preferences that control circulation functions such as holds and  fines.</li>
-               <li><strong>Creators:</strong> this tab contains preferences related to modules that create objects.</li>
-          <li><strong>Enhanced Content:</strong> holds preferences that will add content from outside sources to your OPAC and Staff Client.  This is where you can turn on cover images, FRBR and tagging.</li>
-               <li><strong>I18N/L10N:</strong> holds preferences related to internationalization and localization such as date formats and languages.</li>
-           <li><strong>Local Use:</strong> this tab will usually be empty unless your library has a preference just for your library.</li>
-               <li><strong>Logs:</strong> turn on/off logging functionality in your system.</li>
-               <li><strong>OPAC:</strong> customize the OPAC and OPAC functions (aside from the Enhanced Content preferences).</li>
-               <li><strong>Patrons:</strong> holds preferences that control how your system handles patron functions.  Some preferences include the minimum password length and membership number settings.</li>
-               <li><strong>Searching:</strong> holds preference related to advanced search functions such as removing stop words or allowing stemming.</li>
-               <li><strong>Serials</strong> holds all preferences related to managing serial subscriptions.</li>
-              <li><strong>Staff Client:</strong> customize the staff client by editing the stylesheet and navigation menu.</li>
-              <li><strong>Web Services:</strong> includes preferences related to services like OAI-PMH.</li>
-       </ul>
+<ul>
+    <li><strong>Acquisitions:</strong> holds preferences related to acquisitions such as handling patron suggestions and local taxes.</li>
+    <li><strong>Administration:</strong> holds administrative preferences such as admin email address, sessions and timout.</li>
+    <li><strong>Authorities:</strong> holds preference related to handling authority records.</li>
+    <li><strong>Cataloging:</strong> holds preferences that control the cataloging functions. This is where you choose your MARC flavor, set up Z39.50 and barcoding.</li>
+    <li><strong>Circulation:</strong> holds preferences that control circulation functions such as holds and fines.</li>
+    <li><strong>Creators:</strong> this tab contains preferences related to modules that create objects.</li>
+    <li><strong>Enhanced Content:</strong> holds preferences that will add content from outside sources to your OPAC and Staff Client. This is where you can turn on cover images, FRBR and tagging.</li>
+    <li><strong>I18N/L10N:</strong> holds preferences related to internationalization and localization such as date formats and languages.</li>
+    <li><strong>Local Use:</strong> this tab will usually be empty unless your library has a preference just for your library.</li>
+    <li><strong>Logs:</strong> turn on/off logging functionality in your system.</li>
+    <li><strong>OPAC:</strong> customize the OPAC and OPAC functions (aside from the Enhanced Content preferences).</li>
+    <li><strong>Patrons:</strong> holds preferences that control how your system handles patron functions. Some preferences include the minimum password length and membership number settings.</li>
+    <li><strong>Searching:</strong> holds preference related to advanced search functions such as removing stop words or allowing stemming.</li>
+    <li><strong>Serials</strong> holds all preferences related to managing serial subscriptions.</li>
+    <li><strong>Staff Client:</strong> customize the staff client by editing the stylesheet and navigation menu.</li>
+    <li><strong>Web Services:</strong> includes preferences related to services like OAI-PMH.</li>
+</ul>
        
-<p><strong>See the full documentation for System Preferences in the <a href="http://manual.koha-community.org/3.8/en/administration.html#globalsysprefs">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for System Preferences in the <a href="http://manual.koha-community.org/3.10/en/administration.html#globalsysprefs">manual</a> (online).</strong></p>
        
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 926175a..cc5a39e 100644 (file)
@@ -10,6 +10,6 @@
 
 <p>When adding or editing a patron, if you have road types defined, there will be a pull down to choose the road type from.</p>
 
-<p><strong>See the full documentation for Road Types in the <a href="http://manual.koha-community.org/3.8/en/patscirc.html#roadtypes">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Road Types in the <a href="http://manual.koha-community.org/3.10/en/patscirc.html#roadtypes">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 583a637..e9552c5 100644 (file)
@@ -4,10 +4,6 @@
 
 <p>These rules define how your items are circulated, how/when fines are calculated and how holds are handled.</p>
 
-<ul>
-    <li><em>Get there:</em> More &gt; Administration &gt; Patrons &amp; Circulation &gt; Circulation and fines rules</li>
-</ul>
-
 <p>The rules are applied from most specific to less specific, using the first found in this order:</p>
 
 <ul>
        <li>all libraries, all patron types, all item types</li>
 </ul>
 
-<p style="background-color: #ffe599;">Tip: If you are a single library system choose your branch name before creating rules (sometimes having only rules for the 'all libraries' option can cause issues with holds)
+<p>Tip: If you are a single library system choose your library name before creating rules (sometimes having only rules for the 'all libraries' option can cause issues with holds)</p>
 
-<p style="color: #990000;">Important: At the very least you will need to set a default circulation rule. This rule should be set for all item types, all libraries and all patron categories. That will catch all instances that do not match a specific rule. When checking out if you do not have a rule for all libraries, all item types and all patron types then you may see patrons getting blocked from placing holds. You will also want a rule for your specific library set for all item types and all patron types to avoid this holds issue. Koha needs to know what rule to fall back on.
+<p style="color: #990000;">Important: At the very least you will need to set a default circulation rule. This rule should be set for all item types, all libraries and all patron categories. That will catch all instances that do not match a specific rule. When checking out if you do not have a rule for all libraries, all item types and all patron types then you may see patrons getting blocked from placing holds. You will also want a rule for your specific library set for all item types and all patron types to avoid this holds issue. Koha needs to know what rule to fall back on.</p>
 
-<h3>Default Circulation Rules</h3>
+<h4>Default Circulation Rules</h4>
 
-<p>Using the issuing rules matrix you can define rules that depend on patron/item type combos. To set your rules, choose a library from the pull down (or 'all libraries' if you want to apply these rules to all branches)</p>
+<p>Using the issuing rules matrix you can define rules that depend on patron/item typecombos. To set your rules, choose a library from the pull down (or 'all libraries' if you want to apply these rules to all libraries)</p>
 
 <p>From the matrix you can choose any combination of patron categories and item types to apply the rules to</p>
 
        <li>First choose which patron category you'd like the rule to be applied to. If you leave this to 'All' it will apply to all patron categories</li>
        <li>Choose the 'Item Type' you would like this rule to apply to. If you leave this to 'All' it will apply to all item types</li>
        <li>Limit the number of items a patron can have checked out at the same time by entering a number in the 'Current Checkouts Allowed' field</li>
-     <li>Define the period of time an item can be checked out to a patron by entering the number of units (days or hours) in the 'Loan Period' box.</li>
+    <li>Define the period of time an item can be checked out to a patron by entering the number of units (days or hours) in the 'Loan Period' box.</li>
     <li>Choose which unit of time, Days or Hours, that the loan period and fines will be calculate in</li>
-       <li>You can also define a hard due date for a specific patron category and item type. A hard due date ignores your usual circulation rules and makes it so that all items of the type defined are due on, before or after the date you specify.</li>
-   <li>'Fine Amount' should have the amount you would like to charge for overdue items
+    <li>You can also define a hard due date for a specific patron category and item type. A hard due date ignores your usual circulation rules and makes it so that allitems of the type defined are due on, before or after the date you specify.</li>
+    <li>'Fine Amount' should have the amount you would like to charge for overdue items
 <ul>
-       <li style="color: #990000;">Important: Enter only numbers and decimal points (no currency symbols).</li>
-
+    <li style="color: #990000;">Important: Enter only numbers and decimal points (no currency symbols).</li>
+</ul>
+</li>
+    <li>Enter the 'Fine Charging Interval' in the unit you set (ex. charge fines every 1 day, or every 2 hours)</li>
+    <li>The 'Fine Grace Period' is the period of time an item can be overdue before you start charging fines.
+<ul>
+    <li style="color: #990000;">Important: This can only be set for the Day unit, not in Hours</li>
 </ul>
 </li>
-  <li>Enter the 'Fine Charging Interval' in the unit you set (ex. charge fines every 1 day, or every 2 hours)</li>
-       <li>The 'Fine Grace Period' is the period of time an item can be overdue before you start charging fines.
+    <li>The 'Overdue Fines Cap' is the maximum fine for this patron and item combination
 <ul>
<li style="color: #990000;">Important: This can only be set for the Day unit, not in Hours</li>
   <li style="color: #990000;">Important: If this field is left blank then Koha will not put a limit on the fines this item will accrue. A maximum fine amount can be set using the MaxFinesystem preference.</li>
 </ul>
 </li>
     <li>If your library 'fines' patrons by suspending their account you can enter the number of days their fine should be suspended in the 'Suspension in Days' field
 <ul>
- <li style="color: #990000;">Important: This can only be set for the Day unit, not in Hours</li>
   <li style="color: #990000;">Important: This can only be set for the Day unit, not in Hours</li>
 </ul>
 </li>
     <li>Next decide if the patron can renew this item type and if so, enter how many times they can renew it in the 'Renewals Allowed' box</li>
     <li>If the patron can place holds on this item type, enter the total numbers of items (of this type) that can be put on hold in the 'Holds Allowed' field</li>
<li>Finally, if you charge a rental fee for the item type and want to give a specific patron type a discount on that fee, enter the percentage discount (without the % symbol) in the 'Rental Discount' field</li>
   <li>Finally, if you charge a rental feefor the item type and want to give a specific patron type a discount on that fee, enter the percentage discount (without the % symbol) in the 'Rental Discount' field</li>
 </ul>
 
 <p>When finished, click 'Add' to save your changes. To modify a rule, create a new one with the same patron type and item type. If you would like to delete your rule, simply click the 'Delete' link to the right of the rule.</p>
 
 <p>After choosing to clone you will be presented with a confirmation message.</p>
 
-<h3>Default Checkouts and Hold Policy</h3>
+<h4>Default Checkouts and Hold Policy</h4>
 
 <p>You can set a default maximum number of checkouts and hold policy that will be used if none is defined below for a particular item type or category.</p>
 
 <p>From this menu you can set a default to apply to all item types and patrons in the library.</p>
 
 <ul>
-  <li>In 'Total Current Checkouts Allowed' enter the total number of items patrons can have checked out at one time</li>
- <li>Control where patrons can place holds from using the 'Hold Policy' menu
+    <li>In 'Total Current Checkouts Allowed' enter the total number of items patrons can have checked out at one time</li>
   <li>Control where patrons can place holds from using the 'Hold Policy' menu
 <ul>
-       <li>From Any Library: Patrons from any library may put this item on hold. (default if none is defined)</li>
+    <li>From Any Library: Patrons from any library may put this item on hold. (default if none is defined)</li>
     <li>From Home Library: Only patrons from the item's home library may put this book on hold.</li>
-       <li>No Holds Allowed: No patron may put this book on hold.</li>
+    <li>No Holds Allowed: No patron may put this book on hold.</li>
 </ul>
 </li>
     <li>Control where the item returns to once it is checked in
 <ul>
-       <li>Item returns home</li>
-     <li>Item returns to issuing branch</li>
-        <li>Item floats
+    <li>Item returns home</li>
+    <li>Item returns to issuing library</li>
+    <li>Item floats
 <ul>
-   <li>When an item floats it stays where it was checked in and does not ever return 'home'</li>
+    <li>When an item floats it stays where it was checked in and does not ever return 'home'</li>
 </ul>
 </li>
 </ul>
        <li>Once your policy is set, you can unset it by clicking the 'Unset' link to the right of the rule</li>
 </ul>
 
-<h3>Checkouts Per Patron</h3>
+<h4>Checkouts Per Patron</h4>
 
 <p>For this library, you can specify the maximum number of loans that a patron of a given category can make, regardless of the item type.</p>
 
-<p style="background-color: #ffe599;">Tip: If the total amount loanable for a given patron category is left blank, no limit applies, except possibly for a limit you define for a specific item type.</p>
+<p>Tip: If the total amount loanable for a given patron category is left blank, no limit applies, except possibly for a limit you define for a specific item type.</p>
 
-<h3>Item Hold Policies</h3>
+<h4>Item Hold Policies</h4>
 
-For this library, you can edit rules for given itemtypes, regardless of the patron's category. Currently, this means hold policies.
+<p>For this library, you can edit rules for given itemtypes, regardless of the patron's category. Currently, this means hold policies.</p>
 
 <p>The various Hold Policies have the following effects:</p>
 
 <ul>
-   <li>From Any Library: Patrons from any library may put this item on hold. (default if none is defined)</li>
+    <li>From Any Library: Patrons from any library may put this item on hold. (default if none is defined)</li>
     <li>From Home Library: Only patrons from the item's home library may put this book on hold.</li>
-       <li>No Holds Allowed: No patron may put this book on hold.</li>
+    <li>No Holds Allowed: No patron may put this book on hold.</li>
 </ul>
 
-<p style="color: #990000;">Important: Note that if the system preference AllowHoldPolicyOverride set to 'allow', these policies can be overridden by your circulation staff.</p>
+<p style="color: #990000;">Important: Note that if the system preference AllowHoldPolicyOverrideset to 'allow', these policies can be overridden by your circulation staff.</p>
 
-<p style="color: #990000;">Important: These policies are based on the patron's home branch, not the branch that the reserving staff member is from.</p>
+<p style="color: #990000;">Important: These policies are based on the patron's home library, not the library that the reserving staff member is from.</p>
 
 <p>The various Return Policies have the following effects:</p>
 
 <ul>
- <li>Item returns home: The item will prompt the librarian to transfer the item to its home library
   <li>Item returns home: The item will prompt the librarian to transfer the item to its home library
 <ul>
-        <li style="color: #990000;">Important: If the AutomaticItemReturn preference is set to automatically transfer the items home, then a prompt will not appear</li>
+    <li style="color: #990000;">Important: If the AutomaticItemReturnpreference is set to automatically transfer the items home, then a prompt will not appear</li>
 </ul>
 </li>
-   <li>Item returns to issuing branch: The item will prompt the librarian to transfer the item back to the library where it was checked out
+    <li>Item returns to issuing library: The item will prompt the librarian to transfer the item back to the library where it was checked out
 <ul>
-  <li style="color: #990000;">Important: If the AutomaticItemReturn preference is set to automatically transfer the items home, then a prompt will not appear</li>
+    <li style="color: #990000;">Important: If the AutomaticItemReturnpreference is set to automatically transfer the items home, then a prompt will not appear</li>
 </ul>
 </li>
-   <li>Item floats: The item will not be transferred from the branch it was checked in at, instead it will remain there until transferred manually or checked in at another branch</li>
+    <li>Item floats: The item will not be transferred from the library it was checked in at, instead it will remain there until transferred manually or checked in at another library</li>
 </ul>
 
-<p><strong>See the full documentation for Circulation and Fine Rules in the <a href="http://manual.koha-community.org/3.8/en/patscirc.html#circfinerules">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Circulation and Fine Rules in the <a href="http://manual.koha-community.org/3.10/en/patscirc.html#circfinerules">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index bbdda18..05e1640 100644 (file)
@@ -12,6 +12,6 @@
 
 <p style="color: #990000">Important: If you change something in this table, ask your administrator to run misc/batchRebuildBiblioTables.pl script.</p>
 
-<p><strong>See the full documentation for Stop Words in the <a href="http://manual.koha-community.org/3.8/en/additionaladmin.html#stopwordsadmin">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Stop Words in the <a href="http://manual.koha-community.org/3.10/en/additionaladmin.html#stopwordsadmin">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/transport-cost-matrix.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/transport-cost-matrix.tt
new file mode 100644 (file)
index 0000000..9e6486c
--- /dev/null
@@ -0,0 +1,15 @@
+[% INCLUDE 'help-top.inc' %]
+
+<h1>Transport cost matrix</h1>
+
+<p>The Transport cost matrix lets a library system define relative costs to transport books to one another. In order for the system to use this matrix you must first set the UseTransportCostMatrix preference to 'Use'.</p>
+
+<p>Costs are decimal values between some arbitrary maximum value (e.g. 1 or 100) and 0 which is the minimum (no) cost. For example, you could just use the distance between each library in miles as your 'cost', if that would accurately reflect the cost of transferring them. Perhaps post offices would be a better measure. Libraries sharing a post office would have a cost of 1, adjacent post offices would have a cost of 2, etc.</p>
+
+<p>To enter transport costs simply click in the cell you would like to alter, uncheck the 'Disable' box and enter your 'cost'</p>
+
+<p>After entering in your cost, hit 'Enter' on your keyboard or click the 'Save' button at the bottom of the matrix to save your changes.</p>
+
+<p><strong>See the full documentation for the Transport Cost Matrix in the <a href="http://manual.koha-community.org/3.10/en/patscirc.html#transportcostmatrix">manual</a> (online).</strong></p>
+
+[% INCLUDE 'help-bottom.inc' %]
index 431f9f7..df8cbad 100644 (file)
@@ -22,8 +22,6 @@
 <p>The following targets have been used successfully by other Koha libraries (in the Americas):</p>
 
 <ul>
-       <li>BIBLIOS z3950.biblios.net:210 bibliographic</li>
-       <li>BIG COUNTRY KOHA bcls.kohalibrary.com:210 bcls_koha</li>
        <li>CUYAHOGA COUNTY PUBLIC webcat.cuyahoga.lib.oh.us:210 INNOPAC</li>
        <li>GREATER SUDBURY PUBLIC 216.223.90.51:210 INNOPAC</li>
        <li>HALIFAX PUBLIC catalogue.halifaxpubliclibraries.ca:210 horizon</li>
@@ -38,6 +36,6 @@
        <li>VANCOUVER PUBLIC LIBRARY z3950.vpl.ca:210 Horizon</li>
 </ul>
 
-<p><strong>See the full documentation for Z39.50 Servers in the <a href="http://manual.koha-community.org/3.8/en/additionaladmin.html#z3950admin">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Z39.50 Servers in the <a href="http://manual.koha-community.org/3.10/en/additionaladmin.html#z3950admin">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index b774993..5b01b23 100644 (file)
@@ -12,7 +12,9 @@
 
 <p>Clicking on the authority record summary will open the full record and the option to edit the record.</p>
 
-<p><strong>See the full documentation for Authorities in the <a href="http://manual.koha-community.org/3.8/en/catauthorities.html">manual</a> (online).</strong></p>
+<p>If the authority has See Alsos in it you will see those broken out on the search results, clicking the linked headings will run a search for that heading instead.</p>
+
+<p><strong>See the full documentation for Authorities in the <a href="http://manual.koha-community.org/3.10/en/catauthorities.html">manual</a> (online).</strong></p>
 
 
 [% INCLUDE 'help-bottom.inc' %]
index 07d1624..91f72b4 100644 (file)
@@ -2,11 +2,15 @@
 
 <h2>Adding Authorities</h2>
 
-<p>To add a new authority record, choose the authority type from the 'New Authority' button.</p>
+<p>To add a new authority record, choose the authority type from the 'New Authority' button.,/p>
 
 <p>The form that appears will allow you to enter all of the necessary details regarding your authority record.</p>
 
-<p>To expand collapsed values simply click on the title and the subfields will appear.</p>
+<p>To expand collapsed values simply click on the title and the subfields will appear. To duplicate a field or subfield just click the plus sign (+) to the right of the label. To use field helper plugins simply click the ellipsis (...) to the right of the field.</p>
+
+<p>When linking authorities to other headings, you can use the authority finder plugin by clicking the ellipsis (...) to the right of the field.</p>
+
+<p>From there you can search your authority file for the authority to link. If you can't find the authority to link, you can click the 'Create new' button and add the necessary authority for the link. This plugin also allows for you to choose the link relationship between the authorities.</p>
 
 <h2>Editing Authorities</h2>
 
@@ -16,6 +20,6 @@
 
 <p>To delete an authority record you first must make sure it's not linked to any bibliographic records. If it is not used by any bibliographic records a 'Delete' link will appear to the right of the record on the search results and as a button that appears after clicking on the summary of the authority record.</p>
 
-<p><strong>See the full documentation for Authorities in the <a href="http://manual.koha-community.org/3.8/en/catauthorities.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Authorities in the <a href="http://manual.koha-community.org/3.10/en/catauthorities.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 3d43ba7..b0f307f 100644 (file)
@@ -12,6 +12,8 @@
 
 <p>Clicking on the authority record summary will open the full record and the option to edit the record.</p>
 
-<p><strong>See the full documentation for Authorities in the <a href="http://manual.koha-community.org/3.8/en/catauthorities.html">manual</a> (online).</strong></p>
+<p>If the authority has See Alsos in it you will see those broken out on the search results, clicking the linked headings will run a search for that heading instead.</p>
+
+<p><strong>See the full documentation for Authorities in the <a href="http://manual.koha-community.org/3.10/en/catauthorities.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/catalogue/detail.tt
new file mode 100644 (file)
index 0000000..fe07270
--- /dev/null
@@ -0,0 +1,9 @@
+[% INCLUDE 'help-top.inc' %]
+
+<h1>Record detail</h1>
+
+<p>In Koha the bibliographic record contains the main information related to the material. This includes things like the title, author, ISBN, etc. This information is stored in Koha in Marc (different flavors of Marc are supported in Koha). Once this information is saved, items or holdings can be attached.</p>
+
+<p><strong>See the full documentation for Cataloging in the <a href="http://manual.koha-community.org/3.10/en/cataloging.html#catbibs">manual</a> (online).</strong></p>
+
+[% INCLUDE 'help-bottom.inc' %]
index a763f37..98b70be 100644 (file)
@@ -6,6 +6,6 @@
 
 <p>Below the 'History' heading is a link to 'View item's checkout history,' clicking that will open up the item's history which will look slightly different from the bibliographic record's history page.</p>
 
-<p><strong>See the full documentation for Item Checkout History in the <a href="http://manual.koha-community.org/3.8/en/catitems.html#itemcirchistory">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Item Checkout History in the <a href="http://manual.koha-community.org/3.10/en/catitems.html#itemcirchistory">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 7eae764..d69c717 100644 (file)
@@ -18,6 +18,6 @@
 
 <p>Below the 'History' heading is a link to 'View item's checkout history,' clicking that will open up the item's history which will look slightly different from the bibliographic record's history page.</p>
 
-<p><strong>See the full documentation for Item Records in the <a href="http://manual.koha-community.org/3.8/en/catitems.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Item Records in the <a href="http://manual.koha-community.org/3.10/en/catitems.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 38d1b3e..dcc5ade 100644 (file)
@@ -68,6 +68,6 @@
 <li>ctype:w Law reports and digests</li>
 <li>ctype:z Treaties</li></ul>
 
-<p><strong>See the full documentation for Searching in the <a href="http://manual.koha-community.org/3.8/en/searching.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Searching in the <a href="http://manual.koha-community.org/3.10/en/searching.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 5ef851c..32a7370 100644 (file)
@@ -5,7 +5,7 @@
 <p>Records can be added to Koha via original or copy cataloging. If you would like to catalog a record using a blank template</p>
 
 <ul>
-    <li>Click 'New record'
+    <li>Click 'New Record'
 <ul>
        <li>Choose the framework you would like to base your record off of</li>
 </ul>
 <p>If you want to catalog a record based on an existing record at another library</p>
 
 <ul>
-    <li>Click 'Z39.50 search'
+    <li>Click 'z39.50 Search'
 <ul>
        <li>Search for the item you would like to catalog
 <ul>
        <li>Tip: If no results are found, try searching for fewer fields, not all Z39.50 targets can search all of the fields above.</li>
 </ul>
 </li>
-    <li>Search targets can be altered by using the Z39.50 admin area.</li>
-    <li>From the results you can view the MARC or Card view for the records or choose to import them into Koha
+    <li>Search targets can be altered by using the Z39.50 Admin area.</li>
+    <li>From the results you can view the MARC or Card view for the records or choose to Import them into Koha
 <ul>
-    <li>In addition to the 'Import' link to the right of each title, you can click on the title you're interested in and a menu will pop up with links to preview the record and import it</li>
-    <li>If you don't find the title you need in your Z39.50 search results you can click the 'Try another search' button at the bottom left of your results</li>
+    <li>In addition to the Import link to the right of each title, you can click on the title you're interested in and a menu will pop up with links to preview the record and import it</li>
+    <li>If you don't find the title you need in your Z39.50 search results you can click the 'Try Another Search' button at the bottom left of your results</li>
 </ul>
 </li>
 </ul>
 
 <ul>
        <li>To expand a collapsed tag click on the tag description</li>
-    <li>To get help from the Library of Congress on a MARC tag click the question mark (?) to the right of each field number
+    <li>To get help from the Library of Congress on a Marc tag click the question mark (?) to the right of each field number
 <ul>
        <li>If you feel that this clutters the screen you can hide the question marks by unchecking the box next to the 'Show MARC tag documentation links' note at the top right of the editor</li>
 </ul>
 </li>
-       <li>Sometimes fields may not be editable due to the value in your BiblioAddsAuthorities system preference. If you have this preference set to not allow catalogers to type in fields controlled by authorities you may see a lock symbol to the left of the field.
+    <li>Sometimes fields may not be editable due to the value in your <span class="link">BiblioAddsAuthorities</span>system preference. If you have this preference set to not allow catalogers to type in fields controlled by authorities you may see a lock symbol to the left of the field.
 <ul>
        <li>If this icon appears you must click the icon to the right of the field to search for an existing authority.</li>
        <li>From the results list click 'Choose authority' to bring that into your catalog record</li>
@@ -89,6 +89,6 @@
 
 <p>If you would like to merge together multiple records you can do that via the Lists tool.</p>
 
-<p><strong>See the full documentation for Cataloging in the <a href="http://manual.koha-community.org/3.8/en/cataloging.html#catbibs">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Cataloging in the <a href="http://manual.koha-community.org/3.10/en/cataloging.html#catbibs">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index e394ae7..c92ef8b 100644 (file)
@@ -1,17 +1,36 @@
 [% INCLUDE 'help-top.inc' %]
 
-<h1>Cataloging help</h1><h2>How to edit a bibliographic record?</h2>
+<h1>Cataloging</h1>
 
-<p>To edit a bibliographic record, use the cataloging search to find the record. This can be done either via the cataloging interface or the catalog search. A search with in the Cataloging module will search the catalog and the reservoir (see below).</p>
+<p>Before you start cataloging in Koha you're going to want to do some basic setup. Refer to the Implementation Checklist for a full list of these things. Most importantly you're going to want to make sure that your Frameworks are all defined the way you want. Once in the cataloging module you will not be able to add or remove fields and subfields so your frameworks must be ready before you start cataloging.</p>
 
-<h2>How to add a new bibliographic record?</h2>
+<p>From here you can add new bibliographic records to Koha.</p>
 
-<p>Use the &quot;New Record&quot; button to add a new record. Choose the framework that you will use to shape the bibliographic record. Frameworks are cataloging templates that can be created and edited under &quot;System Admininstration&quot;.</p>
+<p>Records can be added to Koha via original or copy cataloging. If you would like to catalog a record using a blank template</p>
 
-<h2>How to add new items to a record?</h2>
+<ul>
+    <li>Click 'New Record'</li>
+    <li>Choose the framework you would like to base your record off of</li>
+</ul>
 
-<p>A bibliographic record needs items or holdings for it to show in the OPAC. There are two ways to add new items to a bibliographic record:</p><ol><li><strong>Through Cataloging</strong>. After adding the new bibliographic record, you will be given the option to add items to the record. One record can have many items. </li><li><strong>Through Acquisitions</strong>.&nbsp; Items can be added to orders in acquisitions. Item details are added upon receiving the item. Using the acquisitions module for adding items allows you to track the libraries spend against funds and budgets. </li></ol><h2>What is the reservoir?</h2>
+<p>If you want to catalog a record based on an existing record at another library</p>
+
+<ul>
+    <li>Click 'z39.50 Search'</li>
+    <li>Search for the item you would like to catalog</li>
+    <li>Tip: If no results are found, try searching for fewer fields, not all Z39.50 targets can search all of the fields above.</li>
+    <li>Search targets can be altered by using the Z39.50 Admin area.</li>
+    <li>From the results you can view the MARC or Card view for the records or choose to Import them into Koha
+<ul>
+    <li>In addition to the Import link to the right of each title, you can click on the title you're interested in and a menu will pop up with links to preview the record and import it</li>
+</ul>
+</li>
+    <li>If you don't find the title you need in your Z39.50 search results you can click the 'Try Another Search' button at the bottom left of your results</li>
+</ul>
+
+<p>Once you've opened a blank framework or imported a record via Z39.50 you will be presented with the form to continue cataloging</p>
+
+<p><strong>See the full documentation for Cataloging in the <a href="http://manual.koha-community.org/3.10/en/cataloging.html">manual</a> (online).</strong></p>
 
-<p>The reservoir is a holding area for bibilographic records that are not yet used in the library catalog.&nbsp; When an item arrives that matches a record in the reservoir, the two can be matched and the bibliographic pulled from the reservoir into the main catalog.</p><p>The reservoir can be populated with MARC records through the &quot;Stage MARC Records for Import&quot; under Tools.</p> 
 [% INCLUDE 'help-bottom.inc' %]
 
index 9ee0458..0306ddc 100644 (file)
        <li>y - Koha item type</li>
 </ul>
 
+<p>To make sure that these values are filled in you can mark them as mandatory in the framework you're using and then they will appear in red with a 'required' label. The item will not save until the required fields are filled in.</p>
+
+<p>Tip: To make item subfields required in a framework you'll want to edit the 952 field in the framework editor.</p>
+
 <p>Below the add form there are 3 buttons for adding the item</p>
 
 <ul>
 <p>Items can be edited in several ways.</p>
 
 <ul>
-    <li>Clicking 'Edit' and 'Edit items' from the bibliographic record</li>
-    <li>Clicking 'Edit items' beside the item on the 'Items' tab</li>
+    <li>Clicking 'Edit' and 'Edit Items' from the bibliographic record
+<ul>
+    <li>Which will open up a list of items where you can click 'Edit' to the left of the specific item you would like to edit.</li>
+</ul>
+</li>
+    <li>Clicking 'Edit Items' beside the item on the 'Items' tab
+<ul>
+    <li>Which will open up a list of items where you can click 'Edit' to the left of the specific item you would like to edit.</li>
+</ul>
+</li>
+    <li>Clicking 'Edit' and then 'Edit items in batch'
+<ul>
+    <li>This will open up the batch item modification tool where you can edit all of the items on this record as a batch.</li>
+</ul>
+</li>
 </ul>
 
 <p>The edit menu is also where items can be deleted from</p>
@@ -57,6 +74,6 @@
 
 <p>Finally you can use the batch delete tool to delete a batch of items.</p>
 
-<p><strong>See the full documentation for Adding/Editing Items in the <a href="http://manual.koha-community.org/3.8/en/catitems.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Adding/Editing Items in the <a href="http://manual.koha-community.org/3.10/en/catitems.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/cataloguing/linkitem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/cataloguing/linkitem.tt
new file mode 100644 (file)
index 0000000..66cfdf2
--- /dev/null
@@ -0,0 +1,32 @@
+[% INCLUDE 'help-top.inc' %]
+
+<h1>Analytics</h1>
+
+<p>Libraries sometimes make journal articles and articles within monographs and serials accessible to library patrons through analytics cataloging. Analytics cataloging creates separate bibliographic records for these articles, chapters, sections, etc. found within a larger resource such as a book, an article within a journal, newspaper or serial. In analytics cataloging, although a separate bib record is created for the title, it is not physically separated from the host item.  Learn more about Analytics in Chapter 13 of AACR2.</p>
+
+<p>If you would like to catalog analytic records in Koha you first need to update the EasyAnalyticalRecords preference to 'Display.'</p>
+
+<p>After cataloging your analytic record (see Adding Records for more on creating records) click 'Edit' from the normal view and choose to 'Link to Host Item'</p>
+
+<p>This will prompt you to enter the barcode for the item this record should be linked to.</p>
+
+<p>After entering the item's barcode and clicking 'Select' you will receive a confirmation message.</p>
+
+<p>The record will now have the 773 field filled in properly to complete the link.</p>
+
+<p>If you have linked an analytic record incorrectly you can remove that link by editing the item on the analytic record (not the host record). To do this, go to the analytic record and click the 'Edit' button and choose to 'Edit items'. To the left of each item you will see two options.</p>
+
+<ul>
+    <li>Clicking 'Edit in Host' will allow you to edit the item on the host record.</li>
+    <li>Clicking 'Delink' will remove the 773 field and the link between the analytic and the host.</li>
+</ul>
+
+<p>To view all of the items tied to the host record, do a search for the record, click the Analytics tab on the left and the analytics tied to each barcode will be shown under the "Used in" column.</p>
+
+<p>Tip: It is also possible to create analytic records from this screen by clicking on "Create Analytics"</p>
+
+<p>You can also see the analytics attached to this record by clicking the 'Show Analytic' link towards the top of the record in the normal view.</p>
+
+<p><strong>See the full documentation for Analytics in the <a href="http://manual.koha-community.org/3.10/en/cataloging.html#cataloganalytics">manual</a> (online).</strong></p>
+
+[% INCLUDE 'help-bottom.inc' %]
index 5c5e1cb..1719753 100644 (file)
@@ -18,6 +18,6 @@
 
 <p style="color: rgb(153, 0, 0);">Important: It is important to rebuild your zebra index immediately after merging records. If a search is performed for a record which has been deleted Koha will present the patrons with an error in the OPAC.</p>
 
-<p><strong>See the full documentation for Merging Items in the <a href="http://manual.koha-community.org/3.8/en/stafflists.html#mergebibrecs">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Merging Items in the <a href="http://manual.koha-community.org/3.10/en/stafflists.html#mergebibrecs">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index eab515a..dc29e28 100644 (file)
@@ -10,6 +10,6 @@
 
 <p>If you want to move all items to a new record creating only one bibliographic record you can use the 'Merge records' tool instead.</p>
 
-<p><strong>See the full documentation for Moving Items in the <a href="http://manual.koha-community.org/3.8/en/catitems.html#moveitemrec">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Moving Items in the <a href="http://manual.koha-community.org/3.10/en/catitems.html#moveitemrec">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index 8808c90..699643a 100644 (file)
@@ -2,17 +2,12 @@
           
 <h1>Overdues with Fines</h1>
 
-<p>This report shows items that:
-<ul>
-    <li>are still checked out,</li>
-    <li>have not had a notice sent, and</li>
-    <li>already have an associated fine (type &quot;FU&quot;).</li>
-</ul>
+<p>This report will show you any overdues at your library that have accrued fines on them.</p>
 
-<p>This report will not show items that are so long overdue that the system has marked them 'Lost'</p>
+<p>If you would like to limit the report you can use the pull down menu at the top to limit to a specific shelving location at your library. To see overdues with fines at other libraries you will have to change your library or log in at that library.</p>
 
-<p>Once open the report can be filtered by the shelving location.</p>
+<p style="color: #990000">Important: If you do not charge fines and/or don't have the fines cron job running you will see no data on this report.</p>
 
-<p><strong>See the full documentation for Overdues with Fines in the <a href="http://manual.koha-community.org/3.8/en/circreports.html#overduesfines">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Overdues with Fines in the <a href="http://manual.koha-community.org/3.10/en/circreports.html#overduesfines">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 5e7e339..dd4c6a0 100644 (file)
@@ -21,6 +21,6 @@
 </li>
 </ul>
 
-<p><strong>See the full documentation for Transfers in the <a href="http://manual.koha-community.org/3.8/en/transfers.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Transfers in the <a href="http://manual.koha-community.org/3.10/en/transfers.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index 07f0b68..f298727 100644 (file)
@@ -20,6 +20,6 @@
 
 <p style="background-color: #ffe599">Tip: Mac users use the OPTION button in place of ALT</p>
 
-<p><strong>See the full documentation for Circulation in the <a href="http://manual.koha-community.org/3.8/en/circulation.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Circulation in the <a href="http://manual.koha-community.org/3.10/en/circulation.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index e5bb318..3836a06 100644 (file)
 
 <p style="background-color: #ffe599"><strong>Tip</strong> If the checked out time is listed as 00:00 then the item is a daily loan item. The due time for daily checkouts will show 23:59 which is the last minute of the day.</p>
 
+<p>If you have set your ExportWithCsvProfile preference, you will also see the option to export the patron's current checkout information using a CSV Profile or ISO2709 (MARC21) format.</p>
+
 <p>Also at the bottom of the page is the list of items the patron has on hold</p>
 
-<p>From the holds list you can suspend or resume patrons holds using the options at the bottom of the list.</p>
+<p>From the holds list you can suspend or resume patrons holds using the options at the bottom of the list if you have the SuspendHoldsIntranet preference set to 'allow.'</p>
+
+<p>Note: If you have your AutoResumeSuspendedHolds preference set to "Don't allow" then you will not have the option to put an end date on the hold suspension.</p>
 
 <p>If there are notes on the patron record these will appear to the right of the checkout box</p>
 
@@ -41,7 +45,7 @@
 
 <p>If you choose 'Print slip' it will print all of the items the patron has checked out, including those they checked out at an earlier date. Choosing 'Print quick slip' will print only the items that were checked out today.</p>
 
-<p>What prints on the slips can be customized by altering the slip templates under the Notices Slips tool.</p>
+<p>What prints on the slips can be customized by altering the slip templates under the Notices Slips tool.</p>
 
 <h3>Clear Patron Information</h3>
 
     <li>Learn more about fast cataloging later in this manual.</li>
 </ul>
 </li>
+    <li>Item being checked out is marked as 'lost'
+<ul>
+    <li>Depending on the value in your IssueLostItem preference, you may just see a warning or a confirmation box</li>
+</ul>
+</li>
+    <li>Item being checked out is not recommended for a patron of this age</li>
+    <li>Item being checked out meets the decreaseLoanHighHolds system preference criteria</li>
 </ul>
 
 <h2>Fast Add Cataloging</h2>
 
 <p>Circulation messages meant for the patron will appear when they log into the OPAC.</p>
 
-<p><strong>See the full documentation for Checking Out in the <a href="http://manual.koha-community.org/3.8/en/circulation.html#checkingout">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Checking Out in the <a href="http://manual.koha-community.org/3.10/en/circulation.html#checkingout">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index 5e847b5..7f99a0c 100644 (file)
@@ -11,6 +11,6 @@
        <li style="background-color: #ffe599">Tip: Large libraries can choose to filter the report before it runs by setting the FilterBeforeOverdueReport system preference to 'Require'.</li>
 </ul>
 
-<p><strong>See the full documentation for Overdues in the <a href="http://manual.koha-community.org/3.8/en/circreports.html#overduesreport">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Overdues in the <a href="http://manual.koha-community.org/3.10/en/circreports.html#overduesreport">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index bbd0d28..b6a5e29 100644 (file)
@@ -2,27 +2,10 @@
 
 <h1>Holds to Pull</h1>
 
-<p>This report will show you all of the items that have holds on them that are available at the library for pulling.</p>
-
-<p>This report will be generated based on a few system preferences:</p>
-
-<ul>
-       <li>StaticHoldsQueueWeight
-<ul>
-       <li>Allows the library to specify a list of library location codes -- if used alone, it will rank the list statically, selecting the top-ranking available location to be added to the picklist.</li>
-</ul>
-</li>
-       <li>RandomizeHoldsQueueWeight
-<ul>
-    <li>If 'RandomizeHoldsQueueWeight' and 'StaticHoldsQueueWeight' are set, the list of library codes in the 'StaticHoldsQueueWeight' system preference are randomized rather than statically ranked. If RandomizeHoldsQueueWeight alone is set, the list of all available library codes is used to randomize the weight.</li>
-</ul>
-</li>
-</ul>
-
-<p>If neither 'RandomizeHoldsQueueWeight' or 'StaticHoldsQueueWeight' is set, the holds queue is statically ranked according to how they are pulled out of the system database.</p>
+<p>This report will show you all of the items that have holds on them that are available at the library for pulling. If the items are available at multiple libraries then all libraries with that item available will see the hold to pull until one library triggers the hold.</p>
 
 <p>You can limit the results you see by using the Refine box on the left side of the page</p>
 
-<p><strong>See the full documentation for Holds to Pull in the <a href="http://manual.koha-community.org/3.8/en/circreports.html#holdspull">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Holds to Pull in the <a href="http://manual.koha-community.org/3.10/en/circreports.html#holdspull">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 1582fe5..dee539d 100644 (file)
@@ -4,7 +4,7 @@
 
 <p>Hold ratios help with collection development. Using this report you will be able to see how many of your patrons have holds on items and whether you should buy more. By default it will be set to the library needing 3 items per hold that has been placed. The report will tell you how many additional items need to be purchased to meet this quota.</p>
 
-<p><strong>See the full documentation for Hold Ratios in the <a href="http://manual.koha-community.org/3.8/en/circreports.html#holdratios">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Hold Ratios in the <a href="http://manual.koha-community.org/3.10/en/circreports.html#holdratios">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
 
index f848ff0..1e0a0c4 100644 (file)
 <p>There are several messages that can appear when checking items in:</p>
 
 <ul>
-    <li>If you are checking an item in at a library other than the home branch, a message will appear asking you to transfer the book to the home library
+    <li>If you are checking an item in at a library other than the home library, a message will appear asking you to transfer the book to the home library
 <ul>
        <li>After this item is checked in the status of the item will be changed in the catalog to 'in transit'</li>
-    <li>To mark an item as back at the home branch, check the item in at the home branch
+    <li>To mark an item as back at the home library, check the item in at the home library
 <ul>
-    <li>A message will appear tell you that the item is not checked out, but the status will now say available in the catalog. This step is necessary to mark items as received by the home branch.</li>
+    <li>A message will appear tell you that the item is not checked out, but the status will now say available in the catalog. This step is necessary to mark items as received by the home library.</li>
 </ul>
 </li>
 </ul>
@@ -46,7 +46,7 @@
     <li>Ignoring the hold will leave the item on hold, but leave its status as Available (it will not cancel the hold)</li>
 </ul>
 </li>
-    <li>If you're checking in an item that has a hold on it at another branch you will be prompted to confirm and transfer the item
+    <li>If you're checking in an item that has a hold on it at another library you will be prompted to confirm and transfer the item
 <ul>
     <li>Clicking the Confirm hold and Transfer button will mark the item as in transit to the library where the hold was placed</li>
     <li>Clicking the Print Slip, Transfer and Confirm button will mark the item as in transit to the library where the hold was placed and present the library with a receipt to print and place on the book with the patron's information</li>
@@ -61,7 +61,7 @@
 
 <p>When you check in an item that has a hold on it the system will ask you to either confirm and transfer the item or just confirm the hold</p>
 
-<p>Clicking the Confirm button will mark the item as on hold for the patron. If the item needs to be transferred the item will also be marked as in transit to the proper branch. Clicking 'Ignore' will retain the hold, but allow you to check the item out to another patron. Choosing to confirm and print will present you with a printable page that you can slip inside the book with the necessary hold and/or transfer information.</p>
+<p>Clicking the Confirm button will mark the item as on hold for the patron. If the item needs to be transferred the item will also be marked as in transit to the proper library. Clicking 'Ignore' will retain the hold, but allow you to check the item out to another patron. Choosing to confirm and print will present you with a printable page that you can slip inside the book with the necessary hold and/or transfer information.</p>
 
 <p>Once confirmed the hold will show on the patron record and on the checkout screen under the 'Hold' tab.</p>
 
@@ -71,6 +71,6 @@
 
 <p>From here you can check the item out to the patron at the desk and cancel the hold for the patron.</p>
 
-<p><strong>See the full documentation for Checking In in the <a href="http://manual.koha-community.org/3.8/en/checkingin.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Checking In in the <a href="http://manual.koha-community.org/3.10/en/checkingin.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index 1fbefd4..d0d8954 100644 (file)
@@ -8,6 +8,6 @@
 
 <p>Once you have saved your changes you new library will appear in the top right.</p>
 
-<p><strong>See the full documentation for Setting your Library in the <a href="http://manual.koha-community.org/3.8/en/setlibrary.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Setting your Library in the <a href="http://manual.koha-community.org/3.10/en/setlibrary.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 5b2b567..09b44ec 100644 (file)
@@ -8,6 +8,6 @@
 
 <p style="color: #990000">Important: An item is considered late based on the number of days you have entered in the TransfersMaxDaysWarning system preference.</p>
 
-<p><strong>See the full documentation for Transfers to Receive in the <a href="http://manual.koha-community.org/3.8/en/circreports.html#transferstoreceive">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Transfers to Receive in the <a href="http://manual.koha-community.org/3.10/en/circreports.html#transferstoreceive">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 9e9c730..29be871 100644 (file)
@@ -2,8 +2,22 @@
 
 <h1>Holds Queue</h1>
 
-<p>This report will show you all of the holds at your library. To generate this report, you must have the Build Holds Queue cron job running.</p>
+<p>This report will show you all of the holds at your library.</p>
 
-<p><strong>See the full documentation for the Holds Queue in the <a href="http://manual.koha-community.org/3.8/en/circreports.html#holdsqueue">manual</a> (online).</strong></p>
+<p>To generate this report, you must have the Build Holds Queue cron job running. This cron job is a script that should be run periodically if your library system allows borrowers to place on-shelf holds. This script decides which library should be responsible for fulfilling a given hold request.</p>
+
+<p>It's behavior is controlled by the system preferences StaticHoldsQueueWeight and RandomizeHoldsQueueWeight.</p>
+
+<p>If you do not want all of your libraries to participate in the on-shelf holds fulfillment process, you should list the the libraries that *do* participate in the process here by inputting all the participating library's branchcodes, separated by commas ( e.g. "MPL,CPL,SPL,BML" etc. ).</p>
+
+<p>By default, the holds queue will be generated such that the system will first attempt to hold fulfillment using items already at the pickup library if possible. If there are no items available at the pickup library to fill a hold, build_holds_queue.pl will then use the list of libraries defined in StaticHoldsQueueWeight. If RandomizeHoldsQueueWeight is disabled ( which it is by default ), the script will assign fulfillment requests in the order the libraries are placed in the StaticHoldsQueueWeight system preference.</p>
+
+<p>For example, if your system has three libraries, of varying sizes ( small, medium and large ) and you want the burden of holds fulfillment to be on larger libraries before smaller libraries, you would want StaticHoldsQueueWeight to look something like "LRG,MED,SML".</p>
+
+<p>If you want the burden of holds fulfillment to be spread out equally throughout your library system, simply enable RandomizeHoldsQueueWeight. When this system preference is enabled, the order in which libraries will be requested to fulfill an on-shelf hold will be randomized each time the list is regenerated.</p>
+
+<p>Leaving StaticHoldsQueueWeight empty is contraindicated at this time. Doing so will cause the build_holds_queue script to ignore RandomizeHoldsQueueWeight, causing the script to request hold fulfillment not randomly, but by alphabetical order.</p>
+
+<p><strong>See the full documentation for the Holds Queue in the <a href="http://manual.koha-community.org/3.10/en/circreports.html#holdsqueue">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index f6120e9..93de82a 100644 (file)
@@ -6,6 +6,6 @@
 
 <p>Items that have been on the hold shelf longer than you normally allow (based on the ReservesMaxPickUpDelay preference value) will appear on the 'Holds Over' tab, they will not automatically be cancelled.</p>
 
-<p><strong>See the full documentation for Holds Awaiting Pickup in the <a href="http://manual.koha-community.org/3.8/en/circreports.html#holdspickup">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Holds Awaiting Pickup in the <a href="http://manual.koha-community.org/3.10/en/circreports.html#holdspickup">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 4964e92..fab1fde 100644 (file)
@@ -22,6 +22,6 @@
 
 <p>After saving your file, simply print to the blank labels you have in your library.</p>
 
-<p><strong>See the full documentation for Label Batches in the <a href="http://manual.koha-community.org/3.8/en/labelcreator.html#labelbatches">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Label Batches in the <a href="http://manual.koha-community.org/3.10/en/labelcreator.html#labelbatches">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 75cf75f..e856151 100644 (file)
@@ -12,6 +12,6 @@
 
 <p>After saving, your layouts will appear on the 'Manage Layouts' page.</p>
 
-<p><strong>See the full documentation for Label Layouts in the <a href="http://manual.koha-community.org/3.8/en/labelcreator.html#labellayouts">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Label Layouts in the <a href="http://manual.koha-community.org/3.10/en/labelcreator.html#labellayouts">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index e731265..207c1f2 100644 (file)
@@ -28,6 +28,6 @@
 
 <p>Once you have saved your new profile, you can return to the list of templates and choose to edit the template that this profile is for.</p>
 
-<p><strong>See the full documentation for Label Profiles in the <a href="http://manual.koha-community.org/3.8/en/labelcreator.html#labelprofiles">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Label Profiles in the <a href="http://manual.koha-community.org/3.10/en/labelcreator.html#labelprofiles">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index eb469f0..a14ce03 100644 (file)
@@ -30,6 +30,6 @@
 
 <p>After saving, your templates will appear on the 'Manage Templates' page.</p>
 
-<p><strong>See the full documentation for Label Templates in the <a href="http://manual.koha-community.org/3.8/en/labelcreator.html#labeltemplates">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Label Templates in the <a href="http://manual.koha-community.org/3.10/en/labelcreator.html#labeltemplates">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 298e967..dee5eb3 100644 (file)
@@ -41,6 +41,6 @@
 
 <p>Batches are made up of the barcodes you would like to print. Once in this tool you can search for the item records you would like to print out labels for.</p>
 
-<p><strong>See the full documentation for the Label Creator in the <a href="http://manual.koha-community.org/3.8/en/labelcreator.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for the Label Creator in the <a href="http://manual.koha-community.org/3.10/en/labelcreator.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 7e7eb88..5abca7d 100644 (file)
@@ -11,6 +11,6 @@
 
 <p>To use this tool you simply need the barcode for the book you'd like to print the spine label for.</p>
 
-<p><strong>See the full documentation for Quick Spine Label Creator in the <a href="http://manual.koha-community.org/3.8/en/quicklabelcreator.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Quick Spine Label Creator in the <a href="http://manual.koha-community.org/3.10/en/quicklabelcreator.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index ae73634..ae2cc88 100644 (file)
@@ -5,7 +5,7 @@
 
 <p>Once you have set up patron categories, you should create a new user in &quot;Patrons&quot; with super librarian privileges. Then use that user to log in rather than the root user set up as part of installation.</p>
 
-<p>Here are some other suggestions: </p>
+<p>Here are some other suggestions:</p>
 
 <ul>
 <li><a href="http://koha-community.org/documentation/">Read Koha documentation</a></li>
 
 <h2>Can I edit the online help? </h2>
 
-<p>You can edit the online help through the Koha Staff Client by clicking the &quot;Edit Help&quot; button. This feature has been designed so that library workflow and policies can be documented within&nbsp; Koha. </p>
+<p>You can edit the online help through the Koha Staff Client by clicking the &quot;Edit Help&quot; button. This feature has been designed so that library workflow and policies can be documented within Koha.</p>
 
 <p><strong>IMPORTANT NOTE: Online help is overwritten during a Koha upgrade.</strong></p>
 
 <p>As part of the upgrade process your online help will be overwritten with the new Help as part of the install. If you want to keep a copy of your online help, you should instruct your System Administrator to upgrade the Online Help directory in the Koha file tree.</p>
 
-<p>The online help directory is: <pre>&nbsp;/koha-tmpl/intranet-tmpl/prog/en/modules/help</pre></p>
+<p>The online help directory is: <pre>/koha-tmpl/intranet-tmpl/prog/en/modules/help</pre></p>
 
-<p><strong>See the full documentation for Koha in the <a href="http://manual.koha-community.org/3.8/en/">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Koha in the <a href="http://manual.koha-community.org/3.10/en/">manual</a> (online).</strong></p>
 
 
 [% INCLUDE 'help-bottom.inc' %]
index 15e1e74..6d23843 100644 (file)
@@ -19,6 +19,6 @@
 
 <p>To the right of each account line there is a print link. Clicking that link will print an invoice for the line item that includes the date and description of the line item along with the total outstanding on the account.</p>
 
-<p><strong>See the full documentation for Patron Fines in the <a href="http://manual.koha-community.org/3.8/en/patroninformation.html#patronfines">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Patron Fines in the <a href="http://manual.koha-community.org/3.10/en/patroninformation.html#patronfines">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/files.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/files.tt
new file mode 100644 (file)
index 0000000..851f445
--- /dev/null
@@ -0,0 +1,13 @@
+[% INCLUDE 'help-top.inc' %]
+
+<h1>Patron files</h1>
+
+<p>If you set the EnableBorrowerFiles preference to 'Do' the Files tab will be visible on the patron information page.</p>
+
+<p>From here you can upload files to attach to the patron record.</p>
+
+<p>All files that are uploaded will appear above a form where additional files can be uploaded from.</p>
+
+<p><strong>See the full documentation for Patron Files in the <a http://manual.koha-community.org/3.10/en/patroninformation.html#patronfiles">manual</a> (online).</strong></p>
+
+[% INCLUDE 'help-bottom.inc' %]
index 073d52f..63cc5d4 100644 (file)
@@ -11,6 +11,6 @@
        <li>In the amount field, do not enter currency symbols, only numbers and decimals</li>
 </ul>
 
-<p><strong>See the full documentation for Creating Manual Credits in the <a href="http://manual.koha-community.org/3.8/en/patroninformation.html#manualcredit">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Creating Manual Credits in the <a href="http://manual.koha-community.org/3.10/en/patroninformation.html#manualcredit">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 3054fbb..e7f5221 100644 (file)
@@ -14,6 +14,6 @@
        <li>In the amount field, do not enter currency symbols, only numbers and decimals</li>
 </ul>
 
-<p><strong>See the full documentation for Creating Manual Invoices in the <a href="http://manual.koha-community.org/3.8/en/patroninformation.html#manualinvoice">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Creating Manual Invoices in the <a href="http://manual.koha-community.org/3.10/en/patroninformation.html#manualinvoice">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 3839480..f63233e 100644 (file)
@@ -42,6 +42,7 @@
        <li>parameters
 <ul>
        <li>Provides access to all areas of the Administration menu</li>
+    <li>This section can be expanded</li>
 </ul>
 </li>
        <li>borrowers
 </li>
 </ul>
 
+<h4>Granular Parameters Permissions</h4>
+
+<p>If the staff member has 'parameters' permissions they have the ability to perform all of these actions. If you would like to control parameter permissions on a more granular level choose from these options:</p>
+
+<ul>
+    <li>manage_circ_rules
+<ul>
+    <li>The ability to edit circulation and fine rules in the administration area</li>
+</ul>
+</li>
+    <li>parameters_remaining_permissions
+<ul>
+    <li>Access to all other areas under Administration</li>
+</ul>
+</li>
+</ul>
+
 <h4>Granular Holds Permissions</h4>
 
 <p>If the staff member has 'reserveforothers' permissions they have the ability to perform all of these actions. If you would like to control holds permissions on a more granular level choose from these options:</p>
 </li>
 </ul>
 
-<p><strong>See the full documentation for Patron Permissions in the <a href="http://manual.koha-community.org/3.8/en/patronpermissions.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Patron Permissions in the <a href="http://manual.koha-community.org/3.10/en/patronpermissions.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index 1e95a9a..da65c95 100644 (file)
@@ -2,7 +2,7 @@
 
 <h1>Change Patron Password</h1>
 
-<p>To only change the patron's password, click the 'Change Password' button</p>
+<p>Patron passwords are not recoverable. The stars show on the patron detail next to the Password label are always there even if a password isn't set. If a patron forgets their password the only option is to reset their password. To change the patron's password, click the 'Change Password' button</p>
 
 <ul>
     <li>Koha cannot display existing passwords. Leave the field blank to leave password unchanged.</li>
 
 <p>The default minimum password length is 3 characters long.  To change this value, update your system preferences.</p>
 
-<ul>
-       <li><em>Get there:</em> More &gt; Administration &gt; Global System Preferences &gt; Patrons &gt; minPasswordLength</li>
-</ul>
-
-<p><strong>See the full documentation for Editing Patrons in the <a href="http://manual.koha-community.org/3.8/en/editpatrons.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Editing Patrons in the <a href="http://manual.koha-community.org/3.10/en/editpatrons.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
 
index 901a7ac..37dc0db 100644 (file)
 </li>
 </ul>
 
-<p>If you want to filter your results to a specific branch or category, you can click the plus sign [+] to the right of the search box.</p>
+<p>If you want to filter your results to a specific library or category, you can click the plus sign [+] to the right of the search box.</p>
 
 <p>You can also browse through the patron records by clicking on the linked letters across the top.</p>
 
-<p><strong>See the full documentation for Patron Search in the <a href="http://manual.koha-community.org/3.8/en/patronsearch.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Patron Search in the <a href="http://manual.koha-community.org/3.10/en/patronsearch.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 12aec49..a4fa8fa 100644 (file)
@@ -86,6 +86,6 @@
 
 <p style="color: #990000">Remember to assign your staff secure usernames and passwords since these will be used to log into the staff client.</p>
 
-<p><strong>See the full documentation for Adding Patrons in the <a href="http://manual.koha-community.org/3.8/en/patrons.html#addnewpatron">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Adding Patrons in the <a href="http://manual.koha-community.org/3.10/en/patrons.html#addnewpatron">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index c15cc44..2023cbb 100644 (file)
 </li>
 </ul>
 
-<p>If you want to filter your results to a specific branch or category, you can click the plus sign [+] to the right of the search box.</p>
+<p>If you want to filter your results to a specific library or category, you can click the plus sign [+] to the right of the search box.</p>
 
 <p>You can also browse through the patron records by clicking on the linked letters across the top.</p>
 
-<p><strong>See the full documentation for the Patrons module in the <a href="http://manual.koha-community.org/3.8/en/patrons.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for the Patrons module in the <a href="http://manual.koha-community.org/3.10/en/patrons.html">manual</a> (online).</strong></p>
        
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index c747362..0c00458 100644 (file)
 
 <p>Clicking on the message title will expand the view to show you the full text of the message that was sent.</p>
 
+<h2>Statistics</h2>
+
+<p>Depending on what you set for the values of your StatisticsFields system preference, you can see statistics for one patron's circulation actions.</p>
+
+<h2>Files</h2>
+
+<p>If you set the EnableBorrowerFiles preference to 'Do' the Files tab will be visible on the patron information page.</p>
+
+<p>From here you can upload files to attach to the patron record.</p>
+
+<p>All files that are uploaded will appear above a form where additional files can be uploaded from.</p>
+
 <h2>Editing Patrons</h2>
 
 <p>Patrons in Koha can be edited using one of many edit buttons.</p>
        <li>You will be brought to your new patron</li>
 </ul>
 
-<p><strong>See the full documentation for the Patron Details in the <a href="http://manual.koha-community.org/3.8/en/patroninformation.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for the Patron Details in the <a href="http://manual.koha-community.org/3.10/en/patroninformation.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 2e5bf37..e2df9e1 100644 (file)
@@ -6,6 +6,6 @@
 
 <p>Clicking on the message title will expand the view to show you the full text of the message that was sent.</p>
 
-<p><strong>See the full documentation for Patron Notices in the <a href="http://manual.koha-community.org/3.8/en/patroninformation.html#patnotices">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Patron Notices in the <a href="http://manual.koha-community.org/3.10/en/patroninformation.html#patnotices">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index e59f544..00fd99a 100644 (file)
@@ -57,6 +57,6 @@
 </li>
 </ul>
 
-<p><strong>See the full documentation for Paying Fines in the <a href="http://manual.koha-community.org/3.8/en/patroninformation.html#payfines">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Paying Fines in the <a href="http://manual.koha-community.org/3.10/en/patroninformation.html#payfines">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index e59f544..00fd99a 100644 (file)
@@ -57,6 +57,6 @@
 </li>
 </ul>
 
-<p><strong>See the full documentation for Paying Fines in the <a href="http://manual.koha-community.org/3.8/en/patroninformation.html#payfines">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Paying Fines in the <a href="http://manual.koha-community.org/3.10/en/patroninformation.html#payfines">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index 6f44ad1..8092fef 100644 (file)
@@ -8,6 +8,6 @@
 
 <p>This will generate a text file with one barcode per line.</p>
 
-<p><strong>See the full documentation for Circulation History in the <a href="http://manual.koha-community.org/3.8/en/patroninformation.html#circhistory">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Circulation History in the <a href="http://manual.koha-community.org/3.10/en/patroninformation.html#circhistory">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/routing-lists.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/routing-lists.tt
new file mode 100644 (file)
index 0000000..f046266
--- /dev/null
@@ -0,0 +1,11 @@
+[% INCLUDE 'help-top.inc' %]
+
+<h1>Patron routing lists</h1>
+
+<p>A list of all of the serial routing lists the patron belongs to will be accessible via the 'Routing Lists' tab on the patron record.</p>
+
+<p>On this tab you will be able to see and edit all of the routing lists that this patron is on.</p>
+
+<p><strong>See the full documentation for Patron routing lists in the <a http://manual.koha-community.org/3.10/en/patroninformation.html#patronroutingtab">manual</a> (online).</strong></p>
+
+[% INCLUDE 'help-bottom.inc' %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/statistics.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/statistics.tt
new file mode 100644 (file)
index 0000000..8a49547
--- /dev/null
@@ -0,0 +1,9 @@
+[% INCLUDE 'help-top.inc' %]
+
+<h1>Patron statistics</h1>
+
+<p>Depending on what you set for the values of your StatisticsFields system preference, you can see statistics for one patron's circulation actions.</p>
+
+<p><strong>See the full documentation for Patron Statistics in the <a http://manual.koha-community.org/3.10/en/patroninformation.html#patronstatstab">manual</a> (online).</strong></p>
+
+[% INCLUDE 'help-bottom.inc' %]
index 0826ae7..df5a944 100644 (file)
@@ -2,7 +2,7 @@
        
 <h1>Online help</h1>
 
-<p>Sorry, there is no help available for this topic, please refer to the <a href="http://manual.koha-community.org/3.8/en/">Koha 3.8 manual</a> (online).</p>
+<p>Sorry, there is no help available for this topic, please refer to the <a href="http://manual.koha-community.org/3.10/en/">Koha 3.10 manual</a> (online).</p>
 
 <form action="/cgi-bin/koha/edithelp.pl" method="post">
        <input type="hidden" name="referer" value="[% referer %]" />
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/offline_circ/list.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/offline_circ/list.tt
new file mode 100644 (file)
index 0000000..5dc1351
--- /dev/null
@@ -0,0 +1,25 @@
+[% INCLUDE 'help-top.inc' %]
+
+<h1>Offline Circulation</h1>
+
+<p>From this page you can manage offline circulation actions tracked in the Firefox plugin found at: <a class="ulink" href="https://addons.mozilla.org/en/firefox/addon/koct/" target="_top">https://addons.mozilla.org/en/firefox/addon/koct/</a></p>
+
+<p>When you use the 'Commit to Koha' option in the offline circulation plugin you will come to this page to manage the data.</p>
+
+<p>Once all of the logs from all of the circulation computers are loaded you will be able to check them all or select just those you want to process into Koha.</p>
+
+<ul>
+    <li>Click on the Process button and Koha will record every stored transaction one by one. For each transaction, the status will change to:
+<ul>
+    <li>"Success." if the transaction was processed correctly</li>
+    <li>"Borrower not found." if the borrower card number is incorrect</li>
+    <li>"Item not found." if the item barcode is wrong</li>
+    <li>"Item not issued." if you checked in an available item</li>
+</ul>
+</li>
+    <li>Once finished you will have a summary of all of your transactions</li>
+</ul>
+
+<p><strong>See the full documentation for Offline Circulation in the <a href="http://manual.koha-community.org/3.10/en/offlinecirc.html#firefoxofflinecirc">manual</a> (online).</strong></p>
+
+[% INCLUDE 'help-bottom.inc' %]
index ca81ae8..6b9c4ed 100644 (file)
@@ -2,6 +2,8 @@
 
 <h1>Offline Circulation File (.koc) Uploader</h1>
 
+<p>The Offline Circulation Utility can be downloaded at: <a href="http://millruntech.com/koha/koha-offline-circulation">http://millruntech.com/koha/koha-offline-circulation</a></p>
+
 <p>The offline circulation tool for Windows generates a KOC file which you can upload into Koha once your system comes back up.</p>
 
 <p>Browse your computer for the *.koc file.</p>
@@ -10,6 +12,6 @@
 
 <p>When this process  is complete, you will see a summary of actions from when you were offline (including any errors).</p>
 
-<p><strong>See the full documentation for the Offline Circulation File Uploader in the <a href="http://manual.koha-community.org/3.8/en/offlinecirc.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for the Offline Circulation File Uploader in the <a http://manual.koha-community.org/3.10/en/offlinecirc.html#uploadofflinecirc">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index b69371e..7cdca05 100644 (file)
@@ -8,6 +8,6 @@
 
 <p>To add a new batch, you want to click on the 'Batches' button at the top of your page and choose 'New Batch'</p>
 
-<p><strong>See the full documentation for the Patron Card Batches in the <a href="http://manual.koha-community.org/3.8/en/patroncardcreator.html#patroncardbatches">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for the Patron Card Batches in the <a href="http://manual.koha-community.org/3.10/en/patroncardcreator.html#patroncardbatches">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index f1e4155..b2fb8dd 100644 (file)
@@ -31,6 +31,6 @@
 
 <p>After saving, your layouts will appear on the 'Manage Layouts' page.</p>
 
-<p><strong>See the full documentation for the Patron Card Layouts in the <a href="http://manual.koha-community.org/3.8/en/patroncardcreator.html#cardlayouts">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for the Patron Card Layouts in the <a href="http://manual.koha-community.org/3.10/en/patroncardcreator.html#cardlayouts">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 964a4ba..085b95d 100644 (file)
@@ -28,6 +28,6 @@
 
 <p>Once you have saved your new profile, you can return to the list of templates and choose to edit the template that this profile is for.</p>
 
-<p><strong>See the full documentation for the Patron Card Profiles in the <a href="http://manual.koha-community.org/3.8/en/patroncardcreator.html#patronprofile">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for the Patron Card Profiles in the <a href="http://manual.koha-community.org/3.10/en/patroncardcreator.html#patronprofile">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 9e8c42d..15d1dbb 100644 (file)
@@ -25,6 +25,6 @@ After saving, your templates will appear on the 'Manage Templates' page.</li>
 </li>
 </ul>
 
-<p><strong>See the full documentation for the Patron Card Templates in the <a href="http://manual.koha-community.org/3.8/en/patroncardcreator.html#patrontemplate">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for the Patron Card Templates in the <a href="http://manual.koha-community.org/3.10/en/patroncardcreator.html#patrontemplate">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 360e73e..edf31fa 100644 (file)
@@ -17,6 +17,6 @@
 
 <p>The developers of the Patron Card Creator module hope you will find this an extremely useful tool. You are encouraged to submit any enhancement requests as well as any bugs via Koha Project Bugzilla.</p>
 
-<p><strong>See the full documentation for the Patron Card Creator in the <a href="http://manual.koha-community.org/3.8/en/patroncardcreator.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for the Patron Card Creator in the <a href="http://manual.koha-community.org/3.10/en/patroncardcreator.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index f6b2b18..f54da54 100644 (file)
@@ -16,6 +16,6 @@
 
 <p>To delete one or multiple of these images, click the checkbox to the right of each image you want to delete and click the 'Delete' button.</p>
 
-<p><strong>See the full documentation for Managing Images in the <a href="http://manual.koha-community.org/3.8/en/patroncardcreator.html#managecardimages">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Managing Images in the <a href="http://manual.koha-community.org/3.10/en/patroncardcreator.html#managecardimages">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 957497f..9da3068 100644 (file)
@@ -16,6 +16,6 @@
 
 <p>A batch is a collection of patrons for whom you want to generate cards.</p>
 
-<p><strong>See the full documentation for the Patron Card Creator in the <a href="http://manual.koha-community.org/3.8/en/patroncardcreator.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for the Patron Card Creator in the <a href="http://manual.koha-community.org/3.10/en/patroncardcreator.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 59d31ca..bc4b01e 100644 (file)
@@ -12,6 +12,6 @@
 
 <p>Choosing amount will change your results to appear as the sum of the amounts spent.</p>
 
-<p><strong>See the full documentation for Acquisitions Statistics in the <a href="http://manual.koha-community.org/3.8/en/statsreports.html#acqstats">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Acquisitions Statistics in the <a href="http://manual.koha-community.org/3.10/en/statsreports.html#acqstats">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 2811f37..080a16d 100644 (file)
@@ -8,6 +8,6 @@
 
 <p>You can also choose to export to a file that you can manipulate to your needs.</p>
 
-<p><strong>See the full documentation for the Patrons with the most Checkouts report in the <a href="http://manual.koha-community.org/3.8/en/statsreports.html#mostcheckouts">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for the Patrons with the most Checkouts report in the <a href="http://manual.koha-community.org/3.10/en/statsreports.html#mostcheckouts">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 22c8a8f..40f369f 100644 (file)
@@ -8,6 +8,6 @@
 
 <p>You can also choose to export to a file that you can manipulate to your needs.</p>
 
-<p><strong>See the full documentation for the Patrons with no Checkouts report in the <a href="http://manual.koha-community.org/3.8/en/statsreports.html#patnocheckouts">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for the Patrons with no Checkouts report in the <a href="http://manual.koha-community.org/3.10/en/statsreports.html#patnocheckouts">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index f26347f..310e952 100644 (file)
@@ -8,7 +8,7 @@
 
 <p>Based on your selections, you may see some query information above your results table. You can also choose to export to a file that you can manipulate to your needs.</p>
 
-<p><strong>See the full documentation for Patron Statistics in the <a href="http://manual.koha-community.org/3.8/en/statsreports.html#patstats">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Patron Statistics in the <a href="http://manual.koha-community.org/3.10/en/statsreports.html#patstats">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
 
index 8dd03cc..cf615e9 100644 (file)
@@ -8,6 +8,6 @@
 
 <p>You can also choose to export to a file that you can manipulate to your needs.</p>
 
-<p><strong>See the full documentation for the Most Circulation Items report in the <a href="http://manual.koha-community.org/3.8/en/statsreports.html#mostcirculated">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for the Most Circulation Items report in the <a href="http://manual.koha-community.org/3.10/en/statsreports.html#mostcirculated">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 9efdf8f..93e70a7 100644 (file)
@@ -8,6 +8,6 @@
 
 <p>You can also choose to export to a file that you can manipulate to your needs.</p>
 
-<p><strong>See the full documentation for the Items with no Checkouts report in the <a href="http://manual.koha-community.org/3.8/en/statsreports.html#itemnocheckouts">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for the Items with no Checkouts report in the <a href="http://manual.koha-community.org/3.10/en/statsreports.html#itemnocheckouts">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index fc346e9..3a54696 100644 (file)
@@ -8,7 +8,7 @@
 
 <p>You can also choose to export to a file that you can manipulate to your needs.</p>
 
-<p><strong>See the full documentation for Catalog Statistics in the <a href="http://manual.koha-community.org/3.8/en/statsreports.html#catstats">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Catalog Statistics in the <a href="http://manual.koha-community.org/3.10/en/statsreports.html#catstats">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
 
index 1880846..191e437 100644 (file)
@@ -18,6 +18,6 @@
 
 <p>Then when generating reports on the module you created the value for you will see an option to limit by the definition at the bottom of the usual filters.</p>
 
-<p><strong>See the full documentation for the Reports Dictionary in the <a href="http://manual.koha-community.org/3.8/en/reportdic.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for the Reports Dictionary in the <a href="http://manual.koha-community.org/3.10/en/reportdic.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 1ebcc04..33f46c6 100644 (file)
@@ -38,7 +38,7 @@
 
 <ul><li>This is optional, if you want the results to come out as they are in the table, just leave this section blank.</li></ul>
 
-<h1>Edit Reports</h1>
+<h2>Edit Reports</h2>
 
 <p>Custom reports can be edited in their entirety from the Saved Guided Reports page.</p>
 
 
 <h2>Report from SQL</h2>
 
-<p>In addition to the report wizard, you have the option to write your own queries using SQL. To find reports written by other Koha users, visit the Koha Wiki: <a href="http://wiki.koha-community.org/wiki/SQL_Reports_Library">http://wiki.koha-community.org/wiki/SQL_Reports_Library</a>. You can also find your database structure in /installer/data/mysql/kohastructure.sql or online at: <a href="http://schema.koha-community.org">http://schema.koha-community.org</a>.</p>
+<p>In addition to the report wizard, you have the option to write your own queries using SQL. To find reports written by other Koha users, visit the Koha Wiki: <a href="http://wiki.koha-community.org/wiki/SQL_Reports_Library" target="_top">http://wiki.koha-community.org/wiki/SQL_Reports_Library</a>. You can also find your database structure in /installer/data/mysql/kohastructure.sql or online at: <a href="http://schema.koha-community.org/" target="_top">http://schema.koha-community.org</a>.</p>
 
 <p>To add your query, click the link to 'Create from SQL' on the main reports module or the New button at the top of the Saved Reports page.</p>
 
 <p>Fill in the form presented</p>
 <ul>
-    <li>The name is what will appear on the Saved Reports page to help you identify the report later. It will also be searchable using the filters found the left of the Saved Reports page.</li>
-    <li>Notes will also appear on the Saved Reports page, this can be used to provide more details about the report or tips on how to enter values when it runs</li>
-    <li>The type should always be 'Tabular' at this time since the other formats have not been implemented</li>
-    <li>In the SQL box you will type or paste the SQL for the report</li>
-    <li>If you feel that your report might be too resource intensive you might want to consider using runtime parameters to your query. Runtime parameters basically make a filter appear before the report is run to save your system resources.
+    <li>The 'Name' is what will appear on the Saved Reports page to help you identify the report later. It will also be searchable using the filters found the left of the Saved Reports page.</li>
+    <li>You can use the 'Report group' to organize your reports so that you can easily filter reports by groups. Report groups are set in the REPORT_GROUP authorized value category.</li>
+    <li>You can use 'Report subgroup' to further organize your reports so that you can easily filter reports by groups and subgroups. Report subgroups are set in the REPORT_SUBGROUP authorized value category.</li>
+    <li>'Report is public' should be left to the default of 'No' in most cases. A report can be made public if you intend to allow access to it through the JSON webservice interface. This is a system that can be used by developers to make custom presentations of the data from the report, for example displaying it using a graphing API. To learn more speak to your local developer.
+<ul>
+    <li>A public report is accessible via a URL that looks like this: http://MYOPAC/cgi-bin/koha/svc/report?id=REPORTID</li>
+</ul>
+</li>
+    <li>'Notes' will also appear on the Saved Reports page, this can be used to provide more details about the report or tips on how to enter values when it runs</li>
+    <li>The type should always be 'Tabular' at this time since theother formats have not been implemented</li>
+    <li>In the 'SQL' box you will type or paste the SQL for the report</li>
+    <li>If you feel that your report might be too resource intensive you might want to consider using runtime parameters to your query. Runtime parameters basically make a filter appear before the report is run to save your system resources.There is a specific syntax that Koha will understand as 'ask for values when running the report'. The syntax is &lt;&lt;Question to ask|authorized_value&gt;&gt;.
 <ul>
-    <li><strong>Note:</strong> There is a limit of 10,000 records put on SQL statements entered in Koha. To get around this you want to add 'LIMIT 100000' to the end of your SQL statement (or any other number above 10,000.</li>
-    <li>There is a specific syntax that Koha will understand as 'ask for values when running the report'. The syntax is &lt;&lt;Question to ask|authorized_value&gt;&gt;.</li>
     <li>The &lt;&lt; and &gt;&gt; are just delimiters. You must put &lt;&lt; at the beginning and &gt;&gt; at the end of your parameter</li>
     <li>The 'Question to ask' will be displayed on the left of the string to enter.</li>
-    <li>The authorized_value can be omitted if not applicable. If it contains an authorized value category, or branches or itemtype or categorycode, a list with the Koha authorized values will be displayed instead of a free field Note that you can have more than one parameter in a given SQL Note that entering nothing at run time won't probably work as you expect. It will be considered as "value empty" not as "ignore this parameter". For example entering nothing for : "title=&lt;&lt;Enter title&gt;&gt;" will display results with title='' (no title). If you want to have to have something not mandatory, use "title like &lt;&lt;Enter title&gt;&gt;" and enter a % at run time instead of nothing</li>
+    <li>The authorized_value can be omitted if not applicable. If it contains an authorized value category, or libraries or itemtype or categorycode, a list with the Koha authorized values will be displayed instead of a free field Note that you can have more than one parameter in a given SQL Note that entering nothing at run time won't probably work as you expect. It will be considered as "value empty" not as "ignore this parameter". For example entering nothing for : "title=&lt;&lt;Enter title&gt;&gt;" will display results with title='' (no title). If you want to have to have something not mandatory, use "title like &lt;&lt;Enter title&gt;&gt;" and enter a % at run time instead of nothing</li>
 </ul>
-
 <p>Examples:</p>
-
 <ul>
     <li>SELECT surname, firstname<br />
-    FROM borrowers<br />
-    WHERE branchcode=&lt;&lt;Enter patrons library|branches&gt;&gt; AND surname like &lt;&lt;Enter filter for patron surname (% if none)&gt;&gt;</li>
-    <li>SELECT *<br />
-    FROM items<br />
-    WHERE homebranch = &lt;&lt;Pick your branch|branches&gt;&gt; and barcode like &lt;&lt;Partial barcode value here (use % for wildcard)&gt;&gt;</li>
+FROM borrowers <br />
+WHERE branchcode=&lt;&lt;Enter patrons library|branches&gt;&gt; AND surname like &lt;&lt;Enter filter for patron surname (% if none)&gt;&gt;</li>
+    <li>SELECT * <br />
+FROM items <br />
+WHERE homebranch = &lt;&lt;Pick your library|branches&gt;&gt; AND barcode like &lt;&lt;Partial barcode value here&gt;&gt;</li>
 </ul>
 </li>
-    <li style="background-color: #ffe599;">Tip: To generate a date picker calendar to the right of the field when running a report you can use the 'date' keyword like this: &lt;&lt;Enter Date|date&gt;&gt;</li>
-    <li style="background-color: #ffe599;">Tip: You have to put "%" in a text box to 'leave it blank'. Otherwise, it literally looks for "" (empty string) as the value for the field.</li>
-    <li style="color: #990000;">Important: In addition to using any authorized value code to generate a dropdown, you can use the following values as well: Branches (branches), Item Types (itemtypes) and Patron Categories (categorycode). For example a branch pull down would be generated like this &lt;&lt;Branch|branches&gt;&gt;</li>
+    <li>Tip: To generate a date picker calendar to the right of the field when running a report you can use the 'date' keyword like this: &lt;&lt;Enter Date|date&gt;&gt;</li>
+    <li>Tip: You have to put "%" in a text box to 'leave it blank'. Otherwise, it literally looks for "" (empty string) as the value for the field.</li>
+    <li style="color: #990000">Important: In addition to using any authorized value code to generate a dropdown, you can use the following values as well: Libraries (branches), Item Types (itemtypes) and Patron Categories (categorycode). For example a library pull down would be generated like this &lt;&lt;Library|branches&gt;&gt;</li>
 </ul>
 
-<p>Once everything is entered click the 'Save Report' button and you'll be presented with options to run it. Once a report is saved you do not have to recreate it you can simply find it on the Saved Reports page and run or edit it.</p>
-
-<h1>Questions</h1>
+<p>Note: There is a limit of 10,000 records put on SQL statements entered in Koha. To get around this you want to add 'LIMIT 100000' to the end of your SQL statement (or any other number above 10,000.</p>
 
-<p><strong>What are duration and visibility?</strong></p>
-<p>The duration field may be visible or not, don't worry if you don't see it. If you see it, it says how long a report run is kept in Koha and, any subsequent re-run will in fact display the result run the 1st time</p>
-<p>The visibility field specify if your report is accessible <strong>without authentication</strong> from the OPAC. Reports can be retrieved from the following URLs:
-<ul><li> opac: http://localhost/cgi-bin/koha/svc/report?id=1</li>
-<li>intranet: http://localhost:8080/cgi-bin/koha/svc/report?id=1</li>
-</ul>
-<p>(replace localhost and localhost:8080 with the appropriate URLs)</p>
+<p>Once everything is entered click the 'Save Report' button and you'll be presented with options to run it. Once a report is saved you do not have to recreate it you can simply find it on the Saved Reports page and run or edit it.</p>
 
 <p><strong>Is there a repository for reports?</strong></p>
 
 
 <p>NEKLS also has a great page (<a href="http://www.nexpresslibrary.org/training/reports-training/" target="_new">http://www.nexpresslibrary.org/training/reports-training/</a>) with a list of reports they have written.</p>
 
-<p><strong>See the full documentation for Custom Reports in the <a href="http://manual.koha-community.org/3.8/en/reports.html#customreports">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Custom Reports in the <a href="http://manual.koha-community.org/3.10/en/reports.html#customreports">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index 09ec95f..16c025b 100644 (file)
@@ -8,6 +8,6 @@
 
 <p>You can also choose to export to a file that you can manipulate to your needs.</p>
 
-<p><strong>See the full documentation for the Average Loan Time report in the <a href="http://manual.koha-community.org/3.8/en/statsreports.html#avloantime">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for the Average Loan Time report in the <a href="http://manual.koha-community.org/3.10/en/statsreports.html#avloantime">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 7080f07..6117f00 100644 (file)
@@ -19,6 +19,6 @@
        <li>For a single day, an example would be: 11/15/2009 to 11/16/2009 to find what circulated on the 15th</li>
 </ul>
 
-<p><strong>See the full documentation for Circulation Statistics in the <a href="http://manual.koha-community.org/3.8/en/statsreports.html#circstats">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Circulation Statistics in the <a href="http://manual.koha-community.org/3.10/en/statsreports.html#circstats">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index 8ee9408..5d48ded 100644 (file)
@@ -16,6 +16,6 @@
                </ul>
        </div>  
 
-<p><strong>See the full documentation for the Lost Items report in the <a href="http://manual.koha-community.org/3.8/en/statsreports.html#lostreport">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for the Lost Items report in the <a href="http://manual.koha-community.org/3.10/en/statsreports.html#lostreport">manual</a> (online).</strong></p>
        
 [% INCLUDE 'help-bottom.inc' %]
index e4fecf1..a9f3c02 100644 (file)
@@ -8,6 +8,6 @@
 
 <p>You can also choose to export to a file that you can manipulate to your needs.</p>
 
-<p><strong>See the full documentation for the Catalog by Item Type report in the <a href="http://manual.koha-community.org/3.8/en/statsreports.html#catbyitem">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for the Catalog by Item Type report in the <a href="http://manual.koha-community.org/3.10/en/statsreports.html#catbyitem">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index 61cbf54..c64c1a0 100644 (file)
@@ -19,6 +19,6 @@
 </li>
 </ul>
 
-<p><strong>See the full documentation for Reports in the <a href="http://manual.koha-community.org/3.8/en/reports.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Reports in the <a href="http://manual.koha-community.org/3.10/en/reports.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 5383afd..463f441 100644 (file)
@@ -10,6 +10,6 @@
 
 <p>You can also choose to export to a file that you can manipulate to your needs.</p>
 
-<p><strong>See the full documentation for Holds Statistics in the <a href="manual.koha-community.org/3.8/en/statsreports.html#holdstats">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Holds Statistics in the <a href="manual.koha-community.org/3.10/en/statsreports.html#holdstats">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 2dd4c57..dcb7d4b 100644 (file)
@@ -8,6 +8,6 @@
 
 <p>You can also choose to export to a file that you can manipulate to your needs.</p>
 
-<p><strong>See the full documentation for Serials Statistics in the <a href="http://manual.koha-community.org/3.8/en/statsreports.html#serialstats">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Serials Statistics in the <a href="http://manual.koha-community.org/3.10/en/statsreports.html#serialstats">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index eef6972..b2dac8b 100644 (file)
@@ -60,6 +60,6 @@
 
 <p>If a patron asks to have their hold suspended you can do so by clicking the Suspend button to far right. If the patron gives you a date for the items to become unsuspended you can enter that in the date box and click the 'Update hold(s)' button to save your changes.</p>
 
-<p><strong>See the full documentation for Holds in the <a href="http://manual.koha-community.org/3.8/en/holds.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Holds in the <a href="http://manual.koha-community.org/3.10/en/holds.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index 6ba41ed..21073be 100644 (file)
@@ -10,6 +10,6 @@
 
 <p>You can also review and unapprove comments you have approved in the past by choosing the 'Approved comments' tab</p>
 
-<p><strong>See the full documentation for Comments in the <a href="http://manual.koha-community.org/3.8/en/comments.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Comments in the <a href="http://manual.koha-community.org/3.10/en/comments.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 369ba8e..c13b223 100644 (file)
@@ -8,6 +8,6 @@
 
 <p>In your results you will see all subscriptions that will expire before the date you entered. From there you can choose to view the subscription further or renew it in one click.</P>
 
-<p><strong>See the full documentation for Checking Serial Expiration in the <a href="http://manual.koha-community.org/3.8/en/serialexpiration.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Checking Serial Expiration in the <a href="http://manual.koha-community.org/3.10/en/serialexpiration.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index c6d8ade..91cfcd0 100644 (file)
@@ -12,7 +12,7 @@
 
 <p>From the list of late issues you can choose which ones you want to send a claim email to by clicking the checkbox to the left of late issue, choosing the notice template to use and clicking the 'Send notification' button.</p>
 
-<p><strong>See the full documentation for Serial Claims in the <a href="http://manual.koha-community.org/3.8/en/serialclaims.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Serial Claims in the <a href="http://manual.koha-community.org/3.10/en/serialclaims.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
 
index 911e239..cf7e655 100644 (file)
@@ -16,6 +16,6 @@
 
 <p>If RoutingListAddReserves is set to on then patrons listed in the routing list will automatically be added to the holds list for the issue.</p>
 
-<p><strong>See the full documentation for Routing Lists in the <a href="http://manual.koha-community.org/3.8/en/routinglist.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Routing Lists in the <a href="http://manual.koha-community.org/3.10/en/routinglist.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 45916df..f00eb88 100644 (file)
@@ -10,6 +10,6 @@
 
 <p>If you are adding multiple issues at once or if the latest expected issue is late, you can click the 'Generate Next' button to generate the next issue based on the subscription pattern.</p>
 
-<p><strong>See the full documentation for Serials in the <a href="http://manual.koha-community.org/3.8/en/serials.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Serials in the <a href="http://manual.koha-community.org/3.10/en/serials.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index f3f76fc..acb3f2d 100644 (file)
@@ -24,6 +24,6 @@
 
 <p>Clicking this button will generate the next issue for you and mark the previously expected issue as 'Late' automatically. You can then check the 'Edit' box to the right of each issue and edit the status on multiple issues at once.</p>
 
-<p><strong>See the full documentation for Receiving a Serial in the <a href="http://manual.koha-community.org/3.8/en/receiveissues.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Receiving a Serial in the <a href="http://manual.koha-community.org/3.10/en/receiveissues.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index d4ee4f5..1def1f1 100644 (file)
@@ -6,7 +6,7 @@
 
 <p>You can search for existing subscriptions by using the search box at the top of the page. You can search for any part of the serial title or ISSN.</p>
 
-<p><strong>See the full documentation for Serials in the <a href="http://manual.koha-community.org/3.8/en/serials.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Serials in the <a href="http://manual.koha-community.org/3.10/en/serials.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
 
index 247ded7..b8710f3 100644 (file)
@@ -83,7 +83,7 @@
 
 <p>Click 'Save Subscription' to save the information you have entered.</p>
 
-<p><strong>See the full documentation for Adding a Subscription in the <a href="http://manual.koha-community.org/3.8/en/serials.html#newsubscription">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Adding a Subscription in the <a href="http://manual.koha-community.org/3.10/en/serials.html#newsubscription">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
 
index fbada5d..1226147 100644 (file)
@@ -6,6 +6,6 @@
 
 <p>From here you can edit your subscription, renew it and/or recieve issues.</p>
 
-<p><strong>See the full documentation for Serials in the <a href="http://manual.koha-community.org/3.8/en/serials.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Serials in the <a href="http://manual.koha-community.org/3.10/en/serials.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 0965c94..1049d0d 100644 (file)
@@ -2,37 +2,39 @@
 
 <h1>Purchase Suggestions</h1>
 
-<p>Depending on your settings in your <em>suggestion</em> system preference, patrons may be able to make purchase suggestions via the OPAC. When a suggestion is waiting for library review, it will appear on the Acquisitions home page in the list of links on the left of the page.</p>
+<p>Depending on your settings in the suggestion system preference, patrons may be able to make purchase suggestions via the OPAC. When a suggestion is waiting for library review, it will appear on the Acquisitions home page under the vendor search.</p>
 
-<p>It will also appear on the main staff dashboard under the Acquisitions label.</p>
+<p>It will also appear on the main staff dashboard under the module labels.</p>
 
-<p>Clicking ‘Manage suggestions’ will take you to the suggestion management tool. If there are no pending suggestions you can access the suggestion management tool by clicking the ‘Manage suggestions’ link on the menu on the left of the Acquisitions page.</p>
+<p>Clicking 'Manage suggestions' will take you to the suggestion management tool. If there are no pending suggestions you can access the suggestion management tool by clicking the 'Manage suggestions' link on the menu on the left of the Acquisitions page.</p>
 
-<p>Your suggestions will be sorted into three categories: Accepted, Pending, and Rejected. Each accepted or rejected suggestion will show the name of the librarian who managed the suggestion and the reason they gave for accepting or rejecting it (found under ‘Status’).</p>
+<p>Your suggestions will be sorted into several tabs: Accepted, Pending, Checked, Ordered and/or Rejected. Each accepted or rejected suggestion will show the name of the librarian who managed the suggestion and the reason they gave for accepting or rejecting it (found under 'Status').</p>
 
 <p>For libraries with lots of suggestions, there are filters on the left hand side of the Manage Suggestions page to assist in limiting the number of titles displayed on the screen.</p>
 
-<p>Clicking on the blue headings will expand the filtering options and clicking ‘[clear]‘ will clear all filters and show all suggestions.</p>
+<p>Clicking on the blue headings will expand the filtering options and clicking '[clear]' will clear all filters and show all suggestions.</p>
 
-<p>When reviewing ‘Pending’ suggestions you can choose to check the box next to the item(s) you want to approve/reject and then choose the status and reason for your selection. You can also choose to completely delete the suggestion by checking the ‘Delete selected’ box.</p>
+<p><strong>Tip:</strong> The suggestions page will automatically be limited to suggestions for your library. To see information for all (or any other) libraries click on the 'Acquisition information' filter and change the library.</p>
+
+<p>When reviewing 'Pending' suggestions you can choose to check the box next to the item(s) you want to approve/reject and then choose the status and reason for your selection. You can also choose to completely delete the suggestion by checking the 'Delete selected' box.</p>
 
 <p>Another option for libraries with long lists of suggestions is to approve or reject suggestions one by one by clicking on the title of the suggestion to open a summary of the suggestion, including information if the item was purchased.</p>
 
-<p>Clicking ‘edit’ to the right of the suggested title will open a suggestion editing page.</p>
+<p>Clicking 'edit' to the right of the suggested title will open a suggestion editing page.</p>
 
 <p>From this form you can make edits to the suggestion (adding more details or updating incorrect information provided by the patron). You can also choose to accept or reject the suggestion on an individual basis.</p>
 
 <ul>
-<li>Choosing to mark a request as ‘Asked’ will move the request back to the ‘Pending’ tab.</li>
+    <li>Choosing to mark a request as 'Pending' will move the request back to the 'Pending' tab.</li>
 </ul>
 
 <p>Reasons for accepting and rejecting suggestions are defined by the SUGGEST authorized value.</p>
 
-<p>If you choose ‘Others…’ as your reason you will be prompted to enter your reason in a text box. Clicking ‘Cancel’ to the right of the box will bring back the pull down menu with authorized reasons.</p>
+<p>If you choose 'Others...' as your reason you will be prompted to enter your reason in a text box. Clicking 'Cancel' to the right of the box will bring back the pull down menu with authorized reasons.</p>
 
-<p>Once you have clicked ‘Submit’ the suggestion will be moved to the matching tab. The status will also be updated on the patron’s account in the OPAC and an email notice will be sent to the patron using the template that matches the status you have chosen.</p>
+<p>Once you have clicked 'Submit' the suggestion will be moved to the matching tab. The status will also be updated on the patron's account in the OPAC and an email notice will be sent to the patron using the template that matches the status you have chosen.</p>
 
-<p><strong>See the full documentation for Purchase Suggestions in the <a href="http://manual.koha-community.org/3.8/en/managesuggest.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Purchase Suggestions in the <a href="http://manual.koha-community.org/3.10/en/managesuggest.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
 
index a6b6bfb..79bd3ae 100644 (file)
@@ -2,22 +2,22 @@
 
 <h1>Tags</h1>
 
-<p>Depending on your tagging system preferences, librarians may need to approve tags before they are published on the OPAC. This is done via the Tag Moderation Tool.</p>
+<p>Depending on your tagging system preferences, librarians may need to approve tags before they are published on the OPAC. This is done via the Tag Moderation Tool. If there are tags awaiting moderation they will be listed on the main staff dashboard under the module labels.</p>
 
-<p>When first visiting the tool, you will be presented with a list of tags that are pending approval or rejection by a librarian</p>
+<p>To moderate the tags visit the Tags tool. When first visiting the tool, you will be presented with a list of tags that are pending approval or rejection by a librarian</p>
 
 <ul>
-    <li>To approve a tag, you can either click the 'Approve' button inline with the term, or check all terms you want to approve and click 'Approve' below the table.</li>
+    <li>To approve a tag, you can either click the 'Approve' button in line with the term, or check all terms you want to approve and click 'Approve' below the table.</li>
 
-    <li>To reject a tag, you can either click the 'Reject' button inline with the term, or check all terms you want to approve and click 'Reject' below the table.</li>
+    <li>To reject a tag, you can either click the 'Reject' button in line with the term, or check all terms you want to approve and click 'Reject' below the table.</li>
 </ul>
 
 <p>Once a tag has been approved or rejected it will be moved to the appropriate list of tags. A summary of all tags will appear on the right of the screen.</p>
 
 <p>Even though a tag is approved or rejected, it can still be moved to another list. When viewing approved tags each tag has the option to reject</p>
 
-<p>To check terms against the approved and rejected lists (and possibly against the dictionary you have assigned for tag moderation) simply enter the term into the search box on the bottom right of the screen to see the status of the term</p>
+<p>To check terms against the approved and rejected lists (and possibly against the dictionary you have assigned for tag moderation) simply enter the term into the search box on the bottom right of the screen to see the status of the term.</p>
 
-<p><strong>See the full documentation for Tag Moderation in the <a href="http://manual.koha-community.org/3.8/en/tagsmoderation.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Tag Moderation in the <a href="http://manual.koha-community.org/3.10/en/tagsmoderation.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index acec1db..bff3a9c 100644 (file)
@@ -8,20 +8,28 @@
 
 <p>You will be presented with a summary of the items you want to modify. From here you can uncheck the items you don't want to modify before making changes in the form below. You can also hide columns you don't need to see to prevent having to scroll from left to right to see the entire item form.</p>
 
-<p>Using the edit form you can choose which fields to make edits to.  By checking the checkbox to the right of each field you can clear the values in that field for the records you are modifying.</p>
+<p>Using the edit form you can choose which fields to make edits to. By checking the checkbox to the right of each field you can clear the values in that field for the records you are modifying.</p>
 
 <p>Once you have made you changes you will be presented with the resulting items.</p>
 
+<p><strong>Tip:</strong> You can also edit items on one bib record in a batch by going to the bib record and clicking Edit > Edit items in batch</p>
+
 <h1>Batch Delete Items</h1>
 
 <p>This tool will allow you to delete a batch of item records from Koha.</p>
 
-<p>From the tool you can choose to upload a file of barcodes or item ids, or you can scan items one by one into the box below the upload tool. Once you have your file uploaded or the barcodes listed you can click 'Continue.'</p>
+<p>From the tool you can choose to upload a file of barcodes or item ids, or you can scan items one by one into the box below the upload tool.</p>
+
+<p>Once you have your file uploaded or the barcodes scanned you can click 'Continue.'</p>
+
+<p>You will be presented with a confirmation screen. From here you can uncheck the items you don't want to delete and decide if Koha should delete the bib record if the last item is being deleted before clicking 'Delete selected items.'</p>
+
+<p>If your file (or list of scanned barcodes) has more than 1000 barcodes, Koha will be unable to present you with a list of the items. You will still be able to delete them, but not able to choose which items specifically to delete or delete the biblio records.</p>
 
-<p>You will be presented with a confirmation screen. From here you can uncheck the items you don't want to delete and decide if Koha should delete the bib record if the last item is being deleted before clicking 'Delete selected items.' If the items are checked out you will be presented with an error after clicking 'Delete selected items' and the items will not be deleted.</p>
+<p>If the items are checked out you will be presented with an error after clicking 'Delete selected items' and the items will not be deleted.</p>
 
 <p>If the items can be deleted they will be and you will be presented with a confirmation of your deletion.</p>
 
-<p><strong>See the full documentation for <a href="http://manual.koha-community.org/3.8/en/batchmodifyitems.html">Batch Item Modifications</a> and <a href="http://manual.koha-community.org/3.8/en/batchdeleteitems.html">Batch Item Deletions</a> in the manual (online).</strong></p>
+<p><strong>See the full documentation for <a href="http://manual.koha-community.org/3.10/en/batchmodifyitems.html">Batch Item Modifications</a> and <a href="http://manual.koha-community.org/3.10/en/batchdeleteitems.html">Batch Item Deletions</a> in the manual (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 236e89e..ee72d92 100644 (file)
@@ -16,6 +16,6 @@
        <li>Clicking 'Finish' will delete or anonymize your data</li>
 </ul>
 
-<p><strong>See the full documentation for Anonymizing Patrons in the <a href="http://manual.koha-community.org/3.8/en/anonpatrons.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Anonymizing Patrons in the <a href="http://manual.koha-community.org/3.1-/en/anonpatrons.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 8f960ea..c7c37d6 100644 (file)
@@ -4,7 +4,7 @@
 
 <p>CSV Profiles are created to define how you would like your cart or list to export.</p>
 
-<h2>Add CSV Profiles</h2>
+<h3>Add CSV Profiles</h3>
 
 <p>To add a CSV Profile</p>
 
        <li>Click 'CSV Profiles' from the Tools menu
 <ul>
        <li>The 'Profile name' will appear on the export pull down list when choosing 'Download' from your cart or list</li>
-       <li>The 'Profile description' is for your own benefit</li>
+    <li>The 'Profile description' is for your own benefit, but will also appear in the OPAC when patrons download content, so make sure it's clear to your patrons as well</li>
        <li>The 'CSV separator' is the character used to separate values and value groups</li>
+    <li><strong>Tip:</strong> The most common option here is comma because most spreadsheet applications know how to open files split by commas.</li>
        <li>The 'Field separator' is the character used to separate duplicate fields
 <ul>
-       <li>Example: You may have multiple 650 fields</li>
+    <li>Example: You may have multiple 650 fields and this is the character that will appear in between each one in the column</li>
 </ul>
 </li>
        <li>The 'Subfield separator' is the character used to separate duplicate subfields
 </ul>
 </li>
        <li>The 'Encoding' field lets you define the encoding used when saving the file</li>
-       <li>Finally format your CSV file using the 'Profile marcfields' fields
+    <li>Finally format your CSV file using the 'Profile MARC fields' fields
 <ul>
-       <li>Define which fields or subfields you want to export, separated by pipes. Example : 200|210$a|301</li>
-       <li style="background-color: #ffe599;">Tip: You can also use your own headers (instead of the ones from Koha) by prefixing the field number with an header, followed by the equal sign. Example : Personal name=200|Entry element=210$a|300|009</li>
+    <li>Define which fields or subfields you want to export, separated by pipes. Example :200|210$a|301</li>
+    <li><strong>Tip:</strong> You can also use your own headers (instead of the ones from Koha) by prefixing the field number with an header, followed by the equal sign. Example : Personal name=100|title=245$a|300</li>
 </ul>
 </li>
 </ul>
 </li>
 </ul>
 
-<h2>Modify CSV Profiles</h2>
+<p>When you have entered in all of the information for you profile, simply click 'Submit' and you will be presented with a confirmation that your profile has been saved.</p>
+
+<h3>Modify CSV Profiles</h3>
 
 <p>Once you have created at least one CSV Profile an 'Edit profile' tab will appear next to the 'New profile' button.</p>
 
 <ul>
-       <li>Choose the profile you would like to edit and alter the necessary fields.</li>
-       <li>To delete a profile, check the 'Delete selected profile' option before clicking 'Submit Query'</li>
+    <li>Choose the profile you would like to edit and alter the necessary fields.</li>
+    <li>After submitting your changes you will be presented with a confirmation message at the top of the screen</li>
+    <li>To delete a profile, check the 'Delete selected profile' option before clicking 'Submit Query'</li>
 </ul>
 
-<h2>Using CSV Profiles</h2>
+<h3>Using CSV Profiles</h3>
 
-<p>Your CSV Profiles will appear on the export list or cart menu under the 'Download' button</p>
+<p>Your CSV Profiles will appear on the export list or cart menu under the 'Download' button in both the staff client and the OPAC</p>
 
-<p><strong>See the full documentation for CSV Profiles in the <a href="http://manual.koha-community.org/3.8/en/csvprofiles.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for CSV Profiles in the <a href="http://manual.koha-community.org/3.10/en/csvprofiles.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 5188b9d..54438e5 100644 (file)
@@ -2,12 +2,16 @@
 
 <h1>MARC Export</h1>
 
-<p>Koha comes with a tool that will allow you to export your bibliographic and/or holdings data in bulk. This can be used to send your records to fellow libraries, organizations or services; or simply for backup purposes.</p>
+<p>Koha comes with a tool that will allow you to export your bibliographic, holdings and/or authority data in bulk. This can be used to send your records to fellow libraries, organizations or services; or simply for backup purposes.</p>
+
+<h3>Export Bibliographic Records</h3>
+
+<p>At the top of the screen you need to pick what data you're exporting. If you're exporting bibliographic records with or without the holdings information you want to click the 'Export bibliographic records' tab.</p>
 
 <ul>
-       <li>Fill in the form in order to limit your export to a specific range (all fields are optional)</li>
+    <li>Fill in the form in order to limit your export to a specific range (all fields are optional)
 <ul>
-       <li>Choose to limit your export by any one or more of the following options</li>
+    <li>Choose to limit your export by any one or more of the following options
 <ul>
        <li>Limit to a bib number range</li>
        <li>Limit to a specific item type</li>
        <li>Limit to a call number range</li>
        <li>Limit to an acquisition date range</li>
 </ul>
-       <li>Next choose what to skip when exporting</li>
+</li>
+    <li>Next choose what to skip when exporting
 <ul>
        <li>By default items will be exported, if you would like to only export bibliographic data, check the 'Don't export items' box</li>
        <li>To limit your export only to items from the library you're logged in as (if you leave the 'Library' field set to 'All') or to the library you selected above check the 'Remove non-local items' box</li>
        <li>You can also choose what fields you don't want to export. This can be handy if you're sharing your data, you can remove all local fields before sending your data to another library</li>
 </ul>
-       <li>Finally choose the file type and file name</li>
+</li>
+    <li>Finally choose the file type and file name
 <ul>
        <li>Choose to export your data in marc or marcxml format</li>
        <li>Choose the name you want your file to save as</li>
 </ul>
-       <li>Click 'Export'</li>
+</li>
+    <li>Click 'Export bibliographic records'</li>
+</ul>
+</li>
+</ul>
+
+<h3>Export Authority Records</h3>
+
+<p>At the top of the screen you need to pick what data you're exporting. If you're exporting authority records you want to click the 'Export authority records' tab.</p>
+
+<ul>
+    <li>Fill in the form in order to limit your export to a specific range or type of authority record (all fields are optional)</li>
+    <li>Next choose fields that you would like to exclude from the export separated by a space (no commas)
+<ul>
+    <li>If you'd like to exclude all subfields of the 200 for example just enter 200</li>
+    <li>If you'd like to exclude a specific subfield enter it beside the field value 100a will exclude just the subfield 'a' of the 100</li>
+</ul>
+</li>
+    <li>Finally choose the file type and file name
+<ul>
+    <li>Choose to export your data in marc or marcxml format</li>
+    <li>Choose the name you want your file to save as</li>
 </ul>
+</li>
+    <li>Click 'Export authority records'</li>
 </ul>
 
-<p><strong>See the full documentation for Exporting MARC Records in the <a href="http://manual.koha-community.org/3.8/en/exportbibs.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Exporting MARC Records in the <a href="http://manual.koha-community.org/3.10/en/exportbibs.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 9d335a9..923e1d5 100644 (file)
@@ -19,7 +19,7 @@
 
 <h3>Adding Events</h3>
 
-<p>Before adding events, choose the library you would like to apply the closings to. When adding events you will be asked if you would like to apply the event to one branch or all branches. To add events, simply</p>
+<p>Before adding events, choose the library you would like to apply the closings to. When adding events you will be asked if you would like to apply the event to one library or all libraries. To add events, simply</p>
 
 <ul>
        <li>Click on the date on the calendar that you would like to apply the closing to</li>
@@ -39,7 +39,7 @@
 </li>
     <li>Finally decide if this event should be applied to all libraries or just the one you have originally selected
 <ul>
-    <li>If you'd rather enter all the holidays and then copy them all to another branch all at once you can use the copy menu below the calendar</li>
+    <li>If you'd rather enter all the holidays and then copy them all to another library all at once you can use the copy menu below the calendar</li>
 </ul>
 </li>
 </ul>
@@ -65,7 +65,7 @@
 
 <p>When adding or editing events you can get additional help by clicking on the question mark next to various different options on the form</p>
 
-<p><strong>See the full documentation for the Calendar in the <a href="http://manual.koha-community.org/3.8/en/calholidays.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for the Calendar in the <a href="http://manual.koha-community.org/3.10/en/calholidays.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
 
index f65ff9c..7ad3322 100644 (file)
@@ -55,6 +55,6 @@
 </li>
 </ul>
 
-<p><strong>See the full documentation for Patron Import in the <a href="http://manual.koha-community.org/3.8/en/patronimport.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Patron Import in the <a href="http://manual.koha-community.org/3.10/en/patronimport.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index 4eba729..c02da58 100644 (file)
@@ -16,6 +16,6 @@
 
 <p>Choose the text file and the date you want to mark all times as seen and click 'Submit.'</p>
 
-<p><strong>See the full documentation for Inventory in the <a href="http://manual.koha-community.org/3.8/en/inventory.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Inventory in the <a href="http://manual.koha-community.org/3.10/en/inventory.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 9eb742d..67f438e 100644 (file)
@@ -22,6 +22,6 @@
        <li>News on the circulation receipts will appear below the items that are checked out</li>
 </ul>
 
-<p><strong>See the full documentation for News in the <a href="http://manual.koha-community.org/3.8/en/tools.html#newstool">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for News in the <a href="http://manual.koha-community.org/3.10/en/tools.html#newstool">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]    
\ No newline at end of file
index ae9cbaa..bae182f 100644 (file)
 
 <p>An example of using these two tags in a notice template might be like:</p>
 
-<pre class="programlisting">   The following item(s) is/are currently overdue:
+<pre>The following item(s) is/are currently overdue:
 
    &lt;item&gt;"&lt;&lt;biblio.title&gt;&gt;" by &lt;&lt;biblio.author&gt;&gt;, &lt;&lt;items.itemcallnumber&gt;&gt;, Barcode: &lt;&lt;items.barcode&gt;&gt; Fine: &lt;fine&gt;GBP&lt;/fine&gt;&lt;/item&gt;</pre>
-Which, assuming two items were overdue, would result in a notice like:
-<pre class="programlisting">   The following item(s) is/are currently overdue:
+
+<p>Which, assuming two items were overdue, would result in a notice like:</p>
+
+<pre>The following item(s) is/are currently overdue:
 
    "A Short History of Western Civilization" by Harrison, John B, 909.09821 H2451, Barcode: 08030003 Fine: £3.50
    "History of Western Civilization" by Hayes, Carlton Joseph Huntley, 909.09821 H3261 v.1, Barcode: 08030004 Fine: £3.50</pre>
@@ -73,50 +75,49 @@ Which, assuming two items were overdue, would result in a notice like:
        <li>ACQCLAIM (Acquisition Claim)
 <ul>
        <li>Used in the claim acquisition module</li>
-    <li><span class="emphasis"><em>Get there:</em></span> More &gt; Acquisitions &gt; Late issues</li>
+    <li><em>Get there:</em> More &gt; Acquisitions &gt; Late issues</li>
 </ul>
 </li>
        <li>HOLD (Hold Available for Pickup)
 <ul>
        <li>This notice is used if two criteria are met:
-<div class="orderedlist">
 <ol type="1">
-    <li>The <span class="link">EnhancedMessagingPreferences</span> is set to 'Allow'</li>
+    <li>The EnhancedMessagingPreferences is set to 'Allow'</li>
        <li>The patron has requested to receive this notice
 <ul>
-    <li><span class="emphasis"><em>Get there: </em></span>OPAC &gt; Login &gt; my messaging</li>
-    <li><span class="emphasis"><em>Get there: </em></span>Staff Client &gt; Patron Record &gt; Notices</li>
+    <li><em>Get there: </em>OPAC &gt; Login &gt; my messaging</li>
+    <li><em>Get there: </em>Staff Client &gt; Patron Record &gt; Notices</li>
 </ul>
 </li>
 </ol>
-</div></li>
-    <li>When this notice references the branches table it is referring to the pickup branch information.</li>
+</li>
+    <li>When this notice references the branches table it is referring to the pickup library information.</li>
 </ul>
 </li>
        <li>HOLDPLACED (a notice to the library staff that a hold has been placed)
 <ul>
        <li>This notice requires the emailLibrarianWhenHoldIsPlaced system preference to be set to 'Enable'</li>
-    <li>When this notice references the branches table it is referring to the pickup branch information.</li>
+    <li>When this notice references the branches table it is referring to the pickup library information.</li>
 </ul>
 </li>
        <li>HOLD_PRINT (Printed notice when hold available for pickup)
 <ul>
        <li>This notice is used for hold confirmation notices that are sent out in print format. This will not effect what the email notice looks like.</li>
-    <li>When this notice references the branches table it is referring to the pickup branch information.</li>
+    <li>When this notice references the branches table it is referring to the pickup library information.</li>
 </ul>
 </li>
        <li>ODUE (Overdue Notice)
 <ul>
        <li>This notice is used to send Overdue Notices to Patrons</li>
-    <li>See a <span class="link">Sample Overdue Notice</span></li>
-    <li>Requires that you set <span class="link">Overdue Notice/Status Triggers</span></li>
+    <li>See a Sample Overdue Notice</li>
+    <li>Requires that you set Overdue Notice/Status Triggers</li>
 </ul>
 </li>
        <li>RLIST (Routing List)
 <ul>
        <li>Used in the serials module to notify patrons/staff of new issues of a serial
 <ul>
-    <li><span class="emphasis"><em>Get there:</em></span> More &gt; Serials &gt; <span class="link">New Subscription</span></li>
+    <li><em>Get there:</em> More &gt; Serials &gt; New Subscription</li>
 </ul>
 </li>
        <li>You have the option to select the 'Routing List' notice when creating a new subscription (Choose from the 'Patron notification' drop down).</li>
@@ -125,7 +126,7 @@ Which, assuming two items were overdue, would result in a notice like:
 </li>
 </ul>
 
-<p>There are also a set of predefined slips (or receipts) listed on this page. All of these slips can be customized by altering their text via the Notices &amp; Slips tool and their style using the <span class="link">SlipCSS</span> preference to define a stylesheet.</p>
+<p>There are also a set of predefined slips (or receipts) listed on this page. All of these slips can be customized by altering their text via the Notices &amp; Slips tool and their style using the SlipCSS preference to define a stylesheet.</p>
 
 <p>Here is what those slips are used for:</p>
 
@@ -151,11 +152,11 @@ Which, assuming two items were overdue, would result in a notice like:
     <li>TRANSFERSLIP
 <ul>
     <li>Used to print a transfer slip</li>
-    <li>The transfer sliip is printed when you confirm a transfer from one branch to another in your system</li>
+    <li>The transfer sliip is printed when you confirm a transfer from one library to another in your system</li>
 </ul>
 </li>
 </ul>
 
-<p><strong>See the full documentation for Notices in the <a href="http://manual.koha-community.org/3.8/en/notices.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Notices in the <a href="http://manual.koha-community.org/3.10/en/notices.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index a911863..e4da1a7 100644 (file)
@@ -40,7 +40,7 @@
 </li>
 </ul>
 
-<p><strong>See the full documentation for the Managing Staged MARC Records in the <a href="http://manual.koha-community.org/3.8/en/managestaged.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for the Managing Staged MARC Records in the <a href="http://manual.koha-community.org/3.10/en/managestaged.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
 
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/modborrowers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/modborrowers.tt
new file mode 100644 (file)
index 0000000..7fabf69
--- /dev/null
@@ -0,0 +1,19 @@
+[% INCLUDE 'help-top.inc' %]
+
+<h1>Batch Patron Modification</h1>
+
+<p>With this tool you can make edits to a batch of patron records. Simply load in a file of cardnumbers (one per line) or scan patron card numbers in to the box provided.</p>
+
+<p>Once you have the file loaded or the barcodes scanned click 'Continue.' You will be presented with a list of the patrons and the changes you can make.</p>
+
+<p>To the left of each text box there is a checkbox. Clicking that checkbox will clear our the field values.</p>
+
+<p style="color:#990000;">Important: If the field is mandatory you will not be able to clear the value in it.</p>
+
+<p>If you have multiple patron attributes you can change them all by using the plus (+) sign to the right of the text box. This will allow you to add another attribute value.</p>
+
+<p>Once you have made the changes you want, you can click 'Save' and Koha will present you with the changed patron records.</p>
+
+<p><strong>See the full documentation for Batch Patron Modification in the <a href="http://manual.koha-community.org/3.10/en/tools.html#batchpatronmod">manual</a> (online).</strong></p>
+
+[% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 06839ce..1504364 100644 (file)
@@ -41,7 +41,7 @@
 
 <p>Sincerely, Library Staff</p>
 
-<p><strong>See the full documentation for the Overdue Notice/Status Triggers in the <a href="http://manual.koha-community.org/3.8/en/noticetriggers.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for the Overdue Notice/Status Triggers in the <a href="http://manual.koha-community.org/3.10/en/noticetriggers.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
 
index 1feb07f..bdae00a 100644 (file)
@@ -20,6 +20,6 @@
 
 <p style="color:#990000;">Important: There is a limit of 520K on the size of the picture uploaded and it is recommended that the image be 200x300 pixels, but smaller images will work as well.</p>
 
-<p><strong>See the full documentation for the Patron Image Uploader in the <a href="http://manual.koha-community.org/3.8/en/uploadpatronimages.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for the Patron Image Uploader in the <a href="http://manual.koha-community.org/3.10/en/uploadpatronimages.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index 31a8e14..f13cb9a 100644 (file)
@@ -1,8 +1,9 @@
 [% INCLUDE 'help-top.inc' %]
 
-<h1>QOTD Uploader</h1>
+<h1>Quote of the Day Uploader</h1>
+
+<p>The Quote of the Day (QOTD) uploader allows for uploading of bulk quotes into the pool of quotes which serve as the source of the Quote-Of-The-Day (QOTD) feature in OPAC.</p>
 
-<p style="font-size:18px;font-style:italic;">The QOTD uploader allows for uploading of bulk quotes into the pool of quotes which serve as the source of the Quote-Of-The-Day (QOTD) feature in OPAC.</p>
 <p>There are four basic functions in the uploader:</p>
 
 <ol>
@@ -39,6 +40,6 @@
     </ol>
 </ol>
 
-<p><strong>See the full documentation for the QOTD Uploader in the <a href="http://manual.koha-community.org/3.8/en/QOTDuploader.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for the Quote of the Day Uploader in the <a href="http://manual.koha-community.org/3.10/en/additionaltools.html#importquote">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index 9509ae2..ce069be 100644 (file)
@@ -1,8 +1,9 @@
 [% INCLUDE 'help-top.inc' %]
 
-<h1>QOTD Editor</h1>
+<h1>Quote of the Day Editor</h1>
+
+<p>The Quote of the Day (QOTD) editor allows for editing of and adding to the pool of quotes which serve as the source of the Quote-Of-The-Day (QOTD) feature in OPAC.</p>
 
-<p>The QOTD editor allows for editing of and adding to the pool of quotes which serve as the source of the Quote-Of-The-Day (QOTD) feature in OPAC.</p>
 <p>There are four basic functions in the editor:</p>
 
 <ol>
@@ -37,6 +38,6 @@
     </ol>
 </ol>
 
-<p><strong>See the full documentation for the QOTD Editor in the <a href="http://manual.koha-community.org/3.8/en/QOTDeditor.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for the Quote of the Day Editor in the <a href="http://manual.koha-community.org/3.10/en/additionaltools.html#QOTDEditor">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index d864149..258ec67 100644 (file)
@@ -23,6 +23,6 @@
 
 <p>Task scheduler will not work if the user the web server runs as doesn't have the permission to use it. To find out if the right user has the permissions necessary, check /etc/at.allow to see what users are in it. If you don't have that file, check etc/at.deny. If at.deny exists but is blank, then every user can use it. Talk to your system admin about adding the user to the right place to make the task scheduler work.</p>
 
-<p><strong>See the full documentation for the Task Scheduler in the <a href="http://manual.koha-community.org/3.8/en/taskscheduler.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for the Task Scheduler in the <a href="http://manual.koha-community.org/3.10/en/taskscheduler.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
index 014d4cb..6850565 100644 (file)
@@ -25,6 +25,6 @@
        <li>To complete the process continue to the Managed Staged MARC Records Tool</li>
 </ul>
 
-<p><strong>See the full documentation for the MARC Import in the <a href="http://manual.koha-community.org/3.8/en/stagemarc.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for the MARC Import in the <a href="http://manual.koha-community.org/3.10/en/stagemarc.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 40697de..88084a1 100644 (file)
@@ -4,6 +4,6 @@
 
 <p>Tools in Koha all perform some sort of action. Often many of the items listed under Tools in Koha are referred to as 'Reports' in other library management systems.</p>
 
-<p><strong>See the full documentation for Tools in the <a href="http://manual.koha-community.org/3.8/en/tools.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Tools in the <a href="http://manual.koha-community.org/3.10/en/tools.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index b28fa18..93dd614 100644 (file)
@@ -40,6 +40,6 @@
 
 <p>In the OPAC the cover images will also appear in the images tab, as well as next to the title and on the search results.</p>
 
-<p><strong>See the full documentation for Uploading Cover Images in the <a href="http://manual.koha-community.org/3.8/en/uploadlocalimages.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Uploading Cover Images in the <a href="http://manual.koha-community.org/3.10/en/uploadlocalimages.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 8783a90..f28a0be 100644 (file)
@@ -8,6 +8,6 @@
 
 <p>You will note that real names do not appear on the log, only identifying numbers. You need to use the identifying numbers when searching the logs as well.</p>
 
-<p><strong>See the full documentation for the Log Viewer in the <a href="http://manual.koha-community.org/3.8/en/logviewer.html">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for the Log Viewer in the <a href="http://manual.koha-community.org/3.10/en/logviewer.html">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index d861392..ce24a9e 100644 (file)
@@ -67,6 +67,6 @@
 
 <p style="color: rgb(153, 0, 0);">Important: It is important to rebuild your zebra index immediately after merging records. If a search is performed for a record which has been deleted Koha will present the patrons with an error in the OPAC.</p>
 
-<p><strong>See the full documentation for Lists in the <a href="http://manual.koha-community.org/3.8/en/stafflists.html#lists">manual</a> (online).</strong></p>
+<p><strong>See the full documentation for Lists in the <a href="http://manual.koha-community.org/3.10/en/stafflists.html#lists">manual</a> (online).</strong></p>
 
 [% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
index 38658dd..4e91e06 100644 (file)
    <div id="bd" role="main">
     <div id="yui-main">
     <div class="yui-b"><div class="yui-g">
+    [% IF adminWarning %]
+        <div id="adminwarning" class="dialog alert">
+            <p><strong>Warning:</strong> You're logged in with the database administrator account. This a bad idea, and you are likely to encounter problems.</p>
+            <p>You should <a href="/cgi-bin/koha/members/memberentry.pl?op=add">create a patron</a> to use when administering Koha and give it superlibrarian permissions.</p>
+        </div>
+    [% END %]
     <div class="yui-u first">
+
             <div id="area-list-left">
                 <ul class="biglinks-list">
                     [% IF ( CAN_user_circulate ) %]
index 59caa81..f05e63f 100644 (file)
@@ -74,7 +74,7 @@
                 <fieldset class="rows">
                     <ol>
                         <li>
-                            <label for="template_id" style="width:9em">Select a template to be applied: </label>
+                            <label for="template_id" style="width:20em">Select a template to be applied: </label>
                             <select name="template_id" id="template_id">
                                     [% FOREACH template IN templates %]
                                     <option value="[% template.template_id %]">[% template.template_code %]</option>
@@ -82,7 +82,7 @@
                                 </select>
                         </li>
                         <li>
-                            <label for="layout_id" style="width:9em">Select a layout to be applied: </label>
+                            <label for="layout_id" style="width:20em">Select a layout to be applied: </label>
                             <select name="layout_id" id="layout_id">
                                     [% FOREACH layout IN layouts %]
                                     <option value="[% layout.layout_id %]">[% layout.layout_name %]</option>
@@ -90,7 +90,7 @@
                                 </select>
                         </li>
                         <li>
-                            <label for="start_label" style="width:9em">Enter starting label number: </label>
+                            <label for="start_label" style="width:20em">Enter starting label position (for PDF): </label>
                             <input type="text" size="5" id="start_label" name="start_label" class="focus" title="Starting label number" value="1"/>
                         </li>
                     </ol>
index 7060cbf..613ad36 100644 (file)
@@ -24,8 +24,8 @@
 
                                                <div class="browse">
                                                        Browse by last name:
-                                                       [% FOREACH letter IN letters %]
-                                                               <a href="/cgi-bin/koha/members/member.pl?quicksearch=1&amp;surname=[% letter.letter %]">[% letter.letter %]</a>
+                            [% FOREACH letter IN alphabet.split(' ') %]
+                                <a href="/cgi-bin/koha/members/member.pl?quicksearch=1&amp;surname=[% letter %]">[% letter %]</a>
                                                        [% END %]
                                                </div>
 
                                                        <td>[% resultsloo.cardnumber %]</td>
                             <td style="white-space: nowrap;">
                             <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% resultsloo.borrowernumber %]">
-                            [% INCLUDE 'patron-title.inc' category_type = resultsloo.category_type firstname = resultsloo.firstname surname = resultsloo.surname othernames = resultsloo.othernames cardnumber = resultsloo.cardnumber invert_name = 1%]
+                            [% INCLUDE 'patron-title.inc' borrowernumber = resultsloo.borrowernumber category_type = resultsloo.category_type firstname = resultsloo.firstname surname = resultsloo.surname othernames = resultsloo.othernames cardnumber = resultsloo.cardnumber invert_name = 1%]
                             </a> <br />
                             [% IF ( resultsloo.streetnumber ) %][% resultsloo.streetnumber %] [% END %][% resultsloo.address %][% IF ( resultsloo.address2 ) %]<br />[% resultsloo.address2 %][% END %][% IF ( resultsloo.city ) %]<br />[% resultsloo.city %][% IF ( resultsloo.state ) %],[% END %][% END %][% IF ( resultsloo.state ) %] [% resultsloo.state %][% END %] [% IF ( resultsloo.zipcode ) %]  [% resultsloo.zipcode %][% END %][% IF ( resultsloo.country ) %], [% resultsloo.country %][% END %]</td>
                                                        <td>[% resultsloo.category_description %] ([% resultsloo.category_type %])</td>
-                                                       <td>[% resultsloo.branchcode %]</td>
+                                                       <td>[% resultsloo.branchname %]</td>
                                                        <td>[% resultsloo.dateexpiry %]</td>
                                                        <td>[% IF ( resultsloo.overdues ) %]<span class="overdue"><strong>[% resultsloo.overdues %]</strong></span>[% ELSE %][% resultsloo.overdues %][% END %]/[% resultsloo.issues %]</td>
                                                        <td>[% IF ( resultsloo.fines < 0 ) %]<span class="credit">[% resultsloo.fines %]</span> [% ELSIF resultsloo.fines > 0 %] <span class="debit"><strong>[% resultsloo.fines %]</strong></span> [% ELSE %] [% resultsloo.fines %] [% END %]</td>
index 96e17c5..e327d03 100644 (file)
@@ -36,7 +36,7 @@
     });
 
     function clear_entry(node) {
-        var original = node.parentNode.parentNode;
+        var original = $(node).parent();
         $("textarea", original).attr('value', '');
         $("select", original).attr('value', '');
     }
         [% END %]
        </ol>
   </fieldset>
-    [% UNLESS nodateenrolled && nodateexpiry &&  noopacnote && noborrowernotes %]
+    [% UNLESS nodateenrolled &&  noopacnote && noborrowernotes %]
        <fieldset class="rows" id="memberentry_subscription">
        <legend id="library_setup_lgd">Library set-up</legend><ol>
         [% UNLESS nodateenrolled %]
         [% END %]
         [% UNLESS nodateexpiry %]
                <li>
+        [% ELSE %]
+                <li style="display:none">
+        [% END %]
                        [% IF ( mandatorydateexpiry ) %]
             <label for="to" class="required">
                        [% ELSE %]
                [% IF ( ERROR_dateexpiry ) %]<span class="required">(Error)</span>[% END %]
                <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
                </li>
-        [% END %]
         [% UNLESS noopacnote %]
                <li>
                        [% IF ( mandatoryopacnote ) %]
   </fieldset>
 [% END %] [% END %]
 
+[% UNLESS ( check_member ) %]
     <fieldset class="action">
         <input type="submit" name="save" onclick="return check_form_borrowers();" value="Save" />
       [% IF ( opadd ) %]
          <a class="cancel" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">Cancel</a>
           [% END %]
     </fieldset>
+[% END %]
 </form>
   
 </div>
index abbf26f..4e6271f 100644 (file)
@@ -11,6 +11,7 @@
 [% INCLUDE 'calendar.inc' %]
 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery-ui-timepicker-addon.js"></script>
 <script type="text/JavaScript" language="JavaScript">
 //<![CDATA[
 $.tablesorter.addParser({
@@ -84,7 +85,11 @@ $(document).ready(function() {
                }
        });
     $("#suspend_until").datepicker({ minDate: 1 }); // require that hold suspended until date is after today
-    $("#newduedate").datepicker({ minDate: 1 }); // require that renewal date is after today
+    $("#newduedate").datetimepicker({
+        minDate: 1, // require that renewal date is after today
+        hour: 23,
+        minute: 59
+    });
  });
 function uncheck_sibling(me){
 nodename=me.getAttribute("name");
index aa6a627..fa0ae38 100644 (file)
@@ -62,6 +62,7 @@ $(document).ready(function(){
 [% END %]
   // call the tablesorter plugin
   $("#table_reports").tablesorter({
+    widgets : ['zebra'],
     sortList: [[1,0]],
     headers: {
        6: { sorter: false},
@@ -173,7 +174,7 @@ canned reports and writing custom SQL reports.</p>
 </thead>
 <tbody>
 [% FOREACH savedreport IN savedreports %]
-[% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
+[% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %]
 <td>[% savedreport.id %]</td>
 <td>[% savedreport.report_name %]</td>
 <td>[% savedreport.type %]</td>
index af51a4c..65f662f 100644 (file)
@@ -38,6 +38,7 @@
                 <th>Call number</th>
                 <th>Subscription begin</th>
                 <th>Subscription end</th>
+                <th>Expired? / Closed?</th>
                        </tr>
                </thead>
                <tbody>
                                        <td>[% data.callnumber %]</td>
                                        <td>[% data.startdate %]</td>
                                        <td>[% data.enddate %]</td>
+                    <td>
+                        [% IF data.closed %]
+                            Closed
+                        [% ELSIF data.expired %]
+                            Expired
+                        [% END %]
+                    </td>
                                </tr>
                                [% END %]
                        </tr>
index 5d9f7a9..c1f3aa1 100644 (file)
                <option>Late</option>
                <option>Missing</option>
                <option>Claimed</option>
+        <option>Stopped</option>
            </select>
        </li>
        
                             [% IF ( missingissue.status3 ) %]Late[% END %]
                             [% IF ( missingissue.status4 ) %]Missing[% END %]
                             [% IF ( missingissue.status7 ) %]Claimed[% END %]
+                            [% IF ( missingissue.status8 ) %]Stopped[% END %]
                         </td>
                         <td class="planneddate">
                         [% missingissue.planneddate %]
index ae998cc..dbdfda9 100644 (file)
@@ -68,12 +68,14 @@ function active(numlayer)
                                        [% serial.serialseq %]
                                </td>
                                <td>
-                                       [% IF ( serial.status1 ) %]Arrived[% END %]
-                                       [% IF ( serial.status2 ) %]Expected[% END %]
-                                       [% IF ( serial.status3 ) %]Late[% END %]
-                                       [% IF ( serial.status4 ) %]Missing[% END %]
-                    [% IF ( serial.status5 ) %]Not available[% END %]
-                                       [% IF ( serial.status7 ) %]Claimed[% END %]
+                    [% IF ( serial.status1 ) %]Expected[% END %]
+                    [% IF ( serial.status2 ) %]Arrived[% END %]
+                    [% IF ( serial.status3 ) %]Late[% END %]
+                    [% IF ( serial.status4 ) %]Missing[% END %]
+                    [% IF ( serial.status5 ) %]Not issued[% END %]
+                    [% IF ( serial.status6 ) %]Delete[% END %]
+                    [% IF ( serial.status7 ) %]Claimed[% END %]
+                    [% IF ( serial.status8 ) %]Stopped[% END %]
                                </td>
                        </tr>
                        [% END %]
index 23b496b..6281258 100644 (file)
@@ -1,9 +1,18 @@
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Serials &rsaquo; Serial collection information for [% bibliotitle %]</title>
+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
 [% INCLUDE 'doc-head-close.inc' %]
+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
+<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
 
 <script type="text/javascript">
 //<![CDATA[
+function generateReceive(subscriptionid) {
+    if(nbissues=prompt(_("How many issues do you want to receive ?"))){
+        document.location = 'serials-collection.pl?op=gennext&subscriptionid='+subscriptionid+'&nbissues='+nbissues;
+    }
+}
 function print_slip(subscriptionid,issue){
     var myurl = 'routing-preview.pl?ok=1&subscriptionid='+subscriptionid+'&issue='+issue;
     window.open(myurl,'PrintSlip','width=500,height=500,toolbar=no,scrollbars=yes');
@@ -40,10 +49,31 @@ function generateNext(subscriptionid) {
        }
 }
 
+function CheckAll( node ) {
+    $("#"+node).checkCheckboxes();
+    return false;
+}
+function CheckNone( node ) {
+    $("#"+node).unCheckCheckboxes();
+    return false;
+}
 $(document).ready(function() {
     $('#subscription_years').tabs();
+    [% IF dateformatmetric %]
+      dt_add_type_uk_date();
+    [% END %]
+
+    $(".subscription-year-table").dataTable($.extend(true, {}, dataTablesDefaults, {
+        "aoColumnDefs": [
+            { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
+        ],
+        "aaSorting": [[0, 'desc']],
+        "bAutoWidth": false,
+        "bPaginate": false,
+        "bInfo": false,
+        "bFilter": false,
+    } ));
 });
 
 //]]>
 </script>
@@ -146,22 +176,33 @@ $(document).ready(function() {
                 [% END %]</td>
             <td> [% subscription.branchcode %]</td>
             <td> [% subscription.callnumber %]</td>
-        <td> [% subscription.notes %]        [% IF ( subscription.subscriptionexpired ) %]<br /><span class="problem"> Subscription expired</span>
-        [% END %]
+        <td> [% subscription.notes %]
+            [% UNLESS subscription.closed %]
+                [% IF ( subscription.subscriptionexpired ) %]
+                    <br /><span class="problem"> Subscription expired</span>
+                [% END %]
+            [% ELSE %]
+                <br /> Subscription closed
+            [% END %]
         </td>
         [% IF ( routing && CAN_user_serials_routing ) %]
         <td>
-            <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]">Edit routing list</a>
+            [% UNLESS subscription.closed %]
+                <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]">Edit routing list</a>
+            [% END %]
         </td>
         [% END %]
-        [% IF ( subscription.abouttoexpire ) %]<td class="problem"> <a href="/cgi-bin/koha/serials/subscription-renew.pl?subscriptionid=[% subscription.subscriptionid %]" onclick="popup([% subscription.subscriptionid %]); return false;">Renew</a></td>
-        [% ELSE %]
-        [% IF ( subscription.subscriptionexpired ) %]<td class="problem"> <a href="/cgi-bin/koha/serials/subscription-renew.pl?subscriptionid=[% subscription.subscriptionid %]" onclick="popup([% subscription.subscriptionid %]); return false;">Renew</a></td>
+        [% UNLESS subscription.closed %]
+            [% IF ( subscription.abouttoexpire ) %]<td class="problem"> <a href="/cgi-bin/koha/serials/subscription-renew.pl?subscriptionid=[% subscription.subscriptionid %]" onclick="popup([% subscription.subscriptionid %]); return false;">Renew</a></td>
+            [% ELSE %]
+                [% IF ( subscription.subscriptionexpired ) %]<td class="problem"> <a href="/cgi-bin/koha/serials/subscription-renew.pl?subscriptionid=[% subscription.subscriptionid %]" onclick="popup([% subscription.subscriptionid %]); return false;">Renew</a></td>
+                [% ELSE %]
+                    <td> &nbsp;</td>
+                [% END %]
+            [% END %]
         [% ELSE %]
-        <td> &nbsp;</td>
-        [% END %]
+            <td> &nbsp;</td>
         [% END %]
-
       </tr>
 [% END %]
 [% IF ( subscr ) %]
@@ -189,12 +230,22 @@ $(document).ready(function() {
     [% IF ( CAN_user_serials_receive_serials ) %]
         <p>
             <input type="submit" value="Edit serials" />&nbsp;
-            <input type="button" value="Generate Next" onclick="javascript:generateNext([% subscriptionidlist %])" />
+            [% UNLESS subscription.closed %]
+                <input type="button" value="Generate Next" onclick="javascript:generateNext([% subscriptionidlist %])" />
+                [% IF ( subscriptions.size == 1 and !serialsadditems ) %]&nbsp;<input type="button" value="Multi receiving" onclick="javascript:generateReceive([% subscriptionidlist %])" />[% END %]
+            [% END %]
         </p>
     [% END %]
-
-        <table>
-         <tr>
+      <span class="checkall">
+        <a class="CheckAll" href="#" onclick="CheckAll('subscription-year-[% year.year %]'); return false;">Select all</a>
+      </span> |
+      <span class="clearall">
+        <a class="CheckNone" href="#" onclick="CheckNone('subscription-year-[% year.year %]'); return false;">Clear all</a>
+      </span>
+        <table class="subscription-year-table">
+          <thead>
+            <tr>
+                [% IF ( CAN_user_serials_receive_serials ) %]<th>Edit</th>[% END %]
 [% IF ( subscriptions.size > 1 ) %]
                 <th># Subs</th>
 [% END %]
@@ -211,10 +262,28 @@ $(document).ready(function() {
                 <th>Library
                 </th>
                 [% IF ( routing ) %]<th>Routing</th>[% END %]
-                [% IF ( CAN_user_serials_receive_serials ) %]<th>Edit</th>[% END %]
             </tr>
+          </thead>
+          <tbody>
       [% FOREACH serial IN year.serials %]
     [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
+            [% IF ( CAN_user_serials_receive_serials ) %]
+                <td>
+                  [% IF ( serial.cannotedit ) %]
+                    disabled
+                  [% ELSE %]
+                    [% IF ( serial.subscriptionexpired ) %]
+                    <input type="checkbox" name="serialid" value="[% serial.serialid %]" disabled="disabled" />
+                    [% ELSE %]
+                      [% IF ( serial.checked ) %]
+                    <input type="checkbox" class="checkboxed" name="serialid" checked="checked" value="[% serial.serialid %]" />
+                      [% ELSE %]
+                    <input type="checkbox" class="checkboxed" name="serialid" value="[% serial.serialid %]" />
+                      [% END %]
+                    [% END %]
+                  [% END %]
+                </td>
+            [% END %]
 [% IF ( subscriptions.size > 1 ) %]
                  <td><a href="serials-collection.pl?subscriptionid=[% serial.subscriptionid %]">[% serial.subscriptionid %]</a></td>
 [% END %]
@@ -228,7 +297,14 @@ $(document).ready(function() {
                     [% serial.serialseq %]
                 </td>
                 <td>
-                    [% IF ( serial.status1 ) %]Expected[% END %][% IF ( serial.status2 ) %]Arrived[% END %][% IF ( serial.status3 ) %]Late[% END %][% IF ( serial.status4 ) %]Missing[% END %][% IF ( serial.status5 ) %]Not Available[% END %][% IF ( serial.status7 ) %]Claimed[% END %]
+                    [% IF ( latestserial.status1 ) %]Expected[% END %]
+                    [% IF ( latestserial.status2 ) %]Arrived[% END %]
+                    [% IF ( latestserial.status3 ) %]Late[% END %]
+                    [% IF ( latestserial.status4 ) %]Missing[% END %]
+                    [% IF ( latestserial.status5 ) %]Not issued[% END %]
+                    [% IF ( latestserial.status6 ) %]Delete[% END %]
+                    [% IF ( latestserial.status7 ) %]Claimed[% END %]
+                    [% IF ( latestserial.status8 ) %]Stopped[% END %]
                 </td>
                 <td>
                     [% serial.notes %]
@@ -241,26 +317,10 @@ $(document).ready(function() {
                     <a href="" onclick="print_slip([% serial.subscriptionid |html %], '[% serial.serialseq |html %] ([% serial.planneddate %])'); return false" >Print list</a>
                 </td>
                 [% END %]
-            [% IF ( CAN_user_serials_receive_serials ) %]
-                <td>
-                  [% IF ( serial.cannotedit ) %]
-                    disabled
-                  [% ELSE %]
-                    [% IF ( serial.subscriptionexpired ) %]
-                    <input type="checkbox" name="serialid" value="[% serial.serialid %]" disabled="disabled" />
-                    [% ELSE %]
-                      [% IF ( serial.checked ) %]
-                    <input type="checkbox" name="serialid" checked="checked" value="[% serial.serialid %]" />
-                      [% ELSE %]
-                    <input type="checkbox" name="serialid" value="[% serial.serialid %]" />
-                      [% END %]           
-                    [% END %]
-                  [% END %]
-                </td>
-            [% END %]
             </tr>
-      [% END %]
-        </table>
+          [% END %]
+        </tbody>
+      </table>
     </div>
     [% END %]
   <input type="hidden" name="subscriptionid" value="[% subscriptionidlist %]" />
index 79ce099..935d9e1 100644 (file)
@@ -1,8 +1,15 @@
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Serials &rsaquo; Serial edition [% bibliotitle %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
+<script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script>
 <script language="JavaScript" type="text/javascript">
 //<![CDATA[
+function generateReceive() {
+    var subscriptionid =  document.getElementsByName("subscriptionid")[0].value;
+    if(nbissues=prompt(_("How many issues do you want to receive ?"))){
+        document.location = 'serials-collection.pl?op=gennext&subscriptionid='+subscriptionid+'&nbissues='+nbissues;
+    }
+}
 function popup(subscriptionid) {
        window.open("subscription-renew.pl?subscriptionid="+subscriptionid,"subscription_renewal",'width=700,height=400,toolbar=false,scrollbars=yes');
 }
@@ -68,70 +75,7 @@ function changeDate2(adate) {
    var elem = document.getElementById("supexpecteddate");
     elem.value = adate;
 }
-function CloneSubfield(index){
-    var original = document.getElementById(index); //original <div>
-    var clone = original.cloneNode(true);
-    var new_key = CreateKey();
-    var old_id =  original.getAttribute('id');
-    old_id=old_id.substr(12);
-    var new_id  = old_id+new_key;
-    
-    // set the attribute for the new 'div' subfields
-    var inputs     = clone.getElementsByTagName('input');
-    var selects    = clone.getElementsByTagName('select');
-    var textareas  = clone.getElementsByTagName('textarea');
-        
-    // input
-    var id_input = "";
-    for(var i=0,len=inputs.length; i<len ; i++ ){
-        id_input = inputs[i].getAttribute('id')+new_key;
-        inputs[i].setAttribute('id',id_input);
-        inputs[i].setAttribute('name',inputs[i].getAttribute('name'));
-    }
-    
-    // select 
-    for(var i=0,len=selects.length; i<len ; i++ ){
-        id_input = selects[i].getAttribute('id')+new_key;
-        selects[i].setAttribute('id',selects[i].getAttribute('id')+new_key);
-        selects[i].setAttribute('name',selects[i].getAttribute('name'));
-    }
-    
-    // textarea
-    for(var i=0,len=textareas.length; i<len ; i++ ){
-        id_input = textareas[i].getAttribute('id')+new_key;
-        textareas[i].setAttribute('id',textareas[i].getAttribute('id')+new_key);
-        textareas[i].setAttribute('name',textareas[i].getAttribute('name'));
-    }
-    
-    [% UNLESS ( advancedMARCEditor ) %]
-    // when cloning a subfield, reset its label too.
-    var label = clone.getElementsByTagName('label')[0];
-    label.setAttribute('for',id_input);
-    [% END %]
-    
-    // setting a new if for the parent div
-    clone.setAttribute('id',new_id);
-    
-    var CloneButtonPlus;
-    try {
-      var spans = clone.getElementsByTagName('span');
-      if(spans.length){
-          for(var i = 0 ,lenspans = spans.length ; i < lenspans ; i++){
-            if(spans[i].getAttribute('class') == 'buttonPlus'){
-                    CloneButtonPlus = spans[i];
-                    CloneButtonPlus.setAttribute('onclick',"CloneSubfield('" + new_id + "')");
-                    var buttonUp = clone.getElementsByTagName('img')[0];
-                    buttonUp.setAttribute('onclick',"upSubfield('" + new_id + "')");
-                }
-            }
-        }
-    }
-    catch(e){
-        // do nothig if ButtonPlus & CloneButtonPlus don't exist.
-    }
-    // insert this line on the page
-    original.parentNode.insertBefore(clone,original.nextSibling);
-}
+
 $(document).ready(function() {
        $("form#serials_edit").submit(function() {
            var total_errors = 0;
@@ -224,7 +168,7 @@ $(document).ready(function() {
         </td>
         <td>
             [% IF ( serialslis.editdisable ) %]
-              <input type="hidden" name="status" id="status[% serialslis.serialid %]" value="1">
+              <input type="hidden" name="status" id="status[% serialslis.serialid %]" value="[% serialslis.serstatus %]">
               <select name="status" size="1"  disabled="disabled">
             [% ELSE %]
               [% IF ( serialslis.serialsadditems ) %]
@@ -233,39 +177,42 @@ $(document).ready(function() {
               <select name="status" size="1" id="status[% serialslis.serialid %]" onchange="if (this.value==2 || this.value==7){changeDate(this, '[% serialslis.arriveddate %]')} else {changeDate(this, '[% serialslis.planneddate %]')}" >
                [% END %] 
             [% END %]
-  [% IF ( serialslis.status1 ) %]
-                    <option value="1" selected="selected">Expected</option>
-  [% END %]
-  [% IF ( serialslis.status2 ) %]
-                    <option value="2" selected="selected">Arrived</option>
-  [% ELSE %]
-                    <option value="2">Arrived</option>
-  [% END %]
-  [% IF ( serialslis.status3 ) %]
-                    <option value="3" selected="selected">Late</option>
-  [% ELSE %]
-                    <option value="3">Late</option>
-  [% END %]
-  [% IF ( serialslis.status4 ) %]
-                    <option value="4" selected="selected">Missing</option>
-  [% ELSE %]
-                    <option value="4">Missing</option>
-  [% END %]
-  [% IF ( serialslis.status7 ) %]
-                    <option value="7" selected="selected">Claimed</option>
-  [% ELSE %]
-                    <option value="7">Claimed</option>
-  [% END %]
-  [% IF ( serialslis.status5 ) %]
-                    <option value="5" selected="selected">Not available</option>
-  [% ELSE %]
-                    <option value="5">Not available</option>
-  [% END %]
-  [% IF ( serialslis.status6 ) %]
-                    <option value="6" selected="selected">Delete</option>
-  [% ELSE %]
-                    <option value="6">Delete</option>
-  [% END %]
+            [% IF ( serialslis.status1 ) %]
+              <option value="1" selected="selected">Expected</option>
+            [% END %]
+            [% IF ( serialslis.status2 ) %]
+              <option value="2" selected="selected">Arrived</option>
+            [% ELSE %]
+              <option value="2">Arrived</option>
+            [% END %]
+            [% IF ( serialslis.status3 ) %]
+              <option value="3" selected="selected">Late</option>
+            [% ELSE %]
+              <option value="3">Late</option>
+            [% END %]
+            [% IF ( serialslis.status4 ) %]
+              <option value="4" selected="selected">Missing</option>
+            [% ELSE %]
+              <option value="4">Missing</option>
+            [% END %]
+            [% IF ( serialslis.status7 ) %]
+              <option value="7" selected="selected">Claimed</option>
+            [% ELSE %]
+              <option value="7">Claimed</option>
+            [% END %]
+            [% IF ( serialslis.status5 ) %]
+              <option value="5" selected="selected">Not available</option>
+            [% ELSE %]
+              <option value="5">Not available</option>
+            [% END %]
+            [% IF ( serialslis.status6 ) %]
+              <option value="6" selected="selected">Delete</option>
+            [% ELSE %]
+              <option value="6">Delete</option>
+            [% END %]
+            [% IF serialslis.status8 %]
+              <option value="8" selected="selected">Stopped</option>
+            [% END %]
             </select>
 
         </td>
@@ -287,7 +234,7 @@ $(document).ready(function() {
         [% FOREACH item IN serialslis.items %]
         <div id="item[% item.serialid %][% item.countitems %]" class="items">
         <ol>[% FOREACH iteminformatio IN item.iteminformation %]<li>
-               <div class="subfield_line" style="[% iteminformatio.hidden %];" id="subfield[% item.serialid %][% item.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]">
+               <div class="subfield_line" style="[% iteminformatio.hidden %]" id="subfield[% item.serialid %][% item.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]">
                               
                 <label>[% iteminformatio.subfield %] - [% IF ( iteminformatio.mandatory ) %]<b>[% END %][% iteminformatio.marc_lib %][% IF ( iteminformatio.mandatory ) %] *</b>[% END %]</label>
                 [% iteminformatio.marc_value %]
@@ -296,8 +243,10 @@ $(document).ready(function() {
                 <input type="hidden" name="tag" value="[% iteminformatio.tag %]" />
                 <input type="hidden" name="subfield" value="[% iteminformatio.subfield %]" />
                 <input type="hidden" name="mandatory" value="[% iteminformatio.mandatory %]" />
-                [% IF ( iteminformatio.ITEM_SUBFIELDS_ARE_NOT_REPEATABLE ) %]
-                    <span class="buttonPlus" onclick="CloneSubfield('subfield[% item.serialid %][% item.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]')">+</span>
+                [% IF ( iteminformatio.repeatable ) %]
+                    <a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode); return false;">
+                        <img src="/intranet-tmpl/prog/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
+                    </a>
                 [% END %]
         
             </div></li>
@@ -338,39 +287,42 @@ $(document).ready(function() {
             <select name="status" size="1" id="addstatus[% newserialloo.serialid %]" onchange="if (this.value==2){unHideItems('items'+'[% newserialloo.subscriptionid %][% newserialloo.serialid %]','label[% newserialloo.subscriptionid %][% newserialloo.serialid %]','[% newserialloo.serialid %]'); changeDate2('[% newserialloo.arriveddate %]')} else if (this.value==7){changeDate('[% newserialloo.arriveddate %]')} else { HideItems('items'+'[% newserialloo.subscriptionid %]'+[% newserialloo.serialid %],'label[% serialslis.subscriptionid %][% serialslis.serialid %]'); changeDate2('[% serialslis.planneddate %]')}" >
 
                     <option value="">----</option>
-  [% IF ( newserialloo.status1 ) %]
+                  [% IF ( newserialloo.status1 ) %]
                     <option value="1" selected="selected">Expected</option>
-  [% END %]
-  [% IF ( newserialloo.status2 ) %]
+                  [% END %]
+                  [% IF ( newserialloo.status2 ) %]
                     <option value="2" selected="selected">Arrived</option>
-  [% ELSE %]
+                  [% ELSE %]
                     <option value="2">Arrived</option>
-  [% END %]
-  [% IF ( newserialloo.status3 ) %]
+                  [% END %]
+                  [% IF ( newserialloo.status3 ) %]
                     <option value="3" selected="selected">Late</option>
-  [% ELSE %]
+                  [% ELSE %]
                     <option value="3">Late</option>
-  [% END %]
-  [% IF ( newserialloo.status4 ) %]
+                  [% END %]
+                  [% IF ( newserialloo.status4 ) %]
                     <option value="4" selected="selected">Missing</option>
-  [% ELSE %]
+                  [% ELSE %]
                     <option value="4">Missing</option>
-  [% END %]
-  [% IF ( newserialloo.status7 ) %]
+                  [% END %]
+                  [% IF ( newserialloo.status7 ) %]
                     <option value="7" selected="selected">Claimed</option>
-  [% ELSE %]
+                  [% ELSE %]
                     <option value="7">Claimed</option>
-  [% END %]
-  [% IF ( newserialloo.status5 ) %]
+                  [% END %]
+                  [% IF ( newserialloo.status5 ) %]
                     <option value="5" selected="selected">Not available</option>
-  [% ELSE %]
+                  [% ELSE %]
                     <option value="5">Not available</option>
-  [% END %]
-  [% IF ( newserialloo.status6 ) %]
+                  [% END %]
+                  [% IF ( newserialloo.status6 ) %]
                     <option value="6" selected="selected">Delete</option>
-  [% ELSE %]
+                  [% ELSE %]
                     <option value="6">Delete</option>
-  [% END %]
+                  [% END %]
+                  [% IF newserialloo.status8 %]
+                    <option value="8" selected="selected">Stopped</option>
+                  [% END %]
             </select>
 
         </td>
@@ -390,7 +342,7 @@ $(document).ready(function() {
           <div class="cataloguing_additem_itemlist">
         <div id="item[% newserialloo.serialid %][% newserialloo.countitems %]" class="items">
         <ol>[% FOREACH iteminformatio IN newserialloo.iteminformation %]<li>
-               <div class="subfield_line" style="[% iteminformatio.hidden %];" id="subfield[% newserialloo.serialid %][% newserialloo.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]">
+               <div class="subfield_line" style="[% iteminformatio.hidden %]" id="subfield[% newserialloo.serialid %][% newserialloo.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]">
    
                 <label>[% iteminformatio.subfield %] - [% IF ( iteminformatio.mandatory ) %]<b>[% END %][% iteminformatio.marc_lib %][% IF ( iteminformatio.mandatory ) %] *</b>[% END %]</label>
                 [% iteminformatio.marc_value %]
@@ -399,8 +351,10 @@ $(document).ready(function() {
                 <input type="hidden" name="tag" value="[% iteminformatio.tag %]" />
                 <input type="hidden" name="subfield" value="[% iteminformatio.subfield %]" />
                 <input type="hidden" name="mandatory" value="[% iteminformatio.mandatory %]" />
-                [% IF ( iteminformatio.ITEM_SUBFIELDS_ARE_NOT_REPEATABLE ) %]
-                    <span class="buttonPlus" onclick="CloneSubfield('subfield[% newserialloo.serialid %][% newserialloo.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]')">+</span>
+                [% IF ( iteminformatio.repeatable ) %]
+                    <a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode); return false;">
+                        <img src="/intranet-tmpl/prog/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
+                    </a>
                 [% END %]
         </div>
        </li>[% END %]</ol>
@@ -422,7 +376,11 @@ $(document).ready(function() {
 [% END %]
 
 </table>
-    <fieldset class="action"><input type="submit" value="Save"  class="button" accesskey="w" />
+    <fieldset class="action">
+       <input type="submit" onclick="return false;" style="display: none;" id="phony_submit" value="phony_submit" name="phony_submit" />
+       <input type="submit" value="Save"  class="button" accesskey="w" />
+       [% UNLESS ( serialsadditems ) %]&nbsp;&nbsp;<input type="button" onclick="javascript:generateReceive()" value="Multi receiving">[% END %]
+    </fieldset>
 </form>
 
 </div>
@@ -435,7 +393,9 @@ $(document).ready(function() {
         <li><a href="serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]" title="serial collection for [% subscription.bibliotitle %]">Serial collection #[% subscription.subscriptionid %]</a></li>
         <li><a href="subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" title="detail of the subscription">Subscription #[% subscription.subscriptionid %]</a></li>
         [% IF ( subscription.abouttoexpire ) %]
+          [% UNLESS subscription.closed %]
             <li><a href="#" onclick="javascript:popup([% subscription.subscriptionid %])">Renew #[% subscription.subscriptionid %]</a></li>
+          [% END %]
         [% END %]
     [% END %]
     <li><a href="/cgi-bin/koha/catalogue/[% default_bib_view %].pl?biblionumber=[% biblionumber %]" title="go to [% bibliotitle %]">Show biblio</a></li></ul>
index 868d34e..04db346 100644 (file)
@@ -137,6 +137,9 @@ function barcode_check(){
                                        [% ELSE %]
                                                <option value="6">Delete</option>
                                        [% END %]
+                    [% IF serialslis.status8 %]
+                        <option value="8" selected="selected">Stopped</option>
+                    [% END %]
                                </select>
                        [% IF ( serialslis.serialadditems ) %]
                                <br /><br />
index b5e7f54..558f988 100644 (file)
@@ -9,14 +9,25 @@
 <script type="text/javascript">
 //<![CDATA[
  $(document).ready(function() {
-    var srlt = $("#srlt").dataTable($.extend(true, {}, dataTablesDefaults, {
+    var osrlt = $("#osrlt").dataTable($.extend(true, {}, dataTablesDefaults, {
         "aoColumnDefs": [
             { "aTargets": [ -1, -2, -3 ], "bSortable": false, "bSearchable": false },
         ],
         "sPaginationType": "four_button"
     } ) );
 
-    srlt.fnAddFilters("filter", 750);
+    var csrlt = $("#csrlt").dataTable($.extend(true, {}, dataTablesDefaults, {
+        "aoColumnDefs": [
+            { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
+        ],
+        "sPaginationType": "four_button"
+    } ) );
+
+    osrlt.fnAddFilters("filter", 750);
+    csrlt.fnAddFilters("filter", 750);
+
+    $('#serialstabs').tabs();
+
  });
  //]]>
 </script>
       <div class="yui-b">
       [% INCLUDE 'serials-toolbar.inc' %]
 
-      <h2>Serials subscriptions</h2>
-
-      <div id="advsearch">
+      <h2>Serials subscriptions ([% total %] found)</h2>
+      [% UNLESS ( done_searched ) %]
+      <div id="advsearch" style="padding-bottom:3em;">
         <form action="/cgi-bin/koha/serials/serials-search.pl" method="get">
           <fieldset class="rows">
-          <legend onclick="$('#advsearch_form').slideToggle(400);">
-              <a id="unfold_advsearch" style="cursor:pointer">Search subscriptions</a>
-          </legend>
-            [% IF ( done_searched ) %]
-              <div id="advsearch_form" style="display:none">
-            [% ELSE %]
-              <div>
-            [% END %]
+          <legend>Search subscriptions</legend>
               <ol>
                 <li>
                   <label for="issn">ISSN:</label>
                   <input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter %]" />
                 </li>
                 <li>
-                  <label for="bookseller">Bookseller:</label>
+                  <label for="bookseller">Vendor:</label>
                   <input type="text" id="bookseller" name="bookseller_filter" value="[% bookseller_filter %]" />
                 </li>
                 <li>
-                  <label for="branch">Branch:</label>
+                  <label for="branch">Library:</label>
                   <select id="branch" name="branch_filter">
                     <option value="">All</option>
                     [% FOREACH branch IN branches_loop %]
               <fieldset class="action">
                 <input type="submit" value="Search" />
               </fieldset>
-            </div>
           </fieldset>
         </form>
       </div>
-
+      [% END %]
       [% IF ( done_searched ) %]
-        [% IF ( subscriptions ) %]
-          <table id="srlt">
-            <thead>
-              <tr>
-                  <th>ISSN</th>
-                  <th>Title</th>
-                  <th> Notes </th>
-                  <th>Library</th>
-                  <th>Call number</th>
-                  <th>Expiration date</th>
-                  [% IF ( routing && CAN_user_serials_routing ) %]
-                    <th>Routing list</th>
-                  [% END %]
-                  <th>&nbsp;</th>
-                  <th>&nbsp;</th>
-              </tr>
-            </thead>
-            <tfoot>
-              <tr>
-                <td><input type="text" class="filter" data-column_num="0" placeholder="Search ISSN" /></td>
-                <td><input type="text" class="filter" data-column_num="1" placeholder="Search title" /></td>
-                <td><input type="text" class="filter" data-column_num="2" placeholder="Search notes" /></td>
-                <td><input type="text" class="filter" data-column_num="3" placeholder="Search library" /></td>
-                <td><input type="text" class="filter" data-column_num="4" placeholder="Search callnumber" /></td>
-                <td><input type="text" class="filter" data-column_num="5" placeholder="Search expiration date" /></td>
-                [% IF ( routing && CAN_user_serials_routing ) %]<td></td>[% END %]
-                <td></td>
-                <td></td>
-              </tr>
-            </tfoot>
-            <tbody>
-              [% FOREACH subscription IN subscriptions %]
-                <tr>
-                  <td>
-                  [% IF ( subscription.issn ) %][% subscription.issn %]
-                  [% END %]
-                  </td>
-                  <td><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" class="button" title="subscription detail">[% subscription.title |html %]</a>
-                  </td>
-                  <td>[% IF ( subscription.notes ) %][% subscription.notes %][% END %]
-                  [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %]
-                  </td>
-                  <td>
-                    [% IF ( subscription.branchname ) %][% subscription.branchname %][% END %]
-                  </td>
-                  <td>
-                    [% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %]
-                  </td>
-                  <td>
-                    [% IF ( subscription.enddate ) %][% subscription.enddate | $KohaDates %][% END %]
-                  </td>
-                  [% IF ( routing && CAN_user_serials_routing ) %]
-                  <td>
-                    [% IF ( subscription.cannotedit ) %]
-                      &nbsp;
-                    [% ELSE %]
-                      [% IF ( subscription.routingedit ) %]
-                        <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]">Edit</a>
-                        ([% subscription.routingedit %])
-                      [% ELSE %]
-                        <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]&amp;op=new">New</a>
-                      [% END %]
+        [% IF ( total ) %]
+          <div id="serialstabs" class="toptabs" style="clear:both;">
+            <ul class="ui-tabs-nav">
+              <li><a href="#opened">Opened ([% openedsubscriptions.size || 0 %])</a></li>
+              <li><a href="#closed">Closed ([% closedsubscriptions.size || 0 %])</a></li>
+            </ul>
+            <div id="opened">
+              [% IF openedsubscriptions %]
+                <table id="osrlt">
+                  <thead>
+                    <tr>
+                        <th>ISSN</th>
+                        <th>Title</th>
+                        <th> Notes </th>
+                        <th>Library</th>
+                        <th>Call number</th>
+                        <th>Expiration date</th>
+                        [% IF ( routing && CAN_user_serials_routing ) %]
+                          <th>Routing list</th>
+                        [% END %]
+                        <th>&nbsp;</th>
+                        <th>&nbsp;</th>
+                    </tr>
+                  </thead>
+                  <tfoot>
+                    <tr>
+                      <td><input type="text" class="filter" data-column_num="0" placeholder="Search ISSN" /></td>
+                      <td><input type="text" class="filter" data-column_num="1" placeholder="Search title" /></td>
+                      <td><input type="text" class="filter" data-column_num="2" placeholder="Search notes" /></td>
+                      <td><input type="text" class="filter" data-column_num="3" placeholder="Search library" /></td>
+                      <td><input type="text" class="filter" data-column_num="4" placeholder="Search callnumber" /></td>
+                      <td><input type="text" class="filter" data-column_num="5" placeholder="Search expiration date" /></td>
+                      [% IF ( routing && CAN_user_serials_routing ) %]<td></td>[% END %]
+                      <td></td>
+                      <td></td>
+                    </tr>
+                  </tfoot>
+                  <tbody>
+                    [% FOREACH subscription IN openedsubscriptions %]
+                      <tr>
+                        <td>
+                        [% IF ( subscription.issn ) %][% subscription.issn %]
+                        [% END %]
+                        </td>
+                        <td><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" class="button" title="subscription detail">[% subscription.title |html %]</a>
+                        </td>
+                        <td>[% IF ( subscription.notes ) %][% subscription.notes %][% END %]
+                        [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %]
+                        </td>
+                        <td>
+                          [% IF ( subscription.branchname ) %][% subscription.branchname %][% END %]
+                        </td>
+                        <td>
+                          [% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %]
+                        </td>
+                        <td>
+                          [% IF ( subscription.enddate ) %][% subscription.enddate | $KohaDates %][% END %]
+                        </td>
+                        [% IF ( routing && CAN_user_serials_routing ) %]
+                        <td>
+                          [% IF ( subscription.cannotedit ) %]
+                            &nbsp;
+                          [% ELSE %]
+                            [% IF ( subscription.routingedit ) %]
+                              <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]">Edit</a>
+                              ([% subscription.routingedit %])
+                            [% ELSE %]
+                              <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]&amp;op=new">New</a>
+                            [% END %]
+                          [% END %]
+                        </td>
+                        [% END %]
+                        <td><a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]">Issue history</a>
+                        </td>
+                        <td>
+                        [% IF ( subscription.cannotedit ) %]
+                          &nbsp;
+                        [% ELSE %]
+                          [% IF ( CAN_user_serials_receive_serials ) %]<a href="/cgi-bin/koha/serials/serials-edit.pl?subscriptionid=[% subscription.subscriptionid %]&amp;serstatus=1,3,7">Serial receive</a>[% END %]
+                        [% END %]
+                        </td>
+                      </tr>
+                    [% END %]
+                  </tbody>
+                </table>
+              [% ELSE %]
+                There is no opened subscription for your search.
+              [% END %]
+            </div>
+            <div id="closed">
+              [% IF closedsubscriptions %]
+                <table id="csrlt">
+                  <thead>
+                    <tr>
+                        <th>ISSN</th>
+                        <th>Title</th>
+                        <th> Notes </th>
+                        <th>Library</th>
+                        <th>Call number</th>
+                        <th>&nbsp;</th>
+                        <th>&nbsp;</th>
+                    </tr>
+                  </thead>
+                  <tfoot>
+                    <tr>
+                      <td><input type="text" class="filter" data-column_num="0" placeholder="Search ISSN" /></td>
+                      <td><input type="text" class="filter" data-column_num="1" placeholder="Search title" /></td>
+                      <td><input type="text" class="filter" data-column_num="2" placeholder="Search notes" /></td>
+                      <td><input type="text" class="filter" data-column_num="3" placeholder="Search library" /></td>
+                      <td><input type="text" class="filter" data-column_num="4" placeholder="Search callnumber" /></td>
+                      <td></td>
+                      <td></td>
+                    </tr>
+                  </tfoot>
+                  <tbody>
+                    [% FOREACH subscription IN closedsubscriptions %]
+                      <tr>
+                        <td>
+                          [% IF ( subscription.issn ) %]
+                            [% subscription.issn %]
+                          [% END %]
+                        </td>
+                        <td>
+                          <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" class="button" title="subscription detail">[% subscription.title |html %]</a>
+                        </td>
+                        <td>
+                          [% IF ( subscription.notes ) %][% subscription.notes %][% END %]
+                          [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %]
+                        </td>
+                        <td>
+                          [% IF ( subscription.branchname ) %][% subscription.branchname %][% END %]
+                        </td>
+                        <td>
+                          [% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %]
+                        </td>
+                        <td>
+                          [% UNLESS subscription.cannotedit %]
+                            <a href="/cgi-bin/koha/serials/serials-search.pl?subscriptionid=[% subscription.subscriptionid %]&amp;op=reopen&routing=[% subscription.routing %]&amp;searched=1&amp;title_filter=[% title_filter %]&amp;ISSN_filter=[% ISSN_filter %]&amp;EAN_filter=[% EAN_filter %]&amp;published_filter=[% publisher_filter %]&amp;bookseller_filter=[% bookseller_filter %]&amp;branch_filter=[% branch_filter %]" onclick="return confirm(_('Are you sure you want to reopen this subscription?'));">Reopen</a>
+                          [% ELSE %]
+                            Cannot edit
+                          [% END %]
+                        </td>
+                        <td>
+                          <a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]">Issue history</a>
+                        </td>
+                      </tr>
                     [% END %]
-                  </td>
-                  [% END %]
-                  <td><a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]">Issue history</a>
-                  </td>
-                  <td>
-                  [% IF ( subscription.cannotedit ) %]
-                    &nbsp;
-                  [% ELSE %]
-                    [% IF ( CAN_user_serials_receive_serials ) %]<a href="/cgi-bin/koha/serials/serials-edit.pl?subscriptionid=[% subscription.subscriptionid %]&amp;serstatus=1,3,7">Serial receive</a>[% END %]
-                  [% END %]
-                  </td>
-                </tr>
+                  </tbody>
+                </table>
+              [% ELSE %]
+                There is no closed subscription for your search.
               [% END %]
-            </tbody>
-          </table>
-        [% ELSE %]
-          There is no subscription for your search.
+            </div>
+          </div>
         [% END %]
       [% END %]
     </div>
 
   <div class="yui-b">
     [% INCLUDE 'serials-menu.inc' %]
+    [% IF ( done_searched ) %]
+    <div id="advsearch">
+        <form action="/cgi-bin/koha/serials/serials-search.pl" method="get">
+          <fieldset class="brief">
+            <h4>Search subscriptions</h4>
+              <ol>
+                <li>
+                  <label for="issn">ISSN:</label>
+                  <input type="text" id="issn" name="ISSN_filter" value="[% ISSN_filter %]" />
+                </li>
+                <li>
+                  <label for="title">Title:</label>
+                  <input type="text" id="title" name="title_filter" value="[% title_filter %]" />
+                </li>
+                [% IF ( marcflavour == "UNIMARC" ) %]
+                <li>
+                  <label for="ean">EAN:</label>
+                  <input type="text" id="ean" name="EAN_filter" value="[% EAN_filter %]" />
+                </li>
+                [% END %]
+                <li>
+                  <label for="publisher">Publisher:</label>
+                  <input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter %]" />
+                </li>
+                <li>
+                  <label for="bookseller">Vendor:</label>
+                  <input type="text" id="bookseller" name="bookseller_filter" value="[% bookseller_filter %]" />
+                </li>
+                <li>
+                  <label for="branch">Library:</label>
+                  <select id="branch" name="branch_filter">
+                    <option value="">All</option>
+                    [% FOREACH branch IN branches_loop %]
+                      [% IF ( branch.selected ) %]
+                        <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option>
+                      [% ELSE %]
+                        <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
+                      [% END %]
+                    [% END %]
+                  </select>
+                </li>
+              </ol>
+              <input type="hidden" name="searched" value="1" />
+              <fieldset class="action">
+                <input type="submit" value="Search" />
+              </fieldset>
+            </div>
+          </fieldset>
+        </form>
+      [% END %]
   </div>
 </div>
 [% INCLUDE 'intranet-bottom.inc' %]
index 1afd0c1..949b946 100644 (file)
@@ -55,8 +55,12 @@ $(document).ready(function() {
        <div class="yui-b">
        [% INCLUDE 'serials-toolbar.inc' %]
 
-    <h1>Subscription for [% bibliotitle %] </h1>
-    [% IF ( abouttoexpire ) %]<div class="dialog message">Subscription will expire [% enddate %]. <a href="#" id="renewsub">Renew this subscription</a>.</div>[% END %]
+    <h1>Subscription for [% bibliotitle%] [% IF closed %](closed)[% END %]</h1>
+    [% IF ( abouttoexpire ) %]
+      [% UNLESS closed %]
+        <div class="dialog message">Subscription will expire [% enddate %]. <a href="#" id="renewsub">Renew this subscription</a>.</div>
+      [% END %]
+    [% END %]
     [% IF ( NEEDSCONFIRMATION ) %]
     <div id="circ_needsconfirmation" class="dialog alert">
                        <h3>Please Confirm Subscription deletion</h3>
@@ -126,6 +130,40 @@ $(document).ready(function() {
      </div>
 </div>
 </div>
+    [% IF ( show_acquisition_details ) %]
+        <div id="acquisition_details">
+            <h2>Acquisition details</h2>
+            <table>
+                <thead>
+                    <tr><th></th><th>Price exc. taxes</th><th>Price inc. taxes</th><th>fund</th><th></th></tr>
+                </thead>
+                <tbody>
+                    <tr>
+                        <td>Ordered amount</td>
+                        <td>[% valuegste_ordered %]</td>
+                        <td>[% valuegsti_ordered %]</td>
+                        <td>[% budget_name_ordered %]</td>
+                        <td>
+                            [% IF ( ordered_exists ) %]
+                                <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">See basket informations</a>
+                            [% END %]
+                        </td>
+                    </tr>
+                    <tr>
+                        <td>Spent amount</td>
+                        <td>[% valuegste_spent %]</td>
+                        <td>[% valuegsti_spent %]</td>
+                        <td>[% budget_name_spent %]</td>
+                        <td>
+                            [% IF ( spent_exists ) %]
+                                <a href="/cgi-bin/koha/acqui/invoice.pl?invoicenumber=[% invoicenumber %]">See invoice informations</a>
+                            [% END %]
+                        </td>
+                    </tr>
+                </tbody>
+            </table>
+        </div>
+    [% END %]
     <div id="subscription_planning">
     <div class="yui-g">
     <div class="rows">
@@ -340,27 +378,19 @@ $(document).ready(function() {
                     [% serialslis.publisheddate %]
                 </td>
                 <td>
-                        [% IF ( serialslis.status1 ) %]
-                            Expected
-                        [% END %]
-                        [% IF ( serialslis.status2 ) %]
-                            Arrived
-                        [% END %]
-                        [% IF ( serialslis.status3 ) %]
-                            Late
-                        [% END %]
-                        [% IF ( serialslis.status4 ) %]
-                            Missing
-                        [% END %]
-                        [% IF ( serialslis.status5 ) %]
-                            Not available
-                        [% END %]
-                        [% IF ( serialslis.status7 ) %]
-                            Claimed
-                             [% IF ( serialslis.claimdate ) %]
-                             [% serialslis.claimdate %]
-                             [% END %]
-                        [% END %]
+                    [% IF ( serialslis.status1 ) %]Expected[% END %]
+                    [% IF ( serialslis.status2 ) %]Arrived[% END %]
+                    [% IF ( serialslis.status3 ) %]Late[% END %]
+                    [% IF ( serialslis.status4 ) %]Missing[% END %]
+                    [% IF ( serialslis.status5 ) %]Not issued[% END %]
+                    [% IF ( serialslis.status6 ) %]Delete[% END %]
+                    [% IF ( serialslis.status7 ) %]
+                      Claimed
+                      [% IF ( serialslis.claimdate ) %]
+                        [% serialslis.claimdate %]
+                      [% END %]
+                    [% END %]
+                    [% IF ( serialslis.status8 ) %]Stopped[% END %]
                 </td>
             </tr>
         [% END %]
index 4b68e13..4569525 100644 (file)
@@ -209,7 +209,7 @@ td input,td input[type="submit"] { font-size: 85%; padding: 1px; }
        <tr>
            <td class="count">[% offset + loop.count %]
            </td>
-        [% IF ( approved == 0 ) %]<td><span><input type="checkbox" value="[% tagloo.term %]" name="tags" class="pending" /></span>
+        [% IF ( tagloo.approved == 0 ) %]<td><span><input type="checkbox" value="[% tagloo.term %]" name="tags" class="pending" /></span>
         [% ELSE %]<td><span><input type="checkbox" value="[% tagloo.term %]" name="tags" /></span>[% END %]
            </td>
            [% IF ( tagloo.approved == -1 ) %]<td class="red">rejected
@@ -223,7 +223,7 @@ td input,td input[type="submit"] { font-size: 85%; padding: 1px; }
            </td>
                [% IF ( tagloo.approved ) %]
            <td><span class="ajax_buttons" style="visibility:hidden">
-                       [% IF ( approved == -1 ) %]
+            [% IF ( tagloo.approved == -1 ) %]
                        <input class="ok"  type="submit" title="[% tagloo.term %]" value="Approve" name="approve" />
                        <input class="rej" disabled="disabled" type="submit" title="[% tagloo.term %]" value="Rejected" name="reject" />
                        [% ELSE %]
index 3d511ea..e3f6b29 100644 (file)
@@ -65,6 +65,8 @@ for( x=0; x<allColumns.length; x++ ){
 
 
 <form name="f" action="batchMod.pl" method="post">
+     <input type="hidden" name="src" id="src" value="[% src %]" />
+     <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblionumber %]" />
      <input type="hidden" name="op" value="[% op %]" />
      <input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" />
      <input type="hidden" name="completedJobID" id="completedJobID" value="" />
@@ -175,7 +177,13 @@ for( x=0; x<allColumns.length; x++ ){
        </div>
        [% END %]
 
-       <p><a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Return to batch item deletion</a></p>
+    <p>
+        [% IF ( src == 'CATALOGUING') %]
+           <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]">Done</a>
+        [% ELSE %]
+           <a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Return to batch item deletion</a>
+        [% END %]
+    </p>
 [% END %]
     </div>
     </div>
index 551ff40..c65277a 100644 (file)
@@ -2,6 +2,7 @@
 <title>Koha &rsaquo; Tools &rsaquo; Batch item modification</title>
 [% INCLUDE 'doc-head-close.inc' %]
 <script type="text/javascript" src="[% themelang %]/js/background-job-progressbar.js"></script>
+<script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script>
 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/pages/batchMod.css" />
 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
@@ -80,8 +81,10 @@ $(document).ready(function(){
         [% END %]
     </tbody>
       </table>
-      [% UNLESS ( too_many_items ) %]
-      <h4>The following barcodes were found: </h4>
+      [% IF ( item_loop ) %]
+          [% UNLESS ( too_many_items ) %]
+          <h4>The following barcodes were found: </h4>
+          [% END %]
       [% END %]
   [% END %] <!-- /notfoundbarcodes -->
 
@@ -142,6 +145,7 @@ $(document).ready(function(){
     [% END %]
 [% END %]<!-- /too_many_items -->
 
+[% IF ( item_loop ) %]
 <div id="cataloguing_additem_newitem">
         <h2>Edit Items</h2>
         <div class="hint">Checking the box right next the subfield label will disable the entry and delete the subfield on all selected items. Leave fields blank to make no change.</div>
@@ -163,7 +167,9 @@ $(document).ready(function(){
                 <input type="hidden" name="subfield"       value="[% ite.subfield %]" />
                 <input type="hidden" name="mandatory"       value="[% ite.mandatory %]" />
                 [% IF ( ite.repeatable ) %]
-                    <span class="buttonPlus" onclick="CloneSubfield('subfield[% ite.tag %][% ite.subfield %][% ite.random %]')">+</span>
+                    <a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode); return false;">
+                        <img src="/intranet-tmpl/prog/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
+                    </a>
                 [% END %]
                 <span class="hint" id="hint[% ite.tag %][% ite.subfield %][% ite.random %]"></span>
             </div></li>
@@ -179,6 +185,9 @@ $(document).ready(function(){
          <a href="/cgi-bin/koha/tools/batchMod.pl" class="cancel" onclick="history.back();return false;">Cancel</a>
     </fieldset>
 </div>
+[% ELSE %]
+    <p><a href="/cgi-bin/koha/tools/batchMod.pl">Return to batch item modification</a></p>
+[% END %]
 [% ELSE %] <!-- // show -->
 <fieldset class="action">
 [% IF ( src == 'CATALOGUING') %]
index 9993c28..fa7904f 100644 (file)
                        $(this).parent().find(".hint").toggle(); return false;
                });
         $("#dateofrange").datepicker();
+        $("#datecancelrange").datepicker();
                $("#dateofrange").each(function () { this.value = "" });
+        $("#datecancelrange").each(function () { this.value = "" });
         $("#jcalendar-container").datepicker({
           beforeShowDay: function(thedate) {
             var day = thedate.getDate();
@@ -276,7 +278,7 @@ td.repeatableyearly a.ui-state-default, .repeatableyearly {  background:  #FFFF9
                                <input type="hidden" id="showBranchName" name="showBranchName" />
                        </li>
                        <li>
-                               <strong>Date:</strong>
+                               <strong>From Date:</strong>
                                <span id="showDaynameOutput"></span>, 
                                
                                [% IF ( dateformat_us ) %]<span id="showMonthOutput"></span>/<span id="showDayOutput"></span>/<span id="showYearOutput"></span>[% ELSIF ( dateformat_metric ) %]<span id="showDayOutput"></span>/<span id="showMonthOutput"></span>/<span id="showYearOutput"></span>[% ELSE %]<span id="showYearOutput"></span>/<span id="showMonthOutput"></span>/<span id="showDayOutput"></span>[% END %]
@@ -287,6 +289,10 @@ td.repeatableyearly a.ui-state-default, .repeatableyearly {  background:  #FFFF9
                                <input type="hidden" id="showMonth" name="showMonth" />
                                <input type="hidden" id="showYear" name="showYear" />
                        </li>
+            <li class="dateinsert">
+                <b>To Date : </b>
+                <input type="text" id="datecancelrange" name="datecancelrange" size="20" value="[% datecancelrange %]" class="datepicker"/>
+            </li>
                        <li><label for="showTitle">Title: </label><input type="text" name="showTitle" id="showTitle" size="35" /></li>
                    <!-- showTitle is necessary for exception radio button to work properly --> 
                                <label for="showDescription">Description:</label>
@@ -297,13 +303,29 @@ td.repeatableyearly a.ui-state-default, .repeatableyearly {  background:  #FFFF9
                                <a href="#" class="helptext">[?]</a>
                                <div class="hint">You can make an exception for this holiday rule. This means that you will be able to say that for a repeatable holiday there is one day which is going to be an exception.</div>
                        </div></li>
+            <li class="radio"><input type="radio" name="showOperation" id="showOperationExcRange" value="exceptionrange" />
+                <label for="newOperationFieldException">Generate exceptions on a range of dates.</label>
+                <a href="#" class="helptext">[?]</a>
+                <div class="hint">You can make an exception on a range of dates repeated yearly.</div>
+            </li>
                        <li class="radio"><input type="radio" name="showOperation" id="showOperationDel" value="delete" /> <label for="showOperationDel" id="showOperationDelLabel">Delete this holiday</label>
                                <a href="#" class="helptext">[?]</a>
-                               <div class="hint">This will delete this holiday rule. If it is a repeatable holiday, this option checks for posible exceptions. If an exception exists, this option will remove the exception and set the date to a regular holiday.</div></li>
+                               <div class="hint">This will delete this holiday rule. If it is a repeatable holiday, this option checks for possible exceptions. If an exception exists, this option will remove the exception and set the date to a regular holiday.</div></li>
+            <li class="radio"><input type="radio" name="showOperation" id="showOperationDelRange" value="deleterange" /> <label for="showOperationDelRange" id="showOperationDelLabelRange">Delete the single holidays on a range</label>.
+                <a href="#" class="helptext">[?]</a>
+                <div class="hint">This will delete the single holidays rules only. The repeatable holidays and exceptions will not be deleted.</div>
+            </li>
+            <li class="radio"><input type="radio" name="showOperation" id="showOperationDelRangeRepeat" value="deleterangerepeat" /> <label for="showOperationDelRangeRepeat" id="showOperationDelLabelRangeRepeat">Delete the repeated holidays on a range</label>.
+                <a href="#" class="helptext">[?]</a>
+                <div class="hint">This will delete the repeated holidays rules only. The repeatable holidays will be deleted but not the exceptions.</div>
+            </li>
+            <li class="radio"><input type="radio" name="showOperation" id="showOperationDelRangeRepeatExcept" value="deleterangerepeatexcept" /> <label for="showOperationDelRangeRepeatExcept" id="showOperationDelLabelRangeRepeatExcept">Delete the exceptions on a range</label>.
+                <a href="#" class="helptext">[?]</a>
+                <div class="hint">This will delete the exceptions inside a given range. Be careful about your scope range if it is oversized you could slow down Koha.</div>
+            </li>
                        <li class="radio"><input type="radio" name="showOperation" id="showOperationEdit" value="edit" checked="checked" /> <label for="showOperationEdit">Edit this holiday</label>
-                                               <a href="#" class="helptext">[?]</a>
-                                               <div class="hint">This will save changes to the holiday's title and description. If the information for a repeatable holiday is modified, it affects all of the dates on which the holiday is repeated.</div></li>
-
+                <a href="#" class="helptext">[?]</a>
+                <div class="hint">This will save changes to the holiday's title and description. If the information for a repeatable holiday is modified, it affects all of the dates on which the holiday is repeated.</div></li>
                        </ol>
                        <fieldset class="action">
                                <input type="submit" name="submit" value="Save" />
@@ -363,12 +385,12 @@ td.repeatableyearly a.ui-state-default, .repeatableyearly {  background:  #FFFF9
             <li class="radio"><input type="radio" name="newOperation" id="newOperationField" value="holidayrange" />
                             <label for="newOperationField">Holidays on a range</label>.
                             <a href="#" class="helptext">[?]</a>
-                            <div class="hint">Make a single holiday on a range. For example, selecting August 1st, 2012  and August 10st, 2012 will make all days between 1st and 10st holiday, but will not affect August 1st-10st in other years.</div>
+                            <div class="hint">Make a single holiday on a range. For example, selecting August 1st, 2012  and August 10st, 2012 will make all days between 1st and 10st holiday, but will not affect August 1-10 in other years.</div>
                             </li>
             <li class="radio"><input type="radio" name="newOperation" id="newOperationFieldyear" value="holidayrangerepeat" />
                             <label for="newOperationFieldyear">Holidays repeated yearly on a range</label>.
                             <a href="#" class="helptext">[?]</a>
-                            <div class="hint">Make a single holiday on a range repeated yearly. For example, selecting August 1st, 2012  and August 10st, 2012 will make all days between 1st and 10st holiday, and will affect August 1st-10st in other years.</div>
+                            <div class="hint">Make a single holiday on a range repeated yearly. For example, selecting August 1st, 2012  and August 10st, 2012 will make all days between 1st and 10st holiday, and will affect August 1-10 in other years.</div>
                             </li>
                                <li class="radio">
                                <input type="checkbox" name="allBranches" id="allBranches" />
index 2a9deda..8265b50 100644 (file)
@@ -1,3 +1,22 @@
+[% BLOCK final_match_link %]
+    [% IF ( record.record_type == 'biblio' ) %]
+        <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% record.final_match_id %]">[% record.final_match_id %]</a>
+    [% ELSIF ( record.record_type == 'auth' ) %]
+        <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% record.final_match_id %]">[% record.final_match_id %]</a>
+    [% END %]
+[% END %]
+[% BLOCK match_link %]
+    [% IF ( record_lis.match_id ) %]
+        <tr>
+            <td />
+            [% IF ( record.record_type == 'biblio' ) %]
+                <td class="highlight" colspan="4">Matches biblio [% record_lis.match_id %] (score = [% record_lis.match_score %]): <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% record_lis.match_id %]">[% record_lis.match_citation %]</a></td>
+            [% ELSIF ( record.record_type == 'auth' ) %]
+                <td class="highlight" colspan="4">Matches authority [% record_lis.match_id %] (score = [% record_lis.match_score %]): <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% record_lis.match_id %]">[% record_lis.match_citation %]</a></td>
+            [% END %]
+        </tr>
+    [% END %]
+[% END %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Tools &rsaquo; Manage staged MARC records
 [% IF ( import_batch_id ) %]
@@ -107,7 +126,8 @@ $(document).ready(function(){
 <fieldset class="rows" id="staged-record-matching-rules">
   <ol>
     <li><span class="label">File name:</span> [% file_name %]</li>
-    <li><span class="label">Comments:</span> [% IF ( comments ) %][% comments %](none)[% END %]</li>
+    <li><span class="label">Comments:</span> [% IF ( comments ) %][% comments %][% ELSE %](none)[% END %]</li>
+    <li><span class="label">Type:</span> [% IF ( record_type == 'auth' ) %]Authority records[% ELSE %]Bibliographic records[% END %]</li>
     <li><span class="label">Staged:</span> [% upload_timestamp %]</li>
     <li><span class="label">Status:</span> [% import_status %]</li>
     <li> 
@@ -218,9 +238,10 @@ Page
     <th>#</th>
     <th>File name</th>
     <th>Comments</th>
+    <th>Type</th>
     <th>Status</th>
     <th>Staged</th>
-    <th># Bibs</th>
+    <th># Records</th>
     <th># Items</th>
     <th>Action</th>
   </tr>
@@ -229,9 +250,10 @@ Page
     <td>[% batch_lis.import_batch_id %]</td>
     <td><a href="[% batch_lis.script_name %]?import_batch_id=[% batch_lis.import_batch_id %]">[% batch_lis.file_name %]</a></td>
     <td>[% batch_lis.comments %]</td>
+    <td>[% IF ( batch_lis.record_type == 'auth' ) %]Authority[% ELSE %]Bibliographic[% END %]</td>
     <td>[% batch_lis.import_status %]</td>
     <td>[% batch_lis.upload_timestamp %]</td>
-    <td>[% batch_lis.num_biblios %]</td>
+    <td>[% batch_lis.num_records %]</td>
     <td>[% batch_lis.num_items %][% IF ( batch_lis.num_items ) %] <a href="[% batch_lis.script_name %]?import_batch_id=[% batch_lis.import_batch_id %]&amp;op=create_labels">(Create label batch)</a>[% END %]</td>
     <td>[% IF ( batch_lis.can_clean ) %]
           <form method="post" action="[% batch_lis.script_name %]" name="clean_batch_[% batch_lis.import_batch_id %]" id="clean_batch_[% batch_lis.import_batch_id %]" >
@@ -258,7 +280,7 @@ Page
   [% END %]
 [% END %]
 
-[% IF ( biblio_list ) %]
+[% IF ( record_list ) %]
   [% IF ( pages ) %]
 <div class="pages">
 Page 
@@ -277,26 +299,21 @@ Page
     <th>Citation</th>
     <th>Status</th>
     <th>Match?</th>
-    <th>Bib</th>
+    <th>Record</th>
 
   </tr>
-  [% FOREACH biblio_lis IN biblio_list %]
+  [% FOREACH record_lis IN record_list %]
   [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
-    <td>[% biblio_lis.record_sequence %]</td>
-    <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% biblio_lis.import_record_id %]" rel="gb_page_center[600,500]">[% biblio_lis.citation %]</a></td>
-    <td>[% biblio_lis.status %]</td>
-    <td>[% biblio_lis.overlay_status %]</td>
-    <td>[% IF ( biblio_lis.final_match_biblionumber ) %]
-        <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio_lis.final_match_biblionumber %]">[% biblio_lis.final_match_biblionumber %]</a>
+    <td>[% record_lis.record_sequence %]</td>
+    <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% record_lis.import_record_id %]" rel="gb_page_center[600,500]">[% record_lis.citation %]</a></td>
+    <td>[% record_lis.status %]</td>
+    <td>[% record_lis.overlay_status %]</td>
+    <td>[% IF ( record_lis.final_match_id ) %]
+        [% PROCESS final_match_link record=record_lis %]
         [% END %]
     </td>
   </tr>
-    [% IF ( biblio_lis.match_biblionumber ) %]
-    <tr>
-      <td />
-      <td class="highlight" colspan="4">Matches biblio [% biblio_lis.match_biblionumber %] (score = [% biblio_lis.match_score %]): <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio_lis.match_biblionumber %]">[% biblio_lis.match_citation %]</a></td>
-    </tr>
-    [% END %]
+    [% PROCESS match_link record=record_lis %]
   [% END %]
 </table>
   [% IF ( pages ) %]
index 618d056..62d2eb3 100644 (file)
@@ -1,28 +1,34 @@
 [% USE KohaDates %]
 [% INCLUDE 'doc-head-open.inc'%]
-<title>Koha &rsaquo; Tools &rsaquo; [% IF ( del ) %]Batch item deletion[% ELSE %]Batch item modification[% END %] </title>
+<title>Koha &rsaquo; Tools &rsaquo; Batch patron modification</title>
 [% INCLUDE 'doc-head-close.inc' %]
 [% INCLUDE 'calendar.inc' %]
 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
-<script type="text/JavaScript" language="JavaScript">
+<script type="text/JavaScript">
 //<![CDATA[
         var patron_attributes_lib = new Array();
         var patron_attributes_values = new Array();
         $(document).ready(function() {
-            $("#borrowerst").tablesorter();
+            [% IF borrowers %]
+                $("#borrowerst").tablesorter({
+                    headers: { 0: { sorter: false}},
+                    widgets : ['zebra'],
+                    sortList: [[1,0]]
+                });
 
-            $("#selectallbutton").click(function() {
-                $("#borrowerst").find("input:checkbox").each(function() {
-                    $(this).attr("checked", true);
+                $("#selectallbutton").click(function() {
+                    $("#borrowerst").find("input:checkbox").each(function() {
+                        $(this).attr("checked", true);
+                    });
+                    return false;
                 });
-                return false;
-            });
-            $("#clearallbutton").click(function() {
-                $("#borrowerst").find("input:checkbox").each(function() {
-                    $(this).attr("checked", false);
+                $("#clearallbutton").click(function() {
+                    $("#borrowerst").find("input:checkbox").each(function() {
+                        $(this).attr("checked", false);
+                    });
+                    return false;
                 });
-                return false;
-            });
+            [% END %]
 
             var values = new Array();
             var lib = new Array();
@@ -53,7 +59,7 @@
             var information_category_node = $(select_attr).parent().parent().find('span.information_category');
             information_category_node.html("");
             if ( category.length > 0 ) {
-                information_category_node.html('This attribute will be only applied to the borrower\'s category "' + category + '"');
+                information_category_node.html(_("This attribute will be only applied to the patron\'s category") +' "' + category + '"');
             }
             if ( type == 'select' ) {
                 var options = '<option value = ""></option>';
@@ -70,7 +76,7 @@
             var li_node = $("li.attributes:last");
             var li_clone = $(li_node).clone();
             if ( $(li_clone).find("a.delete").length == 0 ) {
-                $(li_clone).append('[<a href="#" title="Delete" class="delete" onclick="del_attributes(this);return false;">X</a>]');
+                $(li_clone).append('<a href="#" title="Delete" class="delete clear-field" onclick="del_attributes(this);return false;">Delete</a>');
             }
             $(li_clone).find('select[name="patron_attributes"]').change(function() {
                 updateAttrValues(this);
 <div id="breadcrumbs">
     <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
     <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
-    <a href="/cgi-bin/koha/tools/modborrowers.pl">Patrons modification</a>
+    <a href="/cgi-bin/koha/tools/modborrowers.pl">Batch patron modification</a>
 </div>
 
 <div id="doc3" class="yui-t2">
         <div id="yui-main">
             <div class="yui-b">
                 [% IF ( op == 'show_form' ) %]
-                <h1>Batch patrons modification</h1>
+                <h1>Batch patron modification</h1>
                 <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/tools/modborrowers.pl">
                     <fieldset class="rows">
                     <legend>Use a file</legend>
-                    <label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" />
+                    <ol>
+                    <li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li>
+                    </ol>
                     </fieldset>
                     <fieldset class="rows">
                         <legend>Or list cardnumbers one by one</legend>
                         <ol>
                             <li>
-                              <label for="cardnumberlist">Carnumber list (one cardnumber per line): </label>
+                              <label for="cardnumberlist">Carnumber list (one cardnumber per line): </label>
                               <textarea rows="10" cols="30" id="cardnumberlist" name="cardnumberlist">[% cardnumberlist %]</textarea>
                             </li>
                         </ol>
 
                     [% IF ( op == 'show_results' ) %]
                         [% IF ( errors ) %]
-                            Errors occured :
+                            <div class="dialog alert">
+                            <h4>Errors occured:</h4>
                             <ul class="warnings">
                             [% FOREACH error IN errors %]
                                 [% IF ( error.error == 'can_not_update' ) %]
-                                    <li>Can not update borrower with borrowernumber [% error.borrowernumber %]</li>
+                                    <li>Can not update patron with borrowernumber [% error.borrowernumber %]</li>
                                 [% ELSE %]
                                     <li>[% error.error %]</li>
                                 [% END %]
                             [% END %]
                             </ul>
+                            </div>
                         [% END %]
-                        <br/>
                     [% END %]
 
                     [% IF ( op == 'show' ) %]
                             <div id="toolbar"><a id="selectallbutton" href="#">Select All</a> | <a id="clearallbutton" href="#">Clear All</a></div>
                         [% END %]
                     [% END %]
+                        [% IF borrowers %]
                             <div id="cataloguing_additem_itemlist">
                                 <div style="overflow:auto">
                                     <table id="borrowerst">
                                                 [% IF ( op == 'show' ) %]
                                                     <th>&nbsp;</th>
                                                 [% END %]
+                                                <th>Card number</th>
                                                 <th>Surname</th>
                                                 <th>Firstname</th>
-                                                <th>Branchname</th>
-                                                <th>Categorycode</th>
-                                                <th>Cardnumber</th>
-                                                <th>dateenrolled</th>
-                                                <th>dateexpiry</th>
-                                                <th>debarred</th>
+                                                <th>Library</th>
+                                                <th>Category</th>
+                                                <th>Registration date</th>
+                                                <th>Expiry date</th>
+                                                <th>Restricted</th>
                                                 [% FOREACH attrh IN attributes_header %]
                                                     <th>[% attrh.attribute %]</th>
                                                 [% END %]
                                                     [% IF ( op == 'show' ) %]
                                                         <td><input type="checkbox" name="borrowernumber" value="[% borrower.borrowernumber %]" checked="checked" /></td>
                                                     [% END %]
+                                                    <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrower.borrowernumber %]">[% borrower.cardnumber %]</a></td>
                                                     <td>[% borrower.surname %]</td>
                                                     <td>[% borrower.firstname %]</td>
                                                     <td>[% borrower.branchname %]</td>
                                                     <td>[% borrower.categorycode %]</td>
-                                                    <td>[% borrower.cardnumber %]</td>
                                                     <td>[% borrower.dateenrolled | $KohaDates %]</td>
                                                     <td>[% borrower.dateexpiry | $KohaDates %]</td>
                                                     <td>[% borrower.debarred | $KohaDates %]</td>
                                     <ol>
                                         [% FOREACH field IN fields %]
                                         <li>
-                                            <label style="width:20em;">[% field.lib %]</label>
+                                            [% IF ( field.mandatory ) %]
+                                            <label for="[% field.name %]" class="required">
+                                            [% ELSE %]
+                                            <label for="[% field.name %]">
+                                            [% END %]
+                                            [% SWITCH ( field.name ) %]
+                                                [% CASE 'surname' %]
+                                                Surname:
+                                                [% CASE 'firstname' %]
+                                                First name:
+                                                [% CASE 'branchcode' %]
+                                                Library:
+                                                [% CASE 'categorycode' %]
+                                                Category
+                                                [% CASE 'sort1' %]
+                                                Sort 1:
+                                                [% CASE 'sort2' %]
+                                                Sort 2:
+                                                [% CASE 'dateenrolled' %]
+                                                Registration date:
+                                                [% CASE 'dateexpiry' %]
+                                                Expiry date:
+                                                [% CASE 'debarred' %]
+                                                Restricted:
+                                                [% CASE 'debarredcomment' %]
+                                                Restriction comment:
+                                                [% CASE 'borrowernotes' %]
+                                                Circulation note:
+                                            [% END %]
+                                            </label>
                                             [% IF field.mandatory %]
                                                 <input type="checkbox" title="This field is mandatory" name="disable_input" value="[% field.name %]" readonly="readonly" onclick="return false;" />
                                             [% ELSE %]
                                             [% END %]
                                             [% IF ( field.type == 'date' ) %]
                                                 <input type="text" name="[% field.name %]" id="[% field.name %]" value="" size="10" maxlength="10" readonly="readonly" class="datepicker" />
-                                                <a href="#" onclick="clearDate('[% field.name %]');return false;">X</a>
+                                                <a href="#" class="clear-field" onclick="clearDate('[% field.name %]');return false;">Clear</a>
                                                 [% END %]
                                         </li>
                                         [% END %]
                                         [% IF ( patron_attributes_codes ) %]
                                             <li class="attributes">
-                                                <label style="width:20em;">Attribute
+                                                <label style="width:auto;">Attribute:
                                                     <select name="patron_attributes">
                                                         [% FOREACH pac IN patron_attributes_codes %]
                                                             <option value="[% pac.attribute_code %]" data-type="[% pac.type %]" data-category="[% pac.category_lib %]">[% pac.attribute_lib %]</option>
                                                 </label>
                                                 <input type="checkbox" title="check to delete this field" name="disable_input" value="attr0_value" />
                                                 <span class="patron_attributes_value"></span>
-                                                <a href="#" title="Add an attribute" onclick="add_attributes(); return false;">+</a>
-                                                <span class="information_category"></span>
+                                                <a href="#" class="clone-field" title="Add an attribute" onclick="add_attributes(); return false;">New</a>
+                                                <span class="information_category hint" style="width:25%;float:right;"></span>
                                             </li>
                                         [% END %]
                                     </ol>
                             </div>
                         </form>
                         [% END %]
+                    [% END %]
                 [% END %]
                 [% IF ( op == 'show_results' ) %]
-                    <br/>
-                    <a href="/cgi-bin/koha/tools/modborrowers.pl" title="new Batch patrons modification">new Batch patrons modification</a>
+                <p>
+                    <a href="/cgi-bin/koha/tools/modborrowers.pl" title="New batch patrons modification">New batch patron modification</a>
+                </p>
                 [% END %]
             </div>
             </div>
index 7a083b8..ea5769c 100644 (file)
@@ -6,7 +6,6 @@
     <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
     <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/dataTables.fnReloadAjax.js"></script>
     [% INCLUDE 'datatables-strings.inc' %]
-    </script>
     <script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
     <script type="text/javascript" src="[% themelang %]/js/jquery.jeditable.mini.js"></script>
     <script type="text/javascript">
                                             { "sWidth": "11%" },
                                           ],
                    "oLanguage"          : {
-                                            "sEmptyTable": sEmptyTable,
+                                            "oPaginate": {
+                                                           "sFirst": MSG_DT_FIRST,
+                                                           "sLast": MSG_DT_LAST,
+                                                           "sNext": MSG_DT_NEXT,
+                                                           "sPrevious": MSG_DT_PREVIOUS,
+                                                         },
+                                            "sEmptyTable": MSG_DT_EMPTY_TABLE,
+                                            "sInfo": MSG_DT_INFO,
+                                            "sInfoEmpty": MSG_DT_INFO_EMPTY,
+                                            "sInfoFiltered": MSG_DT_INFO_FILTERED,
+                                            "sLengthMenu": MSG_DT_LENGTH_MENU,
+                                            "sLoadingRecords": MSG_DT_LOADING_RECORDS,
+                                            "sProcessing": MSG_DT_PROCESSING,
+                                            "sSearch": MSG_DT_SEARCH,
+                                            "sZeroRecords": MSG_DT_ZERO_RECORDS,
                                           },
                    "fnPreDrawCallback": function(oSettings) {
                         return true;
index 478527c..4846872 100644 (file)
 //<![CDATA[
 $(document).ready(function(){
        $("#processfile").hide();
+    $("#record_type").change(function() {
+        if ($(this).val() == 'auth') {
+            $('#items').hide();
+        } else {
+            $('#items').show();
+        }
+    });
 });
 function CheckForm(f) {
     if ($("#fileToUpload").value == '') {
@@ -40,6 +47,12 @@ function CheckForm(f) {
 [% IF ( uploadmarc ) %]
 <p>MARC staging results :</p>
 <ul>
+    [% SWITCH (record_type) %]
+    [% CASE 'biblio' %]
+        <li>Processing bibliographic records</li>
+    [% CASE 'auth' %]
+        <li>Processing authority records</li>
+    [% END %]
        <li>[% total %]  records in file</li>
        <li>[% import_errors %] records not staged because of MARC error</li>
        <li>[% staged %] records staged</li>
@@ -62,8 +75,8 @@ function CheckForm(f) {
 </ul>
 [% ELSE %]
 <ul>
-       <li>Select a MARC file to stage in the import reservoir.  It will be parsed, and each valid record staged for later import into the catalog.</li>
-       <li>You can enter a name for this import. It may be useful, when creating a biblio, to remember where the suggested MARC data comes from!</li>
+    <li>Select a MARC file to stage in the import reservoir.  It will be parsed, and each valid record staged for later import into the catalog.</li>
+    <li>You can enter a name for this import. It may be useful, when creating a record, to remember where the suggested MARC data comes from!</li>
 </ul>
 <form method="post" action="[% SCRIPT_NAME %]" id="uploadfile" enctype="multipart/form-data">
 <fieldset class="rows" id="uploadform">
@@ -92,6 +105,13 @@ function CheckForm(f) {
                <input type="text" id="comments" name="comments" />
                
        </li>
+    <li>
+        <label for='record_type'>Record type:</label>
+        <select name='record_type' id='record_type'>
+            <option value='biblio' selected='selected'>Bibliographic</option>
+            <option value='auth'>Authority</option>
+        </select>
+    </li>
        <li>
                <label for="encoding">Character encoding: </label>
             <select name="encoding" id="encoding"><option value="utf8" selected="selected">UTF-8 (Default)</option><option value="MARC-8">MARC 8</option><option value="ISO_5426">ISO 5426</option><option value="ISO_6937">ISO 6937</option><option value=ISO_8859-1">ISO 8859-1</option><option value="EUC-KR">EUC-KR</option></select>
@@ -108,7 +128,7 @@ function CheckForm(f) {
        [% END %]
     </select>
     </li>
-      <li><label for="overlay_action">Action if matching bibliographic record found: </label>
+      <li><label for="overlay_action">Action if matching record found: </label>
            [% INCLUDE 'tools-overlay-action.inc' %]
       </li>
       <li><label for="nomatch_action">Action if no match is found: </label>
@@ -116,7 +136,7 @@ function CheckForm(f) {
       </li>
     </ol>
   </fieldset>
-  <fieldset class="rows">
+  <fieldset class="rows" id="items">
     <legend>Check for embedded item record data?</legend>
     <ol>
       <li class="radio">
index 0c71a41..20ae8ee 100644 (file)
@@ -210,6 +210,7 @@ function placeHold () {
                 <th>Title</th>
                 <th>Author</th>
                 <th>Date added</th>
+                <th>Call number</th>
                 <th>&nbsp;</th>
             </tr>
                [% FOREACH itemsloo IN itemsloop %]
@@ -238,6 +239,9 @@ function placeHold () {
                        <td>[% itemsloo.author %]</td>
                        <td>[% itemsloo.dateadded %]</td>
                        <td>
+                [% FOREACH result IN itemsloo.ITEM_RESULTS %][% result.itemcallnumber %][% UNLESS loop.last %], [% END %][% END %]
+            </td>
+            <td>
                        [% UNLESS ( itemsloo.notforloan ) %]
                        <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% itemsloo.biblionumber %]">Holds</a>
                        [% END %]
@@ -299,6 +303,7 @@ function placeHold () {
                [% IF ( sort_title ) %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
                [% IF ( sort_author ) %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
                [% IF ( sort_copyrightdate ) %]<option value="copyrightdate" selected="selected">Copyrightdate</option>[% ELSE %]<option value="copyrightdate">Copyrightdate</option>[% END %]
+        [% IF ( sort_itemcallnumber ) %]<option value="itemcallnumber" selected="selected">Call number</option>[% ELSE %]<option value="itemcallnumber">Call number</option>[% END %]
                </select></li>
         <li><label for="category">Category: </label>
                        <select name="category" id="category">
@@ -322,6 +327,7 @@ function placeHold () {
                [% IF ( sort_title ) %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
                [% IF ( sort_author ) %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
                [% IF ( sort_copyrightdate ) %]<option value="copyrightdate" selected="selected">Copyrightdate</option>[% ELSE %]<option value="copyrightdate">Copyrightdate</option>[% END %]
+        [% IF ( sort_itemcallnumber ) %]<option value="itemcallnumber" selected="selected">Call number</option>[% ELSE %]<option value="itemcallnumber">Call number</option>[% END %]
                </select></li>
                <li><label for="category">Category: </label>
                        <select id="category" name="category">
@@ -386,7 +392,7 @@ function placeHold () {
                     [% IF ( shelveslooppri.toggle ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
         <td><a href="shelves.pl?[% IF ( shelveslooppri.showprivateshelves ) %]display=privateshelves&amp;[% END %]viewshelf=[% shelveslooppri.shelf %]&amp;shelfoff=[% shelfoff %]">[% shelveslooppri.shelfname |html %]</a></td>
         <td>[% shelveslooppri.count %] item(s)</td>
-        <td>[% IF ( shelveslooppri.authorsort ) %]Author[% ELSIF ( shelveslooppri.yearsort ) %]Year[% ELSE %]Title[% END %]</td>
+        <td>[% IF ( shelveslooppri.authorsort ) %]Author[% ELSIF ( shelveslooppri.yearsort ) %]Year[% ELSIF (shelveslooppri.itemcallnumbersort) %]Call number[% ELSE %]Title[% END %]</td>
         <td>[% IF ( shelveslooppri.viewcategory1 ) %]Private[% END %]
                        [% IF ( shelveslooppri.viewcategory2 ) %]Public[% END %]
                </td>
@@ -439,7 +445,7 @@ function placeHold () {
                <td><a href="shelves.pl?viewshelf=[% shelvesloo.shelf %]">[% shelvesloo.shelfname |html %]</a></td>
         <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% shelvesloo.owner %]">[% shelvesloo.ownername %]</td>
                <td>[% shelvesloo.count %] item(s)</td>
-        <td>[% IF ( shelvesloo.authorsort ) %]Author[% ELSIF ( shelvesloo.yearsort ) %]Year[% ELSE %]Title[% END %]</td>
+        <td>[% IF ( shelvesloo.authorsort ) %]Author[% ELSIF ( shelvesloo.yearsort ) %]Year[% ELSIF (shelvesloo.itemcallnumbersort) %]Call number[% ELSE %]Title[% END %]</td>
         <td>[% IF ( shelvesloo.viewcategory1 ) %]Private[% END %]
                        [% IF ( shelvesloo.viewcategory2 ) %]Public[% END %]
                </td>
index 2d6d5ba..aabefe4 100644 (file)
@@ -4,7 +4,7 @@
 
 <xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="marc">
        <xsl:import href="MARC21slimUtils.xsl"/>
-       <xsl:output method="xml" indent="yes"/>
+    <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
        
        <!--Added ISBN and deleted attributes 6/04 jer-->
        
index 2ba9cf1..a9fa440 100644 (file)
@@ -7,7 +7,7 @@
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   exclude-result-prefixes="marc">
        <xsl:import href="MARC21slimUtils.xsl"/>
-       <xsl:output method="xml" indent="yes"/>
+    <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
        
        <xsl:template match="/">
                        <xsl:apply-templates/>
index c641b8c..43c7ae5 100644 (file)
@@ -2,7 +2,7 @@
 <!DOCTYPE stylesheet [<!ENTITY nbsp "&#160;" >]>
 <xsl:stylesheet version="1.0" xmlns:xlink="http://www.w3.org/TR/xlink" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns="http://www.loc.gov/mods/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="marc">
        <xsl:include href="MARC21slimUtils.xsl"/>
-       <xsl:output method="xml" indent="yes"/>
+    <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
        
        <xsl:template match="/">
                <collection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/mods/  http://www.loc.gov/standards/marcxml/schema/mods.xsd">
index 289bde7..291ab06 100644 (file)
@@ -4,7 +4,7 @@
 
 <xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="marc">
        <xsl:import href="MARC21slimUtils.xsl"/>
-       <xsl:output method="xml" indent="yes"/>
+    <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
        <!--Added ISBN and deleted attributes 6/04 jer-->
        <xsl:template match="/">
                <xsl:if test="marc:collection">
index b888431..32b71d5 100644 (file)
@@ -2,7 +2,7 @@
 <!DOCTYPE stylesheet [<!ENTITY nbsp "&#160;" >]>
 <xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="marc">
        <xsl:import href="MARC21slimUtils.xsl"/>
-       <xsl:output method="xml" indent="yes"/>
+    <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
        
        <xsl:template match="/">
                        <xsl:apply-templates/>
index 00201a7..d100a59 100644 (file)
@@ -4,7 +4,7 @@
 
 <xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="marc">
        <xsl:import href="MARC21slimUtils.xsl"/>
-       <xsl:output method="xml" indent="yes"/>
+    <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
        
        <!--Added ISBN and deleted attributes 6/04 jer-->
        
index f16fcc4..9d38ee1 100644 (file)
@@ -4,7 +4,7 @@
 
 <xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="marc">
        <xsl:import href="MARC21slimUtils2.xsl"/>
-       <xsl:output method="xml" indent="yes"/>
+    <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
        
        <!--Added ISBN and deleted attributes 6/04 jer-->
        
index 2e1754b..ea36118 100644 (file)
@@ -9,7 +9,7 @@
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   exclude-result-prefixes="marc items">
     <xsl:import href="MARC21slimUtils.xsl"/>
-    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" />
+    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
     <xsl:template match="/">
             <xsl:apply-templates/>
     </xsl:template>
index 3714dab..ca517cd 100644 (file)
@@ -7,7 +7,7 @@
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   exclude-result-prefixes="marc items">
     <xsl:import href="MARC21slimUtils.xsl"/>
-    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" />
+    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
     <xsl:key name="item-by-status" match="items:item" use="items:status"/>
     <xsl:key name="item-by-status-and-branch" match="items:item" use="concat(items:status, ' ', items:homebranch)"/>
 
index 351e366..1a10e8b 100644 (file)
@@ -7,7 +7,7 @@
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   exclude-result-prefixes="marc">
        <xsl:import href="MARC21slimUtils.xsl"/>
-       <xsl:output method="xml" indent="yes"/>
+    <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
        
        <xsl:template match="/">
                        <xsl:apply-templates/>
index 289bde7..291ab06 100644 (file)
@@ -4,7 +4,7 @@
 
 <xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="marc">
        <xsl:import href="MARC21slimUtils.xsl"/>
-       <xsl:output method="xml" indent="yes"/>
+    <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
        <!--Added ISBN and deleted attributes 6/04 jer-->
        <xsl:template match="/">
                <xsl:if test="marc:collection">
index 5ea4fc7..9751a58 100644 (file)
@@ -6,7 +6,7 @@
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   exclude-result-prefixes="marc items">
     <xsl:import href="NORMARCslimUtils.xsl"/>
-    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" />
+    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
     <xsl:template match="/">
             <xsl:apply-templates/>
     </xsl:template>
@@ -37,7 +37,8 @@
         <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
         <xsl:variable name="field019b" select="marc:datafield[@tag=019]/marc:subfield[@code='b']"/>
         <xsl:variable name="biblionumber" select="marc:datafield[@tag=999]/marc:subfield[@code='c']"/>
-        <xsl:variable name="materialTypeCode">
+        <xsl:variable name="typeOf008">
+            <!-- The logic here should be exactly the same for NORMARCslim2intranetDetail.xsl, NORMARCslim2intranetResults.xsl, NORMARCslim2OPACDetail.xsl and NORMARCslim2OPACResults.xsl -->
             <xsl:choose>
                 <xsl:when test="$field019b='b' or $field019b='k' or $field019b='l' or $leader6='b'">Mon</xsl:when>
                 <xsl:when test="$field019b='e' or contains($field019b,'ec') or contains($field019b,'ed') or contains($field019b,'ee') or contains($field019b,'ef') or $leader6='g'">FV</xsl:when>
                 </xsl:when>
             </xsl:choose>
         </xsl:variable>
-        <xsl:variable name="materialTypeLabel">
-                        <xsl:choose>
-                <xsl:when test="$field019b='b' or $field019b='k' or $field019b='l' or $leader6='b'">Bok</xsl:when>
-                <xsl:when test="$field019b='e' or contains($field019b,'ec') or contains($field019b,'ed') or contains($field019b,'ee') or contains($field019b,'ef') or $leader6='g'">Film og video</xsl:when>
-                <xsl:when test="$field019b='c' or $field019b='d' or contains($field019b,'da') or contains($field019b,'db') or contains($field019b,'dc') or contains($field019b,'dd') or contains($field019b,'dg') or contains($field019b,'dh') or contains($field019b,'di') or contains($field019b,'dj') or contains($field019b,'dk') or $leader6='c' or $leader6='d' or $leader6='i' or $leader6='j'">Musikalier</xsl:when>
-                <xsl:when test="$field019b='a' or contains($field019b,'ab') or contains($field019b,'aj') or $leader6='e' or $leader6='f'">Kart</xsl:when>
-                <xsl:when test="$field019b='f' or $field019b='i' or contains($field019b,'ib') or contains($field019b,'ic') or contains($field019b,'fd') or contains($field019b,'ff') or contains($field019b,'fi') or $leader6='k'">Grafisk materiale</xsl:when>
-                <xsl:when test="$field019b='g' or contains($field019b,'gb') or contains($field019b,'gd') or contains($field019b,'ge') or $leader6='m'">Fil</xsl:when>
-                <xsl:when test="$leader6='o'">Kombidokument</xsl:when>
-                <xsl:when test="$field019b='h' or $leader6='r'">Tredimensjonal gjenstand</xsl:when>
-                <xsl:when test="$field019b='j' or $leader6='a'">
-                    <xsl:choose>
-                        <xsl:when test="$leader7='a' or $leader7='c' or $leader7='m' or $leader7='p'">Bok</xsl:when>
-                        <xsl:when test="$field019b='j' or $leader7='b' or $leader7='s'">Periodikum</xsl:when>
-                    </xsl:choose>
-                </xsl:when>
-            </xsl:choose>
-
-        </xsl:variable>
 
         <!-- Tittel og ansvarsopplysninger -->
         <xsl:if test="marc:datafield[@tag=245]">
         </xsl:choose>
 
 
-        <xsl:if test="$materialTypeCode!=''">
-        <span class="results_summary"><span class="label">Materialtype: </span>
-        <xsl:element name="img"><xsl:attribute name="src">/opac-tmpl/prog/famfamfam/<xsl:value-of select="$materialTypeCode"/>.png</xsl:attribute><xsl:attribute name="alt"></xsl:attribute></xsl:element>
-        <xsl:value-of select="$materialTypeLabel"/>
+        <xsl:if test="$typeOf008!=''">
+        <span class="results_summary">
+            <span class="label">Materialtype: </span>
+            <xsl:choose>
+                <xsl:when test="$typeOf008='Mon'"><img src="/intranet-tmpl/prog/img/famfamfam/BK.png" alt="Bok" title="Bok"/> Bok</xsl:when>
+                <xsl:when test="$typeOf008='Per'"><img src="/intranet-tmpl/prog/img/famfamfam/AR.png" alt="Periodika" title="Periodika"/> Periodika</xsl:when>
+                <xsl:when test="$typeOf008='Fil'"><img src="/intranet-tmpl/prog/img/famfamfam/CF.png" alt="Fil" title="Fil"/> Fil</xsl:when>
+                <xsl:when test="$typeOf008='Kar'"><img src="/intranet-tmpl/prog/img/famfamfam/MP.png" alt="Kart" title="Kart"/> Kart</xsl:when>
+                <xsl:when test="$typeOf008='FV'"><img  src="/intranet-tmpl/prog/img/famfamfam/VM.png" alt="Film og video" title="Film og video"/> Film og video</xsl:when>
+                <xsl:when test="$typeOf008='Mus'"><img src="/intranet-tmpl/prog/img/famfamfam/PR.png" alt="Musikktrykk og lydopptak" title="Musikktrykk og lydopptak"/> Musikk</xsl:when>
+                <xsl:when test="$typeOf008='gra'"><img src="/intranet-tmpl/prog/img/famfamfam/GR.png" alt="Grafisk materiale" title="Grafisk materiale"/> Grafisk materiale</xsl:when>
+                <xsl:when test="$typeOf008='kom'"><img src="/intranet-tmpl/prog/img/famfamfam/MX.png" alt="Kombidokumenter" title="Kombidokumenter"/> Kombidokumenter</xsl:when>
+                <xsl:when test="$typeOf008='trd'"><img src="/intranet-tmpl/prog/img/famfamfam/TD.png" alt="Tre-dimensjonale gjenstander" title="Tre-dimensjonale gjenstander"/> Tre-dimensjonale gjenstander</xsl:when>
+            </xsl:choose>
         </span>
         </xsl:if>
 
index 5ee95ff..e73a583 100644 (file)
@@ -7,7 +7,7 @@
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   exclude-result-prefixes="marc items">
     <xsl:import href="MARC21slimUtils.xsl"/>
-    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" />
+    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
     <xsl:key name="item-by-status" match="items:item" use="items:status"/>
     <xsl:key name="item-by-status-and-branch" match="items:item" use="concat(items:status, ' ', items:homebranch)"/>
 
@@ -33,9 +33,8 @@
         <xsl:variable name="controlField007-01" select="substring($controlField007,2,1)"/>
         <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
         <xsl:variable name="field019b" select="marc:datafield[@tag=019]/marc:subfield[@code='b']"/>
-
         <xsl:variable name="typeOf008">
-        <!-- Codes with upper case first letter below are from the NORMARC standard, lower case first letter are made up. -->
+            <!-- The logic here should be exactly the same for NORMARCslim2intranetDetail.xsl, NORMARCslim2intranetResults.xsl, NORMARCslim2OPACDetail.xsl and NORMARCslim2OPACResults.xsl -->
             <xsl:choose>
                 <xsl:when test="$field019b='b' or $field019b='k' or $field019b='l' or $leader6='b'">Mon</xsl:when>
                 <xsl:when test="$field019b='e' or contains($field019b,'ec') or contains($field019b,'ed') or contains($field019b,'ee') or contains($field019b,'ef') or $leader6='g'">FV</xsl:when>
 
     <span class="results_summary">
     <xsl:if test="$typeOf008!=''">
-        <span class="label">Type: </span>
-
+        <span class="label">Materialtype: </span>
             <xsl:choose>
-                <xsl:when test="$typeOf008='Mon'"><img src="/opac-tmpl/prog/famfamfam/silk/book.png" alt="Bok" title="Bok"/> Bok</xsl:when>
-                <xsl:when test="$typeOf008='Per'"><img src="/opac-tmpl/prog/famfamfam/silk/newspaper.png" alt="Periodika" title="Periodika"/> Periodika</xsl:when>
-                <xsl:when test="$typeOf008='Fil'"><img src="/opac-tmpl/prog/famfamfam/silk/computer_link.png" alt="Fil" title="Fil"/> Fil</xsl:when>
-                <xsl:when test="$typeOf008='Kar'"><img src="/opac-tmpl/prog/famfamfam/silk/map.png" alt="Kart" title="Kart"/> Kart</xsl:when>
-                <xsl:when test="$typeOf008='FV'"><img src="/opac-tmpl/prog/famfamfam/silk/film.png" alt="Film og video" title="Film og video"/> Film og video</xsl:when>
-                <xsl:when test="$typeOf008='Mus'"><img src="/opac-tmpl/prog/famfamfam/silk/sound.png" alt="Musikktrykk og lydopptak" title="Musikktrykk og lydopptak"/> Musikk</xsl:when>
-                <xsl:when test="$typeOf008='gra'"> Grafisk materiale</xsl:when>
-                <xsl:when test="$typeOf008='kom'"> Kombidokumenter</xsl:when>
-                <xsl:when test="$typeOf008='trd'"> Tre-dimensjonale gjenstander</xsl:when>
+                <xsl:when test="$typeOf008='Mon'"><img src="/intranet-tmpl/prog/img/famfamfam/BK.png" alt="Bok" title="Bok"/> Bok</xsl:when>
+                <xsl:when test="$typeOf008='Per'"><img src="/intranet-tmpl/prog/img/famfamfam/AR.png" alt="Periodika" title="Periodika"/> Periodika</xsl:when>
+                <xsl:when test="$typeOf008='Fil'"><img src="/intranet-tmpl/prog/img/famfamfam/CF.png" alt="Fil" title="Fil"/> Fil</xsl:when>
+                <xsl:when test="$typeOf008='Kar'"><img src="/intranet-tmpl/prog/img/famfamfam/MP.png" alt="Kart" title="Kart"/> Kart</xsl:when>
+                <xsl:when test="$typeOf008='FV'"><img  src="/intranet-tmpl/prog/img/famfamfam/VM.png" alt="Film og video" title="Film og video"/> Film og video</xsl:when>
+                <xsl:when test="$typeOf008='Mus'"><img src="/intranet-tmpl/prog/img/famfamfam/PR.png" alt="Musikktrykk og lydopptak" title="Musikktrykk og lydopptak"/> Musikk</xsl:when>
+                <xsl:when test="$typeOf008='gra'"><img src="/intranet-tmpl/prog/img/famfamfam/GR.png" alt="Grafisk materiale" title="Grafisk materiale"/> Grafisk materiale</xsl:when>
+                <xsl:when test="$typeOf008='kom'"><img src="/intranet-tmpl/prog/img/famfamfam/MX.png" alt="Kombidokumenter" title="Kombidokumenter"/> Kombidokumenter</xsl:when>
+                <xsl:when test="$typeOf008='trd'"><img src="/intranet-tmpl/prog/img/famfamfam/TD.png" alt="Tre-dimensjonale gjenstander" title="Tre-dimensjonale gjenstander"/> Tre-dimensjonale gjenstander</xsl:when>
             </xsl:choose>
     </xsl:if>
     <xsl:if test="string-length(normalize-space($physicalDescription))">
index 7b69a0c..32e8aec 100644 (file)
@@ -7,7 +7,7 @@
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:marc="http://www.loc.gov/MARC21/slim" 
   version="1.0">
-  <xsl:output method="html" doctype-public="-//W3C/DTD html 4.01 Transitional//EN" doctype-system="http://www.w3.org/TR/html4/strict.dtd" />    
+  <xsl:output method="html" doctype-public="-//W3C/DTD html 4.01 Transitional//EN" doctype-system="http://www.w3.org/TR/html4/strict.dtd" encoding="UTF-8"/>
       <xsl:template match="/">
         <html>
           <head>
index cf6475d..04e5b24 100644 (file)
@@ -9,7 +9,7 @@
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="marc">
   <xsl:import href="MARC21slimUtils.xsl"/>
-  <xsl:output method="xml" indent="yes"/>
+  <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
   <xsl:template match="/">
     <xsl:if test="marc:collection">
       <oai_dc:dcCollection xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd">
index 5c80f08..f297cc7 100644 (file)
@@ -9,7 +9,7 @@
   exclude-result-prefixes="marc items">
 
 <xsl:import href="UNIMARCslimUtils.xsl"/>
-<xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" />
+<xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
 <xsl:template match="/">
   <xsl:apply-templates/>
 </xsl:template>
index be83929..963fd72 100644 (file)
@@ -6,7 +6,7 @@
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   exclude-result-prefixes="marc items">
 <xsl:import href="UNIMARCslimUtils.xsl"/>
-<xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" />
+<xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
 <xsl:key name="item-by-status" match="items:item" use="items:status"/>
 <xsl:key name="item-by-status-and-branch" match="items:item" use="concat(items:status, ' ', items:homebranch)"/>
 
index 8f49e73..dcf76e1 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE stylesheet [<!ENTITY nbsp "&#160;" >]>
 <xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-       <xsl:output method="html"/>
+    <xsl:output method="html" encoding="UTF-8"/>
        
        <xsl:template match="/">
                <html>
diff --git a/koha-tmpl/intranet-tmpl/prog/img/famfamfam/GR.png b/koha-tmpl/intranet-tmpl/prog/img/famfamfam/GR.png
new file mode 100644 (file)
index 0000000..4a158fe
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/famfamfam/GR.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/famfamfam/TD.png b/koha-tmpl/intranet-tmpl/prog/img/famfamfam/TD.png
new file mode 100644 (file)
index 0000000..7851cf3
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/famfamfam/TD.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/article_b.gif b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/article_b.gif
new file mode 100644 (file)
index 0000000..22f50d0
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/article_b.gif differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/audiovisual_b.gif b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/audiovisual_b.gif
new file mode 100644 (file)
index 0000000..e5b101d
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/audiovisual_b.gif differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/binary_b.gif b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/binary_b.gif
new file mode 100644 (file)
index 0000000..497ce89
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/binary_b.gif differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/book_b.gif b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/book_b.gif
new file mode 100644 (file)
index 0000000..ee79e8a
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/book_b.gif differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/handwriting_b.gif b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/handwriting_b.gif
new file mode 100644 (file)
index 0000000..d767a8c
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/handwriting_b.gif differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/map_b.gif b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/map_b.gif
new file mode 100644 (file)
index 0000000..816110d
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/map_b.gif differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/periodical_b.gif b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/periodical_b.gif
new file mode 100644 (file)
index 0000000..3249ec4
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/periodical_b.gif differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/picture_b.gif b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/picture_b.gif
new file mode 100644 (file)
index 0000000..652dfb1
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/picture_b.gif differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/score_b.gif b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/score_b.gif
new file mode 100644 (file)
index 0000000..31a2118
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/score_b.gif differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/sons_b.gif b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/sons_b.gif
new file mode 100644 (file)
index 0000000..a81ad42
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/sons_b.gif differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/sound_b.gif b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/sound_b.gif
new file mode 100644 (file)
index 0000000..d563c82
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/sound_b.gif differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/thesis_b.gif b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/thesis_b.gif
new file mode 100644 (file)
index 0000000..78bb330
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/thesis_b.gif differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/unknown_b.gif b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/unknown_b.gif
new file mode 100644 (file)
index 0000000..1630b7b
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc/unknown_b.gif differ
index d235584..e939a1b 100644 (file)
@@ -1,5 +1,5 @@
-@import url("../lib/yui/reset-fonts-grids.css");
-@import url("../lib/yui/skin.css");
+@import url("../../../lib/yui/reset-fonts-grids.css");
+@import url("../../../lib/yui/skin.css");
 
 a {
       font-weight : bold;
@@ -240,7 +240,6 @@ fieldset.brief input[type=reset]
  background: -webkit-linear-gradient(top, #f4f9fc 0%,#dfeefa 4%,#bfd5ea 93%,#a1c4e2 97%,#b8d0e6 100%); /* Chrome10+,Safari5.1+ */
        background: -o-linear-gradient(top, #f4f9fc 0%,#dfeefa 4%,#bfd5ea 93%,#a1c4e2 97%,#b8d0e6 100%); /* Opera11.10+ */
      background: -ms-linear-gradient(top, #f4f9fc 0%,#dfeefa 4%,#bfd5ea 93%,#a1c4e2 97%,#b8d0e6 100%); /* IE10+ */
-  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f9fc', endColorstr='#b8d0e6',GradientType=0 ); /* IE6-9 */
        background: linear-gradient(top, #f4f9fc 0%,#dfeefa 4%,#bfd5ea 93%,#a1c4e2 97%,#b8d0e6 100%); /* W3C */
         border-top: 1px solid #cccccc;
  border-left: 1px solid #cccccc;
@@ -507,7 +506,6 @@ background: -webkit-linear-gradient(top, #b2b2b2 0%,#e0e0e0 14%,#e8e8e8 100%); /
 background: -o-linear-gradient(top, #b2b2b2 0%,#e0e0e0 14%,#e8e8e8 100%); /* Opera 11.10+ */
 background: -ms-linear-gradient(top, #b2b2b2 0%,#e0e0e0 14%,#e8e8e8 100%); /* IE10+ */
 background: linear-gradient(top, #b2b2b2 0%,#e0e0e0 14%,#e8e8e8 100%); /* W3C */
-filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e0e0e0', endColorstr='#e8e8e8',GradientType=0 ); /* IE6-9 */
     margin : 0 0 1em 0;
     padding-top : .5em;
     padding-left : 10px;
@@ -725,7 +723,7 @@ input.deleteshelf:active {
 
 #tagslist li { display : inline; }
 
-a.tag_results_add {
+a.tag_add {
     background-image: url(../../images/tag-small.png);
     background-position : -1px center;
     background-repeat : no-repeat;
@@ -744,7 +742,6 @@ a.tag_results_add {
 
 .tag_results_input {
     background-color: #EEE;
-    display: none;
     margin-left: 1em;
     padding: 0.3em;
 }
@@ -913,7 +910,6 @@ body#advsearch #listsmenulink {
   background: -o-linear-gradient(top, #8fb4e8 0%,#8cb1e5 19%,#80a8dc 48%,#7da5d8 52%,#7198cf 83%,#618ac0 100%); /* Opera 11.10+ */
        background: -ms-linear-gradient(top, #8fb4e8 0%,#8cb1e5 19%,#80a8dc 48%,#7da5d8 52%,#7198cf 83%,#618ac0 100%); /* IE10+ */
      background: linear-gradient(top, #8fb4e8 0%,#8cb1e5 19%,#80a8dc 48%,#7da5d8 52%,#7198cf 83%,#618ac0 100%); /* W3C */
-   filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#8fb4e8', endColorstr='#618ac0',GradientType=0 ); /* IE6-9 */
        border-top : 1px solid #335599;
         border-bottom : 1px solid #335599;
      margin-left : -10px;
@@ -1446,9 +1442,19 @@ padding-left : .4em;
     padding-left:20px
 }
 
-.searchresults .tagstatus {
-        display: block;
-        color: #707070;
+.tagstatus {
+    color: #707070;
+    padding: 0 4px 0 4px;
+    margin-left: 5px;
+    border: 1px solid #bcbcbc;
+    background-color: #ffffcc;
+    -webkit-border-radius: 4px;
+    -moz-border-radius: 4px;
+    border-radius: 4px;
+}
+
+.results_summary.tagstatus {
+    display: inline;
 }
 
 .results_summary .label {
@@ -1459,8 +1465,12 @@ padding-left : .4em;
         font-weight: normal;
 }
 
-.actions a {
-   margin-left : 1em;
+.actions a.hold,
+.actions a.addtocart,
+.actions a.addtoshelf,
+.actions a.addtolist,
+.actions a.tag_add {
+     margin-left : 1em;
      text-decoration : none;
 }
 
@@ -1505,7 +1515,6 @@ div.alert {
   background: -webkit-linear-gradient(top, #fef8d3 0%,#ffec91 9%,#ffed87 89%,#f9dc00 100%); /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(top, #fef8d3 0%,#ffec91 9%,#ffed87 89%,#f9dc00 100%); /* Opera11.10+ */
  background: -ms-linear-gradient(top, #fef8d3 0%,#ffec91 9%,#ffed87 89%,#f9dc00 100%); /* IE10+ */
-      filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fef8d3', endColorstr='#f9dc00',GradientType=0 ); /* IE6-9 */
        background: linear-gradient(top, #fef8d3 0%,#ffec91 9%,#ffed87 89%,#f9dc00 100%); /* W3C */
     text-align : center;
 }
@@ -1521,7 +1530,6 @@ div.message {
  background: -webkit-linear-gradient(top, #ffffff 0%,#f4f6fa 2%,#eaeef5 23%,#e8edf6 94%,#cddbf2 100%); /* Chrome10+,Safari5.1+ */
        background: -o-linear-gradient(top, #ffffff 0%,#f4f6fa 2%,#eaeef5 23%,#e8edf6 94%,#cddbf2 100%); /* Opera11.10+ */
      background: -ms-linear-gradient(top, #ffffff 0%,#f4f6fa 2%,#eaeef5 23%,#e8edf6 94%,#cddbf2 100%); /* IE10+ */
-  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#cddbf2',GradientType=0 ); /* IE6-9 */
        background: linear-gradient(top, #ffffff 0%,#f4f6fa 2%,#eaeef5 23%,#e8edf6 94%,#cddbf2 100%); /* W3C */
         border : 1px solid #bcbcbc;
     width : 55%;
@@ -1567,7 +1575,6 @@ div.message {
        background: -webkit-linear-gradient(left, #eef4fe 0%,#eef4fe 88%,#f6f9fe 98%,#ffffff 99%,#a5c2f6 99%,#e6eefe 100%,#cbdefe 100%); /* Chrome10+,Safari5.1+ */
     background: -o-linear-gradient(left, #eef4fe 0%,#eef4fe 88%,#f6f9fe 98%,#ffffff 99%,#a5c2f6 99%,#e6eefe 100%,#cbdefe 100%); /* Opera11.10+ */
   background: -ms-linear-gradient(left, #eef4fe 0%,#eef4fe 88%,#f6f9fe 98%,#ffffff 99%,#a5c2f6 99%,#e6eefe 100%,#cbdefe 100%); /* IE10+ */
-       filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eef4fe', endColorstr='#cbdefe',GradientType=1 ); /* IE6-9 */
        background: linear-gradient(left, #eef4fe 0%,#eef4fe 88%,#f6f9fe 98%,#ffffff 99%,#a5c2f6 99%,#e6eefe 100%,#cbdefe 100%); /* W3C */
      border : 1px solid #739acf;
     padding : .3em 1em 0 0;
@@ -1691,7 +1698,6 @@ span.lang{
  background: -webkit-linear-gradient(top, #e6f3fe 0%,#dfeefa 8%,#bfd5ea 49%,#b8d0e6 52%,#b8d0e6 100%); /* Chrome10+,Safari5.1+ */
        background: -o-linear-gradient(top, #e6f3fe 0%,#dfeefa 8%,#bfd5ea 49%,#b8d0e6 52%,#b8d0e6 100%); /* Opera11.10+ */
      background: -ms-linear-gradient(top, #e6f3fe 0%,#dfeefa 8%,#bfd5ea 49%,#b8d0e6 52%,#b8d0e6 100%); /* IE10+ */
-  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e6f3fe', endColorstr='#b8d0e6',GradientType=0 ); /* IE6-9 */
        background: linear-gradient(top, #e6f3fe 0%,#dfeefa 8%,#bfd5ea 49%,#b8d0e6 52%,#b8d0e6 100%); /* W3C */
         -webkit-border-radius: 4px;
     -moz-border-radius: 4px;
@@ -1722,7 +1728,6 @@ div#menu li a {
      background: -o-linear-gradient(left, #eeeeee 0%,#eeeeee 96%,#e6e6e6 97%,#cccccc 99%,#c1c1c1 100%); /* Opera 11.10+ */
   background: -ms-linear-gradient(left, #eeeeee 0%,#eeeeee 96%,#e6e6e6 97%,#cccccc 99%,#c1c1c1 100%); /* IE10+ */
         background: linear-gradient(left, #eeeeee 0%,#eeeeee 96%,#e6e6e6 97%,#cccccc 99%,#c1c1c1 100%); /* W3C */
-      filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#c1c1c1',GradientType=1 ); /* IE6-9 */
        text-decoration : none;
         display : block;
        border : 1px solid #979797;
@@ -1740,7 +1745,6 @@ div#menu li a:hover {
  background: -o-linear-gradient(left, #eaeef5 0%,#dee6f4 96%,#c4d5ef 98%,#a2bee8 100%); /* Opera 11.10+ */
       background: -ms-linear-gradient(left, #eaeef5 0%,#dee6f4 96%,#c4d5ef 98%,#a2bee8 100%); /* IE10+ */
     background: linear-gradient(left, #eaeef5 0%,#dee6f4 96%,#c4d5ef 98%,#a2bee8 100%); /* W3C */
-  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eaeef5', endColorstr='#a2bee8',GradientType=1 ); /* IE6-9 */
 }
 
 div#menu li.active a:hover {
@@ -1851,7 +1855,6 @@ span.starMT {
     background: url("../../images/sprite.png"),-o-linear-gradient(top, #d7e5ff 0%,#b1cbff 50%,#9fbfff 100%); /* Opera 11.10+ */
     background: url("../../images/sprite.png"),-ms-linear-gradient(top, #d7e5ff 0%,#b1cbff 50%,#9fbfff 100%); /* IE10+ */
     background: url("../../images/sprite.png"),linear-gradient(top, #d7e5ff 0%,#b1cbff 50%,#9fbfff 100%); /* W3C */
-        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#d7e5ff', endColorstr='#9fbfff',GradientType=0 ); /* IE6-9 */
     background-position: 40px -287px,top left;
         background-repeat: no-repeat;
   border: 1px solid #629DCF;
@@ -1867,7 +1870,6 @@ span.starMT {
     background: url("../../images/sprite.png"),-o-linear-gradient(top, #e2ecf5 0%,#c3d8ea 50%,#b8d0e6 100%); /* Opera 11.10+ */
     background: url("../../images/sprite.png"),-ms-linear-gradient(top, #e2ecf5 0%,#c3d8ea 50%,#b8d0e6 100%); /* IE10+ */
     background: url("../../images/sprite.png"),linear-gradient(top, #e2ecf5 0%,#c3d8ea 50%,#b8d0e6 100%); /* W3C */
-  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e2ecf5', endColorstr='#b8d0e6',GradientType=0 ); /* IE6-9 */
        background-repeat: no-repeat;
     background-position: 40px -287px,top left;
 }
@@ -1880,7 +1882,6 @@ span.starMT {
     background: url("../../images/sprite.png"),-o-linear-gradient(top, #d5eaba 0%,#b7db8a 50%,#98cb59 100%); /* Opera 11.10+ */
     background: url("../../images/sprite.png"),-ms-linear-gradient(top, #d5eaba 0%,#b7db8a 50%,#98cb59 100%); /* IE10+ */
     background: url("../../images/sprite.png"),linear-gradient(top, #d5eaba 0%,#b7db8a 50%,#98cb59 100%); /* W3C */
-      filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#d5eaba', endColorstr='#98cb59',GradientType=0 ); /* IE6-9 */
     background-position: -5px -256px, left top;
        background-repeat: no-repeat;
   border: 1px solid #5EA28C;
@@ -1896,7 +1897,6 @@ span.starMT {
     background: url("../../images/sprite.png"),-o-linear-gradient(top, #e5f1d4 0%,#cbe4aa 50%,#c0de98 100%); /* Opera 11.10+ */
     background: url("../../images/sprite.png"),-ms-linear-gradient(top, #e5f1d4 0%,#cbe4aa 50%,#c0de98 100%); /* IE10+ */
     background: url("../../images/sprite.png"),linear-gradient(top, #e5f1d4 0%,#cbe4aa 50%,#c0de98 100%); /* W3C */
-  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e5f1d4', endColorstr='#c0de98',GradientType=0 ); /* IE6-9 */
        background-repeat: no-repeat;
     background-position: -5px -256px, left top;
 }
@@ -2609,6 +2609,26 @@ ul.ui-tabs-nav li {
     margin-left: 0.5em;
 }
 
+#didyoumean {
+    background-color: #EEE;
+    border: 1px solid #E8E8E8;
+    margin: 0 0 0.5em;
+    text-align: left;
+    padding: 0.5em;
+    border-radius: 3px 3px 3px 3px;
+}
+
+.suggestionlabel {
+    font-weight: bold;
+}
+
+.searchsuggestion {
+    padding: 0.2em 0.5em;
+    white-space: nowrap;
+    display: inline-block;
+}
+
+
 /* jQuery UI Datepicker */
 .ui-datepicker-trigger {
     vertical-align: middle;
@@ -2624,6 +2644,57 @@ body#opac-main #opacmainuserblockmobile {
     display: none;
 }
 
+#hierarchies a {
+    font-weight: normal;
+    text-decoration: underline;
+    color: #069;
+}
+
+#hierarchies a:hover {
+    color: #990033;
+}
+
 .mobile_only {
    display : none;
 }
+
+/* different sizes for different tags in opac-tags.tt */
+.tagweight0 {
+    font-size: 12px;
+}
+
+.tagweight1 {
+    font-size: 14px;
+}
+
+.tagweight2 {
+    font-size: 16px;
+}
+
+.tagweight3 {
+    font-size: 18px;
+}
+
+.tagweight4 {
+    font-size: 20px;
+}
+
+.tagweight5 {
+    font-size: 22px;
+}
+
+.tagweight6 {
+    font-size: 24px;
+}
+
+.tagweight7 {
+    font-size: 26px;
+}
+
+.tagweight8 {
+    font-size: 28px;
+}
+
+.tagweight9 {
+    font-size: 30px;
+}
index 263c99f..5a79a47 100644 (file)
@@ -1,5 +1,5 @@
-@import url("../../en/lib/yui/reset-fonts-grids.css");
-@import url("../../en/lib/yui/skin.css");
+@import url("../../../lib/yui/reset-fonts-grids.css");
+@import url("../../../lib/yui/skin.css");
 
 a {
   font-weight : bold;
@@ -338,4 +338,4 @@ span.lang{
 
 div.ft {
  clear : both;
-}
\ No newline at end of file
+}
index 5b6981d..8df82cf 100644 (file)
@@ -3,6 +3,8 @@
 <meta name="generator" content="Koha [% Version %]" /> <!-- leave this for stats -->
 <link rel="shortcut icon" href="[% IF ( OpacFavicon ) %][% OpacFavicon %][% ELSE %][% themelang %]/includes/favicon.ico[% END %]" type="image/x-icon" />
 <link rel="stylesheet" type="text/css" href="[% themelang %]/lib/jquery/jquery-ui.css" />
+<link rel="stylesheet" type="text/css" href="/opac-tmpl/lib/yui/reset-fonts-grids.css" />
+<link rel="stylesheet" type="text/css" href="/opac-tmpl/lib/yui/skin.css" />
 [% SET opaclayoutstylesheet='opac.css' UNLESS opaclayoutstylesheet %]
 [% IF (opaclayoutstylesheet.match('^https?:|^\/')) %]
     <link rel="stylesheet" type="text/css" href="[% opaclayoutstylesheet %]" />
@@ -81,7 +83,8 @@
     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.");[% END %][% END %]
+    var MSG_MULTI_ADD_TAG_FAILED = _("Unable to add one or more tags.");
+    var MSG_NO_TAG_SPECIFIED = _("No tag was specified.");[% END %][% END %]
     [% IF ( OPACAmazonCoverImages ) %]$(window).load(function() {
         verify_images();
     });[% END %]
index 0ee0622..115880f 100644 (file)
@@ -80,7 +80,7 @@ function openBasket() {
     if ( strCookie ) {
         var iW = 820;
         var iH = 450;
-        var optWin = "dependant=yes,status=yes,scrollbars=yes,resizable=yes,toolbar=no,location=yes,height="+iH+",width="+iW;
+        var optWin = "status=yes,scrollbars=yes,resizable=yes,toolbar=no,location=yes,height="+iH+",width="+iW;
         var loc = CGIBIN + "opac-basket.pl?" + strCookie;
         var basket = open(loc, "basket", optWin);
         if (window.focus) {basket.focus()}
@@ -354,7 +354,7 @@ function sendBasket() {
 
     var loc = CGIBIN + "opac-sendbasket.pl?" + strCookie;
 
-    var optWin="dependant=yes,scrollbars=no,resizable=no,height=300,width=450,top=50,left=100";
+    var optWin="scrollbars=no,resizable=no,height=300,width=450,top=50,left=100";
     var win_form = open(loc,"win_form",optWin);
 }
 
@@ -365,7 +365,7 @@ function downloadBasket() {
 
     var loc = CGIBIN + "opac-downloadcart.pl?" + strCookie;
 
-    open(loc,"win_form",'dependant=yes,scrollbars=no,resizable=no,height=300,width=450,top=50,left=100');
+    open(loc,"win_form",'scrollbars=no,resizable=no,height=300,width=450,top=50,left=100');
 }
 
 function printBasket() {
index f663696..cffd4bf 100644 (file)
@@ -26,12 +26,11 @@ if (typeof(readCookie) == "undefined") {
    }
 }
 KOHA.Tags = {
-      add_tag_button: function(){
-            var mybibnum = $(this).attr("title");
-          var mynewtag = "newtag" + mybibnum;
+      add_tag_button: function(bibnum, tag){
+          var mynewtag = "newtag" + bibnum;
             var mytagid = "#" + mynewtag;
           var mydata = {CGISESSID: readCookie('CGISESSID')};   // Someday this should be OPACSESSID
-                mydata[mynewtag] = $(mytagid).val();   // need [bracket] for variable property id
+                mydata[mynewtag] = tag;        // need [bracket] for variable property id
                 var response;  // AJAX from server will assign value to response.
                $.post(
                         "/cgi-bin/koha/opac-tags.pl",
@@ -61,11 +60,14 @@ KOHA.Tags = {
       },
      set_tag_status : function(tagid, newstatus) {
           $(tagid).html(newstatus);
-              $(tagid).css({display:"inline"});
+              $(tagid).show();
       },
      append_tag_status : function(tagid, newstatus) {
                $(tagid).append(newstatus);
-            $(tagid).css({display:"inline"});
+            $(tagid).show();
+      },
+     clear_all_tag_status : function() {
+          $(".tagstatus").empty().hide();
       },
 
     tag_message: {
@@ -73,8 +75,8 @@ KOHA.Tags = {
     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);},
+    failed_add_tag : function(arg) {return (MSG_ADD_TAG_FAILED+ " '"+arg+"'. \n"+MSG_ADD_TAG_FAILED_NOTE);},
+    failed_delete  : function(arg) {return (MSG_DELETE_TAG_FAILED+ " '"+arg+"'. \n"+MSG_DELETE_TAG_FAILED_NOTE);},
    login : function(arg) {return (MSG_LOGIN_REQUIRED);}
    },
 
@@ -92,7 +94,7 @@ KOHA.Tags = {
                   mydata,
                         function(data){
                                 eval(data);
-                $(".tagstatus").empty();
+                KOHA.Tags.clear_all_tag_status();
                 var bibErrors = false;
 
                 // Display the status for each tagged bib
diff --git a/koha-tmpl/opac-tmpl/lib/famfamfam/GR.png b/koha-tmpl/opac-tmpl/lib/famfamfam/GR.png
new file mode 100644 (file)
index 0000000..4a158fe
Binary files /dev/null and b/koha-tmpl/opac-tmpl/lib/famfamfam/GR.png differ
diff --git a/koha-tmpl/opac-tmpl/lib/famfamfam/PR.png b/koha-tmpl/opac-tmpl/lib/famfamfam/PR.png
new file mode 100644 (file)
index 0000000..a8b3ede
Binary files /dev/null and b/koha-tmpl/opac-tmpl/lib/famfamfam/PR.png differ
diff --git a/koha-tmpl/opac-tmpl/lib/famfamfam/TD.png b/koha-tmpl/opac-tmpl/lib/famfamfam/TD.png
new file mode 100644 (file)
index 0000000..7851cf3
Binary files /dev/null and b/koha-tmpl/opac-tmpl/lib/famfamfam/TD.png differ
diff --git a/koha-tmpl/opac-tmpl/lib/jquery/plugins/jquery.jstree.js b/koha-tmpl/opac-tmpl/lib/jquery/plugins/jquery.jstree.js
new file mode 100644 (file)
index 0000000..c94e61f
--- /dev/null
@@ -0,0 +1,4551 @@
+/*
+ * jsTree 1.0-rc3
+ * http://jstree.com/
+ *
+ * Copyright (c) 2010 Ivan Bozhanov (vakata.com)
+ *
+ * Licensed same as jquery - under the terms of either the MIT License or the GPL Version 2 License
+ *   http://www.opensource.org/licenses/mit-license.php
+ *   http://www.gnu.org/licenses/gpl.html
+ *
+ * $Date: 2011-02-09 01:17:14 +0200 (ср, 09 февр 2011) $
+ * $Revision: 236 $
+ */
+
+/*jslint browser: true, onevar: true, undef: true, bitwise: true, strict: true */
+/*global window : false, clearInterval: false, clearTimeout: false, document: false, setInterval: false, setTimeout: false, jQuery: false, navigator: false, XSLTProcessor: false, DOMParser: false, XMLSerializer: false*/
+
+"use strict";
+
+// top wrapper to prevent multiple inclusion (is this OK?)
+(function () { if(jQuery && jQuery.jstree) { return; }
+     var is_ie6 = false, is_ie7 = false, is_ff2 = false;
+
+/*
+ * jsTree core
+ */
+(function ($) {
+     // Common functions not related to jsTree
+      // decided to move them to a `vakata` "namespace"
+      $.vakata = {};
+ // CSS related functions
+       $.vakata.css = {
+               get_css : function(rule_name, delete_flag, sheet) {
+                    rule_name = rule_name.toLowerCase();
+                   var css_rules = sheet.cssRules || sheet.rules,
+                         j = 0;
+                 do {
+                           if(css_rules.length && j > css_rules.length + 5) { return false; }
+                             if(css_rules[j].selectorText && css_rules[j].selectorText.toLowerCase() == rule_name) {
+                                        if(delete_flag === true) {
+                                             if(sheet.removeRule) { sheet.removeRule(j); }
+                                          if(sheet.deleteRule) { sheet.deleteRule(j); }
+                                          return true;
+                                   }
+                                      else { return css_rules[j]; }
+                          }
+                      }
+                      while (css_rules[++j]);
+                        return false;
+          },
+             add_css : function(rule_name, sheet) {
+                 if($.jstree.css.get_css(rule_name, false, sheet)) { return false; }
+                    if(sheet.insertRule) { sheet.insertRule(rule_name + ' { }', 0); } else { sheet.addRule(rule_name, null, 0); }
+                  return $.vakata.css.get_css(rule_name);
+                },
+             remove_css : function(rule_name, sheet) {
+                      return $.vakata.css.get_css(rule_name, true, sheet);
+           },
+             add_sheet : function(opts) {
+                   var tmp = false, is_new = true;
+                        if(opts.str) {
+                         if(opts.title) { tmp = $("style[id='" + opts.title + "-stylesheet']")[0]; }
+                            if(tmp) { is_new = false; }
+                            else {
+                                 tmp = document.createElement("style");
+                                 tmp.setAttribute('type',"text/css");
+                                   if(opts.title) { tmp.setAttribute("id", opts.title + "-stylesheet"); }
+                         }
+                              if(tmp.styleSheet) {
+                                   if(is_new) {
+                                           document.getElementsByTagName("head")[0].appendChild(tmp);
+                                             tmp.styleSheet.cssText = opts.str;
+                                     }
+                                      else {
+                                         tmp.styleSheet.cssText = tmp.styleSheet.cssText + " " + opts.str;
+                                      }
+                              }
+                              else {
+                                 tmp.appendChild(document.createTextNode(opts.str));
+                                    document.getElementsByTagName("head")[0].appendChild(tmp);
+                             }
+                              return tmp.sheet || tmp.styleSheet;
+                    }
+                      if(opts.url) {
+                         if(document.createStyleSheet) {
+                                        try { tmp = document.createStyleSheet(opts.url); } catch (e) { }
+                               }
+                              else {
+                                 tmp                   = document.createElement('link');
+                                        tmp.rel                = 'stylesheet';
+                                       tmp.type        = 'text/css';
+                                 tmp.media     = "all";
+                                     tmp.href  = opts.url;
+                                   document.getElementsByTagName("head")[0].appendChild(tmp);
+                                     return tmp.styleSheet;
+                         }
+                      }
+              }
+      };
+
+    // private variables
+   var instances = [],                 // instance array (used by $.jstree.reference/create/focused)
+            focused_instance = -1,     // the index in the instance array of the currently focused instance
+            plugins = {},                      // list of included plugins
+            prepared_move = {};                // for the move_node function
+
+    // jQuery plugin wrapper (thanks to jquery UI widget function)
+ $.fn.jstree = function (settings) {
+            var isMethodCall = (typeof settings == 'string'), // is this a method call like $().jstree("open_node")
+                        args = Array.prototype.slice.call(arguments, 1),
+                       returnValue = this;
+
+           // if a method call execute the method on all selected instances
+               if(isMethodCall) {
+                     if(settings.substring(0, 1) == '_') { return returnValue; }
+                    this.each(function() {
+                         var instance = instances[$.data(this, "jstree_instance_id")],
+                                  methodValue = (instance && $.isFunction(instance[settings])) ? instance[settings].apply(instance, args) : instance;
+                                    if(typeof methodValue !== "undefined" && (settings.indexOf("is_") === 0 || (methodValue !== true && methodValue !== false))) { returnValue = methodValue; return false; }
+                      });
+            }
+              else {
+                 this.each(function() {
+                         // extend settings and allow for multiple hashes and $.data
+                            var instance_id = $.data(this, "jstree_instance_id"),
+                                  a = [],
+                                        b = settings ? $.extend({}, true, settings) : {},
+                                      c = $(this),
+                                   s = false,
+                                     t = [];
+                                a = a.concat(args);
+                            if(c.data("jstree")) { a.push(c.data("jstree")); }
+                             b = a.length ? $.extend.apply(null, [true, b].concat(a)) : b;
+
+                         // if an instance already exists, destroy it first
+                             if(typeof instance_id !== "undefined" && instances[instance_id]) { instances[instance_id].destroy(); }
+                         // push a new empty object to the instances array
+                              instance_id = parseInt(instances.push({}),10) - 1;
+                             // store the jstree instance id to the container element
+                               $.data(this, "jstree_instance_id", instance_id);
+                               // clean up all plugins
+                                b.plugins = $.isArray(b.plugins) ? b.plugins : $.jstree.defaults.plugins.slice();
+                              b.plugins.unshift("core");
+                             // only unique plugins
+                         b.plugins = b.plugins.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");
+
+                                // extend defaults with passed data
+                            s = $.extend(true, {}, $.jstree.defaults, b);
+                          s.plugins = b.plugins;
+                         $.each(plugins, function (i, val) {
+                                    if($.inArray(i, s.plugins) === -1) { s[i] = null; delete s[i]; }
+                                       else { t.push(i); }
+                            });
+                            s.plugins = t;
+
+                                // push the new object to the instances array (at the same time set the default classes to the container) and init
+                             instances[instance_id] = new $.jstree._instance(instance_id, $(this).addClass("jstree jstree-" + instance_id), s);
+                             // init all activated plugins for this instance
+                                $.each(instances[instance_id]._get_settings().plugins, function (i, val) { instances[instance_id].data[val] = {}; });
+                          $.each(instances[instance_id]._get_settings().plugins, function (i, val) { if(plugins[val]) { plugins[val].__init.apply(instances[instance_id]); } });
+                         // initialize the instance
+                             setTimeout(function() { if(instances[instance_id]) { instances[instance_id].init(); } }, 0);
+                   });
+            }
+              // return the jquery selection (or if it was a method call that returned a value - the returned value)
+         return returnValue;
+    };
+     // object to store exposed functions and objects
+       $.jstree = {
+           defaults : {
+                   plugins : []
+           },
+             _focused : function () { return instances[focused_instance] || null; },
+                _reference : function (needle) {
+                       // get by instance id
+                  if(instances[needle]) { return instances[needle]; }
+                    // get by DOM (if still no luck - return null
+                  var o = $(needle);
+                     if(!o.length && typeof needle === "string") { o = $("#" + needle); }
+                   if(!o.length) { return null; }
+                 return instances[o.closest(".jstree").data("jstree_instance_id")] || null;
+             },
+             _instance : function (index, container, settings) {
+                    // for plugins to store data in
+                        this.data = { core : {} };
+                     this.get_settings = function () { return $.extend(true, {}, settings); };
+                      this._get_settings       = function () { return settings; };
+                 this.get_index                = function () { return index; };
+                       this.get_container      = function () { return container; };
+                        this.get_container_ul = function () { return container.children("ul:eq(0)"); };
+                        this._set_settings     = function (s) {
+                            settings = $.extend(true, {}, settings, s);
+                    };
+             },
+             _fn : { },
+             plugin : function (pname, pdata) {
+                     pdata = $.extend({}, {
+                         __init                : $.noop,
+                              __destroy        : $.noop,
+                            _fn                        : {},
+                            defaults   : false
+                       }, pdata);
+                     plugins[pname] = pdata;
+
+                       $.jstree.defaults[pname] = pdata.defaults;
+                     $.each(pdata._fn, function (i, val) {
+                          val.plugin           = pname;
+                           val.old                     = $.jstree._fn[i];
+                           $.jstree._fn[i] = function () {
+                                        var rslt,
+                                              func = val,
+                                            args = Array.prototype.slice.call(arguments),
+                                          evnt = new $.Event("before.jstree"),
+                                           rlbk = false;
+
+                                 if(this.data.core.locked === true && i !== "unlock" && i !== "is_locked") { return; }
+
+                                 // Check if function belongs to the included plugins of this instance
+                                  do {
+                                           if(func && func.plugin && $.inArray(func.plugin, this._get_settings().plugins) !== -1) { break; }
+                                              func = func.old;
+                                       } while(func);
+                                 if(!func) { return; }
+
+                                 // context and function to trigger events, then finally call the function
+                                      if(i.indexOf("_") === 0) {
+                                             rslt = func.apply(this, args);
+                                 }
+                                      else {
+                                         rslt = this.get_container().triggerHandler(evnt, { "func" : i, "inst" : this, "args" : args, "plugin" : func.plugin });
+                                                if(rslt === false) { return; }
+                                         if(typeof rslt !== "undefined") { args = rslt; }
+
+                                              rslt = func.apply(
+                                                     $.extend({}, this, {
+                                                           __callback : function (data) {
+                                                                 this.get_container().triggerHandler( i + '.jstree', { "inst" : this, "args" : args, "rslt" : data, "rlbk" : rlbk });
+                                                           },
+                                                             __rollback : function () {
+                                                                     rlbk = this.get_rollback();
+                                                                    return rlbk;
+                                                           },
+                                                             __call_old : function (replace_arguments) {
+                                                                    return func.old.apply(this, (replace_arguments ? Array.prototype.slice.call(arguments, 1) : args ) );
+                                                          }
+                                                      }), args);
+                                     }
+
+                                     // return the result
+                                   return rslt;
+                           };
+                             $.jstree._fn[i].old = val.old;
+                         $.jstree._fn[i].plugin = pname;
+                        });
+            },
+             rollback : function (rb) {
+                     if(rb) {
+                               if(!$.isArray(rb)) { rb = [ rb ]; }
+                            $.each(rb, function (i, val) {
+                                 instances[val.i].set_rollback(val.h, val.d);
+                           });
+                    }
+              }
+      };
+     // set the prototype for all instances
+ $.jstree._fn = $.jstree._instance.prototype = {};
+
+     // load the css when DOM is ready
+      $(function() {
+         // code is copied from jQuery ($.browser is deprecated + there is a bug in IE)
+         var u = navigator.userAgent.toLowerCase(),
+                     v = (u.match( /.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
+                     css_string = '' +
+                              '.jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; } ' +
+                          '.jstree li { display:block; min-height:18px; line-height:18px; white-space:nowrap; margin-left:18px; min-width:18px; } ' +
+                            '.jstree-rtl li { margin-left:0; margin-right:18px; } ' +
+                              '.jstree > ul > li { margin-left:0px; } ' +
+                            '.jstree-rtl > ul > li { margin-right:0px; } ' +
+                               '.jstree ins { display:inline-block; text-decoration:none; width:18px; height:18px; margin:0 0 0 0; padding:0; } ' +
+                           '.jstree a { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; text-decoration:none; padding:1px 2px; margin:0; } ' +
+                              '.jstree a:focus { outline: none; } ' +
+                                '.jstree a > ins { height:16px; width:16px; } ' +
+                              '.jstree a > .jstree-icon { margin-right:3px; } ' +
+                            '.jstree-rtl a > .jstree-icon { margin-left:3px; margin-right:0; } ' +
+                         'li.jstree-open > ul { display:block; } ' +
+                            'li.jstree-closed > ul { display:none; } ';
+            // Correct IE 6 (does not support the > CSS selector)
+          if(/msie/.test(u) && parseInt(v, 10) == 6) {
+                   is_ie6 = true;
+
+                        // fix image flicker and lack of caching
+                       try {
+                          document.execCommand("BackgroundImageCache", false, true);
+                     } catch (err) { }
+
+                     css_string += '' +
+                             '.jstree li { height:18px; margin-left:0; margin-right:0; } ' +
+                                '.jstree li li { margin-left:18px; } ' +
+                               '.jstree-rtl li li { margin-left:0px; margin-right:18px; } ' +
+                         'li.jstree-open ul { display:block; } ' +
+                              'li.jstree-closed ul { display:none !important; } ' +
+                          '.jstree li a { display:inline; border-width:0 !important; padding:0px 2px !important; } ' +
+                           '.jstree li a ins { height:16px; width:16px; margin-right:3px; } ' +
+                           '.jstree-rtl li a ins { margin-right:0px; margin-left:3px; } ';
+                }
+              // Correct IE 7 (shifts anchor nodes onhover)
+          if(/msie/.test(u) && parseInt(v, 10) == 7) {
+                   is_ie7 = true;
+                 css_string += '.jstree li a { border-width:0 !important; padding:0px 2px !important; } ';
+              }
+              // correct ff2 lack of display:inline-block
+            if(!/compatible/.test(u) && /mozilla/.test(u) && parseFloat(v, 10) < 1.9) {
+                    is_ff2 = true;
+                 css_string += '' +
+                             '.jstree ins { display:-moz-inline-box; } ' +
+                          '.jstree li { line-height:12px; } ' + // WHY??
+                         '.jstree a { display:-moz-inline-box; } ' +
+                            '.jstree .jstree-no-icons .jstree-checkbox { display:-moz-inline-stack !important; } ';
+                                /* this shouldn't be here as it is theme specific */
+           }
+              // the default stylesheet
+              $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
+        });
+
+   // core functions (open, close, create, update, delete)
+        $.jstree.plugin("core", {
+              __init : function () {
+                 this.data.core.locked = false;
+                 this.data.core.to_open = this.get_settings().core.initially_open;
+                      this.data.core.to_load = this.get_settings().core.initially_load;
+              },
+             defaults : {
+                   html_titles : false,
+                   animation   : 500,
+                       initially_open : [],
+                   initially_load : [],
+                   open_parents : true,
+                   notify_plugins : true,
+                 rtl                   : false,
+                 load_open     : false,
+                     strings           : {
+                           loading             : "Loading ...",
+                              new_node : "New node",
+                         multiple_selection : "Multiple selection"
+                      }
+              },
+             _fn : {
+                        init   : function () {
+                           this.set_focus();
+                              if(this._get_settings().core.rtl) {
+                                    this.get_container().addClass("jstree-rtl").css("direction", "rtl");
+                           }
+                              this.get_container().html("<ul><li class='jstree-last jstree-leaf'><ins>&#160;</ins><a class='jstree-loading' href='#'><ins class='jstree-icon'>&#160;</ins>" + this._get_string("loading") + "</a></li></ul>");
+                               this.data.core.li_height = this.get_container_ul().find("li.jstree-closed, li.jstree-leaf").eq(0).height() || 18;
+
+                             this.get_container()
+                                   .delegate("li > ins", "click.jstree", $.proxy(function (event) {
+                                                       var trgt = $(event.target);
+                                                    // if(trgt.is("ins") && event.pageY - trgt.offset().top < this.data.core.li_height) { this.toggle_node(trgt); }
+                                                        this.toggle_node(trgt);
+                                                }, this))
+                                      .bind("mousedown.jstree", $.proxy(function () {
+                                                        this.set_focus(); // This used to be setTimeout(set_focus,0) - why?
+                                            }, this))
+                                      .bind("dblclick.jstree", function (event) {
+                                            var sel;
+                                               if(document.selection && document.selection.empty) { document.selection.empty(); }
+                                             else {
+                                                 if(window.getSelection) {
+                                                              sel = window.getSelection();
+                                                           try {
+                                                                  sel.removeAllRanges();
+                                                                 sel.collapse();
+                                                                } catch (err) { }
+                                                      }
+                                              }
+                                      });
+                            if(this._get_settings().core.notify_plugins) {
+                                 this.get_container()
+                                           .bind("load_node.jstree", $.proxy(function (e, data) {
+                                                         var o = this._get_node(data.rslt.obj),
+                                                                 t = this;
+                                                              if(o === -1) { o = this.get_container_ul(); }
+                                                          if(!o.length) { return; }
+                                                              o.find("li").each(function () {
+                                                                        var th = $(this);
+                                                                      if(th.data("jstree")) {
+                                                                                $.each(th.data("jstree"), function (plugin, values) {
+                                                                                  if(t.data[plugin] && $.isFunction(t["_" + plugin + "_notify"])) {
+                                                                                              t["_" + plugin + "_notify"].call(t, th, values);
+                                                                                       }
+                                                                              });
+                                                                    }
+                                                              });
+                                                    }, this));
+                             }
+                              if(this._get_settings().core.load_open) {
+                                      this.get_container()
+                                           .bind("load_node.jstree", $.proxy(function (e, data) {
+                                                         var o = this._get_node(data.rslt.obj),
+                                                                 t = this;
+                                                              if(o === -1) { o = this.get_container_ul(); }
+                                                          if(!o.length) { return; }
+                                                              o.find("li.jstree-open:not(:has(ul))").each(function () {
+                                                                      t.load_node(this, $.noop, $.noop);
+                                                             });
+                                                    }, this));
+                             }
+                              this.__callback();
+                             this.load_node(-1, function () { this.loaded(); this.reload_nodes(); });
+                       },
+                     destroy   : function () {
+                                var i,
+                                 n = this.get_index(),
+                                  s = this._get_settings(),
+                                      _this = this;
+
+                         $.each(s.plugins, function (i, val) {
+                                  try { plugins[val].__destroy.apply(_this); } catch(err) { }
+                            });
+                            this.__callback();
+                             // set focus to another instance if this one is focused
+                                if(this.is_focused()) {
+                                        for(i in instances) {
+                                          if(instances.hasOwnProperty(i) && i != n) {
+                                                    instances[i].set_focus();
+                                                      break;
+                                         }
+                                      }
+                              }
+                              // if no other instance found
+                          if(n === focused_instance) { focused_instance = -1; }
+                          // remove all traces of jstree in the DOM (only the ones set using jstree*) and cleans all events
+                              this.get_container()
+                                   .unbind(".jstree")
+                                     .undelegate(".jstree")
+                                 .removeData("jstree_instance_id")
+                                      .find("[class^='jstree']")
+                                             .andSelf()
+                                             .attr("class", function () { return this.className.replace(/jstree[^ ]*|$/ig,''); });
+                          $(document)
+                                    .unbind(".jstree-" + n)
+                                        .undelegate(".jstree-" + n);
+                           // remove the actual data
+                              instances[n] = null;
+                           delete instances[n];
+                   },
+
+                    _core_notify : function (n, data) {
+                            if(data.opened) {
+                                      this.open_node(n, false, true);
+                                }
+                      },
+
+                    lock : function () {
+                           this.data.core.locked = true;
+                          this.get_container().children("ul").addClass("jstree-locked").css("opacity","0.7");
+                            this.__callback({});
+                   },
+                     unlock : function () {
+                         this.data.core.locked = false;
+                         this.get_container().children("ul").removeClass("jstree-locked").css("opacity","1");
+                           this.__callback({});
+                   },
+                     is_locked : function () { return this.data.core.locked; },
+                     save_opened : function () {
+                            var _this = this;
+                              this.data.core.to_open = [];
+                           this.get_container_ul().find("li.jstree-open").each(function () {
+                                      if(this.id) { _this.data.core.to_open.push("#" + this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")); }
+                             });
+                            this.__callback(_this.data.core.to_open);
+                      },
+                     save_loaded : function () { },
+                 reload_nodes : function (is_callback) {
+                                var _this = this,
+                                      done = true,
+                                   current = [],
+                                  remaining = [];
+                                if(!is_callback) {
+                                     this.data.core.reopen = false;
+                                 this.data.core.refreshing = true;
+                                      this.data.core.to_open = $.map($.makeArray(this.data.core.to_open), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
+                                   this.data.core.to_load = $.map($.makeArray(this.data.core.to_load), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
+                                   if(this.data.core.to_open.length) {
+                                            this.data.core.to_load = this.data.core.to_load.concat(this.data.core.to_open);
+                                        }
+                              }
+                              if(this.data.core.to_load.length) {
+                                    $.each(this.data.core.to_load, function (i, val) {
+                                             if(val == "#") { return true; }
+                                                if($(val).length) { current.push(val); }
+                                               else { remaining.push(val); }
+                                  });
+                                    if(current.length) {
+                                           this.data.core.to_load = remaining;
+                                            $.each(current, function (i, val) {
+                                                    if(!_this._is_loaded(val)) {
+                                                           _this.load_node(val, function () { _this.reload_nodes(true); }, function () { _this.reload_nodes(true); });
+                                                            done = false;
+                                                  }
+                                              });
+                                    }
+                              }
+                              if(this.data.core.to_open.length) {
+                                    $.each(this.data.core.to_open, function (i, val) {
+                                             _this.open_node(val, false, true);
+                                     });
+                            }
+                              if(done) {
+                                     // TODO: find a more elegant approach to syncronizing returning requests
+                                       if(this.data.core.reopen) { clearTimeout(this.data.core.reopen); }
+                                     this.data.core.reopen = setTimeout(function () { _this.__callback({}, _this); }, 50);
+                                  this.data.core.refreshing = false;
+                                     this.reopen();
+                         }
+                      },
+                     reopen : function () {
+                         var _this = this;
+                              if(this.data.core.to_open.length) {
+                                    $.each(this.data.core.to_open, function (i, val) {
+                                             _this.open_node(val, false, true);
+                                     });
+                            }
+                              this.__callback({});
+                   },
+                     refresh : function (obj) {
+                             var _this = this;
+                              this.save_opened();
+                            if(!obj) { obj = -1; }
+                         obj = this._get_node(obj);
+                             if(!obj) { obj = -1; }
+                         if(obj !== -1) { obj.children("UL").remove(); }
+                                else { this.get_container_ul().empty(); }
+                              this.load_node(obj, function () { _this.__callback({ "obj" : obj}); _this.reload_nodes(); });
+                  },
+                     // Dummy function to fire after the first load (so that there is a jstree.loaded event)
+                        loaded : function () {
+                         this.__callback();
+                     },
+                     // deal with focus
+                     set_focus : function () {
+                              if(this.is_focused()) { return; }
+                              var f = $.jstree._focused();
+                           if(f) { f.unset_focus(); }
+
+                            this.get_container().addClass("jstree-focused");
+                               focused_instance = this.get_index();
+                           this.__callback();
+                     },
+                     is_focused        : function () {
+                             return focused_instance == this.get_index();
+                   },
+                     unset_focus       : function () {
+                            if(this.is_focused()) {
+                                        this.get_container().removeClass("jstree-focused");
+                                    focused_instance = -1;
+                         }
+                              this.__callback();
+                     },
+
+                    // traverse
+                    _get_node          : function (obj) {
+                          var $obj = $(obj, this.get_container());
+                               if($obj.is(".jstree") || obj == -1) { return -1; }
+                             $obj = $obj.closest("li", this.get_container());
+                               return $obj.length ? $obj : false;
+                     },
+                     _get_next         : function (obj, strict) {
+                          obj = this._get_node(obj);
+                             if(obj === -1) { return this.get_container().find("> ul > li:first-child"); }
+                          if(!obj.length) { return false; }
+                              if(strict) { return (obj.nextAll("li").size() > 0) ? obj.nextAll("li:eq(0)") : false; }
+
+                               if(obj.hasClass("jstree-open")) { return obj.find("li:eq(0)"); }
+                               else if(obj.nextAll("li").size() > 0) { return obj.nextAll("li:eq(0)"); }
+                              else { return obj.parentsUntil(".jstree","li").next("li").eq(0); }
+                     },
+                     _get_prev         : function (obj, strict) {
+                          obj = this._get_node(obj);
+                             if(obj === -1) { return this.get_container().find("> ul > li:last-child"); }
+                           if(!obj.length) { return false; }
+                              if(strict) { return (obj.prevAll("li").length > 0) ? obj.prevAll("li:eq(0)") : false; }
+
+                               if(obj.prev("li").length) {
+                                    obj = obj.prev("li").eq(0);
+                                    while(obj.hasClass("jstree-open")) { obj = obj.children("ul:eq(0)").children("li:last"); }
+                                     return obj;
+                            }
+                              else { var o = obj.parentsUntil(".jstree","li:eq(0)"); return o.length ? o : false; }
+                  },
+                     _get_parent               : function (obj) {
+                                obj = this._get_node(obj);
+                             if(obj == -1 || !obj.length) { return false; }
+                         var o = obj.parentsUntil(".jstree", "li:eq(0)");
+                               return o.length ? o : -1;
+                      },
+                     _get_children     : function (obj) {
+                               obj = this._get_node(obj);
+                             if(obj === -1) { return this.get_container().children("ul:eq(0)").children("li"); }
+                            if(!obj.length) { return false; }
+                              return obj.children("ul:eq(0)").children("li");
+                        },
+                     get_path          : function (obj, id_mode) {
+                          var p = [],
+                                    _this = this;
+                          obj = this._get_node(obj);
+                             if(obj === -1 || !obj || !obj.length) { return false; }
+                                obj.parentsUntil(".jstree", "li").each(function () {
+                                   p.push( id_mode ? this.id : _this.get_text(this) );
+                            });
+                            p.reverse();
+                           p.push( id_mode ? obj.attr("id") : this.get_text(obj) );
+                               return p;
+                      },
+
+                    // string functions
+                    _get_string : function (key) {
+                         return this._get_settings().core.strings[key] || key;
+                  },
+
+                    is_open            : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-open"); },
+                     is_closed : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-closed"); },
+                  is_leaf              : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-leaf"); },
+                     correct_state     : function (obj) {
+                               obj = this._get_node(obj);
+                             if(!obj || obj === -1) { return false; }
+                               obj.removeClass("jstree-closed jstree-open").addClass("jstree-leaf").children("ul").remove();
+                          this.__callback({ "obj" : obj });
+                      },
+                     // open/close
+                  open_node    : function (obj, callback, skip_animation) {
+                         obj = this._get_node(obj);
+                             if(!obj.length) { return false; }
+                              if(!obj.hasClass("jstree-closed")) { if(callback) { callback.call(); } return false; }
+                         var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation,
+                                    t = this;
+                              if(!this._is_loaded(obj)) {
+                                    obj.children("a").addClass("jstree-loading");
+                                  this.load_node(obj, function () { t.open_node(obj, callback, skip_animation); }, callback);
+                            }
+                              else {
+                                 if(this._get_settings().core.open_parents) {
+                                           obj.parentsUntil(".jstree",".jstree-closed").each(function () {
+                                                        t.open_node(this, false, true);
+                                                });
+                                    }
+                                      if(s) { obj.children("ul").css("display","none"); }
+                                    obj.removeClass("jstree-closed").addClass("jstree-open").children("a").removeClass("jstree-loading");
+                                  if(s) { obj.children("ul").stop(true, true).slideDown(s, function () { this.style.display = ""; t.after_open(obj); }); }
+                                       else { t.after_open(obj); }
+                                    this.__callback({ "obj" : obj });
+                                      if(callback) { callback.call(); }
+                              }
+                      },
+                     after_open        : function (obj) { this.__callback({ "obj" : obj }); },
+                     close_node        : function (obj, skip_animation) {
+                          obj = this._get_node(obj);
+                             var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation,
+                                    t = this;
+                              if(!obj.length || !obj.hasClass("jstree-open")) { return false; }
+                              if(s) { obj.children("ul").attr("style","display:block !important"); }
+                         obj.removeClass("jstree-open").addClass("jstree-closed");
+                              if(s) { obj.children("ul").stop(true, true).slideUp(s, function () { this.style.display = ""; t.after_close(obj); }); }
+                                else { t.after_close(obj); }
+                           this.__callback({ "obj" : obj });
+                      },
+                     after_close       : function (obj) { this.__callback({ "obj" : obj }); },
+                    toggle_node        : function (obj) {
+                         obj = this._get_node(obj);
+                             if(obj.hasClass("jstree-closed")) { return this.open_node(obj); }
+                              if(obj.hasClass("jstree-open")) { return this.close_node(obj); }
+                       },
+                     open_all  : function (obj, do_animation, original_obj) {
+                                obj = obj ? this._get_node(obj) : -1;
+                          if(!obj || obj === -1) { obj = this.get_container_ul(); }
+                              if(original_obj) {
+                                     obj = obj.find("li.jstree-closed");
+                            }
+                              else {
+                                 original_obj = obj;
+                                    if(obj.is(".jstree-closed")) { obj = obj.find("li.jstree-closed").andSelf(); }
+                                 else { obj = obj.find("li.jstree-closed"); }
+                           }
+                              var _this = this;
+                              obj.each(function () {
+                                 var __this = this;
+                                     if(!_this._is_loaded(this)) { _this.open_node(this, function() { _this.open_all(__this, do_animation, original_obj); }, !do_animation); }
+                                      else { _this.open_node(this, false, !do_animation); }
+                          });
+                            // so that callback is fired AFTER all nodes are open
+                          if(original_obj.find('li.jstree-closed').length === 0) { this.__callback({ "obj" : original_obj }); }
+                  },
+                     close_all : function (obj, do_animation) {
+                             var _this = this;
+                              obj = obj ? this._get_node(obj) : this.get_container();
+                                if(!obj || obj === -1) { obj = this.get_container_ul(); }
+                              obj.find("li.jstree-open").andSelf().each(function () { _this.close_node(this, !do_animation); });
+                             this.__callback({ "obj" : obj });
+                      },
+                     clean_node        : function (obj) {
+                          obj = obj && obj != -1 ? $(obj) : this.get_container_ul();
+                             obj = obj.is("li") ? obj.find("li").andSelf() : obj.find("li");
+                                obj.removeClass("jstree-last")
+                                 .filter("li:last-child").addClass("jstree-last").end()
+                                 .filter(":has(li)")
+                                            .not(".jstree-open").removeClass("jstree-leaf").addClass("jstree-closed");
+                             obj.not(".jstree-open, .jstree-closed").addClass("jstree-leaf").children("ul").remove();
+                               this.__callback({ "obj" : obj });
+                      },
+                     // rollback
+                    get_rollback : function () {
+                           this.__callback();
+                             return { i : this.get_index(), h : this.get_container().children("ul").clone(true), d : this.data };
+                   },
+                     set_rollback : function (html, data) {
+                         this.get_container().empty().append(html);
+                             this.data = data;
+                              this.__callback();
+                     },
+                     // Dummy functions to be overwritten by any datastore plugin included
+                  load_node    : function (obj, s_call, e_call) { this.__callback({ "obj" : obj }); },
+                      _is_loaded       : function (obj) { return true; },
+
+                 // Basic operations: create
+                    create_node        : function (obj, position, js, callback, is_loaded) {
+                              obj = this._get_node(obj);
+                             position = typeof position === "undefined" ? "last" : position;
+                                var d = $("<li />"),
+                                   s = this._get_settings().core,
+                                 tmp;
+
+                          if(obj !== -1 && !obj.length) { return false; }
+                                if(!is_loaded && !this._is_loaded(obj)) { this.load_node(obj, function () { this.create_node(obj, position, js, callback, true); }); return false; }
+
+                          this.__rollback();
+
+                            if(typeof js === "string") { js = { "data" : js }; }
+                           if(!js) { js = {}; }
+                           if(js.attr) { d.attr(js.attr); }
+                               if(js.metadata) { d.data(js.metadata); }
+                               if(js.state) { d.addClass("jstree-" + js.state); }
+                             if(!js.data) { js.data = this._get_string("new_node"); }
+                               if(!$.isArray(js.data)) { tmp = js.data; js.data = []; js.data.push(tmp); }
+                            $.each(js.data, function (i, m) {
+                                      tmp = $("<a />");
+                                      if($.isFunction(m)) { m = m.call(this, js); }
+                                  if(typeof m == "string") { tmp.attr('href','#')[ s.html_titles ? "html" : "text" ](m); }
+                                       else {
+                                         if(!m.attr) { m.attr = {}; }
+                                           if(!m.attr.href) { m.attr.href = '#'; }
+                                                tmp.attr(m.attr)[ s.html_titles ? "html" : "text" ](m.title);
+                                          if(m.language) { tmp.addClass(m.language); }
+                                   }
+                                      tmp.prepend("<ins class='jstree-icon'>&#160;</ins>");
+                                  if(!m.icon && js.icon) { m.icon = js.icon; }
+                                   if(m.icon) {
+                                           if(m.icon.indexOf("/") === -1) { tmp.children("ins").addClass(m.icon); }
+                                               else { tmp.children("ins").css("background","url('" + m.icon + "') center center no-repeat"); }
+                                        }
+                                      d.append(tmp);
+                         });
+                            d.prepend("<ins class='jstree-icon'>&#160;</ins>");
+                            if(obj === -1) {
+                                       obj = this.get_container();
+                                    if(position === "before") { position = "first"; }
+                                      if(position === "after") { position = "last"; }
+                                }
+                              switch(position) {
+                                     case "before": obj.before(d); tmp = this._get_parent(obj); break;
+                                      case "after" : obj.after(d);  tmp = this._get_parent(obj); break;
+                                      case "inside":
+                                 case "first" :
+                                         if(!obj.children("ul").length) { obj.append("<ul />"); }
+                                               obj.children("ul").prepend(d);
+                                         tmp = obj;
+                                             break;
+                                 case "last":
+                                           if(!obj.children("ul").length) { obj.append("<ul />"); }
+                                               obj.children("ul").append(d);
+                                          tmp = obj;
+                                             break;
+                                 default:
+                                               if(!obj.children("ul").length) { obj.append("<ul />"); }
+                                               if(!position) { position = 0; }
+                                                tmp = obj.children("ul").children("li").eq(position);
+                                          if(tmp.length) { tmp.before(d); }
+                                              else { obj.children("ul").append(d); }
+                                         tmp = obj;
+                                             break;
+                         }
+                              if(tmp === -1 || tmp.get(0) === this.get_container().get(0)) { tmp = -1; }
+                             this.clean_node(tmp);
+                          this.__callback({ "obj" : d, "parent" : tmp });
+                                if(callback) { callback.call(this, d); }
+                               return d;
+                      },
+                     // Basic operations: rename (deal with text)
+                   get_text    : function (obj) {
+                            obj = this._get_node(obj);
+                             if(!obj.length) { return false; }
+                              var s = this._get_settings().core.html_titles;
+                         obj = obj.children("a:eq(0)");
+                         if(s) {
+                                        obj = obj.clone();
+                                     obj.children("INS").remove();
+                                  return obj.html();
+                             }
+                              else {
+                                 obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
+                                     return obj.nodeValue;
+                          }
+                      },
+                     set_text  : function (obj, val) {
+                               obj = this._get_node(obj);
+                             if(!obj.length) { return false; }
+                              obj = obj.children("a:eq(0)");
+                         if(this._get_settings().core.html_titles) {
+                                    var tmp = obj.children("INS").clone();
+                                 obj.html(val).prepend(tmp);
+                                    this.__callback({ "obj" : obj, "name" : val });
+                                        return true;
+                           }
+                              else {
+                                 obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
+                                     this.__callback({ "obj" : obj, "name" : val });
+                                        return (obj.nodeValue = val);
+                          }
+                      },
+                     rename_node : function (obj, val) {
+                            obj = this._get_node(obj);
+                             this.__rollback();
+                             if(obj && obj.length && this.set_text.apply(this, Array.prototype.slice.call(arguments))) { this.__callback({ "obj" : obj, "name" : val }); }
+                  },
+                     // Basic operations: deleting nodes
+                    delete_node : function (obj) {
+                         obj = this._get_node(obj);
+                             if(!obj.length) { return false; }
+                              this.__rollback();
+                             var p = this._get_parent(obj), prev = $([]), t = this;
+                         obj.each(function () {
+                                 prev = prev.add(t._get_prev(this));
+                            });
+                            obj = obj.detach();
+                            if(p !== -1 && p.find("> ul > li").length === 0) {
+                                     p.removeClass("jstree-open jstree-closed").addClass("jstree-leaf");
+                            }
+                              this.clean_node(p);
+                            this.__callback({ "obj" : obj, "prev" : prev, "parent" : p });
+                         return obj;
+                    },
+                     prepare_move : function (o, r, pos, cb, is_cb) {
+                               var p = {};
+
+                           p.ot = $.jstree._reference(o) || this;
+                         p.o = p.ot._get_node(o);
+                               p.r = r === - 1 ? -1 : this._get_node(r);
+                              p.p = (typeof pos === "undefined" || pos === false) ? "last" : pos; // TODO: move to a setting
+                         if(!is_cb && prepared_move.o && prepared_move.o[0] === p.o[0] && prepared_move.r[0] === p.r[0] && prepared_move.p === p.p) {
+                                   this.__callback(prepared_move);
+                                        if(cb) { cb.call(this, prepared_move); }
+                                       return;
+                                }
+                              p.ot = $.jstree._reference(p.o) || this;
+                               p.rt = $.jstree._reference(p.r) || this; // r === -1 ? p.ot : $.jstree._reference(p.r) || this
+                         if(p.r === -1 || !p.r) {
+                                       p.cr = -1;
+                                     switch(p.p) {
+                                          case "first":
+                                          case "before":
+                                         case "inside":
+                                                 p.cp = 0;
+                                                      break;
+                                         case "after":
+                                          case "last":
+                                                   p.cp = p.rt.get_container().find(" > ul > li").length;
+                                                 break;
+                                         default:
+                                                       p.cp = p.p;
+                                                    break;
+                                 }
+                              }
+                              else {
+                                 if(!/^(before|after)$/.test(p.p) && !this._is_loaded(p.r)) {
+                                           return this.load_node(p.r, function () { this.prepare_move(o, r, pos, cb, true); });
+                                   }
+                                      switch(p.p) {
+                                          case "before":
+                                                 p.cp = p.r.index();
+                                                    p.cr = p.rt._get_parent(p.r);
+                                                  break;
+                                         case "after":
+                                                  p.cp = p.r.index() + 1;
+                                                        p.cr = p.rt._get_parent(p.r);
+                                                  break;
+                                         case "inside":
+                                         case "first":
+                                                  p.cp = 0;
+                                                      p.cr = p.r;
+                                                    break;
+                                         case "last":
+                                                   p.cp = p.r.find(" > ul > li").length;
+                                                  p.cr = p.r;
+                                                    break;
+                                         default:
+                                                       p.cp = p.p;
+                                                    p.cr = p.r;
+                                                    break;
+                                 }
+                              }
+                              p.np = p.cr == -1 ? p.rt.get_container() : p.cr;
+                               p.op = p.ot._get_parent(p.o);
+                          p.cop = p.o.index();
+                           if(p.op === -1) { p.op = p.ot ? p.ot.get_container() : this.get_container(); }
+                         if(!/^(before|after)$/.test(p.p) && p.op && p.np && p.op[0] === p.np[0] && p.o.index() < p.cp) { p.cp++; }
+                             //if(p.p === "before" && p.op && p.np && p.op[0] === p.np[0] && p.o.index() < p.cp) { p.cp--; }
+                                p.or = p.np.find(" > ul > li:nth-child(" + (p.cp + 1) + ")");
+                          prepared_move = p;
+                             this.__callback(prepared_move);
+                                if(cb) { cb.call(this, prepared_move); }
+                       },
+                     check_move : function () {
+                             var obj = prepared_move, ret = true, r = obj.r === -1 ? this.get_container() : obj.r;
+                          if(!obj || !obj.o || obj.or[0] === obj.o[0]) { return false; }
+                         if(obj.op && obj.np && obj.op[0] === obj.np[0] && obj.cp - 1 === obj.o.index()) { return false; }
+                              obj.o.each(function () {
+                                       if(r.parentsUntil(".jstree", "li").andSelf().index(this) !== -1) { ret = false; return false; }
+                                });
+                            return ret;
+                    },
+                     move_node : function (obj, ref, position, is_copy, is_prepared, skip_check) {
+                          if(!is_prepared) {
+                                     return this.prepare_move(obj, ref, position, function (p) {
+                                            this.move_node(p, false, false, is_copy, true, skip_check);
+                                    });
+                            }
+                              if(is_copy) {
+                                  prepared_move.cy = true;
+                               }
+                              if(!skip_check && !this.check_move()) { return false; }
+
+                               this.__rollback();
+                             var o = false;
+                         if(is_copy) {
+                                  o = obj.o.clone(true);
+                                 o.find("*[id]").andSelf().each(function () {
+                                           if(this.id) { this.id = "copy_" + this.id; }
+                                   });
+                            }
+                              else { o = obj.o; }
+
+                           if(obj.or.length) { obj.or.before(o); }
+                                else {
+                                 if(!obj.np.children("ul").length) { $("<ul />").appendTo(obj.np); }
+                                    obj.np.children("ul:eq(0)").append(o);
+                         }
+
+                             try {
+                                  obj.ot.clean_node(obj.op);
+                                     obj.rt.clean_node(obj.np);
+                                     if(!obj.op.find("> ul > li").length) {
+                                         obj.op.removeClass("jstree-open jstree-closed").addClass("jstree-leaf").children("ul").remove();
+                                       }
+                              } catch (e) { }
+
+                               if(is_copy) {
+                                  prepared_move.cy = true;
+                                       prepared_move.oc = o;
+                          }
+                              this.__callback(prepared_move);
+                                return prepared_move;
+                  },
+                     _get_move : function () { return prepared_move; }
+              }
+      });
+})(jQuery);
+//*/
+
+/*
+ * jsTree ui plugin
+ * This plugins handles selecting/deselecting/hovering/dehovering nodes
+ */
+(function ($) {
+       var scrollbar_width, e1, e2;
+   $(function() {
+         if (/msie/.test(navigator.userAgent.toLowerCase())) {
+                  e1 = $('<textarea cols="10" rows="2"></textarea>').css({ position: 'absolute', top: -1000, left: 0 }).appendTo('body');
+                        e2 = $('<textarea cols="10" rows="2" style="overflow: hidden;"></textarea>').css({ position: 'absolute', top: -1000, left: 0 }).appendTo('body');
+                      scrollbar_width = e1.width() - e2.width();
+                     e1.add(e2).remove();
+           }
+              else {
+                 e1 = $('<div />').css({ width: 100, height: 100, overflow: 'auto', position: 'absolute', top: -1000, left: 0 })
+                                        .prependTo('body').append('<div />').find('div').css({ width: '100%', height: 200 });
+                  scrollbar_width = 100 - e1.width();
+                    e1.parent().remove();
+          }
+      });
+    $.jstree.plugin("ui", {
+                __init : function () {
+                 this.data.ui.selected = $();
+                   this.data.ui.last_selected = false;
+                    this.data.ui.hovered = null;
+                   this.data.ui.to_select = this.get_settings().ui.initially_select;
+
+                     this.get_container()
+                           .delegate("a", "click.jstree", $.proxy(function (event) {
+                                              event.preventDefault();
+                                                event.currentTarget.blur();
+                                            if(!$(event.currentTarget).hasClass("jstree-loading")) {
+                                                       this.select_node(event.currentTarget, true, event);
+                                            }
+                                      }, this))
+                              .delegate("a", "mouseenter.jstree", $.proxy(function (event) {
+                                         if(!$(event.currentTarget).hasClass("jstree-loading")) {
+                                                       this.hover_node(event.target);
+                                         }
+                                      }, this))
+                              .delegate("a", "mouseleave.jstree", $.proxy(function (event) {
+                                         if(!$(event.currentTarget).hasClass("jstree-loading")) {
+                                                       this.dehover_node(event.target);
+                                               }
+                                      }, this))
+                              .bind("reopen.jstree", $.proxy(function () {
+                                           this.reselect();
+                                       }, this))
+                              .bind("get_rollback.jstree", $.proxy(function () {
+                                             this.dehover_node();
+                                           this.save_selected();
+                                  }, this))
+                              .bind("set_rollback.jstree", $.proxy(function () {
+                                             this.reselect();
+                                       }, this))
+                              .bind("close_node.jstree", $.proxy(function (event, data) {
+                                            var s = this._get_settings().ui,
+                                                       obj = this._get_node(data.rslt.obj),
+                                                   clk = (obj && obj.length) ? obj.children("ul").find("a.jstree-clicked") : $(),
+                                                 _this = this;
+                                          if(s.selected_parent_close === false || !clk.length) { return; }
+                                               clk.each(function () {
+                                                 _this.deselect_node(this);
+                                                     if(s.selected_parent_close === "select_parent") { _this.select_node(obj); }
+                                            });
+                                    }, this))
+                              .bind("delete_node.jstree", $.proxy(function (event, data) {
+                                           var s = this._get_settings().ui.select_prev_on_delete,
+                                                 obj = this._get_node(data.rslt.obj),
+                                                   clk = (obj && obj.length) ? obj.find("a.jstree-clicked") : [],
+                                                 _this = this;
+                                          clk.each(function () { _this.deselect_node(this); });
+                                          if(s && clk.length) {
+                                                  data.rslt.prev.each(function () {
+                                                              if(this.parentNode) { _this.select_node(this); return false; /* if return false is removed all prev nodes will be selected */}
+                                                 });
+                                            }
+                                      }, this))
+                              .bind("move_node.jstree", $.proxy(function (event, data) {
+                                             if(data.rslt.cy) {
+                                                     data.rslt.oc.find("a.jstree-clicked").removeClass("jstree-clicked");
+                                           }
+                                      }, this));
+             },
+             defaults : {
+                   select_limit : -1, // 0, 1, 2 ... or -1 for unlimited
+                  select_multiple_modifier : "ctrl", // on, or ctrl, shift, alt
+                  select_range_modifier : "shift",
+                       selected_parent_close : "select_parent", // false, "deselect", "select_parent"
+                 selected_parent_open : true,
+                   select_prev_on_delete : true,
+                  disable_selecting_children : false,
+                    initially_select : []
+          },
+             _fn : {
+                        _get_node : function (obj, allow_multiple) {
+                           if(typeof obj === "undefined" || obj === null) { return allow_multiple ? this.data.ui.selected : this.data.ui.last_selected; }
+                         var $obj = $(obj, this.get_container());
+                               if($obj.is(".jstree") || obj == -1) { return -1; }
+                             $obj = $obj.closest("li", this.get_container());
+                               return $obj.length ? $obj : false;
+                     },
+                     _ui_notify : function (n, data) {
+                              if(data.selected) {
+                                    this.select_node(n, false);
+                            }
+                      },
+                     save_selected : function () {
+                          var _this = this;
+                              this.data.ui.to_select = [];
+                           this.data.ui.selected.each(function () { if(this.id) { _this.data.ui.to_select.push("#" + this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")); } });
+                                this.__callback(this.data.ui.to_select);
+                       },
+                     reselect : function () {
+                               var _this = this,
+                                      s = this.data.ui.to_select;
+                            s = $.map($.makeArray(s), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
+                             // this.deselect_all(); WHY deselect, breaks plugin state notifier?
+                            $.each(s, function (i, val) { if(val && val !== "#") { _this.select_node(val); } });
+                           this.data.ui.selected = this.data.ui.selected.filter(function () { return this.parentNode; });
+                         this.__callback();
+                     },
+                     refresh : function (obj) {
+                             this.save_selected();
+                          return this.__call_old();
+                      },
+                     hover_node : function (obj) {
+                          obj = this._get_node(obj);
+                             if(!obj.length) { return false; }
+                              //if(this.data.ui.hovered && obj.get(0) === this.data.ui.hovered.get(0)) { return; }
+                           if(!obj.hasClass("jstree-hovered")) { this.dehover_node(); }
+                           this.data.ui.hovered = obj.children("a").addClass("jstree-hovered").parent();
+                          this._fix_scroll(obj);
+                         this.__callback({ "obj" : obj });
+                      },
+                     dehover_node : function () {
+                           var obj = this.data.ui.hovered, p;
+                             if(!obj || !obj.length) { return false; }
+                              p = obj.children("a").removeClass("jstree-hovered").parent();
+                          if(this.data.ui.hovered[0] === p[0]) { this.data.ui.hovered = null; }
+                          this.__callback({ "obj" : obj });
+                      },
+                     select_node : function (obj, check, e) {
+                               obj = this._get_node(obj);
+                             if(obj == -1 || !obj || !obj.length) { return false; }
+                         var s = this._get_settings().ui,
+                                       is_multiple = (s.select_multiple_modifier == "on" || (s.select_multiple_modifier !== false && e && e[s.select_multiple_modifier + "Key"])),
+                                    is_range = (s.select_range_modifier !== false && e && e[s.select_range_modifier + "Key"] && this.data.ui.last_selected && this.data.ui.last_selected[0] !== obj[0] && this.data.ui.last_selected.parent()[0] === obj.parent()[0]),
+                                     is_selected = this.is_selected(obj),
+                                   proceed = true,
+                                        t = this;
+                              if(check) {
+                                    if(s.disable_selecting_children && is_multiple &&
+                                              (
+                                                      (obj.parentsUntil(".jstree","li").children("a.jstree-clicked").length) ||
+                                                      (obj.children("ul").find("a.jstree-clicked:eq(0)").length)
+                                             )
+                                      ) {
+                                            return false;
+                                  }
+                                      proceed = false;
+                                       switch(!0) {
+                                           case (is_range):
+                                                       this.data.ui.last_selected.addClass("jstree-last-selected");
+                                                   obj = obj[ obj.index() < this.data.ui.last_selected.index() ? "nextUntil" : "prevUntil" ](".jstree-last-selected").andSelf();
+                                                  if(s.select_limit == -1 || obj.length < s.select_limit) {
+                                                              this.data.ui.last_selected.removeClass("jstree-last-selected");
+                                                                this.data.ui.selected.each(function () {
+                                                                       if(this !== t.data.ui.last_selected[0]) { t.deselect_node(this); }
+                                                             });
+                                                            is_selected = false;
+                                                           proceed = true;
+                                                        }
+                                                      else {
+                                                         proceed = false;
+                                                       }
+                                                      break;
+                                         case (is_selected && !is_multiple):
+                                                    this.deselect_all();
+                                                   is_selected = false;
+                                                   proceed = true;
+                                                        break;
+                                         case (!is_selected && !is_multiple):
+                                                   if(s.select_limit == -1 || s.select_limit > 0) {
+                                                               this.deselect_all();
+                                                           proceed = true;
+                                                        }
+                                                      break;
+                                         case (is_selected && is_multiple):
+                                                     this.deselect_node(obj);
+                                                       break;
+                                         case (!is_selected && is_multiple):
+                                                    if(s.select_limit == -1 || this.data.ui.selected.length + 1 <= s.select_limit) {
+                                                               proceed = true;
+                                                        }
+                                                      break;
+                                 }
+                              }
+                              if(proceed && !is_selected) {
+                                  if(!is_range) { this.data.ui.last_selected = obj; }
+                                    obj.children("a").addClass("jstree-clicked");
+                                  if(s.selected_parent_open) {
+                                           obj.parents(".jstree-closed").each(function () { t.open_node(this, false, true); });
+                                   }
+                                      this.data.ui.selected = this.data.ui.selected.add(obj);
+                                        this._fix_scroll(obj.eq(0));
+                                   this.__callback({ "obj" : obj, "e" : e });
+                             }
+                      },
+                     _fix_scroll : function (obj) {
+                         var c = this.get_container()[0], t;
+                            if(c.scrollHeight > c.offsetHeight) {
+                                  obj = this._get_node(obj);
+                                     if(!obj || obj === -1 || !obj.length || !obj.is(":visible")) { return; }
+                                       t = obj.offset().top - this.get_container().offset().top;
+                                      if(t < 0) {
+                                            c.scrollTop = c.scrollTop + t - 1;
+                                     }
+                                      if(t + this.data.core.li_height + (c.scrollWidth > c.offsetWidth ? scrollbar_width : 0) > c.offsetHeight) {
+                                            c.scrollTop = c.scrollTop + (t - c.offsetHeight + this.data.core.li_height + 1 + (c.scrollWidth > c.offsetWidth ? scrollbar_width : 0));
+                                       }
+                              }
+                      },
+                     deselect_node : function (obj) {
+                               obj = this._get_node(obj);
+                             if(!obj.length) { return false; }
+                              if(this.is_selected(obj)) {
+                                    obj.children("a").removeClass("jstree-clicked");
+                                       this.data.ui.selected = this.data.ui.selected.not(obj);
+                                        if(this.data.ui.last_selected.get(0) === obj.get(0)) { this.data.ui.last_selected = this.data.ui.selected.eq(0); }
+                                     this.__callback({ "obj" : obj });
+                              }
+                      },
+                     toggle_select : function (obj) {
+                               obj = this._get_node(obj);
+                             if(!obj.length) { return false; }
+                              if(this.is_selected(obj)) { this.deselect_node(obj); }
+                         else { this.select_node(obj); }
+                        },
+                     is_selected : function (obj) { return this.data.ui.selected.index(this._get_node(obj)) >= 0; },
+                        get_selected : function (context) {
+                            return context ? $(context).find("a.jstree-clicked").parent() : this.data.ui.selected;
+                 },
+                     deselect_all : function (context) {
+                            var ret = context ? $(context).find("a.jstree-clicked").parent() : this.get_container().find("a.jstree-clicked").parent();
+                             ret.children("a.jstree-clicked").removeClass("jstree-clicked");
+                                this.data.ui.selected = $([]);
+                         this.data.ui.last_selected = false;
+                            this.__callback({ "obj" : ret });
+                      }
+              }
+      });
+    // include the selection plugin by default
+     $.jstree.defaults.plugins.push("ui");
+})(jQuery);
+//*/
+
+/*
+ * jsTree CRRM plugin
+ * Handles creating/renaming/removing/moving nodes by user interaction.
+ */
+(function ($) {
+   $.jstree.plugin("crrm", {
+              __init : function () {
+                 this.get_container()
+                           .bind("move_node.jstree", $.proxy(function (e, data) {
+                                 if(this._get_settings().crrm.move.open_onmove) {
+                                               var t = this;
+                                          data.rslt.np.parentsUntil(".jstree").andSelf().filter(".jstree-closed").each(function () {
+                                                     t.open_node(this, false, true);
+                                                });
+                                    }
+                              }, this));
+             },
+             defaults : {
+                   input_width_limit : 200,
+                       move : {
+                               always_copy                     : false, // false, true or "multitree"
+                           open_onmove                 : true,
+                          default_position     : "last",
+                             check_move                        : function (m) { return true; }
+                   }
+              },
+             _fn : {
+                        _show_input : function (obj, callback) {
+                               obj = this._get_node(obj);
+                             var rtl = this._get_settings().core.rtl,
+                                       w = this._get_settings().crrm.input_width_limit,
+                                       w1 = obj.children("ins").width(),
+                                      w2 = obj.find("> a:visible > ins").width() * obj.find("> a:visible > ins").length,
+                                     t = this.get_text(obj),
+                                        h1 = $("<div />", { css : { "position" : "absolute", "top" : "-200px", "left" : (rtl ? "0px" : "-1000px"), "visibility" : "hidden" } }).appendTo("body"),
+                                      h2 = obj.css("position","relative").append(
+                                    $("<input />", {
+                                               "value" : t,
+                                           "class" : "jstree-rename-input",
+                                               // "size" : t.length,
+                                          "css" : {
+                                                      "padding" : "0",
+                                                       "border" : "1px solid silver",
+                                                 "position" : "absolute",
+                                                       "left"  : (rtl ? "auto" : (w1 + w2 + 4) + "px"),
+                                                       "right" : (rtl ? (w1 + w2 + 4) + "px" : "auto"),
+                                                       "top" : "0px",
+                                                 "height" : (this.data.core.li_height - 2) + "px",
+                                                      "lineHeight" : (this.data.core.li_height - 2) + "px",
+                                                  "width" : "150px" // will be set a bit further down
+                                            },
+                                             "blur" : $.proxy(function () {
+                                                 var i = obj.children(".jstree-rename-input"),
+                                                          v = i.val();
+                                                   if(v === "") { v = t; }
+                                                        h1.remove();
+                                                   i.remove(); // rollback purposes
+                                                       this.set_text(obj,t); // rollback purposes
+                                                     this.rename_node(obj, v);
+                                                      callback.call(this, obj, v, t);
+                                                        obj.css("position","");
+                                                }, this),
+                                              "keyup" : function (event) {
+                                                   var key = event.keyCode || event.which;
+                                                        if(key == 27) { this.value = t; this.blur(); return; }
+                                                 else if(key == 13) { this.blur(); return; }
+                                                    else {
+                                                         h2.width(Math.min(h1.text("pW" + this.value).width(),w));
+                                                      }
+                                              },
+                                             "keypress" : function(event) {
+                                                 var key = event.keyCode || event.which;
+                                                        if(key == 13) { return false; }
+                                                }
+                                      })
+                             ).children(".jstree-rename-input");
+                            this.set_text(obj, "");
+                                h1.css({
+                                               fontFamily              : h2.css('fontFamily')          || '',
+                                             fontSize          : h2.css('fontSize')            || '',
+                                         fontWeight            : h2.css('fontWeight')          || '',
+                                             fontStyle         : h2.css('fontStyle')           || '',
+                                               fontStretch             : h2.css('fontStretch')         || '',
+                                           fontVariant         : h2.css('fontVariant')         || '',
+                                           letterSpacing       : h2.css('letterSpacing')       || '',
+                                         wordSpacing           : h2.css('wordSpacing')         || ''
+                            });
+                            h2.width(Math.min(h1.text("pW" + h2[0].value).width(),w))[0].select();
+                 },
+                     rename : function (obj) {
+                              obj = this._get_node(obj);
+                             this.__rollback();
+                             var f = this.__callback;
+                               this._show_input(obj, function (obj, new_name, old_name) {
+                                     f.call(this, { "obj" : obj, "new_name" : new_name, "old_name" : old_name });
+                           });
+                    },
+                     create : function (obj, position, js, callback, skip_rename) {
+                         var t, _this = this;
+                           obj = this._get_node(obj);
+                             if(!obj) { obj = -1; }
+                         this.__rollback();
+                             t = this.create_node(obj, position, js, function (t) {
+                                 var p = this._get_parent(t),
+                                           pos = $(t).index();
+                                    if(callback) { callback.call(this, t); }
+                                       if(p.length && p.hasClass("jstree-closed")) { this.open_node(p, false, true); }
+                                        if(!skip_rename) {
+                                             this._show_input(t, function (obj, new_name, old_name) {
+                                                       _this.__callback({ "obj" : obj, "name" : new_name, "parent" : p, "position" : pos });
+                                          });
+                                    }
+                                      else { _this.__callback({ "obj" : t, "name" : this.get_text(t), "parent" : p, "position" : pos }); }
+                           });
+                            return t;
+                      },
+                     remove : function (obj) {
+                              obj = this._get_node(obj, true);
+                               var p = this._get_parent(obj), prev = this._get_prev(obj);
+                             this.__rollback();
+                             obj = this.delete_node(obj);
+                           if(obj !== false) { this.__callback({ "obj" : obj, "prev" : prev, "parent" : p }); }
+                   },
+                     check_move : function () {
+                             if(!this.__call_old()) { return false; }
+                               var s = this._get_settings().crrm.move;
+                                if(!s.check_move.call(this, this._get_move())) { return false; }
+                               return true;
+                   },
+                     move_node : function (obj, ref, position, is_copy, is_prepared, skip_check) {
+                          var s = this._get_settings().crrm.move;
+                                if(!is_prepared) {
+                                     if(typeof position === "undefined") { position = s.default_position; }
+                                 if(position === "inside" && !s.default_position.match(/^(before|after)$/)) { position = s.default_position; }
+                                  return this.__call_old(true, obj, ref, position, is_copy, false, skip_check);
+                          }
+                              // if the move is already prepared
+                             if(s.always_copy === true || (s.always_copy === "multitree" && obj.rt.get_index() !== obj.ot.get_index() )) {
+                                  is_copy = true;
+                                }
+                              this.__call_old(true, obj, ref, position, is_copy, true, skip_check);
+                  },
+
+                    cut : function (obj) {
+                         obj = this._get_node(obj, true);
+                               if(!obj || !obj.length) { return false; }
+                              this.data.crrm.cp_nodes = false;
+                               this.data.crrm.ct_nodes = obj;
+                         this.__callback({ "obj" : obj });
+                      },
+                     copy : function (obj) {
+                                obj = this._get_node(obj, true);
+                               if(!obj || !obj.length) { return false; }
+                              this.data.crrm.ct_nodes = false;
+                               this.data.crrm.cp_nodes = obj;
+                         this.__callback({ "obj" : obj });
+                      },
+                     paste : function (obj) {
+                               obj = this._get_node(obj);
+                             if(!obj || !obj.length) { return false; }
+                              var nodes = this.data.crrm.ct_nodes ? this.data.crrm.ct_nodes : this.data.crrm.cp_nodes;
+                               if(!this.data.crrm.ct_nodes && !this.data.crrm.cp_nodes) { return false; }
+                             if(this.data.crrm.ct_nodes) { this.move_node(this.data.crrm.ct_nodes, obj); this.data.crrm.ct_nodes = false; }
+                         if(this.data.crrm.cp_nodes) { this.move_node(this.data.crrm.cp_nodes, obj, false, true); }
+                             this.__callback({ "obj" : obj, "nodes" : nodes });
+                     }
+              }
+      });
+    // include the crr plugin by default
+   // $.jstree.defaults.plugins.push("crrm");
+})(jQuery);
+//*/
+
+/*
+ * jsTree themes plugin
+ * Handles loading and setting themes, as well as detecting path to themes, etc.
+ */
+(function ($) {
+   var themes_loaded = [];
+        // this variable stores the path to the themes folder - if left as false - it will be autodetected
+     $.jstree._themes = false;
+      $.jstree.plugin("themes", {
+            __init : function () {
+                 this.get_container()
+                           .bind("init.jstree", $.proxy(function () {
+                                             var s = this._get_settings().themes;
+                                           this.data.themes.dots = s.dots;
+                                                this.data.themes.icons = s.icons;
+                                              this.set_theme(s.theme, s.url);
+                                        }, this))
+                              .bind("loaded.jstree", $.proxy(function () {
+                                           // bound here too, as simple HTML tree's won't honor dots & icons otherwise
+                                            if(!this.data.themes.dots) { this.hide_dots(); }
+                                               else { this.show_dots(); }
+                                             if(!this.data.themes.icons) { this.hide_icons(); }
+                                             else { this.show_icons(); }
+                                    }, this));
+             },
+             defaults : {
+                   theme : "default",
+                     url : false,
+                   dots : true,
+                   icons : true
+           },
+             _fn : {
+                        set_theme : function (theme_name, theme_url) {
+                         if(!theme_name) { return false; }
+                              if(!theme_url) { theme_url = $.jstree._themes + theme_name + '/style.css'; }
+                           if($.inArray(theme_url, themes_loaded) == -1) {
+                                        $.vakata.css.add_sheet({ "url" : theme_url });
+                                 themes_loaded.push(theme_url);
+                         }
+                              if(this.data.themes.theme != theme_name) {
+                                     this.get_container().removeClass('jstree-' + this.data.themes.theme);
+                                  this.data.themes.theme = theme_name;
+                           }
+                              this.get_container().addClass('jstree-' + theme_name);
+                         if(!this.data.themes.dots) { this.hide_dots(); }
+                               else { this.show_dots(); }
+                             if(!this.data.themes.icons) { this.hide_icons(); }
+                             else { this.show_icons(); }
+                            this.__callback();
+                     },
+                     get_theme : function () { return this.data.themes.theme; },
+
+                   show_dots   : function () { this.data.themes.dots = true; this.get_container().children("ul").removeClass("jstree-no-dots"); },
+                  hide_dots    : function () { this.data.themes.dots = false; this.get_container().children("ul").addClass("jstree-no-dots"); },
+                    toggle_dots        : function () { if(this.data.themes.dots) { this.hide_dots(); } else { this.show_dots(); } },
+
+                     show_icons        : function () { this.data.themes.icons = true; this.get_container().children("ul").removeClass("jstree-no-icons"); },
+                       hide_icons      : function () { this.data.themes.icons = false; this.get_container().children("ul").addClass("jstree-no-icons"); },
+                 toggle_icons: function () { if(this.data.themes.icons) { this.hide_icons(); } else { this.show_icons(); } }
+            }
+      });
+    // autodetect themes path
+      $(function () {
+                if($.jstree._themes === false) {
+                       $("script").each(function () {
+                         if(this.src.toString().match(/jquery\.jstree[^\/]*?\.js(\?.*)?$/)) {
+                                   $.jstree._themes = this.src.toString().replace(/jquery\.jstree[^\/]*?\.js(\?.*)?$/, "") + 'themes/';
+                                   return false;
+                          }
+                      });
+            }
+              if($.jstree._themes === false) { $.jstree._themes = "themes/"; }
+       });
+    // include the themes plugin by default
+        $.jstree.defaults.plugins.push("themes");
+})(jQuery);
+//*/
+
+/*
+ * jsTree hotkeys plugin
+ * Enables keyboard navigation for all tree instances
+ * Depends on the jstree ui & jquery hotkeys plugins
+ */
+(function ($) {
+ var bound = [];
+        function exec(i, event) {
+              var f = $.jstree._focused(), tmp;
+              if(f && f.data && f.data.hotkeys && f.data.hotkeys.enabled) {
+                  tmp = f._get_settings().hotkeys[i];
+                    if(tmp) { return tmp.call(f, event); }
+         }
+      }
+      $.jstree.plugin("hotkeys", {
+           __init : function () {
+                 if(typeof $.hotkeys === "undefined") { throw "jsTree hotkeys: jQuery hotkeys plugin not included."; }
+                  if(!this.data.ui) { throw "jsTree hotkeys: jsTree UI plugin not included."; }
+                  $.each(this._get_settings().hotkeys, function (i, v) {
+                         if(v !== false && $.inArray(i, bound) == -1) {
+                                 $(document).bind("keydown", i, function (event) { return exec(i, event); });
+                                   bound.push(i);
+                         }
+                      });
+                    this.get_container()
+                           .bind("lock.jstree", $.proxy(function () {
+                                             if(this.data.hotkeys.enabled) { this.data.hotkeys.enabled = false; this.data.hotkeys.revert = true; }
+                                  }, this))
+                              .bind("unlock.jstree", $.proxy(function () {
+                                           if(this.data.hotkeys.revert) { this.data.hotkeys.enabled = true; }
+                                     }, this));
+                     this.enable_hotkeys();
+         },
+             defaults : {
+                   "up" : function () {
+                           var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+                              this.hover_node(this._get_prev(o));
+                            return false;
+                  },
+                     "ctrl+up" : function () {
+                              var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+                              this.hover_node(this._get_prev(o));
+                            return false;
+                  },
+                     "shift+up" : function () {
+                             var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+                              this.hover_node(this._get_prev(o));
+                            return false;
+                  },
+                     "down" : function () {
+                         var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+                              this.hover_node(this._get_next(o));
+                            return false;
+                  },
+                     "ctrl+down" : function () {
+                            var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+                              this.hover_node(this._get_next(o));
+                            return false;
+                  },
+                     "shift+down" : function () {
+                           var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+                              this.hover_node(this._get_next(o));
+                            return false;
+                  },
+                     "left" : function () {
+                         var o = this.data.ui.hovered || this.data.ui.last_selected;
+                            if(o) {
+                                        if(o.hasClass("jstree-open")) { this.close_node(o); }
+                                  else { this.hover_node(this._get_prev(o)); }
+                           }
+                              return false;
+                  },
+                     "ctrl+left" : function () {
+                            var o = this.data.ui.hovered || this.data.ui.last_selected;
+                            if(o) {
+                                        if(o.hasClass("jstree-open")) { this.close_node(o); }
+                                  else { this.hover_node(this._get_prev(o)); }
+                           }
+                              return false;
+                  },
+                     "shift+left" : function () {
+                           var o = this.data.ui.hovered || this.data.ui.last_selected;
+                            if(o) {
+                                        if(o.hasClass("jstree-open")) { this.close_node(o); }
+                                  else { this.hover_node(this._get_prev(o)); }
+                           }
+                              return false;
+                  },
+                     "right" : function () {
+                                var o = this.data.ui.hovered || this.data.ui.last_selected;
+                            if(o && o.length) {
+                                    if(o.hasClass("jstree-closed")) { this.open_node(o); }
+                                 else { this.hover_node(this._get_next(o)); }
+                           }
+                              return false;
+                  },
+                     "ctrl+right" : function () {
+                           var o = this.data.ui.hovered || this.data.ui.last_selected;
+                            if(o && o.length) {
+                                    if(o.hasClass("jstree-closed")) { this.open_node(o); }
+                                 else { this.hover_node(this._get_next(o)); }
+                           }
+                              return false;
+                  },
+                     "shift+right" : function () {
+                          var o = this.data.ui.hovered || this.data.ui.last_selected;
+                            if(o && o.length) {
+                                    if(o.hasClass("jstree-closed")) { this.open_node(o); }
+                                 else { this.hover_node(this._get_next(o)); }
+                           }
+                              return false;
+                  },
+                     "space" : function () {
+                                if(this.data.ui.hovered) { this.data.ui.hovered.children("a:eq(0)").click(); }
+                         return false;
+                  },
+                     "ctrl+space" : function (event) {
+                              event.type = "click";
+                          if(this.data.ui.hovered) { this.data.ui.hovered.children("a:eq(0)").trigger(event); }
+                          return false;
+                  },
+                     "shift+space" : function (event) {
+                             event.type = "click";
+                          if(this.data.ui.hovered) { this.data.ui.hovered.children("a:eq(0)").trigger(event); }
+                          return false;
+                  },
+                     "f2" : function () { this.rename(this.data.ui.hovered || this.data.ui.last_selected); },
+                       "del" : function () { this.remove(this.data.ui.hovered || this._get_node(null)); }
+             },
+             _fn : {
+                        enable_hotkeys : function () {
+                         this.data.hotkeys.enabled = true;
+                      },
+                     disable_hotkeys : function () {
+                                this.data.hotkeys.enabled = false;
+                     }
+              }
+      });
+})(jQuery);
+//*/
+
+/*
+ * jsTree JSON plugin
+ * The JSON data store. Datastores are build by overriding the `load_node` and `_is_loaded` functions.
+ */
+(function ($) {
+      $.jstree.plugin("json_data", {
+         __init : function() {
+                  var s = this._get_settings().json_data;
+                        if(s.progressive_unload) {
+                             this.get_container().bind("after_close.jstree", function (e, data) {
+                                   data.rslt.obj.children("ul").remove();
+                         });
+                    }
+              },
+             defaults : {
+                   // `data` can be a function:
+                   //  * accepts two arguments - node being loaded and a callback to pass the result to
+                   //  * will be executed in the current tree's scope & ajax won't be supported
+                   data : false,
+                  ajax : false,
+                  correct_state : true,
+                  progressive_render : false,
+                    progressive_unload : false
+             },
+             _fn : {
+                        load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_json(obj, function () { _this.__callback({ "obj" : _this._get_node(obj) }); s_call.call(this); }, e_call); },
+                    _is_loaded : function (obj) {
+                          var s = this._get_settings().json_data;
+                                obj = this._get_node(obj);
+                             return obj == -1 || !obj || (!s.ajax && !s.progressive_render && !$.isFunction(s.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").length > 0;
+                       },
+                     refresh : function (obj) {
+                             obj = this._get_node(obj);
+                             var s = this._get_settings().json_data;
+                                if(obj && obj !== -1 && s.progressive_unload && ($.isFunction(s.data) || !!s.ajax)) {
+                                  obj.removeData("jstree_children");
+                             }
+                              return this.__call_old();
+                      },
+                     load_node_json : function (obj, s_call, e_call) {
+                              var s = this.get_settings().json_data, d,
+                                      error_func = function () {},
+                                   success_func = function () {};
+                         obj = this._get_node(obj);
+
+                            if(obj && obj !== -1 && (s.progressive_render || s.progressive_unload) && !obj.is(".jstree-open, .jstree-leaf") && obj.children("ul").children("li").length === 0 && obj.data("jstree_children")) {
+                                    d = this._parse_json(obj.data("jstree_children"), obj);
+                                        if(d) {
+                                                obj.append(d);
+                                         if(!s.progressive_unload) { obj.removeData("jstree_children"); }
+                                       }
+                                      this.clean_node(obj);
+                                  if(s_call) { s_call.call(this); }
+                                      return;
+                                }
+
+                             if(obj && obj !== -1) {
+                                        if(obj.data("jstree_is_loading")) { return; }
+                                  else { obj.data("jstree_is_loading",true); }
+                           }
+                              switch(!0) {
+                                   case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";
+                                   // function option added here for easier model integration (also supporting async - see callback)
+                                      case ($.isFunction(s.data)):
+                                           s.data.call(this, obj, $.proxy(function (d) {
+                                                  d = this._parse_json(d, obj);
+                                                  if(!d) {
+                                                               if(obj === -1 || !obj) {
+                                                                       if(s.correct_state) { this.get_container().children("ul").empty(); }
+                                                           }
+                                                              else {
+                                                                 obj.children("a.jstree-loading").removeClass("jstree-loading");
+                                                                        obj.removeData("jstree_is_loading");
+                                                                   if(s.correct_state) { this.correct_state(obj); }
+                                                               }
+                                                              if(e_call) { e_call.call(this); }
+                                                      }
+                                                      else {
+                                                         if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
+                                                           else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree_is_loading"); }
+                                                                this.clean_node(obj);
+                                                          if(s_call) { s_call.call(this); }
+                                                      }
+                                              }, this));
+                                             break;
+                                 case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):
+                                          if(!obj || obj == -1) {
+                                                        d = this._parse_json(s.data, obj);
+                                                     if(d) {
+                                                                this.get_container().children("ul").empty().append(d.children());
+                                                              this.clean_node();
+                                                     }
+                                                      else {
+                                                         if(s.correct_state) { this.get_container().children("ul").empty(); }
+                                                   }
+                                              }
+                                              if(s_call) { s_call.call(this); }
+                                              break;
+                                 case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):
+                                             error_func = function (x, t, e) {
+                                                      var ef = this.get_settings().json_data.ajax.error;
+                                                     if(ef) { ef.call(this, x, t, e); }
+                                                     if(obj != -1 && obj.length) {
+                                                          obj.children("a.jstree-loading").removeClass("jstree-loading");
+                                                                obj.removeData("jstree_is_loading");
+                                                           if(t === "success" && s.correct_state) { this.correct_state(obj); }
+                                                    }
+                                                      else {
+                                                         if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }
+                                                        }
+                                                      if(e_call) { e_call.call(this); }
+                                              };
+                                             success_func = function (d, t, x) {
+                                                    var sf = this.get_settings().json_data.ajax.success;
+                                                   if(sf) { d = sf.call(this,d,t,x) || d; }
+                                                       if(d === "" || (d && d.toString && d.toString().replace(/^[\s\n]+$/,"") === "") || (!$.isArray(d) && !$.isPlainObject(d))) {
+                                                           return error_func.call(this, x, t, "");
+                                                        }
+                                                      d = this._parse_json(d, obj);
+                                                  if(d) {
+                                                                if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
+                                                           else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree_is_loading"); }
+                                                                this.clean_node(obj);
+                                                          if(s_call) { s_call.call(this); }
+                                                      }
+                                                      else {
+                                                         if(obj === -1 || !obj) {
+                                                                       if(s.correct_state) {
+                                                                          this.get_container().children("ul").empty();
+                                                                           if(s_call) { s_call.call(this); }
+                                                                      }
+                                                              }
+                                                              else {
+                                                                 obj.children("a.jstree-loading").removeClass("jstree-loading");
+                                                                        obj.removeData("jstree_is_loading");
+                                                                   if(s.correct_state) {
+                                                                          this.correct_state(obj);
+                                                                               if(s_call) { s_call.call(this); }
+                                                                      }
+                                                              }
+                                                      }
+                                              };
+                                             s.ajax.context = this;
+                                         s.ajax.error = error_func;
+                                             s.ajax.success = success_func;
+                                         if(!s.ajax.dataType) { s.ajax.dataType = "json"; }
+                                             if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
+                                              if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
+                                           $.ajax(s.ajax);
+                                                break;
+                         }
+                      },
+                     _parse_json : function (js, obj, is_callback) {
+                                var d = false,
+                                 p = this._get_settings(),
+                                      s = p.json_data,
+                                       t = p.core.html_titles,
+                                        tmp, i, j, ul1, ul2;
+
+                          if(!js) { return d; }
+                          if(s.progressive_unload && obj && obj !== -1) {
+                                        obj.data("jstree_children", d);
+                                }
+                              if($.isArray(js)) {
+                                    d = $();
+                                       if(!js.length) { return false; }
+                                       for(i = 0, j = js.length; i < j; i++) {
+                                                tmp = this._parse_json(js[i], obj, true);
+                                              if(tmp.length) { d = d.add(tmp); }
+                                     }
+                              }
+                              else {
+                                 if(typeof js == "string") { js = { data : js }; }
+                                      if(!js.data && js.data !== "") { return d; }
+                                   d = $("<li />");
+                                       if(js.attr) { d.attr(js.attr); }
+                                       if(js.metadata) { d.data(js.metadata); }
+                                       if(js.state) { d.addClass("jstree-" + js.state); }
+                                     if(!$.isArray(js.data)) { tmp = js.data; js.data = []; js.data.push(tmp); }
+                                    $.each(js.data, function (i, m) {
+                                              tmp = $("<a />");
+                                              if($.isFunction(m)) { m = m.call(this, js); }
+                                          if(typeof m == "string") { tmp.attr('href','#')[ t ? "html" : "text" ](m); }
+                                           else {
+                                                 if(!m.attr) { m.attr = {}; }
+                                                   if(!m.attr.href) { m.attr.href = '#'; }
+                                                        tmp.attr(m.attr)[ t ? "html" : "text" ](m.title);
+                                                      if(m.language) { tmp.addClass(m.language); }
+                                           }
+                                              tmp.prepend("<ins class='jstree-icon'>&#160;</ins>");
+                                          if(!m.icon && js.icon) { m.icon = js.icon; }
+                                           if(m.icon) {
+                                                   if(m.icon.indexOf("/") === -1) { tmp.children("ins").addClass(m.icon); }
+                                                       else { tmp.children("ins").css("background","url('" + m.icon + "') center center no-repeat"); }
+                                                }
+                                              d.append(tmp);
+                                 });
+                                    d.prepend("<ins class='jstree-icon'>&#160;</ins>");
+                                    if(js.children) {
+                                              if(s.progressive_render && js.state !== "open") {
+                                                      d.addClass("jstree-closed").data("jstree_children", js.children);
+                                              }
+                                              else {
+                                                 if(s.progressive_unload) { d.data("jstree_children", js.children); }
+                                                   if($.isArray(js.children) && js.children.length) {
+                                                             tmp = this._parse_json(js.children, obj, true);
+                                                                if(tmp.length) {
+                                                                       ul2 = $("<ul />");
+                                                                     ul2.append(tmp);
+                                                                       d.append(ul2);
+                                                         }
+                                                      }
+                                              }
+                                      }
+                              }
+                              if(!is_callback) {
+                                     ul1 = $("<ul />");
+                                     ul1.append(d);
+                                 d = ul1;
+                               }
+                              return d;
+                      },
+                     get_json : function (obj, li_attr, a_attr, is_callback) {
+                              var result = [],
+                                       s = this._get_settings(),
+                                      _this = this,
+                                  tmp1, tmp2, li, a, t, lang;
+                            obj = this._get_node(obj);
+                             if(!obj || obj === -1) { obj = this.get_container().find("> ul > li"); }
+                               li_attr = $.isArray(li_attr) ? li_attr : [ "id", "class" ];
+                            if(!is_callback && this.data.types) { li_attr.push(s.types.type_attr); }
+                               a_attr = $.isArray(a_attr) ? a_attr : [ ];
+
+                            obj.each(function () {
+                                 li = $(this);
+                                  tmp1 = { data : [] };
+                                  if(li_attr.length) { tmp1.attr = { }; }
+                                        $.each(li_attr, function (i, v) {
+                                              tmp2 = li.attr(v);
+                                             if(tmp2 && tmp2.length && tmp2.replace(/jstree[^ ]*/ig,'').length) {
+                                                   tmp1.attr[v] = (" " + tmp2).replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"");
+                                              }
+                                      });
+                                    if(li.hasClass("jstree-open")) { tmp1.state = "open"; }
+                                        if(li.hasClass("jstree-closed")) { tmp1.state = "closed"; }
+                                    if(li.data()) { tmp1.metadata = li.data(); }
+                                   a = li.children("a");
+                                  a.each(function () {
+                                           t = $(this);
+                                           if(
+                                                    a_attr.length ||
+                                                       $.inArray("languages", s.plugins) !== -1 ||
+                                                    t.children("ins").get(0).style.backgroundImage.length ||
+                                                       (t.children("ins").get(0).className && t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').length)
+                                                ) {
+                                                    lang = false;
+                                                  if($.inArray("languages", s.plugins) !== -1 && $.isArray(s.languages) && s.languages.length) {
+                                                         $.each(s.languages, function (l, lv) {
+                                                                 if(t.hasClass(lv)) {
+                                                                           lang = lv;
+                                                                             return false;
+                                                                  }
+                                                              });
+                                                    }
+                                                      tmp2 = { attr : { }, title : _this.get_text(t, lang) };
+                                                        $.each(a_attr, function (k, z) {
+                                                               tmp2.attr[z] = (" " + (t.attr(z) || "")).replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"");
+                                                 });
+                                                    if($.inArray("languages", s.plugins) !== -1 && $.isArray(s.languages) && s.languages.length) {
+                                                         $.each(s.languages, function (k, z) {
+                                                                  if(t.hasClass(z)) { tmp2.language = z; return true; }
+                                                          });
+                                                    }
+                                                      if(t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/^\s+$/ig,"").length) {
+                                                            tmp2.icon = t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"");
+                                                  }
+                                                      if(t.children("ins").get(0).style.backgroundImage.length) {
+                                                            tmp2.icon = t.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","");
+                                                 }
+                                              }
+                                              else {
+                                                 tmp2 = _this.get_text(t);
+                                              }
+                                              if(a.length > 1) { tmp1.data.push(tmp2); }
+                                             else { tmp1.data = tmp2; }
+                                     });
+                                    li = li.find("> ul > li");
+                                     if(li.length) { tmp1.children = _this.get_json(li, li_attr, a_attr, true); }
+                                   result.push(tmp1);
+                             });
+                            return result;
+                 }
+              }
+      });
+})(jQuery);
+//*/
+
+/*
+ * jsTree languages plugin
+ * Adds support for multiple language versions in one tree
+ * This basically allows for many titles coexisting in one node, but only one of them being visible at any given time
+ * This is useful for maintaining the same structure in many languages (hence the name of the plugin)
+ */
+(function ($) {
+ $.jstree.plugin("languages", {
+         __init : function () { this._load_css();  },
+           defaults : [],
+         _fn : {
+                        set_lang : function (i) {
+                              var langs = this._get_settings().languages,
+                                    st = false,
+                                    selector = ".jstree-" + this.get_index() + ' a';
+                               if(!$.isArray(langs) || langs.length === 0) { return false; }
+                          if($.inArray(i,langs) == -1) {
+                                 if(!!langs[i]) { i = langs[i]; }
+                                       else { return false; }
+                         }
+                              if(i == this.data.languages.current_language) { return true; }
+                         st = $.vakata.css.get_css(selector + "." + this.data.languages.current_language, false, this.data.languages.language_css);
+                             if(st !== false) { st.style.display = "none"; }
+                                st = $.vakata.css.get_css(selector + "." + i, false, this.data.languages.language_css);
+                                if(st !== false) { st.style.display = ""; }
+                            this.data.languages.current_language = i;
+                              this.__callback(i);
+                            return true;
+                   },
+                     get_lang : function () {
+                               return this.data.languages.current_language;
+                   },
+                     _get_string : function (key, lang) {
+                           var langs = this._get_settings().languages,
+                                    s = this._get_settings().core.strings;
+                         if($.isArray(langs) && langs.length) {
+                                 lang = (lang && $.inArray(lang,langs) != -1) ? lang : this.data.languages.current_language;
+                            }
+                              if(s[lang] && s[lang][key]) { return s[lang][key]; }
+                           if(s[key]) { return s[key]; }
+                          return key;
+                    },
+                     get_text : function (obj, lang) {
+                              obj = this._get_node(obj) || this.data.ui.last_selected;
+                               if(!obj.size()) { return false; }
+                              var langs = this._get_settings().languages,
+                                    s = this._get_settings().core.html_titles;
+                             if($.isArray(langs) && langs.length) {
+                                 lang = (lang && $.inArray(lang,langs) != -1) ? lang : this.data.languages.current_language;
+                                    obj = obj.children("a." + lang);
+                               }
+                              else { obj = obj.children("a:eq(0)"); }
+                                if(s) {
+                                        obj = obj.clone();
+                                     obj.children("INS").remove();
+                                  return obj.html();
+                             }
+                              else {
+                                 obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
+                                     return obj.nodeValue;
+                          }
+                      },
+                     set_text : function (obj, val, lang) {
+                         obj = this._get_node(obj) || this.data.ui.last_selected;
+                               if(!obj.size()) { return false; }
+                              var langs = this._get_settings().languages,
+                                    s = this._get_settings().core.html_titles,
+                                     tmp;
+                           if($.isArray(langs) && langs.length) {
+                                 lang = (lang && $.inArray(lang,langs) != -1) ? lang : this.data.languages.current_language;
+                                    obj = obj.children("a." + lang);
+                               }
+                              else { obj = obj.children("a:eq(0)"); }
+                                if(s) {
+                                        tmp = obj.children("INS").clone();
+                                     obj.html(val).prepend(tmp);
+                                    this.__callback({ "obj" : obj, "name" : val, "lang" : lang });
+                                 return true;
+                           }
+                              else {
+                                 obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
+                                     this.__callback({ "obj" : obj, "name" : val, "lang" : lang });
+                                 return (obj.nodeValue = val);
+                          }
+                      },
+                     _load_css : function () {
+                              var langs = this._get_settings().languages,
+                                    str = "/* languages css */",
+                                   selector = ".jstree-" + this.get_index() + ' a',
+                                       ln;
+                            if($.isArray(langs) && langs.length) {
+                                 this.data.languages.current_language = langs[0];
+                                       for(ln = 0; ln < langs.length; ln++) {
+                                         str += selector + "." + langs[ln] + " {";
+                                              if(langs[ln] != this.data.languages.current_language) { str += " display:none; "; }
+                                            str += " } ";
+                                  }
+                                      this.data.languages.language_css = $.vakata.css.add_sheet({ 'str' : str, 'title' : "jstree-languages" });
+                              }
+                      },
+                     create_node : function (obj, position, js, callback) {
+                         var t = this.__call_old(true, obj, position, js, function (t) {
+                                        var langs = this._get_settings().languages,
+                                            a = t.children("a"),
+                                           ln;
+                                    if($.isArray(langs) && langs.length) {
+                                         for(ln = 0; ln < langs.length; ln++) {
+                                                 if(!a.is("." + langs[ln])) {
+                                                           t.append(a.eq(0).clone().removeClass(langs.join(" ")).addClass(langs[ln]));
+                                                    }
+                                              }
+                                              a.not("." + langs.join(", .")).remove();
+                                       }
+                                      if(callback) { callback.call(this, t); }
+                               });
+                            return t;
+                      }
+              }
+      });
+})(jQuery);
+//*/
+
+/*
+ * jsTree cookies plugin
+ * Stores the currently opened/selected nodes in a cookie and then restores them
+ * Depends on the jquery.cookie plugin
+ */
+(function ($) {
+  $.jstree.plugin("cookies", {
+           __init : function () {
+                 if(typeof $.cookie === "undefined") { throw "jsTree cookie: jQuery cookie plugin not included."; }
+
+                    var s = this._get_settings().cookies,
+                          tmp;
+                   if(!!s.save_loaded) {
+                          tmp = $.cookie(s.save_loaded);
+                         if(tmp && tmp.length) { this.data.core.to_load = tmp.split(","); }
+                     }
+                      if(!!s.save_opened) {
+                          tmp = $.cookie(s.save_opened);
+                         if(tmp && tmp.length) { this.data.core.to_open = tmp.split(","); }
+                     }
+                      if(!!s.save_selected) {
+                                tmp = $.cookie(s.save_selected);
+                               if(tmp && tmp.length && this.data.ui) { this.data.ui.to_select = tmp.split(","); }
+                     }
+                      this.get_container()
+                           .one( ( this.data.ui ? "reselect" : "reopen" ) + ".jstree", $.proxy(function () {
+                                      this.get_container()
+                                           .bind("open_node.jstree close_node.jstree select_node.jstree deselect_node.jstree", $.proxy(function (e) {
+                                                             if(this._get_settings().cookies.auto_save) { this.save_cookie((e.handleObj.namespace + e.handleObj.type).replace("jstree","")); }
+                                                      }, this));
+                             }, this));
+             },
+             defaults : {
+                   save_loaded         : "jstree_load",
+                  save_opened          : "jstree_open",
+                  save_selected        : "jstree_select",
+                       auto_save               : true,
+                     cookie_options    : {}
+            },
+             _fn : {
+                        save_cookie : function (c) {
+                           if(this.data.core.refreshing) { return; }
+                              var s = this._get_settings().cookies;
+                          if(!c) { // if called manually and not by event
+                                        if(s.save_loaded) {
+                                            this.save_loaded();
+                                            $.cookie(s.save_loaded, this.data.core.to_load.join(","), s.cookie_options);
+                                   }
+                                      if(s.save_opened) {
+                                            this.save_opened();
+                                            $.cookie(s.save_opened, this.data.core.to_open.join(","), s.cookie_options);
+                                   }
+                                      if(s.save_selected && this.data.ui) {
+                                          this.save_selected();
+                                          $.cookie(s.save_selected, this.data.ui.to_select.join(","), s.cookie_options);
+                                 }
+                                      return;
+                                }
+                              switch(c) {
+                                    case "open_node":
+                                      case "close_node":
+                                             if(!!s.save_opened) {
+                                                  this.save_opened();
+                                                    $.cookie(s.save_opened, this.data.core.to_open.join(","), s.cookie_options);
+                                           }
+                                              if(!!s.save_loaded) {
+                                                  this.save_loaded();
+                                                    $.cookie(s.save_loaded, this.data.core.to_load.join(","), s.cookie_options);
+                                           }
+                                              break;
+                                 case "select_node":
+                                    case "deselect_node":
+                                          if(!!s.save_selected && this.data.ui) {
+                                                        this.save_selected();
+                                                  $.cookie(s.save_selected, this.data.ui.to_select.join(","), s.cookie_options);
+                                         }
+                                              break;
+                         }
+                      }
+              }
+      });
+    // include cookies by default
+  // $.jstree.defaults.plugins.push("cookies");
+})(jQuery);
+//*/
+
+/*
+ * jsTree sort plugin
+ * Sorts items alphabetically (or using any other function)
+ */
+(function ($) {
+       $.jstree.plugin("sort", {
+              __init : function () {
+                 this.get_container()
+                           .bind("load_node.jstree", $.proxy(function (e, data) {
+                                         var obj = this._get_node(data.rslt.obj);
+                                               obj = obj === -1 ? this.get_container().children("ul") : obj.children("ul");
+                                           this.sort(obj);
+                                        }, this))
+                              .bind("rename_node.jstree create_node.jstree create.jstree", $.proxy(function (e, data) {
+                                              this.sort(data.rslt.obj.parent());
+                                     }, this))
+                              .bind("move_node.jstree", $.proxy(function (e, data) {
+                                         var m = data.rslt.np == -1 ? this.get_container() : data.rslt.np;
+                                              this.sort(m.children("ul"));
+                                   }, this));
+             },
+             defaults : function (a, b) { return this.get_text(a) > this.get_text(b) ? 1 : -1; },
+           _fn : {
+                        sort : function (obj) {
+                                var s = this._get_settings().sort,
+                                     t = this;
+                              obj.append($.makeArray(obj.children("li")).sort($.proxy(s, t)));
+                               obj.find("> li > ul").each(function() { t.sort($(this)); });
+                           this.clean_node(obj);
+                  }
+              }
+      });
+})(jQuery);
+//*/
+
+/*
+ * jsTree DND plugin
+ * Drag and drop plugin for moving/copying nodes
+ */
+(function ($) {
+     var o = false,
+         r = false,
+             m = false,
+             ml = false,
+            sli = false,
+           sti = false,
+           dir1 = false,
+          dir2 = false,
+          last_pos = false;
+      $.vakata.dnd = {
+               is_down : false,
+               is_drag : false,
+               helper : false,
+                scroll_spd : 10,
+               init_x : 0,
+            init_y : 0,
+            threshold : 5,
+         helper_left : 5,
+               helper_top : 10,
+               user_data : {},
+
+               drag_start : function (e, data, html) {
+                        if($.vakata.dnd.is_drag) { $.vakata.drag_stop({}); }
+                   try {
+                          e.currentTarget.unselectable = "on";
+                           e.currentTarget.onselectstart = function() { return false; };
+                          if(e.currentTarget.style) { e.currentTarget.style.MozUserSelect = "none"; }
+                    } catch(err) { }
+                       $.vakata.dnd.init_x = e.pageX;
+                 $.vakata.dnd.init_y = e.pageY;
+                 $.vakata.dnd.user_data = data;
+                 $.vakata.dnd.is_down = true;
+                   $.vakata.dnd.helper = $("<div id='vakata-dragged' />").html(html); //.fadeTo(10,0.25);
+                 $(document).bind("mousemove", $.vakata.dnd.drag);
+                      $(document).bind("mouseup", $.vakata.dnd.drag_stop);
+                   return false;
+          },
+             drag : function (e) {
+                  if(!$.vakata.dnd.is_down) { return; }
+                  if(!$.vakata.dnd.is_drag) {
+                            if(Math.abs(e.pageX - $.vakata.dnd.init_x) > 5 || Math.abs(e.pageY - $.vakata.dnd.init_y) > 5) {
+                                       $.vakata.dnd.helper.appendTo("body");
+                                  $.vakata.dnd.is_drag = true;
+                                   $(document).triggerHandler("drag_start.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });
+                             }
+                              else { return; }
+                       }
+
+                     // maybe use a scrolling parent element instead of document?
+                   if(e.type === "mousemove") { // thought of adding scroll in order to move the helper, but mouse poisition is n/a
+                               var d = $(document), t = d.scrollTop(), l = d.scrollLeft();
+                            if(e.pageY - t < 20) {
+                                 if(sti && dir1 === "down") { clearInterval(sti); sti = false; }
+                                        if(!sti) { dir1 = "up"; sti = setInterval(function () { $(document).scrollTop($(document).scrollTop() - $.vakata.dnd.scroll_spd); }, 150); }
+                           }
+                              else {
+                                 if(sti && dir1 === "up") { clearInterval(sti); sti = false; }
+                          }
+                              if($(window).height() - (e.pageY - t) < 20) {
+                                  if(sti && dir1 === "up") { clearInterval(sti); sti = false; }
+                                  if(!sti) { dir1 = "down"; sti = setInterval(function () { $(document).scrollTop($(document).scrollTop() + $.vakata.dnd.scroll_spd); }, 150); }
+                         }
+                              else {
+                                 if(sti && dir1 === "down") { clearInterval(sti); sti = false; }
+                                }
+
+                             if(e.pageX - l < 20) {
+                                 if(sli && dir2 === "right") { clearInterval(sli); sli = false; }
+                                       if(!sli) { dir2 = "left"; sli = setInterval(function () { $(document).scrollLeft($(document).scrollLeft() - $.vakata.dnd.scroll_spd); }, 150); }
+                               }
+                              else {
+                                 if(sli && dir2 === "left") { clearInterval(sli); sli = false; }
+                                }
+                              if($(window).width() - (e.pageX - l) < 20) {
+                                   if(sli && dir2 === "left") { clearInterval(sli); sli = false; }
+                                        if(!sli) { dir2 = "right"; sli = setInterval(function () { $(document).scrollLeft($(document).scrollLeft() + $.vakata.dnd.scroll_spd); }, 150); }
+                              }
+                              else {
+                                 if(sli && dir2 === "right") { clearInterval(sli); sli = false; }
+                               }
+                      }
+
+                     $.vakata.dnd.helper.css({ left : (e.pageX + $.vakata.dnd.helper_left) + "px", top : (e.pageY + $.vakata.dnd.helper_top) + "px" });
+                     $(document).triggerHandler("drag.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });
+           },
+             drag_stop : function (e) {
+                     if(sli) { clearInterval(sli); }
+                        if(sti) { clearInterval(sti); }
+                        $(document).unbind("mousemove", $.vakata.dnd.drag);
+                    $(document).unbind("mouseup", $.vakata.dnd.drag_stop);
+                 $(document).triggerHandler("drag_stop.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });
+                      $.vakata.dnd.helper.remove();
+                  $.vakata.dnd.init_x = 0;
+                       $.vakata.dnd.init_y = 0;
+                       $.vakata.dnd.user_data = {};
+                   $.vakata.dnd.is_down = false;
+                  $.vakata.dnd.is_drag = false;
+          }
+      };
+     $(function() {
+         var css_string = '#vakata-dragged { display:block; margin:0 0 0 0; padding:4px 4px 4px 24px; position:absolute; top:-2000px; line-height:16px; z-index:10000; } ';
+             $.vakata.css.add_sheet({ str : css_string, title : "vakata" });
+        });
+
+   $.jstree.plugin("dnd", {
+               __init : function () {
+                 this.data.dnd = {
+                              active : false,
+                                after : false,
+                         inside : false,
+                                before : false,
+                                off : false,
+                           prepared : false,
+                              w : 0,
+                         to1 : false,
+                           to2 : false,
+                           cof : false,
+                           cw : false,
+                            ch : false,
+                            i1 : false,
+                            i2 : false,
+                            mto : false
+                    };
+                     this.get_container()
+                           .bind("mouseenter.jstree", $.proxy(function (e) {
+                                              if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+                                                    if(this.data.themes) {
+                                                         m.attr("class", "jstree-" + this.data.themes.theme);
+                                                           if(ml) { ml.attr("class", "jstree-" + this.data.themes.theme); }
+                                                               $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme);
+                                                       }
+                                                      //if($(e.currentTarget).find("> ul > li").length === 0) {
+                                                      if(e.currentTarget === e.target && $.vakata.dnd.user_data.obj && $($.vakata.dnd.user_data.obj).length && $($.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0] !== e.target) { // node should not be from the same tree
+                                                            var tr = $.jstree._reference(e.target), dc;
+                                                            if(tr.data.dnd.foreign) {
+                                                                      dc = tr._get_settings().dnd.drag_check.call(this, { "o" : o, "r" : tr.get_container(), is_root : true });
+                                                                      if(dc === true || dc.inside === true || dc.before === true || dc.after === true) {
+                                                                             $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
+                                                                 }
+                                                              }
+                                                              else {
+                                                                 tr.prepare_move(o, tr.get_container(), "last");
+                                                                        if(tr.check_move()) {
+                                                                          $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
+                                                                 }
+                                                              }
+                                                      }
+                                              }
+                                      }, this))
+                              .bind("mouseup.jstree", $.proxy(function (e) {
+                                         //if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && $(e.currentTarget).find("> ul > li").length === 0) {
+                                             if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && e.currentTarget === e.target && $.vakata.dnd.user_data.obj && $($.vakata.dnd.user_data.obj).length && $($.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0] !== e.target) { // node should not be from the same tree
+                                                   var tr = $.jstree._reference(e.currentTarget), dc;
+                                                     if(tr.data.dnd.foreign) {
+                                                              dc = tr._get_settings().dnd.drag_check.call(this, { "o" : o, "r" : tr.get_container(), is_root : true });
+                                                              if(dc === true || dc.inside === true || dc.before === true || dc.after === true) {
+                                                                     tr._get_settings().dnd.drag_finish.call(this, { "o" : o, "r" : tr.get_container(), is_root : true });
+                                                          }
+                                                      }
+                                                      else {
+                                                         tr.move_node(o, tr.get_container(), "last", e[tr._get_settings().dnd.copy_modifier + "Key"]);
+                                                  }
+                                              }
+                                      }, this))
+                              .bind("mouseleave.jstree", $.proxy(function (e) {
+                                              if(e.relatedTarget && e.relatedTarget.id && e.relatedTarget.id === "jstree-marker-line") {
+                                                     return false;
+                                          }
+                                              if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+                                                    if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
+                                                      if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
+                                                      if(this.data.dnd.to1) { clearTimeout(this.data.dnd.to1); }
+                                                     if(this.data.dnd.to2) { clearTimeout(this.data.dnd.to2); }
+                                                     if($.vakata.dnd.helper.children("ins").hasClass("jstree-ok")) {
+                                                                $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
+                                                    }
+                                              }
+                                      }, this))
+                              .bind("mousemove.jstree", $.proxy(function (e) {
+                                               if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+                                                    var cnt = this.get_container()[0];
+
+                                                    // Horizontal scroll
+                                                   if(e.pageX + 24 > this.data.dnd.cof.left + this.data.dnd.cw) {
+                                                         if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
+                                                              this.data.dnd.i1 = setInterval($.proxy(function () { this.scrollLeft += $.vakata.dnd.scroll_spd; }, cnt), 100);
+                                                        }
+                                                      else if(e.pageX - 24 < this.data.dnd.cof.left) {
+                                                               if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
+                                                              this.data.dnd.i1 = setInterval($.proxy(function () { this.scrollLeft -= $.vakata.dnd.scroll_spd; }, cnt), 100);
+                                                        }
+                                                      else {
+                                                         if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
+                                                      }
+
+                                                     // Vertical scroll
+                                                     if(e.pageY + 24 > this.data.dnd.cof.top + this.data.dnd.ch) {
+                                                          if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
+                                                              this.data.dnd.i2 = setInterval($.proxy(function () { this.scrollTop += $.vakata.dnd.scroll_spd; }, cnt), 100);
+                                                 }
+                                                      else if(e.pageY - 24 < this.data.dnd.cof.top) {
+                                                                if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
+                                                              this.data.dnd.i2 = setInterval($.proxy(function () { this.scrollTop -= $.vakata.dnd.scroll_spd; }, cnt), 100);
+                                                 }
+                                                      else {
+                                                         if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
+                                                      }
+
+                                             }
+                                      }, this))
+                              .bind("scroll.jstree", $.proxy(function (e) {
+                                          if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && m && ml) {
+                                                 m.hide();
+                                                      ml.hide();
+                                             }
+                                      }, this))
+                              .delegate("a", "mousedown.jstree", $.proxy(function (e) {
+                                              if(e.which === 1) {
+                                                    this.start_drag(e.currentTarget, e);
+                                                   return false;
+                                          }
+                                      }, this))
+                              .delegate("a", "mouseenter.jstree", $.proxy(function (e) {
+                                             if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+                                                    this.dnd_enter(e.currentTarget);
+                                               }
+                                      }, this))
+                              .delegate("a", "mousemove.jstree", $.proxy(function (e) {
+                                              if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+                                                    if(!r || !r.length || r.children("a")[0] !== e.currentTarget) {
+                                                                this.dnd_enter(e.currentTarget);
+                                                       }
+                                                      if(typeof this.data.dnd.off.top === "undefined") { this.data.dnd.off = $(e.target).offset(); }
+                                                 this.data.dnd.w = (e.pageY - (this.data.dnd.off.top || 0)) % this.data.core.li_height;
+                                                 if(this.data.dnd.w < 0) { this.data.dnd.w += this.data.core.li_height; }
+                                                       this.dnd_show();
+                                               }
+                                      }, this))
+                              .delegate("a", "mouseleave.jstree", $.proxy(function (e) {
+                                             if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+                                                    if(e.relatedTarget && e.relatedTarget.id && e.relatedTarget.id === "jstree-marker-line") {
+                                                             return false;
+                                                  }
+                                                              if(m) { m.hide(); }
+                                                            if(ml) { ml.hide(); }
+                                                  /*
+                                                     var ec = $(e.currentTarget).closest("li"),
+                                                             er = $(e.relatedTarget).closest("li");
+                                                 if(er[0] !== ec.prev()[0] && er[0] !== ec.next()[0]) {
+                                                         if(m) { m.hide(); }
+                                                            if(ml) { ml.hide(); }
+                                                  }
+                                                      */
+                                                     this.data.dnd.mto = setTimeout(
+                                                                (function (t) { return function () { t.dnd_leave(e); }; })(this),
+                                                      0);
+                                            }
+                                      }, this))
+                              .delegate("a", "mouseup.jstree", $.proxy(function (e) {
+                                                if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+                                                    this.dnd_finish(e);
+                                            }
+                                      }, this));
+
+                    $(document)
+                            .bind("drag_stop.vakata", $.proxy(function () {
+                                                if(this.data.dnd.to1) { clearTimeout(this.data.dnd.to1); }
+                                             if(this.data.dnd.to2) { clearTimeout(this.data.dnd.to2); }
+                                             if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
+                                              if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
+                                              this.data.dnd.after              = false;
+                                          this.data.dnd.before = false;
+                                          this.data.dnd.inside = false;
+                                          this.data.dnd.off            = false;
+                                            this.data.dnd.prepared     = false;
+                                                this.data.dnd.w                        = false;
+                                             this.data.dnd.to1         = false;
+                                            this.data.dnd.to2          = false;
+                                            this.data.dnd.i1           = false;
+                                             this.data.dnd.i2          = false;
+                                             this.data.dnd.active      = false;
+                                          this.data.dnd.foreign        = false;
+                                         if(m) { m.css({ "top" : "-2000px" }); }
+                                                if(ml) { ml.css({ "top" : "-2000px" }); }
+                                      }, this))
+                              .bind("drag_start.vakata", $.proxy(function (e, data) {
+                                                if(data.data.jstree) {
+                                                 var et = $(data.event.target);
+                                                 if(et.closest(".jstree").hasClass("jstree-" + this.get_index())) {
+                                                             this.dnd_enter(et);
+                                                    }
+                                              }
+                                      }, this));
+                             /*
+                             .bind("keydown.jstree-" + this.get_index() + " keyup.jstree-" + this.get_index(), $.proxy(function(e) {
+                                                if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && !this.data.dnd.foreign) {
+                                                  var h = $.vakata.dnd.helper.children("ins");
+                                                   if(e[this._get_settings().dnd.copy_modifier + "Key"] && h.hasClass("jstree-ok")) {
+                                                             h.parent().html(h.parent().html().replace(/ \(Copy\)$/, "") + " (Copy)");
+                                                      }
+                                                      else {
+                                                         h.parent().html(h.parent().html().replace(/ \(Copy\)$/, ""));
+                                                  }
+                                              }
+                                      }, this)); */
+
+
+
+                       var s = this._get_settings().dnd;
+                      if(s.drag_target) {
+                            $(document)
+                                    .delegate(s.drag_target, "mousedown.jstree-" + this.get_index(), $.proxy(function (e) {
+                                                o = e.target;
+                                          $.vakata.dnd.drag_start(e, { jstree : true, obj : e.target }, "<ins class='jstree-icon'></ins>" + $(e.target).text() );
+                                                if(this.data.themes) {
+                                                 if(m) { m.attr("class", "jstree-" + this.data.themes.theme); }
+                                                 if(ml) { ml.attr("class", "jstree-" + this.data.themes.theme); }
+                                                       $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme);
+                                               }
+                                              $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
+                                            var cnt = this.get_container();
+                                                this.data.dnd.cof = cnt.offset();
+                                              this.data.dnd.cw = parseInt(cnt.width(),10);
+                                           this.data.dnd.ch = parseInt(cnt.height(),10);
+                                          this.data.dnd.foreign = true;
+                                          e.preventDefault();
+                                    }, this));
+                     }
+                      if(s.drop_target) {
+                            $(document)
+                                    .delegate(s.drop_target, "mouseenter.jstree-" + this.get_index(), $.proxy(function (e) {
+                                                       if(this.data.dnd.active && this._get_settings().dnd.drop_check.call(this, { "o" : o, "r" : $(e.target), "e" : e })) {
+                                                          $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
+                                                 }
+                                              }, this))
+                                      .delegate(s.drop_target, "mouseleave.jstree-" + this.get_index(), $.proxy(function (e) {
+                                                       if(this.data.dnd.active) {
+                                                             $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
+                                                    }
+                                              }, this))
+                                      .delegate(s.drop_target, "mouseup.jstree-" + this.get_index(), $.proxy(function (e) {
+                                                  if(this.data.dnd.active && $.vakata.dnd.helper.children("ins").hasClass("jstree-ok")) {
+                                                                this._get_settings().dnd.drop_finish.call(this, { "o" : o, "r" : $(e.target), "e" : e });
+                                                      }
+                                              }, this));
+                     }
+              },
+             defaults : {
+                   copy_modifier       : "ctrl",
+                        check_timeout  : 100,
+                   open_timeout        : 500,
+                    drop_target                : ".jstree-drop",
+                 drop_check            : function (data) { return true; },
+                        drop_finish            : $.noop,
+                 drag_target           : ".jstree-draggable",
+                    drag_finish                : $.noop,
+                 drag_check            : function (data) { return { after : false, before : false, inside : true }; }
+             },
+             _fn : {
+                        dnd_prepare : function () {
+                            if(!r || !r.length) { return; }
+                                this.data.dnd.off = r.offset();
+                                if(this._get_settings().core.rtl) {
+                                    this.data.dnd.off.right = this.data.dnd.off.left + r.width();
+                          }
+                              if(this.data.dnd.foreign) {
+                                    var a = this._get_settings().dnd.drag_check.call(this, { "o" : o, "r" : r });
+                                  this.data.dnd.after = a.after;
+                                 this.data.dnd.before = a.before;
+                                       this.data.dnd.inside = a.inside;
+                                       this.data.dnd.prepared = true;
+                                 return this.dnd_show();
+                                }
+                              this.prepare_move(o, r, "before");
+                             this.data.dnd.before = this.check_move();
+                              this.prepare_move(o, r, "after");
+                              this.data.dnd.after = this.check_move();
+                               if(this._is_loaded(r)) {
+                                       this.prepare_move(o, r, "inside");
+                                     this.data.dnd.inside = this.check_move();
+                              }
+                              else {
+                                 this.data.dnd.inside = false;
+                          }
+                              this.data.dnd.prepared = true;
+                         return this.dnd_show();
+                        },
+                     dnd_show : function () {
+                               if(!this.data.dnd.prepared) { return; }
+                                var o = ["before","inside","after"],
+                                   r = false,
+                                     rtl = this._get_settings().core.rtl,
+                                   pos;
+                           if(this.data.dnd.w < this.data.core.li_height/3) { o = ["before","inside","after"]; }
+                          else if(this.data.dnd.w <= this.data.core.li_height*2/3) {
+                                     o = this.data.dnd.w < this.data.core.li_height/2 ? ["inside","before","after"] : ["inside","after","before"];
+                          }
+                              else { o = ["after","inside","before"]; }
+                              $.each(o, $.proxy(function (i, val) {
+                                  if(this.data.dnd[val]) {
+                                               $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
+                                         r = val;
+                                               return false;
+                                  }
+                              }, this));
+                             if(r === false) { $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid"); }
+
+                               pos = rtl ? (this.data.dnd.off.right - 18) : (this.data.dnd.off.left + 10);
+                            switch(r) {
+                                    case "before":
+                                         m.css({ "left" : pos + "px", "top" : (this.data.dnd.off.top - 6) + "px" }).show();
+                                             if(ml) { ml.css({ "left" : (pos + 8) + "px", "top" : (this.data.dnd.off.top - 1) + "px" }).show(); }
+                                           break;
+                                 case "after":
+                                          m.css({ "left" : pos + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height - 6) + "px" }).show();
+                                          if(ml) { ml.css({ "left" : (pos + 8) + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height - 1) + "px" }).show(); }
+                                                break;
+                                 case "inside":
+                                         m.css({ "left" : pos + ( rtl ? -4 : 4) + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height/2 - 5) + "px" }).show();
+                                              if(ml) { ml.hide(); }
+                                          break;
+                                 default:
+                                               m.hide();
+                                              if(ml) { ml.hide(); }
+                                          break;
+                         }
+                              last_pos = r;
+                          return r;
+                      },
+                     dnd_open : function () {
+                               this.data.dnd.to2 = false;
+                             this.open_node(r, $.proxy(this.dnd_prepare,this), true);
+                       },
+                     dnd_finish : function (e) {
+                            if(this.data.dnd.foreign) {
+                                    if(this.data.dnd.after || this.data.dnd.before || this.data.dnd.inside) {
+                                              this._get_settings().dnd.drag_finish.call(this, { "o" : o, "r" : r, "p" : last_pos });
+                                 }
+                              }
+                              else {
+                                 this.dnd_prepare();
+                                    this.move_node(o, r, last_pos, e[this._get_settings().dnd.copy_modifier + "Key"]);
+                             }
+                              o = false;
+                             r = false;
+                             m.hide();
+                              if(ml) { ml.hide(); }
+                  },
+                     dnd_enter : function (obj) {
+                           if(this.data.dnd.mto) {
+                                        clearTimeout(this.data.dnd.mto);
+                                       this.data.dnd.mto = false;
+                             }
+                              var s = this._get_settings().dnd;
+                              this.data.dnd.prepared = false;
+                                r = this._get_node(obj);
+                               if(s.check_timeout) {
+                                  // do the calculations after a minimal timeout (users tend to drag quickly to the desired location)
+                                    if(this.data.dnd.to1) { clearTimeout(this.data.dnd.to1); }
+                                     this.data.dnd.to1 = setTimeout($.proxy(this.dnd_prepare, this), s.check_timeout);
+                              }
+                              else {
+                                 this.dnd_prepare();
+                            }
+                              if(s.open_timeout) {
+                                   if(this.data.dnd.to2) { clearTimeout(this.data.dnd.to2); }
+                                     if(r && r.length && r.hasClass("jstree-closed")) {
+                                             // if the node is closed - open it, then recalculate
+                                           this.data.dnd.to2 = setTimeout($.proxy(this.dnd_open, this), s.open_timeout);
+                                  }
+                              }
+                              else {
+                                 if(r && r.length && r.hasClass("jstree-closed")) {
+                                             this.dnd_open();
+                                       }
+                              }
+                      },
+                     dnd_leave : function (e) {
+                             this.data.dnd.after               = false;
+                          this.data.dnd.before = false;
+                          this.data.dnd.inside = false;
+                          $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
+                            m.hide();
+                              if(ml) { ml.hide(); }
+                          if(r && r[0] === e.target.parentNode) {
+                                        if(this.data.dnd.to1) {
+                                                clearTimeout(this.data.dnd.to1);
+                                               this.data.dnd.to1 = false;
+                                     }
+                                      if(this.data.dnd.to2) {
+                                                clearTimeout(this.data.dnd.to2);
+                                               this.data.dnd.to2 = false;
+                                     }
+                              }
+                      },
+                     start_drag : function (obj, e) {
+                               o = this._get_node(obj);
+                               if(this.data.ui && this.is_selected(o)) { o = this._get_node(null, true); }
+                            var dt = o.length > 1 ? this._get_string("multiple_selection") : this.get_text(o),
+                                     cnt = this.get_container();
+                            if(!this._get_settings().core.html_titles) { dt = dt.replace(/</ig,"&lt;").replace(/>/ig,"&gt;"); }
+                            $.vakata.dnd.drag_start(e, { jstree : true, obj : o }, "<ins class='jstree-icon'></ins>" + dt );
+                               if(this.data.themes) {
+                                 if(m) { m.attr("class", "jstree-" + this.data.themes.theme); }
+                                 if(ml) { ml.attr("class", "jstree-" + this.data.themes.theme); }
+                                       $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme);
+                               }
+                              this.data.dnd.cof = cnt.offset();
+                              this.data.dnd.cw = parseInt(cnt.width(),10);
+                           this.data.dnd.ch = parseInt(cnt.height(),10);
+                          this.data.dnd.active = true;
+                   }
+              }
+      });
+    $(function() {
+         var css_string = '' +
+                  '#vakata-dragged ins { display:block; text-decoration:none; width:16px; height:16px; margin:0 0 0 0; padding:0; position:absolute; top:4px; left:4px; ' +
+                      ' -moz-border-radius:4px; border-radius:4px; -webkit-border-radius:4px; ' +
+                    '} ' +
+                 '#vakata-dragged .jstree-ok { background:green; } ' +
+                  '#vakata-dragged .jstree-invalid { background:red; } ' +
+                       '#jstree-marker { padding:0; margin:0; font-size:12px; overflow:hidden; height:12px; width:8px; position:absolute; top:-30px; z-index:10001; background-repeat:no-repeat; display:none; background-color:transparent; text-shadow:1px 1px 1px white; color:black; line-height:10px; } ' +
+                      '#jstree-marker-line { padding:0; margin:0; line-height:0%; font-size:1px; overflow:hidden; height:1px; width:100px; position:absolute; top:-30px; z-index:10000; background-repeat:no-repeat; display:none; background-color:#456c43; ' +
+                     ' cursor:pointer; border:1px solid #eeeeee; border-left:0; -moz-box-shadow: 0px 0px 2px #666; -webkit-box-shadow: 0px 0px 2px #666; box-shadow: 0px 0px 2px #666; ' +
+                  ' -moz-border-radius:1px; border-radius:1px; -webkit-border-radius:1px; ' +
+                    '}' +
+                  '';
+            $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
+                m = $("<div />").attr({ id : "jstree-marker" }).hide().html("&raquo;")
+                 .bind("mouseleave mouseenter", function (e) {
+                          m.hide();
+                              ml.hide();
+                             e.preventDefault();
+                            e.stopImmediatePropagation();
+                          return false;
+                  })
+                     .appendTo("body");
+             ml = $("<div />").attr({ id : "jstree-marker-line" }).hide()
+                   .bind("mouseup", function (e) {
+                                if(r && r.length) {
+                                    r.children("a").trigger(e);
+                                    e.preventDefault();
+                                    e.stopImmediatePropagation();
+                                  return false;
+                          }
+                      })
+                     .bind("mouseleave", function (e) {
+                             var rt = $(e.relatedTarget);
+                           if(rt.is(".jstree") || rt.closest(".jstree").length === 0) {
+                                   if(r && r.length) {
+                                            r.children("a").trigger(e);
+                                            m.hide();
+                                              ml.hide();
+                                             e.preventDefault();
+                                            e.stopImmediatePropagation();
+                                          return false;
+                                  }
+                              }
+                      })
+                     .appendTo("body");
+             $(document).bind("drag_start.vakata", function (e, data) {
+                     if(data.data.jstree) { m.show(); if(ml) { ml.show(); } }
+               });
+            $(document).bind("drag_stop.vakata", function (e, data) {
+                      if(data.data.jstree) { m.hide(); if(ml) { ml.hide(); } }
+               });
+    });
+})(jQuery);
+//*/
+
+/*
+ * jsTree checkbox plugin
+ * Inserts checkboxes in front of every node
+ * Depends on the ui plugin
+ * DOES NOT WORK NICELY WITH MULTITREE DRAG'N'DROP
+ */
+(function ($) {
+     $.jstree.plugin("checkbox", {
+          __init : function () {
+                 this.data.checkbox.noui = this._get_settings().checkbox.override_ui;
+                   if(this.data.ui && this.data.checkbox.noui) {
+                          this.select_node = this.deselect_node = this.deselect_all = $.noop;
+                            this.get_selected = this.get_checked;
+                  }
+
+                     this.get_container()
+                           .bind("open_node.jstree create_node.jstree clean_node.jstree refresh.jstree", $.proxy(function (e, data) {
+                                             this._prepare_checkboxes(data.rslt.obj);
+                                       }, this))
+                              .bind("loaded.jstree", $.proxy(function (e) {
+                                          this._prepare_checkboxes();
+                                    }, this))
+                              .delegate( (this.data.ui && this.data.checkbox.noui ? "a" : "ins.jstree-checkbox") , "click.jstree", $.proxy(function (e) {
+                                            e.preventDefault();
+                                            if(this._get_node(e.target).hasClass("jstree-checked")) { this.uncheck_node(e.target); }
+                                               else { this.check_node(e.target); }
+                                            if(this.data.ui && this.data.checkbox.noui) {
+                                                  this.save_selected();
+                                                  if(this.data.cookies) { this.save_cookie("select_node"); }
+                                             }
+                                              else {
+                                                 e.stopImmediatePropagation();
+                                                  return false;
+                                          }
+                                      }, this));
+             },
+             defaults : {
+                   override_ui : false,
+                   two_state : false,
+                     real_checkboxes : false,
+                       checked_parent_open : true,
+                    real_checkboxes_names : function (n) { return [ ("check_" + (n[0].id || Math.ceil(Math.random() * 10000))) , 1]; }
+             },
+             __destroy : function () {
+                      this.get_container()
+                           .find("input.jstree-real-checkbox").removeClass("jstree-real-checkbox").end()
+                          .find("ins.jstree-checkbox").remove();
+         },
+             _fn : {
+                        _checkbox_notify : function (n, data) {
+                                if(data.checked) {
+                                     this.check_node(n, false);
+                             }
+                      },
+                     _prepare_checkboxes : function (obj) {
+                         obj = !obj || obj == -1 ? this.get_container().find("> ul > li") : this._get_node(obj);
+                                if(obj === false) { return; } // added for removing root nodes
+                         var c, _this = this, t, ts = this._get_settings().checkbox.two_state, rc = this._get_settings().checkbox.real_checkboxes, rcn = this._get_settings().checkbox.real_checkboxes_names;
+                           obj.each(function () {
+                                 t = $(this);
+                                   c = t.is("li") && (t.hasClass("jstree-checked") || (rc && t.children(":checked").length)) ? "jstree-checked" : "jstree-unchecked";
+                                     t.find("li").andSelf().each(function () {
+                                              var $t = $(this), nm;
+                                          $t.children("a" + (_this.data.languages ? "" : ":eq(0)") ).not(":has(.jstree-checkbox)").prepend("<ins class='jstree-checkbox'>&#160;</ins>").parent().not(".jstree-checked, .jstree-unchecked").addClass( ts ? "jstree-unchecked" : c );
+                                              if(rc) {
+                                                       if(!$t.children(":checkbox").length) {
+                                                         nm = rcn.call(_this, $t);
+                                                              $t.prepend("<input type='checkbox' class='jstree-real-checkbox' id='" + nm[0] + "' name='" + nm[0] + "' value='" + nm[1] + "' />");
+                                                    }
+                                                      else {
+                                                         $t.children(":checkbox").addClass("jstree-real-checkbox");
+                                                     }
+                                              }
+                                              if(!ts) {
+                                                      if(c === "jstree-checked" || $t.hasClass("jstree-checked") || $t.children(':checked').length) {
+                                                                $t.find("li").andSelf().addClass("jstree-checked").children(":checkbox").prop("checked", true);
+                                                        }
+                                              }
+                                              else {
+                                                 if($t.hasClass("jstree-checked") || $t.children(':checked').length) {
+                                                          $t.addClass("jstree-checked").children(":checkbox").prop("checked", true);
+                                                     }
+                                              }
+                                      });
+                            });
+                            if(!ts) {
+                                      obj.find(".jstree-checked").parent().parent().each(function () { _this._repair_state(this); });
+                                }
+                      },
+                     change_state : function (obj, state) {
+                         obj = this._get_node(obj);
+                             var coll = false, rc = this._get_settings().checkbox.real_checkboxes;
+                          if(!obj || obj === -1) { return false; }
+                               state = (state === false || state === true) ? state : obj.hasClass("jstree-checked");
+                          if(this._get_settings().checkbox.two_state) {
+                                  if(state) {
+                                            obj.removeClass("jstree-checked").addClass("jstree-unchecked");
+                                                if(rc) { obj.children(":checkbox").prop("checked", false); }
+                                   }
+                                      else {
+                                         obj.removeClass("jstree-unchecked").addClass("jstree-checked");
+                                                if(rc) { obj.children(":checkbox").prop("checked", true); }
+                                    }
+                              }
+                              else {
+                                 if(state) {
+                                            coll = obj.find("li").andSelf();
+                                               if(!coll.filter(".jstree-checked, .jstree-undetermined").length) { return false; }
+                                             coll.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
+                                           if(rc) { coll.children(":checkbox").prop("checked", false); }
+                                  }
+                                      else {
+                                         coll = obj.find("li").andSelf();
+                                               if(!coll.filter(".jstree-unchecked, .jstree-undetermined").length) { return false; }
+                                           coll.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
+                                           if(rc) { coll.children(":checkbox").prop("checked", true); }
+                                           if(this.data.ui) { this.data.ui.last_selected = obj; }
+                                         this.data.checkbox.last_selected = obj;
+                                        }
+                                      obj.parentsUntil(".jstree", "li").each(function () {
+                                           var $this = $(this);
+                                           if(state) {
+                                                    if($this.children("ul").children("li.jstree-checked, li.jstree-undetermined").length) {
+                                                                $this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
+                                                          if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").prop("checked", false); }
+                                                         return false;
+                                                  }
+                                                      else {
+                                                         $this.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
+                                                          if(rc) { $this.children(":checkbox").prop("checked", false); }
+                                                 }
+                                              }
+                                              else {
+                                                 if($this.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length) {
+                                                              $this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
+                                                          if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").prop("checked", false); }
+                                                         return false;
+                                                  }
+                                                      else {
+                                                         $this.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
+                                                          if(rc) { $this.children(":checkbox").prop("checked", true); }
+                                                  }
+                                              }
+                                      });
+                            }
+                              if(this.data.ui && this.data.checkbox.noui) { this.data.ui.selected = this.get_checked(); }
+                            this.__callback(obj);
+                          return true;
+                   },
+                     check_node : function (obj) {
+                          if(this.change_state(obj, false)) {
+                                    obj = this._get_node(obj);
+                                     if(this._get_settings().checkbox.checked_parent_open) {
+                                                var t = this;
+                                          obj.parents(".jstree-closed").each(function () { t.open_node(this, false, true); });
+                                   }
+                                      this.__callback({ "obj" : obj });
+                              }
+                      },
+                     uncheck_node : function (obj) {
+                                if(this.change_state(obj, true)) { this.__callback({ "obj" : this._get_node(obj) }); }
+                 },
+                     check_all : function () {
+                              var _this = this,
+                                      coll = this._get_settings().checkbox.two_state ? this.get_container_ul().find("li") : this.get_container_ul().children("li");
+                          coll.each(function () {
+                                        _this.change_state(this, false);
+                               });
+                            this.__callback();
+                     },
+                     uncheck_all : function () {
+                            var _this = this,
+                                      coll = this._get_settings().checkbox.two_state ? this.get_container_ul().find("li") : this.get_container_ul().children("li");
+                          coll.each(function () {
+                                        _this.change_state(this, true);
+                                });
+                            this.__callback();
+                     },
+
+                    is_checked : function(obj) {
+                           obj = this._get_node(obj);
+                             return obj.length ? obj.is(".jstree-checked") : false;
+                 },
+                     get_checked : function (obj, get_all) {
+                                obj = !obj || obj === -1 ? this.get_container() : this._get_node(obj);
+                         return get_all || this._get_settings().checkbox.two_state ? obj.find(".jstree-checked") : obj.find("> ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked");
+                     },
+                     get_unchecked : function (obj, get_all) {
+                              obj = !obj || obj === -1 ? this.get_container() : this._get_node(obj);
+                         return get_all || this._get_settings().checkbox.two_state ? obj.find(".jstree-unchecked") : obj.find("> ul > .jstree-unchecked, .jstree-undetermined > ul > .jstree-unchecked");
+                       },
+
+                    show_checkboxes : function () { this.get_container().children("ul").removeClass("jstree-no-checkboxes"); },
+                    hide_checkboxes : function () { this.get_container().children("ul").addClass("jstree-no-checkboxes"); },
+
+                      _repair_state : function (obj) {
+                               obj = this._get_node(obj);
+                             if(!obj.length) { return; }
+                            if(this._get_settings().checkbox.two_state) {
+                                  obj.find('li').andSelf().not('.jstree-checked').removeClass('jstree-undetermined').addClass('jstree-unchecked').children(':checkbox').prop('checked', true);
+                                   return;
+                                }
+                              var rc = this._get_settings().checkbox.real_checkboxes,
+                                        a = obj.find("> ul > .jstree-checked").length,
+                                 b = obj.find("> ul > .jstree-undetermined").length,
+                                    c = obj.find("> ul > li").length;
+                              if(c === 0) { if(obj.hasClass("jstree-undetermined")) { this.change_state(obj, false); } }
+                             else if(a === 0 && b === 0) { this.change_state(obj, true); }
+                          else if(a === c) { this.change_state(obj, false); }
+                            else {
+                                 obj.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
+                                     if(rc) { obj.parentsUntil(".jstree", "li").andSelf().children(":checkbox").prop("checked", false); }
+                           }
+                      },
+                     reselect : function () {
+                               if(this.data.ui && this.data.checkbox.noui) {
+                                  var _this = this,
+                                              s = this.data.ui.to_select;
+                                    s = $.map($.makeArray(s), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
+                                     this.deselect_all();
+                                   $.each(s, function (i, val) { _this.check_node(val); });
+                                       this.__callback();
+                             }
+                              else {
+                                 this.__call_old();
+                             }
+                      },
+                     save_loaded : function () {
+                            var _this = this;
+                              this.data.core.to_load = [];
+                           this.get_container_ul().find("li.jstree-closed.jstree-undetermined").each(function () {
+                                        if(this.id) { _this.data.core.to_load.push("#" + this.id); }
+                           });
+                    }
+              }
+      });
+    $(function() {
+         var css_string = '.jstree .jstree-real-checkbox { display:none; } ';
+           $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
+        });
+})(jQuery);
+//*/
+
+/*
+ * jsTree XML plugin
+ * The XML data store. Datastores are build by overriding the `load_node` and `_is_loaded` functions.
+ */
+(function ($) {
+        $.vakata.xslt = function (xml, xsl, callback) {
+                var rs = "", xm, xs, processor, support;
+               // TODO: IE9 no XSLTProcessor, no document.recalc
+              if(document.recalc) {
+                  xm = document.createElement('xml');
+                    xs = document.createElement('xml');
+                    xm.innerHTML = xml;
+                    xs.innerHTML = xsl;
+                    $("body").append(xm).append(xs);
+                       setTimeout( (function (xm, xs, callback) {
+                             return function () {
+                                   callback.call(null, xm.transformNode(xs.XMLDocument));
+                                 setTimeout( (function (xm, xs) { return function () { $(xm).remove(); $(xs).remove(); }; })(xm, xs), 200);
+                             };
+                     })(xm, xs, callback), 100);
+                    return true;
+           }
+              if(typeof window.DOMParser !== "undefined" && typeof window.XMLHttpRequest !== "undefined" && typeof window.XSLTProcessor === "undefined") {
+                   xml = new DOMParser().parseFromString(xml, "text/xml");
+                        xsl = new DOMParser().parseFromString(xsl, "text/xml");
+                        // alert(xml.transformNode());
+                 // callback.call(null, new XMLSerializer().serializeToString(rs));
+
+            }
+              if(typeof window.DOMParser !== "undefined" && typeof window.XMLHttpRequest !== "undefined" && typeof window.XSLTProcessor !== "undefined") {
+                   processor = new XSLTProcessor();
+                       support = $.isFunction(processor.transformDocument) ? (typeof window.XMLSerializer !== "undefined") : true;
+                    if(!support) { return false; }
+                 xml = new DOMParser().parseFromString(xml, "text/xml");
+                        xsl = new DOMParser().parseFromString(xsl, "text/xml");
+                        if($.isFunction(processor.transformDocument)) {
+                                rs = document.implementation.createDocument("", "", null);
+                             processor.transformDocument(xml, xsl, rs, null);
+                               callback.call(null, new XMLSerializer().serializeToString(rs));
+                                return true;
+                   }
+                      else {
+                         processor.importStylesheet(xsl);
+                               rs = processor.transformToFragment(xml, document);
+                             callback.call(null, $("<div />").append(rs).html());
+                           return true;
+                   }
+              }
+              return false;
+  };
+     var xsl = {
+            'nest' : '<' + '?xml version="1.0" encoding="utf-8" ?>' +
+                      '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >' +
+                   '<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/html" />' +
+                        '<xsl:template match="/">' +
+                   '   <xsl:call-template name="nodes">' +
+                  '            <xsl:with-param name="node" select="/root" />' +
+                    '  </xsl:call-template>' +
+                      '</xsl:template>' +
+                    '<xsl:template name="nodes">' +
+                        '      <xsl:param name="node" />' +
+                 '     <ul>' +
+                      '        <xsl:for-each select="$node/item">' +
+                        '              <xsl:variable name="children" select="count(./item) &gt; 0" />' +
+                   '           <li>' +
+                     '                 <xsl:attribute name="class">' +
+                    '                          <xsl:if test="position() = last()">jstree-last </xsl:if>' +
+                       '                               <xsl:choose>' +
+                   '                                   <xsl:when test="@state = \'open\'">jstree-open </xsl:when>' +
+                    '                                  <xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>' +
+                   '                                   <xsl:otherwise>jstree-leaf </xsl:otherwise>' +
+                   '                           </xsl:choose>' +
+                  '                            <xsl:value-of select="@class" />' +
+                       '                       </xsl:attribute>' +
+                        '                      <xsl:for-each select="@*">' +
+                      '                                <xsl:if test="name() != \'class\' and name() != \'state\' and name() != \'hasChildren\'">' +
+                      '                                        <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
+                    '                          </xsl:if>' +
+                      '                        </xsl:for-each>' +
+                 '     <ins class="jstree-icon"><xsl:text>&#xa0;</xsl:text></ins>' +
+                        '                      <xsl:for-each select="content/name">' +
+                    '                          <a>' +
+                    '                          <xsl:attribute name="href">' +
+                    '                                  <xsl:choose>' +
+                  '                                    <xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>' +
+                     '                                 <xsl:otherwise>#</xsl:otherwise>' +
+                      '                                        </xsl:choose>' +
+                 '                             </xsl:attribute>' +
+                       '                               <xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>' +
+                   '                           <xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>' +
+                   '                           <xsl:for-each select="@*">' +
+                     '                                 <xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">' +
+                    '                                          <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
+                   '                                   </xsl:if>' +
+                     '                         </xsl:for-each>' +
+                        '                                      <ins>' +
+                 '                                             <xsl:attribute name="class">jstree-icon ' +
+                     '                                                 <xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>' +
+                   '                                           </xsl:attribute>' +
+                     '                                         <xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>' +
+                    '                                          <xsl:text>&#xa0;</xsl:text>' +
+                  '                                    </ins>' +
+                        '                                      <xsl:copy-of select="./child::node()" />' +
+                      '                                </a>' +
+                   '                   </xsl:for-each>' +
+                 '                     <xsl:if test="$children or @hasChildren"><xsl:call-template name="nodes"><xsl:with-param name="node" select="current()" /></xsl:call-template></xsl:if>' +
+                 '             </li>' +
+                    '  </xsl:for-each>' +
+                   '   </ul>' +
+                     '</xsl:template>' +
+                    '</xsl:stylesheet>',
+
+          'flat' : '<' + '?xml version="1.0" encoding="utf-8" ?>' +
+                      '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >' +
+                   '<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/xml" />' +
+                 '<xsl:template match="/">' +
+                   '   <ul>' +
+                      '        <xsl:for-each select="//item[not(@parent_id) or @parent_id=0 or not(@parent_id = //item/@id)]">' + /* the last `or` may be removed */
+                        '              <xsl:call-template name="nodes">' +
+                 '                     <xsl:with-param name="node" select="." />' +
+                       '                       <xsl:with-param name="is_last" select="number(position() = last())" />' +
+                  '            </xsl:call-template>' +
+                     ' </xsl:for-each>' +
+                   '   </ul>' +
+                     '</xsl:template>' +
+                    '<xsl:template name="nodes">' +
+                        '      <xsl:param name="node" />' +
+                 '     <xsl:param name="is_last" />' +
+                      '        <xsl:variable name="children" select="count(//item[@parent_id=$node/attribute::id]) &gt; 0" />' +
+                    '  <li>' +
+                      '        <xsl:attribute name="class">' +
+                      '                <xsl:if test="$is_last = true()">jstree-last </xsl:if>' +
+                   '           <xsl:choose>' +
+                     '                 <xsl:when test="@state = \'open\'">jstree-open </xsl:when>' +
+                      '                        <xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>' +
+                     '                 <xsl:otherwise>jstree-leaf </xsl:otherwise>' +
+                     '         </xsl:choose>' +
+                    '          <xsl:value-of select="@class" />' +
+                 '     </xsl:attribute>' +
+                  '    <xsl:for-each select="@*">' +
+                        '              <xsl:if test="name() != \'parent_id\' and name() != \'hasChildren\' and name() != \'class\' and name() != \'state\'">' +
+                    '          <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
+                       '               </xsl:if>' +
+                        '      </xsl:for-each>' +
+                   '   <ins class="jstree-icon"><xsl:text>&#xa0;</xsl:text></ins>' +
+                        '      <xsl:for-each select="content/name">' +
+                      '                <a>' +
+                      '                <xsl:attribute name="href">' +
+                      '                        <xsl:choose>' +
+                    '                  <xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>' +
+                       '                       <xsl:otherwise>#</xsl:otherwise>' +
+                        '                      </xsl:choose>' +
+                   '           </xsl:attribute>' +
+                 '             <xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>' +
+                     '         <xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>' +
+                     '         <xsl:for-each select="@*">' +
+                       '                       <xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">' +
+                      '                                <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
+                     '                 </xsl:if>' +
+                       '               </xsl:for-each>' +
+                  '                    <ins>' +
+                   '                           <xsl:attribute name="class">jstree-icon ' +
+                       '                                       <xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>' +
+                     '                         </xsl:attribute>' +
+                       '                               <xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>' +
+                      '                                <xsl:text>&#xa0;</xsl:text>' +
+                    '                  </ins>' +
+                  '                    <xsl:copy-of select="./child::node()" />' +
+                        '              </a>' +
+                     ' </xsl:for-each>' +
+                   '   <xsl:if test="$children">' +
+                 '             <ul>' +
+                     '         <xsl:for-each select="//item[@parent_id=$node/attribute::id]">' +
+                   '                   <xsl:call-template name="nodes">' +
+                        '                              <xsl:with-param name="node" select="." />' +
+                      '                                <xsl:with-param name="is_last" select="number(position() = last())" />' +
+                 '                     </xsl:call-template>' +
+                    '          </xsl:for-each>' +
+                  '            </ul>' +
+                    '  </xsl:if>' +
+                 '     </li>' +
+                     '</xsl:template>' +
+                    '</xsl:stylesheet>'
+    },
+     escape_xml = function(string) {
+                return string
+                  .toString()
+                    .replace(/&/g, '&amp;')
+                        .replace(/</g, '&lt;')
+                 .replace(/>/g, '&gt;')
+                 .replace(/"/g, '&quot;')
+                       .replace(/'/g, '&apos;');
+      };
+     $.jstree.plugin("xml_data", {
+          defaults : {
+                   data : false,
+                  ajax : false,
+                  xsl : "flat",
+                  clean_node : false,
+                    correct_state : true,
+                  get_skip_empty : false,
+                        get_include_preamble : true
+            },
+             _fn : {
+                        load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_xml(obj, function () { _this.__callback({ "obj" : _this._get_node(obj) }); s_call.call(this); }, e_call); },
+                     _is_loaded : function (obj) {
+                          var s = this._get_settings().xml_data;
+                         obj = this._get_node(obj);
+                             return obj == -1 || !obj || (!s.ajax && !$.isFunction(s.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").size() > 0;
+                        },
+                     load_node_xml : function (obj, s_call, e_call) {
+                               var s = this.get_settings().xml_data,
+                                  error_func = function () {},
+                                   success_func = function () {};
+
+                                obj = this._get_node(obj);
+                             if(obj && obj !== -1) {
+                                        if(obj.data("jstree_is_loading")) { return; }
+                                  else { obj.data("jstree_is_loading",true); }
+                           }
+                              switch(!0) {
+                                   case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";
+                                   case ($.isFunction(s.data)):
+                                           s.data.call(this, obj, $.proxy(function (d) {
+                                                  this.parse_xml(d, $.proxy(function (d) {
+                                                               if(d) {
+                                                                        d = d.replace(/ ?xmlns="[^"]*"/ig, "");
+                                                                        if(d.length > 10) {
+                                                                            d = $(d);
+                                                                              if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
+                                                                           else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree_is_loading"); }
+                                                                           if(s.clean_node) { this.clean_node(obj); }
+                                                                             if(s_call) { s_call.call(this); }
+                                                                      }
+                                                                      else {
+                                                                         if(obj && obj !== -1) {
+                                                                                        obj.children("a.jstree-loading").removeClass("jstree-loading");
+                                                                                        obj.removeData("jstree_is_loading");
+                                                                                   if(s.correct_state) {
+                                                                                          this.correct_state(obj);
+                                                                                               if(s_call) { s_call.call(this); }
+                                                                                      }
+                                                                              }
+                                                                              else {
+                                                                                 if(s.correct_state) {
+                                                                                          this.get_container().children("ul").empty();
+                                                                                           if(s_call) { s_call.call(this); }
+                                                                                      }
+                                                                              }
+                                                                      }
+                                                              }
+                                                      }, this));
+                                             }, this));
+                                             break;
+                                 case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):
+                                          if(!obj || obj == -1) {
+                                                        this.parse_xml(s.data, $.proxy(function (d) {
+                                                          if(d) {
+                                                                        d = d.replace(/ ?xmlns="[^"]*"/ig, "");
+                                                                        if(d.length > 10) {
+                                                                            d = $(d);
+                                                                              this.get_container().children("ul").empty().append(d.children());
+                                                                              if(s.clean_node) { this.clean_node(obj); }
+                                                                             if(s_call) { s_call.call(this); }
+                                                                      }
+                                                              }
+                                                              else {
+                                                                 if(s.correct_state) {
+                                                                          this.get_container().children("ul").empty();
+                                                                           if(s_call) { s_call.call(this); }
+                                                                      }
+                                                              }
+                                                      }, this));
+                                             }
+                                              break;
+                                 case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):
+                                             error_func = function (x, t, e) {
+                                                      var ef = this.get_settings().xml_data.ajax.error;
+                                                      if(ef) { ef.call(this, x, t, e); }
+                                                     if(obj !== -1 && obj.length) {
+                                                         obj.children("a.jstree-loading").removeClass("jstree-loading");
+                                                                obj.removeData("jstree_is_loading");
+                                                           if(t === "success" && s.correct_state) { this.correct_state(obj); }
+                                                    }
+                                                      else {
+                                                         if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }
+                                                        }
+                                                      if(e_call) { e_call.call(this); }
+                                              };
+                                             success_func = function (d, t, x) {
+                                                    d = x.responseText;
+                                                    var sf = this.get_settings().xml_data.ajax.success;
+                                                    if(sf) { d = sf.call(this,d,t,x) || d; }
+                                                       if(d === "" || (d && d.toString && d.toString().replace(/^[\s\n]+$/,"") === "")) {
+                                                             return error_func.call(this, x, t, "");
+                                                        }
+                                                      this.parse_xml(d, $.proxy(function (d) {
+                                                               if(d) {
+                                                                        d = d.replace(/ ?xmlns="[^"]*"/ig, "");
+                                                                        if(d.length > 10) {
+                                                                            d = $(d);
+                                                                              if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
+                                                                           else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree_is_loading"); }
+                                                                           if(s.clean_node) { this.clean_node(obj); }
+                                                                             if(s_call) { s_call.call(this); }
+                                                                      }
+                                                                      else {
+                                                                         if(obj && obj !== -1) {
+                                                                                        obj.children("a.jstree-loading").removeClass("jstree-loading");
+                                                                                        obj.removeData("jstree_is_loading");
+                                                                                   if(s.correct_state) {
+                                                                                          this.correct_state(obj);
+                                                                                               if(s_call) { s_call.call(this); }
+                                                                                      }
+                                                                              }
+                                                                              else {
+                                                                                 if(s.correct_state) {
+                                                                                          this.get_container().children("ul").empty();
+                                                                                           if(s_call) { s_call.call(this); }
+                                                                                      }
+                                                                              }
+                                                                      }
+                                                              }
+                                                      }, this));
+                                             };
+                                             s.ajax.context = this;
+                                         s.ajax.error = error_func;
+                                             s.ajax.success = success_func;
+                                         if(!s.ajax.dataType) { s.ajax.dataType = "xml"; }
+                                              if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
+                                              if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
+                                           $.ajax(s.ajax);
+                                                break;
+                         }
+                      },
+                     parse_xml : function (xml, callback) {
+                         var s = this._get_settings().xml_data;
+                         $.vakata.xslt(xml, xsl[s.xsl], callback);
+                      },
+                     get_xml : function (tp, obj, li_attr, a_attr, is_callback) {
+                           var result = "",
+                                       s = this._get_settings(),
+                                      _this = this,
+                                  tmp1, tmp2, li, a, lang;
+                               if(!tp) { tp = "flat"; }
+                               if(!is_callback) { is_callback = 0; }
+                          obj = this._get_node(obj);
+                             if(!obj || obj === -1) { obj = this.get_container().find("> ul > li"); }
+                               li_attr = $.isArray(li_attr) ? li_attr : [ "id", "class" ];
+                            if(!is_callback && this.data.types && $.inArray(s.types.type_attr, li_attr) === -1) { li_attr.push(s.types.type_attr); }
+
+                              a_attr = $.isArray(a_attr) ? a_attr : [ ];
+
+                            if(!is_callback) {
+                                     if(s.xml_data.get_include_preamble) {
+                                          result += '<' + '?xml version="1.0" encoding="UTF-8"?' + '>';
+                                  }
+                                      result += "<root>";
+                            }
+                              obj.each(function () {
+                                 result += "<item";
+                                     li = $(this);
+                                  $.each(li_attr, function (i, v) {
+                                              var t = li.attr(v);
+                                            if(!s.xml_data.get_skip_empty || typeof t !== "undefined") {
+                                                   result += " " + v + "=\"" + escape_xml((" " + (t || "")).replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")) + "\"";
+                                         }
+                                      });
+                                    if(li.hasClass("jstree-open")) { result += " state=\"open\""; }
+                                        if(li.hasClass("jstree-closed")) { result += " state=\"closed\""; }
+                                    if(tp === "flat") { result += " parent_id=\"" + escape_xml(is_callback) + "\""; }
+                                      result += ">";
+                                 result += "<content>";
+                                 a = li.children("a");
+                                  a.each(function () {
+                                           tmp1 = $(this);
+                                                lang = false;
+                                          result += "<name";
+                                             if($.inArray("languages", s.plugins) !== -1) {
+                                                 $.each(s.languages, function (k, z) {
+                                                          if(tmp1.hasClass(z)) { result += " lang=\"" + escape_xml(z) + "\""; lang = z; return false; }
+                                                  });
+                                            }
+                                              if(a_attr.length) {
+                                                    $.each(a_attr, function (k, z) {
+                                                               var t = tmp1.attr(z);
+                                                          if(!s.xml_data.get_skip_empty || typeof t !== "undefined") {
+                                                                   result += " " + z + "=\"" + escape_xml((" " + t || "").replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")) + "\"";
+                                                           }
+                                                      });
+                                            }
+                                              if(tmp1.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/^\s+$/ig,"").length) {
+                                                 result += ' icon="' + escape_xml(tmp1.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")) + '"';
+                                           }
+                                              if(tmp1.children("ins").get(0).style.backgroundImage.length) {
+                                                 result += ' icon="' + escape_xml(tmp1.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","").replace(/'/ig,"").replace(/"/ig,"")) + '"';
+                                              }
+                                              result += ">";
+                                         result += "<![CDATA[" + _this.get_text(tmp1, lang) + "]]>";
+                                            result += "</name>";
+                                   });
+                                    result += "</content>";
+                                        tmp2 = li[0].id || true;
+                                       li = li.find("> ul > li");
+                                     if(li.length) { tmp2 = _this.get_xml(tp, li, li_attr, a_attr, tmp2); }
+                                 else { tmp2 = ""; }
+                                    if(tp == "nest") { result += tmp2; }
+                                   result += "</item>";
+                                   if(tp == "flat") { result += tmp2; }
+                           });
+                            if(!is_callback) { result += "</root>"; }
+                              return result;
+                 }
+              }
+      });
+})(jQuery);
+//*/
+
+/*
+ * jsTree search plugin
+ * Enables both sync and async search on the tree
+ * DOES NOT WORK WITH JSON PROGRESSIVE RENDER
+ */
+(function ($) {
+   $.expr[':'].jstree_contains = function(a,i,m){
+         return (a.textContent || a.innerText || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;
+      };
+     $.expr[':'].jstree_title_contains = function(a,i,m) {
+          return (a.getAttribute("title") || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;
+   };
+     $.jstree.plugin("search", {
+            __init : function () {
+                 this.data.search.str = "";
+                     this.data.search.result = $();
+                 if(this._get_settings().search.show_only_matches) {
+                            this.get_container()
+                                   .bind("search.jstree", function (e, data) {
+                                            $(this).children("ul").find("li").hide().removeClass("jstree-last");
+                                           data.rslt.nodes.parentsUntil(".jstree").andSelf().show()
+                                                       .filter("ul").each(function () { $(this).children("li:visible").eq(-1).addClass("jstree-last"); });
+                                    })
+                                     .bind("clear_search.jstree", function () {
+                                             $(this).children("ul").find("li").css("display","").end().end().jstree("clean_node", -1);
+                                      });
+                    }
+              },
+             defaults : {
+                   ajax : false,
+                  search_method : "jstree_contains", // for case insensitive - jstree_contains
+                   show_only_matches : false
+              },
+             _fn : {
+                        search : function (str, skip_async) {
+                          if($.trim(str) === "") { this.clear_search(); return; }
+                                var s = this.get_settings().search,
+                                    t = this,
+                                      error_func = function () { },
+                                  success_func = function () { };
+                                this.data.search.str = str;
+
+                           if(!skip_async && s.ajax !== false && this.get_container_ul().find("li.jstree-closed:not(:has(ul)):eq(0)").length > 0) {
+                                       this.search.supress_callback = true;
+                                   error_func = function () { };
+                                  success_func = function (d, t, x) {
+                                            var sf = this.get_settings().search.ajax.success;
+                                              if(sf) { d = sf.call(this,d,t,x) || d; }
+                                               this.data.search.to_open = d;
+                                          this._search_open();
+                                   };
+                                     s.ajax.context = this;
+                                 s.ajax.error = error_func;
+                                     s.ajax.success = success_func;
+                                 if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, str); }
+                                      if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, str); }
+                                   if(!s.ajax.data) { s.ajax.data = { "search_string" : str }; }
+                                  if(!s.ajax.dataType || /^json/.exec(s.ajax.dataType)) { s.ajax.dataType = "json"; }
+                                    $.ajax(s.ajax);
+                                        return;
+                                }
+                              if(this.data.search.result.length) { this.clear_search(); }
+                            this.data.search.result = this.get_container().find("a" + (this.data.languages ? "." + this.get_lang() : "" ) + ":" + (s.search_method) + "(" + this.data.search.str + ")");
+                           this.data.search.result.addClass("jstree-search").parent().parents(".jstree-closed").each(function () {
+                                        t.open_node(this, false, true);
+                                });
+                            this.__callback({ nodes : this.data.search.result, str : str });
+                       },
+                     clear_search : function (str) {
+                                this.data.search.result.removeClass("jstree-search");
+                          this.__callback(this.data.search.result);
+                              this.data.search.result = $();
+                 },
+                     _search_open : function (is_callback) {
+                                var _this = this,
+                                      done = true,
+                                   current = [],
+                                  remaining = [];
+                                if(this.data.search.to_open.length) {
+                                  $.each(this.data.search.to_open, function (i, val) {
+                                           if(val == "#") { return true; }
+                                                if($(val).length && $(val).is(".jstree-closed")) { current.push(val); }
+                                                else { remaining.push(val); }
+                                  });
+                                    if(current.length) {
+                                           this.data.search.to_open = remaining;
+                                          $.each(current, function (i, val) {
+                                                    _this.open_node(val, function () { _this._search_open(true); });
+                                               });
+                                            done = false;
+                                  }
+                              }
+                              if(done) { this.search(this.data.search.str, true); }
+                  }
+              }
+      });
+})(jQuery);
+//*/
+
+/*
+ * jsTree contextmenu plugin
+ */
+(function ($) {
+      $.vakata.context = {
+           hide_on_mouseleave : false,
+
+           cnt         : $("<div id='vakata-contextmenu' />"),
+           vis         : false,
+          tgt          : false,
+          par          : false,
+          func : false,
+          data : false,
+          rtl          : false,
+          show : function (s, t, x, y, d, p, rtl) {
+                      $.vakata.context.rtl = !!rtl;
+                  var html = $.vakata.context.parse(s), h, w;
+                    if(!html) { return; }
+                  $.vakata.context.vis = true;
+                   $.vakata.context.tgt = t;
+                      $.vakata.context.par = p || t || null;
+                 $.vakata.context.data = d || null;
+                     $.vakata.context.cnt
+                           .html(html)
+                            .css({ "visibility" : "hidden", "display" : "block", "left" : 0, "top" : 0 });
+
+                        if($.vakata.context.hide_on_mouseleave) {
+                              $.vakata.context.cnt
+                                   .one("mouseleave", function(e) { $.vakata.context.hide(); });
+                  }
+
+                     h = $.vakata.context.cnt.height();
+                     w = $.vakata.context.cnt.width();
+                      if(x + w > $(document).width()) {
+                              x = $(document).width() - (w + 5);
+                             $.vakata.context.cnt.find("li > ul").addClass("right");
+                        }
+                      if(y + h > $(document).height()) {
+                             y = y - (h + t[0].offsetHeight);
+                               $.vakata.context.cnt.find("li > ul").addClass("bottom");
+                       }
+
+                     $.vakata.context.cnt
+                           .css({ "left" : x, "top" : y })
+                                .find("li:has(ul)")
+                                    .bind("mouseenter", function (e) {
+                                             var w = $(document).width(),
+                                                   h = $(document).height(),
+                                                      ul = $(this).children("ul").show();
+                                            if(w !== $(document).width()) { ul.toggleClass("right"); }
+                                             if(h !== $(document).height()) { ul.toggleClass("bottom"); }
+                                   })
+                                     .bind("mouseleave", function (e) {
+                                             $(this).children("ul").hide();
+                                 })
+                                     .end()
+                         .css({ "visibility" : "visible" })
+                             .show();
+                       $(document).triggerHandler("context_show.vakata");
+             },
+             hide      : function () {
+                   $.vakata.context.vis = false;
+                  $.vakata.context.cnt.attr("class","").css({ "visibility" : "hidden" });
+                        $(document).triggerHandler("context_hide.vakata");
+             },
+             parse     : function (s, is_callback) {
+                    if(!s) { return false; }
+                       var str = "",
+                          tmp = false,
+                           was_sep = true;
+                        if(!is_callback) { $.vakata.context.func = {}; }
+                       str += "<ul>";
+                 $.each(s, function (i, val) {
+                          if(!val) { return true; }
+                              $.vakata.context.func[i] = val.action;
+                         if(!was_sep && val.separator_before) {
+                                 str += "<li class='vakata-separator vakata-separator-before'></li>";
+                           }
+                              was_sep = false;
+                               str += "<li class='" + (val._class || "") + (val._disabled ? " jstree-contextmenu-disabled " : "") + "'><ins ";
+                                if(val.icon && val.icon.indexOf("/") === -1) { str += " class='" + val.icon + "' "; }
+                          if(val.icon && val.icon.indexOf("/") !== -1) { str += " style='background:url(" + val.icon + ") center center no-repeat;' "; }
+                         str += ">&#160;</ins><a href='#' rel='" + i + "'>";
+                            if(val.submenu) {
+                                      str += "<span style='float:" + ($.vakata.context.rtl ? "left" : "right") + ";'>&raquo;</span>";
+                                }
+                              str += val.label + "</a>";
+                             if(val.submenu) {
+                                      tmp = $.vakata.context.parse(val.submenu, true);
+                                       if(tmp) { str += tmp; }
+                                }
+                              str += "</li>";
+                                if(val.separator_after) {
+                                      str += "<li class='vakata-separator vakata-separator-after'></li>";
+                                    was_sep = true;
+                                }
+                      });
+                    str = str.replace(/<li class\='vakata-separator vakata-separator-after'\><\/li\>$/,"");
+                        str += "</ul>";
+                        $(document).triggerHandler("context_parse.vakata");
+                    return str.length > 10 ? str : false;
+          },
+             exec      : function (i) {
+                  if($.isFunction($.vakata.context.func[i])) {
+                           // if is string - eval and call it!
+                            $.vakata.context.func[i].call($.vakata.context.data, $.vakata.context.par);
+                            return true;
+                   }
+                      else { return false; }
+         }
+      };
+     $(function () {
+                var css_string = '' +
+                  '#vakata-contextmenu { display:block; visibility:hidden; left:0; top:-200px; position:absolute; margin:0; padding:0; min-width:180px; background:#ebebeb; border:1px solid silver; z-index:10000; *width:180px; } ' +
+                  '#vakata-contextmenu ul { min-width:180px; *width:180px; } ' +
+                 '#vakata-contextmenu ul, #vakata-contextmenu li { margin:0; padding:0; list-style-type:none; display:block; } ' +
+                      '#vakata-contextmenu li { line-height:20px; min-height:20px; position:relative; padding:0px; } ' +
+                     '#vakata-contextmenu li a { padding:1px 6px; line-height:17px; display:block; text-decoration:none; margin:1px 1px 0 1px; } ' +
+                        '#vakata-contextmenu li ins { float:left; width:16px; height:16px; text-decoration:none; margin-right:2px; } ' +
+                       '#vakata-contextmenu li a:hover, #vakata-contextmenu li.vakata-hover > a { background:gray; color:white; } ' +
+                 '#vakata-contextmenu li ul { display:none; position:absolute; top:-2px; left:100%; background:#ebebeb; border:1px solid gray; } ' +
+                    '#vakata-contextmenu .right { right:100%; left:auto; } ' +
+                     '#vakata-contextmenu .bottom { bottom:-1px; top:auto; } ' +
+                    '#vakata-contextmenu li.vakata-separator { min-height:0; height:1px; line-height:1px; font-size:1px; overflow:hidden; margin:0 2px; background:silver; /* border-top:1px solid #fefefe; */ padding:0; } ';
+             $.vakata.css.add_sheet({ str : css_string, title : "vakata" });
+                $.vakata.context.cnt
+                   .delegate("a","click", function (e) { e.preventDefault(); })
+                   .delegate("a","mouseup", function (e) {
+                                if(!$(this).parent().hasClass("jstree-contextmenu-disabled") && $.vakata.context.exec($(this).attr("rel"))) {
+                                  $.vakata.context.hide();
+                               }
+                              else { $(this).blur(); }
+                       })
+                     .delegate("a","mouseover", function () {
+                               $.vakata.context.cnt.find(".vakata-hover").removeClass("vakata-hover");
+                        })
+                     .appendTo("body");
+             $(document).bind("mousedown", function (e) { if($.vakata.context.vis && !$.contains($.vakata.context.cnt[0], e.target)) { $.vakata.context.hide(); } });
+               if(typeof $.hotkeys !== "undefined") {
+                 $(document)
+                            .bind("keydown", "up", function (e) {
+                                  if($.vakata.context.vis) {
+                                             var o = $.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").prevAll("li:not(.vakata-separator)").first();
+                                             if(!o.length) { o = $.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").last(); }
+                                             o.addClass("vakata-hover");
+                                            e.stopImmediatePropagation();
+                                          e.preventDefault();
+                                    }
+                              })
+                             .bind("keydown", "down", function (e) {
+                                        if($.vakata.context.vis) {
+                                             var o = $.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").nextAll("li:not(.vakata-separator)").first();
+                                             if(!o.length) { o = $.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").first(); }
+                                            o.addClass("vakata-hover");
+                                            e.stopImmediatePropagation();
+                                          e.preventDefault();
+                                    }
+                              })
+                             .bind("keydown", "right", function (e) {
+                                       if($.vakata.context.vis) {
+                                             $.vakata.context.cnt.find(".vakata-hover").children("ul").show().children("li:not(.vakata-separator)").removeClass("vakata-hover").first().addClass("vakata-hover");
+                                           e.stopImmediatePropagation();
+                                          e.preventDefault();
+                                    }
+                              })
+                             .bind("keydown", "left", function (e) {
+                                        if($.vakata.context.vis) {
+                                             $.vakata.context.cnt.find(".vakata-hover").children("ul").hide().children(".vakata-separator").removeClass("vakata-hover");
+                                            e.stopImmediatePropagation();
+                                          e.preventDefault();
+                                    }
+                              })
+                             .bind("keydown", "esc", function (e) {
+                                 $.vakata.context.hide();
+                                       e.preventDefault();
+                            })
+                             .bind("keydown", "space", function (e) {
+                                       $.vakata.context.cnt.find(".vakata-hover").last().children("a").click();
+                                       e.preventDefault();
+                            });
+            }
+      });
+
+   $.jstree.plugin("contextmenu", {
+               __init : function () {
+                 this.get_container()
+                           .delegate("a", "contextmenu.jstree", $.proxy(function (e) {
+                                            e.preventDefault();
+                                            if(!$(e.currentTarget).hasClass("jstree-loading")) {
+                                                   this.show_contextmenu(e.currentTarget, e.pageX, e.pageY);
+                                              }
+                                      }, this))
+                              .delegate("a", "click.jstree", $.proxy(function (e) {
+                                          if(this.data.contextmenu) {
+                                                    $.vakata.context.hide();
+                                               }
+                                      }, this))
+                              .bind("destroy.jstree", $.proxy(function () {
+                                          // TODO: move this to descruct method
+                                          if(this.data.contextmenu) {
+                                                    $.vakata.context.hide();
+                                               }
+                                      }, this));
+                     $(document).bind("context_hide.vakata", $.proxy(function () { this.data.contextmenu = false; }, this));
+                },
+             defaults : {
+                   select_node : false, // requires UI plugin
+                     show_at_node : true,
+                   items : { // Could be a function that should return an object like this one
+                            "create" : {
+                                   "separator_before"  : false,
+                                    "separator_after"  : true,
+                                      "label"                          : "Create",
+                                 "action"                      : function (obj) { this.create(obj); }
+                              },
+                             "rename" : {
+                                   "separator_before"  : false,
+                                    "separator_after"  : false,
+                                     "label"                           : "Rename",
+                                 "action"                      : function (obj) { this.rename(obj); }
+                              },
+                             "remove" : {
+                                   "separator_before"  : false,
+                                    "icon"                             : false,
+                                     "separator_after" : false,
+                                     "label"                           : "Delete",
+                                 "action"                      : function (obj) { if(this.is_selected(obj)) { this.remove(); } else { this.remove(obj); } }
+                                },
+                             "ccp" : {
+                                      "separator_before"       : true,
+                                     "icon"                            : false,
+                                     "separator_after" : false,
+                                     "label"                           : "Edit",
+                                   "action"                    : false,
+                                    "submenu" : {
+                                          "cut" : {
+                                                      "separator_before"       : false,
+                                                    "separator_after"  : false,
+                                                     "label"                           : "Cut",
+                                                    "action"                   : function (obj) { this.cut(obj); }
+                                         },
+                                             "copy" : {
+                                                     "separator_before"        : false,
+                                                    "icon"                             : false,
+                                                     "separator_after" : false,
+                                                     "label"                           : "Copy",
+                                                   "action"                    : function (obj) { this.copy(obj); }
+                                                },
+                                             "paste" : {
+                                                    "separator_before" : false,
+                                                    "icon"                             : false,
+                                                     "separator_after" : false,
+                                                     "label"                           : "Paste",
+                                                  "action"                     : function (obj) { this.paste(obj); }
+                                               }
+                                      }
+                              }
+                      }
+              },
+             _fn : {
+                        show_contextmenu : function (obj, x, y) {
+                              obj = this._get_node(obj);
+                             var s = this.get_settings().contextmenu,
+                                       a = obj.children("a:visible:eq(0)"),
+                                   o = false,
+                                     i = false;
+                             if(s.select_node && this.data.ui && !this.is_selected(obj)) {
+                                  this.deselect_all();
+                                   this.select_node(obj, true);
+                           }
+                              if(s.show_at_node || typeof x === "undefined" || typeof y === "undefined") {
+                                   o = a.offset();
+                                        x = o.left;
+                                    y = o.top + this.data.core.li_height;
+                          }
+                              i = obj.data("jstree") && obj.data("jstree").contextmenu ? obj.data("jstree").contextmenu : s.items;
+                           if($.isFunction(i)) { i = i.call(this, obj); }
+                         this.data.contextmenu = true;
+                          $.vakata.context.show(i, a, x, y, this, obj, this._get_settings().core.rtl);
+                           if(this.data.themes) { $.vakata.context.cnt.attr("class", "jstree-" + this.data.themes.theme + "-context"); }
+                  }
+              }
+      });
+})(jQuery);
+//*/
+
+/*
+ * jsTree types plugin
+ * Adds support types of nodes
+ * You can set an attribute on each li node, that represents its type.
+ * According to the type setting the node may get custom icon/validation rules
+ */
+(function ($) {
+       $.jstree.plugin("types", {
+             __init : function () {
+                 var s = this._get_settings().types;
+                    this.data.types.attach_to = [];
+                        this.get_container()
+                           .bind("init.jstree", $.proxy(function () {
+                                             var types = s.types,
+                                                   attr  = s.type_attr,
+                                                   icons_css = "",
+                                                        _this = this;
+
+                                         $.each(types, function (i, tp) {
+                                                       $.each(tp, function (k, v) {
+                                                           if(!/^(max_depth|max_children|icon|valid_children)$/.test(k)) { _this.data.types.attach_to.push(k); }
+                                                  });
+                                                    if(!tp.icon) { return true; }
+                                                  if( tp.icon.image || tp.icon.position) {
+                                                               if(i == "default")      { icons_css += '.jstree-' + _this.get_index() + ' a > .jstree-icon { '; }
+                                                           else                                { icons_css += '.jstree-' + _this.get_index() + ' li[' + attr + '="' + i + '"] > a > .jstree-icon { '; }
+                                                               if(tp.icon.image)       { icons_css += ' background-image:url(' + tp.icon.image + '); '; }
+                                                           if(tp.icon.position){ icons_css += ' background-position:' + tp.icon.position + '; '; }
+                                                                else                           { icons_css += ' background-position:0 0; '; }
+                                                         icons_css += '} ';
+                                                     }
+                                              });
+                                            if(icons_css !== "") { $.vakata.css.add_sheet({ 'str' : icons_css, title : "jstree-types" }); }
+                                        }, this))
+                              .bind("before.jstree", $.proxy(function (e, data) {
+                                            var s, t,
+                                                      o = this._get_settings().types.use_data ? this._get_node(data.args[0]) : false,
+                                                        d = o && o !== -1 && o.length ? o.data("jstree") : false;
+                                              if(d && d.types && d.types[data.func] === false) { e.stopImmediatePropagation(); return false; }
+                                               if($.inArray(data.func, this.data.types.attach_to) !== -1) {
+                                                   if(!data.args[0] || (!data.args[0].tagName && !data.args[0].jquery)) { return; }
+                                                       s = this._get_settings().types.types;
+                                                  t = this._get_type(data.args[0]);
+                                                      if(
+                                                            (
+                                                                      (s[t] && typeof s[t][data.func] !== "undefined") ||
+                                                                    (s["default"] && typeof s["default"][data.func] !== "undefined")
+                                                               ) && this._check(data.func, data.args[0]) === false
+                                                    ) {
+                                                            e.stopImmediatePropagation();
+                                                          return false;
+                                                  }
+                                              }
+                                      }, this));
+                     if(is_ie6) {
+                           this.get_container()
+                                   .bind("load_node.jstree set_type.jstree", $.proxy(function (e, data) {
+                                                 var r = data && data.rslt && data.rslt.obj && data.rslt.obj !== -1 ? this._get_node(data.rslt.obj).parent() : this.get_container_ul(),
+                                                         c = false,
+                                                             s = this._get_settings().types;
+                                                        $.each(s.types, function (i, tp) {
+                                                             if(tp.icon && (tp.icon.image || tp.icon.position)) {
+                                                                   c = i === "default" ? r.find("li > a > .jstree-icon") : r.find("li[" + s.type_attr + "='" + i + "'] > a > .jstree-icon");
+                                                                      if(tp.icon.image) { c.css("backgroundImage","url(" + tp.icon.image + ")"); }
+                                                                   c.css("backgroundPosition", tp.icon.position || "0 0");
+                                                                }
+                                                      });
+                                            }, this));
+                     }
+              },
+             defaults : {
+                   // defines maximum number of root nodes (-1 means unlimited, -2 means disable max_children checking)
+                   max_children                : -1,
+                    // defines the maximum depth of the tree (-1 means unlimited, -2 means disable max_depth checking)
+                     max_depth                 : -1,
+                      // defines valid node types for the root nodes
+                 valid_children                : "all",
+
+                      // whether to use $.data
+                       use_data : false,
+                      // where is the type stores (the rel attribute of the LI element)
+                      type_attr : "rel",
+                     // a list of types
+                     types : {
+                              // the default type
+                            "default" : {
+                                  "max_children"       : -1,
+                                   "max_depth"         : -1,
+                                     "valid_children": "all"
+
+                                       // Bound functions - you can bind any other function here (using boolean or function)
+                                  //"select_node"      : true
+                         }
+                      }
+              },
+             _fn : {
+                        _types_notify : function (n, data) {
+                           if(data.type && this._get_settings().types.use_data) {
+                                 this.set_type(data.type, n);
+                           }
+                      },
+                     _get_type : function (obj) {
+                           obj = this._get_node(obj);
+                             return (!obj || !obj.length) ? false : obj.attr(this._get_settings().types.type_attr) || "default";
+                    },
+                     set_type : function (str, obj) {
+                               obj = this._get_node(obj);
+                             var ret = (!obj.length || !str) ? false : obj.attr(this._get_settings().types.type_attr, str);
+                         if(ret) { this.__callback({ obj : obj, type : str}); }
+                         return ret;
+                    },
+                     _check : function (rule, obj, opts) {
+                          obj = this._get_node(obj);
+                             var v = false, t = this._get_type(obj), d = 0, _this = this, s = this._get_settings().types, data = false;
+                             if(obj === -1) {
+                                       if(!!s[rule]) { v = s[rule]; }
+                                 else { return; }
+                               }
+                              else {
+                                 if(t === false) { return; }
+                                    data = s.use_data ? obj.data("jstree") : false;
+                                        if(data && data.types && typeof data.types[rule] !== "undefined") { v = data.types[rule]; }
+                                    else if(!!s.types[t] && typeof s.types[t][rule] !== "undefined") { v = s.types[t][rule]; }
+                                     else if(!!s.types["default"] && typeof s.types["default"][rule] !== "undefined") { v = s.types["default"][rule]; }
+                             }
+                              if($.isFunction(v)) { v = v.call(this, obj); }
+                         if(rule === "max_depth" && obj !== -1 && opts !== false && s.max_depth !== -2 && v !== 0) {
+                                    // also include the node itself - otherwise if root node it is not checked
+                                     obj.children("a:eq(0)").parentsUntil(".jstree","li").each(function (i) {
+                                               // check if current depth already exceeds global tree depth
+                                            if(s.max_depth !== -1 && s.max_depth - (i + 1) <= 0) { v = 0; return false; }
+                                          d = (i === 0) ? v : _this._check(rule, this, false);
+                                           // check if current node max depth is already matched or exceeded
+                                              if(d !== -1 && d - (i + 1) <= 0) { v = 0; return false; }
+                                              // otherwise - set the max depth to the current value minus current depth
+                                              if(d >= 0 && (d - (i + 1) < v || v < 0) ) { v = d - (i + 1); }
+                                         // if the global tree depth exists and it minus the nodes calculated so far is less than `v` or `v` is unlimited
+                                               if(s.max_depth >= 0 && (s.max_depth - (i + 1) < v || v < 0) ) { v = s.max_depth - (i + 1); }
+                                   });
+                            }
+                              return v;
+                      },
+                     check_move : function () {
+                             if(!this.__call_old()) { return false; }
+                               var m  = this._get_move(),
+                                     s  = m.rt._get_settings().types,
+                                       mc = m.rt._check("max_children", m.cr),
+                                        md = m.rt._check("max_depth", m.cr),
+                                   vc = m.rt._check("valid_children", m.cr),
+                                      ch = 0, d = 1, t;
+
+                             if(vc === "none") { return false; }
+                            if($.isArray(vc) && m.ot && m.ot._get_type) {
+                                  m.o.each(function () {
+                                         if($.inArray(m.ot._get_type(this), vc) === -1) { d = false; return false; }
+                                    });
+                                    if(d === false) { return false; }
+                              }
+                              if(s.max_children !== -2 && mc !== -1) {
+                                       ch = m.cr === -1 ? this.get_container().find("> ul > li").not(m.o).length : m.cr.find("> ul > li").not(m.o).length;
+                                    if(ch + m.o.length > mc) { return false; }
+                             }
+                              if(s.max_depth !== -2 && md !== -1) {
+                                  d = 0;
+                                 if(md === 0) { return false; }
+                                 if(typeof m.o.d === "undefined") {
+                                             // TODO: deal with progressive rendering and async when checking max_depth (how to know the depth of the moved node)
+                                           t = m.o;
+                                               while(t.length > 0) {
+                                                  t = t.find("> ul > li");
+                                                       d ++;
+                                          }
+                                              m.o.d = d;
+                                     }
+                                      if(md - m.o.d < 0) { return false; }
+                           }
+                              return true;
+                   },
+                     create_node : function (obj, position, js, callback, is_loaded, skip_check) {
+                          if(!skip_check && (is_loaded || this._is_loaded(obj))) {
+                                       var p  = (typeof position == "string" && position.match(/^before|after$/i) && obj !== -1) ? this._get_parent(obj) : this._get_node(obj),
+                                               s  = this._get_settings().types,
+                                               mc = this._check("max_children", p),
+                                           md = this._check("max_depth", p),
+                                              vc = this._check("valid_children", p),
+                                         ch;
+                                    if(typeof js === "string") { js = { data : js }; }
+                                     if(!js) { js = {}; }
+                                   if(vc === "none") { return false; }
+                                    if($.isArray(vc)) {
+                                            if(!js.attr || !js.attr[s.type_attr]) {
+                                                        if(!js.attr) { js.attr = {}; }
+                                                 js.attr[s.type_attr] = vc[0];
+                                          }
+                                              else {
+                                                 if($.inArray(js.attr[s.type_attr], vc) === -1) { return false; }
+                                               }
+                                      }
+                                      if(s.max_children !== -2 && mc !== -1) {
+                                               ch = p === -1 ? this.get_container().find("> ul > li").length : p.find("> ul > li").length;
+                                            if(ch + 1 > mc) { return false; }
+                                      }
+                                      if(s.max_depth !== -2 && md !== -1 && (md - 1) < 0) { return false; }
+                          }
+                              return this.__call_old(true, obj, position, js, callback, is_loaded, skip_check);
+                      }
+              }
+      });
+})(jQuery);
+//*/
+
+/*
+ * jsTree HTML plugin
+ * The HTML data store. Datastores are build by replacing the `load_node` and `_is_loaded` functions.
+ */
+(function ($) {
+       $.jstree.plugin("html_data", {
+         __init : function () {
+                 // this used to use html() and clean the whitespace, but this way any attached data was lost
+                   this.data.html_data.original_container_html = this.get_container().find(" > ul > li").clone(true);
+                     // remove white space from LI node - otherwise nodes appear a bit to the right
+                 this.data.html_data.original_container_html.find("li").andSelf().contents().filter(function() { return this.nodeType == 3; }).remove();
+                },
+             defaults : {
+                   data : false,
+                  ajax : false,
+                  correct_state : true
+           },
+             _fn : {
+                        load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_html(obj, function () { _this.__callback({ "obj" : _this._get_node(obj) }); s_call.call(this); }, e_call); },
+                    _is_loaded : function (obj) {
+                          obj = this._get_node(obj);
+                             return obj == -1 || !obj || (!this._get_settings().html_data.ajax && !$.isFunction(this._get_settings().html_data.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").size() > 0;
+                      },
+                     load_node_html : function (obj, s_call, e_call) {
+                              var d,
+                                 s = this.get_settings().html_data,
+                                     error_func = function () {},
+                                   success_func = function () {};
+                         obj = this._get_node(obj);
+                             if(obj && obj !== -1) {
+                                        if(obj.data("jstree_is_loading")) { return; }
+                                  else { obj.data("jstree_is_loading",true); }
+                           }
+                              switch(!0) {
+                                   case ($.isFunction(s.data)):
+                                           s.data.call(this, obj, $.proxy(function (d) {
+                                                  if(d && d !== "" && d.toString && d.toString().replace(/^[\s\n]+$/,"") !== "") {
+                                                               d = $(d);
+                                                              if(!d.is("ul")) { d = $("<ul />").append(d); }
+                                                         if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); }
+                                                         else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree_is_loading"); }
+                                                         this.clean_node(obj);
+                                                          if(s_call) { s_call.call(this); }
+                                                      }
+                                                      else {
+                                                         if(obj && obj !== -1) {
+                                                                        obj.children("a.jstree-loading").removeClass("jstree-loading");
+                                                                        obj.removeData("jstree_is_loading");
+                                                                   if(s.correct_state) {
+                                                                          this.correct_state(obj);
+                                                                               if(s_call) { s_call.call(this); }
+                                                                      }
+                                                              }
+                                                              else {
+                                                                 if(s.correct_state) {
+                                                                          this.get_container().children("ul").empty();
+                                                                           if(s_call) { s_call.call(this); }
+                                                                      }
+                                                              }
+                                                      }
+                                              }, this));
+                                             break;
+                                 case (!s.data && !s.ajax):
+                                             if(!obj || obj == -1) {
+                                                        this.get_container()
+                                                           .children("ul").empty()
+                                                                .append(this.data.html_data.original_container_html)
+                                                           .find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end()
+                                                                .filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");
+                                                  this.clean_node();
+                                             }
+                                              if(s_call) { s_call.call(this); }
+                                              break;
+                                 case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):
+                                          if(!obj || obj == -1) {
+                                                        d = $(s.data);
+                                                 if(!d.is("ul")) { d = $("<ul />").append(d); }
+                                                 this.get_container()
+                                                           .children("ul").empty().append(d.children())
+                                                           .find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end()
+                                                                .filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");
+                                                  this.clean_node();
+                                             }
+                                              if(s_call) { s_call.call(this); }
+                                              break;
+                                 case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):
+                                             obj = this._get_node(obj);
+                                             error_func = function (x, t, e) {
+                                                      var ef = this.get_settings().html_data.ajax.error;
+                                                     if(ef) { ef.call(this, x, t, e); }
+                                                     if(obj != -1 && obj.length) {
+                                                          obj.children("a.jstree-loading").removeClass("jstree-loading");
+                                                                obj.removeData("jstree_is_loading");
+                                                           if(t === "success" && s.correct_state) { this.correct_state(obj); }
+                                                    }
+                                                      else {
+                                                         if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }
+                                                        }
+                                                      if(e_call) { e_call.call(this); }
+                                              };
+                                             success_func = function (d, t, x) {
+                                                    var sf = this.get_settings().html_data.ajax.success;
+                                                   if(sf) { d = sf.call(this,d,t,x) || d; }
+                                                       if(d === "" || (d && d.toString && d.toString().replace(/^[\s\n]+$/,"") === "")) {
+                                                             return error_func.call(this, x, t, "");
+                                                        }
+                                                      if(d) {
+                                                                d = $(d);
+                                                              if(!d.is("ul")) { d = $("<ul />").append(d); }
+                                                         if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); }
+                                                         else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree_is_loading"); }
+                                                         this.clean_node(obj);
+                                                          if(s_call) { s_call.call(this); }
+                                                      }
+                                                      else {
+                                                         if(obj && obj !== -1) {
+                                                                        obj.children("a.jstree-loading").removeClass("jstree-loading");
+                                                                        obj.removeData("jstree_is_loading");
+                                                                   if(s.correct_state) {
+                                                                          this.correct_state(obj);
+                                                                               if(s_call) { s_call.call(this); }
+                                                                      }
+                                                              }
+                                                              else {
+                                                                 if(s.correct_state) {
+                                                                          this.get_container().children("ul").empty();
+                                                                           if(s_call) { s_call.call(this); }
+                                                                      }
+                                                              }
+                                                      }
+                                              };
+                                             s.ajax.context = this;
+                                         s.ajax.error = error_func;
+                                             s.ajax.success = success_func;
+                                         if(!s.ajax.dataType) { s.ajax.dataType = "html"; }
+                                             if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
+                                              if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
+                                           $.ajax(s.ajax);
+                                                break;
+                         }
+                      }
+              }
+      });
+    // include the HTML data plugin by default
+     $.jstree.defaults.plugins.push("html_data");
+})(jQuery);
+//*/
+
+/*
+ * jsTree themeroller plugin
+ * Adds support for jQuery UI themes. Include this at the end of your plugins list, also make sure "themes" is not included.
+ */
+(function ($) {
+        $.jstree.plugin("themeroller", {
+               __init : function () {
+                 var s = this._get_settings().themeroller;
+                      this.get_container()
+                           .addClass("ui-widget-content")
+                         .addClass("jstree-themeroller")
+                                .delegate("a","mouseenter.jstree", function (e) {
+                                      if(!$(e.currentTarget).hasClass("jstree-loading")) {
+                                           $(this).addClass(s.item_h);
+                                    }
+                              })
+                             .delegate("a","mouseleave.jstree", function () {
+                                       $(this).removeClass(s.item_h);
+                         })
+                             .bind("init.jstree", $.proxy(function (e, data) {
+                                              data.inst.get_container().find("> ul > li > .jstree-loading > ins").addClass("ui-icon-refresh");
+                                               this._themeroller(data.inst.get_container().find("> ul > li"));
+                                        }, this))
+                              .bind("open_node.jstree create_node.jstree", $.proxy(function (e, data) {
+                                              this._themeroller(data.rslt.obj);
+                                      }, this))
+                              .bind("loaded.jstree refresh.jstree", $.proxy(function (e) {
+                                           this._themeroller();
+                                   }, this))
+                              .bind("close_node.jstree", $.proxy(function (e, data) {
+                                                this._themeroller(data.rslt.obj);
+                                      }, this))
+                              .bind("delete_node.jstree", $.proxy(function (e, data) {
+                                               this._themeroller(data.rslt.parent);
+                                   }, this))
+                              .bind("correct_state.jstree", $.proxy(function (e, data) {
+                                             data.rslt.obj
+                                                  .children("ins.jstree-icon").removeClass(s.opened + " " + s.closed + " ui-icon").end()
+                                                 .find("> a > ins.ui-icon")
+                                                             .filter(function() {
+                                                                   return this.className.toString()
+                                                                               .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
+                                                                               .indexOf("ui-icon-") === -1;
+                                                           }).removeClass(s.item_open + " " + s.item_clsd).addClass(s.item_leaf || "jstree-no-icon");
+                                     }, this))
+                              .bind("select_node.jstree", $.proxy(function (e, data) {
+                                               data.rslt.obj.children("a").addClass(s.item_a);
+                                        }, this))
+                              .bind("deselect_node.jstree deselect_all.jstree", $.proxy(function (e, data) {
+                                         this.get_container()
+                                                   .find("a." + s.item_a).removeClass(s.item_a).end()
+                                                     .find("a.jstree-clicked").addClass(s.item_a);
+                                  }, this))
+                              .bind("dehover_node.jstree", $.proxy(function (e, data) {
+                                              data.rslt.obj.children("a").removeClass(s.item_h);
+                                     }, this))
+                              .bind("hover_node.jstree", $.proxy(function (e, data) {
+                                                this.get_container()
+                                                   .find("a." + s.item_h).not(data.rslt.obj).removeClass(s.item_h);
+                                               data.rslt.obj.children("a").addClass(s.item_h);
+                                        }, this))
+                              .bind("move_node.jstree", $.proxy(function (e, data) {
+                                         this._themeroller(data.rslt.o);
+                                                this._themeroller(data.rslt.op);
+                                       }, this));
+             },
+             __destroy : function () {
+                      var s = this._get_settings().themeroller,
+                              c = [ "ui-icon" ];
+                     $.each(s, function (i, v) {
+                            v = v.split(" ");
+                              if(v.length) { c = c.concat(v); }
+                      });
+                    this.get_container()
+                           .removeClass("ui-widget-content")
+                              .find("." + c.join(", .")).removeClass(c.join(" "));
+           },
+             _fn : {
+                        _themeroller : function (obj) {
+                                var s = this._get_settings().themeroller;
+                              obj = !obj || obj == -1 ? this.get_container_ul() : this._get_node(obj).parent();
+                              obj
+                                    .find("li.jstree-closed")
+                                              .children("ins.jstree-icon").removeClass(s.opened).addClass("ui-icon " + s.closed).end()
+                                               .children("a").addClass(s.item)
+                                                        .children("ins.jstree-icon").addClass("ui-icon")
+                                                               .filter(function() {
+                                                                   return this.className.toString()
+                                                                               .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
+                                                                               .indexOf("ui-icon-") === -1;
+                                                           }).removeClass(s.item_leaf + " " + s.item_open).addClass(s.item_clsd || "jstree-no-icon")
+                                                              .end()
+                                                 .end()
+                                         .end()
+                                 .end()
+                                 .find("li.jstree-open")
+                                                .children("ins.jstree-icon").removeClass(s.closed).addClass("ui-icon " + s.opened).end()
+                                               .children("a").addClass(s.item)
+                                                        .children("ins.jstree-icon").addClass("ui-icon")
+                                                               .filter(function() {
+                                                                   return this.className.toString()
+                                                                               .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
+                                                                               .indexOf("ui-icon-") === -1;
+                                                           }).removeClass(s.item_leaf + " " + s.item_clsd).addClass(s.item_open || "jstree-no-icon")
+                                                              .end()
+                                                 .end()
+                                         .end()
+                                 .end()
+                                 .find("li.jstree-leaf")
+                                                .children("ins.jstree-icon").removeClass(s.closed + " ui-icon " + s.opened).end()
+                                              .children("a").addClass(s.item)
+                                                        .children("ins.jstree-icon").addClass("ui-icon")
+                                                               .filter(function() {
+                                                                   return this.className.toString()
+                                                                               .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
+                                                                               .indexOf("ui-icon-") === -1;
+                                                           }).removeClass(s.item_clsd + " " + s.item_open).addClass(s.item_leaf || "jstree-no-icon");
+                     }
+              },
+             defaults : {
+                   "opened"    : "ui-icon-triangle-1-se",
+                    "closed"   : "ui-icon-triangle-1-e",
+                     "item"            : "ui-state-default",
+                  "item_h"     : "ui-state-hover",
+                   "item_a"    : "ui-state-active",
+                  "item_open"  : "ui-icon-folder-open",
+                   "item_clsd" : "ui-icon-folder-collapsed",
+                      "item_leaf"      : "ui-icon-document"
+               }
+      });
+    $(function() {
+         var css_string = '' +
+                  '.jstree-themeroller .ui-icon { overflow:visible; } ' +
+                        '.jstree-themeroller a { padding:0 2px; } ' +
+                  '.jstree-themeroller .jstree-no-icon { display:none; }';
+               $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
+        });
+})(jQuery);
+//*/
+
+/*
+ * jsTree unique plugin
+ * Forces different names amongst siblings (still a bit experimental)
+ * NOTE: does not check language versions (it will not be possible to have nodes with the same title, even in different languages)
+ */
+(function ($) {
+  $.jstree.plugin("unique", {
+            __init : function () {
+                 this.get_container()
+                           .bind("before.jstree", $.proxy(function (e, data) {
+                                            var nms = [], res = true, p, t;
+                                                if(data.func == "move_node") {
+                                                 // obj, ref, position, is_copy, is_prepared, skip_check
+                                                        if(data.args[4] === true) {
+                                                            if(data.args[0].o && data.args[0].o.length) {
+                                                                  data.args[0].o.children("a").each(function () { nms.push($(this).text().replace(/^\s+/g,"")); });
+                                                                      res = this._check_unique(nms, data.args[0].np.find("> ul > li").not(data.args[0].o), "move_node");
+                                                             }
+                                                      }
+                                              }
+                                              if(data.func == "create_node") {
+                                                       // obj, position, js, callback, is_loaded
+                                                      if(data.args[4] || this._is_loaded(data.args[0])) {
+                                                            p = this._get_node(data.args[0]);
+                                                              if(data.args[1] && (data.args[1] === "before" || data.args[1] === "after")) {
+                                                                  p = this._get_parent(data.args[0]);
+                                                                    if(!p || p === -1) { p = this.get_container(); }
+                                                               }
+                                                              if(typeof data.args[2] === "string") { nms.push(data.args[2]); }
+                                                               else if(!data.args[2] || !data.args[2].data) { nms.push(this._get_string("new_node")); }
+                                                               else { nms.push(data.args[2].data); }
+                                                          res = this._check_unique(nms, p.find("> ul > li"), "create_node");
+                                                     }
+                                              }
+                                              if(data.func == "rename_node") {
+                                                       // obj, val
+                                                    nms.push(data.args[1]);
+                                                        t = this._get_node(data.args[0]);
+                                                      p = this._get_parent(t);
+                                                       if(!p || p === -1) { p = this.get_container(); }
+                                                       res = this._check_unique(nms, p.find("> ul > li").not(t), "rename_node");
+                                              }
+                                              if(!res) {
+                                                     e.stopPropagation();
+                                                   return false;
+                                          }
+                                      }, this));
+             },
+             defaults : {
+                   error_callback : $.noop
+                },
+             _fn : {
+                        _check_unique : function (nms, p, func) {
+                              var cnms = [];
+                         p.children("a").each(function () { cnms.push($(this).text().replace(/^\s+/g,"")); });
+                          if(!cnms.length || !nms.length) { return true; }
+                               cnms = cnms.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");
+                           if((cnms.length + nms.length) != cnms.concat(nms).sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",").length) {
+                                    this._get_settings().unique.error_callback.call(null, nms, p, func);
+                                   return false;
+                          }
+                              return true;
+                   },
+                     check_move : function () {
+                             if(!this.__call_old()) { return false; }
+                               var p = this._get_move(), nms = [];
+                            if(p.o && p.o.length) {
+                                        p.o.children("a").each(function () { nms.push($(this).text().replace(/^\s+/g,"")); });
+                                 return this._check_unique(nms, p.np.find("> ul > li").not(p.o), "check_move");
+                         }
+                              return true;
+                   }
+              }
+      });
+})(jQuery);
+//*/
+
+/*
+ * jsTree wholerow plugin
+ * Makes select and hover work on the entire width of the node
+ * MAY BE HEAVY IN LARGE DOM
+ */
+(function ($) {
+     $.jstree.plugin("wholerow", {
+          __init : function () {
+                 if(!this.data.ui) { throw "jsTree wholerow: jsTree UI plugin not included."; }
+                 this.data.wholerow.html = false;
+                       this.data.wholerow.to = false;
+                 this.get_container()
+                           .bind("init.jstree", $.proxy(function (e, data) {
+                                              this._get_settings().core.animation = 0;
+                                       }, this))
+                              .bind("open_node.jstree create_node.jstree clean_node.jstree loaded.jstree", $.proxy(function (e, data) {
+                                              this._prepare_wholerow_span( data && data.rslt && data.rslt.obj ? data.rslt.obj : -1 );
+                                        }, this))
+                              .bind("search.jstree clear_search.jstree reopen.jstree after_open.jstree after_close.jstree create_node.jstree delete_node.jstree clean_node.jstree", $.proxy(function (e, data) {
+                                             if(this.data.to) { clearTimeout(this.data.to); }
+                                               this.data.to = setTimeout( (function (t, o) { return function() { t._prepare_wholerow_ul(o); }; })(this,  data && data.rslt && data.rslt.obj ? data.rslt.obj : -1), 0);
+                                        }, this))
+                              .bind("deselect_all.jstree", $.proxy(function (e, data) {
+                                              this.get_container().find(" > .jstree-wholerow .jstree-clicked").removeClass("jstree-clicked " + (this.data.themeroller ? this._get_settings().themeroller.item_a : "" ));
+                                     }, this))
+                              .bind("select_node.jstree deselect_node.jstree ", $.proxy(function (e, data) {
+                                         data.rslt.obj.each(function () {
+                                                       var ref = data.inst.get_container().find(" > .jstree-wholerow li:visible:eq(" + ( parseInt((($(this).offset().top - data.inst.get_container().offset().top + data.inst.get_container()[0].scrollTop) / data.inst.data.core.li_height),10)) + ")");
+                                                     // ref.children("a")[e.type === "select_node" ? "addClass" : "removeClass"]("jstree-clicked");
+                                                 ref.children("a").attr("class",data.rslt.obj.children("a").attr("class"));
+                                             });
+                                    }, this))
+                              .bind("hover_node.jstree dehover_node.jstree", $.proxy(function (e, data) {
+                                            this.get_container().find(" > .jstree-wholerow .jstree-hovered").removeClass("jstree-hovered " + (this.data.themeroller ? this._get_settings().themeroller.item_h : "" ));
+                                             if(e.type === "hover_node") {
+                                                  var ref = this.get_container().find(" > .jstree-wholerow li:visible:eq(" + ( parseInt(((data.rslt.obj.offset().top - this.get_container().offset().top + this.get_container()[0].scrollTop) / this.data.core.li_height),10)) + ")");
+                                                   // ref.children("a").addClass("jstree-hovered");
+                                                       ref.children("a").attr("class",data.rslt.obj.children(".jstree-hovered").attr("class"));
+                                               }
+                                      }, this))
+                              .delegate(".jstree-wholerow-span, ins.jstree-icon, li", "click.jstree", function (e) {
+                                         var n = $(e.currentTarget);
+                                            if(e.target.tagName === "A" || (e.target.tagName === "INS" && n.closest("li").is(".jstree-open, .jstree-closed"))) { return; }
+                                         n.closest("li").children("a:visible:eq(0)").click();
+                                           e.stopImmediatePropagation();
+                                  })
+                             .delegate("li", "mouseover.jstree", $.proxy(function (e) {
+                                             e.stopImmediatePropagation();
+                                          if($(e.currentTarget).children(".jstree-hovered, .jstree-clicked").length) { return false; }
+                                           this.hover_node(e.currentTarget);
+                                              return false;
+                                  }, this))
+                              .delegate("li", "mouseleave.jstree", $.proxy(function (e) {
+                                            if($(e.currentTarget).children("a").hasClass("jstree-hovered").length) { return; }
+                                             this.dehover_node(e.currentTarget);
+                                    }, this));
+                     if(is_ie7 || is_ie6) {
+                         $.vakata.css.add_sheet({ str : ".jstree-" + this.get_index() + " { position:relative; } ", title : "jstree" });
+                        }
+              },
+             defaults : {
+           },
+             __destroy : function () {
+                      this.get_container().children(".jstree-wholerow").remove();
+                    this.get_container().find(".jstree-wholerow-span").remove();
+           },
+             _fn : {
+                        _prepare_wholerow_span : function (obj) {
+                              obj = !obj || obj == -1 ? this.get_container().find("> ul > li") : this._get_node(obj);
+                                if(obj === false) { return; } // added for removing root nodes
+                         obj.each(function () {
+                                 $(this).find("li").andSelf().each(function () {
+                                                var $t = $(this);
+                                              if($t.children(".jstree-wholerow-span").length) { return true; }
+                                               $t.prepend("<span class='jstree-wholerow-span' style='width:" + ($t.parentsUntil(".jstree","li").length * 18) + "px;'>&#160;</span>");
+                                 });
+                            });
+                    },
+                     _prepare_wholerow_ul : function () {
+                           var o = this.get_container().children("ul").eq(0), h = o.html();
+                               o.addClass("jstree-wholerow-real");
+                            if(this.data.wholerow.last_html !== h) {
+                                       this.data.wholerow.last_html = h;
+                                      this.get_container().children(".jstree-wholerow").remove();
+                                    this.get_container().append(
+                                           o.clone().removeClass("jstree-wholerow-real")
+                                                  .wrapAll("<div class='jstree-wholerow' />").parent()
+                                                   .width(o.parent()[0].scrollWidth)
+                                                      .css("top", (o.height() + ( is_ie7 ? 5 : 0)) * -1 )
+                                                    .find("li[id]").each(function () { this.removeAttribute("id"); }).end()
+                                        );
+                             }
+                      }
+              }
+      });
+    $(function() {
+         var css_string = '' +
+                  '.jstree .jstree-wholerow-real { position:relative; z-index:1; } ' +
+                   '.jstree .jstree-wholerow-real li { cursor:pointer; } ' +
+                      '.jstree .jstree-wholerow-real a { border-left-color:transparent !important; border-right-color:transparent !important; } ' +
+                  '.jstree .jstree-wholerow { position:relative; z-index:0; height:0; } ' +
+                      '.jstree .jstree-wholerow ul, .jstree .jstree-wholerow li { width:100%; } ' +
+                  '.jstree .jstree-wholerow, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li, .jstree .jstree-wholerow a { margin:0 !important; padding:0 !important; } ' +
+                     '.jstree .jstree-wholerow, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li { background:transparent !important; }' +
+                  '.jstree .jstree-wholerow ins, .jstree .jstree-wholerow span, .jstree .jstree-wholerow input { display:none !important; }' +
+                   '.jstree .jstree-wholerow a, .jstree .jstree-wholerow a:hover { text-indent:-9999px; !important; width:100%; padding:0 !important; border-right-width:0px !important; border-left-width:0px !important; } ' +
+                  '.jstree .jstree-wholerow-span { position:absolute; left:0; margin:0px; padding:0; height:18px; border-width:0; padding:0; z-index:0; }';
+              if(is_ff2) {
+                   css_string += '' +
+                             '.jstree .jstree-wholerow a { display:block; height:18px; margin:0; padding:0; border:0; } ' +
+                         '.jstree .jstree-wholerow-real a { border-color:transparent !important; } ';
+           }
+              if(is_ie7 || is_ie6) {
+                 css_string += '' +
+                             '.jstree .jstree-wholerow, .jstree .jstree-wholerow li, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow a { margin:0; padding:0; line-height:18px; } ' +
+                         '.jstree .jstree-wholerow a { display:block; height:18px; line-height:18px; overflow:hidden; } ';
+              }
+              $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
+        });
+})(jQuery);
+//*/
+
+/*
+* jsTree model plugin
+* This plugin gets jstree to use a class model to retrieve data, creating great dynamism
+*/
+(function ($) {
+     var nodeInterface = ["getChildren","getChildrenCount","getAttr","getName","getProps"],
+         validateInterface = function(obj, inter) {
+                     var valid = true;
+                      obj = obj || {};
+                       inter = [].concat(inter);
+                      $.each(inter, function (i, v) {
+                                if(!$.isFunction(obj[v])) { valid = false; return false; }
+                     });
+                    return valid;
+          };
+     $.jstree.plugin("model", {
+             __init : function () {
+                 if(!this.data.json_data) { throw "jsTree model: jsTree json_data plugin not included."; }
+                      this._get_settings().json_data.data = function (n, b) {
+                                var obj = (n == -1) ? this._get_settings().model.object : n.data("jstree_model");
+                              if(!validateInterface(obj, nodeInterface)) { return b.call(null, false); }
+                             if(this._get_settings().model.async) {
+                                 obj.getChildren($.proxy(function (data) {
+                                              this.model_done(data, b);
+                                      }, this));
+                             }
+                              else {
+                                 this.model_done(obj.getChildren(), b);
+                         }
+                      };
+             },
+             defaults : {
+                   object : false,
+                        id_prefix : false,
+                     async : false
+          },
+             _fn : {
+                        model_done : function (data, callback) {
+                               var ret = [],
+                                  s = this._get_settings(),
+                                      _this = this;
+
+                         if(!$.isArray(data)) { data = [data]; }
+                                $.each(data, function (i, nd) {
+                                        var r = nd.getProps() || {};
+                                   r.attr = nd.getAttr() || {};
+                                   if(nd.getChildrenCount()) { r.state = "closed"; }
+                                      r.data = nd.getName();
+                                 if(!$.isArray(r.data)) { r.data = [r.data]; }
+                                  if(_this.data.types && $.isFunction(nd.getType)) {
+                                             r.attr[s.types.type_attr] = nd.getType();
+                                      }
+                                      if(r.attr.id && s.model.id_prefix) { r.attr.id = s.model.id_prefix + r.attr.id; }
+                                      if(!r.metadata) { r.metadata = { }; }
+                                  r.metadata.jstree_model = nd;
+                                  ret.push(r);
+                           });
+                            callback.call(null, ret);
+                      }
+              }
+      });
+})(jQuery);
+//*/
+
+})();
\ No newline at end of file
diff --git a/koha-tmpl/opac-tmpl/lib/jquery/plugins/themes/classic/d.gif b/koha-tmpl/opac-tmpl/lib/jquery/plugins/themes/classic/d.gif
new file mode 100644 (file)
index 0000000..6eb0004
Binary files /dev/null and b/koha-tmpl/opac-tmpl/lib/jquery/plugins/themes/classic/d.gif differ
diff --git a/koha-tmpl/opac-tmpl/lib/jquery/plugins/themes/classic/d.png b/koha-tmpl/opac-tmpl/lib/jquery/plugins/themes/classic/d.png
new file mode 100644 (file)
index 0000000..275daec
Binary files /dev/null and b/koha-tmpl/opac-tmpl/lib/jquery/plugins/themes/classic/d.png differ
diff --git a/koha-tmpl/opac-tmpl/lib/jquery/plugins/themes/classic/dot_for_ie.gif b/koha-tmpl/opac-tmpl/lib/jquery/plugins/themes/classic/dot_for_ie.gif
new file mode 100644 (file)
index 0000000..c0cc5fd
Binary files /dev/null and b/koha-tmpl/opac-tmpl/lib/jquery/plugins/themes/classic/dot_for_ie.gif differ
diff --git a/koha-tmpl/opac-tmpl/lib/jquery/plugins/themes/classic/style.css b/koha-tmpl/opac-tmpl/lib/jquery/plugins/themes/classic/style.css
new file mode 100644 (file)
index 0000000..9fbab0e
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * jsTree classic theme 1.0
+ * Supported features: dots/no-dots, icons/no-icons, focused, loading
+ * Supported plugins: ui (hovered, clicked), checkbox, contextmenu, search
+ */
+
+.jstree-classic li,
+.jstree-classic ins { background-image:url("d.png"); background-repeat:no-repeat; background-color:transparent; }
+.jstree-classic li { background-position:-90px 0; background-repeat:repeat-y;  }
+.jstree-classic li.jstree-last { background:transparent; }
+.jstree-classic .jstree-open > ins { background-position:-72px 0; }
+.jstree-classic .jstree-closed > ins { background-position:-54px 0; }
+.jstree-classic .jstree-leaf > ins { background-position:-36px 0; }
+
+.jstree-classic .jstree-hovered { background:#e7f4f9; border:1px solid #e7f4f9; padding:0 2px 0 1px; }
+.jstree-classic .jstree-clicked { background:navy; border:1px solid navy; padding:0 2px 0 1px; color:white; }
+.jstree-classic a .jstree-icon { background-position:-56px -19px; }
+.jstree-classic .jstree-open > a .jstree-icon { background-position:-56px -36px; }
+.jstree-classic a.jstree-loading .jstree-icon { background:url("throbber.gif") center center no-repeat !important; }
+
+.jstree-classic.jstree-focused { background:white; }
+
+.jstree-classic .jstree-no-dots li,
+.jstree-classic .jstree-no-dots .jstree-leaf > ins { background:transparent; }
+.jstree-classic .jstree-no-dots .jstree-open > ins { background-position:-18px 0; }
+.jstree-classic .jstree-no-dots .jstree-closed > ins { background-position:0 0; }
+
+.jstree-classic .jstree-no-icons a .jstree-icon { display:none; }
+
+.jstree-classic .jstree-search { font-style:italic; }
+
+.jstree-classic .jstree-no-icons .jstree-checkbox { display:inline-block; }
+.jstree-classic .jstree-no-checkboxes .jstree-checkbox { display:none !important; }
+.jstree-classic .jstree-checked > a > .jstree-checkbox { background-position:-38px -19px; }
+.jstree-classic .jstree-unchecked > a > .jstree-checkbox { background-position:-2px -19px; }
+.jstree-classic .jstree-undetermined > a > .jstree-checkbox { background-position:-20px -19px; }
+.jstree-classic .jstree-checked > a > .jstree-checkbox:hover { background-position:-38px -37px; }
+.jstree-classic .jstree-unchecked > a > .jstree-checkbox:hover { background-position:-2px -37px; }
+.jstree-classic .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; }
+
+#vakata-dragged.jstree-classic ins { background:transparent !important; }
+#vakata-dragged.jstree-classic .jstree-ok { background:url("d.png") -2px -53px no-repeat !important; }
+#vakata-dragged.jstree-classic .jstree-invalid { background:url("d.png") -18px -53px no-repeat !important; }
+#jstree-marker.jstree-classic { background:url("d.png") -41px -57px no-repeat !important; text-indent:-100px; }
+
+.jstree-classic a.jstree-search { color:aqua; }
+.jstree-classic .jstree-locked a { color:silver; cursor:default; }
+
+#vakata-contextmenu.jstree-classic-context,
+#vakata-contextmenu.jstree-classic-context li ul { background:#f0f0f0; border:1px solid #979797; -moz-box-shadow: 1px 1px 2px #999; -webkit-box-shadow: 1px 1px 2px #999; box-shadow: 1px 1px 2px #999; }
+#vakata-contextmenu.jstree-classic-context li { }
+#vakata-contextmenu.jstree-classic-context a { color:black; }
+#vakata-contextmenu.jstree-classic-context a:hover,
+#vakata-contextmenu.jstree-classic-context .vakata-hover > a { padding:0 5px; background:#e8eff7; border:1px solid #aecff7; color:black; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; }
+#vakata-contextmenu.jstree-classic-context li.jstree-contextmenu-disabled a,
+#vakata-contextmenu.jstree-classic-context li.jstree-contextmenu-disabled a:hover { color:silver; background:transparent; border:0; padding:1px 4px; }
+#vakata-contextmenu.jstree-classic-context li.vakata-separator { background:white; border-top:1px solid #e0e0e0; margin:0; }
+#vakata-contextmenu.jstree-classic-context li ul { margin-left:-4px; }
+
+/* IE6 BEGIN */
+.jstree-classic li,
+.jstree-classic ins,
+#vakata-dragged.jstree-classic .jstree-invalid,
+#vakata-dragged.jstree-classic .jstree-ok,
+#jstree-marker.jstree-classic { _background-image:url("d.gif"); }
+.jstree-classic .jstree-open ins { _background-position:-72px 0; }
+.jstree-classic .jstree-closed ins { _background-position:-54px 0; }
+.jstree-classic .jstree-leaf ins { _background-position:-36px 0; }
+.jstree-classic .jstree-open a ins.jstree-icon { _background-position:-56px -36px; }
+.jstree-classic .jstree-closed a ins.jstree-icon { _background-position:-56px -19px; }
+.jstree-classic .jstree-leaf a ins.jstree-icon { _background-position:-56px -19px; }
+#vakata-contextmenu.jstree-classic-context ins { _display:none; }
+#vakata-contextmenu.jstree-classic-context li { _zoom:1; }
+.jstree-classic .jstree-undetermined a .jstree-checkbox { _background-position:-20px -19px; }
+.jstree-classic .jstree-checked a .jstree-checkbox { _background-position:-38px -19px; }
+.jstree-classic .jstree-unchecked a .jstree-checkbox { _background-position:-2px -19px; }
+/* IE6 END */
\ No newline at end of file
diff --git a/koha-tmpl/opac-tmpl/lib/jquery/plugins/themes/classic/throbber.gif b/koha-tmpl/opac-tmpl/lib/jquery/plugins/themes/classic/throbber.gif
new file mode 100644 (file)
index 0000000..5b33f7e
Binary files /dev/null and b/koha-tmpl/opac-tmpl/lib/jquery/plugins/themes/classic/throbber.gif differ
index e13c2e2..06e6bcf 100644 (file)
@@ -649,12 +649,11 @@ a.send {
 
 #toolbar input.editshelf,
 input.editshelf {
-    background-image : url("../../images/sprite.png");
-    background-position : 2px -732px;
-    background-repeat: no-repeat;
+    background : transparent url("../../images/sprite.png") 2px -732px no-repeat;
        border : 0;
        color : #006699;
        cursor : pointer;
+    filter: none;
        font-size : 100%;
        padding-left : 29px;
        text-decoration : none;
@@ -664,11 +663,12 @@ input.editshelf {
 #toolbar a.newshelf,
 a.newshelf {
     background-image: url("../../images/sprite.png"); /* add to list icon */
-    background-position: -4px -864px;
+    background-position: -4px -764px;
     background-repeat: no-repeat;
        border : 0;
        color : #006699;
        cursor : pointer;
+    filter: none;
        font-size : 100%;
        margin: 0 0.5em;
     padding-left : 23px;
@@ -683,12 +683,11 @@ a.newshelf.disabled {
 
 #toolbar input.deleteshelf,
 input.deleteshelf {
-    background-image : url("../../images/sprite.png");
-    background-position : 2px -685px;
-    background-repeat: no-repeat;
+    background : transparent url("../../images/sprite.png") 2px -685px no-repeat;
        border : 0;
        color : #006699;
        cursor : pointer;
+    filter: none;
        font-size : 100%;
     padding-left : 25px;
        text-decoration : none;
@@ -729,7 +728,7 @@ input.deleteshelf:active {
 
 #tagslist li { display : inline; }
 
-a.tag_results_add {
+a.tag_add {
     background-image: url(../../images/tag-small.png);
     background-position : -1px center;
     background-repeat : no-repeat;
@@ -748,7 +747,6 @@ a.tag_results_add {
 
 .tag_results_input {
     background-color: #EEE;
-    display: none;
     margin-left: 1em;
     padding: 0.3em;
 }
@@ -1450,9 +1448,19 @@ padding-left : .4em;
     padding-left:20px
 }
 
-.searchresults .tagstatus {
-       display: block;
-       color: #707070;
+.tagstatus {
+    color: #707070;
+    padding: 0 4px 0 4px;
+    margin-left: 5px;
+    border: 1px solid #bcbcbc;
+    background-color: #ffffcc;
+    -webkit-border-radius: 4px;
+    -moz-border-radius: 4px;
+    border-radius: 4px;
+}
+
+.results_summary.tagstatus {
+    display: inline;
 }
 
 .results_summary .label {
@@ -1463,7 +1471,11 @@ padding-left : .4em;
        font-weight: normal;
 }
 
-.actions a {
+.actions a.hold,
+.actions a.addtocart,
+.actions a.addtoshelf,
+.actions a.addtolist,
+.actions a.tag_add {
        margin-left : 1em;
        text-decoration : none;
 }
@@ -1525,7 +1537,7 @@ div.message {
        background: -webkit-linear-gradient(top, #ffffff 0%,#f4f6fa 2%,#eaeef5 23%,#e8edf6 94%,#cddbf2 100%); /* Chrome10+,Safari5.1+ */
        background: -o-linear-gradient(top, #ffffff 0%,#f4f6fa 2%,#eaeef5 23%,#e8edf6 94%,#cddbf2 100%); /* Opera11.10+ */
        background: -ms-linear-gradient(top, #ffffff 0%,#f4f6fa 2%,#eaeef5 23%,#e8edf6 94%,#cddbf2 100%); /* IE10+ */
-       filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#cddbf2',GradientType=0 ); /* IE6-9 */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eaeef5', endColorstr='#cddbf2',GradientType=0 ); /* IE6-9 */
        background: linear-gradient(top, #ffffff 0%,#f4f6fa 2%,#eaeef5 23%,#e8edf6 94%,#cddbf2 100%); /* W3C */
        border : 1px solid #bcbcbc;
        width : 55%;
@@ -1571,7 +1583,6 @@ div.message {
        background: -webkit-linear-gradient(left, #eef4fe 0%,#eef4fe 88%,#f6f9fe 98%,#ffffff 99%,#a5c2f6 99%,#e6eefe 100%,#cbdefe 100%); /* Chrome10+,Safari5.1+ */
        background: -o-linear-gradient(left, #eef4fe 0%,#eef4fe 88%,#f6f9fe 98%,#ffffff 99%,#a5c2f6 99%,#e6eefe 100%,#cbdefe 100%); /* Opera11.10+ */
        background: -ms-linear-gradient(left, #eef4fe 0%,#eef4fe 88%,#f6f9fe 98%,#ffffff 99%,#a5c2f6 99%,#e6eefe 100%,#cbdefe 100%); /* IE10+ */
-       filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eef4fe', endColorstr='#cbdefe',GradientType=1 ); /* IE6-9 */
        background: linear-gradient(left, #eef4fe 0%,#eef4fe 88%,#f6f9fe 98%,#ffffff 99%,#a5c2f6 99%,#e6eefe 100%,#cbdefe 100%); /* W3C */
        border : 1px solid #739acf;
        padding : .3em 1em 0 0;
@@ -1726,7 +1737,6 @@ div#menu li a {
        background: -o-linear-gradient(left, #eeeeee 0%,#eeeeee 96%,#e6e6e6 97%,#cccccc 99%,#c1c1c1 100%); /* Opera 11.10+ */
        background: -ms-linear-gradient(left, #eeeeee 0%,#eeeeee 96%,#e6e6e6 97%,#cccccc 99%,#c1c1c1 100%); /* IE10+ */
        background: linear-gradient(left, #eeeeee 0%,#eeeeee 96%,#e6e6e6 97%,#cccccc 99%,#c1c1c1 100%); /* W3C */
-       filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#c1c1c1',GradientType=1 ); /* IE6-9 */
        text-decoration : none;
        display : block;
        border : 1px solid #979797;
@@ -1744,7 +1754,6 @@ div#menu li a:hover {
        background: -o-linear-gradient(left, #eaeef5 0%,#dee6f4 96%,#c4d5ef 98%,#a2bee8 100%); /* Opera 11.10+ */
        background: -ms-linear-gradient(left, #eaeef5 0%,#dee6f4 96%,#c4d5ef 98%,#a2bee8 100%); /* IE10+ */
        background: linear-gradient(left, #eaeef5 0%,#dee6f4 96%,#c4d5ef 98%,#a2bee8 100%); /* W3C */
-       filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eaeef5', endColorstr='#a2bee8',GradientType=1 ); /* IE6-9 */
 }
 
 div#menu li.active a:hover {
@@ -2682,10 +2691,18 @@ ul.ui-tabs-nav li {
 .authstanzaheading {
     font-weight: bold;
 }
-
+div.authorizedheading {
+    font-weight: bold;
+}
 .authstanza li {
     margin-left: 0.5em;
 }
+.authres_notes, .authres_seealso, .authres_otherscript {
+  padding-top: 5px;
+}
+.authres_notes {
+  font-style: italic;
+}
 
 #didyoumean {
     background-color: #EEE;
@@ -2709,6 +2726,19 @@ ul.ui-tabs-nav li {
 .authlink {
     padding-left: 0.25em;
 }
+#hierarchies a {
+    font-weight: normal;
+    text-decoration: underline;
+    color: #069;
+}
+
+#hierarchies a:hover {
+    color: #990033;
+}
+
+#top-pages {
+    margin: 0 0 0.5em;
+}
 
 /* jQuery UI Datepicker */
 .ui-datepicker table {width: 100%; font-size: .9em; border : 0; border-collapse: collapse; margin:0 0 .4em; }
@@ -2758,3 +2788,44 @@ body#opac-main #opacmainuserblockmobile {
 .mobile_only {
    display : none;
 }
+
+/* different sizes for different tags in opac-tags.tt */
+.tagweight0 {
+    font-size: 12px;
+}
+
+.tagweight1 {
+    font-size: 14px;
+}
+
+.tagweight2 {
+    font-size: 16px;
+}
+
+.tagweight3 {
+    font-size: 18px;
+}
+
+.tagweight4 {
+    font-size: 20px;
+}
+
+.tagweight5 {
+    font-size: 22px;
+}
+
+.tagweight6 {
+    font-size: 24px;
+}
+
+.tagweight7 {
+    font-size: 26px;
+}
+
+.tagweight8 {
+    font-size: 28px;
+}
+
+.tagweight9 {
+    font-size: 30px;
+}
index cd99443..6e6db3c 100644 (file)
@@ -2,15 +2,13 @@
     [% IF marcflavour == 'UNIMARC' %]
         [% SWITCH type %]
         [% CASE 'broader' %]
-            <span class="BT">[% heading | html %]</span> --
+            <span class="BT">BT: [% heading | html %]</span>
         [% CASE 'narrower' %]
-            <span class="NT">[% heading | html %]</span> --
-        [% CASE 'narrower' %]
-            <span class="NT">[% heading | html %]</span> --
+            <span class="NT">NT: [% heading | html %]</span>
         [% CASE 'seefrom' %]
-            <span class="UF">[% heading | html %]</span> --
+            <span class="UF">UF: [% heading | html %]</span>
         [% CASE 'seealso' %]
-            <span class="RT">[% heading | html %]</span> --
+            <span class="RT">RT: [% heading | html %]</span>
         [% END %]
     [% ELSE %]
         [% IF ( label ) %]<span class="label">[% label | html %]</span>[% END %]
         [% CASE 'broader' %](Broader heading)
         [% CASE 'narrower' %](Narrower heading)
         [% CASE 'parent' %](Immediate parent body)
-        [% CASE %]([% type | html %])
+        [% CASE %][% IF type %]([% type | html %])[% END %]
         [% END %]</span>[% END %]
     [% END %]
 [% END %]
 [% BLOCK authresult %]
     [% IF ( summary.summary ) %][% summary.summary | html %]:[% END %]
     [% UNLESS ( summary.summaryonly ) %]
-        [% FOREACH authorize IN summary.authorized %]
+        <div class="authorizedheading">
+          [% FOREACH authorize IN summary.authorized %]
             <span class="authorizedheading">[% authorize.heading | html %]</span>
-        [% END %]
+          [% END %]
+        </div>
         [% IF ( marcflavour == 'UNIMARC' ) %]
-            [% FOREACH note IN summary.notes %]
-                <span class="note">[% note | html %]</span>
+            [% IF summary.notes %]
+             <div class="authres_notes">
+             [% FOREACH note IN summary.notes %]
+               [% note.note | html %]</span>
+             [% END %]
+             </div>
+            [% END %]
+            [% IF summary.seealso %]
+              <div class="authres_seealso">
+              [% FOREACH see IN summary.seealso %]
+                 [% PROCESS showreference heading=see.heading label="" type=see.type search='' %]
+                 [% IF ! loop.last %] ; [% END %]
+              [% END %]
+              </div>
             [% END %]
-            [% FOREACH seefro IN summary.seefrom %]
-                [% PROCESS showreference heading=seefro.heading label="" type=seefro.type search='' %]
+            [% IF summary.otherscript %]
+              <div class="authres_otherscript">
+              [% FOREACH other IN summary.otherscript %]
+                [% PROCESS language lang=other.lang | trim %]:
+                [% other.term %]
+                [% IF ! loop.last %] ; [% END %]
+              [% END %]
+              </div>
             [% END %]
         [% ELSE %]
             [% IF ( summary.seefrom ) %]
index f032b20..4f0e540 100644 (file)
@@ -3,8 +3,8 @@
 <meta name="generator" content="Koha [% Version %]" /> <!-- leave this for stats -->
 <link rel="shortcut icon" href="[% IF ( OpacFavicon ) %][% OpacFavicon %][% ELSE %][% themelang %]/includes/favicon.ico[% END %]" type="image/x-icon" />
 <link rel="stylesheet" type="text/css" href="[% themelang %]/lib/jquery/jquery-ui.css" />
-<link rel="stylesheet" type="text/css" href="[% yuipath %]/reset-fonts-grids.css" />
-<link rel="stylesheet" type="text/css" href="[% yuipath %]/skin.css" />
+<link rel="stylesheet" type="text/css" href="/opac-tmpl/lib/yui/reset-fonts-grids.css" />
+<link rel="stylesheet" type="text/css" href="/opac-tmpl/lib/yui/skin.css" />
 [% SET opaclayoutstylesheet='opac.css' UNLESS opaclayoutstylesheet %]
 [% IF (opaclayoutstylesheet.match('^https?:|^\/')) %]
     <link rel="stylesheet" type="text/css" href="[% opaclayoutstylesheet %]" />
@@ -80,7 +80,8 @@
     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.");[% END %][% END %]
+    var MSG_MULTI_ADD_TAG_FAILED = _("Unable to add one or more tags.");
+    var MSG_NO_TAG_SPECIFIED = _("No tag was specified.");[% END %][% END %]
        [% IF ( OPACAmazonCoverImages ) %]$(window).load(function() {
                        verify_images();
                 });[% END %]
index 51c2e9f..98fdb38 100644 (file)
@@ -25,8 +25,8 @@
         [% END %]
     [% END %]
 [% ELSIF ( item.itemnotforloan ) %]
-    [% IF ( item.notforloanvalue ) %]
-        [% item.notforloanvalue %] [% IF ( item.restrictedopac ) %]<span class="restricted">([% item.restrictedopac %])</span>[% END %]
+    [% IF ( item.notforloanvalueopac ) %]
+        [% item.notforloanvalueopac %] [% IF ( item.restrictedopac ) %]<span class="restricted">([% item.restrictedopac %])</span>[% END %]
     [% ELSE %]
         Not for loan [% IF ( item.restrictedopac ) %]<span class="restricted">([% item.restrictedopac %])</span>[% END %]
     [% END %]
diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/opac-authorities.inc b/koha-tmpl/opac-tmpl/prog/en/includes/opac-authorities.inc
new file mode 100644 (file)
index 0000000..0cb0efe
--- /dev/null
@@ -0,0 +1,66 @@
+[% BLOCK showhierarchy %]
+    [% FOREACH tree IN trees %]
+        [% PROCESS showtree tree = tree %]
+    [% END %]
+[% END %]
+[% BLOCK showtree %]
+    <ul class="hierarchy">
+        [% FOREACH node IN tree %]
+            <li id="hier[% node.authid %]" class="[% node.class %] authnode">
+            [% IF ( node.current_value ) %]
+                <span class='currentauth'>[% node.value | html %]</span>
+            [% ELSE %]
+                <a href="opac-authoritiesdetail.pl?authid=[% node.authid %]" title="Term">[% node.value | html %]</a>
+            [% END %]
+            [% IF ( node.children && node.children.size > 0 ) %]
+                [% PROCESS showtree tree = node.children %]
+            [% END %]
+            </li>
+        [% END %]
+    </ul>
+[% END %]
+
+[% BLOCK authtypelabel %]
+    [% UNLESS ( type=='seefrom' || type=='seealso' || type=='' ) %]
+        <span class="type">[% FILTER trim %][% SWITCH type %]
+        [% CASE 'earlier' %]Earlier heading
+        [% CASE 'later' %]Later heading
+        [% CASE 'acronym' %]Acronym
+        [% CASE 'musical' %]Musical composition
+        [% CASE 'broader' %]Broader heading
+        [% CASE 'narrower' %]Narrower heading
+        [% CASE %][% type %]
+        [% END %][% END %]</span>
+    [% END %]
+[% END %]
+[% BLOCK otherscript %]
+    [% FOREACH heading IN headings %]
+        [% IF heading.category == wantcategory %]
+            [% IF heading.direction == 'ltr' %]
+                <div class="heading otherscript [% heading.category %]">
+                <span class="[% heading.category %]">[% heading.term %]</span>
+                </div>
+            [% ELSIF heading.direction == 'rtl' %]
+                <div class="heading otherscript [% heading.category %] rtl">
+                <span class="[% heading.category %]">[% heading.term %]</span>
+                </div>
+            [% END %]
+        [% END %]
+    [% END %]
+[% END %]
+[% BLOCK authheadingdisplay %]
+    [% IF authid %]<a href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% authid %]">[% heading %]</a>
+    [% ELSIF search %]<a href="/cgi-bin/koha/opac-authorities-home.pl?op=do_search&type=opac&operator=contains&marclist=mainentry&and_or=and&orderby=HeadingAsc&value=[% search %]">[% heading %]</a>
+    [% ELSE %][% heading %]
+    [% END %]
+[% END %]
+[% BLOCK language %]
+  [% SWITCH lang %]
+   [% CASE ['en', 'eng'] %]English
+   [% CASE ['fr', 'fre'] %]French
+   [% CASE ['it', 'ita'] %]Italian
+   [% CASE ['de', 'ger', 'deu'] %]German
+   [% CASE ['es', 'spa'] %]Spanish
+   [% CASE %][% lang %]
+  [% END %]
+[% END %]
index 082f846..fbb7c55 100644 (file)
@@ -3,7 +3,7 @@
 <div id="search-facets">
 <h4>Refine your search</h4>
 <ul>
-       <li>Availability<ul><li>[% IF ( available ) %]Showing only <strong>available</strong> items. <a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi_not_availablity %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by %][% END %]">Show all items</a>[% ELSE %]Limit to <a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by %][% END %]&amp;limit=available">currently available items.</a>[% END %]</li></ul>
+    <li id="availability_facet">Availability<ul><li>[% IF ( available ) %]Showing only <strong>available</strong> items. <a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi_not_availablity %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |html%][% END %]">Show all items</a>[% ELSE %]Limit to <a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |html%][% END %]&amp;limit=available">currently available items.</a>[% END %]</li></ul>
        [% IF ( related ) %] <li>(related searches: [% FOREACH relate IN related %][% relate.related_search %][% END %])</li>[% END %]
        </li>
        
@@ -20,8 +20,8 @@
 [% END %]
 [% IF ( facets_loo.type_label_Location ) %]Locations[% END %]
 <ul>
-        [% FOREACH facet IN facets_loo.facets %]<li><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by %][% END %]&amp;limit=[% facet.type_link_value %]:[% facet.facet_link_value %]" title="[% facet.facet_title_value |html %]">[% facet.facet_label_value %]</a> [% IF ( displayFacetCount ) %]([% facet.facet_count %])[% END %]</li>[% END %][% IF ( facets_loo.expandable ) %]
-        <li class="showmore"><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by %][% END %][% IF ( offset ) %]&amp;offset=[% offset %][% END %]&amp;expand=[% facets_loo.expand %]#[% facets_loo.type_id %]">Show more</a></li>
+        [% FOREACH facet IN facets_loo.facets %]<li><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |html %][% END %]&amp;limit=[% facet.type_link_value %]:[% facet.facet_link_value %]" title="[% facet.facet_title_value |html %]">[% facet.facet_label_value %]</a> [% IF ( displayFacetCount ) %]([% facet.facet_count %])[% END %]</li>[% END %][% IF ( facets_loo.expandable ) %]
+        <li class="showmore"><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |html %][% END %][% IF ( offset ) %]&amp;offset=[% offset %][% END %]&amp;expand=[% facets_loo.expand %]#[% facets_loo.type_id %]">Show more</a></li>
 [% END %]
 </ul></li>
 [% END %]
index 738c0c9..33d5a3e 100644 (file)
@@ -1,7 +1,6 @@
 [% IF ( PAGE_NUMBERS ) %]<div class="pages">
     <!-- Row of numbers corresponding to search result pages -->
-        [% IF ( previous_page_offset ) %]<a class="nav" href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;offset=[% previous_page_offset %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by %][% END %]">&lt;&lt; Previous</a>[% END %]
-    [% FOREACH PAGE_NUMBER IN PAGE_NUMBERS %][% IF ( PAGE_NUMBER.highlight ) %]<span class="current">[% PAGE_NUMBER.pg %]</span>[% ELSE %]        <a class="nav" href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;offset=[% PAGE_NUMBER.offset %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by %][% END %]">[% PAGE_NUMBER.pg %]</a>[% END %]
+        [% IF ( previous_page_offset.defined ) %]<a class="nav" href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;offset=[% previous_page_offset %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |html %][% END %]">&lt;&lt; Previous</a>[% END %]
+    [% FOREACH PAGE_NUMBER IN PAGE_NUMBERS %][% IF ( PAGE_NUMBER.highlight ) %]<span class="current">[% PAGE_NUMBER.pg %]</span>[% ELSE %]        <a class="nav" href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;offset=[% PAGE_NUMBER.offset %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |html%][% END %]">[% PAGE_NUMBER.pg %]</a>[% END %]
     [% END %]
-        [% IF ( next_page_offset ) %]<a class="nav" href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;offset=[% next_page_offset %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by %][% END %]">Next &gt;&gt;</a>[% END %]
-</div>[% END %]
+        [% IF ( next_page_offset ) %]<a class="nav" href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;offset=[% next_page_offset %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |html %][% END %]">Next &gt;&gt;</a>[% END %] </div>[% END %]
index 2a68959..1845ddb 100644 (file)
@@ -3,21 +3,21 @@
     <p>
     <label>Audience</label>
     <select name="limit" class="subtype">
-            <option value="" SELECTED="selected" >Any</option>
+            <option value="" selected="selected" >Any</option>
       <option value="aud:a">juvenile, general</option>
       <option value="aud:b">pre-primary (0-5)</option>
-      <option value="aud:c">Primary (5-8)</option>
+      <option value="aud:c">primary (5-8)</option>
       <option value="aud:d">children (9-14)</option>
-      <option value="aud:e">Young Adult</option>
-      <option value="aud:k">Adult, serious</option>
-      <option value="aud:m">Adult, General</option>
-      <option value="aud:u">Unknown</option>
+      <option value="aud:e">young Adult</option>
+      <option value="aud:k">adult, serious</option>
+      <option value="aud:m">adult, General</option>
+      <option value="aud:u">unknown</option>
     </select>
     </p>
     <p>
     <label>Print</label>
         <select name="limit" class="subtype">
-      <option value="" selected="selected" >any</option>
+      <option value="" selected="selected" >Any</option>
         <option value="Material-type:r">regular print</option>
         <option value="Material-type:d">large print</option>
         <option value="Material-type:e">newspaper format</option>
         <option value="Material-type:h">hand-written</option>
         <option value="Material-type:i">multimedia</option>
         <option value="Material-type:j">mini-print</option>
+    <option value="Material-type:s">electronic ressource</option>
+    <option value="Material-type:t">microform</option>
         <option value="Material-type:z">other form of textual material</option>
     </select>
     </p>
     <p>
-    <label>Feschrift Ind.</label>
+    <label>Literary genre</label>
     <select name="limit" class="subtype">
       <option value="" selected="selected" >Any</option>
             <option value="Literature-Code:a">fiction</option>
             <option value="Literature-Code:f">short stories</option>
             <option value="Literature-Code:g">poetry</option>
             <option value="Literature-Code:h">speeches, oratory</option>
+            <option value="Literature-Code:i">libretto</option>
             <option value="Literature-Code:y">not a literary text</option>
-            <option value="Literature-Code:z">multiple/other lit. forms</option>
+            <option value="Literature-Code:z">multiple/other literary forms</option>
     </select>
     </p>
         <p>
     <label>Biography</label>
         <select name="limit" class="subtype" size="1">
             <option value="">Any</option>
-            <option value="Biography-code:y">Not a biography</option>
+            <option value="Biography-code:y">not a biography</option>
             <option value="Biography-code:a">autobiography</option>
             <option value="Biography-code:b">individual biography</option>
             <option value="Biography-code:c">collective biography</option>
-            <option value="Biography-code:d">contains biogr. data</option>
+            <option value="Biography-code:d">contains biographical data</option>
     </select>
         </p>
         <p>
             <option value="ctype:r" >literature surveys/reviews</option>
             <option value="ctype:s" >treaties</option>
             <option value="ctype:t" >cartoons or comic strips</option>
+            <option value="ctype:v" >dissertation or thesis (revised)</option>v
+            <option value="ctype:w" >religious text</option>
             <option value="ctype:z" >other</option>
     </select>
         </p>
     <select name="limit" class="subtype">
            <option value="">Any type</option>
            <option value="Type-Of-Serial:a">Periodical</option>
-      <option value="Type-Of-Serial:b">Monographical series</option>
-      <option value="Type-Of-Serial:c">Newspaper</option>
-      <option value="Type-Of-Serial:z">Other</option>
+           <option value="Type-Of-Serial:b">Monographic series</option>
+           <option value="Type-Of-Serial:c">Newspaper</option>
+       <option value="Type-Of-Serial:e">Updating loose-leaf</option>
+       <option value="Type-Of-Serial:f">Database</option>
+       <option value="Type-Of-Serial:g">Updating website</option>
+       <option value="Type-Of-Serial:z">Other</option>
     </select>
     </p>
     <p>
         <option value="Frequency-code:i">Three times a year</option>
         <option value="Frequency-code:j">Semiannual</option>
         <option value="Frequency-code:k">Annual</option>
-        <option value="Frequency-code:l">Biannual</option>
+        <option value="Frequency-code:l">Biennial</option>
         <option value="Frequency-code:m">Triennial</option>
         <option value="Frequency-code:n">Three times a week</option>
         <option value="Frequency-code:o">Three times a month</option>
-        <option value="Frequency-code:u">Unknown</option>
         <option value="Frequency-code:y">Without periodicity</option>
-        <option value="Frequency-code:i">Other</option>
+        <option value="Frequency-code:u">Unknown</option>
+        <option value="Frequency-code:z">Other</option>
     </select>
     </p>
     <p>
     <label>Regularity</label>
     <select name="limit" class="subtype">
             <option value="">Any regularity</option>
-        <option value="Regularity-code:u">Unknown</option>
-        <option value="Regularity-code:a">Regular</option>
-        <option value="Regularity-code:b">Normalised irregular</option>
+        <option value="Regularity-code:a">regular</option>
+        <option value="Regularity-code:b">normalised irregular</option>
         <option value="Regularity-code:y">irregular</option>
+        <option value="Regularity-code:u">unknown</option>
     </select>
         </p>
 
         <option value="Graphics-type:z">other non-projected graphic type</option>
     </select>
     <select name="limit" class="subtype">
-            <option value="">any</option>
+            <option value="">Any</option>
             <option value="Graphics-support:a">canvas</option>
             <option value="Graphics-support:b">bristol board</option>
             <option value="Graphics-support:c">cardboard/illustration board</option>
             <option value="Graphics-support:l">porcelaine</option>
             <option value="Graphics-support:m">stone</option>
             <option value="Graphics-support:n">wood</option>
-            <option value="Graphics-support:u">unknown</option>
             <option value="Graphics-support:v">mixed collection</option>
             <option value="Graphics-support:e">synthetics</option>
             <option value="Graphics-support:f">skin</option>
             <option value="Graphics-support:h">metal</option>
             <option value="Graphics-support:i">paper</option>
             <option value="Graphics-support:z">others</option>
+            <option value="Graphics-support:u">unknown</option>
     </select>
         </p>
index 13a2c36..9bfd103 100644 (file)
@@ -80,7 +80,7 @@ function openBasket() {
     if ( strCookie ) {
         var iW = 820;
         var iH = 450;
-        var optWin = "dependant=yes,status=yes,scrollbars=yes,resizable=yes,toolbar=no,location=yes,height="+iH+",width="+iW;
+        var optWin = "status=yes,scrollbars=yes,resizable=yes,toolbar=no,location=yes,height="+iH+",width="+iW;
         var loc = CGIBIN + "opac-basket.pl?" + strCookie;
         var basket = open(loc, "basket", optWin);
         if (window.focus) {basket.focus()}
@@ -354,7 +354,7 @@ function sendBasket() {
 
     var loc = CGIBIN + "opac-sendbasket.pl?" + strCookie;
 
-    var optWin="dependant=yes,scrollbars=no,resizable=no,height=300,width=450,top=50,left=100";
+    var optWin="scrollbars=yes,resizable=yes,height=600,width=900,top=50,left=100";
     var win_form = open(loc,"win_form",optWin);
 }
 
@@ -365,7 +365,7 @@ function downloadBasket() {
 
     var loc = CGIBIN + "opac-downloadcart.pl?" + strCookie;
 
-    open(loc,"win_form",'dependant=yes,scrollbars=no,resizable=no,height=300,width=450,top=50,left=100');
+    open(loc,"win_form",'scrollbars=no,resizable=no,height=300,width=450,top=50,left=100');
 }
 
 function printBasket() {
@@ -397,6 +397,16 @@ function showLess() {
     document.location = loc;
 }
 
+function holdSel() {
+    var items = document.getElementById('records').value;
+    if (items) {
+        parent.opener.document.location = "/cgi-bin/koha/opac-reserve.pl?biblionumbers=" + items;
+        window.close();
+    } else {
+        alert(MSG_NO_RECORD_SELECTED);
+    }
+}
+
 function updateBasket(updated_value,target) {
        if(target){
        target.$('#basketcount').html("<span>"+updated_value+"</span>");
index cd85b18..f28747f 100644 (file)
@@ -26,12 +26,11 @@ if (typeof(readCookie) == "undefined") {
        }
 }
 KOHA.Tags = {
-       add_tag_button: function(){
-               var mybibnum = $(this).attr("title");
-               var mynewtag = "newtag" + mybibnum;
+    add_tag_button: function(bibnum, tag){
+        var mynewtag = "newtag" + bibnum;
                var mytagid = "#" + mynewtag;
                var mydata = {CGISESSID: readCookie('CGISESSID')};      // Someday this should be OPACSESSID
-               mydata[mynewtag] = $(mytagid).val();    // need [bracket] for variable property id
+        mydata[mynewtag] = tag;        // need [bracket] for variable property id
                var response;   // AJAX from server will assign value to response.
                $.post(
                        "/cgi-bin/koha/opac-tags.pl",
@@ -61,20 +60,23 @@ KOHA.Tags = {
        },
        set_tag_status : function(tagid, newstatus) {
                $(tagid).html(newstatus);
-               $(tagid).css({display:"inline"});
+        $(tagid).show();
        },
        append_tag_status : function(tagid, newstatus) {
                $(tagid).append(newstatus);
-               $(tagid).css({display:"inline"});
+        $(tagid).show();
        },
+    clear_all_tag_status : function() {
+        $(".tagstatus").empty().hide();
+    },
 
        tag_message: {
        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);},
+    failed_add_tag : function(arg) {return (MSG_ADD_TAG_FAILED+ " '"+arg+"'. \n"+MSG_ADD_TAG_FAILED_NOTE);},
+    failed_delete  : function(arg) {return (MSG_DELETE_TAG_FAILED+ " '"+arg+"'. \n"+MSG_DELETE_TAG_FAILED_NOTE);},
        login : function(arg) {return (MSG_LOGIN_REQUIRED);}
        },
 
@@ -92,7 +94,7 @@ KOHA.Tags = {
                        mydata,
                        function(data){
                                eval(data);
-                $(".tagstatus").empty();
+                KOHA.Tags.clear_all_tag_status();
                 var bibErrors = false;
 
                 // Display the status for each tagged bib
index f2deef2..fe76cd3 100644 (file)
  * http://docs.jquery.com/UI/Menu#theming
  */
 .ui-menu {
-       list-style:none;
-       padding: 2px;
-       margin: 0;
-       display:block;
      float: left;
+       list-style:none;
+       padding: 2px;
+  margin: 0;
+     display:block;
+ float: left;
 }
 .ui-menu .ui-menu {
-       margin-top: -3px;
+     margin-top: -3px;
 }
 .ui-menu .ui-menu-item {
-       margin:0;
-       padding: 0;
-       zoom: 1;
-       float: left;
-       clear: left;
-       width: 100%;
+   margin:0;
+      padding: 0;
+    zoom: 1;
+       float: left;
+   clear: left;
+   width: 100%;
 }
 .ui-menu .ui-menu-item a {
-       text-decoration:none;
-       display:block;
      padding:.2em .4em;
-       line-height:1.5;
-       zoom:1;
+      text-decoration:none;
+  display:block;
+ padding:.2em .4em;
+     line-height:1.5;
+       zoom:1;
 }
 .ui-menu .ui-menu-item a.ui-state-hover,
 .ui-menu .ui-menu-item a.ui-state-active {
-       font-weight: normal;
-       margin: -1px;
+  font-weight: normal;
+   margin: -1px;
 }
 /*!
  * jQuery UI Slider 1.8.23
index 2fca9c7..635f4c6 100644 (file)
 * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
 (function(a,b){a.ui=a.ui||{};var c=/left|center|right/,d=/top|center|bottom/,e="center",f={},g=a.fn.position,h=a.fn.offset;a.fn.position=function(b){if(!b||!b.of)return g.apply(this,arguments);b=a.extend({},b);var h=a(b.of),i=h[0],j=(b.collision||"flip").split(" "),k=b.offset?b.offset.split(" "):[0,0],l,m,n;return i.nodeType===9?(l=h.width(),m=h.height(),n={top:0,left:0}):i.setTimeout?(l=h.width(),m=h.height(),n={top:h.scrollTop(),left:h.scrollLeft()}):i.preventDefault?(b.at="left top",l=m=0,n={top:b.of.pageY,left:b.of.pageX}):(l=h.outerWidth(),m=h.outerHeight(),n=h.offset()),a.each(["my","at"],function(){var a=(b[this]||"").split(" ");a.length===1&&(a=c.test(a[0])?a.concat([e]):d.test(a[0])?[e].concat(a):[e,e]),a[0]=c.test(a[0])?a[0]:e,a[1]=d.test(a[1])?a[1]:e,b[this]=a}),j.length===1&&(j[1]=j[0]),k[0]=parseInt(k[0],10)||0,k.length===1&&(k[1]=k[0]),k[1]=parseInt(k[1],10)||0,b.at[0]==="right"?n.left+=l:b.at[0]===e&&(n.left+=l/2),b.at[1]==="bottom"?n.top+=m:b.at[1]===e&&(n.top+=m/2),n.left+=k[0],n.top+=k[1],this.each(function(){var c=a(this),d=c.outerWidth(),g=c.outerHeight(),h=parseInt(a.curCSS(this,"marginLeft",!0))||0,i=parseInt(a.curCSS(this,"marginTop",!0))||0,o=d+h+(parseInt(a.curCSS(this,"marginRight",!0))||0),p=g+i+(parseInt(a.curCSS(this,"marginBottom",!0))||0),q=a.extend({},n),r;b.my[0]==="right"?q.left-=d:b.my[0]===e&&(q.left-=d/2),b.my[1]==="bottom"?q.top-=g:b.my[1]===e&&(q.top-=g/2),f.fractions||(q.left=Math.round(q.left),q.top=Math.round(q.top)),r={left:q.left-h,top:q.top-i},a.each(["left","top"],function(c,e){a.ui.position[j[c]]&&a.ui.position[j[c]][e](q,{targetWidth:l,targetHeight:m,elemWidth:d,elemHeight:g,collisionPosition:r,collisionWidth:o,collisionHeight:p,offset:k,my:b.my,at:b.at})}),a.fn.bgiframe&&c.bgiframe(),c.offset(a.extend(q,{using:b.using}))})},a.ui.position={fit:{left:function(b,c){var d=a(window),e=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=e>0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]===e)return;var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0},top:function(b,c){if(c.at[1]===e)return;var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];return!c||!c.ownerDocument?null:b?a.isFunction(b)?this.each(function(c){a(this).offset(b.call(this,c,a(this).offset()))}):this.each(function(){a.offset.setOffset(this,b)}):h.call(this)}),a.curCSS||(a.curCSS=a.css),function(){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d,e,g,h,i;d=document.createElement(b?"div":"body"),g={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},b&&a.extend(g,{position:"absolute",left:"-1000px",top:"-1000px"});for(var j in g)d.style[j]=g[j];d.appendChild(c),e=b||document.documentElement,e.insertBefore(d,e.firstChild),c.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",h=a(c).offset(function(a,b){return b}).offset(),d.innerHTML="",e.removeChild(d),i=h.top+h.left+(b?2e3:0),f.fractions=i>21&&i<22}()})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
 * https://github.com/jquery/jquery-ui
+* Includes: jquery.ui.sortable.js
+* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
+(function(a,b){a.widget("ui.sortable",a.ui.mouse,{widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var a=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},destroy:function(){a.Widget.prototype.destroy.call(this),this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--)this.items[b].item.removeData(this.widgetName+"-item");return this},_setOption:function(b,c){b==="disabled"?(this.options[b]=c,this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")):a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(b,c){var d=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(b);var e=null,f=this,g=a(b.target).parents().each(function(){if(a.data(this,d.widgetName+"-item")==f)return e=a(this),!1});a.data(b.target,d.widgetName+"-item")==f&&(e=a(b.target));if(!e)return!1;if(this.options.handle&&!c){var h=!1;a(this.options.handle,e).find("*").andSelf().each(function(){this==b.target&&(h=!0)});if(!h)return!1}return this.currentItem=e,this._removeCurrentsFromItems(),!0},_mouseStart:function(b,c,d){var e=this.options,f=this;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(b),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),e.containment&&this._setContainment(),e.cursor&&(a("body").css("cursor")&&(this._storedCursor=a("body").css("cursor")),a("body").css("cursor",e.cursor)),e.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",e.opacity)),e.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",e.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",b,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!d)for(var g=this.containers.length-1;g>=0;g--)this.containers[g]._trigger("activate",b,f._uiHash(this));return a.ui.ddmanager&&(a.ui.ddmanager.current=this),a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(b),!0},_mouseDrag:function(b){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var c=this.options,d=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY<c.scrollSensitivity?this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop+c.scrollSpeed:b.pageY-this.overflowOffset.top<c.scrollSensitivity&&(this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop-c.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-b.pageX<c.scrollSensitivity?this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft+c.scrollSpeed:b.pageX-this.overflowOffset.left<c.scrollSensitivity&&(this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft-c.scrollSpeed)):(b.pageY-a(document).scrollTop()<c.scrollSensitivity?d=a(document).scrollTop(a(document).scrollTop()-c.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<c.scrollSensitivity&&(d=a(document).scrollTop(a(document).scrollTop()+c.scrollSpeed)),b.pageX-a(document).scrollLeft()<c.scrollSensitivity?d=a(document).scrollLeft(a(document).scrollLeft()-c.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<c.scrollSensitivity&&(d=a(document).scrollLeft(a(document).scrollLeft()+c.scrollSpeed))),d!==!1&&a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(var e=this.items.length-1;e>=0;e--){var f=this.items[e],g=f.item[0],h=this._intersectsWithPointer(f);if(!h)continue;if(g!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=g&&!a.ui.contains(this.placeholder[0],g)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],g):!0)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(f))this._rearrange(b,f);else break;this._trigger("change",b,this._uiHash());break}}return this._contactContainers(b),a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),this._trigger("sort",b,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(b,c){if(!b)return;a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,b);if(this.options.revert){var d=this,e=d.placeholder.offset();d.reverting=!0,a(this.helper).animate({left:e.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){d._clear(b)})}else this._clear(b,c);return!1},cancel:function(){var b=this;if(this.dragging){this._mouseUp({target:null}),this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("deactivate",null,b._uiHash(this)),this.containers[c].containerCache.over&&(this.containers[c]._trigger("out",null,b._uiHash(this)),this.containers[c].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),a.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];return b=b||{},a(c).each(function(){var c=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[-=_](.+)/);c&&d.push((b.key||c[1]+"[]")+"="+(b.key&&b.expression?c[1]:c[2]))}),!d.length&&b.key&&d.push(b.key+"="),d.join("&")},toArray:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];return b=b||{},c.each(function(){d.push(a(b.item||this).attr(b.attribute||"id")||"")}),d},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,d=this.positionAbs.top,e=d+this.helperProportions.height,f=a.left,g=f+a.width,h=a.top,i=h+a.height,j=this.offset.click.top,k=this.offset.click.left,l=d+j>h&&d+j<i&&b+k>f&&b+k<g;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?l:f<b+this.helperProportions.width/2&&c-this.helperProportions.width/2<g&&h<d+this.helperProportions.height/2&&e-this.helperProportions.height/2<i},_intersectsWithPointer:function(b){var c=this.options.axis==="x"||a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top,b.height),d=this.options.axis==="y"||a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left,b.width),e=c&&d,f=this._getDragVerticalDirection(),g=this._getDragHorizontalDirection();return e?this.floating?g&&g=="right"||f=="down"?2:1:f&&(f=="down"?2:1):!1},_intersectsWithSides:function(b){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top+b.height/2,b.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left+b.width/2,b.width),e=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();return this.floating&&f?f=="right"&&d||f=="left"&&!d:e&&(e=="down"&&c||e=="up"&&!c)},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){return this._refreshItems(a),this.refreshPositions(),this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(b){var c=this,d=[],e=[],f=this._connectWith();if(f&&b)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&e.push([a.isFunction(j.options.items)?j.options.items.call(j.element):a(j.options.items,j.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),j])}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var g=e.length-1;g>=0;g--)e[g][0].each(function(){d.push(this)});return a(d)},_removeCurrentsFromItems:function(){var a=this.currentItem.find(":data("+this.widgetName+"-item)");for(var b=0;b<this.items.length;b++)for(var c=0;c<a.length;c++)a[c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(b){this.items=[],this.containers=[this];var c=this.items,d=this,e=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],b,{item:this.currentItem}):a(this.options.items,this.element),this]],f=this._connectWith();if(f&&this.ready)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&(e.push([a.isFunction(j.options.items)?j.options.items.call(j.element[0],b,{item:this.currentItem}):a(j.options.items,j.element),j]),this.containers.push(j))}}for(var g=e.length-1;g>=0;g--){var k=e[g][1],l=e[g][0];for(var i=0,m=l.length;i<m;i++){var n=a(l[i]);n.data(this.widgetName+"-item",k),c.push({item:n,instance:k,width:0,height:0,left:0,top:0})}}},refreshPositions:function(b){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var c=this.items.length-1;c>=0;c--){var d=this.items[c];if(d.instance!=this.currentContainer&&this.currentContainer&&d.item[0]!=this.currentItem[0])continue;var e=this.options.toleranceElement?a(this.options.toleranceElement,d.item):d.item;b||(d.width=e.outerWidth(),d.height=e.outerHeight());var f=e.offset();d.left=f.left,d.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var c=this.containers.length-1;c>=0;c--){var f=this.containers[c].element.offset();this.containers[c].containerCache.left=f.left,this.containers[c].containerCache.top=f.top,this.containers[c].containerCache.width=this.containers[c].element.outerWidth(),this.containers[c].containerCache.height=this.containers[c].element.outerHeight()}return this},_createPlaceholder:function(b){var c=b||this,d=c.options;if(!d.placeholder||d.placeholder.constructor==String){var e=d.placeholder;d.placeholder={element:function(){var b=a(document.createElement(c.currentItem[0].nodeName)).addClass(e||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return e||(b.style.visibility="hidden"),b},update:function(a,b){if(e&&!d.forcePlaceholderSize)return;b.height()||b.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10)),b.width()||b.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10))}}}c.placeholder=a(d.placeholder.element.call(c.element,c.currentItem)),c.currentItem.after(c.placeholder),d.placeholder.update(c,c.placeholder)},_contactContainers:function(b){var c=null,d=null;for(var e=this.containers.length-1;e>=0;e--){if(a.ui.contains(this.currentItem[0],this.containers[e].element[0]))continue;if(this._intersectsWith(this.containers[e].containerCache)){if(c&&a.ui.contains(this.containers[e].element[0],c.element[0]))continue;c=this.containers[e],d=e}else this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",b,this._uiHash(this)),this.containers[e].containerCache.over=0)}if(!c)return;if(this.containers.length===1)this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1;else if(this.currentContainer!=this.containers[d]){var f=1e4,g=null,h=this.positionAbs[this.containers[d].floating?"left":"top"];for(var i=this.items.length-1;i>=0;i--){if(!a.ui.contains(this.containers[d].element[0],this.items[i].item[0]))continue;var j=this.containers[d].floating?this.items[i].item.offset().left:this.items[i].item.offset().top;Math.abs(j-h)<f&&(f=Math.abs(j-h),g=this.items[i],this.direction=j-h>0?"down":"up")}if(!g&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[d],g?this._rearrange(b,g,null,!0):this._rearrange(b,null,this.containers[d].element,!0),this._trigger("change",b,this._uiHash()),this.containers[d]._trigger("change",b,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1}},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b,this.currentItem])):c.helper=="clone"?this.currentItem.clone():this.currentItem;return d.parents("body").length||a(c.appendTo!="parent"?c.appendTo:this.currentItem[0].parentNode)[0].appendChild(d[0]),d[0]==this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(d[0].style.width==""||c.forceHelperSize)&&d.width(this.currentItem.width()),(d[0].style.height==""||c.forceHelperSize)&&d.height(this.currentItem.height()),d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)){var c=a(b.containment)[0],d=a(b.containment).offset(),e=a(c).css("overflow")!="hidden";this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(e?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(e?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName);this.cssPosition=="relative"&&(this.scrollParent[0]==document||this.scrollParent[0]==this.offsetParent[0])&&(this.offset.relative=this._getRelativeOffset());var f=b.pageX,g=b.pageY;if(this.originalPosition){this.containment&&(b.pageX-this.offset.click.left<this.containment[0]&&(f=this.containment[0]+this.offset.click.left),b.pageY-this.offset.click.top<this.containment[1]&&(g=this.containment[1]+this.offset.click.top),b.pageX-this.offset.click.left>this.containment[2]&&(f=this.containment[2]+this.offset.click.left),b.pageY-this.offset.click.top>this.containment[3]&&(g=this.containment[3]+this.offset.click.top));if(c.grid){var h=this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1];g=this.containment?h-this.offset.click.top<this.containment[1]||h-this.offset.click.top>this.containment[3]?h-this.offset.click.top<this.containment[1]?h+c.grid[1]:h-c.grid[1]:h:h;var i=this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0];f=this.containment?i-this.offset.click.left<this.containment[0]||i-this.offset.click.left>this.containment[2]?i-this.offset.click.left<this.containment[0]?i+c.grid[0]:i-c.grid[0]:i:i}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_rearrange:function(a,b,c,d){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?b.item[0]:b.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var e=this,f=this.counter;window.setTimeout(function(){f==e.counter&&e.refreshPositions(!d)},0)},_clear:function(b,c){this.reverting=!1;var d=[],e=this;!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var f in this._storedCSS)if(this._storedCSS[f]=="auto"||this._storedCSS[f]=="static")this._storedCSS[f]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!c&&d.push(function(a){this._trigger("receive",a,this._uiHash(this.fromOutside))}),(this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!c&&d.push(function(a){this._trigger("update",a,this._uiHash())});if(!a.ui.contains(this.element[0],this.currentItem[0])){c||d.push(function(a){this._trigger("remove",a,this._uiHash())});for(var f=this.containers.length-1;f>=0;f--)a.ui.contains(this.containers[f].element[0],this.currentItem[0])&&!c&&(d.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.containers[f])),d.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,this.containers[f])))}for(var f=this.containers.length-1;f>=0;f--)c||d.push(function(a){return function(b){a._trigger("deactivate",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over&&(d.push(function(a){return function(b){a._trigger("out",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over=0);this._storedCursor&&a("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop",b,this._uiHash());for(var f=0;f<d.length;f++)d[f].call(this,b);this._trigger("stop",b,this._uiHash())}return this.fromOutside=!1,!1}c||this._trigger("beforeStop",b,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!=this.currentItem[0]&&this.helper.remove(),this.helper=null;if(!c){for(var f=0;f<d.length;f++)d[f].call(this,b);this._trigger("stop",b,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){a.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(b){var c=b||this;return{helper:c.helper,placeholder:c.placeholder||a([]),position:c.position,originalPosition:c.originalPosition,offset:c.positionAbs,item:c.currentItem,sender:b?b.element:null}}}),a.extend(a.ui.sortable,{version:"1.8.23"})})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
+* https://github.com/jquery/jquery-ui
 * Includes: jquery.ui.autocomplete.js
 * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
 (function(a,b){var c=0;a.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var b=this,c=this.element[0].ownerDocument,d;this.isMultiLine=this.element.is("textarea"),this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(b.options.disabled||b.element.propAttr("readOnly"))return;d=!1;var e=a.ui.keyCode;switch(c.keyCode){case e.PAGE_UP:b._move("previousPage",c);break;case e.PAGE_DOWN:b._move("nextPage",c);break;case e.UP:b._keyEvent("previous",c);break;case e.DOWN:b._keyEvent("next",c);break;case e.ENTER:case e.NUMPAD_ENTER:b.menu.active&&(d=!0,c.preventDefault());case e.TAB:if(!b.menu.active)return;b.menu.select(c);break;case e.ESCAPE:b.element.val(b.term),b.close(c);break;default:clearTimeout(b.searching),b.searching=setTimeout(function(){b.term!=b.element.val()&&(b.selectedItem=null,b.search(null,c))},b.options.delay)}}).bind("keypress.autocomplete",function(a){d&&(d=!1,a.preventDefault())}).bind("focus.autocomplete",function(){if(b.options.disabled)return;b.selectedItem=null,b.previous=b.element.val()}).bind("blur.autocomplete",function(a){if(b.options.disabled)return;clearTimeout(b.searching),b.closing=setTimeout(function(){b.close(a),b._change(a)},150)}),this._initSource(),this.menu=a("<ul></ul>").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",c)[0]).mousedown(function(c){var d=b.menu.element[0];a(c.target).closest(".ui-menu-item").length||setTimeout(function(){a(document).one("mousedown",function(c){c.target!==b.element[0]&&c.target!==d&&!a.ui.contains(d,c.target)&&b.close()})},1),setTimeout(function(){clearTimeout(b.closing)},13)}).menu({focus:function(a,c){var d=c.item.data("item.autocomplete");!1!==b._trigger("focus",a,{item:d})&&/^key/.test(a.originalEvent.type)&&b.element.val(d.value)},selected:function(a,d){var e=d.item.data("item.autocomplete"),f=b.previous;b.element[0]!==c.activeElement&&(b.element.focus(),b.previous=f,setTimeout(function(){b.previous=f,b.selectedItem=e},1)),!1!==b._trigger("select",a,{item:e})&&b.element.val(e.value),b.term=b.element.val(),b.close(a),b.selectedItem=e},blur:function(a,c){b.menu.element.is(":visible")&&b.element.val()!==b.term&&b.element.val(b.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"),a.fn.bgiframe&&this.menu.element.bgiframe(),b.beforeunloadHandler=function(){b.element.removeAttr("autocomplete")},a(window).bind("beforeunload",b.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"),this.menu.element.remove(),a(window).unbind("beforeunload",this.beforeunloadHandler),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b==="source"&&this._initSource(),b==="appendTo"&&this.menu.element.appendTo(a(c||"body",this.element[0].ownerDocument)[0]),b==="disabled"&&c&&this.xhr&&this.xhr.abort()},_initSource:function(){var b=this,c,d;a.isArray(this.options.source)?(c=this.options.source,this.source=function(b,d){d(a.ui.autocomplete.filter(c,b.term))}):typeof this.options.source=="string"?(d=this.options.source,this.source=function(c,e){b.xhr&&b.xhr.abort(),b.xhr=a.ajax({url:d,data:c,dataType:"json",success:function(a,b){e(a)},error:function(){e([])}})}):this.source=this.options.source},search:function(a,b){a=a!=null?a:this.element.val(),this.term=this.element.val();if(a.length<this.options.minLength)return this.close(b);clearTimeout(this.closing);if(this._trigger("search",b)===!1)return;return this._search(a)},_search:function(a){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.source({term:a},this._response())},_response:function(){var a=this,b=++c;return function(d){b===c&&a.__response(d),a.pending--,a.pending||a.element.removeClass("ui-autocomplete-loading")}},__response:function(a){!this.options.disabled&&a&&a.length?(a=this._normalize(a),this._suggest(a),this._trigger("open")):this.close()},close:function(a){clearTimeout(this.closing),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.deactivate(),this._trigger("close",a))},_change:function(a){this.previous!==this.element.val()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(b){return b.length&&b[0].label&&b[0].value?b:a.map(b,function(b){return typeof b=="string"?{label:b,value:b}:a.extend({label:b.label||b.value,value:b.value||b.label},b)})},_suggest:function(b){var c=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(c,b),this.menu.deactivate(),this.menu.refresh(),c.show(),this._resizeMenu(),c.position(a.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(new a.Event("mouseover"))},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(b,c){var d=this;a.each(c,function(a,c){d._renderItem(b,c)})},_renderItem:function(b,c){return a("<li></li>").data("item.autocomplete",c).append(a("<a></a>").text(c.label)).appendTo(b)},_move:function(a,b){if(!this.menu.element.is(":visible")){this.search(null,b);return}if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term),this.menu.deactivate();return}this.menu[a](b)},widget:function(){return this.menu.element},_keyEvent:function(a,b){if(!this.isMultiLine||this.menu.element.is(":visible"))this._move(a,b),b.preventDefault()}}),a.extend(a.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(b,c){var d=new RegExp(a.ui.autocomplete.escapeRegex(c),"i");return a.grep(b,function(a){return d.test(a.label||a.value||a)})}})})(jQuery),function(a){a.widget("ui.menu",{_create:function(){var b=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){if(!a(c.target).closest(".ui-menu-item a").length)return;c.preventDefault(),b.select(c)}),this.refresh()},refresh:function(){var b=this,c=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");c.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(c){b.activate(c,a(this).parent())}).mouseleave(function(){b.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,d=this.element.scrollTop(),e=this.element.height();c<0?this.element.scrollTop(d+c):c>=e&&this.element.scrollTop(d+c-e+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end(),this._trigger("focus",a,{item:b})},deactivate:function(){if(!this.active)return;this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(a,b,c){if(!this.active){this.activate(c,this.element.children(b));return}var d=this.active[a+"All"](".ui-menu-item").eq(0);d.length?this.activate(c,d):this.activate(c,this.element.children(b))},nextPage:function(b){if(this.hasScroll()){if(!this.active||this.last()){this.activate(b,this.element.children(".ui-menu-item:first"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c-d+a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:last")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(b){if(this.hasScroll()){if(!this.active||this.first()){this.activate(b,this.element.children(".ui-menu-item:last"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c+d-a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:first")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element[a.fn.prop?"prop":"attr"]("scrollHeight")},select:function(a){this._trigger("selected",a,{item:this.active})}})}(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
index cca5d0d..e08fff2 100644 (file)
@@ -92,7 +92,9 @@
 [% END %]
 [% IF ( expanded_options ) %]
             <option value="nt">Notes/Comments</option>
+    [% IF (marcflavour != 'UNIMARC') %]
             <option value="curriculum">Curriculum</option>
+    [% END %]
 [% END %]
             <option value="pb,wrdl">Publisher</option>
             <option value="pl,wrdl">Publisher location</option>
 <fieldset>
 <!-- PUB RANGE OPTION -->
 <legend>Publication date range:</legend>
-<span>For example:  1999-2001.  You could also use "-1987" for everything published before 1987 or "2008-" for everything published after 2008.</span>
+<p>For example:  1999-2001.  You could also use "-1987" for everything published in and before 1987 or "2008-" for everything published in 2008 and after.</p>
 <input type="text" size="30" name="limit-yr" title="Enter search terms" value="" />
 </fieldset>
 <!-- /PUB RANGE OPTION -->
 <!-- AVAILABILITY LIMITS -->
     [% UNLESS ( singleBranchMode ) %]
     <div id="location" class="container"><fieldset><legend>Location and availability: </legend>
-        
+
+        <label for="branchloop">Library:</label>
         <select name="limit" id="branchloop">
         <option value="">All libraries</option>
         [% FOREACH BranchesLoo IN BranchesLoop %]
 </div>
 <div class="yui-u">
 <!-- RANK LIMITS -->
-    <div id="sortby" class="container"><fieldset><legend>Sort by: </legend>
-        <select id="sort_by" name="sort_by">
+    <div id="sortby" class="container"><fieldset><legend>Sorting: </legend>
+        <label for="sort_by">Sort by:</label> <select id="sort_by" name="sort_by">
 [% INCLUDE 'resort_form.inc' %]
 </select></fieldset></div>
 <!-- RANK LIMITS -->
index 4cee9fe..ad5ddc7 100644 (file)
@@ -1,30 +1,25 @@
+[% PROCESS 'opac-authorities.inc' %]
 [% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo;  Entry
 [% INCLUDE 'doc-head-close.inc' %]
-[% IF ( displayhierarchy ) %]
-<link rel="stylesheet" type="text/css" href="[% themelang %]/css/hierarchy.css">
-<script language="JavaScript" type="text/javascript">
-function showParents(mynumber) {
-  var parents=document.getElementsByName(mynumber+'p')
-  for(i=0;i<parents.length;i++){
-    if (parents[i].style.display == "none") {
-      parents[i].style.display ="block";
-    } else {
-      parents[i].style.display ="none";
-    }
-  } 
-}
-function showChildren(mynumber) {
-  var children=document.getElementsByName(mynumber+'c')
-  for(i=0;i<children.length;i++){
-    if (children[i].style.display == "none") {
-      children[i].style.display = "block";
-    } else {
-      children[i].style.display = "none";
-    }
-  }
-}
+<script language="javascript" type="text/javascript" src="/opac-tmpl/lib/jquery/plugins/jquery.jstree.js"></script>
+<script language="javascript" type="text/javascript">
+//<![CDATA[
+$(document).ready(function() {
+    [% IF ( displayhierarchy ) %]
+        var current_nodes = [];
+        $('.currentauth').each(function() {
+            current_nodes.push('#' + $(this).parent().parents('li:first').attr('id'));
+            });
+        $('#hierarchies').jstree({
+                "plugins": [ "themes", "html_data"],
+                "themes": { "theme": "classic",
+                            "icons": false },
+                "core": { "initially_open": current_nodes }
+            });
+    [% END %]
+});
+//]]>
 </script>
-[% END %]
 </head>
 <body id="opac-authoritiesdetail">
 
@@ -38,30 +33,11 @@ function showChildren(mynumber) {
     <div id="views"><span class="view"><a id="MARCview" href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% authid %]">Normal view</a></span> <span class="view"><span id="MARCview">MARC view</span></span></div>
 
 [% IF ( displayhierarchy ) %]
-
-<div class="hierarchies">
-[% FOREACH loophierarchie IN loophierarchies %]
-  <div class="hierarchy">
-  [% FOREACH loopelemen IN loophierarchie.loopelement %]
-    <div id="[% loopelemen.loopauthid %]" class="[% loopelemen.class %]">
-    [% IF ( loopelemen.current_value ) %]
-        [% loopelemen.value %]
-    [% ELSE %]
-        <a href="opac-authoritiesdetail.pl?authid=[% loopelemen.loopauthid %]" title="Term">[% loopelemen.value %]</a>
-    [% END %]
-    [% IF ( loopelemen.ifchildren ) %]
-      <sub><a class="parents" title="Narrower terms" href="JavaScript:showChildren('[% loopelemen.loopauthid %]');">+</a></sub><br/>
-      [% FOREACH loopchildre IN loopelemen.loopchildren %]
-        <div name="[% loopchildre.loopauthid %]c" class="child"> <a href="opac-authoritiesdetail.pl?authid=[% loopchildre.childauthid %]">[% loopchildre.childvalue %]</a></div>
-      [% END %]
-    [% END %]
-    </div>
-  [% END %]
-    
-  </div>
-[% END %]
+<div id="hierarchies">
+[% PROCESS showhierarchy trees = loophierarchies %]
 </div>
 [% END %]
+
 <h1>Entry [% authtypetext %]</h1>
        <p>Used in <a href="opac-search.pl?type=opac&amp;q=[% authid %]&amp;idx=an,phr">[% count %] records</a></p>
         [% FOREACH Tag0X IN Tab0XX %]
index 672d4e3..de5eae1 100644 (file)
@@ -1,69 +1,27 @@
-[% BLOCK authtypelabel %]
-    [% UNLESS ( type=='seefrom' || type=='seealso' || type=='' ) %]
-        <span class="type">[% FILTER trim %][% SWITCH type %]
-        [% CASE 'earlier' %]Earlier heading
-        [% CASE 'later' %]Later heading
-        [% CASE 'acronym' %]Acronym
-        [% CASE 'musical' %]Musical composition
-        [% CASE 'broader' %]Broader heading
-        [% CASE 'narrower' %]Narrower heading
-        [% CASE %][% type %]
-        [% END %][% END %]</span>
-    [% END %]
-[% END %]
-[% BLOCK otherscript %]
-    [% FOREACH heading IN headings %]
-        [% IF heading.category == wantcategory %]
-            [% IF heading.direction == 'ltr' %]
-                <div class="heading otherscript [% heading.category %]">
-                <span class="[% heading.category %]">[% heading.term %]</span>
-                </div>
-            [% ELSIF heading.direction == 'rtl' %]
-                <div class="heading otherscript [% heading.category %] rtl">
-                <span class="[% heading.category %]">[% heading.term %]</span>
-                </div>
-            [% END %]
-        [% END %]
-    [% END %]
-[% END %]
-[% BLOCK authheadingdisplay %]
-    [% IF authid %]<a href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% authid %]">[% heading %]</a>
-    [% ELSIF search %]<a href="/cgi-bin/koha/opac-authorities-home.pl?op=do_search&type=opac&operator=contains&marclist=mainentry&and_ora=and&orderby=HeadingAsc&value=[% search %]">[% heading %]</a>
-    [% ELSE %][% heading %]
-    [% END %]
-[% END %]
+[% PROCESS 'opac-authorities.inc' %]
 [% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo;  Entry
 [% INCLUDE 'doc-head-close.inc' %]
 [% IF ( displayhierarchy ) %]
-<link rel="stylesheet" type="text/css" href="[% themelang %]/css/hierarchy.css">
+<script language="javascript" type="text/javascript" src="/opac-tmpl/lib/jquery/plugins/jquery.jstree.js"></script>
 [% END %]
-<script language="JavaScript" type="text/javascript">
+<script language="javascript" type="text/javascript">
+//<![CDATA[
 $(document).ready(function() {
     $('#authdescriptions').tabs();
+    [% IF ( displayhierarchy ) %]
+        var current_nodes = [];
+        $('.currentauth').each(function() {
+            current_nodes.push('#' + $(this).parent().parents('li:first').attr('id'));
+            });
+        $('#hierarchies').jstree({
+                "plugins": [ "themes", "html_data"],
+                "themes": { "theme": "classic",
+                            "icons": false },
+                "core": { "initially_open": current_nodes }
+            });
+    [% END %]
 });
-
-[% IF ( displayhierarchy ) %]
-function showParents(mynumber) {
-  var parents=document.getElementsByName(mynumber+'p')
-  for(i=0;i<parents.length;i++){
-    if (parents[i].style.display == "none") {
-      parents[i].style.display ="block";
-    } else {
-      parents[i].style.display ="none";
-    }
-  }
-}
-function showChildren(mynumber) {
-  var children=document.getElementsByName(mynumber+'c')
-  for(i=0;i<children.length;i++){
-    if (children[i].style.display == "none") {
-      children[i].style.display = "block";
-    } else {
-      children[i].style.display = "none";
-    }
-  }
-}
-[% END %]
+//]]>
 </script>
 </head>
 <body id="opac-authoritiesdetail">
@@ -79,31 +37,12 @@ function showChildren(mynumber) {
 <div id="userauthdetails" class="container">
 
 [% IF ( displayhierarchy ) %]
-
-<div class="hierarchies">
-[% FOREACH loophierarchie IN loophierarchies %]
-  <div class="hierarchy">
-  [% FOREACH loopelemen IN loophierarchie.loopelement %]
-    <div id="[% loopelemen.loopauthid %]" class="[% loopelemen.class %]">
-    [% IF ( loopelemen.current_value ) %]
-        [% loopelemen.value %]
-    [% ELSE %]
-        <a href="opac-authoritiesdetail.pl?authid=[% loopelemen.loopauthid %]" title="Term">[% loopelemen.value %]</a>
-    [% END %]
-    [% IF ( loopelemen.ifchildren ) %]
-      <sub><a class="parents" title="Narrower terms" href="JavaScript:showChildren('[% loopelemen.loopauthid %]');">+</a></sub><br/>
-      [% FOREACH loopchildre IN loopelemen.loopchildren %]
-        <div name="[% loopchildre.loopauthid %]c" class="child"> <a href="opac-authoritiesdetail.pl?authid=[% loopchildre.childauthid %]">[% loopchildre.childvalue %]</a></div>
-      [% END %]
-    [% END %]
-    </div>
-  [% END %]
-
-  </div>
-[% END %]
+<div id="hierarchies">
+[% PROCESS showhierarchy trees = loophierarchies %]
 </div>
 [% END %]
-<h1>[% summary.mainentry %][% IF authtypetext %]([% authtypetext %])[% END %]</h1>
+
+<h1>[% summary.mainentry %][% IF authtypetext %] ([% authtypetext %])[% END %]</h1>
 <div class="usedin">Used in <a href="opac-search.pl?type=opac&amp;q=[% authid %]&amp;idx=an,phr">[% count %] records</a></div>
 <div class="authstanza">
 [% FOREACH authorize IN summary.authorized %]
@@ -137,13 +76,17 @@ function showChildren(mynumber) {
     </div>
 [% END %]
 [% IF marcflavour == 'UNIMARC' && summary.otherscript %]
-    <div class="authstanza">
+  <div class="authstanza">
+    <div class="authstanzaheading">Other forms:</div>
+    <ul>
     [% FOREACH otherscrip IN summary.otherscript %]
-        <div class="heading otherscript auth[% otherscrip.field %]"><span class="label">See also[% PROCESS language lang=otherscript.lang | trim %] term:</span>
+      <li>
+        [% PROCESS language lang=otherscrip.lang | trim %]:
         <span class="otherscript">[% otherscrip.term %]</span>
-        </div>
+      </li>
     [% END %]
-    </div>
+    </ul>
+  </div>
 [% END %]
 <div id="authdescriptions" class="toptabs">
 <ul>
index 93f27b9..e0bf5a9 100644 (file)
@@ -33,7 +33,7 @@
                     <option value="match">in any heading</option>
                     <option value="mainentry">in main entry</option>
                 </select>
-                <input type="hidden" name="and_ora" value="and" />
+                <input type="hidden" name="and_or" value="and" />
                 <input type="hidden" name="excluding" value="" />
             </li>
             <li><label for="orderby">Order by: </label><select name="orderby" id="orderby">
index 96fa3e0..db9e695 100644 (file)
@@ -1,3 +1,4 @@
+[% PROCESS 'opac-authorities.inc' %]
 [% PROCESS 'authorities-search-results.inc' %]
 [% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; [% IF ( total ) %]Authority search result[% ELSE %]No results found[% END %]
 [% INCLUDE 'doc-head-close.inc' %]
index 2ea6d94..90a259e 100644 (file)
@@ -1,3 +1,5 @@
+[% SET TagsInputEnabled = ( opacuserlogin && TagsEnabled && TagsInputOnList ) %]
+
 [% INCLUDE 'doc-head-open.inc' %]
 [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your cart
     [% IF ( print_basket ) %]</title>
     @import url([% themelang %]/css/print.css);
 </style>
     [% ELSE %][% INCLUDE 'doc-head-close.inc' %]
-       <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
-       <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
-       <script type="text/javascript">
-       //<![CDATA[
+    <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
+    <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
+    <script type="text/javascript">
+    //<![CDATA[
+
+$.tablesorter.addParser({
+    // set a unique id
+    id: 'links',
+    is: function(s)
+    {
+        // return false so this parser is not auto detected
+        return false;
+    },
+    format: function(s)
+    {
+        // format your data for normalization
+        return s.replace(new RegExp(/<.*?>/),"");
+    },
+    // set type, either numeric or text
+    type: 'text'
+});
 
-var MSG_NO_RECORD_SELECTED = _("Please select one or more items");
 $(document).ready(function()
     {
         $("#itemst").tablesorter({
-                        headers: { 0: { sorter: false },4:{sorter:false}}
+                        headers: { 0: { sorter: false }, 1: {sorter: 'links'}, 4:{sorter:false}}
                 });
     $(".cb").click(function(){
       enableCheckboxActions();
     });
+    enableCheckboxActions();
     }
 );
 
-[% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]
-var MSG_NO_TAG_SPECIFIED = _("No tag was specified.");
-
+[% IF ( TagsInputEnabled && loggedinusername ) %]
 function tagSelected() {
     var bibs = document.getElementById('records').value;
     if (bibs) {
@@ -52,6 +69,8 @@ function tagCanceled() {
     $("#tagsel_form").hide();
     $("#tagsel_tag").show();
     $("#tag_hides").show();
+    $("#tagsel_new").val("");
+    $(".tagstatus").empty().hide();
 }
 
 function tagAdded() {
@@ -76,46 +95,31 @@ function tagAdded() {
     KOHA.Tags.add_multitags_button(bibs, tag);
     return false;
 }
-[% END %][% END %][% END %]
-       $(document).ready(function(){
-               $("#CheckAll").click(function(){
-               var checked = [];
-               $(".checkboxed").checkCheckboxes("*", true).each(
-                   function() {
-                               selRecord(this.value,true);
-                       }
-               );
-        enableCheckboxActions();
-               return false;
-           });
-           $("#CheckNone").click(function(){
-           var checked = [];
-               $(".checkboxed").unCheckCheckboxes("*",true).each(
-                   function() {
-                               selRecord(this.value,false);
-                       }
-               );
+[% END %]
+    $(document).ready(function(){
+        $("#CheckAll").click(function(){
+            var checked = [];
+            $(".checkboxed").checkCheckboxes("*", true).each(
+                function() {
+                    selRecord(this.value,true);
+                }
+            );
+            enableCheckboxActions();
+            return false;
+        });
+        $("#CheckNone").click(function(){
+        var checked = [];
+        $(".checkboxed").unCheckCheckboxes("*",true).each(
+            function() {
+                selRecord(this.value,false);
+            }
+        );
         enableCheckboxActions();
-               return false;
-           });
+            return false;
+        });
+
+    });
 
-[% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]
-          $("#tagsel_button").click(function(){
-              tagAdded();
-              return false;
-          });
-[% END %][% END %][% END %]
-       });
-[% IF ( opacuserlogin ) %][% IF ( RequestOnOpac ) %]
-    function holdSel() {
-        var items = document.getElementById('records').value;
-        if (items) {
-            document.location = "/cgi-bin/koha/opac-reserve.pl?biblionumbers=" + items;
-        } else {
-            alert(MSG_NO_RECORD_SELECTED);
-        }
-    }
-[% END %][% END %]
 function enableCheckboxActions(){
     // Enable/disable controls if checkboxes are checked
     var checkedBoxes = $(".checkboxed input:checkbox:checked");
@@ -127,9 +131,9 @@ function enableCheckboxActions(){
       $("#selections-toolbar .links a").addClass("disabled");
     }
 }
-       //]]>
-       </script>
-       [% END %]
+    //]]>
+    </script>
+    [% END %]
 </head>
 <body id="basket">
 
@@ -141,37 +145,45 @@ function enableCheckboxActions(){
 <div id="toolbar">
 <ul>
     <li>[% IF ( verbose ) %]<a href="opac-basket.pl" class="brief" onclick="showLess(); return false;">Brief display</a>[% ELSE %]<a href="opac-basket.pl" class="detail" onclick="showMore(); return false;">More details</a>[% END %]</li>
-       [% IF ( opacuserlogin ) %]<li><a class="send" href="opac-basket.pl" onclick="sendBasket(); return false;">Send</a></li>[% END %]
-       <li><a class="download" href="opac-basket.pl" onclick="downloadBasket(); return false;">Download</a></li>
-       <li><a class="print" href="opac-basket.pl" onclick="printBasket(); return false;">Print</a></li>
+    [% IF ( opacuserlogin ) %]<li><a class="send" href="opac-basket.pl" onclick="sendBasket(); return false;">Send</a></li>[% END %]
+    <li><a class="download" href="opac-basket.pl" onclick="downloadBasket(); return false;">Download</a></li>
+    <li><a class="print" href="opac-basket.pl" onclick="printBasket(); return false;">Print</a></li>
     <li><a class="empty" href="opac-basket.pl" onclick="delBasket(); return false;">Empty and close</a></li>
     <li><a class="hide close" href="opac-basket.pl">Hide window</a></li>
 </ul>
 </div>
+[% END %]
+
+[% UNLESS ( print_basket ) %]
+<div id="selections-toolbar">
+    <a id="CheckAll" href="#">Select all</a>
+    <a id="CheckNone" href="#">Clear all</a>
+    <span class="sep">|</span>
+    <span class="links" id="tag_hides">
+        <span id="selections">Select titles to: </span>
+        <a href="#" class="deleteshelf disabled" onclick="delSelRecords(); return false;">Remove</a>
+        [% IF ( opacuserlogin ) %]
+          [% IF ( virtualshelves ) %][% IF ( loggedinusername ) %]
+          <a href="#" class="newshelf disabled" onclick="addSelToShelf(); return false;">Add to a list</a>
+          [% END %][% END %]
+          [% IF ( RequestOnOpac ) %]<a href="#" class="hold disabled" onclick="holdSel(); return false;">Place hold</a>[% END %]
+          [% IF ( TagsInputEnabled && loggedinusername ) %]
+          <a href="#" id="tagsel_tag" class="disabled" onclick="tagSelected(); return false;">Tag</a>
+          [% END %]
         [% END %]
+    </span>
+    [% IF ( TagsInputEnabled && loggedinusername ) %]
+    <span id="tagsel_form" style="display:none">
+        <label for="tagsel_new">New tag:</label>
+        <input name="tagsel_new" id="tagsel_new" maxlength="100" />
+        <input id="tagsel_button" name="tagsel_button" class="input tagsel_button" title="Add" type="submit" value="Add" onclick="tagAdded(); return false;" />
+        <a href="#" id="tagsel_cancel" onclick="tagCanceled(); return false;">Cancel</a>
+    </span>
+    [% END %]
+</div>
+[% END %]
 
 [% IF ( verbose ) %]
-       [% UNLESS ( print_basket ) %]<div id="selections-toolbar"><a id="CheckAll" href="#">Select all</a> <a id="CheckNone" href="#">Clear all</a> <span class="sep">|</span> <span class="links"><span id="selections">Select titles to: </span>
-<span id="tag_hides">
-<a href="#" class="deleteshelf disabled" onclick="delSelRecords(); return false;">Remove</a>
-[% IF ( opacuserlogin ) %]
-    [% IF ( virtualshelves ) %][% IF ( loggedinusername ) %]
-         | <a href="#" class="newshelf disabled" onclick="addSelToShelf(); return false;">Add to a list</a>
-    [% END %][% END %]
-    [% IF ( RequestOnOpac ) %]| <a href="#" class="hold disabled" onclick="holdSel(); return false;">Place hold</a>[% END %]
-    [% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]
-    | <a href="#" id="tagsel_tag" class="disabled" onclick="tagSelected(); return false;">Tag</a>[% END %][% END %]
-[% END %]
-</span>
-     <span id="tagsel_form" style="display:none">
-       <label for="tagsel_new" style="display:inline">New&nbsp;tag:</label>
-       <input name="tagsel_new" id="tagsel_new" maxlength="100" style="display:inline"/>
-       <input id="tagsel_button" name="tagsel_button" class="input tagsel_button" title="tagsel_button"
-           type="submit" value="Add" style="display:inline" />
-       <a href="#" id="tagsel_cancel" onclick="tagCanceled(); return false;" style="display:inline">Cancel</a>
-     </span>
-     </span>
-</div>[% END %]
             <form action="opac-basket.pl" method="get" name="bookbag_form" id="bookbag_form" class="checkboxed">
     [% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %]
     <h3>
@@ -186,7 +198,7 @@ function enableCheckboxActions(){
                 [% IF ( BIBLIO_RESULT.author ) %] [% BIBLIO_RESULT.author |html %][% END %]
         [% END %]
     </h3>
-           <!-- COinS / Openurl -->
+        <!-- COinS / Openurl -->
     <span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.au=[% BIBLIO_RESULT.author %]&amp;rft.btitle=[% BIBLIO_RESULT.title |url %]&amp;rft.date=[% BIBLIO_RESULT.publicationyear %]&amp;rft.tpages=[% BIBLIO_RESULT.size %]&amp;rft.isbn=[% BIBLIO_RESULT.isbn |url %]&amp;rft.aucorp=&amp;rft.place=[% BIBLIO_RESULT.place %]&amp;rft.pub=[% BIBLIO_RESULT.publisher |url %]&amp;rft.edition=[% BIBLIO_RESULT.edition %]&amp;rft.series=[% BIBLIO_RESULT.series %]&amp;rft.genre="></span>
     <table>
         [% IF ( BIBLIO_RESULT.isbn ) %]
@@ -212,7 +224,7 @@ function enableCheckboxActions(){
                        </p>
                        [% END %]
                    [% END %]
-           </td>
+        </td>
         </tr>
         [% END %]
 
@@ -298,20 +310,24 @@ function enableCheckboxActions(){
         <tr>
             <th scope="row">URL(s)</th>
             <td>
-          [% FOREACH MARCurl IN BIBLIO_RESULT.MARCurlS %]
-               <p>[% IF ( MARCurl.part ) %][% MARCurl.part %]
-                       <br />[% END %]
+               [% FOREACH MARCurl IN BIBLIO_RESULT.MARCurlS %]
+                    <p>
+                    [% IF ( MARCurl.part ) %][% MARCurl.part %]
+                        <br />
+                    [% END %]
 
-               [% MARCurl.MARCurl %]
-                       [% IF ( MARCurl.notes ) %][% FOREACH note IN MARCurl.notes %][% note.note %]<br />[% END %][% END %]
-            [% END %]</p></td>
+                    [% MARCurl.MARCurl %]
+                        [% IF ( MARCurl.notes ) %][% FOREACH note IN MARCurl.notes %][% note.note %]<br />[% END %][% END %]
+                    [% END %]
+                    </p>
+            </td>
         </tr>[% END %]
 
         <tr>
             <th scope="row">Location(s) (Status)</th>
             <td>[% IF ( BIBLIO_RESULT.ITEM_RESULTS ) %]<ul>[% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
                             <li>
-                                <strong>[% ITEM_RESULT.homebranch %]</strong>[% IF ( ITEM_RESULT.location_opac ) %], [% ITEM_RESULT.location_opac %][% END %]
+                                <strong>[% ITEM_RESULT.branchname %]</strong>[% IF ( ITEM_RESULT.location_opac ) %], [% ITEM_RESULT.location_opac %][% END %]
                                 [% IF ( ITEM_RESULT.itemcallnumber ) %]
                                     ([% ITEM_RESULT.itemcallnumber %])
                                 [% END %]
@@ -324,38 +340,17 @@ function enableCheckboxActions(){
             </form>
 
 [% ELSE %]
-[% UNLESS ( print_basket ) %]
 <form action="/cgi-bin/koha/opac-basket.pl" method="get" name="bookbag_form" id="bookbag_form" class="checkboxed">
-<div id="selections-toolbar">
-    <a id="CheckAll" href="#">Select all</a>
-    <a id="CheckNone" href="#">Clear all</a>
-    <span class="sep">|</span> <span class="links"><span id="selections">Select titles to: </span>
-        <a href="#" class="deleteshelf disabled" onclick="delSelRecords(); return false;">Remove</a>
-    [% IF ( opacuserlogin ) %]
-        [% IF ( virtualshelves ) %][% IF ( loggedinusername ) %]
-          <a href="#" class="newshelf disabled" onclick="addSelToShelf(); return false;">Add to a list</a>
-        [% END %][% END %]
-        [% IF ( RequestOnOpac ) %] <a href="#" class="hold disabled" onclick="holdSel(); return false;">Place hold</a>[% END %]
-        [% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]
-         <a href="#" class="disabled" id="tagsel_tag" onclick="tagSelected(); return false;">Tag</a>[% END %][% END %]
-    [% END %]
-    </span>
-         [% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]<span id="tagsel_form" style="display:none">
-           <label for="tagsel_new" style="display:inline">New&nbsp;tag:</label>
-           <input name="tagsel_new" id="tagsel_new" maxlength="100"  style="display:inline"/>
-           <input id="tagsel_button" name="tagsel_button" class="input tagsel_button" title="tagsel_button" type="submit" value="Add"  style="display:inline"/>
-           <a href="#" id="tagsel_cancel" onclick="tagCanceled(); return false;" style="display:inline">Cancel</a>
-         </span>[% END %][% END %][% END %]</span>
-</div>
-[% END %]
     <table id="itemst">
-       <thead><tr>
-           [% UNLESS ( print_basket ) %]<th>&nbsp;</th>[% END %]
-           <th>Title</th>
-           <th>Author</th>
-           <th>Year</th>
-        <th>Location (Status)</th>
-        </tr></thead>
+    <thead>
+        <tr>
+            [% UNLESS ( print_basket ) %]<th>&nbsp;</th>[% END %]
+            <th>Title</th>
+            <th>Author</th>
+            <th>Year</th>
+            <th>Location (Status)</th>
+        </tr>
+    </thead>
 
         [% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %]
             [% IF ( BIBLIO_RESULT.even ) %]
@@ -368,31 +363,32 @@ function enableCheckboxActions(){
 
                 </td> [% END %]
             <td>
-               <a href="#" onclick="openBiblio('[% BIBLIO_RESULT.dest %]',[% BIBLIO_RESULT.biblionumber %])">
-                        [% BIBLIO_RESULT.title |html %][% IF ( BIBLIO_RESULT.subtitle ) %] [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %][% subtitl.subfield |html %][% END %][% END %]
-                </a>
+                <a href="#" onclick="openBiblio('[% BIBLIO_RESULT.dest %]',[% BIBLIO_RESULT.biblionumber %])">[% BIBLIO_RESULT.title |html %][% IF ( BIBLIO_RESULT.subtitle ) %] [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %][% subtitl.subfield |html %][% END %][% END %]</a>
                 <!-- COinS / Openurl -->
-                   <span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.au=[% BIBLIO_RESULT.author %]&amp;rft.btitle=[% BIBLIO_RESULT.title |url %]&amp;rft.date=[% BIBLIO_RESULT.publicationyear %]&amp;rft.tpages=[% BIBLIO_RESULT.size %]&amp;rft.isbn=[% BIBLIO_RESULT.isbn |url %]&amp;rft.aucorp=&amp;rft.place=[% BIBLIO_RESULT.place %]&amp;rft.pub=[% BIBLIO_RESULT.publisher |url %]&amp;rft.edition=[% BIBLIO_RESULT.edition %]&amp;rft.series=[% BIBLIO_RESULT.series %]&amp;rft.genre="></span>
-                   [% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]<div id="newtag[% BIBLIO_RESULT.biblionumber %]_status" class="tagstatus results_summary" style="display:none">Tag status here.</div>[% END %][% END %][% END %]
-           </td>
-           <td>[% BIBLIO_RESULT.author %]</td>
-           <td>
-               [% IF ( BIBLIO_RESULT.publicationyear ) %]
-                   [% BIBLIO_RESULT.publicationyear %]
+                <span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.au=[% BIBLIO_RESULT.author %]&amp;rft.btitle=[% BIBLIO_RESULT.title |url %]&amp;rft.date=[% BIBLIO_RESULT.publicationyear %]&amp;rft.tpages=[% BIBLIO_RESULT.size %]&amp;rft.isbn=[% BIBLIO_RESULT.isbn |url %]&amp;rft.aucorp=&amp;rft.place=[% BIBLIO_RESULT.place %]&amp;rft.pub=[% BIBLIO_RESULT.publisher |url %]&amp;rft.edition=[% BIBLIO_RESULT.edition %]&amp;rft.series=[% BIBLIO_RESULT.series %]&amp;rft.genre="></span>
+                [% IF ( TagsInputEnabled && loggedinusername ) %]
+                <span id="newtag[% BIBLIO_RESULT.biblionumber %]_status" class="tagstatus results_summary" style="display:none">Tag status here.</span>
+                [% END %]
+            </td>
+            <td>[% BIBLIO_RESULT.author %]</td>
+            <td>
+                [% IF ( BIBLIO_RESULT.publicationyear ) %]
+                    [% BIBLIO_RESULT.publicationyear %]
                 [% ELSE %]
-                   [% BIBLIO_RESULT.copyrightdate %]
+                    [% BIBLIO_RESULT.copyrightdate %]
                 [% END %]
-           </td>
-                <td>[% IF ( BIBLIO_RESULT.ITEM_RESULTS ) %]<ul>[% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
-                    <li>
-                        [% ITEM_RESULT.homebranch %][% IF ( ITEM_RESULT.location_opac ) %], [% ITEM_RESULT.location_opac %][% END %]
-                        [% IF ( ITEM_RESULT.itemcallnumber ) %]
-                            ([% ITEM_RESULT.itemcallnumber %])
-                        [% END %]
-                        ([% INCLUDE 'item-status.inc' item = ITEM_RESULT %])
-                    </li>
-                    [% END %]</ul>[% ELSE %]This record has no items.[% END %]</td>
-            </tr>
+            </td>
+            <td>[% IF ( BIBLIO_RESULT.ITEM_RESULTS ) %]<ul>[% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
+                <li>
+                    [% ITEM_RESULT.branchname %][% IF ( ITEM_RESULT.location_opac ) %], [% ITEM_RESULT.location_opac %][% END %]
+                    [% IF ( ITEM_RESULT.itemcallnumber ) %]
+                        ([% ITEM_RESULT.itemcallnumber %])
+                    [% END %]
+                    ([% INCLUDE 'item-status.inc' item = ITEM_RESULT %])
+                </li>
+                [% END %]</ul>[% ELSE %]This record has no items.[% END %]
+            </td>
+        </tr>
         [% END %]
     </table></form>
 [% END %]
index f740488..1753cce 100644 (file)
@@ -1,4 +1,6 @@
 [% USE KohaDates %]
+[% SET TagsShowEnabled = ( TagsEnabled && TagsShowOnDetail ) %]
+[% SET TagsInputEnabled = ( opacuserlogin && TagsEnabled && TagsInputOnDetail ) %]
 
 [% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Details for: [% title |html %][% FOREACH subtitl IN subtitle %], [% subtitl.subfield |html %][% END %]
 [% INCLUDE 'doc-head-close.inc' %]
@@ -8,6 +10,7 @@
     <script type="text/javascript" src="https://apis.google.com/js/plusone.js">
       {lang: '[% lang %]'}
     </script>
+    <script type="text/javascript">!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
 [% END %]
 [% IF ( OpacStarRatings != 'disable' ) %]<script type="text/javascript" src="/opac-tmpl/prog/en/lib/jquery/plugins/jquery.rating.js"></script>
 <link rel="stylesheet" type="text/css" href="/opac-tmpl/prog/en/css/jquery.rating.css" />[% END %]
 
      $(document).ready(function() { 
         $('#bibliodescriptions').tabs();
-[% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]$("#tagform").hide();
-        $("#addtagl").show();
-        $("#addtagl a").click(function(){
-            $("#addtagl").hide();
-            $("#tagform, #tagform a").show();
+
+[% IF ( TagsInputEnabled && loggedinusername ) %]
+        $(".tag_add").click(function(){
+            var thisid = $(this).attr("id");
+            thisid = thisid.replace("tag_add","");
+            $(this).hide();
+            $("#tagform"+thisid).show();
+            $("#newtag"+thisid).focus();
+            $("#newtag"+thisid+"_status").empty().hide();
             return false;
         });
-        $("#tagform a").click(function(){
-            $("#addtagl").show();
-            $("#tagform").hide();
+        $(".cancel_tag_add").click(function(){
+            var thisid = $(this).attr("id");
+            thisid = thisid.replace("cancel","");
+            $("#tagform"+thisid).hide();
+            $("#tag_add"+thisid).show();
+            $("#newtag"+thisid).val("");
+            $("#newtag"+thisid+"_status").empty().hide();
             return false;
-        });[% END %][% END %][% END %]
+        });
+        $(".tagbutton").click(function(){
+            var thisid = $(this).attr("title");
+            var tag = $("#newtag"+thisid).val();
+            if (!tag || (tag == "")) {
+                alert(MSG_NO_TAG_SPECIFIED);
+                return false;
+            }
+            KOHA.Tags.add_tag_button(thisid, tag);
+            return false;
+        });
+[% END %]
+
         $("#holdingst").tablesorter({[% IF ( dateformat == 'metric' ) %]
     dateFormat: 'uk',[% END %]
             widgets : ['zebra'],
             sortList: [[0,0]]
         });
-        [% IF ( query_desc ) %][% IF ( OpacHighlightedWords ) %]var query_desc = "[% query_desc |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]";
+        [% IF ( query_desc ) %][% IF ( OpacHighlightedWords ) %]var query_desc = "[% query_desc |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') |html %]";
             q_array = query_desc.split(" ");
             highlightOn();
             $("#highlight_toggle_on" ).hide().click(function() {highlightOn() ; return false;});
         [% IF ( NovelistSelectProfile ) %]
         novSelect.loadContentForISBN('[% normalized_isbn %]','[% NovelistSelectProfile %]', '[% NovelistSelectPassword %]', function(d){});
         [% END %]
-       [% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]
-        $(".tagbutton").click(KOHA.Tags.add_tag_button);[% END %][% END %][% END %]
-
 
     [% IF ( OpacBrowseResults && busc ) %]
         if (arrPagination.length > 0) {
@@ -292,9 +312,6 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
  });
 //]]>
 </script>
-[% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]<style type="text/css">
-    #addtagl { display: none; }
-</style>[% END %][% END %][% END %]
 <style type="text/css">
 .branch-info-tooltip {
   display: none;
@@ -502,8 +519,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
        </span>
 [% END %]
 
-[% IF ( TagsEnabled ) %]
-    [% IF ( TagsShowOnDetail ) %]
+[% IF ( TagsShowEnabled ) %]
         <div class="results_summary">
         [% IF ( TagLoop ) %]
         <span class="label">Tags from this library:</span>
@@ -514,28 +530,23 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
     [% END %]
         </div>
 [% END %]
-[% IF ( opacuserlogin ) %]
-  [% IF ( loggedinusername ) %]
-   [% IF ( TagsEnabled ) %]
-      [% IF ( TagsInputOnDetail ) %]
+[% IF ( TagsInputEnabled ) %]
       <div class="results_summary">
-        <span class="label" id="addtagl"><a href="#">Add</a></span>
-         <form name="tagform[% biblionumber %]" method="post" action="/cgi-bin/koha/opac-tags.pl" id="tagform">
-                <label for="newtag[% biblionumber %]">New:</label><input name="newtag[% biblionumber %]" id="newtag[% biblionumber %]" maxlength="100" />
+        [% IF ( loggedinusername ) %]
+            <a class="tag_add" id="tag_add[% biblionumber %]" href="#">Add</a>
+            <form id="tagform[% biblionumber %]" method="post" action="/cgi-bin/koha/opac-tags.pl" style="display:none;">
+                <label for="newtag[% biblionumber %]">New tag(s):</label>
+                <input name="newtag[% biblionumber %]" id="newtag[% biblionumber %]" maxlength="100" type="text"/>
                 <input name="tagbutton" class="input tagbutton" title="[% biblionumber %]" type="submit" value="Add" />
-                <a href="#">Cancel</a>
+                <a class="cancel_tag_add" id="cancel[% biblionumber %]" href="#">(done)</a>
             </form>
             <span id="newtag[% biblionumber %]_status" class="tagstatus" style="display:none;">
                 Tag status here.
             </span>
-            <br />
-            [% ELSE %]
-                <span id="login4tags" class="tagstatus">Log in to add tags.</span>
-            [% END %]
+        [% ELSE %]
+            <span id="login4tags">Log in to add tags.</span>
         [% END %]
         </div>
-    [% END %]
-   [% END %]
 [% END %]
 
         [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsSeries ) %][% IF ( SyndeticsSERIES1Exists ) %]
@@ -695,19 +706,15 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
     <li id="tab_editions"><a href="#editions">Editions</a></li>
 [% END %][% END %]
 
-[% IF ( Babeltheque ) %]
-    <li id="tab_babeltheque"><a href="#babeltheque">Babelthèque</a></li>
-[% END %]
-
 [% IF ( serialcollection ) %]
     [% IF ( defaulttab == 'serialcollection' ) %]<li id="tab_serialcollection" class="ui-tabs-selected">[% ELSE %]<li id="tab_serialcollection">[% END %]
         <a href="#serialcollection">Serial collection</a>
     </li>
 [% END %]
 
-[% IF ( OPACLocalCoverImages ) %][% IF ( localimages ) %]
+[% IF ( OPACLocalCoverImages && localimages.size ) %]
     <li id="tab_images"><a href="#images">Images</a></li>
-[% END %][% END %]
+[% END %]
 </ul>
 
 [% IF ( serialcollection ) %]
@@ -981,6 +988,8 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
     [% FOREACH subscription IN subscriptions %]
     [% IF ( subscription.branchname ) %]<h3>At library: [% subscription.branchname %]</h3>[% ELSE %]
     [% IF ( subscription.branchcode ) %]<h3>At library: [% subscription.branchcode %]</h3>[% END %][% END %]
+    [% IF ( subscription.closed ) %]<p>This subscription is closed.</p>[% END %]
+    <span style="display:none;"> [% IF ( subscription.callnumber ) %]<p>Callnumber: [% subscription.callnumber %]</p>[% END %]</span>
     [% IF ( subscription.subscriptionnotes ) %]<p>[% subscription.subscriptionnotes FILTER html_line_break %] </p>[% END %]
     <p>Subscription from: [% subscription.histstartdate | $KohaDates %] to:[% IF ( subscription.histenddate ) %] [% subscription.histenddate | $KohaDates %] [% ELSE %] now (current)[% END %]</p>
     [% IF ( subscription.missinglist ) %]<p>Missing issues: [% subscription.missinglist %] </p>[% END %]
@@ -1142,7 +1151,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
 </table>
 </div>[% END %][% END %]
 
-[% IF ( OPACLocalCoverImages ) %]
+[% IF ( OPACLocalCoverImages && localimages.size ) %]
 <div id="images">
 <p>Click on an image to view it in the image viewer</p>
 [% FOREACH image IN localimages %]
@@ -1219,11 +1228,11 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
     <div id="social_networks">
         <span>Share</span>
         <div><a id="facebook" href="http://www.facebook.com/sharer.php?u=[% current_url |url %]&amp;t=[% title |url %]" title="Share on Facebook">Facebook</a></div>
-        <div><a id="twitter" href="http://twitter.com/share" title="Share on Twitter">Twitter</a></div>
         <div><a id="linkedin" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=[% current_url |url %]&amp;title=[% title |url %]" title="Share on LinkedIn">LinkedIn</a></div>
         <div><a id="delicious" href="http://www.delicious.com/save?url=[% current_url |url %]&amp;title=[% title |url %]" title="Share on Delicious">Delicious</a></div>
-        <div><a id="email" href="mailto:?subject=[% title %]&amp;body=[% title %] ([% current_url |url %])" title="Share by email">Email</a></div>
-        <div><g:plusone size="small"></g:plusone></div>
+        <div><a id="email" href="mailto:?subject=[% title |url %]&amp;body=[% title |url %] ([% current_url |url %])" title="Share by email">Email</a></div>
+        <div><g:plusone size="small" annotation="none"></g:plusone></div>
+        <div><a id="twitter" href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-text="[% title %]" data-lang="[% lang %]">Tweet</a></div>
     </div>
 [% END %]
 
index 6b1e365..f594ffc 100644 (file)
@@ -9,9 +9,9 @@
        <ol><li><label for="format">Download cart:</label>
         <select name="format" id="format">
         <option value="">-- Choose format --</option>
-           <option value="iso2709">iso2709</option>
-           <option value="ris">RIS</option>
-           <option value="bibtex">BibTex</option>
+        <option value="ris">RIS (Zotero, EndNote, others)</option>
+        <option value="bibtex">BibTeX</option>
+        <option value="iso2709">MARC</option>
            [% FOREACH csv_profile IN csv_profiles %]
            <option value="[% csv_profile.export_format_id %]">CSV - [% csv_profile.profile %]</option>
            [% END %]
index e3c9a21..5712c6a 100644 (file)
@@ -17,9 +17,9 @@
                <ol><li><label for="format">Download list:</label>
                <select name="format" id="format">
             <option value="">-- Choose format --</option>
-                   <option value="iso2709">iso2709</option>
-                   <option value="ris">RIS</option>
-                   <option value="bibtex">BibTex</option>
+            <option value="ris">RIS (Zotero, EndNote, others)</option>
+            <option value="bibtex">BibTeX</option>
+            <option value="iso2709">MARC</option>
                    [% FOREACH csv_profile IN csv_profiles %]
                    <option value="[% csv_profile.export_format_id %]">CSV - [% csv_profile.profile %]</option>
                    [% END %]
index 6b47afa..c37a6ef 100644 (file)
@@ -200,12 +200,15 @@ function showlayer(numlayer){
                    </td>
                    <td>    [% serial.serialseq %]
                    </td>
-                   <td>    [% IF ( serial.status1 ) %]Waiting[% END %]
-                       [% IF ( serial.status2 ) %]Arrived[% END %]
-                       [% IF ( serial.status3 ) %]Late[% END %]
-                       [% IF ( serial.status4 ) %]Missing[% END %]
-            [% IF ( serial.status5 ) %]Not available[% END %]
-                       [% IF ( serial.status7 ) %]Claimed[% END %]
+            <td>
+              [% IF ( serial.status1 ) %]Expected[% END %]
+              [% IF ( serial.status2 ) %]Arrived[% END %]
+              [% IF ( serial.status3 ) %]Late[% END %]
+              [% IF ( serial.status4 ) %]Missing[% END %]
+              [% IF ( serial.status5 ) %]Not available[% END %]
+              [% IF ( serial.status6 ) %]Delete[% END %]
+              [% IF ( serial.status7 ) %]Claimed[% END %]
+              [% IF ( serial.status8 ) %]Stopped[% END %]
                    </td>
                    <td class="subscriptionidfilterclass">    [% serial.subscriptionid %]
                    </td>
index e761402..2d51ba6 100644 (file)
@@ -19,7 +19,7 @@
    <channel>
      <title><![CDATA[[% LibraryName |html %] Search [% IF ( query_desc ) %]for '[% query_desc |html %]'[% END %][% IF ( limit_desc ) %] with limit(s): '[% limit_desc |html %]'[% END %]]]></title>
      <link>[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;format=rss2</link>
-     <atom:link rel="self" type="application/rss+xml" href="[% OPACBaseurl %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;sort_by=[% sort_by |html %]&amp;format=rss2"/>
+     <atom:link rel="self" type="application/rss+xml" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;sort_by=[% sort_by |html %]&amp;format=rss2"/>
      <description><![CDATA[ Search results [% IF ( query_desc ) %]for '[% query_desc |html %]'[% END %][% IF ( limit_desc ) %] with limit(s): '[% limit_desc |html %]'[% END %] at [% LibraryName |html %]]]></description>
      <opensearch:totalResults>[% total %]</opensearch:totalResults>
      <opensearch:startIndex>[% offset %]</opensearch:startIndex>
@@ -29,7 +29,7 @@
        <opensearch:itemsPerPage>20</opensearch:itemsPerPage>
      [% END %]
         [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
-     <atom:link rel="search" type="application/opensearchdescription+xml" href="[% SEARCH_RESULT.OPACBaseurl %]/cgi-bin/koha/opac-search.pl?[% SEARCH_RESULT.query_cgi |html %][% SEARCH_RESULT.limit_cgi |html %]&amp;sort_by=[% SEARCH_RESULT.sort_by |html %]&amp;format=opensearchdescription"/>
+     <atom:link rel="search" type="application/opensearchdescription+xml" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% SEARCH_RESULT.query_cgi |html %][% SEARCH_RESULT.limit_cgi |html %]&amp;sort_by=[% SEARCH_RESULT.sort_by |html %]&amp;format=opensearchdescription"/>
      <opensearch:Query role="request" searchTerms="[% SEARCH_RESULT.query_desc |url %][% SEARCH_RESULT.limit_desc |url %]" startPage="[% SEARCH_RESULT.page %]" />
      <item>
        <title>[% SEARCH_RESULT.title |html %] [% FOREACH subtitl IN SEARCH_RESULT.subtitle %], [% subtitl.subfield |html %][% END %]</title>
                         [% IF ( SEARCH_RESULT.pages ) %]. [% SEARCH_RESULT.pages |html %][% END %]
                         [% IF ( SEARCH_RESULT.notes ) %], [% SEARCH_RESULT.notes |html %][% END %]
                         [% IF ( SEARCH_RESULT.size ) %] [% SEARCH_RESULT.size |html %]. [% END %]
-                        [% IF ( SEARCH_RESULT.isbn ) %] [% SEARCH_RESULT.isbn |html %][% END %] </p><p>
+                        [% IF ( SEARCH_RESULT.isbn ) %] [% SEARCH_RESULT.isbn |html %][% END %]
+       </p>
 [% IF ( RequestOnOpac ) %]
-<a href="[% SEARCH_RESULT.OPACBaseurl %]/cgi-bin/koha/opac-reserve.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Place Hold on <i>[% SEARCH_RESULT.title %]</i></a></p>
+<p><a href="[% OPACBaseURL %]/cgi-bin/koha/opac-reserve.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Place Hold on <i>[% SEARCH_RESULT.title %]</i></a></p>
 [% END %]
                                                ]]></description>
        <guid>[% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]</guid>
      <opensearch:itemsPerPage>20</opensearch:itemsPerPage>
    [% END %]
    <opensearch:Query role="request" searchTerms="[% query_desc |html %] [% limit_desc |html %]" startPage="[% page |html %]" />
-   <link rel="alternate" href="[% OPACBaseurl %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]pw=[% page %]&amp;format=atom" type="application/atom+xml"/>
+   <link rel="alternate" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]pw=[% page %]&amp;format=atom" type="application/atom+xml"/>
    <link rel="self" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]&amp;format=atom" type="application/atom+xml"/>
    <link rel="first" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]pw=1&amp;format=atom" type="application/atom+xml"/>
    <link rel="previous" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]pw=2&amp;format=atom" type="application/atom+xml"/>
    <link rel="next" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]pw=4&amp;format=atom" type="application/atom+xml"/>
-   <link rel="last" href="[% OPACBaseurl %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]pw=42299&amp;format=atom" type="application/atom+xml"/>
+   <link rel="last" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]pw=42299&amp;format=atom" type="application/atom+xml"/>
    <link rel="search" type="application/opensearchdescription+xml" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?format=opensearchdescription"/>
 
    [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
index 907835f..d10ab7b 100644 (file)
         </p></div>
     [% END %]
     
-    [% IF ( Ask_data ) %]
-        [% IF ( OpacPasswordChange ) %]
+    [% IF ( OpacPasswordChange ) %]
+        [% IF ( Ask_data ) %]
         <form action="/cgi-bin/koha/opac-passwd.pl" name="mainform" id="mainform" method="post"><fieldset class="brief">
                        [% UNLESS ( ShortPass ) %]<div class="hint">Your password must be at least [% minpasslen %] characters long.</div>[% END %]
           <ol>  <li><label for="Oldkey">Current password:</label> <input type="password" id="Oldkey" size="25"  name="Oldkey" /></li>
             <li><label for="Newkey">New password:</label> <input type="password" id="Newkey"  size="25"  name="Newkey" /></li>
             <li><label for="Confirm">Re-type new password:</label> <input type="password"  id="Confirm" size="25" name="Confirm" /></li></ol></fieldset>
             <fieldset class="action"><input type="submit" value="Submit changes" class="submit" /> <a href="/cgi-bin/koha/opac-user.pl" class="cancel">Cancel</a></fieldset>
-    </form>
-        [% ELSE %]
-            <div class="dialog alert">You can't change your password.</div>
+        </form>
         [% END %]
+    [% ELSE %]
+        <div class="dialog alert">You can't change your password.</div>
     [% END %]
     
     [% IF ( password_updated ) %]
index 86e1a08..222d841 100644 (file)
@@ -62,7 +62,7 @@ $(document).ready(function(){
         return false;
     });
     [% IF ( query_desc ) %]
-    var query_desc = "[% query_desc |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]";
+    var query_desc = "[% query_desc |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') |html %]";
     q_array = query_desc.split(" ");
     // ensure that we don't have "" at the end of the array, which can
     // break the highlighter
index e5238f7..2e3ad22 100644 (file)
@@ -1,3 +1,6 @@
+[% SET TagsShowEnabled = ( TagsEnabled && TagsShowOnList ) %]
+[% SET TagsInputEnabled = ( opacuserlogin && TagsEnabled && TagsInputOnList ) %]
+
 [% INCLUDE 'doc-head-open.inc' %]
 [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo;
 [% IF ( searchdesc ) %]
@@ -6,7 +9,7 @@
     You did not specify any search criteria.
 [% END %]
 [% INCLUDE 'doc-head-close.inc' %]
-<link rel="alternate" type="application/rss+xml" title="[% LibraryName |html %] Search RSS Feed" href="[% OPACBaseurl %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;count=[% countrss |html %]&amp;sort_by=acqdate_dsc&amp;format=rss2" />
+<link rel="alternate" type="application/rss+xml" title="[% LibraryName |html %] Search RSS Feed" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;count=[% countrss |html %]&amp;sort_by=acqdate_dsc&amp;format=rss2" />
 [% IF ( OpacStarRatings == 'all' ) %]<script type="text/javascript" src="/opac-tmpl/prog/en/lib/jquery/plugins/jquery.rating.js"></script>
 <link rel="stylesheet" type="text/css" href="/opac-tmpl/prog/en/css/jquery.rating.css" />[% END %]
 
@@ -38,9 +41,9 @@ function holdBiblioNums(numList) {
     // numList: biblio numbers separated by "/"
     $("#hold_form_biblios").attr("value", numList);
     $("#hold_form").submit();
-}[% END %]
+}[% END %][% END %]
 
-[% IF ( TagsEnabled ) %]
+[% IF ( TagsInputEnabled && loggedinusername ) %]
 function tagSelected() {
     var checkedBoxes = $(".searchresults :checkbox:checked");
     if ($(checkedBoxes).size() == 0) {
@@ -56,6 +59,8 @@ function tagCanceled() {
     $("#tagsel_form").hide();
     $("#tagsel_tag").show();
     $("#sort_by").show();
+    $("#tagsel_new").val("");
+    $("#tagsel_status, .tagstatus").empty().hide();
 }
 
 function tagAdded() {
@@ -67,6 +72,7 @@ function tagAdded() {
 
     var tag = $("#tagsel_new").val();
     if (!tag || (tag == "")) {
+        alert(MSG_NO_TAG_SPECIFIED);
         return false;
     }
 
@@ -78,7 +84,7 @@ function tagAdded() {
 
     KOHA.Tags.add_multitags_button(bibs, tag);
     return false;
-}[% END %][% END %]
+}[% END %]
 [% IF ( OpacHighlightedWords ) %]
 var q_array = new Array();  // holds search terms if available
 
@@ -123,7 +129,7 @@ $(document).ready(function(){
     [% END %]
     param1 += "<\/select> <input type=\"submit\" class=\"submit\" value=\""+_("Save")+"\" />";
     [% ELSE %]
-        var param1 = "<a id=\"addto\" class=\"addtocart\" href=\"#\">Add to cart<\/a>";
+        var param1 = "<a id=\"addto\" class=\"addtocart\" href=\"#\">" + _("Add to cart") + "<\/a>";
     [% END %]
 [% ELSE %]
         var param1 = "<label for=\"addto\">"+_("Add to list: ")+"<\/label><select name=\"addto\" id=\"addto\"><option value=\"\"><\/option>";
@@ -161,7 +167,6 @@ $(document).ready(function(){
     });
     [% END %]
 [% END %]
-    [% IF ( opacuserlogin ) %][% IF ( TagsEnabled ) %]$("#tagsel_span").html("<input id=\"tagsel_tag\" class=\"submit\" type=\"submit\" value=\"Tag\"/>");[% END %][% END %]
 
     function cartList(){
         if($("#addto").find("option:selected").attr("value") == "addtolist"){
@@ -207,7 +212,7 @@ $(document).ready(function(){
 [% END %]
     $("#holdDetails").hide();
 
-[% IF ( query_desc ) %][% IF ( OpacHighlightedWords ) %]var query_desc = "[% query_desc |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]";
+[% IF ( query_desc ) %][% IF ( OpacHighlightedWords ) %]var query_desc = "[% query_desc |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') |html %]";
         q_array = query_desc.split(" ");
         // ensure that we don't have "" at the end of the array, which can
         // break the highlighter
@@ -218,10 +223,7 @@ $(document).ready(function(){
         $("#highlight_toggle_on" ).hide().click(function() {highlightOn() ;});
         $("#highlight_toggle_off").show().click(function() {highlightOff();});[% END %][% END %]
 
-[% IF ( opacuserlogin ) %]    [% IF ( TagsEnabled ) %]
-        $(".tagbutton").click(KOHA.Tags.add_tag_button);
-        [% IF ( TagsInputOnList ) %]
-        [% IF ( loggedinusername ) %]
+[% IF ( TagsInputEnabled && loggedinusername ) %]
             $("#tagsel_tag").click(function(){
                 tagSelected();
                 return false;
@@ -235,31 +237,35 @@ $(document).ready(function(){
                 return false;
             });
 
-            $(".tag_results_add").click(function(){
+            $(".tag_add").click(function(){
                 var thisid = $(this).attr("id");
                 thisid = thisid.replace("tag_add","");
                 $(this).hide();
                 $("#tagform"+thisid).show();
                 $("#newtag"+thisid).focus();
+                $("#newtag"+thisid+"_status").empty().hide();
                 return false;
-            })
-
+            });
             $(".cancel_tag_add").click(function(){
                 var thisid = $(this).attr("id");
                 thisid = thisid.replace("cancel","");
-                $(this).parent().hide();
+                $("#tagform"+thisid).hide();
                 $("#tag_add"+thisid).show();
+                $("#newtag"+thisid).val("");
+                $("#newtag"+thisid+"_status").empty().hide();
                 return false;
-            })
-
-        [% ELSE %]
-            $("#tagsel_tag").click(function(){
-                window.location = "/cgi-bin/koha/opac-user.pl";
+            });
+            $(".tagbutton").click(function(){
+                var thisid = $(this).attr("title");
+                var tag = $("#newtag"+thisid).val();
+                if (!tag || (tag == "")) {
+                    alert(MSG_NO_TAG_SPECIFIED);
+                    return false;
+                }
+                KOHA.Tags.add_tag_button(thisid, tag);
                 return false;
             });
-        [% END %]
-        [% END %]
-    [% END %][% END %]
+[% END %]
     [% IF OpenLibraryCovers %]KOHA.OpenLibrary.GetCoverFromIsbn();[% END %]
     [% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %]
     [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
@@ -285,10 +291,10 @@ $(document).ready(function(){
     <div id="yui-main">
     <div class="yui-b">
     <div id="userresults" class="container">
-    [% IF ( DidYouMeanFromAuthorities ) %]
-        <div id='didyoumean'>Not what you expected? Check for <a href='/cgi-bin/koha/svc/suggestion?render=standalone&q=[% querystring | uri %]'>suggestions</a></div>
+    [% IF ( DidYouMean ) %]
+        <div id='didyoumean'>Not what you expected? Check for <a href='/cgi-bin/koha/svc/suggestion?render=standalone&amp;q=[% querystring | uri %]'>suggestions</a></div>
     [% END %]
-    [% INCLUDE 'page-numbers.inc' %]<br />
+    <div id="top-pages">[% INCLUDE 'page-numbers.inc' %]</div>
   [% IF ( koha_spsuggest ) %]
     Did you mean:
     <ul style="list-style: none;">
@@ -395,22 +401,20 @@ $(document).ready(function(){
             <span id="placehold"><!-- input class="submit" type="submit" value="Place Hold"/ --></span>
             <div id="holdDetails"></div>
 
-            [% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]
-                        [% IF ( TagsInputOnList ) %]
-                            <span id="tagsel_span"></span>
-                          [% IF ( loggedinusername ) %]
+            [% IF ( TagsInputEnabled && loggedinusername ) %]
+                            <span id="tagsel_span">
+                              <input id="tagsel_tag" class="submit" type="submit" value="Tag"/>
+                            </span>
                             <span id="tagsel_form" style="display:none">
                               <label for="tagsel_new">New tag:</label>
                               <input name="tagsel_new" id="tagsel_new" maxlength="100" />
-                              <input id="tagsel_button" name="tagsel_button" class="input tagsel_button" title="tagsel_button" type="submit" value="Add" />
-                              <a href="#" id="tagsel_cancel">Cancel</a>
+                              <input id="tagsel_button" name="tagsel_button" class="input tagsel_button" title="Add" type="submit" value="Add" />
+                              <a href="#" id="tagsel_cancel">(done)</a>
                             </span>
                             <span id="tagsel_status" class="tagsel_tatus" style="display:none;">
                               Tag status here.
                             </span>
-                          [% END %]
-                        [% END %]
-                [% END %][% END %][% END %]
+            [% END %]
         </div>
 
         </td></tr>
@@ -542,18 +546,15 @@ $(document).ready(function(){
                 [% END %]
 
                 [% IF ( LibraryThingForLibrariesID ) %]<div class="ltfl_reviews"></div>[% END %]
-                [% IF ( opacuserlogin ) %][% IF ( TagsEnabled ) %]
-                                [% IF ( TagsShowOnList ) %]
+                [% IF ( TagsShowEnabled ) %]
                                 [% IF ( SEARCH_RESULT.TagLoop.size ) %]
                                         <div class="results_summary"><span class="label">Tags:</span>
                                         <ul style="display: inline; list-style: none;">[% FOREACH TagLoo IN SEARCH_RESULT.TagLoop %]<li style="display: inline; list-style: none;"><a href="/cgi-bin/koha/opac-search.pl?tag=[% TagLoo.term |url %]&amp;q=[% TagLoo.term |url %]">[% TagLoo.term %]</a> <span class="weight">([% TagLoo.weight_total %])</span></li>
                                             [% END %]
                                         </ul>
-                                   [% END %]
-                                    [% IF ( SEARCH_RESULT.TagLoop.size ) %]
-                                    </div>[% END %]
+                                        </div>
                                 [% END %]
-                                [% END %][% END %]
+                [% END %]
                 [% IF ( SEARCH_RESULT.searchhighlightblob ) %]<span class="results_summary"><span class="label">Match:</span> [% SEARCH_RESULT.searchhighlightblob %]</span>[% END %]
 
 
@@ -598,14 +599,18 @@ $(document).ready(function(){
                     [% END %]
                 [% END %]
 
-                [% IF ( TagsInputOnList ) %]
+                [% IF ( TagsInputEnabled ) %]
                     [% IF ( loggedinusername ) %]
-                        <a class="tag_results_add" id="tag_add[% SEARCH_RESULT.biblionumber %]" href="#">Add tag</a>
-                        <span id="tagform[% SEARCH_RESULT.biblionumber %]" class="tag_results_input"><label for="newtag[% SEARCH_RESULT.biblionumber %]">New tag(s):</label><input name="newtag[% SEARCH_RESULT.biblionumber %]" id="newtag[% SEARCH_RESULT.biblionumber %]" maxlength="100" />
-                        <input name="tagbutton" class="tagbutton" title="[% SEARCH_RESULT.biblionumber %]" type="submit" value="Add" /> <a class="cancel_tag_add" id="cancel[% SEARCH_RESULT.biblionumber %]" href="#">Cancel</a>
+                        <a class="tag_add" id="tag_add[% SEARCH_RESULT.biblionumber %]" href="#">Add tag</a>
+                        <span id="tagform[% SEARCH_RESULT.biblionumber %]" class="tag_results_input" style="display:none;">
+                          <label for="newtag[% SEARCH_RESULT.biblionumber %]">New tag(s):</label>
+                          <input name="newtag[% SEARCH_RESULT.biblionumber %]" id="newtag[% SEARCH_RESULT.biblionumber %]" maxlength="100" />
+                          <input name="tagbutton" class="tagbutton" title="[% SEARCH_RESULT.biblionumber %]" type="submit" value="Add" />
+                          <a class="cancel_tag_add" id="cancel[% SEARCH_RESULT.biblionumber %]" href="#">(done)</a>
+                        </span>
                         <span id="newtag[% SEARCH_RESULT.biblionumber %]_status" class="tagstatus" style="display:none;">
-                        Tag status here.
-                        </span></span>
+                          Tag status here.
+                        </span>
                     [% ELSIF ( loop.first ) %]<span id="login4tags">Log in to add tags.</span>
                     [% END %]
                 [% END %]
@@ -654,7 +659,7 @@ $(document).ready(function(){
     </form>
         </div>
     [% END %]
-    [% INCLUDE 'page-numbers.inc' %]
+    <div id="bottom-pages">[% INCLUDE 'page-numbers.inc' %]</div>
 
     [% ELSE %]
     [% END %]
index 6845f6b..5ab225d 100644 (file)
@@ -1,4 +1,4 @@
-[% INCLUDE 'doc-head-open.inc' %][% LibraryNameTitle or "Koha online" %] catalog &rsaquo; Comments on [% title %]
+[% INCLUDE 'doc-head-open.inc' %][% LibraryNameTitle or "Koha online" %] catalog &rsaquo; Comments on [% title |html %]
 [% INCLUDE 'doc-head-close.inc' %]
 <style type="text/css">
   #custom-doc { width:37.08em;*width:36.16em;min-width:485px; margin:1em auto; text-align:left; }
@@ -68,7 +68,7 @@
     <input type="hidden" name="biblionumber" value="[% biblionumber | html%]" />
     [% IF ( reviewid ) %]<input type="hidden" name="reviewid" value="[% reviewid | html%]" />[% END %]
        <fieldset class="brief">
-       <legend>Comments on <i>[% title |html %] [% subtitle %]</i>[% IF ( author ) %]by [% author %][% END %]</legend>
+       <legend>Comments on <i>[% title |html %] [% subtitle %]</i>[% IF ( author ) %]by [% author |html %][% END %]</legend>
             <ol><li><textarea id="review" name="review" cols="60" rows="8">[% review %]</textarea></li></ol>
                </fieldset>
     <p>Note: Your comment must be approved by a librarian. </p>
index 9e782fb..2e21d12 100644 (file)
@@ -1,12 +1,13 @@
+[% SET TagsShowEnabled = ( TagsEnabled && TagsShowOnList ) %]
+[% SET TagsInputEnabled = ( opacuserlogin && TagsEnabled && TagsInputOnList ) %]
+
 [% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo;   [% IF ( viewshelf ) %]Contents of [% shelfname |html %][% ELSE %]Your lists[% END %][% INCLUDE 'doc-head-close.inc' %]
 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
 <script type="text/javascript">
 //<![CDATA[
-var MSG_NO_TAG_SPECIFIED = _("No tag was specified.");
 var MSG_REMOVE_FROM_LIST = _("Are you sure you want to remove these items from the list?");
 var MSG_CONFIRM_DELETE_LIST = _("Are you sure you want to delete this list?");
-var MSG_NO_RECORD_SELECTED = _("Please select one or more items");
 
 [% IF ( opacuserlogin ) %][% IF ( RequestOnOpac ) %]
 function holdSelections() {
@@ -24,7 +25,8 @@ function holdSelections() {
     }
 }
 [% END %][% END %]
-[% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]function tagSelected() {
+[% IF ( TagsInputEnabled && loggedinusername ) %]
+function tagSelected() {
     var checkedBoxes = $("input:checkbox:checked");
     if ($(checkedBoxes).size()) {
         $("#tagsel_tag").hide();
@@ -39,6 +41,8 @@ function tagCanceled() {
     $("#tagsel_form").hide();
     $("#tagsel_tag").show();
     $(".tag_hides").show();
+    $("#tagsel_new").val("");
+    $(".tagstatus").empty().hide();
 }
 
 function tagAdded() {
@@ -62,7 +66,7 @@ function tagAdded() {
 
     KOHA.Tags.add_multitags_button(bibs, tag);
     return false;
-}[% END %][% END %][% END %]
+}[% END %]
 
 function enableCheckboxActions(){
     // Enable/disable controls if checkboxes are checked
@@ -102,35 +106,51 @@ $(function() {
     $(".cb").click(function(){
       enableCheckboxActions();
     });
+    enableCheckboxActions();
 
-    [% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]
-          $("#addtags").click(function(){
+[% IF ( TagsInputEnabled && loggedinusername ) %]
+        $("#tagsel_tag").click(function(){
             tagSelected();
             return false;
-          });
-          $("#addtags").html("<a id=\"tagsel_tag\" href=\"#\" class=\"disabled\">"+_("Tag")+"<\/a> ");
-
-        $(".tagbutton").click(KOHA.Tags.add_tag_button);
-      [% IF ( loggedinusername ) %]
-            $("#tagsel_tag").click(function(){
-                tagSelected();
-                return false;
-            });
-            $("#tagsel_cancel").click(function(){
-                tagCanceled();
-                return false;
-            });
-            $("#tagsel_button").click(function(){
-                tagAdded();
-                return false;
-            });
-        [% ELSE %]
-            $("#tagsel_tag").click(function(){
-                window.location = "/cgi-bin/koha/opac-user.pl";
-                return false;
-            });
-        [% END %]
-        [% END %][% END %][% END %]
+        });
+        $("#tagsel_cancel").click(function(){
+            tagCanceled();
+            return false;
+        });
+        $("#tagsel_button").click(function(){
+            tagAdded();
+            return false;
+        });
+
+        $(".tag_add").click(function(){
+            var thisid = $(this).attr("id");
+            thisid = thisid.replace("tag_add","");
+            $(this).hide();
+            $("#tagform"+thisid).show();
+            $("#newtag"+thisid).focus();
+            $("#newtag"+thisid+"_status").empty().hide();
+            return false;
+        });
+        $(".cancel_tag_add").click(function(){
+            var thisid = $(this).attr("id");
+            thisid = thisid.replace("cancel","");
+            $("#tagform"+thisid).hide();
+            $("#tag_add"+thisid).show();
+            $("#newtag"+thisid).val("");
+            $("#newtag"+thisid+"_status").empty().hide();
+            return false;
+        });
+        $(".tagbutton").click(function(){
+          var thisid = $(this).attr("title");
+          var tag = $("#newtag"+thisid).val();
+          if (!tag || (tag == "")) {
+              alert(MSG_NO_TAG_SPECIFIED);
+              return false;
+          }
+          KOHA.Tags.add_tag_button(thisid, tag);
+          return false;
+        });
+[% END %]
   [% IF ( loggedinusername && allowremovingitems ) %]
   $("#myform").submit(function(){
     var checkedBoxes = $(".checkboxed input:checkbox:checked");
@@ -223,7 +243,7 @@ $(function() {
                      </div>
                     [% END %]
                     [% IF ( paramsloo.nopermission ) %]
-                      <div class="dialog alert">ERROR: You do not have adequate permission for that action on list [% paramsloo.nopermission %].</div>
+                      <div class="dialog alert">ERROR: You do not have adequate permission for that action on list [% paramsloo.nopermission |html%].</div>
                     [% END %]
                     [% IF ( paramsloo.failgetitem ) %]
                       <div class="dialog alert">ERROR: No item found with barcode [% paramsloo.failgetitem %].</div>
@@ -261,9 +281,9 @@ $(function() {
               [% IF ( itemsloop ) %]
                   <div id="toolbar" class="list-actions">
 
-                      <a href="/cgi-bin/koha/opac-downloadshelf.pl?shelfid=[% shelfnumber %]" class="download" onclick="open(CGIBIN+'opac-downloadshelf.pl?shelfid=[% shelfnumber %]','win_form','dependant=yes,scrollbars=no,resizable=no,height=300,width=450,top=50,left=100'); return false;">Download list</a>
+                      <a href="/cgi-bin/koha/opac-downloadshelf.pl?shelfid=[% shelfnumber %]" class="download" onclick="open(CGIBIN+'opac-downloadshelf.pl?shelfid=[% shelfnumber %]','win_form','scrollbars=no,resizable=no,height=300,width=450,top=50,left=100'); return false;">Download list</a>
 
-[% IF ( opacuserlogin ) %]<span class="sendlist"><a href="/cgi-bin/koha/opac-sendshelf.pl?shelfid=[% shelfnumber %]" class="send" onclick="open(CGIBIN+'opac-sendshelf.pl?shelfid=[% shelfnumber %]','win_form','dependant=yes,scrollbars=no,resizable=no,height=300,width=450,top=50,left=100'); return false; ">Send list</a></span>[% END %]
+[% IF ( opacuserlogin ) %]<span class="sendlist"><a href="/cgi-bin/koha/opac-sendshelf.pl?shelfid=[% shelfnumber %]" class="send" onclick="open(CGIBIN+'opac-sendshelf.pl?shelfid=[% shelfnumber %]','win_form','scrollbars=no,resizable=no,height=300,width=450,top=50,left=100'); return false; ">Send list</a></span>[% END %]
 
 <a class="print" href="opac-shelves.pl" onclick="print(); return false;">Print list</a>
 
@@ -285,16 +305,16 @@ $(function() {
                                       [% IF ( RequestOnOpac ) %]
                                         <span id="placehold"></span>
                                       [% END %]
-                                      [% IF ( loggedinusername ) %]
-                                        [% IF ( TagsEnabled ) %]
-                                          <span id="addtags"></span>
-                                          <span id="tagsel_form" style="display:none">
-                                          <label for="tagsel_new" style="display:inline">New&nbsp;tag:</label>
-                                          <input name="tagsel_new" id="tagsel_new" maxlength="100" style="display:inline"/>
-                                          <input id="tagsel_button" name="tagsel_button" class="input tagsel_button" title="tagsel_button" type="submit" value="Add" style="display:inline" />
-                                          <a href="#" id="tagsel_cancel" onclick="tagCanceled(); return false;" style="display:inline">Cancel</a>
-                                          </span>
-                                        [% END %]
+                                      [% IF ( TagsInputEnabled && loggedinusername ) %]
+                                        <span id="addtags">
+                                          <a id="tagsel_tag" href="#" class="disabled">Tag</a>
+                                        </span>
+                                        <span id="tagsel_form" style="display:none">
+                                          <label for="tagsel_new">New tag:</label>
+                                          <input name="tagsel_new" id="tagsel_new" maxlength="100" />
+                                          <input id="tagsel_button" name="tagsel_button" class="input tagsel_button" title="tagsel_button" type="submit" value="Add" />
+                                          <a href="#" id="tagsel_cancel">Cancel</a>
+                                        </span>
                                       [% END %]
                     [% IF ( loggedinusername && allowremovingitems ) %]<span id="removeitems"></span>[% END %]</span>
                   </div>
@@ -352,8 +372,7 @@ $(function() {
           [% END %]
           [% END %][% ELSE %]This record has no items.[% END %]</span>
             [% END %]
-        [% IF ( TagsEnabled ) %]
-          [% IF ( TagsShowOnList ) %]
+          [% IF ( TagsShowEnabled ) %]
             [% IF ( itemsloo.TagLoop.size ) %]
               <div class="results_summary">
               <span class="label">Tags:</span>
@@ -363,24 +382,27 @@ $(function() {
               </div>
             [% END %]
           [% END %]
-                [% IF ( TagsInputOnList ) %]
-          [% IF ( loggedinusername ) %]
-                        <label for="newtag[% itemsloo.biblionumber %]">New tag:</label>
+
+    <span class="results_summary actions">
+        <span class="label">Actions:</span>
+
+        [% IF ( TagsInputEnabled ) %]
+              [% IF ( loggedinusername ) %]
+                    <a class="tag_add" id="tag_add[% itemsloo.biblionumber %]" href="#">Add tag</a>
+                    <span id="tagform[% itemsloo.biblionumber %]" class="tag_results_input" style="display:none;">
+                        <label for="newtag[% itemsloo.biblionumber %]">New tag(s):</label>
                         <input name="newtag[% itemsloo.biblionumber %]" id="newtag[% itemsloo.biblionumber %]" maxlength="100" />
                         <input name="tagbutton" class="tagbutton" title="[% itemsloo.biblionumber %]" type="submit" value="Add" />
+                        <a class="cancel_tag_add" id="cancel[% itemsloo.biblionumber %]" href="#">(done)</a>
+                    </span>
                     <span id="newtag[% itemsloo.biblionumber %]_status" class="tagstatus" style="display:none;">
                         Tag status here.
                     </span>
-                    [% ELSIF ( loop.first ) %]<span class="tagstatus" id="login4tags">Log in to add tags.</span>
-                  [% END %]
-                [% ELSE %]
-            [% IF ( loggedinusername ) %]
-              <span id="newtag[% itemsloo.biblionumber %]_status" class="tagstatus results_summary" style="display:none;">Tag status here.</span>
-            [% END %]
-                [% END %]
-        [% END %]
+              [% ELSIF ( loop.first ) %]
+                    <span class="tagstatus" id="login4tags">Log in to add tags.</span>
+              [% END %]
+          [% END %]
 
-<span class="results_summary actions"><span class="label">Actions:</span>
       [% IF ( RequestOnOpac ) %]
           [% UNLESS ( itemsloo.norequests ) %]
             [% IF ( opacuserlogin ) %]
@@ -395,7 +417,7 @@ $(function() {
           [% END %]
         [% END %]
 
-        [% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( virtualshelves ) %]<a class="addtolist" href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=[% itemsloo.biblionumber %]" onclick="Dopop('opac-addbybiblionumber.pl?biblionumber=[% itemsloo.biblionumber %]'); return false;">Save to another list</a>
+        [% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( virtualshelves ) %]<a class="addtoshelf" href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=[% itemsloo.biblionumber %]" onclick="Dopop('opac-addbybiblionumber.pl?biblionumber=[% itemsloo.biblionumber %]'); return false;">Save to another list</a>
           [% END %][% END %][% END %]
           [% IF ( opacbookbag ) %]
               [% IF ( itemsloo.incart ) %]
@@ -452,7 +474,7 @@ $(function() {
 
             
             [% IF ( edit ) %]
-                <h3><a href="/cgi-bin/koha/opac-shelves.pl">Lists</a> <img src="[% themelang %]/../images/caret.gif" width="16" height="16" alt="&gt;" border="0" /> <a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% shelfnumber %]"><em>[% shelfname |html %]</em></a> <img src="[% themelang %]/../images/caret.gif" width="16" height="16" alt="&gt;" border="0" /> Editing</h3>
+                <h3><a href="/cgi-bin/koha/opac-shelves.pl">Lists</a> &#8674; <a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% shelfnumber %]"><em>[% shelfname |html %]</em></a> &#8674; Editing</h3>
                 <form method="post" action="/cgi-bin/koha/opac-shelves.pl">
                   <input type="hidden" name="op" value="modifsave" />
                   <input type="hidden" name="display" value="[% display %]" />
@@ -466,6 +488,7 @@ $(function() {
                           [% IF ( sort_title ) %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
                           [% IF ( sort_author ) %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
                           [% IF ( sort_year ) %]<option value="year" selected="selected">Year</option>[% ELSE %]<option value="year">Year</option>[% END %]
+                          [% IF ( sort_itemcallnumber ) %]<option value="itemcallnumber" selected="selected">Call number</option>[% ELSE %]<option value="itemcallnumber">Call number</option>[% END %]
                         </select>
                       </li>
                       <li>
@@ -655,6 +678,7 @@ $(function() {
                           [% IF ( sort_title ) %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
                           [% IF ( sort_author ) %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
                           [% IF ( sort_year ) %]<option value="year" selected="selected">Year</option>[% ELSE %]<option value="year">Year</option>[% END %]
+                          [% IF ( sort_itemcallnumber ) %]<option value="itemcallnumber" selected="selected">Call number</option>[% ELSE %]<option value="itemcallnumber">Call number</option>[% END %]
                         </select>
                       </li>
                       <li>
index 3a5a9f8..452d565 100644 (file)
@@ -1,8 +1,10 @@
-[% INCLUDE 'doc-head-open.inc' %]MARC view
+[% INCLUDE 'doc-head-open.inc' %]
+MARC view</title>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 </head>
 <body id="opac-showmarc">
 <div id="main">
 <pre>[% MARC_FORMATTED %]</pre>
-<!-- div gets closed by opac-bottom.inc -->
-[% INCLUDE 'opac-bottom.inc' %]
+</div>
+</body>
+</html>
index b0d5972..3c62e55 100644 (file)
@@ -63,7 +63,9 @@ $.tablesorter.addParser({
             .click(function(){
               $("#myform").submit();
               return false;
-            });[% END %]
+            });
+            enableCheckboxActions();
+            [% END %]
        });
 
       function Check(f) {
@@ -152,7 +154,7 @@ $.tablesorter.addParser({
                     Search for:
                 </th>
                 <td>
-                    <input type="text" name="title" value="[% title %]" />
+                    <input type="text" name="title" value="[% title |html %]" />
                 </td>
                 <th>
                 Suggested by:
index b91d3d1..a9f05c8 100644 (file)
 </style>
 <script type="text/javascript">
 //<![CDATA[
-       var fontsizes = new Array (12,14,16,18,20,22,24,26,28,30);
-       var fontcount = fontsizes.length;
-       var maxcloudweight = 1;
-       $(document).ready(function() {
-               // $('#tagcloud').css('background-color','lightgrey');
-               // $('#tagcloud .tag').css('border','1px solid black');
-               $('#tagcloud .tag').each(function() {
-                       if (maxcloudweight < this.title) { maxcloudweight = this.title; }
-                       // have to run through the set of tags once to get the max: cannot be combined w/ 2nd pass
-               });
-               $('#tagcloud .tag').each(function(i) {
-                       var pos = this.id;
-                       var weight = this.title;        // "cloudweight"
-                       weight = (! weight) ? 1 : (weight > maxcloudweight) ? maxcloudweight : weight ;
-                       var index = Math.round(fontcount * weight/maxcloudweight) - 1;
-                       index  = (! index ) ? 0 : ( index > fontcount     ) ? fontcount      : index  ;
-                       var newsize = fontsizes[index];
-                       // alert(pos+ " (" +i+ ") weight = " +weight+ " of " +maxcloudweight+ ", fontsize[" +index+ " of " +fontcount+ "] = " +newsize);
-                       $('#' + pos).css({"font-size":(newsize + 'px'), display:"inline"});
-               });
                $("#mytagst").tablesorter({[% IF ( dateformat == 'metric' ) %]
     dateFormat: 'uk',[% END %]
             widgets : ['zebra'],
                        headers: { 3: { sorter: false }},
             sortList: [[2,0]]
         });
-       });
 //]]>
 </script>
 </head>
@@ -90,7 +69,7 @@
        [% IF ( TAGLOOP ) %]
        <div id="tagcloud">
        [% FOREACH TAGLOO IN TAGLOOP %]
-    <span class="tag" id="tag[% loop.count %]">
+            <span class="tag tagweight[% TAGLOO.stratum %]" id="tag[% loop.count %]" style="display:inline;">
                <a href="/cgi-bin/koha/opac-search.pl?tag=[% TAGLOO.term |url %]&amp;q=[% TAGLOO.term |url %]">
                [% TAGLOO.term |html %]</a>
                        <span class="tagweight">[% TAGLOO.weight_total %]</span>
index ab2ea12..39b5405 100644 (file)
@@ -6,7 +6,7 @@
     You did not specify any search criteria.
 [% END %]
 [% INCLUDE 'doc-head-close.inc' %]
-<link rel="alternate" type="application/rss+xml" title="[% LibraryName |html %] Search RSS Feed" href="[% OPACBaseurl %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;count=[% countrss |html %]&amp;sort_by=acqdate_dsc&amp;format=rss2" />
+<link rel="alternate" type="application/rss+xml" title="[% LibraryName |html %] Search RSS Feed" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;count=[% countrss |html %]&amp;sort_by=acqdate_dsc&amp;format=rss2" />
 <script type="text/javascript" src="/opac-tmpl/prog/en/lib/jquery/jquery.js"></script>
 <link rel="stylesheet" type="text/css" href="/opac-tmpl/prog/en/css/jquery.rating.css" />
 
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/text/explodedterms.tt b/koha-tmpl/opac-tmpl/prog/en/modules/text/explodedterms.tt
new file mode 100644 (file)
index 0000000..6f394ad
--- /dev/null
@@ -0,0 +1,8 @@
+[%- SWITCH index -%]
+[%- CASE 'su-na' -%]
+Search also for narrower subjects
+[%- CASE 'su-br' -%]
+Search also for broader subjects
+[%- CASE 'su-rl' -%]
+Search also for related subjects
+[%- END -%]
index 7917c0b..64afc0b 100644 (file)
@@ -7,7 +7,7 @@
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   exclude-result-prefixes="marc items">
     <xsl:import href="MARC21slimUtils.xsl"/>
-    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" />
+    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
     <xsl:template match="/">
             <xsl:apply-templates/>
     </xsl:template>
index fe18b80..fb8a07e 100644 (file)
@@ -1,11 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE stylesheet [<!ENTITY nbsp "&#160;" >]>
 <xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-       <xsl:output method="html"/>
+    <xsl:output method="html" encoding="UTF-8"/>
 
        <xsl:template match="/">
                <html>
-                       <xsl:apply-templates/>
+          <head><title>MARC View</title></head>
+          <body>
+           <xsl:apply-templates/>
+          </body>
                </html>
        </xsl:template>
 
index 4f0acd3..cdc803e 100644 (file)
@@ -7,7 +7,7 @@
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   exclude-result-prefixes="marc items">
     <xsl:import href="MARC21slimUtils.xsl"/>
-    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" />
+    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
     <xsl:key name="item-by-status" match="items:item" use="items:status"/>
     <xsl:key name="item-by-status-and-branch" match="items:item" use="concat(items:status, ' ', items:homebranch)"/>
 
index 2d6d65f..00cebb7 100644 (file)
@@ -9,7 +9,7 @@
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   exclude-result-prefixes="marc items">
     <xsl:import href="NORMARCslimUtils.xsl"/>
-    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" />
+    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
     <xsl:template match="/">
             <xsl:apply-templates/>
     </xsl:template>
@@ -38,7 +38,8 @@
         <xsl:variable name="leader7" select="substring($leader,8,1)"/>
         <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
         <xsl:variable name="field019b" select="marc:datafield[@tag=019]/marc:subfield[@code='b']"/>
-        <xsl:variable name="materialTypeCode">
+        <xsl:variable name="typeOf008">
+            <!-- The logic here should be exactly the same for NORMARCslim2intranetDetail.xsl, NORMARCslim2intranetResults.xsl, NORMARCslim2OPACDetail.xsl and NORMARCslim2OPACResults.xsl -->
             <xsl:choose>
                 <xsl:when test="$field019b='b' or $field019b='k' or $field019b='l' or $leader6='b'">Mon</xsl:when>
                 <xsl:when test="$field019b='e' or contains($field019b,'ec') or contains($field019b,'ed') or contains($field019b,'ee') or contains($field019b,'ef') or $leader6='g'">FV</xsl:when>
                 </xsl:when>
             </xsl:choose>
         </xsl:variable>
-        <xsl:variable name="materialTypeLabel">
-                        <xsl:choose>
-                <xsl:when test="$field019b='b' or $field019b='k' or $field019b='l' or $leader6='b'">Bok</xsl:when>
-                <xsl:when test="$field019b='e' or contains($field019b,'ec') or contains($field019b,'ed') or contains($field019b,'ee') or contains($field019b,'ef') or $leader6='g'">Film og video</xsl:when>
-                <xsl:when test="$field019b='c' or $field019b='d' or contains($field019b,'da') or contains($field019b,'db') or contains($field019b,'dc') or contains($field019b,'dd') or contains($field019b,'dg') or contains($field019b,'dh') or contains($field019b,'di') or contains($field019b,'dj') or contains($field019b,'dk') or $leader6='c' or $leader6='d' or $leader6='i' or $leader6='j'">Musikalier</xsl:when>
-                <xsl:when test="$field019b='a' or contains($field019b,'ab') or contains($field019b,'aj') or $leader6='e' or $leader6='f'">Kart</xsl:when>
-                <xsl:when test="$field019b='f' or $field019b='i' or contains($field019b,'ib') or contains($field019b,'ic') or contains($field019b,'fd') or contains($field019b,'ff') or contains($field019b,'fi') or $leader6='k'">Grafisk materiale</xsl:when>
-                <xsl:when test="$field019b='g' or contains($field019b,'gb') or contains($field019b,'gd') or contains($field019b,'ge') or $leader6='m'">Fil</xsl:when>
-                <xsl:when test="$leader6='o'">Kombidokument</xsl:when>
-                <xsl:when test="$field019b='h' or $leader6='r'">Tredimensjonal gjenstand</xsl:when>
-                <xsl:when test="$field019b='j' or $leader6='a'">
-                    <xsl:choose>
-                        <xsl:when test="$leader7='a' or $leader7='c' or $leader7='m' or $leader7='p'">Bok</xsl:when>
-                        <xsl:when test="$field019b='j' or $leader7='b' or $leader7='s'">Periodikum</xsl:when>
-                    </xsl:choose>
-                </xsl:when>
-            </xsl:choose>
-
-        </xsl:variable>
 
         <!-- Tittel og ansvarsopplysninger -->
         <xsl:if test="marc:datafield[@tag=245]">
-        <h1>
+        <h1 class="title">
             <xsl:for-each select="marc:datafield[@tag=245]">
                     <xsl:call-template name="subfieldSelect">
                         <xsl:with-param name="codes">a</xsl:with-param>
         </xsl:choose>
 
     <xsl:if test="$DisplayOPACiconsXSLT!='0'">
-        <xsl:if test="$materialTypeCode!=''">
-        <span class="results_summary"><span class="label">Materialtype: </span>
-        <xsl:element name="img"><xsl:attribute name="src">/opac-tmpl/lib/famfamfam/<xsl:value-of select="$materialTypeCode"/>.png</xsl:attribute><xsl:attribute name="alt"></xsl:attribute></xsl:element>
-        <xsl:value-of select="$materialTypeLabel"/>
+        <xsl:if test="$typeOf008!=''">
+        <span class="results_summary">
+            <span class="label">Materialtype: </span>
+            <xsl:choose>
+                <xsl:when test="$typeOf008='Mon'"><img src="/opac-tmpl/lib/famfamfam/BK.png" alt="Bok" title="Bok"/> Bok</xsl:when>
+                <xsl:when test="$typeOf008='Per'"><img src="/opac-tmpl/lib/famfamfam/AR.png" alt="Periodika" title="Periodika"/> Periodika</xsl:when>
+                <xsl:when test="$typeOf008='Fil'"><img src="/opac-tmpl/lib/famfamfam/CF.png" alt="Fil" title="Fil"/> Fil</xsl:when>
+                <xsl:when test="$typeOf008='Kar'"><img src="/opac-tmpl/lib/famfamfam/MP.png" alt="Kart" title="Kart"/> Kart</xsl:when>
+                <xsl:when test="$typeOf008='FV'"><img  src="/opac-tmpl/lib/famfamfam/VM.png" alt="Film og video" title="Film og video"/> Film og video</xsl:when>
+                <xsl:when test="$typeOf008='Mus'"><img src="/opac-tmpl/lib/famfamfam/PR.png" alt="Musikktrykk og lydopptak" title="Musikktrykk og lydopptak"/> Musikk</xsl:when>
+                <xsl:when test="$typeOf008='gra'"><img src="/opac-tmpl/lib/famfamfam/GR.png" alt="Grafisk materiale" title="Grafisk materiale"/> Grafisk materiale</xsl:when>
+                <xsl:when test="$typeOf008='kom'"><img src="/opac-tmpl/lib/famfamfam/MX.png" alt="Kombidokumenter" title="Kombidokumenter"/> Kombidokumenter</xsl:when>
+                <xsl:when test="$typeOf008='trd'"><img src="/opac-tmpl/lib/famfamfam/TD.png" alt="Tre-dimensjonale gjenstander" title="Tre-dimensjonale gjenstander"/> Tre-dimensjonale gjenstander</xsl:when>
+            </xsl:choose>
         </span>
         </xsl:if>
     </xsl:if>
index 3645174..2c3597e 100644 (file)
@@ -9,7 +9,7 @@
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   exclude-result-prefixes="marc items">
     <xsl:import href="NORMARCslimUtils.xsl"/>
-    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" />
+    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
     <xsl:key name="item-by-status" match="items:item" use="items:status"/>
     <xsl:key name="item-by-status-and-branch" match="items:item" use="concat(items:status, ' ', items:homebranch)"/>
 
@@ -32,7 +32,7 @@
         <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
         <xsl:variable name="field019b" select="marc:datafield[@tag=019]/marc:subfield[@code='b']"/>
         <xsl:variable name="typeOf008">
-        <!-- Codes with upper case first letter below are from the NORMARC standard, lower case first letter are made up. -->
+            <!-- The logic here should be exactly the same for NORMARCslim2intranetDetail.xsl, NORMARCslim2intranetResults.xsl, NORMARCslim2OPACDetail.xsl and NORMARCslim2OPACResults.xsl -->
             <xsl:choose>
                 <xsl:when test="$field019b='b' or $field019b='k' or $field019b='l' or $leader6='b'">Mon</xsl:when>
                 <xsl:when test="$field019b='e' or contains($field019b,'ec') or contains($field019b,'ed') or contains($field019b,'ee') or contains($field019b,'ef') or $leader6='g'">FV</xsl:when>
 <xsl:if test="$DisplayOPACiconsXSLT!='0'">
     <span class="results_summary">
     <xsl:if test="$typeOf008!=''">
-        <span class="label">Type: </span>
-        
-            <xsl:choose>
-                <xsl:when test="$typeOf008='Mon'"><img src="/opac-tmpl/lib/famfamfam/silk/book.png" alt="Bok" title="Bok"/> Bok</xsl:when>
-                <xsl:when test="$typeOf008='Per'"><img src="/opac-tmpl/lib/famfamfam/silk/newspaper.png" alt="Periodika" title="Periodika"/> Periodika</xsl:when>
-                <xsl:when test="$typeOf008='Fil'"><img src="/opac-tmpl/lib/famfamfam/silk/computer_link.png" alt="Fil" title="Fil"/> Fil</xsl:when>
-                <xsl:when test="$typeOf008='Kar'"><img src="/opac-tmpl/lib/famfamfam/silk/map.png" alt="Kart" title="Kart"/> Kart</xsl:when>
-                <xsl:when test="$typeOf008='FV'"><img src="/opac-tmpl/lib/famfamfam/silk/film.png" alt="Film og video" title="Film og video"/> Film og video</xsl:when>
-                <xsl:when test="$typeOf008='Mus'"><img src="/opac-tmpl/lib/famfamfam/silk/sound.png" alt="Musikktrykk og lydopptak" title="Musikktrykk og lydopptak"/> Musikk</xsl:when>
-                <xsl:when test="$typeOf008='gra'"> Grafisk materiale</xsl:when>
-                <xsl:when test="$typeOf008='kom'"> Kombidokumenter</xsl:when>
-                <xsl:when test="$typeOf008='trd'"> Tre-dimensjonale gjenstander</xsl:when>
-            </xsl:choose>
+        <span class="label">Materialtype: </span>
+        <xsl:choose>
+            <xsl:when test="$typeOf008='Mon'"><img src="/opac-tmpl/lib/famfamfam/BK.png" alt="Bok" title="Bok"/> Bok</xsl:when>
+            <xsl:when test="$typeOf008='Per'"><img src="/opac-tmpl/lib/famfamfam/AR.png" alt="Periodika" title="Periodika"/> Periodika</xsl:when>
+            <xsl:when test="$typeOf008='Fil'"><img src="/opac-tmpl/lib/famfamfam/CF.png" alt="Fil" title="Fil"/> Fil</xsl:when>
+            <xsl:when test="$typeOf008='Kar'"><img src="/opac-tmpl/lib/famfamfam/MP.png" alt="Kart" title="Kart"/> Kart</xsl:when>
+            <xsl:when test="$typeOf008='FV'"><img  src="/opac-tmpl/lib/famfamfam/VM.png" alt="Film og video" title="Film og video"/> Film og video</xsl:when>
+            <xsl:when test="$typeOf008='Mus'"><img src="/opac-tmpl/lib/famfamfam/PR.png" alt="Musikktrykk og lydopptak" title="Musikktrykk og lydopptak"/> Musikk</xsl:when>
+            <xsl:when test="$typeOf008='gra'"><img src="/opac-tmpl/lib/famfamfam/GR.png" alt="Grafisk materiale" title="Grafisk materiale"/> Grafisk materiale</xsl:when>
+            <xsl:when test="$typeOf008='kom'"><img src="/opac-tmpl/lib/famfamfam/MX.png" alt="Kombidokumenter" title="Kombidokumenter"/> Kombidokumenter</xsl:when>
+            <xsl:when test="$typeOf008='trd'"><img src="/opac-tmpl/lib/famfamfam/TD.png" alt="Tre-dimensjonale gjenstander" title="Tre-dimensjonale gjenstander"/> Tre-dimensjonale gjenstander</xsl:when>
+        </xsl:choose>
     </xsl:if>
     <xsl:if test="string-length(normalize-space($physicalDescription))">
         <span class="label">; Format: </span><xsl:copy-of select="$physicalDescription"></xsl:copy-of>
index 6fee4fb..cb365d9 100644 (file)
@@ -9,7 +9,7 @@
   exclude-result-prefixes="marc items">
 
 <xsl:import href="UNIMARCslimUtils.xsl"/>
-<xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" />
+<xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
 <xsl:template match="/">
   <xsl:apply-templates/>
 </xsl:template>
index 2b416fb..a086d31 100644 (file)
@@ -9,7 +9,7 @@
   exclude-result-prefixes="marc items">
 
 <xsl:import href="UNIMARCslimUtils.xsl"/>
-<xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" />
+<xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
 <xsl:key name="item-by-status" match="items:item" use="items:status"/>
 <xsl:key name="item-by-status-and-branch" match="items:item" use="concat(items:status, ' ', items:homebranch)"/>
 
         <xsl:text>). </xsl:text>
       </span>
     </xsl:if>
-    <xsl:if test="count(key('item-by-status', 'On Orangemanr'))>0">
+    <xsl:if test="count(key('item-by-status', 'On order'))>0">
       <span class="unavailable">
         <xsl:text>On order (</xsl:text>
         <xsl:value-of select="count(key('item-by-status', 'On order'))"/>
index 32f8cde..09bd9e0 100644 (file)
             <xsl:variable name="start" select="position()"/>
             <xsl:variable name="ends">
               <xsl:for-each select="../marc:subfield[position() &gt; $start]">
-                <xsl:if test="@code=3 or @code=9 or @code=2">
+                <xsl:if test="@code=9">
                   <xsl:variable name="end" select="position() + $start"/>
                   <xsl:value-of select="$end"/>
                   <xsl:text>,</xsl:text>
               </xsl:choose>
             </xsl:variable>
             <xsl:variable name="display">
-              <xsl:for-each select="../marc:subfield[position() &gt; $start and position() &lt; $end]">
+              <xsl:for-each select="../marc:subfield[position() &gt; $start and position() &lt; $end and @code!=2 and @code!=3]">
                 <xsl:value-of select="."/>
                 <xsl:if test="not(position()=last())">
                   <xsl:text>, </xsl:text>
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/article_b.gif b/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/article_b.gif
new file mode 100644 (file)
index 0000000..22f50d0
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/article_b.gif differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/audiovisual_b.gif b/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/audiovisual_b.gif
new file mode 100644 (file)
index 0000000..e5b101d
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/audiovisual_b.gif differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/binary_b.gif b/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/binary_b.gif
new file mode 100644 (file)
index 0000000..497ce89
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/binary_b.gif differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/book_b.gif b/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/book_b.gif
new file mode 100644 (file)
index 0000000..ee79e8a
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/book_b.gif differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/handwriting_b.gif b/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/handwriting_b.gif
new file mode 100644 (file)
index 0000000..d767a8c
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/handwriting_b.gif differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/map_b.gif b/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/map_b.gif
new file mode 100644 (file)
index 0000000..816110d
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/map_b.gif differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/periodical_b.gif b/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/periodical_b.gif
new file mode 100644 (file)
index 0000000..3249ec4
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/periodical_b.gif differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/picture_b.gif b/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/picture_b.gif
new file mode 100644 (file)
index 0000000..652dfb1
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/picture_b.gif differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/score_b.gif b/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/score_b.gif
new file mode 100644 (file)
index 0000000..31a2118
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/score_b.gif differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/sons_b.gif b/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/sons_b.gif
new file mode 100644 (file)
index 0000000..a81ad42
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/sons_b.gif differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/sound_b.gif b/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/sound_b.gif
new file mode 100644 (file)
index 0000000..d563c82
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/sound_b.gif differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/thesis_b.gif b/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/thesis_b.gif
new file mode 100644 (file)
index 0000000..78bb330
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/thesis_b.gif differ
diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/unknown_b.gif b/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/unknown_b.gif
new file mode 100644 (file)
index 0000000..1630b7b
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/sudoc/unknown_b.gif differ
index 1b810c3..d239732 100644 (file)
@@ -16,7 +16,7 @@ the kohaversion is divided in 4 parts :
 use strict;
 
 sub kohaversion {
-    our $VERSION = '3.09.00.052';
+    our $VERSION = '3.11.00.004';
     # version needs to be set this way
     # so that it can be picked up by Makefile.PL
     # during install
index 268912c..e814e3b 100755 (executable)
@@ -41,8 +41,8 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     }
 );
 
-my $op = $cgi->param('op') || $ARGV[0] || '';
-my $layout_id = $cgi->param('layout_id') || $cgi->param('element_id') || $ARGV[1] || '';
+my $op = $cgi->param('op') || '';
+my $layout_id = $cgi->param('layout_id') || $cgi->param('element_id') || '';
 my $layout_choice = $cgi->param('layout_choice') || '';
 our $layout = '';
 
index f834985..78daf38 100755 (executable)
@@ -60,4 +60,11 @@ $template->param(
     pendingsuggestions => $pendingsuggestions
 );
 
+#
+# warn user if he is using mysql/admin login
+#
+unless ($loggedinuser) {
+    $template->param(adminWarning => 1);
+}
+
 output_html_with_http_headers $query, $cookie, $template->output;
index bef3323..f8aa4f1 100755 (executable)
@@ -141,6 +141,7 @@ foreach my $borrower(@$results[$from..$to-1]){
     issues => $issue,
     odissue => "$od/$issue",
     fines =>  sprintf("%.2f",$fines),
+    branchname => $branches->{$borrower->{branchcode}}->{branchname},
     );
   push(@resultsdata, \%row);
 }
index 830800e..017669c 100755 (executable)
@@ -80,7 +80,6 @@ $template->param(
         "AddPatronLists_".C4::Context->preference("AddPatronLists")=> "1",
         no_add => $no_add,
             );
-my @letters = map { {letter => $_} } ( 'A' .. 'Z');
-$template->param( letters => \@letters );
+$template->param( 'alphabet' => C4::Context->preference('alphabet') || join ' ', 'A' .. 'Z' );
 
 output_html_with_http_headers $query, $cookie, $template->output;
diff --git a/misc/batchdeletebiblios.pl b/misc/batchdeletebiblios.pl
new file mode 100755 (executable)
index 0000000..9bc999a
--- /dev/null
@@ -0,0 +1,90 @@
+#!/usr/bin/perl
+
+use Modern::Perl;
+use Getopt::Long;
+use Pod::Usage;
+use IO::File;
+
+use C4::Biblio;
+
+my ($help, $files);
+GetOptions(
+    'h|help' => \$help,
+);
+
+pod2usage(1) if $help or not @ARGV;
+
+for my $file ( @ARGV ) {
+    say "Find biblionumber in file $file";
+    my $fh;
+    open($fh, '<', $file) or say "Error: '$file' $!" and next;
+
+    while ( <$fh> ) {
+        my $biblionumber = $_;
+        $biblionumber =~ s/$1/\n/g if $biblionumber =~ m/(\r\n?|\n\r?)/;
+        chomp $biblionumber;
+        my $dbh = C4::Context->dbh;
+        next if not $biblionumber =~ /^\d*$/;
+        print "Delete biblionumber $biblionumber ";
+        my $error;
+        eval {
+            $error = DelBiblio $biblionumber;
+        };
+        if ( $@ or $error) {
+            say "KO $@ ($! | $error)";
+        } else {
+            say "OK";
+        }
+    }
+}
+
+exit(0);
+
+__END__
+
+=head1 NAME
+
+batchdeletebiblios.pl
+
+=head1 SYNOPSIS
+
+./batchdeletebiblio.pl file1 [file2 ... filen]
+
+This script batch deletes biblios which contain a biblionumber present in file passed in parameter.
+If one biblio has items, it is not deleted.
+
+=head1 OPTIONS
+
+=over 8
+
+=item B<-h|--help>
+
+prints this help message
+
+=back
+
+=head1 AUTHOR
+
+Jonathan Druart <jonathan.druart@biblibre.com>
+
+=head1 COPYRIGHT
+
+Copyright 2012 BibLibre
+
+=head1 LICENSE
+
+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.
+
+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.
+
+=head1 DISCLAIMER OF WARRANTY
+
+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.
+
+=cut
diff --git a/misc/bin/koha-zebraqueue-ctl.sh b/misc/bin/koha-zebraqueue-ctl.sh
deleted file mode 100755 (executable)
index d3444f0..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/bash
-USER=__KOHA_USER__
-GROUP=__KOHA_GROUP__
-DBNAME=__DB_NAME__
-NAME=koha-zebraqueue-ctl-$DBNAME
-LOGDIR=__LOG_DIR__
-PERL5LIB=__PERL_MODULE_DIR__
-KOHA_CONF=__KOHA_CONF_DIR__/koha-conf.xml
-ERRLOG=$LOGDIR/koha-zebraqueue.err
-STDOUT=$LOGDIR/koha-zebraqueue.log
-OUTPUT=$LOGDIR/koha-zebraqueue-output.log
-export KOHA_CONF
-export PERL5LIB
-ZEBRAQUEUE=__SCRIPT_DIR__/zebraqueue_daemon.pl
-
-test -f $ZEBRAQUEUE || exit 0
-
-OTHERUSER=''
-if [[ $EUID -eq 0 ]]; then
-    OTHERUSER="--user=$USER.$GROUP"
-fi
-
-case "$1" in
-    start)
-      echo "Starting Zebraqueue Daemon"
-      daemon --name=$NAME --errlog=$ERRLOG --stdout=$STDOUT --output=$OUTPUT --verbose=1 --respawn --delay=30 $OTHERUSER -- perl -I $PERL5LIB $ZEBRAQUEUE -f $KOHA_CONF 
-      ;;
-    stop)
-      echo "Stopping Zebraqueue Daemon"
-      daemon --name=$NAME --errlog=$ERRLOG --stdout=$STDOUT --output=$OUTPUT --verbose=1 --respawn --delay=30 $OTHERUSER --stop -- perl -I $PERL5LIB $ZEBRAQUEUE -f $KOHA_CONF 
-      ;;
-    restart)
-      echo "Restarting the Zebraqueue Daemon"
-      daemon --name=$NAME --errlog=$ERRLOG --stdout=$STDOUT --output=$OUTPUT --verbose=1 --respawn --delay=30 $OTHERUSER --restart -- perl -I $PERL5LIB $ZEBRAQUEUE -f $KOHA_CONF 
-      ;;
-    *)
-      echo "Usage: /etc/init.d/$NAME {start|stop|restart}"
-      exit 1
-      ;;
-esac
diff --git a/misc/bin/zebraqueue_daemon.pl b/misc/bin/zebraqueue_daemon.pl
deleted file mode 100755 (executable)
index 6181a94..0000000
+++ /dev/null
@@ -1,475 +0,0 @@
-#!/usr/bin/perl
-
-# daemon to watch the zebraqueue and update zebra as needed
-
-use strict;
-#use warnings; FIXME - Bug 2505
-BEGIN {
-    # find Koha's Perl modules
-    # test carefully before changing this
-    use FindBin;
-    eval { require "$FindBin::Bin/kohalib.pl" };
-}
-
-use POE qw(Wheel::SocketFactory Wheel::ReadWrite Filter::Stream Driver::SysRW);
-use Unix::Syslog qw(:macros);
-
-use C4::Context;
-use C4::Biblio;
-use C4::Search;
-use C4::AuthoritiesMarc;
-use XML::Simple;
-use POSIX;
-use utf8;
-
-
-# wait periods governing connection attempts
-my $min_connection_wait =    1; # start off at 1 second
-my $max_connection_wait = 1024; # max about 17 minutes
-
-# keep separate wait period for bib and authority Zebra databases
-my %zoom_connection_waits = (); 
-
-my $db_connection_wait = $min_connection_wait;
-
-# ZOOM and Z39.50 errors that are potentially
-# resolvable by connecting again and retrying
-# the operation
-my %retriable_zoom_errors = (
-    10000 => 'ZOOM_ERROR_CONNECT',
-    10001 => 'ZOOM_ERROR_MEMORY',
-    10002 => 'ZOOM_ERROR_ENCODE',
-    10003 => 'ZOOM_ERROR_DECODE',
-    10004 => 'ZOOM_ERROR_CONNECTION_LOST',
-    10005 => 'ZOOM_ERROR_INIT',
-    10006 => 'ZOOM_ERROR_INTERNAL',
-    10007 => 'ZOOM_ERROR_TIMEOUT',
-);
-
-# structure to store updates that have
-# failed and are to be retrieved.  The
-# structure is a hashref of hashrefs, 
-# e.g.,
-#
-# $postoned_updates->{$server}->{$record_number} = 1;
-#
-# If an operation is attempted and fails because
-# of a retriable error (see above), the daemon
-# will try several times to recover as follows:
-#
-# 1. close and reopen the connection to the
-#    Zebra server, unless the error was a timeout,
-#    in which case
-# 2. retry the operation
-#
-# If, after trying this five times, the operation still
-# fails, the daemon will mark the record number as
-# postponed, and try to process other entries in 
-# zebraqueue.  When an update is postponed, the 
-# error will be reported to syslog. 
-#
-# If more than 100 postponed updates are 
-# accumulated, the daemon will assume that 
-# something is seriously wrong, complain loudly,
-# and abort.  If running under the daemon(1) command, 
-# this means that the daemon will respawn.
-#
-my $num_postponed_updates = 0;
-my $postponed_updates = {};
-
-my $max_operation_attempts =   5;
-my $max_postponed_updates  = 100;
-
-# Zebra connection timeout
-my $zconn_timeout            =  30;
-my $zconn_timeout_multiplier = 1.5;
-my $max_zconn_timeout        = 120;
-
-my $ident = "Koha Zebraqueue ";
-
-my $debug = 0;
-Unix::Syslog::openlog $ident, LOG_PID, LOG_LOCAL0;
-
-Unix::Syslog::syslog LOG_INFO, "Starting Zebraqueue log at " . scalar localtime(time) . "\n";
-
-sub handler_start {
-
-    # Starts session. Only ever called once only really used to set an alias
-    # for the POE kernel
-    my ( $kernel, $heap, $session ) = @_[ KERNEL, HEAP, SESSION ];
-
-    my $time = localtime(time);
-    Unix::Syslog::syslog LOG_INFO, "$time POE Session ", $session->ID, " has started.\n";
-
-    # check status
-#    $kernel->yield('status_check');
-    $kernel->yield('sleep');
-}
-
-sub handler_sleep {
-
-    # can be used to slow down loop execution if needed
-    my ( $kernel, $heap, $session ) = @_[ KERNEL, HEAP, SESSION ];
-    use Time::HiRes qw (sleep);
-    Time::HiRes::sleep(0.5);
-    #sleep 1;
-    $kernel->yield('status_check');
-}
-
-sub handler_check {
-    # check if we need to do anything, at the moment just checks the zebraqueue, it could check other things too
-    my ( $kernel, $heap, $session ) = @_[ KERNEL, HEAP, SESSION ];
-    my $dbh = get_db_connection();
-    my $sth = $dbh->prepare("SELECT count(*) AS opcount FROM zebraqueue WHERE done = 0");
-    $sth->execute;
-    my $data = $sth->fetchrow_hashref();
-    if ($data->{'opcount'} > 0) {
-        Unix::Syslog::syslog LOG_INFO, "$data->{'opcount'} operations waiting to be run\n";
-        $sth->finish();
-        $dbh->commit(); # needed so that we get current state of zebraqueue next time
-                        # we enter handler_check
-        $kernel->yield('do_ops');
-    }
-    else {
-        $sth->finish();
-        $dbh->commit(); # needed so that we get current state of zebraqueue next time
-                        # we enter handler_check
-        $kernel->yield('sleep');
-    }
-}
-
-sub zebraop {
-    # execute operations waiting in the zebraqueue
-    my ( $kernel, $heap, $session ) = @_[ KERNEL, HEAP, SESSION ];
-    my $dbh = get_db_connection();
-    my $readsth = $dbh->prepare("SELECT id, biblio_auth_number, operation, server FROM zebraqueue WHERE done = 0 ORDER BY id DESC");
-    $readsth->execute();
-    Unix::Syslog::syslog LOG_INFO, "Executing zebra operations\n";
-
-    my $completed_updates = {};
-    ZEBRAQUEUE: while (my $data = $readsth->fetchrow_hashref()) {
-        warn "Inside while loop" if $debug;
-
-        my $id = $data->{'id'};
-        my $op = $data->{'operation'};
-        $op = 'recordDelete' if $op =~ /delete/i; # delete ops historically have been coded
-                                                  # either delete_record or recordDelete
-        my $record_number = $data->{'biblio_auth_number'};
-        my $server = $data->{'server'};
-
-        next ZEBRAQUEUE if exists $postponed_updates->{$server}->{$record_number};
-        next ZEBRAQUEUE if exists $completed_updates->{$server}->{$record_number}->{$op};
-
-        my $ok = 0;
-        my $record;
-        if ($op eq 'recordDelete') {
-            $ok = process_delete($dbh, $server, $record_number);
-        }
-        else {
-            $ok = process_update($dbh, $server, $record_number, $id);
-        }
-        if ($ok == 1) {
-            mark_done($dbh, $record_number, $op, $server);
-            $completed_updates->{$server}->{$record_number}->{$op} = 1;
-            if ($op eq 'recordDelete') {
-                $completed_updates->{$server}->{$record_number}->{'specialUpdate'} = 1;
-            }
-        }                            
-    }
-    $readsth->finish();
-    $dbh->commit();
-    $kernel->yield('sleep');
-}
-
-sub process_delete {
-    my $dbh = shift;
-    my $server = shift;
-    my $record_number = shift;
-
-    my $record;
-    my $ok = 0;
-    eval {
-        warn "Searching for record to delete" if $debug;
-        # 1st read the record in zebra, we have to get it from zebra as its no longer in the db
-        my $Zconn =  get_zebra_connection($server);
-        my $results = $Zconn->search_pqf( '@attr 1=Local-number '.$record_number);
-        $results->option(elementSetName => 'marcxml');
-        $record = $results->record(0)->raw();
-    };
-    if ($@) {
-        # this doesn't exist, so no need to wail on zebra to delete it
-        if ($@->code() eq 13) {
-            $ok = 1;
-        } else {
-            # caught a ZOOM::Exception
-            my $message = _format_zoom_error_message($@);
-            postpone_update($server, $record_number, $message);
-        }
-    } else {
-        # then, delete the record
-        warn "Deleting record" if $debug;
-        $ok = zebrado($record, 'recordDelete', $server, $record_number);
-    }
-    return $ok;
-}
-
-sub process_update {
-    my $dbh = shift;
-    my $server = shift;
-    my $record_number = shift;
-    my $id = shift;
-
-    my $record;
-    my $ok = 0;
-
-    warn "Updating record" if $debug;
-    # get the XML
-    my $marcxml;
-    if ($server eq "biblioserver") {
-        my $marc = GetMarcBiblio($record_number);
-        $marcxml = $marc->as_xml_record() if $marc;
-    } 
-    elsif ($server eq "authorityserver") {
-        $marcxml = C4::AuthoritiesMarc::GetAuthorityXML($record_number);
-    }
-    # check it's XML, just in case
-    eval {
-        my $hashed = XMLin($marcxml);
-    }; ### is it a proper xml? broken xml may crash ZEBRA- slow but safe
-    ## it's Broken XML-- Should not reach here-- but if it does -lets protect ZEBRA
-    if ($@) {
-        Unix::Syslog::syslog LOG_ERR, "$server record $record_number is malformed: $@";
-        mark_done_by_id($dbh, $id, $server);
-        $ok = 0;
-    } else {
-        # ok, we have everything, do the operation in zebra !
-        $ok = zebrado($marcxml, 'specialUpdate', $server, $record_number);
-    }
-    return $ok;
-}
-
-sub mark_done_by_id {
-    my $dbh = shift;
-    my $id = shift;
-    my $server = shift;
-    my $delsth = $dbh->prepare("UPDATE zebraqueue SET done = 1 WHERE id = ? AND server = ? AND done = 0");
-    $delsth->execute($id, $server);
-}
-
-sub mark_done {
-    my $dbh = shift;
-    my $record_number = shift;
-    my $op = shift;
-    my $server = shift;
-
-    my $delsth;
-    if ($op eq 'recordDelete') {
-        # if it's a deletion, we can delete every request on this biblio : in case the user
-        # did a modif (or item deletion) just before biblio deletion, there are some specialUpdate
-        # that are pending and can't succeed, as we don't have the XML anymore
-        # so, delete everything for this biblionumber
-        $delsth = $dbh->prepare_cached("UPDATE zebraqueue SET done = 1 
-                                        WHERE biblio_auth_number = ? 
-                                        AND server = ?
-                                        AND done = 0");
-        $delsth->execute($record_number, $server);
-    } else {
-        # if it's not a deletion, delete every pending specialUpdate for this biblionumber
-        # in case the user add biblio, then X items, before this script runs
-        # this avoid indexing X+1 times where just 1 is enough.
-        $delsth = $dbh->prepare("UPDATE zebraqueue SET done = 1 
-                                 WHERE biblio_auth_number = ? 
-                                 AND operation = 'specialUpdate'
-                                 AND server = ?
-                                 AND done = 0");
-        $delsth->execute($record_number, $server);
-    }
-}
-
-sub zebrado {
-    ###Accepts a $server variable thus we can use it to update  biblios, authorities or other zebra dbs
-    my ($record, $op, $server, $record_number) = @_;
-
-    unless ($record) {
-        my $message = "error updating index for $server $record $record_number: no source record";
-        postpone_update($server, $record_number, $message);
-        return 0;
-    }
-
-    my $attempts = 0;
-    my $ok = 0;
-    ATTEMPT: while ($attempts < $max_operation_attempts) {
-        $attempts++;
-        warn "Attempt $attempts for $op for $server $record_number" if $debug;
-        my $Zconn = get_zebra_connection($server);
-
-        my $Zpackage = $Zconn->package();
-        $Zpackage->option(action => $op);
-        $Zpackage->option(record => $record);
-
-        eval { $Zpackage->send("update") };
-        if ($@ && $@->isa("ZOOM::Exception")) {
-            my $message = _format_zoom_error_message($@);
-            my $error = $@->code();
-            if (exists $retriable_zoom_errors{$error}) {
-                warn "reattempting operation $op for $server $record_number" if $debug;
-                warn "last Zebra error was $message" if $debug;
-                $Zpackage->destroy();
-
-                if ($error == 10007 and $zconn_timeout < $max_zconn_timeout) {
-                    # bump up connection timeout
-                    $zconn_timeout = POSIX::ceil($zconn_timeout * $zconn_timeout_multiplier);
-                    $zconn_timeout = $max_zconn_timeout if $zconn_timeout > $max_zconn_timeout;
-                    Unix::Syslog::syslog LOG_INFO, "increased Zebra connection timeout to $zconn_timeout\n";
-                    warn "increased Zebra connection timeout to $zconn_timeout" if $debug;
-                }
-                next ATTEMPT;
-            } else {
-                postpone_update($server, $record_number, $message);
-            }
-        }
-        # FIXME - would be more efficient to send a ES commit
-        # after a batch of records, rather than commiting after
-        # each one - Zebra handles updates relatively slowly.
-        eval { $Zpackage->send('commit'); };
-        if ($@) {
-            # operation succeeded, but commit
-            # did not - we have a problem
-            my $message = _format_zoom_error_message($@);
-            postpone_update($server, $record_number, $message);
-        } else {
-            $ok = 1;
-            last ATTEMPT;
-        }
-    }
-
-    unless ($ok) {
-        my $message = "Made $attempts attempts to index $server record $record_number without success";
-        postpone_update($server, $record_number, $message);
-    }
-
-    return $ok; 
-}
-
-sub postpone_update {
-    my ($server, $record_number, $message) = @_;
-    warn $message if $debug;
-    $message .= "\n" unless $message =~ /\n$/;
-    Unix::Syslog::syslog LOG_ERR, $message;
-    $postponed_updates->{$server}->{$record_number} = 1;
-
-    $num_postponed_updates++;
-    if ($num_postponed_updates > $max_postponed_updates) {
-        warn "exiting, over $max_postponed_updates postponed indexing updates";
-        Unix::Syslog::syslog LOG_ERR, "exiting, over $max_postponed_updates postponed indexing updates";
-        Unix::Syslog::closelog;
-        exit;
-    }
-}
-
-sub handler_stop {
-    my $heap = $_[HEAP];
-    my $time = localtime(time);
-    Unix::Syslog::syslog LOG_INFO, "$time Session ", $_[SESSION]->ID, " has stopped.\n";
-    delete $heap->{session};
-}
-
-# get a DB connection
-sub get_db_connection {
-    my $dbh;
-
-    $db_connection_wait = $min_connection_wait unless defined $db_connection_wait;
-    while (1) {
-        eval {
-            # note that C4::Context caches the
-            # DB handle; C4::Context->dbh() will
-            # check that handle first before returning
-            # it.  If the connection is bad, it
-            # then tries (once) to create a new one.
-            $dbh = C4::Context->dbh();
-        };
-
-        unless ($@) {
-            # C4::Context->dbh dies if it cannot
-            # establish a connection
-            $db_connection_wait = $min_connection_wait;
-            $dbh->{AutoCommit} = 0; # do this to reduce number of
-                                    # commits to zebraqueue
-            return $dbh;
-        }
-
-        # connection failed
-        my $error = "failed to connect to DB: $DBI::errstr";
-        warn $error if $debug;
-        Unix::Syslog::syslog LOG_ERR, $error;
-        sleep $db_connection_wait;
-        $db_connection_wait *= 2 unless $db_connection_wait >= $max_connection_wait;
-    }
-}
-
-# get a Zebra connection
-sub get_zebra_connection {
-    my $server = shift;
-
-    # start connection retry wait queue if necessary
-    $zoom_connection_waits{$server} = $min_connection_wait unless exists  $zoom_connection_waits{$server};
-
-    # try to connect to Zebra forever until we succeed
-    while (1) {
-        # what follows assumes that C4::Context->Zconn 
-        # makes only one attempt to create a new connection;
-        my $Zconn = C4::Context->Zconn($server, 0, 1, '', 'xml');
-        $Zconn->option('timeout' => $zconn_timeout);
-
-        # it is important to note that if the existing connection
-        # stored by C4::Context has an error (any type of error)
-        # from the last transaction, C4::Context->Zconn closes
-        # it and establishes a new one.  Therefore, the
-        # following check will succeed if we have a new, good 
-        # connection or we're using a previously established
-        # connection that has experienced no errors.
-        if ($Zconn->errcode() == 0) {
-            $zoom_connection_waits{$server} = $min_connection_wait;
-            return $Zconn;
-        }
-
-        # connection failed
-        my $error = _format_zoom_error_message($Zconn);
-        warn $error if $debug;
-        Unix::Syslog::syslog LOG_ERR, $error;
-        sleep $zoom_connection_waits{$server};
-        $zoom_connection_waits{$server} *= 2 unless $zoom_connection_waits{$server} >= $max_connection_wait;
-    }
-}
-
-# given a ZOOM::Exception or
-# ZOOM::Connection object, generate
-# a human-reaable error message
-sub _format_zoom_error_message {
-    my $err = shift;
-
-    my $message = "";
-    if (ref($err) eq 'ZOOM::Connection') {
-        $message = $err->errmsg() . " (" . $err->diagset . " " . $err->errcode() . ") " . $err->addinfo();
-    } elsif (ref($err) eq 'ZOOM::Exception') {
-        $message = $err->message() . " (" . $err->diagset . " " .  $err->code() . ") " . $err->addinfo();
-    }
-    return $message; 
-}
-
-POE::Session->create(
-    inline_states => {
-        _start       => \&handler_start,
-        sleep        => \&handler_sleep,
-        status_check => \&handler_check,
-        do_ops       => \&zebraop,
-        _stop        => \&handler_stop,
-    },
-);
-
-# start the kernel
-$poe_kernel->run();
-
-Unix::Syslog::closelog;
-
-exit;
diff --git a/misc/commit_biblios_file.pl b/misc/commit_biblios_file.pl
deleted file mode 100755 (executable)
index b4be670..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-#use warnings; FIXME - Bug 2505
-BEGIN {
-    # find Koha's Perl modules
-    # test carefully before changing this
-    use FindBin;
-    eval { require "$FindBin::Bin/kohalib.pl" };
-}
-
-use C4::Context;
-use C4::ImportBatch;
-use Getopt::Long;
-
-$| = 1;
-
-# command-line parameters
-my $batch_number = "";
-my $list_batches = 0;
-my $want_help = 0;
-
-my $result = GetOptions(
-    'batch-number:s' => \$batch_number,
-    'list-batches'   => \$list_batches,
-    'h|help'         => \$want_help
-);
-
-if ($want_help or (not $batch_number and not $list_batches)) {
-    print_usage();
-    exit 0;
-}
-
-if ($list_batches) {
-    list_batches();
-    exit 0;
-}
-
-# FIXME dummy user so that logging won't fail
-# in future, probably should tie to a real user account
-C4::Context->set_userenv(0, 'batch', 0, 'batch', 'batch', 'batch', 'batch', 'batch');
-
-my $dbh = C4::Context->dbh;
-$dbh->{AutoCommit} = 0;
-if ($batch_number =~ /^\d+$/ and $batch_number > 0) {
-    my $batch = GetImportBatch($batch_number);
-    die "$0: import batch $batch_number does not exist in database\n" unless defined $batch;
-    die "$0: import batch $batch_number status is '" . $batch->{'import_status'} . "', and therefore cannot be imported\n"
-        unless $batch->{'import_status'} eq "staged" or $batch->{'import_status'} eq "reverted";
-    process_batch($batch_number);
-    $dbh->commit();
-} else {
-    die "$0: please specify a numeric batch ID\n";
-}
-
-exit 0;
-
-sub list_batches {
-    my $results = GetAllImportBatches();
-    print sprintf("%5.5s %-25.25s %-25.25s %-10.10s\n", "#", "File name", "Batch comments", "Status");
-    print '-' x 5, ' ' , '-' x 25, ' ', '-' x 25, ' ', '-' x 10, "\n" ;
-    foreach my $batch (@{ $results}) {
-        if ($batch->{'import_status'} eq "staged" or $batch->{'import_status'} eq "reverted") {
-            print sprintf("%5.5s %-25.25s %-25.25s %-10.10s\n",
-                          $batch->{'import_batch_id'},
-                          $batch->{'file_name'},
-                          $batch->{'comments'},
-                          $batch->{'import_status'});
-        }
-    }
-}
-
-sub process_batch {
-    my ($import_batch_id) = @_;
-
-    print "... importing MARC records -- please wait\n";
-    my ($num_added, $num_updated, $num_items_added, $num_items_errored, $num_ignored) = 
-        BatchCommitBibRecords($import_batch_id, '', 100, \&print_progress_and_commit);
-    print "... finished importing MARC records\n";
-
-    print <<_SUMMARY_;
-
-MARC record import report
-----------------------------------------
-Batch number:                    $import_batch_id
-Number of new bibs added:        $num_added
-Number of bibs replaced:         $num_updated
-Number of bibs ignored:          $num_ignored
-Number of items added:           $num_items_added
-Number of items ignored:         $num_items_errored
-
-Note: an item is ignored if its barcode is a 
-duplicate of one already in the database.
-_SUMMARY_
-}
-
-sub print_progress_and_commit {
-    my $recs = shift;
-    print "... processed $recs records\n";
-    $dbh->commit();
-}
-
-sub print_usage {
-    print <<_USAGE_;
-$0: import a batch of staged MARC records into database.
-
-Use this batch job to complete the import of a batch of
-MARC records that was staged either by the batch job
-stage_biblios_file.pl or by the Koha Tools option
-"Stage MARC Records for Import".
-
-Parameters:
-    --batch-number <#>   number of the record batch
-                         to import
-    --list-batches       print a list of record batches
-                         available to commit
-    --help or -h            show this message.
-_USAGE_
-}
diff --git a/misc/commit_file.pl b/misc/commit_file.pl
new file mode 100755 (executable)
index 0000000..9c1089a
--- /dev/null
@@ -0,0 +1,151 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+BEGIN {
+    # find Koha's Perl modules
+    # test carefully before changing this
+    use FindBin;
+    eval { require "$FindBin::Bin/kohalib.pl" };
+}
+
+use C4::Context;
+use C4::ImportBatch;
+use Getopt::Long;
+
+$| = 1;
+
+# command-line parameters
+my $batch_number = "";
+my $list_batches = 0;
+my $revert = 0;
+my $want_help = 0;
+
+my $result = GetOptions(
+    'batch-number:s' => \$batch_number,
+    'list-batches'   => \$list_batches,
+    'revert'         => \$revert,
+    'h|help'         => \$want_help
+);
+
+if ($want_help or (not $batch_number and not $list_batches)) {
+    print_usage();
+    exit 0;
+}
+
+if ($list_batches) {
+    list_batches();
+    exit 0;
+}
+
+# FIXME dummy user so that logging won't fail
+# in future, probably should tie to a real user account
+C4::Context->set_userenv(0, 'batch', 0, 'batch', 'batch', 'batch', 'batch', 'batch');
+
+my $dbh = C4::Context->dbh;
+$dbh->{AutoCommit} = 0;
+if ($batch_number =~ /^\d+$/ and $batch_number > 0) {
+    my $batch = GetImportBatch($batch_number);
+    die "$0: import batch $batch_number does not exist in database\n" unless defined $batch;
+    if ($revert) {
+        die "$0: import batch $batch_number status is '" . $batch->{'import_status'} . "', and therefore cannot be imported\n"
+            unless $batch->{'import_status'} eq "imported";
+        revert_batch($batch_number);
+    } else {
+        die "$0: import batch $batch_number status is '" . $batch->{'import_status'} . "', and therefore cannot be imported\n"
+            unless $batch->{'import_status'} eq "staged" or $batch->{'import_status'} eq "reverted";
+        process_batch($batch_number);
+    }
+    $dbh->commit();
+} else {
+    die "$0: please specify a numeric batch ID\n";
+}
+
+exit 0;
+
+sub list_batches {
+    my $results = GetAllImportBatches();
+    print sprintf("%5.5s %-25.25s %-25.25s %-10.10s\n", "#", "File name", "Batch comments", "Status");
+    print '-' x 5, ' ' , '-' x 25, ' ', '-' x 25, ' ', '-' x 10, "\n" ;
+    foreach my $batch (@{ $results}) {
+        if ($batch->{'import_status'} eq "staged" or $batch->{'import_status'} eq "reverted") {
+            print sprintf("%5.5s %-25.25s %-25.25s %-10.10s\n",
+                          $batch->{'import_batch_id'},
+                          $batch->{'file_name'},
+                          $batch->{'comments'},
+                          $batch->{'import_status'});
+        }
+    }
+}
+
+sub process_batch {
+    my ($import_batch_id) = @_;
+
+    print "... importing MARC records -- please wait\n";
+    my ($num_added, $num_updated, $num_items_added, $num_items_errored, $num_ignored) =
+        BatchCommitRecords($import_batch_id, '', 100, \&print_progress_and_commit);
+    print "... finished importing MARC records\n";
+
+    print <<_SUMMARY_;
+
+MARC record import report
+----------------------------------------
+Batch number:                    $import_batch_id
+Number of new records added:     $num_added
+Number of records replaced:      $num_updated
+Number of records ignored:       $num_ignored
+Number of items added:           $num_items_added
+Number of items ignored:         $num_items_errored
+
+Note: an item is ignored if its barcode is a
+duplicate of one already in the database.
+_SUMMARY_
+}
+
+sub revert_batch {
+    my ($import_batch_id) = @_;
+
+    print "... reverting batch -- please wait\n";
+    my ($num_deleted, $num_errors, $num_reverted, $num_items_deleted, $num_ignored) =
+        BatchRevertRecords($import_batch_id, 100, \&print_progress_and_commit);
+    print "... finished reverting batch\n";
+
+    print <<_SUMMARY_;
+
+MARC record import report
+----------------------------------------
+Batch number:                    $import_batch_id
+Number of records deleted:       $num_deleted
+Number of errors:                $num_errors
+Number of records reverted:      $num_reverted
+Number of records ignored:       $num_ignored
+Number of items added:           $num_items_deleted
+
+_SUMMARY_
+}
+
+
+sub print_progress_and_commit {
+    my $recs = shift;
+    print "... processed $recs records\n";
+    $dbh->commit();
+}
+
+sub print_usage {
+    print <<_USAGE_;
+$0: import a batch of staged MARC records into database.
+
+Use this batch job to complete the import of a batch of
+MARC records that was staged either by the batch job
+stage_file.pl or by the Koha Tools option
+"Stage MARC Records for Import".
+
+Parameters:
+    --batch-number <#>   number of the record batch
+                         to import
+    --list-batches       print a list of record batches
+                         available to commit
+    --revert             revert a batch instead of importing it
+    --help or -h         show this message.
+_USAGE_
+}
diff --git a/misc/cronjobs/check-url-quick.pl b/misc/cronjobs/check-url-quick.pl
new file mode 100755 (executable)
index 0000000..d1674e8
--- /dev/null
@@ -0,0 +1,209 @@
+#!/usr/bin/perl
+
+# Copyright 2012 Tamil s.a.r.l.
+#
+# 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 Modern::Perl;
+use Pod::Usage;
+use Getopt::Long;
+use C4::Context;
+use C4::Biblio;
+eval { require AnyEvent }       or die "This script requires AnyEvent perl library. Use check-url.pl if you can't install AnyEvent" ;
+eval { require AnyEvent::HTTP } or die "This script requires AnyEvent::HTTP perl library. Use check-url.pl if you can't install AnyEvent::HTTP" ;
+
+my ( $verbose, $help, $html ) = ( 0, 0, 0 );
+my ( $host,    $host_intranet ) = ( '', '' );
+my ( $timeout, $maxconn )       = ( 10, 200 );
+my @tags;
+my $uriedit    = "/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=";
+my $user_agent = 'Mozilla/5.0 (compatible; U; Koha checkurl)';
+GetOptions(
+    'verbose'         => \$verbose,
+    'html'            => \$html,
+    'h|help'          => \$help,
+    'host=s'          => \$host,
+    'host-intranet=s' => \$host_intranet,
+    'timeout=i'       => \$timeout,
+    'maxconn=i'       => \$maxconn,
+    'tags=s{,}'       => \@tags,
+);
+
+# Validate tags to check
+{
+    my %h = map { $_ => undef } @tags;
+    @tags = sort keys %h;
+    my @invalids;
+    for (@tags) {
+        push @invalids, $_ unless /^\d{3}$/;
+    }
+    if (@invalids) {
+        say "Invalid tag(s): ", join( ' ', @invalids );
+        exit;
+    }
+    push @tags, '856' unless @tags;
+}
+
+sub usage {
+    pod2usage( -verbose => 2 );
+    exit;
+}
+
+sub report {
+    my ( $hdr, $biblionumber, $url ) = @_;
+    print $html
+      ? "<tr>\n <td><a href=\""
+      . $host_intranet
+      . $uriedit
+      . $biblionumber
+      . "\">$biblionumber</a>"
+      . "</td>\n <td>$url</td>\n <td>"
+      . "$hdr->{Status} $hdr->{Reason}</td>\n</tr>\n"
+      : "$biblionumber\t$url\t" . "$hdr->{Status} $hdr->{Reason}\n";
+}
+
+# Check all URLs from all current Koha biblio records
+
+sub check_all_url {
+    my $sth = C4::Context->dbh->prepare(
+        "SELECT biblionumber FROM biblioitems ORDER BY biblionumber");
+    $sth->execute;
+
+    my $count = 0;                   # Number of requested URL
+    my $cv    = AnyEvent->condvar;
+    say "<html>\n<body>\n<div id=\"checkurl\">\n<table>" if $html;
+    my $idle = AnyEvent->timer(
+        interval => .3,
+        cb       => sub {
+            return if $count > $maxconn;
+            while ( my ($biblionumber) = $sth->fetchrow ) {
+                my $record = GetMarcBiblio($biblionumber);
+                for my $tag (@tags) {
+                    foreach my $field ( $record->field($tag) ) {
+                        my $url = $field->subfield('u');
+                        next unless $url;
+                        $url = "$host/$url" unless $url =~ /^http/i;
+                        $count++;
+                        http_request(
+                            HEAD    => $url,
+                            headers => { 'user-agent' => $user_agent },
+                            timeout => $timeout,
+                            sub {
+                                my ( undef, $hdr ) = @_;
+                                $count--;
+                                report( $hdr, $biblionumber, $url )
+                                  if $hdr->{Status} !~ /^2/ || $verbose;
+                            },
+                        );
+                    }
+                }
+                return if $count > $maxconn;
+            }
+            $cv->send;
+        }
+    );
+    $cv->recv;
+    $idle = undef;
+
+    # Few more time for pending requests
+    $cv = AnyEvent->condvar;
+    my $timer = AnyEvent->timer(
+        after    => $timeout,
+        interval => $timeout,
+        cb       => sub { $cv->send if $count == 0; }
+    );
+    $cv->recv;
+    say "</table>\n</div>\n</body>\n</html>" if $html;
+}
+
+usage() if $help;
+
+if ( $html && !$host_intranet ) {
+    if ($host) {
+        $host_intranet = $host;
+    }
+    else {
+        say
+"Error: host-intranet parameter or host must be provided in html mode";
+        exit;
+    }
+}
+
+check_all_url();
+
+=head1 NAME
+
+check-url-quick.pl - Check URLs from biblio records
+
+=head1 USAGE
+
+=over
+
+=item check-url-quick [--verbose|--help|--html] [--tags 310 856] [--host=http://default.tld]
+[--host-intranet]
+
+Scan all URLs found by default in 856$u of bib records and display if resources
+are available or not. HTTP requests are sent in parallel for efficiency, and
+speed.  This script replaces check-url.pl script.
+
+=back
+
+=head1 PARAMETERS
+
+=over
+
+=item B<--host=http://default.tld>
+
+Server host used when URL doesn't have one, ie doesn't begin with 'http:'.
+For example, if --host=http://www.mylib.com, then when 856$u contains
+'img/image.jpg', the url checked is: http://www.mylib.com/image.jpg'.
+
+=item B<--tags>
+
+Tags containing URLs in $u subfields. If not provided, 856 tag is checked. Multiple tags can be specified, for example:
+
+ check-url-quick.pl --tags 310 410 856
+
+=item B<--verbose|-v>
+
+Outputs both successful and failed URLs.
+
+=item B<--html>
+
+Formats output in HTML. The result can be redirected to a file
+accessible by http. This way, it's possible to link directly to biblio
+record in edit mode. With this parameter B<--host-intranet> is required.
+
+=item B<--host-intranet=http://koha-pro.tld>
+
+Server host used to link to biblio record editing page in Koha intranet
+interface.
+
+=item B<--timeout=10>
+
+Timeout for fetching URLs. By default 10 seconds.
+
+=item B<--maxconn=1000>
+
+Number of simulaneous HTTP requests. By default 200 connexions.
+
+=item B<--help|-h>
+
+Print this help page.
+
+=back
+
+=cut
index fae2413..589a4c5 100755 (executable)
@@ -250,6 +250,7 @@ check-url.pl - Check URLs from 856$u field.
 
 Scan all URLs found in 856$u of bib records 
 and display if resources are available or not.
+This script is deprecated. You should rather use check-url-quick.pl.
 
 =back
 
index ed8f117..012747c 100644 (file)
@@ -29,10 +29,10 @@ KOHA_CRON_PATH = /usr/share/koha/bin/cronjobs
 # by manipulating those variables in the command.
 #
 # For example, on the same codebase:
-# */10 * * * *    KOHA_CONF=/etc/koha/koha-conf.xml /usr/share/koha/bin/migration_tools/rebuild_zebra.pl -b -a -z >/dev/null
+# */10 * * * *    __KOHA_USER__  KOHA_CONF=/etc/koha/koha-conf.xml /usr/share/koha/bin/migration_tools/rebuild_zebra.pl -b -a -z >/dev/null
 #
 # For example, on a separate codebase:
-# */10 * * * *    KOHA_CONF=/etc/koha/koha-conf.xml PERL5LIB=/home/koha/kohaclone /home/koha/kohaclone/misc/migration_tools/rebuild_zebra.pl -b -a -z >/dev/null
+# */10 * * * *    __KOHA_USER__  KOHA_CONF=/etc/koha/koha-conf.xml PERL5LIB=/home/koha/kohaclone /home/koha/kohaclone/misc/migration_tools/rebuild_zebra.pl -b -a -z >/dev/null
 # 
 # ADDITIONAL INFO:
 # See the perldoc of individual scripts to determine what other options
@@ -43,42 +43,42 @@ KOHA_CRON_PATH = /usr/share/koha/bin/cronjobs
 # Cron/crontab will choke without it.
 #
 # SCHEDULED JOBS:
-# m h  dom mon dow   command
+# m h  dom mon dow   user command
 
 # OVERDUE NOTICES
-0    1 * * *  $KOHA_CRON_PATH/overdue_notices.pl -t
+0    1 * * *  __KOHA_USER__  $KOHA_CRON_PATH/overdue_notices.pl -t
 
 # FINES
-5    1 * * *  $KOHA_CRON_PATH/fines.pl
+5    1 * * *  __KOHA_USER__  $KOHA_CRON_PATH/fines.pl
 
 # ADVANCE NOTICES
-10   1 * * *  $KOHA_CRON_PATH/advance_notices.pl -c
+10   1 * * *  __KOHA_USER__  $KOHA_CRON_PATH/advance_notices.pl -c
 
 # PROCESS LONG OVERDUES
 # updates item status from available to longoverdue for items long overdue
-# 19 1 * * *  $KOHA_CRON_PATH/longoverdue.pl --lost 90=1 --confirm
+# 19 1 * * *  __KOHA_USER__  $KOHA_CRON_PATH/longoverdue.pl --lost 90=1 --confirm
 
 # SEND EMAILS
-15   * * * *  $KOHA_CRON_PATH/process_message_queue.pl
+15   * * * *  __KOHA_USER__  $KOHA_CRON_PATH/process_message_queue.pl
 
 # Hourly holds queue updated
-52   * * * *  $KOHA_CRON_PATH/holds/build_holds_queue.pl >/dev/null 2>&1
+52   * * * *  __KOHA_USER__  $KOHA_CRON_PATH/holds/build_holds_queue.pl >/dev/null 2>&1
 
 # Cancel expired holds
-0 1 * * *  $KOHA_CRON_PATH/holds/cancel_expired_holds.pl >/dev/null 2>&1
+0 1 * * *  __KOHA_USER__ $KOHA_CRON_PATH/holds/cancel_expired_holds.pl >/dev/null 2>&1
 
 # Update popularity counts for biblio records
-0 2 * * *  $KOHA_CRON_PATH/update_totalissues.pl --commit=1000 --use-stats --incremental --interval=1d >/dev/null 2>&1
+0 2 * * *  __KOHA_USER__ $KOHA_CRON_PATH/update_totalissues.pl --commit=1000 --use-stats --incremental --interval=1d >/dev/null 2>&1
 
 # ZEBRA INDEX UPDATES with -z option, incremental index updates throughout the day
 # for both authorities and bibs
-*/10 * * * *  $KOHA_CRON_PATH/../migration_tools/rebuild_zebra.pl -b -a -z >/dev/null
+*/10 * * * *  __KOHA_USER__  $KOHA_CRON_PATH/../migration_tools/rebuild_zebra.pl -b -a -z >/dev/null
 
 # services_throttle -- resets the xISBN service
-59 23 * * *  $KOHA_CRON_PATH/services_throttle.pl > /dev/null 2>&1
+59 23 * * *  __KOHA_USER__ $KOHA_CRON_PATH/services_throttle.pl > /dev/null 2>&1
 
 # clean up databases nightly.  Be sure not to run this with --sessions during a time when the system is in use!
-16 1 * * * $KOHA_CRON_PATH/cleanup_database.pl --sessions --zebraqueue 10
+16 1 * * * __KOHA_USER__ $KOHA_CRON_PATH/cleanup_database.pl --sessions --zebraqueue 10
 
 # delete old purchase suggestions weekly. Replace XX with a number to define the age of suggestions to delete.
-@weekly        $KOHA_CRON_PATH/purge_suggestions.pl --days XX > /dev/null 2>&1
+@weekly        __KOHA_USER__  $KOHA_CRON_PATH/purge_suggestions.pl --days XX > /dev/null 2>&1
index d1b30ef..3f57779 100755 (executable)
@@ -54,4 +54,4 @@ EOF
 my $batch_ids = GetStagedWebserviceBatches() or exit;
 
 $framework ||= '';
-BatchCommitBibRecords($_, $framework) foreach @$batch_ids;
+BatchCommitRecords($_, $framework) foreach @$batch_ids;
index 1de5a48..a5a376f 100755 (executable)
@@ -60,6 +60,7 @@ my $sth = $dbh->prepare("
      WHERE serial.status = 1 
        AND periodicity <> 32
        AND DATE_ADD(planneddate, INTERVAL CAST(graceperiod AS SIGNED) DAY) < NOW()
+       AND subscription.closed = 0
      ");
 $sth->execute();
 
diff --git a/misc/cronjobs/smsoverdues.pl b/misc/cronjobs/smsoverdues.pl
deleted file mode 100755 (executable)
index 6415eb6..0000000
+++ /dev/null
@@ -1,360 +0,0 @@
-#!/usr/bin/perl
-
-#  This script loops through each overdue item, determines the fine,
-#  and updates the total amount of fines due by each user.  It relies on
-#  the existence of /tmp/fines, which is created by ???
-# Doesnt really rely on it, it relys on being able to write to /tmp/
-# It creates the fines file
-#
-#  This script is meant to be run nightly out of cron.
-
-# Copyright 2000-2002 Katipo Communications
-#
-# 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.
-
-# $Id: sendoverdues.pl,v 1.1.2.1 2007/03/26 22:38:09 tgarip1957 Exp $
-
-#use strict;
-#use warnings; FIXME - Bug 2505
-
-BEGIN {
-    # find Koha's Perl modules
-    # test carefully before changing this
-    use FindBin;
-    eval { require "$FindBin::Bin/../kohalib.pl" };
-}
-
-use C4::Context;
-use C4::Search;
-use C4::Circulation;
-use C4::Members;
-use C4::Dates qw/format_date/;
-use HTML::Template::Pro;
-use Mail::Sendmail;
-use Mail::RFC822::Address;
-use C4::SMS;
-use Carp;
-use utf8;
-my ($res,$ua);##variables for SMS
-
-my $date=get_today();
-                       my $dbh = C4::Context->dbh;
-
-
-notifyOverdues();
-
-sub    notifyOverdues {
-       # Look up the overdues for today. 
-       # Capture overdues which fall on our dates of interest.
-
-####################################################################################################
-# Creating a big hash of available templates
-my %email;
-%email->{'template'}='email-2.txt';
-my %sms; 
-%sms->{'template'}='sms-2.txt';
-
-
-my %firstReminder->{'email'} = \%email;
-%firstReminder->{'sms'} = \%sms;
-
-my %email2;
-%email2->{'template'}='email-7.txt';
-my %secondReminder->{'email'} = \%email2;
-my %sms2;  
-%sms2->{'template'}='sms-7.txt';
-%secondReminder->{'sms'} = \%sms2;
-my %letter2;
-%letter2->{'template'}='letter-7.html';
-%secondReminder->{'letter'} = \%letter2;    
-
-
-my %email3;
-%email3->{'template'}='email-29.txt';
-my %sms3;
-%sms3->{'template'}='sms-29.txt';
-my %letter3;
-%letter3->{'template'}='letter-29.html';
-
-my %finalReminder->{'email'} = \%email3;
-%finalReminder->{'letter'} = \%letter3;
-%finalReminder->{'sms'} = \%sms3;
-
-my %actions;
-%actions->{'1'}=\%firstReminder;
-%actions->{'3'}=\%secondReminder;###This was 7 days changed to 3 days
-%actions->{'20'}=\%finalReminder;###This was 29 days changed to 20 days
-
-##################################################################################################################
-my @overdues2;#an array for each actiondate
-my @overdues7;
-my @overdues29;
-my $filename;
-       
-   
-
-        # Retrieve an array of overdues.
-        my ($count, $overduesReference) = Getoverdues();
-        my @overdues=@$overduesReference;
-
-
-       # We're going to build a hash of arrays, containing the items requiring action.
-       # ->borrowernumber, date, @overdues
-       my %actionItems;
-       
-
-        foreach my $overdue (@overdues) {
-                 my $due_day=$overdue->{'date_due'};
-
-                       my $difference=DATE_subtract($date,$due_day);
-               # If does this item fall on a day of interest?
-                               $overdue->{'difference'}=$difference;
-               foreach my $actiondate (keys(%actions)) {
-                       if ($actiondate == $difference) {
-                       $filename='overdues'.$actiondate;
-                               push @$$filename,$overdue;              
-#print "$actiondate,-,$overdue->{borrowernumber}\n";           
-                       }
-                       $actionItems{$actiondate} = \@$$filename;
-               }
-       }
-
-       # We now have a hash containing overdues which need actioning,  we can step through each set. 
-       # Work from earilest to latest. We only wish to send the most urgent message.
-       my %messages; 
-        my %borritem;
-
-    foreach my $actiondate (keys %actions) {
-#              print "\n\nThe following items are $actiondate days overdue.\n";
-               my $items = $actionItems{$actiondate};
-               $filename='overdues'.$actiondate;
-       foreach my $overdue (@$$filename) {
-                               # Detemine which borrower is responsible for this overdue;
-                               # if the offender is a child, then the guarantor is the person to notify
-                               my $borrowernumber=$overdue->{borrowernumber};
-
-                               my $borrower=responsibleBorrower($borrowernumber);
-                               my ($method, $address) = preferedContactMethod($borrower);
-                  if ($method && $address) {   
-                               
-                                       # Do we have to send something, using this method on this day?
-                   if (%actions->{$actiondate}->{$method}->{'template'}) {
-                                               my $intranetdir=C4::Context->config('intranetdir');
-                                               # Template the message
-                                               my $template = HTML::Template::Pro->new(filename => $intranetdir.'/scripts/misc/notifys/templates/'.%actions->{$actiondate}->{$method}->{'template'}, die_on_bad_params => 0);
-                                               my @bookdetails;
-                                                               my %row_data;
-                                        my $item = getiteminformation("", $overdue->{'itemnumber'});
-                                                       $row_data{'BARCODE'}=$item->{'barcode'};
-                               
-                                                      my $title=substr($item->{'title'},0,25)."...";
-
-                               $title=changecharacter($title);
-                                 $row_data{'TITLE'}=$title;
-                                                       $row_data{'DATE_DUE'}=format_date($overdue->{'date_due'});
-                               $row_data{'cardnumber'}=$borrower->{'cardnumber'};
-                                       push(@bookdetails, \%row_data);
-                                               $template->param(BOOKDETAILS => \@bookdetails);                                                         
-                               my $name= "$borrower->{'firstname'} $borrower->{'surname'}"; 
-                               $template->param(NAME=> $name);
-                     %messages->{$borrower->{'borrowernumber'}} = $template->output();
-                       if ($method eq 'email') {
-                       $result = sendEmail($address, 'library@library.neu.edu.tr', 'Overdue Library Items', %messages->{$borrowernumber});
-                       logContact($borrowernumber, $method, $address, $result, %messages->{$borrowernumber});
-                       }
-                       elsif ($method eq 'sms') {
-                       $result = sendSMS($address, %messages->{$borrowernumber});
-                       logContact($borrowernumber, $method, $address, $result, %messages->{$borrowernumber});
-                       }
-                       elsif ($method eq 'letter') {
-                       $result = printLetter($address, %messages->{$borrowernumber});
-                       }                                                       
-                      }##template exists
-               }else{
-               print "$borrowernumber has an overdue item, but no means of contact\n";
-               }##$method              
-
-
-       } #end of 'foreach overdue'
-
-     } # end of foreach actiondate
-}
-
-sub    responsibleBorrower {   
-       # Given an overdue item, return the details of the borrower responible as a hash of database columns.
-       my $borrowernumber=shift;
-
-       if ($borrowernumber) {
-               my $borrower=BorType($borrowernumber);
-               # Overdue books assigned to children have notices sent to the guarantor.        
-               if ($borrower->{'categorycode'} eq 'C') {
-                       my $guarantor=BorType($borrower->{'guarantor'});
-                       $borrower = $guarantor;
-                       }
-       
-               return $borrower;
-       }
-
-}
-
-
-
-
-
-
-
-
-
-sub    preferedContactMethod {
-       # Given a reference to borrower details, in the format
-       # returned by BorType(), determine the prefered contact method, and address to use.
-       my $borrower=$_[0];
-       my $borrcat = getborrowercategoryinfo($borrower->{'categorycode'});
-if(  !$borrcat->{'overduenoticerequired'}){
-return (undef,undef);
-}
-       my $method='';  
-       my $address=''; 
-## if borrower has a phone set that as our preferrred contact
-       if ($borrower->{'phoneday'}) {
-               if (parse_phone($borrower->{phoneday})){
-                               $address = parse_phone($borrower->{phoneday});
-                               $method="sms";
-                               return ($method, $address);
-               }
-       }
-       
-       if (($borrower->{'emailaddress'}) and (Mail::RFC822::Address::valid($borrower->{'emailaddress'}))) {
-                               $address = $borrower->{'emailaddress'};
-               $method="email";
-                               return ($method, $address);
-       }
-                       
-       if ($borrower->{'streetaddress'}) {
-                               $address =  mailingAddress($borrower);
-                       $method = 'letter';     
-       }
-#print "$method, $address\n";
-       return ($method, $address);
-}
-
-
-
-
-
-
-
-
-sub    logContact {
-       # Given the details of an attempt to contact a borrower, 
-       # log them in the attempted_contacts table of the koha database.
-       my ($borrowernumber, $method, $address, $result, $message) = @_;
-
-       my $querystring = "     insert into     attempted_contacts 
-                                               (borrowernumber, method, address, result, message, date) 
-                                               values (?, ?, ?, ?, ?, now())";
-       my $sth= $dbh->prepare($querystring);
-       $sth->execute($borrowernumber, $method, $address, $result, $message);
-       $sth->finish();
-}
-
-
-
-
-
-
-
-
-sub    mailingAddress {
-       # Given a hash of borrower information, such as that returned by BorType, 
-       # return a mailing address. 
-       my $borrower=$_[0];
-
-       my $address =   $borrower->{'firstname'}."\n". 
-                       $borrower->{'streetaddress'}."\n".
-                       $borrower->{'streetcity'};
-
-       return $address;
-}
-
-
-
-sub    sendEmail {
-       # Given an email address, and a subject and message, attempt to send email.
-
-       my $to=$_[0];
-       my $from=$_[1];
-       my $subject=$_[2];
-       my $message=$_[3];
-#    print "in email area";
-
-#      print "\nSending Email To: $to\n$message\n";
-
-       my      %mail = (               To      => $to,
-                                        CC => 'library@library.neu.edu.tr', 
-                                       From    => $from,
-                                        Subject => $subject,
-                                        Message => $message);
-
-                
-       if (not(sendmail %mail)) {       
-carp  "sendEmail to $to failed: " . $Mail::Sendmail::error;
-               return 0;       
-       }
-       
-       return 1;
-}
-
-
-sub    sendSMS {
-my ($phone, $message)=@_;
-($res,$ua)=get_sms_auth() unless $res;
-       # Given a cell number and a message, attempt to send an SMS message.
-my  $sendresult=send_sms($ua,$phone,$message,$res->{pSessionId});
-       my $error=error_codes($sendresult->{pErrCode});
-       return 1 unless $error;
-       return $error;
-}
-
-
-sub    printLetter {
-print "letter\n";
-       # Print a letter
-       # FIXME - decide where to print
-       return 1;
-}
-sub changecharacter {
-my ($string)=@_;
-$_=$string;
-
-s/ş/s/g;
-s/Ş/S/g;
-s/ü/u/g;
-s/Ü/U/g;
-s/ç/c/g;
-s/Ç/C/g;
-s/ö/o/g;
-s/Ö/O/g;
-s/ı/i/g;
-s/İ/I/g;
-s/ğ/g/g;
-s/Ğ/G/g;
-$string=$_;
-return $string;
-}
-$dbh->disconnect();
-                       
index 226f17e..b4d4e9c 100755 (executable)
@@ -127,20 +127,17 @@ foreach my $type (@types) {
         my $date = C4::Dates->new( $issues->{'date_due'}, 'iso' );
         my $due_date = $date->output('metric');
 
-        # gets the placeholder message, and enqueues the letter
-        my $letter = getletter( $module, $code );
-        die "No letter found for type $type!... dying\n" unless $letter;
+        my $letter = C4::Letters::GetPreparedLetter(
+            module      => $module,
+            letter_code => $code,
+            tables      => {
+                borrowers   => $issues->{'borrowernumber'},
+                biblio      => $issues->{'biblionumber'},
+                biblioitems => $issues->{'biblionumber'}
+            },
+        );
 
-        # covers basic variable parsing in letter
-        $letter =
-          C4::Letters::parseletter( $letter, 'borrowers',
-            $issues->{'borrowernumber'} );
-        $letter =
-          C4::Letters::parseletter( $letter, 'biblio',
-            $issues->{'biblionumber'} );
-        $letter =
-          C4::Letters::parseletter( $letter, 'biblioitems',
-            $issues->{'biblionumber'} );
+        die "No letter found for type $type!... dying\n" unless $letter;
 
         my $message_id = 0;
         if ($outfile) {
diff --git a/misc/cronjobs/zebraqueue_start.pl b/misc/cronjobs/zebraqueue_start.pl
deleted file mode 100755 (executable)
index ea84156..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-#!/usr/bin/perl
-# script that starts the zebraquee
-#  Written by TG on 01/08/2006
-use strict;
-#use warnings; FIXME - Bug 2505
-BEGIN {
-    # find Koha's Perl modules
-    # test carefully before changing this
-    use FindBin;
-    eval { require "$FindBin::Bin/../kohalib.pl" };
-}
-
-use C4::Context;
-use C4::Biblio;
-use C4::Search;
-use C4::AuthoritiesMarc;
-use XML::Simple;
-use utf8;
-### ZEBRA SERVER UPDATER
-##Uses its own database handle
-my $dbh=C4::Context->dbh;
-my $readsth=$dbh->prepare("SELECT id,biblio_auth_number,operation,server FROM zebraqueue WHERE done=0 
-                           ORDER BY id DESC"); # NOTE - going in reverse order to catch deletes that
-                                               # occur after a string of updates (e.g., user deletes
-                                               # the items attached to a bib, then the items.
-                                               # Having a specialUpdate occur after a recordDelete
-                                               # should not occur.
-#my $delsth=$dbh->prepare("delete from zebraqueue where id =?");
-
-
-#AGAIN:
-
-#my $wait=C4::Context->preference('zebrawait') || 120;
-my $verbose = 0;
-print "starting with verbose=$verbose\n" if $verbose;
-
-my ($id,$biblionumber,$operation,$server,$marcxml);
-
-$readsth->execute;
-while (($id,$biblionumber,$operation,$server)=$readsth->fetchrow){
-    print "read in queue : $id : biblio $biblionumber for $operation on $server\n" if $verbose;
-    my $ok;
-    eval{
-        # if the operation is a deletion, zebra requires that we give it the xml.
-        # as it is no more in the SQL db, retrieve it from zebra itself.
-        # may sound silly, but that's the way zebra works ;-)
-           if ($operation =~ /delete/i) { # NOTE depending on version, delete operation
-                                       #      was coded 'delete_record' or 'recordDelete'.
-                                       #      'recordDelete' is the preferred one, as that's
-                                       #      what the ZOOM API wants.
-              # 1st read the record in zebra
-            my $Zconn=C4::Context->Zconn($server, 0, 1,'','xml');
-            my $query = $Zconn->search_pqf( '@attr 1=Local-Number '.$biblionumber);
-            # then, delete the record
-               $ok=zebrado($query->record(0)->render(),$operation,$server,$biblionumber);
-        # if it's an add or a modif
-        } else {
-            # get the XML
-            if ($server eq "biblioserver") {
-                my $marc = GetMarcBiblio($biblionumber);
-                $marcxml = $marc->as_xml_record() if $marc;
-            } elsif ($server eq "authorityserver") {
-                $marcxml =C4::AuthoritiesMarc::GetAuthorityXML($biblionumber);
-            }
-            if ($verbose) {
-                if ($marcxml) {
-                    print "XML read : $marcxml\n" if $verbose >1;
-                } else {
-                # workaround for zebra bug needing a XML even for deletion
-                $marcxml= "<dummy/>";
-                    print "unable to read MARCxml\n" if $verbose;
-                }
-            }
-            # check it's XML, just in case
-            eval {
-                my $hashed=XMLin($marcxml);
-            }; ### is it a proper xml? broken xml may crash ZEBRA- slow but safe
-            ## it's Broken XML-- Should not reach here-- but if it does -lets protect ZEBRA
-            if ($@){
-                warn $@;
-                my $delsth=$dbh->prepare("UPDATE zebraqueue SET done=1 WHERE id =?");
-                $delsth->execute($id);
-                next;
-            }
-            # ok, we have everything, do the operation in zebra !
-            $ok=zebrado($marcxml,$operation,$server);
-        }
-    };
-    print "ZEBRAopserver returned : $ok \n" if $verbose;
-    if ($ok ==1) {
-        $dbh=C4::Context->dbh;
-        my $delsth;
-        # if it's a deletion, we can delete every request on this biblio : in case the user
-        # did a modif (or item deletion) just before biblio deletion, there are some specialUpdage
-        # that are pending and can't succeed, as we don't have the XML anymore
-        # so, delete everything for this biblionumber
-        my $reset_readsth = 0;
-        if ($operation eq 'recordDelete') {
-            print "deleting biblio deletion $biblionumber\n" if $verbose;
-            $delsth =$dbh->prepare("UPDATE zebraqueue SET done=1 WHERE biblio_auth_number =?");
-            $delsth->execute($biblionumber);
-            $reset_readsth = 1 if $delsth->rows() > 0;
-        # if it's not a deletion, delete every pending specialUpdate for this biblionumber
-        # in case the user add biblio, then X items, before this script runs
-        # this avoid indexing X+1 times where just 1 is enough.
-        } else {
-            print "deleting special date for $biblionumber\n" if $verbose;
-            $delsth =$dbh->prepare("UPDATE zebraqueue SET done=1 WHERE biblio_auth_number =? and operation='specialUpdate'");
-            $delsth->execute($biblionumber);
-            $reset_readsth = 1 if $delsth->rows() > 0;
-        }
-        if ($reset_readsth) {
-            # if we can ignore rows in zebraqueue because we've already
-            # touched a record, reset the query. 
-            $readsth->finish();
-            $readsth->execute();
-        }
-    }
-}
-
-sub zebrado {
-    
-    ###Accepts a $server variable thus we can use it to update  biblios, authorities or other zebra dbs
-    my ($record,$op,$server,$biblionumber)=@_;
-    
-    my @port;
-    
-    my $tried=0;
-    my $recon=0;
-    my $reconnect=0;
-#    $record=Encode::encode("UTF-8",$record);
-    my $shadow=$server."shadow";
-    $op = 'recordDelete' if $op eq 'delete_record';
-reconnect:
-    
-    my $Zconn=C4::Context->Zconn($server, 0, 1);
-    if ($record){
-        print "updating $op on $biblionumber for server $server\n $record\n" if $verbose;
-        my $Zpackage = $Zconn->package();
-        $Zpackage->option(action => $op);
-        $Zpackage->option(record => $record);
-#          $Zpackage->option(recordIdOpaque => $biblionumber) if $biblionumber;
-retry:
-        $Zpackage->send("update");
-        my($error, $errmsg, $addinfo, $diagset) = $Zconn->error_x();
-        if ($error==10007 && $tried<3) {## timeout --another 30 looonng seconds for this update
-            print "error 10007\n" if $verbose;
-            sleep 1;   ##  wait a sec!
-            $tried=$tried+1;
-            goto "retry";
-        }elsif ($error==2 && $tried<2) {## timeout --temporary zebra error !whatever that means
-            print "error 2\n" if $verbose;
-            sleep 2;   ##  wait two seconds!
-            $tried=$tried+1;
-            goto "retry";
-        }elsif($error==10004 && $recon==0){##Lost connection -reconnect
-            print "error 10004\n" if $verbose;
-            sleep 1;   ##  wait a sec!
-            $recon=1;
-            $Zpackage->destroy();
-            $Zconn->destroy();
-            goto "reconnect";
-        }elsif ($error){
-        #      warn "Error-$server   $op  /errcode:, $error, /MSG:,$errmsg,$addinfo \n";       
-            print "error $error\n" if $verbose;
-            $Zpackage->destroy();
-            $Zconn->destroy();
-            return 0;
-        }
-        $Zpackage->send('commit');
-#     $Zpackage->destroy();
-#     $Zconn->destroy();
-    return 1;
-    }
-    return 0;
-}
index b35a00e..37596c5 100755 (executable)
@@ -18,6 +18,7 @@ use Pod::Usage;
 use Data::Dumper;
 use Time::HiRes qw/time/;
 use POSIX qw/strftime ceil/;
+use Module::Load::Conditional qw(can_load);
 
 sub usage {
     pod2usage( -verbose => 2 );
@@ -53,13 +54,11 @@ if ( not $result or $want_help ) {
 
 my $linker_module =
   "C4::Linker::" . ( C4::Context->preference("LinkerModule") || 'Default' );
-eval { eval "require $linker_module"; };
-if ($@) {
+unless ( can_load( modules => { $linker_module => undef } ) ) {
     $linker_module = 'C4::Linker::Default';
-    eval "require $linker_module";
-}
-if ($@) {
-    die "Unable to load linker module. Aborting.";
+    unless ( can_load( modules => { $linker_module => undef } ) ) {
+        die "Unable to load linker module. Aborting.";
+    }
 }
 
 my $linker = $linker_module->new(
index 43b5550..244c2ac 100755 (executable)
@@ -2,7 +2,7 @@
 #
 # This script should be used only with UNIMARC flavour
 # It is designed to report some missing information from biblio
-# table into  marc data
+# table into marc data
 #
 use strict;
 use warnings;
@@ -13,63 +13,221 @@ BEGIN {
 }
 
 use C4::Biblio;
+use Getopt::Long;
+
+sub _read_marc_code {
+    my $input = shift;
+    my ( $field, $subfield );
+    if ( $input =~ /^(\d{3})$/ ) {
+        $field = $1;
+    }
+    elsif ( $input =~ /^(\d{3})(\w)$/ ) {
+        $field    = $1;
+        $subfield = $2;
+    }
+    return ( $field, $subfield );
+}
+
+my ( $run, $help, $verbose, $where, $date_created_marc, $date_modified_marc );
+GetOptions(
+    'help|h'                 => \$help,
+    'verbose|v'              => \$verbose,
+    'run'                    => \$run,
+    'where:s'                => \$where,
+    'date-created-marc|c:s'  => \$date_created_marc,
+    'date-modified-marc|m:s' => \$date_modified_marc,
+);
+my $debug = $ENV{DEBUG};
+$verbose = 1 if $debug;
+
+# display help ?
+if ($help) {
+    print_usage();
+    exit 0;
+}
+
+$verbose and print "================================\n";
+
+# date created MARC field/subfield
+$date_created_marc = '099c' unless $date_created_marc;
+my ( $c_field, $c_subfield ) = _read_marc_code($date_created_marc);
+die "date-created-marc '$date_created_marc' is not correct." unless $c_field;
+if ($verbose) {
+    print "Date created on $c_field";
+    print $c_subfield if defined $c_subfield;    # use of defined to allow 0
+    print "\n";
+}
+
+# date last modified MARC field/subfield
+$date_modified_marc = '099d' unless $date_modified_marc;
+my ( $m_field, $m_subfield ) = _read_marc_code($date_modified_marc);
+die "date-modified-marc '$date_modified_marc' is not correct." unless $m_field;
+die
+"When date-created-marc and date-modified-marc are on same field, they should have distinct subfields"
+  if ( $c_field eq $m_field )
+  && ( !defined $c_subfield
+    || !defined $m_subfield
+    || $c_subfield eq $m_subfield );
+if ($verbose) {
+    print "Date last modified on $m_field";
+    print $m_subfield if defined $m_subfield;    # use of defined to allow 0
+    print "\n";
+}
+
+my $dbh;
+my $sth_prepared;
 
 sub updateMarc {
-    my $id = shift;
-    my $dbh = C4::Context->dbh;
-    my $field;
+    my $id     = shift;
     my $biblio = GetMarcBiblio($id);
 
-    return unless $biblio;
-
-    if(!$biblio->field('099'))
-    {
-        $field = new MARC::Field('099','','',
-                    'c' => '',
-                    'd'=>'');
-        $biblio->add_fields($field);
+    unless ($biblio) {
+        $debug and warn '[ERROR] GetMarcBiblio did not return any biblio.';
+        return;
     }
 
-    $field = $biblio->field('099');
+    my $c_marc_field = $biblio->field($c_field);
+    my $m_marc_field = $biblio->field($m_field);
 
-    my $sth = $dbh->prepare("SELECT DATE_FORMAT(datecreated,'%Y-%m-%d') as datecreated,
-                                    DATE_FORMAT(timestamp,'%Y-%m-%d') as timestamp,
-                                    frameworkcode
-                                    FROM biblio
-                                    WHERE biblionumber = ?");
-    $sth->execute($id);
-    (my $bibliorow = $sth->fetchrow_hashref);
+    my $c_marc_value;
+    if ($c_marc_field) {
+        $c_marc_value =
+          defined $c_subfield
+          ? $c_marc_field->subfield($c_subfield)
+          : $c_marc_field->data();
+    }
+    $c_marc_value = '' unless defined $c_marc_value;
+
+    my $m_marc_value;
+    if ($m_marc_field) {
+        $m_marc_value =
+          defined $m_subfield
+          ? $m_marc_field->subfield($m_subfield)
+          : $m_marc_field->data();
+    }
+    $m_marc_value ||= '';
+
+    $sth_prepared = $dbh->prepare(
+        q{
+        SELECT
+            DATE_FORMAT(datecreated,'%Y-%m-%d') AS datecreatediso,
+            DATE_FORMAT(timestamp,'%Y-%m-%d') AS datemodifiediso,
+            frameworkcode
+        FROM biblio
+        WHERE biblionumber = ?
+    }
+    ) unless $sth_prepared;
+    $sth_prepared->execute($id);
+    my $bibliorow     = $sth_prepared->fetchrow_hashref;
     my $frameworkcode = $bibliorow->{'frameworkcode'};
+    my $c_db_value    = $bibliorow->{'datecreatediso'} || '';
+    my $m_db_value    = $bibliorow->{'datemodifiediso'} || '';
+
+    # do nothing if already sync
+    return if ( $c_marc_value eq $c_db_value && $m_marc_value eq $m_db_value );
 
-    $field->update( 'c' => $bibliorow->{'datecreated'},
-                    'd' => $bibliorow->{'timestamp'}
-                    );
+    # do apply to database ?
+    return 1 unless $run;
 
-     if(&ModBiblio($biblio, $id, $frameworkcode))
-     {
-        print "\r$id";
-     }
+    # update MARC record
 
+    # date created field
+    unless ($c_marc_field) {
+        $biblio->add_fields( new MARC::Field( $c_field, '', '' ) );
+        $debug and warn "[WARN] $c_field did not exist.";
+        $c_marc_field = $biblio->field($c_field);
+
+        # when on same field
+        if ( $m_field eq $c_field ) {
+            $m_marc_field = $c_marc_field;
+        }
+    }
+    if ( defined $c_subfield ) {
+        $c_marc_field->update( $c_subfield, $c_db_value );
+    }
+    else {
+        $c_marc_field->update($c_db_value);
+    }
+
+    # date last modified field
+    unless ($m_marc_field) {
+        $biblio->add_fields( new MARC::Field( $m_field, '', '' ) );
+        $debug and warn "[WARN] $m_field did not exist.";
+        $m_marc_field = $biblio->field($m_field);
+    }
+    if ( defined $m_subfield ) {
+        $m_marc_field->update( $m_subfield, $m_db_value );
+    }
+    else {
+        $m_marc_field->update($m_db_value);
+    }
+
+    # apply to databse
+    if ( &ModBiblio( $biblio, $id, $frameworkcode ) ) {
+        return 1;
+    }
+
+    $debug and warn '[ERROR] ModBiblio failed.';
+    return;
 }
 
 sub process {
 
-    my $dbh = C4::Context->dbh;
+    $dbh = C4::Context->dbh;
+    my $mod_count = 0;
 
-    my $sth = $dbh->prepare("SELECT biblionumber FROM biblio");
+    my $query = q{
+        SELECT biblionumber
+        FROM biblio
+        JOIN biblioitems USING (biblionumber)
+    };
+    $query .= qq{ WHERE $where} if $where;
+    my $sth = $dbh->prepare($query);
     $sth->execute();
 
-    while(my $biblios = $sth->fetchrow_hashref)
-    {
-        updateMarc($biblios->{'biblionumber'});
-        print ".";
+    $verbose and print "Number of concerned biblios: " . $sth->rows . "\n";
+
+    while ( my $biblios = $sth->fetchrow_hashref ) {
+        $verbose and print 'Bib ' . $biblios->{'biblionumber'} . ':';
+        my $ret = updateMarc( $biblios->{'biblionumber'} );
+        if ($ret) {
+            $verbose and print 'modified';
+            $mod_count++;
+        }
+        $verbose and print "\n";
     }
 
+    $verbose and print "Number of modified biblios: " . $mod_count . "\n";
 }
 
-if (lc(C4::Context->preference('marcflavour')) eq "unimarc"){
-process();
-} 
+if ( lc( C4::Context->preference('marcflavour') ) eq "unimarc" ) {
+    $verbose
+      and !$run
+      and print "*** Not in run mode, modifications will not be applyed ***\n";
+
+    $verbose and print "================================\n";
+    process();
+}
 else {
-       print "this script is UNIMARC only and should be used only on unimarc databases\n";
+    print
+"This script is UNIMARC only and should be used only on UNIMARC databases\n";
+}
+
+sub print_usage {
+    print <<_USAGE_;
+Synchronizes date created and date last modified from biblio table to MARC data.
+Does not update biblio if dates are already synchronized.
+UNIMARC specific.
+
+Parameters:
+    --help or -h                show this message
+    --verbose or -v             verbose logging
+    --run                       run the command else modifications will not be applyed to database
+    --where                     (optional) use this to limit execution to some biblios :
+                                write a SQL where clause using biblio and/or biblioitems fields
+    --date-created-marc or c    (optional) date created MARC field and optional subfield,
+                                099c by default
+    --date-modified-marc or m   (optional) date last modified MARC field and optional subfield,
+                                099d by default
+_USAGE_
 }
diff --git a/misc/maintenance/fix_accountlines_rmdupfines_bug8253.pl b/misc/maintenance/fix_accountlines_rmdupfines_bug8253.pl
new file mode 100755 (executable)
index 0000000..36e4623
--- /dev/null
@@ -0,0 +1,120 @@
+#!/usr/bin/perl
+#
+# Copyright (C) 2012 ByWater Solutions
+#
+# 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;
+
+BEGIN {
+    # find Koha's Perl modules
+    # test carefully before changing this
+    use FindBin;
+    eval { require "$FindBin::Bin/../kohalib.pl" };
+}
+
+use C4::Context;
+use C4::Installer;
+use C4::Dates;
+
+use Getopt::Long;
+use Data::Dumper;
+
+sub print_usage {
+    print <<_USAGE_
+$0: Remove duplicate fines
+
+Due to bug 8253, upgrading from Koha 3.6 to 3.8 may introduce duplicate fines.
+This script will remove these duplicate fines. To use, repeatably run this
+script until there are no more duplicates in the database.
+
+Parameters:
+  --confirm or -c     Confirm you want to run the script.
+  --help or -h        Print out this help message.
+_USAGE_
+}
+
+my $help;
+my $confirm;
+my $result = GetOptions(
+    'confirm|c' => \$confirm,
+    'help|h'   => \$help,
+);
+if ( $help || !$confirm ) {
+    print_usage();
+    exit 0;
+}
+
+
+my $dbh = C4::Context->dbh;
+
+my $query = "
+    SELECT * FROM accountlines
+    WHERE ( accounttype =  'FU' OR accounttype =  'F' )
+    AND description like '%23:59%'
+    ORDER BY borrowernumber, itemnumber, accountno, description
+";
+my $sth = $dbh->prepare($query);
+$sth->execute();
+my $results = $sth->fetchall_arrayref( {} );
+
+$query =
+"SELECT * FROM accountlines WHERE description LIKE ? AND description NOT LIKE ?";
+$sth = $dbh->prepare($query);
+
+my @fines;
+foreach my $keeper (@$results) {
+
+    warn "WORKING ON KEEPER: " . Data::Dumper::Dumper( $keeper );
+    my ($description_to_match) = split( / 23:59/, $keeper->{'description'} );
+    $description_to_match .= '%';
+
+    warn "DESCRIPTION TO MATCH: " . $description_to_match;
+
+    $sth->execute( $description_to_match, $keeper->{'description'} );
+
+    my $has_changed = 0;
+
+    while ( my $f = $sth->fetchrow_hashref() ) {
+
+        warn "DELETING: " . Data::Dumper::Dumper( $f );
+
+        if ( $f->{'amountoutstanding'} < $keeper->{'amountoutstanding'} ) {
+            $keeper->{'amountoutstanding'} = $f->{'amountoutstanding'};
+            $has_changed = 1;
+        }
+
+        my $sql =
+            "DELETE FROM accountlines WHERE borrowernumber = ? AND accountno = ? AND itemnumber = ? AND date = ? AND description = ? LIMIT 1";
+        $dbh->do( $sql, undef, $f->{'borrowernumber'},
+            $f->{'accountno'}, $f->{'itemnumber'}, $f->{'date'},
+            $f->{'description'} );
+    }
+
+    if ($has_changed) {
+        my $sql =
+            "UPDATE accountlines SET amountoutstanding = ? WHERE borrowernumber = ? AND accountno = ? AND itemnumber = ? AND date = ? AND description = ? LIMIT 1";
+        $dbh->do(
+            $sql,                           undef,
+            $keeper->{'amountoutstanding'}, $keeper->{'borrowernumber'},
+            $keeper->{'accountno'},         $keeper->{'itemnumber'},
+            $keeper->{'date'},              $keeper->{'description'}
+        );
+    }
+}
+
+exit;
diff --git a/misc/maintenance/fix_mysql_constraints.pl b/misc/maintenance/fix_mysql_constraints.pl
new file mode 100755 (executable)
index 0000000..1485140
--- /dev/null
@@ -0,0 +1,166 @@
+#!/usr/bin/perl
+#
+# Copyright (C) 2012 Tamil s.a.r.l.
+#
+# 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 Modern::Perl;
+BEGIN {
+    # find Koha's Perl modules
+    # test carefully before changing this
+    use FindBin;
+    my $lib = "$FindBin::Bin/../kohalib.pl";
+    eval { require $lib };
+}
+
+use Getopt::Long;
+use Pod::Usage;
+use YAML;
+use Try::Tiny;
+use C4::Context;
+
+
+my ($doit, $alterengine, $help);
+my $result = GetOptions(
+    'doit'        => \$doit,
+    'alterengine' => \$alterengine,
+    'help|h'      => \$help,
+);
+
+
+sub usage {
+    pod2usage( -verbose => 2 );
+    exit;
+}
+
+
+sub fix_mysql_constraints {
+    my ($doit) = @_;
+
+    # Get all current DB constraints
+    my $dbh = C4::Context->dbh;
+    $dbh->{RaiseError} = 1;
+    $dbh->{ShowErrorStatement} = 1;
+    my $database = C4::Context->config('database');
+    my %db_constraint = map { $_->[0] => undef } @{$dbh->selectall_arrayref(
+        "SELECT CONSTRAINT_NAME
+           FROM information_schema.table_constraints
+          WHERE constraint_schema = '$database'
+            AND CONSTRAINT_TYPE != 'PRIMARY KEY' ")};
+
+    my $base_dir = C4::Context->config('intranetdir');
+    open my $fh, "<", "$base_dir/installer/data/mysql/kohastructure.sql"
+        or die "Unable to open kohastructure.sql file";
+
+    my $table_name;
+    my $engine_altered;
+    # FIXME: This hide problem. But if you run this script, it means that you
+    # have already identified issues with your Koha DB integrity, and will fix
+    # any necessary tables requiring records deleting.
+    $dbh->do("SET FOREIGN_KEY_CHECKS=0");
+    my $line = <$fh>;
+    while ( $line ) {
+        if ( $line =~ /CREATE TABLE (.*?) / ) {
+            $table_name = $1;
+            $table_name =~ s/\`//g;
+            $engine_altered = 0;
+            $line = <$fh>;
+            next;
+        }
+        unless ( $line =~ /CONSTRAINT /i ) {
+            $line = <$fh>;
+            next;
+        }
+        my $constraint = $line;
+        CONTRAINT_LOOP:
+        while ( $constraint !~ /,/ ) {
+            $line = <$fh>;
+            last CONTRAINT_LOOP if $line =~ /ENGINE/i;
+            $line =~ s/^ */ /;
+            $constraint .= $line;
+        }
+        $constraint =~ s/^ *//;
+        $constraint =~ s/\n//g;
+        $constraint =~ s/ *$//;
+        $constraint =~ s/,$//;
+        my ($name) = $constraint =~ /CONSTRAINT (.*?) /;
+        $name =~ s/\`//g;
+        unless ( exists($db_constraint{$name}) ) {
+            if ( $alterengine && !$engine_altered ) {
+                my $sql = "ALTER TABLE $table_name ENGINE = 'InnoDB'";
+                say $sql;
+                if ( $doit ) {
+                    try {
+                        $dbh->do($sql) if $doit;
+                        $engine_altered = 1;
+                    } catch {
+                        say "Error: $_;";
+                    };
+                }
+            }
+            my $sql = "ALTER TABLE $table_name ADD $constraint";
+            say $sql;
+            if ( $doit ) {
+                try {
+                    $dbh->do($sql) if $doit;
+                } catch {
+                    say "Error: $_";
+                }
+            }
+        }
+        $line = <$fh> if $line =~ /CONSTRAINT/i;
+    }
+}
+
+
+usage() if $help;
+
+fix_mysql_constraints($doit);
+
+=head1 NAME
+
+fix_mysql_constraints.pl
+
+=head1 SYNOPSIS
+
+  fix_mysql_constraints.pl --help
+  fix_mysql_constraints.pl
+  fix_mysql_constraints.pl --doit
+
+=head1 DESCRIPTION
+
+See bug #8915
+
+Alter tables to add missing constraints. Prior to altering tables, it may be
+necessary to alter tables storage engine from MyISAM to InnoDB.
+
+=over 8
+
+=item B<--help>
+
+Prints this help
+
+=item B<--doit>
+
+Alter tables effectively, otherwise just display the ALTER TABLE directives.
+
+=item B<--alterengine>
+
+Prior to add missing constraints, alter table engine to InnoDB.
+
+=back
+
+=cut
index e11817d..0e24df5 100755 (executable)
@@ -251,7 +251,7 @@ sub index_records {
         }
         my $record_fmt = ($as_xml) ? 'marcxml' : 'iso2709' ;
         if ($process_zebraqueue) {
-            do_indexing($record_type, 'delete', "$directory/del_$record_type", $reset, $noshadow, $record_fmt, $zebraidx_log_opt)
+            do_indexing($record_type, 'adelete', "$directory/del_$record_type", $reset, $noshadow, $record_fmt, $zebraidx_log_opt)
                 if %$records_deleted;
             do_indexing($record_type, 'update', "$directory/upd_$record_type", $reset, $noshadow, $record_fmt, $zebraidx_log_opt)
                 if $num_records_exported;
diff --git a/misc/release_notes/release_notes_3_10_0.txt b/misc/release_notes/release_notes_3_10_0.txt
new file mode 100644 (file)
index 0000000..a1ebdef
--- /dev/null
@@ -0,0 +1,2231 @@
+RELEASE NOTES FOR KOHA 3.10.0
+23 nov. 2012
+========================================================================
+
+Koha is the first free and open source software library automation package 
+(ILS). Development is sponsored by libraries of varying types and sizes, 
+volunteers, and support companies from around the world.  
+The website for the Koha project is 
+
+    http://koha-community.org/
+
+Koha 3.10.0 can be downloaded from:
+
+    http://download.koha-community.org/koha-3.10.00.tar.gz
+
+Installation instructions can be found at:
+
+    http://wiki.koha-community.org/wiki/Installation_Documentation
+    
+    OR in the INSTALL files that come in the tarball
+
+
+Koha 3.10.0 is a major release, that comes with many new features.
+
+
+It includes 160 enhancement and 456 bugfixes.
+
+
+Plack for staff interface
+=========================
+
+The most important feature that comes with Koha 3.10.0 is Plack 
+compatibility for the staff interface. In Koha 3.8.0, 
+the OPAC was already plack-ready. A lot of work (more than 30 
+bugfixes) has been made to make the staff interface Plack-compliant.
+
+The Koha team made many tests, and BibLibre has published a blog entry 
+about performance improvements: using Plack for staff interface 
+will improve your productivity by 25%.
+
+If you’re interested by the complete details for of the tests, you can 
+have a look at:
+
+http://www.biblibre.com/en/blog/entry/plack-for-staff-interface-in-310-why-you-will-want-it
+
+However, Plack is not activated by default when you install Koha 
+(and not activated when you upgrade from a previous version. 
+If you want to activate it, everything you need is described on the wiki page:
+
+http://wiki.koha-community.org/wiki/Plack#Running_Intranet
+
+
+Enhancements and new features in 3.10.0
+======================
+
+About
+----------
+       8301    Display additional system information (preferences) on About page to minimize support cases
+To minimize support questions regarding common mistakes, the About page now 
+has an additional tab that displays warnings if deprecated and/or mutually
+exclusive system preferences are used.
+
+Example: Bug 8298 Can't call method  subfield  on an undefined value at
+Biblio.pm (sub _AddBiblioNoZebra)
+
+       8641    Add information warning about log-in as root user to About->System information
+If you are logged in as database administrative user,a lot of things
+do not work.
+
+It seems that this is a pitfall for a lot of newbies.
+To prevent frustration and support questions, this patch adds some information
+to About->System Information.
+
+Acquisitions
+----------
+       5335    Define VAT/taxes at orderline level, with default value for supplier and list of valid tax rates
+Before this patch, VAT rate was defined at vendor level. With this 
+new feature, the system preference gist is now a list of tax rates.
+Each vendor has its own default tax rate, and on each orderline the 
+librarian can choose the tax rate to apply, the default being the vendor
+default one.
+       5337    In Acquisition, EAN search will return results
+In acquisition module, scanning an EAN results in a correct search
+       5339    Parcel closing in acq
+A new feature has been added to enable closing of a parcel.
+Once a parcel is closed, no items can be added.
+When the librarian closes a parcel, invoice information can be entered.
+Invoice detail includes:
+    - shipment date.
+    - billing date.
+    - shipment cost and budget used for shipment cost.
+       5356    Shipping billing address improvements
+The library will be able to choose shipping and billing address at basket level.
+If that information is filled at basket level, then they won't have to be
+filled at the basketgroup level. If shipping and billing addresses are filled at basket
+level, the information will be stored in the comment section of the basket. That
+will be useful for libraries having a single basketgroup for the supplier, but
+different shipping/billing address
+       7168    Search orders by basket group name
+This patch adds the possibility to search orders by the basket group name
+       7175    Improve order receiving page
+When system preference AcqCreateItem= ordering , this development allows 
+the user to choose what items are received by listing all created items and 
+providing a checkbox for each one.
+
+       7302    CSV export of a basketgroup
+This patch adds CSV export for basketgroups
+       7304    Working on funds ergonomic display and funds management by multiple librarians
+This patch adds more permissions for budgets.
+The librarian can now:
+    - add users to a budget.
+    - Set restrictions to:
+      - None.
+      - Owner.
+      - Owner and users.
+      - Owner, users and library.
+    - Restricted users cannot spend on these budgets (nor can they modify them)
+       7583    Undo receive
+This patch adds a feature to reverse receipt an item in acquisitions 
+- or undo a receipt if you happen to have clicked the wrong title or a 
+title by accident
+       7757    Edit basket vendor after it has been created
+This patch adds the ability to change the vendor for an
+individual basket.
+       7903    Add an ordernumber column in orders history table
+This patch adds ordernumber column in order's history table
+
+Add an ordernumber column in the search results table of orders. It should
+help as far as order tracking is concerned.
+       8028    Make table collapsing on parcel.pl sticky
+The tables on parcel.pl defaulted to show only the first five items in the table,
+and librarians had to click the a link to display all the items. Every time the
+page is reloaded the table got re-collapsed, and the librarian had to click again.
+With this patch, parcel.pl now remembers which way the table was set and keeps it
+that way until it is changed again.
+       8099    DataTables in Acquisision module: acqui-home.tt
+This patch adds a DataTables filter in Acquisision module: acqui-home.tt
+       8100    DataTables in Acquisision module: neworderbiblio.tt
+This patch adds a DataTables filter in Acquisision module: neworderbiblio.tt
+       8102    DataTables in Acquisision module: supplier.tt
+This patch adds a DataTables filter in Acquisision module: supplier.tt
+       8106    DataTables in Acquisision module: addorderiso2709.tt
+This patch adds a DataTables filter in Acquisision module: addorderiso2709.tt
+       8117    Divide budget periods into two tabs
+Budget periods are now divided into two tabs : active and inactive
+budget periods.
+       8652    There is no default value for the late orders
+On the lateorders.pl, we don't want to see all the late orders.
+With this patch, the date interval is based on the estimated delivery date and
+the delay parameter is based on the closing date.
+
+Architecture, internals, and plumbing
+----------
+       7065    Reserves table needs a primary key
+The reserves (and old_reserves) tables need a primary key.
+reservernumber should be used for consistency's sake.  This will allow the
+possibility of multiple holds per biblio/patron combination, and a host of other
+improvements.
+       7248    Caching for services
+This patch moves all caching services to the Koha namespace.
+This patch is a first step that will let us add more caching services to 
+improve speed and scalability in the future.
+This patch works in conjunction with 8089 and 8092
+       7444    Use T::T date plugin to display dates omnibus
+With this patch, all dates can now be displayed through a 
+Template::Toolkit plug-in. All existing code must be updated.
+Dates can/should/must now be displayed by:
+* adding [% USE KohaDates %] at the beginning of the template.
+* use [% mydate   KohaDates %] for mydate date variable.
+* remove .pl code that update date format before sending the string
+to the template.
+
+This entry is an omnibus, as many patches will be necessary.
+       7729    Svc API should allow modification of items
+The svc new_biblio and biblio scripts and now create item as well
+
+The svc API also support deletion of items - maybe using HTTP DELETE
+method.
+       8089    Use Koha::Cache everywhere
+
+
+       8092    Koha should use CHI caching framework
+This patch adds CHI support for caching and its already-existing cache drivers.
+
+Cataloging
+----------
+       3462    Link see also in authorities
+The see also statements in Authorities are linked to the
+authority they were referencing
+       6448    EAN-13 barcode support
+We are migrating one library from custom software to Koha, and they are using
+EAN-13 zero-padded barcodes (primary key in legacy system) instead of ISBN or
+ISSN. Since books already have barcodes on them, we can't change it.
+To make things more interesting, at least one barcode reader reports it as
+UPC-A without first leading zero, since EAN-13 has backwards compatibility with
+it.
+       7412    Pre-filling items in cataloging
+Pre-filling of items: remember what was in the previous item filled, 
+to be able to create multiple items quickly.
+By default, all subfields are prefilled when the PrefillItem system 
+preference is on, unless you specify which fields you want to prefill in the 
+SubfieldsToUseWhenPrefill system preference.
+For example, with a value of 'f u v', only the $f, $u and $v will be pre-filled.
+       7601    Preference for default language for field 008 Range 35-37 (instead of hard coded "eng")
+This patch adds the DefaultLanguageField008 system preference, that is
+used to populate the default 008 MARC21 field, Range 35-37
+       7613    OCLC Connexion Gateway, including extension svc/import_bib
+This patch adds OCLC Connexion Gateway, including extension svc/import_bib
+to let libraries populate their catalog with OCLC (or other) external sources.
+This patch includes:
+  * C4::ImportBatch: create sub GetImportBatchByFilename($filename) which will get
+the last import_batches record with the filename.
+  * svc/import_bib:
+    -  POST request structure:
+param1: val.
+param2: val.
+<?xml version= 1.0  encoding= UTF-8 ?>
+<record ...
+</record>
+    -  call C4::ImportBatch::GetImportBatchByFilename( webservice ); if in 'stage'
+status use it, otherwise create new one AddImportBatch() using POST param.
+    -  call C4::ImportBatch::AddBiblioToBatch() and AddItemsToImportBiblio().
+    -  if import mode = 'direct' call C4::ImportBatch::BatchCommitBibRecords().
+  * misc/cronjobs/import_webservice_batch.pl:
+    -  input params: framework (default 'default').
+    -  call C4::ImportBatch::GetImportBatchByFilename( webservice ); if in 'stage'
+status.
+    -  call C4::ImportBatch::BatchCommitBibRecords().
+  * OCLC requests listening daemon connexion_import.pl.
+    -  base on HTTP::Server or similar.
+    -  command line params: config file.
+    -  config values as per spec.
+    -  first get the auth cookie from auth url, then make request to import url
+       7652    Add item barcode on top of its editing form
+This patch displays the item barcode on top of its editing form. It's
+more useful for the common user than the itemnumber which has no practical 
+application for the user.
+       7739    Batch edit items of a title
+A new option - Edit items in batch - is made available under the Edit 
+menu in  the catalog detail page. When this option is selected the 
+batch item modification tool is called with all items under this record 
+passed as parameters.
+User can then edit all items of this record in batch. Once changes are 
+saved the 'done' link takes the user back to the catalog detail page of 
+this record.
+       7992    New plugin about Automatic Number incrementing inventory. Prefix management from a authorised values list
+The plug-in Koha about the Automatic Number incrementing inventory are not
+perfect.
+This patch adds a new plug-in which offers more opportunities with a prefix 
+management from a authorized values list.
+
+  1 / Create a list of authorized values(INVENTORY_NUMBER). In which the code is
+the prefix and the description the last number assigned.
+
+  2/ A space between the prefix and number.
+
+
+  3 / From a holding record, after indicate the prefix when you click on the
+plug-in -> Koha search the last number from authorized values assigned in the
+list and increment n +1 level meter (description).
+       8185    Plugin for linking records in MARC21
+In cataloging/value_builder there is a plug-in for linking records.
+But is only for UNIMARC (unimarc_field_4XX.pl), this patch add a plug-in for MARC21.
+       8208    Add "create authority" button to auth_finder plugin
+Right now if you want to link a heading to a new authority record, you have to
+either use BiblioAddsAuthorities to automatically generate the authority, or
+create a new authority in the authority module, and wait for the indexer to
+catch up. This patch adds a create authority button that -- like the fast add
+functionality in circulation -- allows you to create an authority and immediately
+populate the heading.
+       8524    Add barcode plugin that does not autofill
+The current barcode plug-in uses the autobarcode system preference to 
+decide which type of barcode to generate, then *always* inserts a barcode.
+This patch adds a plug-in which will only insert the barcode when the plug-in 
+link is clicked.
+       8674    Need a delete biblios script
+The script misc/batchdeletebiblios.pl batch deletes bibliographic 
+records which contain a biblionumber present in file passed in parameter.
+If a bibliographic record has items, it is not deleted.
+       8801    Offer to batch delete items of a bibliographic record
+This patch adds a link in 'Edit' menu to go directly to batch deletion of items.
+
+Circulation
+----------
+       4118    Add Collection Code (CCODE) to Statistics Table
+This patch adds the collection code added to the statistics table in
+addition to itemtype.
+       5549    Hourly Loans
+This patch fixes some problems to hourly loans features which had been 
+introduced in Koha 3.8
+       7420    Add max fines to circulation matrix
+This patch adds a capped charge per item.
+It adds an Overdue Fines Cap section at the bottom of the Circulation
+Rules page with inputs for item type and patron category.
+       7563    Silent print slips using Firefox PlugIn jsPrintSetup and new staff client preference
+This patch implement silent printing for slips. 
+
+In opposition to the solution with an additional Firefox (Portable) installation
+(see: http://wiki.koha-community.org/wiki/Using_Portable_Firefox_as_a_Koha_Client), 
+this solution works with the standard Firefox installation (+ PlugIn jsPrintSetup) .
+
+jsPrintSetup e.g. allows to set printer, print silent, change header and footer,
+see: http://jsprintsetup.mozdev.org/
+
+The overall concept is to have a new staff client system preference 
+(intranetslipprinterjs) where one can enter the necessary JavaScript.
+
+If this preference is empty, Koha falls back to the default behaviour.
+
+Example of intranetslipprinterjs configuration:
+
+function printThenClose() {
+ try
+  {
+        //Try to print using jsPrintSetup Plug-In in Firefox
+        //If it is not installed fall back to default prnting
+        jsPrintSetup.clearSilentPrint();   
+        jsPrintSetup.setOption('printSilent', 1);
+               
+       //Choose printer using one or more of the following functions
+       //jsPrintSetup.getPrintersList...
+       //jsPrintSetup.setPrinter...
+
+       //Set Header and footer...
+        jsPrintSetup.setOption('headerStrLeft', '');
+        jsPrintSetup.setOption('headerStrCenter', '');
+        jsPrintSetup.setOption('headerStrRight', '');
+        jsPrintSetup.setOption('footerStrLeft', '');
+        jsPrintSetup.setOption('footerStrCenter', '');
+        jsPrintSetup.setOption('footerStrRight', '');   
+               
+        jsPrintSetup.print();     
+        window.close();
+  }
+catch(err)
+  {   
+        //Default printing if jsPrint-setup is not available
+        window.print();
+        window.close();
+  }
+} 
+
+if you've installed jsPrintSetup PlugIn in Firefox from now on, 
+slips will print silently with Firefox and will show default behaviour
+if jsPrintSetup is not installed or if you make use of an other browser. 
+
+All other printing will behave like before.
+       7621    Circulation: Match age restriction of title with borrower's age without using categories
+Public libraries and school libraries often have to deal with a lot of age
+restrictions, [e.g. FSK (see www.fsk.de) or PEGI (Pan European Game
+Information, see www.pegi.info)] and/or with regional rules regarding movies
+(virtually every canton in Switzerland has it's own rules).
+
+The classic way to implement age restrictions is to make use of a lot of
+categories. This gets soon very complicated, and is not easily maintainable. The
+librarians need an easy way to maintain age restrictions per title, otherwise
+they will not accept Koha.
+
+This patch adds a robust and easily configurable way to match age restriction
+against the borrower's age.
+
+The concept.
+  1) Have information about age restriction in a field (521$a Target audience
+ is suggested) The entry can be anywhere in the field. It reads like
+PEGI 3 or FSK 12 (or any other 'tag' + age).
+  2) Have a preference 'AgeRestrictionMarker' where such tags are defined. It is a
+text field with a list like
+PEGI,FSK,Age...
+  3) Update your MARC cataloging frameworks to link the 521$a (or any other one) to
+biblioitems.agerestriction.
+  4) Add a limit into a biblio record, for example PEGI 12, if you've defined PEGI in 
+AgeRestrictionMarker.
+If a borrower tries to check out a restricted book and does not have the
+appropriate age, the circulation module will block the check out and issue a
+message like Age restriction 12 
+The AgeRestrictionOverride let you choose if your librarians can or can't
+override age restriction.
+       7647    Checkout History Sort
+With popular items the checkout history can be quite long and it is a challenge
+to sort through and find one library's history of a book.
+This patch puts a table sorter on the checkout history.
+       7704    Independent Branches sys pref change to let librarians choose which things to share
+Before this patch, when independantbranches was ON and canreservefromotherbranch 
+was set to Allow, attempting to checkin the item at the other branch 
+is made, system disallows checkin. Now the item is checked in and an 
+automatic transfer to the home branch is setup.
+       7751    Decrease loan period on items with a high number of holds
+Controlled by a system preference, this will reduce the amount of time something
+can be onloan, if it has a lot of holds on it:
+The loan duration is reduced by decreaseLoanHighHoldsDuration days for items 
+with more than decreaseLoanHighHoldsValue holds
+       7849    Instant Fine Calculation at Checkin
+Add the ability for fines to be calculated at checkin.  This will be 
+helpful for hourly based items so the cronjob for fines doesn't have to be 
+run on such a frequent interval.
+
+
+       7986    Export issues
+This patch adds filters and export button (in iso2709 or csv format) on 
+issues table.
+The export will export bibliographic and items informations, that can be put 
+on a USB key and given to your patron.
+If the patron is a library, he can import this file into his local ILS.
+(This is a common usage in France, where large library check-out hundreds of books
+for a long period to small villages)
+       8167    Add syspref allow a choice of blocking, non-blocking, or do nothing when issuing lost items.
+This patch adds a system preference IssueLostItem to define the 
+behaviour in case of issuing a 'lost' item:
+    - do nothing (checkout without any warning).
+    - request for confirmation.
+    - issue a non-blocking warning.
+       8477    Display home & holding branches when checking in
+This patch adds home and holding branch display when checking in an item.
+       8693    Sort biblio checkout history by checkout date instead of patron name
+issuehistory.pl is displaying a timeline of checkouts for a particular
+title, so it makes more sense to display the list chronologically.
+
+Command-line Utilities
+----------
+       5600    Bulk MARC biblio export script
+This patch adds a command line interface for tools/export.pl
+export.pl [--format=format] [--date=date] [--dont_export_items]
+  [--deleted_barcodes] [--clean] --filename=outputfile
+    * format is either 'xml' or 'marc' (default)
+    * date should be entered as the 'dateformat' system preference is set
+      (dd/mm/yyyy for metric, yyyy-mm-dd for iso, mm/dd/yyyy for us)
+    * records exported are the ones that have been modified since 'date'
+    * if --deleted_barcodes is used, a list of barcodes of items deleted
+      since 'date' is produced (or from all deleted items if no date is
+      specified)
+    * --clean removes NSE/NSB
+       7213    Document /svc/ HTTP API and provide example command-line client
+This patch adds a script that can be used from commandline to play with
+the svc/ API for integrating biblio records into Koha.
+This script can be used from other scripts as C<Koha::SVC> module or run
+directly using syntax:
+  koha-svc.pl http://koha-dev:8080/cgi-bin/koha/svc svc-user svc-password 
+  $biblionumber [bib-42.xml]
+
+       7447    Allow to specify a date in overdue_notice.pl
+
+
+
+       7675    New script for changing selinux file labels on perl scripts
+On some Linux distributions like RedHat, Fedora, CentOS you can use
+SELinux for enhanced security. Among others, this involves file labeling
+(security context).
+In other distributions SELinux can be installed additionally.
+
+The script added by this patch xt/set-selinux-labels lets you update and
+restore such labels on the perl script in a Koha installation.
+Note that there is more to it to get Koha running with SELinux, but this is a
+first step.
+       7963    Parallel HTTP requests when checking URLs
+Current script check-url.pl checks URL found in 856$u by sending HTTP
+requests, one by one. This patch adds a new script which send multiple
+requests simultaneously. The checking is something like 20 times faster.
+
+This script is based on AnyEvent and AnyEvent::HTTP CPAN modules, that are
+required dependencies if you want to use it.
+       8063    Hold print notices do not sort by branch
+The gather_print_notices.pl cronjob for printing hold notices mails all notices
+as one file and does not separate out the notices by branch.  For libraries with
+multiple branches this results in large files being received by individual
+branches that need to be read/sorted/printed or ignored.
+This patch adds a --split (or -s) parameter to gather_print_notices.pl that
+let the library create a separate file for each (borrower) branch
+       8376    Command line utility for exporting borrowers
+
+
+
+
+Database
+----------
+       7792    Redefine the field branchcode as PRIMARY KEY of branches
+The table branches had a UNIQUE KEY `branchcode`, that is moved to PRIMARY KEY
+(There's no noticeable consequence to this change)
+       7794    Redefine the field id as PRIMARY KEY of sessions
+Table sessions had a UNIQUE KEY `id`, that is moved to PRIMARY KEY.
+(There's no noticeable consequence to this change)
+       8268    Koha should offer way to backup entire db
+Right now, if libraries with hosted installations want copies of the database
+for backup purposes, they have to request that their vendors provide them with a
+copy. With this feature, it is possible for vendors to easily enable their
+customers to easily download backups of their database via the Export tool.
+       8757    Longer size text for authorized values description
+This patch improve the size of authorized values descriptions.
+Authorised Values have many uses, and, among others things, store in SUGGEST the
+potential  reasons  (then stored in the  suggestions  table) for which a
+suggestion can be refused.
+To give better informations to borrowers, some librairies would like to see
+longer  lib_opac  fields (the  lib  field should follow the movement, of
+course), this patch make this field 255 chars long.
+
+Developer documentation
+----------
+       6716    Database Documentation
+The database documentation available at 
+http://schema.koha-community.org has been updated and improved
+
+Hold requests
+----------
+       5911    Transport Cost Matrix of transporting an item between branches
+This patch adds a new administrative page that serves to manage the
+relative costs of transporting an item between branches. “Cost” does not
+directly correspond to currency, but rather is a measurement of the difficulty
+of transporting the item between the two branches.
+
+For each branch, it is possible to specify a numeric value indicating the
+'cost' of transporting the item from that branch to every other branch. A toggle
+is also available to block all transport from any branch to any other
+branch. The toggle does not change the 'cost' value associated with the
+transport between any two branches.
+
+A system preference has been added to control whether holds are filled using the
+Transport Cost Matrix, or not.
+
+If the system is configured to use the Transport Cost Matrix for filling holds,
+then when attempting to fill a hold, the system will search for the lowest cost
+branch, and attempt to fill the hold with an item from that branch first.
+Branches of equal cost will be selected from randomly. The branch or branches
+of the next highest cost will be selected from only if all the branches in the
+previous group are unable to fill the hold.
+
+The system use the item's current holding branch when determining whether
+the item can fulfill a hold using the Transport Cost Matrix. This behaviour
+can be overruled if the AutomaticItemReturn system preference is enabled.
+       8004    Items on hold lose transfer after being scanned twice
+When a hold is placed on an item where the pickup location is different than the
+holding library, Koha initiates a branch transfer for that item to fill that
+hold when items is run through the returns system.
+
+If the item is then run through returns a second time, the system is supposed to
+close that transfer as a 'wrongtransfer', and open a new transfer with the same
+from and to branches as the original.
+
+The problem is that the original transfer is closed, but the new transfer is not
+created. This is because at some point, someone replaced the template variable
+WrongTransfer, which had previously contained the branchcode for the library to
+transfer to, with the full name of the library instead ( I assume to make a look
+nicer ).
+
+The consequence of this, is the the name of the library is passed to
+updateWrongTransfer instead of the branchcode, causing the failure.
+       8449    Improve wording and styling for "cancelled holds" on Holds Awaiting Pickup screen
+This patch changes the div classes, so that the prompts for action
+stand out and actually grab the attention of the user.
+
+It also adds more precise, descriptive language for the prompt messages and
+fixes the grammar (e.g. comma splices). The most important part being the 
+second instruction where staff are prompted to check-in the item to continue
+processing the hold for the next patron in the holds queue.
+       8454    Holds to Pull : Show pull list on load. Otherwise, it looks like the pull list is empty.
+Currently, when you click  Holds to pull from the Circulation menu, the only
+thing that you see is a white screen and a side navigation bar that says  Refine
+Results .
+
+Since there appears to be no results to refine, the holds to pull list appears
+completely empty. Staff have to know to click  Submit on the Refine Results 
+form to get anything.
+
+This patch set the run_report  flag to ON for the initial load. The
+report uses the default 2 days mentioned in the Refine Results form, so there
+is continuity across the board.
+       8585    Add System Preference to specify Holds to Pull List Start Date
+When you are on the  Holds to Pull  page in the Circulation module, the
+default Start Date  in the  Refine Results  section is 2 days in the past.
+
+This patch introduce a system preference that changes the number of days to
+however many the librarian chooses. If the system preference isn't set, the
+default of 2 days will continue to be used.
+
+I18N/L10N
+----------
+       8019    Preserve language choice between Browser sessions
+If I select a language in Staff client or Opac, I expect it to be
+persistent between browser sessions.
+
+This is not the case. Koha forgets the selection as soon as all Broser 
+instances are closed, and starts up the next session with the Browser's 
+preferred language.
+With this patch, the language choice is stored for up to 3 years from the last
+login.
+
+Installation and upgrade (command-line installer)
+----------
+       8485    Make koha_perl_deps.pl batch friendly
+This patch adds a switch to the koha_perl_deps.pl script so it is more batch
+friendly. 
+The new parameter -B (for batch) make it output just the library name,
+preserving the other switches semantics.
+
+It is useful to do things like:
+
+for k in $(for i in $(./koha_perl_deps.pl -m -B   perl -pi -e 's/::/-/g'   tr
+'[A-Z]' '[a-z]')
+  do
+    echo lib$i-perl
+  done)
+do
+ apt-cache search $k
+done
+
+Label printing
+----------
+       7846    Get_batch_summary reimplements GROUP BY in perl code
+This patch does not add any feature, but improves by a factor 100 the 
+speed of Manage Batch for label printing screen 
+
+Lists
+----------
+       7788    Tiny problems with calling GetShelf
+This patch just cleans and removes some dead code:
+The first patch deals with two unused calls to GetShelf in
+opac/opac-downloadshelf.pl and virtualshelves/downloadshelf.pl.
+       7805    Exposing the new list permissions in opac and staff
+The next step after 7310: Exposing the new permissions to add and
+delete lists.
+
+Important note: The owner can always add, but needs perms to remove.
+
+MARC Authority data support
+----------
+       2060    Ability to import Authorities from Staff Client
+This patch adds a feature to import authority record files.
+The biblio records staging and importing into the catalog has been extended to handle 
+authorities.
+The matching rules have also be extended to handle authorities.
+       5910    Authorities : allow users to search on all auth types
+This patch adds a 'search all authorities types' feature for
+UNIMARC libraries.
+       7475    Option to overlay authorities
+Right now it is impossible to overlay existing records when importing new
+authority records. This patch adds a script that handles the following overlay
+options:
+    * Overlay (or discard) based on matching preferred headings (1xx in MARC21, 2xx
+in UNIMARC).
+    * Overlay (or discard) based on matching LCCNs (010 in MARC21).
+    * Overlay (or discard) based on matching control numbers (001 for both MARC21
+and UNIMARC).
+    * Overlay (or discard) based on matching an earlier form of the heading
+(4xx$w/2=[aeo] in MARC21, 4xx$5=a in UNIMARC).
+    * Select which record to keep based on the date last modified (003 in MARC21).
+
+This script enable libraries to keep their authority records up to date
+with the latest national authority files, without polluting the local authority
+file with numerous copies of authority records (every time they are updated).
+       8203    Should be possible to save individual authorities
+Right now there is no convenient way to save an individual authority
+record.
+This patch adds a Save button to the authority view in the staff client which
+allows records to be saved as MARC, MARCXML, and (at least for MARC21) MADS.
+       8207    Modify authority type frameworks to allow see also fields to link to thesauri
+Right now if you were to link a field in an authority to a thesaurus, it 
+will not work properly. The authority type frameworks require some adjustments 
+to allow see also headings to be linked to thesauri (such as adding subfield $9).
+
+       8332    Add relationships to auth_finder for authority links
+In addition to the work in bug 8207 that enables auth_finder use, it
+would be very useful when creating authorities to have the auth_finder plug-in
+automatically fill out the relationship information in $w (in MARC21).
+       8627    Fixing pipe values in MARC21 controlfield 008 of authorities
+In MARC21, within field 008 pipe values (i.e. character   ) were not 
+passed correctly in the plug-in script 
+value_builder/marc21_field_008_authorities.pl to the template, resulting 
+in replacement of these character positions.
+
+MARC Bibliographic data support
+----------
+       8138    Add 773$t field to xslt
+This patch adds MARC21 773$t field if exists to result list of both OPAC 
+and staff client.
+This require to have XSLT display activated 
+
+
+Notices
+----------
+       3461    Duplicate overdue email notices caused by message settings not being controled by CircControl in System Prerfrences
+trivial
+       4246    Koha support for Itiva Talking Tech phone notification service
+Implements support for Talking Tech I-tiva phone notification for 
+OVERDUE,  PREDUE and HOLD notifications.
+Overdues respect triggers as configured for the patron's branch.
+Predue and Holds notifications respect patron's messaging preference choices.
+A new column for phone notification is added if the 
+TalkingTechItivaPhoneNotification system preference is turned on.
+
+Record of phone messages being sent to patrons is added to the patron's
+Notices tab; notice of success or failure can be retrieved from I-tiva.
+
+See the TalkingTech.README for installation and set-up instructions.
+
+OPAC
+----------
+       3708    Add another customizable region to the OPAC: right sidebar
+This patch creates a new system preference, OpacNavRight, in
+which the librarian can add HTML which will appear on the OPAC
+main page under the login form. If the user is logged in the content
+will appear in place of the login form.
+       4255    Add item type to facet list
+Itemtype is added to the facet list
+       4460    Amazon's AssociateID tag not used in links so referred revenue lost
+Though Koha enables usage of Amazon's AssociateID tag in the enhanced content
+configuration, no code currently uses it when generating links to Amazon.  Thus
+if a person searching the catalog clicks on a link taking them to Amazon for a
+purchase, Amazon doesn't have the tag and cannot associate the account
+accordingly.  Thus, any possible revenue is lost.
+       6494    Opacmysummaryhtml on reading history
+The opacmysummaryhtml sytem preference is also shown on the reading history
+since it's pretty much a longer version of the my summary anyway.
+
+       6774    Optionally display barcode on OPAC detail page
+This patch optionally displays barcode on OPAC detail normal view 
+including in XSLT view
+       7153    Show Open Library as Search Target in "More Searches" in OPAC detail page
+This patch show Open Library as Search Target in  More Searches  in OPAC
+detail page.
+       7161    Open Library - Larger image, Read, borrow and checked-out status
+This patch modifies Open Library JavaScript to:
+  1. Use jscmd=data instead of default, this provides ebooks availability
+  information. This will allow us to display read/borrow/checkedout icons.
+  2. Show larger image in opac-detail page.
+  3. Show read/borrow/checked-out status in opac-detail page below the image
+       7398    Show number of holds on a title in the OPAC details
+Like on the staff client, it is now possible to show the number of holds
+currently on a title. This will allow patrons to know how long a wait is going
+to be without having to log into the OPAC.
+This patch adds a new system preference, OPACShowHoldsCount, that will
+control whether the total number of holds shown on the OPAC detail page or not.
+       7470    Babeltheque improvement and social networks links (like, +1,...)
+This patch make a new implementation of babeltheque in Koha, more 
+complete and better integrated (for the moment in community version,
+babeltheque is not configurable and hardcoded in opac-bottom.inc).
+There are 3 features in this one:
+  - adds social network information in search results.
+  - adds babeltheque data in opac-detail.
+  - adds social network links in opac-detail too (google+, twitter, mail ...)
+French article with screenshots:
+http://docmiop.wordpress.com/2012/01/18/quand-babeltheque-enrichit-koha/
+       7570    Add item availability status to cart
+For items in the cart (opac-basket.pl), only location and call no. are
+displayed, This patch adds the display of item availability status as well.
+       7959    Update OPAC suggestions interface to match lists
+The OPAC's suggestions list is similar to that of lists in that there is an
+action you can take directly (new suggestion) and an action you can take if
+items are selected (delete suggestion). The toolbar now match the one on
+lists in that the delete option should only be available if an item is selected.
+       7977    Add a "Quote-of-the-day" feature to the OPAC homepage
+This patch adds the option of displaying a select quote
+for the day on the OPAC homepage. It include the addition
+of a QOD editor in the tools section of the staff interface
+which allow the addition, editing, and deletion of quotes.
+A single system preference enable/disable the display of
+the QOD on the OPAC homepage. A new granular permission has
+also been added to control user access to the QOD editor tool.
+       7980    Group search results tag input with other actions
+If TagsInputOnList in enabled there was a 'new tag' form field displayed with
+each search result. This page changes this so that it behaves much like the
+tag link at the top of the search results where clicking the link displays
+the form field.
+
+The per-line add tag functionality is grouped with other  actions  (like
+ place hold,   add to cart,  etc). Clicking the link display the form and
+automatically move the focus to the entry field.
+       7991    Display in a holding summary tab information about serial record
+This patch displays in a holding summary tab informations about serial
+record.
+It is UNIMARC specific, and probably French-specific.
+
+It add the following fields: branch (955$9), holding summary (955$r) and
+call (930$a).
+
+which is information imported from SUDOC (French universities common
+catalog)
+
+example :
+http://catalogue.univ-aix-marseille.fr/cgi-bin/koha/opac-detail
+.pl?biblionumber=725747
+       8001    Add some styling to the tags to allow them to be distinctive
+This patch allows the title and the tag terms in the user's tag list 
+to be styled differently in order to make things prettier.
+       8205    Should be possible to hide unused authorities in OPAC
+For libraries which load complete authority files into their Koha installations,
+authority records which are not in use can overwhelm those that are in the
+ Browse subjects and authors  in the OPAC. This patch adds an OPACShowUnusedAuthorities
+system preference that can be set to 'off' so that the display can be limited to only
+those authorities referenced in the bibliographic database.
+       8206    Add additional search options to authority browser in OPAC
+The OPAC authority browser used to have several boxes for the different types of
+authority searches that are possible. This was confusing to users, and rather
+ugly. However, the additional options were useful for libraries with massive
+authority files. This patch adds a dropdown to the authority search page on the
+OPAC which can be easily hidden using CSS, but offers the option to choose
+whether to look in main entries, headings, or anywhere.
+       8210    Headings in OPAC bib details should link to authority record
+There should be a link to used authority records from the bibliographic
+details display. This is already done in 5888 for the  normal  display.
+       8263    Make OPAC stylesheet preferences more consistent
+This patch merge opaclayoutstylesheet and opacstylesheet that could
+just be one pref (just as opaccolorstylesheet already advertises).
+       8496    Show local cover images on lists view in OPAC
+This patch adds local cover images to lists in the OPAC.
+       8525    Highlight matches on details page
+After doing a search and going to the details page, it can sometimes be
+difficult to see exactly *why* a record was returned by a search. It would be
+very useful to highlight the matches on the details page in the same way we
+highlight them on the results page.
+       8597    New theme for the OPAC with a mobile view
+This patch adds a new theme for the OPAC which includes a mobile version.
+This patch adds the following system preferences:
+    * OpacMainUserBlockMobile- alternate content for MainUserBlock for mobile.
+    * OPACMobileUserCSS- custom CSS for mobile views only.
+    * OpacShowFiltersPulldownMobile- whether or not to show the index
+      dropdown on the mobile view.
+    * OpacShowLibrariesPulldownMobile- whether or not to show the library
+      dropdown on the mobile view.
+
+In order to activate the theme, change the opacthemes system preference to 
+'ccsr' and make sure that your opaccolorstylesheet is set to 'colors.css.'
+       8759    Add labels for library and sorting on OPAC advanced search
+We've had reports of patrons being confused by the lack of labels directly
+attached to the library and sorting pulldowns on the OPAC advanced search.
+With this patch, these pulldowns have explicit labels.
+
+Packaging
+----------
+       6684    Koha-remove should check the number of arguments it gets
+Currently, koha-remove does not check that at least one instancename was
+provided as an argument, so running it with arguments causes an Apache reload,
+which might come as a surprise.
+If no instancename is given as argument it print it's usage.
+
+
+Patrons
+----------
+       3374    Display patron attributes in the same format as other patron data
+Patrons' 'Additional attributes and identifiers' are displayed
+in the same format as other standard patron data: in a list of label/data
+pairs.
+       5742    Batch edit patrons
+This patch adds a batch patron edit tool that includes the
+patron attributes in it.
+An example use of this would be for school libraries
+that keep track of home rooms as an attribute - that changes each year and it
+would be great to be able to batch edit that.
+       7671    Add a real primary key "accountlinesid" in accountlines
+All selects in accountlines are 'WHERE borrowernumber = ? AND accountno=?' 
+Best practice is to have an id. This patch adds id as identifier and modifies calls 
+to accountlines to use it
+       7839    Enhancement: Show routing lists attached to patron in Patron record
+This patch adds a tab called Routing Lists to the Patron record between 
+Fines  and Circulation History.
+It lists all the subscription titles that the patron has routed to them. Each
+title has a link to the subscription record and a link to the edit window of the
+routing list.
+       7955    Statistics tab in patron module
+This patch adds a tab (in the patron module) with statistics (number
+of issues by item type,...)
+       8080    Login and password no longer pre-filled by the browser when creating a new patron
+When creating a new patron, if you have chosen to let your browser remember your
+login and password for you, the login and password fields will be pre-filled
+with them, leading to a system error 'the passwords entered do not match' 
+since the second password field was not filled.
+With this patch, these fields are always blank.
+       8130    Attach PDF files to a patron record
+This patch adds a feature that allows librarians to attach unlimited arbitrary
+files to a patron record.
+It can be used to store a PDF document with a patron record.
+       8431    Increase the borrower attribute field size from 64 characters to 255
+Some libraries like to store more verbose data in a borrower attribute
+field. The character limit has been upped from 64 to 255.
+
+Reports
+----------
+       7249    Report webservices
+This patch adds report webservice, with caching support, and public
+visibility setting.
+Each report can now be declared public and accessible (WARNING: without
+authentication) from OPAC.
+To improve performance, it's also possible to cache for up to 30 days 
+
+       7993    Saved report with hierarchies
+This patch introduces grouping and subgrouping for SQL reports.
+Libraries:
+  -  can create groups (no pre-defined grouping)
+  -  can move report from one hierarchy to another (modify)
+  -  have 2 levels of hierarchy (group and sub groups)
+
+This patch adds 2 authorized value lists:  REPORT_GROUP and REPORT_SUBGROUP.
+When you register or modify a report, you first choose a  group  (code) and 
+then a subgroup  (lib_opac which represent the link between both).
+
+Example:
+  REPORT_GROUP.
+    Code lib lib_opac.
+    CIRC Circulation PRT.
+    CIRC Circulation RET.
+    CAT Cataloging BIB.
+    CAT Cataloging EX.
+    CAT Cataloging AUT.
+    ...etc.
+
+  REPORT_SUBGROUP.
+    Code lib lib_OPAC.
+    PRT Check-outs CIRC.
+    RET Check-ins CIRC.
+    BIB Biblios BIB CAT.
+    EX Biblio EX CAT.
+    AUT Biblio AUT CAT.
+
+From Summary and Statistics  when saving the report, a proposal from the
+list of tabs (hierarchy) to classify the report as a topic of their choice.
+
+Other changes introduced by this patch:
+  * From .../cgi-bin/koha/reports/guided_reports.pl?phase= First show the 
+    top of hierarchies as tabs and then clicking on the opening of
+    the hierarchy. Reports are provided in a table with headers that are 
+    sortable.
+  * After you save the report there is now a link from this page 'Start the 
+    new report'.
+  * Columns are also sortable.
+       8256    Reports webservice should allow selection by name
+At the moment, reports cannot be selected from the reports webservice by name,
+only by report ID. This patch adds the feature to select a report by name.
+
+Searching
+----------
+       6566    Checking if DB records are properly indexed
+This patch adds a small script that checks that each record in the DB is
+properly indexed.
+
+parameters:
+\t-h this help screen
+\t-c confirm (without this parameter, you get the help screen
+\t-z insert a signal in zebraqueue to force indexing of non indexed biblios
+\t-s silent throw no warnings except for non indexed records. Otherwise throw a
+warn every 1000 biblios to show progress
+
+Syntax:
+\t./batchCheckNonIndexedBiblios.pl -h
+\t./batchCheckNonIndexedBiblios.pl -c
+
+       7286    Introduce rebuild_zebra_sliced.zsh to recursively rebuild zebra & be error proof
+
+
+
+       7401    Show shelving location facet instead of branch facet when only 1 branch configured
+If there is only one branch configured in Koha, it doesn't make any sense to put
+a limiter on branchcode in search results.  Having a limiter on shelving
+locations within that branch, though, would be very handy.
+       7417    Include alternate forms from authorities in bibliographic searches
+This patch enables the search on authorities see-from in biblio 
+searches. Although authority records include references from unused terms,
+at present Koha does not take advantage of them when searching bibliographic
+records. It would be very useful if Koha could (optionally) include all the
+see-from terms in bibliographic records for indexing purposes. In order
+to do this, it will be necessary to inject see-from headings into bib 
+records immediately before exporting them for indexing by Zebra (or solr,
+or any other indexing engine that Koha may use).
+The price for this feature, if you use it, is a much slower catalog
+indexing speed. (by a factor 2 or 3)
+       8211    Add "subject (broader)," "subject (narrower)," and "subject (related)" options for search
+With the addition of DOM indexing, it is now possible to do  exploded
+searches which search for records with broader, narrower, and other related
+headings by searching authorities for the specified term, then using
+authorities that match the specified criteria to do a more inclusive search
+for bib records.
+       8492    Restrict OpacSuppression to IP addresses outside of an IP range
+This enhancement extends the OpacSuppression feature with an optional IP address
+range within which results are _not_ suppressed.
+       8726    Did you mean? plugin for broader/narrower/related terms
+Building on the work in bug 8211, this patch add a  Did you mean? 
+plug-in which will suggest that users review broader, narrower, and related
+terms when they do subject searches, thus making the functionality usable
+to the general public.
+
+Serials
+----------
+       5357    Subscription search and displays
+This patch improve many ergonomic aspects of the serials module:
+  * The search page is improved and some fields are added to search on
+(issn, subscription number, library, internal note, callnumber).
+  * The subscription list result is modified. The pipe will be removed in case
+of a repeated title & issn (the title & issn are repeated).
+  * The internal note was not displayed on staff interface. It is now displayed in
+serial issues and in various places where it can be useful.
+  * An option has been added to limit subscription search by branch.
+       8432    Improvement of serials search results list
+This patch adds fields in the search result list : branch, callnumber 
+(in separate columns), history, expirydate, number of routing lists attached.
+
+SIP2
+----------
+       8216    Enable critic tests on SIP modules
+SIP modules continued to issue a number of perlcritic warnings. 
+This patch adds C4/SIP to the testcritic directories and addresses those 
+issues which are warnings (mainly return undef and subroutine prototypes)
+It also removes some dead code that was no longer used.
+       8271    Teach SIPServer to set its own lib path
+Teach SIPServer.pm to set its own lib path. SIPServer.pm requires that
+C4/SIP 
+is added to its lib path This has been done by passing this directory
+to it via -I. By using FindBin it can set the path for itself correctly. 
+This will also work if the C4/SIP directory tree is moved to a 
+non-standard location This patch also remove the now redundant -I. from
+sip_run.sh.
+
+Staff Client
+----------
+       7949    A different favicon for the staff client
+At the moment the favicon used in the staff client is the same as the one for
+the OPAC. A different one would make it more legible when having both opened in
+various tabs.
+
+System Administration
+----------
+       8083    Granular parameters permissions
+This patch introduce 'manage_circ_rules' and
+'parameters_remaining_permissions' parameters subpermissions.
+
+Add  GranularParametersPermissions  boolean system preference, No default. If set to yes
+use aforementioned subpermissions in admin/* functions, otherwise just use
+parameters flag
+       8412    Add color icon set
+This patch adds coloring images to ccodes.
+The goalis to make it so that libraries can use one of the authorized
+values (shelving location or collection code) to store the color of the material
+and then make that searchable on the advanced search page.
+To do this for collection codes you'd need to add the following jqueries:
+intranetuserjs
+  $(document).ready(function(){
+    $( #advsearch-tab-ccode a:contains('Collection') ).text( Color );
+    $( #holdings th:contains('Collection') ).text( Color );
+  });
+opacuserjs
+  $(document).ready(function(){
+    $( #advsearch-tab-ccode a:contains('Collection') ).text( Color );
+    $('#item_ccode').text( Color );
+  });
+And update the frameworks to change the 952$8 label to say Color.
+This patch just has images, no code.
+
+Templates
+----------
+       2930    Put 'other name' on checkout screen
+Put 'other name' on checkout screen
+
+This patch adds 'other name' to the include which is used
+to display patron names and adds this include in several
+places where it can be used in place of direct output.
+
+The patron-title include has been modified to handle the
+two possible variable scopes throughout patron-related
+templates. This is a hack similar to having both
+circ-menu.tt and circ-menu.inc, but keeping both in the
+same file.
+
+Changes to some scripts were necessary to make the
+othernames variable available to the include.
+
+This patch also corrects some title tags and fixes
+some incorrect capitalization (see Bug 2780).
+       5184    Upgrade jQuery to the latest version
+This patch updates JQuery library to version 1.7.2
+       5345    DataTables in Koha
+Table sorter & filters have been added everywhere in Koha
+We avoid adding sorters & filters where perf is a caveat (like circulation)
+       6689    Improve styling of table pager
+This patch change the style of the pager which has been added to some
+tables sorted by the jQuery tablesorter. 
+       7747    Replace YUI autocomplete with jQueryUI
+This patch introduce jQueryUI in Koha, widget autocomplete.
+       7905    Multi-line notes are displayed on one line in Staff Serials page
+In Serials, on the summary of a subscription, four different notes
+(nonpublic note, public note, and 2 notes for history) are displayed in
+one line for each. But when we edit the subscription, it's possible
+(and tempting) to type the content on several lines.
+
+This patch try to display these notes on several lines in an elegant way (not so
+easy because the layout seems to be optimized for one-line informations).
+       7926    Acq search results show empty parenthesis for orders without basket group
+Search results in acquisitions show a column for basket group with  name of
+basket group (basket group number)  that will only be () when there is no basket
+group for an order line.
+       8107    Disabled buttons not distinguishable from enabled buttons.
+Disabled buttons in Koha appear no different than enabled buttons. This
+patch adds some CSS in Koha to make disabled buttons distinguishable from 
+enabled ones.
+       8143    Upgrade jQuery tabs to current jQueryUI version
+We use a very old version of jQuery tabs in many places. Each instance 
+should be updated to work with the latest jQueryUI.
+
+
+       8181    Replace DynArch calendar widget with jQueryUI version
+Currently Koha uses a JavaScript calendar plug-in from
+http://www.dynarch.com/projects/calendar/old/.
+This older version of the plug-in is open source but is now unmaintained and
+the newer version is not open source. This plug-in has been replaced by the
+jQueryUI datepicker widget:
+  http://jqueryui.com/demos/datepicker/
+       8283    Replace usage of YUI Cookie utility with jQuery Cookie plugin
+This patch continues the work to eliminate usage of YUI by using jQuery
+Cookie plug-in instead of YUI Cookie..
+       8319    Headings on statistics tab are confusing
+On the statistics tab on the patron record the table headings are
+confusing to the average library staff member.  This patch change the language
+to something a bit clearer.
+       8405    Add IntranetBiblioDefaultView and BiblioDefaultView to XSLT.pm
+When displaying the result lists with XSLT, the link to the detailed
+bibliographic record was hard-coded to the default view (detail.pl or opac-
+detail.pl) and there was no way to accommodate for the system preference value since it was
+not taken into account in XSLT.pm.
+This patch make the default view available in the XSLT.
+
+       8655    Re-order items on administration page to better match configuration priority
+This patch reorders the administration home page for a better usability:
+The administration home page says 'Configure these parameters in the order they
+appear', but cities and road types appear before circulation and fine rules.
+Circ rules have a higher priority.
+       8718    Normal catalog detail view in staff client doesn't show missing serials or subscription history note
+Normal catalog detail view in staff client doesn't show missing
+serials or subscription history note.
+This patch adds librariannote (staff subscription history note) and missing
+list to the normal catalog detail view in staff client.
+       8989    Availability facet needs an id
+Facets in search results (both in the staff interface and in the OPAC)
+have ids for CSS styling, except for the availability facet.
+
+This patch adds one, especially since this feature seems to have been
+broken for a while and this would allow us to hide it. 
+
+Test Suite
+----------
+       5327    Omnibus for unit tests required for all C4 modules
+The patches attached to this entry are related to unit tests developers
+run when a patch is added to Koha.
+       8353    Add test to compare system preferences in db to syspref.sql
+This patch adds a script, xt/check_sysprefs.t that check all the 
+system preferences in your system, and warn you if any system preferences
+are missing
+       8649    C4::Search needs a unit test
+This patch adds unit tests for searching
+       8728    T/db_dependent/Reserve.t test doesn't use resdate and expdate arguments for AddReserve
+The AddReserve routine had resdate and expdate added in between arguments (not
+appended) in 2009/2010ish so we need to adjust the t/db_dependent/Reserve.t accordingly.
+       8768    T/ItemType.t fails because DBD::Mock has no empty result set
+ItemType.t fails because the second test attempts to retrieve a non existent
+result set causing an error in DBI
+The intention of the test is that all returns 0 on an empty table so DBD::Mock
+should be populated with an empty result set otherwise the test suite fails
+
+
+
+Tools
+----------
+       7351    Ability to edit a range of holidays
+The new feature that allows you to enter a range of holidays did not let you
+edit the range. So if you have a long range of dates and you messed up you'd 
+have to edit them one by one. This patch adds a way to edit/delete a range of 
+dates.
+       7784    Improve clarity of batch modification operations
+In the batch item modification interfaces:
+
+ Checking the box right next the subfield label will disable the entry 
+and delete the values of that subfield on all selected items 
+
+It's more accurate to say  disable the entry and delete the contents of
+the subfield. Some enhancements:
+
+ - indicate this by emptying/resetting the field and adding a disabled
+attribute.
+ - append a note which says  The contents of this field will be deleted.
+
+It would also be helpful to add a note saying that leaving fields empty will
+make no changes to any records.
+       8202    Add authorities to export tool
+This patch adds the feature to export authorities in the export tool
+       8279    CAS Debugging improvements
+Adds more precise debug informations for easier CAS troubleshootings resolution.
+Before this patch, whenever ticket validation failed, the debug message was
+'Invalid ticket'.
+But ticket validation may fail for other reasons: CAS server not reachable,
+casServerUrl system preference is wrong...
+This patch adds the reason for ticket validation failing.
+
+
+Z39.50 / SRU / OpenSearch Servers
+----------
+       3087    Z39.50 server returns usmarc format records for UNIMARC DB
+When marcflavour is UNIMARC, Koha Z39.50 used to return biblio records 
+in UNIMARC format. But it also returned that biblio record format
+is 'usmarc'. There is an incompatibility. Z39.50 clients who interpret 
+this value won't display correctly biblio records.
+WARNING = All UNIMARC libraries must upgrade their zebra configuration and restart zebra,
+or searches will always return 0 results !!!
+Upgrading zebra is automatically done with 'make upgrade'. Libraries using git must go
+to the bugzilla entry to see what must be changed.
+       8570    Add pagination to the Z39.50 results page
+When doing Z39.50 searches, a maximum of 20 results are show even if 
+there are a lot more matching results returned by the server.
+This patch adds some pagination code to the Z39.50 results pages so all results
+returned by the Z39.50 server can be accessed.
+
+
+Critical bugs fixed in 3.10.0
+======================
+
+(this list include all bugfixes since the previous major version. Most of them have already been fixed in maintainance releases)
+
+
+Acquisitions
+----------
+       8247    blocker Adding basket doesn't save basket name, internal or vendor note
+       8495    blocker Javascript error when creating a new order
+       8903    blocker Can't receive any orders
+       8439    critical        Printing basketgroup does not work on plack
+       8637    critical        Lack of control on mandatory in orderreveive.tt
+       8832    critical        Can't enter a tax rate on vendor or when ordering
+       3969    major   Budget Search Doesn't Work
+       7112    major   Having two prices in 020$c causes basket creation to fail from staged marc import
+       7921    major   Software error while placing order
+       8201    major   Can't change receive date
+       8395    major   Order receive not sorting right
+
+Architecture, internals, and plumbing
+----------
+       8486    blocker Critical error in Koha::Calendar::days_between calculation
+       8842    blocker Plack and tools/holidays.pl
+       9064    blocker Statistics.ccode specified inconsistently
+       7119    critical        General code-cleaning, tidy/whitespace omnibus
+       7818    critical        Support DOM mode for Zebra indexing of bibliographic records
+       8636    critical        Some dependencies are not listed by the installer
+       8315    major   Fix 'C4::Output 3.02' errors in Koha
+       8384    major   Some Perl scripts do not compile
+       8463    major   Koha/SearchEngine/Solr/Search.pm fails perlcritic test
+       8892    major   Plack variable scoping in basket.pl
+       8997    major   Dead code in C4/Language causing useless SQL queries
+       9005    major   Changing sysprefs requires restart under Plack
+       9085    major   Installer will not run with DEBUG set
+
+Authentication
+----------
+       8919    critical        ExtendedPatronAttributes not populated from LDAP
+
+Browser compatibility
+----------
+       8414    major   Intranet header toplinks display white rather than blue in < IE8
+       8547    major   Enabling star ratings causes javascript errors that cause IE to have a boo boo
+
+Cataloging
+----------
+       8071    blocker Link beween bib and authorities with the authid
+       8818    blocker Authority linker error on Z cataloging
+       8447    critical        Can't save new records / indicator error
+       8576    critical        Software error on authority edition when using merge
+       8665    critical        DOM indexing fails to index some bib records
+       8829    critical        Can't import authorities
+       8860    critical        Can't merge if you don't have fast cataloging permissions
+       8503    major   Software error n edit items with EasyAnalyticalRecords
+
+Circulation
+----------
+       8154    blocker The export today's checked in barcodes generated file is always empty
+       8800    blocker SpecifyDueDate && useDaysMode=Datedue wrong behaviour
+       5644    critical        Dropbox mode doesn't set the correct date
+       8056    critical        CircAutoPrintQuickSlip set to clear doesn't work
+       8077    critical        Overdues with fines won't run
+       8251    critical        Patrons are systematically debarred at checkin
+       8253    critical        Fix fine doubling, when upgrading from 3.6 to 3.8 (or later)
+       8418    critical        Koha::Calendar is_holiday ignores all user data
+       8966    critical        Koha::Calendar::is_holiday truncates the date
+       6151    major   IndependantBranches and HomeOrHoldingBranchReturn can prevent items from being checked in
+       6976    major   User hold limit can be avoided by users in OPAC
+       8082    major   The:  IssuingInProcess  configuration setting is working in reverse.
+       8213    major   "Cancel All" button on holds over tab cancels both holds over and holds waiting
+       8420    major   Tool statisticfines.pl(bz 6858) and hourly loan(bz5549)
+       8656    major   Koha::Calendar not loading both sets of special dates
+       8738    major   DateTime object being compared to a date string in circulation
+       8939    major   Fines Charged During Grace Period
+
+Command-line Utilities
+----------
+       9001    critical        Zebraqueue_daemon is deprecated and must go
+
+Database
+----------
+       6428    blocker Refered column 'items.coded_location_qualifier' does not exist
+       9066    critical        VirtualShelves database access not Plack + MariaDB compatible
+       8182    major   Problem with overdue fine calculations after upgrade
+
+Documentation
+----------
+       7936    major   General ticket for help file updates
+       8945    major   Koha 3.10 Help Files Update
+
+Hold requests
+----------
+       7641    critical        Add ability to suspend reserves.
+       8448    major   Holds Awaiting Pickup : Cancelling a hold on a waiting item with multiple holds displays a blank screen instead of a warning prompt
+
+Installation and upgrade (command-line installer)
+----------
+       8135    critical        Services Directory and itemrecorddisplay.pl File Missing After Install
+       8289    critical        Upgrading from 2.2 does not work anymore
+       8780    major   Lower dependency version for DateTime::TimeZone
+       8784    major   Missing files in debian.packages list
+
+Installation and upgrade (web-based installer)
+----------
+       8159    critical        Error in kohastructure.sql
+       7984    major   Fix the upload_local_cover_images permission
+
+Label printing
+----------
+       8140    blocker Error when exporting label xml
+       8490    blocker Error when adding label layout under plack
+       8442    critical        Error when printing labels under plack
+
+Lists
+----------
+       8706    critical        Private lists can be accessed by anyone
+
+MARC Authority data support
+----------
+       8520    critical        Authorities display incorrectly in staff results
+       8743    critical        ZOOM error when merging authority change to biblios
+       8905    major   Error when accessing invalid authority
+
+MARC Bibliographic record staging/import
+----------
+       7329    critical        The "undo import into catalog" command deletes items onloan without checking
+
+Notices
+----------
+       8267    blocker Overdue notices not working
+       8607    blocker Overdue_notices is broken
+       7848    major   Issues data missing from circulation notices
+
+OPAC
+----------
+       5981    blocker OPAC: Add limits to search history
+       8381    blocker Paging broken in OPAC search results
+       8144    critical        775 tag in the MARC record causes display issue
+       8293    critical        Software error when clicking on first or last result of each page on OPAC
+       8953    critical        Opac-userupdate encoding issues
+       8095    major   Printed lists in the OPAC not easy to read
+       8145    major   Opac-tags.pl fails when DEBUG is set
+       8204    major   Authority viewer in OPAC ugly, unfriendly, and mostly useless
+       8513    major   OPAC detail page broken with XSLT
+       8572    major   Attempting to view an invalid authority in the OPAC gives an error instead of 404
+       8678    major   XSLT stylesheets output XML, but HTML is needed
+       8885    major   OPAC with ccsr theme in IE9
+
+Packaging
+----------
+       7589    blocker Tinymce editor broken in .deb packages - in 'en' templates
+       8890    blocker Packages can't be built on master, db dependent test
+       7924    critical        Fix handling of command line arguments in koha-remove
+       8162    critical        Packaging scripts create user incorrectly
+
+Patrons
+----------
+       9122    blocker Writing off fees broken
+       7068    major   Autobarcode not working when duplicating patrons
+       8057    major   Error when adding a patron with email address
+       8980    major   Untranslatable strings in modborrowers.pl
+
+Reports
+----------
+       8128    blocker Can't seem to run new sql reports
+       8072    critical        Reports wizard dies
+       8329    major   GetLostItems in C4::Items.pm has a SELECT *
+       8811    major   Can't run report after saving
+
+Searching
+----------
+       8172    major   Missing dereference marker for buildQuery parameter in addbooks.pl
+       8233    major   New search engine layer - introduce solr without breaking anything else
+       8805    major   Add a biblio-zebra-indexdefs.xsl for NORMARC
+       9050    major   Rebuild_zebra should use the adelete action so it doesn't fail when deleting a record not in the index
+
+SIP2
+----------
+       7619    blocker 3M self checkout don't work in France
+       8336    major   SIP Server does not process renewal transaction correctly
+
+Staff Client
+----------
+       9010    blocker Quote of the day: diacritics & other utf8 chars not displayed correctly
+       7998    critical        3.8 UI cleanup, tweaks to new styles
+       8379    critical        Encoding problem under Plack
+
+System Administration
+----------
+       8002    critical        Can't add patron attribute type in newer installation
+       8497    critical        Strange behavior when modifying the 'timeout' system preference.
+
+Templates
+----------
+       3652    critical        XSS vulnerabilities
+       8428    critical        Can't save contracts
+       8078    major   My summary showing contents of incorrect tab
+       8229    major   Tabs in marc subfield structure is not shown correctly
+       8356    major   Moveitem.tt and linkitem.tt have cataloging typo
+       8622    major   Koha themes broken
+       8644    major   JQueryUI CSS file should not contain customizations
+
+Test Suite
+----------
+       8846    blocker T/SuggestionEngine_ExplodedTerms.t sneakily uses database
+       9036    critical        00-load.t checks Koha::Cache::Memcached when it should not
+       9053    critical        Test::MockModule and DBD::Mock should be required
+       9054    critical        00-load should not try to load modules with optional dependencies
+       9039    major   Tests in the basic test suite should only test code based on required dependencies/modules
+
+Tools
+----------
+       8904    blocker Plack variable scoping in tools/overduerules
+       8035    critical        Bibs with comments show an error in opac
+       9046    critical        Items are not exported with the tools/export.pl
+       8707    major   Tags always say approved
+
+Z39.50 / SRU / OpenSearch Servers
+----------
+       8027    major   Wrong order for parameters in Z39.50 SQL INSERT
+
+
+Other bugs fixed in 3.10.0
+======================
+
+(this list include all bugfixes since the previous major version. Most of them have already been fixed in maintainance releases)
+
+
+About
+----------
+       8282    normal  Bug in modules list in about.pl
+       8910    minor   Silent warnings triggered in about.pl
+       7143    trivial Bug for tracking changes to the about page
+       8313    trivial Add ASHS to 'Koha team' page, for sponsorship of the 'star-ratings' feature
+
+Acquisitions
+----------
+       6394    normal  Purchase order has french hard coded in
+       7129    normal  Actual cost showing too many zeros
+       7178    normal  Improve order item creation
+       7604    normal  Link on basket group name for closed basket groups is broken
+       8152    normal  Clicking cancel on edit suggestion redirect to the suggestion detail
+       8184    normal  Duplicate budget page lacks heading and breadcrumbs
+       8224    normal  Aqplan.pl and aqbudgets: authorized values doesn't appear in planning list
+       8382    normal  It is not possible to cancel an order when receiving on a filtered page in parcel.pl
+       8575    normal  Number of items expected is wrong
+       8629    normal  Update of statistics fields on fund selection in order creation/edition
+       8659    normal  Inactive funds in neworderempty not disabled in IE/Opera
+       8680    normal  Z39.50 searches for ISBN/ISSN problematic in the Acquistions Module
+       8944    normal  Fix wording on invoice search
+       7990    minor   Bad html attribute into aqplan.tt : styl= insted of style=
+       8040    minor   A menu misnamed in budgets
+       8166    minor   Adding new currencies & exchange rates if not fill any field it save blank record
+       8183    minor   Acqui/parcels.pl plack scoping
+       8223    minor   Properly format SQL query in C4::Bookseller::GetBookSeller
+       8440    minor   Dates does not appear in suggestions management
+       8666    minor   Prevent to create baskets for inactive suppliers
+       8820    minor   Don't show orders table if there are no orders
+       8831    minor   Gstrate should say 'Tax rate'
+
+Architecture, internals, and plumbing
+----------
+       4321    normal  C4::Biblio::GetBiblio is badly coded
+       4330    normal  Copyright statements out of date
+       7299    normal  ILSDI HoldItem service does't set the itemnumber in reserves table
+       7379    normal  Copynumber is displayed 'as is' when linked to autorised values
+       7857    normal  Database upgrade fails with plack
+       7941    normal  Fix version numbers in modules and set up a system to keep them up to date
+       8311    normal  Mis-scoped function call in C4::Auth
+       8434    normal  Notice generation fails for Advanced Notices, Item Due, and Overdues when run in shell (due to error in Letters.pm)
+       8648    normal  SearchResults uses SQL query rather than GetMarcFromKohaField
+       8679    normal  Remove usage of Amazon API
+       8705    normal  Software error on help of main page
+       8804    normal  Quiet errors in the log from Auth.pm
+       8915    normal  Referential integrity constraints and InnoDB vs MyISAM storage engine
+       2553    minor   Alphabetize dropdown menus
+       6679    minor   Fixing code so it passes basic Perl::Critic tests
+       8017    minor   Remove unnecessary processing on return of GetAllIssues
+       8761    minor   Correct compile time warnings in C4::Circulation
+       4491    trivial Cleaning some weird code in *search.pl
+       8727    trivial Correct help text in rebuild_zebra_sliced.sh
+       8850    trivial Can't place hold on title with ILS-DI
+
+Authentication
+----------
+       7810    normal  C4/Auth.pm - on plack restart session is undefined
+       8787    minor   If OpacMaintenance is on the requested page is loaded
+
+Cataloging
+----------
+       2399    normal  All status fields in the item edit interface offer two blank/null entries per dropdown instead of one
+       3413    normal  Repeatable tickbox not sticking 1st time round
+       4198    normal  Deleting an authority refreshes the page
+       4838    normal  Repeated authority headings break biblio record data entry form
+       6939    normal  DefaultClassificationSource not used in 942$2
+       7961    normal  Local cover images should support CSV link files
+       8116    normal  Z3950 empty search causes silent warning in koha-error_log
+       8161    normal  Cataloging home page should be accessible to users with permission to edit catalog or edit items
+       8175    normal  Items.materials check logs error or displays incorrectly in details.pl
+       8180    normal  Cataloguing/additem.pl plack scoping
+       8386    normal  Error in duplicate detection message for authorities
+       8550    normal  Z39.50 searches for ISBN/ISSN problematic
+       8586    normal  Small bug in die if no mapping in framework for biblioitems.biblioitemnumber
+       8692    normal  Authorities search form does not correspond to current search query
+       8823    normal  CatalogModuleRelink Creates Multiple Links between Bib and Auth record  ($9 RLIN)
+       8862    normal  Merge.pl contains untranslatable strings
+       8191    minor   New value for 8 position in coded data field 100 in unimarc
+       8709    minor   Subfield 0 does not show in MARC detail in intranet
+
+Circulation
+----------
+       3387    normal  WITHDRAWN items shouldn't check in
+       6858    normal  Adds staticfines.pl for static fines processing
+       8005    normal  Lost item is not anonymized when checked in
+       8043    normal  Today's checkouts are in Previous checkouts in circulation.pl
+       8045    normal  Problems on Due date when checking in
+       8129    normal  Quick slips issuing does not work
+       8178    normal  Circ/circulation.pl under plack duplicates checkout rows
+       8275    normal  Xml parsing error when the webservice GetPatronInfo/show_loans is called
+       8370    normal  Default checkout, hold and return policy for all library => wrong term
+       8455    normal  Check ins processed through "Check Out" tab of the Patron Record ignore Circulation System Preferences
+       8498    normal  Can't specify an hour when specifying due date
+       8532    normal  Old/iffy data causes error checking out
+       8590    normal  Checked out from missing on patron detail
+       8640    normal  GetHardDueDate functions incorrectly
+       8675    normal  Renewing item to specified date creates a due date with HH:MM set to 00:00
+       8834    normal  Call to C4::Context::preference fails to pass $self in Circulation.pm
+       8841    normal  Duedates set by Returnbeforeexpiry lack HH:MM
+       8971    normal  Sort holds queue report using DataTables
+       8972    normal  Due Date set to 100 years ago.
+       7948    minor   Printing transfer slip loses barcode field focus
+       8006    minor   Loading offline circulation does not anonymize
+       8234    minor   Dates are not well sorted on Transfers to receive
+       8422    minor   Fix impossible warning in circulation.pl when OverduesBlockCirc set to Block
+       8569    minor   Paying for a lost item overwrites nonpublic notes
+       8826    minor   Initialization of hash triggers error log entries.
+       8772    trivial Uninitialized variable triggers error log entry in smart_rules.pl
+       8880    trivial Uninitialized variable triggers error log entry in circulation.pl
+
+Command-line Utilities
+----------
+       8844    normal  UNIMARC_sync_date_created_with_marc_biblio.pl creates a modification log
+       8741    minor   Crontab.example missing username, fails in some systems
+       6267    trivial Custom http user-agent in check-url.pl (fix for books.google.com 401 error)
+
+Database
+----------
+       6557    normal  Biblioitems.totalissues unused
+
+Documentation
+----------
+       8568    minor   Fix some errors in docs for scripts provided by the Debian packages
+       6350    trivial Bug for tracking updates to the history file
+       8670    trivial Update POD of C4::Branch::GetBranches() to use TT syntax
+       8961    trivial Typo in intranet-tmpl/prog/en/modules/help/offline_circ/list.tt
+
+Hold requests
+----------
+       7951    normal  Suspending holds needs a system preference
+       8419    normal  Suspended holds appear on the daily holds queue
+       8479    normal  Opac Holds being created with priority set to NULL
+       8700    normal  RESERVESLIP fields not being replaced correctly
+       7815    minor   Order pickup library list by name rather than by code
+
+Holidays
+----------
+       8110    normal  Add tests for Calendar modules
+       9078    normal  Is_holiday should honour holiday exceptions
+
+I18N/L10N
+----------
+       7943    normal  Untranslatable strings in OPAC's authority search
+       8633    normal  Translate script hardcoded to prog template
+       9018    normal  Po file for ccsr theme missing on translate.koha-community.org
+       6141    minor   Html glitches causing problems to translator
+       8062    minor   Cart email broken for non english templates
+       8872    minor   Improve encoding for xslt files, showmarc and opac-showmarc
+       9020    trivial Translate new permissions for 3.10
+
+Installation and upgrade (command-line installer)
+----------
+       7820    normal  Missing packages from install_misc/debian.packages
+       8724    normal  Upgrade from NoZebra installs is broken
+       8478    minor   Update Ubuntu related files
+       8742    trivial Example uses perl 5.8 in Makefile.PL
+       8749    trivial Missing Ubuntu library files in ubuntu.packages and ubuntu.12.04.packages
+
+Installation and upgrade (web-based installer)
+----------
+       5795    normal  Missing ReservesControlBranch system pref in database installer
+       9024    normal  Add additional sample data to German installer
+       9058    normal  Norwegian default for CalendarFirstDayOfWeek
+       9023    minor   Update installer txt files to have more accurate information
+       8222    trivial The zip code field is mandatory by default
+
+Label printing
+----------
+       7952    normal  PDF::Reuse under plack writes to console STDOUT instead to browser
+       8375    normal  Common diacritics not shown correctly when exporting batch label to PDF
+       8796    normal  Patron cards not starting on designated card
+
+Lists
+----------
+       1963    normal  Problem with deleted biblio in a virtual shelf
+       8719    normal  Private lists always sorted by title (even when author or date is selected)
+
+MARC Authority data support
+----------
+       6720    normal  Saved authorities always show as 'Default'
+       7455    normal  Authority subfields are cloned in the wrong field
+       7872    normal  C4::Items should use C4::Koha methods instead of duplicating SQL queries
+       8523    normal  Authority hierarchies only support UNIMARC
+       8581    normal  Authority display doesn't like GND records
+       8653    normal  With DOM indexing turned on subject authority links are not indexed
+       8744    normal  Thesaurus in authorities should not lock fields
+       8750    normal  Chronological terms authorities not correctly indexed
+       8870    normal  UNIMARC authorities search doesn't display properly information
+       8914    normal  Blank search that returns invalid authorities fails under Plack
+       9070    normal  Searching for authority from tag editor for field 650 gives error
+
+MARC Bibliographic data support
+----------
+       8136    normal  Changes the expected lenght of 100$a in rebuild_zebra.pl
+
+MARC Bibliographic record staging/import
+----------
+       8350    normal  Searching for a 10 or 13 digit string (with a number in it) that does not exist in one's catalog will fail to affect SQL statement correctly in C4::Breeding
+
+Notices
+----------
+       3383    normal  Item due reminder digests - cannot display title information
+       8606    normal  Talking Tech broken by user-configurable slips feature
+       6090    minor   Empty mails in message_queue are sent
+       8378    minor   <fine> syntax not working on overdues anymore
+       5490    trivial Is smsoverdues.pl an orphan
+
+OPAC
+----------
+       3280    normal  Opac/opac-sendbasket.pl security leaky
+       4064    normal  Uninitialized variable errors in opac-search.pl
+       4173    normal  Statuses not appearing in the OPAC
+       5409    normal  Call number is not show on Opac search result page.
+       7586    normal  Search: Language restriction does  NOT show expected results (no items shown)
+       7932    normal  Twitter share doesn't work with socialnetworks
+       8108    normal  Remove unused images from the OPAC
+       8197    normal  Software error when you have cleaned cookies in your browser and try to past the url to opac-topissues.pl
+       8226    normal  'OpacFooter' markup/css improvements
+       8255    normal  Local cover images should be cacheable
+       8617    normal  Problem with display of comments waiting for moderation in OPAC
+       8626    normal  Encoding problem with = in cart emails
+       8708    normal  RSS feed for new comments is broken
+       8791    normal  OPAC UNIMARC XSLT details : subject with subfield 3
+       8810    normal  Opac: Cart should display branchname instead of branchcode
+       8827    normal  YUI CSS files no longer found on Yahoo servers
+       8873    normal  JavaScript error in Opac displaying tag cloud
+       8923    normal  Add ids to repeated pagination menus to allow for CSS customization
+       8941    normal  Make title display properly for NORMARC OPAC detail view
+       8947    normal  Search does not work with CCSR theme and language = nb-NO
+       8973    normal  HTML and URL escape missing in OPAC templates
+       7500    minor   Use CSS Sprites for faster page loading
+       7642    minor   The number that appears when hovering over a tag in the tag cloud isn't the number of items with that tag
+       7873    minor   Title sort in OPAC basket doesn't work
+       7877    minor   Note on expiration in the opac worded wrongish
+       7929    minor   Duplicate id "availability" on XSLT result page
+       8139    minor   Fix the CSS for the recent comments to prevent leftmenu overlapping it.
+       8232    minor   Comments in OPAC contain untranslatable javascript messages
+       8272    minor   OPAC : date expiration format
+       8314    minor   Missing MARCISBNS param in opac-detail.pl
+       8322    minor   Removing space between end of marc data and fullstops
+       8335    minor   Missing Icon PR.png or typo in MARC21slim2OPACDetail.xsl
+       8357    minor   UNIMARCslim2OPACDetail.xsl, title without class and too links to views
+       8408    minor   Odd OPAC message when OPAC Renewals are disabled and OPACFineNoRenewals is set to blank
+       8441    minor   Hide MODS export for UNIMARC
+       8476    minor   Little bug in OPAC XSLT on OPACURLOpenInNewWindow
+       8936    minor   Search RSS  feeds does not show there items when subscribing in Firefox
+       8988    minor   Item status uses authorized value description for intranet
+       7367    trivial General OPAC typo omnibus
+       8323    trivial User created lists not sorting properly
+       8544    trivial Make RSS icon styleable
+
+Packaging
+----------
+       7968    normal  Create meta-packages to simplify installation of koha
+       8020    normal  Prepare debian packages for 3.8 release
+       8235    minor   Packaging scripts get upset with non-Debian perl modules
+       8982    minor   Koha-create rejects --database option
+       8008    trivial Fix typo in man page for koha-create
+
+Patrons
+----------
+       6634    normal  Manager_id not populated when paying fines
+       7411    normal  Remove diacritics when automatically generating userid
+       7628    normal  Required format is not enforced for Patron Categories
+       7643    normal  Can't upload and import zipped file of patron images
+       8025    normal  Patron attribute not selected if value is zero
+       8391    normal  Cannot view reading record through staff client
+       8514    normal  Display of patron results changed display order
+       8739    normal  Partial Fine Payments Saving Amount Paid Incorrectly
+       7630    minor   Warning on moremember.pl about param without key
+       8014    minor   On the patron entry form hide "restricted until" field if "Restricted: No" is checked
+       8150    minor   Patron circulation history has a fossil navagation bar
+       8196    minor   Members/memberentry.pl?op=add shows all extended attribute values from database
+       8392    minor   Memberentry is not enforcing birthdate restrictions
+       8427    minor   Patron search results not consistent
+       8533    minor   Non-numeric cardnumbers screw up autoMemberNum
+       8863    minor   When clearing a patron attribute, they are all cleared
+       8869    minor   Duplicate member check doesn't disable submit button on bottom.
+       8978    minor   Patron's dateexpiry is erroneously updated if dateexpiry in UnWantedField syspref
+
+Reports
+----------
+       8588    normal  Duplicate field IDs cause problems with SQL report parameter entry
+       8594    normal  A report containing a subquery that has a 'limit' will have that limit stripped out
+       8596    normal  Reports interface date picker doesn't force ISO formatted dates
+
+Searching
+----------
+       7722    normal  Insidious problem with searching
+       7847    normal  OPAC search dies with plack
+       8209    normal  "Did you mean?" suggestions based on authorities
+       8458    normal  $stemmed_operand in C4::Search _build_stemmed_operand is not initialized.
+       8657    normal  Default sort by call number does not work
+       8954    normal  Languages list in advanced search always in english
+       8958    normal  Facets are not fully UNIMARC compliant
+       6886    minor   Single branch mode should disable showing the branch name in front of all callnumbers
+       8041    minor   In admin search, items can be lost and  for loan
+       8217    minor   Focus on search box in Detail page (staff search)
+       8916    minor   Hide Curriculum index in advanced search for unimarc marcflavor
+       8012    trivial DefaultSortOrder and OPACdefaultSortOrder are set to "ascending" on install
+
+Self checkout
+----------
+       8111    normal  Language chooser display problem in self-checkout
+       8518    minor   Self checkout does not display debt amount if syspref AllowFineOverride is set to allow
+       7953    trivial Opacuserjs to the sco template
+
+Serials
+----------
+       8176    normal  $sqlwhere is undefined in C4::Serials in GetSubscriptions
+       8716    normal  Reordering of routing list entries doesn't work
+       3456    minor   Serials receipt note
+       8227    minor   Remove compile time warning from C4::Serials
+       6655    trivial Sorting order of serial issues in OPAC
+
+SIP2
+----------
+       3638    normal  Status of hold not changed when item checked in via SIP2 Interface
+       6335    normal  Branch not set consistently in all SIP transactions
+       7787    normal  SIP server closes the TCP connection when it receives an invalid message
+
+Staff Client
+----------
+       7599    normal  Cart JavaScript contains untranslatable English strings
+       8481    normal  Items table is showing in opac-MARCdetail.pl but not in MARCdetail.pl
+       8812    normal  Staff Client: Patron search should display branch name instead of branch code in results table
+       8949    normal  Trying to view help on a page without any help results in a Perl error
+       8996    normal  In result page items with negative notforloan are available
+       9017    normal  Quote of the day: Table footer not translated
+       5312    minor   XHTML correction in authority summary
+       8009    minor   Item descriptive data not populated on pay.pl
+       8593    minor   Add unique IDs to pending approval markup on staff client home page
+       8646    minor   Certain search terms cause browser "script taking too long" error
+       8793    minor   Fix materialTypeCode/typeOf008 icons for NORMARC XSLT
+       8895    minor   Warning in systempreferences.pl: Use of uninitialized value in length...
+       7368    trivial General staff client typo omnibus
+
+System Administration
+----------
+       4177    normal  Opaccloud missing from the system preferences interface
+       8702    normal  System preferences search does not allow accented letters
+       9107    normal  DidYouMeanFromAuthorities syspref obsolete
+       8119    minor   Show hint when disabling active currency checkbox
+       8122    minor   Add a link to new library group creation from empty groups message
+       8261    minor   Cannot search system preferences from Local Use tab
+       8907    minor   Last updated date does not appear on currency edit form
+       8713    trivial Warning message triggered by clicking keyword to marc mapping.
+       8714    trivial Poorly ordered and triggers warning in marctagstructure.pl
+       8849    trivial Error log generated when not a demo system
+
+Templates
+----------
+       6037    normal  Invalid markup, missing breadcrumbs on Keyword to MARC Mapping page
+       6617    normal  Table of contents not printing right if entered right
+       7127    normal  Templates must be valid XHTML
+       7842    normal  Inconsistencies in Notices interface
+       7982    normal  Typo in moremember-receipt.tt
+       8124    normal  Hide option to download results of items with no checkouts report
+       8160    normal  Link to cataloging appears for users without cataloging permission
+       8241    normal  Remove stray references to YUI autocomplete
+       8281    normal  Remove unused YUI files
+       8385    normal  Searchengine/solr/indexes.tt fails 'prove ./xt/tt_valid.t' test
+       8398    normal  Missing image file in staff global css
+       8522    normal  Markup errors cause problems with customized CSS
+       8549    normal  DataTables upgrade broke display of next/previous buttons in table controls
+       8573    normal  Translation difficult in picture-upload.tt due to nested sentence in if/foreach/if/elsif - construction
+       8598    normal  No patron image or home library on Files & Statistics tabs
+       8621    normal  Template for sending out carts not formatting correctly
+       8623    normal  Javascript libraries should be outside theme directories
+       8931    normal  Submit buttons have blue background
+       8934    normal  Fix typo and language on transport cost matrix
+       8975    normal  Search results should say on order in staff client
+       6855    minor   Bullet point showing in wrong place on error message
+       7483    minor   A more detailed breadcrumb for authority management
+       7690    minor   Hidelostitems not working in Normal Display
+       7889    minor   Use standard style for errors and messages
+       7987    minor   Typo causing invalid markup in circulation.tt
+       8048    minor   Better spacing on categories for attributes
+       8187    minor   Batch patron modification missing from tools sidebar menu
+       8194    minor   Layout problem on subscription add when showing manual history
+       8195    minor   The selected link in include menus must be bold
+       8288    minor   Showmarc.tt should not include full doc-head-close.inc
+       8318    minor   Update StatisticsFields description
+       8321    minor   Fix OPACShowBarcode description
+       8339    minor   Div id="login" should be id="login_controls" in header.inc
+       8351    minor   Fix wording when undoing an import
+       8556    minor   "Mark seen and continue" not translatable in inventory.tt
+       8624    minor   Famfamfam should be outside theme directory
+       8677    minor   Table overlapping to the right on holds waiting
+       8696    minor   Tools menu says export bibs still
+       8711    minor   Alternating colors messed up on reports
+       8717    minor   Wrong subscription notes are showing in catalogue detail view of serials in staff client
+       8721    minor   Typo in  AllowItemsOnHoldCheckout
+       8730    minor   Browse overlaying powered by
+       8737    minor   Incorrect icon at login in staff client
+       8765    minor   Add series title to intranet search results
+       8766    minor   OPACBaseURL still called as OPACBaseurl in many files
+       8851    minor   Strange blue bar above serials results
+       8898    minor   Remove unused mainmenu include and related styles in the staff client
+       8912    minor   Remove unused hold-menu.inc
+       8933    minor   Transport cost matrix capitalization wrong
+       8935    minor   Transport cost matrix could be prettier
+       3521    trivial Items table in catalogue/detail.pl and cataloguing/additem.pl is sorted nonsensically
+       8764    trivial Template change "Authors" to "Additional authors" in OPAC
+
+Test Suite
+----------
+       8022    normal  Permissions test doesn't check all languages
+       8383    normal  Need test to check that Perl files will compile
+       8413    normal  Space in barcode breaks GET request in benchmark_staff.pl
+       8470    minor   Remove  depreciated  H:T:P test file
+       7994    trivial Syntax error in yaml (syspref) files
+
+Tools
+----------
+       8843    normal  Cannot export bibliographic records by call number
+       6372    minor   Batch progress bar does not check for 0 size jobs; should be in separate js too
+       8861    minor   Undefined variables in batchMod.pl trigger error logs
+       8453    trivial Need spaces after radio buttons on inventory
+
+Transaction logs
+----------
+       7241    normal  Circulation action logs record biblionumber instead of item number
+
+translate.koha-community.org
+----------
+       8968    normal  JavaScript String not translatable
+
+Z39.50 / SRU / OpenSearch Servers
+----------
+       3782    normal  Delivered z39.50 targets wrong for NY Public Library and NY University Library
+       8171    normal  Improper escaping of quotes during z39.50 queries leads to broken html
+       8704    normal  Typo in etc/koha-conf.xml
+
+
+New sysprefs in 3.10.0
+======================
+
+  * autoBarcode
+  * BorrowerMandatoryField
+  * MaxFine
+  * OpacNavRight
+  * QuoteOfTheDay
+  * NoZebra
+  * defaultSortField
+  * defaultSortOrder
+  * OPACdefaultSortField
+  * OPACdefaultSortOrder
+  * itemBarcodeInputFilter
+  * OPACItemsResultsDisplay
+  * AllowReturnToBranch
+  * OPACShowHoldQueueDetails
+  * OPACSearchForTitleIn
+  * OPACMySummaryHTML
+  * UseTransportCostMatrix
+  * SvcMaxReportRows
+  * decreaseLoanHighHolds
+  * decreaseLoanHighHoldsValue
+  * decreaseLoanHighHoldsDuration
+  * ReservesControlBranch
+  * IssueLostItem
+  * SuspendHoldsIntranet
+  * SuspendHoldsOpac
+  * DefaultLanguageField008
+  * OPACShowBarcode
+  * OPACShowUnusedAuthorities
+  * EnableBorrowerFiles
+  * UpdateTotalIssuesOnCirc
+  * IntranetSlipPrinterJS
+  * OpacSuppressionByIPRange
+  * PrefillItem
+  * SubfieldsToUseWhenPrefill
+  * AgeRestrictionMarker
+  * AgeRestrictionOverride
+  * IncludeSeeFromInSearches
+  * OPACMobileUserCSS
+  * OpacMainUserBlockMobile
+  * OpacShowLibrariesPulldownMobile
+  * OpacShowFiltersPulldownMobile
+  * AuthDisplayHierarchy
+  * OPACdidyoumean
+  * INTRAdidyoumean
+  * BlockReturnOfWithdrawnItems
+  * HoldsToPullStartDate
+
+
+System requirements
+======================
+
+    Important notes:
+    
+    * Perl 5.10 is required
+    * Zebra is required
+
+
+Documentation
+======================
+
+The Koha manual is maintained in DocBook.The home page for Koha 
+documentation is 
+
+    http://koha-community.org/documentation/
+
+As of the date of these release notes, only the English version of the
+Koha manual is available:
+
+    http://manual.koha-community.org/3.10.0/en/
+
+The Git repository for the Koha manual can be found at
+
+    http://git.koha-community.org/gitweb/?p=kohadocs.git;a=summary
+
+
+Translations
+======================
+
+Complete or near-complete translations of the OPAC and staff
+interface are available in this release for the following languages:
+
+
+  * English (USA)
+  * Arabic (90%)
+  * Armenian (90%)
+  * Chinese (Taiwan) (69%)
+  * Danish (70%)
+  * English (New Zealand) (91%)
+  * French (100%)
+  * French (Canada) (69%)
+  * German (100%)
+  * German (Switzerland) (100%)
+  * Italian (100%)
+  * Norwegian Bokmål (66%)
+  * Portuguese (Brazil) (100%)
+  * Slovak (100%)
+  * Spanish (93%)
+
+
+Partial translations are available for various other languages.
+
+The Koha team welcomes additional translations; please see
+
+    http://wiki.koha-community.org/wiki/Translating_Koha
+
+for information about translating Koha, and join the koha-translate 
+list to volunteer:
+
+    http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-translate
+
+The most up-to-date translations can be found at:
+
+    http://translate.koha-community.org/
+
+
+Release Team
+======================
+
+The release team for Koha 3.10.0 is
+
+  Release Manager:       Paul Poulain <paul.poulain@biblibre.com>
+  Documentation Manager: Nicole C Engard <nengard@gmail.com>
+  Translation Manager:   Frédéric Demians <frederic@tamil.fr>
+  Translation Team:      Katrin Fischer <Katrin.Fischer@bsz-bw.de>,
+                         Marijana Glavica <mglavica@ffzg.hr>
+  QA Manager:            Ian Walls <koha.sekjal@gmail.com>
+  QA Team:               Marcel de Rooy <M.de.Rooy@rijksmuseum.nl>,
+                         Jonathan Druart <jonathan.druart@biblibre.com>,
+                         Mason James <mtj@kohaaloha.com>
+  Bug Wranglers:         Magnus Enger <magnus@enger.priv.no>,
+                         Katrin Fischer <Katrin.Fischer@bsz-bw.de>,
+                         Dobrica Pavlinušić <dpavlin@rot13.org>
+  Packaging Manager:     Robin Sheat <robin@catalyst.net.nz>
+  Packaging Assistant:   Mason James <mtj@kohaaloha.com>
+
+  Release Maintainer (3.4.x): Chris Nighswonger <cnighswonger@foundations.edu>
+  Release Maintainer (3.6.x): Jared Camins-Esakov <jcamins@cpbibliography.com>
+  Release Maintainer (3.8.x): Chris Cormack <chrisc@catalyst.net.nz>
+
+
+Credits
+======================
+
+We thank the following libraries who are known to have sponsored
+new features in Koha 3.10.0:
+  * BdP de la Meuse
+  * Brooklyn Law School Library
+  * Central Kansas Library System (CKLS), Plum Creek Library System and Washoe County Library System
+  * Centre collégial des services regroupés (CCSR)
+  * Corpus Christi Public Libraries
+  * Los Gatos Public Library and Harrison Carmel Public Library
+  * North Central Regional Library (NCRL)
+  * Northeast Kansas Library System (NEKLS)
+  * Talking Tech
+  * Universidad Nacional de Córdoba
+  * Université d'Aix-Marseille
+  * Université de Lyon 3
+  * Université de Rennes 2
+  * Université de St Etienne
+  * VOKAL
+  * Washoe County Library System
+
+We thank the following individuals who contributed patches to Koha 3.10.0.
+  *      1     Joseph Alway
+  *      2     Nuño López Ansótegui
+  *     13     Tomas Cohen Arazi
+  *      4     Alex Arnaud
+  *      1     Marc Balmer
+  *      5     D Ruth Bavousett
+  *      2     Gaetan Boisson
+  *      1     Ivan Brown
+  *    162     Jared Camins-Esakov
+  *     31     Colin Campbell
+  *      7     Frédérick Capovilla
+  *     14     Galen Charlton
+  *     14     David Cook
+  *     32     Chris Cormack
+  *      3     Christophe Croullebois
+  *      2     Elliott Davis
+  *      5     Stéphane Delaune
+  *     14     Frédéric Demians
+  *     77     Jonathan Druart
+  *     70     Nicole Engard
+  *     11     Magnus Enger
+  *     26     Katrin Fischer
+  *      6     Amit Gupta
+  *      5     Chris Hall
+  *     72     Kyle M Hall
+  *      2     Claire Hernandez
+  *     40     Mason James
+  *      9     Srdjan Jankovic
+  *      7     Bart Jorgensen
+  *      1     Jorgia Kelsey
+  *      1     Piotr Kowalski
+  *      1     Henri-Damien Laurent
+  *    102     Owen Leonard
+  *      1     Frère Sébastien Marie
+  *     29     Julian Maurice
+  *      1     Melia Meggs
+  *      6     Matthias Meusburger
+  *      4     Sophie Meynieux
+  *      1     Christopher Nighswonger
+  *     21     Chris Nighswonger
+  *     23     Dobrica Pavlinusic
+  *      3     Maxime Pelletier
+  *      3     Shari Perkins
+  *    306     Paul Poulain
+  *      6     Meenakshi R
+  *      5     MJ Ray
+  *      4     Liz Rea
+  *     26     Marcel de Rooy
+  *     34     Fridolyn SOMERS
+  *      3     Mathieu Saby
+  *     14     Adrien Saurat
+  *     19     Robin Sheat
+  *      1     Simon Story
+  *      1     Zeno Tajoli
+  *      8     Lyon3 Team
+  *      6     Mirko Tietgen
+  *     25     Mark Tompsett
+  *      2     Duncan Tyler
+  *      1     Kathryn Tyree
+  *     22     Marc Veron
+  *      1     Aleksa Vujicic
+  *      1     Stacey Walker
+  *      5     Ian Walls
+  *      1     Robert Williams
+  *      4     christophe croullebois
+  *      1     root
+  *      1     Savitra sirohi
+  *      1     Koha user
+  *      3     wajasu
+  *      1     Serhij Dubyk {Сергій Дубик}
+
+We thank the following companies who contributed patches to Koha 3.10.0
+  *     102 ACPL                                                                                          
+  *       1 Abbaye de La Trappe
+  *       1 Amigos Library Services
+  *      26 BSZ BW                                                                                         
+  *     491 BibLibre                                                                                    
+  *      10 BigBallOfWax                                                                          
+  *     151 ByWater-Solutions                                                                   
+  *     162 C & P Bibliography                                                                    
+  *      61 Catalyst                                                                                 
+  *       1 Cilea                                                                                           
+  *      14 Equinox                                                                                   
+  *      21 Foundations                                                                              
+  *      40 KohaAloha                                                                                  
+  *      10 Libeo                                                                                          
+  *      11 Libriotech                                                                                 
+  *       2 MASmedios                                                                                  
+  *      13 Nucsoft OSS Labs
+  *      31 PTFS-Europe                                                                              
+  *       1 Progilone
+  *      14 Prosentient Systems
+  *      26 Rijksmuseum                                                                               
+  *       5 Software.coop                                                                             
+  *      14 Tamil                                                                                           
+  *       7 Université Jean Moulin Lyon 3
+  *       3 Université Rennes 2
+  *       3 abunchofthings.net
+  *       3 gmx.de
+  *       1 littleover.derby.sch.uk
+  *       1 msys.ch
+  *       3 mypacks.net
+  *      23 rot13.org                                                                                      
+  *       1 ubuntu
+  *      62 unidentified
+  *      22 veron.ch
+
+We also especially thank the following individuals who tested patches
+for Koha 3.10.0.
+  *       1 Koha Team Lyon 3
+  *       1 Joseph Alway
+  *       1 Pierre Angot
+  *       9 Tomas Cohen Arazi
+  *       2 Alex Arnaud
+  *       1 Larry Baerveldt
+  *       1 Marc Balmer
+  *       5 Gaetan Boisson
+  *     256 Jared Camins-Esakov
+  *       1 Colin Campbell
+  *       1 François Charbonnier
+  *      16 Galen Charlton
+  *       2 David Cook
+  *     162 Chris Cormack
+  *       7 Elliott Davis
+  *       5 Michael Davis
+  *       1 Stéphane Delaune
+  *       2 Stephane Delaye
+  *       1 Stéphane Delaye
+  *      13 Frédéric Demians
+  *      87 Jonathan Druart
+  *      47 Nicole C. Engard
+  *       9 Magnus Enger
+  *      81 Katrin Fischer
+  *       2 Mathilde Formery
+  *       3 Marijana Glavica
+  *       1 Corinne HAYET
+  *     107 Kyle M Hall
+  *      27 Mason James
+  *      60 Owen Leonard
+  *       1 MathildeF
+  *      25 Julian Maurice
+  *      11 Melia Meggs
+  *       3 Matthias Meusburger
+  *       1 Sophie Meynieux
+  *       5 Joy Nelson
+  *       2 Chris Nighswonger
+  *      10 Dobrica Pavlinusic
+  *       6 Shari Perkins
+  *     687 Paul Poulain
+  *       2 MJ Ray
+  *      14 Liz Rea
+  *       9 Martin Renvoize
+  *      22 Marcel de Rooy
+  *       1 Fridolyn SOMERS
+  *       1 Adrien Saurat
+  *       7 Robin Sheat
+  *       6 Delaye Stephane
+  *       1 Zeno Tajoli
+  *      17 Mirko Tietgen
+  *      43 Marc Veron
+  *       2 Stacey Walker
+  *       9 Ian Walls
+  *       1 jmbroust
+  *       1 jorgia
+  *       3 mveron
+  *      20 wajasu
+
+We regret any omissions.  If a contributor has been inadvertently missed,
+please send a patch against these release notes to 
+koha-patches@lists.koha-community.org.
+
+
+Revision control notes
+======================
+
+The Koha project uses Git for version control.  The current development 
+version of Koha can be retrieved by checking out the master branch of 
+
+    git://git.koha-community.org/koha.git
+
+The branch for this version of Koha and future bugfixes in this release line is 3.10.x.
+
+
+Bugs and feature requests
+======================
+
+Bug reports and feature requests can be filed at the Koha bug
+tracker at
+
+    http://bugs.koha-community.org/
+
+
+He rau ringa e oti ai.
+(Many hands finish the work)
+
+##### Autogenerated release notes updated last on 23 nov. 2012 15:25:13 Z #####
diff --git a/misc/stage_biblios_file.pl b/misc/stage_biblios_file.pl
deleted file mode 100755 (executable)
index 6e2b30c..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-#!/usr/bin/perl
-
-# This file is part of Koha.
-#
-# Copyright (C) 2007 LibLime
-# Parts Copyright BSZ 2011
-#
-# 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 this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-use strict;
-use warnings;
-BEGIN {
-    # find Koha's Perl modules
-    # test carefully before changing this
-    use FindBin;
-    eval { require "$FindBin::Bin/kohalib.pl" };
-}
-
-use C4::Context;
-use C4::ImportBatch;
-use C4::Matcher;
-use Getopt::Long;
-
-$| = 1;
-
-# command-line parameters
-my $encoding = "";
-my $match_bibs = 0;
-my $add_items = 0;
-my $input_file = "";
-my $batch_comment = "";
-my $want_help = 0;
-my $no_replace ;
-
-my $result = GetOptions(
-    'encoding:s'    => \$encoding,
-    'file:s'        => \$input_file,
-    'match-bibs:s'  => \$match_bibs,
-    'add-items'     => \$add_items,
-    'no-replace'    => \$no_replace,
-    'comment:s'     => \$batch_comment,
-    'h|help'        => \$want_help
-);
-
-if ($encoding eq "") {
-    $encoding = "utf8";
-}
-
-if (not $result or $input_file eq "" or $want_help) {
-    print_usage();
-    exit 0;
-}
-
-unless (-r $input_file) {
-    die "$0: cannot open input file $input_file: $!\n";
-}
-
-my $dbh = C4::Context->dbh;
-$dbh->{AutoCommit} = 0;
-process_batch($input_file, $match_bibs, $add_items, $batch_comment);
-$dbh->commit();
-
-exit 0;
-
-sub process_batch {
-    my ($input_file, $match_bibs, $add_items, $batch_comment) = @_;
-
-    open IN, "<$input_file" or die "$0: cannot open input file $input_file: $!\n";
-    my $marc_records = "";
-    $/ = "\035";
-    my $num_input_records = 0;
-    while (<IN>) {
-        s/^\s+//;
-        s/\s+$//;
-        next unless $_; # skip if record has only whitespace, as might occur
-                        # if file includes newlines between each MARC record
-        $marc_records .= $_; # FIXME - this sort of string concatenation
-                             # is probably rather inefficient
-        $num_input_records++;
-    }
-    close IN;
-
-    print "... staging MARC records -- please wait\n";
-    my ($batch_id, $num_valid, $num_items, @import_errors) = 
-        BatchStageMarcRecords($encoding, $marc_records, $input_file, $batch_comment, '', $add_items, 0,
-                              100, \&print_progress_and_commit);
-    print "... finished staging MARC records\n";
-
-    my $num_with_matches = 0;
-    if ($match_bibs) {
-        my $matcher = C4::Matcher->fetch($match_bibs) ;
-        if (! defined $matcher) {
-            $matcher = C4::Matcher->new('biblio');
-            $matcher->add_simple_matchpoint('isbn', 1000, '020', 'a', -1, 0, '');
-            $matcher->add_simple_required_check('245', 'a', -1, 0, '', 
-                                            '245', 'a', -1, 0, '');
-        } else {
-            SetImportBatchMatcher($batch_id, $match_bibs);
-        }
-        # set default record overlay behavior
-        SetImportBatchOverlayAction($batch_id, ($no_replace) ? 'ignore' : 'replace');
-        SetImportBatchNoMatchAction($batch_id, 'create_new');
-        SetImportBatchItemAction($batch_id, 'always_add');
-        print "... looking for matches with records already in database\n";
-        $num_with_matches = BatchFindBibDuplicates($batch_id, $matcher, 10, 100, \&print_progress_and_commit);
-        print "... finished looking for matches\n";
-    }
-
-    my $num_invalid_bibs = scalar(@import_errors);
-    print <<_SUMMARY_;
-
-MARC record staging report
-------------------------------------
-Input file:              $input_file
-Number of input bibs:    $num_input_records
-Number of valid bibs:    $num_valid
-Number of invalid bibs:  $num_invalid_bibs
-_SUMMARY_
-    if ($match_bibs) {
-        print "Number of bibs matched:  $num_with_matches\n";
-    } else {
-        print "Incoming bibs not matched against existing bibs (--match-bibs option not supplied)\n";
-    }
-    if ($add_items) {
-        print "Number of items parsed:  $num_items\n";
-    } else {
-        print "No items parsed (--add-items option not supplied)\n";
-    }
-
-    print "\n";
-    print "Batch number assigned:  $batch_id\n";
-    print "\n";
-}
-
-sub print_progress_and_commit {
-    my $recs = shift;
-    $dbh->commit();
-    print "... processed $recs records\n";
-}
-
-sub print_usage {
-    print <<_USAGE_;
-$0: stage MARC bib file into reservoir.
-
-Use this batch job to load a file of MARC bibliographic records
-(with optional item information) into the Koha reservoir.
-
-After running this program to stage your file, you can use
-either the batch job commit_biblios_file.pl or the Koha
-Tools option "Manage Staged MARC Records" to load the
-records into the main Koha database.
-
-Parameters:
-    --file <file_name>      name of input MARC bib file
-    --encoding <encoding>   encoding of MARC records, default is utf8.
-                            Other possible options are: MARC-8,
-                            ISO_5426, ISO_6937, ISO_8859-1, EUC-KR
-    --match-bibs <match_id> use this option to match bibs
-                            in the file with bibs already in 
-                            the database for future overlay.
-                            If <match_id> isn't defined, a default 
-                            MARC21 ISBN & title match rule will be applied.
-    --add-items             use this option to specify that
-                            item data is embedded in the MARC
-                            bibs and should be parsed.
-    --no-replace            overlay action for bib record: default is to 
-                            replace extant bib with the imported record.
-    --comment <comment>     optional comment to describe
-                            the record batch; if the comment
-                            has spaces in it, surround the
-                            comment with quotation marks.
-    --help or -h            show this message.
-_USAGE_
-}
diff --git a/misc/stage_file.pl b/misc/stage_file.pl
new file mode 100755 (executable)
index 0000000..4ce16b5
--- /dev/null
@@ -0,0 +1,197 @@
+#!/usr/bin/perl
+
+# This file is part of Koha.
+#
+# Copyright (C) 2007 LibLime
+# Parts Copyright BSZ 2011
+# Parts Copyright C & P Bibliography Services 2012
+#
+# 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 this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+use strict;
+use warnings;
+BEGIN {
+    # find Koha's Perl modules
+    # test carefully before changing this
+    use FindBin;
+    eval { require "$FindBin::Bin/kohalib.pl" };
+}
+
+use C4::Context;
+use C4::ImportBatch;
+use C4::Matcher;
+use Getopt::Long;
+
+$| = 1;
+
+# command-line parameters
+my $record_type = "biblio";
+my $encoding = "";
+my $authorities = 0;
+my $match = 0;
+my $add_items = 0;
+my $input_file = "";
+my $batch_comment = "";
+my $want_help = 0;
+my $no_replace ;
+
+my $result = GetOptions(
+    'encoding:s'    => \$encoding,
+    'file:s'        => \$input_file,
+    'match|match-bibs:s'  => \$match,
+    'add-items'     => \$add_items,
+    'no-replace'    => \$no_replace,
+    'comment:s'     => \$batch_comment,
+    'authorities'   => \$authorities,
+    'h|help'        => \$want_help
+);
+
+$record_type = 'auth' if ($authorities);
+
+if ($encoding eq "") {
+    $encoding = "utf8";
+}
+
+if (not $result or $input_file eq "" or $want_help) {
+    print_usage();
+    exit 0;
+}
+
+unless (-r $input_file) {
+    die "$0: cannot open input file $input_file: $!\n";
+}
+
+my $dbh = C4::Context->dbh;
+$dbh->{AutoCommit} = 0;
+process_batch($input_file, $record_type, $match, $add_items, $batch_comment);
+$dbh->commit();
+
+exit 0;
+
+sub process_batch {
+    my ($input_file, $record_type, $match, $add_items, $batch_comment) = @_;
+
+    open IN, "<$input_file" or die "$0: cannot open input file $input_file: $!\n";
+    my $marc_records = "";
+    $/ = "\035";
+    my $num_input_records = 0;
+    while (<IN>) {
+        s/^\s+//;
+        s/\s+$//;
+        next unless $_; # skip if record has only whitespace, as might occur
+                        # if file includes newlines between each MARC record
+        $marc_records .= $_; # FIXME - this sort of string concatenation
+                             # is probably rather inefficient
+        $num_input_records++;
+    }
+    close IN;
+
+    print "... staging MARC records -- please wait\n";
+    my ($batch_id, $num_valid_records, $num_items, @import_errors) =
+        BatchStageMarcRecords($record_type, $encoding, $marc_records, $input_file, $batch_comment, '', $add_items, 0,
+                              100, \&print_progress_and_commit);
+    print "... finished staging MARC records\n";
+
+    my $num_with_matches = 0;
+    if ($match) {
+        my $matcher = C4::Matcher->fetch($match) ;
+        if (defined $matcher) {
+            SetImportBatchMatcher($batch_id, $match);
+        } elsif ($record_type eq 'biblio')  {
+            $matcher = C4::Matcher->new($record_type);
+            $matcher->add_simple_matchpoint('isbn', 1000, '020', 'a', -1, 0, '');
+            $matcher->add_simple_required_check('245', 'a', -1, 0, '',
+                                            '245', 'a', -1, 0, '');
+        }
+        # set default record overlay behavior
+        SetImportBatchOverlayAction($batch_id, ($no_replace) ? 'ignore' : 'replace');
+        SetImportBatchNoMatchAction($batch_id, 'create_new');
+        SetImportBatchItemAction($batch_id, 'always_add');
+        print "... looking for matches with records already in database\n";
+        $num_with_matches = BatchFindDuplicates($batch_id, $matcher, 10, 100, \&print_progress_and_commit);
+        print "... finished looking for matches\n";
+    }
+
+    my $num_invalid_records = scalar(@import_errors);
+    print <<_SUMMARY_;
+
+MARC record staging report
+------------------------------------
+Input file:                 $input_file
+Record type:                $record_type
+Number of input records:    $num_input_records
+Number of valid records:    $num_valid_records
+Number of invalid records:  $num_invalid_records
+_SUMMARY_
+    if ($match) {
+        print "Number of records matched:  $num_with_matches\n";
+    } else {
+        print "Incoming records not matched against existing records (--match option not supplied)\n";
+    }
+    if ($record_type eq 'biblio') {
+        if ($add_items) {
+            print "Number of items parsed:  $num_items\n";
+        } else {
+            print "No items parsed (--add-items option not supplied)\n";
+        }
+    }
+
+    print "\n";
+    print "Batch number assigned:  $batch_id\n";
+    print "\n";
+}
+
+sub print_progress_and_commit {
+    my $recs = shift;
+    $dbh->commit();
+    print "... processed $recs records\n";
+}
+
+sub print_usage {
+    print <<_USAGE_;
+$0: stage MARC file into reservoir.
+
+Use this batch job to load a file of MARC bibliographic
+(with optional item information) or authority records into
+the Koha reservoir.
+
+After running this program to stage your file, you can use
+either the batch job commit_file.pl or the Koha
+Tools option "Manage Staged MARC Records" to load the
+records into the main Koha database.
+
+Parameters:
+    --file <file_name>      name of input MARC bib file
+    --authorities           stage authority records instead of bibs
+    --encoding <encoding>   encoding of MARC records, default is utf8.
+                            Other possible options are: MARC-8,
+                            ISO_5426, ISO_6937, ISO_8859-1, EUC-KR
+    --match <match_id>      use this option to match records
+                            in the file with records already in
+                            the database for future overlay.
+                            If <match_id> isn't defined, a default
+                            MARC21 ISBN & title match rule will be applied
+                            for bib imports.
+    --add-items             use this option to specify that
+                            item data is embedded in the MARC
+                            bibs and should be parsed.
+    --no-replace            overlay action for record: default is to
+                            replace extant with the imported record.
+    --comment <comment>     optional comment to describe
+                            the record batch; if the comment
+                            has spaces in it, surround the
+                            comment with quotation marks.
+    --help or -h            show this message.
+_USAGE_
+}
index f9abda6..00daaf4 100644 (file)
@@ -17,8 +17,7 @@ package LangInstaller;
 # 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 Modern::Perl;
 
 use C4::Context;
 # WARNING: Any other tested YAML library fails to work properly in this
@@ -29,6 +28,7 @@ use FindBin qw( $Bin );
 
 $YAML::Syck::ImplicitTyping = 1;
 
+
 sub set_lang {
     my ($self, $lang) = @_;
 
@@ -63,21 +63,34 @@ sub new {
     # Get all available language codes
     opendir $fh, $self->{path_po};
     my @langs =  map { ($_) =~ /(.*)-i-opac/ } 
-        grep { $_ =~ /.*-opac-/ } readdir($fh);
+        grep { $_ =~ /.*-opac-t-prog/ } readdir($fh);
     closedir $fh;
     $self->{langs} = \@langs;
 
     # Map for both interfaces opac/intranet
-    $self->{interface} = {
-        opac => {
-            dir    => $context->config('opachtdocs') . '/prog',
+    my $opachtdocs = $context->config('opachtdocs');
+    $self->{interface} = [
+        {
+            name   => 'OPAC prog',
+            dir    => "$opachtdocs/prog",
             suffix => '-i-opac-t-prog-v-3006000.po',
         },
-        intranet => {
+        {
+            name   => 'Intranet prog',
             dir    => $context->config('intrahtdocs') . '/prog',
             suffix => '-i-staff-t-prog-v-3006000.po',
-        }
-    };
+        },
+    ];
+
+    # Alternate opac themes
+    opendir $fh, $context->config('opachtdocs');
+    for ( grep { not /^\.|\.\.|prog|lib$/ } readdir($fh) ) {
+        push @{$self->{interface}}, {
+            name   => "OPAC $_",
+            dir    => "$opachtdocs/$_",
+            suffix => "-opac-$_.po",
+        };
+    }
 
     bless $self, $class;
 }
@@ -211,7 +224,7 @@ sub save_po {
     my $self = shift;
     # Write .po entries into a file put in Koha standard po directory
     Locale::PO->save_file_fromhash( $self->po_filename, $self->{po} );
-    print "Saved in file: ", $self->po_filename, "\n" if $self->{verbose};
+    say "Saved in file: ", $self->po_filename if $self->{verbose};
 }
 
 
@@ -291,21 +304,21 @@ sub install_prefs {
 
 sub install_tmpl {
     my $self = shift;
-    print "Install templates\n" if $self->{verbose};
-    while ( my ($interface, $tmpl) = each %{$self->{interface}} ) {
+    say "Install templates" if $self->{verbose};
+    for my $trans ( @{$self->{interface}} ) {
         print
-            "  Install templates '$interface\n",
-            "    From: $tmpl->{dir}/en/\n",
-            "    To  : $tmpl->{dir}/$self->{lang}\n",
-            "    With: $self->{path_po}/$self->{lang}$tmpl->{suffix}\n"
+            "  Install templates '$trans->{name}'\n",
+            "    From: $trans->{dir}/en/\n",
+            "    To  : $trans->{dir}/$self->{lang}\n",
+            "    With: $self->{path_po}/$self->{lang}$trans->{suffix}\n"
                 if $self->{verbose};
-        my $lang_dir = "$tmpl->{dir}/$self->{lang}";
+        my $lang_dir = "$trans->{dir}/$self->{lang}";
         mkdir $lang_dir unless -d $lang_dir;
         system
             "$self->{process} install " .
-            "-i $tmpl->{dir}/en/ " .
-            "-o $tmpl->{dir}/$self->{lang} ".
-            "-s $self->{path_po}/$self->{lang}$tmpl->{suffix} -r"
+            "-i $trans->{dir}/en/ " .
+            "-o $trans->{dir}/$self->{lang} ".
+            "-s $self->{path_po}/$self->{lang}$trans->{suffix} -r"
     }
 }
 
@@ -313,19 +326,19 @@ sub install_tmpl {
 sub update_tmpl {
     my $self = shift;
 
-    print "Update templates\n" if $self->{verbose};
-    while ( my ($interface, $tmpl) = each %{$self->{interface}} ) {
+    say "Update templates" if $self->{verbose};
+    for my $trans ( @{$self->{interface}} ) {
         print
-            "  Update templates '$interface'\n",
-            "    From: $tmpl->{dir}/en/\n",
-            "    To  : $self->{path_po}/$self->{lang}$tmpl->{suffix}\n"
+            "  Update templates '$trans->{name}'\n",
+            "    From: $trans->{dir}/en/\n",
+            "    To  : $self->{path_po}/$self->{lang}$trans->{suffix}\n"
                 if $self->{verbose};
-        my $lang_dir = "$tmpl->{dir}/$self->{lang}";
+        my $lang_dir = "$trans->{dir}/$self->{lang}";
         mkdir $lang_dir unless -d $lang_dir;
         system
             "$self->{process} update " .
-            "-i $tmpl->{dir}/en/ " .
-            "-s $self->{path_po}/$self->{lang}$tmpl->{suffix} -r"
+            "-i $trans->{dir}/en/ " .
+            "-s $self->{path_po}/$self->{lang}$trans->{suffix} -r"
     }
 }
 
@@ -333,6 +346,10 @@ sub update_tmpl {
 sub create_prefs {
     my $self = shift;
 
+    if ( -e $self->po_filename ) {
+        say "Preferences .po file already exists. Delete it if you want to recreate it.";
+        return;
+    }
     $self->get_po_from_prefs();
     $self->save_po();
 }
@@ -341,17 +358,17 @@ sub create_prefs {
 sub create_tmpl {
     my $self = shift;
 
-    print "Create templates\n" if $self->{verbose};
-    while ( my ($interface, $tmpl) = each %{$self->{interface}} ) {
+    say "Create templates\n" if $self->{verbose};
+    for my $trans ( @{$self->{interface}} ) {
         print
-            "  Create templates .po files for '$interface'\n",
-            "    From: $tmpl->{dir}/en/\n",
-            "    To  : $self->{path_po}/$self->{lang}$tmpl->{suffix}\n"
+            "  Create templates .po files for '$trans->{name}'\n",
+            "    From: $trans->{dir}/en/\n",
+            "    To  : $self->{path_po}/$self->{lang}$trans->{suffix}\n"
                 if $self->{verbose};
         system
             "$self->{process} create " .
-            "-i $tmpl->{dir}/en/ " .
-            "-s $self->{path_po}/$self->{lang}$tmpl->{suffix} -r"
+            "-i $trans->{dir}/en/ " .
+            "-s $self->{path_po}/$self->{lang}$trans->{suffix} -r"
     }
 }
 
index 773ed51..be62879 100755 (executable)
@@ -67,6 +67,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
 );
 
 my $biblionumber = $query->param('biblionumber');
+$biblionumber = int($biblionumber);
 
 # get biblionumbers stored in the cart
 my @cart_list;
index 2d9dc25..ac13a9d 100755 (executable)
@@ -61,6 +61,7 @@ my $biblionumber = $query->param('biblionumber');
 my $itemtype     = &GetFrameworkCode($biblionumber);
 my $tagslib      = &GetMarcStructure( 0, $itemtype );
 my $biblio = GetBiblioData($biblionumber);
+$biblionumber = $biblio->{biblionumber};
 my $record = GetMarcBiblio($biblionumber, 1);
 if ( ! $record ) {
     print $query->redirect("/cgi-bin/koha/errors/404.pl");
index 5656228..115012e 100755 (executable)
@@ -90,7 +90,13 @@ if ( $op eq "do_search" ) {
         $displaynext = 1;
     }
 
-    my @field_data = ( { term => "marclist" , val => $query->param("marclist") || ''} );
+    my @field_data = (
+        { term => "marclist",  val => $marclist[0] },
+        { term => "and_or",    val => $and_or[0] },
+        { term => "excluding", val => $excluding[0] },
+        { term => "operator",  val => $operator[0] },
+        { term => "value",     val => $value[0] },
+    );
 
     my @numbers = ();
 
index 4a4e382..3e17cf1 100755 (executable)
@@ -66,7 +66,8 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     }
 );
 
-my $authid       = $query->param('authid');
+my $authid = $query->param('authid');
+$authid = int($authid);
 my $record = GetAuthority( $authid );
 if ( ! $record ) {
     print $query->redirect("/cgi-bin/koha/errors/404.pl"); # escape early
@@ -76,28 +77,10 @@ if ( ! $record ) {
 my $authtypecode = &GetAuthTypeCode( $authid );
 
 if ($display_hierarchy){
-  my $trees=BuildUnimarcHierarchies($authid);
-  my @trees = split /;/,$trees ;
-  push @trees,$trees unless (@trees);
-  my @loophierarchies;
-  foreach my $tree (@trees){
-    my @tree=split /,/,$tree;
-    push @tree,$tree unless (@tree);
-    my $cnt=0;
-    my @loophierarchy;
-    foreach my $element (@tree){
-      my $cell;
-      my $elementdata = GetAuthority($element);
-      push @loophierarchy, BuildUnimarcHierarchy($elementdata,"child".$cnt, $authid);
-      $cnt++;
-    }
-    push @loophierarchies, { 'loopelement' =>\@loophierarchy};
-  }
-  $template->param(
-    'displayhierarchy' => $display_hierarchy,
-    'loophierarchies' =>\@loophierarchies,
-  );
+    $template->{VARS}->{'displayhierarchy'} = $display_hierarchy;
+    $template->{VARS}->{'loophierarchies'} = GenerateHierarchy($authid);
 }
+
 my $count = CountUsage($authid);
 
 
@@ -139,7 +122,7 @@ if ($show_marc) {
         my @subfields_data;
 
 # skip UNIMARC fields <200, they are useless for a patron
-        next if C4::Context->preference('MarcFlavour') eq 'UNIMARC' && $field->tag() <200;
+        next if C4::Context->preference('marcflavour') eq 'UNIMARC' && $field->tag() <200;
 
 # if tag <10, there's no subfield, use the "@" trick
         if ( $field->tag() < 10 ) {
@@ -151,6 +134,9 @@ if ($show_marc) {
             $subfield_data{marc_tag}      = $field->tag();
             push( @subfields_data, \%subfield_data );
         }
+        elsif ( C4::Context->preference('marcflavour') eq 'MARC21' && $field->tag() eq 667 ) {
+            # tagfield 667 is a nonpublic general note in MARC21, which shouldn't be shown in the OPAC
+        }
         else {
             my @subf = $field->subfields;
 
@@ -188,4 +174,3 @@ if ($show_marc) {
 }
 
 output_html_with_http_headers $query, $cookie, $template->output;
-
index cdb4a5a..5e432e1 100755 (executable)
@@ -69,6 +69,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
 );
 
 my $biblionumber = $query->param('biblionumber') || $query->param('bib');
+$biblionumber = int($biblionumber);
 
 my $record       = GetMarcBiblio($biblionumber);
 if ( ! $record ) {
@@ -470,6 +471,8 @@ foreach my $subscription (@subscriptions) {
     $cell{branchcode}        = $subscription->{branchcode};
     $cell{branchname}        = GetBranchName($subscription->{branchcode});
     $cell{hasalert}          = $subscription->{hasalert};
+    $cell{callnumber}        = $subscription->{callnumber};
+    $cell{closed}            = $subscription->{closed};
     #get the three latest serials.
     $serials_to_display = $subscription->{opacdisplaycount};
     $serials_to_display = C4::Context->preference('OPACSerialIssueDisplayCount') unless $serials_to_display;
index fb8dee7..002c88e 100755 (executable)
@@ -32,6 +32,7 @@ my $query = new CGI;
 my $op=$query->param("op")||''; #op=export is currently the only use
 my $format=$query->param("format")||'utf8';
 my $biblionumber = $query->param("bib")||0;
+$biblionumber = int($biblionumber);
 my ($marc, $error)= ('','');
 
 $marc = GetMarcBiblio($biblionumber, 1) if $biblionumber;
@@ -41,18 +42,23 @@ if(!$marc) {
 }
 elsif ($format =~ /endnote/) {
     $marc = marc2endnote($marc);
+    $format = 'endnote';
 }
 elsif ($format =~ /marcxml/) {
     $marc = marc2marcxml($marc);
+    $format = 'marcxml';
 }
 elsif ($format=~ /mods/) {
     $marc = marc2modsxml($marc);
+    $format = 'mods';
 }
 elsif ($format =~ /ris/) {
     $marc = marc2ris($marc);
+    $format = 'ris';
 }
 elsif ($format =~ /bibtex/) {
     $marc = marc2bibtex(C4::Biblio::GetMarcBiblio($biblionumber),$biblionumber);
+    $format = 'bibtex';
 }
 elsif ($format =~ /dc/) {
     ($error,$marc) = marc2dcxml($marc,1);
@@ -61,14 +67,17 @@ elsif ($format =~ /dc/) {
 elsif ($format =~ /marc8/) {
     ($error,$marc) = changeEncoding($marc,"MARC","MARC21","MARC-8");
     $marc = $marc->as_usmarc() unless $error;
+    $format = 'marc8';
 }
 elsif ($format =~ /utf8/) {
     C4::Charset::SetUTF8Flag($marc,1);
     $marc = $marc->as_usmarc();
+    $format = 'utf8';
 }
 elsif ($format =~ /marcstd/) {
     C4::Charset::SetUTF8Flag($marc,1);
     ($error,$marc) = marc2marc($marc, 'marcstd', C4::Context->preference('marcflavour'));
+    $format = 'marcstd';
 }
 else {
     $error= "Format $format is not supported.";
@@ -78,7 +87,7 @@ if ($error){
     print $query->header();
     print $query->start_html();
     print "<h1>An error occurred </h1>";
-    print $error;
+    print $query->escapeHTML("$error");
     print $query->end_html();
 }
 else {
index a52d40a..19425f7 100755 (executable)
@@ -46,57 +46,58 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
 
 # get borrower information ....
 my ( $borr ) = GetMemberDetails( $borrowernumber );
-my $sth =  $dbh->prepare("UPDATE borrowers SET password = ? WHERE borrowernumber=?");
 my $minpasslen = C4::Context->preference("minPasswordLength");
-if (   $query->param('Oldkey')
-    && $query->param('Newkey')
-    && $query->param('Confirm') )
-{
-    if ( goodkey( $dbh, $borrowernumber, $query->param('Oldkey') ) ) {
-        if ( $query->param('Newkey') eq $query->param('Confirm')
-            && length( $query->param('Confirm') ) >= $minpasslen )
-        {    # Record password
-            my $clave = md5_base64( $query->param('Newkey') );
-            $sth->execute( $clave, $borrowernumber );
-            $template->param( 'password_updated' => '1' );
-            $template->param( 'borrowernumber'   => $borrowernumber );
+if ( C4::Context->preference("OpacPasswordChange") ) {
+    my $sth =  $dbh->prepare("UPDATE borrowers SET password = ? WHERE borrowernumber=?");
+    if (   $query->param('Oldkey')
+        && $query->param('Newkey')
+        && $query->param('Confirm') )
+    {
+        if ( goodkey( $dbh, $borrowernumber, $query->param('Oldkey') ) ) {
+            if ( $query->param('Newkey') eq $query->param('Confirm')
+                && length( $query->param('Confirm') ) >= $minpasslen )
+            {    # Record password
+                my $clave = md5_base64( $query->param('Newkey') );
+                $sth->execute( $clave, $borrowernumber );
+                $template->param( 'password_updated' => '1' );
+                $template->param( 'borrowernumber'   => $borrowernumber );
+            }
+            elsif ( $query->param('Newkey') ne $query->param('Confirm') ) {
+                $template->param( 'Ask_data'       => '1' );
+                $template->param( 'Error_messages' => '1' );
+                $template->param( 'PassMismatch'   => '1' );
+            }
+            elsif ( length( $query->param('Confirm') ) < $minpasslen ) {
+                $template->param( 'Ask_data'       => '1' );
+                $template->param( 'Error_messages' => '1' );
+                $template->param( 'ShortPass'      => '1' );
+            }
+            else {
+                $template->param( 'Error_messages' => '1' );
+            }
         }
-        elsif ( $query->param('Newkey') ne $query->param('Confirm') ) {
+        else {
             $template->param( 'Ask_data'       => '1' );
             $template->param( 'Error_messages' => '1' );
-            $template->param( 'PassMismatch'   => '1' );
+            $template->param( 'WrongPass'      => '1' );
         }
-        elsif ( length( $query->param('Confirm') ) < $minpasslen ) {
-            $template->param( 'Ask_data'       => '1' );
+    }
+    else {
+
+        # Called Empty, Ask for data.
+        $template->param( 'Ask_data' => '1' );
+        if (!$query->param('Oldkey') && ($query->param('Newkey') || $query->param('Confirm'))){
+            # Old password is empty but one of the others isnt
             $template->param( 'Error_messages' => '1' );
-            $template->param( 'ShortPass'      => '1' );
+            $template->param( 'WrongPass'      => '1' );
         }
-        else {
+        elsif ($query->param('Oldkey') && (!$query->param('Newkey') || !$query->param('Confirm'))){
+            # Oldpassword is entered but one of the other fields is empty
             $template->param( 'Error_messages' => '1' );
+            $template->param( 'PassMismatch'   => '1' );
         }
     }
-    else {
-        $template->param( 'Ask_data'       => '1' );
-        $template->param( 'Error_messages' => '1' );
-        $template->param( 'WrongPass'      => '1' );
-    }
-}
-else {
-   
-    # Called Empty, Ask for data.
-    $template->param( 'Ask_data' => '1' );
-       if (!$query->param('Oldkey') && ($query->param('Newkey') || $query->param('Confirm'))){
-               # Old password is empty but one of the others isnt
-               $template->param( 'Error_messages' => '1' );
-               $template->param( 'WrongPass'      => '1' );
-       }
-       elsif ($query->param('Oldkey') && (!$query->param('Newkey') || !$query->param('Confirm'))){
-               # Oldpassword is entered but one of the other fields is empty
-               $template->param( 'Error_messages' => '1' );
-               $template->param( 'PassMismatch'   => '1' );
-       }
 }
-
 $template->param(firstname => $borr->{'firstname'},
                                                        surname => $borr->{'surname'},
                                                        minpasslen => $minpasslen,
index bb23752..fbc9dd7 100755 (executable)
@@ -490,7 +490,7 @@ foreach my $biblioNum (@biblionumbers) {
         # If there is no loan, return and transfer, we show a checkbox.
         $itemLoopIter->{notforloan} = $itemLoopIter->{notforloan} || 0;
 
-        my $branch = C4::Circulation::_GetCircControlBranch($itemLoopIter, $borr);
+        my $branch = ( C4::Context->preference('ReservesControlBranch') eq 'ItemHomeLibrary' ) ? $itemInfo->{'homebranch'} : $borr->{'branchcode'};
 
         my $branchitemrule = GetBranchItemRule( $branch, $itemInfo->{'itype'} );
         my $policy_holdallowed = 1;
index 9aac79d..73d2c53 100755 (executable)
@@ -71,7 +71,7 @@ BEGIN {
 }
 
 my ($template,$borrowernumber,$cookie);
-
+my $lang = C4::Templates::getlanguage($cgi, 'opac');
 # decide which template to use
 my $template_name;
 my $template_type = 'basic';
@@ -178,7 +178,7 @@ $template->param(
 );
 
 # load the language limits (for search)
-my $languages_limit_loop = getAllLanguages();
+my $languages_limit_loop = getAllLanguages($lang);
 $template->param(search_languages_loop => $languages_limit_loop,);
 
 # load the Type stuff
@@ -418,7 +418,6 @@ my ($error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_
 my @results;
 
 ## I. BUILD THE QUERY
-my $lang = C4::Templates::getlanguage($cgi, 'opac');
 ( $error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$stopwords_removed,$query_type) = buildQuery(\@operators,\@operands,\@indexes,\@limits,\@sort_by, 0, $lang);
 
 sub _input_cgi_parse {
@@ -696,7 +695,7 @@ for (my $i=0;$i<@servers;$i++) {
             $hide = ($hide =~ m/\S/) if $hide; # Just in case it has some spaces/new lines
             $template->param(
                 SEARCH_RESULTS => \@newresults,
-                OPACItemsResultsDisplay => (C4::Context->preference("OPACItemsResultsDisplay") eq "itemdetails"?1:0),
+                OPACItemsResultsDisplay => (C4::Context->preference("OPACItemsResultsDisplay")),
                 suppress_result_number => $hide,
                             );
            if (C4::Context->preference("OPACLocalCoverImages")){
@@ -823,7 +822,7 @@ if (C4::Context->preference('GoogleIndicTransliteration')) {
         $template->param('GoogleIndicTransliteration' => 1);
 }
 
-$template->{VARS}->{DidYouMeanFromAuthorities} = C4::Context->preference('DidYouMeanFromAuthorities');
+$template->{VARS}->{DidYouMean} = C4::Context->preference('OPACdidyoumean') =~ m/enable/;
 
     $template->param( borrowernumber    => $borrowernumber);
 output_with_http_headers $cgi, $cookie, $template->output, $content_type;
index 3638f88..b958485 100755 (executable)
@@ -27,8 +27,6 @@
 use strict;
 use warnings;
 
-use open OUT=> ":encoding(UTF-8)", ':std';
-
 # standard or CPAN modules used
 use CGI;
 use Encode;
@@ -44,29 +42,21 @@ use XML::LibXML;
 
 my $input       = new CGI;
 my $biblionumber = $input->param('id');
-my $importid   = $input->param('importid');
-my $view               = $input->param('viewas') || 'marc';
-
-my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
-        template_name   => "opac-showmarc.tmpl",
-        query           => $input,
-        type            => "opac",
-        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
-        debug           => 1,
-});
+$biblionumber   = int($biblionumber);
+my $importid= $input->param('importid');
+my $view= $input->param('viewas') || 'marc';
 
-$template->param( SCRIPT_NAME => $ENV{'SCRIPT_NAME'}, );
-my ($record, $xmlrecord);
+my $record;
 if ($importid) {
-       my ($marc,$encoding) = GetImportRecordMarc($importid);
-       $record = MARC::Record->new_from_usmarc($marc) ;
-       if($view eq 'card') {
-               $xmlrecord = $record->as_xml();
-       }
+    my ($marc) = GetImportRecordMarc($importid);
+    $record = MARC::Record->new_from_usmarc($marc);
+}
+else {
+    $record =GetMarcBiblio($biblionumber);
 }
 
 if ($view eq 'card' || $view eq 'html') {
-    $xmlrecord = GetXmlBiblio($biblionumber) unless $xmlrecord;
+    my $xmlrecord= $importid? $record->as_xml(): GetXmlBiblio($biblionumber);
     my $xslfile;
     my $themelang = '/' . C4::Context->preference("opacthemes") .  '/' . C4::Templates::_current_language();
 
@@ -83,10 +73,16 @@ if ($view eq 'card' || $view eq 'html') {
     my $stylesheet = $xslt->parse_stylesheet($style_doc);
     my $results = $stylesheet->transform($source);
     my $newxmlrecord = $stylesheet->output_string($results);
-    $newxmlrecord = Encode::decode_utf8($newxmlrecord) unless utf8::is_utf8($newxmlrecord);
-    print $input->header(-charset => 'UTF-8'), $newxmlrecord;
-} else {
-    $record =GetMarcBiblio($biblionumber) unless $record; 
+    print $input->header(-charset => 'UTF-8'), Encode::encode_utf8($newxmlrecord);
+}
+else { #view eq marc
+    my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
+        template_name   => "opac-showmarc.tmpl",
+        query           => $input,
+        type            => "opac",
+        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
+        debug           => 1,
+    });
     $template->param( MARC_FORMATTED => $record->as_formatted );
     output_html_with_http_headers $input, $cookie, $template->output;
 }
index a0ed523..a856081 100755 (executable)
@@ -41,7 +41,7 @@ use C4::Debug;
 use C4::Output qw(:html :ajax pagination_bar);
 use C4::Scrubber;
 use C4::Biblio;
-use C4::Tags qw(add_tag get_approval_rows get_tag_rows remove_tag);
+use C4::Tags qw(add_tag get_approval_rows get_tag_rows remove_tag stratify_tags);
 
 use Data::Dumper;
 
@@ -263,34 +263,9 @@ if ($add_op) {
                $arghash->{biblionumber} = $arg;
        }
        $results = get_approval_rows($arghash);
-
+    stratify_tags(10, $results); # work out the differents sizes for things
        my $count = scalar @$results;
        $template->param(TAGLOOP_COUNT => $count, mine => $mine);
-       # Here we make a halfhearted attempt to separate the tags into "strata" based on weight_total
-       # FIXME: code4lib probably has a better algorithm, iirc
-       # FIXME: when we get a better algorithm, move to C4
-       my $maxstrata = 5;
-       my $strata = 1;
-       my $previous = 0;
-       my $chunk = ($count/$maxstrata)/2;
-       my $total = 0;
-       my %cloud;
-       foreach (reverse @$results) {
-               my $current = $_->{weight_total};
-               $total++;
-               $cloud{$strata}++;
-               if ($current == $previous) {
-                       $_->{cloudweight} = $strata;
-                       next;
-               } 
-               if ($strata < $maxstrata and 
-                       ($cloud{$strata} > $chunk or 
-                       $count-$total <= $maxstrata-$strata)) {
-                       $strata++;
-               }
-               $_->{cloudweight} = $strata;
-               $previous = $current;
-       }
 }
 (scalar @errors  ) and $template->param(ERRORS  => \@errors);
 my @orderedresult = sort { uc($a->{'term'}) cmp uc($b->{'term'}) } @$results;
index eee3d38..05e8133 100755 (executable)
@@ -127,7 +127,7 @@ $bordat[0] = $borr;
 # Warningdate is the date that the warning starts appearing
 if ( $borr->{dateexpiry} && C4::Context->preference('NotifyBorrowerDeparture') &&
     Date_to_Days(Add_Delta_Days($warning_year,$warning_month,$warning_day,- C4::Context->preference('NotifyBorrowerDeparture'))) <
-    Date_to_Days( $today_year, $today_month, $today_day ) ) 
+    Date_to_Days( $today_year, $today_month, $today_day ) )
 {
     # borrower card soon to expire, warn the borrower
     $borr->{'warndeparture'} = $borr->{dateexpiry};
@@ -154,58 +154,58 @@ my @issuedat;
 my $itemtypes = GetItemTypes();
 my $issues = GetPendingIssues($borrowernumber);
 if ($issues){
-       foreach my $issue ( sort { $b->{date_due}->datetime() cmp $a->{date_due}->datetime() } @{$issues} ) {
-               # check for reserves
-               my ( $restype, $res, undef ) = CheckReserves( $issue->{'itemnumber'} );
-               if ( $restype ) {
-                       $issue->{'reserved'} = 1;
-               }
-               
-               my ( $total , $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber );
-               my $charges = 0;
-               foreach my $ac (@$accts) {
-                       if ( $ac->{'itemnumber'} == $issue->{'itemnumber'} ) {
-                               $charges += $ac->{'amountoutstanding'}
-                                 if $ac->{'accounttype'} eq 'F';
-                               $charges += $ac->{'amountoutstanding'}
-                                 if $ac->{'accounttype'} eq 'L';
-                       }
-               }
-               $issue->{'charges'} = $charges;
-
-               # get publictype for icon
-
-               my $publictype = $issue->{'publictype'};
-               $issue->{$publictype} = 1;
-
-               # check if item is renewable
-               my ($status,$renewerror) = CanBookBeRenewed( $borrowernumber, $issue->{'itemnumber'} );
-               ($issue->{'renewcount'},$issue->{'renewsallowed'},$issue->{'renewsleft'}) = GetRenewCount($borrowernumber, $issue->{'itemnumber'});
+    foreach my $issue ( sort { $b->{date_due}->datetime() cmp $a->{date_due}->datetime() } @{$issues} ) {
+        # check for reserves
+        my ( $restype, $res, undef ) = CheckReserves( $issue->{'itemnumber'} );
+        if ( $restype ) {
+            $issue->{'reserved'} = 1;
+        }
+
+        my ( $total , $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber );
+        my $charges = 0;
+        foreach my $ac (@$accts) {
+            if ( $ac->{'itemnumber'} == $issue->{'itemnumber'} ) {
+                $charges += $ac->{'amountoutstanding'}
+                  if $ac->{'accounttype'} eq 'F';
+                $charges += $ac->{'amountoutstanding'}
+                  if $ac->{'accounttype'} eq 'L';
+            }
+        }
+        $issue->{'charges'} = $charges;
+
+        # get publictype for icon
+
+        my $publictype = $issue->{'publictype'};
+        $issue->{$publictype} = 1;
+
+        # check if item is renewable
+        my ($status,$renewerror) = CanBookBeRenewed( $borrowernumber, $issue->{'itemnumber'} );
+        ($issue->{'renewcount'},$issue->{'renewsallowed'},$issue->{'renewsleft'}) = GetRenewCount($borrowernumber, $issue->{'itemnumber'});
         if($status && C4::Context->preference("OpacRenewalAllowed")){
             $issue->{'status'} = $status;
         }
-               $issue->{'too_many'} = 1 if $renewerror and $renewerror eq 'too_many';
-               $issue->{'on_reserve'} = 1 if $renewerror and $renewerror eq 'on_reserve';
-
-               if ( $issue->{'overdue'} ) {
-                       push @overdues, $issue;
-                       $overdues_count++;
-                       $issue->{'overdue'} = 1;
-               }
-               else {
-                       $issue->{'issued'} = 1;
-               }
-               # imageurl:
-               my $itemtype = $issue->{'itemtype'};
-               if ( $itemtype ) {
-                       $issue->{'imageurl'}    = getitemtypeimagelocation( 'opac', $itemtypes->{$itemtype}->{'imageurl'} );
-                       $issue->{'description'} = $itemtypes->{$itemtype}->{'description'};
-               }
-               push @issuedat, $issue;
-               $count++;
-               
-               my $isbn = GetNormalizedISBN($issue->{'isbn'});
-               $issue->{normalized_isbn} = $isbn;
+        $issue->{'too_many'} = 1 if $renewerror and $renewerror eq 'too_many';
+        $issue->{'on_reserve'} = 1 if $renewerror and $renewerror eq 'on_reserve';
+
+        if ( $issue->{'overdue'} ) {
+            push @overdues, $issue;
+            $overdues_count++;
+            $issue->{'overdue'} = 1;
+        }
+        else {
+            $issue->{'issued'} = 1;
+        }
+        # imageurl:
+        my $itemtype = $issue->{'itemtype'};
+        if ( $itemtype ) {
+            $issue->{'imageurl'}    = getitemtypeimagelocation( 'opac', $itemtypes->{$itemtype}->{'imageurl'} );
+            $issue->{'description'} = $itemtypes->{$itemtype}->{'description'};
+        }
+        push @issuedat, $issue;
+        $count++;
+
+        my $isbn = GetNormalizedISBN($issue->{'isbn'});
+        $issue->{normalized_isbn} = $isbn;
 
                 # My Summary HTML
                 if (my $my_summary_html = C4::Context->preference('OPACMySummaryHTML')){
@@ -217,7 +217,7 @@ if ($issues){
                     $issue->{biblionumber} ? $my_summary_html =~ s/{BIBLIONUMBER}/$issue->{biblionumber}/g : $my_summary_html =~ s/{BIBLIONUMBER}//g;
                     $issue->{MySummaryHTML} = $my_summary_html;
                 }
-       }
+    }
 }
 $template->param( ISSUES       => \@issuedat );
 $template->param( issues_count => $count );
@@ -257,7 +257,7 @@ foreach my $res (@reserves) {
     if ( $res->{'expirationdate'} eq '0000-00-00' ) {
       $res->{'expirationdate'} = '';
     }
-    
+
     my $publictype = $res->{'publictype'};
     $res->{$publictype} = 1;
     $res->{'waiting'} = 1 if $res->{'found'} eq 'W';
@@ -291,7 +291,7 @@ foreach my $res (@reserves) {
         if ( ( $res->{'found'} eq 'W' ) ) {
             my $item = $res->{'itemnumber'};
             $item = GetBiblioFromItemNumber($item,undef);
-            $res->{'wait'}= 1; 
+            $res->{'wait'}= 1;
             $res->{'holdingbranch'}=$item->{'holdingbranch'};
             $res->{'biblionumber'}=$item->{'biblionumber'};
             $res->{'barcode'} = $item->{'barcode'};
@@ -317,7 +317,7 @@ foreach my $res (@reserves) {
     # can be cancelled
     #$res->{'cancelable'} = 1 if ($res->{'wait'} && $res->{'atdestination'} && $res->{'found'} ne "1");
     $res->{'cancelable'} = 1 if    ($res->{wait} and not $res->{found}) or (not $res->{wait} and not $res->{intransit});
-    
+
 }
 
 $template->param( WAITING => \@waiting );
@@ -341,12 +341,12 @@ if (C4::Context->preference('BakerTaylorEnabled')) {
 if (C4::Context->preference("OPACAmazonCoverImages") or 
     C4::Context->preference("GoogleJackets") or
     C4::Context->preference("BakerTaylorEnabled") or
-       C4::Context->preference("SyndeticsCoverImages")) {
+    C4::Context->preference("SyndeticsCoverImages")) {
         $template->param(JacketImages=>1);
 }
 
 if ( GetMessagesCount( $borrowernumber, 'B' ) ) {
-       $template->param( bor_messages => 1 );
+    $template->param( bor_messages => 1 );
 }
 
 if ( $borr->{'opacnote'} ) {
@@ -357,7 +357,7 @@ if ( $borr->{'opacnote'} ) {
 }
 
 $template->param(
-    bor_messages_loop  => GetMessages( $borrowernumber, 'B', 'NONE' ),
+    bor_messages_loop    => GetMessages( $borrowernumber, 'B', 'NONE' ),
     waiting_count      => $wcount,
     patronupdate => $patronupdate,
     OpacRenewalAllowed => C4::Context->preference("OpacRenewalAllowed"),
index 529a2a6..3b90498 100755 (executable)
@@ -22,6 +22,7 @@ use warnings;
 
 use CGI;
 use Mail::Sendmail;
+use Encode;
 
 use C4::Auth;    # checkauth, getborrowernumber.
 use C4::Context;
@@ -102,7 +103,7 @@ EOF
     my $B_address2 = $borr->{'B_address2'} || '';
 
     foreach my $field (@fields) {
-        my $newfield = $query->param($field) || '';
+        my $newfield = decode('utf-8',$query->param($field)) || '';
         my $borrowerfield = '';
         if($borr->{$field}) {
             $borrowerfield = $borr->{$field};
@@ -124,8 +125,8 @@ EOF
         To      => $updateemailaddress,
         From    => $patronemail,
         Subject => "User Request for update of Record.",
-        Message => $message,
-        'Content-Type' => 'text/plain; charset="utf8"',
+        Message => encode('utf-8', $message), # Mail::Sendmail doesn't like wide characters
+        'Content-Type' => 'text/plain; charset="utf-8"',
     );
 
     if ( sendmail %mail ) {
index 7234ffd..9c08565 100755 (executable)
@@ -80,12 +80,20 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     }
 );
 
-unless ( C4::Context->preference('DidYouMeanFromAuthorities') ) {
+my @plugins = ();
+
+my $pluginsconfig = from_json(C4::Context->preference('OPACdidyoumean') || '[]');
+
+foreach my $plugin (@$pluginsconfig) {
+    push @plugins, $plugin->{name} if ($plugin->{enabled});
+}
+
+unless ( @plugins ) {
     print $query->header;
     exit;
 }
 
-my $suggestor = Koha::SuggestionEngine->new( { plugins => ('AuthorityFile') } );
+my $suggestor = Koha::SuggestionEngine->new( { plugins => \@plugins } );
 
 my $suggestions =
   $suggestor->get_suggestions( { search => $search, count => $count } );
index aae96c9..f27ce10 100755 (executable)
@@ -108,7 +108,7 @@ elsif ( $phase eq 'New Term step 4' ) {
         if ( $type eq 'DATE' || $type eq 'DATETIME' ) {
             $tmp_hash{'date'} = 1;
         }
-        if ( $type eq 'TEXT' ) {
+        if ($type eq 'TEXT' || $type eq 'MEDIUMTEXT'){
             $tmp_hash{'text'} = 1;
         }
 
index 00f52ef..de18072 100755 (executable)
@@ -501,7 +501,7 @@ elsif ( $phase eq 'Save Report' ) {
         );
     }
     else {
-        save_report( {
+        my $id = save_report( {
                 borrowernumber => $borrowernumber,
                 sql            => $sql,
                 name           => $name,
@@ -513,7 +513,11 @@ elsif ( $phase eq 'Save Report' ) {
                 cache_expiry   => $cache_expiry,
                 public         => $public,
             } );
-        $template->param( 'save_successful' => 1, );
+        $template->param(
+            'save_successful' => 1,
+            'reportname'      => $name,
+            'id'              => $id,
+        );
     }
 }
 
index 9aff54b..36f7cc5 100755 (executable)
@@ -96,9 +96,19 @@ if($do_it){
     while(my $row = $sth->fetchrow_hashref){
         $row->{'enddate'} = format_date(GetExpirationDate($row->{'subscriptionid'}));
         $row->{'startdate'} = format_date($row->{'startdate'});
-        push @datas, $row if ($expired || (not $expired && not HasSubscriptionExpired($row->{subscriptionid})) );
+        $row->{expired} = HasSubscriptionExpired($row->{subscriptionid});
+        push @datas, $row if (
+            $expired
+            or (
+                not $expired
+                and (
+                    not $row->{expired}
+                    and not $row->{closed}
+                )
+            )
+        );
     }
-    
+
     if($output eq 'screen'){
         $template->param(datas => \@datas,
                          do_it => 1);
index bf4b6e9..e831854 100755 (executable)
@@ -79,6 +79,7 @@ if ($date) {
 
         $subscription->{expirationdate} = $expirationdate;
         next if $expirationdate !~ /\d{4}-\d{2}-\d{2}/; # next if not in ISO format.
+        next if $subscription->{closed};
         if ( Date_to_Days(split "-",$expirationdate) < Date_to_Days(split "-",$date) &&
                         Date_to_Days(split "-",$expirationdate) > Date_to_Days(&Today) ) {
             $subscription->{expirationdate}=format_date($subscription->{expirationdate});
index 610de60..ad57e07 100755 (executable)
@@ -34,6 +34,7 @@ use List::MoreUtils qw/uniq/;
 
 my $query = new CGI;
 my $op = $query->param('op') || q{};
+my $nbissues=$query->param('nbissues');
 my $dbh = C4::Context->dbh;
 
 my ($template, $loggedinuser, $cookie);
@@ -55,19 +56,20 @@ my $subscriptions;
 
 if($op eq 'gennext' && @subscriptionid){
     my $subscriptionid = $subscriptionid[0];
-    my $subscription = GetSubscription($subscriptionid);
-
-       my $sth = $dbh->prepare("SELECT publisheddate, serialid, serialseq, planneddate
+    my $sth = $dbh->prepare("SELECT publisheddate, serialid, serialseq, planneddate
                                                        FROM serial WHERE status = 1 AND subscriptionid = ?");
+    my $status = defined( $nbissues ) ? 2 : 3;
+    $nbissues ||= 1;
+    for ( my $i = 0; $i < $nbissues; $i++ ){
        $sth->execute($subscriptionid);
-
        # modify actual expected issue, to generate the next
        if ( my $issue = $sth->fetchrow_hashref ) {
                ModSerialStatus( $issue->{serialid}, $issue->{serialseq},
                 $issue->{planneddate}, $issue->{publisheddate},
-                3, "" );
+                $status, "" );
        }else{
-               my $expected = GetNextExpected($subscriptionid);
+            my $subscription = GetSubscription($subscriptionid);
+            my $expected = GetNextExpected($subscriptionid);
            my (
                 $newserialseq,  $newlastvalue1, $newlastvalue2, $newlastvalue3,
              $newinnerloop1, $newinnerloop2, $newinnerloop3
@@ -82,14 +84,16 @@ if($op eq 'gennext' && @subscriptionid){
             ## Updating the subscription seq status
             my $squery = "UPDATE subscription SET lastvalue1=?, lastvalue2=?, lastvalue3=?, innerloop1=?, innerloop2=?, innerloop3=?
                         WHERE  subscriptionid = ?";
-            $sth = $dbh->prepare($squery);
-            $sth->execute(
+            my $seqsth = $dbh->prepare($squery);
+            $seqsth->execute(
                 $newlastvalue1, $newlastvalue2, $newlastvalue3, $newinnerloop1,
                 $newinnerloop2, $newinnerloop3, $subscriptionid
                 );
 
        }
-
+       last if $nbissues == 1;
+       last if HasSubscriptionExpired($subscriptionid) > 0;
+    }
     print $query->redirect('/cgi-bin/koha/serials/serials-collection.pl?subscriptionid='.$subscriptionid);
 }
 
@@ -97,8 +101,10 @@ my $subscriptioncount;
 my ($location, $callnumber);
 if (@subscriptionid){
    my @subscriptioninformation=();
+   my $closed = 0;
    foreach my $subscriptionid (@subscriptionid){
     my $subs= GetSubscription($subscriptionid);
+    $closed = 1 if $subs->{closed};
     $subs->{opacnote}     =~ s/\n/\<br\/\>/g;
     $subs->{missinglist}  =~ s/\n/\<br\/\>/g;
     $subs->{recievedlist} =~ s/\n/\<br\/\>/g;
@@ -123,6 +129,7 @@ if (@subscriptionid){
     my $tmpsubscription= GetFullSubscription($subscriptionid);
     @subscriptioninformation=(@$tmpsubscription,@subscriptioninformation);
   }
+  $template->param(closed => $closed);
   $subscriptions=PrepareSerialsData(\@subscriptioninformation);
   $subscriptioncount = CountSubscriptionFromBiblionumber($subscriptiondescs->[0]{'biblionumber'});
 } else {
@@ -161,9 +168,11 @@ $template->param(
           routing => C4::Context->preference("RoutingSerials"),
           subscr=>$query->param('subscriptionid'),
           subscriptioncount => $subscriptioncount,
-    location          => $locationlib,
-    callnumber        => $callnumber,
-    uc(C4::Context->preference("marcflavour")) => 1
+          location            => $locationlib,
+          callnumber          => $callnumber,
+          uc(C4::Context->preference("marcflavour")) => 1,
+          serialsadditems   => $subscriptiondescs->[0]{'serialsadditems'},
+          dateformatmetric   => C4::Context->preference("dateformat") eq "metric" ? 1 : 0,
           );
 
 output_html_with_http_headers $query, $cookie, $template->output;
index bb87c5f..66d3a4e 100755 (executable)
@@ -151,6 +151,7 @@ foreach my $serialid (@serialids) {
             )
             || $serinfo->{'cannotedit'}
         );
+        $serinfo->{editdisable} ||= ($serinfo->{status8} and $serinfo->{closed});
         push @serialdatalist, $serinfo;
         $processedserialid{$serialid} = 1;
     }
index ac5d0d3..aaf64e6 100755 (executable)
@@ -46,6 +46,8 @@ my $biblionumber  = $query->param('biblionumber') || '';
 my $branch        = $query->param('branch_filter') || '';
 my $routing       = $query->param('routing') || C4::Context->preference("RoutingSerials");
 my $searched      = $query->param('searched') || 0;
+my @subscriptionids = $query ->param('subscriptionid');
+my $op            = $query->param('op');
 
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     {
@@ -58,6 +60,16 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     }
 );
 
+if ( $op and $op eq "close" ) {
+    for my $subscriptionid ( @subscriptionids ) {
+        C4::Serials::CloseSubscription( $subscriptionid );
+    }
+} elsif ( $op and $op eq "reopen" ) {
+    for my $subscriptionid ( @subscriptionids ) {
+        C4::Serials::ReopenSubscription( $subscriptionid );
+    }
+}
+
 my @subscriptions;
 if ($searched){
     @subscriptions = SearchSubscriptions(
@@ -81,6 +93,15 @@ if ($routing) {
     }
 }
 
+my (@openedsubscriptions, @closedsubscriptions);
+for my $sub ( @subscriptions ) {
+    unless ( $sub->{closed} ) {
+        push @openedsubscriptions, $sub;
+    } else {
+        push @closedsubscriptions, $sub;
+    }
+}
+
 my $branches = GetBranches();
 my @branches_loop;
 foreach (sort keys %$branches){
@@ -94,7 +115,9 @@ foreach (sort keys %$branches){
 }
 
 $template->param(
-    subscriptions => \@subscriptions,
+    openedsubscriptions => \@openedsubscriptions,
+    closedsubscriptions => \@closedsubscriptions,
+    total         => @openedsubscriptions + @closedsubscriptions,
     title_filter  => $title,
     ISSN_filter   => $ISSN,
     EAN_filter    => $EAN,
index ae85c51..009360b 100755 (executable)
@@ -34,6 +34,13 @@ my $issueconfirmed = $query->param('issueconfirmed');
 my $dbh = C4::Context->dbh;
 my ($template, $loggedinuser, $cookie, $hemisphere);
 my $subscriptionid = $query->param('subscriptionid');
+
+if ( $op and $op eq "close" ) {
+    C4::Serials::CloseSubscription( $subscriptionid );
+} elsif ( $op and $op eq "reopen" ) {
+    C4::Serials::ReopenSubscription( $subscriptionid );
+}
+
 my $subs = GetSubscription($subscriptionid);
 
 $subs->{enddate} = GetExpirationDate($subscriptionid);
@@ -100,7 +107,7 @@ my $hasRouting = check_routing($subscriptionid);
 
 # COMMENT hdl : IMHO, we should think about passing more and more data hash to template->param rather than duplicating code a new coding Guideline ?
 
-for my $date qw(startdate enddate firstacquidate histstartdate histenddate){
+for my $date ( qw(startdate enddate firstacquidate histstartdate histenddate) ) {
     $$subs{$date}      = format_date($$subs{$date}) if $date && $$subs{$date};
 }
 $subs->{location} = GetKohaAuthorisedValueLib("LOC",$subs->{location});
@@ -119,6 +126,34 @@ if (! $subs->{periodicity}) {
     $subs->{periodicity} = '0';
 }
 my $default_bib_view = get_default_view();
+
+my ( $order, $bookseller, $tmpl_infos );
+# FIXME = see http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5335#c52
+#if ( defined $subscriptionid ) {
+#    my $lastOrderNotReceived = GetLastOrderNotReceivedFromSubscriptionid $subscriptionid;
+#    my $lastOrderReceived = GetLastOrderReceivedFromSubscriptionid $subscriptionid;
+#    if ( defined $lastOrderNotReceived ) {
+#        my $basket = GetBasket $lastOrderNotReceived->{basketno};
+#        my $bookseller = GetBookSellerFromId $basket->{booksellerid};
+#        ( $tmpl_infos->{valuegsti_ordered}, $tmpl_infos->{valuegste_ordered} ) = get_value_with_gst_params ( $lastOrderNotReceived->{ecost}, $lastOrderNotReceived->{gstrate}, $bookseller );
+#        $tmpl_infos->{valuegsti_ordered} = sprintf( "%.2f", $tmpl_infos->{valuegsti_ordered} );
+#        $tmpl_infos->{valuegste_ordered} = sprintf( "%.2f", $tmpl_infos->{valuegste_ordered} );
+#        $tmpl_infos->{budget_name_ordered} = GetBudgetName $lastOrderNotReceived->{budget_id};
+#        $tmpl_infos->{basketno} = $lastOrderNotReceived->{basketno};
+#        $tmpl_infos->{ordered_exists} = 1;
+#    }
+#    if ( defined $lastOrderReceived ) {
+#        my $basket = GetBasket $lastOrderReceived->{basketno};
+#        my $bookseller = GetBookSellerFromId $basket->{booksellerid};
+#        ( $tmpl_infos->{valuegsti_spent}, $tmpl_infos->{valuegste_spent} ) = get_value_with_gst_params ( $lastOrderReceived->{unitprice}, $lastOrderReceived->{gstrate}, $bookseller );
+#        $tmpl_infos->{valuegsti_spent} = sprintf( "%.2f", $tmpl_infos->{valuegsti_spent} );
+#        $tmpl_infos->{valuegste_spent} = sprintf( "%.2f", $tmpl_infos->{valuegste_spent} );
+#        $tmpl_infos->{budget_name_spent} = GetBudgetName $lastOrderReceived->{budget_id};
+#        $tmpl_infos->{invoicenumber} = $lastOrderReceived->{booksellerinvoicenumber};
+#        $tmpl_infos->{spent_exists} = 1;
+#    }
+#}
+
 $template->param(
        subscriptionid => $subscriptionid,
     serialslist => \@serialslist,
@@ -138,7 +173,8 @@ $template->param(
     intranetcolorstylesheet => C4::Context->preference('intranetcolorstylesheet'),
     irregular_issues => scalar @irregular_issues,
     default_bib_view => $default_bib_view,
-    (uc(C4::Context->preference("marcflavour"))) => 1
+    (uc(C4::Context->preference("marcflavour"))) => 1,
+    show_acquisition_details => defined $tmpl_infos->{ordered_exists} || defined $tmpl_infos->{spent_exists} ? 1 : 0,
     );
 
 output_html_with_http_headers $query, $cookie, $template->output;
index a029a58..3e43339 100755 (executable)
@@ -89,7 +89,7 @@ sub import_bib {
     my $number_of_matches =  BatchFindBibDuplicates($batch_id, $matcher);
 
     # XXX we are ignoring the result of this;
-    BatchCommitBibRecords($batch_id, $framework) if lc($import_mode) eq 'direct';
+    BatchCommitRecords($batch_id, $framework) if lc($import_mode) eq 'direct';
 
     my $dbh = C4::Context->dbh();
     my $sth = $dbh->prepare("SELECT matched_biblionumber FROM import_biblios WHERE import_record_id =?");
index da9008d..dc69f96 100644 (file)
@@ -12,23 +12,24 @@ find({
     no_chdir => 1,
     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
-           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
+        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
+        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
+        return if $m =~ /C4::Members::Statistics/; # DB
         use_ok($m) || BAIL_OUT("***** PROBLEMS LOADING FILE '$m'");
     },
 }, $lib);
@@ -43,7 +44,8 @@ find(
             return unless $m =~ s/[.]pm$//;
             $m =~ s{^.*/Koha/}{Koha/};
             $m =~ s{/}{::}g;
-            return if $m =~ /Koha::SearchEngine::/; # Koha::SearchEngine::* are experimental
+            return if $m =~ /Koha::SearchEngine/; # Koha::SearchEngine::* are experimental
+            return if $m =~ /Koha::Cache::Memcached/; # optional dependency
             use_ok($m) || BAIL_OUT("***** PROBLEMS LOADING FILE '$m'");
         },
     },
diff --git a/t/Acquisition/Invoice.t b/t/Acquisition/Invoice.t
new file mode 100755 (executable)
index 0000000..a887965
--- /dev/null
@@ -0,0 +1,131 @@
+#!/usr/bin/perl
+
+use Modern::Perl;
+use C4::Context;
+
+use Test::More tests => 47;
+use Test::MockModule;
+
+use_ok('C4::Acquisition');
+
+my $module = new Test::MockModule('C4::Context');
+$module->mock('_new_dbh', sub {
+    my $dbh = DBI->connect( 'DBI:Mock:', '', '' )
+        || die "Cannot create handle: $DBI::errstr\n";
+    return $dbh;
+});
+
+my $dbh = C4::Context->dbh;
+
+# We need to add a resultset to avoid DBI fail
+# ("DBI bind_columns: invalid number of arguments...")
+my $rs = [
+    [qw(one two three four)],
+    [1, 2, 3, 4]
+];
+
+$dbh->{mock_add_resultset} = $rs;
+my @invoices = C4::Acquisition::GetInvoices(
+    supplierid => "supplierid",
+    invoicenumber => "invoicenumber",
+    suppliername => "suppliername",
+    shipmentdatefrom => "shipmentdatefrom",
+    shipmentdateto => "shipmentdateto",
+    billingdatefrom => "billingdatefrom",
+    billingdateto => "billingdateto",
+    isbneanissn => "isbneanissn",
+    title => "title",
+    author => "author",
+    publisher => "publisher",
+    publicationyear => "publicationyear",
+    branchcode => "branchcode",
+);
+my $history = $dbh->{mock_all_history};
+
+is(scalar(@$history), 1);
+my @bound_params = @{ $history->[0]->{bound_params} };
+is(scalar(@bound_params), 15);
+is($bound_params[0], 'supplierid');
+is($bound_params[1], '%invoicenumber%');
+is($bound_params[2], '%suppliername%');
+is($bound_params[3], 'shipmentdatefrom');
+is($bound_params[4], 'shipmentdateto');
+is($bound_params[5], 'billingdatefrom');
+is($bound_params[6], 'billingdateto');
+is($bound_params[7], 'isbneanissn');
+is($bound_params[8], 'isbneanissn');
+is($bound_params[9], 'isbneanissn');
+is($bound_params[10], 'title');
+is($bound_params[11], 'author');
+is($bound_params[12], 'publisher');
+is($bound_params[13], 'publicationyear');
+is($bound_params[14], 'branchcode');
+
+$dbh->{mock_clear_history} = 1;
+$dbh->{mock_add_resultset} = $rs;
+GetInvoice(42);
+$history = $dbh->{mock_all_history};
+is(scalar(@$history), 1);
+@bound_params = @{ $history->[0]->{bound_params} };
+is(scalar(@bound_params), 1);
+is($bound_params[0], 42);
+
+$dbh->{mock_clear_history} = 1;
+$dbh->{mock_add_resultset} = $rs;
+$dbh->{mock_add_resultset} = $rs;
+my $invoice = GetInvoiceDetails(42);
+$history = $dbh->{mock_all_history};
+is(scalar(@$history), 2);
+@bound_params = @{ $history->[0]->{bound_params} };
+is(scalar(@bound_params), 1);
+is($bound_params[0], 42);
+@bound_params = @{ $history->[1]->{bound_params} };
+is(scalar(@bound_params), 1);
+is($bound_params[0], 42);
+ok(exists $invoice->{orders});
+
+$dbh->{mock_clear_history} = 1;
+is(AddInvoice(booksellerid => 1), undef);   # Fails because of a missing parameter
+$history = $dbh->{mock_all_history};
+is(scalar(@$history), 0);
+
+$dbh->{mock_clear_history} = 1;
+AddInvoice(invoicenumber => 'invoice', booksellerid => 1, unknown => "unknown");
+$history = $dbh->{mock_all_history};
+is(scalar(@$history), 1);
+@bound_params = @{ $history->[0]->{bound_params} };
+is(scalar(@bound_params), 2);
+ok(grep /^1$/, @bound_params);
+ok(grep /^invoice$/, @bound_params);
+ok(not grep /unknown/, @bound_params);
+
+$dbh->{mock_clear_history} = 1;
+is(ModInvoice(booksellerid => 1), undef);   # Fails because of a missing parameter
+$history = $dbh->{mock_all_history};
+is(scalar(@$history), 0);
+
+$dbh->{mock_clear_history} = 1;
+ModInvoice(invoiceid => 3, invoicenumber => 'invoice', unknown => "unknown");
+$history = $dbh->{mock_all_history};
+is(scalar(@$history), 1);
+@bound_params = @{ $history->[0]->{bound_params} };
+is(scalar(@bound_params), 2);
+ok(grep /^3$/, @bound_params);
+ok(grep /^invoice$/, @bound_params);
+ok(not grep /unknown/, @bound_params);
+
+$dbh->{mock_clear_history} = 1;
+CloseInvoice(42);
+$history = $dbh->{mock_all_history};
+is(scalar(@$history), 1);
+@bound_params = @{ $history->[0]->{bound_params} };
+is(scalar(@bound_params), 1);
+is($bound_params[0], 42);
+
+$dbh->{mock_clear_history} = 1;
+ReopenInvoice(42);
+$history = $dbh->{mock_all_history};
+is(scalar(@$history), 1);
+@bound_params = @{ $history->[0]->{bound_params} };
+is(scalar(@bound_params), 1);
+is($bound_params[0], 42);
diff --git a/t/AuthoritiesMarc.t b/t/AuthoritiesMarc.t
deleted file mode 100755 (executable)
index d59b43b..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::AuthoritiesMarc');
-}
-
diff --git a/t/Cache_Memcached.t b/t/Cache_Memcached.t
deleted file mode 100755 (executable)
index a9366cc..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('Koha::Cache::Memcached');
-}
-
index 283300e..42b8342 100755 (executable)
@@ -3,7 +3,8 @@
 use strict;
 use warnings;
 use DateTime;
-use Test::More tests => 21;
+use DateTime::Duration;
+use Test::More tests => 26;
 use Koha::DateUtils;
 
 BEGIN {
@@ -89,20 +90,14 @@ my $daycount = $cal->days_between( $test_dt, $later_dt );
 cmp_ok( $daycount->in_units('days'),
     '==', 48, 'days_between calculates correctly' );
 
-my $ret = $cal->addDate( $test_dt, 1, 'days' );
+my $ret;
 
-cmp_ok( $ret->ymd(), 'eq', '2012-07-24', 'Simple Single Day Add (Calendar)' );
-
-$ret = $cal->addDate( $test_dt, 7, 'days' );
-cmp_ok( $ret->ymd(), 'eq', '2012-07-31', 'Add 7 days Calendar mode' );
-$cal->set_daysmode('Datedue');
-$ret = $cal->addDate( $test_dt, 7, 'days' );
-cmp_ok( $ret->ymd(), 'eq', '2012-07-30', 'Add 7 days Datedue mode' );
-$cal->set_daysmode('Days');
-$ret = $cal->addDate( $test_dt, 7, 'days' );
-cmp_ok( $ret->ymd(), 'eq', '2012-07-30', 'Add 7 days Days mode' );
 $cal->set_daysmode('Calendar');
 
+# see bugzilla #8966
+is( $cal->is_holiday($later_dt), 0, 'is holiday for the next test' );
+cmp_ok( $later_dt, 'eq', '2012-09-17T17:30:00', 'Date should be the same after is_holiday' );
+
 # example tests for bug report
 $cal->clear_weekly_closed_days();
 
@@ -127,3 +122,60 @@ $cal->add_holiday( dt_from_string('2012-07-07','iso') );
 $daycount = $cal->days_between( dt_from_string("2012-07-01",'iso'),
     dt_from_string("2012-07-15",'iso') )->in_units('days');
 cmp_ok( $daycount, '==', 12, 'multiple holidays correctly recognized' );
+
+my $one_day_dur = DateTime::Duration->new( days => 1 );
+my $two_day_dur = DateTime::Duration->new( days => 2 );
+my $seven_day_dur = DateTime::Duration->new( days => 7 );
+
+    ## 'Datedue' tests
+    $cal = Koha::Calendar->new( TEST_MODE => 1 ,
+                                days_mode => 'Datedue');
+
+    $cal->add_holiday( dt_from_string('2012-07-04','iso') );
+    $dt = dt_from_string( '2012-07-03','iso' );
+
+    is($cal->addDate( $dt, $one_day_dur, 'days' ),
+        dt_from_string('2012-07-05','iso'),
+        'Single day add (Datedue, matches holiday, shift)' );
+
+    is($cal->addDate( $dt, $two_day_dur, 'days' ),
+        dt_from_string('2012-07-05','iso'),
+        'Two days add, skips holiday (Datedue)' );
+
+    cmp_ok($cal->addDate( $test_dt, $seven_day_dur, 'days' ), 'eq',
+        '2012-07-30T11:53:00',
+        'Add 7 days (Datedue)' );
+
+
+
+    ## 'Calendar' tests'
+    $cal = Koha::Calendar->new( TEST_MODE => 1,
+                                days_mode => 'Calendar' );
+
+    $cal->add_holiday( dt_from_string('2012-07-04','iso') );
+    $dt = dt_from_string('2012-07-03','iso');
+
+    is($cal->addDate( $dt, $one_day_dur, 'days' ),
+        dt_from_string('2012-07-05','iso'),
+        'Single day add (Calendar)' );
+
+    cmp_ok($cal->addDate( $test_dt, $seven_day_dur, 'days' ), 'eq',
+       '2012-07-31T11:53:00',
+       'Add 7 days (Calendar)' );
+
+
+
+    ## 'Days' tests
+    $cal = Koha::Calendar->new( TEST_MODE => 1,
+                                days_mode => 'Days' );
+
+    $cal->add_holiday( dt_from_string('2012-07-04','iso') );
+    $dt = dt_from_string('2012-07-03','iso');
+
+    is($cal->addDate( $dt, $one_day_dur, 'days' ),
+        dt_from_string('2012-07-04','iso'),
+        'Single day add (Days)' );
+
+    cmp_ok($cal->addDate( $test_dt, $seven_day_dur, 'days' ),'eq',
+        '2012-07-30T11:53:00',
+        'Add 7 days (Days)' );
index dbf38a6..a55c0d9 100755 (executable)
@@ -5,7 +5,7 @@ use DateTime;
 use DateTime::TimeZone;
 
 use C4::Context;
-use Test::More tests => 25;
+use Test::More tests => 28;
 
 BEGIN { use_ok('Koha::DateUtils'); }
 
@@ -26,13 +26,22 @@ $dt->set_minute(0);
 my $date_string = output_pref( $dt, 'iso' );
 cmp_ok $date_string, 'eq', '2011-06-16 12:00', 'iso output';
 
+my $date_string = output_pref( $dt, 'iso',1 );
+cmp_ok $date_string, 'eq', '2011-06-16', 'iso output (date only)';
+
 $date_string = output_pref( $dt, 'us' );
 cmp_ok $date_string, 'eq', '06/16/2011 12:00', 'us output';
 
+$date_string = output_pref( $dt, 'us', 1 );
+cmp_ok $date_string, 'eq', '06/16/2011', 'us output (date only)';
+
 # metric should return the French Revolutionary Calendar Really
 $date_string = output_pref( $dt, 'metric' );
 cmp_ok $date_string, 'eq', '16/06/2011 12:00', 'metric output';
 
+$date_string = output_pref( $dt, 'metric',1 );
+cmp_ok $date_string, 'eq', '16/06/2011', 'metric output (date only)';
+
 $date_string = output_pref_due( $dt, 'metric' );
 cmp_ok $date_string, 'eq', '16/06/2011 12:00',
   'output_pref_due preserves non midnight HH:SS';
index a049677..80058bb 100644 (file)
@@ -29,7 +29,7 @@ REAL_REWRITE_SCRIPT = ../rewrite-config.PL
 ZEBRA_CONF_DIR = run/etc/zebradb
 ZEBRA_CONF_FILES = $(ZEBRA_CONF_DIR)/etc/passwd $(ZEBRA_CONF_DIR)/zebra-biblios.cfg $(ZEBRA_CONF_DIR)/zebra-authorities.cfg $(ZEBRA_CONF_DIR)/zebra-authorities-dom.cfg $(ZEBRA_CONF_DIR)/explain-authorities.xml $(ZEBRA_CONF_DIR)/explain-biblios.xml $(ZEBRA_CONF_DIR)/retrieval-info-auth-grs1.xml $(ZEBRA_CONF_DIR)/retrieval-info-auth-dom.xml $(ZEBRA_CONF_DIR)/ccl.properties $(ZEBRA_CONF_DIR)/cql.properties $(ZEBRA_CONF_DIR)/pqf.properties
 
-SCRIPTS = koha-zebra-ctl.sh koha-pazpar2-ctl.sh koha-zebraqueue-ctl.sh zebraqueue_daemon.pl
+SCRIPTS = koha-zebra-ctl.sh koha-pazpar2-ctl.sh
 SRC_SCRIPT_DIR = ../misc/bin
 TEST_SCRIPT_DIR = run/bin
 
index 67a4949..eed6fe8 100755 (executable)
@@ -20,15 +20,15 @@ foreach my $plugin (@installed_plugins) {
     ok(grep($plugin, @available_plugins), "Found plugin $plugin");
 }
 
-my $suggestor = Koha::SuggestionEngine->new( { plugins => ( 'ABCD::EFGH::IJKL' ) } );
+my $suggestor = Koha::SuggestionEngine->new( { plugins => [ 'ABCD::EFGH::IJKL' ] } );
 
 is(ref($suggestor), 'Koha::SuggestionEngine', 'Created suggestion engine with invalid plugin');
 is(scalar @{ $suggestor->get_suggestions({ 'search' => 'books' }) }, 0 , 'Request suggestions with empty suggestor');
 
-$suggestor = Koha::SuggestionEngine->new( { plugins => ( 'Null' ) } );
+$suggestor = Koha::SuggestionEngine->new( { plugins => [ 'Null' ] } );
 is(ref($suggestor->plugins->[0]), 'Koha::SuggestionEngine::Plugin::Null', 'Created record suggestor with implicitly scoped Null filter');
 
-$suggestor = Koha::SuggestionEngine->new( { plugins => ( 'Koha::SuggestionEngine::Plugin::Null' ) } );
+$suggestor = Koha::SuggestionEngine->new( { plugins => [ 'Koha::SuggestionEngine::Plugin::Null' ] } );
 is(ref($suggestor->plugins->[0]), 'Koha::SuggestionEngine::Plugin::Null', 'Created record suggestor with explicitly scoped Null filter');
 
 my $suggestions = $suggestor->get_suggestions({ 'search' => 'books' });
@@ -38,7 +38,7 @@ is_deeply($suggestions->[0], { 'search' => 'book', label => 'Book!', relevance =
 $suggestions = $suggestor->get_suggestions({ 'search' => 'silliness' });
 
 eval {
-    $suggestor = Koha::SuggestionEngine->new( { plugins => ( 'Koha::SuggestionEngine::Plugin::Null' ) } );
+    $suggestor = Koha::SuggestionEngine->new( { plugins => [ 'Koha::SuggestionEngine::Plugin::Null' ] } );
     undef $suggestor;
 };
 ok(!$@, 'Destroyed suggestor successfully');
index b9ab35b..18a6e42 100755 (executable)
@@ -22,7 +22,7 @@ $module->mock('SearchAuthorities', sub {
                     'reported_tag' => undef,
                     'even' => 0,
                     'summary' => {
-                        'authorized' => [ 'Cooking' ],
+                        'authorized' => [ { 'heading' => 'Cooking' } ],
                         'otherscript' => [],
                         'seefrom' => [ 'Cookery' ],
                         'notes' => [ 'Your quintessential poor heading selection' ],
@@ -33,7 +33,7 @@ $module->mock('SearchAuthorities', sub {
                 } ], 1
 });
 
-my $suggestor = Koha::SuggestionEngine->new( { plugins => ( 'AuthorityFile' ) } );
+my $suggestor = Koha::SuggestionEngine->new( { plugins => [ 'AuthorityFile' ] } );
 is(ref($suggestor), 'Koha::SuggestionEngine', 'Created suggestion engine');
 
 my $result = $suggestor->get_suggestions({search => 'Cookery'});
index 2c39128..4a5b31e 100755 (executable)
@@ -47,7 +47,7 @@ SKIP: {
     my @expectedfields = qw( basketno
                              biblioitemnumber
                              biblionumber
-                             booksellerinvoicenumber
+                             invoiceid
                              budgetdate
                              cancelledby
                              closedate
@@ -59,7 +59,7 @@ SKIP: {
                              entrydate
                              firstname
                              freight
-                             gst
+                             gstrate
                              listprice
                              notes
                              ordernumber
diff --git a/t/db_dependent/AuthoritiesMarc.t b/t/db_dependent/AuthoritiesMarc.t
new file mode 100755 (executable)
index 0000000..9c8c1fd
--- /dev/null
@@ -0,0 +1,98 @@
+#!/usr/bin/perl
+#
+# This Koha test module is a stub!  
+# Add more tests here!!!
+
+use strict;
+use warnings;
+
+use Test::More tests => 5;
+use Test::MockModule;
+use MARC::Record;
+
+BEGIN {
+        use_ok('C4::AuthoritiesMarc');
+}
+
+# We are now going to be testing the authorities hierarchy code, and
+# therefore need to pretend that we have consistent data in our database
+my $module = new Test::MockModule('C4::AuthoritiesMarc');
+$module->mock('GetHeaderAuthority', sub {
+    return {'authtrees' => ''};
+});
+$module->mock('AddAuthorityTrees', sub {
+    return;
+});
+$module->mock('GetAuthority', sub {
+    my ($authid) = @_;
+    my $record = MARC::Record->new();
+    if ($authid eq '1') {
+        $record->add_fields(
+            [ '001', '1' ],
+            [ '151', ' ', ' ', a => 'United States' ]
+            );
+    } elsif ($authid eq '2') {
+        $record->add_fields(
+            [ '001', '2' ],
+            [ '151', ' ', ' ', a => 'New York (State)' ],
+            [ '551', ' ', ' ', a => 'United States', w => 'g', 9 => '1' ]
+            );
+    } elsif ($authid eq '3') {
+        $record->add_fields(
+            [ '001', '3' ],
+            [ '151', ' ', ' ', a => 'New York (City)' ],
+            [ '551', ' ', ' ', a => 'New York (State)', w => 'g', 9 => '2' ]
+            );
+    } elsif ($authid eq '4') {
+        $record->add_fields(
+            [ '001', '4' ],
+            [ '151', ' ', ' ', a => 'New York (City)' ],
+            [ '551', ' ', ' ', a => 'New York (State)', w => 'g' ]
+            );
+    } else {
+        undef $record;
+    }
+    return $record;
+});
+
+is(BuildAuthHierarchies(3, 1), '1,2,3', "Built linked authtrees hierarchy string");
+
+my $expectedhierarchy = [ [ {
+        'authid' => '1',
+        'value' => 'United States',
+        'class' => 'child0',
+        'children' => [ {
+            'authid' => '2',
+            'value' => 'New York (State)',
+            'class' => 'child1',
+            'children' => [ {
+                'authid' => '3',
+                'current_value' => 1,
+                'value' => 'New York (City)',
+                'class' => 'child2',
+                'children' => [],
+                'parents' => [ {
+                    'authid' => '2',
+                    'value' => 'New York (State)'
+                } ]
+            } ],
+            'parents' => [ {
+                'authid' => '1',
+                'value' => 'United States'
+            } ]
+        } ],
+        'parents' => []
+} ] ];
+
+is_deeply(GenerateHierarchy(3), $expectedhierarchy, "Generated hierarchy data structure for linked hierarchy");
+
+is(BuildAuthHierarchies(4, 1), '4', "Built unlinked authtrees hierarchy string");
+$expectedhierarchy = [ [ {
+    'authid' => '4',
+    'current_value' => 1,
+    'value' => 'New York (City)',
+    'class' => 'child0',
+    'children' => [],
+    'parents' => []
+} ] ];
+is_deeply(GenerateHierarchy(4), $expectedhierarchy, "Generated hierarchy data structure for unlinked hierarchy");
index eac3265..5105e84 100755 (executable)
@@ -5,6 +5,7 @@ use strict;
 use warnings;
 
 use Test::More;
+use Test::MockModule;
 use vars qw($debug $koha $dbh $config $ret);
 
 BEGIN {
@@ -42,6 +43,65 @@ foreach (grep {defined $koha->{$_}} sort @keys) {
 }
 ok($config = $koha->{config}, 'Getting $koha->{config} ');
 
+diag "Testing syspref caching.";
+
+my $dbh = C4::Context->dbh;
+$dbh->disconnect;
+
+my $module = new Test::MockModule('C4::Context');
+$module->mock(
+    '_new_dbh',
+    sub {
+        my $dbh = DBI->connect( 'DBI:Mock:', '', '' )
+          || die "Cannot create handle: $DBI::errstr\n";
+        return $dbh;
+    }
+);
+
+my $history;
+$dbh = C4::Context->dbh;
+
+$dbh->{mock_add_resultset} = [ ['value'], ['thing1'] ];
+$dbh->{mock_add_resultset} = [ ['value'], ['thing2'] ];
+$dbh->{mock_add_resultset} = [ ['value'], ['thing3'] ];
+$dbh->{mock_add_resultset} = [ ['value'], ['thing4'] ];
+
+is(C4::Context->preference("SillyPreference"), 'thing1', "Retrieved syspref (value='thing1') successfully with default behavior");
+$history = $dbh->{mock_all_history};
+is(scalar(@{$history}), 1, 'Retrieved syspref from database');
+
+$dbh->{mock_clear_history} = 1;
+is(C4::Context->preference("SillyPreference"), 'thing1', "Retrieved syspref (value='thing1') successfully with default behavior");
+$history = $dbh->{mock_all_history};
+is(scalar(@{$history}), 0, 'Did not retrieve syspref from database');
+
+C4::Context->disable_syspref_cache();
+is(C4::Context->preference("SillyPreference"), 'thing2', "Retrieved syspref (value='thing2') successfully with disabled cache");
+$history = $dbh->{mock_all_history};
+is(scalar(@{$history}), 1, 'Retrieved syspref from database');
+
+$dbh->{mock_clear_history} = 1;
+is(C4::Context->preference("SillyPreference"), 'thing3', "Retrieved syspref (value='thing3') successfully with disabled cache");
+$history = $dbh->{mock_all_history};
+is(scalar(@{$history}), 1, 'Retrieved syspref from database');
+
+C4::Context->enable_syspref_cache();
+$dbh->{mock_clear_history} = 1;
+is(C4::Context->preference("SillyPreference"), 'thing3', "Retrieved syspref (value='thing3') successfully from cache");
+$history = $dbh->{mock_all_history};
+is(scalar(@{$history}), 0, 'Did not retrieve syspref from database');
+
+C4::Context->clear_syspref_cache();
+$dbh->{mock_clear_history} = 1;
+is(C4::Context->preference("SillyPreference"), 'thing4', "Retrieved syspref (value='thing4') successfully after clearing cache");
+$history = $dbh->{mock_all_history};
+is(scalar(@{$history}), 1, 'Retrieved syspref from database');
+
+$dbh->{mock_clear_history} = 1;
+is(C4::Context->preference("SillyPreference"), 'thing4', "Retrieved syspref (value='thing4') successfully from cache");
+$history = $dbh->{mock_all_history};
+is(scalar(@{$history}), 0, 'Did not retrieve syspref from database');
+
 done_testing();
 
 1;
diff --git a/t/db_dependent/Holidays.t b/t/db_dependent/Holidays.t
new file mode 100755 (executable)
index 0000000..5c4da1b
--- /dev/null
@@ -0,0 +1,45 @@
+use strict;
+use warnings;
+use 5.010;
+use DateTime;
+use DateTime::TimeZone;
+
+use C4::Context;
+use Test::More tests => 8;
+
+BEGIN { use_ok('Koha::Calendar'); }
+BEGIN { use_ok('C4::Calendar'); }
+
+my $branchcode = 'MPL';
+
+my $koha_calendar = Koha::Calendar->new( branchcode => $branchcode );
+my $c4_calendar = C4::Calendar->new( branchcode => $branchcode );
+
+isa_ok( $koha_calendar, 'Koha::Calendar', 'Koha::Calendar class returned' );
+isa_ok( $c4_calendar,   'C4::Calendar',   'C4::Calendar class returned' );
+
+my $sunday = DateTime->new(
+    year  => 2011,
+    month => 6,
+    day   => 26,
+);
+my $monday = DateTime->new(
+    year  => 2011,
+    month => 6,
+    day   => 27,
+);
+my $christmas = DateTime->new(
+    year  => 2032,
+    month => 12,
+    day   => 25,
+);
+my $newyear = DateTime->new(
+    year  => 2035,
+    month => 1,
+    day   => 1,
+);
+
+is( $koha_calendar->is_holiday($sunday),    1, 'Sunday is a closed day' );
+is( $koha_calendar->is_holiday($monday),    0, 'Monday is not a closed day' );
+is( $koha_calendar->is_holiday($christmas), 1, 'Christmas is a closed day' );
+is( $koha_calendar->is_holiday($newyear), 1, 'New Years day is a closed day' );
index ca4d42e..1e20318 100755 (executable)
@@ -5,6 +5,9 @@ use warnings;
 use C4::Branch;
 
 use Test::More tests => 4;
+use MARC::Record;
+use C4::Biblio;
+use C4::Items;
 
 BEGIN {
        use FindBin;
@@ -12,6 +15,20 @@ BEGIN {
        use_ok('C4::Reserves');
 }
 
+# Setup Test------------------------
+# Helper biblio.
+diag("\nCreating biblio instance for testing.");
+my ($bibnum, $title, $bibitemnum) = create_helper_biblio();
+
+# Helper item for that biblio.
+diag("Creating item instance for testing.");
+my ($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => 'CPL', holdingbranch => 'CPL' } , $bibnum);
+
+# Modify item; setting barcode.
+my $testbarcode = '97531';
+ModItem({ barcode => $testbarcode }, $bibnum, $itemnumber);
+
+# Get a borrower
 my $dbh = C4::Context->dbh;
 my $query = qq/SELECT borrowernumber
     FROM   borrowers
@@ -20,27 +37,16 @@ my $sth = $dbh->prepare($query);
 $sth->execute;
 my $borrower = $sth->fetchrow_hashref;
 
-$query = qq/SELECT biblionumber, title, itemnumber, barcode
-    FROM biblio
-    LEFT JOIN items USING (biblionumber)
-    WHERE barcode <> ""
-    AND barcode IS NOT NULL
-    LIMIT  1/;
-$sth = $dbh->prepare($query);
-$sth->execute;
-my $biblio = $sth->fetchrow_hashref;
-
-
 my $borrowernumber = $borrower->{'borrowernumber'};
-my $biblionumber   = $biblio->{'biblionumber'};
-my $itemnumber     = $biblio->{'itemnumber'};
-my $barcode        = $biblio->{'barcode'};
+my $biblionumber   = $bibnum;
+my $barcode        = $testbarcode;
 
 my $constraint     = 'a';
 my $bibitems       = '';
 my $priority       = '1';
+my $resdate        = undef;
+my $expdate        = undef;
 my $notes          = '';
-my $title          = $biblio->{'title'};
 my $checkitem      = undef;
 my $found          = undef;
 
@@ -48,7 +54,7 @@ my @branches = GetBranchesLoop();
 my $branch = $branches[0][0]{value};
 
 AddReserve($branch,    $borrowernumber, $biblionumber,
-        $constraint, $bibitems,  $priority,       $notes,
+        $constraint, $bibitems,  $priority, $resdate, $expdate, $notes,
         $title,      $checkitem, $found);
         
 my ($status, $reserve, $all_reserves) = CheckReserves($itemnumber, $barcode);
@@ -60,3 +66,23 @@ ok($status eq "Reserved", "CheckReserves Test 2");
 ($status, $reserve, $all_reserves) = CheckReserves(undef, $barcode);
 ok($status eq "Reserved", "CheckReserves Test 3");
 
+
+# Teardown Test---------------------
+# Delete item.
+diag("Deleting item testing instance.");
+DelItem($dbh, $bibnum, $itemnumber);
+
+# Delete helper Biblio.
+diag("Deleting biblio testing instance.");
+DelBiblio($bibnum);
+
+# Helper method to set up a Biblio.
+sub create_helper_biblio {
+    my $bib = MARC::Record->new();
+    my $title = 'Silence in the library';
+    $bib->append_fields(
+        MARC::Field->new('100', ' ', ' ', a => 'Moffat, Steven'),
+        MARC::Field->new('245', ' ', ' ', a => $title),
+    );
+    return ($bibnum, $title, $bibitemnum) = AddBiblio($bib, '');
+}
diff --git a/t/db_dependent/SuggestionEngine_ExplodedTerms.t b/t/db_dependent/SuggestionEngine_ExplodedTerms.t
new file mode 100755 (executable)
index 0000000..b97166e
--- /dev/null
@@ -0,0 +1,90 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use File::Basename;
+use File::Spec;
+use Test::More;
+use Test::MockModule;
+
+BEGIN {
+        use_ok('Koha::SuggestionEngine');
+}
+
+my $langModule = new Test::MockModule('C4::Languages');
+$langModule->mock('regex_lang_subtags', sub {
+    return {
+        'extension' => undef,
+        'script' => undef,
+        'privateuse' => undef,
+        'variant' => undef,
+        'language' => 'en',
+        'region' => undef,
+        'rfc4646_subtag' => 'en'
+    };
+});
+$langModule->mock('getTranslatedLanguages', sub {
+   return [
+       {
+           'sublanguages_loop' => [
+           {
+               'script' => undef,
+               'extension' => undef,
+               'language' => 'en',
+               'region' => undef,
+               'region_description' => undef,
+               'sublanguage_current' => 1,
+               'privateuse' => undef,
+               'variant' => undef,
+               'variant_description' => undef,
+               'script_description' => undef,
+               'rfc4646_subtag' => 'en',
+               'native_description' => 'English',
+               'enabled' => 1
+           },
+           ],
+           'plural' => 1,
+           'language' => 'en',
+           'current' => 1,
+           'native_description' => 'English',
+           'rfc4646_subtag' => 'en',
+           'group_enabled' => 1
+       }
+   ];
+});
+my $tmplModule = new Test::MockModule('C4::Templates');
+$tmplModule->mock('_get_template_file', sub {
+    my ($tmplbase, $interface, $query) = @_;
+    my $opactmpl = File::Spec->rel2abs(dirname(__FILE__) . '/../../koha-tmpl/opac-tmpl');
+    return ($opactmpl, 'prog', 'en', "$opactmpl/prog/en/modules/$tmplbase");
+});
+my $contextModule = new Test::MockModule('C4::Context');
+$contextModule->mock('preference', sub {
+    return '';
+});
+$contextModule->mock('config', sub {
+    return '';
+});
+
+
+my $suggestor = Koha::SuggestionEngine->new( { plugins => [ 'ExplodedTerms' ] } );
+is(ref($suggestor), 'Koha::SuggestionEngine', 'Created suggestion engine');
+
+my $result = $suggestor->get_suggestions({search => 'Cookery'});
+
+ok((grep { $_->{'search'} eq 'su-na=Cookery' } @$result) && (grep { $_->{'search'} eq 'su-br=Cookery' } @$result) && (grep { $_->{'search'} eq 'su-rl=Cookery' } @$result), "Suggested correct alternatives for keyword search 'Cookery'");
+
+$result = $suggestor->get_suggestions({search => 'su:Cookery'});
+
+ok((grep { $_->{'search'} eq 'su-na=Cookery' } @$result) && (grep { $_->{'search'} eq 'su-br=Cookery' } @$result) && (grep { $_->{'search'} eq 'su-rl=Cookery' } @$result), "Suggested correct alternatives for subject search 'Cookery'");
+
+$result = $suggestor->get_suggestions({search => 'nt:Cookery'});
+
+is(scalar @$result, 0, "No suggestions for fielded search");
+
+$result = $suggestor->get_suggestions({search => 'ccl=su:Cookery'});
+
+is(scalar @$result, 0, "No suggestions for CCL search");
+
+done_testing();
index 83b3c9b..5359e30 100755 (executable)
@@ -6,9 +6,60 @@
 use strict;
 use warnings;
 
-use Test::More tests => 1;
+use Test::More tests => 30;
 
 BEGIN {
         use_ok('C4::Tags');
 }
 
+# Simple 'sequential 5' test
+my $tags = make_tags(1,2,3,4,5);
+my @strata = (0,1,2,3,4);
+my ($min, $max) = C4::Tags::stratify_tags(5, $tags);
+check_tag_strata($tags, \@strata, 'Sequential 5');
+is($min, 0, 'Sequential 5 min');
+is($max, 4, 'Sequential 5 max');
+
+# Reverse test - should have the same results as previous
+$tags = make_tags(5,4,3,2,1);
+@strata = (4,3,2,1,0);
+($min, $max) = C4::Tags::stratify_tags(5, $tags);
+check_tag_strata($tags, \@strata, 'Reverse Sequential 5');
+is($min, 0, 'Sequential 5 min');
+is($max, 4, 'Sequential 5 max');
+
+# All the same test - should all have the same results
+$tags = make_tags(4,4,4,4,4);
+@strata = (0,0,0,0,0);
+($min, $max) = C4::Tags::stratify_tags(5, $tags);
+check_tag_strata($tags, \@strata, 'All The Same');
+is($min, 0, 'Sequential 5 min');
+is($max, 0, 'Sequential 5 max');
+
+# Some the same, some different
+$tags = make_tags(1,2,2,3,3,8);
+@strata = (0,0,0,1,1,4);
+($min, $max) = C4::Tags::stratify_tags(5, $tags);
+check_tag_strata($tags, \@strata, 'All The Same');
+is($min, 0, 'Sequential 5 min');
+is($max, 7, 'Sequential 5 max');
+
+# Runs tests against the results
+sub check_tag_strata {
+    my ($tags, $expected, $name) = @_;
+
+    foreach my $t (@$tags) {
+        my $w = $t->{weight_total};
+        my $s = $t->{stratum};
+        is($s, shift @$expected, $name . " - $w ($s)");
+    }
+}
+
+# Makes some tags with just enough info to test
+sub make_tags {
+    my @res;
+    while (@_) {
+        push @res, { weight_total => shift @_ };
+    }
+    return \@res;
+}
index d8cf495..601c48f 100644 (file)
@@ -818,7 +818,7 @@ sub stop_zebrasrv {
 
 sub start_zebraqueue_daemon {
 
-    my $command = q(run/bin/koha-zebraqueue-ctl.sh start);
+    my $command = q(echo "zebraqueue_daemon is deprecated");
     diag $command;
     my $started = system( $command );
     diag "started: $started";
@@ -832,7 +832,7 @@ sub start_zebraqueue_daemon {
 
 sub stop_zebraqueue_daemon {
 
-    my $command = q(run/bin/koha-zebraqueue-ctl.sh stop);
+    my $command = q(echo "zebraqueue_daemon is deprecated");
     diag $command;
     my $started = system( $command );
     diag "started: $started";
index c26e5f2..383ee1b 100644 (file)
@@ -48,6 +48,7 @@ sub one_parcel : Test( 17 ) {
                                         undef,         # $quantrec,
                                         undef,         # $user,
                                         undef,         # $cost,
+                                        undef,         # $ecost,
                                         $invoice,         # $invoiceno,
                                         undef,         # $freight,
                                         undef,         # $rrp,
index fd3ad0f..e0c815b 100644 (file)
@@ -276,6 +276,7 @@ sub create_order {
                                         undef,         # $quantrec,
                                         undef,         # $user,
                                         undef,         # $cost,
+                                        undef,         # $ecost,
                                         $param{'invoice'},         # $invoiceno,
                                         undef,         # $freight,
                                         undef,         # $rrp,
diff --git a/t/optional/Cache_Memcached.t b/t/optional/Cache_Memcached.t
new file mode 100755 (executable)
index 0000000..a9366cc
--- /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('Koha::Cache::Memcached');
+}
+
index 3ba93a8..2c68bd3 100755 (executable)
@@ -53,6 +53,7 @@ my $template_flag;
 if (!defined $op) {
     $template_name = "tools/batchMod.tmpl";
     $template_flag = { tools => '*' };
+    $op = q{};
 } else {
     $template_name = ($del) ? "tools/batchMod-del.tmpl" : "tools/batchMod-edit.tmpl";
     $template_flag = ($del) ? { tools => 'items_batchdel' }   : { tools => 'items_batchmod' };
@@ -393,14 +394,14 @@ foreach my $tag (sort keys %{$tagslib}) {
                        my $temp;
             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 );
-            $subfield_data{marc_value} = qq[<input $attributes
+            $subfield_data{marc_value} = qq[<input type="text" $attributes
                 onfocus="Focus$function_name($subfield_data{random}, '$subfield_data{id}');"
                  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
+            $subfield_data{marc_value} = "<input type=\"text\" $attributes />"; # supply default input form
         }
     }
     elsif ( $tag eq '' ) {       # it's an hidden field
@@ -419,7 +420,7 @@ foreach my $tag (sort keys %{$tagslib}) {
         $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\" $attributes />";
     }
 #   $subfield_data{marc_value}="<input type=\"text\" name=\"field_value\">";
     push (@loop_data, \%subfield_data);
@@ -440,8 +441,8 @@ foreach my $tag (sort keys %{$tagslib}) {
 $template->param(%$items_display_hashref) if $items_display_hashref;
 $template->param(
     op      => $nextop,
-    $op => 1,
 );
+$template->param( $op => 1 ) if $op;
 
 if ($op eq "action") {
 
@@ -457,9 +458,10 @@ if ($op eq "action") {
 }
 
 foreach my $error (@errors) {
-    $template->param($error => 1);
+    $template->param($error => 1) if $error;
 }
 $template->param(src => $src);
+$template->param(biblionumber => $biblionumber);
 output_html_with_http_headers $input, $cookie, $template->output;
 exit;
 
index 64a4860..0a36a20 100755 (executable)
@@ -7,7 +7,7 @@ use CGI;
 
 use C4::Auth;
 use C4::Output;
-
+use DateTime;
 
 use C4::Calendar;
 
@@ -19,10 +19,13 @@ my $weekday = $input->param('showWeekday');
 my $day = $input->param('showDay');
 my $month = $input->param('showMonth');
 my $year = $input->param('showYear');
+my $day1;
+my $month1;
+my $year1;
 my $title = $input->param('showTitle');
 my $description = $input->param('showDescription');
 my $holidaytype = $input->param('showHolidayType');
-
+my $datecancelrange = $input->param('datecancelrange');
 my $calendardate = sprintf("%04d-%02d-%02d", $year, $month, $day);
 my $isodate = C4::Dates->new($calendardate, 'iso');
 $calendardate = $isodate->output('syspref');
@@ -37,12 +40,53 @@ if ($description) {
     $description = '';
 }   
 
+# We format the date
+my @dateend = split(/[\/-]/, $datecancelrange);
+if (C4::Context->preference("dateformat") eq "metric") {
+    $day1 = $dateend[0];
+    $month1 = $dateend[1];
+    $year1 = $dateend[2];
+}elsif (C4::Context->preference("dateformat") eq "us") {
+    $month1 = $dateend[0];
+    $day1 = $dateend[1];
+    $year1 = $dateend[2];
+} else {
+    $year1 = $dateend[0];
+    $month1 = $dateend[1];
+    $day1 = $dateend[2];
+}
+
+# We make an array with holiday's days
+my @holiday_list;
+if ($year1 && $month1 && $day1){
+            my $first_dt = DateTime->new(year => $year, month  => $month,  day => $day);
+            my $end_dt   = DateTime->new(year => $year1, month  => $month1,  day => $day1);
+
+            for (my $dt = $first_dt->clone();
+                $dt <= $end_dt;
+                $dt->add(days => 1) )
+                {
+                push @holiday_list, $dt->clone();
+                }
+}
 if ($input->param('showOperation') eq 'exception') {
        $calendar->insert_exception_holiday(day => $day,
                                                                                month => $month,
                                                                            year => $year,
                                                                title => $title,
                                                                description => $description);
+} elsif ($input->param('showOperation') eq 'exceptionrange' ) {
+        if (@holiday_list){
+            foreach my $date (@holiday_list){
+                $calendar->insert_exception_holiday(
+                    day         => $date->{local_c}->{day},
+                    month       => $date->{local_c}->{month},
+                    year       => $date->{local_c}->{year},
+                    title       => $title,
+                    description => $description
+                    );
+            }
+        }
 } elsif ($input->param('showOperation') eq 'edit') {
     if($holidaytype eq 'weekday') {
       $calendar->ModWeekdayholiday(weekday => $weekday,
@@ -71,5 +115,31 @@ if ($input->param('showOperation') eq 'exception') {
                                  day => $day,
                                  month => $month,
                                              year => $year);
+}elsif ($input->param('showOperation') eq 'deleterange') {
+    if (@holiday_list){
+        foreach my $date (@holiday_list){
+            $calendar->delete_holiday_range(weekday => $weekday,
+                                            day => $date->{local_c}->{day},
+                                            month => $date->{local_c}->{month},
+                                            year => $date->{local_c}->{year});
+            }
+    }
+}elsif ($input->param('showOperation') eq 'deleterangerepeat') {
+    if (@holiday_list){
+        foreach my $date (@holiday_list){
+           $calendar->delete_holiday_range_repeatable(weekday => $weekday,
+                                         day => $date->{local_c}->{day},
+                                         month => $date->{local_c}->{month});
+        }
+    }
+}elsif ($input->param('showOperation') eq 'deleterangerepeatexcept') {
+    if (@holiday_list){
+        foreach my $date (@holiday_list){
+           $calendar->delete_exception_holiday_range(weekday => $weekday,
+                                         day => $date->{local_c}->{day},
+                                         month => $date->{local_c}->{month},
+                                         year => $date->{local_c}->{year});
+        }
+    }
 }
 print $input->redirect("/cgi-bin/koha/tools/holidays.pl?branch=$branchcode&calendardate=$calendardate");
index a4eb6e9..c7a8fd8 100755 (executable)
@@ -538,12 +538,12 @@ sub construct_query {
             }
 
             if ($start_callnumber) {
-                $sql_query .= " AND itemcallnumber <= ? ";
+                $sql_query .= " AND itemcallnumber >= ? ";
                 push @sql_params, $start_callnumber;
             }
 
             if ($end_callnumber) {
-                $sql_query .= " AND itemcallnumber >= ? ";
+                $sql_query .= " AND itemcallnumber <= ? ";
                 push @sql_params, $end_callnumber;
             }
             if ($start_accession) {
index 03f5bb9..32d3645 100755 (executable)
@@ -29,6 +29,7 @@ use MARC::File::USMARC;
 use C4::Context;
 use C4::Koha;
 use C4::Auth;
+use C4::AuthoritiesMarc;
 use C4::Output;
 use C4::Biblio;
 use C4::ImportBatch;
@@ -59,7 +60,7 @@ my ($template, $loggedinuser, $cookie)
                  });
 
 my %cookies = parse CGI::Cookie($cookie);
-my $sessionID = $cookies{'CGISESSID'}->value;
+our $sessionID = $cookies{'CGISESSID'}->value;
 our $dbh = C4::Context->dbh;
 
 # Frameworks selection loop
@@ -99,7 +100,7 @@ if ($op eq "") {
     if ($import_batch_id eq '') {
         import_batches_list($template, $offset, $results_per_page);
     } else {
-        import_biblios_list($template, $import_batch_id, $offset, $results_per_page);
+        import_records_list($template, $import_batch_id, $offset, $results_per_page);
     }
 } elsif ($op eq "commit-batch") {
     if ($completedJobID) {
@@ -108,14 +109,14 @@ if ($op eq "") {
         my $framework = $input->param('framework');
         commit_batch($template, $import_batch_id, $framework);
     }
-    import_biblios_list($template, $import_batch_id, $offset, $results_per_page);
+    import_records_list($template, $import_batch_id, $offset, $results_per_page);
 } elsif ($op eq "revert-batch") {
     if ($completedJobID) {
         add_saved_job_results_to_template($template, $completedJobID);
     } else {
         revert_batch($template, $import_batch_id);
     }
-    import_biblios_list($template, $import_batch_id, $offset, $results_per_page);
+    import_records_list($template, $import_batch_id, $offset, $results_per_page);
 } elsif ($op eq "clean-batch") {
     CleanBatch($import_batch_id);
     import_batches_list($template, $offset, $results_per_page);
@@ -131,7 +132,7 @@ if ($op eq "") {
     my $item_action = $input->param('item_action');
     redo_matching($template, $import_batch_id, $new_matcher_id, $current_matcher_id, 
                   $overlay_action, $nomatch_action, $item_action);
-    import_biblios_list($template, $import_batch_id, $offset, $results_per_page);
+    import_records_list($template, $import_batch_id, $offset, $results_per_page);
 } 
 
 output_html_with_http_headers $input, $cookie, $template->output;
@@ -163,21 +164,17 @@ sub redo_matching {
         $template->param('changed_item_action' => 1);
     }
 
-    if ($new_matcher_id eq $current_matcher_id) {
-        return;
-    } 
-
     my $num_with_matches = 0;
     if (defined $new_matcher_id and $new_matcher_id ne "") {
         my $matcher = C4::Matcher->fetch($new_matcher_id);
         if (defined $matcher) {
-            $num_with_matches = BatchFindBibDuplicates($import_batch_id, $matcher);
+            $num_with_matches = BatchFindDuplicates($import_batch_id, $matcher);
             SetImportBatchMatcher($import_batch_id, $new_matcher_id);
         } else {
             $rematch_failed = 1;
         }
     } else {
-        $num_with_matches = BatchFindBibDuplicates($import_batch_id, undef);
+        $num_with_matches = BatchFindDuplicates($import_batch_id, undef);
         SetImportBatchMatcher($import_batch_id, undef);
         SetImportBatchOverlayAction('create_new');
     }
@@ -214,13 +211,14 @@ sub import_batches_list {
     foreach my $batch (@$batches) {
         push @list, {
             import_batch_id => $batch->{'import_batch_id'},
-            num_biblios => $batch->{'num_biblios'},
+            num_records => $batch->{'num_records'},
             num_items => $batch->{'num_items'},
             upload_timestamp => $batch->{'upload_timestamp'},
             import_status => $batch->{'import_status'},
             file_name => $batch->{'file_name'} || "($batch->{'batch_type'})",
             comments => $batch->{'comments'},
             can_clean => ($batch->{'import_status'} ne 'cleaned') ? 1 : 0,
+            record_type => $batch->{'record_type'},
         };
     }
     $template->param(batch_list => \@list); 
@@ -244,7 +242,7 @@ sub commit_batch {
         $callback = progress_callback($job, $dbh);
     }
     my ($num_added, $num_updated, $num_items_added, $num_items_errored, $num_ignored) = 
-        BatchCommitBibRecords($import_batch_id, $framework, 50, $callback);
+        BatchCommitRecords($import_batch_id, $framework, 50, $callback);
     $dbh->commit();
 
     my $results = {
@@ -273,7 +271,7 @@ sub revert_batch {
         $callback = progress_callback($job, $dbh);
     }
     my ($num_deleted, $num_errors, $num_reverted, $num_items_deleted, $num_ignored) = 
-        BatchRevertBibRecords($import_batch_id, 50, $callback);
+        BatchRevertRecords($import_batch_id, 50, $callback);
     $dbh->commit();
 
     my $results = {
@@ -295,7 +293,7 @@ sub put_in_background {
     my $import_batch_id = shift;
 
     my $batch = GetImportBatch($import_batch_id);
-    my $job = C4::BackgroundJob->new($sessionID, $batch->{'file_name'}, $ENV{'SCRIPT_NAME'}, $batch->{'num_biblios'});
+    my $job = C4::BackgroundJob->new($sessionID, $batch->{'file_name'}, $ENV{'SCRIPT_NAME'}, $batch->{'num_records'});
     my $jobID = $job->id();
 
     # fork off
@@ -350,46 +348,53 @@ sub add_saved_job_results_to_template {
     add_results_to_template($template, $results);
 }
 
-sub import_biblios_list {
+sub import_records_list {
     my ($template, $import_batch_id, $offset, $results_per_page) = @_;
 
     my $batch = GetImportBatch($import_batch_id);
-    my $biblios = GetImportBibliosRange($import_batch_id, $offset, $results_per_page);
+    my $records = GetImportRecordsRange($import_batch_id, $offset, $results_per_page);
     my @list = ();
-    foreach my $biblio (@$biblios) {
-        my $citation = $biblio->{'title'};
-        $citation .= " $biblio->{'author'}" if $biblio->{'author'};
-        $citation .= " (" if $biblio->{'issn'} or $biblio->{'isbn'};
-        $citation .= $biblio->{'isbn'} if $biblio->{'isbn'};
-        $citation .= ", " if $biblio->{'issn'} and $biblio->{'isbn'};
-        $citation .= $biblio->{'issn'} if $biblio->{'issn'};
-        $citation .= ")" if $biblio->{'issn'} or $biblio->{'isbn'};
-
-        my $match = GetImportRecordMatches($biblio->{'import_record_id'}, 1);
+    foreach my $record (@$records) {
+        my $citation = $record->{'title'} || $record->{'authorized_heading'};
+        $citation .= " $record->{'author'}" if $record->{'author'};
+        $citation .= " (" if $record->{'issn'} or $record->{'isbn'};
+        $citation .= $record->{'isbn'} if $record->{'isbn'};
+        $citation .= ", " if $record->{'issn'} and $record->{'isbn'};
+        $citation .= $record->{'issn'} if $record->{'issn'};
+        $citation .= ")" if $record->{'issn'} or $record->{'isbn'};
+
+        my $match = GetImportRecordMatches($record->{'import_record_id'}, 1);
         my $match_citation = '';
         if ($#$match > -1) {
-            $match_citation .= $match->[0]->{'title'} if defined($match->[0]->{'title'});
-            $match_citation .= ' ' . $match->[0]->{'author'} if defined($match->[0]->{'author'});
+            if ($match->[0]->{'record_type'} eq 'biblio') {
+                $match_citation .= $match->[0]->{'title'} if defined($match->[0]->{'title'});
+                $match_citation .= ' ' . $match->[0]->{'author'} if defined($match->[0]->{'author'});
+            } elsif ($match->[0]->{'record_type'} eq 'auth') {
+                $match_citation .= $match->[0]->{'authorized_heading'} if defined($match->[0]->{'authorized_heading'});
+            }
         }
 
         push @list,
-          { import_record_id         => $biblio->{'import_record_id'},
-            final_match_biblionumber => $biblio->{'matched_biblionumber'},
+          { import_record_id         => $record->{'import_record_id'},
+            final_match_id           => $record->{'matched_biblionumber'} || $record->{'matched_authid'},
             citation                 => $citation,
-            status                   => $biblio->{'status'},
-            record_sequence          => $biblio->{'record_sequence'},
-            overlay_status           => $biblio->{'overlay_status'},
-            match_biblionumber       => $#$match > -1 ? $match->[0]->{'biblionumber'} : 0,
+            status                   => $record->{'status'},
+            record_sequence          => $record->{'record_sequence'},
+            overlay_status           => $record->{'overlay_status'},
+            # Sorry about the match_id being from the "biblionumber" field;
+            # as it turns out, any match id will go in biblionumber
+            match_id                 => $#$match > -1 ? $match->[0]->{'biblionumber'} : 0,
             match_citation           => $match_citation,
             match_score              => $#$match > -1 ? $match->[0]->{'score'} : 0,
+            record_type              => $record->{'record_type'},
           };
     }
-    my $num_biblios = $batch->{'num_biblios'};
-    $template->param(biblio_list => \@list); 
-    add_page_numbers($template, $offset, $results_per_page, $num_biblios);
+    my $num_records = $batch->{'num_records'};
+    $template->param(record_list => \@list);
+    add_page_numbers($template, $offset, $results_per_page, $num_records);
     $template->param(offset => $offset);
     $template->param(range_top => $offset + $results_per_page - 1);
-    $template->param(num_results => $num_biblios);
+    $template->param(num_results => $num_records);
     $template->param(results_per_page => $results_per_page);
     $template->param(import_batch_id => $import_batch_id);
     my $overlay_action = GetImportBatchOverlayAction($import_batch_id);
@@ -412,12 +417,13 @@ sub batch_info {
     $template->param(comments => $batch->{'comments'});
     $template->param(import_status => $batch->{'import_status'});
     $template->param(upload_timestamp => $batch->{'upload_timestamp'});
-    $template->param(num_biblios => $batch->{'num_biblios'});
-    $template->param(num_items => $batch->{'num_biblios'});
+    $template->{VARS}->{'record_type'} = $batch->{'record_type'};
+    $template->param(num_records => $batch->{'num_records'});
+    $template->param(num_items => $batch->{'num_items'});
     if ($batch->{'import_status'} ne 'cleaned') {
         $template->param(can_clean => 1);
     }
-    if ($batch->{'num_biblios'} > 0) {
+    if ($batch->{'num_records'} > 0) {
         if ($batch->{'import_status'} eq 'staged' or $batch->{'import_status'} eq 'reverted') {
             $template->param(can_commit => 1);
         }
index 50bb668..a2c27c6 100755 (executable)
@@ -155,21 +155,18 @@ if ( $op eq 'show' ) {
     my @fields = (
         {
             name => "surname",
-            lib  => "Surname",
             type => "text",
             mandatory => ( grep /surname/, @mandatoryFields ) ? 1 : 0
         }
         ,
         {
             name => "firstname",
-            lib  => "Firstname",
             type => "text",
             mandatory => ( grep /surname/, @mandatoryFields ) ? 1 : 0,
         }
         ,
         {
             name => "branchcode",
-            lib  => "Branchname",
             type => "select",
             option => \@branches_option,
             mandatory => ( grep /branchcode/, @mandatoryFields ) ? 1 : 0,
@@ -177,7 +174,6 @@ if ( $op eq 'show' ) {
         ,
         {
             name => "categorycode",
-            lib  => "Category",
             type => "select",
             option => \@categories_option,
             mandatory => ( grep /categorycode/, @mandatoryFields ) ? 1 : 0,
@@ -185,7 +181,6 @@ if ( $op eq 'show' ) {
         ,
         {
             name => "sort1",
-            lib  => "Sort 1",
             type => @sort1_option ? "select" : "text",
             option => \@sort1_option,
             mandatory => ( grep /sort1/, @mandatoryFields ) ? 1 : 0,
@@ -193,7 +188,6 @@ if ( $op eq 'show' ) {
         ,
         {
             name => "sort2",
-            lib  => "Sort 2",
             type => @sort2_option ? "select" : "text",
             option => \@sort2_option,
             mandatory => ( grep /sort2/, @mandatoryFields ) ? 1 : 0,
@@ -201,35 +195,30 @@ if ( $op eq 'show' ) {
         ,
         {
             name => "dateenrolled",
-            lib  => "Date enrolled",
             type => "date",
             mandatory => ( grep /dateenrolled/, @mandatoryFields ) ? 1 : 0,
         }
         ,
         {
             name => "dateexpiry",
-            lib  => "Date expiry",
             type => "date",
             mandatory => ( grep /dateexpiry/, @mandatoryFields ) ? 1 : 0,
         }
         ,
         {
             name => "debarred",
-            lib  => "Debarred",
             type => "date",
             mandatory => ( grep /debarred/, @mandatoryFields ) ? 1 : 0,
         }
         ,
         {
             name => "debarredcomment",
-            lib  => "Debarred comment",
             type => "text",
             mandatory => ( grep /debarredcomment/, @mandatoryFields ) ? 1 : 0,
         }
         ,
         {
             name => "borrowernotes",
-            lib  => "Borrower Notes",
             type => "text",
             mandatory => ( grep /borrowernotes/, @mandatoryFields ) ? 1 : 0,
         }
index c36d328..646276c 100755 (executable)
@@ -15,19 +15,19 @@ use DateTime;
 my $input               = new CGI;
 my $dbh                 = C4::Context->dbh();
 
-my $branchcode          = $input->param('newBranchName');
+our $branchcode          = $input->param('newBranchName');
 my $originalbranchcode  = $branchcode;
-my $weekday             = $input->param('newWeekday');
-my $day                 = $input->param('newDay');
-my $month               = $input->param('newMonth');
-my $year                = $input->param('newYear');
+our $weekday             = $input->param('newWeekday');
+our $day                 = $input->param('newDay');
+our $month               = $input->param('newMonth');
+our $year                = $input->param('newYear');
 my $day1;
 my $month1;
 my $year1;
 my $dateofrange         = $input->param('dateofrange');
-my $title               = $input->param('newTitle');
-my $description         = $input->param('newDescription');
-my $newoperation        = $input->param('newOperation');
+our $title               = $input->param('newTitle');
+our $description         = $input->param('newDescription');
+our $newoperation        = $input->param('newOperation');
 my $allbranches         = $input->param('allBranches');
 
 my $calendardate        = sprintf("%04d-%02d-%02d", $year, $month, $day);
@@ -56,6 +56,20 @@ if ($description) {
        $description = '';
 }
 
+# We make an array with holiday's days
+our @holiday_list;
+if ($year1 && $month1 && $day1){
+            my $first_dt = DateTime->new(year => $year, month  => $month,  day => $day);
+            my $end_dt   = DateTime->new(year => $year1, month  => $month1,  day => $day1);
+
+            for (my $dt = $first_dt->clone();
+                $dt <= $end_dt;
+                $dt->add(days => 1) )
+                {
+                push @holiday_list, $dt->clone();
+                }
+}
+
 if($allbranches) {
        my $branch;
        my @branchcodes = split(/\|/, $input->param('branchCodes')); 
@@ -100,50 +114,30 @@ sub add_holiday {
                }
 
        } elsif ( $newoperation eq 'holidayrange' ) {
-        #Make an array with holiday's days
-        my $first_dt = DateTime->new(year => $year, month  => $month,  day => $day);
-        my $end_dt   = DateTime->new(year => $year1, month  => $month1,  day => $day1);
-        my @holiday_list = ();
-
-        for (my $dt = $first_dt->clone();
-            $dt <= $end_dt;
-            $dt->add(days => 1) )
-            {
-            push @holiday_list, $dt->clone();
-            }
-
-        foreach my $date (@holiday_list){
-            unless ( $calendar->isHoliday( $date->{local_c}->{day}, $date->{local_c}->{month}, $date->{local_c}->{year} ) ) {
-            $calendar->insert_single_holiday(
-                day         => $date->{local_c}->{day},
-                month       => $date->{local_c}->{month},
-                year        => $date->{local_c}->{year},
-                title       => $title,
-                description => $description
-                );
+        if (@holiday_list){
+            foreach my $date (@holiday_list){
+                unless ( $calendar->isHoliday( $date->{local_c}->{day}, $date->{local_c}->{month}, $date->{local_c}->{year} ) ) {
+                    $calendar->insert_single_holiday(
+                        day         => $date->{local_c}->{day},
+                        month       => $date->{local_c}->{month},
+                        year        => $date->{local_c}->{year},
+                        title       => $title,
+                        description => $description
+                    );
+                }
             }
         }
     } elsif ( $newoperation eq 'holidayrangerepeat' ) {
-        #Make an array with holiday's days
-        my $first_dt = DateTime->new(year => $year, month  => $month,  day => $day);
-        my $end_dt   = DateTime->new(year => $year1, month  => $month1,  day => $day1);
-        my @holiday_list = ();
-
-        for (my $dt = $first_dt->clone();
-            $dt <= $end_dt;
-            $dt->add(days => 1) )
-            {
-            push @holiday_list, $dt->clone();
-            }
-
-        foreach my $date (@holiday_list){
-            unless ( $calendar->isHoliday( $date->{local_c}->{day}, $date->{local_c}->{month}, $date->{local_c}->{year} ) ) {
-            $calendar->insert_day_month_holiday(
-                day         => $date->{local_c}->{day},
-                month       => $date->{local_c}->{month},
-                title       => $title,
-                description => $description
-                );
+        if (@holiday_list){
+            foreach my $date (@holiday_list){
+                unless ( $calendar->isHoliday( $date->{local_c}->{day}, $date->{local_c}->{month}, $date->{local_c}->{year} ) ) {
+                    $calendar->insert_day_month_holiday(
+                        day         => $date->{local_c}->{day},
+                        month       => $date->{local_c}->{month},
+                        title       => $title,
+                        description => $description
+                    );
+                }
             }
         }
     }
index 478a762..cc90d0b 100755 (executable)
@@ -28,7 +28,7 @@ use C4::Branch;
 use C4::Letters;
 use C4::Members;
 
-my $input = new CGI;
+our $input = new CGI;
 my $dbh = C4::Context->dbh;
 
 my @categories = @{$dbh->selectall_arrayref(
@@ -36,7 +36,7 @@ my @categories = @{$dbh->selectall_arrayref(
     { Slice => {} }
 )};
 my @category_codes  = map { $_->{categorycode} } @categories;
-my @rule_params     = qw(delay letter debarred);
+our @rule_params     = qw(delay letter debarred);
 
 # blank_row($category_code) - return true if the entire row is blank.
 sub blank_row {
index bfb233e..4507fa1 100755 (executable)
@@ -80,7 +80,7 @@ if ( ($op eq 'Upload') && $uploadfile ) {       # Case is important in these ope
     $debug and warn "dirname = $dirname";
     my $filesuffix;
     if ( $uploadfilename =~ m/(\..+)$/i ) {
-        my $filesuffix = $1;
+        $filesuffix = $1;
     }
     ( $tfh, $tempfile ) = File::Temp::tempfile( SUFFIX => $filesuffix, UNLINK => 1 );
     $debug and warn "tempfile = $tempfile";
index 926fe9d..da5dc01 100755 (executable)
@@ -46,7 +46,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
 
 my $params = $cgi->Vars; # NOTE: Multivalue parameters NOT allowed!!
 
-print $cgi->header('application/json');
+print $cgi->header('application/json; charset=utf-8');
 
 if ($params->{'action'} eq 'add') {
     my $sth = $dbh->prepare('INSERT INTO quotes (source, text) VALUES (?, ?);');
@@ -58,10 +58,11 @@ if ($params->{'action'} eq 'add') {
     my $new_quote_id = $dbh->{q{mysql_insertid}}; # ALERT: mysqlism here
     $sth = $dbh->prepare('SELECT * FROM quotes WHERE id = ?;');
     $sth->execute($new_quote_id);
-    print to_json($sth->fetchall_arrayref);
+    print to_json($sth->fetchall_arrayref, {utf8 =>1});
     exit 1;
 }
 elsif ($params->{'action'} eq 'edit') {
+    my $aaData = [];
     my $editable_columns = [qw(source text)]; # pay attention to element order; these columns match the quotes table columns
     my $sth = $dbh->prepare("UPDATE quotes SET $editable_columns->[$params->{'column'}-1]  = ? WHERE id = ?;");
     $sth->execute($params->{'value'}, $params->{'id'});
@@ -71,7 +72,9 @@ elsif ($params->{'action'} eq 'edit') {
     }
     $sth = $dbh->prepare("SELECT $editable_columns->[$params->{'column'}-1] FROM quotes WHERE id = ?;");
     $sth->execute($params->{'id'});
-    print $sth->fetchrow_array();
+    $aaData = $sth->fetchrow_array();
+    print Encode::encode('utf8', $aaData);
+
     exit 1;
 }
 elsif ($params->{'action'} eq 'delete') {
@@ -106,5 +109,5 @@ else {
                     iTotalDisplayRecords=>  $iTotalDisplayRecords,
                     sEcho               =>  $params->{'sEcho'},
                     aaData              =>  $aaData,
-                  });
+                  }, {utf8 =>1});
 }
index 0de73d4..fbb5365 100755 (executable)
@@ -55,6 +55,7 @@ my $nomatch_action = $input->param('nomatch_action');
 my $parse_items = $input->param('parse_items');
 my $item_action = $input->param('item_action');
 my $comments = $input->param('comments');
+my $record_type = $input->param('record_type');
 my $encoding = $input->param('encoding');
 my ($template, $loggedinuser, $cookie)
        = get_template_and_user({template_name => "tools/stage-marc-import.tmpl",
@@ -115,7 +116,7 @@ if ($completedJobID) {
             # close STDOUT to signal to Apache that
             # we're now running in the background
             close STDOUT;
-            close STDERR;
+            # close STDERR; # there is no good reason to close STDERR
         } else {
             # fork failed, so exit immediately
             warn "fork failed while attempting to run $ENV{'SCRIPT_NAME'} as a background job";
@@ -130,7 +131,7 @@ if ($completedJobID) {
     }
 
     # FIXME branch code
-    my ($batch_id, $num_valid, $num_items, @import_errors) = BatchStageMarcRecords($encoding, $marcrecord, $filename, $comments, '', $parse_items, 0, 50, staging_progress_callback($job, $dbh));
+    my ($batch_id, $num_valid, $num_items, @import_errors) = BatchStageMarcRecords($record_type, $encoding, $marcrecord, $filename, $comments, '', $parse_items, 0, 50, staging_progress_callback($job, $dbh));
 
     $dbh->commit();
 
@@ -143,7 +144,7 @@ if ($completedJobID) {
         if (defined $matcher) {
             $checked_matches = 1;
             $matcher_code = $matcher->code();
-            $num_with_matches = BatchFindBibDuplicates($batch_id, $matcher, 
+            $num_with_matches = BatchFindDuplicates($batch_id, $matcher,
                                                        10, 50, matching_progress_callback($job, $dbh));
             SetImportBatchMatcher($batch_id, $matcher_id);
             SetImportBatchOverlayAction($batch_id, $overlay_action);