@@ -, +, @@ --- installer/data/mysql/sysprefs.sql | 2 +- .../prog/en/modules/admin/preferences/opac.pref | 2 +- .../prog/en/modules/opac-readingrecord.tt | 6 ++++++ opac/opac-readingrecord.pl | 11 +++++++++++ 4 files changed, 19 insertions(+), 2 deletions(-) --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -280,7 +280,7 @@ INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanatio INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'DisplayClearScreenButton', '0', '', 'If set to ON, a clear screen button will appear on the circulation page.', 'YesNo'); INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('HidePatronName', '0', '', 'If this is switched on, patron''s cardnumber will be shown instead of their name on the holds and catalog screens', 'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACSearchForTitleIn','
  • Other Libraries (WorldCat)
  • \n
  • Other Databases (Google Scholar)
  • \n
  • Online Stores (Bookfinder.com)
  • \n
  • Open Library (openlibrary.org)
  • ','Enter the HTML that will appear in the \'Search for this title in\' box on the detail page in the OPAC. Enter {TITLE}, {AUTHOR}, or {ISBN} in place of their respective variables in the URL. Leave blank to disable \'More Searches\' menu.','70|10','Textarea'); -INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACMySummaryHTML','','Enter the HTML that will appear in a column on the \'my profile\' tab when a user is logged in to the OPAC. Enter {BIBLIONUMBER}, {TITLE}, {AUTHOR}, or {ISBN} in place of their respective variables in the HTML. Leave blank to disable.','70|10','Textarea'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACMySummaryHTML','','Enter the HTML that will appear in a column on the \'my summary\' and \'my reading history\' tabs when a user is logged in to the OPAC. Enter {BIBLIONUMBER}, {TITLE}, {AUTHOR}, or {ISBN} in place of their respective variables in the HTML. Leave blank to disable.','70|10','Textarea'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACPatronDetails','1','If OFF the patron details tab in the OPAC is disabled.','','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACFinesTab','1','If OFF the patron fines tab in the OPAC is disabled.','','YesNo'); INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('DisplayOPACiconsXSLT', '1', '', 'If ON, displays the format, audience, type icons in XSLT MARC21 results and display pages.', 'YesNo'); --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -199,7 +199,7 @@ OPAC: type: textarea class: code - - - 'Include a "Links" column on the "my summary" tab when a user is logged in to the OPAC, with the following HTML (leave blank to disable):' + - 'Include a "Links" column on the "my summary" and "my reading history" tabs when a user is logged in to the OPAC, with the following HTML (leave blank to disable):' - '
    Note: The placeholders {BIBLIONUMBER}, {TITLE}, {ISBN} and {AUTHOR} will be replaced with information from the displayed record.' - pref: OPACMySummaryHTML type: textarea --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tt +++ a/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tt @@ -59,6 +59,9 @@ You have never borrowed anything from this library. Item type Call no. Date +[% IF ( OPACMySummaryHTML ) %] +Links +[% END %] [% FOREACH READING_RECOR IN READING_RECORD %] @@ -85,6 +88,9 @@ You have never borrowed anything from this library. [% UNLESS ( noItemTypeImages ) %][% IF ( READING_RECOR.imageurl ) %][% END %][% END %] [% READING_RECOR.description %] [% READING_RECOR.itemcallnumber %] [% IF ( READING_RECOR.returndate ) %][% READING_RECOR.returndate | $KohaDates %][% ELSE %](Checked out)[% END %] +[% IF ( OPACMySummaryHTML ) %] +[% READING_RECOR.MySummaryHTML %] +[% END %] [% END %] --- a/opac/opac-readingrecord.pl +++ a/opac/opac-readingrecord.pl @@ -97,6 +97,16 @@ foreach my $issue (@{$issues} ) { $line{'description'} = $itemtypes->{ $issue->{'itemtype'} }->{'description'}; $line{imageurl} = getitemtypeimagelocation( 'opac', $itemtypes->{ $issue->{'itemtype'} }->{'imageurl'} ); } + # My Summary HTML + if (my $my_summary_html = C4::Context->preference('OPACMySummaryHTML')){ + $line{author} ? $my_summary_html =~ s/{AUTHOR}/$line{author}/g : $my_summary_html =~ s/{AUTHOR}//g; + $line{title} =~ s/\/+$//; # remove trailing slash + $line{title} =~ s/\s+$//; # remove trailing space + $line{title} ? $my_summary_html =~ s/{TITLE}/$line{title}/g : $my_summary_html =~ s/{TITLE}//g; + $line{normalized_isbn} ? $my_summary_html =~ s/{ISBN}/$line{normalized_isbn}/g : $my_summary_html =~ s/{ISBN}//g; + $line{biblionumber} ? $my_summary_html =~ s/{BIBLIONUMBER}/$line{biblionumber}/g : $my_summary_html =~ s/{BIBLIONUMBER}//g; + $line{MySummaryHTML} = $my_summary_html; + } push( @loop_reading, \%line ); $line{subtitle} = GetRecordValue('subtitle', $record, GetFrameworkCode($issue->{'biblionumber'})); } @@ -130,6 +140,7 @@ $template->param( showfulllink => 1, readingrecview => 1, count => scalar @loop_reading, + OPACMySummaryHTML => (C4::Context->preference("OPACMySummaryHTML")) ? 1 : 0, ); output_html_with_http_headers $query, $cookie, $template->output; --