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

(-)a/C4/OAI/Sets.pm (+7 lines)
Lines 609-614 sub UpdateOAISetsBiblio { Link Here
609
609
610
    return unless($biblionumber and $record);
610
    return unless($biblionumber and $record);
611
611
612
    if (C4::Context->preference('OAI-PMH:AutoUpdateSetsEmbedItemData')) {
613
        C4::Biblio::EmbedItemsInMarcBiblio({
614
            marc_record  => $record,
615
            biblionumber => $biblionumber
616
        });
617
    }
618
612
    my $sets_biblios;
619
    my $sets_biblios;
613
    my @sets = CalcOAISetsBiblio($record);
620
    my @sets = CalcOAISetsBiblio($record);
614
    foreach (@sets) {
621
    foreach (@sets) {
(-)a/cataloguing/additem.pl (+8 lines)
Lines 769-774 if ($op eq "additem") { Link Here
769
    }
769
    }
770
    $nextop="additem";
770
    $nextop="additem";
771
} elsif ($op eq "delinkitem"){
771
} elsif ($op eq "delinkitem"){
772
772
    my $analyticfield = '773';
773
    my $analyticfield = '773';
773
	if ($marcflavour  eq 'MARC21' || $marcflavour eq 'NORMARC'){
774
	if ($marcflavour  eq 'MARC21' || $marcflavour eq 'NORMARC'){
774
        $analyticfield = '773';
775
        $analyticfield = '773';
Lines 784-789 if ($op eq "additem") { Link Here
784
	my $modbibresult = ModBiblio($record, $biblionumber,'');
785
	my $modbibresult = ModBiblio($record, $biblionumber,'');
785
}
786
}
786
787
788
# update OAI-PMH sets
789
if ($op) {
790
    if (C4::Context->preference("OAI-PMH:AutoUpdateSets")) {
791
        C4::OAI::Sets::UpdateOAISetsBiblio($biblionumber, $record);
792
    }
793
}
794
787
#
795
#
788
#-------------------------------------------------------------------------------
796
#-------------------------------------------------------------------------------
789
# build screen with existing items. and "new" one
797
# 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 361-367 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
361
('numSearchRSSResults','50',NULL,'Specify the maximum number of results to display on a RSS page of results','Integer'),
361
('numSearchRSSResults','50',NULL,'Specify the maximum number of results to display on a RSS page of results','Integer'),
362
('OAI-PMH','0',NULL,'if ON, OAI-PMH server is enabled','YesNo'),
362
('OAI-PMH','0',NULL,'if ON, OAI-PMH server is enabled','YesNo'),
363
('OAI-PMH:archiveID','KOHA-OAI-TEST',NULL,'OAI-PMH archive identification','Free'),
363
('OAI-PMH:archiveID','KOHA-OAI-TEST',NULL,'OAI-PMH archive identification','Free'),
364
('OAI-PMH:AutoUpdateSets','0','','Automatically update OAI sets when a bibliographic record is created or updated','YesNo'),
364
('OAI-PMH:AutoUpdateSets','0','','Automatically update OAI sets when a bibliographic or item record is created or updated','YesNo'),
365
('OAI-PMH:AutoUpdateSetEmbedItemData', '0', '', 'Embed item information when automatically updating OAI sets. Requires OAI-PMH:AutoUpdateSets syspref to be enabled', 'YesNo'),
365
('OAI-PMH:ConfFile','',NULL,'If empty, Koha OAI Server operates in normal mode, otherwise it operates in extended mode.','File'),
366
('OAI-PMH:ConfFile','',NULL,'If empty, Koha OAI Server operates in normal mode, otherwise it operates in extended mode.','File'),
366
('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'),
367
('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'),
367
('OAI-PMH:MaxCount','50',NULL,'OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries','Integer'),
368
('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