@@ -, +, @@ the staff client --------- > SOURCE .../installer/data/mysql/sysprefs.sql; -- It should run without error. > SELECT variable,value from systempreferences WHERE variable='OpacProtocol'; -- It should have the value 'http://' -- It should run the upgrade to insert OpacProtocol. > SELECT variable,value from systempreferences WHERE variable='OpacProtocol'; -- It should have the value 'http://' preference. -- It should have a value of "doesn't use" in the drop down. -- both emails should have OPAC URLs which start with http:// 'uses' (https://), log out and log in (to force refresh of cached system preferences), and repeat steps 14 through 19. -- the two new emails should have OPAC URLS which start with https:// and lists sent from staff. --- basket/sendbasket.pl | 5 +---- installer/data/mysql/sysprefs.sql | 2 +- installer/data/mysql/updatedatabase.pl | 4 ++-- .../prog/en/modules/admin/preferences/opac.pref | 6 +++--- .../prog/en/modules/basket/sendbasket.tt | 4 ++-- .../prog/en/modules/virtualshelves/sendshelf.tt | 4 ++-- opac/opac-sendshelf.pl | 4 ++++ virtualshelves/sendshelf.pl | 5 +---- 8 files changed, 16 insertions(+), 18 deletions(-) --- a/basket/sendbasket.pl +++ a/basket/sendbasket.pl @@ -100,10 +100,7 @@ if ( $email_add ) { push( @results, $dat ); } - my $protocol = C4::Context->preference('PublicCatalogUsesSSL') ? "https://" : "http://"; - if (C4::Context->preference('OPACBaseURL')){ - $template2->param( OPACBaseURL => $protocol . C4::Context->preference('OPACBaseURL') ); - } + $template2->param( OPACBaseURL => C4::Context->preference('OPACBaseURL') ); my $resultsarray = \@results; $template2->param( --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -257,6 +257,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OPACPatronDetails','1','','If OFF the patron details tab in the OPAC is disabled.','YesNo'), ('OPACpatronimages','0',NULL,'Enable patron images in the OPAC','YesNo'), ('OpacPrivacy','0',NULL,'if ON, allows patrons to define their privacy rules (reading history)','YesNo'), +('OpacProtocol','http://','http://|https://','Public catalog/OPAC uses SSL','Choice'), ('OpacPublic','1',NULL,'Turn on/off public OPAC','YesNo'), ('opacreadinghistory','1','','If ON, enables display of Patron Circulation History in OPAC','YesNo'), ('OpacRenewalAllowed','0',NULL,'If ON, users can renew their issues directly from their OPAC account','YesNo'), @@ -310,7 +311,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('previousIssuesDefaultSortOrder','asc','asc|desc','Specify the sort order of Previous Issues on the circulation page','Choice'), ('printcirculationslips','1','','If ON, enable printing circulation receipts','YesNo'), ('PrintNoticesMaxLines','0','','If greater than 0, sets the maximum number of lines an overdue notice will print. If the number of items is greater than this number, the notice will end with a warning asking the borrower to check their online account for a full list of overdue items.','Integer'), -('PublicCatalogUsesSSL',0,'','Public catalog/OPAC uses SSL','YesNo'), ('QueryAutoTruncate','1',NULL,'If ON, query truncation is enabled by default','YesNo'), ('QueryFuzzy','1',NULL,'If ON, enables fuzzy option for searches','YesNo'), ('QueryStemming','1',NULL,'If ON, enables query stemming','YesNo'), --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -8205,8 +8205,8 @@ if ( CheckVersion($DBversion) ) { $DBversion = "3.15.00.XXX"; if ( CheckVersion($DBversion) ) { $dbh->do(q{INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES - ('PublicCatalogUsesSSL',0,'','Public catalog/OPAC uses SSL','YesNo');}); - print "Upgrade to $DBversion done (Bug 5010: Add PublicCatalogUsesSSL system preference)\n"; + ('OpacProtocol','http://','http://|https://','Public catalog/OPAC uses SSL','Choice');}); + print "Upgrade to $DBversion done (Bug 5010: Add OpacProtocol system preference)\n"; SetVersion($DBversion); } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -455,10 +455,10 @@ OPAC: - patrons to select their branch on the OPAC or show branch names with callnumbers. - - The public catalog - - pref: PublicCatalogUsesSSL + - pref: OpacProtocol choices: - yes: uses - no: "doesn't use" + "https://": uses + "http://": "doesn't use" - SSL. - - pref: SearchMyLibraryFirst --- a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasket.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasket.tt @@ -1,4 +1,4 @@ - +[%- USE Koha -%] Your cart @@ -134,7 +134,7 @@ Your cart [% IF ( OPACBaseURL ) %]

- In online catalog: [% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber %] + In online catalog: [% Koha.Preference( 'OPACProtocol' ) %][% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber %]

[% END %] [% IF ( BIBLIO_RESULT.ITEM_RESULTS.size ) %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt @@ -1,4 +1,4 @@ - +[%- USE Koha -%] Your list: [% shelfname %] @@ -141,7 +141,7 @@ Your list: [% shelfname %] [% IF ( OPACBaseURL ) %]

- In online catalog: [% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber %] + In online catalog: [% Koha.Preference('OpacProtocol') %][% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber %]

[% END %] [% IF ( BIBLIO_RESULT.ITEM_RESULTS.size ) %] --- a/opac/opac-sendshelf.pl +++ a/opac/opac-sendshelf.pl @@ -107,6 +107,10 @@ if ( $email ) { my $user = GetMember(borrowernumber => $borrowernumber); + if (C4::Context->preference('OPACBaseURL')){ + $template2->param( OPACBaseURL => C4::Context->preference('OPACBaseURL') ); + } + $template2->param( BIBLIO_RESULTS => \@results, email_sender => $email_from, --- a/virtualshelves/sendshelf.pl +++ a/virtualshelves/sendshelf.pl @@ -100,10 +100,7 @@ if ( $email ) { push( @results, $dat ); } - my $protocol = C4::Context->preference('PublicCatalogUsesSSL') ? "https://" : "http://"; - if (C4::Context->preference('OPACBaseURL')){ - $template2->param( OPACBaseURL => $protocol . C4::Context->preference('OPACBaseURL') ); - } + $template2->param( OPACBaseURL => C4::Context->preference('OPACBaseURL') ); $template2->param( BIBLIO_RESULTS => \@results, --