Commit graph

1401 commits

Author SHA1 Message Date
Jared Camins-Esakov
bc05b5d163 Bug 7417: Include see from references in bibliographic searches
This patch adds the Koha::Indexer::RecordNormalizer and
Koha::Indexer::MARC::RecordNormalizer::EmbedSeeFromHeadings packages
to enable the inclusion of alternate forms of headings in bibliographic
searches. When the new syspref IncludeSeeFromInSearches is turned on
(default is off) rebuild_zebra.pl will insert see from headings from
authority records into bibliographic records when indexing, so that a
search on an obsolete term will turn up relevant records.

To test:
1) Enable IncludeSeeFromInSearches
2) Add a heading that has an alternate form to a record (for example,
   "Cooking" has the alternate form "Cookery," if you have authority
   records from LC)
3) Index the zebraqueue (or reindex if you haven't indexed your system
   yet)
4) Confirm that if you search for "Cookery" you get the record you
   just modified

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Rebased on master 5 August 2012
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Rebased on master 11 September 2012

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>

Also checked:
- Verified database update works correctly
- Checked system preference and its description
- Checked staff/opac detail pages with feature on/off
- Checked staff/opac search facets
- Downloaded and tested records in various formats
- Tried different searches for 'see from' entries of authorities
- Ran all unit tests

No problems found.
2012-09-13 14:19:28 +02:00
Jared Camins-Esakov
8471158160 Bug 8209: "Did you mean?" from authorities
One of the ideas behind authority records is that users who search for
one term should have related terms (according to the authority file)
suggested to them. At the moment, Koha doesn't do that. Adding an
authority searching step to regular searches and displaying any
suggestions in a "Did you mean" bar at the top of the results would be
very useful.

This commit adds a Koha::SuggestionEngine class which is in charge of
getting suggestions from individual suggestion engine plugins, which
much be in the Koha::SuggestionEngine::Plugin::* namespace, and extend
Koha::SuggestionEngine::Base. Suggestions are loaded asynchronously
using AJAX, and a link to a page with suggestions is provided for users
with Javascript turned off.

The AuthorityFile suggestion engine plugin looks up the specified search
terms in the authority file and then suggests searches for records using
matching authorities.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Rebased 2 August 2012 and incorporated QA feedback

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>

Test plan:
- Verified database update added system preference correctly,
  pref defaults to OFF
- Verified search results and detail pages in OPAC and staff
  still worked the same as before
  * for no results
  * with results
- Activated system preference and tested various searches
  * Searches from simple search
  * Searches from advanced search
  * Search links in records
- Deactivated Javascript - verified fallback works correctly

Notes:

- Suggested terms can include autorities with no linked records.
- When combining more than one search option using advanced search
  this results in "no suggestions" more often. Feature works best
  from simple search.

Overall great feature making use of authorities in a user friendly way!

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Rebased on latest master 2012-09-10
Signed-off-by: wajasu <matted-34813@mypacks.net>
2012-09-13 11:34:28 +02:00
Paul Poulain
609dad4014 bug 8431 follow-up DBRev number
+ removing useless ` in DB columns
2012-09-13 11:22:01 +02:00
9dada89776 Bug 8431 - Increase the borrower attribute field size from 64 characters to 255
Some libraries would like to store more verbose data in a borrower attribute field.
This commit increases the maximum length of a borrower attribute from 64 characters
to 255 characters.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2012-09-13 11:04:59 +02:00
Paul Poulain
78d8f9895c Bug 5911 follow-up DBRev number 2012-09-12 15:31:14 +02:00
Srdjan
86c2c4626d bug_5911: Transport Cost Matrix
Create transport_cost table,  added UseTransportCostMatrix syspref.
transport_cost table contains branch to branch transfer
costs. These are used for filling inter-branch hold transfers.

Moved GetHoldsQueueItems() from .pl to HoldsQueue.pm

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-12 14:49:25 +02:00
Marc Veron
01a7188d6a BUG 7621 [ENH] Circulation: Match age restriction of title with borrower's age without using categories
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

New version implementing Paul's advice.
See Wiki http://wiki.koha-community.org/wiki/Age_restrictiotion

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
fix updatedatabase.pl

New fix updatedatabase.pl to apply to current master by Marc Veron veron@veron.ch
...and fixed missing curly bracket after merging updatedatabase.pl

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-05 14:32:53 +02:00
Nicole C. Engard
dcc5f6f938 update 'onloan' in items and deleteditems
This field said it was a 1 or 0 value, but it's
a date field.

http://bugs.koha-community.org/show_bug.cgi?id=6716
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-04 18:21:25 +02:00
Paul Poulain
2fc8360bb7 Bug 7412 follow-up
* DBRev number
  * removing useless `` in table name
2012-09-03 17:03:09 +02:00
Matthias Meusburger
245d6634fe Bug 7412: Pre-filling items in cataloguing
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 syspref is on, unless you specify which fields
you want to prefill in the SubfieldsToUseWhenPrefill syspref.
With a value of "f u v", only the $f, $u and $v will be prefilled, for example.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Rebased and QAed.
2012-09-03 17:01:58 +02:00
7e6690f6e3 Bug 6494 - opacmysummaryhtml on reading history
This patch re-uses code and markup from opac-user.tt & .pl
to place the contents of the opacmysummaryhtml preference
on the circulation history page in exactly the same way
it appears on the "my summary" page.

The wording of the system preference description has
been modified to reflect this addition.

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

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-03 16:27:43 +02:00
D Ruth Bavousett
4e2bf7bea3 Bug 8012: default values for defaultSortField/defaultSortOrder NULL on install
...which *looks* like "relevance/ascending" in the staff client, which doesn't make sense.
This patch initializes the values at "relevance/descending", which is a functional
combination.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-03 15:19:32 +02:00
Jared Camins-Esakov
2e389ec02b Bug 8207 follow-up: correct typo in authority types
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-03 12:43:32 +02:00
Mirko Tietgen
ac61b4df51 Bug 8492 [ENH] Restrict OpacSuppression to IP adresses outside of an IP range
This enhancement extends the OpacSuppression feature with an optional IP address range within which results are _not_ suppressed.

To test

* turn on OpacSuppression (Administration->System preferences->Cataloging) and enter an IP address range in the OpacSuppressionByIPRange field.
* set at least one bibliographic record to suppress=1 (enter '1' in 942$n)
* fully reindex your data
* do an OPAC search that should bring up your suppressed record
* try with IP ranges that match your IP and ranges that don't

Signed-off-by: Marc Veron <veron@veron.ch>

Tested following the scenario above. Works as expected.
2012-09-03 11:56:21 +02:00
e50ba9f220 Bug 8657 - Default sort by call number does not work
If you choose to sort search results in the OPAC or staff
client by call number by default, the wrong value will
be saved by the system preferences editor. It should be
"call_number" instead of "callnumber." This patch
corrects the pref file and updates the database in cases
where defaultSortField or OPACdefaultSortField are
set to the incorrect value for call number sort.

To test: Set defaultSortField and/or OPACdefaultSortField
to "call number" and perform a search. Results will be
sorted by relevance. Apply the patch, update the database,
and search again. Results should now be sorted by call number.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
with the caveat that this will not fix the issue unless the sort order is first set to descending and back to ascending per bug 8012.

However, with the sort order set to a proper sort value, this patch does fix the issue.
2012-08-29 17:51:19 +02:00
Paul Poulain
94d170483f Bug 8670 follow-up DBRev number 2012-08-29 17:46:14 +02:00
ff7417fa91 Bug 8679 [REVISED] Remove usage of Amazon API
This patch removes the AmazonReviews and AmazonSimilarItems
features from the OPAC and staff client. With on Amazon
feature remaining, cover images, the *AmazonEnabled preference
is also removed in favor of checking the *AmazonCoverImages
preference. Two other system preferences, AWSAccessKeyID and
AWSPrivateKey are removed as they were required only by the
removed features.

Handling of book cover images from Amazon is unchanged.

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

Turned on amazon covers in opac and staff client and all
worked as expected. Then tested to make sure other cover image
services still worked and they do.

Signing off.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-08-29 16:05:29 +02:00
Paul Poulain
7199d94a96 Bug 8263 follow-up DBRev number 2012-08-03 12:30:04 +02:00
daeb964996 8263 Consistent stylesheet prefs
This patch makes the use of opaccolorstylesheet and opaclayoutstylesheet more consistent. They may be: 1) just a file name, 2) a complete local path or 3) a full URL starting with http: for a remote css file.
This makes the syspref opacstylesheet that was only used for a remote css file obsolete.

June 20, 2012 Rebased.
July 18, 2012: Regex allows https too (thanks to Owen Leonard).

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-08-03 12:03:30 +02:00
688e81f7fe 8263 Make OPAC stylesheet preferences more consistent (dbrev)
This patch handles the dbrev for this report. It optionally saves the value of the former opacstylesheet pref into opaclayoutstylesheet.

June 21, 2012 & July 4, 2012: Rebased.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
2012-08-03 12:03:25 +02:00
Paul Poulain
6271f9b6c4 Bug 6448 follow-up, DBrev number 2012-08-02 18:49:59 +02:00
Dobrica Pavlinusic
28e5427c60 Bug 6448 [2/3] Barcodes::EAN13 autoBarcode
Implement auto-incrementing EAN-13 barcodes

To make this work, C4::Barcodes::next was modified to call process_tail with
new incremented value so that process_tail can generate correct checksum.
Since process_tail is currenlty not used by any barcodes, this change is safe.

C4::Barcodes is used by addbiblio.pl when adding multiple records, while value_builder
is used in all other cases.

Test scenario:

1. prove t/Barcodes_EAN13.t

2. KOHA_CONF=/etc/koha/sites/fer/koha-conf.xml prove t/db_dependent/Barcodes.t
   this will check C4::Barcode implementataion

3. in systempreference change autoBarcode to incremental EAN-13 barcode

4. edit two items of any biblio assigning barcodes and verify that numbers
   are increasing. Have in mind that last digit is check digit, and it
   doesn't increment, but is calculated from barcode itself. Example with
   checksum in brackets: 000000086275[2], 000000086276[9], 000000086277[6]

5. Add Item and verify that it gets assigned next barcode

6. Add & Duplicate item and verify barcode increase

7. Add Multiple Copies and verify that barcode increase for each copy

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-08-02 18:41:44 +02:00
Dobrica Pavlinusic
089b1151f5 Bug 6448 [1/3] EAN-13/UPC-A itemBarcodeInputFilter
This filter which check validity of EAN-13 barcode and padd it with zeros
up to full 13 digit number. This will also expand 12 digit UPC-A barcodes
to EAN-13 automatically which is useful for older barcode readers which tend
to ignore first zero in EAN-13 if they have just UPC-A support.

It should be noted that EAN-13 or UPC-A product codes printed on books are not
good choice for barcodes in Koha since each item has to have unique barcode.

Test scenario:

1. prove t/Circulation_barcodedecode.t
   this checks expansion of 12 digit UPC-A to 13 digit EAN-13 and zero padding

2. in systempreferences search for itemBarcodeInputFilter and select EAN-13

3. edit one item and assign it valid EAN-13 barcode, eg. 0000000695152, check it out

4. test checkin with just 695152 to test leading zero expansion

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
2012-08-02 18:41:40 +02:00
Jared Camins-Esakov
fe47a27c79 Bug 8207: Allow see also fields in auths to link to thesauri
Right now if you were to link a field in an authority to a thesaurus, it
would 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).

This patch adds subfield $9 and thesaurus links to existing installs
for those 5xx fields (under MARC21 and NORMARC only) which do not yet
have any subfield $9 or thesauri configured, as well as adding that to
new English language installs. There will be a follow-up patch adding
the subfields to new non-English language install files later, once
it is clear that the changes proposed and demonstrated in the English
files are accepable to the community.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested frameworks install cleanly on a new installation.

Tested database update and made sure, that configuration and subfields
of a field were not changed if
- a $9 subfield already existed for a 5xx field
- a $9 subfield and a link to another thesaurus in $a existed
- no $9 but a link to another thesaurus in $a existed

This seems safe to me.
2012-08-01 15:46:17 +02:00
Savitra sirohi
ba8a6ed141 Bug 7153 - Show Open Library as Search Target in "More Searches" in OPAC detail page
Update syspref OPACSearchForTitleIn to include Open Library as a target in More Searches in the OPAC detail page

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

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-07-26 14:55:23 +02:00
Elliott Davis
381794ff4e [PATCH] bug_7420: Added overduefinescap to issuingrules
Replaced existing MaxFine syspref logic with overduefinescap.
Repurposed MaxFine to be the overall overdue limit for all items
overdue. Implemented new MaxFine logic in UpdateFine().

Signed-off-by: Elliott Davis <elliott@bywatersolutions.com>
Tested according to Srdjan's test plan and everything worked like he said it would.  I set fined equal to $2 and max fine equal to $1.      When I ran the fines script for overdue items fines assessed were only $1.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-07-25 18:33:20 +02:00
Paul Poulain
4feb0a6246 Bug 6716 tiny follow-up, mysql want a space after the -- 2012-07-23 18:26:21 +02:00
Nicole C. Engard
7f7599ea05 Bug 6716: Update z3950servers documentation
The new timeout field was not documented.
2012-07-23 18:23:38 +02:00
Nicole C. Engard
479c490676 Bug 6716: Document search_history table 2012-07-23 18:23:37 +02:00
Nicole C. Engard
98f539f7aa Bug 6716: Document saved_sql table 2012-07-23 18:23:36 +02:00
Nicole C. Engard
7b1676895a Bug 6716: Update reserves table
This table had one field that I hadn't documented
before and two new fields for hold suspensions. All
of these are now updated.
2012-07-23 18:23:35 +02:00
Nicole C. Engard
89a4ae4076 Bug 6716: Update documentation for the letter table
The letter table is now for slips and notices, and
had other changes necessary.
2012-07-23 18:23:34 +02:00
Nicole C. Engard
f3160d1005 Bug 6716: document import_record_matches table 2012-07-23 18:23:33 +02:00
Nicole C. Engard
67bd83d180 Bug 6716: Document import_batches table 2012-07-23 18:23:32 +02:00
Nicole C. Engard
929fee5f8c Bug 6716: Document tags tables
I did not document the 'tags' table in this patch
because it looks like this table is unused, so I
need confirmation of that before marking it as
'unused.'
2012-07-23 18:23:31 +02:00
Nicole C. Engard
5ab6d0ccd9 Bug 6716: Document patronimage table 2012-07-23 18:23:29 +02:00
Nicole C. Engard
f32d7e6483 Bug 6716: document issuingrules table 2012-07-23 18:23:28 +02:00
Nicole C. Engard
707d5a5e68 Bug 6716: Document branch_borrower_circ_rules table 2012-07-23 18:23:27 +02:00
Nicole C. Engard
e7816ad31e Bug 6716: Document branch_item_rules table 2012-07-23 18:23:26 +02:00
Nicole C. Engard
a3a6407e51 Bug 6716: Document the biblio_framework table 2012-07-23 18:23:25 +02:00
Nicole C. Engard
1b0e6938ad Bug 6716: Document aqbasket table 2012-07-23 18:23:24 +02:00
Nicole C. Engard
73def1a24a Bug 6716: Document action_logs table 2012-07-23 18:23:23 +02:00
Nicole C. Engard
bfaef0bb19 Bug 6716: Update ratings table documentation
This patch adds a comment to the table and updates the field
descriptions with a bit more information.
2012-07-23 18:23:22 +02:00
Nicole C. Engard
86392dde00 Bug 6716: Document branchtransfers table 2012-07-23 18:23:21 +02:00
Nicole C. Engard
1a3102ce91 Bug 6716: Document aqorders_items table 2012-07-23 18:23:20 +02:00
Nicole C. Engard
bb1d8dd960 Bug 6716: Document the aqorders table
This table has a lot of fields that I never see any values in.
All have been noted in the documentation and I welcome any
additional info about how these fields might be used.
2012-07-23 18:23:19 +02:00
Nicole C. Engard
3b78048645 Bug 6716: Document aqbudgets and aqbudgetperiods tables 2012-07-23 18:23:18 +02:00
Paul Poulain
175e1bdcbd Bug 8083 follow-up DBRev number 2012-07-23 10:51:04 +02:00
Srdjan
10fdb7fe50 bug_8083: Explanation of update query
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-07-23 10:44:02 +02:00
Srdjan
c1e5462db1 bug_8083: parameters subpermissions: manage_circ_rules and parameters_remaining_permissions
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2012-07-23 10:43:59 +02:00
2662e4c069 Bug 7065 - reserves table needs a primary key
Adds the primary key reserve_id to reserves and old_reserves.

Thanks to gmcharlt and jcamins for contributions.

Signed-off-by: MJ Ray <mjr@phonecoop.coop>
Signed-off-by: Ian Walls <koha.sekjal@gmail.com>

Updated DBrev to start with 3.09... instead of 3.08...
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-07-10 12:09:01 +02:00
Paul Poulain
b85d5d3440 Bug 7563 follow-up DBRev 2012-07-06 18:26:39 +02:00
Marc Veron
45f6b755fa Bug 7563 - Silent print slips using Firefox PlugIn jsPrintSetup and new staff client preference
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-07-06 18:23:39 +02:00
Paul Poulain
3a4c547aaa Bug 8233 follow-up fixin DBRev
porting 2nd patch of the bug, that does not apply anymore, to fix DB version
2012-07-06 16:54:44 +02:00
Jonathan Druart
623f3a2c84 Bug 8233 : SearchEngine: Add a Koha::SearchEngine module
First draft introducing solr into Koha :-)

List of files :
  $ tree t/searchengine/
  t/searchengine
  |-- 000_conn
  |   `-- conn.t
  |-- 001_search
  |   `-- search_base.t
  |-- 002_index
  |   `-- index_base.t
  |-- 003_query
  |   `-- buildquery.t
  |-- 004_config
  |   `-- load_config.t
  `-- indexes.yaml
  just do `prove -r t/searchengine/**/*.t`

  t/lib
  |-- Mocks
  |   `-- Context.pm
  `-- Mocks.pm
  provide a mock to SearchEngine syspref (set_zebra and set_solr).

  $ tree Koha/SearchEngine
  Koha/SearchEngine
  |-- Config.pm
  |-- ConfigRole.pm
  |-- FacetsBuilder.pm
  |-- FacetsBuilderRole.pm
  |-- Index.pm
  |-- IndexRole.pm
  |-- QueryBuilder.pm
  |-- QueryBuilderRole.pm
  |-- Search.pm
  |-- SearchRole.pm
  |-- Solr
  |   |-- Config.pm
  |   |-- FacetsBuilder.pm
  |   |-- Index.pm
  |   |-- QueryBuilder.pm
  |   `-- Search.pm
  |-- Solr.pm
  |-- Zebra
  |   |-- QueryBuilder.pm
  |   `-- Search.pm
  `-- Zebra.pm

How to install and configure Solr ?
  See the wiki page: http://wiki.koha-community.org/wiki/SearchEngine_Layer_RFC

http://bugs.koha-community.org/show_bug.cgi?id=8233
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
2012-07-06 16:51:58 +02:00
Paul Poulain
459efb364a Bug 5981 follow-up DBrev number 2012-07-04 16:27:44 +02:00
Alex Arnaud
b20ffe15bb Bug 5981 - OPAC: Add limits to search history
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Fixed a conflict in updatedatabase and removed kohaversion.pl from the patch.

Patch works nicely, tested with different searches and limits.

Note: Sort options don't get into the history still.
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-07-04 16:26:33 +02:00
Paul Poulain
3ba8426564 Bug 6557 follow-up UNIMARC 942$0 in default french frameworks 2012-06-29 15:25:11 +02:00
Jared Camins-Esakov
c0714a99f2 Bug 6557: Record bib popularity in totalissues
Because updating the total issues count associated with a bibliographic
record on issue could cause a significant load on the server, this
commit adds the syspref UpdateTotalIssuesOnCirc (which defaults to OFF
to match existing behavior). The syspref has the following description:

  Do/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).

Bug 6557: automatically increment totalissues

Adds the ability to automatically increment biblioitems.totalissues
whenever an item is issued.

To test:
1) Choose a record with at least one item that can circulate
2) Check the value of 942$0 (you may need to look at the plain MARC view
   on the OPAC). Most likely there won't be any 942$0 at all
3) Enable UpdateTotalIssuesOnCirc
4) Check out the item you selected
5) Check the value of 942$0 (you may need to look at the plain MARC view
   on the OPAC). That value should now be one greater than before
6) Discharge the item
7) Disable UpdateTotalIssuesOnCirc
8) Check out the item you selected again
9) Check the value of 942$0 (you may need to look at the plain MARC view
   on the OPAC). That value should not have changed

Bug 6557: add script to update totalissues from stats

NAME
       update_totalissues.pl

SYNOPSIS
         update_totalissues.pl --use-stats
         update_totalissues.pl --use-items
         update_totalissues.pl --commit=1000
         update_totalissues.pl --since='2012-01-01'
         update_totalissues.pl --interval=30d

DESCRIPTION
       This batch job populates bibliographic records' total issues count
       based on historical issue statistics.

       --help  Prints this help

       -v|--verbose
               Provide verbose log information (list every bib modified).

       --use-stats
               Use the data in the statistics table for populating total
               issues.

       --use-items
               Use items.issues data for populating total issues. Note that
               issues data from the items table does not respect the --since
               or --interval options, by definition. Also note that if both
               --use-stats and --use-items are specified, the count of biblios
               processed will be misleading.

       -s|--since=DATE
               Only process issues recorded in the statistics table since
               DATE.

       -i|--interval=S
               Only process issues recorded in the statistics table in the
               last N units of time. The interval should consist of a number
               with a one-letter unit suffix. The valid suffixes are h
               (hours), d (days), w (weeks), m (months), and y (years). The
               default unit is days.

       --incremental
               Add the number of issues found in the statistics table to the
               existing total issues count. Intended so that this script can
               be used as a cron job to update popularity information during
               low-usage periods. If neither --since or --interval are
               specified, incremental mode will default to processing the
               last twenty-four hours.

       --commit=N
               Commit the results to the database after every N records are
               processed.

       --test  Only test the popularity population script.

WARNING

If the time on your database server does not match the time on your Koha
server you will need to take that into account, and probably use the
--since argument instead of the --interval argument for incremental
updating.

=== TESTING PLAN ===

NOTE: in order to test this script, you will need to have some sort of
circulation data already existing in your Koha installation.

1) Disable UpdateTotalIssuesOnCirc
2) Run: misc/cronjobs/update_totalissues.pl --use-items -t -v
3) If you have total checkout data in your item records (i.e. anything
   in 952$l), you should see messages like "Processing bib 43 (1 issues)"
4) Choose one of the lines that shows more than 0 issues, and view the
   record with that biblionumber in the staff client, choosing the "Items"
   tab (moredetail.pl). Add up the "Total checkouts" listed for each item,
   and confirm it matches what the script reported
5) Run: misc/cronjobs/update_totalissues.pl --use-stats -t -v
6) If you have any circulation statistics in your database (i.e. any
   'issue' entries in your statistics table), you should see messages
   like "Processing bib 43 (1 issues)";
7) Choose one of the lines and view the record with that biblionumber in
   the staff client, choosing the "Items" tab (moredetail.pl). If you
   count the number of checkouts listed in each item's checkout history,
   the total should match what the script reported.
8) Check out an item
9) Run: misc/cronjobs/update_totalissues.pl --use-stats
   --incremental --interval=1h -t -v
10) You should see one line reporting a single circ for the bib record
    associated with the item you just checked out (there may be more if
    you checked out any books in the hour prior to running these tests
11) If the results in steps 4, 7, and 10 match the predictions, the
    script worked

This patch to Koha was sponsored by the Arcadia Public Library and the
Arcadia Public Library Foundation in honor of Jackie Faust-Moreno, late
director of the Arcadia Public Library.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Tested this with my test data - numbers are correct and updated appropriately.

More importantly - if I do a popularity search, the most popular items *come up first*. Amazing.
2012-06-29 14:29:22 +02:00
76b80ac33c Bug 8130 - attach PDF files to a patron record
Adds the ability to attach unlimited arbitrary files to
a borrower record.

Test Plan:
1) Enable system preference EnableBorrowerFiles
2) Look up borrower record, click 'Files' tab on left
3) Upload a file, download the file, delete the file.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
rebased for current master.

Signed-off-by: Ian Walls <koha.sekjal@gmail.com>
rebased again; some indentation issues in include menus.
2012-06-28 10:55:51 +02:00
Paul Poulain
e57afa00f5 Bug 8205 follow-up DBRev number 2012-06-28 09:22:58 +02:00
Jared Camins-Esakov
44cd5e058b Bug 8205: Add OPACShowUnusedAuthorities syspref
Rather than list authorities that are not actually used by a library,
this commit introduces a new syspref: OPACShowUnusedAuthorities to
enable libraries to hide unused authorities in the OPAC authority browser.

To test:
1) Do a search in the OPAC authority browser that brings up multiple
   results, including some that are used in the bibliographic database
   and some that are not.
2) Observe that the results include both used and unused authorities.
3) Set OPACShowUnusedAuthorities to "Do not."
4) Repeat the same search as in step 1.
5) Observe that the results no longer include unused authorities.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Preference is implemented cleanly and works like advertised.
As a note: The unused authority records will be hidden from display,
but the result list paging does not adjust for the hidden records.
So the result pages will show more or less records total, depending
on how many records are hidden.
2012-06-28 08:59:46 +02:00
Paul Poulain
e73058e469 Bug 7304 followup DBRev number 2012-06-27 16:56:08 +02:00
Julian Maurice
203757e353 Bug 7304: More permissions for budgets
- Possibility to add users to a budget
- Restrictions changed to:
  - None
  - Owner
  - Owner and users
  - Owner, users and library
- Restricted users cannot spent on these budgets (they cannot modify them
  either)

Modified pages:
 - admin/aqbudgets.pl
 - admin/aqplan.pl
 - suggestion/suggestion.pl
 - acqui/acqui-home.pl
 - acqui/addorderiso2709.pl
 - acqui/basket.pl
 - acqui/neworderempty.pl

Unit tests in t/Budgets/CanUserUseBudget.t and t/Budgets/CanUserModifyBudget.t

Bug 7304 tmp

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-06-27 16:25:44 +02:00
Paul Poulain
866fc7653c Bug 8289 Upgrading from 2.2 does not work anymore
The updatedatabase22to30.pl script update the engine from MyISAM to InnoDB for most tables.

However, the TYPE=InnoDB was deprecated, and is not removed.
The correct syntax is now ENGINE=InnoDB

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
2012-06-25 16:15:42 +02:00
Paul Poulain
a163be4113 Bug 3708 - Add another customizable region to the OPAC: right sidebar nav
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.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-06-20 23:11:06 +02:00
Amit Gupta
5836738957 Bug 6774 Display barcode on OPAC detail page(Correcting Typo).
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Rebased to current master, works in my tests, but needs another set of eyes.
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2012-06-20 22:04:32 +02:00
Dobrica Pavlinusic
a29a5df175 Bug 7857 - invalidate cached preferences after SetVersion
This allows plack to correctly move to login page after database upgrade
2012-06-20 21:32:33 +02:00
Jonathan Druart
5e2001a6f8 Bug 7955: Statistics tab for Patron checkouts
This patch adds a new 'statistics' tab in the Patron module.
For a borrower, this tab contains a table with:
- number of checkout for today
- number of checkin for today
- "precedent state", the number of checkouts the patron had yesterday on
  its library card
- "actual state", the number of checkouts on the borrower card at the current date

A new syspref (StatisticsFields) contains a list of fields (separated by
pipe (|) on which the table results is based. The default value is
location|itype|ccode

Signed-off-by: Mathilde Formery <mathilde.formery@ville-nimes.fr>
2012-06-20 21:16:50 +02:00
Robin Sheat
ac5a8ca2df Bug 8222 - make the zipcode no longer mandatory
Having the zipcode field mandatory by default is a bit annoying for
places where no one cares about it. This patch stops it being the case
on new installs.

Signed-off-by: Michael Davis <m.r.davis@cranfield.ac.uk>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-06-20 10:45:33 +02:00
Paul Poulain
591bae324d Bug 4246 Follow-up updatedatabase 2012-06-10 18:16:33 +02:00
Ian Walls
d29efac4f3 Talking Tech Support - Phase I
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.

Aside from the control system preference, and the necessary changes to Messaging Preferences
forms to make use of phone notifications, the bulk of the code resides in external
cronjobs.

TalkingTech_itiva_outbound.pl generates the Spec C file to send to I-tiva.  Actual transmission
of the file must be handled by the system administrator.

TalkingTech_itiva_inbound.pl processes the received Results file from I-tiva.  Getting the
file from I-tiva to Koha is the job of the system administrator, as well.

Both scripts have a --help option with full documentation.

The only necessary change to core Koha behavior is in C4::Letters::EnqueueLetter.  The return
value was changed from 0 or 1 (successful addition of letter to message_queue or not), to the actual
insert ID of the letter.  This was required by the outbound script to present a unique Transaction ID
for the notice added to the patron's record (so a 'sent' or 'failed' status could be updated).  Since
the dbh and sth are not shared, and the last_insert_id() command is table-specific, this should be thread-safe.
No changes are necessary to any parts of Koha, as all usage of EnqueueLetter currently ignores the return value.

To Test:

1. Turn on TalkingTechItivaPhoneNotification system preference
2. Verify that 'phone' is now a valid notification option for patrons on both staff and OPAC side
3. Attempt to set a 'phone' preference for PREDUE or HOLD messaging; attempt should succeed
4. Set up the patron for notices to triggers:
   a. include checked out items due in a range of days, including the value set up in their messaging preferences.
   b. place several holds, some in position, others waiting for pickup, others in transit.
   c. set the patron up to have overdues, overdue by a range of days that includes the delay values for
the patrons branch and categorycode
5. Run TalkingTech_itiva_outbound.pl --type=RESERVE --type=PREOVERDUE --type=OVERDUE --outfile=/tmp/talkingtechtest.csv

The resulting talkingtechtest.csv file should include all the items due on X days (where X is the patrons' preference),
and none of the ones due in other increments.  Similarly, overdues messages should be added for each item due by a delay
value as configured; overdues of other numbers of days should be ignore.  Holds that are waiting pick up or in transit should
have messages, those still pending should not.

Messages should be added to the patron's notices tab for each issue sent.  Verify these messages exist, and all Notices
tokens are replaced with appropriate information.

Repeat, this time with 4c making use of the default branch overdue triggers, instead of branch-specific triggers.

To test the inbound script, create a CSV with rows in the format "<<Message_id>>","<<SUCCESS or FAIL>>"
Message ID should correspond to the final column of the talkingtechtest.csv file (the transaction id) for the message.

Primary Authorship: Ian Walls
Additional modifications: Kyle M Hall

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

Tested and in use in production by two public libraries : Middletown
and Washoe. Both have given their sign off, but don't have git to
actually sign off.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-06-10 17:46:52 +02:00
Marc Veron
419b0dfccf Bug 7601 - Preference for default language for field 008 Range 35-37 (instead of hard coded "eng")
When a new marc record is added, the language code in field 008 Range 35-37 defaults to Englih ("eng"). This makes cataloguing inefficient and error-prone for librarians if most of the bibliographic data is e.g. in German or in French.

Test:
- Apply patch
- Edit preference DefaultLanguageField008, fill in e.g. 'ger'
- Go to Cataloguing, Add marc Record
- Click in field 008. Language code should read 'ger' (instead of 'eng')

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
2012-06-10 10:53:14 +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
Matthias Meusburger
7f957077dd Bug 5337: EAN management : Adds ean for various searches
- in various acquisition pages and serials home
  - in database : biblioitems.ean
  - adds ean and its mapping in default english bibliographic framework
  - adds ean mapping in default french bibliographic framework
  - ean search is not enabled for MARC21

The required mapping between the ean marc field and the biblioitems.ean
database field will be automatically added on an existing unimarc installation.

However, if you already have records with ean, you will have to
run misc/batchRebuildBiblioTables.pl to populate biblioitems.ean

Signed-off-by: jmbroust <jean-manuel.broust@univ-lyon2.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Passed QA at second run. Removed a merge marker only.
2012-06-09 18:26:34 +02:00
Paul Poulain
d49cefdece bug 8167 follow-up: DBRev number 2012-06-09 16:28:00 +02:00
2aff4b467b Bug 8167 - Add syspref allow a choice of blocking, non-blocking, or do nothing when issuing lost items.
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Works as advertised.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-06-09 16:21:05 +02:00
Paul Poulain
157a29b2f9 Bug 8182 follow-up, fixing BLO typo mistake 2012-06-05 16:22:30 +02:00
21475a6cbc Bug 8182 - Problem with overdue fine calculations after upgrade
Items that were overdue and still out as of 5/26 (date of Upgrade) were charged
overdue fines as of 5/26.  When the items DO come back, the overdue fines are
calculated again from the due date to the date of checkin.  Therefore the
patron is being charged double overdue fines from the original date up to 5/26.

This is caused by issues.date_due being changed to a datetime, with the
hour/minute/secons time portion defaulting to 00:00:00. It should be 23::50::00 instead.

This is an unusual patch as it modifies a previous database update. This
make sense because if a install has already been updated past the db rev
update, this fix will be too late. It will only help those that have not
updated past that db revision.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-06-05 16:05:28 +02:00
Jared Camins-Esakov
64f933a2fa Bug 8159: Fix error in kohastructure.sql
Adds a missing semicolon.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-05-31 18:12:34 +02:00
Paul Poulain
838269d1e7 Bug 7792:redefine the field branchcode as PRIMARY KEY of branches
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-05-28 11:59:44 +02:00
Paul Poulain
261d870601 Bug 7794: follow-up DBRev number + removing UNIQUE index that is now useless 2012-05-28 11:55:23 +02:00
Stéphane Delaune
90928e1404 Bug 7794:redefine the field id as PRIMARY KEY of sessions
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-05-28 11:46:47 +02:00
Paul Poulain
a6b3dcb301 Bug 5795 follow-up, DBRev number 2012-05-24 18:08:36 +02:00
Amit Gupta
b920b61799 Bug 5795 Update the database as follow-up If sys pref
ReservesControlBranch has null then update the table to
insert a PatronLibrary as value

To Test:
1) Go to mysql use koha database
2) select * from systempreferences where variable = 'ReservesControlBranch'; Check if value set to ItemHomeLibrary.
+-----------------------+-----------------+-------------------------------+-------------------------------------------------+--------+
| variable              | value           | options                       | explanation                                     | type   |
+-----------------------+-----------------+-------------------------------+-------------------------------------------------+--------+
| ReservesControlBranch | PatronLibrary   | ItemHomeLibrary|PatronLibrary | Branch checked for members reservations rights. | Choice |
+-----------------------+-----------------+-------------------------------+-------------------------------------------------+--------+

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-05-24 18:06:01 +02:00
Katrin Fischer
2d5655cdd4 Bug 5795 [SIGNED-OFF] - Missing ReservesControlBranch system pref in database installer
sysprefs.sql file was missing ReservesControlBranch.

To test:
1) Create a new installation and check sysprefs.sql loads correctly.
2) Check ReservesControlBranch shows up correctly in the sys pref editor.
3) Check sys pref can be edited and new value saves correctly.

Signed-off-by: Marc Veron <veron@veron.ch>

- Line is added at the end of installer/data/mysql/sysprefs.sql
- Tested Line diretly in MySQL with a systempreferences table where variable 'ReservesControlBranch' was missing. Data inserted correctly.
- Syspref shows up in Staff client

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

- Fixed merge conflict
2012-05-24 18:05:58 +02:00
Paul Poulain
4533ff7dd3 Bug 7398 follow-up DBRev number 2012-05-24 15:47:37 +02:00
Srdjan
c80fe2be2d bug_7398: Replaced OPACDisplayRequestPriority syspref with OPACShowHoldQueueDetails
New syspref is Choice, options being:
- None
- Priority only
- Holds number only
- Holds number and priority

Show holds count on OPAC detail

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-05-24 15:32:19 +02:00
Paul Poulain
0754c2f7cf Bug 7977 follow-up DBRev number 2012-05-24 14:33:30 +02:00
9959cf45e7 add edit_quotes to es-ES/mandatory/userpermissions.sql
Signed-off-by: Mason James <mtj@kohaaloha.com>

http://bugs.koha-community.org/show_bug.cgi?id=7977
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-05-24 14:15:21 +02:00
Chris Nighswonger
d42e35ef49 Making source a text field rather than a varchar to avoid potential length limitations
http://bugs.koha-community.org/show_bug.cgi?id=7977
Signed-off-by: Mason James <mtj@kohaaloha.com>
2012-05-24 14:15:15 +02:00
Chris Nighswonger
73c5061379 Bug 7977: Fixing quote sample data timestamps
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
2012-05-24 14:14:23 +02:00
Chris Nighswonger
eb7e930eea Bug 7977: Quote-of-the-day (QOTD) Feature for OPAC
This feature will add the option of displaying a select quote
for the day on the OPAC homepage. It will include the addition
of a QOTD editor in the tools section of the staff interface
which will allow the addition, editing, and deletion of quotes.
A single system preference will enable/disable the display of
the QOTD on the OPAC homepage. A new granular permission will
also be added to conrol user access to the QOTD editor tool.

Possible extentions to this would be code to allow alternate
quote selection algorithms to be added to vary how the currently
displayed quote is selected from the table of quotes.

This patch is a squash of the following work:

--Adding quotes table to kohastructure.sql and updatedatabase.pl

Note: This patch is intended for a MySQL based installation only.
That means that it includes backticks because that is what is required
at this point in history to install Koha correctly on a MySQL based
installation.

Feel free to port this over to the Pg stuff in the data/Pg directory.

--Adding system preference to control display of QOTD on OPAC main page
--Adding sample quote data

These quotes are taken from various US presidents. I'm not sure these
are applicable to the rest of the world, so I'm leaving it to translators
and others to add sample quote data for other languages.

--Adding edit_quotes user permissions
--Squash with other db related patches in this series
--Adding quotes editor pages to tools
--Adding QOTD editor link to tools homepage
--Integration of DataTables into QOTD Editor
--Impleminting jEditable into the quote editor
--Adding delete and add option to editor
--Fixing OPAC display so the QOTD div does not show if no quote is returned
--Also removing useless code from tools/quotes.pl
--Adding spans around QOTD foo in opac-main.tt
--Also fixing quote selection logic to accomodate the possibility of
    a single quote in the db a litte better.
--Changing timestamp column header to a more user-friendly 'Last Displayed'
--Fixing bug in quote selection logic. This bug caused a situation where
    when the table had only a single quote with an id greater than 1 in it,
    no quote would be selected.
--Fixing up sorting in the quote editor table. --jcamins
--Adding span element to quote separator --jcamins
--Overriding the default empty table message supplied by datatables-strings.inc
--Adds missing page heading
--Adds beginning of click-for-help elements.
--Refactors delete functionality to allow selecting of quotes to delete,
    enabling multi-delete.
--Refactors saving added quote functionality so that striking <Enter>
    saves the new quote.
--Refactors canceling aded quote functionality so that striking <Esc>
    cancels the new quote.
--Removing debug console.log statements
--Implementng the YUI button widget/toolbar used on other pages.
--Adds a 5px radius to all YUI buttons to bring them into
    conformity with the general trend toward rounded corners
--Fixes capitalization in quote editor
--Implements improvements suggested by jcamins and oleonard
--Adds DataTables Plugin dataTables.fnReloadAjax.js

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
2012-05-24 14:14:05 +02:00
Paul Poulain
978ac74b34 Bug 5742 follow-up DB rev number 2012-05-15 18:02:05 +02:00
Paul Poulain
aa34994174 Bug 5742 follow-up permissions for RU and UK languages 2012-05-15 18:01:49 +02:00
Jonathan Druart
a6c6946dfc But 5742: Batch edit patrons
new permission : edit_patrons

Plan test:
- Go on the page: tools > Patrons modification (modborrowers.pl)
- Enter a list of cardnumbers (or use a file)
- Modify one or more patron's fields (you can modify surname, firstname,
branchname, category, sort1, sort2, date of enrollment, date of expiry,
debarred date, debarred comment and borrower note)
- Save
- Check on the result page (or in database for non-displayed fields) if
modifications have been correctly made.
- re test with different attributes. For each attributes filled with an
authorized value category, you can select a value in a drop-down list.
Else it's a free input text. If your attribute is filled with a patron
category, the modification performs only on patrons belonging to this
category
- Save
- Verify on the result page

Signed-off-by: Mathilde Formery <mathilde.formery@ville-nimes.fr>
Signed-off-by: Stéphane Delaye <stephane.delaye@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-05-15 17:44:19 +02:00
Paul Poulain
c7bbb0f773 bug 8022 follow-up, missing permission in spanish
This patch should quiet jenkins
2012-05-14 18:13:41 +02:00
Magnus Enger
e8ad24ca78 Bug 7984 [SIGNED-OFF] - Fix the upload_local_cover_images permission
upload_local_cover_images is needed to use the new, cool local covers
feature

This patch
- adds upload_local_cover_images to
  installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql
  from whch it was missing, making it impossible to use the local
  covers feature in an nb-NO installation
- translates the text of the preference for de-DE (thanks to cait,
  drojf and mveron for the translation)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Marc Veron <veron@veron.ch>

I did no fresh installs, however I
- had a look at the files before and after applying the patch
- carefully checked the syntax
- tested with MySQL by removing the entry in the table 'permissions'
  double checked that now the entry in Staff client was one
  and then did  an insert with the sql snippets.
  In DE-de the translated entry translation appeared as expected.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-05-14 14:47:35 +02:00
Paul Poulain
c6337e7ea5 Bug 7249 BDRev number 2012-05-11 10:58:43 +02:00
Jared Camins-Esakov
02a6d2b1d0 Bug 7249: Syspref to control number of rows in web service results
The original patches for bug 7249 had a hardcoded limit of ten rows in the
results returned by the web service. This patch adds a SvcMaxReportRows syspref
which allows the librarian to choose how many rows should be returned by the
web service.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-05-11 10:26:33 +02:00
Chris Hall
24213703d5 Bug 7249 : Allow reports to be called through a restful interface
Hands back JSON, and supports caching

Squashed commit of the following:

commit 5c93506079738b9a13139417d3a0734289a4b007
Author: Chris Hall <chrish@catalyst.net.nz>
Date:   Mon Nov 21 15:41:14 2011 +1300

    Fixed bugs when creating reports, added more user friendly input and
    feedback

commit c62430bb358ee4af6ee5331b4d3a2ed67f723032
Author: Chris Hall <chrish@catalyst.net.nz>
Date:   Mon Nov 21 12:00:27 2011 +1300

    Added caching to intranet report webservices, added cache expiry and public
    options to reports

commit 2d89f0777d95b26bf08635782070b6367d0698f3
Author: Chris Cormack <chris@bigballofwax.co.nz>
Date:   Wed Nov 9 20:29:26 2011 +1300

    Working on caching for services

commit e0511f180cebd81747858ad776433fe3a1cf6854
Author: Chris Cormack <chris@bigballofwax.co.nz>
Date:   Wed Nov 9 08:28:26 2011 +1300

    Starting work on webservices

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Patch includes database update adding 2 new fields to the saved_sql table.

1) Checked that adding/deleting/editing of sql reports still works and new
fields are correctly saved to the database.

2) The saved reports page now lists the new fields correctly.

3) Checking URLs with JSON output
- if report is not public http://localhost/cgi-bin/koha/svc/report?id=2 fails,
but http://localhost:8080/cgi-bin/koha/svc/report?id=2 works
- if report is public, both links work

4) Checking results are cached
Created a report listing my borrowers, setting caching to 60 seconds and
added new borrowers before doing following tests.
- URL doesn't show new borrower immediately - correct
- Turning off the usecache system preference updates data - correct
- Restarting memcached updates data '/etc/init.d/memcached restart' - correct
- Waiting until cache time runs out updates data - correct

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Retested the feature and renewing my sign-off.

There are some things that should be noted:
- currently there is a hardcoded limit of 10 results for the reports webservice
- reports with runtime parameters are currently not supported
2012-05-11 10:26:29 +02:00
Katrin Fischer
548b85db85 Bug 2399: Follow up removing MySQLisms from ru-RU and uk-UA sample files
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-05-07 22:26:57 +02:00
Katrin Fischer
86ae1e2849 Bug 2399: All status fields in the item edit interface offer two blank/null entries per dropdown instead of one
Removes the '0' values without description from the sample date for
authorised values.

To test:
1) Verify that SQL files load correctly
- truncate authorised_values; /* empty authorised values table */
- load sample data using one of the SQL files
2) Check cataloging interface - all status fields should only show 1 empty line

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2012-05-07 22:26:53 +02:00
Paul Poulain
a726cf2804 Bug 8002 follow-up to use 3.09 and MODIFY instead of 3.08 and CHANGE
see Ian comment 4 (http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8002)
2012-04-30 14:36:08 +02:00
50f1db6c77 Bug 8002 [SIGNED-OFF][REVISED] Can't add patron attribute type in newer installation
Correcting patron_attributes_types definition in kohastructure.sql
to allow NULL entries for category_code, matching the definition
specified in updatedatabase.pl. Adds an entry to updatedatabase.pl
to correct existing installations with the incorrect table structure.

After running the updated updatedatabase.pl the category_code
column in borrower_attribute_types should show that it allows
NULL entries. Adding a new patron attribute type with no
patron category specified should work correctly.

To test the update to kohastructure.sql: Back up your Koha
database, drop it, and recreate it. Load the staff interface
and go through the web installer. After recreating the database
enable ExtendedPatronAttributes and try adding a new patron
attribute type with no patron category specified. The operation
should be successful.

signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
a new update for installations affected.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-30 14:28:49 +02:00
Paul Poulain
142c62081f Koha 3.8.0 bump 2012-04-23 16:28:46 +02:00
Chris Cormack
c606b53763 Bug 6931 : Only update frameworks for the correct marcflavour
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-20 16:25:35 +02:00
Zeno Tajoli
e224e6e888 Bug 7861 : Update of italian sql files for 3.8
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-19 17:40:39 +02:00
Juan Romay Sieira
16e067953b Bug 7855 - marcflavour files changed to set the maxlength field into fresh installs. Include NORMARC in updatedatabase to change maxlength.
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-19 17:20:13 +02:00
Paul Poulain
3dfe9903a5 Bug 7726: explanation and options that were in the wrong order
I also removed the ` mysql-ism

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2012-04-19 11:31:53 +02:00
Katrin Fischer
5958ec3e96 Bug 7922: Fixing typo in German sample news
Fehlerkorrektoren > Fehlerkorrekturen

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-19 10:40:30 +02:00
Chris Nighswonger
012c6df001 Bug 7902 - Adding Function to Check for Existence of Tables
This patch adds a function TableExists which checks for the existence
of a given table and returns 1 or 0 accordingly. This allows us to
check for the existence of a given table when doing operations on
tables which may not exist in a given database which, in turn, will
reduce the number of red errors which show up after an upgrade.

An example of its use is included in this patch.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-13 16:20:02 +02:00
Paul Poulain
8070cef696 Merge remote-tracking branch 'origin/new/bug_5668' 2012-04-13 15:32:25 +02:00
mveron
b42d662542 Bug 5668 Error during during insall with web installer, Step 3
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Mason James <mtj at kohaaloha.com>
Before patch web installer dies with error message on creating
database tables:
ERROR 1064 (42000) at line 2821: You have an error in your SQL
syntax; check the manual that corresponds to your MySQL server
version for the right syntax to use near '- biblionumber int(11)
NOT NULL, - rating_value tinyint(1) NOT NULL, - ' at line 2

After patch installation completes normally. I also checked
that tables ratings and pending_offline_operations were
created correctly.

Note: This is Marc Veron's first patch for Koha - congratulations!
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-13 15:29:53 +02:00
Paul Poulain
5483ec6204 missing \n in updatedatabase that causes some ugly display 2012-04-11 15:18:40 +02:00
Katrin Fischer
47fac215af Bug 7935: Introduce sys pref to control 'browse results' in OPAC
Patch introduces a new system preference "OpacBrowseResults" to control
the feature for browsing and paging through results shown on top of the
left menu on detail pages in OPAC.

Preference is activated by default and can be deactivated using the
system preference.

To test:
 - Check database update works correctly
 - Check that browsing and paging still works with after database update
 - Deactivate the feature by setting 'OpacBrowseResults' to 'Disable'
 - Check the feature does no longer show up in OPAC
 - Check that a new installation also has the system preference with correct default

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2012-04-10 15:26:37 +02:00
Paul Poulain
3de47f3f90 Bug 5668 follow-up: DBRev number 2012-04-10 14:57:55 +02:00
7eef4c8c70 Bug 5668 - Star ratings in the opac
patch applied to commit eb3dc448d2

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

Turned on star ratings in the opac on details and results
Searched for titles - saw the stars
Clicked on a title
Clicked on the stars
Clicked on the stars to change my rating
Logged out
Tried to click on stars
Logged in as different user
Rated items that were rated already and saw average change
Changed preference to show only on detail and repeated tests
Changed preference to now show stars

All above tests passed. Signing off.

Rebased 3-19-12 by Ian Walls

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-10 14:40:49 +02:00
Paul Poulain
8a4b05b9d6 Bug 7886 follow-up DBRev number 2012-04-10 11:53:15 +02:00
Dobrica Pavlinusic
d8e702dd25 Bug 7886 - C4/ShelfBrowser slow SQL performance
ShelfBrowser uses two SQL queries with syntax

WHERE ((cn_sort = ? AND itemnumber < ?) OR cn_sort < ?)
AND homebranch = ? AND location = ? AND ccode = ?

homebranch already has index, and adding indexes on ccode and location
improves performance by 30% for each query since MySQL is able to use
index_merge intersect(items_ccode,homebranch,items_location)

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-10 11:37:01 +02:00
MJ Ray
0df4c6a3ac bug 5549: change to kohastructure.sql missing from commit 8cea8e5cc0
Also deletes earlier updatedatabase addition of lengthunit to avoid errors for people upgrading from stable (thanks Katrin for the idea)

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Checked creating a database from scratch and updating a database
with missing lengthunit column. Both worked without any problem.
If you update and have the column updatedatabase will report an error,
but the database will be ok.
2012-04-06 17:58:28 +02:00
Paul Poulain
b90b271a0c Bug 7613 follow-up DBRev number 2012-04-06 17:37:26 +02:00
Srdjan
12ff7355bb bug_7613: OCLC Connexion gateway
svc/import_bib:
* takes POST request with parameters in url and MARC XML as DATA
* pushes MARC XML to an impoort bach queue of type 'webservice'
* returns status and imported record XML
* is a drop-in replacement for svc/new_bib

misc/cronjobs/import_webservice_batch.pl:
* a cron job for processing impoort bach queues of type 'webservice'
* batches can also be processed through the UI

misc/bin/connexion_import_daemon.pl:
* a daemon that listens for OCLC Connexion requests and is compliant
  with OCLC Gateway spec
* takes request with MARC XML
* takes import batch params from a config file and forwards the lot to
  svc/import_bib
* returns status

ImportBatches:
* Added new import batch type of 'webservice'
* Changed interface to AddImportBatch() - now it takes a hashref
* Replaced batch_type = 'batch' with
  batch_type IN ( 'batch', 'webservice' ) in some SELECTs

Signed-off-by: MJ Ray <mjr@phonecoop.coop>
2012-04-06 17:26:20 +02:00
Magnus Enger
58e98c3c38 Bug 7850 - Fix values for hidden in subfields of 952 + maxlength in NORMARC frameworks
This patch does three things:

- Add a copyright comment to normarc_fastadd_framework.sql
- Change the value of marc_subfield_structure.hidden from -1 to 0 for
  several subfields of 952, in both the default and fast add framework,
  using this SQL statement:
  update marc_subfield_structure set hidden = 0 where tagfield = '952' and hidden = -1;
- Add the maxlength column introduced by bug 7263 to all rows in
  marc_subfield_structure, setting the following maxlengths:
  000 = 24
  008 = 40
  all other subfields = 9999

The format of the SQL files is the one that is produced by exporting the
frameworks from the Web UI, with added copyright comments at the top.

To test:
- Install nb-NO
- Run through the web installer in Norwegian on an empty database
- Select NORMARC as the marcflavour
- Be sure to select the fast add framework ("Rammeverk for
  hurtigkatalogisering" under "Valgritt")
- Check in Home › Administration › MARC Frameworks that 000 and 008
  for both frameworks have the right length
- Add a dummy record so you get to the item edit screen and check that
  the form for subfields looks good. The subfields that are shown
  should be 01234578abcdefghjoptuvwyz and all subfields should have
  a text box or a dropdown associated with them. Check this for
  for both the default and fast add frameworks

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Walked through the test plan, seems to work well.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-04 14:54:50 +02:00
Paul Poulain
7335add2a2 bug 7291 follow-up DBRev number 2012-04-03 18:32:25 +02:00
Jonathan Druart
64d39e1d9e Bug 7291: Followup: removes backquotes
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-03 18:19:48 +02:00
Jonathan Druart
d76dbace5e Bug 7291: Adds new field aqbooksellers.deliverytime
New field deliverytime in aqbooksellers table. It is an estimated
delivery time for orders (in days).
You can set this delay on the supplier modification page.
It is used in the late orders search.

The order estimated date is the aqbasket.closedate +
aqbooksellers.deliverytime

If you set a delay, the query check if closedate <= today - delay

If you set a "delivery time from" and a "delivery time to", the query check if
$delivery_time_from <= aqbooksellers.deliverytime is not NULL and if
closedate + deliverytime >= $delivery_time_to
if there is not a time_to then $delivery_time_to = the current date.
2012-04-03 18:19:46 +02:00
Serhij Dubyk {Сергій Дубик}
b915f4ff32 Bug 6434 - Ukrainian and Russian MARC sql-tables
Changes: Marc21 support, 995 for items (Unimarc), authorities types for both
MARC's, many small field/subfield changes

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

It works, doesn't break anything, seems to be in Ukrainian/Russian (I can't
judge).

It's a huge patch (21M). That's why it's attached as a bz2 archive: so the
archive must be downloaded, decompressed, and then applied.

General remark: Adding this patch to Koha will increase substantially Koha git
repository size. It shows that non-code files (.po files, SQL files)
could/should be managed outside Koha core repository. See this discussion:

http://wiki.koha-community.org/wiki/Git_Splitting_and_Shrinking

Here is my test plan:

[1]  Apply the patch on master
[2]  Install ru-RU and uk-UA languages:
     cd misc/translator
     ./translate ru-RU uk-UA
[3]  re-create Koha DB:
     DROP DATABASE koha;
     CREATE DATABASE koha;
[4]  Load Koha pro interface: get web installer
[5]  Choose ru-RU language
[6]  Everything is in Russian. Click blindly on button until reaching the
     page where to choose Unimarc/Marc21.
[7]  Choose Unimarc.
[8]  Tick on everything to load all UNIMARC SQL files.
[9]  All SQL are loaded without any error.
[10] Check Koha cataloguing.
[11] Go to [3] and choose Marc21 at step [7].
[12] Go to [3] and choose uk-UA at step [5].
[13] Go to [3] and choose uk-UA at step [5] and Marc21 at step [7].
2012-04-02 12:16:49 +02:00
Paul Poulain
8f17915231 Bug 4032 follow-up: removing ` in syspref 2012-03-29 16:59:34 +02:00
Stéphane Delaune
df0a6a71d7 Bug 4032 XSLT systempreference takes a path to file rather than YesNo
Signed-off-by: Marijana Glavica <mglavica@ffzg.hr>

I am signing it off because it doesn't break anything and I will report
another bug for language issues described in my previous comment.

Removed MySQLism backquotes
2012-03-29 16:58:55 +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
Magnus Enger
43214bbcce Bug 7436 - Set itemtypes.rentalcharge = 0 in sample data for nb-NO and de-DE
Set the rentalcharge = 0 for sample itemtypes (except Music for nb-NO).

To test:
Run through the web-installer for nb-NO and de-DE, and check that
itemtypes are displayed correctly for each language.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>.
Note: You have to install the language first in order to be able
to select it in the web installer. There was a problem
in the po files for nb-NO that kept all files from being created
correctly. I fixed the po file and did an installation with all sample
files. There is a problem with z3950servers.sql that is not caused
by this patch:
z3950servers.sql
ERROR 1136 (21S01) at line 1: Column count doesn't match value count at row 1

Web installer for de-DE ran without problems on the sample files.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-29 10:43:07 +02:00
Magnus Enger
2f5f7bfe31 Bug 7837 - nb-NO z3950servers.sql misses column names
Fix installer/data/mysql/nb-NO/2-Valgfritt/z3950servers.sql so it
includes column names.

To test:
- Install the nb-NO language
- Run through the web installer, and make sure to select the optional
  ("Valgfritt") z3950servers.sql file
- Check there are no errors
- Check that the Z39.50 errors are displayed OK in
  Home › Administration › Z39.50 Servers

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Web installer runs without any errors now and I checked that
the Z39.50 servers were imported correctly and can be edited.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-28 16:21:15 +02:00
Paul Poulain
1610a7d61c bug 5354 follow-up DBRev number 2012-03-28 16:15:34 +02:00
Jonathan Druart
a52d3fbf9d Bug 5354: Followup. Change separator 2012-03-28 15:56:45 +02:00
Jonathan Druart
5167e8034d Bug 5354: Partial duplication of a subscription
A new syspref (SubscriptionDuplicateDroppedInput) contains the list of fields to
duplicate when duplicating a subscription. The library will be able to
define that, for example, the internal note should not be duplicated

Test plan:
On the detail subscription page, click Edit > Edit as New (Duplicate):
All the information must be copied from the original subscription.

Fill the syspref SubscriptionDuplicateDroppedInput with a list of fields
you don't want to be duplicated (e.g. location;notes;branchcode).

Repeat the duplicate action. Normally, information for these fields are
not copied.

Signed-off-by: Kristina D.C. Hoeppner <kristina@catalyst.net.nz>
2012-03-28 15:51:23 +02:00
Paul Poulain
32ac3f673e Bug 7470 follow-up DBRev + removing ` 2012-03-26 14:51:43 +02:00
Jonathan Druart
f35a1cce68 Bug 7470: Babeltheque integration
3 features:
- adds social network information in search results
- adds babeltheque data in opac-detail
- adds social network links in opac-detail too (google+, twitter, mail
  and co.)
2012-03-26 14:24:04 +02:00
Paul Poulain
e94ff7e557 Bug 7178 follow-up DBRev number 2012-03-26 14:14:31 +02:00
Julian Maurice
eefc774e27 Bug 7178: Acquisition item creation improvement
- Display a unique item block at once

On orderreceive.pl when AcqCreateItem is 'receiving', and on
neworderempty.pl when AcqCreateItem is 'ordering' it displays an
item block with item infos to fill, and a '+' button.
When user clicks on '+', the block is hidden and a list shows up with
the items that will be received. User can then edit or delete items in
the list and click 'Save' to receive items.

- PrepareItemrecordDisplay is now used for cloning block

Previous cloning function was duplicating ids, the side effect is that
plugins didn't work when several items were displayed.
PrepareItemrecordDisplay regenerate the form with new ids

- New system preference UniqueItemFields

Contains a space-separated list of sql column names (of items table).
This syspref is used in two ways:
 - Values corresponding to fields in syspref are not duplicated when
   adding a new item (button 'Add')
 - When saving the form, a check is made on fields in syspref for
   detecting duplicate (in DB and in the form)

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests done are noted on the bug report.

2012-03-23: Fixed conflict in updatedatabase.
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-26 11:07:23 +02:00
Paul Poulain
5531904dcc big 7263 follow-up: DBRev number 2012-03-26 11:00:34 +02:00
Juan Romay Sieira
020c095377 Bug 7263 - Determine maximum length of some fields or subfields when cataloguing a biblio or an item.
Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-26 10:51:22 +02:00
Paul Poulain
7847f868fe tiny follow-up: removing ` that are mysqlism 2012-03-23 17:16:55 +01:00
Paul Poulain
35279926b3 bug 6140 follow-up: DBRev number 2012-03-22 18:27:02 +01:00
Juan Romay Sieira
21b3f8a7bf Bug 6140 - Set a timeout to z3950 servers that could have network problems occasionally
Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
2012-03-22 18:22:02 +01:00
Paul Poulain
d5542514d2 Merge remote-tracking branch 'catalyst/merged_5549' into new/bug_5549
Conflicts:
	installer/data/mysql/updatedatabase.pl
	members/moremember.pl
2012-03-22 17:34:26 +01:00
Paul Poulain
b6751749a6 Bug 7310 follow-up : typo fix lt instead of < in DB version comparison 2012-03-22 16:55:56 +01:00
Paul Poulain
8705e18aa5 Bug 7154 follow-up DBRev
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-22 16:08:46 +01:00
Jonathan Druart
bb35b60828 Bug 7154: Modification in borrower attributes
* group some attributes for a more friendly display

* allow a link between a borrower category and an attribute to display
  it only for the specified category

* Attr classes filled with AV 'PA_CLASS' category (you have to create AV
  with a new category 'PA_CLASS' to fill class list)

this patch add 2 fields in borrower_attribute_types :
    category_code
    class

Signed-off-by: Julien Sicot <julien.sicot@gmail.com>

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-22 16:08:28 +01:00
Paul Poulain
13f553020c bug 7264: follow-up DBRev number 2012-03-22 11:59:46 +01:00