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

(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 335-337 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
335
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowMultipleCovers','0','Allow multiple cover images to be attached to each bibliographic record.','1','YesNo');
335
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowMultipleCovers','0','Allow multiple cover images to be attached to each bibliographic record.','1','YesNo');
336
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('BorrowerRenewalPeriodBase', 'now', 'Set whether the borrower renewal date should be counted from the dateexpiry or from the current date ','dateexpiry|now','Choice');
336
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('BorrowerRenewalPeriodBase', 'now', 'Set whether the borrower renewal date should be counted from the dateexpiry or from the current date ','dateexpiry|now','Choice');
337
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('AllowItemsOnHoldCheckout',0,'Do not generate RESERVE_WAITING and RESERVED warning when checking out items reserved to someone else. This allows self checkouts for those items.','','YesNo');
337
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('AllowItemsOnHoldCheckout',0,'Do not generate RESERVE_WAITING and RESERVED warning when checking out items reserved to someone else. This allows self checkouts for those items.','','YesNo');
338
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacExportOptions','bibtex|dc|marcxml|marc8|utf8|marcstd|mods|ris','Define export options available on OPAC detail page.','','free');
(-)a/installer/data/mysql/updatedatabase.pl (+8 lines)
Lines 4671-4676 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
4671
    SetVersion ($DBversion);
4671
    SetVersion ($DBversion);
4672
}
4672
}
4673
4673
4674
$DBversion = "3.07.99.XXX"; #FIXME
4675
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4676
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacExportOptions','bibtex|dc|marcxml|marc8|utf8|marcstd|mods|ris','Define available export options on OPAC detail page.','','free');");
4677
    print "Upgrade to $DBversion done (Bug 7345: Add system preference OpacExportOptions.)\n";
4678
    SetVersion($DBversion);
4679
}
4680
4681
4674
=head1 FUNCTIONS
4682
=head1 FUNCTIONS
4675
4683
4676
=head2 DropAllForeignKeys($table)
4684
=head2 DropAllForeignKeys($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-1 / +8 lines)
Lines 132-138 OPAC: Link Here
132
              class: file
132
              class: file
133
            - to override specified settings from the default stylesheet. Enter the filename (if the file is in the server's css directory) or a complete URL beginning with <code>http://</code> (if the file lives on a remote server). Leave blank to disable.
133
            - to override specified settings from the default stylesheet. Enter the filename (if the file is in the server's css directory) or a complete URL beginning with <code>http://</code> (if the file lives on a remote server). Leave blank to disable.
134
        -
134
        -
135
            - Use the CSS stylesheet <!-- TMPL_VAR NAME="opacthemelang" -->/css/
135
            - Use the CSS stylesheet [% opacthemelang %]/css/
136
            - pref: opaclayoutstylesheet
136
            - pref: opaclayoutstylesheet
137
              class: file
137
              class: file
138
            - on all pages in the OPAC, instead of the default (leave blank to disable).
138
            - on all pages in the OPAC, instead of the default (leave blank to disable).
Lines 208-213 OPAC: Link Here
208
                  Results: "Results page only"
208
                  Results: "Results page only"
209
                  Both: "Both Details and Results pages"
209
                  Both: "Both Details and Results pages"
210
            - 'Note: The corresponding OPACXSLT option must be turned on.'
210
            - 'Note: The corresponding OPACXSLT option must be turned on.'
211
        -
212
            - 'List export options that should be available from OPAC detail page separated by |:'
213
            - pref: OpacExportOptions
214
              class: multi
215
            - '<br />Note: Available options are: BIBTEX (<code>bibtex</code>), Dublin Core (<code>dc</code>),'
216
            - 'MARCXML (<code>marcxml</code>), MARC-8 encoded MARC (<code>marc8</code>), Unicode/UTF-8 encoded MARC (<code>utf8</code>),'
217
            - 'Unicode/UTF-8 encoded MARC without local use (9xx, x9x, xx9) fields and subfields (<code>marcstd</code>), MODS (<code>mods</code>), RIS (<code>ris</code>)'
211
    Features:
218
    Features:
212
        -
219
        -
213
            - pref: opacuserlogin
220
            - pref: opacuserlogin
(-)a/koha-tmpl/opac-tmpl/prog/en/includes/opac-detail-sidebar.inc (+63 lines)
Line 0 Link Here
1
<ul id="action">
2
    [% UNLESS ( norequests ) %]
3
        [% IF ( opacuserlogin ) %]
4
            [% IF ( RequestOnOpac ) %]
5
                [% IF ( AllowOnShelfHolds ) %]
6
                    <li><a class="reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% biblionumber %]">Place Hold</a></li>
7
                [% ELSE %]
8
                    [% IF ( ItemsIssued ) %]
9
                        <li><a class="reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% biblionumber %]">Place Hold</a></li>
10
                    [% END %]
11
                [% END %]
12
            [% END %]
13
        [% END %]
14
    [% END %]
15
    <li><a class="print" href="#" onclick="window.print();">Print</a></li>
16
    [% IF ( virtualshelves ) %]
17
        [% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %]
18
            <li><a class="addtoshelf" href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=[% biblionumber %]" onclick="Dopop('opac-addbybiblionumber.pl?biblionumber=[% biblionumber %]'); return false;">
19
                Save to Your Lists
20
            </a></li>
21
        [% END %][% END %]
22
    [% END %]
23
    [% IF ( opacbookbag ) %]
24
        <li><a class="addtocart" href="#" onclick="addRecord('[% biblionumber %]'); return false;">Add to Your Cart</a></li>
25
    [% END %]
26
    <li style="display:none;"><a href="#" id="furthersearches">More searches</a></li>
27
</ul>
28
29
[% IF ( OPACSearchForTitleIn ) %]
30
    <div id="furtherm" class="yuimenu">
31
    <div class="bd">
32
    <h4>Search for this title in:</h4>
33
    <ul class="first-of-type">
34
        [% OPACSearchForTitleIn %]
35
    </ul>
36
    </div>
37
    </div>
38
[% END %]
39
40
[% IF ( export_options.size ) %]
41
    <div id="export" class="detailtagcell">
42
        <form method="get" action="/cgi-bin/koha/opac-export.pl">
43
        <label for="format">Save Record:</label>
44
        <select name="format" id="format">
45
        [% FOREACH option IN export_options %]
46
            [% SWITCH option %]
47
                [% CASE 'bibtex' %]<option value="bibtex">BIBTEX</option>
48
                [% CASE 'dc' %]<option value="dc">Dublin Core (XML)</option>
49
                [% CASE 'marcxml' %]<option value="marcxml">MARCXML</option>
50
                [% CASE 'marc8' %]<option value="marc8">MARC (non-Unicode/MARC-8)</option>
51
                [% CASE 'utf8' %]<option value="utf8">MARC (Unicode/UTF-8)</option>
52
                [% CASE 'marcstd' %]<option value="utf8">MARC (Unicode/UTF-8, Standard)</option>
53
                [% CASE 'mods' %]<option value="mods">MODS (XML)</option>
54
                [% CASE 'ris' %]<option value="ris">RIS</option>
55
                [% CASE %]<option value="[% option %]">[% option %]</option>
56
            [% END %]
57
        [% END %]
58
        </select>
59
        <input type="hidden" name="op" value="export" />
60
        <input type="hidden" name="bib" value="[% biblionumber %]" />
61
        <input type="submit" name="save" value="Go" /></form>
62
    </div>
63
[% END %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tt (-55 / +1 lines)
Lines 46-108 Link Here
46
	</div>
46
	</div>
47
	<div class="yui-u">
47
	<div class="yui-u">
48
	<div id="ulactioncontainer" class="container">
48
	<div id="ulactioncontainer" class="container">
49
<ul id="action">
50
49
51
[% UNLESS ( norequests ) %]
50
[% INCLUDE 'opac-detail-sidebar.inc' %]
52
        [% IF ( opacuserlogin ) %]
53
		[% IF ( RequestOnOpac ) %]
54
			[% IF ( AllowOnShelfHolds ) %]
55
				<li><a class="reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% biblionumber %]">Place Hold</a></li>
56
			[% ELSE %]
57
				[% IF ( ItemsIssued ) %]
58
					<li><a class="reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% biblionumber %]">Place Hold</a></li>
59
				[% END %]
60
			[% END %]
61
51
62
        	[% END %]
63
	[% END %]
64
[% END %]
65
        <li><a class="print" href="#" onclick="window.print();">Print</a></li>
66
[% IF ( virtualshelves ) %]
67
   [% IF ( opacuserlogin ) %] [% IF ( loggedinusername ) %]
68
        <li><a class="addtoshelf" href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=[% biblionumber %]" onclick="Dopop('opac-addbybiblionumber.pl?biblionumber=[% biblionumber %]'); return false;">
69
            Save to Your Lists
70
        </a></li>
71
    [% END %][% END %]
72
[% END %]
73
        [% IF ( opacbookbag ) %]<li><a class="addtocart" href="#" onclick="addRecord('[% biblionumber %]'); return false;">
74
            Add to Your Cart
75
        </a></li>[% END %]
76
		<li style="display:none;"><a href="#" id="furthersearches">More searches</a></li>
77
</ul>
78
79
[% IF ( OPACSearchForTitleIn ) %]
80
<div id="furtherm" class="yuimenu">
81
<div class="bd">
82
<h4>Search for this title in:</h4>
83
<ul class="first-of-type">
84
85
[% OPACSearchForTitleIn %]
86
87
</ul>
88
</div>
89
</div>
90
[% END %]
91
92
		<div id="export">
93
		<form method="get" action="/cgi-bin/koha/opac-export.pl">
94
		<label for="format">Save Record:</label>
95
	    <select name="format" id="format">
96
		<option value="">-- Choose Format --</option>
97
 	    <option value="bibtex">BibTex</option>
98
        <option value="dc">Dublin Core (XML)</option>
99
        <option value="marcxml">MARCXML</option>
100
        <option value="marc8">MARC (non-Unicode/MARC-8)</option>
101
        <option value="utf8">MARC (Unicode/UTF-8)</option>
102
        <option value="mods">MODS (XML)</option>
103
 	    <option value="ris">RIS</option>    
104
		</select><input type="hidden" name="op" value="export" /><input type="hidden" name="bib" value="[% biblionumber %]" />
105
<input type="submit" name="save" value="Go" /></form></div>
106
</div>
52
</div>
107
</div>
53
</div>
108
</div>
54
</div>
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tt (-54 / +1 lines)
Lines 201-262 $(document).ready(function(){ Link Here
201
    </div>
201
    </div>
202
    <div class="yui-u">
202
    <div class="yui-u">
203
    <div id="ulactioncontainer" class="container">
203
    <div id="ulactioncontainer" class="container">
204
<ul id="action">
205
204
206
[% UNLESS ( norequests ) %]
205
[% INCLUDE 'opac-detail-sidebar.inc' %]
207
        [% IF ( opacuserlogin ) %]
208
        [% IF ( RequestOnOpac ) %]
209
            [% IF ( AllowOnShelfHolds ) %]
210
                <li><a class="reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% biblionumber %]">Place Hold</a></li>
211
            [% ELSE %]
212
                [% IF ( ItemsIssued ) %]
213
                    <li><a class="reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% biblionumber %]">Place Hold</a></li>
214
                [% END %]
215
            [% END %]
216
217
            [% END %]
218
    [% END %]
219
[% END %]
220
        <li><a class="print" href="#" onclick="window.print();">
221
            Print
222
        </a></li>
223
[% IF ( virtualshelves ) %]
224
   [% IF ( opacuserlogin ) %] [% IF ( loggedinusername ) %]
225
        <li><a class="addtoshelf" href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=[% biblionumber %]" onclick="Dopop('opac-addbybiblionumber.pl?biblionumber=[% biblionumber %]'); return false;">
226
            Save to Your Lists
227
        </a></li>
228
    [% END %][% END %]
229
[% END %]
230
        [% IF ( opacbookbag ) %]<li><a class="addtocart" href="#" onclick="addRecord('[% biblionumber %]'); return false;">
231
            Add to Your Cart
232
        </a></li>[% END %]
233
        <li style="display:none;"><a href="#" id="furthersearches">More searches</a></li>
234
</ul>
235
236
[% IF ( OPACSearchForTitleIn ) %]
237
<div id="furtherm" class="yuimenu">
238
<div class="bd">
239
<h4>Search for this title in:</h4>
240
<ul class="first-of-type">
241
242
[% OPACSearchForTitleIn %]
243
244
</ul>
245
</div>
246
</div>
247
[% END %]
248
206
249
        <div id="export">
250
        <form method="get" action="/cgi-bin/koha/opac-export.pl">
251
        <label for="format">Save Record:</label>
252
        <select name="format" id="format">
253
        <option value="">-- Choose Format --</option>
254
        <option value="mods">MODS (XML)</option>
255
        <option value="dc">Dublin Core (XML)</option>
256
        <option value="marcxml">MARCXML</option>
257
        <option value="marc8">MARC (non-Unicode/MARC-8)</option>
258
        <option value="utf8">MARC (Unicode/UTF-8)</option>    </select><input type="hidden" name="op" value="export" /><input type="hidden" name="bib" value="[% biblionumber %]" />
259
<input type="submit" name="save" value="Go" /></form></div>
260
</div>
207
</div>
261
</div>
208
</div>
262
</div>
209
</div>
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt (-54 / +1 lines)
Lines 1035-1095 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
1035
        [% END %]
1035
        [% END %]
1036
    </div>
1036
    </div>
1037
[% END %]
1037
[% END %]
1038
<ul id="action">
1039
1040
[% UNLESS ( norequests ) %]
1041
        [% IF ( opacuserlogin ) %]
1042
		[% IF ( RequestOnOpac ) %]
1043
			[% IF ( AllowOnShelfHolds ) %]
1044
	            		<li><a class="reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% biblionumber %]">Place Hold</a></li>
1045
			[% ELSE %]
1046
				[% IF ( ItemsIssued ) %]
1047
		            		<li><a class="reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% biblionumber %]">Place Hold</a></li>
1048
				[% END %]
1049
			[% END %]
1050
        	[% END %]
1051
	[% END %]
1052
[% END %]
1053
        <li><a class="print" href="#" onclick="window.print();">Print</a></li>
1054
[% IF ( virtualshelves ) %]
1055
    [% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %]
1056
        <li><a class="addtoshelf" href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=[% biblionumber %]" onclick="Dopop('opac-addbybiblionumber.pl?biblionumber=[% biblionumber %]'); return false;">
1057
            Save to Your Lists
1058
        </a></li>
1059
    [% END %][% END %]
1060
[% END %]
1061
        [% IF ( opacbookbag ) %]<li><a class="addtocart" href="#" onclick="addRecord('[% biblionumber %]'); return false;">Add to Your Cart</a></li>[% END %]
1062
		<li style="display:none;"><a href="#" id="furthersearches">More searches</a></li>
1063
</ul>
1064
1065
[% IF ( OPACSearchForTitleIn ) %]
1066
<div id="furtherm" class="yuimenu">
1067
<div class="bd">
1068
<h4>Search for this title in:</h4>
1069
<ul class="first-of-type">
1070
1071
[% OPACSearchForTitleIn %]
1072
1038
1073
</ul>
1039
[% INCLUDE 'opac-detail-sidebar.inc' %]
1074
</div>
1075
</div>
1076
[% END %]
1077
1078
        <div id="export" class="detailtagcell">
1079
        <form method="get" action="/cgi-bin/koha/opac-export.pl">
1080
        <label for="format">Save Record:</label>
1081
        <select name="format" id="format">
1082
        <option value="">-- Choose Format --</option>
1083
        <option value="bibtex">BIBTEX</option>
1084
        <option value="dc">Dublin Core (XML)</option>
1085
        <option value="marcxml">MARCXML</option>
1086
        <option value="marc8">MARC (non-Unicode/MARC-8)</option>
1087
        <option value="utf8">MARC (Unicode/UTF-8)</option>    
1088
        <option value="mods">MODS (XML)</option>
1089
        <option value="ris">RIS</option>
1090
		</select><input type="hidden" name="op" value="export" /><input type="hidden" name="bib" value="[% biblionumber %]" />
1091
<input type="submit" name="save" value="Go" /></form>
1092
        </div>
1093
1040
1094
        [% IF ( NovelistSelectProfile ) %] [% IF ( NovelistSelectView == 'right') %]
1041
        [% IF ( NovelistSelectProfile ) %] [% IF ( NovelistSelectView == 'right') %]
1095
         <div id="NovelistSelect">
1042
         <div id="NovelistSelect">
(-)a/opac/opac-ISBDdetail.pl (+9 lines)
Lines 159-171 $template->param( Link Here
159
    reviews             => $reviews,
159
    reviews             => $reviews,
160
);
160
);
161
161
162
#Export options
163
my $OpacExportOptions=C4::Context->preference("OpacExportOptions");
164
my @export_options = split(/\|/,$OpacExportOptions);
165
$template->{VARS}->{'export_options'} = \@export_options;
166
162
#Search for title in links
167
#Search for title in links
168
my $marccontrolnumber   = GetMarcControlnumber   ($record, $marcflavour);
169
163
if (my $search_for_title = C4::Context->preference('OPACSearchForTitleIn')){
170
if (my $search_for_title = C4::Context->preference('OPACSearchForTitleIn')){
164
    $dat->{author} ? $search_for_title =~ s/{AUTHOR}/$dat->{author}/g : $search_for_title =~ s/{AUTHOR}//g;
171
    $dat->{author} ? $search_for_title =~ s/{AUTHOR}/$dat->{author}/g : $search_for_title =~ s/{AUTHOR}//g;
165
    $dat->{title} =~ s/\/+$//; # remove trailing slash
172
    $dat->{title} =~ s/\/+$//; # remove trailing slash
166
    $dat->{title} =~ s/\s+$//; # remove trailing space
173
    $dat->{title} =~ s/\s+$//; # remove trailing space
167
    $dat->{title} ? $search_for_title =~ s/{TITLE}/$dat->{title}/g : $search_for_title =~ s/{TITLE}//g;
174
    $dat->{title} ? $search_for_title =~ s/{TITLE}/$dat->{title}/g : $search_for_title =~ s/{TITLE}//g;
168
    $isbn ? $search_for_title =~ s/{ISBN}/$isbn/g : $search_for_title =~ s/{ISBN}//g;
175
    $isbn ? $search_for_title =~ s/{ISBN}/$isbn/g : $search_for_title =~ s/{ISBN}//g;
176
    $marccontrolnumber ? $search_for_title =~ s/{CONTROLNUMBER}/$marccontrolnumber/g : $search_for_title =~ s/{CONTROLNUMBER}//g;
177
    $search_for_title =~ s/{BIBLIONUMBER}/$biblionumber/g;
169
 $template->param('OPACSearchForTitleIn' => $search_for_title);
178
 $template->param('OPACSearchForTitleIn' => $search_for_title);
170
}
179
}
171
180
(-)a/opac/opac-MARCdetail.pl (-5 / +17 lines)
Lines 270-282 if(C4::Context->preference("ISBD")) { Link Here
270
	$template->param(ISBD => 1);
270
	$template->param(ISBD => 1);
271
}
271
}
272
272
273
#Export options
274
my $OpacExportOptions=C4::Context->preference("OpacExportOptions");
275
my @export_options = split(/\|/,$OpacExportOptions);
276
$template->{VARS}->{'export_options'} = \@export_options;
277
273
#Search for title in links
278
#Search for title in links
279
my $marcflavour  = C4::Context->preference("marcflavour");
280
my $dat = TransformMarcToKoha( $dbh, $record );
281
my $isbn = GetNormalizedISBN(undef,$record,$marcflavour);
282
my $marccontrolnumber   = GetMarcControlnumber   ($record, $marcflavour);
283
274
if (my $search_for_title = C4::Context->preference('OPACSearchForTitleIn')){
284
if (my $search_for_title = C4::Context->preference('OPACSearchForTitleIn')){
275
    $biblio->{author} ? $search_for_title =~ s/{AUTHOR}/$biblio->{author}/g : $search_for_title =~ s/{AUTHOR}//g;
285
    $dat->{author} ? $search_for_title =~ s/{AUTHOR}/$dat->{author}/g : $search_for_title =~ s/{AUTHOR}//g;
276
    $biblio->{title} =~ s/\/+$//; # remove trailing slash
286
    $dat->{title} =~ s/\/+$//; # remove trailing slash
277
    $biblio->{title} =~ s/\s+$//; # remove trailing space
287
    $dat->{title} =~ s/\s+$//; # remove trailing space
278
    $biblio->{title} ? $search_for_title =~ s/{TITLE}/$biblio->{title}/g : $search_for_title =~ s/{TITLE}//g;
288
    $dat->{title} ? $search_for_title =~ s/{TITLE}/$dat->{title}/g : $search_for_title =~ s/{TITLE}//g;
279
    $biblio->{isbn} ? $search_for_title =~ s/{ISBN}/$biblio->{isbn}/g : $search_for_title =~ s/{ISBN}//g;
289
    $isbn ? $search_for_title =~ s/{ISBN}/$isbn/g : $search_for_title =~ s/{ISBN}//g;
290
    $marccontrolnumber ? $search_for_title =~ s/{CONTROLNUMBER}/$marccontrolnumber/g : $search_for_title =~ s/{CONTROLNUMBER}//g;
291
    $search_for_title =~ s/{BIBLIONUMBER}/$biblionumber/g;
280
 $template->param('OPACSearchForTitleIn' => $search_for_title);
292
 $template->param('OPACSearchForTitleIn' => $search_for_title);
281
}
293
}
282
294
(-)a/opac/opac-detail.pl (-1 / +5 lines)
Lines 891-896 if (C4::Context->preference("OPACURLOpenInNewWindow")) { Link Here
891
    $template->param(covernewwindow => 'false');
891
    $template->param(covernewwindow => 'false');
892
}
892
}
893
893
894
#Export options
895
my $OpacExportOptions=C4::Context->preference("OpacExportOptions");
896
my @export_options = split(/\|/,$OpacExportOptions);
897
$template->{VARS}->{'export_options'} = \@export_options;
898
894
#Search for title in links
899
#Search for title in links
895
my $marccontrolnumber   = GetMarcControlnumber   ($record, $marcflavour);
900
my $marccontrolnumber   = GetMarcControlnumber   ($record, $marcflavour);
896
901
897
- 

Return to bug 7392