Commit graph

137 commits

Author SHA1 Message Date
240520c2f9 Bug 10663: QA Followup: Typo in comment in renewscript
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-08-16 01:39:16 +00:00
Fridolyn SOMERS
4f263b3a90 Bug 10247: show warning if hold blocked due to maxreserves syspre
On intranet, when placing a hold requst:
If borrower has reached the request limit, a warning should appear :
  Cannot place hold
  * Too Many Holds: TEST has too many holds.

This works when quota defined in circulation rules is reached but not
when limit specified in syspref maxreserves is reached, in case this
limit is lower than the one defined is circulation rules.

This is because template param maxreserves is set twice, this patch
corrects this bug.

Also moves warnings and messages conditional variable from Perl to
template because it cause the same bug as for maxreserves.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-08-12 15:02:57 +00:00
Galen Charlton
61522d06f1 Bug 9394: (follow-up) silence spurious warns
One just needed parentheses, but the one on line 219 reflects
a slightly deeper problem -- it's running patron checks when
a patron hasn't actually been supplied.

To test:

[1] From the staff interface, bring up a biblio that has no
    holds on it, then go to the holds tab.
[2] Verify that the Apache log has no new warnings containing:

request.pl: Use of uninitialized value in string eq at /home/gmc/koha/reserve/request.pl line 219

or

request.pl: Use of uninitialized value in string eq at /home/gmc/koha/reserve/request.pl line 488

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-07-24 05:04:56 +00:00
53fbfa2dde Bug 9394: Use reserve_id where possible
This patch switches from using a combination of
biblionumber/borrowernumber to using reserve_id where possible.

Test Plan:
1) Apply patch
2) Run t/db_dependent/Holds.t

Signed-off-by: Maxime Pelletier <maxime.pelletier@libeo.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-07-24 05:04:55 +00:00
Colin Campbell
7668e19c95 Bug 766: remove CGI::scrolling_list from request.pl
Let the template take care of generating the display.
Lets at least part of request.pl be more succinct.

To test, place a hold and search for the patron using a partial name.
You should get a dropdown select list of patrons and be able to select
the patron to hold for from there.

The functionality should remain unimpaired after this patch is applied.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-06-05 07:31:06 -07:00
f291596aa4 Bug 10080 - Change system pref IndependantBranches to IndependentBranches - Followup
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-05-22 07:58:27 -07:00
b00ec06968 Bug 10080 - Change system pref IndependantBranches to IndependentBranches
Test Plan:
1) Enable IndependantBranches
2) Apply this patch
3) Run updatedatabase.pl
4) Verify that the system preference still functions correctly

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-05-22 07:58:23 -07:00
98b96c88d7 Bug 9575 - Serious Holds Problem with IndependantBranches
If IndependantBranches is enabled, all holds for an item display the
currently logged in library no matter what, and modifying the holds will
set all pickup locations for all the holds to that logged in library!

Test plan:
 1) Disable IndependantBranches
 2) Place 3 holds on a record with 3 different pickup locations
 3) Enable IndependantBranches
 4) Refresh the holds page for that record, all the holds show now
    show a pickup location of the logged in branch
 5) Modify the order of the holds
 6) Disable IndependantBranches
 7) Refresh the holds, verify the holds all now have a pickup
    location of the logged in branch
 8) Apply the patch
 9) Repeat steps 1-3
10) Refresh the holds page for that record, all the holds should
    now show the correct pickup branch, but it cannot be changed
    as IndependantBranches is enabled.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
In my tests the above test plan only worked out if my user
had no superlibrarian permission. But then behaviour for
independentbranches off/on was all correct.
All tests and QA script pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-05-14 08:29:28 -04:00
Galen Charlton
a7eb34f2c8 Revert "Bug 6554 - make Koha internally utf-8 clean"
This reverts commit d542740ab8.

Rolling back bug 6554 work until we have more comprehensive tests.

Conflicts:

	opac/opac-search.pl
2013-04-29 15:12:32 -07:00
Dobrica Pavlinusic
d542740ab8 Bug 6554 - make Koha internally utf-8 clean
In current implementation (mostly commented out in this patch)
uses heuristic to guess which strings need decoding from utf-8
to binary representation and doesn't support utf-8 characters
in templates and has problems with utf-8 data from database.

With this changes, Koha perl code always uses utf-8 encoding
correctly. All incomming data from database is allready
correctly marked as utf-8, and decoding of utf8 is required
only from Zebra and XSLT transfers which don't set utf-8 flag
correctly.

For output, standard perl :encoding(utf8) handler is used
so it also removes various "wide character" warnings as side-effect.

Test scenario:
1. make sure that you have utf-8 characters in your biblio
   records, patrons, categories etc.
2. try to search records on intranet and opac which contain
   utf-8 characters
3. install language which has utf-8 characters, e.g. uk-UA
   dpavlin@koha-dev:/srv/koha/misc/translator(bug_6554) $
   PERL5LIB=/srv/koha/ perl translate install uk-UA
4. switch language to uk-UA and verify that templates
   display correctly
5. test search and Z39.50 search and verify that caracters
   are correct

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

I followed the test plan, adding utf-8 characters to library names,
patron categories, titles, and authorized values. I tried the uk-UA
translation and everything looked good.

When performing Z39.50 searches for titles containing utf-8 characters I
got results which were still occasionally contaminated with dummy
characters [?] but I assume this is Z39.50's fault not the patch's.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Already signed, add mine.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-04-01 18:51:49 -04:00
Bernardo Gonzalez Kriegel
3209941f3f Bug 9457 - Followup - Ordering branches should be case independent (2)
This follow up reinstates or add check for undef returned
by C4::Context->userenv, only where previous patch touch
code.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-20 15:36:19 -04:00
Bernardo Gonzalez Kriegel
2d9f5fc69e Bug 9457: [ENH] Ordering branches should be case independent (2)
This patch replace use of CGI::scroll_list() to show list of branches.

In two files, marc21_linking_section.pl and unimarc_field_4XX.pl,
the scrolling list is created but not used in the template file,
so the code is removed.

Also minor renaming/normalizing of variables.

To test:
1) Install with some branches, records and patrons

2.1) Select a record, click 'Place hold', select user,
     there is a library pull-down next to 'Pickup at:',
     list is ordered case sensitive
2.2) Go to Reports > Average loan time,
     next to Library is a pull-down,
     list without order
2.3) Go to Reports > Catalog by item type,
     next to 'Select a library' is a pull-down,
     list is ordered case sensitive
2.4) This is tricky, go to Reports home,
     change last part of URL 'reports-home.pl' with
     'manager.pl?report_name=issues_by_borrower_category'
     (can't find a direct link), next to 'Select a library'
     is a library pull-down,
     list without order
2.5) Edit/Add a patron, on section 'Library management'
     there is a library pull-down, case sensitive
2.6) OPAC, as logged user, make a suggestion or hold,
     there is library pull-down, correct order

3) Apply the patch

4.1) Repeat 2.1), correctly ordered list
4.2) Repeat 2.2), correctly ordered list
4.3) Repeat 2.3), correctly ordered list
4.4) Repeat 2.4), correctly ordered list
4.5) This is a bit more work
     There are 3 possible situations to test:
     A) No branches, must show a message that are no
        libraries defined
     B) New patron, must show a correctly ordered
        list of branches, current branch selected
     C) Edit patron, must show a correctly ordered
        list of branches, patron branch selected
4.6) Small changes on variable names, so retest 2.6)

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-20 15:35:58 -04:00
Jonathan Druart
a469663d7b Bug 9108: Followup: send the dateformat value from C4::Auth
- the dateformat value is send to all templates (from
  C4::Auth::get_template_and_user)
- remove all assignment of dateformat in all .pl files
- the DHTMLcalendar_dateformat variable is unused

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Fixed conflicts:
 - opac/sco/sco-main.pl
 - reports/acquisitions_stats.pl
 - tools/cleanborrowers.pl

All tests pass, perlcritic problems appeared in some files
before and after these patches were applied.

Checked sorting in following pages:
- acqui/addorderiso2709.tt - list of staged imports in acq
- acqui/histsearch.tt - sorting of dates in acq search result list
- acqui/invoices.tt - billing date in list of invoices in acq
- acqui/lateorders.tt - list of late orders in acq
- acqui/ordered.tt - ordered titles and estimated costs for a fund
- acqui/parcels.tt - receive shipment page
- acqui/spent.tt - received titles and actual costs for a fund
...
- serials-search.tt - subscription search result list
...
- opac/sco/sco-main.tt - due dates in list of checked out items
- reports/acquisitions-stats.tt - date searches, display of dates
- tools/cleanborrowers.tt
- tools.holidays.tt - different views of dates library is closed,
  adding dates

Checked dates display according to system preference everywhere and
searching, entering dates etc. still worked as expected.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-01-17 21:59:30 -05:00
Jonathan Druart
7fc4be502d Bug 9206: Followup QA FIX
- Fix indentation
- It is useless to loop on all items. If at least 1 item is already
  issued, we want to return 1.
2012-12-27 09:48:03 -05:00
e3f6a74660 Bug 9206 - Only allow place holds in records that the patron don't have in his possession - QA Followup
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
2012-12-27 09:48:03 -05:00
Vitor FERNANDES
63f2ceb603 Bug 9206 - Only allow place holds in records that the patron don't have in his possession
Added a system preference to turn on/off this feature.
By default the system allow the patron to place holds even if it is in his possession.
Script to place holds check if the system preference is off and if patron has at least one item to block holds.
Messages to say that are already in patron possession added to templates.
Method to check if patron has one issue from one record added to C4::Circulation

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-12-27 09:48:03 -05:00
Colin Campbell
8cef238d3a Bug 8675 Add hours and mins to renewal due date
If user supplies renewal with a new due date it should add
a time using the same logic as dateduespec in circulation.pl
rather than defaulting to 00:00

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-04 18:22:32 +02:00
e22d877976 Bug 8455 - Followup - perltidy renewscript.pl
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-08-02 16:44:55 +02:00
3790243193 Bug 8455 - Check ins processed through "Check Out" tab of the Patron Record ignore Circulation System Preferences
If you check-in an item through the "Check Out" tab of the Patron Record, the return/check-in ignores the "InProcessingToShelvingCart" and "ReturnToShelvingCart" circulation system preferences. Or rather, there just isn't any logic to handle them in the renewscript.pl file.

I'm pretty much just bringing the code straight across from returns.pl, although some minor changes need to be made due to context.

Both system preferences are important to include, since you can check-out an in processing item to a patron. While a regular check-in will clear the in processing status, a check-in through the Patron module will cause the item to have its status returned to "In Processing" rather than going to "Shelving Cart", if the preference is set, of course.

To test the scenario, turn on one of (or both of) these settings and try checking books in through the Circulation module and the Patron module.

Before the patch, you will see that only the Circulation module will change the shelving location.

After the patch, you should see identical behaviour.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

http://bugs.koha-community.org/show_bug.cgi?id=7189
2012-08-02 16:44:52 +02:00
Sophie Meynieux
3b4d31abe9 Bug 7815 : Order pickup libraries list by name rather than by code
Signed-off-by: Marijana Glavica <mglavica@ffzg.hr>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-06-10 13:09:00 +02:00
5e43e2f93d Bug 7951 - Suspending holds needs a system preference
Adds system preferences SuspendHoldsIntranet and SuspendHoldsOpac.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
2012-06-09 18:45:57 +02:00
b04899bafd Bug 7641 - Followup - Suspend Until not set on by suspend button.
For request.pl, there are two ways to suspend a reserve, either
by using the 'suspend' button for an individual reserve, or by
using the 'Update hold(s)' button with suspend until dates set.

If the 'suspend' button is used, any date in the 'suspend until'
field is ignored. This commit fixes this issue.

  * Add suspend_until date to suspend button link via jquery
  * Add optional date to ToggleSuspend()
  * Add KohaDates plugin where necessary

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
passes tests, tested:
* suspend all holds from circ.pl
* suspend one hold from circ.pl
* suspend all holds from moremember.pl
* suspend one hold from moremember.pl
   --- NOTE: clicking suspend all holds without setting a date will mean the holds must be manually unsuspended. I'm not sure this is intentional?
* suspend a specific hold using the in-table button on reserves
* suspend a specific hold using the "update hold" button

500 error is gone.

http://bugs.koha-community.org/show_bug.cgi?id=8084
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-05-15 15:48:12 +02:00
f446b3d03d Bug 7641: Suspend Reserves
Adds the ability to suspend reserves. The new system preference
AutoResumeSuspendedHolds enables the ability to set a date for
a suspended hold to automatically be resumed.

When a hold is suspended, it will continue to increase in priority
as the holds above it are fulfilled. If the first holds in line
to be filled are suspended, the first non-suspened hold in line
will be used when an item can fulfill a hold that has been placed.

http://bugs.koha-community.org/show_bug.cgi?id=7641
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>

Tested with the preference on and off:
1. placed several holds in the staff client
2. suspended some with a date
3. suspended some without a date
4. triggered hold message by checking in for hold with suspensions
5. the suspended hold was skipped as it should be
6. tested suspending holds in the OPAC w and w/out dates
7. ran the cron to clear suspensions with dates

All the above tests worked as expected. Signing off.
2012-03-29 14:37:49 +02:00
Colin Campbell
e8daace29f Bug 5549 : Fix typo in renewscript 2012-03-20 13:22:56 +13:00
Colin Campbell
17657b6094 Bug 5549 : Duedate formatting : reserves and opac 2012-03-20 12:36:52 +13:00
Robin Sheat
4cbeeedbe8 Bug 6296: allow users to be authenticated by SSL client certs
This adds a new syspref: AllowPKIAuth. It can have one of three states:
* None
* Common Name
* emailAddress

If a) this is set to something that's not "None", and b) the webserver
is passing SSL client cert details on to Koha, then the relevant field
in the user's certificate will be matched up against the field in the
database and they will be automatically logged in. This is used as a
secure form of single sign-on in some organisations.

The "Common Name" field is matched up against the userid, while
"emailAddress" is matched against the primary email.

This is an example of what might go in the Apache configuration for the
virtual host:

    #SSLVerifyClient require # only allow PKI authentication
    SSLVerifyClient optional
    SSLVerifyDepth 2
    SSLCACertificateFile /etc/apache2/ssl/test/ca.crt
    SSLOptions +StdEnvVars

The last line ensures that the required details are
passed to Koha.

To test the PKI authentication, use the following curl command:
    curl -k --cert client.crt --key client.key  https://URL/
(look through the output to find the "Welcome," line to indicate that a user
has been authenticated or the "Log in to Your Account" to indicate that a
user has not been authenticated)

To create the certificates needed for the above command, the following series
of commands will work:
    # Create the CA Key and Certificate for signing Client Certs
    openssl genrsa -des3 -out ca.key 4096
    openssl req -new -x509 -days 365 -key ca.key -out ca.crt
    # This is the ca.crt file that the Apache config needs to know about,
    # so put the file at /etc/apache2/ssl/test/ca.crt

    # Create the Server Key, CSR, and Certificate
    openssl genrsa -des3 -out server.key 1024
    openssl req -new -key server.key -out server.csr

    # We're self signing our own server cert here.  This is a no-no in
    # production.
    openssl x509 -req -days 365 -in server.csr -CA ca.crt -CAkey ca.key \
        -set_serial 01 -out server.crt

    # Create the Client Key and CSR
    openssl genrsa -des3 -out client.key 1024
    openssl req -new -key client.key -out client.csr

    # Sign the client certificate with our CA cert. Unlike signing our own
    # server cert, this is what we want to do.
    openssl x509 -req -days 365 -in client.csr -CA ca.crt -CAkey ca.key \
        -set_serial 02 -out client.crt
    openssl pkcs12 -export -in client.crt -inkey client.key -out client.p12
    # In theory we can install this client.p12 file in Firefox or Chrome, but
    # the exact steps for doing so are unclear, and outside the scope of this
    # patch

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Tested with Common Name and E-mail authentication, as well as with PKI
authentication disabled. Regular logins continue to work in all cases when
SSL authentication is set to optional on the server.

Signed-off-by: Ian Walls <koha.sekjal@gmail.com>
QA comment: synchronized updatedatabase.pl version of syspref with sysprefs.sql
version, to avoid divergent databases between new and upgrading users.
2012-03-19 17:02:44 +01:00
Garry Collum
e1d948ecd6 Bug 5674: patron name sort ignoring case when placing holds.
Fixes the patron name sorting when placing holds.

Testing - See Bug 5674.
Create two patrons.  One named SMITH, THOMAS and the other Smith, John.
Search for an item to place on request.  Do a patron search for Smith.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Confirm both the original bug and the fix, sorting is correct now.
Patch does not change status of tests - prove t t/db_dependent xt no different from master.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-02-03 16:36:21 +01:00
Ian Walls
fcd28a664a Bug 7059: Remove GetMemberDetails from reserve/request.pl
Replaces all four usages of GetMemberDetails with GetMember, since none of the
hashref fields used were anything other than those in borrower table, which GetMember
returns.

To Test:
1.  Apply patch
2.  Go to reserve/request.pl; the page should load without error
3.  Search for a cardnumber: the page should load without error

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-20 14:07:51 +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
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
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
Srdjan Jankovic
8b65b94636 Bug 6405: added enumchron to reserve copy list
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-09 20:01:24 +13:00
Srdjan Jankovic
d388acd482 bug_6770: removed doubled override increment when using AllowHoldPolicyOverride
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-07 09:21:15 +13:00
Robin Sheat
99056625b6 Bug 6687 - allow people to be moved in the holds queue
This fixes a regression introduced by Bug 6526 that told you someone
already had a reserve if you attempted to move their ordering in the
hold queue.

(note: it also cleans a host of trailing whitespace errors that were in
that file)

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-09-08 13:46:46 +12:00
Colin Campbell
bb251a484f Bug 6562: Silence runtime error in reserve/request.pl
Not defining action just causes logging of noisy
runtime warnings.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-08-26 10:34:48 +12:00
Robin Sheat
218a35776e Bug 6526 - make the reserves code use the borrowernumber
Previously it used the cardnumber, which caused numerous issues if your
users don't have card numbers.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-06-26 06:44:14 +12:00
Ian Walls
6059599fac Bug 6259: AllowHoldPolicyOverride causes every hold to need override
Adds a check to make sure that the item is actually unavailable before requiring the override

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-04-27 16:21:43 +12:00
Chris Cormack
ef8171ba42 Merge remote branch 'kc/new/enh/bug_4449' into kcmaster 2011-04-09 11:40:47 +12:00
Ian Walls
00e019bfd7 Fix for Bug 4449: AllowHoldPolicyOverride cannot over all policies
AllowHoldPolicyOverride should be able to override AllowOnShelfHolds, as well as other possible reasons for blocking a hold. Before, this only
allowed override of branch policies set in Circ Rules.

Signed-off-by: Nicole Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-04-09 11:39:50 +12:00
Jared Camins-Esakov
8b582d863d Bug 6100: request.pl should check maxreserves exists
Adds a check to confirm that the maxreserves syspref actually has a value before
using it. Also fixes an off-by-one error in the maxreserves calculation that
would allow librarians to place maxreserves + 1 holds for patrons.

Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-04-07 14:00:11 +12:00
Ian Walls
48ee1dcb3f Bug 5547: Hide Lost Items dev
Adds a Hide Lost Items option to the staff client, as detailed in the enhancement request
at http://wiki.koha-community.org/wiki/Hidelostitems_option_for_the_staff_client_RFC

Minor edits: Whitespace

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-03-30 20:20:05 +13:00
7a587112f0 Fix for Bug 4853 - Rights needed to renew a document
Correcting check for circulation permission. Also updating
updateitem.pl (for setting lost and damaged statuses) with
circulate permissions.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-03-06 08:26:35 +13:00
6709d0e4f7 Follow-up correction for Bug 5462 - Fix variable names for template::toolkit
Previous commit modified checks for the item-level_itypes preference
to look for a different variable name but didn't update where that
variable is set in Auth.pm.

Other scripts perform a direct check of item-level_itypes and must
continue to use the name of the variable in the database.

Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-02-08 21:03:28 +13:00
Christopher Hall
f03000f50f Bug 5462: modified intranet scripts to match templates
Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
2011-02-03 09:57:24 +00:00
Ian Walls
5e8b078651 Bug 4449: AllowHoldPolicyOverride does not override all hold policies
This patch provides a universal override to any hold policy if the AllowHoldPolicyOverride is set.
Amongst other overrides, this patch allows missing, non-checked out items to be placed on hold even with AllowShelfHolds turned off.

Signed-off-by: Nicole Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-12-02 08:35:58 +13:00
Colin Campbell
bd93bfdbc4 Bug 5392 Initialize vars used in building url strings
If no failures are to be added to the to the strings for redirect
the corresponding variables are undefined causing warnings
to be logged. Initialize them so that the error log is not
being filled with trivia.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-13 06:46:21 +13:00
Liz Rea
21cabf7666 bug 5237: Testing renewals on patron barcodes with + signs at the end
According to notes in bug, patch was originally by Chris Cormack.

Signed-off-by: Liz Rea <lrea@nekls.org>
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-02 11:20:01 +13:00
39c177e3f2 bug 3344: display in-transit status on holds priority list
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-06-24 07:55:35 -04:00
Nahuel ANGELINETTI
5f0f488596 (bug #4853) change rights needed to renew loans
Use "circulate" right, instead of "borrower".

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-06-09 09:55:29 -04:00
ede20857ea bug 4816: require authentication for placerequest.pl
Otherwise, it was possible to construct a URL to place
hold requests without authorization.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-05-25 23:30:51 -04:00