@@ -, +, @@ by SocialNetworks syspref - Go to Administration -> Global system preferences -> OPAC -> Features and find the SocialNetworks preference. - If your SocialNetworks preference was enabled, all choices should be selected. Otherwise none should be selected. - If none are selected, select them all and save. - Locate a record in the OPAC and view the details page. - The social network icons should appear as expected and function as before. - Return to system preferences in the staff client and try enabling and disabling different options, verifying each time that the OPAC reflects your choices. --- .../bug_23791-opac-social-network-selection.perl | 14 ++++++++++++++ .../prog/en/modules/admin/preferences/opac.pref | 11 +++++++---- .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 21 +++++++++++++++------ .../opac-tmpl/bootstrap/images/social-sprite.png | Bin 2802 -> 0 bytes 4 files changed, 36 insertions(+), 10 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_23791-opac-social-network-selection.perl delete mode 100644 koha-tmpl/opac-tmpl/bootstrap/images/social-sprite.png --- a/installer/data/mysql/atomicupdate/bug_23791-opac-social-network-selection.perl +++ a/installer/data/mysql/atomicupdate/bug_23791-opac-social-network-selection.perl @@ -0,0 +1,14 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + my ($socialnetworks) = $dbh->selectrow_array( q| + SELECT value FROM systempreferences WHERE variable='socialnetworks'; + |); + if( $socialnetworks ){ + # If the socialnetworks preference is enabled, enable all social networks + $dbh->do("UPDATE systempreferences SET value = 'email,facebook,linkedin,twitter', explanation = 'email|facebook|linkedin|twitter', type = 'multiple' WHERE variable = 'SocialNetworks'"); + } else { + $dbh->do("UPDATE systempreferences SET value = '', explanation = 'email|facebook|linkedin|twitter', type = 'multiple' WHERE variable = 'SocialNetworks'"); + } + SetVersion ($DBversion); + print "Upgrade to $DBversion done (Bug 22880: Move contents of socialnetworks preference to Koha news system)\n"; +} --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -487,11 +487,14 @@ OPAC: class: long - search results in the RSS feed. - + - Show - pref: SocialNetworks - default: 0 - choices: - yes: Enable - no: Disable + multiple: + facebook: Facebook + linkedin: LinkedIn + email: Email + twitter: Twitter + - social network links in opac detail pages - - pref: OpacBrowseResults --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1152,15 +1152,24 @@ [% END %] - [% IF ( SocialNetworks ) %] + [% IF ( Koha.Preference('SocialNetworks') ) %]
Share -
Facebook
-
LinkedIn
-
Email
-
+ [% SET SocialNetworks = Koha.Preference('SocialNetworks') %] + [% FOREACH network IN SocialNetworks.split(",") %] + [% SWITCH network -%] + [% CASE "facebook" -%] +
+ [% CASE "linkedin" -%] +
+ [% CASE "email" -%] +
+ [% CASE "twitter" -%] +
+ [% END -%] + [% END %]
- [% END %] + [% END # /IF SocialNetworks %]