Bug 11676 - Loading shelving locations based on the item's homebranch instead of the user's logged-in branch.
Summary: Loading shelving locations based on the item's homebranch instead of the user...
Status: Patch doesn't apply
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Olli-Antti Kivilahti
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-04 11:37 UTC by Olli-Antti Kivilahti
Modified: 2015-04-04 21:39 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 11676 - Loading shelving locations based on the item's homebranch instead of the user's logged-in branch. For pageload. (5.89 KB, patch)
2014-02-04 17:41 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
Bug 11676 - Loading shelving locations based on the item's homebranch instead of the user's logged-in branch. Svc AJAX-wrapper. (2.56 KB, patch)
2014-02-04 17:41 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
Bug 11676 - Loading shelving locations based on the item's homebranch instead of the user's logged-in branch. Javascript bits. (2.09 KB, patch)
2014-02-04 17:41 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
Bug 11676 - Loading shelving locations based on the item's homebranch instead of the user's logged-in branch. For pageload. (6.51 KB, patch)
2014-02-05 16:32 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
Bug 11676 - Loading shelving locations based on the item's homebranch instead of the user's logged-in branch. Svc AJAX-wrapper. (2.56 KB, patch)
2014-02-05 16:33 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
Bug 11676 - Loading shelving locations based on the item's homebranch instead of the user's logged-in branch. Javascript bits. (3.53 KB, patch)
2014-02-05 16:33 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
Bug 11676 - Loading shelving locations based on the item's homebranch instead of the user's logged-in branch. Svc AJAX-wrapper. (2.48 KB, patch)
2014-02-05 18:02 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
C4::Auth.pm Documentation improvement (1.12 KB, patch)
2014-02-05 18:05 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
Bug 11676 - Loading shelving locations based on stuff. For acquisitions. Found out that there is another way of adding items, which has a different mechanism (datatables yay) of addition, so this feature enables shelving location updating in the newordere (11.34 KB, patch)
2014-04-03 14:52 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
Bug 11676 - Loading shelving locations based on stuff. For acquisitions. Found out that there is another way of adding items, which has a different mechanism (datatables yay) of addition, so this feature enables shelving location updating in the newordere (14.19 KB, patch)
2014-04-10 08:05 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Olli-Antti Kivilahti 2014-02-04 11:37:45 UTC
------------
- SYNOPSIS -
------------
When editing items, the shelving locations list does not reflect the shelving locations available for the home branch of the editable item?
So if you are editing an item in another branch than the item's homebranch, you have a set of different/wrong shelving locations for the item you are editing, based on the branch where you are logged into, not the item you are editing.
This is problematic when we receive and catalog items centrally and then transport them to other libraries.
Changing the item editing behaviour to get the available shelving locations based on the item's homebranch instead of the users logged in library.

----------
- DESIGN -
----------
-When loading the koha/cataloguing/additem.pl?op=edititem, check if the item's homebranch exists and load the available shelving locations for the homebranch.
-After changing "Permanent location", load new shelving locations based on the homebranch using an AJAX query.
---Only touch the <option value="CART">Book Cart</option> elements to be as
   unintrusive as possible.
-When javascript is disabled, this feature only loads the available shelving locations on page load.

-----------------
- IN DISCUSSION -
-----------------
-Can this feature be on by default or do we need Yet.Another.System.Preference?
Comment 1 Olli-Antti Kivilahti 2014-02-04 17:41:19 UTC Comment hidden (obsolete)
Comment 2 Olli-Antti Kivilahti 2014-02-04 17:41:40 UTC Comment hidden (obsolete)
Comment 3 Olli-Antti Kivilahti 2014-02-04 17:41:50 UTC Comment hidden (obsolete)
Comment 4 Olli-Antti Kivilahti 2014-02-05 16:32:52 UTC
Created attachment 25060 [details] [review]
Bug 11676 - Loading shelving locations based on the item's homebranch instead of the user's logged-in branch. For pageload.

-Modifies the Koha::GetAuthorisedValues() to support passing a branchcode as a parameter
-Modifies cataloguing/additem.pl to find the items.homebranch and pass this to the
  GetAuthorisedValues().

-------------
- TEST PLAN -
-------------

1. Define shelving locations for a specific branch:
   Go to Administration -> Authorised values -> category: LOC,
   Add a new value X specific to branch A,
   Add a new value Y specific to branch B.
2. Set your logged in library to branch C.
3. Edit an item. Set the Permanent location to branch A. Save the item.
4. Edit the item. Shelving locations has location X selectable in addition to the default
   ones. Set the Permanent location to branch B. Save the item.
5. Edit the item. Shelving locations has location Y selectable in addition to the default
   ones. Set the Permanent location to branch C. Save the item.
6. Edit the item. Shelving locations has neither Y or X selectable. Don't save.
7. Set your logged in branch to A.
8. Edit the item. Shelving locations has neither Y or X selectable. Don't save.

This is how we do it!
Comment 5 Olli-Antti Kivilahti 2014-02-05 16:33:25 UTC Comment hidden (obsolete)
Comment 6 Olli-Antti Kivilahti 2014-02-05 16:33:44 UTC
Created attachment 25062 [details] [review]
Bug 11676 - Loading shelving locations based on the item's homebranch instead of the user's logged-in branch. Javascript bits.

Makes the Shelving locations automatically refresh when the "Permanent location" (homebranch)
changes.
Comment 7 Olli-Antti Kivilahti 2014-02-05 18:02:57 UTC
Created attachment 25064 [details] [review]
Bug 11676 - Loading shelving locations based on the item's homebranch instead of the user's logged-in branch. Svc AJAX-wrapper.

This patch provides a HTTP-interface for the C4::Koha::GetAuthorisedValues() using the
existing svc web interface.
Comment 8 Olli-Antti Kivilahti 2014-02-05 18:05:45 UTC
Created attachment 25065 [details] [review]
C4::Auth.pm Documentation improvement

check_cookie_auth() didn't describe the content and how to use the permissions hash
and I had to rummage through code to figure out how the flags are properly passed.

I hope this will help the next one not to take that hit.
Comment 9 Olli-Antti Kivilahti 2014-04-03 14:52:31 UTC
Created attachment 26796 [details] [review]
Bug 11676 - Loading shelving locations based on stuff. For acquisitions. Found out that there is another way of adding items, which has a different mechanism (datatables yay) of addition, so this feature enables shelving location updating in the newordere

Centralized the shelving location fetching code (to koha-to-marc-mapping-api.js)
to have a central place to share related features.

-------------
- TEST PLAN -
-------------
Same as in the first patch, but this time use the neworderempty.pl-script.
Comment 10 Olli-Antti Kivilahti 2014-04-10 08:05:39 UTC
Created attachment 26965 [details] [review]
Bug 11676 - Loading shelving locations based on stuff. For acquisitions. Found out that there is another way of adding items, which has a different mechanism (datatables yay) of addition, so this feature enables shelving location updating in the newordere

Centralized the shelving location fetching code (to koha-to-marc-mapping-api.js)
to have a central place to share related features.

-------------
- TEST PLAN -
-------------
Same as in the first patch, but this time use the neworderempty.pl-script.
Comment 11 Owen Leonard 2014-04-22 13:16:20 UTC
This patch doesn't apply with git-bz. I'm not sure if it's a simple conflict or perhaps the patches are out of order?

fatal: sha1 information is lacking or useless (koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Comment 12 Mark Tompsett 2015-04-04 21:39:39 UTC
This still doesn't apply, and it is worse now. You would think that someone would have hash referenced the parameters for generate_subfield_form when they added $restrictededition. *sigh*