Bug 38739

Summary: Templates not ending with include intranet-bottom.inc in staff interface
Product: Koha Reporter: Fridolin Somers <fridolin.somers>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: Needs Signoff --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: jonathan.druart, lucas
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30707
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31339
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36135
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39190
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 37033    
Bug Blocks:    
Attachments: Bug 38739: Fix mana-report-search-result.inc
Bug 38739: Fix admin/file_transports.pl
Bug 38739: Fix tools/batch_modify_holds.tt
Bug 38739: Fix some other wrong templates
Bug 38739: Fix basket/basket.tt

Description Fridolin Somers 2024-12-18 11:33:05 UTC
Some templates in staff interface do not end with include intranet-bottom.inc.

 > tail -n1 koha-tmpl/intranet-tmpl/prog/en/modules/*/*.tt | grep -B2 '</html>'

==> koha-tmpl/intranet-tmpl/prog/en/modules/acqui/showorder.tt <==
</html>
--

==> koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt <==
</html>

==> koha-tmpl/intranet-tmpl/prog/en/modules/basket/downloadcart.tt <==
</html>

==> koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasketform.tt <==
</html>

==> koha-tmpl/intranet-tmpl/prog/en/modules/batch/print-notices.tt <==
</html>
--

==> koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/showelastic.tt <==
</html>

==> koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/showmarc.tt <==
</html>
--

==> koha-tmpl/intranet-tmpl/prog/en/modules/reports/convert_report.tt <==
</html>
--

==> koha-tmpl/intranet-tmpl/prog/en/modules/tools/preview_letter.tt <==
</html>
--

==> koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/downloadshelf.tt <==
</html>

==> koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelfform.tt <==
</html>


So for example it does not call hook "intranet_js".

Should all templates end with this include ?
Comment 1 Owen Leonard 2024-12-18 15:38:42 UTC
Popup windows and pages like showmarc.tt which are loaded via AJAX do not need the full contents of intranet-bottom. We would either need to add some logic to intranet-bottom.inc or add a different, trimmed-down version.
Comment 2 Fridolin Somers 2025-09-29 15:57:03 UTC
*** Bug 38740 has been marked as a duplicate of this bug. ***
Comment 3 Fridolin Somers 2025-09-29 16:01:29 UTC
koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt
calls :
[% INCLUDE 'intranet-bottom.inc' popup_window=1 %]
That will add ending tags body and html
this must be at the end
Comment 4 Fridolin Somers 2025-10-06 15:06:32 UTC
other suspects :

koha-tmpl/intranet-tmpl/prog/en/includes/mana/mana-report-search-result.inc
koha-tmpl/intranet-tmpl/prog/en/modules/admin/file_transports.tt
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/cn_browser.tt
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_210c_bis.tt
koha-tmpl/intranet-tmpl/prog/en/modules/reserve/hold-group.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-renew.tt
koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_modify_holds.tt

> Should all templates end with this include ?
Nope, some blocks may exist after it.
Also there is the example curbside_pickups.tt with :
    [% UNLESS policy.enabled %]
        <div class="alert alert-warning"> Curbside pickups are not enabled for your library. </div>
        [% INCLUDE 'intranet-bottom.inc' %]
        [% STOP %]
    [% END %]
Comment 5 Fridolin Somers 2025-10-06 15:09:00 UTC
Check with :

git grep -A1 "INCLUDE 'intranet-bottom.inc'" | grep -v INCLUDE | grep '</'
Comment 6 Jonathan Druart 2025-10-07 09:05:22 UTC
(In reply to Fridolin Somers from comment #3)
> koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt
> calls :
> [% INCLUDE 'intranet-bottom.inc' popup_window=1 %]
> That will add ending tags body and html
> this must be at the end

Caused by bug 37033.
Comment 7 Jonathan Druart 2025-10-07 09:32:05 UTC
Created attachment 187506 [details] [review]
Bug 38739: Fix mana-report-search-result.inc
Comment 8 Jonathan Druart 2025-10-07 09:32:07 UTC
Created attachment 187507 [details] [review]
Bug 38739: Fix admin/file_transports.pl
Comment 9 Jonathan Druart 2025-10-07 09:32:10 UTC
Created attachment 187508 [details] [review]
Bug 38739: Fix tools/batch_modify_holds.tt
Comment 10 Jonathan Druart 2025-10-07 09:32:12 UTC
Created attachment 187509 [details] [review]
Bug 38739: Fix some other wrong templates
Comment 11 Jonathan Druart 2025-10-07 09:32:14 UTC
Created attachment 187510 [details] [review]
Bug 38739: Fix basket/basket.tt