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

(-)a/C4/OAI/Sets.pm (-1 / +7 lines)
Lines 504-510 sub CalcOAISetsBiblio { Link Here
504
            next if not $mapping;
504
            next if not $mapping;
505
            my $rule_operator = $mapping->{'rule_operator'};
505
            my $rule_operator = $mapping->{'rule_operator'};
506
            my $result = _evalRule($record, $mapping);
506
            my $result = _evalRule($record, $mapping);
507
508
            # First rule or 'or' rule is always pushed
507
            # First rule or 'or' rule is always pushed
509
            if (!@$rules || $rule_operator eq 'or') {
508
            if (!@$rules || $rule_operator eq 'or') {
510
                push @$rules, [$result];
509
                push @$rules, [$result];
Lines 609-614 sub UpdateOAISetsBiblio { Link Here
609
608
610
    return unless($biblionumber and $record);
609
    return unless($biblionumber and $record);
611
610
611
    if (C4::Context->preference('OAI-PMH:AutoUpdateSetsEmbedItemData')) {
612
        C4::Biblio::EmbedItemsInMarcBiblio({
613
            marc_record  => $record,
614
            biblionumber => $biblionumber
615
        });
616
    }
617
612
    my $sets_biblios;
618
    my $sets_biblios;
613
    my @sets = CalcOAISetsBiblio($record);
619
    my @sets = CalcOAISetsBiblio($record);
614
    foreach (@sets) {
620
    foreach (@sets) {
(-)a/cataloguing/additem.pl (-2 / +9 lines)
Lines 628-634 if ($op eq "additem") { Link Here
628
        exit;
628
        exit;
629
    }
629
    }
630
630
631
632
#-------------------------------------------------------------------------------
631
#-------------------------------------------------------------------------------
633
} elsif ($op eq "edititem") {
632
} elsif ($op eq "edititem") {
634
#-------------------------------------------------------------------------------
633
#-------------------------------------------------------------------------------
Lines 737-743 if ($op eq "additem") { Link Here
737
            if $newitemlost && $newitemlost ge '1' && !$olditemlost;
736
            if $newitemlost && $newitemlost ge '1' && !$olditemlost;
738
    }
737
    }
739
    $nextop="additem";
738
    $nextop="additem";
740
} elsif ($op eq "delinkitem"){
739
740
    } elsif ($op eq "delinkitem"){
741
    my $analyticfield = '773';
741
    my $analyticfield = '773';
742
	if ($marcflavour  eq 'MARC21' || $marcflavour eq 'NORMARC'){
742
	if ($marcflavour  eq 'MARC21' || $marcflavour eq 'NORMARC'){
743
        $analyticfield = '773';
743
        $analyticfield = '773';
Lines 753-758 if ($op eq "additem") { Link Here
753
	my $modbibresult = ModBiblio($record, $biblionumber,'');
753
	my $modbibresult = ModBiblio($record, $biblionumber,'');
754
}
754
}
755
755
756
# update OAI-PMH sets
757
if ($op) {
758
    if (C4::Context->preference("OAI-PMH:AutoUpdateSets")) {
759
        C4::OAI::Sets::UpdateOAISetsBiblio($biblionumber, $record);
760
    }
761
}
762
756
#
763
#
757
#-------------------------------------------------------------------------------
764
#-------------------------------------------------------------------------------
758
# build screen with existing items. and "new" one
765
# build screen with existing items. and "new" one
(-)a/installer/data/mysql/atomicupdate/bug_25460-add_oai-PMH:AutoUpdateSetsEmbedItemData_syspref.perl (+9 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if ( CheckVersion($DBversion) ) {
3
    $dbh->do(q{INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES ('OAI-PMH:AutoUpdateSetEmbedItemData', '0', '', 'Embed item information when automatically updating OAI sets. Requires OAI-PMH:AutoUpdateSets syspref to be enabled', 'YesNo') });
4
5
    $dbh->do(q{ UPDATE systempreferences SET explanation = 'Automatically update OAI sets when a bibliographic or item record is created or updated' WHERE variable = 'OAI-PMH:AutoUpdateSets' });
6
7
    SetVersion( $DBversion );
8
    print "Upgrade to $DBversion done (Bug 25460 - Update OAI set when adding/editing/deleting item records)\n";
9
}
(-)a/installer/data/mysql/sysprefs.sql (-1 / +2 lines)
Lines 353-359 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
353
('numSearchRSSResults','50',NULL,'Specify the maximum number of results to display on a RSS page of results','Integer'),
353
('numSearchRSSResults','50',NULL,'Specify the maximum number of results to display on a RSS page of results','Integer'),
354
('OAI-PMH','0',NULL,'if ON, OAI-PMH server is enabled','YesNo'),
354
('OAI-PMH','0',NULL,'if ON, OAI-PMH server is enabled','YesNo'),
355
('OAI-PMH:archiveID','KOHA-OAI-TEST',NULL,'OAI-PMH archive identification','Free'),
355
('OAI-PMH:archiveID','KOHA-OAI-TEST',NULL,'OAI-PMH archive identification','Free'),
356
('OAI-PMH:AutoUpdateSets','0','','Automatically update OAI sets when a bibliographic record is created or updated','YesNo'),
356
('OAI-PMH:AutoUpdateSets','0','','Automatically update OAI sets when a bibliographic or item record is created or updated','YesNo'),
357
('OAI-PMH:AutoUpdateSetEmbedItemData', '0', '', 'Embed item information when automatically updating OAI sets. Requires OAI-PMH:AutoUpdateSets syspref to be enabled', 'YesNo'),
357
('OAI-PMH:ConfFile','',NULL,'If empty, Koha OAI Server operates in normal mode, otherwise it operates in extended mode.','File'),
358
('OAI-PMH:ConfFile','',NULL,'If empty, Koha OAI Server operates in normal mode, otherwise it operates in extended mode.','File'),
358
('OAI-PMH:DeletedRecord','persistent','Koha\'s deletedbiblio table will never be deleted (persistent), might be deleted (transient), or will never have any data in it (no)','transient|persistent|no','Choice'),
359
('OAI-PMH:DeletedRecord','persistent','Koha\'s deletedbiblio table will never be deleted (persistent), might be deleted (transient), or will never have any data in it (no)','transient|persistent|no','Choice'),
359
('OAI-PMH:MaxCount','50',NULL,'OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries','Integer'),
360
('OAI-PMH:MaxCount','50',NULL,'OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries','Integer'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref (-2 / +8 lines)
Lines 64-70 Web services: Link Here
64
              choices:
64
              choices:
65
                  yes: Enable
65
                  yes: Enable
66
                  no: Disable
66
                  no: Disable
67
            - automatic update of OAI-PMH sets when a bibliographic record is created or updated
67
            - automatic update of OAI-PMH sets when a bibliographic or item record is created or updated
68
        -
69
            - pref: "OAI-PMH:AutoUpdateSetsEmbedItemData"
70
              choices:
71
                  yes: Enable
72
                  no: Disable
73
            - embedding of item data when automatically updating OAI-PMH sets.
74
            - <br><strong>NOTE:</strong> This needs OAI-PMH:AutoUpdateSets syspref to be enabled."
68
        -
75
        -
69
            - Koha's deletedbiblio table
76
            - Koha's deletedbiblio table
70
            - pref: "OAI-PMH:DeletedRecord"
77
            - pref: "OAI-PMH:DeletedRecord"
71
- 

Return to bug 25460