Lines 104-110
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 |
|
109 |
if ($tag == 952 && $subfieldtag eq 'c') { |
110 |
my $break = 1; |
111 |
} |
112 |
|
108 |
|
113 |
|
109 |
my $frameworkcode = &GetFrameworkCode($biblionumber); |
114 |
my $frameworkcode = &GetFrameworkCode($biblionumber); |
110 |
my %subfield_data; |
115 |
my %subfield_data; |
Lines 205-211
sub generate_subfield_form {
Link Here
|
205 |
} |
210 |
} |
206 |
else { |
211 |
else { |
207 |
push @authorised_values, qq{} unless ( $subfieldlib->{mandatory} ); |
212 |
push @authorised_values, qq{} unless ( $subfieldlib->{mandatory} ); |
208 |
my $av = GetAuthorisedValues( $subfieldlib->{authorised_value} ); |
213 |
my $av; |
|
|
214 |
#Bug 11676 #Limit the available shelving locations based on the item's homebranch instead of the user's logged in branch |
215 |
if ($subfieldlib->{authorised_value} eq 'LOC' && $itemrecord) { |
216 |
#Get the homebranch of the item |
217 |
my ( $homebranch_field, $homebranch_subfield ) = C4::Biblio::GetMarcFromKohaField( "items.homebranch", $frameworkcode ); |
218 |
my $homebranch = $itemrecord->subfield( $homebranch_field, $homebranch_subfield ); |
219 |
#Get the shelving locations limited by the item's homebranch |
220 |
$av = GetAuthorisedValues( $subfieldlib->{authorised_value}, undef, undef, $homebranch ); |
221 |
} |
222 |
else { |
223 |
$av = GetAuthorisedValues( $subfieldlib->{authorised_value} ); |
224 |
} |
225 |
|
209 |
for my $r ( @$av ) { |
226 |
for my $r ( @$av ) { |
210 |
push @authorised_values, $r->{authorised_value}; |
227 |
push @authorised_values, $r->{authorised_value}; |
211 |
$authorised_lib{$r->{authorised_value}} = $r->{lib}; |
228 |
$authorised_lib{$r->{authorised_value}} = $r->{lib}; |
Lines 778-784
if($itemrecord){
Link Here
|
778 |
next if subfield_is_koha_internal_p($subfieldtag); |
795 |
next if subfield_is_koha_internal_p($subfieldtag); |
779 |
next if ($tagslib->{$tag}->{$subfieldtag}->{'tab'} ne "10"); |
796 |
next if ($tagslib->{$tag}->{$subfieldtag}->{'tab'} ne "10"); |
780 |
|
797 |
|
781 |
my $subfield_data = generate_subfield_form($tag, $subfieldtag, $value, $tagslib, $subfieldlib, $branches, $today_iso, $biblionumber, $temp, \@loop_data, $i); |
798 |
my $subfield_data = generate_subfield_form($tag, $subfieldtag, $value, $tagslib, $subfieldlib, $branches, $today_iso, $biblionumber, $temp, \@loop_data, $i, $itemrecord); |
782 |
|
799 |
|
783 |
push @fields, "$tag$subfieldtag"; |
800 |
push @fields, "$tag$subfieldtag"; |
784 |
push (@loop_data, $subfield_data); |
801 |
push (@loop_data, $subfield_data); |
Lines 803-809
foreach my $tag ( keys %{$tagslib}){
Link Here
|
803 |
my @values = (undef); |
820 |
my @values = (undef); |
804 |
@values = $itemrecord->field($tag)->subfield($subtag) if ($itemrecord && defined($itemrecord->field($tag)) && defined($itemrecord->field($tag)->subfield($subtag))); |
821 |
@values = $itemrecord->field($tag)->subfield($subtag) if ($itemrecord && defined($itemrecord->field($tag)) && defined($itemrecord->field($tag)->subfield($subtag))); |
805 |
for my $value (@values){ |
822 |
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); |
823 |
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); |
824 |
push (@loop_data, $subfield_data); |
808 |
$i++; |
825 |
$i++; |
809 |
} |
826 |
} |
810 |
- |
|
|