@@ -, +, @@ --- .../prog/en/modules/tools/koha-news.tt | 2 +- .../en/modules/opac-request-article.tt | 320 +++++++++--------- opac/opac-request-article.pl | 12 + 3 files changed, 180 insertions(+), 154 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt @@ -457,7 +457,7 @@ [% END %] [% FOREACH lang_lis IN lang_list %] - [% FOREACH location IN [ '', 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacSuggestionInstructions'] %] + [% FOREACH location IN [ '', 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText'] %] [% IF ( location == '' ) %] [% SET location_lang = lang_lis.language %] [% location = BLOCK %]OPAC news[% END %] --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-request-article.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-request-article.tt @@ -1,4 +1,5 @@ [% USE Koha %] +[% USE raw %] [% USE Branches %] [% USE ItemTypes %] [% INCLUDE 'doc-head-open.inc' %] @@ -30,171 +31,184 @@
[% IF biblio.can_article_request( patron ) %] - [% SET article_request_type = biblio.article_request_type( patron ) %] +

Place article request for [% biblio.title | html %]

+ [% IF disclaimer %] +
+ [% FOREACH disc IN disclaimer %] +

[% disc.title | html %]

+

+ [% disc.content | $raw %] +

+ [% END %] + Accept +
+ [% ELSE %] + [% SET article_request_type = biblio.article_request_type( patron ) %] - [% IF article_request_type == 'yes' %] [% SET mandatory_fields = Koha.Preference('ArticleRequestsMandatoryFields') %] [% END %] - [% IF article_request_type == 'bib_only' %] [% SET mandatory_fields = Koha.Preference('ArticleRequestsMandatoryFieldsRecordOnly') %] [% END %] - [% IF article_request_type == 'item_only' %] [% SET mandatory_fields = Koha.Preference('ArticleRequestsMandatoryFieldsItemOnly') %] [% END %] + [% IF article_request_type == 'yes' %] [% SET mandatory_fields = Koha.Preference('ArticleRequestsMandatoryFields') %] [% END %] + [% IF article_request_type == 'bib_only' %] [% SET mandatory_fields = Koha.Preference('ArticleRequestsMandatoryFieldsRecordOnly') %] [% END %] + [% IF article_request_type == 'item_only' %] [% SET mandatory_fields = Koha.Preference('ArticleRequestsMandatoryFieldsItemOnly') %] [% END %] -

Place article request for [% biblio.title | html %]

-
- - - -
-
    -
  • - [% IF mandatory_fields.search('title') %] - - - [% ELSE %] - - - [% END %] -
  • - -
  • - [% IF mandatory_fields.search('author') %] - - - [% ELSE %] - - - [% END %] -
  • - -
  • - [% IF mandatory_fields.search('volume') %] - - - [% ELSE %] - - - [% END %] -
  • - -
  • - [% IF mandatory_fields.search('issue') %] - - - [% ELSE %] - - - [% END %] -
  • - -
  • - [% IF mandatory_fields.search('date') %] - - - [% ELSE %] - - - [% END %] -
  • - -
  • - [% IF mandatory_fields.search('pages') %] - - - [% ELSE %] - - - [% END %] -
  • - -
  • - [% IF mandatory_fields.search('chapters') %] - - - [% ELSE %] - - - [% END %] -
  • - -
  • - - -
  • - -
  • - - + + +
    +
      +
    • + [% IF mandatory_fields.search('title') %] + + + [% ELSE %] + + + [% END %] +
    • + +
    • + [% IF mandatory_fields.search('author') %] + + + [% ELSE %] + + + [% END %] +
    • + +
    • + [% IF mandatory_fields.search('volume') %] + + + [% ELSE %] + + + [% END %] +
    • + +
    • + [% IF mandatory_fields.search('issue') %] + + + [% ELSE %] + + + [% END %] +
    • + +
    • + [% IF mandatory_fields.search('date') %] + + + [% ELSE %] + + + [% END %] +
    • + +
    • + [% IF mandatory_fields.search('pages') %] + + + [% ELSE %] + + + [% END %] +
    • + +
    • + [% IF mandatory_fields.search('chapters') %] + + + [% ELSE %] + + + [% END %] +
    • + +
    • + + +
    • + +
    • + + +
    • +
    +
    + + [% IF article_request_type != 'bib_only' %] + + + + + + + + + + + + + + + [% FOREACH item IN biblio.items %] + [% IF item.can_article_request( patron ) %] + + + + + + + + [% END %] [% END %] - - - - - - [% IF article_request_type != 'bib_only' %] -
    Select a specific item:
     Item typeBarcodeHome libraryCall numberEnumeration
    + [% IF article_request_type == 'item_only' && !checked %] + [% SET checked = 1 %] + + [% ELSE %] + + [% END %] + + [% ItemTypes.GetDescription( item.itype ) | html %] + + [% item.barcode | html %] + + [% Branches.GetName( item.homebranch ) | html %] + + [% item.itemcallnumber | html %] + + [% item.enumchron | html %] +
    - - - - - - - - - - - - - - [% FOREACH item IN biblio.items %] - [% IF item.can_article_request( patron ) %] + + [% IF article_request_type != 'item_only' %] - - - - - [% END %] - [% END %] - - [% IF article_request_type != 'item_only' %] - - - - - [% END %] - -
    Select a specific item:
     Item typeBarcodeHome libraryCall numberEnumeration
    - [% IF article_request_type == 'item_only' && !checked %] - [% SET checked = 1 %] - - [% ELSE %] - - [% END %] - - [% ItemTypes.GetDescription( item.itype ) | html %] - - [% item.barcode | html %] + - [% Branches.GetName( item.homebranch ) | html %] - - [% item.itemcallnumber | html %] - - [% item.enumchron | html %] + + Any item
    - - - Any item -
    - [% END %] + + + [% END %] - -
  • + + + [% END %] [% ELSE %]

    [% biblio.title | html %]

    --- a/opac/opac-request-article.pl +++ a/opac/opac-request-article.pl @@ -23,6 +23,8 @@ use CGI qw ( -utf8 ); use C4::Auth; use C4::Output; +use C4::Context; +use C4::NewsChannels; use Koha::Biblios; use Koha::Patrons; @@ -40,6 +42,15 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( my $action = $cgi->param('action') || q{}; my $biblionumber = $cgi->param('biblionumber'); +my $homebranch = C4::Context->userenv->{'branch'} || ""; +my $location = 'ArticleRequestsDisclaimerText_'; +my $disclaimer; +if ( !$action ) { + $disclaimer = GetNewsToDisplay( $location . $template->lang, $homebranch ); + $disclaimer = GetNewsToDisplay( $location . "en", $homebranch ) + if !scalar(@$disclaimer); +} + if ( $action eq 'create' ) { my $branchcode = $cgi->param('branchcode'); @@ -81,6 +92,7 @@ my $patron = Koha::Patrons->find($borrowernumber); $template->param( biblio => $biblio, patron => $patron, + disclaimer => $disclaimer ); output_html_with_http_headers $cgi, $cookie, $template->output, undef, { force_no_caching => 1 }; --