|
Lines 104-112
sub _increment_barcode {
Link Here
|
| 104 |
|
104 |
|
| 105 |
|
105 |
|
| 106 |
sub generate_subfield_form { |
106 |
sub generate_subfield_form { |
| 107 |
my ($tag, $subfieldtag, $value, $tagslib,$subfieldlib, $branches, $today_iso, $biblionumber, $temp, $loop_data, $i) = @_; |
107 |
my ($tag, $subfieldtag, $value, $tagslib,$subfieldlib, $branches, $today_iso, $biblionumber, $temp, $loop_data, $i, $itemrecord) = @_; |
| 108 |
|
108 |
|
| 109 |
my $frameworkcode = &GetFrameworkCode($biblionumber); |
109 |
my $frameworkcode = &GetFrameworkCode($biblionumber); |
| 110 |
my %subfield_data; |
110 |
my %subfield_data; |
| 111 |
my $dbh = C4::Context->dbh; |
111 |
my $dbh = C4::Context->dbh; |
| 112 |
|
112 |
|
|
Lines 204-215
sub generate_subfield_form {
Link Here
|
| 204 |
#---- "true" authorised value |
204 |
#---- "true" authorised value |
| 205 |
} |
205 |
} |
| 206 |
else { |
206 |
else { |
| 207 |
push @authorised_values, qq{} unless ( $subfieldlib->{mandatory} ); |
207 |
push @authorised_values, qq{} unless ( $subfieldlib->{mandatory} ); |
| 208 |
my $av = GetAuthorisedValues( $subfieldlib->{authorised_value} ); |
208 |
my $av; |
| 209 |
for my $r ( @$av ) { |
209 |
#Bug 11676 #Limit the available shelving locations based on the item's homebranch instead of the user's logged in branch |
| 210 |
push @authorised_values, $r->{authorised_value}; |
210 |
if ($subfieldlib->{authorised_value} eq 'LOC' && $itemrecord) { |
| 211 |
$authorised_lib{$r->{authorised_value}} = $r->{lib}; |
211 |
#Get the homebranch of the item |
| 212 |
} |
212 |
my ( $homebranch_field, $homebranch_subfield ) = C4::Biblio::GetMarcFromKohaField( "items.homebranch", $frameworkcode ); |
|
|
213 |
my $homebranch = $itemrecord->subfield( $homebranch_field, $homebranch_subfield ); |
| 214 |
#Get the shelving locations limited by the item's homebranch |
| 215 |
$av = GetAuthorisedValues( $subfieldlib->{authorised_value}, undef, undef, $homebranch ); |
| 216 |
} |
| 217 |
else { |
| 218 |
$av = GetAuthorisedValues( $subfieldlib->{authorised_value} ); |
| 219 |
} |
| 220 |
|
| 221 |
for my $r ( @$av ) { |
| 222 |
push @authorised_values, $r->{authorised_value}; |
| 223 |
$authorised_lib{$r->{authorised_value}} = $r->{lib}; |
| 224 |
} |
| 213 |
} |
225 |
} |
| 214 |
|
226 |
|
| 215 |
if ($subfieldlib->{'hidden'}) { |
227 |
if ($subfieldlib->{'hidden'}) { |
|
Lines 778-784
if($itemrecord){
Link Here
|
| 778 |
next if subfield_is_koha_internal_p($subfieldtag); |
790 |
next if subfield_is_koha_internal_p($subfieldtag); |
| 779 |
next if ($tagslib->{$tag}->{$subfieldtag}->{'tab'} ne "10"); |
791 |
next if ($tagslib->{$tag}->{$subfieldtag}->{'tab'} ne "10"); |
| 780 |
|
792 |
|
| 781 |
my $subfield_data = generate_subfield_form($tag, $subfieldtag, $value, $tagslib, $subfieldlib, $branches, $today_iso, $biblionumber, $temp, \@loop_data, $i); |
793 |
my $subfield_data = generate_subfield_form($tag, $subfieldtag, $value, $tagslib, $subfieldlib, $branches, $today_iso, $biblionumber, $temp, \@loop_data, $i, $itemrecord); |
| 782 |
|
794 |
|
| 783 |
push @fields, "$tag$subfieldtag"; |
795 |
push @fields, "$tag$subfieldtag"; |
| 784 |
push (@loop_data, $subfield_data); |
796 |
push (@loop_data, $subfield_data); |
|
Lines 803-809
foreach my $tag ( keys %{$tagslib}){
Link Here
|
| 803 |
my @values = (undef); |
815 |
my @values = (undef); |
| 804 |
@values = $itemrecord->field($tag)->subfield($subtag) if ($itemrecord && defined($itemrecord->field($tag)) && defined($itemrecord->field($tag)->subfield($subtag))); |
816 |
@values = $itemrecord->field($tag)->subfield($subtag) if ($itemrecord && defined($itemrecord->field($tag)) && defined($itemrecord->field($tag)->subfield($subtag))); |
| 805 |
for my $value (@values){ |
817 |
for my $value (@values){ |
| 806 |
my $subfield_data = generate_subfield_form($tag, $subtag, $value, $tagslib, $tagslib->{$tag}->{$subtag}, $branches, $today_iso, $biblionumber, $temp, \@loop_data, $i); |
818 |
my $subfield_data = generate_subfield_form($tag, $subtag, $value, $tagslib, $tagslib->{$tag}->{$subtag}, $branches, $today_iso, $biblionumber, $temp, \@loop_data, $i, $itemrecord); |
| 807 |
push (@loop_data, $subfield_data); |
819 |
push (@loop_data, $subfield_data); |
| 808 |
$i++; |
820 |
$i++; |
| 809 |
} |
821 |
} |
| 810 |
- |
|
|