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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt (-3 / +3 lines)
Lines 198-204 Link Here
198
                                                    <td>[% biblio.biblionumber | html %]</td>
198
                                                    <td>[% biblio.biblionumber | html %]</td>
199
                                                    <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber | uri %]">[% biblio.title | html %]</a></td>
199
                                                    <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber | uri %]">[% biblio.title | html %]</a></td>
200
                                                    <td class="actions">
200
                                                    <td class="actions">
201
                                                        <a href="/cgi-bin/koha/svc/records/preview?record_type=biblio&record_id=[% biblio.biblionumber | uri %]&mmtid=[% mmtid | uri %]" class="previewMARC btn btn-default btn-xs" data-record_type="biblio" data-record_id="[% biblio.biblionumber | html %]" data-mmtid="[% mmtid | html %]" title="Preview MARC"><i class="fa fa-eye"></i> Show MARC</a>
201
                                                        <a href="/cgi-bin/koha/svc/records/preview?record_type=biblio&record_id=[% biblio.biblionumber | uri %]&mmtid=[% mmtid | uri %]&overlay_context=batchmod" class="previewMARC btn btn-default btn-xs" data-record_type="biblio" data-record_id="[% biblio.biblionumber | html %]" data-mmtid="[% mmtid | html %]" title="Preview MARC"><i class="fa fa-eye"></i> Show MARC</a>
202
                                                    </td>
202
                                                    </td>
203
                                                </tr>
203
                                                </tr>
204
                                            [% END %]
204
                                            [% END %]
Lines 225-231 Link Here
225
                                                    <td><input type="checkbox" name="record_id" value="[% authority.authid | html %]" data-usage="[% authority.count_usage | html %]" /></td>
225
                                                    <td><input type="checkbox" name="record_id" value="[% authority.authid | html %]" data-usage="[% authority.count_usage | html %]" /></td>
226
                                                    <td><a href="/cgi-bin/koha/authorities/detail.pl?authid=[% authority.authid | uri %]">[% authority.authid | html %]</a></td>
226
                                                    <td><a href="/cgi-bin/koha/authorities/detail.pl?authid=[% authority.authid | uri %]">[% authority.authid | html %]</a></td>
227
                                                    <td>[% PROCESS authresult summary=authority.summary authid=authority.authid %]</td>
227
                                                    <td>[% PROCESS authresult summary=authority.summary authid=authority.authid %]</td>
228
                                                    <td class="actions"><a href="/cgi-bin/koha/svc/records/preview?record_type=authority&record_id=[% authority.authid | uri %]&mmtid=[% mmtid | uri %]" data-record_type="authority" data-record_id="[% authority.authid | html %]" data-mmtid="[% mmtid | html %]" class="previewMARC btn btn-default btn-xs"><i class='fa fa-eye'></i> Show MARC</a>
228
                                                    <td class="actions"><a href="/cgi-bin/koha/svc/records/preview?record_type=authority&record_id=[% authority.authid | uri %]&mmtid=[% mmtid | uri %]&overlay_context=batchmod" data-record_type="authority" data-record_id="[% authority.authid | html %]" data-mmtid="[% mmtid | html %]" class="previewMARC btn btn-default btn-xs"><i class='fa fa-eye'></i> Show MARC</a>
229
                                                </tr>
229
                                                </tr>
230
                                            [% END %]
230
                                            [% END %]
231
                                        </tbody>
231
                                        </tbody>
Lines 355-361 Link Here
355
                var url = "/cgi-bin/koha/svc/records/preview?"
355
                var url = "/cgi-bin/koha/svc/records/preview?"
356
                var mmtid = $(this).val();
356
                var mmtid = $(this).val();
357
                $("a.previewMARC").each(function() {
357
                $("a.previewMARC").each(function() {
358
                    $(this).attr("href", url + "record_type=" + $(this).attr("data-record_type") + "&record_id=" + $(this).attr("data-record_id") + "&mmtid=" + mmtid);
358
                    $(this).attr("href", url + "record_type=" + $(this).attr("data-record_type") + "&record_id=" + $(this).attr("data-record_id") + "&mmtid=" + mmtid + "&overlay_context=batchmod");
359
                });
359
                });
360
            });
360
            });
361
361
(-)a/svc/records/preview (-6 / +27 lines)
Lines 20-33 Link Here
20
use Modern::Perl;
20
use Modern::Perl;
21
use CGI;
21
use CGI;
22
use C4::Auth qw( get_template_and_user );
22
use C4::Auth qw( get_template_and_user );
23
use C4::Biblio qw( GetMarcBiblio );
23
use C4::Biblio qw( GetMarcBiblio ApplyMarcOverlayRules );
24
use C4::MarcModificationTemplates qw( ModifyRecordWithTemplate );
24
use C4::MarcModificationTemplates qw( ModifyRecordWithTemplate );
25
use C4::Output qw( output_html_with_http_headers );
25
use C4::Output qw( output_html_with_http_headers );
26
26
use Koha::MetadataRecord::Authority;
27
use Koha::MetadataRecord::Authority;
28
use Koha::Patrons;
27
29
28
my $query = CGI->new();
30
my $query = CGI->new();
29
my $record_id = $query->param('record_id');
31
my $record_id = $query->param('record_id');
30
my $record_type = $query->param('record_type') || 'biblio';
32
my $record_type = $query->param('record_type') || 'biblio';
33
my $overlay_context = $query->param('overlay_context');
31
my $mmtid = $query->param('mmtid'); # Marc modification template id
34
my $mmtid = $query->param('mmtid'); # Marc modification template id
32
35
33
my $record;
36
my $record;
Lines 38-52 if ( $record_type eq 'biblio' ) { Link Here
38
    $record = $authority->record;
41
    $record = $authority->record;
39
}
42
}
40
43
41
if ( $mmtid ) {
42
    ModifyRecordWithTemplate( $mmtid, $record );
43
}
44
45
my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
44
my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
46
    template_name   => "catalogue/showmarc.tt",
45
    template_name   => "catalogue/showmarc.tt",
47
    query           => $query,
46
    query           => $query,
48
    type            => "intranet",
47
    type            => "intranet",
49
});
48
});
50
49
50
51
if ($mmtid) {
52
    ModifyRecordWithTemplate( $mmtid, $record );
53
54
    if (   $record_type eq 'biblio'
55
        && C4::Context->preference('MARCOverlayRules')
56
        && $overlay_context )
57
    {
58
        my $logged_in_user = Koha::Patrons->find($loggedinuser);
59
        $record = ApplyMarcOverlayRules(
60
            {
61
                biblionumber    => $record_id,
62
                record          => $record,
63
                overlay_context => {
64
                    source       => $overlay_context,
65
                    categorycode => $logged_in_user->categorycode,
66
                    userid       => $logged_in_user->userid
67
                },
68
            }
69
        );
70
    }
71
}
72
51
$template->param( MARC_FORMATTED => $record->as_formatted );
73
$template->param( MARC_FORMATTED => $record->as_formatted );
52
output_html_with_http_headers $query, $cookie, $template->output;
74
output_html_with_http_headers $query, $cookie, $template->output;
53
- 

Return to bug 14957