Commit graph

3549 commits

Author SHA1 Message Date
Paul Poulain
1e5347fb34 Merge remote-tracking branch 'origin/new/bug_7146' 2011-11-06 12:04:43 +01:00
0c0ddf9211 Fix for Bug 7085 - Problems with searching for orders in acquisitions
Changing "if ( defined $input )" to "if ( $input )" in the section
of the script which builds the order search query seems to give
successful searches where they didn't exist before. Searches from
the advanced order search screen work with title, author, vendor,
basket number, date, etc.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Searches for date ranges, title and author keywords give
me the correct results now.
2011-11-06 10:23:47 +01:00
7ee0565f5c 7146 (Update timestamps when deleting a biblio)
Currently, when you delete an item, the timestamp column in deleteditems is
updated with current time. (This comes from an [unintentional] additional
update statement in DelItem.) It makes deletion time visible.
In the past, the marcxml was updated too at that moment, resulting in an
updated timestamp in biblioitems too. The timestamp in biblio was not touched.

If you delete a biblio however, the timestamps in deletedbiblio and
deletedbiblioitems do not reflect time of deletion. They still show the time of
last update before the record was deleted. This last update can be extracted
from MARC field 005 too.

This behavior is not consistent nor logical. I would suggest to add a statement
in DelBiblio to force updating the timestamp in deletedbiblio(items) too. It
makes the time of deletion visible in the record too. The time of deletion of a
biblio can be very useful for e.g. synchronizing purposes.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-11-05 05:50:02 +01:00
Ian Walls
36d8e5df96 Bug 7061: unnecessary global variables declared in C4::SQLHelper
Removes $tablename and $hash from global scope of C4/SQLHelper.pm.  They are never used;
all instances of $table are locally scoped to the subroutines, and $hash is never used.

This may help with persistance; if not, it's at least a bit of trivial cleanup.

To test:

1.  Search for a patron
2.  Create a Contract in Acquisitions
3.  Modify that Contract
4.  Delete that Contract

All instances should return error free.  This checks the subroutines of SQLHelper

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-11-04 12:11:13 +01:00
d998166ea3 Bug 6989 Patron categories not properly displayed if not pure ASCII
C4::Category module returns badly encoded patron categories when they are
containing non pure-ASCII characters.

To reproduce this bug:

  - Go in Administration > Patron Categories
  - Add a new category. Give it this code for example:
    Café
  - Click on Patrons link on top menu
  - Click on New button

    => You get 'Café' displayed without accent

Signed-off-by: Piotr Wejman <ropuch@bagno.be>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-11-04 12:07:08 +01:00
Ian Walls
a0a9368bec Bug 7076: Lists render OPAC XSLT on staff side
Adds a small check in C4::VirtualShelves::Page::shelfpage to only render
OPACResultsXSLT if the $type is 'opac'.  Since parsing the XML is such an expensive
thing, and the resulting XSLTBloc is not used on the staff side, this will increase
performance for Lists in the intranet

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-11-04 10:35:28 +01:00
Frédérick Capovilla
327be442bd Bug 6963: Corrects a problem when a new order is created with a duplicate barcode.
If the AcqCreateItem preference is set to "ordering" and the barcode for
the new item is already in use, no error is returned, but an invalid
itemnumber is saved in the aqorders_items table and the item is never
created.

This patch adds a duplicate barcode verification in neworderempty.pl
_koha_add_item is also modified so it won't return an invalid ID when
an item can't be added.

http://bugs.koha-community.org/show_bug.cgi?id=6963
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test plan on second patch.
2011-11-04 10:22:28 +01:00
Ian Walls
d52095b48c Bug 7078: Remove HTML::Template::Pro from Koha perl dependencies list
Removes HTML::Template::Pro as a requirement (since we're now on Template::Toolkit).

To test:

On a system without, HTML::Template::Pro installed, run perl koha_perl_deps.pl -m -u

Shouldn't return anything about HTML::Template::Pro

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-22 09:01:26 +13:00
Chris Cormack
b6cc3acdac Merge remote-tracking branch 'kc/new/bug_7060' into kcmaster 2011-10-22 04:09:49 +13:00
Ian Walls
c5bc35b694 Bug 7060 Followup: AddReturn needs GetMemberDetails
In my haste, I overlooked circ/returns.pl's need for borrower flags.  This patch
changes back the call in AddReturn from GetMember to GetMemberDetails

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-22 04:07:37 +13:00
Salvador Zaragoza Rubio
4a2a95cc25 Bug 6483 - Paging in opac-detail when coming from a search
Add paging in opac-detail when coming from a search to be
able to continue viewing the previous and next register
from the detail without returning to the results.
The partial list pagination can be showed to increase forwarding
or rewinding in the pagination.
It's implemented for Zebra search and not build_grouped_results.

The param busc with all the information from the search is stored
on the session when running opac-search and opac-detail, outside these
pages the busc param is removed from the session.

A list of the biblionumbers inside the OPACnumSearchResults range
is passed to avoid repeating the searching everytime we see the
previous or next biblio. The searching will be run again when
we are going to exceed the list and a new one will be calculated
from the new search.

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-21 04:57:09 +13:00
Ian Walls
769acee41a Bug 7060: GetMemberDetails unnecessary in C4::Circulation
Replaces all instances of GetMemberDetails with the more efficient GetMember.  Since
no hash values other than the borrowers table's fields are used in this module, the
transition is safe.

To test:

1.  Checkout a material; the page should load without error
2.  Renew a material: the page should load without error
3.  Return a material: the page should load without error

The above test plan invokes all the subroutines affected by this patch; any call to an undefined
value in a hashref should give a warning

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-20 14:09:58 +13:00
Ian Walls
a1e3975067 Bug 7057: CheckReserves uses GetMemberDetails unnecessarily
Replaces call to GetMemberDetails with a call to GetMember.  Much more efficient,
and since only branchcode is used, no required data is lost.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-20 14:03:20 +13:00
bf64266e99 Follow-up fix for Bug 4473 - Recent comments view for the OPAC
This follow-up adds a system preference which controls display
of a link to recent comments in the OPAC masthead alongside
"Advanced search," "Tag cloud," etc.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-20 12:12:45 +13:00
Ian Walls
823b807ac9 Bug 7016: CanBookBeReserved uses GetItemsInfo unnecessarily
CanBookBeReserved uses the very heavy-weight function GetItemsInfo to simply retrieve
the itemnumbers attached to a given biblio.  The function get_itemnumbers_of() is much
lighter-weight and returns the required information; switching to it will reduce the overall
system resource cost of placing a hold.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-20 11:55:10 +13:00
05d35b0ae0 6094 Fixing ModAuthority problems
Pref MergeAuthoritiesOnUpdate does not exist; should be dontmerge
(AuthoritiesMarc.pm).

Instead of folder modified_authorities, now introducing a table for this
purpose: need_merge_authorities. This eliminates several permissions and
security issues. This change applies to AuthoritiesMarc.pm and
merge_authority.pl.

POD lines added for ModAuthority. Deprecated parameter $merge removed.

Test this patch by applying the db revision first from the second patch.

August 4, 2011: Rebased.

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>

Thanks Marcel. It works as advertised. Both modes are functionnal
(back):

- Immediate with dontmerge=0: After modifying an authority record, its
  linked biblios are immediately modified. This isn't the case in 3.4.5.
- Delayed with dontmerge=1: After modifying an authority record, its
  linked biblios are not modified. But an entry is added to
  need_merge_authority new table and 'merge_authorities.pl -b' script
  updates biblios.

Comment: need_merge_authority, like zebraqueue, should be cleared
from time to time.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-20 11:28:53 +13:00
Chris Cormack
d80c3369d2 Merge remote-tracking branch 'kc/new/bug_6253' into kcmaster 2011-10-20 09:23:36 +13:00
Ian Walls
d80cf35e9b Bug 6253 followup: explicitly check ref value for ARRAY before casting
in C4::SQLHelper::_Process_Operands, $operand has been modified to be cast as an array ref
if the incoming $operand is not a ref.  However, the incoming $operand could be some other
kind of ref (hashref for example), which would case the dereferencing in line 419 to fail and exit.

Adding an explicit test for whether the ref is ARRAY seems to clear up this issue.

To test, run t/db_dependent/Members.t.  Before, it fails after test 3.  After, it completes all tests.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-20 09:20:20 +13:00
Christophe Croullebois
4d67e69107 Bug 5680: Order cancelling improvement : delete attached items & biblio if avalaible
- all items attached to the order are deleted
- if there is no more items, and if the biblio is not in other orders and no subscriptions and no holds then the biblio is proposed to deletion
Now whe have 2 links : "delete order" and "delete order and catalog record", the second one appears only if the deletion is possible.
Note that if an hold is related to the item or if the item is unique for the biblio the link "Delete order" is canceled due to hold remaining.
On mouse over explanations are shown with count.
More lines of warnings with count are shown depending of the case.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Configuration:
AcqCreateItem = on order

Test cases and results:

1) Order new record with 2 items
a) From basket
- delete order: only deletes items, OK!
- delete order and catalog record: deletes record and items, OK
b) From shipment/receive
- delete order: only deletes items, OK!

2) Order 1 additional item for existing record with 1 item
a) From basket:
- delete order: works, existing item and record remain, OK
- Can't delete order and catalog record, 1 item left, OK!

3) Order new record with 1 item, title level hold on record
a) From basket:
- delete order: not possible, OK!
- delete orer and catalog record: not possible, OK!
b) From shipment/receive page
- Cancel: Deletes order, record and hold silently.
NO WARNING. NOT OK. See note below.

4) Order 1 additional item for existing record with 1 item,
item level hold on existing item
a) From basket:
- delete order: works, hold and existing item remain, OK!
- delete order and catalog record: not possible, OK!
b) From shipment/receive page
- Cancel: on order item is deleted, other item and hold remain.

5) Order new serial record, create subscription
a) From basket:
- delete order: works, record and subscription remain, OK!
- delete order and catalog record: not possible, OK!
b) From shipment/receive page:
- Cancel: Subscription and record are silently deleted. NOT OK.

6) Order additional item for existing record with other on order items
a) From basket:
- delete order: works, existing on order items remain, OK!
- delete order and catalog record: not possible, OK!
b) From shipment:
- Cancel: deletes order and ordered item. OK.

Changes made:
I changed the wording of the error messages a bit in the template.
I changed the message 'Can't delete order and catalog record' to not be
shown as a link, as the link does nothing. Tooltip still appears.
I attached a screenshot to the bug showing some of my changes.

Hope that's ok.

Necessary  enhancements:
Cancelling orders when receiving items should work the same as from the
basket summary page. We need the same checks and messages there before
deleting records and items automatically.
I am signing off on this, but to go into Koha it  needs a follow-up for the
order receive page.
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-19 16:58:46 +13:00
Srdjan Jankovic
18b8991cf1 bug_6253: Unified member Search()
Removed SearchMembers() and replaced with more generic Search()
Amended Search() to try cardnumber first
Replaced SearchMembers() calls with Search()
Replaced SELECT with Search() where appropriate
C4::SQLHelper:
- added support for '' key for search filter.
- when passing an array to filter, join with OR (rather than AND)
- added support for key => [val1, val2] in filter
- did not document - there was no input documentation to start with,
  and SQLHelper should be replaced with something better anyway

Signed-off-by: Liz Rea <lrea@nekls.org>
(again - testing merge issue)
The functionality of the patch seems to be maintained with Biblibre's changes.

I tested the following:
Extended attribute searching: works
3 part name searching: works
2 part name searching: works
1 part name searching: works

From:
mainpage.pl
members-home.pl
	Patron search limited by branch: Works
	Patron search limited by patron category: works
	Ordering by cardnumber instead of surname: works
The "Check Out" field in the masthead.

Circ Autocomplete is not reliably functional at this time, but the problem appears to predate this patch.
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-19 16:23:02 +13:00
Paul Poulain
7631bae2b2 Bug 7051 de-nesting C4::Reserve, 1st step
C4::Search is not used, so removing it from C4::Reserves
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-19 04:02:27 +13:00
Paul Poulain
86e9c29f54 Bug 7037 de-nesting C4/Print.pm
removing use C4::Circulation, that is useless

Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-19 03:48:21 +13:00
Paul Poulain
56b9412562 Bug 7036 de-nesting C4::Circulation
Just removing use C4::Koha, as other packages are widely used.

Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-19 03:47:31 +13:00
Paul Poulain
94b067b53c Bug 7035 de-nesting C4::ClassSource & ClassSortRoutine
just removing use C4::Koha, that are useless

Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-19 03:25:59 +13:00
Paul Poulain
69732f5c62 Bug 7034: de-nesting C4/Branch.pm
use C4::Koha was loaded only to call C4::Koha::get_infos_of in get_branchinfos_of

the sub get_branchinfos_of was used nowhere
(checked with "grep -R get_branchinfos_of *")
only one reference was made to get_branchinfos_of, in reserve/request.pl, but the sub was not used in fact (maybe removed previously & silently)

This patch removes sub get_branchinfos_of and use C4::Koha in C4::Branch, as well as the reference in request.pl and the t test

The patch doesn't remove use C4::Branch in reserve/request.pl, as it's still used for other subroutines.

Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-19 03:23:31 +13:00
Srdjan Jankovic
4770555855 bug_5533: Slightly improved marking items as lost
Call LostItem() whenever item is lost.
LostItem() new arg - mark returned.
Disabled Lost Status on catalogue item edit.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>

For follow up we need to explain how to hide the 952$1 (lost) from
the framework by putting it in the 'ignore' tab.

Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-18 09:01:39 +13:00
Ian Walls
4e95e94727 Bug 6789: biblios with many items can result in broken search results link
This patch fixes an issue whereby biblios with many items (often > 500) would index,
but not the biblionumber itself, resulting in search results with a) inaccurate item counts
and b) no biblionumber to use in the link to the details page.  This is due to Net::Z3950::ZOOM  not providing
a mechanism for specifying different connection attributes; the maximumRecordSize ZOOM connection attribute,
if not specified, defaults to 1MB, which is less than the size of a MARC record with many, many 952 fields.  Since
it is unlikely we can fix Net::Z3950::ZOOM in a timely fashion, this patch aims to build a workaround on the Koha end.

This patch changes EmbedItemsInMarcBiblio to use append_fields instead of insert_ordered_fields,
so the 999$c will come before the item records.  It's VERY unlikely we will encounter more than 1MB of biblio-level MARC
content, as this would break the ISO-2709 standard by a large factor.

To this end, it also moves the fix_biblio_ids portion of get_corrected_marc_record out of rebuild_zebra.pl,
and makes it a part of GetMarcBiblio (right before EmbedItemsInMarcBiblio, so the 952s still come last).  fix_biblio_ids
is kept as a subroutine for the deletion portion of rebuild_zebra.pl, which still uses it.

It also uses the subroutine parameter in GetMarcBiblio to do the EmbedItemsInMarcBiblio action, rather than having
rebuild_zebra.pl perform it on the itemless record returned from GetMarcBiblio.  Simpler and cleaner that way.

To verify bug issue:
1. Find a biblio with over 700 items (or enough that the resulting MARCXML is greater than 1MB)
2. search for this biblio (in a search that would return multiple results, not just this title).  You should get the title in
the results list
3. attempt to click the link to this biblio's details page; the biblionumber should be blank, leading to a 404

To test solution:
1. Apply patch
2. modify the biblio slightly (click the 005 for example) and save
   OR manually add the biblio to zebraqueue for reindexing
3. after rebuild_zebra.pl -z -b -x runs, use the same search as above. The title should still appear.
4. click the link, and find yourself on the biblio detail page as desired

Signed-off-by: D Ruth Bavousett <ruth@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-15 13:47:24 +13:00
Chris Cormack
a118102d4e Merge remote-tracking branch 'kc/new/bug_5995' into kcmaster 2011-10-15 12:59:34 +13:00
Ian Walls
dcb4ac77fb Bug 5995 Followup: checkpw was returning inconsistent values
In the case of LDAP, checkpw was returning the cardnumber of there user, but it was being treated as the
userid.  This patch updates checkpw_ldap to return the cardnumber AND the userid, and updates checkpw to
uniformly return cardnumber and userid in all instances, so that whoever is authenticating can use the
desired value in the right way.
2011-10-15 12:58:10 +13:00
d7cbdd3d0b Bug 6825 OpacNav menu hide user menu on opac-user.pl page
This patch add a new syspref OpacNavBottom which is placed on all pages
after OpacNav. On Patron pages, specif patron links are placed between
OpacNav and OpacNavBottom, like this:

  OpacNav
  Patron links
  OpacNavBottom

To test:

  1 Apply this patch
  2 For RM, modify kohaversion.pl and updatedatabase.pl appropriately
  3 Test that OPAC pages are displayed as before, OpacNav on the left
  4 Test OPAC patron pages: OpacNav is as before displayed after patron
    links
  5 Split OpacNav between itself and OpacNavBottom
  6 Patron pages display patron links between OpacNav and OpacNavBottom

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-14 11:20:06 +13:00
Amit Gupta
6c9ab3678a Bug 6807 - Add ISBN filter to advanced order search.
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-14 10:57:30 +13:00
Galen Charlton
72eeac56fd bug 5780 followup: RIS export now includes all URLs
Also cleanup whitespace and adjust the line ending per
bug 6769.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-14 10:37:31 +13:00
Chris Cormack
412666e52b Bug 5780 - Export the URI as part of a RIS export
Squashed commit of the following:

commit 8486cd30caf879ddff93aaa5fab722838db946a1
Author: Chris Cormack <chrisc@catalyst.net.nz>
Date:   Mon Feb 21 10:23:07 2011 +1300

    WR76962 - Fixing typos

commit f3ac9d9233db2b410fded112e16e54b27280af0a
Author: Chris Cormack <chrisc@catalyst.net.nz>
Date:   Mon Feb 21 09:56:43 2011 +1300

    WR76962 - Extending RIS support to handle URI

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-14 10:34:52 +13:00
Paul Poulain
37902b25a7 Bug 6840 warning in logs
In staff interface, in search (catalogue/search.pl), there is a warning saying:
[Fri Sep  2 18:20:24 2011] search.pl: Use of uninitialized value $key in hash
element at /home/paul/koha.dev/koha-community/C4/Templates.pm line 227.

The problem happens when searching from the quick search toolbar, not when you
search from advanced search.
Investigating, it seems it's because the sort_by is not defined in this case.

This patch
* fixes the problem in Search.pl by setting the parameter only if there is a sort_by field
* modify te Template->param sub to get a better error message. Instead of having just "use of uninitia..." get the value you try to set to an empty key. Much easier to understand which line causes the problem

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-13 16:17:33 +13:00
7621591ae6 Bug 6912 Test 008 presence in get CoinS function
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-13 15:57:18 +13:00
Chris Cormack
cdd798ec32 Bug 6885 Follow up to fix superlibarian permission check 2011-10-13 15:54:48 +13:00
b64dbb246c Bug 6885 Allow superlib to delete items from any library
When IndependantBranches syspref is enabled, a 'regular' user can only
delete items belonging to his/her library. But a superlibrarian should
have the permission to delete items from all libraries. He can't for the
time being. This is fix by this patch.

How to test?

- On a multi-libraries Koha, activate IndependantBranches
- Log in with a superlibrarian user
- Find a biblio with one item from another library than the user home
  library
- Click on Edit > Edit Items
- On the list of items, all lines have Delete link
- If you try to delete an item from another library than the user home
  library, deletion will fail.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-13 15:52:20 +13:00
Paul Poulain
1c0702c76e Bug 5630, follow-up
Fixes chris comment 28, that was a consequence of Marcel comment 27
Recent error
[Thu Sep 01 14:22:45 2011] [error] [client 192.87.126.61] [Thu Sep  1 14:22:45
2011] opac-MARCdetail.pl: DBD::mysql::st execute failed: Unknown column
'limit_desc' in 'field list' at /usr/share/koha/testclone/C4/Auth.pm line 276.
Seems to come from this commit 9a3950f673 (5630
CAS Improvements)

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-13 10:51:12 +13:00
Ian Walls
74c7c4e3a5 Bug 5630 Followup: checkpw_ldap not imported
If LDAP authentication is used, Koha barks that C4::Auth::checkpw_ldap is
undefined, which is true.  checkpw_ldap needs to be imported from C4::Auth_with_ldap,
like it was before the bug fix for 5630

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-13 10:50:50 +13:00
Chris Cormack
046c996c2f Bug 5630 CAS improvements
Squashed commit of the following:

commit 0e13a5278e11b288e48190dc26f31e96d06598dd
Author: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
Date:   Wed Jan 19 21:24:39 2011 +0100

    Bug 5630 : fixing C4/Auth.pm

commit b55abc7a0dc1ca43b2610a27246293e9a9346e18
Author: Matthias Meusburger <matthias.meusburger@biblibre.com>
Date:   Wed Jan 19 21:24:38 2011 +0100

    Bug 5630 : Adds CAS documentation

commit df0098a6a65465e6e734f99f65fb453dd3fa11d1
Author: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
Date:   Wed Jan 19 21:24:37 2011 +0100

    Bug 5630 : ilsdi service AuthenticatePatron doesn't with CAS syspref on

    Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>

commit 31c8f0c0facfafae011ad24c9d458c50f2fad296
Author: Matthias Meusburger <matthias.meusburger@biblibre.com>
Date:   Wed Jan 19 21:24:36 2011 +0100

    Bug 5630 : Adds the ability to authenticate against multiple CAS servers

commit 9d0def826135d5756533dc0dcf8e0a107d1ac8fc
Author: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
Date:   Wed Jan 19 21:24:34 2011 +0100

    Auth_with_cas : removing a warning

    $sth was defined twice in a function
    Removing the second definition

commit 5ee550e9a2bb7ab6bc09f14fced6ce0df8011eb0
Author: Matthias Meusburger <matthias.meusburger@biblibre.com>
Date:   Wed Jan 19 21:24:33 2011 +0100

    Bug 6012 : MT 2270: CAS proxy

    CAS Proxy
    Examples included are now really usable

    Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-13 10:49:49 +13:00
Jared Camins-Esakov
f09e2ca27e Bug 5528: Analytic records support
Display links to parent biblios, show linked items in holdings, allow holds on
linked items. This uses MARC to maintain relationships.

Sponsored by the Mississippi Department of Archives and History and RapidRadio
Solution. Originally developed by Savitra Sirohi and Amit Gupta at OSSLabs, with
UNIMARC support added by Zeno Tajoli. Commits squashed and merge conflicts
resolved by Chris Cormack from Catalyst. Respect for NORMARC and some small
framework portability fixes made by Jared Camins-Esakov of C & P Bibliography
Services.

IMPORTANT NOTE: A bug in the 773 coding for MARC21 was corrected from the
original OSS Labs code. The 773s generated by the pre-release code did not have
the first indicator set to '0', which means that they were not supposed to
display. Going forward, the first indicator will be set correctly, but existing
records created with this code will no longer appear (they appeared before only
due to another bug). To correct this, you could globally (or, to make sure you
only modify records created with the Analytics tool, for records with 773$0)
change the first indicator of the 773 from blank to '0'.

== Background ==
An analytic record for an item is a more detailed, monographic biblio for an
item attached to a serial record .  This is often used for special issues of a
journal that are released as books on their own (assigned an ISBN, as well as an
ISSN/volume/issue).  It is important for researchers to be able to search for
these items both as issues of the serial, and as monographs.  It is equally
important for the library to not have duplicate item records for the item in
question to have to keep synchronized.

== Establishing relationships ==
Analytical records are connected to items belonging to parent or host
bibliographic records. This can be accomplished by:
* From an analytical bibliographic record linking to an host item by providing
  the item barcode as input
* From a host item by using option "analyze", this creates a new empty
  bibliographic record with field 773 (MARC21) populated
* Running a new CLI script that establishes a relationship between the
  analytical record and the host item identified by the barcode in the
  analytical record's 773$o (MARC21)

== Connecting Records ==
The relationships are maintained in the MARC records, we have not used database
tables at all.

== MARC Representation ==
In MARC21/NORMARC we have used:
* 773$9 to store the Koha item number of the host item
* 773$0 to store the Koha biblio number of the host bibliographic record

The above fields are used to display the relationships in various screens in the
OPAC and the staff interface. Additionally, when populating field 773 with host
item's details, we have used following MARC 21 mapping:
* 'a' <= 100/110/111 $a (author main)
* 'b' <= 250$a (edition)
* 'd' <= 260$a, 260$b, 260$c (place, publisher, year)
* 'o' <= barcode
* 't' <= 245$a (title)
* 'w' <= (003)001 --> if no 001 is available, we can populate biblionumber
* 'x' <= 022$a (issn)
* 'z' <= 020$a (isbn)

In UNIMARC, this code uses:
* 461$9 to store the Koha item number of the host item
* 461$0 to store the Koha biblio number of the host bibliographic record

When populating field 461 in UNIMARC, the following mapping is used:
* 't' <= 200$a (title)

== Treatment of Holds ==
A key requirement was to allow holds to be placed on host items from the
analytical record. We have accomplished this by allowing holds on specific
copies only. Biblio level holds are not allowed. This ensures that holds are
placed on specific items that are relevant to the analytical record.

== Deleting host items with linked analytical records ==
As we have not used database tables to maintain relationships, we had to use
search to find out if any linked analytical records are present. If 1 or more
analytical are present, we do not allow deletion of items. This is similar to
what we see when we try to delete authority records.

== Importing analytical records ==
Analytical records can be imported using bulkmarcimport or the GUI tools. The
new CLI script can be executed after the import to establish relationships with
host items. The script will establish relationships using the host item's
barcode, the barcode must be present in 773$o of the analytical record.

== What if there are two or more copies of the host item? ==
The current design will require that there be two host (773) fields, one for
each copy.

== What if there is no barcode available for the host item? ==
It is still possible to establish a relationship, by populating 773$9 with the
host's item number. However the CLI script uses barcode in 773$o to establish
relationships so it won't work where barcodes are unavailable. Also from an
analytical record, it is possible to establish a relationship to a host item by
providing the barcode as input, this option will not be available as well.

Commits that added the following features were squashed by Chris Cormack (this
is not a list of every commit):
* Display links to host records from biblio detail screens
* Support for UNIMARC, respecting the system preference 'marcflavor'
* Support holds from the OPAC
* Ability to link to items belong to host records from a analytical record
* Display items belonging to host records in the moredetail page
* Ability to edit items belonging to host records, also ability to delink from
  them
* Move get host items code into a C4 routine, also calling the new routine in
  related perl scripts
* Move host field population to a C4 routine, all changes in pl files to call
  new routine
* Allow only specific copy holds for analytical records plus changes to use new
  C4 routines
* Support for holds on items linked via host records
* Storing bibnumber and itemnumber in subfields 0 and 9, plus other mapping
  changes
* New command line script that establishes relationships between analytical
  records and host items and bibs. The script looks for host field (MARC21 773)
  in records, and based on barcode in subfield 'o' populates host bibnumber in
  subfield '0' and host itemnumber in subfield '9'. The script can be run after
  an import of analytical records, it can also be run in the crontab to maintain
  the relationships
* Ability to create analytical records from items, to view linked analytics, and
  prevent deletion of items that have linked analytics
* New template for catalogue/detail.pl (NOTE: not a new template file, just a
  new way of displaying analytics), template displays linked analytics and
  allows creation of analytical records
* New zebra index for item number in host fields. This index will be used to
  display links to analytical records from host records
* Display title of host record instead of the phrase host record
* Using detail.tmpl for analytics tab instead of a new template file
* Improved qualification info prepration in Prephostmarcfield
* Check for linked analytics before deleting item
* Display link to host record and more meaningful anchor text for edit item link
* Analytical record: Unimarc index in record.abs and help in
  create_analytical_rel.pl
* Adding a sys pref that controls display of options to create analytical
  relationships
* Add host entry in XSLT stylesheet in staff item detail
* Added host record support to OPAC detail XSLT
* Adding 773$0 and 773$9 to all frameworks
* Adding 773 subfields 0 and 9 to default marc framework via updatedatabase.pl
* Display create analytics and used in links in catalog detail
* Fixed problem where analytical records not showing in OPAC search results
  because GetMarcBiblio now needs a flag to add item records
* Fixed problem where analytics count was set to 1 for all records, not just
  those with analytics
* Fixed catalogue detail page not to show analytics counts if count is 0

Conflicts:
	installer/data/mysql/updatedatabase.pl
	koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt
	kohaversion.pl

Co-author: Savitra Sirohi <savitra.sirohi@osslabs.biz>
Co-author: Zeno Tajoli <tajoli@cilea.it>

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-13 10:03:39 +13:00
Chris Cormack
71defcbc6c Bug 5459 - Holds not being shifted when merging biblios
Holds are now shifted and reordered by date placed.
Holds already marked waiting, or in transit are not reordered.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-13 09:32:24 +13:00
Colin Campbell
0cf8194d5f Bug 6667 Correct documentation of function
Return list was documented as being in the reverse order
to how it is returned. Correct the perldoc description

also removed comments which did not help anyone trying
to make sense of this subroutine

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Just improving text comments. No code changes involved.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-09 20:24:04 +13:00
Robin Sheat
85b1d6d558 Bug 6636 - add 'powered by Koha' text to OPAC footer
Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
  QA control: added () inside 2 [% IF %]

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-09 20:13:09 +13:00
Ian Walls
e05d53d50d Enh 6403: Record local use stats when checking in unissued materials
Adds a new system preference, RecordLocalUseOnReturn, which when active will change the statistical
entry type from "return" to "localuse" in AddReturn() if the material was not on loan when returned.
The intended use-case here is for libraries with 'open' book drops, in which patrons can put locally
used (but unissued) materials.

Adds a small message to the user interface to confirm that Local Use was recorded.

This change opens up the possibility to record more types of statistics on return; one would just need
to update the $stat_type variable accordingly.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-09 19:50:41 +13:00
7d599afe6d Bug 6371 Item Types description not properly displayed if not pure ASCII
In several places, C4::ItemType module is used to retrieve item types
and their description. If the description text contains non-ASCII
characters, those characters are not properly displayed.

This bug can be seen in:

  - 4xx plugin of a UNIMARC DB
  - Home > Admin > Item circulation alerts
  - others?...

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
  - Fixes display probems in circulation alerts and 4xx UNIMARC plugin
  - display in other places looks ok with and without patch

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-08 20:10:29 +13:00
cd1fbb7510 6786: False detection of index names in Search; make index names case insensitive
Fixing the regex to detect index names in ccl queries.  Changing loop
structure: looping through the index candidates in the query is faster than
testing every index name with a regex.  Making the index comparison case
insensitive will benefit users misspelling the case of an index; Zebra does not
care about it.  Test the change by searching on a word followed by a : or =
character.  Previously, when that word contained an index name like an or nb,
the search would crash.

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>

Perltidied the new block to fix indentation

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-07 14:08:09 +13:00
293a9baba8 6769 Getting rid of some RIS errors/warnings
Removing unnecessary warnings. Some were based on errors in the script. Others are removed by adding debug flag and disabling debugging mode by default.
Adding carriage returns for Windows users, assuming that it does not hurt the Linux users. (Perhaps a future option?)
Test it with: http://yourserver.com/cgi-bin/koha/opac-export.pl?bib=yourbibnumber&format=ris&op=export [replace server and biblionumber]

Revision of Aug 24: Fixed two missing newlines too.

Signed-off-by: Steven Callender <stevecallender@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
  (removed comment "240811 marcelr during QA"

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-07 14:02:34 +13:00
f02796d989 6584: Enable searching on Zebra's Bib-level index
Bib-level is already indexed in MARC21 record.abs.
But you cannot search this index, because it is commented in ccl.properties and
not listed in getIndexes of Search.pm.
This very simple patch does only do those two things.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-07 13:43:47 +13:00
6ade95d5db Fix for Bug 6600, Library name linking wrong if current location is different
GetItemsInfo in Items.pm includes this join:

LEFT JOIN branches ON items.homebranch = branches.branchcode

This means that the branch URL (from the branches table) comes out
as the URL for items.homebranch, thus the URL in the holdings
output is the item's home branch even though the display might
be showing a different current location.

This patch changes the join to use items.holdingbranch. The join
was originally added to fix Bug 3702, and based on the description
of that feature I'm assuming this change is not harmful to other
usages. However, it does make the assumption that the item's
current (holding) branch is the branch we want to see information
about.

Signed-off-by: Nicole Engard <nengard@gmail.com>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-07 11:34:43 +13:00