View | Details | Raw Unified | Return to bug 35151
Collapse All | Expand All

(-)a/Koha/Illrequest.pm (-2 / +14 lines)
Lines 41-46 use Koha::Biblios; Link Here
41
use Koha::Items;
41
use Koha::Items;
42
use Koha::ItemTypes;
42
use Koha::ItemTypes;
43
use Koha::Libraries;
43
use Koha::Libraries;
44
use Koha::AdditionalContents;
44
45
45
use C4::Circulation qw( CanBookBeIssued AddIssue );
46
use C4::Circulation qw( CanBookBeIssued AddIssue );
46
47
Lines 932-940 sub backend_create { Link Here
932
    my ( $self, $params ) = @_;
933
    my ( $self, $params ) = @_;
933
934
934
    # Establish whether we need to do a generic copyright clearance.
935
    # Establish whether we need to do a generic copyright clearance.
935
    if ($params->{opac}) {
936
    if ( $params->{opac} ) {
937
938
        my $copyright_content = Koha::AdditionalContents->search_for_display(
939
            {
940
                category   => 'html_customizations',
941
                location   => ['ILLModuleCopyrightClearance'],
942
                lang       => $params->{lang},
943
                library_id => $params->{branchcode},
944
            }
945
        );
946
936
        if ( ( !$params->{stage} || $params->{stage} eq 'init' )
947
        if ( ( !$params->{stage} || $params->{stage} eq 'init' )
937
                && C4::Context->preference("ILLModuleCopyrightClearance") ) {
948
            && $copyright_content->count )
949
        {
938
            return {
950
            return {
939
                error   => 0,
951
                error   => 0,
940
                status  => '',
952
                status  => '',
(-)a/installer/data/mysql/atomicupdate/bug-35151-move-ILLModuleCopyrightClearance-to-additional-contents.pl (+38 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "35065",
5
    description => "Move ILLModuleCopyrightClearance to additional contents",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        # Get any existing value from the ILLModuleCopyrightClearance system preference
11
        my ($illmodulecopyrightclearance) = $dbh->selectrow_array(
12
            q|
13
            SELECT value FROM systempreferences WHERE variable='ILLModuleCopyrightClearance';
14
        |
15
        );
16
        if ($illmodulecopyrightclearance) {
17
18
            # Insert any values found from system preference into additional_contents
19
            $dbh->do(
20
                "INSERT INTO additional_contents ( category, code, location, branchcode, published_on ) VALUES ('html_customizations', 'ILLModuleCopyrightClearance', 'ILLModuleCopyrightClearance', NULL, CAST(NOW() AS date) )"
21
            );
22
23
            my ($insert_id) = $dbh->selectrow_array(
24
                "SELECT id FROM additional_contents WHERE category = 'html_customizations' AND code = 'ILLModuleCopyrightClearance' AND location = 'ILLModuleCopyrightClearance' LIMIT 1",
25
                {}
26
            );
27
28
            $dbh->do(
29
                "INSERT INTO additional_contents_localizations ( additional_content_id, title, content, lang ) VALUES ( ?, 'ILLModuleCopyrightClearance default', ?, 'default' )",
30
                undef, $insert_id, $illmodulecopyrightclearance
31
            );
32
33
            # Remove old system preference
34
            $dbh->do("DELETE FROM systempreferences WHERE variable='ILLModuleCopyrightClearance'");
35
            say $out "Bug 35065 update done";
36
        }
37
    }
38
    }
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html-customization-help.inc (+4 lines)
Lines 18-23 Link Here
18
    Include this content in the popup message which is displayed in the OPAC when the CookieConsent system preference is enabled and the user clicks the "Your cookies" menu item in the header.
18
    Include this content in the popup message which is displayed in the OPAC when the CookieConsent system preference is enabled and the user clicks the "Your cookies" menu item in the header.
19
</div>
19
</div>
20
20
21
<div id="ILLModuleCopyrightClearance_notes" class="hint customization_note">
22
    Adding content to this region will enable the copyright clearance stage in request creation. The content will appear on the OPAC during the process of placing an ILL request.
23
</div>
24
21
<div id="opaccredits_notes" class="hint customization_note">
25
<div id="opaccredits_notes" class="hint customization_note">
22
    Include this content in the footer of all pages in the OPAC.
26
    Include this content in the footer of all pages in the OPAC.
23
</div>
27
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt (-1 / +1 lines)
Lines 524-530 Link Here
524
            [% END %]
524
            [% END %]
525
        [% END %]
525
        [% END %]
526
    [% ELSE %]
526
    [% ELSE %]
527
        [% SET opac_available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'OpacMaintenanceNotice', 'OPACResultsSidebar', 'OpacSuppressionMessage', 'SCOMainUserBlock', 'SelfCheckInMainUserBlock', 'SelfCheckHelpMessage', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup', 'PatronSelfRegistrationAdditionalInstructions' ] %]
527
        [% SET opac_available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'OpacMaintenanceNotice', 'OPACResultsSidebar', 'OpacSuppressionMessage', 'SCOMainUserBlock', 'SelfCheckInMainUserBlock', 'SelfCheckHelpMessage', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup', 'PatronSelfRegistrationAdditionalInstructions', 'ILLModuleCopyrightClearance' ] %]
528
        <optgroup label="OPAC">
528
        <optgroup label="OPAC">
529
            [% FOREACH l IN opac_available_options.sort %]
529
            [% FOREACH l IN opac_available_options.sort %]
530
                [% IF l == location %]
530
                [% IF l == location %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt (-3 / +8 lines)
Lines 6-11 Link Here
6
[% USE AdditionalContents %]
6
[% USE AdditionalContents %]
7
[% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
7
[% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
8
[% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
8
[% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
9
[% SET ILLModuleCopyrightClearance = AdditionalContents.get( location => "ILLModuleCopyrightClearance", lang => lang, library => logged_in_user.branchcode || default_branch ) %]
9
[% INCLUDE 'doc-head-open.inc' %]
10
[% INCLUDE 'doc-head-open.inc' %]
10
<title>Your interlibrary loan requests &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
11
<title>Your interlibrary loan requests &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
11
[% INCLUDE 'doc-head-close.inc' %]
12
[% INCLUDE 'doc-head-close.inc' %]
Lines 78-90 Link Here
78
                                [% INCLUDE messages %]
79
                                [% INCLUDE messages %]
79
                                <div>
80
                                <div>
80
                                    <p>
81
                                    <p>
81
                                        [% Koha.Preference('ILLModuleCopyrightClearance') | $raw %]
82
                                        [% IF ( ILLModuleCopyrightClearance ) %]
83
                                            <div id="ILLModuleCopyrightClearance">
84
                                                [% PROCESS koha_news_block news => ILLModuleCopyrightClearance %]
85
                                            </div>
86
                                        [% END %]
82
                                    </p>
87
                                    </p>
83
                                    [% USE link_url = url('/cgi-bin/koha/opac-illrequests.pl', whole.value.other) %]
88
                                    [% USE link_url = url('/cgi-bin/koha/opac-illrequests.pl', whole.value.other) %]
84
                                    <a href="[% link_url _ '&amp;stage=copyrightclearance' | $raw %]"
89
                                    <a href="[% link_url _ '&amp;stage=copyrightclearance' | $raw %]"
85
                                    class="btn btn-sm btn-primary"><i class="fa fa-check" aria-hidden="true"></i> Yes</a>
90
                                    class="btn btn-sm btn-primary"><i class="fa fa-fw fa-check" aria-hidden="true"></i> Yes</a>
86
                                    <a href="/cgi-bin/koha/opac-illrequests.pl"
91
                                    <a href="/cgi-bin/koha/opac-illrequests.pl"
87
                                    class="btn btn-sm btn-danger"><i class="fa fa-times" aria-hidden="true"></i> No</a>
92
                                    class="btn btn-sm btn-danger"><i class="fa fa-fw fa-times" aria-hidden="true"></i> No</a>
88
                                </div>
93
                                </div>
89
                            [% ELSE %]
94
                            [% ELSE %]
90
                                [% INCLUDE messages %]
95
                                [% INCLUDE messages %]
(-)a/opac/opac-illrequests.pl (-2 / +5 lines)
Lines 146-153 if ( $op eq 'list' ) { Link Here
146
            exit;
146
            exit;
147
        }
147
        }
148
148
149
        my $patron = Koha::Patrons->find( { borrowernumber => $loggedinuser } );
150
149
        $params->{cardnumber} = $patron->cardnumber;
151
        $params->{cardnumber} = $patron->cardnumber;
150
        $params->{opac} = 1;
152
        $params->{branchcode} = $patron->branchcode;
153
        $params->{opac}       = 1;
154
        $params->{lang}       = C4::Languages::getlanguage($query);
151
        my $backend_result = $request->backend_create($params);
155
        my $backend_result = $request->backend_create($params);
152
156
153
        # After creation actions
157
        # After creation actions
154
- 

Return to bug 35151