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

(-)a/C4/Biblio.pm (-1 / +12 lines)
Lines 67-73 BEGIN { Link Here
67
		GetMarcUrls
67
		GetMarcUrls
68
		&GetUsedMarcStructure
68
		&GetUsedMarcStructure
69
		&GetXmlBiblio
69
		&GetXmlBiblio
70
        &GetCOinSBiblio
70
		&GetCOinSBiblio
71
71
72
		&GetAuthorisedValueDesc
72
		&GetAuthorisedValueDesc
73
		&GetMarcStructure
73
		&GetMarcStructure
Lines 75-80 BEGIN { Link Here
75
		&GetFrameworkCode
75
		&GetFrameworkCode
76
		&GetPublisherNameFromIsbn
76
		&GetPublisherNameFromIsbn
77
		&TransformKohaToMarc
77
		&TransformKohaToMarc
78
		
79
		&CountItemsIssued
78
	);
80
	);
79
81
80
	# To modify something
82
	# To modify something
Lines 2024-2029 more. Link Here
2024
2026
2025
=cut
2027
=cut
2026
2028
2029
sub CountItemsIssued {
2030
  my ( $biblionumber )  = @_;
2031
  my $dbh = C4::Context->dbh;
2032
  my $sth = $dbh->prepare('SELECT COUNT(*) as issuedCount FROM items, issues WHERE items.itemnumber = issues.itemnumber AND items.biblionumber = ?');
2033
  $sth->execute( $biblionumber );
2034
  my $row = $sth->fetchrow_hashref();
2035
  return $row->{'issuedCount'};
2036
}
2037
2027
sub _disambiguate {
2038
sub _disambiguate {
2028
    my ($table, $column) = @_;
2039
    my ($table, $column) = @_;
2029
    if ($column eq "cn_sort" or $column eq "cn_source") {
2040
    if ($column eq "cn_sort" or $column eq "cn_source") {
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tmpl (-5 / +12 lines)
Lines 161-171 Link Here
161
161
162
<!-- TMPL_UNLESS NAME="norequests" -->
162
<!-- TMPL_UNLESS NAME="norequests" -->
163
    <!-- TMPL_UNLESS name="bi_notforloan" -->
163
    <!-- TMPL_UNLESS name="bi_notforloan" -->
164
        <!-- TMPL_IF NAME="opacuserlogin" --><!-- TMPL_IF NAME="RequestOnOpac" -->
164
        <!-- TMPL_IF NAME="opacuserlogin" -->
165
            <li><a class="reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">
165
		<!-- TMPL_IF NAME="RequestOnOpac" -->
166
            Place Hold
166
			<!-- TMPL_IF NAME="AllowOnShelfHolds" -->
167
            </a></li>
167
				<li><a class="reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Place Hold</a></li>
168
        <!-- /TMPL_IF --><!-- /TMPL_IF -->
168
			<!-- TMPL_ELSE -->
169
				<!-- TMPL_IF NAME="itemsissued" -->
170
					<li><a class="reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Place Hold</a></li>
171
				<!-- /TMPL_IF -->
172
			<!-- /TMPL_IF -->
173
174
        	<!-- /TMPL_IF -->
175
	<!-- /TMPL_IF -->
169
    <!-- /TMPL_UNLESS -->
176
    <!-- /TMPL_UNLESS -->
170
<!-- /TMPL_UNLESS -->
177
<!-- /TMPL_UNLESS -->
171
        <li><a class="print" href="/cgi-bin/koha/opac-detailprint.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" onclick="Dopop('opac-detailprint.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->'); return false;">
178
        <li><a class="print" href="/cgi-bin/koha/opac-detailprint.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" onclick="Dopop('opac-detailprint.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->'); return false;">
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tmpl (-1 / +13 lines)
Lines 19-25 Link Here
19
<div class="container"><div class="yui-g">
19
<div class="container"><div class="yui-g">
20
<div id="toolbar">
20
<div id="toolbar">
21
<ul>
21
<ul>
22
	<!-- TMPL_UNLESS NAME="norequests" --><!-- TMPL_IF NAME="opacuserlogin" --><!-- TMPL_IF NAME="RequestOnOpac" --><li><a class="link reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Place Hold</a></li><!-- /TMPL_IF --><!-- /TMPL_IF --><!-- /TMPL_UNLESS -->
22
	<!-- TMPL_UNLESS NAME="norequests" -->
23
		<!-- TMPL_IF NAME="opacuserlogin" -->
24
			<!-- TMPL_IF NAME="RequestOnOpac" -->
25
				<!-- TMPL_IF NAME="AllowOnShelfHolds" -->
26
					<li><a class="link reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Place Hold</a></li>
27
				<!-- TMPL_ELSE -->
28
					<!-- TMPL_IF NAME="ItemsIssued" -->
29
						<li><a class="link reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Place Hold</a></li>
30
					<!-- /TMPL_IF -->
31
				<!-- /TMPL_IF -->
32
			<!-- /TMPL_IF -->
33
		<!-- /TMPL_IF -->
34
	<!-- /TMPL_UNLESS -->
23
	<li><a class="link print" href="/cgi-bin/koha/opac-detailprint.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" onclick="Dopop('opac-detailprint.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->'); return false;">Print</a></li>
35
	<li><a class="link print" href="/cgi-bin/koha/opac-detailprint.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" onclick="Dopop('opac-detailprint.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->'); return false;">Print</a></li>
24
	<!-- TMPL_IF name="virtualshelves" --><!-- TMPL_IF NAME="opacuserlogin" --><!-- TMPL_IF NAME="loggedinusername" --><li><a class="link addtoshelf" href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" onclick="Dopop('opac-addbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->'); return false;">Save to Your Lists</a></li><!-- /TMPL_IF --><!-- /TMPL_IF --><!-- /TMPL_IF -->
36
	<!-- TMPL_IF name="virtualshelves" --><!-- TMPL_IF NAME="opacuserlogin" --><!-- TMPL_IF NAME="loggedinusername" --><li><a class="link addtoshelf" href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" onclick="Dopop('opac-addbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->'); return false;">Save to Your Lists</a></li><!-- /TMPL_IF --><!-- /TMPL_IF --><!-- /TMPL_IF -->
25
	<!-- TMPL_IF NAME="opacbookbag" --><li><a class="link addtocart" href="#" onclick="addRecord('<!-- TMPL_VAR NAME="biblionumber" -->'); return false;">Add to Your Cart</a></li><!-- /TMPL_IF -->
37
	<!-- TMPL_IF NAME="opacbookbag" --><li><a class="link addtocart" href="#" onclick="addRecord('<!-- TMPL_VAR NAME="biblionumber" -->'); return false;">Add to Your Cart</a></li><!-- /TMPL_IF -->
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl (-5 / +11 lines)
Lines 736-746 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
736
736
737
<!-- TMPL_UNLESS NAME="norequests" -->
737
<!-- TMPL_UNLESS NAME="norequests" -->
738
    <!-- TMPL_UNLESS name="bi_notforloan" -->
738
    <!-- TMPL_UNLESS name="bi_notforloan" -->
739
        <!-- TMPL_IF NAME="opacuserlogin" --><!-- TMPL_IF NAME="RequestOnOpac" -->
739
        <!-- TMPL_IF NAME="opacuserlogin" -->
740
            <li><a class="reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">
740
		<!-- TMPL_IF NAME="RequestOnOpac" -->
741
            Place Hold
741
			<!-- TMPL_IF NAME="AllowOnShelfHolds" -->
742
            </a></li>
742
	            		<li><a class="reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Place Hold</a></li>
743
        <!-- /TMPL_IF --><!-- /TMPL_IF -->
743
			<!-- TMPL_ELSE -->
744
				<!-- TMPL_IF NAME="ItemsIssued" -->
745
		            		<li><a class="reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Place Hold</a></li>
746
				<!-- /TMPL_IF -->
747
			<!-- /TMPL_IF -->
748
        	<!-- /TMPL_IF -->
749
	<!-- /TMPL_IF -->
744
    <!-- /TMPL_UNLESS -->
750
    <!-- /TMPL_UNLESS -->
745
<!-- /TMPL_UNLESS -->
751
<!-- /TMPL_UNLESS -->
746
        <li><a class="print" href="/cgi-bin/koha/opac-detailprint.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" onclick="Dopop('opac-detailprint.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->'); return false;">
752
        <li><a class="print" href="/cgi-bin/koha/opac-detailprint.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" onclick="Dopop('opac-detailprint.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->'); return false;">
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results-grouped.tmpl (-1 / +15 lines)
Lines 224-230 $(document).ready(function(){ Link Here
224
					</span>
224
					</span>
225
				</p>
225
				</p>
226
226
227
				<p><!-- TMPL_IF name="RequestOnOpac" --><!-- TMPL_UNLESS NAME="norequests" --><!-- TMPL_IF NAME="opacuserlogin" --><a class="reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Place Hold</a><!-- /TMPL_IF --><!-- /TMPL_UNLESS --> <!-- /TMPL_IF -->
227
				<p>
228
                                <!-- TMPL_IF name="RequestOnOpac" -->
229
					<!-- TMPL_UNLESS NAME="norequests" -->
230
						<!-- TMPL_IF NAME="opacuserlogin" -->
231
							<!-- TMPL_IF NAME="AllowOnShelfHolds" -->
232
								<a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Place Hold</a><!-- add back when available 0 holds in queue-->
233
							<!-- TMPL_ELSE -->
234
								<!-- TMPL_IF NAME="itemsissued" -->
235
									<a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Place Hold</a><!-- add back when available 0 holds in queue-->
236
								<!-- /TMPL_IF -->
237
							<!-- /TMPL_IF -->
238
						<!-- /TMPL_IF -->
239
					<!-- /TMPL_UNLESS -->
240
				<!-- /TMPL_IF -->
241
228
				<!--TMPL_IF EXPR="opacbookbag || virtualshelves" --><input type="checkbox" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" title="Click to add to cart" /> <label for="bib<!-- TMPL_VAR NAME="biblionumber" -->"><!-- /TMPL_IF --><img src="<!-- TMPL_VAR NAME="themelang" -->/images/<!-- TMPL_VAR NAME="itemtype" -->.gif" alt="<!-- TMPL_VAR NAME="ccode" -->" title="<!-- TMPL_VAR NAME="ccode" -->" /><!--TMPL_IF EXPR="opacbookbag || virtualshelves" --></label><!-- /TMPL_IF --> <!-- TMPL_IF name="classification" -->
242
				<!--TMPL_IF EXPR="opacbookbag || virtualshelves" --><input type="checkbox" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" title="Click to add to cart" /> <label for="bib<!-- TMPL_VAR NAME="biblionumber" -->"><!-- /TMPL_IF --><img src="<!-- TMPL_VAR NAME="themelang" -->/images/<!-- TMPL_VAR NAME="itemtype" -->.gif" alt="<!-- TMPL_VAR NAME="ccode" -->" title="<!-- TMPL_VAR NAME="ccode" -->" /><!--TMPL_IF EXPR="opacbookbag || virtualshelves" --></label><!-- /TMPL_IF --> <!-- TMPL_IF name="classification" -->
229
                                    <a href="/cgi-bin/koha/opac-search.pl?q=callnum:<!-- TMPL_VAR NAME="classification" ESCAPE="URL" -->">
243
                                    <a href="/cgi-bin/koha/opac-search.pl?q=callnum:<!-- TMPL_VAR NAME="classification" ESCAPE="URL" -->">
230
                                        <!-- TMPL_VAR NAME="classification" -->
244
                                        <!-- TMPL_VAR NAME="classification" -->
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl (-1 / +13 lines)
Lines 427-433 $(document).ready(function(){ Link Here
427
				<!-- TMPL_IF Name="searchhighlightblob" --><span class="results_summary"><span class="label">Match:</span> <!-- TMPL_VAR NAME="searchhighlightblob" --></span><!-- /TMPL_IF -->
427
				<!-- TMPL_IF Name="searchhighlightblob" --><span class="results_summary"><span class="label">Match:</span> <!-- TMPL_VAR NAME="searchhighlightblob" --></span><!-- /TMPL_IF -->
428
428
429
<span class="results_summary actions"><span class="label">Actions:</span>
429
<span class="results_summary actions"><span class="label">Actions:</span>
430
                                <!-- TMPL_IF name="RequestOnOpac" --><!-- TMPL_UNLESS NAME="norequests" --><!-- TMPL_IF NAME="opacuserlogin" --><a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Place Hold</a><!-- add back when available 0 holds in queue--> <!-- /TMPL_IF --><!-- /TMPL_UNLESS --><!-- /TMPL_IF -->
430
                                <!-- TMPL_IF name="RequestOnOpac" -->
431
					<!-- TMPL_UNLESS NAME="norequests" -->
432
						<!-- TMPL_IF NAME="opacuserlogin" -->
433
							<!-- TMPL_IF NAME="AllowOnShelfHolds" -->
434
								<a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Place Hold</a><!-- add back when available 0 holds in queue-->
435
							<!-- TMPL_ELSE -->
436
								<!-- TMPL_IF NAME="itemsissued" -->
437
									<a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Place Hold</a><!-- add back when available 0 holds in queue-->
438
								<!-- /TMPL_IF -->
439
							<!-- /TMPL_IF -->
440
						<!-- /TMPL_IF -->
441
					<!-- /TMPL_UNLESS -->
442
				<!-- /TMPL_IF -->
431
443
432
444
433
				<!-- TMPL_IF NAME="opacuserlogin" --><!-- TMPL_IF NAME="loggedinusername" --><!-- TMPL_IF NAME="virtualshelves" --><a class="addtolist" href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" onclick="Dopop('opac-addbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->'); return false;">Save to Lists</a>
445
				<!-- TMPL_IF NAME="opacuserlogin" --><!-- TMPL_IF NAME="loggedinusername" --><!-- TMPL_IF NAME="virtualshelves" --><a class="addtolist" href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" onclick="Dopop('opac-addbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->'); return false;">Save to Lists</a>
(-)a/opac/opac-MARCdetail.pl (+3 lines)
Lines 74-79 $template->param( Link Here
74
    bibliotitle => $biblio->{title},
74
    bibliotitle => $biblio->{title},
75
);
75
);
76
76
77
$template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHolds') );
78
$template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) );
79
77
# adding the $RequestOnOpac param
80
# adding the $RequestOnOpac param
78
my $RequestOnOpac;
81
my $RequestOnOpac;
79
if (C4::Context->preference("RequestOnOpac")) {
82
if (C4::Context->preference("RequestOnOpac")) {
(-)a/opac/opac-detail.pl (+4 lines)
Lines 59-64 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
59
);
59
);
60
60
61
my $biblionumber = $query->param('biblionumber') || $query->param('bib');
61
my $biblionumber = $query->param('biblionumber') || $query->param('bib');
62
63
$template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHolds') );
64
$template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) );
65
62
my $record       = GetMarcBiblio($biblionumber);
66
my $record       = GetMarcBiblio($biblionumber);
63
$template->param( biblionumber => $biblionumber );
67
$template->param( biblionumber => $biblionumber );
64
# XSLT processing of some stuff
68
# XSLT processing of some stuff
(-)a/opac/opac-search.pl (-1 / +2 lines)
Lines 73-78 if (C4::Context->preference("marcflavour") eq "UNIMARC" ) { Link Here
73
elsif (C4::Context->preference("marcflavour") eq "MARC21" ) {
73
elsif (C4::Context->preference("marcflavour") eq "MARC21" ) {
74
    $template->param('usmarc' => 1);
74
    $template->param('usmarc' => 1);
75
}
75
}
76
$template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHolds') );
76
77
77
if (C4::Context->preference('BakerTaylorEnabled')) {
78
if (C4::Context->preference('BakerTaylorEnabled')) {
78
	$template->param(
79
	$template->param(
Lines 423-428 for (my $i=0;$i<=@servers;$i++) { Link Here
423
			$tag_quantity = C4::Context->preference('TagsShowOnList')) {
424
			$tag_quantity = C4::Context->preference('TagsShowOnList')) {
424
			foreach (@newresults) {
425
			foreach (@newresults) {
425
				my $bibnum = $_->{biblionumber} or next;
426
				my $bibnum = $_->{biblionumber} or next;
427
				$_->{itemsissued} = CountItemsIssued( $bibnum );
426
				$_ ->{'TagLoop'} = get_tags({biblionumber=>$bibnum, approved=>1, 'sort'=>'-weight',
428
				$_ ->{'TagLoop'} = get_tags({biblionumber=>$bibnum, approved=>1, 'sort'=>'-weight',
427
										limit=>$tag_quantity });
429
										limit=>$tag_quantity });
428
			}
430
			}
429
- 

Return to bug 2339