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 (+125 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" ) {
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" ) {
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, '', '',
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
    };
1912
    if ($marcflavour eq "UNIMARC") {
1913
        $hostmarcfield = MARC::Field->new(
1914
            461, '', '',
1915
            '0' => $hostbiblionumber,
1916
            't' => $hostrecord->subfield('200','a'), 
1917
            '9' => $hostitemnumber
1918
        );	
1919
    };
1920
1921
    return $hostmarcfield;
1922
}
1923
1924
1800
=head2 TransformKohaToMarcOneField
1925
=head2 TransformKohaToMarcOneField
1801
1926
1802
    $record = TransformKohaToMarcOneField( $sth, $record, $kohafieldname, $value, $frameworkcode );
1927
    $record = TransformKohaToMarcOneField( $sth, $record, $kohafieldname, $value, $frameworkcode );
(-)a/C4/Items.pm (-21 / +129 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
	    foreach my $hostfield ( $record->field('773') ) {
1415
        	my $hostbiblionumber = $hostfield->subfield("0");
1416
	        my $linkeditemnumber = $hostfield->subfield("9");
1417
        	my @hostitemInfos = GetItemsInfo($hostbiblionumber);
1418
	        foreach my $hostitemInfo (@hostitemInfos){
1419
        	        if ($hostitemInfo->{itemnumber} eq $linkeditemnumber){
1420
                	        push (@returnitemsInfo,$hostitemInfo);
1421
				last;
1422
                	}
1423
        	}
1424
	    }
1425
	}
1426
	if ( 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'){$tag='773';$biblio_s='0';$item_s='9'};
1548
	if ($marcflavor eq 'UNIMARC'){$tag='461';$biblio_s='0';$item_s='9'};
1549
	
1550
        foreach my $hostfield ( $marcrecord->field($tag) ) {
1551
                my $hostbiblionumber = $hostfield->subfield($biblio_s);
1552
                my $linkeditemnumber = $hostfield->subfield($item_s);
1553
		my @itemnumbers;
1554
                if (my $itemnumbers = get_itemnumbers_of($hostbiblionumber)->{$hostbiblionumber})
1555
		{
1556
			@itemnumbers = @$itemnumbers;
1557
		}
1558
                foreach my $itemnumber (@itemnumbers){
1559
                        if ($itemnumber eq $linkeditemnumber){
1560
                                push (@returnhostitemnumbers,$itemnumber);
1561
                                last;
1562
                        }
1563
                }
1564
	}
1565
        return @returnhostitemnumbers;
1566
}
1567
1568
1485
=head2 GetItemnumberFromBarcode
1569
=head2 GetItemnumberFromBarcode
1486
1570
1487
  $result = GetItemnumberFromBarcode($barcode);
1571
  $result = GetItemnumberFromBarcode($barcode);
Lines 2094-2128 sub DelItemCheck { Link Here
2094
    my ( $dbh, $biblionumber, $itemnumber ) = @_;
2178
    my ( $dbh, $biblionumber, $itemnumber ) = @_;
2095
    my $error;
2179
    my $error;
2096
2180
2181
        my $countanalytics=GetAnalyticsCount($itemnumber);
2182
2183
2097
    # check that there is no issue on this item before deletion.
2184
    # check that there is no issue on this item before deletion.
2098
    my $sth=$dbh->prepare("select * from issues i where i.itemnumber=?");
2185
    my $sth=$dbh->prepare("select * from issues i where i.itemnumber=?");
2099
    $sth->execute($itemnumber);
2186
    $sth->execute($itemnumber);
2100
2187
2101
    my $item = GetItem($itemnumber);
2188
    my $item = GetItem($itemnumber);
2102
    my $onloan = $sth->fetchrow;
2189
    my $onloan=$sth->fetchrow;
2103
    if ($onloan) {
2190
2104
        $error = "book_on_loan";
2191
    if ($onloan){
2192
        $error = "book_on_loan" 
2105
    }
2193
    }
2106
    elsif (C4::Context->preference("IndependantBranches") and (C4::Context->userenv->{branch} ne $item->{C4::Context->preference("HomeOrHoldingBranch")||'homebranch'})){
2194
    elsif (C4::Context->preference("IndependantBranches") and (C4::Context->userenv->{branch} ne $item->{C4::Context->preference("HomeOrHoldingBranch")||'homebranch'})){
2107
        $error = "not_same_branch";
2195
        $error = "not_same_branch";
2108
    } 
2196
    }
2109
    else {
2197
	else{
2110
	if ($onloan){ 
2198
        # check it doesnt have a waiting reserve
2111
	    $error = "book_on_loan" 
2199
        $sth=$dbh->prepare("SELECT * FROM reserves WHERE (found = 'W' or found = 'T') AND itemnumber = ?");
2112
	}
2200
        $sth->execute($itemnumber);
2113
	else {
2201
        my $reserve=$sth->fetchrow;
2114
	    # check it doesnt have a waiting reserve
2202
        if ($reserve){
2115
	    $sth=$dbh->prepare("SELECT * FROM reserves WHERE (found = 'W' or found = 'T') AND itemnumber = ?");
2203
            $error = "book_reserved";
2116
	    $sth->execute($itemnumber);
2204
        } elsif ($countanalytics > 0){
2117
	    my $reserve=$sth->fetchrow;
2205
		$error = "linked_analytics";
2118
	    if ($reserve) {
2206
	} else {
2119
		$error = "book_reserved";
2207
            DelItem($dbh, $biblionumber, $itemnumber);
2120
	    } 
2208
            return 1;
2121
	    else {
2209
        }
2122
		DelItem($dbh, $biblionumber, $itemnumber);
2123
		return 1;
2124
	    }
2125
	}
2126
    }
2210
    }
2127
    return $error;
2211
    return $error;
2128
}
2212
}
Lines 2339-2342 sub _parse_unlinked_item_subfields_from_xml { Link Here
2339
    return $unlinked_subfields;
2423
    return $unlinked_subfields;
2340
}
2424
}
2341
2425
2426
=head2 GetAnalyticsCount
2427
2428
  $count= &GetAnalyticsCount($itemnumber)
2429
2430
counts Usage of itemnumber in Analytical bibliorecords. 
2431
2432
=cut
2433
2434
sub GetAnalyticsCount {
2435
    my ($itemnumber) = @_;
2436
    if (C4::Context->preference('NoZebra')) {
2437
        # Read the index Koha-Auth-Number for this authid and count the lines
2438
        my $result = C4::Search::NZanalyse("hi=$itemnumber");
2439
        my @tab = split /;/,$result;
2440
        return scalar @tab;
2441
    } else {
2442
        ### ZOOM search here
2443
        my $query;
2444
        $query= "hi=".$itemnumber;
2445
                my ($err,$res,$result) = C4::Search::SimpleSearch($query,0,10);
2446
        return ($result);
2447
    }
2448
}
2449
2342
1;
2450
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 (+42 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
        if ($marcflavor eq 'MARC21'){
1565
            foreach my $hostfield ( $marcrecord->field('773')) {
1566
                my $hostbiblionumber = $hostfield->subfield("0");
1567
                my $linkeditemnumber = $hostfield->subfield("9");
1568
                if(!$hostbiblionumber eq undef){
1569
                        my $hostbiblio = GetMarcBiblio($hostbiblionumber, 1);
1570
                        if(!$hostbiblio eq undef){
1571
                        my @hostitems = $hostbiblio->field('952');
1572
                        foreach my $hostitem (@hostitems){
1573
                                if ($hostitem->subfield("9") eq $linkeditemnumber){
1574
                                        my $linkeditem =$hostitem;
1575
                                         # append linked items if they exist
1576
                                        if (!$linkeditem eq undef){
1577
                                        push (@fields, $linkeditem);}
1578
                                }
1579
                        }
1580
                        }
1581
                }
1582
            }
1583
        }
1584
        if ($marcflavor eq 'UNIMARC'){
1585
            foreach my $hostfield ( $marcrecord->field('461')) {
1586
                my $hostbiblionumber = $hostfield->subfield("0");
1587
                my $linkeditemnumber = $hostfield->subfield("9");
1588
                if(!$hostbiblionumber eq undef){
1589
                        my $hostbiblio = GetMarcBiblio($hostbiblionumber, 1);
1590
                        if(!$hostbiblio eq undef){
1591
                        my @hostitems = $hostbiblio->field('995');
1592
                        foreach my $hostitem (@hostitems){
1593
                                if ($hostitem->subfield("9") eq $linkeditemnumber){
1594
                                        my $linkeditem =$hostitem;
1595
                                         # append linked items if they exist
1596
                                        if (!$linkeditem eq undef){
1597
                                        push (@fields, $linkeditem);}
1598
                                }
1599
                        }
1600
                    }
1601
                }
1602
            }
1603
        }
1562
1604
1563
        # Setting item statuses for display
1605
        # Setting item statuses for display
1564
        my @available_items_loop;
1606
        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 (+54 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
	if ($marcflavour  eq 'MARC21'){
509
	    foreach my $field ($record->field('773')){
510
		if ($field->subfield('9') eq $hostitemnumber){
511
			$record->delete_field($field);
512
			last;
513
		}
514
	    }
515
	}
516
	if ($marcflavour  eq 'UNIMARC'){
517
	    foreach my $field ($record->field('461')){
518
		if ($field->subfield('9') eq $hostitemnumber){
519
			$record->delete_field($field);
520
			last;
521
		}
522
	    }
523
	}	
524
	my $modbibresult = ModBiblio($record, $biblionumber,'');
505
}
525
}
506
526
507
#
527
#
Lines 512-517 if ($op eq "additem") { Link Here
512
# now, build existiing item list
532
# now, build existiing item list
513
my $temp = GetMarcBiblio( $biblionumber );
533
my $temp = GetMarcBiblio( $biblionumber );
514
#my @fields = $record->fields();
534
#my @fields = $record->fields();
535
536
515
my %witness; #---- stores the list of subfields used at least once, with the "meaning" of the code
537
my %witness; #---- stores the list of subfields used at least once, with the "meaning" of the code
516
my @big_array;
538
my @big_array;
517
#---- finds where items.itemnumber is stored
539
#---- finds where items.itemnumber is stored
Lines 520-525 my ($branchtagfield, $branchtagsubfield) = &GetMarcFromKohaField("items.homebran Link Here
520
C4::Biblio::EmbedItemsInMarcBiblio($temp, $biblionumber);
542
C4::Biblio::EmbedItemsInMarcBiblio($temp, $biblionumber);
521
my @fields = $temp->fields();
543
my @fields = $temp->fields();
522
544
545
546
my @hostitemnumbers;
547
foreach my $hostfield ($temp->field('773')){
548
        if ($hostfield->subfield('0')){
549
                my $hostrecord = GetMarcBiblio($hostfield->subfield('0'), 1);
550
                foreach my $hostitem ($hostrecord->field('952')){
551
                        if ($hostitem->subfield('9') eq $hostfield->subfield('9')){
552
                                push (@fields, $hostitem);
553
                                push (@hostitemnumbers, $hostfield->subfield('9'));
554
                        }
555
                }
556
        }
557
}
558
559
560
523
foreach my $field (@fields) {
561
foreach my $field (@fields) {
524
    next if ( $field->tag() < 10 );
562
    next if ( $field->tag() < 10 );
525
563
Lines 550-555 foreach my $field (@fields) { Link Here
550
            }
588
            }
551
        }
589
        }
552
        $this_row{itemnumber} = $subfieldvalue if ($field->tag() eq $itemtagfield && $subfieldcode eq $itemtagsubfield);
590
        $this_row{itemnumber} = $subfieldvalue if ($field->tag() eq $itemtagfield && $subfieldcode eq $itemtagsubfield);
591
	foreach my $hostitemnumber (@hostitemnumbers){
592
		if ($this_row{itemnumber} eq $hostitemnumber){
593
			$this_row{hostitemflag} = 1;
594
			$this_row{hostbiblionumber}= GetBiblionumberFromItemnumber($hostitemnumber);
595
			last;
596
		}
597
	}
598
599
#	my $countanalytics=GetAnalyticsCount($this_row{itemnumber});
600
#        if ($countanalytics > 0){
601
#                $this_row{countanalytics} = $countanalytics;
602
#        }
603
553
    }
604
    }
554
    if (%this_row) {
605
    if (%this_row) {
555
        push(@big_array, \%this_row);
606
        push(@big_array, \%this_row);
Lines 570-575 for my $row ( @big_array ) { Link Here
570
    $row_data{itemnumber} = $row->{itemnumber};
621
    $row_data{itemnumber} = $row->{itemnumber};
571
    #reporting this_row values
622
    #reporting this_row values
572
    $row_data{'nomod'} = $row->{'nomod'};
623
    $row_data{'nomod'} = $row->{'nomod'};
624
    $row_data{'hostitemflag'} = $row->{'hostitemflag'};
625
    $row_data{'hostbiblionumber'} = $row->{'hostbiblionumber'};
626
#	$row_data{'countanalytics'} = $row->{'countanalytics'};
573
    push(@item_value_loop,\%row_data);
627
    push(@item_value_loop,\%row_data);
574
}
628
}
575
foreach my $subfield_code (sort keys(%witness)) {
629
foreach my $subfield_code (sort keys(%witness)) {
(-)a/cataloguing/linkitem.pl (+95 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'){$template->param(bibliotitle => $biblio->subfield('245','a'))};
51
if ($marcflavour eq 'UNIMARC'){$template->param(bibliotitle => $biblio->subfield('200','a'))};
52
53
$template->param(biblionumber => $biblionumber);
54
55
if ($barcode && $biblionumber) { 
56
    
57
    # We get the host itemnumber
58
    my $hostitemnumber = GetItemnumberFromBarcode($barcode);
59
60
    if ($hostitemnumber) {
61
	my $hostbiblionumber = GetBiblionumberFromItemnumber($hostitemnumber);
62
63
	if ($hostbiblionumber) {
64
	        my $field = PrepHostMarcField($hostbiblionumber, $hostitemnumber,$marcflavour);
65
		$biblio->append_fields($field);
66
67
		my $modresult = ModBiblio($biblio, $biblionumber, ''); 
68
		if ($modresult) { 
69
			$template->param(success => 1);
70
		} else {
71
			$template->param(error => 1,
72
					 errornomodbiblio => 1); 
73
		}
74
	} else {
75
		$template->param(error => 1,
76
	        	             errornohostbiblionumber => 1);
77
	}
78
    } else {
79
	    $template->param(error => 1,
80
			     errornohostitemnumber => 1);
81
82
    }
83
    $template->param(
84
			barcode => $barcode,  
85
			hostitemnumber => $hostitemnumber,
86
		    );
87
88
} else {
89
    $template->param(missingparameter => 1);
90
    if (!$barcode)      { $template->param(missingbarcode      => 1); }
91
    if (!$biblionumber) { $template->param(missingbiblionumber => 1); }
92
}
93
94
95
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 (+15 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
    $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)");
4459
    $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)");
4460
    print "Upgrade to $DBversion done (Add 773 subfield 9 and 0 to default framework)\n";
4461
    SetVersion ($DBversion);
4462
}
4448
4463
4449
4464
4450
=head1 FUNCTIONS
4465
=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.tmpl (+57 lines)
Line 0 Link Here
1
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2
<title>Link to host item</title>
3
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4
</head>
5
<body>
6
<!-- TMPL_INCLUDE NAME="header.inc" -->
7
<!-- TMPL_INCLUDE NAME="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><!-- TMPL_VAR NAME="bibliotitle" escape="html" --></i></div>
9
<div id="doc3" class="yui-t2">
10
11
<!-- TMPL_IF NAME="error" -->
12
    <div class="dialog alert">
13
	<!-- TMPL_IF NAME="errornomodbiblio" -->ERROR: Unable to modify the bibliographic record.<!-- /TMPL_IF -->
14
	<!-- TMPL_IF NAME="errornohostbiblionumber" -->ERROR: Unable to get the biblio number of host item.<!-- /TMPL_IF -->
15
	<!-- TMPL_IF NAME="errornohostitemnumber" -->ERROR: Unable to get the item number from this barcode.<!-- /TMPL_IF -->
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="<!-- TMPL_VAR NAME="biblionumber" -->" />
20
    </form>
21
<!-- TMPL_ELSE -->
22
    <!-- TMPL_IF NAME="success" -->
23
	<div class="dialog">The item has successfully been linked to <i><!-- TMPL_VAR NAME="bibliotitle" escape="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="<!-- TMPL_VAR NAME="biblionumber" -->" />
27
	</form>
28
    <!-- TMPL_ELSE -->
29
	<!-- TMPL_IF NAME="missingparameter" -->
30
	<form method="post" action="/cgi-bin/koha/cataloguing/linkitem.pl">
31
	    <!-- TMPL_IF NAME="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
	    <!-- TMPL_ELSE -->
38
	    <input type="hidden" name="biblionumber" id="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
39
	    <!-- /TMPL_IF -->
40
41
    	    <!-- TMPL_IF NAME="missingbarcode" -->
42
	    <fieldset id="barcode_fieldset">
43
		<label for="barcode_fieldset">Select the host item to link<!-- TMPL_IF NAME="bibliotitle" --> to <i><!-- TMPL_VAR NAME="bibliotitle" escape="html" --></i><!-- /TMPL_IF --></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
	    <!-- TMPL_ELSE -->
48
	    <input type="hidden" name="barcode" id="barcode" value="<!-- TMPL_VAR NAME="barcode" -->" />
49
	    <!-- /TMPL_IF -->
50
51
	    <input type="submit" value="Select" />
52
53
	</form>
54
	<!-- /TMPL_IF -->
55
    <!-- /TMPL_IF -->
56
<!-- /TMPL_IF -->
57
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
(-)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 (+23 lines)
Lines 273-278 Link Here
273
        </span>
273
        </span>
274
        </xsl:if>
274
        </xsl:if>
275
275
276
        <!-- Host item entry -->
277
        <xsl:if test="marc:datafield[@tag=773]">
278
        <span class="results_summary"><span class="label">In: </span>
279
        <xsl:for-each select="marc:datafield[@tag=773]">
280
            <a>
281
            <xsl:choose>
282
            <xsl:when test="marc:subfield[@code='0']">
283
                <xsl:attribute name="href">/cgi-bin/koha/catalogue/detail.pl?biblionumber=<xsl:value-of select="marc:subfield[@code='0']"/></xsl:attribute>
284
            </xsl:when>
285
            <xsl:otherwise>
286
                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Title:<xsl:value-of select="translate(//marc:datafield[@tag=773]/marc:subfield[@code='t'], '.', '')"/></xsl:attribute>
287
            </xsl:otherwise>
288
            </xsl:choose>
289
            <xsl:value-of select="translate(//marc:datafield[@tag=773]/marc:subfield[@code='t'], '.', '')" />
290
            </a>
291
            <xsl:choose>
292
                <xsl:when test="position()=last()"></xsl:when>
293
                <xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
294
            </xsl:choose>
295
        </xsl:for-each>
296
        </span>
297
        </xsl:if>
298
276
        <!-- Publisher Statement: Alternate Graphic Representation (MARC 880) -->
299
        <!-- Publisher Statement: Alternate Graphic Representation (MARC 880) -->
277
        <xsl:if test="$display880">
300
        <xsl:if test="$display880">
278
            <xsl:call-template name="m880Select">
301
            <xsl:call-template name="m880Select">
(-)a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl (+23 lines)
Lines 330-335 Link Here
330
        </span>
330
        </span>
331
        </xsl:if>
331
        </xsl:if>
332
332
333
        <!-- Host item entry -->
334
        <xsl:if test="marc:datafield[@tag=773]">
335
        <span class="results_summary"><span class="label">In: </span>
336
        <xsl:for-each select="marc:datafield[@tag=773]">
337
            <a>
338
            <xsl:choose>
339
            <xsl:when test="marc:subfield[@code='0']">
340
                <xsl:attribute name="href">/cgi-bin/koha/catalogue/detail.pl?biblionumber=<xsl:value-of select="marc:subfield[@code='0']"/></xsl:attribute>
341
            </xsl:when>
342
            <xsl:otherwise>
343
                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Title:<xsl:value-of select="translate(//marc:datafield[@tag=773]/marc:subfield[@code='t'], '.', '')"/></xsl:attribute>
344
            </xsl:otherwise>
345
            </xsl:choose>
346
            <xsl:value-of select="translate(//marc:datafield[@tag=773]/marc:subfield[@code='t'], '.', '')" />
347
            </a>
348
            <xsl:choose>
349
                <xsl:when test="position()=last()"></xsl:when>
350
                <xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
351
            </xsl:choose>
352
        </xsl:for-each>
353
        </span>
354
        </xsl:if>
355
333
        <!-- Publisher Statement: Alternate Graphic Representation (MARC 880) -->
356
        <!-- Publisher Statement: Alternate Graphic Representation (MARC 880) -->
334
        <xsl:if test="$display880">
357
        <xsl:if test="$display880">
335
            <xsl:call-template name="m880Select">
358
            <xsl:call-template name="m880Select">
(-)a/misc/migration_tools/create_analytical_rel.pl (+151 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
	foreach my $hostfield ( $bib->field('773') ) {
92
		if(my $barcode = $hostfield->subfield('o')){
93
			my $itemnumber = GetItemnumberFromBarcode($barcode);
94
			if ($itemnumber ne undef){
95
				my $bibnumber = GetBiblionumberFromItemnumber($itemnumber);
96
				if ($bibnumber ne undef){
97
					my $modif;
98
					if ($hostfield->subfield('0') ne $bibnumber){
99
						$hostfield->update('0', $bibnumber);
100
						$modif = 1;
101
					}
102
					if ($hostfield->subfield('9') ne $itemnumber){
103
						$hostfield->update('9', $itemnumber);
104
						$modif=1;
105
					}
106
					if ($modif){
107
						$num_bibs_modified++;
108
						my $modresult = ModBiblio($bib, $biblionumber, '');
109
						warn "Modifying biblio $biblionumber";
110
						if (!$modresult){
111
							warn "Unable to modify biblio $biblionumber with update host field";
112
							$num_hostfields_unabletomodify++;
113
						}
114
					}
115
				} else {
116
					warn "No biblio record found corressponding to itemnumber $itemnumber";
117
					$num_nobib_foritemnumber++;
118
				}
119
			} else {
120
				warn "No item record found for barcode $barcode";
121
				$num_noitem_forbarcode++;
122
			}
123
		} else{
124
			warn "No barcode in host field for biblionumber $biblionumber";
125
			$num_nobarcode_inhostfield++;
126
		}
127
	}
128
}
129
130
sub print_progress_and_commit {
131
    my $recs = shift;
132
    $dbh->commit();
133
    print "... processed $recs records\n";
134
}
135
136
sub print_usage {
137
    print <<_USAGE_;
138
$0: establish relationship to host items
139
140
Based on barcode in host field populates subfield 0 with host biblionumber and subfield 9 with host itemnumber.
141
142
Subfield 0 and 9 are used in Koha screns to display relationships between analytical records and host bibs and items.
143
144
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.
145
146
Parameters:
147
    --run-update            run the synchronization
148
    --where condition       selects the biblios on a criterium (Repeatable)
149
    --help or -h            show this message.
150
_USAGE_
151
}
(-)a/opac/opac-detail.pl (-1 / +31 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
if ($marcflavour eq 'MARC21'){
94
    foreach my $hostfield ( $record->field('773')) {
95
        my $hostbiblionumber = $hostfield->subfield("0");
96
        my $linkeditemnumber = $hostfield->subfield("9");
97
        my @hostitemInfos = GetItemsInfo($hostbiblionumber);
98
        foreach my $hostitemInfo (@hostitemInfos){
99
            if ($hostitemInfo->{itemnumber} eq $linkeditemnumber){
100
                push(@all_items, $hostitemInfo);
101
            }
102
        }
103
    }
104
}
105
if ($marcflavour eq 'UNIMARC'){
106
    foreach my $hostfield ( $record->field('461')) {
107
        my $hostbiblionumber = $hostfield->subfield("0");
108
        my $linkeditemnumber = $hostfield->subfield("9");
109
        my @hostitemInfos = GetItemsInfo($hostbiblionumber);
110
        foreach my $hostitemInfo (@hostitemInfos){
111
            if ($hostitemInfo->{itemnumber} eq $linkeditemnumber){
112
                push(@all_items, $hostitemInfo);
113
            }
114
        }
115
    }
116
}
117
89
my @items;
118
my @items;
90
119
91
# Getting items to be hidden
120
# Getting items to be hidden
Lines 217-229 for my $itm (@items) { Link Here
217
246
218
## get notes and subjects from MARC record
247
## get notes and subjects from MARC record
219
my $dbh              = C4::Context->dbh;
248
my $dbh              = C4::Context->dbh;
220
my $marcflavour      = C4::Context->preference("marcflavour");
221
my $marcnotesarray   = GetMarcNotes   ($record,$marcflavour);
249
my $marcnotesarray   = GetMarcNotes   ($record,$marcflavour);
222
my $marcisbnsarray   = GetMarcISBN    ($record,$marcflavour);
250
my $marcisbnsarray   = GetMarcISBN    ($record,$marcflavour);
223
my $marcauthorsarray = GetMarcAuthors ($record,$marcflavour);
251
my $marcauthorsarray = GetMarcAuthors ($record,$marcflavour);
224
my $marcsubjctsarray = GetMarcSubjects($record,$marcflavour);
252
my $marcsubjctsarray = GetMarcSubjects($record,$marcflavour);
225
my $marcseriesarray  = GetMarcSeries  ($record,$marcflavour);
253
my $marcseriesarray  = GetMarcSeries  ($record,$marcflavour);
226
my $marcurlsarray    = GetMarcUrls    ($record,$marcflavour);
254
my $marcurlsarray    = GetMarcUrls    ($record,$marcflavour);
255
my $marchostsarray  = GetMarcHosts($record,$marcflavour);
227
my $subtitle         = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber));
256
my $subtitle         = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber));
228
257
229
    $template->param(
258
    $template->param(
Lines 232-237 my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($bib Link Here
232
                     MARCAUTHORS             => $marcauthorsarray,
261
                     MARCAUTHORS             => $marcauthorsarray,
233
                     MARCSERIES              => $marcseriesarray,
262
                     MARCSERIES              => $marcseriesarray,
234
                     MARCURLS                => $marcurlsarray,
263
                     MARCURLS                => $marcurlsarray,
264
		     MARCHOSTS               => $marchostsarray,
235
                     norequests              => $norequests,
265
                     norequests              => $norequests,
236
                     RequestOnOpac           => C4::Context->preference("RequestOnOpac"),
266
                     RequestOnOpac           => C4::Context->preference("RequestOnOpac"),
237
                     itemdata_ccode          => $itemfields{ccode},
267
                     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