Bugzilla – Attachment 165358 Details for
Bug 30123
On set library page, desk always defaults to last in list instead of desk user is signed in at
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30123: Set desk default to logged-in-desk-id on sety library page
Bug-30123-Set-desk-default-to-logged-in-desk-id-on.patch (text/plain), 4.16 KB, created by
Martin Renvoize (ashimema)
on 2024-04-23 08:54:06 UTC
(
hide
)
Description:
Bug 30123: Set desk default to logged-in-desk-id on sety library page
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-04-23 08:54:06 UTC
Size:
4.16 KB
patch
obsolete
>From 1899bac24a7db16697b4577f1716b83d58893ffd Mon Sep 17 00:00:00 2001 >From: Brendan Lawlor <blawlor@clamsnet.org> >Date: Mon, 22 Apr 2024 16:50:59 +0000 >Subject: [PATCH] Bug 30123: Set desk default to logged-in-desk-id on sety > library page > >This patch refactors the javascript that runs on the set library page. If the logged in user branch code is the same as the seleceted library, default the desk selection to the current logged in desk id. Otherwise set the default desk selection to the first option for the current branch. > >Test plan: > >1. Turn on UseCirculationDesks >2. Create a few desks with unique names for a few different libraries >3. Set your library and desk >4. Reload set-library.pl and notice that the desk always defaults to the last option for the library selected >5. Apply patch and restart_all >6. Reload set-library.pl and notice that the desk selection defaults to your current logged in desk >7. Try changing the library selection to libraries with and without desks >8. Notice that the desk selection defaults to the first option available for the selected library >9. Notice that the desk selection defaults to the --- no desk for libraries without desks >10. Notice the desk selection defaults to the currenty logged in desk if you select the library you are currently logged into > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../prog/en/includes/html_helpers.inc | 2 +- > .../intranet-tmpl/prog/js/desk_selection.js | 27 +++++-------------- > 2 files changed, 8 insertions(+), 21 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc >index 6830e06dc78..5b514f5736e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc >@@ -18,7 +18,7 @@ > <option class="[% d.branchcode | html %]" value="[% d.desk_id | html %]" >[% d.desk_name | html %]</option> > [% END %] > [% ELSE %] >- <option class="[% d.branchcode | html %]" value="[% d.desk_id | html %]" disabled hidden>[% d.desk_name | html %]</option> >+ <option class="[% d.branchcode | html %]" value="[% d.desk_id | html %]" disabled style="display: none">[% d.desk_name | html %]</option> > [% END %] > [% END %] > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/desk_selection.js b/koha-tmpl/intranet-tmpl/prog/js/desk_selection.js >index ab42768d136..2b58e367b0b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/desk_selection.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/desk_selection.js >@@ -1,22 +1,4 @@ > $(document).ready(function() { >- $("#desk_id").children().each(function() { >- var selectedBranch = $("#branch"). children("option:selected"). val(); >- if ($(this).attr('id') === "nodesk") { //set no desk by default, should be first element >- $(this).prop("selected", true); >- $(this).prop("disabled", false); >- $(this).show(); >- } >- else if ($(this).hasClass(selectedBranch)) { >- $('#nodesk').prop("disabled", true); // we have desk, no need for nodesk option >- $('#nodesk').hide(); >- $(this).prop("disabled", false); >- $(this).show(); >- $(this).prop("selected", true) >- } else { >- $(this).prop("disabled", true); >- $(this).hide(); >- } >- }); > > $("#branch").on("change", function() { > >@@ -32,11 +14,16 @@ $(document).ready(function() { > $('#nodesk').hide(); > $(this).prop("disabled", false); > $(this).show(); >- $(this).prop("selected", true) >+ if ( selectedBranch == $(".logged-in-branch-code").html() ) { >+ $("#desk_id").val($(".logged-in-desk-id").html()); >+ } >+ else { >+ $("#desk_id").val($("#desk_id option:not([disabled]):first").val()); >+ } > } else { > $(this).prop("disabled", true); > $(this).hide(); > } > }); > }); >-}) ; >+}); >\ No newline at end of file >-- >2.44.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30123
:
164389
|
164390
|
164846
|
165331
|
165339
| 165358