View | Details | Raw Unified | Return to bug 5528
Collapse All | Expand All

(-)a/C4/Auth.pm (+1 lines)
Lines 382-387 sub get_template_and_user { Link Here
382
            virtualshelves              => C4::Context->preference("virtualshelves"),
382
            virtualshelves              => C4::Context->preference("virtualshelves"),
383
            StaffSerialIssueDisplayCount => C4::Context->preference("StaffSerialIssueDisplayCount"),
383
            StaffSerialIssueDisplayCount => C4::Context->preference("StaffSerialIssueDisplayCount"),
384
            NoZebra                     => C4::Context->preference('NoZebra'),
384
            NoZebra                     => C4::Context->preference('NoZebra'),
385
		EasyAnalyticalRecords => C4::Context->preference('EasyAnalyticalRecords'),
385
        );
386
        );
386
    }
387
    }
387
    else {
388
    else {
(-)a/C4/Biblio.pm (+124 lines)
Lines 78-83 BEGIN { Link Here
78
      &GetMarcBiblio
78
      &GetMarcBiblio
79
      &GetMarcAuthors
79
      &GetMarcAuthors
80
      &GetMarcSeries
80
      &GetMarcSeries
81
      &GetMarcHosts
81
      GetMarcUrls
82
      GetMarcUrls
82
      &GetUsedMarcStructure
83
      &GetUsedMarcStructure
83
      &GetXmlBiblio
84
      &GetXmlBiblio
Lines 90-95 BEGIN { Link Here
90
      &GetMarcFromKohaField
91
      &GetMarcFromKohaField
91
      &GetFrameworkCode
92
      &GetFrameworkCode
92
      &TransformKohaToMarc
93
      &TransformKohaToMarc
94
      &PrepHostMarcField
93
95
94
      &CountItemsIssued
96
      &CountItemsIssued
95
    );
97
    );
Lines 1760-1765 sub GetMarcSeries { Link Here
1760
    return $marcseriessarray;
1762
    return $marcseriessarray;
1761
}    #end getMARCseriess
1763
}    #end getMARCseriess
1762
1764
1765
=head2 GetMarcHosts
1766
1767
  $marchostsarray = GetMarcHosts($record,$marcflavour);
1768
1769
Get all host records (773s MARC21, 461 UNIMARC) from the MARC record and returns them in an array.
1770
1771
=cut
1772
1773
sub GetMarcHosts {
1774
    my ( $record, $marcflavour ) = @_;
1775
    my ( $tag,$title_subf,$bibnumber_subf,$itemnumber_subf);
1776
    $marcflavour ||="MARC21";
1777
    if ( $marcflavour eq "MARC21" || $marcflavour eq "NORMARC" ) {
1778
        $tag = "773";
1779
        $title_subf = "t";
1780
        $bibnumber_subf ="0";
1781
        $itemnumber_subf='9';
1782
    }
1783
    elsif ($marcflavour eq "UNIMARC") {
1784
        $tag = "461";
1785
        $title_subf = "t";
1786
        $bibnumber_subf ="0";
1787
        $itemnumber_subf='9';
1788
    };
1789
1790
    my @marchosts;
1791
1792
    foreach my $field ( $record->field($tag)) {
1793
1794
        my @fields_loop;
1795
1796
        my $hostbiblionumber = $field->subfield("$bibnumber_subf");
1797
        my $hosttitle = $field->subfield($title_subf);
1798
        my $hostitemnumber=$field->subfield($itemnumber_subf);
1799
        push @fields_loop, { hostbiblionumber => $hostbiblionumber, hosttitle => $hosttitle, hostitemnumber => $hostitemnumber};
1800
        push @marchosts, { MARCHOSTS_FIELDS_LOOP => \@fields_loop };
1801
1802
        }
1803
    my $marchostsarray = \@marchosts;
1804
    return $marchostsarray;
1805
}
1806
1763
=head2 GetFrameworkCode
1807
=head2 GetFrameworkCode
1764
1808
1765
  $frameworkcode = GetFrameworkCode( $biblionumber )
1809
  $frameworkcode = GetFrameworkCode( $biblionumber )
Lines 1797-1802 sub TransformKohaToMarc { Link Here
1797
    return $record;
1841
    return $record;
1798
}
1842
}
1799
1843
1844
=head2 PrepHostMarcField
1845
1846
    $hostfield = PrepHostMarcField ( $hostbiblionumber,$hostitemnumber,$marcflavour )
1847
1848
This function returns a host field populated with data from the host record, the field can then be added to an analytical record
1849
1850
=cut
1851
1852
sub PrepHostMarcField {
1853
    my ($hostbiblionumber,$hostitemnumber, $marcflavour) = @_;
1854
    $marcflavour ||="MARC21";
1855
    
1856
    my $hostrecord = GetMarcBiblio($hostbiblionumber);
1857
	my $item = C4::Items::GetItem($hostitemnumber);
1858
	
1859
	my $hostmarcfield;
1860
    if ( $marcflavour eq "MARC21" || $marcflavour eq "NORMARC" ) {
1861
	
1862
        #main entry
1863
        my $mainentry;
1864
        if ($hostrecord->subfield('100','a')){
1865
            $mainentry = $hostrecord->subfield('100','a');
1866
        } elsif ($hostrecord->subfield('110','a')){
1867
            $mainentry = $hostrecord->subfield('110','a');
1868
        } else {
1869
            $mainentry = $hostrecord->subfield('111','a');
1870
        }
1871
	
1872
        # qualification info
1873
        my $qualinfo;
1874
        if (my $field260 = $hostrecord->field('260')){
1875
            $qualinfo =  $field260->as_string( 'abc' );
1876
        }
1877
	
1878
1879
    	#other fields
1880
        my $ed = $hostrecord->subfield('250','a');
1881
        my $barcode = $item->{'barcode'};
1882
        my $title = $hostrecord->subfield('245','a');
1883
1884
        # record control number, 001 with 003 and prefix
1885
        my $recctrlno;
1886
        if ($hostrecord->field('001')){
1887
            $recctrlno = $hostrecord->field('001')->data();
1888
            if ($hostrecord->field('003')){
1889
                $recctrlno = '('.$hostrecord->field('003')->data().')'.$recctrlno;
1890
            }
1891
        }
1892
1893
        # issn/isbn
1894
        my $issn = $hostrecord->subfield('022','a');
1895
        my $isbn = $hostrecord->subfield('020','a');
1896
1897
1898
        $hostmarcfield = MARC::Field->new(
1899
                773, '0', '',
1900
                '0' => $hostbiblionumber,
1901
                '9' => $hostitemnumber,
1902
                'a' => $mainentry,
1903
                'b' => $ed,
1904
                'd' => $qualinfo,
1905
                'o' => $barcode,
1906
                't' => $title,
1907
                'w' => $recctrlno,
1908
                'x' => $issn,
1909
                'z' => $isbn
1910
                );
1911
    } elsif ($marcflavour eq "UNIMARC") {
1912
        $hostmarcfield = MARC::Field->new(
1913
            461, '', '',
1914
            '0' => $hostbiblionumber,
1915
            't' => $hostrecord->subfield('200','a'), 
1916
            '9' => $hostitemnumber
1917
        );	
1918
    };
1919
1920
    return $hostmarcfield;
1921
}
1922
1923
1800
=head2 TransformKohaToMarcOneField
1924
=head2 TransformKohaToMarcOneField
1801
1925
1802
    $record = TransformKohaToMarcOneField( $sth, $record, $kohafieldname, $value, $frameworkcode );
1926
    $record = TransformKohaToMarcOneField( $sth, $record, $kohafieldname, $value, $frameworkcode );
(-)a/C4/Items.pm (-21 / +136 lines)
Lines 69-75 BEGIN { Link Here
69
        GetItemsByBiblioitemnumber
69
        GetItemsByBiblioitemnumber
70
        GetItemsInfo
70
        GetItemsInfo
71
	GetItemsLocationInfo
71
	GetItemsLocationInfo
72
	GetHostItemsInfo
72
        get_itemnumbers_of
73
        get_itemnumbers_of
74
	get_hostitemnumbers_of
73
        GetItemnumberFromBarcode
75
        GetItemnumberFromBarcode
74
        GetBarcodeFromItemnumber
76
        GetBarcodeFromItemnumber
75
      GetHiddenItemnumbers
77
      GetHiddenItemnumbers
Lines 78-83 BEGIN { Link Here
78
		MoveItemFromBiblio 
80
		MoveItemFromBiblio 
79
		GetLatestAcquisitions
81
		GetLatestAcquisitions
80
        CartToShelf
82
        CartToShelf
83
84
	GetAnalyticsCount
81
    );
85
    );
82
}
86
}
83
87
Lines 1395-1400 sub GetItemsLocationInfo { Link Here
1395
	return @results;
1399
	return @results;
1396
}
1400
}
1397
1401
1402
=head2 GetHostItemsInfo
1403
1404
	$hostiteminfo = GetHostItemsInfo($hostfield);
1405
	Returns the iteminfo for items linked to records via a host field
1406
1407
=cut
1408
1409
sub GetHostItemsInfo {
1410
	my ($record) = @_;
1411
	my @returnitemsInfo;
1412
1413
	if (C4::Context->preference('marcflavour') eq 'MARC21' ||
1414
        C4::Context->preference('marcflavour') eq 'NORMARC'){
1415
	    foreach my $hostfield ( $record->field('773') ) {
1416
        	my $hostbiblionumber = $hostfield->subfield("0");
1417
	        my $linkeditemnumber = $hostfield->subfield("9");
1418
        	my @hostitemInfos = GetItemsInfo($hostbiblionumber);
1419
	        foreach my $hostitemInfo (@hostitemInfos){
1420
        	        if ($hostitemInfo->{itemnumber} eq $linkeditemnumber){
1421
                	        push (@returnitemsInfo,$hostitemInfo);
1422
				last;
1423
                	}
1424
        	}
1425
	    }
1426
	} elsif ( C4::Context->preference('marcflavour') eq 'UNIMARC'){
1427
	    foreach my $hostfield ( $record->field('461') ) {
1428
        	my $hostbiblionumber = $hostfield->subfield("0");
1429
	        my $linkeditemnumber = $hostfield->subfield("9");
1430
        	my @hostitemInfos = GetItemsInfo($hostbiblionumber);
1431
	        foreach my $hostitemInfo (@hostitemInfos){
1432
        	        if ($hostitemInfo->{itemnumber} eq $linkeditemnumber){
1433
                	        push (@returnitemsInfo,$hostitemInfo);
1434
				last;
1435
                	}
1436
        	}
1437
	    }
1438
	}
1439
	return @returnitemsInfo;
1440
}
1441
1398
1442
1399
=head2 GetLastAcquisitions
1443
=head2 GetLastAcquisitions
1400
1444
Lines 1482-1487 sub get_itemnumbers_of { Link Here
1482
    return \%itemnumbers_of;
1526
    return \%itemnumbers_of;
1483
}
1527
}
1484
1528
1529
=head2 get_hostitemnumbers_of
1530
1531
  my @itemnumbers_of = get_hostitemnumbers_of($biblionumber);
1532
1533
Given a biblionumber, return the list of corresponding itemnumbers that are linked to it via host fields
1534
1535
Return a reference on a hash where key is a biblionumber and values are
1536
references on array of itemnumbers.
1537
1538
=cut
1539
1540
1541
sub get_hostitemnumbers_of {
1542
	my ($biblionumber) = @_;
1543
	my $marcrecord = GetMarcBiblio($biblionumber);
1544
        my (@returnhostitemnumbers,$tag, $biblio_s, $item_s);
1545
	
1546
	my $marcflavor = C4::Context->preference('marcflavour');
1547
	if ($marcflavor eq 'MARC21' || $marcflavor eq 'NORMARC') {
1548
        $tag='773';
1549
        $biblio_s='0';
1550
        $item_s='9';
1551
    } elsif ($marcflavor eq 'UNIMARC') {
1552
        $tag='461';
1553
        $biblio_s='0';
1554
        $item_s='9';
1555
    }
1556
1557
    foreach my $hostfield ( $marcrecord->field($tag) ) {
1558
        my $hostbiblionumber = $hostfield->subfield($biblio_s);
1559
        my $linkeditemnumber = $hostfield->subfield($item_s);
1560
        my @itemnumbers;
1561
        if (my $itemnumbers = get_itemnumbers_of($hostbiblionumber)->{$hostbiblionumber})
1562
        {
1563
            @itemnumbers = @$itemnumbers;
1564
        }
1565
        foreach my $itemnumber (@itemnumbers){
1566
            if ($itemnumber eq $linkeditemnumber){
1567
                push (@returnhostitemnumbers,$itemnumber);
1568
                last;
1569
            }
1570
        }
1571
    }
1572
    return @returnhostitemnumbers;
1573
}
1574
1575
1485
=head2 GetItemnumberFromBarcode
1576
=head2 GetItemnumberFromBarcode
1486
1577
1487
  $result = GetItemnumberFromBarcode($barcode);
1578
  $result = GetItemnumberFromBarcode($barcode);
Lines 2094-2128 sub DelItemCheck { Link Here
2094
    my ( $dbh, $biblionumber, $itemnumber ) = @_;
2185
    my ( $dbh, $biblionumber, $itemnumber ) = @_;
2095
    my $error;
2186
    my $error;
2096
2187
2188
        my $countanalytics=GetAnalyticsCount($itemnumber);
2189
2190
2097
    # check that there is no issue on this item before deletion.
2191
    # check that there is no issue on this item before deletion.
2098
    my $sth=$dbh->prepare("select * from issues i where i.itemnumber=?");
2192
    my $sth=$dbh->prepare("select * from issues i where i.itemnumber=?");
2099
    $sth->execute($itemnumber);
2193
    $sth->execute($itemnumber);
2100
2194
2101
    my $item = GetItem($itemnumber);
2195
    my $item = GetItem($itemnumber);
2102
    my $onloan = $sth->fetchrow;
2196
    my $onloan=$sth->fetchrow;
2103
    if ($onloan) {
2197
2104
        $error = "book_on_loan";
2198
    if ($onloan){
2199
        $error = "book_on_loan" 
2105
    }
2200
    }
2106
    elsif (C4::Context->preference("IndependantBranches") and (C4::Context->userenv->{branch} ne $item->{C4::Context->preference("HomeOrHoldingBranch")||'homebranch'})){
2201
    elsif (C4::Context->preference("IndependantBranches") and (C4::Context->userenv->{branch} ne $item->{C4::Context->preference("HomeOrHoldingBranch")||'homebranch'})){
2107
        $error = "not_same_branch";
2202
        $error = "not_same_branch";
2108
    } 
2203
    }
2109
    else {
2204
	else{
2110
	if ($onloan){ 
2205
        # check it doesnt have a waiting reserve
2111
	    $error = "book_on_loan" 
2206
        $sth=$dbh->prepare("SELECT * FROM reserves WHERE (found = 'W' or found = 'T') AND itemnumber = ?");
2112
	}
2207
        $sth->execute($itemnumber);
2113
	else {
2208
        my $reserve=$sth->fetchrow;
2114
	    # check it doesnt have a waiting reserve
2209
        if ($reserve){
2115
	    $sth=$dbh->prepare("SELECT * FROM reserves WHERE (found = 'W' or found = 'T') AND itemnumber = ?");
2210
            $error = "book_reserved";
2116
	    $sth->execute($itemnumber);
2211
        } elsif ($countanalytics > 0){
2117
	    my $reserve=$sth->fetchrow;
2212
		$error = "linked_analytics";
2118
	    if ($reserve) {
2213
	} else {
2119
		$error = "book_reserved";
2214
            DelItem($dbh, $biblionumber, $itemnumber);
2120
	    } 
2215
            return 1;
2121
	    else {
2216
        }
2122
		DelItem($dbh, $biblionumber, $itemnumber);
2123
		return 1;
2124
	    }
2125
	}
2126
    }
2217
    }
2127
    return $error;
2218
    return $error;
2128
}
2219
}
Lines 2339-2342 sub _parse_unlinked_item_subfields_from_xml { Link Here
2339
    return $unlinked_subfields;
2430
    return $unlinked_subfields;
2340
}
2431
}
2341
2432
2433
=head2 GetAnalyticsCount
2434
2435
  $count= &GetAnalyticsCount($itemnumber)
2436
2437
counts Usage of itemnumber in Analytical bibliorecords. 
2438
2439
=cut
2440
2441
sub GetAnalyticsCount {
2442
    my ($itemnumber) = @_;
2443
    if (C4::Context->preference('NoZebra')) {
2444
        # Read the index Koha-Auth-Number for this authid and count the lines
2445
        my $result = C4::Search::NZanalyse("hi=$itemnumber");
2446
        my @tab = split /;/,$result;
2447
        return scalar @tab;
2448
    } else {
2449
        ### ZOOM search here
2450
        my $query;
2451
        $query= "hi=".$itemnumber;
2452
                my ($err,$res,$result) = C4::Search::SimpleSearch($query,0,10);
2453
        return ($result);
2454
    }
2455
}
2456
2342
1;
2457
1;
(-)a/C4/Reserves.pm (+8 lines)
Lines 383-388 sub CanBookBeReserved{ Link Here
383
    my ($borrowernumber, $biblionumber) = @_;
383
    my ($borrowernumber, $biblionumber) = @_;
384
384
385
    my @items = GetItemsInfo($biblionumber);
385
    my @items = GetItemsInfo($biblionumber);
386
387
	#get items linked via host records
388
	my $marcrecord= GetMarcBiblio($biblionumber);
389
	my @hostitemInfos = GetHostItemsInfo($marcrecord);
390
	if (@hostitemInfos){
391
		push (@items,@hostitemInfos);
392
	}
393
386
    foreach my $item (@items){
394
    foreach my $item (@items){
387
        return 1 if CanItemBeReserved($borrowernumber, $item->{itemnumber});
395
        return 1 if CanItemBeReserved($borrowernumber, $item->{itemnumber});
388
    }
396
    }
(-)a/C4/Search.pm (+27 lines)
Lines 1559-1564 sub searchResults { Link Here
1559
1559
1560
        # Pull out the items fields
1560
        # Pull out the items fields
1561
        my @fields = $marcrecord->field($itemtag);
1561
        my @fields = $marcrecord->field($itemtag);
1562
        my $marcflavor = C4::Context->preference("marcflavour");
1563
        # adding linked items that belong to host records
1564
        my $analyticsfield = '773';
1565
        if ($marcflavor eq 'MARC21' || $marcflavor eq 'NORMARC') {
1566
            $analyticsfield = '773';
1567
        } elsif ($marcflavor eq 'UNIMARC') {
1568
            $analyticsfield = '461';
1569
        }
1570
        foreach my $hostfield ( $marcrecord->field($analyticsfield)) {
1571
            my $hostbiblionumber = $hostfield->subfield("0");
1572
            my $linkeditemnumber = $hostfield->subfield("9");
1573
            if(!$hostbiblionumber eq undef){
1574
                my $hostbiblio = GetMarcBiblio($hostbiblionumber, 1);
1575
                my ($itemfield, undef) = GetMarcFromKohaField( 'items.itemnumber', GetFrameworkCode($hostbiblionumber) );
1576
                if(!$hostbiblio eq undef){
1577
                    my @hostitems = $hostbiblio->field($itemfield);
1578
                    foreach my $hostitem (@hostitems){
1579
                        if ($hostitem->subfield("9") eq $linkeditemnumber){
1580
                            my $linkeditem =$hostitem;
1581
                            # append linked items if they exist
1582
                            if (!$linkeditem eq undef){
1583
                                push (@fields, $linkeditem);}
1584
                        }
1585
                    }
1586
                }
1587
            }
1588
        }
1562
1589
1563
        # Setting item statuses for display
1590
        # Setting item statuses for display
1564
        my @available_items_loop;
1591
        my @available_items_loop;
(-)a/catalogue/detail.pl (-5 / +37 lines)
Lines 41-49 use C4::XSLT; Link Here
41
# use Smart::Comments;
41
# use Smart::Comments;
42
42
43
my $query = CGI->new();
43
my $query = CGI->new();
44
45
my $analyze = $query->param('analyze');
46
44
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
47
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
45
    {
48
    {
46
        template_name   => "catalogue/detail.tmpl",
49
    template_name   =>  'catalogue/detail.tmpl',
47
        query           => $query,
50
        query           => $query,
48
        type            => "intranet",
51
        type            => "intranet",
49
        authnotrequired => 0,
52
        authnotrequired => 0,
Lines 105-110 my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); Link Here
105
my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
108
my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
106
my $marcseriesarray  = GetMarcSeries($record,$marcflavour);
109
my $marcseriesarray  = GetMarcSeries($record,$marcflavour);
107
my $marcurlsarray    = GetMarcUrls    ($record,$marcflavour);
110
my $marcurlsarray    = GetMarcUrls    ($record,$marcflavour);
111
my $marchostsarray  = GetMarcHosts($record,$marcflavour);
108
my $subtitle         = GetRecordValue('subtitle', $record, $fw);
112
my $subtitle         = GetRecordValue('subtitle', $record, $fw);
109
113
110
# Get Branches, Itemtypes and Locations
114
# Get Branches, Itemtypes and Locations
Lines 117-122 my @items; Link Here
117
for my $itm (@all_items) {
121
for my $itm (@all_items) {
118
    push @items, $itm unless ( $itm->{itemlost} && GetHideLostItemsPreference($borrowernumber) && !$showallitems);
122
    push @items, $itm unless ( $itm->{itemlost} && GetHideLostItemsPreference($borrowernumber) && !$showallitems);
119
}
123
}
124
125
# flag indicating existence of at least one item linked via a host record
126
my $hostrecords;
127
# adding items linked via host biblios
128
my @hostitems = GetHostItemsInfo($record);
129
if (@hostitems){
130
	$hostrecords =1;
131
	push (@items,@hostitems);
132
}
133
120
my $dat = &GetBiblioData($biblionumber);
134
my $dat = &GetBiblioData($biblionumber);
121
135
122
# get count of holds
136
# get count of holds
Lines 148-156 if ( defined $dat->{'itemtype'} ) { Link Here
148
    $dat->{imageurl} = getitemtypeimagelocation( 'intranet', $itemtypes->{ $dat->{itemtype} }{imageurl} );
162
    $dat->{imageurl} = getitemtypeimagelocation( 'intranet', $itemtypes->{ $dat->{itemtype} }{imageurl} );
149
}
163
}
150
164
151
$dat->{'count'} = scalar @all_items;
165
$dat->{'count'} = scalar @all_items + @hostitems;
152
$dat->{'showncount'} = scalar @items;
166
$dat->{'showncount'} = scalar @items + @hostitems;
153
$dat->{'hiddencount'} = scalar @all_items - scalar @items;
167
$dat->{'hiddencount'} = scalar @all_items + @hostitems - scalar @items;
154
168
155
my $shelflocations = GetKohaAuthorisedValues('items.location', $fw);
169
my $shelflocations = GetKohaAuthorisedValues('items.location', $fw);
156
my $collections    = GetKohaAuthorisedValues('items.ccode'   , $fw);
170
my $collections    = GetKohaAuthorisedValues('items.ccode'   , $fw);
Lines 158-163 my (@itemloop, %itemfields); Link Here
158
my $norequests = 1;
172
my $norequests = 1;
159
my $authvalcode_items_itemlost = GetAuthValCode('items.itemlost',$fw);
173
my $authvalcode_items_itemlost = GetAuthValCode('items.itemlost',$fw);
160
my $authvalcode_items_damaged  = GetAuthValCode('items.damaged', $fw);
174
my $authvalcode_items_damaged  = GetAuthValCode('items.damaged', $fw);
175
176
my $analytics_flag;
161
foreach my $item (@items) {
177
foreach my $item (@items) {
162
178
163
    $item->{homebranch}        = GetBranchName($item->{homebranch});
179
    $item->{homebranch}        = GetBranchName($item->{homebranch});
Lines 223-228 foreach my $item (@items) { Link Here
223
        $item->{waitingdate} = format_date($wait_hashref->{waitingdate});
239
        $item->{waitingdate} = format_date($wait_hashref->{waitingdate});
224
    }
240
    }
225
241
242
    # item has a host number if its biblio number does not match the current bib
243
    if ($item->{biblionumber} ne $biblionumber){
244
        $item->{hostbiblionumber} = $item->{biblionumber};
245
	$item->{hosttitle} = GetBiblioData($item->{biblionumber})->{title};
246
    }
247
	
248
	#count if item is used in analytical bibliorecords
249
	my $countanalytics= GetAnalyticsCount($item->{itemnumber});
250
	if ($countanalytics > 0){
251
		$analytics_flag=1;
252
		$item->{countanalytics} = $countanalytics;
253
	}
254
226
    push @itemloop, $item;
255
    push @itemloop, $item;
227
}
256
}
228
257
Lines 234-239 $template->param( Link Here
234
	MARCSERIES  => $marcseriesarray,
263
	MARCSERIES  => $marcseriesarray,
235
	MARCURLS => $marcurlsarray,
264
	MARCURLS => $marcurlsarray,
236
    MARCISBNS => $marcisbnsarray,
265
    MARCISBNS => $marcisbnsarray,
266
	MARCHOSTS => $marchostsarray,
237
	subtitle    => $subtitle,
267
	subtitle    => $subtitle,
238
	itemdata_ccode      => $itemfields{ccode},
268
	itemdata_ccode      => $itemfields{ccode},
239
	itemdata_enumchron  => $itemfields{enumchron},
269
	itemdata_enumchron  => $itemfields{enumchron},
Lines 243-248 $template->param( Link Here
243
    itemdata_itemnotes  => $itemfields{itemnotes},
273
    itemdata_itemnotes  => $itemfields{itemnotes},
244
	z3950_search_params	=> C4::Search::z3950_search_args($dat),
274
	z3950_search_params	=> C4::Search::z3950_search_args($dat),
245
    holdcount           => $holdcount,
275
    holdcount           => $holdcount,
276
        hostrecords         => $hostrecords,
277
	analytics_flag	=> $analytics_flag,
246
	C4::Search::enabled_staff_search_views,
278
	C4::Search::enabled_staff_search_views,
247
);
279
);
248
280
Lines 284-290 foreach ( keys %{$dat} ) { Link Here
284
$template->param(
316
$template->param(
285
    itemloop        => \@itemloop,
317
    itemloop        => \@itemloop,
286
    biblionumber        => $biblionumber,
318
    biblionumber        => $biblionumber,
287
    detailview => 1,
319
    ($analyze? 'analyze':'detailview') =>1,
288
    subscriptions       => \@subs,
320
    subscriptions       => \@subs,
289
    subscriptionsnumber => $subscriptionsnumber,
321
    subscriptionsnumber => $subscriptionsnumber,
290
    subscriptiontitle   => $dat->{title},
322
    subscriptiontitle   => $dat->{title},
(-)a/catalogue/moredetail.pl (+18 lines)
Lines 97-102 for my $itm (@all_items) { Link Here
97
                               ($itemnumber != $itm->{itemnumber}));
97
                               ($itemnumber != $itm->{itemnumber}));
98
}
98
}
99
99
100
my $record=GetMarcBiblio($biblionumber);
101
102
my $hostrecords;
103
# adding items linked via host biblios
104
my @hostitems = GetHostItemsInfo($record);
105
if (@hostitems){
106
        $hostrecords =1;
107
        push (@items,@hostitems);
108
}
109
110
111
100
my $totalcount=@all_items;
112
my $totalcount=@all_items;
101
my $showncount=@items;
113
my $showncount=@items;
102
my $hiddencount = $totalcount - $showncount;
114
my $hiddencount = $totalcount - $showncount;
Lines 121-126 foreach my $item (@items){ Link Here
121
    $item->{'datelastseen'}            = format_date( $item->{'datelastseen'} );
133
    $item->{'datelastseen'}            = format_date( $item->{'datelastseen'} );
122
    $item->{'copyvol'}                 = $item->{'copynumber'};
134
    $item->{'copyvol'}                 = $item->{'copynumber'};
123
135
136
    # item has a host number if its biblio number does not match the current bib
137
    if ($item->{biblionumber} ne $biblionumber){
138
        $item->{hostbiblionumber} = $item->{biblionumber};
139
        $item->{hosttitle} = GetBiblioData($item->{biblionumber})->{title};
140
    }
141
124
    my $order = GetOrderFromItemnumber( $item->{'itemnumber'} );
142
    my $order = GetOrderFromItemnumber( $item->{'itemnumber'} );
125
    $item->{'ordernumber'}             = $order->{'ordernumber'};
143
    $item->{'ordernumber'}             = $order->{'ordernumber'};
126
    $item->{'basketno'}                = $order->{'basketno'};
144
    $item->{'basketno'}                = $order->{'basketno'};
(-)a/cataloguing/addbiblio.pl (-1 / +17 lines)
Lines 349-354 sub create_input { Link Here
349
           $value eq '' &&
349
           $value eq '' &&
350
           !$tdef->{$subfield}->{mandatory} &&
350
           !$tdef->{$subfield}->{mandatory} &&
351
           !$tdef->{mandatory};
351
           !$tdef->{mandatory};
352
    # expand all subfields of 773 if there is a host item provided in the input
353
    $subfield_data{visibility} ="" if ($tag eq 773 and $cgi->param('hostitemnumber'));
354
355
352
    # it's an authorised field
356
    # it's an authorised field
353
    if ( $tagslib->{$tag}->{$subfield}->{authorised_value} ) {
357
    if ( $tagslib->{$tag}->{$subfield}->{authorised_value} ) {
354
        $subfield_data{marc_value} =
358
        $subfield_data{marc_value} =
Lines 696-702 sub build_tabs ($$$$$) { Link Here
696
                           # always include in the form regardless of the hidden setting - bug 2206
700
                           # always include in the form regardless of the hidden setting - bug 2206
697
                    next
701
                    next
698
                      if ( $tagslib->{$tag}->{$subfield}->{tab} ne $tabloop );
702
                      if ( $tagslib->{$tag}->{$subfield}->{tab} ne $tabloop );
699
                    push(
703
			push(
700
                        @subfields_data,
704
                        @subfields_data,
701
                        &create_input(
705
                        &create_input(
702
                            $tag, $subfield, '', $index_tag, $tabloop, $record,
706
                            $tag, $subfield, '', $index_tag, $tabloop, $record,
Lines 834-839 my $mode = $input->param('mode'); Link Here
834
my $frameworkcode = $input->param('frameworkcode');
838
my $frameworkcode = $input->param('frameworkcode');
835
my $redirect      = $input->param('redirect');
839
my $redirect      = $input->param('redirect');
836
my $dbh           = C4::Context->dbh;
840
my $dbh           = C4::Context->dbh;
841
my $hostbiblionumber = $input->param('hostbiblionumber');
842
my $hostitemnumber = $input->param('hostitemnumber');
837
843
838
    
844
    
839
my $userflags = 'edit_catalogue';
845
my $userflags = 'edit_catalogue';
Lines 904-909 if (($biblionumber) && !($breedingid)){ Link Here
904
if ($breedingid) {
910
if ($breedingid) {
905
    ( $record, $encoding ) = MARCfindbreeding( $breedingid ) ;
911
    ( $record, $encoding ) = MARCfindbreeding( $breedingid ) ;
906
}
912
}
913
#populate hostfield if hostbiblionumber is available
914
if ($hostbiblionumber){
915
	my $marcflavour = C4::Context->preference("marcflavour");
916
	$record=MARC::Record->new();
917
	$record->leader('');
918
        my $field = PrepHostMarcField($hostbiblionumber, $hostitemnumber,$marcflavour);
919
	$record->append_fields($field);
920
}
907
921
908
$is_a_modif = 0;
922
$is_a_modif = 0;
909
    
923
    
Lines 1055-1060 elsif ( $op eq "delete" ) { Link Here
1055
        biblioitemnumtagfield    => $biblioitemnumtagfield,
1069
        biblioitemnumtagfield    => $biblioitemnumtagfield,
1056
        biblioitemnumtagsubfield => $biblioitemnumtagsubfield,
1070
        biblioitemnumtagsubfield => $biblioitemnumtagsubfield,
1057
        biblioitemnumber         => $biblioitemnumber,
1071
        biblioitemnumber         => $biblioitemnumber,
1072
	hostbiblionumber	=> $hostbiblionumber,
1073
	hostitemnumber		=> $hostitemnumber
1058
    );
1074
    );
1059
}
1075
}
1060
1076
(-)a/cataloguing/additem.pl (+57 lines)
Lines 276-281 my $error = $input->param('error'); Link Here
276
my $biblionumber = $input->param('biblionumber');
276
my $biblionumber = $input->param('biblionumber');
277
my $itemnumber   = $input->param('itemnumber');
277
my $itemnumber   = $input->param('itemnumber');
278
my $op           = $input->param('op');
278
my $op           = $input->param('op');
279
my $hostitemnumber = $input->param('hostitemnumber');
280
my $marcflavour  = C4::Context->preference("marcflavour");
279
281
280
my $frameworkcode = &GetFrameworkCode($biblionumber);
282
my $frameworkcode = &GetFrameworkCode($biblionumber);
281
283
Lines 502-507 if ($op eq "additem") { Link Here
502
        $itemnumber="";
504
        $itemnumber="";
503
    }
505
    }
504
    $nextop="additem";
506
    $nextop="additem";
507
} elsif ($op eq "delinkitem"){
508
    my $analyticfield = '773';
509
	if ($marcflavour  eq 'MARC21' || $marcflavour eq 'NORMARC'){
510
        $analyticfield = '773';
511
    } elsif ($marcflavour eq 'UNIMARC') {
512
        $analyticfield = '461';
513
    }
514
    foreach my $field ($record->field($analyticfield)){
515
        if ($field->subfield('9') eq $hostitemnumber){
516
            $record->delete_field($field);
517
            last;
518
        }
519
    }
520
	my $modbibresult = ModBiblio($record, $biblionumber,'');
505
}
521
}
506
522
507
#
523
#
Lines 512-517 if ($op eq "additem") { Link Here
512
# now, build existiing item list
528
# now, build existiing item list
513
my $temp = GetMarcBiblio( $biblionumber );
529
my $temp = GetMarcBiblio( $biblionumber );
514
#my @fields = $record->fields();
530
#my @fields = $record->fields();
531
532
515
my %witness; #---- stores the list of subfields used at least once, with the "meaning" of the code
533
my %witness; #---- stores the list of subfields used at least once, with the "meaning" of the code
516
my @big_array;
534
my @big_array;
517
#---- finds where items.itemnumber is stored
535
#---- finds where items.itemnumber is stored
Lines 520-525 my ($branchtagfield, $branchtagsubfield) = &GetMarcFromKohaField("items.homebran Link Here
520
C4::Biblio::EmbedItemsInMarcBiblio($temp, $biblionumber);
538
C4::Biblio::EmbedItemsInMarcBiblio($temp, $biblionumber);
521
my @fields = $temp->fields();
539
my @fields = $temp->fields();
522
540
541
542
my @hostitemnumbers;
543
my $analyticfield = '773';
544
if ($marcflavour  eq 'MARC21' || $marcflavour eq 'NORMARC') {
545
    $analyticfield = '773';
546
} elsif ($marcflavour eq 'UNIMARC') {
547
    $analyticfield = '461';
548
}
549
foreach my $hostfield ($temp->field($analyticfield)){
550
    if ($hostfield->subfield('0')){
551
        my $hostrecord = GetMarcBiblio($hostfield->subfield('0'), 1);
552
        my ($itemfield, undef) = GetMarcFromKohaField( 'items.itemnumber', GetFrameworkCode($hostfield->subfield('0')) );
553
        foreach my $hostitem ($hostrecord->field($itemfield)){
554
            if ($hostitem->subfield('9') eq $hostfield->subfield('9')){
555
                push (@fields, $hostitem);
556
                push (@hostitemnumbers, $hostfield->subfield('9'));
557
            }
558
        }
559
    }
560
}
561
562
563
523
foreach my $field (@fields) {
564
foreach my $field (@fields) {
524
    next if ( $field->tag() < 10 );
565
    next if ( $field->tag() < 10 );
525
566
Lines 550-555 foreach my $field (@fields) { Link Here
550
            }
591
            }
551
        }
592
        }
552
        $this_row{itemnumber} = $subfieldvalue if ($field->tag() eq $itemtagfield && $subfieldcode eq $itemtagsubfield);
593
        $this_row{itemnumber} = $subfieldvalue if ($field->tag() eq $itemtagfield && $subfieldcode eq $itemtagsubfield);
594
	foreach my $hostitemnumber (@hostitemnumbers){
595
		if ($this_row{itemnumber} eq $hostitemnumber){
596
			$this_row{hostitemflag} = 1;
597
			$this_row{hostbiblionumber}= GetBiblionumberFromItemnumber($hostitemnumber);
598
			last;
599
		}
600
	}
601
602
#	my $countanalytics=GetAnalyticsCount($this_row{itemnumber});
603
#        if ($countanalytics > 0){
604
#                $this_row{countanalytics} = $countanalytics;
605
#        }
606
553
    }
607
    }
554
    if (%this_row) {
608
    if (%this_row) {
555
        push(@big_array, \%this_row);
609
        push(@big_array, \%this_row);
Lines 570-575 for my $row ( @big_array ) { Link Here
570
    $row_data{itemnumber} = $row->{itemnumber};
624
    $row_data{itemnumber} = $row->{itemnumber};
571
    #reporting this_row values
625
    #reporting this_row values
572
    $row_data{'nomod'} = $row->{'nomod'};
626
    $row_data{'nomod'} = $row->{'nomod'};
627
    $row_data{'hostitemflag'} = $row->{'hostitemflag'};
628
    $row_data{'hostbiblionumber'} = $row->{'hostbiblionumber'};
629
#	$row_data{'countanalytics'} = $row->{'countanalytics'};
573
    push(@item_value_loop,\%row_data);
630
    push(@item_value_loop,\%row_data);
574
}
631
}
575
foreach my $subfield_code (sort keys(%witness)) {
632
foreach my $subfield_code (sort keys(%witness)) {
(-)a/cataloguing/linkitem.pl (+98 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Link an item belonging to an analytical record, the item barcode needs to be provided
4
#
5
# Copyright 2009 BibLibre, 2010 Nucsoft OSS Labs
6
#
7
# This file is part of Koha.
8
#
9
# Koha is free software; you can redistribute it and/or modify it under the
10
# terms of the GNU General Public License as published by the Free Software
11
# Foundation; either version 2 of the License, or (at your option) any later
12
# version.
13
#
14
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
15
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
17
#
18
# You should have received a copy of the GNU General Public License along
19
# with Koha; if not, write to the Free Software Foundation, Inc.,
20
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21
22
use strict;
23
use CGI;
24
use C4::Auth;
25
use C4::Output;
26
use C4::Biblio;
27
use C4::Items;
28
use C4::Context;
29
use C4::Koha;
30
use C4::Branch;
31
32
33
my $query = CGI->new;
34
35
my $biblionumber = $query->param('biblionumber');
36
my $barcode	 = $query->param('barcode');
37
38
my ($template, $loggedinuser, $cookie)
39
    = get_template_and_user({template_name => "cataloguing/linkitem.tmpl",
40
                 query => $query,
41
                 type => "intranet",
42
                 authnotrequired => 0,
43
                 flagsrequired => {editcatalogue => 'edit_catalogue'},
44
                 debug => 1,
45
                 });
46
47
my $biblio = GetMarcBiblio($biblionumber);
48
my $marcflavour = C4::Context->preference("marcflavour");
49
$marcflavour ||="MARC21";
50
if ($marcflavour eq 'MARC21' || $marcflavour eq 'NORMARC') {
51
    $template->param(bibliotitle => $biblio->subfield('245','a'));
52
} elsif ($marcflavour eq 'UNIMARC') {
53
    $template->param(bibliotitle => $biblio->subfield('200','a'));
54
}
55
56
$template->param(biblionumber => $biblionumber);
57
58
if ($barcode && $biblionumber) { 
59
    
60
    # We get the host itemnumber
61
    my $hostitemnumber = GetItemnumberFromBarcode($barcode);
62
63
    if ($hostitemnumber) {
64
	my $hostbiblionumber = GetBiblionumberFromItemnumber($hostitemnumber);
65
66
	if ($hostbiblionumber) {
67
	        my $field = PrepHostMarcField($hostbiblionumber, $hostitemnumber,$marcflavour);
68
		$biblio->append_fields($field);
69
70
		my $modresult = ModBiblio($biblio, $biblionumber, ''); 
71
		if ($modresult) { 
72
			$template->param(success => 1);
73
		} else {
74
			$template->param(error => 1,
75
					 errornomodbiblio => 1); 
76
		}
77
	} else {
78
		$template->param(error => 1,
79
	        	             errornohostbiblionumber => 1);
80
	}
81
    } else {
82
	    $template->param(error => 1,
83
			     errornohostitemnumber => 1);
84
85
    }
86
    $template->param(
87
			barcode => $barcode,  
88
			hostitemnumber => $hostitemnumber,
89
		    );
90
91
} else {
92
    $template->param(missingparameter => 1);
93
    if (!$barcode)      { $template->param(missingbarcode      => 1); }
94
    if (!$biblionumber) { $template->param(missingbiblionumber => 1); }
95
}
96
97
98
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/etc/zebradb/biblios/etc/bib1.att (-1 / +1 lines)
Lines 257-262 att 8031 itype Link Here
257
## Fixed Fields and other special indexes
257
## Fixed Fields and other special indexes
258
att 9901    Extent
258
att 9901    Extent
259
att 8910    Koha-Auth-Number
259
att 8910    Koha-Auth-Number
260
att 8911	Host-Item-Number
260
# record length according to the leader
261
# record length according to the leader
261
att 9905    llength
262
att 9905    llength
262
att 9902    Summary 
263
att 9902    Summary 
Lines 290-293 att 9013 arp Link Here
290
att 9520    Item
291
att 9520    Item
291
# Curriculum
292
# Curriculum
292
att 9658    curriculum
293
att 9658    curriculum
293
(-)a/etc/zebradb/ccl.properties (+3 lines)
Lines 1064-1069 arl 1=9904 r=r Link Here
1064
1064
1065
#Accelerated Reader Point
1065
#Accelerated Reader Point
1066
arp 1=9013 r=r
1066
arp 1=9013 r=r
1067
1067
# Curriculum
1068
# Curriculum
1068
curriculum 1=9658
1069
curriculum 1=9658
1069
1070
Lines 1169-1171 ElementSetName exp1,1=12 Link Here
1169
Item 1=9520
1170
Item 1=9520
1170
item Item
1171
item Item
1171
1172
1173
Host-Item-Number 1=8911
1174
hi Host-Item-Number
(-)a/etc/zebradb/marc_defs/marc21/biblios/record.abs (-1 / +2 lines)
Lines 44-50 melm 001 Control-number Link Here
44
melm 005        Date/time-last-modified
44
melm 005        Date/time-last-modified
45
melm 007        Microform-generation:n:range(data,11,1),Material-type,ff7-00:w:range(data,0,1),ff7-01:w:range(data,1,1),ff7-02:w:range(data,2,1),ff7-01-02:w:range(data,0,2)
45
melm 007        Microform-generation:n:range(data,11,1),Material-type,ff7-00:w:range(data,0,1),ff7-01:w:range(data,1,1),ff7-02:w:range(data,2,1),ff7-01-02:w:range(data,0,2)
46
46
47
melm 008        date-entered-on-file:n:range(data,0,5),date-entered-on-file:s:range(data,0,5),pubdate:w:range(data,7,4),pubdate:n:range(data,7,4),pubdate:y:range(data,7,4),pubdate:s:range(data,7,4),pl:w:range(data,15,3),ta:w:range(data,22,1),ff8-23:w:range(data,23,1),ff8-29:w:range(data,29,1),lf:w:range(data,33,1),bio:w:range(data,34,1),ln:w:range(data,35,3),ctype:w:range(data,24,4),Record-source:w:range(data,39,0)
47
melm 008        date-entered-on-file:n:range(data,0,5),date-entered-on-file:s:range(data,0,5),pubdate:w:range(data,7,4),pubdate:n:range(data,7,4),pubdate:y:range(data,7,4),pubdate:s:range(data,7,4),pl:w:range(data,15,3),ta:w:range(data,22,1),ff8-23:w:range(data,23,1),ff8-29:w:range(data,29,1),lf:w:range(data,33,1),bio:w:range(data,34,1),ln:n:range(data,35,3),ctype:w:range(data,24,4),Record-source:w:range(data,39,0)
48
48
49
melm 010        LC-card-number,Identifier-standard
49
melm 010        LC-card-number,Identifier-standard
50
melm 011        LC-card-number,Identifier-standard
50
melm 011        LC-card-number,Identifier-standard
Lines 227-232 melm 751 Name-geographic Link Here
227
melm 770$w      Record-control-number
227
melm 770$w      Record-control-number
228
melm 772$w      Record-control-number
228
melm 772$w      Record-control-number
229
melm 773$a      Host-item
229
melm 773$a      Host-item
230
melm 773$9	Host-Item-Number
230
melm 773$t      Host-item
231
melm 773$t      Host-item
231
melm 773$w      Record-control-number
232
melm 773$w      Record-control-number
232
melm 774$w      Record-control-number
233
melm 774$w      Record-control-number
(-)a/etc/zebradb/marc_defs/unimarc/biblios/record.abs (+3 lines)
Lines 235-240 melm 441$d pubdate:n Link Here
235
melm 445$d    pubdate:n
235
melm 445$d    pubdate:n
236
melm 461$d    pubdate:n
236
melm 461$d    pubdate:n
237
237
238
#Linking ids
239
melm 461$9    Host-Item-Number
240
238
# Authorities Title
241
# Authorities Title
239
melm 500$9    Koha-Auth-Number,Koha-Auth-Number:n
242
melm 500$9    Koha-Auth-Number,Koha-Auth-Number:n
240
melm 501$9    Koha-Auth-Number,Koha-Auth-Number:n
243
melm 501$9    Koha-Auth-Number,Koha-Auth-Number:n
(-)a/installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql (+2 lines)
Lines 2358-2367 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian` Link Here
2358
		('772', 'x', 'International Standard Serial Number', 'International Standard Serial Number', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, '', '', '', NULL),
2358
		('772', 'x', 'International Standard Serial Number', 'International Standard Serial Number', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, '', '', '', NULL),
2359
		('772', 'y', 'CODEN designation', 'CODEN designation', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, '', '', '', NULL),
2359
		('772', 'y', 'CODEN designation', 'CODEN designation', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, '', '', '', NULL),
2360
		('772', 'z', 'International Standard Book Number', 'International Standard Book Number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, '', '', '', NULL),
2360
		('772', 'z', 'International Standard Book Number', 'International Standard Book Number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, '', '', '', NULL),
2361
                ('773', '0', 'Host Biblionumber', 'Host Biblionumber', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, '', '', '', NULL),
2361
		('773', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, '', '', '', NULL),
2362
		('773', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, '', '', '', NULL),
2362
		('773', '6', 'Linkage', 'Linkage', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, '', '', '', NULL),
2363
		('773', '6', 'Linkage', 'Linkage', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, '', '', '', NULL),
2363
		('773', '7', 'Control subfield', 'Control subfield', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, '', '', '', NULL),
2364
		('773', '7', 'Control subfield', 'Control subfield', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, '', '', '', NULL),
2364
		('773', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, '', '', '', NULL),
2365
		('773', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, '', '', '', NULL),
2366
                ('773', '9', 'Host Itemnumber', 'Host Itemnumber', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, '', '', '', NULL),
2365
		('773', 'a', 'Main entry heading', 'Main entry heading', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, '', '', '', NULL),
2367
		('773', 'a', 'Main entry heading', 'Main entry heading', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, '', '', '', NULL),
2366
		('773', 'b', 'Edition', 'Edition', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, '', '', '', NULL),
2368
		('773', 'b', 'Edition', 'Edition', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, '', '', '', NULL),
2367
		('773', 'd', 'Place, publisher, and date of publication', 'Place, publisher, and date of publication', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, '', '', '', NULL),
2369
		('773', 'd', 'Place, publisher, and date of publication', 'Place, publisher, and date of publication', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, '', '', '', NULL),
(-)a/installer/data/mysql/en/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql (+16 lines)
Lines 2376-2385 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian` Link Here
2376
		('772', 'x', 'International Standard Serial Number', 'International Standard Serial Number', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'BKS', '', '', NULL),
2376
		('772', 'x', 'International Standard Serial Number', 'International Standard Serial Number', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'BKS', '', '', NULL),
2377
		('772', 'y', 'CODEN designation', 'CODEN designation', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'BKS', '', '', NULL),
2377
		('772', 'y', 'CODEN designation', 'CODEN designation', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'BKS', '', '', NULL),
2378
		('772', 'z', 'International Standard Book Number', 'International Standard Book Number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'BKS', '', '', NULL),
2378
		('772', 'z', 'International Standard Book Number', 'International Standard Book Number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'BKS', '', '', NULL),
2379
                ('773', '0', 'Host Biblionumber', 'Host Biblionumber', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'BKS', '', '', NULL),
2379
		('773', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'BKS', '', '', NULL),
2380
		('773', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'BKS', '', '', NULL),
2380
		('773', '6', 'Linkage', 'Linkage', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'BKS', '', '', NULL),
2381
		('773', '6', 'Linkage', 'Linkage', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'BKS', '', '', NULL),
2381
		('773', '7', 'Control subfield', 'Control subfield', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'BKS', '', '', NULL),
2382
		('773', '7', 'Control subfield', 'Control subfield', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'BKS', '', '', NULL),
2382
		('773', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'BKS', '', '', NULL),
2383
		('773', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'BKS', '', '', NULL),
2384
                ('773', '9', 'Host Itemnumber', 'Host Itemnumber', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'BKS', '', '', NULL),
2383
		('773', 'a', 'Main entry heading', 'Main entry heading', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'BKS', '', '', NULL),
2385
		('773', 'a', 'Main entry heading', 'Main entry heading', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'BKS', '', '', NULL),
2384
		('773', 'b', 'Edition', 'Edition', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'BKS', '', '', NULL),
2386
		('773', 'b', 'Edition', 'Edition', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'BKS', '', '', NULL),
2385
		('773', 'd', 'Place, publisher, and date of publication', 'Place, publisher, and date of publication', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'BKS', '', '', NULL),
2387
		('773', 'd', 'Place, publisher, and date of publication', 'Place, publisher, and date of publication', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'BKS', '', '', NULL),
Lines 6302-6311 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian` Link Here
6302
		('772', 'x', 'International Standard Serial Number', 'International Standard Serial Number', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'CF', '', '', NULL),
6304
		('772', 'x', 'International Standard Serial Number', 'International Standard Serial Number', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'CF', '', '', NULL),
6303
		('772', 'y', 'CODEN designation', 'CODEN designation', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'CF', '', '', NULL),
6305
		('772', 'y', 'CODEN designation', 'CODEN designation', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'CF', '', '', NULL),
6304
		('772', 'z', 'International Standard Book Number', 'International Standard Book Number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'CF', '', '', NULL),
6306
		('772', 'z', 'International Standard Book Number', 'International Standard Book Number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'CF', '', '', NULL),
6307
                ('773', '0', 'Host Biblionumber', 'Host Biblionumber', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'CF', '', '', NULL),
6305
		('773', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'CF', '', '', NULL),
6308
		('773', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'CF', '', '', NULL),
6306
		('773', '6', 'Linkage', 'Linkage', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'CF', '', '', NULL),
6309
		('773', '6', 'Linkage', 'Linkage', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'CF', '', '', NULL),
6307
		('773', '7', 'Control subfield', 'Control subfield', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'CF', '', '', NULL),
6310
		('773', '7', 'Control subfield', 'Control subfield', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'CF', '', '', NULL),
6308
		('773', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'CF', '', '', NULL),
6311
		('773', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'CF', '', '', NULL),
6312
                ('773', '9', 'Host Itemnumber', 'Host Itemnumber', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'CF', '', '', NULL),
6309
		('773', 'a', 'Main entry heading', 'Main entry heading', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'CF', '', '', NULL),
6313
		('773', 'a', 'Main entry heading', 'Main entry heading', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'CF', '', '', NULL),
6310
		('773', 'b', 'Edition', 'Edition', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'CF', '', '', NULL),
6314
		('773', 'b', 'Edition', 'Edition', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'CF', '', '', NULL),
6311
		('773', 'd', 'Place, publisher, and date of publication', 'Place, publisher, and date of publication', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'CF', '', '', NULL),
6315
		('773', 'd', 'Place, publisher, and date of publication', 'Place, publisher, and date of publication', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'CF', '', '', NULL),
Lines 10227-10236 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian` Link Here
10227
		('772', 'x', 'International Standard Serial Number', 'International Standard Serial Number', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SR', '', '', NULL),
10231
		('772', 'x', 'International Standard Serial Number', 'International Standard Serial Number', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SR', '', '', NULL),
10228
		('772', 'y', 'CODEN designation', 'CODEN designation', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SR', '', '', NULL),
10232
		('772', 'y', 'CODEN designation', 'CODEN designation', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SR', '', '', NULL),
10229
		('772', 'z', 'International Standard Book Number', 'International Standard Book Number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SR', '', '', NULL),
10233
		('772', 'z', 'International Standard Book Number', 'International Standard Book Number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SR', '', '', NULL),
10234
                ('773', '0', 'Host Biblionumber', 'Host Biblionumber', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SF', '', '', NULL),
10230
		('773', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SR', '', '', NULL),
10235
		('773', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SR', '', '', NULL),
10231
		('773', '6', 'Linkage', 'Linkage', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SR', '', '', NULL),
10236
		('773', '6', 'Linkage', 'Linkage', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SR', '', '', NULL),
10232
		('773', '7', 'Control subfield', 'Control subfield', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SR', '', '', NULL),
10237
		('773', '7', 'Control subfield', 'Control subfield', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SR', '', '', NULL),
10233
		('773', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SR', '', '', NULL),
10238
		('773', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SR', '', '', NULL),
10239
                ('773', '9', 'Host Itemnumber', 'Host Itemnumber', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SR', '', '', NULL),
10234
		('773', 'a', 'Main entry heading', 'Main entry heading', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SR', '', '', NULL),
10240
		('773', 'a', 'Main entry heading', 'Main entry heading', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SR', '', '', NULL),
10235
		('773', 'b', 'Edition', 'Edition', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SR', '', '', NULL),
10241
		('773', 'b', 'Edition', 'Edition', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SR', '', '', NULL),
10236
		('773', 'd', 'Place, publisher, and date of publication', 'Place, publisher, and date of publication', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SR', '', '', NULL),
10242
		('773', 'd', 'Place, publisher, and date of publication', 'Place, publisher, and date of publication', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SR', '', '', NULL),
Lines 14152-14161 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian` Link Here
14152
		('772', 'x', 'International Standard Serial Number', 'International Standard Serial Number', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'VR', '', '', NULL),
14158
		('772', 'x', 'International Standard Serial Number', 'International Standard Serial Number', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'VR', '', '', NULL),
14153
		('772', 'y', 'CODEN designation', 'CODEN designation', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'VR', '', '', NULL),
14159
		('772', 'y', 'CODEN designation', 'CODEN designation', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'VR', '', '', NULL),
14154
		('772', 'z', 'International Standard Book Number', 'International Standard Book Number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'VR', '', '', NULL),
14160
		('772', 'z', 'International Standard Book Number', 'International Standard Book Number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'VR', '', '', NULL),
14161
                ('773', '0', 'Host Biblionumber', 'Host Biblionumber', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'VR', '', '', NULL),
14155
		('773', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'VR', '', '', NULL),
14162
		('773', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'VR', '', '', NULL),
14156
		('773', '6', 'Linkage', 'Linkage', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'VR', '', '', NULL),
14163
		('773', '6', 'Linkage', 'Linkage', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'VR', '', '', NULL),
14157
		('773', '7', 'Control subfield', 'Control subfield', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'VR', '', '', NULL),
14164
		('773', '7', 'Control subfield', 'Control subfield', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'VR', '', '', NULL),
14158
		('773', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'VR', '', '', NULL),
14165
		('773', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'VR', '', '', NULL),
14166
                ('773', '9', 'Host Itemnumber', 'Host Itemnumber', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'VR', '', '', NULL),
14159
		('773', 'a', 'Main entry heading', 'Main entry heading', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'VR', '', '', NULL),
14167
		('773', 'a', 'Main entry heading', 'Main entry heading', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'VR', '', '', NULL),
14160
		('773', 'b', 'Edition', 'Edition', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'VR', '', '', NULL),
14168
		('773', 'b', 'Edition', 'Edition', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'VR', '', '', NULL),
14161
		('773', 'd', 'Place, publisher, and date of publication', 'Place, publisher, and date of publication', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'VR', '', '', NULL),
14169
		('773', 'd', 'Place, publisher, and date of publication', 'Place, publisher, and date of publication', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'VR', '', '', NULL),
Lines 18075-18084 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian` Link Here
18075
		('772', 'x', 'International Standard Serial Number', 'International Standard Serial Number', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'AR', '', '', NULL),
18083
		('772', 'x', 'International Standard Serial Number', 'International Standard Serial Number', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'AR', '', '', NULL),
18076
		('772', 'y', 'CODEN designation', 'CODEN designation', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'AR', '', '', NULL),
18084
		('772', 'y', 'CODEN designation', 'CODEN designation', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'AR', '', '', NULL),
18077
		('772', 'z', 'International Standard Book Number', 'International Standard Book Number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'AR', '', '', NULL),
18085
		('772', 'z', 'International Standard Book Number', 'International Standard Book Number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'AR', '', '', NULL),
18086
                ('773', '0', 'Host Biblionumber', 'Host Biblionumber', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'AR', '', '', NULL),
18078
		('773', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'AR', '', '', NULL),
18087
		('773', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'AR', '', '', NULL),
18079
		('773', '6', 'Linkage', 'Linkage', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'AR', '', '', NULL),
18088
		('773', '6', 'Linkage', 'Linkage', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'AR', '', '', NULL),
18080
		('773', '7', 'Control subfield', 'Control subfield', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'AR', '', '', NULL),
18089
		('773', '7', 'Control subfield', 'Control subfield', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'AR', '', '', NULL),
18081
		('773', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'AR', '', '', NULL),
18090
		('773', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'AR', '', '', NULL),
18091
                ('773', '9', 'Host Itemnumber', 'Host Itemnumber', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'AR', '', '', NULL),
18082
		('773', 'a', 'Main entry heading', 'Main entry heading', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'AR', '', '', NULL),
18092
		('773', 'a', 'Main entry heading', 'Main entry heading', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'AR', '', '', NULL),
18083
		('773', 'b', 'Edition', 'Edition', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'AR', '', '', NULL),
18093
		('773', 'b', 'Edition', 'Edition', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'AR', '', '', NULL),
18084
		('773', 'd', 'Place, publisher, and date of publication', 'Place, publisher, and date of publication', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'AR', '', '', NULL),
18094
		('773', 'd', 'Place, publisher, and date of publication', 'Place, publisher, and date of publication', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'AR', '', '', NULL),
Lines 21998-22007 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian` Link Here
21998
		('772', 'x', 'International Standard Serial Number', 'International Standard Serial Number', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'KT', '', '', NULL),
22008
		('772', 'x', 'International Standard Serial Number', 'International Standard Serial Number', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'KT', '', '', NULL),
21999
		('772', 'y', 'CODEN designation', 'CODEN designation', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'KT', '', '', NULL),
22009
		('772', 'y', 'CODEN designation', 'CODEN designation', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'KT', '', '', NULL),
22000
		('772', 'z', 'International Standard Book Number', 'International Standard Book Number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'KT', '', '', NULL),
22010
		('772', 'z', 'International Standard Book Number', 'International Standard Book Number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'KT', '', '', NULL),
22011
                ('773', '0', 'Host Biblionumber', 'Host Biblionumber', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'KT', '', '', NULL),
22001
		('773', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'KT', '', '', NULL),
22012
		('773', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'KT', '', '', NULL),
22002
		('773', '6', 'Linkage', 'Linkage', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'KT', '', '', NULL),
22013
		('773', '6', 'Linkage', 'Linkage', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'KT', '', '', NULL),
22003
		('773', '7', 'Control subfield', 'Control subfield', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'KT', '', '', NULL),
22014
		('773', '7', 'Control subfield', 'Control subfield', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'KT', '', '', NULL),
22004
		('773', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'KT', '', '', NULL),
22015
		('773', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'KT', '', '', NULL),
22016
                ('773', '9', 'Host Itemnumber', 'Host Itemnumber', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'KT', '', '', NULL),
22005
		('773', 'a', 'Main entry heading', 'Main entry heading', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'KT', '', '', NULL),
22017
		('773', 'a', 'Main entry heading', 'Main entry heading', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'KT', '', '', NULL),
22006
		('773', 'b', 'Edition', 'Edition', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'KT', '', '', NULL),
22018
		('773', 'b', 'Edition', 'Edition', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'KT', '', '', NULL),
22007
		('773', 'd', 'Place, publisher, and date of publication', 'Place, publisher, and date of publication', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'KT', '', '', NULL),
22019
		('773', 'd', 'Place, publisher, and date of publication', 'Place, publisher, and date of publication', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'KT', '', '', NULL),
Lines 25922-25931 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian` Link Here
25922
		('772', 'x', 'International Standard Serial Number', 'International Standard Serial Number', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'IR', '', '', NULL),
25934
		('772', 'x', 'International Standard Serial Number', 'International Standard Serial Number', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'IR', '', '', NULL),
25923
		('772', 'y', 'CODEN designation', 'CODEN designation', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'IR', '', '', NULL),
25935
		('772', 'y', 'CODEN designation', 'CODEN designation', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'IR', '', '', NULL),
25924
		('772', 'z', 'International Standard Book Number', 'International Standard Book Number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'IR', '', '', NULL),
25936
		('772', 'z', 'International Standard Book Number', 'International Standard Book Number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'IR', '', '', NULL),
25937
                ('773', '0', 'Host Biblionumber', 'Host Biblionumber', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'IR', '', '', NULL),
25925
		('773', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'IR', '', '', NULL),
25938
		('773', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'IR', '', '', NULL),
25926
		('773', '6', 'Linkage', 'Linkage', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'IR', '', '', NULL),
25939
		('773', '6', 'Linkage', 'Linkage', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'IR', '', '', NULL),
25927
		('773', '7', 'Control subfield', 'Control subfield', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'IR', '', '', NULL),
25940
		('773', '7', 'Control subfield', 'Control subfield', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'IR', '', '', NULL),
25928
		('773', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'IR', '', '', NULL),
25941
		('773', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'IR', '', '', NULL),
25942
                ('773', '9', 'Host Itemnumber', 'Host Itemnumber', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'IR', '', '', NULL),
25929
		('773', 'a', 'Main entry heading', 'Main entry heading', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'IR', '', '', NULL),
25943
		('773', 'a', 'Main entry heading', 'Main entry heading', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'IR', '', '', NULL),
25930
		('773', 'b', 'Edition', 'Edition', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'IR', '', '', NULL),
25944
		('773', 'b', 'Edition', 'Edition', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'IR', '', '', NULL),
25931
		('773', 'd', 'Place, publisher, and date of publication', 'Place, publisher, and date of publication', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'IR', '', '', NULL),
25945
		('773', 'd', 'Place, publisher, and date of publication', 'Place, publisher, and date of publication', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'IR', '', '', NULL),
Lines 29842-29851 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian` Link Here
29842
		('772', 'x', 'International Standard Serial Number', 'International Standard Serial Number', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SER', '', '', NULL),
29856
		('772', 'x', 'International Standard Serial Number', 'International Standard Serial Number', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SER', '', '', NULL),
29843
		('772', 'y', 'CODEN designation', 'CODEN designation', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SER', '', '', NULL),
29857
		('772', 'y', 'CODEN designation', 'CODEN designation', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SER', '', '', NULL),
29844
		('772', 'z', 'International Standard Book Number', 'International Standard Book Number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SER', '', '', NULL),
29858
		('772', 'z', 'International Standard Book Number', 'International Standard Book Number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SER', '', '', NULL),
29859
                ('773', '0', 'Host Biblionumber', 'Host Biblionumber', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SER', '', '', NULL),
29845
		('773', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SER', '', '', NULL),
29860
		('773', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SER', '', '', NULL),
29846
		('773', '6', 'Linkage', 'Linkage', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SER', '', '', NULL),
29861
		('773', '6', 'Linkage', 'Linkage', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SER', '', '', NULL),
29847
		('773', '7', 'Control subfield', 'Control subfield', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SER', '', '', NULL),
29862
		('773', '7', 'Control subfield', 'Control subfield', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SER', '', '', NULL),
29848
		('773', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SER', '', '', NULL),
29863
		('773', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SER', '', '', NULL),
29864
                ('773', '9', 'Host Itemnumber', 'Host Itemnumber', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SER', '', '', NULL),
29849
		('773', 'a', 'Main entry heading', 'Main entry heading', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SER', '', '', NULL),
29865
		('773', 'a', 'Main entry heading', 'Main entry heading', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SER', '', '', NULL),
29850
		('773', 'b', 'Edition', 'Edition', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SER', '', '', NULL),
29866
		('773', 'b', 'Edition', 'Edition', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SER', '', '', NULL),
29851
		('773', 'd', 'Place, publisher, and date of publication', 'Place, publisher, and date of publication', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SER', '', '', NULL),
29867
		('773', 'd', 'Place, publisher, and date of publication', 'Place, publisher, and date of publication', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, 'SER', '', '', NULL),
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 318-320 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( Link Here
318
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('BasketConfirmations', '1', 'When closing or reopening a basket,', 'always ask for confirmation.|do not ask for confirmation.', 'Choice');
318
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('BasketConfirmations', '1', 'When closing or reopening a basket,', 'always ask for confirmation.|do not ask for confirmation.', 'Choice');
319
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('MARCAuthorityControlField008', '|| aca||aabn           | a|a     d', NULL, NULL, 'Textarea');
319
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('MARCAuthorityControlField008', '|| aca||aabn           | a|a     d', NULL, NULL, 'Textarea');
320
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0,'If ON Openlibrary book covers will be show',NULL,'YesNo');
320
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0,'If ON Openlibrary book covers will be show',NULL,'YesNo');
321
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('EasyAnalyticalRecords','0','If on, display in the catalogue screens tools to easily setup analytical record relationships','','YesNo');
(-)a/installer/data/mysql/updatedatabase.pl (+23 lines)
Lines 4445-4450 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
4445
    print "Upgrade to $DBversion done (add OPACResultsSidebar syspref (enh 6165))\n";
4445
    print "Upgrade to $DBversion done (add OPACResultsSidebar syspref (enh 6165))\n";
4446
    SetVersion($DBversion);
4446
    SetVersion($DBversion);
4447
}
4447
}
4448
    
4449
$DBversion = '3.05.00.XXX';
4450
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4451
    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('EasyAnalyticalRecords','0','If on, display in the catalogue screens tools to easily setup analytical record relationships','','YesNo');");
4452
    print "Upgrade to $DBversion done (Add EasyAnalyticalRecords syspref)\n";
4453
    SetVersion ($DBversion);
4454
}
4455
4456
$DBversion = '3.05.00.XXX';
4457
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4458
    if (C4::Context->preference("marcflavour") eq 'MARC21' ||
4459
        C4::Context->preference("marcflavour") eq 'NORMARC'){
4460
        $dbh->do("INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value` , `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('773', '0', 'Host Biblionumber', 'Host Biblionumber', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, '', '', '', NULL)");
4461
        $dbh->do("INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value` , `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('773', '9', 'Host Itemnumber', 'Host Itemnumber', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, '', '', '', NULL)");
4462
        print "Upgrade to $DBversion done (Add 773 subfield 9 and 0 to default framework)\n";
4463
        SetVersion ($DBversion);
4464
    } elsif (C4::Context->preference("marcflavour") eq 'UNIMARC'){
4465
        $dbh->do("INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value` , `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('461', '9', 'Host Itemnumber', 'Host Itemnumber', 0, 0, NULL, 7, NULL, NULL, '', NULL, -6, '', '', '', NULL)");
4466
        print "Upgrade to $DBversion done (Add 461 subfield 9 to default framework)\n";
4467
        SetVersion ($DBversion);
4468
    }
4469
		
4470
}
4448
4471
4449
4472
4450
=head1 FUNCTIONS
4473
=head1 FUNCTIONS
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc (+1 lines)
Lines 23-28 Link Here
23
    [% IF ( CAN_user_reserveforothers ) %]
23
    [% IF ( CAN_user_reserveforothers ) %]
24
    [% IF ( holdsview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% IF ( object ) %][% object %][% ELSE %][% biblionumber %][% END %]">Holds</a></li>
24
    [% IF ( holdsview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% IF ( object ) %][% object %][% ELSE %][% biblionumber %][% END %]">Holds</a></li>
25
    [% END %]
25
    [% END %]
26
    [% IF ( EasyAnalyticalRecords ) %][% IF ( analyze ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% IF ( object ) %][% object %]&analyze=1[% ELSE %][% biblionumber %]&analyze=1[% END %]">Analytics</a></li>[% END %]
26
27
27
    [% IF ( subscriptionsnumber ) %]<li><a href="/cgi-bin/koha/serials/serials-home.pl?searched=1&amp;biblionumber=[% biblionumber %]">Subscription(s)</a></li>[% END %]
28
    [% IF ( subscriptionsnumber ) %]<li><a href="/cgi-bin/koha/serials/serials-home.pl?searched=1&amp;biblionumber=[% biblionumber %]">Subscription(s)</a></li>[% END %]
28
</ul>
29
</ul>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc (+2 lines)
Lines 82-87 function confirm_items_deletion() { Link Here
82
			[% IF ( CAN_user_editcatalogue_edit_items ) %]{text: _("New Item"), url: "/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber %]#additema" },[% END %]
82
			[% IF ( CAN_user_editcatalogue_edit_items ) %]{text: _("New Item"), url: "/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber %]#additema" },[% END %]
83
			[% IF ( CAN_user_serials_create_subscription ) %]
83
			[% IF ( CAN_user_serials_create_subscription ) %]
84
			{text: _("New Subscription"), url: "/cgi-bin/koha/serials/subscription-add.pl?biblionumber_for_new_subscription=[% biblionumber %]"},[% END %]
84
			{text: _("New Subscription"), url: "/cgi-bin/koha/serials/subscription-add.pl?biblionumber_for_new_subscription=[% biblionumber %]"},[% END %]
85
			[% IF ( EasyAnalyticalRecords ) %][% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{text: _("Analyze items"), url: "/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]&analyze=1" },[% END %][% END %]
85
		];
86
		];
86
		if(newmenu.length){
87
		if(newmenu.length){
87
			new YAHOO.widget.Button({
88
			new YAHOO.widget.Button({
Lines 97-102 function confirm_items_deletion() { Link Here
97
	        [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Edit Record"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]&amp;frameworkcode=&amp;op=" },[% END %]
98
	        [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Edit Record"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]&amp;frameworkcode=&amp;op=" },[% END %]
98
	        [% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Edit Items"), url: "/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber %]" },[% END %]
99
	        [% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Edit Items"), url: "/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber %]" },[% END %]
99
	        [% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Attach Item"), url: "/cgi-bin/koha/cataloguing/moveitem.pl?biblionumber=[% biblionumber %]" },[% END %]
100
	        [% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Attach Item"), url: "/cgi-bin/koha/cataloguing/moveitem.pl?biblionumber=[% biblionumber %]" },[% END %]
101
                [% IF ( EasyAnalyticalRecords ) %][% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Link to Host Item"), url: "/cgi-bin/koha/cataloguing/linkitem.pl?biblionumber=[% biblionumber %]" },[% END %][% END %]
100
	        [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Edit as New (Duplicate)"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]&amp;frameworkcode=&amp;op=duplicate" },[% END %]
102
	        [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Edit as New (Duplicate)"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]&amp;frameworkcode=&amp;op=duplicate" },[% END %]
101
			[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Replace Record via Z39.50"), onclick: {fn: PopupZ3950 } },[% END %]
103
			[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Replace Record via Z39.50"), onclick: {fn: PopupZ3950 } },[% END %]
102
			[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Delete Record"), onclick: {fn: confirm_deletion }[% IF ( count ) %],id:'disabled'[% END %] },[% END %]
104
			[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Delete Record"), onclick: {fn: confirm_deletion }[% IF ( count ) %],id:'disabled'[% END %] },[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (+6 lines)
Lines 12-17 Cataloging: Link Here
12
                  yes: "Don't display"
12
                  yes: "Don't display"
13
                  no: Display
13
                  no: Display
14
            - descriptions of fields and subfields in the MARC editor.
14
            - descriptions of fields and subfields in the MARC editor.
15
        -
16
            - pref: EasyAnalyticalRecords
17
              choices:
18
                  yes: Display
19
                  no: "Don't Display"
20
            - easy ways to create analytical record relationships
15
    Spine Labels:
21
    Spine Labels:
16
        -
22
        -
17
            - When using the quick spine label printer,
23
            - When using the quick spine label printer,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-1 / +15 lines)
Lines 248-253 function verify_images() { Link Here
248
                [% IF ( itemdata_copynumber ) %]<th>Copy No.</th>[% END %]
248
                [% IF ( itemdata_copynumber ) %]<th>Copy No.</th>[% END %]
249
                [% IF ( itemdata_itemnotes ) %]<th>Public notes</th>[% END %]
249
                [% IF ( itemdata_itemnotes ) %]<th>Public notes</th>[% END %]
250
		[% IF ( SpineLabelShowPrintOnBibDetails ) %]<th>Spine Label</th>[% END %]
250
		[% IF ( SpineLabelShowPrintOnBibDetails ) %]<th>Spine Label</th>[% END %]
251
		[% IF ( hostrecords ) %]<th>Host Records</th>[% END %]
252
		[% IF ( analyze ) %]<th>Used in</th>[% END %]
253
		[% IF ( analyze ) %]<th></th>[% END %]
251
            </tr>
254
            </tr>
252
            [% FOREACH itemloo IN itemloop %]
255
            [% FOREACH itemloo IN itemloop %]
253
                <tr>
256
                <tr>
Lines 360-367 function verify_images() { Link Here
360
						[% IF ( itemloo.enumchron ) %]
363
						[% IF ( itemloo.enumchron ) %]
361
						[% itemloo.enumchron %][% IF ( itemloo.serialseq ) %] -- [% END %]
364
						[% itemloo.enumchron %][% IF ( itemloo.serialseq ) %] -- [% END %]
362
						[% END %]
365
						[% END %]
363
					[% END %]
364
					[% itemloo.serialseq %][% IF ( itemloo.publisheddate ) %] ([% itemloo.publisheddate %])[% END %]
366
					[% itemloo.serialseq %][% IF ( itemloo.publisheddate ) %] ([% itemloo.publisheddate %])[% END %]
367
					[% END %]
365
				</td>[% END %]
368
				</td>[% END %]
366
				[% IF ( itemdata_uri ) %]
369
				[% IF ( itemdata_uri ) %]
367
					<td class="uri"><a href="[% itemloo.uri %]">[% itemloo.uri %]</a></td>
370
					<td class="uri"><a href="[% itemloo.uri %]">[% itemloo.uri %]</a></td>
Lines 373-378 function verify_images() { Link Here
373
		[% IF ( SpineLabelShowPrintOnBibDetails ) %]
376
		[% IF ( SpineLabelShowPrintOnBibDetails ) %]
374
			<td><a href="/cgi-bin/koha/labels/spinelabel-print.pl?barcode=[% itemloo.barcode %]" >Print Label</a></td>
377
			<td><a href="/cgi-bin/koha/labels/spinelabel-print.pl?barcode=[% itemloo.barcode %]" >Print Label</a></td>
375
		[% END %]
378
		[% END %]
379
                [% IF ( hostrecords ) %]
380
                      <td>[% IF ( itemloo.hostbiblionumber) %]<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% itemloo.hostbiblionumber %]" >[% itemloo.hosttitle %]</a>[% END %]</td>
381
                [% END %]
382
                [% IF ( analyze ) %]<td>
383
			[% IF ( itemloo.countanalytics ) %]
384
                      		<a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&q=[% itemloo.itemnumber %]">[% itemloo.countanalytics %] analytics</a>
385
			[% END %]</td>
386
		[% END %]
387
                [% IF ( analyze ) %]
388
                        <td><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?hostbiblionumber=[% itemloo.biblionumber %]&hostitemnumber=[% itemloo.itemnumber %]">Create Analytics</a></td>
389
                [% END %]
376
390
377
                </tr>
391
                </tr>
378
            [% END %]
392
            [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt (-2 / +5 lines)
Lines 190-195 function set_to_today(id, force) { Link Here
190
[% IF ( book_on_loan ) %]<div class="dialog alert"><strong>Cannot Delete</strong>: item is checked out.</div>[% END %]
190
[% IF ( book_on_loan ) %]<div class="dialog alert"><strong>Cannot Delete</strong>: item is checked out.</div>[% END %]
191
[% IF ( book_reserved ) %]<div class="dialogalert"><strong>Cannot Delete</strong>: item has a waiting hold.</div>[% END %]
191
[% IF ( book_reserved ) %]<div class="dialogalert"><strong>Cannot Delete</strong>: item has a waiting hold.</div>[% END %]
192
[% IF ( not_same_branch ) %]<div class="dialog alert"><strong>Cannot Delete</strong>: The items do not belong to your branch.</div>[% END %]
192
[% IF ( not_same_branch ) %]<div class="dialog alert"><strong>Cannot Delete</strong>: The items do not belong to your branch.</div>[% END %]
193
[% IF ( linked_analytics ) %]<div class="dialog alert"><strong>Cannot Delete</strong>: item has linked <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]&analyze=1">analytics.</a>.</div>[% END %]
193
194
194
<div id="cataloguing_additem_itemlist">
195
<div id="cataloguing_additem_itemlist">
195
    [% IF ( item_loop ) %]
196
    [% IF ( item_loop ) %]
Lines 205-212 function set_to_today(id, force) { Link Here
205
            </tr>
206
            </tr>
206
                [% FOREACH item_loo IN item_loop %]
207
                [% FOREACH item_loo IN item_loop %]
207
                <tr id="row[% item_loo.itemnumber %]">
208
                <tr id="row[% item_loo.itemnumber %]">
208
                    [% IF ( item_loo.nomod ) %] <td colspan="2">&nbsp;</td>[% ELSE %]<td><a href="additem.pl?op=edititem&amp;biblionumber=[% biblionumber %]&amp;itemnumber=[% item_loo.itemnumber %]#edititem">Edit</a></td>
209
                    [% IF ( item_loo.nomod ) %] <td colspan="2">&nbsp;</td>[% ELSE %][% IF ( item_loo.hostitemflag ) %]<td><a href="additem.pl?op=edititem&amp;biblionumber=[% item_loo.hostbiblionumber %]&amp;itemnumber=[% item_loo.itemnumber %]#edititem">Edit in Host</a></td>
209
                    <td><a class="delete" href="/cgi-bin/koha/cataloguing/additem.pl?op=delitem&amp;biblionumber=[% biblionumber %]&amp;itemnumber=[% item_loo.itemnumber %]" onclick="confirm_deletion([% biblionumber %],[% item_loo.itemnumber %]); return false;">Delete</a></td>[% END %]
210
<td><a class="delete" href="/cgi-bin/koha/cataloguing/additem.pl?op=delinkitem&amp;biblionumber=[% biblionumber %]&amp;hostitemnumber=[% item_loo.itemnumber %]">Delink</a></td>
211
[% ELSE %]<td><a href="additem.pl?op=edititem&amp;biblionumber=[% biblionumber %]&amp;itemnumber=[% item_loo.itemnumber %]#edititem">Edit</a></td>
212
                    <td>[% IF ( item_loo.countanalytics ) %]<a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&q=% item_loo.itemnumber %]">view analytics</a>[% ELSE %]<a class="delete" href="/cgi-bin/koha/cataloguing/additem.pl?op=delitem&amp;biblionumber=[% biblionumber %]&amp;itemnumber=[% item_loo.itemnumber %]" onclick="confirm_deletion([% biblionumber %],[% item_loo.itemnumber %]); return false;">Delete</a>[% END %]</td>[% END %][% END %]
210
                [% FOREACH item_valu IN item_loo.item_value %]
213
                [% FOREACH item_valu IN item_loo.item_value %]
211
                    <td>[% item_valu.field |html %]</td>
214
                    <td>[% item_valu.field |html %]</td>
212
                [% END %]
215
                [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/linkitem.tt (+57 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Link to host item</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
</head>
5
<body>
6
[% INCLUDE 'header.inc' %]
7
[% INCLUDE 'cat-search.inc' %]
8
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/cataloging/addbooks.pl">Cataloging</a>  &rsaquo; Link a host item to <i>[% bibliotitle |html %]</i></div>
9
<div id="doc3" class="yui-t2">
10
11
[% IF ( error ) %]
12
    <div class="dialog alert">
13
	[% IF ( errornomodbiblio ) %]ERROR: Unable to modify the bibliographic record.[% END %]
14
	[% IF ( errornohostbiblionumber ) %]ERROR: Unable to get the biblio number of host item.[% END %]
15
	[% IF ( errornohostitemnumber ) %]ERROR: Unable to get the item number from this barcode.[% END %]
16
    </div>
17
    <form action="/cgi-bin/koha/catalogue/MARCdetail.pl" method="post">
18
	<input type="submit" value="OK" />
19
	<input type="hidden" name="biblionumber" value="[% biblionumber %]" />
20
    </form>
21
[% ELSE %]
22
    [% IF ( success ) %]
23
	<div class="dialog">The item has successfully been linked to <i>[% bibliotitle |html %]</i>.</div>    
24
	<form action="/cgi-bin/koha/catalogue/MARCdetail.pl" method="post">
25
	    <input type="submit" value="OK" />
26
	    <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
27
	</form>
28
    [% ELSE %]
29
	[% IF ( missingparameter ) %]
30
	<form method="post" action="/cgi-bin/koha/cataloguing/linkitem.pl">
31
	    [% IF ( missingbiblionumber ) %]
32
	    <fieldset id="biblionumber_fieldset">
33
		<label for="biblionumber_fieldset">Select the biblionumber to link the item to</label>
34
		    <div class="hint">Enter biblionumber:</div>
35
		    <input type="text" name="biblionumber" id="biblionumber" class="focus" size="14" /> 
36
	    </fieldset>
37
	    [% ELSE %]
38
	    <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblionumber %]" />
39
	    [% END %]
40
41
    	    [% IF ( missingbarcode ) %]
42
	    <fieldset id="barcode_fieldset">
43
		<label for="barcode_fieldset">Select the host item to link[% IF ( bibliotitle ) %] to <i>[% bibliotitle |html %]</i>[% END %]</label>
44
		    <div class="hint">Enter item barcode:</div>
45
		    <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" /> 
46
	    </fieldset>
47
	    [% ELSE %]
48
	    <input type="hidden" name="barcode" id="barcode" value="[% barcode %]" />
49
	    [% END %]
50
51
	    <input type="submit" value="Select" />
52
53
	</form>
54
	[% END %]
55
    [% END %]
56
[% END %]
57
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl (+5 lines)
Lines 564-569 Link Here
564
                    </a>
564
                    </a>
565
                    <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
565
                    <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
566
                </xsl:when>
566
                </xsl:when>
567
                <xsl:when test="marc:subfield[@code='0']">
568
                    <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/detail.pl?biblionumber=<xsl:value-of select="marc:subfield[@code='0']"/></xsl:attribute>
569
                        <xsl:value-of select="$f773"/>
570
                    </a>
571
                </xsl:when>
567
                <xsl:otherwise>
572
                <xsl:otherwise>
568
                    <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Title:<xsl:value-of select="translate($f773, '()', '')"/></xsl:attribute>
573
                    <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Title:<xsl:value-of select="translate($f773, '()', '')"/></xsl:attribute>
569
                        <xsl:value-of select="$f773"/>
574
                        <xsl:value-of select="$f773"/>
(-)a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl (+5 lines)
Lines 678-683 Link Here
678
                    </a>
678
                    </a>
679
                    <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
679
                    <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
680
                </xsl:when>
680
                </xsl:when>
681
                <xsl:when test="marc:subfield[@code='0']">
682
                    <a><xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="marc:subfield[@code='0']"/></xsl:attribute>
683
                        <xsl:value-of select="$f773"/>
684
                    </a>
685
                </xsl:when>
681
                <xsl:otherwise>
686
                <xsl:otherwise>
682
                    <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Title:<xsl:value-of select="translate($f773, '()', '')"/></xsl:attribute>
687
                    <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Title:<xsl:value-of select="translate($f773, '()', '')"/></xsl:attribute>
683
                        <xsl:value-of select="$f773"/>
688
                        <xsl:value-of select="$f773"/>
(-)a/misc/migration_tools/create_analytical_rel.pl (+152 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
use strict;
4
#use warnings; FIXME - Bug 2505
5
BEGIN {
6
    # find Koha's Perl modules
7
    # test carefully before changing this
8
    use FindBin;
9
    eval { require "$FindBin::Bin/../kohalib.pl" };
10
}
11
12
use C4::Context;
13
use C4::Biblio;
14
use C4::Items;
15
use Getopt::Long;
16
17
$| = 1;
18
19
# command-line parameters
20
my $want_help = 0;
21
my $do_update = 0;
22
my $wherestrings;
23
24
my $result = GetOptions(
25
    'run-update'    => \$do_update,
26
    'where=s@'         => \$wherestrings,
27
    'h|help'        => \$want_help,
28
);
29
30
if (not $result or $want_help or not $do_update) {
31
    print_usage();
32
    exit 0;
33
}
34
35
my $num_bibs_processed     = 0;
36
my $num_bibs_modified      = 0;
37
my $num_nobib_foritemnumber = 0;
38
my $num_noitem_forbarcode = 0;
39
my $num_nobarcode_inhostfield =0;
40
my $num_hostfields_unabletomodify =0;
41
my $num_bad_bibs           = 0;
42
my $dbh = C4::Context->dbh;
43
$dbh->{AutoCommit} = 0;
44
45
process_bibs();
46
$dbh->commit();
47
48
exit 0;
49
50
sub process_bibs {
51
    my $sql = "SELECT biblionumber FROM biblio JOIN biblioitems USING (biblionumber)";
52
    $sql.="WHERE ". join(" AND ",@$wherestrings) if ($wherestrings);
53
    $sql.="ORDER BY biblionumber ASC";
54
    my $sth = $dbh->prepare($sql);
55
    eval{$sth->execute();};
56
    if ($@){ die "error $@";};
57
    while (my ($biblionumber) = $sth->fetchrow_array()) {
58
        $num_bibs_processed++;
59
        process_bib($biblionumber);
60
61
        if (($num_bibs_processed % 100) == 0) {
62
            print_progress_and_commit($num_bibs_processed);
63
        }
64
    }
65
66
    $dbh->commit;
67
68
    print <<_SUMMARY_;
69
70
Create Analytical records relationships report
71
-----------------------------------------------
72
Number of bibs checked:                   $num_bibs_processed
73
Number of bibs modified:                  $num_bibs_modified
74
Number of hostfields with no barcodes:		$num_nobarcode_inhostfield
75
Number of barcodes not found:                   $num_noitem_forbarcode
76
Number of hostfields unable to modify:		$num_hostfields_unabletomodify
77
Number of bibs with errors:               $num_bad_bibs
78
_SUMMARY_
79
}
80
81
sub process_bib {
82
    my $biblionumber = shift;
83
84
    my $bib = GetMarcBiblio($biblionumber);
85
    unless (defined $bib) {
86
        print "\nCould not retrieve bib $biblionumber from the database - record is corrupt.\n";
87
        $num_bad_bibs++;
88
        return;
89
    }
90
	#loop through each host field and populate subfield 0 and 9
91
    my $analyticfield = '773';
92
	foreach my $hostfield ( $bib->field($analyticfield) ) {
93
		if(my $barcode = $hostfield->subfield('o')){
94
			my $itemnumber = GetItemnumberFromBarcode($barcode);
95
			if ($itemnumber ne undef){
96
				my $bibnumber = GetBiblionumberFromItemnumber($itemnumber);
97
				if ($bibnumber ne undef){
98
					my $modif;
99
					if ($hostfield->subfield('0') ne $bibnumber){
100
						$hostfield->update('0', $bibnumber);
101
						$modif = 1;
102
					}
103
					if ($hostfield->subfield('9') ne $itemnumber){
104
						$hostfield->update('9', $itemnumber);
105
						$modif=1;
106
					}
107
					if ($modif){
108
						$num_bibs_modified++;
109
						my $modresult = ModBiblio($bib, $biblionumber, '');
110
						warn "Modifying biblio $biblionumber";
111
						if (!$modresult){
112
							warn "Unable to modify biblio $biblionumber with update host field";
113
							$num_hostfields_unabletomodify++;
114
						}
115
					}
116
				} else {
117
					warn "No biblio record found corressponding to itemnumber $itemnumber";
118
					$num_nobib_foritemnumber++;
119
				}
120
			} else {
121
				warn "No item record found for barcode $barcode";
122
				$num_noitem_forbarcode++;
123
			}
124
		} else{
125
			warn "No barcode in host field for biblionumber $biblionumber";
126
			$num_nobarcode_inhostfield++;
127
		}
128
	}
129
}
130
131
sub print_progress_and_commit {
132
    my $recs = shift;
133
    $dbh->commit();
134
    print "... processed $recs records\n";
135
}
136
137
sub print_usage {
138
    print <<_USAGE_;
139
$0: establish relationship to host items
140
141
Based on barcode in host field populates subfield 0 with host biblionumber and subfield 9 with host itemnumber.
142
143
Subfield 0 and 9 are used in Koha screns to display relationships between analytical records and host bibs and items.
144
145
NOT usable with UNIMARC data. You can use it only if you have tag 461 with also an items id (like barcode or item numbers). In UNIMARC this situation is very rare. If you have data coded in this way, send a mail to koha-dev mailing list and ask for the feature.
146
147
Parameters:
148
    --run-update            run the synchronization
149
    --where condition       selects the biblios on a criterium (Repeatable)
150
    --help or -h            show this message.
151
_USAGE_
152
}
(-)a/opac/opac-detail.pl (-1 / +23 lines)
Lines 86-91 if (C4::Context->preference("OPACXSLTDetailsDisplay") ) { Link Here
86
$template->param('OPACShowCheckoutName' => C4::Context->preference("OPACShowCheckoutName") ); 
86
$template->param('OPACShowCheckoutName' => C4::Context->preference("OPACShowCheckoutName") ); 
87
# change back when ive fixed request.pl
87
# change back when ive fixed request.pl
88
my @all_items = GetItemsInfo( $biblionumber );
88
my @all_items = GetItemsInfo( $biblionumber );
89
90
# adding items linked via host biblios
91
my $marcflavour  = C4::Context->preference("marcflavour");
92
93
my $analyticfield = '773';
94
if ($marcflavour eq 'MARC21' || $marcflavour eq 'NORMARC'){
95
    $analyticfield = '773';
96
} elsif ($marcflavour eq 'UNIMARC') {
97
    $analyticfield = '461';
98
}
99
foreach my $hostfield ( $record->field($analyticfield)) {
100
    my $hostbiblionumber = $hostfield->subfield("0");
101
    my $linkeditemnumber = $hostfield->subfield("9");
102
    my @hostitemInfos = GetItemsInfo($hostbiblionumber);
103
    foreach my $hostitemInfo (@hostitemInfos){
104
        if ($hostitemInfo->{itemnumber} eq $linkeditemnumber){
105
            push(@all_items, $hostitemInfo);
106
        }
107
    }
108
}
109
89
my @items;
110
my @items;
90
111
91
# Getting items to be hidden
112
# Getting items to be hidden
Lines 217-229 for my $itm (@items) { Link Here
217
238
218
## get notes and subjects from MARC record
239
## get notes and subjects from MARC record
219
my $dbh              = C4::Context->dbh;
240
my $dbh              = C4::Context->dbh;
220
my $marcflavour      = C4::Context->preference("marcflavour");
221
my $marcnotesarray   = GetMarcNotes   ($record,$marcflavour);
241
my $marcnotesarray   = GetMarcNotes   ($record,$marcflavour);
222
my $marcisbnsarray   = GetMarcISBN    ($record,$marcflavour);
242
my $marcisbnsarray   = GetMarcISBN    ($record,$marcflavour);
223
my $marcauthorsarray = GetMarcAuthors ($record,$marcflavour);
243
my $marcauthorsarray = GetMarcAuthors ($record,$marcflavour);
224
my $marcsubjctsarray = GetMarcSubjects($record,$marcflavour);
244
my $marcsubjctsarray = GetMarcSubjects($record,$marcflavour);
225
my $marcseriesarray  = GetMarcSeries  ($record,$marcflavour);
245
my $marcseriesarray  = GetMarcSeries  ($record,$marcflavour);
226
my $marcurlsarray    = GetMarcUrls    ($record,$marcflavour);
246
my $marcurlsarray    = GetMarcUrls    ($record,$marcflavour);
247
my $marchostsarray  = GetMarcHosts($record,$marcflavour);
227
my $subtitle         = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber));
248
my $subtitle         = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber));
228
249
229
    $template->param(
250
    $template->param(
Lines 232-237 my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($bib Link Here
232
                     MARCAUTHORS             => $marcauthorsarray,
253
                     MARCAUTHORS             => $marcauthorsarray,
233
                     MARCSERIES              => $marcseriesarray,
254
                     MARCSERIES              => $marcseriesarray,
234
                     MARCURLS                => $marcurlsarray,
255
                     MARCURLS                => $marcurlsarray,
256
		     MARCHOSTS               => $marchostsarray,
235
                     norequests              => $norequests,
257
                     norequests              => $norequests,
236
                     RequestOnOpac           => C4::Context->preference("RequestOnOpac"),
258
                     RequestOnOpac           => C4::Context->preference("RequestOnOpac"),
237
                     itemdata_ccode          => $itemfields{ccode},
259
                     itemdata_ccode          => $itemfields{ccode},
(-)a/opac/opac-reserve.pl (-1 / +35 lines)
Lines 123-128 foreach my $biblioNumber (@biblionumbers) { Link Here
123
    $biblioDataHash{$biblioNumber} = $biblioData;
123
    $biblioDataHash{$biblioNumber} = $biblioData;
124
124
125
    my @itemInfos = GetItemsInfo($biblioNumber);
125
    my @itemInfos = GetItemsInfo($biblioNumber);
126
127
    my $marcrecord= GetMarcBiblio($biblioNumber);
128
129
	# flag indicating existence of at least one item linked via a host record
130
	my $hostitemsflag;
131
	# adding items linked via host biblios
132
	my @hostitemInfos = GetHostItemsInfo($marcrecord);
133
	if (@hostitemInfos){
134
		$hostitemsflag =1;
135
	        push (@itemInfos,@hostitemInfos);
136
	}
137
138
139
126
    $biblioData->{itemInfos} = \@itemInfos;
140
    $biblioData->{itemInfos} = \@itemInfos;
127
    foreach my $itemInfo (@itemInfos) {
141
    foreach my $itemInfo (@itemInfos) {
128
        $itemInfoHash{$itemInfo->{itemnumber}} = $itemInfo;
142
        $itemInfoHash{$itemInfo->{itemnumber}} = $itemInfo;
Lines 188-193 if ( $query->param('place_reserve') ) { Link Here
188
            $branch = $borr->{'branchcode'};
202
            $branch = $borr->{'branchcode'};
189
        }
203
        }
190
204
205
	#item may belong to a host biblio, if yes change biblioNum to hosts bilbionumber
206
	if ($itemNum ne '') {
207
		my $hostbiblioNum = GetBiblionumberFromItemnumber($itemNum);
208
		if ($hostbiblioNum ne $biblioNum) {
209
			$biblioNum = $hostbiblioNum;
210
		}
211
	}
212
191
        my $biblioData = $biblioDataHash{$biblioNum};
213
        my $biblioData = $biblioDataHash{$biblioNum};
192
        my $found;
214
        my $found;
193
215
Lines 382-387 foreach my $biblioNum (@biblionumbers) { Link Here
382
        my ($reservedate,$reservedfor,$expectedAt) = GetReservesFromItemnumber($itemNum);
404
        my ($reservedate,$reservedfor,$expectedAt) = GetReservesFromItemnumber($itemNum);
383
        my $ItemBorrowerReserveInfo = GetMemberDetails( $reservedfor, 0);
405
        my $ItemBorrowerReserveInfo = GetMemberDetails( $reservedfor, 0);
384
406
407
	# the item could be reserved for this borrower vi a host record, flag this
408
	if ($reservedfor eq $borrowernumber){
409
		$itemLoopIter->{already_reserved} = 1;
410
	}
411
385
        if ( defined $reservedate ) {
412
        if ( defined $reservedate ) {
386
            $itemLoopIter->{backgroundcolor} = 'reserved';
413
            $itemLoopIter->{backgroundcolor} = 'reserved';
387
            $itemLoopIter->{reservedate}     = format_date($reservedate);
414
            $itemLoopIter->{reservedate}     = format_date($reservedate);
Lines 423-428 foreach my $biblioNum (@biblionumbers) { Link Here
423
            $itemLoopIter->{nocancel} = 1;
450
            $itemLoopIter->{nocancel} = 1;
424
        }
451
        }
425
452
453
	# if the items belongs to a host record, show link to host record
454
	if ($itemInfo->{biblionumber} ne $biblioNum){
455
		$biblioLoopIter{hostitemsflag} = 1;
456
		$itemLoopIter->{hostbiblionumber} = $itemInfo->{biblionumber};
457
		$itemLoopIter->{hosttitle} = GetBiblioData($itemInfo->{biblionumber})->{title};
458
	}
459
426
        # If there is no loan, return and transfer, we show a checkbox.
460
        # If there is no loan, return and transfer, we show a checkbox.
427
        $itemLoopIter->{notforloan} = $itemLoopIter->{notforloan} || 0;
461
        $itemLoopIter->{notforloan} = $itemLoopIter->{notforloan} || 0;
428
462
Lines 436-442 foreach my $biblioNum (@biblionumbers) { Link Here
436
            $policy_holdallowed = 0;
470
            $policy_holdallowed = 0;
437
        }
471
        }
438
472
439
        if (IsAvailableForItemLevelRequest($itemNum) and $policy_holdallowed and CanItemBeReserved($borrowernumber,$itemNum)) {
473
        if (IsAvailableForItemLevelRequest($itemNum) and $policy_holdallowed and CanItemBeReserved($borrowernumber,$itemNum) and ($itemLoopIter->{already_reserved} ne 1)) {
440
            $itemLoopIter->{available} = 1;
474
            $itemLoopIter->{available} = 1;
441
            $numCopiesAvailable++;
475
            $numCopiesAvailable++;
442
        }
476
        }
(-)a/reserve/placerequest.pl (+9 lines)
Lines 98-103 if ($type eq 'str8' && $borrower){ Link Here
98
        }
98
        }
99
        my $const;
99
        my $const;
100
100
101
	if ($checkitem ne ''){
102
		my $item = GetItem($checkitem);
103
        	if ($item->{'biblionumber'} ne $biblionumber) {
104
                	$biblionumber = $item->{'biblionumber'};
105
        	}
106
	}
107
108
109
101
        if ($multi_hold) {
110
        if ($multi_hold) {
102
            my $bibinfo = $bibinfos{$biblionumber};
111
            my $bibinfo = $bibinfos{$biblionumber};
103
            AddReserve($branch,$borrower->{'borrowernumber'},$biblionumber,'a',[$biblionumber],
112
            AddReserve($branch,$borrower->{'borrowernumber'},$biblionumber,'a',[$biblionumber],
(-)a/reserve/request.pl (-2 / +15 lines)
Lines 291-297 foreach my $biblionumber (@biblionumbers) { Link Here
291
    if (my $items = get_itemnumbers_of($biblionumber)->{$biblionumber}){
291
    if (my $items = get_itemnumbers_of($biblionumber)->{$biblionumber}){
292
        @itemnumbers  = @$items;
292
        @itemnumbers  = @$items;
293
    }
293
    }
294
    else {
294
	my @hostitems = get_hostitemnumbers_of($biblionumber);
295
	if (@hostitems){
296
		$template->param('hostitemsflag' => 1);
297
		push(@itemnumbers, @hostitems);
298
	}
299
300
    if (!@itemnumbers) {
295
        $template->param('noitems' => 1);
301
        $template->param('noitems' => 1);
296
        $biblioloopiter{noitems} = 1;
302
        $biblioloopiter{noitems} = 1;
297
    }
303
    }
Lines 324-329 foreach my $biblionumber (@biblionumbers) { Link Here
324
330
325
        $biblioitem->{description} =
331
        $biblioitem->{description} =
326
          $itemtypes->{ $biblioitem->{itemtype} }{description};
332
          $itemtypes->{ $biblioitem->{itemtype} }{description};
333
	if($biblioitem->{biblioitemnumber} ne $biblionumber){
334
		$biblioitem->{hostitemsflag}=1;
335
	}
327
        $biblioloopiter{description} = $biblioitem->{description};
336
        $biblioloopiter{description} = $biblioitem->{description};
328
        $biblioloopiter{itypename} = $biblioitem->{description};
337
        $biblioloopiter{itypename} = $biblioitem->{description};
329
        $biblioloopiter{imageurl} =
338
        $biblioloopiter{imageurl} =
Lines 347-352 foreach my $biblionumber (@biblionumbers) { Link Here
347
                  $branches->{ $item->{holdingbranch} }{branchname};
356
                  $branches->{ $item->{holdingbranch} }{branchname};
348
            }
357
            }
349
358
359
		if($item->{biblionumber} ne $biblionumber){
360
			$item->{hostitemsflag}=1;
361
		        $item->{hosttitle} = GetBiblioData($item->{biblionumber})->{title};
362
		}
363
		
350
            #   add information
364
            #   add information
351
            $item->{itemcallnumber} = $item->{itemcallnumber};
365
            $item->{itemcallnumber} = $item->{itemcallnumber};
352
366
353
- 

Return to bug 5528