Bug 7534 - New OPACAllowUserToChooseBranch setting for only showing libraries allowing holds
Summary: New OPACAllowUserToChooseBranch setting for only showing libraries allowing h...
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Lari Taskula
QA Contact:
URL:
Keywords:
Depends on:
Blocks: 7614 18102 22125
  Show dependency treegraph
 
Reported: 2012-02-13 13:47 UTC by delaye
Modified: 2019-07-10 09:28 UTC (History)
11 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 7534: Add new column "pickup_location" to branches (2.81 KB, patch)
2017-02-08 14:51 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 7534: Add method Koha::Template::Plugin::Branches->pickup_locations (3.06 KB, patch)
2017-02-08 14:52 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 7534: Add configuration to admin/branches.pl (3.26 KB, patch)
2017-02-08 14:52 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 7534: Display pickup locations instead of all libraries in opac-reserve.pl (2.58 KB, patch)
2017-02-08 14:52 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 7534: Display pickup locations instead of all libraries in opac-reserve.pl (1.93 KB, patch)
2017-02-08 14:53 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 7534: Display pickup locations instead of all libraries in opac-reserve.pl (2.58 KB, patch)
2017-02-08 16:33 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 7534: Display pickup locations instead of all libraries in request.pl (1.92 KB, patch)
2017-02-08 16:33 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 7534: Display pickup locations instead of all libraries in opac-reserve.pl (2.88 KB, patch)
2017-03-01 14:41 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 7534: Add new column "pickup_location" to branches (2.87 KB, patch)
2017-03-02 16:08 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 7534: Add method Koha::Template::Plugin::Branches->pickup_locations (3.06 KB, patch)
2017-03-02 16:08 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 7534: Add configuration to admin/branches.pl (3.26 KB, patch)
2017-03-02 16:08 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 7534: Display pickup locations instead of all libraries in request.pl (1.92 KB, patch)
2017-03-02 16:09 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 7534: Display pickup locations instead of all libraries in opac-reserve.pl (2.88 KB, patch)
2017-03-02 16:09 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 7534: Add pickup_location to kohastructure.sql (999 bytes, patch)
2017-03-02 16:18 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 7534: Add new column "pickup_location" to branches (3.60 KB, patch)
2017-03-07 16:11 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 7534: Use search parameters for Koha::Template::Plugin::Branches->all (2.95 KB, patch)
2017-03-07 16:11 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 7534: Add configuration to admin/branches.pl (3.26 KB, patch)
2017-03-07 16:12 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 7534: Display pickup locations instead of all libraries in request.pl (1.99 KB, patch)
2017-03-07 16:12 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 7534: Display pickup locations instead of all libraries in opac-reserve.pl (2.94 KB, patch)
2017-03-07 16:12 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 7534: (QA-follow-up) Default pickup location to Yes when adding a new library (2.31 KB, patch)
2017-03-07 16:12 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 7534: Validate pickup location in CanBook/ItemBeReserved (5.12 KB, patch)
2017-03-13 17:22 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 7534: Check hold availability to desired pickup location in opac-reserve.pl (3.23 KB, patch)
2017-03-13 17:22 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 7534: Validate pickup location in CanBook/ItemBeReserved (5.06 KB, patch)
2017-03-13 17:32 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 7534: Check hold availability to desired pickup location in opac-reserve.pl (3.23 KB, patch)
2017-03-13 17:32 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 7534: Add new column "pickup_location" to branches (3.66 KB, patch)
2017-03-20 11:39 UTC, sandboxes@biblibre.com
Details | Diff | Splinter Review
Bug 7534: Use search parameters for Koha::Template::Plugin::Branches->all (3.01 KB, patch)
2017-03-20 11:39 UTC, sandboxes@biblibre.com
Details | Diff | Splinter Review
Bug 7534: Add configuration to admin/branches.pl (3.32 KB, patch)
2017-03-20 11:39 UTC, sandboxes@biblibre.com
Details | Diff | Splinter Review
Bug 7534: Display pickup locations instead of all libraries in request.pl (2.05 KB, patch)
2017-03-20 11:39 UTC, sandboxes@biblibre.com
Details | Diff | Splinter Review
Bug 7534: Display pickup locations instead of all libraries in opac-reserve.pl (3.00 KB, patch)
2017-03-20 11:39 UTC, sandboxes@biblibre.com
Details | Diff | Splinter Review
Bug 7534: (QA-follow-up) Default pickup location to Yes when adding a new library (2.37 KB, patch)
2017-03-20 11:39 UTC, sandboxes@biblibre.com
Details | Diff | Splinter Review
Bug 7534: Validate pickup location in CanBook/ItemBeReserved (5.12 KB, patch)
2017-03-20 11:40 UTC, sandboxes@biblibre.com
Details | Diff | Splinter Review
Bug 7534: Check hold availability to desired pickup location in opac-reserve.pl (3.29 KB, patch)
2017-03-20 11:40 UTC, sandboxes@biblibre.com
Details | Diff | Splinter Review
Bug 7534: Add new column "pickup_location" to branches (2.52 KB, patch)
2018-08-15 17:51 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 7534: Use search parameters for Koha::Template::Plugin::Branches->all (3.23 KB, patch)
2018-08-15 17:51 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 7534: Add configuration to admin/branches.pl (3.47 KB, patch)
2018-08-15 17:51 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 7534: Display pickup locations instead of all libraries in request.pl (2.13 KB, patch)
2018-08-15 17:52 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 7534: Display pickup locations instead of all libraries in opac-reserve.pl (3.01 KB, patch)
2018-08-15 17:52 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 7534: (QA-follow-up) Default pickup location to Yes when adding a new library (2.61 KB, patch)
2018-08-15 17:52 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 7534: Validate pickup location in CanBook/ItemBeReserved (5.12 KB, patch)
2018-08-15 17:52 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 7534: Check hold availability to desired pickup location in opac-reserve.pl (3.04 KB, patch)
2018-08-15 17:52 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 7534: Fix number of tests for Holds.t (639 bytes, patch)
2018-08-15 17:52 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 7534: Disambiguate branchcode parameter, make it match between subroutines (1.76 KB, patch)
2018-08-15 17:52 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 7534: Add new column "pickup_location" to branches (2.51 KB, patch)
2018-08-25 19:07 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 7534: Add new column "pickup_location" to branches (2.51 KB, patch)
2018-08-25 19:08 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 7534: Use search parameters for Koha::Template::Plugin::Branches->all (3.22 KB, patch)
2018-08-25 19:08 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 7534: Add configuration to admin/branches.pl (3.48 KB, patch)
2018-08-25 19:08 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 7534: Display pickup locations instead of all libraries in request.pl (2.14 KB, patch)
2018-08-25 19:08 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 7534: Display pickup locations instead of all libraries in opac-reserve.pl (3.03 KB, patch)
2018-08-25 19:08 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 7534: (QA-follow-up) Default pickup location to Yes when adding a new library (2.61 KB, patch)
2018-08-25 19:08 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 7534: Validate pickup location in CanBook/ItemBeReserved (5.26 KB, patch)
2018-08-25 19:08 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 7534: Check hold availability to desired pickup location in opac-reserve.pl (3.11 KB, patch)
2018-08-25 19:08 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 7534: Fix number of tests for Holds.t (632 bytes, patch)
2018-08-25 19:08 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 7534: Disambiguate branchcode parameter, make it match between subroutines (1.78 KB, patch)
2018-08-25 19:08 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 7534: (RM follow-up) Fix tests and adjust after bug 15524 (2.77 KB, patch)
2018-08-25 19:08 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 7534: Add new column "pickup_location" to branches (2.52 KB, patch)
2018-09-06 13:46 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 7534: Use search parameters for Koha::Template::Plugin::Branches->all (3.23 KB, patch)
2018-09-06 13:46 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 7534: Add configuration to admin/branches.pl (3.49 KB, patch)
2018-09-06 13:46 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 7534: Display pickup locations instead of all libraries in request.pl (2.15 KB, patch)
2018-09-06 13:46 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 7534: Display pickup locations instead of all libraries in opac-reserve.pl (3.04 KB, patch)
2018-09-06 13:46 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 7534: (QA-follow-up) Default pickup location to Yes when adding a new library (2.61 KB, patch)
2018-09-06 13:46 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 7534: Validate pickup location in CanBook/ItemBeReserved (5.32 KB, patch)
2018-09-06 13:47 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 7534: Check hold availability to desired pickup location in opac-reserve.pl (3.12 KB, patch)
2018-09-06 13:47 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 7534: Fix number of tests for Holds.t (639 bytes, patch)
2018-09-06 13:47 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 7534: Disambiguate branchcode parameter, make it match between subroutines (1.86 KB, patch)
2018-09-06 13:47 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 7534: (RM follow-up) Fix tests and adjust after bug 15524 (2.81 KB, patch)
2018-09-06 13:47 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 7534 [QA Followup]: Don't do pickup branch checking for determining holdability in the OPAC (3.34 KB, patch)
2018-09-06 13:47 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 7534 [QA Followup]: Don't do pickup branch checking for determining holdability in the OPAC (2.17 KB, patch)
2018-09-06 13:50 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 7534: (RM follow-up) Fix TT syntax (2.49 KB, patch)
2018-09-06 19:05 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 7534: (QA followup) Disable priority pulldowns when using split holds queue (1.55 KB, patch)
2018-09-07 18:28 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 7534: (QA follow-up) Use Koha.Preference template plugin to fetch the pref's value (3.20 KB, patch)
2018-09-10 20:46 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 7534: (QA Follow-up) Fix the return value for the new format, it should be a hashref, not a string (806 bytes, patch)
2019-02-07 16:20 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description delaye 2012-02-13 13:47:05 UTC
the system preference OPACAllowUserToChooseBranch disaply all the branchs instead of display only the branchs who accept the holds.
Result: a branch can be pickup location when he does not want to manage holds
Comment 1 Katrin Fischer 2013-04-13 21:24:22 UTC
Could you explain how this should work? 
I am not sure what preferences/configuration settings should be taken into account to make the pull down more 'clever'. Maybe one idea would be to have the list of libraries offered in the pull down configurable?
Comment 2 Koha Team AMU 2013-04-19 13:38:20 UTC
At this time, to display pick-up branches when "OPACAllowUserToChooseBranch" is on, "Opac-reserve.pl" calls for "GetBranchesLoop" and all the branches can be selected by users.

It would be great to be able to configurate the pick-up branches and choose either all the branches either only the branches which allow holds.

Maybe it could be a third option for "OPACAllowUserToChooseBranch" ?
Option 1 --> "OPACAllowUserToChooseBranch" = Don't allow
Option 2 --> "OPACAllowUserToChooseBranch" = Allow for all branches --> "Opac-reserve.pl" calls for "GetBranchesLoop" 
Option 3 --> "OPACAllowUserToChooseBranch" = Allow for branches with holds --> "Opac-reserve.pl" calls for a new setting, "GetPickUpBranches" for example, which only selects branches with holds.
Comment 3 Peggy Thrasher 2016-07-29 13:39:16 UTC
This would be helpful for us.  We have a location for "Download" where we put all of our Overdrive titles.  Recently we have had patrons put a hold on a physical book and change the pickup location to "Download".  We'd like to be able to take "Download" off the list of pickup locations that they can choose from.
It would be sufficient for us if there was a choice when you were defining the library (Administration/Libraries and Groups) for Pickup location - yes or no.

Thanks!
Peggy
Comment 4 Lari Taskula 2017-02-08 14:51:41 UTC
Created attachment 60014 [details] [review]
Bug 7534: Add new column "pickup_location" to branches

This patch adds a new column "pickup_location" for each library. This value
defines whether a library can be used as a pickup location or not.

For extended configurability, this flag could perhaps be considered as a part
of issuing rules, but as of now, this patch only offers a simple flag into
each library. This method also allows easy way for REST API to determine valid
pickup locations by querying the /libraries endpoint.

To test:
1. perl installer/data/mysql/updatedatabase.pl
2. Observe
DEV atomic update: bug_7534.perl
Upgrade to XXX done (Bug 7534 - Let libraries have configuration for pickup locations)
Comment 5 Lari Taskula 2017-02-08 14:52:05 UTC
Created attachment 60015 [details] [review]
Bug 7534: Add method Koha::Template::Plugin::Branches->pickup_locations

This patch adds a new method Koha::Template::Plugin::Branches->pickup_locations.

Unit tests included.

To test:
1. prove t/db_dependent/Template/Plugin/Branches.t
Comment 6 Lari Taskula 2017-02-08 14:52:26 UTC
Created attachment 60016 [details] [review]
Bug 7534: Add configuration to admin/branches.pl

This patch adds a configuration option for pickup locations.

To test:
1. Apply patch
2. Go to cgi-bin/koha/admin/branches.pl
3. Observe there is a new column "Pickup location"
4. Click "Edit" for any library
5. Scroll to bottom of the page and select "No"
6. Click "Submit"
7. Observe your library in Libraries-table, notice the value of "Pickup location"
   has changed to "No"
Comment 7 Lari Taskula 2017-02-08 14:52:42 UTC
Created attachment 60017 [details] [review]
Bug 7534: Display pickup locations instead of all libraries in opac-reserve.pl

This patch sets opac-reserve.tt to use the list of pickup libraries instead
of every library in the system.

To test:
1. Go to cgi-bin/koha/admin/branches.pl
2. Configure one of your libraries to "Pickup location" => "No"
3. Go to OPAC and place a hold
4. See the provided Pickup location list
5. Observe the library that you configured is not present in the list
Comment 8 Lari Taskula 2017-02-08 14:53:00 UTC
Created attachment 60018 [details] [review]
Bug 7534: Display pickup locations instead of all libraries in opac-reserve.pl

This patch sets opac-reserve.tt to use the list of pickup libraries instead
of every library in the system.

To test:
1. Go to cgi-bin/koha/admin/branches.pl
2. Configure one of your libraries to "Pickup location" => "No"
3. Go place a hold in intranet
4. See the provided "Pickup at" list
5. Observe the library that you configured is not present in the list
6. Place the hold
7. See list of existing holds on that biblio
8. See "Pickup library" column and observe your configured library is
   not included in the list
Comment 9 Lari Taskula 2017-02-08 14:57:12 UTC
(In reply to Peggy Thrasher from comment #3)
> This would be helpful for us.  We have a location for "Download" where we
> put all of our Overdrive titles.  Recently we have had patrons put a hold on
> a physical book and change the pickup location to "Download".  We'd like to
> be able to take "Download" off the list of pickup locations that they can
> choose from.
> It would be sufficient for us if there was a choice when you were defining
> the library (Administration/Libraries and Groups) for Pickup location - yes
> or no.
> 
> Thanks!
> Peggy
Hi! I wrote patches that implement your suggestion. Could you test it? We have the same need for configuring available pickup locations. Thanks!
Comment 10 Lari Taskula 2017-02-08 16:33:05 UTC
Created attachment 60022 [details] [review]
Bug 7534: Display pickup locations instead of all libraries in opac-reserve.pl

This patch sets opac-reserve.tt to use the list of pickup libraries instead
of every library in the system.

To test:
1. Go to cgi-bin/koha/admin/branches.pl
2. Configure one of your libraries to "Pickup location" => "No"
3. Go to OPAC and place a hold
4. See the provided Pickup location list
5. Observe the library that you configured is not present in the list
Comment 11 Lari Taskula 2017-02-08 16:33:27 UTC
Created attachment 60023 [details] [review]
Bug 7534: Display pickup locations instead of all libraries in request.pl

This patch sets request.tt to use the list of pickup libraries instead
of every library in the system.

To test:
1. Go to cgi-bin/koha/admin/branches.pl
2. Configure one of your libraries to "Pickup location" => "No"
3. Go place a hold in intranet
4. See the provided "Pickup at" list
5. Observe the library that you configured is not present in the list
6. Place the hold
7. See list of existing holds on that biblio
8. See "Pickup library" column and observe your configured library is
   not included in the list
Comment 12 Chris Kirby 2017-02-25 15:38:46 UTC
Applying patches, failed to merge changes for 
"Bug 7534: Display pickup locations instead of all libraries in opac-reserve.pl"

Failed to merge in changes.
Comment 13 Lari Taskula 2017-03-01 14:41:21 UTC
Created attachment 60781 [details] [review]
Bug 7534: Display pickup locations instead of all libraries in opac-reserve.pl

This patch sets opac-reserve.tt to use the list of pickup libraries instead
of every library in the system.

To test:
1. Go to cgi-bin/koha/admin/branches.pl
2. Configure one of your libraries to "Pickup location" => "No"
3. Go to OPAC and place a hold
4. See the provided Pickup location list
5. Observe the library that you configured is not present in the list
Comment 14 Lari Taskula 2017-03-01 14:43:17 UTC
(In reply to Chris Kirby from comment #12)
> Applying patches, failed to merge changes for 
> "Bug 7534: Display pickup locations instead of all libraries in
> opac-reserve.pl"
> 
> Failed to merge in changes.

Thanks for reporting! I fixed the conflict as promised yesterday in IRC. Does it apply now?
Comment 15 Chris Kirby 2017-03-01 16:10:36 UTC
Conflict is now fixed.
Prior to rebase, I ran perl installer/data/mysql/updatedatabase.pl

prove t/db_dependent/Template/Plugin/Branches.t results in
"All tests successful"

However, Going to cgi-bin/koha/admin/branches.pl
causes "internal server error".
Comment 16 Lari Taskula 2017-03-01 16:26:18 UTC
(In reply to Chris Kirby from comment #15)
> Conflict is now fixed.
> Prior to rebase, I ran perl installer/data/mysql/updatedatabase.pl
> 
> prove t/db_dependent/Template/Plugin/Branches.t results in
> "All tests successful"
> 
> However, Going to cgi-bin/koha/admin/branches.pl
> causes "internal server error".

Thank you for the details. I can't reproduce this issue. Is there a more detailed description of the error in the log files?
Comment 17 Chris Kirby 2017-03-01 22:42:43 UTC
I don't get the "internal server error" on an old ubuntu system (14.04 LTS) but I DO get it on kohadevbox with a Windows host and Debian Jessie guest.

On the Kohadevbox, Debian Jessie,
koha-plack-err:
Template process failed: undef error- The method pickup_location is not covered by tests! at /usr/share/koha/lib/C4/Templates.pm line 121.
Comment 18 Lari Taskula 2017-03-02 16:08:15 UTC
Created attachment 60794 [details] [review]
Bug 7534: Add new column "pickup_location" to branches

This patch adds a new column "pickup_location" for each library. This value
defines whether a library can be used as a pickup location or not.

For extended configurability, this flag could perhaps be considered as a part
of issuing rules, but as of now, this patch only offers a simple flag into
each library. This method also allows easy way for REST API to determine valid
pickup locations by querying the /libraries endpoint.

To test:
1. perl installer/data/mysql/updatedatabase.pl
2. Observe
DEV atomic update: bug_7534.perl
Upgrade to XXX done (Bug 7534 - Let libraries have configuration for pickup locations)

https://bugs.koha-community.org/show_bug.cgi?id=7354
Comment 19 Lari Taskula 2017-03-02 16:08:31 UTC
Created attachment 60795 [details] [review]
Bug 7534: Add method Koha::Template::Plugin::Branches->pickup_locations

This patch adds a new method Koha::Template::Plugin::Branches->pickup_locations.

Unit tests included.

To test:
1. prove t/db_dependent/Template/Plugin/Branches.t
Comment 20 Lari Taskula 2017-03-02 16:08:55 UTC
Created attachment 60796 [details] [review]
Bug 7534: Add configuration to admin/branches.pl

This patch adds a configuration option for pickup locations.

To test:
1. Apply patch
2. Go to cgi-bin/koha/admin/branches.pl
3. Observe there is a new column "Pickup location"
4. Click "Edit" for any library
5. Scroll to bottom of the page and select "No"
6. Click "Submit"
7. Observe your library in Libraries-table, notice the value of "Pickup location"
   has changed to "No"
Comment 21 Lari Taskula 2017-03-02 16:09:09 UTC
Created attachment 60797 [details] [review]
Bug 7534: Display pickup locations instead of all libraries in request.pl

This patch sets request.tt to use the list of pickup libraries instead
of every library in the system.

To test:
1. Go to cgi-bin/koha/admin/branches.pl
2. Configure one of your libraries to "Pickup location" => "No"
3. Go place a hold in intranet
4. See the provided "Pickup at" list
5. Observe the library that you configured is not present in the list
6. Place the hold
7. See list of existing holds on that biblio
8. See "Pickup library" column and observe your configured library is
   not included in the list
Comment 22 Lari Taskula 2017-03-02 16:09:21 UTC
Created attachment 60798 [details] [review]
Bug 7534: Display pickup locations instead of all libraries in opac-reserve.pl

This patch sets opac-reserve.tt to use the list of pickup libraries instead
of every library in the system.

To test:
1. Go to cgi-bin/koha/admin/branches.pl
2. Configure one of your libraries to "Pickup location" => "No"
3. Go to OPAC and place a hold
4. See the provided Pickup location list
5. Observe the library that you configured is not present in the list
Comment 23 Lari Taskula 2017-03-02 16:18:03 UTC
Created attachment 60799 [details] [review]
Bug 7534: Add pickup_location to kohastructure.sql
Comment 24 Lari Taskula 2017-03-02 16:18:51 UTC
Changed pickup_location column type to TINYINT(1) since that's what we generally use for "booleans" and added it to kohastructure.sql (forgot to add it there before!)

(In reply to Chris Kirby from comment #17)
> I don't get the "internal server error" on an old ubuntu system (14.04 LTS)
> but I DO get it on kohadevbox with a Windows host and Debian Jessie guest.
> 
> On the Kohadevbox, Debian Jessie,
> koha-plack-err:
> Template process failed: undef error- The method pickup_location is not
> covered by tests! at /usr/share/koha/lib/C4/Templates.pm line 121.

Sent you a message on IRC!
Comment 25 Chris Kirby 2017-03-03 19:51:35 UTC
Hi Lari,
On my kohadevbox, I am still getting plack errors:
Template process failed: undef error - The method pickup_location is not covered by tests! at /usr/share/koha/lib/C4/Templates.pm line 121.

If there is something else you would like me to try testing for this, let me know.
Comment 26 Lari Taskula 2017-03-07 16:11:36 UTC
Created attachment 60878 [details] [review]
Bug 7534: Add new column "pickup_location" to branches

This patch adds a new column "pickup_location" for each library. This value
defines whether a library can be used as a pickup location or not.

For extended configurability, this flag could perhaps be considered as a part
of issuing rules, but as of now, this patch only offers a simple flag into
each library. This method also allows easy way for REST API to determine valid
pickup locations by querying the /libraries endpoint.

To test:
1. perl installer/data/mysql/updatedatabase.pl
2. Observe
DEV atomic update: bug_7534.perl
Upgrade to XXX done (Bug 7534 - Let libraries have configuration for pickup locations)

https://bugs.koha-community.org/show_bug.cgi?id=7354
Comment 27 Lari Taskula 2017-03-07 16:11:57 UTC
Created attachment 60879 [details] [review]
Bug 7534: Use search parameters for Koha::Template::Plugin::Branches->all

This lets us query libraries with additional search parameters and is useful
for this particular Bug by allowing us to select pickup locations.

Unit tests included.

To test:
1. prove t/db_dependent/Template/Plugin/Branches.t
Comment 28 Lari Taskula 2017-03-07 16:12:10 UTC
Created attachment 60880 [details] [review]
Bug 7534: Add configuration to admin/branches.pl

This patch adds a configuration option for pickup locations.

To test:
1. Apply patch
2. Go to cgi-bin/koha/admin/branches.pl
3. Observe there is a new column "Pickup location"
4. Click "Edit" for any library
5. Scroll to bottom of the page and select "No"
6. Click "Submit"
7. Observe your library in Libraries-table, notice the value of "Pickup location"
   has changed to "No"
Comment 29 Lari Taskula 2017-03-07 16:12:24 UTC
Created attachment 60881 [details] [review]
Bug 7534: Display pickup locations instead of all libraries in request.pl

This patch sets request.tt to use the list of pickup libraries instead
of every library in the system.

To test:
1. Go to cgi-bin/koha/admin/branches.pl
2. Configure one of your libraries to "Pickup location" => "No"
3. Go place a hold in intranet
4. See the provided "Pickup at" list
5. Observe the library that you configured is not present in the list
6. Place the hold
7. See list of existing holds on that biblio
8. See "Pickup library" column and observe your configured library is
   not included in the list
Comment 30 Lari Taskula 2017-03-07 16:12:40 UTC
Created attachment 60882 [details] [review]
Bug 7534: Display pickup locations instead of all libraries in opac-reserve.pl

This patch sets opac-reserve.tt to use the list of pickup libraries instead
of every library in the system.

To test:
1. Go to cgi-bin/koha/admin/branches.pl
2. Configure one of your libraries to "Pickup location" => "No"
3. Go to OPAC and place a hold
4. See the provided Pickup location list
5. Observe the library that you configured is not present in the list
Comment 31 Lari Taskula 2017-03-07 16:12:54 UTC
Created attachment 60883 [details] [review]
Bug 7534: (QA-follow-up) Default pickup location to Yes when adding a new library

To test:
1. Apply the patches before this one
2. Go to /cgi-bin/koha/admin/branches.pl
3. Press New library button
4. Scroll down the page and observe Pickup location defaults to No
5. Apply this patch
6. Go to /cgi-bin/koha/admin/branches.pl
7. Press New library button
8. Scroll down the page and observe Pickup location now defaults to Yes
Comment 32 Lari Taskula 2017-03-07 16:15:04 UTC
- Rebased on master
- Removed Koha::Template::Plugin::Branches->pickup_locations and replaced it by adding ability to use search parameters in all. The removed function is used in Bug 7614 and therefore should not be added in this bug yet.
- Fixed a bug, reported by Jonathan, when adding a new library the pickup location selection would default to "No".
Comment 33 Koha Team AMU 2017-03-07 17:11:43 UTC
Test on sandbox1 ByWater Solutions

This patch adds a configuration option for pickup locations.
To test:
1. Apply patch
2. Go to cgi-bin/koha/admin/branches.pl
3. Observe there is a new column "Pickup location"
4. Click "Edit" for any library
5. Scroll to bottom of the page and select "No"
6. Click "Submit"
7. Observe your library in Libraries-table, notice the value of "Pickup location"
   has changed to "No"
--> OK

This patch sets request.tt to use the list of pickup libraries instead
of every library in the system.
To test:
1. Go to cgi-bin/koha/admin/branches.pl
2. Configure one of your libraries to "Pickup location" => "No"
3. Go place a hold in intranet
4. See the provided "Pickup at" list
5. Observe the library that you configured is not present in the list
6. Place the hold
7. See list of existing holds on that biblio
8. See "Pickup library" column and observe your configured library is
   not included in the list
--> OK

This patch sets opac-reserve.tt to use the list of pickup libraries instead
of every library in the system.
To test:
1. Go to cgi-bin/koha/admin/branches.pl
2. Configure one of your libraries to "Pickup location" => "No"
3. Go to OPAC and place a hold
4. See the provided Pickup location list
5. Observe the library that you configured is not present in the list
--> OK

To test:
1. Apply the patches before this one
2. Go to /cgi-bin/koha/admin/branches.pl
3. Press New library button
4. Scroll down the page and observe Pickup location defaults to No
5. Apply this patch
6. Go to /cgi-bin/koha/admin/branches.pl
7. Press New library button
8. Scroll down the page and observe Pickup location now defaults to Yes
--> OK

I don't change status to signed off because I can't test on sandbox 2 elements :
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7534#c18
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7534#c19
Comment 34 Jonathan Druart 2017-03-07 19:49:00 UTC
(In reply to Koha Team AMU from comment #33)
> I don't change status to signed off because I can't test on sandbox 2
> elements :
> https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7534#c18

This is done automatically on a sandbox.

> https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7534#c19

This is for the QA step.

Go ahead :)
Comment 35 Koha Team AMU 2017-03-09 09:56:11 UTC
(In reply to Jonathan Druart from comment #34)
> (In reply to Koha Team AMU from comment #33)
> > I don't change status to signed off because I can't test on sandbox 2
> > elements :
> > https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7534#c18
> 
> This is done automatically on a sandbox.
> 
> > https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7534#c19
> 
> This is for the QA step.
> 
> Go ahead :)

Thank you very much for the explanations ! :-)

So, it works as expected and I change status to signed off ! :-)
Comment 36 Jonathan Druart 2017-03-13 13:32:16 UTC
Lari, I think we need a check server-side to make sure a patron will not inject a library that is not in the list.
Comment 37 Lari Taskula 2017-03-13 17:22:33 UTC
Created attachment 61044 [details] [review]
Bug 7534: Validate pickup location in CanBook/ItemBeReserved

This patch adds $branchcode_to parameter to CanBookBeReserved and
CanItemBeReserved. It represents the pickup location for the hold.

To test:
1. prove t/db_dependent/Holds.t
Comment 38 Lari Taskula 2017-03-13 17:22:54 UTC
Created attachment 61045 [details] [review]
Bug 7534: Check hold availability to desired pickup location in opac-reserve.pl

To test:
-1. Have access to your browser's developer tools in order to modify <select>
    dropdown values
1. Go to cgi-bin/koha/admin/branches.pl
2. Configure one of your libraries to "Pickup location" => "No". Remember the
   branchcode of this library!
3. Go place a hold in OPAC
4. See the provided "Pick up location" list
5. Observe the library that you configured is not present in the list
6. You should see another library selected by default. Right click that and
   in Firefox/Chrome click "Inspect element"
7. You should see a list of <option value="xxxx">blabla</option> elements
8. Double click between value (xxxx in above example) and replace the value
   with the branchcode you remember from step 2.
9. Place the hold
10. Observe that you are taken to cgi-bin/koha/opac-user.pl but your hold
    was not successful.
11. Go back to place a hold and this time do not modify any values.
12. Observe that a hold is now placed.
Comment 39 Lari Taskula 2017-03-13 17:24:43 UTC
(In reply to Jonathan Druart from comment #36)
> Lari, I think we need a check server-side to make sure a patron will not
> inject a library that is not in the list.

Agreed. This was done in Bug 7614, but as it should be already in this Bug, I took the patches from 7614 and rewrote them to be suitable in 7534.
Comment 40 Lari Taskula 2017-03-13 17:32:16 UTC
Created attachment 61046 [details] [review]
Bug 7534: Validate pickup location in CanBook/ItemBeReserved

This patch adds $branchcode_to parameter to CanBookBeReserved and
CanItemBeReserved. It represents the pickup location for the hold.

To test:
1. prove t/db_dependent/Holds.t
Comment 41 Lari Taskula 2017-03-13 17:32:30 UTC
Created attachment 61047 [details] [review]
Bug 7534: Check hold availability to desired pickup location in opac-reserve.pl

To test:
-1. Have access to your browser's developer tools in order to modify <select>
    dropdown values
1. Go to cgi-bin/koha/admin/branches.pl
2. Configure one of your libraries to "Pickup location" => "No". Remember the
   branchcode of this library!
3. Go place a hold in OPAC
4. See the provided "Pick up location" list
5. Observe the library that you configured is not present in the list
6. You should see another library selected by default. Right click that and
   in Firefox/Chrome click "Inspect element"
7. You should see a list of <option value="xxxx">blabla</option> elements
8. Double click between value (xxxx in above example) and replace the value
   with the branchcode you remember from step 2.
9. Place the hold
10. Observe that you are taken to cgi-bin/koha/opac-user.pl but your hold
    was not successful.
11. Go back to place a hold and this time do not modify any values.
12. Observe that a hold is now placed.
Comment 42 sandboxes@biblibre.com 2017-03-20 11:38:13 UTC
Patch tested with a sandbox, by Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 43 sandboxes@biblibre.com 2017-03-20 11:39:40 UTC
Created attachment 61273 [details] [review]
Bug 7534: Add new column "pickup_location" to branches

This patch adds a new column "pickup_location" for each library. This value
defines whether a library can be used as a pickup location or not.

For extended configurability, this flag could perhaps be considered as a part
of issuing rules, but as of now, this patch only offers a simple flag into
each library. This method also allows easy way for REST API to determine valid
pickup locations by querying the /libraries endpoint.

To test:
1. perl installer/data/mysql/updatedatabase.pl
2. Observe
DEV atomic update: bug_7534.perl
Upgrade to XXX done (Bug 7534 - Let libraries have configuration for pickup locations)

https://bugs.koha-community.org/show_bug.cgi?id=7354

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 44 sandboxes@biblibre.com 2017-03-20 11:39:44 UTC
Created attachment 61274 [details] [review]
Bug 7534: Use search parameters for Koha::Template::Plugin::Branches->all

This lets us query libraries with additional search parameters and is useful
for this particular Bug by allowing us to select pickup locations.

Unit tests included.

To test:
1. prove t/db_dependent/Template/Plugin/Branches.t

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 45 sandboxes@biblibre.com 2017-03-20 11:39:48 UTC
Created attachment 61275 [details] [review]
Bug 7534: Add configuration to admin/branches.pl

This patch adds a configuration option for pickup locations.

To test:
1. Apply patch
2. Go to cgi-bin/koha/admin/branches.pl
3. Observe there is a new column "Pickup location"
4. Click "Edit" for any library
5. Scroll to bottom of the page and select "No"
6. Click "Submit"
7. Observe your library in Libraries-table, notice the value of "Pickup location"
   has changed to "No"

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 46 sandboxes@biblibre.com 2017-03-20 11:39:51 UTC
Created attachment 61276 [details] [review]
Bug 7534: Display pickup locations instead of all libraries in request.pl

This patch sets request.tt to use the list of pickup libraries instead
of every library in the system.

To test:
1. Go to cgi-bin/koha/admin/branches.pl
2. Configure one of your libraries to "Pickup location" => "No"
3. Go place a hold in intranet
4. See the provided "Pickup at" list
5. Observe the library that you configured is not present in the list
6. Place the hold
7. See list of existing holds on that biblio
8. See "Pickup library" column and observe your configured library is
   not included in the list

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 47 sandboxes@biblibre.com 2017-03-20 11:39:55 UTC
Created attachment 61277 [details] [review]
Bug 7534: Display pickup locations instead of all libraries in opac-reserve.pl

This patch sets opac-reserve.tt to use the list of pickup libraries instead
of every library in the system.

To test:
1. Go to cgi-bin/koha/admin/branches.pl
2. Configure one of your libraries to "Pickup location" => "No"
3. Go to OPAC and place a hold
4. See the provided Pickup location list
5. Observe the library that you configured is not present in the list

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 48 sandboxes@biblibre.com 2017-03-20 11:39:58 UTC
Created attachment 61278 [details] [review]
Bug 7534: (QA-follow-up) Default pickup location to Yes when adding a new library

To test:
1. Apply the patches before this one
2. Go to /cgi-bin/koha/admin/branches.pl
3. Press New library button
4. Scroll down the page and observe Pickup location defaults to No
5. Apply this patch
6. Go to /cgi-bin/koha/admin/branches.pl
7. Press New library button
8. Scroll down the page and observe Pickup location now defaults to Yes

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 49 sandboxes@biblibre.com 2017-03-20 11:40:02 UTC
Created attachment 61279 [details] [review]
Bug 7534: Validate pickup location in CanBook/ItemBeReserved

This patch adds $branchcode_to parameter to CanBookBeReserved and
CanItemBeReserved. It represents the pickup location for the hold.

To test:
1. prove t/db_dependent/Holds.t

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 50 sandboxes@biblibre.com 2017-03-20 11:40:06 UTC
Created attachment 61280 [details] [review]
Bug 7534: Check hold availability to desired pickup location in opac-reserve.pl

To test:
-1. Have access to your browser's developer tools in order to modify <select>
    dropdown values
1. Go to cgi-bin/koha/admin/branches.pl
2. Configure one of your libraries to "Pickup location" => "No". Remember the
   branchcode of this library!
3. Go place a hold in OPAC
4. See the provided "Pick up location" list
5. Observe the library that you configured is not present in the list
6. You should see another library selected by default. Right click that and
   in Firefox/Chrome click "Inspect element"
7. You should see a list of <option value="xxxx">blabla</option> elements
8. Double click between value (xxxx in above example) and replace the value
   with the branchcode you remember from step 2.
9. Place the hold
10. Observe that you are taken to cgi-bin/koha/opac-user.pl but your hold
    was not successful.
11. Go back to place a hold and this time do not modify any values.
12. Observe that a hold is now placed.

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 51 Nick Clemens 2017-03-23 15:12:20 UTC
Works and tests pass

The updatedatabase patch has changes to the Schema files, these should be removed
Comment 52 Nick Clemens 2017-03-23 15:20:37 UTC
And minor:

CanBookBeReserved you say $branchcode
CanItemBeReseerved you say $branchcode_to

Second is more clear, but first is more standard
Comment 53 Kyle M Hall 2018-08-15 17:51:40 UTC
Created attachment 77847 [details] [review]
Bug 7534: Add new column "pickup_location" to branches

This patch adds a new column "pickup_location" for each library. This value
defines whether a library can be used as a pickup location or not.

For extended configurability, this flag could perhaps be considered as a part
of issuing rules, but as of now, this patch only offers a simple flag into
each library. This method also allows easy way for REST API to determine valid
pickup locations by querying the /libraries endpoint.

To test:
1. perl installer/data/mysql/updatedatabase.pl
2. Observe
DEV atomic update: bug_7534.perl
Upgrade to XXX done (Bug 7534 - Let libraries have configuration for pickup locations)

https://bugs.koha-community.org/show_bug.cgi?id=7354

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 54 Kyle M Hall 2018-08-15 17:51:53 UTC
Created attachment 77848 [details] [review]
Bug 7534: Use search parameters for Koha::Template::Plugin::Branches->all

This lets us query libraries with additional search parameters and is useful
for this particular Bug by allowing us to select pickup locations.

Unit tests included.

To test:
1. prove t/db_dependent/Template/Plugin/Branches.t

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 55 Kyle M Hall 2018-08-15 17:51:58 UTC
Created attachment 77849 [details] [review]
Bug 7534: Add configuration to admin/branches.pl

This patch adds a configuration option for pickup locations.

To test:
1. Apply patch
2. Go to cgi-bin/koha/admin/branches.pl
3. Observe there is a new column "Pickup location"
4. Click "Edit" for any library
5. Scroll to bottom of the page and select "No"
6. Click "Submit"
7. Observe your library in Libraries-table, notice the value of "Pickup location"
   has changed to "No"

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 56 Kyle M Hall 2018-08-15 17:52:03 UTC
Created attachment 77850 [details] [review]
Bug 7534: Display pickup locations instead of all libraries in request.pl

This patch sets request.tt to use the list of pickup libraries instead
of every library in the system.

To test:
1. Go to cgi-bin/koha/admin/branches.pl
2. Configure one of your libraries to "Pickup location" => "No"
3. Go place a hold in intranet
4. See the provided "Pickup at" list
5. Observe the library that you configured is not present in the list
6. Place the hold
7. See list of existing holds on that biblio
8. See "Pickup library" column and observe your configured library is
   not included in the list

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 57 Kyle M Hall 2018-08-15 17:52:08 UTC
Created attachment 77851 [details] [review]
Bug 7534: Display pickup locations instead of all libraries in opac-reserve.pl

This patch sets opac-reserve.tt to use the list of pickup libraries instead
of every library in the system.

To test:
1. Go to cgi-bin/koha/admin/branches.pl
2. Configure one of your libraries to "Pickup location" => "No"
3. Go to OPAC and place a hold
4. See the provided Pickup location list
5. Observe the library that you configured is not present in the list

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 58 Kyle M Hall 2018-08-15 17:52:13 UTC
Created attachment 77852 [details] [review]
Bug 7534: (QA-follow-up) Default pickup location to Yes when adding a new library

To test:
1. Apply the patches before this one
2. Go to /cgi-bin/koha/admin/branches.pl
3. Press New library button
4. Scroll down the page and observe Pickup location defaults to No
5. Apply this patch
6. Go to /cgi-bin/koha/admin/branches.pl
7. Press New library button
8. Scroll down the page and observe Pickup location now defaults to Yes

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 59 Kyle M Hall 2018-08-15 17:52:18 UTC
Created attachment 77853 [details] [review]
Bug 7534: Validate pickup location in CanBook/ItemBeReserved

This patch adds $branchcode_to parameter to CanBookBeReserved and
CanItemBeReserved. It represents the pickup location for the hold.

To test:
1. prove t/db_dependent/Holds.t

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 60 Kyle M Hall 2018-08-15 17:52:22 UTC
Created attachment 77854 [details] [review]
Bug 7534: Check hold availability to desired pickup location in opac-reserve.pl

To test:
-1. Have access to your browser's developer tools in order to modify <select>
    dropdown values
1. Go to cgi-bin/koha/admin/branches.pl
2. Configure one of your libraries to "Pickup location" => "No". Remember the
   branchcode of this library!
3. Go place a hold in OPAC
4. See the provided "Pick up location" list
5. Observe the library that you configured is not present in the list
6. You should see another library selected by default. Right click that and
   in Firefox/Chrome click "Inspect element"
7. You should see a list of <option value="xxxx">blabla</option> elements
8. Double click between value (xxxx in above example) and replace the value
   with the branchcode you remember from step 2.
9. Place the hold
10. Observe that you are taken to cgi-bin/koha/opac-user.pl but your hold
    was not successful.
11. Go back to place a hold and this time do not modify any values.
12. Observe that a hold is now placed.

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 61 Kyle M Hall 2018-08-15 17:52:27 UTC
Created attachment 77855 [details] [review]
Bug 7534: Fix number of tests for Holds.t
Comment 62 Kyle M Hall 2018-08-15 17:52:31 UTC
Created attachment 77856 [details] [review]
Bug 7534: Disambiguate branchcode parameter, make it match between subroutines
Comment 63 Nick Clemens 2018-08-25 19:07:38 UTC
Created attachment 78160 [details] [review]
Bug 7534: Add new column "pickup_location" to branches

This patch adds a new column "pickup_location" for each library. This value
defines whether a library can be used as a pickup location or not.

For extended configurability, this flag could perhaps be considered as a part
of issuing rules, but as of now, this patch only offers a simple flag into
each library. This method also allows easy way for REST API to determine valid
pickup locations by querying the /libraries endpoint.

To test:
1. perl installer/data/mysql/updatedatabase.pl
2. Observe
DEV atomic update: bug_7534.perl
Upgrade to XXX done (Bug 7534 - Let libraries have configuration for pickup locations)

https://bugs.koha-community.org/show_bug.cgi?id=7354

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 64 Nick Clemens 2018-08-25 19:08:03 UTC
Created attachment 78161 [details] [review]
Bug 7534: Add new column "pickup_location" to branches

This patch adds a new column "pickup_location" for each library. This value
defines whether a library can be used as a pickup location or not.

For extended configurability, this flag could perhaps be considered as a part
of issuing rules, but as of now, this patch only offers a simple flag into
each library. This method also allows easy way for REST API to determine valid
pickup locations by querying the /libraries endpoint.

To test:
1. perl installer/data/mysql/updatedatabase.pl
2. Observe
DEV atomic update: bug_7534.perl
Upgrade to XXX done (Bug 7534 - Let libraries have configuration for pickup locations)

https://bugs.koha-community.org/show_bug.cgi?id=7354

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 65 Nick Clemens 2018-08-25 19:08:08 UTC
Created attachment 78162 [details] [review]
Bug 7534: Use search parameters for Koha::Template::Plugin::Branches->all

This lets us query libraries with additional search parameters and is useful
for this particular Bug by allowing us to select pickup locations.

Unit tests included.

To test:
1. prove t/db_dependent/Template/Plugin/Branches.t

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 66 Nick Clemens 2018-08-25 19:08:14 UTC
Created attachment 78163 [details] [review]
Bug 7534: Add configuration to admin/branches.pl

This patch adds a configuration option for pickup locations.

To test:
1. Apply patch
2. Go to cgi-bin/koha/admin/branches.pl
3. Observe there is a new column "Pickup location"
4. Click "Edit" for any library
5. Scroll to bottom of the page and select "No"
6. Click "Submit"
7. Observe your library in Libraries-table, notice the value of "Pickup location"
   has changed to "No"

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 67 Nick Clemens 2018-08-25 19:08:19 UTC
Created attachment 78164 [details] [review]
Bug 7534: Display pickup locations instead of all libraries in request.pl

This patch sets request.tt to use the list of pickup libraries instead
of every library in the system.

To test:
1. Go to cgi-bin/koha/admin/branches.pl
2. Configure one of your libraries to "Pickup location" => "No"
3. Go place a hold in intranet
4. See the provided "Pickup at" list
5. Observe the library that you configured is not present in the list
6. Place the hold
7. See list of existing holds on that biblio
8. See "Pickup library" column and observe your configured library is
   not included in the list

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 68 Nick Clemens 2018-08-25 19:08:24 UTC
Created attachment 78165 [details] [review]
Bug 7534: Display pickup locations instead of all libraries in opac-reserve.pl

This patch sets opac-reserve.tt to use the list of pickup libraries instead
of every library in the system.

To test:
1. Go to cgi-bin/koha/admin/branches.pl
2. Configure one of your libraries to "Pickup location" => "No"
3. Go to OPAC and place a hold
4. See the provided Pickup location list
5. Observe the library that you configured is not present in the list

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 69 Nick Clemens 2018-08-25 19:08:29 UTC
Created attachment 78166 [details] [review]
Bug 7534: (QA-follow-up) Default pickup location to Yes when adding a new library

To test:
1. Apply the patches before this one
2. Go to /cgi-bin/koha/admin/branches.pl
3. Press New library button
4. Scroll down the page and observe Pickup location defaults to No
5. Apply this patch
6. Go to /cgi-bin/koha/admin/branches.pl
7. Press New library button
8. Scroll down the page and observe Pickup location now defaults to Yes

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 70 Nick Clemens 2018-08-25 19:08:34 UTC
Created attachment 78167 [details] [review]
Bug 7534: Validate pickup location in CanBook/ItemBeReserved

This patch adds $branchcode_to parameter to CanBookBeReserved and
CanItemBeReserved. It represents the pickup location for the hold.

To test:
1. prove t/db_dependent/Holds.t

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 71 Nick Clemens 2018-08-25 19:08:39 UTC
Created attachment 78168 [details] [review]
Bug 7534: Check hold availability to desired pickup location in opac-reserve.pl

To test:
-1. Have access to your browser's developer tools in order to modify <select>
    dropdown values
1. Go to cgi-bin/koha/admin/branches.pl
2. Configure one of your libraries to "Pickup location" => "No". Remember the
   branchcode of this library!
3. Go place a hold in OPAC
4. See the provided "Pick up location" list
5. Observe the library that you configured is not present in the list
6. You should see another library selected by default. Right click that and
   in Firefox/Chrome click "Inspect element"
7. You should see a list of <option value="xxxx">blabla</option> elements
8. Double click between value (xxxx in above example) and replace the value
   with the branchcode you remember from step 2.
9. Place the hold
10. Observe that you are taken to cgi-bin/koha/opac-user.pl but your hold
    was not successful.
11. Go back to place a hold and this time do not modify any values.
12. Observe that a hold is now placed.

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 72 Nick Clemens 2018-08-25 19:08:44 UTC
Created attachment 78169 [details] [review]
Bug 7534: Fix number of tests for Holds.t
Comment 73 Nick Clemens 2018-08-25 19:08:49 UTC
Created attachment 78170 [details] [review]
Bug 7534: Disambiguate branchcode parameter, make it match between subroutines
Comment 74 Nick Clemens 2018-08-25 19:08:53 UTC
Created attachment 78171 [details] [review]
Bug 7534: (RM follow-up) Fix tests and adjust after bug 15524
Comment 75 Nick Clemens 2018-08-25 19:11:28 UTC
In testing I set the users branch to 'no' for pickup_location

I found the user could then not place any holds in the opac.

I am wondering if the call to 'CanBookBeReserved' in opac-reserve.pl should include banchcode or not? It seems even if the pickup location is not allowed the borrower should be able to pickup holds elsewhere.

Rebased and adjusted on top of 15524, please take a look as well and let me know if all makes sense.
Comment 76 Kyle M Hall 2018-09-06 13:46:22 UTC
Created attachment 78477 [details] [review]
Bug 7534: Add new column "pickup_location" to branches

This patch adds a new column "pickup_location" for each library. This value
defines whether a library can be used as a pickup location or not.

For extended configurability, this flag could perhaps be considered as a part
of issuing rules, but as of now, this patch only offers a simple flag into
each library. This method also allows easy way for REST API to determine valid
pickup locations by querying the /libraries endpoint.

To test:
1. perl installer/data/mysql/updatedatabase.pl
2. Observe
DEV atomic update: bug_7534.perl
Upgrade to XXX done (Bug 7534 - Let libraries have configuration for pickup locations)

https://bugs.koha-community.org/show_bug.cgi?id=7354

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 77 Kyle M Hall 2018-09-06 13:46:35 UTC
Created attachment 78478 [details] [review]
Bug 7534: Use search parameters for Koha::Template::Plugin::Branches->all

This lets us query libraries with additional search parameters and is useful
for this particular Bug by allowing us to select pickup locations.

Unit tests included.

To test:
1. prove t/db_dependent/Template/Plugin/Branches.t

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 78 Kyle M Hall 2018-09-06 13:46:41 UTC
Created attachment 78479 [details] [review]
Bug 7534: Add configuration to admin/branches.pl

This patch adds a configuration option for pickup locations.

To test:
1. Apply patch
2. Go to cgi-bin/koha/admin/branches.pl
3. Observe there is a new column "Pickup location"
4. Click "Edit" for any library
5. Scroll to bottom of the page and select "No"
6. Click "Submit"
7. Observe your library in Libraries-table, notice the value of "Pickup location"
   has changed to "No"

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 79 Kyle M Hall 2018-09-06 13:46:46 UTC
Created attachment 78480 [details] [review]
Bug 7534: Display pickup locations instead of all libraries in request.pl

This patch sets request.tt to use the list of pickup libraries instead
of every library in the system.

To test:
1. Go to cgi-bin/koha/admin/branches.pl
2. Configure one of your libraries to "Pickup location" => "No"
3. Go place a hold in intranet
4. See the provided "Pickup at" list
5. Observe the library that you configured is not present in the list
6. Place the hold
7. See list of existing holds on that biblio
8. See "Pickup library" column and observe your configured library is
   not included in the list

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 80 Kyle M Hall 2018-09-06 13:46:53 UTC
Created attachment 78481 [details] [review]
Bug 7534: Display pickup locations instead of all libraries in opac-reserve.pl

This patch sets opac-reserve.tt to use the list of pickup libraries instead
of every library in the system.

To test:
1. Go to cgi-bin/koha/admin/branches.pl
2. Configure one of your libraries to "Pickup location" => "No"
3. Go to OPAC and place a hold
4. See the provided Pickup location list
5. Observe the library that you configured is not present in the list

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 81 Kyle M Hall 2018-09-06 13:46:58 UTC
Created attachment 78482 [details] [review]
Bug 7534: (QA-follow-up) Default pickup location to Yes when adding a new library

To test:
1. Apply the patches before this one
2. Go to /cgi-bin/koha/admin/branches.pl
3. Press New library button
4. Scroll down the page and observe Pickup location defaults to No
5. Apply this patch
6. Go to /cgi-bin/koha/admin/branches.pl
7. Press New library button
8. Scroll down the page and observe Pickup location now defaults to Yes

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 82 Kyle M Hall 2018-09-06 13:47:05 UTC
Created attachment 78483 [details] [review]
Bug 7534: Validate pickup location in CanBook/ItemBeReserved

This patch adds $branchcode_to parameter to CanBookBeReserved and
CanItemBeReserved. It represents the pickup location for the hold.

To test:
1. prove t/db_dependent/Holds.t

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 83 Kyle M Hall 2018-09-06 13:47:10 UTC
Created attachment 78484 [details] [review]
Bug 7534: Check hold availability to desired pickup location in opac-reserve.pl

To test:
-1. Have access to your browser's developer tools in order to modify <select>
    dropdown values
1. Go to cgi-bin/koha/admin/branches.pl
2. Configure one of your libraries to "Pickup location" => "No". Remember the
   branchcode of this library!
3. Go place a hold in OPAC
4. See the provided "Pick up location" list
5. Observe the library that you configured is not present in the list
6. You should see another library selected by default. Right click that and
   in Firefox/Chrome click "Inspect element"
7. You should see a list of <option value="xxxx">blabla</option> elements
8. Double click between value (xxxx in above example) and replace the value
   with the branchcode you remember from step 2.
9. Place the hold
10. Observe that you are taken to cgi-bin/koha/opac-user.pl but your hold
    was not successful.
11. Go back to place a hold and this time do not modify any values.
12. Observe that a hold is now placed.

Signed-off-by: Koha Team AMU <axelle.clarisse@univ-amu.fr>
Comment 84 Kyle M Hall 2018-09-06 13:47:15 UTC
Created attachment 78485 [details] [review]
Bug 7534: Fix number of tests for Holds.t
Comment 85 Kyle M Hall 2018-09-06 13:47:20 UTC
Created attachment 78486 [details] [review]
Bug 7534: Disambiguate branchcode parameter, make it match between subroutines
Comment 86 Kyle M Hall 2018-09-06 13:47:25 UTC
Created attachment 78487 [details] [review]
Bug 7534: (RM follow-up) Fix tests and adjust after bug 15524
Comment 87 Kyle M Hall 2018-09-06 13:47:30 UTC
Created attachment 78488 [details] [review]
Bug 7534 [QA Followup]: Don't do pickup branch checking for determining holdability in the OPAC
Comment 88 Kyle M Hall 2018-09-06 13:50:57 UTC
Created attachment 78489 [details] [review]
Bug 7534 [QA Followup]: Don't do pickup branch checking for determining holdability in the OPAC
Comment 89 Nick Clemens 2018-09-06 17:39:05 UTC
Awesome work all! 

Pushed to master for 18.11
Comment 90 Nick Clemens 2018-09-06 19:05:07 UTC
Created attachment 78495 [details] [review]
Bug 7534: (RM follow-up) Fix TT syntax
Comment 91 Nick Clemens 2018-09-07 16:06:30 UTC
(In reply to Nick Clemens from comment #90)
> Created attachment 78495 [details] [review] [review]
> Bug 7534: (RM follow-up) Fix TT syntax

Followup pushed to master
Comment 92 Kyle M Hall 2018-09-07 18:28:56 UTC
Created attachment 78540 [details] [review]
Bug 7534: (QA followup) Disable priority pulldowns when using split holds queue
Comment 93 Martin Renvoize 2018-09-10 17:27:55 UTC
Enhancement, will not be backported to 18.05.x series.
Comment 94 Jonathan Druart 2018-09-10 20:46:01 UTC
Created attachment 78548 [details] [review]
Bug 7534: (QA follow-up) Use Koha.Preference template plugin to fetch the pref's value

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 95 Nick Clemens 2018-09-14 20:01:22 UTC
(In reply to Jonathan Druart from comment #94)
> Created attachment 78548 [details] [review] [review]
> Bug 7534: (QA follow-up) Use Koha.Preference template plugin to fetch the
> pref's value
> 
> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Follow-up pushed to master, thanks Jonathan!
Comment 96 Kyle M Hall 2019-02-07 16:20:54 UTC
Created attachment 84852 [details] [review]
Bug 7534: (QA Follow-up) Fix the return value for the new format, it should be a hashref, not a string