Owen Leonard
9bd3a44944
It should be possible for staff client users to search and view authority records even if they don't have permission to edit them. To test, apply the patch and view the staff client as a user with and without "editauthorities" permission. With "editauthorities" permission, authority search results should show both an edit and delete link. Viewing the details of an authority record, one should see a toolbar with edit/delete/new options. The detail view has been altered to use the term "record" in place of "biblio" ("Used in X record(s)). Without "editauthorities" permission, authority search results should show no edit or delete link. Viewing the details of an authority, the only option shown in the toolbar should be "Save." On the staff client home page and in the header's "More" menu the link to the authorities module should now appear with and without permission to edit authorities. This patch also corrects the permissions in the authority export script to allow saving of authority records by users who do not have permission to edit. Signed-off-by: Paola Rossi <paola.rossi@cineca.it> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
52 lines
1.4 KiB
Perl
Executable file
52 lines
1.4 KiB
Perl
Executable file
#!/usr/bin/perl
|
|
use strict;
|
|
use warnings;
|
|
|
|
use C4::Record;
|
|
use C4::Auth;
|
|
use C4::Output;
|
|
use C4::AuthoritiesMarc;
|
|
use CGI;
|
|
|
|
my $query = new CGI;
|
|
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
|
|
{
|
|
template_name => "tools/export.tt",
|
|
query => $query,
|
|
type => "intranet",
|
|
authnotrequired => 0,
|
|
flagsrequired => { catalogue => 1 },
|
|
debug => 1,
|
|
}
|
|
);
|
|
|
|
my $op = $query->param("op");
|
|
my $format = $query->param("format");
|
|
my $error = '';
|
|
if ( $op eq "export" ) {
|
|
my $authid = $query->param("authid");
|
|
if ($authid) {
|
|
|
|
my $marc = GetAuthority($authid);
|
|
|
|
if ( $format =~ /marcxml/ ) {
|
|
$marc = marc2marcxml($marc, 'UTF-8', C4::Context->preference("marcflavour") eq 'UNIMARC' ? 'UNIMARCAUTH' : 'MARC21' );
|
|
}
|
|
elsif ($format=~ /mads/) {
|
|
$marc = marc2madsxml($marc);
|
|
}
|
|
elsif ( $format =~ /marc8/ ) {
|
|
$marc = changeEncoding( $marc, "MARC", "MARC21", "MARC-8" );
|
|
$marc = $marc->as_usmarc();
|
|
}
|
|
elsif ( $format =~ /utf8/ ) {
|
|
C4::Charset::SetUTF8Flag( $marc, 1 );
|
|
$marc = $marc->as_usmarc();
|
|
}
|
|
print $query->header(
|
|
-type => 'application/octet-stream',
|
|
-attachment => "auth-$authid.$format"
|
|
);
|
|
print $marc;
|
|
}
|
|
}
|