Commit graph

312 commits

Author SHA1 Message Date
Jonathan Druart
cc58bf3c81 Bug 10855: Additional marc fields are not inserted
In subscription-add.pl, the code for inserting additional_fields is not
the same for updating and inserting.
This patch refactores this code in code to do the same tests.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-02 15:10:31 -03:00
Jonathan Druart
750601ac5b Bug 10855: search with exact match if linked to an AV
If a field is linked to an AV, the search should be an exact match.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-02 15:10:31 -03:00
Jonathan Druart
640abc852c Bug 10855: Squash several fixes
Bug 10855: FIX: Add additional fields for closed subscriptions

Bug 10855: Fix instance vs static method

This patch fixes the error message.
The 3 modified routines *are* static methods.

Bug 10855: FIX conflicts with bug 7688

Bug 10855: Fix typo addition_fields -> additional_fields

Bug 10855: A partial search should return the subscriptions

If a search on an additional fields is done using a partial string
("foo" and the defined value is "foobar"), the subscription should
appear in the result list.

Test plan:
Try to search a part of the string for an additional field.

Bug 10855: Filtering on additional fields don't work if value is equal to 0

If you tried to filter on an additional field linked to an authorised
value, that did not work if the value was 0.

Bug 10855: Remove the advanced serial search box on the serial home page

Bug 10855: FIX an add field should not be created if the marc field does not exist.

This patch fixes the following:
Create an add fields linked to a nonexistent marc field (does not exist
in serials).
Edit a subscription and save.
Without this patch, an error occured:
Software error:
DBD::mysql::db do failed: Column 'value' cannot be null at
/var/root-koha/bug-10855/Koha/AdditionalField.pm line 107.

Bug 10855: Fix Type table vs tablename

Koha::AdditionalField->all method take "tablename" not "table" in
parameter".

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-02 15:10:31 -03:00
Jonathan Druart
37319996b0 Bug 10855: Search subscriptions by additional fields on the claim page
Test plan:
- create some serials in late.
- go on serials/claims.pl.
- choose a vendor.
- verify that additional fields are displayed in new columns.
- try filters on columns.
- verify there is no regression on this page.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-02 15:10:31 -03:00
Jonathan Druart
e0c43b5825 Bug 10855: Search subscriptions by additional fields
Now you will abble to search subscriptions by additional fields.
The additional field values will be displayed in the table results.

Test plan:
- go on the subscriptions advanced search page
  (serials/serials-search.pl).
- verify all searchable additional fields are displayed on the form.
- combine 1 or more values and verify results are consistent.
- verify the values are displayed in new columns of the table.
- for field linked to an authorised value category, the description is
  displayed (not the code).

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-02 15:10:30 -03:00
Jonathan Druart
e153d095d4 Bug 10855: New fields on adding/updating a subscription
This patch adds the ability to add values for additional fields when
adding/updating a subscription.

Test plan (test the following on adding a new subscription and on
editing an existent one):
- add/edit a subscription.
- verify all additional fields appears into the "Additional fields"
  block.
- fill a value for af1 and af3.
- fill others values if you are adding a new subscription.
- save.
- verify values appears on the detail of the subscription page.
- verify the af2 field is automatically filled with the specified
  marc field of the notice.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-02 15:10:30 -03:00
Jonathan Druart
3cfdc833bd Bug 10855: interface configuration for adding new fields to subscriptions
This patch adds an interface configuration for adding fields to
subscriptions.

Test plan:
- go to serials/serials-home.pl
- click on the "Add subscription fields" link on the left of the screen
- try to add/update/delete new fields
You are not abble to add a field with an authorised value category and a
marcfield. Columns are sortable
- for the rest, you should have, at least:
  * a new field named af1, sortable, linked to a category
  * a new field named af2, sortable, linked to a marcfield
  * a new field named af3, not sortable

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-02 15:10:30 -03:00
ad3239479d Bug 9809: Update AddReserve prototype to remove constraint parameter
Test Plan:
1) Apply this patch set
2) prove t/db_dependent/Circulation.t
3) prove t/db_dependent/Holds.t
4) prove t/db_dependent/Holds/LocalHoldsPriority.t
5) prove t/db_dependent/Holds/RevertWaitingStatus.t
6) prove t/db_dependent/HoldsQueue.t
7) prove t/db_dependent/Reserves.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

AMENDED: An else branch in reserve/placerequest.pl was removed. This had
the effect of making it no longer possible to place an any hold in the
staff client.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Verified placing a biblio level and an item level hold.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-08-26 10:26:43 -03:00
Jonathan Druart
e604097740 Bug 13662: Fix the serials.receive_serials permissions
There are some issues with serial permissions.
For instance it's not possible to receive serials if the
edit_subscription is not set.
Also the toolbar is empty.

Test plan:
1/ Set the serials => receive_serials permissions to a patron (and only
this one for the serials module).
2/ Verify you cannot create a new subscription, you can search
subscriptions but cannot edit them.
3/ On the serial result list, receive a serial (action > Serial
receive).
You can now change the status and receive it.
4/ On the serial collection, you can edit 1+ serials to reveice it.
5/ Set the serials => edit_subscription permission and confirm there is
no regression.

QA note: I think we should introduce a C4::Serials::can_receive_serials
subroutine, to test the IndependentBranches pref, but I don't want to
add to much processing to check permissions.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-06-05 12:53:09 -03:00
Bernardo Gonzalez Kriegel
65b7ad030c Bug 13423: Remove unused serials-recieve
This patch removes two files, serials-recieve.pl and serial-recieve.tt
serials-recieve.pl is not called anyware
(it's recieve!)

Also removes the sub removeMissingIssue called only from serials-recieve.pl

git grep serials-recieve.pl .
C4/Serials.pm:called when a missing issue is found from the serials-recieve.pl file
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-recieve.tt:     <form method="post" name="f" action="serials-recieve.pl" onsubmit="return barcode_check()">
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-recieve.tt:     <form method="post" name="f2" action="serials-recieve.pl">
serials/serials-recieve.pl:serials-recieve.pl

Just a POD entry and self reference.

After removing of files

git grep removeMissingIssue .
C4/Serials.pm:      &check_routing &updateClaim &removeMissingIssue
C4/Serials.pm:=head2 removeMissingIssue
C4/Serials.pm:removeMissingIssue($subscriptionid)
C4/Serials.pm:sub removeMissingIssue {
t/db_dependent/Serials.t:is(C4::Serials::removeMissingIssue(), undef, 'test removing a missing issue');

Not used anymore

To test:
1) Apply the patch
2) Check serials workflow, no changes must be noted

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-14 11:48:17 -03:00
Jonathan Druart
4598479fd5 Bug 11814: (follow-up) Use constants to describe statuses
This patch deals with all hard-coded status codes in the C4::Serials
module.

Test plan:
Test a complete workflow in the serial module (create, order, receive,
generate next) trying to use all statuses.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-30 15:33:00 -03:00
Jonathan Druart
9d7d645baf Bug 14022: Does not reset the subscription length on editing a subscription
The subscription length is always set to the first/default value
('issues') when editing a subscription.
Even if you selected another value on creating/editing it, the form will
show you the first option.

Test plan:
1/ Add/Edit a subscription, select a subscription length different of
the first value (issues)
2/ Edit the subscription and confirm the value is kept

Bonus: issues, week and months become translatable.

Works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-22 16:25:55 -03:00
Jonathan Druart
a6c9bd0eb5 Bug 9978: Replace license header with the correct license (GPLv3+)
Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

http://bugs.koha-community.org/show_bug.cgi?id=9987

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-20 09:59:38 -03:00
Mark Tompsett
35938a0cb3 Bug 13947: Correct call to GetBiblio to receive correct return value
When you attempt to edit the manual history for a subscription,
the title is blank. This is a result of an incorrect use of the
GetBiblio function.

TEST PLAN
---------
1) Log in to staff client
2) Serials
3) Search for an existing serial with manual history checked.
   -- creating one as needed is left as an exercise to the reader.
4) Click on the title of the serial for the details page.
5) Go to the Planning tab and click 'Edit History'
   -- Heading will be 'Subscription history for' without a
      title.
6) Apply patch
7) Refresh page.
   -- Heading will include the title correctly.
8) run koha qa test tools

Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-16 14:10:54 -03:00
Jonathan Druart
8d3ee81b14 Bug 13891: DataTables server-side processing - Fix regressions
This patch fixes the regressions introduced by the previous patches.
If you have tested all in once, you didn't see them.

It introduces library, category and "first letter" filters.

Test plan:
1/ On all pages impacted by previous patches + new order empty (link patron to
an order) + guarantor search
2/ Add / Select patron to the list
3/ Use the filters
4/ Confirm there is no regression

Tested together with other patches.
Signed-off-by: Marc Veron <veron@veron.ch>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-13 10:55:30 -03:00
Jonathan Druart
a77a9a70a2 Bug 13891: DataTables server-side processing - Serial recipients
This second patch removes the previous way to search for serial recipients.

Test plan:
1/ Edit the routing list for a subscription (serials/routing.pl?subscriptionid=X)
2/ Add 1+ recipients
3/ Confirm there is no regression on the add/delete/search actions

QA note: This search does not use a clean way to interact with the
window opener. Indeed the opener is reloaded to display the new item.
This patch does not change this behavior, but note the trick in the
template (common/patron_search.tt) to wait for the opener in order not
to get a JS error.
This is also used by the next patch (patron card).

Tested together with other patches.
Signed-off-by: Marc Veron <veron@veron.ch>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-13 10:55:21 -03:00
Jonathan Druart
27b534dc56 Bug 11337: Remove the C4::Serials::GetSubscriptions routine
Since SearchSubscriptions is the way to search subscriptions, each call
to GetSubscriptions could be replaced by a call to SearchSubscriptions.

Test plan:
Verify following pages display the same thing as before this patch:
- catalogue/detail.pl
- opac/opac-ISBDdetail.pl
- opac/opac-detail.pl

Verify the following page returns correct results:
- serials/checkexpiration.pl

Verify the Serials UT file still passes:
- prove t/db_dependent/Serials.t

Note: The title filter on checkexpiration now only searches on the title
DB field. I don't think it is a regression, it should be the way to use
this field. Maybe should we add new search fields on this form.
Bug 5337 reintroduces a bug fixed by bug 5864, this patch restore the
right way to search subscription (based on biblionumber).

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-13 10:36:19 -03:00
Katrin Fischer
889e1953ec Bug 13890 - Switch from full serials permission to 'routing' permission for reordering routing lists
For changing the sequence of patrons on a routing list by changing
one of the numbers via the pull downs, full serial permission is needed:

To test:
- Give your patron full serial permissions
- Create a subscription and a routing list for it
- Change the sequence on the routing list using the pull downs
- Verify this works
- Remove any of the serial sub permissions (claim serials or similar)
- Verify changing the sequence now results in a permission error
- Apply patch
- Verify that the permission error is gone now
- Remove the routing permission
- Verify the permission error is back (but this seems to make sense)

In general more fixes would be required to make all routing related
features depend on the routing permission, but I think this fixes
the bug making it depend on the correct permission.

Followed test plan. Works as expected.
Signed-off-by: Marc Veron <veron@veron.ch>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-03-31 11:33:23 -03:00
Jonathan Druart
e20270fec4 Bug 11944: use CGI( -utf8 ) everywhere
Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Dobrica Pavlinusic <dpavlin@rot13.org>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-01-13 13:07:21 -03:00
Jonathan Druart
b3aebd1f53 Bug 11944: Fix encoding issue on adding a subscription
If frequencies or numbering patterns contain non-latin characters, so
output was broken.

To reproduce:
- Create a frequency and a numbering pattern with non-latin characters
- Add a new subscription using these values
- The screen should not contain bad encoded characters.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Dobrica Pavlinusic <dpavlin@rot13.org>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-01-13 13:07:18 -03:00
Jonathan Druart
75f0cc5771 Bug 11944: Some refresh don't indicate the charset to use
This patch replaces occurrences of META HTTP-EQUIV=Refresh with a
redirection.

Note:
 The list of modified files has been got with the following grep:
  git grep Content-Type | grep -v -i utf | grep Refresh | grep -v translator | grep -v \.js

Test plan:
1) admin/auth_tag_structure.pl
- Go on an authority MARC framework for an authority type
(admin/auth_tag_structure.pl?authtypecode=CO for instance)
- Click on the "Add a new tag" button
- Fill fields
- Save
- You should be redirected on the auth_tag_structure.pl page
- Try to modify an existing tag
- The redirection should be done

2) admin/auth_subfields_structure.pl
- From the previous page, click on a "subfields" link
- Edit/Add a new subfields
- Save
- You should be redirected to the subfield list
- Delete a subfield
- You should be redirected to the subfield list

3) admin/authorised_values.pl
- Add/Edit an authorised value
- Save
- You should be redirected to the authorised value list (with the
  right category selected)

4) admin/categorie.pl
- Add/Edit a patron category
- Save
- You should be redirected to the category list
- Delete a patron category
- You should be redirected to the category list

5) admin/koha2marclinks.pl
- Go on the Koha to MARC mapping configuration page
- Edit a field
- Map a field and click on "OK"
- You should be redirected to the list

6) admin/marc_subfields_structure.pl
- Go on the MARC frameworks page
- Click on "MARC structure" for one on the list
- Click on "Subfields" for one on the list
- Add/Edit a subfield
- Save
- You should be redirected to the subfield list

7) admin/systempreferences.pl
- Go on the system preferences admin page
- Click on the "Local use" tab
- Add/Edit a pref
- Save
- You shold be redirected to the Local use preference list

8) serials/subscription-detail.pl
- Go on a subscription detail page
- Delete the subscription (using Edit > Delete subscription)
- You should be redirected on the serials home page

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Dobrica Pavlinusic <dpavlin@rot13.org>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-01-13 13:07:09 -03:00
Jonathan Druart
3d59fc384d Bug 11944: replace uri_escape with uri_escape_utf8 everywhere
To reproduce, edit, index notice with utf-8 char and search for it

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Dobrica Pavlinusic <dpavlin@rot13.org>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-01-13 13:07:01 -03:00
Jonathan Druart
55107741a2 Bug 11944: replace use of utf8 with Encode
See the wiki page for the explanation.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Dobrica Pavlinusic <dpavlin@rot13.org>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-01-13 13:06:45 -03:00
Jonathan Druart
469f36d38f Bug 12896: Move the bookseller-related code into Koha::Acquisition::Bookseller
The C4::Acquisition module should be exploded in order to add
readability and maintainability to this part of the code.

This patch is a POC, it introduces a new Koha::Acquisition::Bookseller module and put in
it the code from GetBookSeller and GetBookSellerFromId.

Test plan:
1/ Create a bookseller, modify it.
2/ Add contacts for this bookseller
3/ Create an order, receive it, transfer it
4/ Launch the prove command on all unit tests modified by this patch and
verify that all pass.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-12-31 14:15:58 -03:00
Jonathan Druart
4179c63d7e Bug 12852: C4::Bookseller should not be imported anymore
This script does not depend on C4::Bookseller anymore. The import can be
removed.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-12-03 11:47:59 -03:00
Jonathan Druart
66438d59e7 Bug 12852: Some unused stuffs more
These parameters are never used.
GetBookSeller takes a string (bookseller name) in parameter, not an id!

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-12-03 11:47:52 -03:00
Jonathan Druart
fd38d8c565 Bug 12852: The "preview" param can be removed serials/claims.pl
This case (preview=1) never appened. This patch remove all occurrences
in the pl and the tt files.

Test plan:
Verify you don't manage to find a place where preview is set to 1 on the
claim serials page.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-12-03 11:47:46 -03:00
simith
b4c0eb4a51 Bug 12536 - Incorrect number of irregularity issues
Modified:

serials/subscription-detail.pl  - fix split command

Testing:

I Apply the patch

0) Select a serial subscription;
1) Click Edit -> Edit subscription;
2) Click Next;
3) Click Test prediction pattern;
4) Select 3 Vols;
5) Save subscription;
6) Select Planing tab;
7) Valide "Irregularity: 3 issues".

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Note: You have to select more than 1 issue as not to
      be published to see the problem.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-25 16:11:02 -03:00
Jonathan Druart
7690cd5ad1 Bug 5342: Serial claiming improvements: add a counter
This patch adds a new DB field serial.claims_count
This field already exists for late orders. It makes sense to introduce
it for serial.

Test plan:
0/
 a) Does not apply the patch.
 b) Remove all your claimissues notices and be sure you have some serial issues
    in late.
 c) remove email address for the vendor you will use.
 d) remove email address for the logged in user.
 e) Export claims using the csv export => The selected issues will be
 marked as claimed.
 f) logout/login (to update the email address).
1/ Apply the patch and execute the updatedb entry.
2/ Go on the Serials > Claims page
3/ Verify that you get a warning message 'No claimissue notice defined'
4/ Verify the vendor list is correct (with the number of serial in late.
You should not get any changes here.
5/ Select one vendor and verify that the issue which was claimed before
has a claim count set to 1.
6/ Verify that you are not able to send notification to the vendor.
7/ Create a claimissue notice.
Something like:
  <<LibrarianFirstname>>
  <<LibrarianSurname>>
  The following issues are in late:
  <order><<biblio.title>>, <<biblio.author>> (<<biblio.serial>>)</order>
8/ Go on the Serials > Claims page, the warning message does not appear
anymore.
9/ Select issues. Select a notice. And "Send notification".
You should get an error (no email defined for this vendor).
10/ Add an email for the vendor.
11/ Select issues. Select a notice. And "Send notification".
You should get an error (no email defined for your user).
12/ Add an email address to your user
logout/login
13/ Select issues. Select a notice. And "Send notification".
You should get a happy message: the email has been sent!
14/ The email will contain the order tags if bug 12851 is not
pushed/applied.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, some small issues fixed in a follow-up.
Note: If you change the email address of your staff user, you will
have to log out and back in to make the change take effect.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-28 10:07:37 -03:00
2323957250 Bug 11349: Make the QA script happy
This patch just adjusts several POD stuff, and in a few cases
reorganizes a hash definition in order to use spaces instead of tabs
for the QA script to be happy.

Nothing important, really. This patch series just changes '.tmpl' for
'.tt'.

Regards
To+

PS beware that running the koha-qa.pl script can take lots of time on this one
:-D

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

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-07-17 11:06:06 -03:00
afd2418d73 Bug 11349: Change .tmpl -> .tt in scripts using templates
Since we switched to Template Toolkit we don't need to stick with the
sufix we used for HTML::Template::Pro.

This patch changes the occurences of '.tmpl' in favour of '.tt'.

To test:
- Apply the patch
- Install koha, and verify that every page can be accesed

Regards
To+

P.S. a followup will remove the glue code.

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

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-07-17 11:05:49 -03:00
Jonathan Druart
10689f2a9b Bug 11226: subscription frequencies and numbering patterns should be editable with serials permissions
Bug 7688 does now allow patrons with serials permissions to edit
 subscription frequencies/numbering patterns.

 Test plan:
 Try to access to serials/subscription-frequencies.pl and
 serials/subscription-numberpatterns.pl with the "serials" permissions.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
With patch and only serial permissions can now access
frequences and patterns.
No koha-qa errors

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-07-14 11:17:23 -03:00
Galen Charlton
effb64f7f2 Bug 11715: require authentication for various staff scripts
To test:

[1] Verify that item record creating and editing during the
    acquisitions process continues to work.
[2] Verify that calling  services/itemrecorddisplay.pl without
    a valid user session fails.
[3] Verify that authentication is required for making a new
    order from a suggestion, transferring an order, doing a
    Z39.50 search from acquisitions, displaying the record
    card view in the staff interface, and running the till
    reconciliation report (/cgi-bin/koha/reports/stats.screen.pl)

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Verified all changed scripts are not accessible witout a valid
user session, but are with one.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-06-25 12:27:08 -03:00
Jonathan Druart
1976ec2020 Bug 11742: Change return type for GetLetters
The GetLetters subroutine should return an arrayref with different
letters for a module.

Test plan:
0/ Delete your notices with module=claimacquisition, claimissues,
serial
1/ Go on the late orders page (acqui/lateorders.pl) and verify you
cannot choose a notice for claiming
2/ Create a notice with module=claimacquisition
3/ Go on the late orders page (acqui/lateorders.pl) and verify you
can choose the notice for claiming
4/ Go on the Claim serials page (serials/claims.pl) and repeat the same
thing with the a "claimissues" notice
5/ Create a new subscription (serials/subscription-add.pl) and verify
you cannot choose a notification for patrons.
6/ Create a notice with module "serial" and verify you can.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script. Additional tests done:

- copy notice ODUE, on saving you are now prompted to choose
  a new CODE for the notice
- edit new notice, try to set code back to ODUE. You are
  prompted that the code is already in use.

This will prevent people from accidentally overwriting a letter
with the same letter code.
2014-06-23 15:19:55 -03:00
Jonathan Druart
507944e41b Bug 11263: Use all languages instead of just the translated ones
This patch produces the same dropdown list as the one in the adv search.
With this way, it won't be necessary to install additional templates to
fill the locale list.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-05 05:01:36 +00:00
Jonathan Druart
98309138a6 Bug 11263: do not use system locales settings for subscriptions
The locales list for subscriptions should not be retrieved from the
locales of the system.
This patch retrieves the locales list from the Koha DB (in the same way
as pref language and opaclanguages).

Test plan:
Edit a subscription (or a numbering pattern) and verify the list of
languages is the same as languages available in Koha.
Note: with this patch we loose the saeson translation, it is
normal. See report linked.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Work as described. No koha-qa errors.

New locale is retrieved from installed languages.
I wonder if that list can be restricted to
'enabled' ones (parsing syspref language value).

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes QA script and all tests.
Works according to description.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-05 05:00:42 +00:00
Julian Maurice
47a9afcb7e Bug 12003: Do not calculate next pubdate for irregular subscriptions
Show 'Unknown' when planneddate and publisheddate cannot be calculated

Also fixes SQL query in misc/cronjobs/serialsUpdate.pl that was still
using "periodicity != 32" to exclude irregular subscriptions from
results

Test plan:

1) Create a subscription in the serials module. Make sure to choose:
   Frequency = Irregular
2) Test the prediction pattern, first publication date is set to
   "First issue publication date" field, others will show as
   'unknown'
3) Save the subscription
4) Check the created issue - it will show a published date and a
   planned date (same as "First issue publication date" field)
5) Receive the issue and check the next generated issue, planned
   date and published date should show as 'Unknown'
6) Generate a next issue, planned date and published date should
   also show as 'Unknown'

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Work as described following test plan.
No koha-qa errors

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Also tested:
- multi receiving generates mulitple issues without dates - 'unknown'
- staff detail page shows the dates empty, which is fine
- OPAC detail page shows the dates empty, which is fine
- serial collection page shows 'unknown' and those issues appear
  on the 'manage' tab, as they did in the past
- Editing the issue from the serial collection page leaves the
  date fields empty.
- Receving the issue, setting the status to 'Arrived' the Expected on
  date is set to 'today' automatically. Date published has to be
  entered manually (maybe something we could improve later
- subscription detail > issues tab shows Uknown.
- t/db_dependent/Serials/GetNextDate.t pass.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-18 20:57:51 +00:00
Jonathan Druart
fac91e2ce1 Bug 11637: don't try to guess publication dates for irregular subscriptions
Test plan:
Create a subscription with an irregular numbering pattern.

Verify the prediction pattern. With this patch, it should show "unknown"
instead of the date of the first issue publication date.

This patch does not fix the issue on generating the next serial.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
This is a partial fix for a small regression in the serials module.
Now the prediction pattern doesn't predict dates when you test it,
and shows 'Unknown' instead.

We still need to fix the 'planned date' set for the expected serial.
There should be no date, it should also be 'unknown'.

Passes tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-03-14 15:16:44 +00:00
daf2ebc4f5 Bug 11096: support the retrieval of large MARCXML records
This patch makes Koha <-> Zebra use MARCXML for the serialization when
using DOM, and USMARC for GRS-1.

* The following functions are modified to set the Zebra record syntax
according to the current sysprefs and configuration:

- C4::Context->Zconn
- C4::Context-_new_Zconn

* A new function 'new_record_from_zebra' is introduced, which checks the
context we are in, and creates the MARC::Record object using the right
constructor.

The following packages get touched to make use of the new function:
- C4::Search
- C4::AuthoritiesMarc

and the same happens to the UI scripts that make use of them (both in
the OPAC and STAFF interfaces).

* Calls to the unsafe ZOOM::Record->render()[1] method are removed.

Due to this last change the code for building facets was rewritten. And
for performance on the facets creation I pushed higher version
dependencies for MARC::File::XML and MARC::Record (we rely on
MARC::Field->as_string).

* Calls to MARC::Record->new_from_xml and MARC::Record->new_from_usmarc
are wrapped with eval for catching problems [2].

* As of bug 3087, UNIMARC uses the 'unimarc' record syntax. this case is
  correctly handled.
* As of bug 7818 misc/migration_tools/rebuild_zebra.pl behaves like:

- bib_index_mode (defaults to 'grs1' if not specified)
- auth_index_mode (defaults to 'dom')

here we do exactly the same.

To test:
 - prove t/db_dependent/Search.t should pass.
 - Searching should remain functional.
 - Indexing and searching for a big record should work (that's what the
   unit tests do).
 - Test an index scan search (on the staff interface):
    Search > More options > Check "Scan indexes".
 - Enable 'itemBarcodeFallbackSearch' and try to circulate any word, it
   shouldn't break.
 - Searching for a biblio in a new subscription shouldn't break.
 - Running bulkmarcimport.pl shouldn't break.
 - And so on... for the rest of the .pl files.

[1] http://search.cpan.org/~mirk/Net-Z3950-ZOOM/lib/ZOOM.pod#render()
[2] a record that cannot be parsed by MARC::Record is simply skipped (bug 10684)

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-02-28 19:50:09 +00:00
Jonathan Druart
b2d08f8359 Bug 11687: remove disused script statecollection.pl
It can be removed.

Test plan:
  git grep statecollection
returns no occurrence.

Signed-off-by: Holger Meissner <h.meissner.82@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-02-07 15:22:43 +00:00
Jonathan Druart
8b685c1e80 Bug 9823: Refactor return from GetReservesFromBiblionumber
The return from GetReservesFromBiblionumber contains an unnecessary
extra variable. In scalar context an array returns its element count.
Maintaining a separate count can lead to unforeseen bugs
and imposes ugly constructions on the subroutine's users.

Remove the useless count variable from the return

This patch also changes the parameters: now the routine takes a hashref.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Placed biblio holds, future holds and item holds. Works as expected.
Tested Holds.t and Reserves.t. Pass.
Tested /cgi-bin/koha/ilsdi.pl?service=GetRecords&id=999 with two holds on
one item. Fine.
C4/SIP/ILS/Item.pm: Looked for "whatever" and "arrayref" and could not find
them anymore. Looks good.
Handled a few unneeded calls in QA follow-up.
Left only one point to-do for serials/routing-preview.pl. See Bugzilla.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-01-30 16:19:55 +00:00
Fridolyn SOMERS
42eb8b2286 Bug 10429: improve display of library and library filter on serials claim page
In serial claims page, the library code is displayed in table instead
of library name and library filter does not work.

This patch adds the display of library name by using libraries template
plugin.  It changes the Javascript library filter to make it work.

Also sets "all" filter in template (like status filter) to allow
translation and sets "all" as selected by default. The staff user's
library was selected by default, but the table was not filtered
with it.

Test plan :
- Go to serials claim of a vendor with serials of multiple libraries
=> You see branch filter with "(All)" and table shows library's names
- Check that library  filter does its work

Signed-off-by: David Cook <dcook@prosentient.com.au>
Works as described.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Table now shows the branch name instead of the branchcode.
First option was named (All), matching the status pull down.
When opening the claims page, (All) is preselected and the
result list matches with the selection. Before the patch
the library was preselected, but the result list did show
late issues from all branches.

This patch is an improvement, but there is still more work to do.

- Filters are not cumulative, but when another filter is selected
  the first filter is not reset.
- It's not possible to combine
  2 or more filters.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-01-06 15:33:28 +00:00
fb4025b67b Bug 10277 - Add C4::Context->IsSuperLibrarian()
The method of checking the logged in user for superlibrarian privileges
is obtuse ( $userenv && $userenv->{flags} % 2 != 1 ) to say the least.
The codebase is littered with these lines, with no explanation given. It
would be much better if we had one subroutine that returned a boolean
value to tell us if the logged in user is a superlibrarian or not.

Test Plan:
1) Apply this patch
2) Verify superlibrarian behavior remains unchanged

Signed-off-by: Joel Sasse <jsasse@plumcreeklibrary.net>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comments on second patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-12-30 15:47:23 +00:00
Jonathan Druart
4651bbff21 Bug 10852: serials search improvements
This patch adds 3 filters for the serials search:
- location
- callnumber
- expiration date

To test:
- Search serials by location and/or callnumber and/or expiration date
  and check that results are consistent.

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-12-14 00:34:30 +00:00
Fridolyn SOMERS
fd22187914 Bug 11091: (follow-up) perltidy on serials/subscription-bib-search.pl
Signed-off-by: David Noe <drnoe@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-12-05 16:15:26 +00:00
Fridolyn SOMERS
e208386aae Bug 11091: revamp search limit options for new subscription bib search form
When creating a new subscription, you can click on "Search for Bilbio"
to search into catalog.

A popup opens with a text field for search terms and a combo-box to
limit search. This combo-box uses the syspref AdvancedSearchTypes to
know what list of values display.

The bug is that the code acts as if AdvancedSearchTypes has always one
value, but since Bug 7031, this syspref can have several values
(item types, collection codes and locations).

This patch removes the use of AdvancedSearchTypes syspref and defines
search form with 2 limits: item types and collection codes (from
authorised values CCODE).

One or both of this information can be on biblio. [RM note: this isn't a
true statement for the default configuration used by MARC21 libraries.]

Searching by location seems to be useless because this information is always
on item.  If CCODE authorised value does not exist or is empty, the collection
code filter is not displayed.

Test plan :
- Check CCODE authorised value exists with some values
- Choose a biblio indexed with both itemtype and ccode indexes
- Go to Serials module and click on "New subscription"
- In form, click on "Search for Biblio"
=> The popup "serials/subscription-bib-search.pl" appears with two limits
- Enter a word of biblio title, select its item type and select its collection code
- Click on "Search"
=> You get the biblio

Signed-off-by: David Noe <drnoe@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>

While I am not sure how useful the collection code is for most libraries, where this
is an item level value, this fixes a broken feature and works as described.
Passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-12-05 16:14:53 +00:00
Fridolyn SOMERS
0c631934de Bug 11214: improve create/edit routing list links in serial collection page
When a subscription has no routing list yet, the page
serials/subscription-detail.pl shows in left menu : "Create routing list".
In serials/serials-collection.pl page, the link in table is always
"Edit routing list", even when there is no routing list.

This patch adds a conditionnal link "Edit routing list"/"Create routing
list" into serials/serials-collection.pl page.

Test plan :
- Create a subscription no. 1 without routing list and a subscription
  no. 2 with a routing list
- Go to serials/serials-collection.pl of subscription no. 1
=> You see "Create routing list" link
- Click on link
=> You see "Create routing list for"
- Go to serials/serials-collection.pl of subscription no. 2
=> You see "Edit routing list" link
- Click on link
=> You see "Edit routing list for ..."

Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Functional and automated tests pass. Passes koha-qa.pl.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
With the patch applied the serial collection page shows the
right link depending on the existance of a routing list.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-11-27 18:23:54 +00:00
Fridolyn SOMERS
7ca790997e Bug 10809: use branches template plugin in serials search
In serials-search.pl, branch name was computed using branch code and
then passed to template.

This patch uses the new template plugin now for this:
    Koha::Template::Plugin::Branches.

Test plan :
- Go to serials search
- Perform a search that returns at least an open an a closed subscription having a branch defined
=> The branch name is displayed in "Library" column

Signed-off-by: Pierre Angot <tredok.pierre@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-11-21 15:20:05 +00:00
Jonathan Druart
43adbda007 Bug 7298: (follow-up) various QA fixes
- use Modern::Perl;
- GPL version
- tabs

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes QA script and all tests.

Testing notes:
- CSV header row is now translatable.
  Tested by updating the German po files and checking for the line.
- Tested that claiming for late serial issues still works as
  expected, as one file has been renamed. Filed 10931 for
  untranslatable CSV contents.
- Tested that claiming late orders still works:
  * Table searching and sorting
    Works nicely, but some columns could be split up for better
    searching and sorting:
      * Order date: 20/01/2013 (245 days)
      * Total cost:     10.00x1 = 10.00 Books
        => item type should be separate
      * Basket:  10 MPL
        => Library and basket number could be separate columns
  * Filters
     * Combined various filters, search results look correct.
  * Selecting order for claiming
      * Limiting by vendor makes it possible to check/uncheck all
      * With no vendor limit, entries for other vendors will be
        locked after the first checkbox is checked for one vendor
  * Exporting as CSV
     * Exported single line > CSV appears correct.
     * Exporting multiple lines > CSV appears correct.
     PROBLEM: Translated CSV don't work correctly, as line
     breaks are lost in the translation process.
     Needs to be fixed in a follow-up.
  * Sending serial claim email
     * No regressions found - there are some problems with the
       email contents noted on bug 7298.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-10-31 15:51:25 +00:00
Jonathan Druart
fd2c751a86 Bug 7298: add option to export late orders as CSV
This patch allows to export late orders as CSV.

Test plan:
- Go on the late orders page (acqui/lateorders.pl)
- Select one or more order and click on the button "Export as CSV".
- The generated file should contains some information on the orders
  (order date, estimated delivery date, vendor name, information field,
  cost, basket name (and basketid), claims count and the claimed date)
  The last line of the file is the total of orders.
- You are not allow to select order from different vendor.
- The check/uncheck all links appears only if a vendor is selected.
- Check that the check/uncheck works for all pages of the table.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: sonia <koha@univ-lyon3.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Testing comments on last patch in this series.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-10-31 15:49:24 +00:00