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

(-)a/C4/Biblio.pm (-2 lines)
Lines 2635-2642 sub _koha_marc_update_bib_ids { Link Here
2635
    if(C4::Context->preference('autoControlNumber') eq 'biblionumber'){
2635
    if(C4::Context->preference('autoControlNumber') eq 'biblionumber'){
2636
        unless($record->field('001')){
2636
        unless($record->field('001')){
2637
            $record->insert_fields_ordered(MARC::Field->new('001', $biblionumber));
2637
            $record->insert_fields_ordered(MARC::Field->new('001', $biblionumber));
2638
        }elsif($record->field('001')->data() eq 'biblionumber'){
2639
            $record->field('001')->update($biblionumber);
2640
        }
2638
        }
2641
    }
2639
    }
2642
}
2640
}
(-)a/cataloguing/addbiblio.pl (-1 / +5 lines)
Lines 790-796 if (($biblionumber) && !($breedingid)){ Link Here
790
if ($breedingid) {
790
if ($breedingid) {
791
    ( $record, $encoding ) = MARCfindbreeding( $breedingid ) ;
791
    ( $record, $encoding ) = MARCfindbreeding( $breedingid ) ;
792
}
792
}
793
793
if ( $record && $op eq 'duplicate' &&
794
     C4::Context->preference('autoControlNumber') eq 'biblionumber' ){
795
    my @control_num = $record->field('001');
796
    $record->delete_fields(@control_num);
797
}
794
#populate hostfield if hostbiblionumber is available
798
#populate hostfield if hostbiblionumber is available
795
if ($hostbiblionumber) {
799
if ($hostbiblionumber) {
796
    my $marcflavour = C4::Context->preference("marcflavour");
800
    my $marcflavour = C4::Context->preference("marcflavour");
(-)a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/koha-backend.js (-2 / +2 lines)
Lines 103-111 define( [ '/cgi-bin/koha/svc/cataloguing/framework?frameworkcode=&callback=defin Link Here
103
            return _framework_kohafields[kohafield];
103
            return _framework_kohafields[kohafield];
104
        },
104
        },
105
105
106
        GetRecord: function( id, callback ) {
106
        GetRecord: function( id, duplicate, callback ) {
107
            $.get(
107
            $.get(
108
                '/cgi-bin/koha/svc/bib/' + id
108
                '/cgi-bin/koha/svc/bib/'+ duplicate + id
109
            ).done( function( metadata ) {
109
            ).done( function( metadata ) {
110
                $.get(
110
                $.get(
111
                    '/cgi-bin/koha/svc/bib_framework/' + id
111
                    '/cgi-bin/koha/svc/bib_framework/' + id
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc (-2 / +2 lines)
Lines 252-258 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
252
            get: function( id, callback ) {
252
            get: function( id, callback ) {
253
                if ( !id ) return false;
253
                if ( !id ) return false;
254
254
255
                KohaBackend.GetRecord( id, callback );
255
                KohaBackend.GetRecord( id, "d", callback );
256
            },
256
            },
257
            save: function( id, record, done ) {
257
            save: function( id, record, done ) {
258
                function finishCb( data ) {
258
                function finishCb( data ) {
Lines 272-278 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
272
            get: function( id, callback ) {
272
            get: function( id, callback ) {
273
                if ( !id ) return false;
273
                if ( !id ) return false;
274
274
275
                KohaBackend.GetRecord( id, callback );
275
                KohaBackend.GetRecord( id, "", callback );
276
            },
276
            },
277
            save: function( id, record, done ) {
277
            save: function( id, record, done ) {
278
                function finishCb( data ) {
278
                function finishCb( data ) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (+1 lines)
Lines 164-169 Cataloging: Link Here
164
              choices:
164
              choices:
165
                  biblionumber: generated as biblionumber.
165
                  biblionumber: generated as biblionumber.
166
                  "OFF": not generated automatically.
166
                  "OFF": not generated automatically.
167
    Display:
167
        -
168
        -
168
            - 'Separate main entry and subdivisions with '
169
            - 'Separate main entry and subdivisions with '
169
            - pref: AuthoritySeparator
170
            - pref: AuthoritySeparator
(-)a/members/memberentry.pl (-2 lines)
Lines 109-117 $template->param( relationships => scalar $patron->guarantor_relationships ) if Link Here
109
109
110
my @relations = split /\|/, C4::Context->preference('borrowerRelationship'), -1;
110
my @relations = split /\|/, C4::Context->preference('borrowerRelationship'), -1;
111
@relations = ('') unless @relations;
111
@relations = ('') unless @relations;
112
warn Data::Dumper::Dumper( \@relations );
113
my $empty_relationship_allowed = grep {$_ eq ""} @relations;
112
my $empty_relationship_allowed = grep {$_ eq ""} @relations;
114
warn $empty_relationship_allowed;
115
$template->param( empty_relationship_allowed => $empty_relationship_allowed );
113
$template->param( empty_relationship_allowed => $empty_relationship_allowed );
116
114
117
my $guarantor_id = $input->param('guarantor_id');
115
my $guarantor_id = $input->param('guarantor_id');
(-)a/svc/bib (-4 / +10 lines)
Lines 40-55 unless ($status eq "ok") { Link Here
40
# do initial validation
40
# do initial validation
41
my $path_info = $query->path_info();
41
my $path_info = $query->path_info();
42
42
43
my $duplicate = undef;
43
my $biblionumber = undef;
44
my $biblionumber = undef;
44
if ($path_info =~ m!^/(\d+)$!) {
45
if ($path_info =~ m!^/(d?)(\d+)$!) {
45
    $biblionumber = $1;
46
    $duplicate = $1;
47
    $biblionumber = $2;
46
} else {
48
} else {
47
    print $query->header(-type => 'text/xml', -status => '400 Bad Request');
49
    print $query->header(-type => 'text/xml', -status => '400 Bad Request');
48
}
50
}
49
51
50
# are we retrieving, updating or deleting a bib?
52
# are we retrieving, updating or deleting a bib?
51
if ($query->request_method eq "GET") {
53
if ($query->request_method eq "GET") {
52
    fetch_bib($query, $biblionumber);
54
    fetch_bib($query, $biblionumber, $duplicate);
53
} elsif ($query->request_method eq "POST") {
55
} elsif ($query->request_method eq "POST") {
54
    update_bib($query, $biblionumber);
56
    update_bib($query, $biblionumber);
55
} elsif ($query->request_method eq "DELETE") {
57
} elsif ($query->request_method eq "DELETE") {
Lines 65-74 exit 0; Link Here
65
sub fetch_bib {
67
sub fetch_bib {
66
    my $query = shift;
68
    my $query = shift;
67
    my $biblionumber = shift;
69
    my $biblionumber = shift;
70
    my $duplicate = shift;
68
    my $record = GetMarcBiblio({
71
    my $record = GetMarcBiblio({
69
        biblionumber => $biblionumber,
72
        biblionumber => $biblionumber,
70
        embed_items  => scalar $query->param('items') });
73
        embed_items  => scalar $query->param('items') });
71
    if  (defined $record) {
74
    if  (defined $record) {
75
        if( $duplicate && C4::Context->preference('autoControlNumber') eq 'biblionumber' ){
76
            my @control_nums = $record->field('001');
77
            $record->delete_fields(@control_nums);
78
        }
72
        print $query->header(-type => 'text/xml',-charset => 'utf-8',);
79
        print $query->header(-type => 'text/xml',-charset => 'utf-8',);
73
        print $record->as_xml_record();
80
        print $record->as_xml_record();
74
    } else {
81
    } else {
75
- 

Return to bug 27981