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

(-)a/catalogue/detail.pl (-2 / +10 lines)
Lines 99-111 unless ($biblio) { Link Here
99
99
100
    # biblionumber invalid -> report and exit
100
    # biblionumber invalid -> report and exit
101
    $template->param(
101
    $template->param(
102
        blocking_error => 'unknown_biblionumber',
102
        unknownbiblionumber => 1,
103
        biblionumber   => $biblionumber
103
        biblionumber        => $biblionumber
104
    );
104
    );
105
    output_html_with_http_headers $query, $cookie, $template->output;
105
    output_html_with_http_headers $query, $cookie, $template->output;
106
    exit;
106
    exit;
107
}
107
}
108
108
109
if ( $query->param('set_record_source') eq '1' ) {
110
    $biblio->metadata->set( { record_source_id => $query->param('record_source_id') } )->store;
111
    my $indexer = Koha::SearchEngine::Indexer->new( { index => $Koha::SearchEngine::BIBLIOS_INDEX } );
112
    $indexer->index_records( $biblionumber, "specialUpdate", "biblioserver" );
113
}
114
115
$template->param( record_sources => Koha::RecordSources->search() );
116
109
my $marc_record         = eval { $biblio->metadata->record };
117
my $marc_record         = eval { $biblio->metadata->record };
110
my $invalid_marc_record = $@ || !$marc_record;
118
my $invalid_marc_record = $@ || !$marc_record;
111
if ($invalid_marc_record) {
119
if ($invalid_marc_record) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc (-1 / +8 lines)
Lines 34-40 Link Here
34
        </div>
34
        </div>
35
    [% END %]
35
    [% END %]
36
36
37
    [% IF ( CAN_user_editcatalogue_edit_catalogue || CAN_user_editcatalogue_edit_items || CAN_user_tools_items_batchmod || CAN_user_tools_items_batchdel ) or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
37
    [% IF ( CAN_user_editcatalogue_edit_catalogue || CAN_user_editcatalogue_edit_items || CAN_user_tools_items_batchmod || CAN_user_tools_items_batchdel || CAN_user_editcatalogue_set_record_sources ) or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
38
        <div class="btn-group">
38
        <div class="btn-group">
39
            <button class="btn btn-default dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</button>
39
            <button class="btn btn-default dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</button>
40
            <ul class="dropdown-menu">
40
            <ul class="dropdown-menu">
Lines 46-51 Link Here
46
                    [% END %]
46
                    [% END %]
47
                [% END %]
47
                [% END %]
48
48
49
                [% IF CAN_user_editcatalogue_set_record_sources %]
50
                    <li><a class="dropdown-item" id="setrecordsource" href="#" data-toggle="modal" data-target="#setRecordSourceModal">Set record source</a></li>
51
                [% ELSE %]
52
                    <li class="disabled"><a id="setrecordsource" href="#">Set record source</a></li>
53
                [% END %]
54
49
                [% IF CAN_user_tools_records_batchmod %]
55
                [% IF CAN_user_tools_records_batchmod %]
50
                    <li>
56
                    <li>
51
                        <form action="/cgi-bin/koha/tools/batch_record_modification.pl" method="post">
57
                        <form action="/cgi-bin/koha/tools/batch_record_modification.pl" method="post">
Lines 345-347 Link Here
345
</div>
351
</div>
346
352
347
[% INCLUDE modals/place_booking.inc %]
353
[% INCLUDE modals/place_booking.inc %]
354
[% INCLUDE modals/record_source.inc %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/modals/record_source.inc (-1 / +32 lines)
Line 0 Link Here
0
- 
1
<!-- Set record source -->
2
<div class="modal" id="setRecordSourceModal" tabindex="-1" role="dialog" aria-labelledby="setRecordSourceLabel">
3
    <div class="modal-dialog">
4
        <div class="modal-content">
5
            <div class="modal-header">
6
                <h1 class="modal-title" id="setRecordSourceModal_">Set the record source [% IF ( biblio.title ) %]for [% INCLUDE 'biblio-title.inc' %][% END %]</h1>
7
            </div>
8
            <form method="post" action="/cgi-bin/koha/catalogue/detail.pl">
9
                <div class="modal-body">
10
                    [% INCLUDE 'csrf-token.inc' %]
11
                    <input type="hidden" name="biblionumber" value="[% biblio.biblionumber | html_entity %]" />
12
                    <input type="hidden" name="set_record_source" value="1" />
13
                    <select id="record_source_id" name="record_source_id">
14
                        <option value="">No specified source</option>
15
                        [% FOREACH source IN record_sources %]
16
                            [% IF ( source.record_source_id == current_source.record_source_id ) %]
17
                                <option value="[% source.record_source_id | html_entity %]" selected="selected">[% source.name | html_entity %]</option>
18
                            [% ELSE %]
19
                                <option value="[% source.record_source_id | html_entity %]">[% source.name | html_entity %]</option>
20
                            [% END %]
21
                        [% END %]
22
                    </select>
23
                    <a class="btn btn-secondary" href="/cgi-bin/koha/admin/record_sources">Configure record sources</a>
24
                </div>
25
                <div class="modal-footer">
26
                    <button type="submit" class="btn btn-primary">Set record source</button>
27
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
28
                </div>
29
            </form>
30
        </div>
31
    </div>
32
</div>

Return to bug 36372