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

--- Comment #5 from Brendan Lawlor <[email protected]> ---
(In reply to Lucas Gass from comment #4)

These are some heavy questions so I'm in a little over my head but I'll try.

> 1. Do we need all this JavaScript in desk_selection.js? Can't we just use
> what is already in set-library.tt?
> 
> [% PROCESS options_for_desks desks => Desks.all(), selected => desk_id  %]

Maybe the javascript could be reduced, but as is I think it's required for this
behavior. The template renders an option element for each desk and just sets
properties to selected, hidden and disabled. The javascript listens for the
user to change the set library selection and then updates hidden and disabled
properties on the options to basically filter the list. You can see how PROCESS
options_for_desks creates all the options in html_helpers.inc

I guess it might be possible to reduce the javascript here if set-library.pl
was reloaded every time the set library selection is changed. I'm not sure how
Koha usually handles this sort of thing, but I'm interested in learning.


> 2. Are there any circumstances where a user should be able to unset their
> desk?

This is a quirk that may also need to be addressed. The current behavior is
that once a desk is set, it can't be unset to No desk. The javascript currently
hides/disables the no desk <option id="nodesk" value="">---</option> when a
library has desks, so it forces the user to select a desk. But if you change
the javascript and submit the form with the desk value '' the page just reloads
but nothing happens. I think there needs to be an update to set-library.pl to
handle that no desk value as an update.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to