[Koha-bugs] [Bug 24412] Attach waiting reserve to desk

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Apr 23 10:43:08 CEST 2020


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

--- Comment #28 from Josef Moravec <josef.moravec at gmail.com> ---
Comment on attachment 101957
  --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=101957
Bug 24412: Attach waiting reserve to desk

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

::: Koha/Hold.pm
@@ +173,3 @@
>      };
>  
> +    if (defined $desk_id) { $values->{'desk_id'} = $desk_id };

the desk_id => $desk_id, setting in values above should be omitted, only the
one in if should stay

@@ +323,5 @@
> +    my ($self) = @_;
> +
> +    $self->{_desk} ||= Koha::Desks->find( $self->desk_id() );
> +
> +    return $self->{_desk};

You should use relation and _new_from_dbic here, see
https://wiki.koha-community.org/wiki/Coding_Guidelines#PERL15:_Object-oriented_code_and_the_Koha::_namespace_.5BPROPOSAL_FOR_CHANGE_dev_meeting_2.2F2020.5D

::: Koha/Template/Plugin/Desks.pm
@@ +47,5 @@
> +
> +sub GetName {
> +    my ( $self, $desk_id ) = @_;
> +    my $d = Koha::Desks->find( $desk_id );
> +    return (defined $d) ? $d->unblessed->{'desk_name'} : q{};

should be something like:

return $d ? $d->desk_name : q{};

::: koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc
@@ +120,4 @@
>                  [% IF ( hold.found ) %]
>                      [% IF ( hold.atdestination ) %]
>                          [% IF ( hold.found ) %]
> +                            Item waiting at <b> [% hold.wbrname | html %]</b>[% IF hold.desk_name %], [% hold.desk_name | html %],[% END %] <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" /> since [% hold.waiting_date | $KohaDates %]

Looks like you  don't need to use Desks template plugin.

::: koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
@@ +381,4 @@
>                          [% SET hold = item.first_hold %]
>                          [% IF hold %]
>                              [% IF hold.waitingdate %]
> +                                Waiting at [% Branches.GetName( hold.branchcode ) | html %][% IF ( hold.desk_id ) %], [% Desks.GetName ( hold.desk_id ) | html %][% END %] since [% hold.waitingdate | $KohaDates %].

you don't new Desks template plugin, just use hold.desk.desk_name

::: koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt
@@ +468,4 @@
>  
>                                                  <div class="modal-footer">
>                                                      <input type="hidden" name="cancel_reserve" value="0" />
> +                                                       <button type="submit" class="btn btn-default approve" [% IF (Desks.defined) %]data-dismiss="modal" [% END %]>

Will need update as Desks.defined was removed in previous patches on bug 24201

::: koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc
@@ +106,4 @@
>                                  <i class="fa fa-exclamation-circle text-warning"></i>
>                                  [% IF ( HOLD.is_at_destination ) %]
>                                      [% IF ( HOLD.found ) %]
> +                                        Item waiting at <b> [% HOLD.branch.branchname | html %]</b>[% IF ( HOLD.desk_id ) %], [% Desks.GetName ( HOLD.desk_id ) | html %],[% END %]

you don't new Desks template plugin, just use hold.desk.desk_name

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


More information about the Koha-bugs mailing list