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 / +40 lines)
Line 0 Link Here
0
- 
1
[% USE raw %]
2
[% USE Price %]
3
[% USE Asset %]
4
[% USE Koha %]
5
[% USE Branches %]
6
[% USE Price %]
7
[% SET footerjs = 1 %]
8
[% INCLUDE 'doc-head-open.inc' %]
9
<title>Item details for [% INCLUDE 'biblio-title-head.inc' %] &rsaquo; Catalog &rsaquo; Koha</title>
10
[% INCLUDE 'doc-head-close.inc' %]
11
<style>.listgroup .rows{margin-left:1em;}</style>
12
</head>
13
<body id="catalog_moredetail" class="catalog">
14
[% USE KohaDates %]
15
[% WRAPPER 'header.inc' %]
16
    [% INCLUDE 'cat-search.inc' %]
17
[% END %]
18
19
<span>Editing record source for biblio [% biblionumber %]</span>
20
21
[% UNLESS record_sources.count %]
22
<div>
23
 <span>There is no record sources defined.</span>
24
</div>
25
[% END %]
26
27
<form method="get" action="/cgi-bin/koha/cataloguing/record_source.pl">
28
  <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
29
  <select id="record_source_id" name="record_source_id">
30
    <option value=''>No specified source</option>
31
    [% FOREACH source IN record_sources %]
32
      <option value=[% source.record_source_id %]>[% source.name %]</option>
33
    [% END %]
34
  </select>
35
  <div class="btn-group">
36
    <input type="submit" name="save" class="btn btn-primary" value="Set record source" />
37
    <button class="btn btn-href="/cgi-bin/koha/admin/record_sources" target="_blank">Configure record sources</button>
38
  </div>
39
</form>
40
[% INCLUDE 'intranet-bottom.inc' %]

Return to bug 36372