From d119336f19afb3e869b5b31752288ecc7216fa3f Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Tue, 11 Apr 2017 11:26:36 +0200 Subject: [PATCH] Bug 18426: Refactor subscriptions tables code in a BLOCK Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- .../prog/en/modules/serials/serials-search.tt | 350 ++++++++---------- 1 file changed, 147 insertions(+), 203 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt index 73b0c1623e..48cf07df32 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt @@ -16,6 +16,149 @@ + +[% BLOCK subscriptions_table %] + + + + + + + + + + [% UNLESS closed %] + + [% END %] + [% FOR field IN additional_fields_for_subscription %] + + [% END %] + + + + + + + + + + + + [% UNLESS closed %] + + [% END %] + [% FOR field IN additional_fields_for_subscription %] + + [% END %] + + + + + [% FOREACH subscription IN subscriptions %] + [% UNLESS subscription.cannotdisplay %] + + + + + + + + [% UNLESS closed %] + + [% END %] + + [% FOR field IN additional_fields_for_subscription %] + [% IF field.authorised_value_category %] + + [% ELSE %] + + [% END %] + [% END %] + + + + + [% END %] + [% END %] + +
ISSNTitleNotesLibraryLocationCall numberExpiration date[% field.name %]Actions
+ [% IF ( subscription.issn ) %][% subscription.issn %] + [% END %] + [% subscription.title |html %] + [% IF ( subscription.publicnotes ) %][% subscription.publicnotes %][% END %] + [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %] + + [% IF ( subscription.branchcode ) %][% Branches.GetName( subscription.branchcode ) %][% END %] + + [% IF ( subscription.location ) %][% AuthorisedValues.GetByCode( 'LOC', subscription.location ) %][% END %] + + [% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %] + + [% IF ( subscription.enddate ) %] + [% subscription.enddate | $KohaDates %] + [% ELSE %] + + [% END %] + [% AuthorisedValues.GetByCode( field.authorised_value_category, subscription.additional_fields.${field.name} ) %][% subscription.additional_fields.${field.name} %] + +
+[% END %] +
@@ -109,118 +252,7 @@
[% IF openedsubscriptions %] - - - - - - - - - - - [% FOR field IN additional_fields_for_subscription %] - - [% END %] - - - - - - - - - - - - - [% FOR field IN additional_fields_for_subscription %] - - [% END %] - - - - - [% FOREACH subscription IN openedsubscriptions %] - [% UNLESS subscription.cannotdisplay %] - - - - - - - - - - [% FOR field IN additional_fields_for_subscription %] - [% IF field.authorised_value_category %] - - [% ELSE %] - - [% END %] - [% END %] - - - - - [% END %] - [% END %] - -
ISSNTitleNotesLibraryLocationCall numberExpiration date[% field.name %]Actions
- [% IF ( subscription.issn ) %][% subscription.issn %] - [% END %] - [% subscription.title |html %] - [% IF ( subscription.publicnotes ) %][% subscription.publicnotes %][% END %] - [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %] - - [% IF ( subscription.branchcode ) %][% Branches.GetName( subscription.branchcode ) %][% END %] - - [% IF ( subscription.location ) %][% AuthorisedValues.GetByCode( 'LOC', subscription.location ) %][% END %] - - [% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %] - - [% IF ( subscription.enddate ) %] - [% subscription.enddate | $KohaDates %] - [% ELSE %] - - [% END %] - [% AuthorisedValues.GetByCode( field.authorised_value_category, subscription.additional_fields.${field.name} ) %][% subscription.additional_fields.${field.name} %] - -
+ [% INCLUDE subscriptions_table subscriptions = openedsubscriptions %] [% ELSE %]

Your search returned no open subscriptions.

@@ -229,95 +261,7 @@
[% IF closedsubscriptions %] - - - - - - - - - - - [% FOR field IN additional_fields_for_subscription %] - - [% END %] - - - - - - - - - - - - [% FOR field IN additional_fields_for_subscription %] - - [% END %] - - - - - [% FOREACH subscription IN closedsubscriptions %] - [% UNLESS subscription.cannotdisplay %] - - - - - - - - [% FOR field IN additional_fields_for_subscription %] - [% IF field.authorised_value_category %] - - [% ELSE %] - - [% END %] - [% END %] - - - [% END %] - [% END %] - -
ISSNTitleNotesLibraryLocationCall number[% field.name %]Actions
- [% IF ( subscription.issn ) %] - [% subscription.issn %] - [% END %] - - [% subscription.title |html %] - - [% IF ( subscription.notes ) %][% subscription.notes %][% END %] - [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %] - - [% IF ( subscription.branchcode ) %][% Branches.GetName( subscription.branchcode ) %][% END %] - - [% IF ( subscription.location ) %][% AuthorisedValues.GetByCode( 'LOC', subscription.location ) %][% END %] - - [% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %] - [% AuthorisedValues.GetByCode( field.authorised_value_category, subscription.additional_fields.${field.name} ) %][% subscription.additional_fields.${field.name} %] - -
+ [% INCLUDE subscriptions_table subscriptions = closedsubscriptions closed = 1 %] [% ELSE %]

Your search returned no closed subscriptions.

@@ -428,7 +372,7 @@ [% Asset.js("js/serials-toolbar.js") %]