7 my $dbh = C4::Context->dbh;
8 $dbh->{RaiseError} = 1;
9 $dbh->{AutoCommit} = 0;
11 my $frameworkcode = 'FCUT';
13 INSERT INTO marc_subfield_structure(
14 tagfield, tagsubfield, liblibrarian, kohafield, frameworkcode
16 ('952', 'p', 'Barcode', 'items.barcode', '$frameworkcode'),
17 ('952', '8', 'Collection code', 'items.ccode', '$frameworkcode'),
18 ('952', '7', 'Not for loan', 'items.notforloan', '$frameworkcode'),
19 ('952', 'y', 'Koha item type', 'items.itype', '$frameworkcode'),
20 ('952', 'c', 'Permanent location', '', '$frameworkcode')
23 is ( C4::Koha::IsKohaFieldLinked( {
24 kohafield => 'items.barcode',
25 frameworkcode => $frameworkcode,
26 }), 1, 'items.barcode is linked' );
28 is ( C4::Koha::IsKohaFieldLinked( {
29 kohafield => 'items.notforloan',
30 frameworkcode => $frameworkcode,
31 }), 1, 'items.notforloan is linked' );
33 is ( C4::Koha::IsKohaFieldLinked( {
34 kohafield => 'notforloan',
35 frameworkcode => $frameworkcode,
36 }), 0, 'notforloan is not linked' );
38 is ( C4::Koha::IsKohaFieldLinked( {
39 kohafield => 'items.permanent_location',
40 frameworkcode => $frameworkcode,
41 }), 0, 'items.permanent_location is not linked' );