[Koha-bugs] [Bug 24201] Attach desk to intranet session

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Apr 30 15:26:50 CEST 2020


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

--- Comment #37 from Josef Moravec <josef.moravec at gmail.com> ---
Comment on attachment 103840
  --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=103840
Bug 24201: (follow-up) add desk choice with library choice

Review of attachment 103840:
 --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=24201&attachment=103840)
-----------------------------------------------------------------

::: Koha/Template/Plugin/Desks.pm
@@ +95,5 @@
> +    for my $d ( @$desks ) {
> +        if (       defined $selected and $d->{desk_id} eq $selected
> +                   or not defined $selected and C4::Context->userenv and $d->{branchcode} eq ( C4::Context->userenv->{desk_id} // q{} )
> +            ) {
> +            $d->{selected} = 1;

You don't need selected here.

You can just return Koha::Desks->search();

::: koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc
@@ +138,5 @@
>      </script>
>  [% END %]
> +
> +[% IF setdesk %]
> +    <script  type="text/javascript">

do not use type attribute, see
https://wiki.koha-community.org/wiki/Coding_Guidelines#JS1:_Embedding_JavaScript_blocks_in_templates

Also, there is no need to have to have javascript code in template (you don't
need template toolkit inside js code), so the code should be in js file and
included using Asset template plugin

::: koha-tmpl/intranet-tmpl/prog/en/modules/circ/set-library.tt
@@ +78,5 @@
> +    <legend>Set Desk</legend>
> +    <ol>
> +        <li><label for="desk">Choose Desk:</label>
> +        <select name="desk_id" id="desk_id">
> +            [% PROCESS options_for_desks libraries => Branches.all( selected => branch ), desks => Desks.all( selected => desk_id ) %]

you pass the libraries variable to options_for_desks block, but not use it in
the block itself

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list