|
Lines 3684-3699
sub UpdateTotalIssues {
Link Here
|
| 3684 |
my ($biblionumber, $increase, $value) = @_; |
3684 |
my ($biblionumber, $increase, $value) = @_; |
| 3685 |
my $totalissues; |
3685 |
my $totalissues; |
| 3686 |
|
3686 |
|
|
|
3687 |
my $record = GetMarcBiblio($biblionumber); |
| 3688 |
unless ($record) { |
| 3689 |
carp "UpdateTotalIssues could not get biblio record"; |
| 3690 |
return; |
| 3691 |
} |
| 3687 |
my $data = GetBiblioData($biblionumber); |
3692 |
my $data = GetBiblioData($biblionumber); |
|
|
3693 |
unless ($data) { |
| 3694 |
carp "UpdateTotalIssues could not get datas of biblio"; |
| 3695 |
return; |
| 3696 |
} |
| 3697 |
my ($totalissuestag, $totalissuessubfield) = GetMarcFromKohaField('biblioitems.totalissues', $data->{'frameworkcode'}); |
| 3698 |
unless ($totalissuestag) { |
| 3699 |
return 1; # There is nothing to do |
| 3700 |
} |
| 3688 |
|
3701 |
|
| 3689 |
if (defined $value) { |
3702 |
if (defined $value) { |
| 3690 |
$totalissues = $value; |
3703 |
$totalissues = $value; |
| 3691 |
} else { |
3704 |
} else { |
| 3692 |
$totalissues = $data->{'totalissues'} + $increase; |
3705 |
$totalissues = $data->{'totalissues'} + $increase; |
| 3693 |
} |
3706 |
} |
| 3694 |
my ($totalissuestag, $totalissuessubfield) = GetMarcFromKohaField('biblioitems.totalissues', $data->{'frameworkcode'}); |
|
|
| 3695 |
|
| 3696 |
my $record = GetMarcBiblio($biblionumber); |
| 3697 |
|
3707 |
|
| 3698 |
my $field = $record->field($totalissuestag); |
3708 |
my $field = $record->field($totalissuestag); |
| 3699 |
if (defined $field) { |
3709 |
if (defined $field) { |
|
Lines 3704-3711
sub UpdateTotalIssues {
Link Here
|
| 3704 |
$record->insert_grouped_field($field); |
3714 |
$record->insert_grouped_field($field); |
| 3705 |
} |
3715 |
} |
| 3706 |
|
3716 |
|
| 3707 |
ModBiblio($record, $biblionumber, $data->{'frameworkcode'}); |
3717 |
return ModBiblio($record, $biblionumber, $data->{'frameworkcode'}); |
| 3708 |
return; |
|
|
| 3709 |
} |
3718 |
} |
| 3710 |
|
3719 |
|
| 3711 |
=head2 RemoveAllNsb |
3720 |
=head2 RemoveAllNsb |