[Koha-devel] ISSUESLIP and old_checkouts in template code

Jonathan Druart jonathan.druart at bugs.koha-community.org
Thu Oct 24 16:11:50 CEST 2019


Hi Mark,

Try this:

@ Members.pm:596 @ sub IssueSlip {
         );
         %loops = (
             issues => [ map { $_->{issues}{itemnumber} } @checkouts ],
+            old_issues => [ $patron->old_checkouts->get_column('itemnumber') ],
             overdues   => [ map { $_->{issues}{itemnumber} } @overdues ],
             opac_news => [ map { $_->{opac_news}{idnew} } @news ],
         );

Then, in the template of the notice:
[% FOR c IN old_checkouts %]
[% c.item.barcode %]<p>
[% END %]

Cheers,
Jonathan

Le jeu. 24 oct. 2019 à 15:24, Mark Alexander <marka at pobox.com> a écrit :
>
>
> I'm trying to access old_checkouts in an ISSUESLIP like this:
>
>   [% FOREACH checkout IN old_checkouts %]
>
> This seems to return an empty list, which is not surprising given that
> the ISSUESLIP supposedly doesn't get passed the old_checkouts
> variable, according to the wiki:
>
>   https://wiki.koha-community.org/wiki/Notices_with_Template_Toolkit
>
> I've been trying to figure out how to get old_checkouts passed to
> ISSUESLIP, but I'm not too familiar with the code.  As best as I can
> tell, this needs to be done somewhere in C4/Members.pm, perhaps in the
> IssueSlip function, but it's not clear to me what I need to do.
>
> Any guidance would be appreciated.  Thanks in advance!
> _______________________________________________
> Koha-devel mailing list
> Koha-devel at lists.koha-community.org
> https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
> website : http://www.koha-community.org/
> git : http://git.koha-community.org/
> bugs : http://bugs.koha-community.org/


More information about the Koha-devel mailing list