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

(-)a/cataloguing/record_source.pl (+62 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2000-2002 Katipo Communications
4
# Copyright 2004-2010 BibLibre
5
#
6
# This file is part of Koha.
7
#
8
# Koha is free software; you can redistribute it and/or modify it
9
# under the terms of the GNU General Public License as published by
10
# the Free Software Foundation; either version 3 of the License, or
11
# (at your option) any later version.
12
#
13
# Koha is distributed in the hope that it will be useful, but
14
# WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
17
#
18
# You should have received a copy of the GNU General Public License
19
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
21
use Modern::Perl;
22
23
use CGI;
24
use C4::Output qw( output_html_with_http_headers );
25
use C4::Auth qw( get_template_and_user haspermission );
26
use C4::Biblio qw( ModBiblio );
27
use C4::Context;
28
use Koha::DateUtils qw( dt_from_string );
29
use Koha::Biblios;
30
use Koha::RecordSources;
31
use URI::Escape qw( uri_escape_utf8 );
32
33
# ========================
34
#          MAIN
35
#=========================
36
my $input = CGI->new;
37
my $biblionumber  = $input->param('biblionumber'); # if biblionumber exists, it's a modif, not a new biblio.
38
my $record_source_id = $input->param('record_source_id') // '';
39
my $save = $input->param('save') // '';
40
41
if ($save ne '') {
42
    my $biblio = Koha::Biblios->find($biblionumber);
43
    $biblio->metadata->set({record_source_id => $record_source_id})->store;
44
    print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber");
45
}
46
47
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
48
    {
49
        template_name   => "cataloguing/record_source.tt",
50
        query           => $input,
51
        type            => "intranet",
52
        flagsrequired   => { editcatalogue => 'set_record_sources' },
53
    });
54
55
my $record_sources = Koha::RecordSources->search();
56
57
$template->param(
58
    biblionumber => $biblionumber,
59
    record_sources => $record_sources,
60
);
61
62
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc (-1 / +7 lines)
Lines 35-41 Link Here
35
    </div>
35
    </div>
36
[% END %]
36
[% END %]
37
37
38
[% 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 ) %]
38
[% 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 ) %]
39
    <div class="btn-group">
39
    <div class="btn-group">
40
    <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit <span class="caret"></span></button>
40
    <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit <span class="caret"></span></button>
41
        <ul class="dropdown-menu">
41
        <ul class="dropdown-menu">
Lines 47-52 Link Here
47
                [% END %]
47
                [% END %]
48
            [% END %]
48
            [% END %]
49
49
50
            [% IF CAN_user_editcatalogue_set_record_sources %]
51
               <li><a id="setrecordsource" href="/cgi-bin/koha/cataloguing/record_source.pl?biblionumber=[% biblionumber | html %]">Set record source</a></li>
52
            [% ELSE %]
53
               <li class="disabled"><a id="setrecordsource" href="#">Set record source</a></li>
54
            [% END %]
55
50
            [% IF CAN_user_tools_records_batchmod %]
56
            [% IF CAN_user_tools_records_batchmod %]
51
                <li>
57
                <li>
52
                    <form action="/cgi-bin/koha/tools/batch_record_modification.pl" method="post">
58
                    <form action="/cgi-bin/koha/tools/batch_record_modification.pl" method="post">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/record_source.tt (-1 / +61 lines)
Line 0 Link Here
0
- 
1
[% USE raw %]
2
[% PROCESS 'i18n.inc' %]
3
[% SET footerjs = 1 %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
<title>[% FILTER collapse %]
6
    [% t("Set record sources for") | html %] [% INCLUDE 'biblio-title-head.inc' %] &rsaquo;
7
    [% t("Cataloging") | html %] &rsaquo;
8
    [% t("Koha") | html %]
9
[% END %]</title>
10
[% INCLUDE 'doc-head-close.inc' %]
11
</head>
12
<body id="catalog_set_record_source" class="catalog">
13
[% WRAPPER 'header.inc' %]
14
    [% INCLUDE 'cat-search.inc' %]
15
[% END %]
16
17
[% WRAPPER 'sub-header.inc' %]
18
    [% WRAPPER breadcrumbs %]
19
        [% WRAPPER breadcrumb_item %]
20
            <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
21
        [% END %]
22
        [% WRAPPER breadcrumb_item %]
23
            [% INCLUDE 'biblio-title.inc' link = 1 %]
24
        [% END %]
25
        [% WRAPPER breadcrumb_item bc_active= 1 %]
26
            <span>Set record's source</span>
27
        [% END %]
28
    [% END #/ WRAPPER breadcrumbs %]
29
[% END #/ WRAPPER sub-header.inc %]
30
31
[% SWITCH Koha.Preference('IntranetBiblioDefaultView') %]
32
[% CASE 'marc' %]         [% action_link = "/cgi-bin/koha/catalogue/MARCdetail.pl" %]
33
[% CASE 'labeled_marc' %] [% action_link = "/cgi-bin/koha/catalogue/labeledMARCdetail.pl" %]
34
[% CASE 'isbd' %]         [% action_link = "/cgi-bin/koha/catalogue/ISBDdetail.pl" %]
35
[% CASE %]                [% action_link = "/cgi-bin/koha/catalogue/detail.pl" %]
36
[% END %]
37
[% action_link = action_link _ '?biblionumber=' _ biblio.biblionumber %]
38
39
<div class="main container-fluid">
40
    <div class="row">
41
        <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
42
            [% INCLUDE 'messages.inc' %]
43
44
        <h1>Set the record source [% IF ( biblio.title ) %] for [% INCLUDE 'biblio-title.inc' %][% END %]</h1>
45
46
        <form method="get" action="/cgi-bin/koha/cataloguing/record_source.pl">
47
            <input type="hidden" name="biblionumber" value="[% biblio.biblionumber %]" />
48
            <select id="record_source_id" name="record_source_id">
49
                <option value=''>No specified source</option>
50
                [% FOREACH source IN record_sources %]
51
                    <option value=[% source.record_source_id %] [% IF ( source.record_source_id == current_source.record_source_id ) %] selected="selected" [% END %]>[% source.name %]</option>
52
                [% END %]
53
            </select>
54
            <div class="btn-group">
55
                <input type="submit" name="save" class="btn btn-primary" value="Set record source" />
56
                <button class="btn" href="/cgi-bin/koha/admin/record_sources" target="_blank">Configure record sources</button>
57
            </div>
58
        </form>
59
    </div>
60
</div>
61
[% INCLUDE 'intranet-bottom.inc' %]

Return to bug 36372