Lines 1262-1268
sub _find_value {
Link Here
|
1262 |
|
1262 |
|
1263 |
=head2 PrepareItemrecordDisplay |
1263 |
=head2 PrepareItemrecordDisplay |
1264 |
|
1264 |
|
1265 |
PrepareItemrecordDisplay($bibnum,$itemumber,$defaultvalues,$frameworkcode); |
1265 |
PrepareItemrecordDisplay($bibnum,$itemumber,$defaultvalues,$frameworkcode, $use_defaults); |
1266 |
|
1266 |
|
1267 |
Returns a hash with all the fields for Display a given item data in a template |
1267 |
Returns a hash with all the fields for Display a given item data in a template |
1268 |
|
1268 |
|
Lines 1270-1280
$defaultvalues should either contain a hashref of values for the new item, or be
Link Here
|
1270 |
|
1270 |
|
1271 |
The $frameworkcode returns the item for the given frameworkcode, ONLY if bibnum is not provided |
1271 |
The $frameworkcode returns the item for the given frameworkcode, ONLY if bibnum is not provided |
1272 |
|
1272 |
|
|
|
1273 |
If $use_defaults is true, the returned item values will be generated from the default values only. |
1274 |
|
1273 |
=cut |
1275 |
=cut |
1274 |
|
1276 |
|
1275 |
sub PrepareItemrecordDisplay { |
1277 |
sub PrepareItemrecordDisplay { |
1276 |
|
1278 |
|
1277 |
my ( $bibnum, $itemnum, $defaultvalues, $frameworkcode ) = @_; |
1279 |
my ( $bibnum, $itemnum, $defaultvalues, $frameworkcode, $use_defaults ) = @_; |
1278 |
|
1280 |
|
1279 |
my $dbh = C4::Context->dbh; |
1281 |
my $dbh = C4::Context->dbh; |
1280 |
$frameworkcode = C4::Biblio::GetFrameworkCode($bibnum) if $bibnum; |
1282 |
$frameworkcode = C4::Biblio::GetFrameworkCode($bibnum) if $bibnum; |
Lines 1294-1304
sub PrepareItemrecordDisplay {
Link Here
|
1294 |
# return nothing if we don't have found an existing framework. |
1296 |
# return nothing if we don't have found an existing framework. |
1295 |
return q{} unless $tagslib; |
1297 |
return q{} unless $tagslib; |
1296 |
my $itemrecord; |
1298 |
my $itemrecord; |
1297 |
if ($itemnum) { |
1299 |
if ($use_defaults) { |
1298 |
$itemrecord = C4::Items::GetMarcItem( $bibnum, $itemnum ); |
|
|
1299 |
}elsif ($defaultvalues && $defaultvalues->{'itemrecord'} ) { |
1300 |
$itemrecord = $defaultvalues->{'itemrecord'}; |
1300 |
$itemrecord = $defaultvalues->{'itemrecord'}; |
1301 |
} |
1301 |
} |
|
|
1302 |
elsif ($itemnum) { |
1303 |
$itemrecord = C4::Items::GetMarcItem( $bibnum, $itemnum ); |
1304 |
} |
1302 |
my @loop_data; |
1305 |
my @loop_data; |
1303 |
|
1306 |
|
1304 |
my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : ""; |
1307 |
my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : ""; |