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 757-762 if ($op eq "additem") { Link Here
757
    }
757
    }
758
    $nextop="additem";
758
    $nextop="additem";
759
} elsif ($op eq "delinkitem"){
759
} elsif ($op eq "delinkitem"){
760
760
    my $analyticfield = '773';
761
    my $analyticfield = '773';
761
	if ($marcflavour  eq 'MARC21' || $marcflavour eq 'NORMARC'){
762
	if ($marcflavour  eq 'MARC21' || $marcflavour eq 'NORMARC'){
762
        $analyticfield = '773';
763
        $analyticfield = '773';
Lines 772-777 if ($op eq "additem") { Link Here
772
	my $modbibresult = ModBiblio($record, $biblionumber,'');
773
	my $modbibresult = ModBiblio($record, $biblionumber,'');
773
}
774
}
774
775
776
# update OAI-PMH sets
777
if ($op) {
778
    if (C4::Context->preference("OAI-PMH:AutoUpdateSets")) {
779
        C4::OAI::Sets::UpdateOAISetsBiblio($biblionumber, $record);
780
    }
781
}
782
775
#
783
#
776
#-------------------------------------------------------------------------------
784
#-------------------------------------------------------------------------------
777
# build screen with existing items. and "new" one
785
# 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 358-364 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
358
('numSearchRSSResults','50',NULL,'Specify the maximum number of results to display on a RSS page of results','Integer'),
358
('numSearchRSSResults','50',NULL,'Specify the maximum number of results to display on a RSS page of results','Integer'),
359
('OAI-PMH','0',NULL,'if ON, OAI-PMH server is enabled','YesNo'),
359
('OAI-PMH','0',NULL,'if ON, OAI-PMH server is enabled','YesNo'),
360
('OAI-PMH:archiveID','KOHA-OAI-TEST',NULL,'OAI-PMH archive identification','Free'),
360
('OAI-PMH:archiveID','KOHA-OAI-TEST',NULL,'OAI-PMH archive identification','Free'),
361
('OAI-PMH:AutoUpdateSets','0','','Automatically update OAI sets when a bibliographic record is created or updated','YesNo'),
361
('OAI-PMH:AutoUpdateSets','0','','Automatically update OAI sets when a bibliographic or item record is created or updated','YesNo'),
362
('OAI-PMH:AutoUpdateSetEmbedItemData', '0', '', 'Embed item information when automatically updating OAI sets. Requires OAI-PMH:AutoUpdateSets syspref to be enabled', 'YesNo'),
362
('OAI-PMH:ConfFile','',NULL,'If empty, Koha OAI Server operates in normal mode, otherwise it operates in extended mode.','File'),
363
('OAI-PMH:ConfFile','',NULL,'If empty, Koha OAI Server operates in normal mode, otherwise it operates in extended mode.','File'),
363
('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'),
364
('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'),
364
('OAI-PMH:MaxCount','50',NULL,'OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries','Integer'),
365
('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