Bugzilla – Attachment 27436 Details for
Bug 5010
Fix OPACBaseURL to include protocol
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 5010: Fix incomplete links in carts and lists sent from the staff client
SIGNED-OFF-Bug-5010-Fix-incomplete-links-in-carts-.patch (text/plain), 6.04 KB, created by
Bernardo Gonzalez Kriegel
on 2014-04-22 18:50:25 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 5010: Fix incomplete links in carts and lists sent from the staff client
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2014-04-22 18:50:25 UTC
Size:
6.04 KB
patch
obsolete
>From 03e2337c07d79ae53a5a2705d225105c50bf9b58 Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <Katrin.Fischer.83@web.de> >Date: Wed, 11 Dec 2013 19:31:00 +0100 >Subject: [PATCH] [SIGNED-OFF] Bug 5010: Fix incomplete links in carts and > lists sent from the staff client > >While the list email hardcoded http:// in front of the URL, the cart email >was missing http(s)://. As there seems to be no reliable way to determine >in staff if the OPAC is using SSL or not, this patch introduces a new >system preference: PublicCatalogUsesSSL. > >To test: >- Create a list >- Send yourself the list from the staff interface >- Verify that the links are http://<OPACBaseURL> >- 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 > >NOTE: My cart didn't have a 'In online catalog:' line on master. > 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. > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> > >NOTE: The rebase removed sendshelf.tt, because bug 11248 removed > the hardcoded http:// in the template file. That may have > been a mistake, since nothing was added to the > corresponding sendshelf.pl file. > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Add a sign >--- > 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(-) > >diff --git a/basket/sendbasket.pl b/basket/sendbasket.pl >index 885ee41..265b269 100755 >--- a/basket/sendbasket.pl >+++ b/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, >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 05a0031..71e817d 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/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'), >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 8917081..2634cd8 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/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) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >index 5483e0a..f822683 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >+++ b/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 >diff --git a/virtualshelves/sendshelf.pl b/virtualshelves/sendshelf.pl >index cc3afde..0341ab9 100755 >--- a/virtualshelves/sendshelf.pl >+++ b/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( >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 5010
:
22945
|
23436
|
23457
|
25877
|
25878
|
25879
|
27049
|
27072
|
27431
|
27432
|
27433
|
27435
|
27436
|
27437
|
27673
|
27779
|
27951
|
27952
|
27953
|
27954
|
31727
|
31728
|
31729
|
31787
|
33726
|
35662
|
35760
|
35833
|
35847
|
35852
|
35853
|
35854
|
36177
|
37695
|
38128
|
38658
|
38659
|
38833
|
38834
|
39008
|
39009
|
39086
|
39087
|
39358
|
39359