Bugzilla – Attachment 23506 Details for
Bug 11395
Batch modifications for records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11395: New service to preview a record.
Bug-11395-New-service-to-preview-a-record.patch (text/plain), 2.49 KB, created by
Jonathan Druart
on 2013-12-13 10:37:20 UTC
(
hide
)
Description:
Bug 11395: New service to preview a record.
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-12-13 10:37:20 UTC
Size:
2.49 KB
patch
obsolete
>From a95fa9dcb63cc8448ac60531d3d68ef3f7f0ad64 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 12 Dec 2013 21:15:06 +0100 >Subject: [PATCH] Bug 11395: New service to preview a record. > >The main patch adds the ability to preview a record. This is done using >an AJAX way. The preview record is processed on the server side. > >Note: I don't think an authentification check is necessary here. >--- > svc/records/preview | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 53 insertions(+) > create mode 100755 svc/records/preview > >diff --git a/svc/records/preview b/svc/records/preview >new file mode 100755 >index 0000000..39fcb92 >--- /dev/null >+++ b/svc/records/preview >@@ -0,0 +1,53 @@ >+#!/usr/bin/perl >+ >+# This file is part of Koha. >+# >+# Copyright (C) 2013 BibLibre >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+use CGI; >+use C4::Auth qw( get_template_and_user ); >+use C4::Biblio qw( GetMarcBiblio ); >+use C4::MarcModificationTemplates qw( ModifyRecordWithTemplate ); >+use C4::Output qw( output_html_with_http_headers ); >+use Koha::Authority; >+ >+my $query = CGI->new(); >+my $record_id = $query->param('record_id'); >+my $record_type = $query->param('record_type') || 'biblio'; >+my $mmtid = $query->param('mmtid'); # Marc modification template id >+ >+my $record; >+if ( $record_type eq 'biblio' ) { >+ $record = GetMarcBiblio( $record_id ); >+} else { >+ my $authority = Koha::Authority->get_from_authid( $record_id ); >+ $record = $authority->record; >+} >+ >+if ( $mmtid ) { >+ ModifyRecordWithTemplate( $mmtid, $record ); >+} >+ >+my ( $template, $loggedinuser, $cookie ) = get_template_and_user({ >+ template_name => "catalogue/showmarc.tt", >+ query => $query, >+ type => "intranet", >+ authnotrequired => 1, >+}); >+ >+$template->param( MARC_FORMATTED => $record->as_formatted ); >+output_html_with_http_headers $query, $cookie, $template->output; >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11395
:
23502
|
23503
|
23504
|
23505
|
23506
|
23507
|
23508
|
23592
|
24634
|
26072
|
26981
|
28978
|
28999
|
29000
|
29001
|
29002
|
29003
|
29004
|
29056
|
29509
|
29569
|
31344
|
32181
|
32182
|
32184
|
32239
|
32240
|
32241
|
32242
|
32243
|
32244
|
32245
|
32246
|
32247
|
32248
|
32249
|
33145
|
33146
|
33147
|
33148
|
33149
|
33150
|
33151
|
33152
|
33153
|
33154
|
33155
|
34393
|
34394
|
34395
|
34396
|
34397
|
34398
|
34399
|
34400
|
34401
|
34402
|
34552
|
34553
|
34554
|
34555
|
34556
|
34557
|
34558
|
34559
|
34560
|
34561
|
34562
|
35783
|
35784
|
35785
|
35786
|
35787
|
35788
|
35789
|
35790
|
35791
|
35792
|
36295
|
36296
|
36297
|
36298
|
36299
|
36300
|
36301
|
36302
|
36303
|
36304