Nick Clemens
e5f251a709
This patch allows for selection of framework to use when overlaying records - by default it is set to keep the initial framework To test: 1 - Create some records using one framework 2 - Export the records 3 - Edit the records to add fields not in original framework 4 - Stage records using a rule that will find matches 5 - Import 6 - Note records contain new fields on display, but they are lost on edit 7 - Apply patch 8 - Stage records again 9 - Select a framework that contains the new fields on import 10 - Import records 11 - Note records now use selected framework and are displayed/edited correctly Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
52 lines
1.2 KiB
Perl
Executable file
52 lines
1.2 KiB
Perl
Executable file
#!/usr/bin/perl -w
|
|
|
|
# Copyright 2012 CatalystIT
|
|
#
|
|
# This file is part of Koha.
|
|
#
|
|
# Koha is free software; you can redistribute it and/or modify it
|
|
# under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# Koha is distributed in the hope that it will be useful, but
|
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with Koha; if not, see <http://www.gnu.org/licenses>.
|
|
|
|
use strict;
|
|
use warnings;
|
|
use utf8;
|
|
|
|
use Getopt::Long qw( GetOptions );
|
|
use Koha::Script -cron;
|
|
use C4::ImportBatch qw( BatchCommitRecords GetStagedWebserviceBatches );
|
|
|
|
my ($help, $framework);
|
|
|
|
GetOptions(
|
|
'help|?' => \$help,
|
|
'framework=s' => \$framework,
|
|
);
|
|
|
|
if($help){
|
|
print <<EOF
|
|
$0 --framework=myframework
|
|
Parameters :
|
|
--help|? This message
|
|
--framework default ""
|
|
EOF
|
|
;
|
|
exit;
|
|
}
|
|
|
|
my $batch_ids = GetStagedWebserviceBatches() or exit;
|
|
|
|
$framework ||= '';
|
|
BatchCommitRecords({
|
|
batch_id => $_,
|
|
framework => $framework
|
|
}) foreach @$batch_ids;
|