Koha/koha-tmpl/intranet-tmpl/prog/en/modules/members/purchase-suggestions.tt
Julian Maurice ed7543287b Bug 20538: Remove the need of writing [% KOHA_VERSION %] everywhere
Having to write [% KOHA_VERSION %] for each url is bad because:
- It's easily forgettable when adding new <script> or <link>
- It prevents grep'ing for the full filename
- It violates the DRY principle
- If at some point we want to change the "force js and css reload"
  mechanism, it will be tedious

This patch:
- adds a Template::Toolkit plugin that generates <script> and
  <link> tags for JS and CSS files, and inserts automatically the Koha
  version in the filename
- use the new plugin to remove all occurences of [% KOHA_VERSION %]
- remove the code that was adding KOHA_VERSION as a template variable

Test plan:
1. Apply patch
2. Go to several different pages in Koha (opac and intranet) while
   checking your browser's dev tools (there should be no 404 for JS and
   CSS files, and the Koha version should appear in filenames) and the
   server logs (there should be no "File not found")
3. `git grep KOHA_VERSION` should return nothing
4. prove t/db_dependent/Koha/Template/Plugin/Asset.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-04-13 11:49:44 -03:00

118 lines
5.1 KiB
Text

[% USE Asset %]
[% USE Koha %]
[% USE AuthorisedValues %]
[% USE Branches %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Patrons &rsaquo; Purchase suggestions for [% INCLUDE 'patron-title.inc' no_html = 1 %]</title>
[% Asset.css("css/datatables.css") %]
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="pat_purchase_suggestions" class="pat">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'patron-search.inc' %]
<div id="breadcrumbs">
<a href="/cgi-bin/koha/mainpage.pl">Home</a>
&rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
&rsaquo; Purchase suggestions for [% INCLUDE 'patron-title.inc' %]
</div>
<div id="doc3" class="yui-t1">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<div class="yui-g">
<h2>Purchase suggestions</h2>
<div id="toolbar" class="btn-toolbar">
<a class="btn btn-default btn-sm" id="newsuggestion" href="/cgi-bin/koha/suggestion/suggestion.pl?op=add&amp;suggestedby=[% patron.borrowernumber %]&amp;redirect=purchase_suggestions&amp;borrowernumber=[% patron.borrowernumber %]"><i class="fa fa-plus"></i> New purchase suggestion</a>
</div>
[% IF suggestions %]
<table id="suggestions">
<thead>
<tr>
<th>Summary</th>
<th>Note</th>
<th>Managed by</th>
<th>Status</th>
</tr>
</thead>
<tbody>
[% FOREACH s IN suggestions %]
<tr>
<td>
<p>
<strong>
[% IF ( CAN_user_catalogue ) %]
<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% s.suggestionid %]&amp;op=show">[% s.title |html %]</a>
[% ELSE %]
[% s.title |html %]
[% END %]
</strong>
</p>
<p>
[% IF ( s.author ) %][% s.author %],[% END %]
[% IF ( s.copyrightdate ) %] - [% s.copyrightdate %],[% END %]
[% IF ( s.publishercode ) %] - [% s.publishercode %][% END %]
[% IF ( s.place ) %]([% s.place %])[% END %]
[% IF ( s.collectiontitle ) %] , [% s.collectiontitle %][% END %]
[% IF ( s.itemtype ) %] - [% s.itemtype %][% END %]
</p>
</td>
<td>[% s.note %]
<td>
[% IF ( s.surnamemanagedby ) %]
[% s.surnamemanagedby %]
[% IF ( s.firstnamemanagedby ) %],[% END %]
[% s.firstnamemanagedby %]
[% ELSE %]
&nbsp;
[% END %]
</td>
<td>
[% IF ( s.ASKED ) %]Requested[% END %]
[% IF ( s.CHECKED ) %]Checked by the library[% END %]
[% IF ( s.ACCEPTED ) %]Accepted by the library[% END %]
[% IF ( s.ORDERED ) %]Ordered by the library[% END %]
[% IF ( s.REJECTED ) %]Suggestion declined [% END %]
[% IF ( s.AVAILABLE ) %]Available in the library[% END %]
[% IF ( s.reason ) %]([% s.reason %])[% END %]
</td>
</tr>
[% END %]
</tbody>
</table>
[% ELSE %]
<div class="dialog message">
<p>This patron has not submitted any purchase suggestions</p>
</div>
[% END %]
</div>
</div>
</div>
<div class="yui-b">
[% INCLUDE 'circ-menu.inc' %]
</div>
</div>
[% MACRO jsinclude BLOCK %]
[% Asset.js("js/members-menu.js") %]
[% INCLUDE 'datatables.inc' %]
<script type="text/javascript">
$(document).ready(function() {
$("#suggestions").dataTable($.extend(true, {}, dataTablesDefaults, {
'bPaginate': false,
'bFilter': false,
'bInfo': false,
'sDom': 't'
} ));
});
</script>
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]