I saw now that you had some issues with that syntax. I've added your
code as another example to the wiki:
https://wiki.koha-community.org/wiki/Notices_and_Slips_Library#Checkouts_slip_using_only_Template_Toolkit
On 01.06.19 10:28, Katrin Fischer wrote:
Hi Michael and Jonathan,
I wanted to add this to the wiki and found that Joseph has added another
variation that might be a little more elegant as it doesn't require you
to change the notice template when changing itemtypes:
https://wiki.koha-community.org/wiki/Notices_and_Slips_Library#Checkouts_slip_using_only_Template_Toolkit
It uses:
[% USE ItemTypes %]
and:
[% ItemTypes.GetDescription(checkout.item.effective_itemtype) %] Hope
this helps, Katrin
On 28.05.19 15:11, Michael Kuhn wrote:
Hi Jonathan
> Replace the whole checkedout "loop" with the FOR loop
> The example in the test file should give you an idea about how to do
> that.
I have now replaced the original loop:
<checkedout>
<p>
<<biblio.title>> <<items.barcode>><br />
Fällig am: <<issues.date_due>><br />
</p>
</checkedout>
with the following:
[% FOREACH checkout IN checkouts %]
[%~ SET item = checkout.item %]
[%~ SET biblio = checkout.item.biblio %]
<p>[% biblio.title %] [% item.barcode %]<br />
[% SWITCH item.itype %]
[% CASE '01' %] Kinder-/Jugendbuch<br />
[% CASE '02' %] Sachbuch<br />
[% CASE '03' %] Schöne Literatur<br />
[% CASE '05' %] Cassetten<br />
[% CASE '06' %] CD<br />
[% CASE '07' %] Zeitschriften<br />
[% CASE '08' %] Präsenzmedien<br />
[% CASE '09' %] Fernleihen<br />
[% CASE '10' %] Kinder-/Jugendbuch Sene<br />
[% CASE '13' %] Englische Literatur<br />
[% CASE '14' %] Frz. Literatur<br />
[% CASE '16' %] Hörbuch / CD<br />
[% CASE '17' %] Wanderausstellung<br />
[% CASE '18' %] Krimi, Thriller<br />
[% CASE '19' %] Historische Literatur<br />
[% CASE '20' %] DVD<br />
[% CASE '21' %] Leihring<br />
[% CASE '22' %] Spiele<br />
[% CASE '23' %] Weihnachten<br />
[% CASE '24' %] E-Medium<br />
[% END %]
Fällig am: [% checkout.date_due %]<br /></p>
[% END %]
This works as expected.
Many thanks & best wishes: Michael
--
Geschäftsführer · Diplombibliothekar BBS, Informatiker eidg. Fachausweis
Admin Kuhn GmbH · Pappelstrasse 20 · 4123 Allschwil · Schweiz
T 0041 (0)61 261 55 61 · E m...@adminkuhn.ch · W www.adminkuhn.ch
_______________________________________________
Koha mailing list http://koha-community.org
Koha@lists.katipo.co.nz
https://lists.katipo.co.nz/mailman/listinfo/koha
_______________________________________________
Koha mailing list http://koha-community.org
Koha@lists.katipo.co.nz
https://lists.katipo.co.nz/mailman/listinfo/koha
_______________________________________________
Koha mailing list http://koha-community.org
Koha@lists.katipo.co.nz
https://lists.katipo.co.nz/mailman/listinfo/koha