Bugzilla – Attachment 23457 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]
Bug 5010: Fix incomplete links in carts and lists sent from the staff client
Bug-5010-Fix-incomplete-links-in-carts-and-lists-s.patch (text/plain), 6.54 KB, created by
Katrin Fischer
on 2013-12-11 18:42:51 UTC
(
hide
)
Description:
Bug 5010: Fix incomplete links in carts and lists sent from the staff client
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2013-12-11 18:42:51 UTC
Size:
6.54 KB
patch
obsolete
>From 435ba831a0aa9deb1d61a3b51bf4ab4d2804af47 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] 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 >--- > basket/sendbasket.pl | 7 ++++++- > installer/data/mysql/sysprefs.sql | 1 + > installer/data/mysql/updatedatabase.pl | 12 ++++++++++++ > .../prog/en/modules/admin/preferences/opac.pref | 7 +++++++ > .../prog/en/modules/virtualshelves/sendshelf.tt | 2 +- > virtualshelves/sendshelf.pl | 3 ++- > 6 files changed, 29 insertions(+), 3 deletions(-) > >diff --git a/basket/sendbasket.pl b/basket/sendbasket.pl >index 3f57de2..7471ffd 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 6438483..98c5d2d 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -303,6 +303,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 19893b4..88c5a58 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -7825,6 +7825,18 @@ 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"; >+ 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 a75c7ef..23c8466 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 >@@ -434,6 +434,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/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt >index 12e53ee..7a2a90e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt >@@ -35,7 +35,7 @@ Classification: [% BIBLIO_RESULT.classification %][% END %][% IF ( BIBLIO_RESULT > LCCN: [% BIBLIO_RESULT.lccn %][% END %][% IF ( BIBLIO_RESULT.url ) %] > URL : [% BIBLIO_RESULT.url %][% END %][% IF ( OPACBaseURL ) %] > In the online catalog: >- http://[% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber |url %][% END %] >+ [% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber |url %][% END %] > Items : [% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %] > [% ITEM_RESULT.branchname %] [% ITEM_RESULT.location %] [% IF ( ITEM_RESULT.itemcallnumber ) %]([% ITEM_RESULT.itemcallnumber %])[% END %] [% ITEM_RESULT.barcode %][% END %] > >diff --git a/virtualshelves/sendshelf.pl b/virtualshelves/sendshelf.pl >index 37a98ec..f8c46a8 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.8.3.2
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