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

(-)a/C4/Items.pm (-1 / +7 lines)
Lines 373-379 sub AddItemBatchFromMarc { Link Here
373
373
374
=head2 ModItemFromMarc
374
=head2 ModItemFromMarc
375
375
376
  ModItemFromMarc($item_marc, $biblionumber, $itemnumber);
376
  ModItemFromMarc($item_marc, $biblionumber, $itemnumber, 
377
        $update_last_seen);
377
378
378
This function updates an item record based on a supplied
379
This function updates an item record based on a supplied
379
C<MARC::Record> object containing an embedded item field.
380
C<MARC::Record> object containing an embedded item field.
Lines 428-433 sub ModItemFromMarc { Link Here
428
    my $item_marc = shift;
429
    my $item_marc = shift;
429
    my $biblionumber = shift;
430
    my $biblionumber = shift;
430
    my $itemnumber = shift;
431
    my $itemnumber = shift;
432
    my $update_last_seen = shift;
431
433
432
    my $dbh = C4::Context->dbh;
434
    my $dbh = C4::Context->dbh;
433
    my $frameworkcode = GetFrameworkCode( $biblionumber );
435
    my $frameworkcode = GetFrameworkCode( $biblionumber );
Lines 439-444 sub ModItemFromMarc { Link Here
439
    foreach my $item_field (keys %default_values_for_mod_from_marc) {
441
    foreach my $item_field (keys %default_values_for_mod_from_marc) {
440
        $item->{$item_field} = $default_values_for_mod_from_marc{$item_field} unless exists $item->{$item_field};
442
        $item->{$item_field} = $default_values_for_mod_from_marc{$item_field} unless exists $item->{$item_field};
441
    }
443
    }
444
    if ($update_last_seen) {
445
        my $today = C4::Dates->new();
446
        $item->{'datelastseen'} = $today->output("iso");
447
    }
442
    my $unlinked_item_subfields = _get_unlinked_item_subfields($localitemmarc, $frameworkcode);
448
    my $unlinked_item_subfields = _get_unlinked_item_subfields($localitemmarc, $frameworkcode);
443
   
449
   
444
    return ModItem($item, $biblionumber, $itemnumber, $dbh, $frameworkcode, $unlinked_item_subfields); 
450
    return ModItem($item, $biblionumber, $itemnumber, $dbh, $frameworkcode, $unlinked_item_subfields); 
(-)a/installer/data/mysql/en/mandatory/sysprefs.sql (+1 lines)
Lines 286-288 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
286
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ILS-DI:Authorized_IPs','','.','Restricts usage of ILS-DI to some IPs','Free');
286
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ILS-DI:Authorized_IPs','','.','Restricts usage of ILS-DI to some IPs','Free');
287
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OverduesBlockCirc','noblock','When checking out an item should overdues block checkout, generate a confirmation dialogue, or allow checkout','noblock|confirmation|block','Choice');
287
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OverduesBlockCirc','noblock','When checking out an item should overdues block checkout, generate a confirmation dialogue, or allow checkout','noblock|confirmation|block','Choice');
288
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('DisplayMultiPlaceHold','1','Display the ability to place multiple holds or not','','YesNo');
288
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('DisplayMultiPlaceHold','1','Display the ability to place multiple holds or not','','YesNo');
289
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('UpdateLastSeenBatch','0','Whether to update datelastseen when doing batch modifications','','YesNo');
(-)a/installer/data/mysql/updatedatabase.pl (+7 lines)
Lines 3701-3706 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
3701
    SetVersion ($DBversion);
3701
    SetVersion ($DBversion);
3702
}
3702
}
3703
3703
3704
$DBversion = "3.01.00.146";
3705
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
3706
    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('UpdateLastSeenBatch','0','Whether to update datelastseen when doing batch modifications','','YesNo')");
3707
    print "Upgrade to $DBversion done (Add UpdateLastSeenBatch system preference)\n";
3708
    SetVersion($DBversion);
3709
}
3710
3704
=item DropAllForeignKeys($table)
3711
=item DropAllForeignKeys($table)
3705
3712
3706
  Drop all foreign keys of the table $table
3713
  Drop all foreign keys of the table $table
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (-1 / +7 lines)
Lines 130-133 Cataloging: Link Here
130
                  simplified: a summary
130
                  simplified: a summary
131
                  full: a full list
131
                  full: a full list
132
            - of the serial issues.
132
            - of the serial issues.
133
133
    Batch Operations:
134
        -
135
            - pref: UpdateLastSeenBatch
136
              choices:
137
                  yes: Update
138
                  no: "Don't update"
139
            - the <code>datalastseen</code> field on items when performing batch modifications.
(-)a/kohaversion.pl (-1 / +1 lines)
Lines 11-17 use strict; Link Here
11
11
12
sub kohaversion {
12
sub kohaversion {
13
13
14
    our $VERSION = '3.01.00.145';
14
    our $VERSION = '3.01.00.146';
15
15
16
    # version needs to be set this way
16
    # version needs to be set this way
17
    # so that it can be picked up by Makefile.PL
17
    # so that it can be picked up by Makefile.PL
(-)a/tools/batchMod.pl (-2 / +2 lines)
Lines 132-137 if ($op eq "action") { Link Here
132
132
133
	# For each item
133
	# For each item
134
	my $i = 1; 
134
	my $i = 1; 
135
        my $update_last_seen = C4::Context->preference('UpdateLastSeenBatch');
135
	foreach my $itemnumber(@itemnumbers){
136
	foreach my $itemnumber(@itemnumbers){
136
137
137
		$job->progress($i) if $runinbackground;
138
		$job->progress($i) if $runinbackground;
Lines 151-157 if ($op eq "action") { Link Here
151
			my $localitem = TransformMarcToKoha( $dbh, $marcitem, "", 'items' );
152
			my $localitem = TransformMarcToKoha( $dbh, $marcitem, "", 'items' );
152
			my $localmarcitem=Item2Marc($itemdata);
153
			my $localmarcitem=Item2Marc($itemdata);
153
			UpdateMarcWith($marcitem,$localmarcitem);
154
			UpdateMarcWith($marcitem,$localmarcitem);
154
			eval{my ($oldbiblionumber,$oldbibnum,$oldbibitemnum) = ModItemFromMarc($localmarcitem,$itemdata->{biblionumber},$itemnumber)};
155
			eval{my ($oldbiblionumber,$oldbibnum,$oldbibitemnum) = ModItemFromMarc($localmarcitem,$itemdata->{biblionumber},$itemnumber,$update_last_seen)};
155
		    }
156
		    }
156
		}
157
		}
157
		$i++;
158
		$i++;
158
- 

Return to bug 5185