@@ -, +, @@ the staff client - Create a list - Send yourself the list from the staff interface - Verify that the links are http:// - Put some records into your cart - Send yourself the cart from the staff interface - Verify that the links are missing http(s):// in front of them - Apply patch - Run database update - Verify that the default setting for PublicCatalogUsesSSL is 'doesn't use' - Resent both emails - Verfiy the catalog links are now both http:// links - Change system preference setting to 'uses' - Resent both emails - Verify the catalog links are now https:// links My list had http:// on master. System preference affected both cart and list sending. System preference necessary, because there is no way to determine http or https in the middle of an email. the hardcoded http:// in the template file. That may have been a mistake, since nothing was added to the corresponding sendshelf.pl file. --- basket/sendbasket.pl | 7 ++++++- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 9 +++++++++ .../prog/en/modules/admin/preferences/opac.pref | 7 +++++++ virtualshelves/sendshelf.pl | 3 ++- 5 files changed, 25 insertions(+), 2 deletions(-) --- a/basket/sendbasket.pl +++ a/basket/sendbasket.pl @@ -86,7 +86,7 @@ if ( $email_add ) { if($dat->{'author'} || @$marcauthorsarray) { $hasauthors = 1; } - + $dat->{MARCNOTES} = $marcnotesarray; $dat->{MARCSUBJCTS} = $marcsubjctsarray; @@ -100,6 +100,11 @@ 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') ); + } + my $resultsarray = \@results; $template2->param( BIBLIO_RESULTS => $resultsarray, --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -310,6 +310,7 @@ 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 @@ -8202,6 +8202,15 @@ if ( CheckVersion($DBversion) ) { SetVersion($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"; + SetVersion($DBversion); +} + + =head1 FUNCTIONS =head2 TableExists($table) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -454,6 +454,13 @@ OPAC: no: Allow - patrons to select their branch on the OPAC or show branch names with callnumbers. - + - The public catalog + - pref: PublicCatalogUsesSSL + choices: + yes: uses + no: "doesn't use" + - SSL. + - - pref: SearchMyLibraryFirst choices: yes: Limit --- a/virtualshelves/sendshelf.pl +++ a/virtualshelves/sendshelf.pl @@ -100,8 +100,9 @@ if ( $email ) { push( @results, $dat ); } + my $protocol = C4::Context->preference('PublicCatalogUsesSSL') ? "https://" : "http://"; if (C4::Context->preference('OPACBaseURL')){ - $template2->param( OPACBaseURL => C4::Context->preference('OPACBaseURL') ); + $template2->param( OPACBaseURL => $protocol . C4::Context->preference('OPACBaseURL') ); } $template2->param( --