use C4::Context;
use MARC::Record;
use C4::Log;
-use C4::Koha; # XXX subfield_is_koha_internal_p
-use C4::Branch; # XXX subfield_is_koha_internal_p
+use C4::Koha;
+use C4::Branch;
use C4::ClassSource;
use C4::ImportBatch;
use C4::Charset;
+use Koha::BiblioFrameworks;
use Date::Calc qw(Today);
use MARC::File::USMARC;
&& !C4::Context->IsSuperLibrarian()
&& C4::Context->userenv->{branch};
my $branches = GetBranches($onlymine);
- my @branchloop;
foreach my $thisbranch ( sort keys %$branches ) {
push @authorised_values, $thisbranch;
$authorised_lib{$thisbranch} = $branches->{$thisbranch}->{'branchname'};
}
- #----- itemtypes
}
elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "itemtypes" ) {
- my $sth =
- $dbh->prepare(
- "select itemtype,description from itemtypes order by description");
- $sth->execute;
push @authorised_values, ""
unless ( $tagslib->{$tag}->{$subfield}->{mandatory}
&& ( $value || $tagslib->{$tag}->{$subfield}->{defaultvalue} ) );
-
+
my $itemtype;
-
- while ( my ( $itemtype, $description ) = $sth->fetchrow_array ) {
- push @authorised_values, $itemtype;
- $authorised_lib{$itemtype} = $description;
+ my $itemtypes = GetItemTypes( style => 'array' );
+ for my $itemtype ( @$itemtypes ) {
+ push @authorised_values, $itemtype->{itemtype};
+ $authorised_lib{$itemtype->{itemtype}} = $itemtype->{translated_description};
}
$value = $itemtype unless ($value);
-
- #---- class_sources
}
elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "cn_source" ) {
push @authorised_values, ""
'stickyduedate' => $fa_stickyduedate,
'duedatespec' => $fa_duedatespec,
);
+} elsif ( C4::Context->preference('EnableAdvancedCatalogingEditor') && $input->cookie( 'catalogue_editor_' . $loggedinuser ) eq 'advanced' && !$breedingid ) {
+ # Only use the advanced editor for non-fast-cataloging.
+ # breedingid is not handled because those would only come off a Z39.50
+ # search initiated by the basic editor.
+ print $input->redirect( '/cgi-bin/koha/cataloguing/editor.pl' . ( $biblionumber ? ( '#catalog/' . $biblionumber ) : '' ) );
}
-# Getting the list of all frameworks
-# get framework list
-my $frameworks = getframeworks;
-my @frameworkcodeloop;
-foreach my $thisframeworkcode ( keys %$frameworks ) {
- my %row = (
- value => $thisframeworkcode,
- frameworktext => $frameworks->{$thisframeworkcode}->{'frameworktext'},
- );
- if ($frameworkcode eq $thisframeworkcode){
- $row{'selected'} = 1;
- }
- push @frameworkcodeloop, \%row;
-}
-$template->param( frameworkcodeloop => \@frameworkcodeloop,
+my $frameworkcodeloop = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] });
+$template->param( frameworkcodeloop => $frameworkcodeloop ,
breedingid => $breedingid );
# ++ Global
$biblionumbertagsubfield,
$biblioitemnumtagfield,
$biblioitemnumtagsubfield,
- $bibitem,
$biblioitemnumber
);
biblionumberdata => $biblionumber,
);
# getting html input
- my @params = $input->param();
- $record = TransformHtmlToMarc( $input );
+ my @params = $input->multi_param();
+ $record = TransformHtmlToMarc( $input, 1 );
# check for a duplicate
my ( $duplicatebiblionumber, $duplicatetitle );
if ( !$is_a_modif ) {
my $confirm_not_duplicate = $input->param('confirm_not_duplicate');
# it is not a duplicate (determined either by Koha itself or by user checking it's not a duplicate)
if ( !$duplicatebiblionumber or $confirm_not_duplicate ) {
- my $oldbibnum;
my $oldbibitemnum;
if (C4::Context->preference("BiblioAddsAuthorities")){
BiblioAutoLink( $record, $frameworkcode );
}
if($changed_framework eq "changed"){
- $record = TransformHtmlToMarc( $input );
+ $record = TransformHtmlToMarc( $input, 1 );
}
elsif( $record ne -1 ) {
#FIXME: it's kind of silly to go from MARC::Record to MARC::File::XML and then back again just to fix the encoding
frameworkcode => $frameworkcode,
itemtype => $frameworkcode,
borrowernumber => $loggedinuser,
- tab => $input->param('tab')
+ tab => scalar $input->param('tab')
);
$template->{'VARS'}->{'searchid'} = $searchid;