Lines 107-113
sub _increment_barcode {
Link Here
|
107 |
|
107 |
|
108 |
|
108 |
|
109 |
sub generate_subfield_form { |
109 |
sub generate_subfield_form { |
110 |
my ($tag, $subfieldtag, $value, $tagslib,$subfieldlib, $branches, $biblionumber, $temp, $loop_data, $i, $restrictededition) = @_; |
110 |
my ($tag, $subfieldtag, $value, $tagslib,$subfieldlib, $branches, $biblionumber, $temp, $loop_data, $i, $restrictededition, $patron) = @_; |
111 |
|
111 |
|
112 |
my $frameworkcode = &GetFrameworkCode($biblionumber); |
112 |
my $frameworkcode = &GetFrameworkCode($biblionumber); |
113 |
|
113 |
|
Lines 171-177
sub generate_subfield_form {
Link Here
|
171 |
my %authorised_lib; |
171 |
my %authorised_lib; |
172 |
# builds list, depending on authorised value... |
172 |
# builds list, depending on authorised value... |
173 |
if ( $subfieldlib->{authorised_value} eq "branches" ) { |
173 |
if ( $subfieldlib->{authorised_value} eq "branches" ) { |
|
|
174 |
my @allowed = $patron->libraries_where_can_edit_items; |
174 |
foreach my $thisbranch (@$branches) { |
175 |
foreach my $thisbranch (@$branches) { |
|
|
176 |
next unless any { /^$thisbranch->{branchcode}$/ } @allowed; |
175 |
push @authorised_values, $thisbranch->{branchcode}; |
177 |
push @authorised_values, $thisbranch->{branchcode}; |
176 |
$authorised_lib{$thisbranch->{branchcode}} = $thisbranch->{branchname}; |
178 |
$authorised_lib{$thisbranch->{branchcode}} = $thisbranch->{branchname}; |
177 |
$value = $thisbranch->{branchcode} if $thisbranch->{selected} && !$value; |
179 |
$value = $thisbranch->{branchcode} if $thisbranch->{selected} && !$value; |
Lines 932-938
if($itemrecord){
Link Here
|
932 |
|
934 |
|
933 |
next if ($tagslib->{$tag}->{$subfieldtag}->{'tab'} ne "10"); |
935 |
next if ($tagslib->{$tag}->{$subfieldtag}->{'tab'} ne "10"); |
934 |
|
936 |
|
935 |
my $subfield_data = generate_subfield_form($tag, $subfieldtag, $value, $tagslib, $subfieldlib, $libraries, $biblionumber, $temp, \@loop_data, $i, $restrictededition); |
937 |
my $subfield_data = generate_subfield_form($tag, $subfieldtag, $value, $tagslib, $subfieldlib, $libraries, $biblionumber, $temp, \@loop_data, $i, $restrictededition, $patron); |
936 |
push @fields, "$tag$subfieldtag"; |
938 |
push @fields, "$tag$subfieldtag"; |
937 |
push (@loop_data, $subfield_data); |
939 |
push (@loop_data, $subfield_data); |
938 |
$i++; |
940 |
$i++; |
Lines 956-962
foreach my $tag ( keys %{$tagslib}){
Link Here
|
956 |
my @values = (undef); |
958 |
my @values = (undef); |
957 |
@values = $itemrecord->field($tag)->subfield($subtag) if ($itemrecord && defined($itemrecord->field($tag)) && defined($itemrecord->field($tag)->subfield($subtag))); |
959 |
@values = $itemrecord->field($tag)->subfield($subtag) if ($itemrecord && defined($itemrecord->field($tag)) && defined($itemrecord->field($tag)->subfield($subtag))); |
958 |
for my $value (@values){ |
960 |
for my $value (@values){ |
959 |
my $subfield_data = generate_subfield_form($tag, $subtag, $value, $tagslib, $tagslib->{$tag}->{$subtag}, $libraries, $biblionumber, $temp, \@loop_data, $i, $restrictededition); |
961 |
my $subfield_data = generate_subfield_form($tag, $subtag, $value, $tagslib, $tagslib->{$tag}->{$subtag}, $libraries, $biblionumber, $temp, \@loop_data, $i, $restrictededition, $patron); |
960 |
push (@loop_data, $subfield_data); |
962 |
push (@loop_data, $subfield_data); |
961 |
$i++; |
963 |
$i++; |
962 |
} |
964 |
} |