Commit graph

342 commits

Author SHA1 Message Date
c840c93835 Bug 15758: Koha::Libraries - Ultimate duel for C4::Branch
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-08 14:36:04 +00:00
df97814f30 Bug 15758: Koha::Libraries - Remove GetBranches
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-08 14:36:03 +00:00
9b9803b69c Bug 15758: Koha::Libraries - Remove GetBranchesLoop
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-08 14:36:02 +00:00
19a977dc7b Bug 15758: Koha::Libraries - Remove GetBranchName
This is the fourth and last patch set to remove C4::Branch.
The real purpose of this patch is to standardise and refactor some code
which is related to the libraries selection/display.
Its unconfessed purpose is to remove the C4::Branch package.

Before this patch set, only 6 subroutines still existed in the C4::Branch
package:
- GetBranchName
- GetBranchesLoop
- mybranch
- onlymine
- GetBranches
- GetBranch

GetBranchName basically returns the branchname for a given branchcode.
The branchname is only used for a display purpose and we don't need to
retrieve it in package or pl scripts (unless for a few exceptions).
We have a `Branches` template plugin with a `GetName` method which does
exactly this job.
To achieve this removal, we will use this template plugin and delete the
GetBranchName from pl and pm files.
The `Branches.all()` will now select the library of the logged in user
if no `selected` parameter has been passed.
This new behavior could cause regressions, for instance there are some
places where we do not want an option preselected (batch item
modification for instance), keep that in mind when testing.

GetBranchesLoop took 3 parameters: $branch and $onlymine.
The first one was used to set a "selected" flag, for a display purpose:
select an option in the libraries dropdown lists.
The second one was useless: If not passed or set to 0, the
`C4::Branch::onlymine` subroutine was called.
This onlymine flag was use to know if the logged in user was able to see
other libraries infos.
A patron can see the infos from other libraries if IndependentBranches
is not set OR if he has the superlibrarian permission.
Prior to this patch set, the "onlymine test" was done on different
places (neworderempty.pl, additem.pl, holidays.pl, etc.), including the
Branches TT plugin. In this patch set, this test is only done on one
place (C4::Context::only_my_library, code moved from
C4::Branch::onlymine).
To accomplish the same job as this subroutine, we just need to call the
`Branches.all()` method from the `Branches` TT plugin. It already
accepts a `selected` parameter to set a flag on the option to select.
To avoid the repetitive
  [% IF selected %]<option selected="selected">[% ELSE %]<option>[% END %]
pattern, a new `html_helpers` TT include file has been created, it
defines an `options_for_libraries` block, which takes a `selected`
parameter. We could imagine to use this include file for other
selects.

The 'mybranch` and `onlymine` subroutines of the C4::Branch package have
been moved to C4::Context. onlymine has been renamed with
only_my_library. There are only 4 occurrences of it, against 11 before
this patch set.
There 2 subroutines are Context-centric and it makes sense to put them
in `C4::Context` (at least it's the least worst place!)

GetBranches is the tricky part of this patch set: It retrieves all the
libraries, independently of the value of IndependentBranches.
To keep the same way as the existing calls of `Branches.all()`, I have
added a `unfiltered` parameter. If set, the `Branches.all()` will call
a usual Koha::Libraries->search method, otherwise
Koha::Libraries->search_filtered will be called. This new method will
check if the logged in user is allowed to see other libraries or only
its library.
Note that this `GetBranches` subroutine also created a `category` key:
it allowed to get the list of groups (of libraries) where this library
existed. Thanks to a previous patch set (bug 15295), this value was
not used anymore (I may have missed something!).

Note that the only use of `GetBranch` was buggy (see bug 15746).

Test plan (for the whole patch set):
The best way to test this whole patch set is to test with 2 instances: 1
with the patch set applied, 1 using master, to be sure there is no
regression.
It would be good to test the same with `IndependentBranches` and the
without `IndependentBranches`.
No difference should be found.
The tester must focus on the library dropdowns on as many forms as
possible.
You will notice changes in the order of the options: the libraries will
now be ordered by branchname (instead of branchcode in some places).
A special attention will be given to the following page:
- acqui/neworderempty.pl
- catalogue/search.pl
- members/members-home.pl (header?)
- opac/opac-topissues.pl
- tools/holidays.pl
- admin/branch_transfer_limits.pl
- admin/item_circulation_alerts.pl
- rotating_collections/transferCollection.pl
- suggestion/suggestion.pl
- tools/export.pl

Notes for QA:
- There are 2 FIXMEs in the patch set, I have kept the existing behavior,
but I am not sure it's the good one. Feel free to open a bug report and
I will fill a patch if you think it's not correct. Otherwise, remove the
FIXME lines in a follow-up patch.
- The whole patch set is huge and makes a lot of changes.
But it finally will tremendously reduce the number of lines:
716 insertions for 1910 deletions

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-08 14:36:01 +00:00
6ee8dd3a59 Bug 15407: Koha::Patron::Categories - replace C4::Category->all
The C4::Category module contained only 1 method to return the patron
categories available for the logged in user.
The new method Koha::Patron::Categories->search_limited does exactly the
same thing (see tests) and must be used in place of it.

Test plan:
- Same prerequisite as before
For the following pages, you should not see patron categories limited to
other libraries.
- On the 'Item circulation alerts' admin page
  (admin/item_circulation_alerts.pl), modify the settings for check-in
  and checkout (NOTE: Should not we display all patron categories on
  this page? If yes, it must be done in another bug report to ease
  backporting it).
- Search for patrons in the admin (budget) and acquisition (order) module.
- On the patron home page (search form in the header)

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-08 13:29:03 +00:00
f3d7f27107 Bug 15451: Koha::CsvProfiles - Remove the residue
This patch erase all traces of C4::Csv since it's not used anymore.
All occurrences have been replaced by previous patches to use
Koha::CsvProfiles.

Note that GetMarcFieldsForCsv was not used prior this patch set.

Test plan:
  git grep 'C4::Csv'
should not return any result.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
No more traces of the file.
This produces a koha-qa fail, due to the missing file.
No other errors

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-07-22 17:18:36 +00:00
0e80c75aee Bug 15451: Koha::CsvProfiles - Remove GetCsvProfile
This subroutine just returned a csv profile for a given id.
It is replaced in this patch by a call to Koha::CsvProfiles->find.

There is nothing to test here, these changes have been tested in
previous patches.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-07-22 17:18:36 +00:00
04c7a8a845 Bug 15451: Koha::CsvProfiles - Remove GetCsvProfiles
This subroutine did the same job as GetCsvProfilesLoop, so this patch
applies the same changes as the previous patch.

Test plan:
1/ Claim some serials, sql profiles should be listed
2/ Export records using the export tool. MARC profiles should be listed.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Listed sql & marc profiles
No errors

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-07-22 17:18:35 +00:00
b416ac16b5 Bug 12178: Update serial status to "claimed" when exporting to CSV
On the same way as late issues, the serial status should be updated to
'claimed' when the issues as exported as csv.

QA note: The updateClaim and UpdateClaimdateIssues subroutine did almost the
same thing, I kick the second on off to centralize the code.

Test plan:
1/ Export some late issues as CSV (serials/claims.pl).
2/ Refresh the page (the export does not do it) and confirm that the
status, the claim date and the claim count have been updated.
3/ Select some others issues, select a notice and send the notification.
Confirm that the behavior is the same.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-07-15 14:07:40 +00:00
c133bedf54 Bug 16154: Fix some other occurrences
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-04-26 23:16:44 +00:00
f3e4b5bbb6 Bug 16154: CGI->multi_param - Force scalar context
This patch replaces the occurrences of
  $template->param( foo => $cgi->param('foo') );
with
  $template->param( foo => scalar $cgi->param('foo') );

perl -p -i -e 's/(\s*=>\s*)\$(cgi|input|query)\->param\(/$1scalar
\$$2\->param\(/xms' **/*.pl

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-04-26 23:16:43 +00:00
ac5a1bfece Bug 16154: CGI->multi_param - Manual changes
This patch does the same as the previous one, but affects lines which
have not been caught by the regex.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-04-26 23:16:43 +00:00
66aacace08 Bug 16154: CGI->multi_param - Declare a list
This patch replaces the occurrences of
  my @foo = $cgi->param('foo');
with
  my @foo = $cgi->multi_param('foo');

perl -p -i -e
's/^(\s*my\s*@\w+\s*=\s*)\$(cgi|input|query)\->param\(/$1\$$2\->multi_param\(/xms'
**/*.pl

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-04-26 23:16:42 +00:00
Robin Sheat
b4392018bc Bug 12478: make things using SimpleSearch use the new version
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-04-26 20:20:07 +00:00
b64e6be1c4 Bug 16157: Move the selected flag from GetAuthorisedValues to the templates
From C4::Koha::GetAuthorisedValues

    # TODO: the "selected" feature should be replaced by a utility function
    # somewhere else, it doesn't belong in here. For starters it makes
    # caching much more complicated. Or just let the UI logic handle it, it's
    # what it's for.

Indeed, it's not a job for a subroutine, the template should take care of that.
Note that a perf gain could be won with this patch \o/

Test plan:
- Edit an itemtype and check the value of the "Search category" dropdown list
- Edit a patron attribute type and check the value of the "Class" dropdown list
- Detail for a catalogue record, the Status column should be correctly
  populated if items are damaged and/or lost
- Item details for a catalogue record, the lost, damaged and withdrawn
  value should be correctly displayed
- Edit a patron, the "street type" should be correctly selected
- Create a patron attribute type linked to an authorised value list.
- Edit a patron, set a value for this attribute, edit it again. The
  correct value should be selected.
- Search for subscriptions. The 'Location' dropdown list should behave
  correctly (select the entry you have choosen before, etc.)
- Edit a subscription, the location dropdown list should select the
  correct value.
- Edit and view a suggestion with a 'reason for suggestion' set (you
  should have at least 1 OPAC_SUG AV defined)

Followed test plan, 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: Brendan Gallagher brendan@bywatersolutions.com
2016-04-07 00:16:09 +00:00
c564f30155 Bug 16169: Change prototype for C4::Biblio::TransformMarcToKoha
subroutines should not take $dbh in parameter.
C4::Biblio::TransformMarcToKoha has it and does not use it.

Test plan:
Look at the patch and confirm that all occurrences of
TransformMarcToKoha have been modified.

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

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

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-04-07 00:04:21 +00:00
Aleisha
fe79402575 Bug 14641: [SIGNED-OFF] Warns in subscription-add.pl
Removes warn using Jonathan's suggestion!

To test:
1) Reproduce warns by clicking New Subscription
2) Apply patch
3) Click New Subscription again
4) Confirm warns are gone

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Patch removes the warn that come when clicking "New subscription"

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-01-27 04:31:27 +00:00
ff1579de6d Bug 15258: Fix Perl scripts declaring unused variables
Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

All affected files tested with `perl -c`.
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
2015-12-30 17:24:45 -07:00
Marc Véron
e8b2f04638 Bug 14870: (followup) Remove stray C4::Dates
(See comment #23)

This patch removes stray C4::Dates (date_fromat...) from
C4/Items.pm
C4/Log.pm
C4/Serials.pm
serials/acqui-search-result.pl
t/DateUtils.t
t/db_dependent/Items/GetItemsForInventory.t
tools/koha-news.pl

Some of them were inside comments etc.

To test:
- git grep 'C4::Dates' should give no result
- git grep 'format_d' should give no result
  Exception: in one cron job there exists an own sub format_date, and occurences not
             related to C4::Dates
- Search for regressions

http://bugs.koha-community.org/show_bug.cgi?id=14870
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
serials/acqui-search-results.pl looks like it should be revisited,
containing code that might not be needed. Searching a vendor
in serials still works witout a problem.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-19 13:05:06 -03:00
Marc Véron
0820d890b2 Bug 14969: (followup) Today's date withoute time when receiving
To test: Change status of a serial from Expected to Received,
         today's date in column "Expected" should appear without time.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-17 15:35:57 -03:00
018de8802d Bug 14969: Remove C4::Dates from serials/*.pl files
Warning: This area is a mess, especially with date management.

For the same reasons as other "Remove C4::Dates from*" patches, this one
will deal with the serials module.

Note that this patch add the datepicker on 3 input fields (on
serials/subscription-detail.tt and serials/subscription-renew.tt).
There was also weird behavior when the dates were invalid. Now default
to undefined. But with the datepicker it will reduce the number of
cases even if the user is still allowed to fill invalid dates.

Test plan:
1/ Create a subscription, fill the first issue pub date and the
subscription start date.
You can fill or not the end date.
Play with the numbering pattern and confirm that there are generated as
before this patch.
2/ On the check expiration page, confirm that the dates are correctly
displayed.
3/ Renew the subscription and confirm that the behavior is correct.
4/ Go on the subscription history page and confirm you have now the
datepicker plugin set on the 2 date fields.

QA notes: The startdate, histstartdate and enddate are not used in
the serials-collection template, this patch removes them from the pl
script.

Tested on top of 15166 15168 15171, full browser reload for date pickers.
Note for 4/: It is the link in tab planning on subscription
detail page, near "Manual history" (if manual history is enabled).
Works as advertised.
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@theke.io>
2015-11-17 15:35:57 -03:00
78c1b01988 Bug 15171: Display subscriptions which will expire in the future
Since the form on the subscription check expiration page let the user choose an
expiration date > today, there is no sense to hide subscriptions which will expire in the future.

Test plan:
0/ Make sure you have at least subscription with an expiration date > today
1/ Start a seach on the check expiration page (serials/checkexpiration.pl)
with a date < today, = today and > today
=> The subscription won't never be displayed without this patch.
With this patch, it will.

Note that you will get a "No results for your query" message only if you
have search for something.

Followed testplan, 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@theke.io>
2015-11-17 09:50:52 -03:00
defcfd050e Bug 15109: Make name the default sort order for all patron searches
Find another place where there is a patron search (add user to a basket,
add users to a fund or edit owner of a fund, set a guarantor to a child,
etc.).
Do a search a confirm that the results are now sorted by name instead of
cardnumber.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-17 09:49:21 -03:00
Julian Maurice
473b7f8dea Bug 8296: Follow up for QA
1 redefined variable removed

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Cedric Vita <cedric.vita@dracenie.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-05 10:41:28 -03:00
Julian Maurice
353ed5b914 Bug 8296: Add descriptive (text) published date field for serials
Add a new field serial.publisheddatetext for displaying published date
in another format that dateformat syspref permit.

Signed-off-by: Cedric Vita <cedric.vita@dracenie.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-05 10:41:28 -03:00
Jonathan Druart
b9a22b3636 Bug 8438: Users can only claim for serials related to their branch.
Only superlibrarian users and users with superserials permission
can override this limitation.

This patch adds a new subroutine C4::Serials::can_claim_subscription.

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

The upgrading of the DB was as required:
for each [PT/S] patron with the permission "claim_serials" ON,
the permission "superserials" became[/was kept to] ON.

Then, after having checked the DB upgrading, to test the currently
adding limitation:
> Users can only claim for serials related to their branch
, I reset 2 PT/S patrons-users to:
permission claim_serials: YES
permission superserials: NO
and I set the syspref "IndependendeBranches" to "Prevent".

For:
> Only superlibrarian users can override this limitation.
the S patron-user could list AND claim:
A) subscriptions of his own branch,
B) subscriptions of other branch,
C) subscriptions without branch.

For:
> Only users with superserials permission can override this limitation.
the PT patron-user could list:
A) subscriptions of his own branch,
B) subscriptions of other branch,
C) subscriptions without branch,
and could claim only:
A) subscriptions of his own branch,
C) subscriptions without branch.

NB: a subscription is selected to be claimed.

Then I set the syspref "IndependendeBranches" to "Don't prevent".
The behaviour was [exactly the same as in master] without the added
limitation.

On [S/PT] patrons, if permission claim_serials was NO, no Claims
link was available on Serials' page, either under "Prevent" or under
"Don't prevent".

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Added the results of Paola's testing to the commit message
as test plan.

Note to RM: Maybe we could add a note to the release notes, that
Koha now enforces superserials with independent branches better,
so people might have to adapt permissions in order to claim
for other branches.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-04 11:12:28 -03:00
Katrin Fischer
2d22a30d6a Bug 8436: QA Follow-up: Activate branch filter, if IndependentBranches is off
The superserials permission is only in use in combination with
IndependentBranches - so it makes sense to also show the branch
filter when IndependentBranches is off.

Permission description:
 superserials Manage subscriptions from any branch
 (only applies when IndependentBranches is used)

Also adds a missing check for superlibraian.

Note: the duplicated permission check in the code is not really nice
- would be good to rewrite this to be more clean.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-04 11:11:47 -03:00
Julian Maurice
8a48209933 Bug 8436: Use C4::Context->IsSuperLibrarian()
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-04 11:11:47 -03:00
Jonathan Druart
da57aba894 Bug 8436: Replace GetBranches with GetBranchesLoop
The branch selection logic still exists in GetBranchesLoop, it should be
used here.

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@theke.io>
2015-11-04 11:11:47 -03:00
Julian Maurice
0b903c5166 Bug 8436: Add limit on branch in checkexpiration.pl
This limit is only available for superlibrarians and patrons that have
superserials permission. Other patrons will only see subscriptions of
their branch.

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@theke.io>
2015-11-04 11:11:47 -03:00
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